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 |
|---|---|---|---|---|---|
Coding Best Practices Using DateTime in the .NET Framework
Dan Rogers
Microsoft Corporation
February 2004
Applies to
Microsoft® .NET Framework
Microsoft® ASP.NET Web Services
XML serialization
Summary: Writing programs that store, perform calculations, and serialize time values using the DateTime type in the Microsoft .NET Framework requires an awareness of the different issues associated with time representations available in Windows and .NET. This article focuses on key testing and development scenarios involving time and defines the best practice recommendations for writing programs that use the DateTime type in Microsoft .NET-based applications and assemblies. (18 printed pages)
Contents
Background
What Is a DateTime, Anyway?
The Rules
Storage Strategies
Best Practice #1
Best Practice #2
Performing Calculations
Don't Get Fooled Again
Best Practice #3
Sorting Out DateTime Methods
The Special Case of XML
Best Practice #4
Best Practice #5
The Class Coders Quandary
Best Practice #6
Dealing with Daylight Savings Time
Best Practice #7
Formatting and Parsing User-Ready Values
Future Consideration
Issues with the DateTime.Now() Method
Best Practice #8
A Couple of Little Known Extras
Conclusion
Background
Many programmers encounter assignments that require them to accurately store and process data that contain date and time information. On first glance, the common language runtime (CLR) DateTime data type appears to be perfect for these tasks. It isn't uncommon, however, for programmers, but more likely testers, to encounter cases where a program simply loses track of correct time values. This article focuses on issues associated with logic involving DateTime, and in doing so, uncovers best practices for writing and testing programs that capture, store, retrieve, and transmit DateTime information.
What Is a DateTime, Anyway?. These areas are pointed out later in this article.
So, let's get started by exploring the DateTime type by outlining a series of rules and best practices that can help you get your code functioning correctly the first time around.
The.
- When using the .NET Framework version 1.0 and 1.1, DO NOT send a DateTime value that represents UCT time thru System.XML.Serialization. This goes for Date, Time and DateTime values. For Web services and other forms of serialization to XML involving System.DateTime, always make sure that the value in the DateTime value represents current machine local time. The serializer will properly decode an XML Schema-defined DateTime value that is encoded in GMT (offset value = 0), but it will decode it to the local machine time viewpoint.
-.
Throughout this article, this simple list of rules serves as the basis for a set of best practices for writing and testing applications that process dates.
By now, several of you are already looking through your code and saying, "Oh darn, it's not doing what I expected it to do," which is the purpose of this article. For those of us that haven't had an epiphany from reading this far, let's take a look at the issues associated with processing DateTime values (from now on, I'll just shorten this to "dates") in .NET-based applications.
Storage Strategies
According to the rules above, calculations on date values are only meaningful when you understand the time-zone information associated with the date value you are processing. This means that whether you are storing your value temporarily in a class member variable, or choosing to save the values you have gathered into a database or file, you as the programmer are responsible for applying a strategy that allows the associated time-zone information to be understood at a later time.
Best Practice #1
When coding, store the time-zone information associated with a DateTime type in an adjunct variable.
An alternative, but less reliable, strategy is to make a steadfast rule that your stored dates will always be converted to a particular time-zone, such as GMT, prior to storage. This may seem sensible, and many teams can make it work. However, the lack of an overt signal that says that a particular DateTime column in a table in a database is in a specific time zone invariably leads to mistakes in interpretation in later iterations of a project.
A common strategy seen in an informal survey of different .NET-based applications is the desire to always have dates represented in universal (GMT) time. I say "desire" because this is not always practical. A case in point arises when serializing a class that has a DateTime member variable via a Web service. The reason is that a DateTime value type maps to a XSD:DateTime type (as one would expect), and the XSD type accommodates representing points in time in any time zone. We'll discuss the XML case later. More interestingly, a good percentage of these projects weren't actually achieving their goal, and were storing the date information in the server time zone without realizing it.
In these cases, an interesting fact is that the testers weren't seeing time conversion issues, so nobody had noticed that the code that was supposed to convert the local date information to UCT time was failing. In these specific cases, the data was later serialized via XML and was converted properly because the date information was in machine local time to start with.
Let's look at some code that doesn't work:
The program above takes the value in variable d and saves it to a database, expecting the stored value to represent a UCT view of time. This example recognizes that the Parse method renders the result in local time unless some non-default culture is used as an optional argument to the Parse family of methods.
The previously shown code actually fails to convert the value in the DateTime variable d to universal time in the third line because, as written, the sample violates Rule #4 (the methods on the DateTime class do not convert the underlying value). Note: this code was seen in an actual application that had been tested.
How did it pass? The applications involved were able to successfully compare the stored dates because, during testing, all of the data was coming from machines set to the same time-zone, so Rule #1 was satisfied (all dates being compared and calculated are localized to the same time-zone point of view). The bug in this code is the kind that is hard to spot—a statement that executes but that doesn't do anything (hint: the last statement in the example is a no-op as written).
Best Practice #2
When testing, check to see that stored values represent the point-in-time value you intend in the time zone you intend.
Fixing the code sample is easy:
Since the calculation methods associated with the DateTime value type never impact the underlying value, but instead return the result of the calculation, a program must remember to store the converted value (if this is desired, of course). Next we'll examine how even this seemingly proper calculation can fail to achieve the expected results in certain circumstances involving daylight savings time.
Performing Calculations
On first glance, the calculation functions that come with the System.DateTime class are really useful. Support is provided for adding intervals to time values, performing arithmetic on time values, and even converting .NET time values to the corresponding value-type appropriate for Win32® API calls, as well as OLE Automation calls. A look at the support methods that surround the DateTime type evokes a nostalgic look back at the different ways that MS-DOS® and Windows® have evolved for dealing with time and timestamps over the years.
The fact that all of these components are still present in various parts of the operating system is related to the backwards-compatibility requirements that Microsoft maintains. To a programmer, this means that if you are moving data representing timestamps on files, directories, or doing COM/OLE Interop involving date and DateTime values, you'll have to become proficient at dealing with conversions between the different generations of time that are present in Windows.
Don't Get Fooled Again
Let's suppose you have adopted the "we store everything in UCT time" strategy, presumably to avoid the overhead of having to store a time zone offset (and perhaps a user-eyed view of time zone, such as Pacific Standard Time, or PST). There are several advantages to performing calculations using UCT time. Chief among them is the fact that when represented in universal time, every day has a fixed length, and there are no time-zone offsets to deal with.
If you were surprised reading that a day can have different lengths, be aware that in any time zone that allows for daylight savings time, on two days of the year (typically), days have a different length. So even if you are using a local time value, such as Pacific Standard Time (PST), if you try and add a span of time to a specific DateTime instance value, you may not get the result you thought you should if the interval being added takes you past the change-over time on a date that daylight savings time either starts or ends.
Let's look at an example of code that doesn't work in the Pacific Time zone in the United States:
The result that is displayed from this calculation may seem correct on first glance; however, on October 26, 2003, one minute after 1:59 AM PST, the daylight savings time change took effect. The correct answer should have been 10/26/2003, 02:00:00 AM, so this calculation based on a local time value failed to yield the correct result. But if we look back at Rule #3, we seem to have a contradiction, but we don't. Let's just call it a special case for using the Add/Subtract methods in time zones that celebrate daylight savings time.
Best Practice #3
When coding, be careful if you need to perform DateTime calculations (add/subtract) on values representing time zones that practice daylight savings time. Unexpected calculation errors can result. Instead, convert the local time value to universal time, perform the calculation, and convert back to achieve maximum accuracy.
Fixing this broken code is straightforward:
The easiest way to reliably add spans of time is to convert local-time-based values to universal time, perform the calculations, and then convert the values back.
Sorting Out DateTime Methods
Throughout this article, different System.DateTime class methods are discussed. Some yield a correct result when the underlying instance represents local time, some when they represent Universal time, and others still require no underlying instance at all. Further, some are completely agnostic to time zone (e.g., AddYear, AddMonth). To simplify the overall understanding of the assumptions behind the most commonly encountered DateTime support methods, the following table is provided.
To read the table, consider the starting (input) and ending (returned value) viewpoint. In all cases, the end state of calling a method is returned by the method. No conversion is made to the underlying instance of data. Caveats that describe exceptions or useful guidance are also provided.
The Special Case of XML
Several people I've talked to recently had the design goal of serializing time values over Web services such that the XML that represents the DateTime would be formatted in GMT (e.g., with a zero offset). While I've heard various reasons ranging from the desire to simply parse the field as a text string for display in a client to wanting to preserve the "stored in UCT" assumptions that exist on the server to the callers of Web services, I've not been convinced that there is ever a good reason to control the marshalling format on the wire to this degree. Why? Simply because the XML encoding for a DateTime type is perfectly adequate for representing an instant in time, and the XML serializer that is built into the .NET Framework does a fine job of managing the serialization and deserialization issues associated with time values.
Further, it turns out that forcing the System.XML.Serialization serializer to encode a date value in GMT on the wire is not possible in .NET, at least not today. As a programmer, designer, or project manager, your job then becomes making sure that the data that is being passed in your application is performed accurately with a minimum of cost.
Several of the groups I talked with in the research that went into this paper had adopted the strategy of defining special classes and writing their own XML serializers so that they have full control over what the DateTime values on the wire looked like in their XML. While I admire the pluck that developers have when making the leap into this brave undertaking, rest assured that the nuances of dealing with daylight savings time and time zone conversion issues alone should make a good manager say, "No way," especially when the mechanisms provided in the .NET Framework do a perfectly accurate job of serializing time values already.
There is only one trick you have to be aware of, and as a designer you MUST understand this and adhere to the rule (see Rule #5).
Code that doesn't work:
Let's first define a simple XML class with a DateTime member variable. For completeness, this class is the simplified equivalent of the recommended approach illustrated later in the article.
<XmlType(TypeName:="timeTestDef", _ Namespace:= "")>), _ XmlRoot(), Serializable()> _ End Get Set(ByVal Value As DateTime) __timeVal = Value timeValSpecified = True End Set End Property End Class
Now, let's use this class to write some XML to a file.
' write out to the file Dim t As Xml.XmlTextWriter Dim ser As XmlSerializer Dim tt As New timeTest ' a class that has a DateTime variable ' set the fields in your class tt.timeVal = DateTime.Parse("12/12/2003 12:01:02 PM") tt.timeVal = tt.TimeVal.ToUniversalTime() ' get a serializer for the root type, and serialize this UTC time ser = New XmlSerializer(GetType(timeTest)) t = New Xml.XmlTextWriter("c:\timetest.xml", System.Text.Encoding.UTF8) ser.Serialize(t, tt) t.Close() t = Nothing tt = Nothing
When this code runs, the XML that is serialized to the output file contains an XML DateTime representation as follows:
This is an error: the value encoded in the XML is off by eight hours! Since this happens to be the time zone offset of my current machine, we should be suspicious. Looking at the XML itself, the date is right, and the 20:01:02 date corresponds to the clock time in London for my own noontime, but the offset portion is not correct for a London-based clock. When the XML looks like the London time, the offset should also represent the London viewpoint, which this code doesn't achieve.
The XML serializer always assumes that DateTime values being serialized represent local machine time, so it applies the machine local time zone offset as the offset portion of the encoded XML time. When we deserialize this onto another machine, the original offset is subtracted from the value being parsed, and the current machine's time-zone offset is added.
When we start with a local time, the result of serialization (encode to XML DateTime followed by decode to local machine time) is always correct—but only if the starting DateTime value being serialized represents local time when serialization begins. In the case of this broken code example, we had already adjusted the DateTime value in the timeVal member variable to UCT time, so when we serialize and deserialize, the result is off by the number of hours equal to the time-zone offset of the originating machine. This is bad.
Best Practice #4
When testing, calculate the value you expect to see in the XML string that is serialized using a machine local time view of the point in time being tested. If the XML in the serialization stream differs, log a bug!
Fixing this code is simple. Comment out the line that calls ToUniversalTime().
Best Practice #5
When writing code to serialize classes that have DateTime member variables, the values must represent local time. If they do not contain local time, adjust them prior to any serialization step, including passing or returning types that contain DateTime values in Web services.
The Class Coders Quandary
Earlier we looked at a pretty unsophisticated class that exposed a DateTime property. In that class, we simply serialized what we stored in a DateTime, without regard to whether the value represented a local or universal time viewpoint. Let's look at a more sophisticated approach that offers programmers an overt choice as to what time-zone assumptions they desire, while always serializing properly.
When coding a class that will have a member variable of type DateTime, a programmer has a choice of making the member variable public or writing the property logic to wrap the member variable with get/set operations. Choosing to make the type public has several disadvantages that, in the case of DateTime types, can have consequences that are not under the class developer's control.
Using what we learned so far, consider instead providing two properties for each DateTime type.
The following example illustrates the recommended approach to managing DateTime member variables:
<XmlType(TypeName:="timeTestDef", _ Namespace:= "")>), _ XmlRoot(), Serializable(), _ EditorBrowsable(EditorBrowsableState.Advanced)> _.ToLocalTime() End Get Set(ByVal Value As DateTime) __timeVal = Value.ToUniversalTime() timeValSpecified = True End Set End Property <XmlIgnore()> _ Public Property timeValUTC() As DateTime Get timeValUTC = __timeVal End Get Set(ByVal Value As DateTime) __timeVal = Value timeValSpecified = True End Set End Property End Class
This example is the corrected equivalent to the prior class serialization example. In both class examples (this one and the earlier one), the classes are implementations that are described with the following schema:
<?xml version="1.0" encoding="utf-8" ?> <xs:schema <xs:element <xs:complexType <xs:sequence> <xs:element </xs:sequence> </xs:complexType> </xs:schema>
In this schema, and in any class implementations, we define a member variable that represents an optional time value. In our recommended example, we have provided two properties with both getters and setters—one for the universal time and one for local time. The angle-bracketed attributes that you see in the code tell the XML serializer to use the local time version for serialization, and generally make the class implementation result in schema-compliant output. To make the class properly deal with the optional lack of expression when no value is set in the instance, the timeValSpecified variable and associated logic in the property setter controls whether the XML element is expressed at serialization time or not. This optional behavior exploits a feature in the serialization subsystem that was designed to support optional XML content.
Using this approach to managing DateTime values in your .NET classes gives you the best of both worlds—you get storage access based on universal time so that calculations are accurate, and you get proper serialization of local time views.
Best Practice #6
When coding, make DateTime member variables private and provide two properties for manipulating your DateTime members in either local or universal time. Bias the storage in the private member as UCT time by controlling the logic in your getters and setters. Add the XML serialization attributes to the local time property declaration to make sure that the local time value is what is serialized (see example).
Caveats to this approach
The recommended approach of managing a DateTime in Universal time within your private member variables is sound, as is the recommendation to provide dual properties to allow coders to deal with the versions of time that they are most comfortable with. One issue that a developer using this or any other approach that exposes any local time to a program continues to be the 25-hour-day issue around daylight savings time. This will continue to be an issue for programs that use CLR version 1.0 and 1.1, so you have to be aware as to whether your program falls into this special case (the added or missing hour for the time being represented), and adjust manually. For those who cannot tolerate a one-hour per year issue window, the current recommendation is to store your dates as strings or some other self-managed approach. (Unix long integers are a good option.)
For CLR version 2.0 (available in the upcoming release of Visual Studio® code-named "Whidbey"), awareness of whether a DateTime contains a local time or a universal time value is being added to the .NET Framework. At that point, the recommended pattern will continue to work, but for programs that interact with member variables via the UTC properties, these errors in the missing/extra hour period will be eliminated. For this reason, the best practice for coding using dual properties is strongly suggested today, so that your programs will migrate cleanly to CLR version 2.0.
Dealing with Daylight Savings Time
As we prepare to close and leave the topic of coding and testing practices for DateTime values, there remains one special case that you need to understand. This case involves the ambiguities that surround daylight saving time and the repeated one-hour per year issue. This issue is primarily one that only affects applications that collect time values from user input.
For those of you in the country-count majority, this case is trivial because in most countries daylight savings time is not practiced. But for those of you who are in the affected programs majority (that is, all of you who have applications that need to deal with time that may be represented in or sourced in places that DO practice daylight savings), you have to know this problem exists and account for it.
In areas of the world that practice daylight savings time, there is one hour each fall and spring where time seemingly goes haywire. On the night that the clock time shifts from standard time to daylight time, the time jumps ahead an hour. This occurs in the spring. In the fall of the year, on one night, the local time clock jumps back an hour.
On these days, you can encounter conditions where the day is 23 or 25 hours in length. So if you are adding or subtracting spans of time from date values and the span crosses this strange point in time where the clocks switch, your code needs to make a manual adjustment.
For logic that is using the DateTime.Parse() method to calculate a DateTime value based on user input of a specific date and time, you need to detect that certain values are not valid (on the 23-hour day), and certain values have two meanings because a particular hour repeats (on the 25-hour day). To do this, you need to know the dates involved and look for these hours. It may be useful to parse and redisplay the interpreted date information as the user exits the fields used to enter dates. As a rule, avoid having users specify daylight savings time in their input.
We've already covered the best practice for time-span calculations. By converting your local time views to universal time prior to performing your calculations, you get past the issues of time accuracy. The harder-to-manage case is the ambiguity case associated with parsing user input that occurs during this magical hour in the spring and fall.
Presently there is no way to parse a string that represents a user's view of time and have it accurately assigned a universal time value. The reason is that people who experience daylight savings time don't live in places where the time zone is Greenwich Mean Time. Thus, it is entirely possible that someone living on the east coast of the United States types in a value like "Oct 26, 2003 01:10:00 AM".
On this particular morning, at 2:00 AM, the local clock is reset to 1:00 AM, creating a 25-hour day. Since all values of clock time between 1:00 AM and 2:00 AM occur twice on that particular morning—at least in most of the United states and Canada. The computer really has no way to know which 1:10 AM was meant—the one that occurs prior to the switch, or the one that occurs 10 minutes after the daylight savings time switch.
Similarly, your programs have to deal with the problem that happens in the springtime when, on a particular morning, there is no such time as 2:10 AM. The reason is that at 2:00 on that particular morning, the time on local clocks suddenly changes to 3:00 AM. The entire 2:00 hour never happens on this 23-hour day.
Your programs have to deal with these cases, possibly by prompting the user when you detect the ambiguity. If you aren't collecting date-time strings from users and parsing them, then you probably don't have these issues. Programs that need to determine whether a particular time falls in daylight savings time can make use of the following:
Timezone.CurrentTimeZone.IsDaylightSavingTime(DateTimeInstance)
or
DateTimeInstance.IsDaylightSavingTime
Best Practice #7
When testing, if your programs accept user input specifying date and time values, be sure to test for data loss on "spring-ahead", "fall-back" 23- and 25-hour days. Also make sure to test for dates gathered on a machine in one time zone and stored on a machine in another time zone.
Formatting and Parsing User-Ready Values
For programs that do take date and time information from users and need to convert this user input into DateTime values, the Framework provides support for parsing strings that are formatted in specific ways. In general, the DateTime.Parse and ParseExact methods are useful for converting strings that contain dates and times into DateTime values. Conversely, the methods ToString, ToLongDateString, ToLongTimeString, ToShortDateString, and ToShortTimeString are all useful for rendering DateTime values into human-readable strings.
Two main issues that affect parsing are culture and format string. The DateTime Frequently Asked Questions (FAQ) covers the basic issues around culture, so here we'll focus on the format string best practices that affect DateTime parsing.
The recommended format strings for converting DateTime to strings are:
'yyyy'-'MM'-'dd'T'HH': 'mm': 'ss.fffffff'Z' —For UCT values
'yyyy'-'MM'-'dd'T'HH': 'mm': 'ss.fffffff'zzz' —For local values
'yyyy'-'MM'-'dd'T'HH': 'mm': 'ss.fffffff' —For abstract time values
These are the format string values that would be passed to the DateTime.ToString method if you want to get output that is compatible with the XML DateTime type specification. The quotes insure that the local date-time settings on the machine don't override your formatting options. If you need to specify different layouts, you can pass other format strings for a fairly flexible date rendering capability, but you need to be careful to only use the Z notation to render strings from UCT values, and use the zzz notation for local time values.
Parsing strings and converting them to DateTime values can be accomplished with the DateTime.Parse and ParseExact methods. For most of us, Parse is sufficient since ParseExact requires you to provide your own Formatter object instance. Parse is pretty capable and flexible, and can accurately convert most strings that contain dates and times.
Finally, it is important to always call the Parse and ToString methods only after setting the thread's CultureInfo to CultureInfo.InvariantCulture.
Future Consideration
One thing you can't do easily at present with DateTime.ToString is format a DateTime value into an arbitrary time zone. This feature is being considered for future implementations of the .NET Framework. If you need to be able to determine that the string "12:00:00 EST" is equivalent to "11:00:00 EDT", you will have to handle the conversion and comparison yourself.
Issues with the DateTime.Now() Method
There are several issues when dealing with the method named Now. For the Visual Basic developers reading this, this applies to the Visual Basic Now function, as well. Developers who regularly use the Now method know that it is commonly used to get the current time. The value returned by the Now method is in the current machine time-zone context, and cannot be treated as an immutable value. A common practice is to convert times that are going to be stored or sent between machines into Universal (UCT) time.
When daylight savings time is a possibility, there is one coding practice that you should avoid. Consider the following code that can introduce a hard-to-detect bug:
The value that results from running this code will be off by an hour if called during the extra hour that occurs during the daylight savings time switch in the fall. (This only applies to machines that are in time-zones that practice daylight savings time.) Because the extra hour falls into that place where the same value, such as 1:10:00 AM, occurs twice on that morning, the value returned may not match the value you wanted.
To fix this, a best practice is to call DateTime.UtcNow() instead of calling DateTime.Now, and then converting to universal time.
This code will always have the proper 24-hour-day perspective, and may then be safely converted to local time.
Best Practice #8
When you are coding and desire to store current time represented as universal time, avoid calling DateTime.Now() followed by a conversion to universal time. Instead, call the DateTime.UtcNow function directly.
Caveat: If you are going to serialize a class that contains a DateTime value, be sure that the value being serialized does not represent Universal time. XML serialization will not support UCT serialization until the Whidbey release of Visual Studio.
A Couple of Little Known Extras
Sometimes when you start diving into a part of an API you find a hidden gem—something that helps you achieve a goal, but which, if you aren't told about it, you don't uncover in your day-to-day travels. The DateTime value type in .NET has several such gems that may help you achieve more consistent use of universal time.
The first is the DateTimeStyles enumeration that is found in the System.Globalization namespace. The enumeration controls behaviors of the DateTime.Parse() and ParseExact functions that are used to convert user-specified input and other forms of input string representations to DateTime values.
The following table highlights some of the features that the DateTimeStyles enumeration enables.
Other interesting support functions are found in the System.Timezone class. Be sure to check those out if you want to detect whether daylight savings time will affect a DateTime value, or if you want to programmatically determine the current time zone offset for the local machine.
Conclusion
The .NET Framework DateTime class provides a full-featured interface for writing programs that deal with time. Understanding the nuances of dealing with the class goes beyond what you can glean from Intellisense®. Here we covered the best practices for coding and testing programs that deal with dates and time. Happy coding! | https://msdn.microsoft.com/en-us/library/ms973825.aspx | CC-MAIN-2018-51 | refinedweb | 5,217 | 50.06 |
| Join
Last post 05-07-2008 6:46 AM by salsam. 3 replies.
Sort Posts:
Oldest to newest
Newest to oldest
I have form authentication in my application which has cookie timeout set to 20 minutes. Cookie is being removed after 20 minutes of user's innactivity. I also have some data stored in session which has timeout set also to 20 minutes.
If I set cookie timeout to less than session everything works fine and user is redirected to login page. But if session expires before cookie, which is most likely, all data gets lost.
I tried to force form authentication logout at session end in global.asax but it doesn't work. I used this code in global.asax:
FormsAuthentication.SignOut()FormsAuthentication.RedirectToLoginPage()
Am I doing this right or is there any other better way to handle this.Thanks
Hello my friend,
The code seems right but it is in the wrong place. Within your page code, check if a session variable exists. If not, use the 2 lines above to kick the user out. Something like the following: -
if
{
}
If you need to do this on multiple web pages, create a new class called CustomBasePage like the following: -
using System;
using
///
public
Now for any web page where you need to make this check, change it so that it inherits from this new class instead of System.Web.UI.Page
For example: -
Hope this does the trick my friend
Kind regards
Scotty
I'm having similar problem, and still thinking about some good solutions. first of all let me explain the problem
I'm using Form Authentication in our web application and also using session to save user specific data. problem started when we came to know that session are lossing data if user is being idle for more than session timeout. session timeout set to 60 mins and same is the timeout for Form Authentication. see below.
<sessionState timeout="60" mode="InProc" cookieless="false"/> <authentication mode="Forms"> <forms loginUrl="Pages/Login.aspx" defaultUrl=".\Pages\Default.aspx" timeout ="60" slidingExpiration ="true"> </forms> </authentication>
Now the problem is Event viewer is having too many events logged when page is left idle for more than 60 mins and then user try to make any request. it is automatically redirected to login page which is corrected this is how it should work. but at the same time it log (see below.)
vent code: 4005
Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.
Event time: 07/05/2008 10:49:07
Event time (UTC): 07/05/2008 09:49:07
Event ID: ad3cc19382b14007bf8a79ec51d47c66
Event sequence: 4
Event occurrence: 1
Event detail code: 50202
Now here is my understand about above flow. when session and Form Authentication is timeout (it is timing out at the same time in my case.) and when user make any request. Forms Authentication came in to check the validity of the issued ticket. and find it expired and redirect to login. at the same time it create new session. (creating a new session if one already timeout is a buildin feature of IIS.) Now possiablities are:
-- when new session is being created it obiously not have same data which previous session was holding. and user is not redirected to login page some how, and continue to next page with new session that give the effect of session data lost. or may there is someother reason. For this problem I have already put in the code in Global.asax in AcquireRequestState event, which checks every request and session state if user is Authenticated and Session is newly created just forced the user to login page to get all his user specific data again. this will solve my problem of data lost during the user session hopefully.
But my other problem is that event is still being logged in the event log. Beacuse Form Authentication ticket validation is check before session state is being established for the request.
So can some suggest me any good place where i can check my session expiry before Form Authentication ticket validation.
Advertise |
Ads by BanManPro |
Running IIS7
Trademarks |
Privacy Statement
© 2009 Microsoft Corporation. | http://forums.asp.net/p/1060101/2342687.aspx | crawl-002 | refinedweb | 697 | 63.59 |
NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Digital Caliper and DRO Schematic
Hi all,
I'm having fun with the Nerdkit. Built everything so far but I'm having a bit of a problem with the digital caliper and DRO project. I was wondering if Mike or Humberto could take a look at the schematic I put together. It's actually Mikes work, I just put it all on one diagram.
It's been many years since I bread boarded anything and I had some conflicts with the MOSFET diagram. I was hoping you could take a peek and see if I had everything right or any suggestions. I didn't hookup the direction or zero switch so I did't draw them on the schematic.
I wired everything and doubled and trippled checked all connections and supply voltage but nothing comes up on the DRO. I'm using the same style digital caliper that was used in the demo. I tryed USB power and seperate power for each but to no avail. I did not change anything in Mikes caliper code. Like all the other projects, I just expected to see it come alive.
Here is the link to ImageShack file of the schematic.
BTW. Thanks to Humberto and Mike for the great kit. I'm looking forward to learning a lot from all of you guys.
I'll talk about a nother problem in the next post.
Gary
Hi Linkster,
I don't see anything obviously wrong in your diagram. Are you sure the calipers are actually outputting data? Do you have an oscilloscope around so you can verify data is really coming out of the calipers and it is following the same protocol as the calipers we are using.
Humberto
One thing I noticed in your schematic was that you don't have the AVcc line of the micro-controller connected to Vcc. I know according to the datasheet this should be connected whether or not the ADC is used. I have read somewhere... just can't place it right now that it also helps power some of the pins on that side of the chip. This may or may not make a difference, but it could be worth a shot.
Rick
Humberto,
I have an antique single channel buried in the shop. I'll dig it out and see what I can find as far as a signal for the caliper. I did use a logic probe to see if I had pulse output from both the data and clock.
I think Rick might of hit on the problem. I did not have AVCC tied to +5v as per the data sheet for the ATmega168. I'm not sure if that is it but I will give it a try. However, I did try running the signals without the MOSFETS but had no results. Let me solve the new problem with the verification error and then I can get back to the caliper/DRO project.
Thanks Humberto and Rick.
Gary
Hi Gary,
One thing I'd do is just swap the clock and data lines -- I've found it's quite easy to get them mixed up, so whenever my caliper-based circuits aren't working, just try it the other way around and see what happens.
Another thing to try is to write a few lines of code so that the microcontroller copies whatever it sees on those two lines onto another set of two pins, so that you can use an LED to see whether you are getting anything at all.
When you used your logic probe, did you see any activity at all? Were you probing directly at the output of the calipers, or were you looking at the output of the inverter/level-shifter circuits?
Mike
Hi all,
Well, I spent a tremendous amount of time trying to get the DRO Caliper project up and running but still no luck. I re-read the entire article and tried to comprehend every part of the code. So I have a few questions regarding some lines of the code in Mikes DRO project.
First let me say that the calipers are very similar to the one that Mike used in his project. Here is what could be of some differences.
Some tests that I conducted proved that I can not put the calipers in high speed nor can I zero the calipers from the data and clock output pins.
When I placed a logic probe on the data and clock pins, I do get a pulsing signal on both. I then checked the collector of both 2N3904 transistors and they also have pulsing signals. I attempted to check the output voltages of the data and clock signals and the result with a DVM is they are both +1.94dc. My supply voltage to the calipers is 2vdc.
With an old BK 1460 oscilloscope and the help of a Global Specialties 8001 Multiplexer I was able to look at both data and clock signals. At the caliper pins I have approximately +1.5vdc with each pulse of the nibbles dropping to 0vdc. This is the case for both Data and Clock signals.
At the collector of each transistor I am seeing approximately +4vdc with the pulse only dropping to +3vdc. I’m thinking this is the problem. I’m only getting a 1 volt drop on my collector when I believe the transistor should be pulling the voltage down to 0vdc for the MCU to be able to detect the pulses. If I force the transistor to change state, the transistor inverts the signal to 0vdc and the pulse goes to almost +5vdc. Again, this is the case for both data and clock signals. (I hope this made since.)
Looking closer at the relationship of the signals I see that the Data and clock signals are 6 nibbles each with 4 bits. I can see the changes in the bits when I move the calipers along the scale. The clock signals are always consistent.
Because it is an old scope I can not make out much more than the voltages. There seems to be a problem with the stability settings and perhaps calibration of the overall unit. But at least I can verify the clock and data pins of the calipers.
As for Mike’s suggestion in writing a couple lines of code to see what the pins are doing, I tried but I’m not sure what to write. I wrote a couple lines to turn on a couple LED’s if a signal is present on the pins. It sometimes seems to work if I force the signal with a jumper but is not always the case. The calipers don’t have any effect at all. So any help on some lines of code for this part would help a lot. Basically I did the same to write to the LCD. Again any help?
I removed the mosfets from the board and from the code along with the switch direction button and its code. I think keeping it simple first may be the way to start. Besides, like I said earlier, I don’t think I have Zeroing capabilities on the calipers so I shouldn’t need them.
I included the revised code for you to look at. Please go easy on me. I’m old and still trying to keep the gears going.
Here are a couple code questions that I can’t seem to find info on.
What does "break;" do? Is it the same as pause?
What are the two ++ after the i used for? "for(i=0; i<24; i++)" or, how would you explain this line?
What is the part in parenthesis? "return (1L<<30);"
Thank you kindly,
Gary
// calipersrev.c
// for NerdKits with ATmega168
:
//
// PB1 -- (inverted) data
// PB2 -- (inverted) clock
// PB3 -- power to calipers
// PC5 -- yellow LED
// PC4 -- red LED
void calipers_power_on() {
PORTB |= (1<<PB3);
DDRB |= (1<<PB3);
}
uint8_t read_bit() {
// wait for rising edge of /CLK
// then sample /DATA
// return 0 for true 0 (high voltage on /DATA)
// return 1 for true 1 (low voltage on /DATA)
// return 2 for timeout error
uint8_t attempt_counter=200 ;
// at 14.7456 MHz and 8 clocks/loop, 200 takes 108us.
while(--attempt_counter) {
if((PINB & (1<<PB2)) != 0) {
// we got rising edge
break;
}
}
if(attempt_counter==0)
return 2; // timeout error
//sample a bunch of times and take the best guess
uint8_t samples = 5;
uint8_t samples_0 = 0;
uint8_t samples_1 = 0;
uint8_t i;
for(i=0; i<samples; i++) {
if((PINB & (1<<PB1)) != 0) {
samples_0++;
} else {
samples_1++;
}
}
if(samples_0 > samples_1) {
return 0;
} else {
return 1;
}
}
int32_t read_bits() {
// read 24 bits
// LSB first
// return in a signed int32_t
uint32_t accumulator = 0;
uint32_t bitval = 1;
uint8_t rb;
uint8_t i;
for(i=0; i<24; i++) {
rb = read_bit();
if(rb==2) {
// TIMEOUT
return (1L<<30);
} else if(rb==1) {
accumulator |= bitval;
}
bitval <<= 1;
}
// handle negatives
if(rb == 1) {
// the MSB was 1 so we've got a negative number!
// fill the upper 8-bits of the 32-bit
accumulator |= 0xFF000000L;
}
return accumulator;
}
void wait_for_quiet() {
// get at least 50us of high on /CLK
// before returning.
// not really microseconds -- close enough!
uint8_t quiet_us = 0;
while(quiet_us++ < 50) {
if((PINB & (1<<PB2)) == 0) {
// /CLK is low -- not quiet!
quiet_us = 0;
}
}
// we made it through 50!
return;
}
void wait_for_pulse() {
// get at least 50us of high on /CLK
wait_for_quiet();
// then wait for a falling edge
while((PINB & (1<<PB2)) != 0) {
// do nothing
}
}
int main() {
// activate pull-ups
PORTB |= (1<<PB1) | (1<<PB2) | (1<<PB4) | (1<<PB5);
// turn on calipers
calipers_power_on();
delay_ms(2000);
// init serial port
uart_init();
FILE uart_stream = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW);
stdin = stdout = &uart_stream;
// lcd
lcd_init();
FILE lcd_stream = FDEV_SETUP_STREAM(lcd_putchar, 0, _FDEV_SETUP_WRITE);
lcd_clear_and_home();
int32_t lastpos, tmpr, refpos = 0;
double lastpos_inches, lastpos_mm;
while(1) {
wait_for_pulse();
tmpr = read_bits();
if(tmpr != (1L<<30)) {
// This is where I started with some code for the pins. don't luagh.
// check for signal on PB1 & PB2
// signal from caliper is inverted thru the 3904.
// PB1 & PB2 is low (0 volts) for true.
uint8_t signal_1;
uint8_t signal_2;
// LED as outputs
DDRC |= (1<<PC4) |(1<<PC5);
// Turn on PC4 red LED if signal is detected on PB1.
signal_1 = ((PINB & (1<<PB1))==0) ? 1 : 0;
if((PINB & (1<<PB1)) ==0 ){
PORTC &= ~(1<<PC4);
}
else {
PORTC |= (1<<PC4);
}
// Turn on PC5 yellow LED if signal is detected on PB2.
signal_2 = ((PINB & (1<<PB2))==0) ? 1 : 0;
if((PINB & (1<<PB2)) == 0){
PORTC &= ~(1<<PC5);
}
else {
PORTC |= (1<<PC5);
}
// calculate position
lastpos = tmpr - refpos;
lastpos = -lastpos;
// translate into inches and mm
lastpos_inches = lastpos / 20480.0;
lastpos_mm = lastpos * (25.4 / 20480.0);
// send over serial port
printf_P(PSTR("%8ld\t%10.5f\r\n"), lastpos, lastpos_inches);
// show on LCD
lcd_line_one();
fprintf_P(&lcd_stream, PSTR(" Caliper Project "));
lcd_line_two();
fprintf_P(&lcd_stream, PSTR("%9.4f inches "), lastpos_inches);
lcd_line_three();
if((signal_1)==1)
{
fprintf_P(&lcd_stream, PSTR("Signal 1 red YES "));
} else {
fprintf_P(&lcd_stream, PSTR("Signal 1 red No "));
lcd_line_four();
if((signal_2)==1)
{
fprintf_P(&lcd_stream, PSTR("Signal 2 yellow YES"));
} else {
fprintf_P(&lcd_stream, PSTR("Signal 2 yellow No "));
}
}
}
}
return 0;
}
Unless you are in your high eighties you are not considered old around here. Some like myself are suffering from the "AGE Virus" but definitely not considered "old".
Therefore we will show no mercy.
Well actually you will find us, like my wife, a very tolerant sort.
re: "I can’t seem to find info on.
What does "break;" do? Is it the same as pause?
while(--attempt_counter) {
if((PINB & (1<<PB2)) != 0) {
// we got rising edge
break;
}
}
Break literally "breaks" the flow of the while loop, i.e. it ends the loop. Guess what "pause" would do.
-----------------------------------------------------------------
What are the two ++ after the i used for? "for(i=0; i<24; i++)" or, how would you explain this line?
for(i=0; i<24; i++) {
rb = read_bit();
if(rb==2) {
// TIMEOUT
return (1L<<30);
} else if(rb==1) {
accumulator |= bitval;
}
bitval <<= 1;
}
Think of i as in "increment", you are in a for loop and gone through all of the steps in that loop once now
you want to do it 23 more times. The i keeps track of where you are in the loop, how many iterations you
have completed.
-------------------------------------------------------------------
What is the part in parenthesis? "return (1L<<30);"
if(rb==2) {
// TIMEOUT
return (1L<<30);
The valve to be "returned" to the procedure that preceded or called the if statement.
In this case I believe it becomes read_bits(1L<<30).
----------------------------------------------------------------------------
Hopefully someone with actual C programing knowledge will clarify/correct all of this further.
You need to Google " C break", "C loops" and "C Increment and Decrement Operators (++, --)"
Ralph
Thanks Ralph,
I've been reprieved from going to the old age home. For now anyways.
So, is the (1L<<30) have something to do with a register? I might need to look again at the spec sheet.
I think I understand the "break;" from what I gather it lets the while statement loop untill it fullfills it's requirements. In this case loop untill ((PINB & (1<<PB2)) != 0).
Another words not equal to 0 so it must be a 1 which would be a rising edge and then continue on to the next part of the code.
Am I close??
Thanks for the google tip.
Gary
For mrobbins.
Mike,
Could you give me a little info on how this line of code works for the DRO project? accumulator |= 0xFF000000L; it's the 0xFF000000L part I'm lost on.
I guess I'm also lost on return (1L<<30); the (1L<<30) part of the code. It's used in a couple places.
I difinitely know that I have output from the calipers. I know which is clock and Data. The inverter/level-shifter circuits do have output and are inverted. Data bit pulses are all high when all zeros. I can see the bits go low when I move the caliper. The clock is 6 nibbles each 4 bits. Each of these bits are always high.
It's hard with my old scope to guage the voltages or frequencies. If we even need to know the frequency. But, I'm sure we do.
I removed the MOSFETs and associated code so I could just concentrate on the actual signals. Not sure if calipers have high-speed. I might have to look for a nother calper if this one does not work.
Hate to bother you with this project but it was the sole reason for the kit.
Thanks for any help you can give.
Do I need to start a new topic pertaining to this part of the DRO project?
Gary
Please log in to post a reply. | http://www.nerdkits.com/forum/thread/1280/ | CC-MAIN-2020-40 | refinedweb | 2,452 | 82.04 |
import processing.serial.*; Serial myPort; // Create object from Serial class int val; // Data received from the serial port void()[1]; println(Serial.list()); myPort = new Serial(this, portName, 9600); } void draw() { if ( myPort.available() > 0) { // If data is available, val = myPort.read(); // read it and store it in val print((char) val); } }
void setup() { Serial.begin(9600); // Start serial communication at 9600 bps while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } } void loop() { delay(1000); Serial.print("hoila "); // send to Processing delay(1000); Serial.print("hoibo "); // send to Processing }
Yeah, I even did a Hot Fix to update the usbser.sys... no change. I am curious on how cantore got it to output in another terminal program. I tried teraserv and hyperterm...no joy. cantore has success w/ Win7 and I did with Vista.
Is the Processing machine an WinXP?I have the same issue on serial on a WinXP but not on Vista Machine (Have not tested Win7).
I am trying to send from arduino Leonardo
to Visual Studio
and I can't get it to work.
String portName = Serial.list()[1]; println(Serial.list()); myPort = new Serial(this, portName, 9600);
myPort = new Serial(this, "COMx", 9600);
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
Thank you for subscribing!
Arduino
via Egeo 16
Torino, 10131
Italy | http://forum.arduino.cc/index.php?topic=119471.0 | CC-MAIN-2016-07 | refinedweb | 237 | 60.21 |
Other ways to convert Markdown/HTML to PDF in iOS
I've been experimenting with workflows to convert Markdown/HTML to PDF, using a CSS and wanting to set page breaks. Here's what I found:
Using a cloud service - Docverter
The free services usually have limited features, though Docverter seemed promising. I wrote a workflow to use It, based on Caleb McDaniel's Pythonista script here. Docverter supports @page, page breaks, page-break-after:avoid (to keep headings on the same page as the following paragraph) and links in a displayed PDF are live.
Sadly it always lost the last few sentences I sent it, and my Python/internet skills are not good enough to find where the problem is. I found other problems:
- Caleb's script sent the CSS and markdown as two files, but I found this was not reliable. I converted to HTML, with a CSS, so I only needed to send one file. even so, it occasionally failed.
- There are only a couple of fonts available, presumably for copyright reasons, though you can use @fontface to send other font files.
- I couldn't see how to hyphenate, so either the right margin is very ragged, or you justify it and get terrible gaps in the text.
- It doesn't handle images wider that the print area well (does not scale down properly)
Using an iOS HTML converter app
There are many apps to convert HTML to PDF. The support seems to be for CSS2.1, so you can' t use @page but you can use page breaks. Unfortunately all apps seem to have a bug with page-break-before:always and most have a bug with page-break-before:always (insert two page breaks), so most aren't suitable. I used:
- PDF-Converter (Readdle) as described here (in the webbrowser.open, change rhttp to pdfhttp). The top and bottom margins are a bit small for a printed page. And since iOS 7, this only gives me US paper size, which I don't want. I think it is arrogant of a developer not to allow for A4 paper as well.
- PDF This Page (Julian Yap) This is what I use now. The top and bottom margins are better, and you can select US or A4 pages. My workflow for this is here:
Neither of these apps let you add a header or footer, or set the top and bottom margins and you can't hyphenate. Page-break-after:avoid doesn't work and links in a displayed PDF are not live. Images do work well.
So, I'm still looking for the perfect app for this.
I installed xhtml2pdf (together with reportlab-2.7, pyPdf-1.13, html5lib) in Editorial.
Here is the python script I used to install everything (I have a directory 'scripts' that contains all python stuff):
<pre>
import urllib
import tarfile
from zipfile import ZipFile
import shutil
import console
import os
import editor
from os.path import expanduser
os.chdir(expanduser('~/Documents/'))
url = ''
fname='reportlab-2.7'
sname='src/reportlab'
dname='scripts/reportlab'='pyPdf-1.13'
sname='pyPdf'
dname='scripts/pyPdf'='html5lib-python-master'
sname='html5lib'
dname='scripts/html5lib'='xhtml2pdf-master'
sname='xhtml2pdf'
dname='scripts/xhtml2pdf'='scripts/xhtml2pdf/fonts/pfbfer-20070710'
sname='pfbfer-20070710'
dname='scripts/xhtml2pdf/fonts'
if os.path.isdir(dname):
shutil.rmtree(dname)
os.mkdir(dname)
print 'Downloading '+sname+'...'
urllib.urlretrieve(url, fname+'.zip')
print 'Extracting...'
dr=os.getcwd()
os.chdir(dname)
with ZipFile(sname+'.zip', 'r') as z:
z.extractall()
os.chdir(dr)
print 'Cleaning up...'
os.remove(fname+'.zip')
editor.reload_files()
print 'Done'
</pre>
Then the workflow contains a 'Document Text' step, followed by a 'Convert Markdown to HTML' step, followed by the following 'Run Python Script' step:
<pre>
#coding: utf-8
import sys
from os.path import expanduser
if not(expanduser('~/Documents/scripts') in sys.path):
sys.path.append(expanduser('~/Documents/scripts'))
import workflow
import os.path
import editor
import xhtml2pdf.pisa as pisa
import StringIO
from urllib import unquote
pisa.showLogging()
def link_callback(uri,rel):
if not(uri.startswith('/')):
return dir+'/'+unquote(uri)
return unquote(uri)
action_in = workflow.get_input()
pre='<html>\n<head>\n<meta charset="utf-8"/>\n<style>\n p {font-size:12pt}\n</style>\n</head>\n\n<body>\n'
post='\n</body>\n</html>'
inp=StringIO.StringIO(pre+action_in.encode('ascii', 'xmlcharrefreplace')+post)
p = editor.get_path()
dir = os.path.split(p)[0]
f = os.path.split(p)[1]
fn= os.path.splitext(f)[0]
fl = file(dir+'/'+fn+".pdf", "w+b")
print('processing '+p)
pdf = pisa.CreatePDF(inp,fl,dir,link_callback=link_callback)
fl.close()
if pdf.err!=0:
print(pdf.err)
else:
print('done!')
</pre>
Thanks for posting that.
@hvmhvm Thanks for sharing! Btw, Pythonista already includes html5lib, so it shouldn't be necessary to install that.
To round this thread off, here's a workflow to convert markdown to PDFs via LaTeX and the iOS app Texpad:
It works really well, is fast, and creates beautiful PDFs. You can type LaTeX commands in the Markdown, so you can do real tables, equations and all the rest.
- phillipsmn
I made a workflow public that lets you convert your markdown document to pdf and saves it in your dropbox directory. You can download it from here in Editorial.
- jackadision
If you are a normal user or unable to execute any manual method then use any converter tool because this types of tool is very easy to operate and also able to give you good output. Free download this tool from
@hvmhvm: Whoa, quite an eye-opener. I had no idea you could install scripts and run in such a manner.
Anyway I managed to actually get these all installed and a conversion success message...Done!
Although the resulting pdf contains only the title of my md file, not the content. Any ideas?
Also, your Workflow was failing on me initially, protesting that xhtml2PDF was looking for PyPDF2 when in fact your dependencies install script installs the older PyPDF 1.1.3. I got it working after changing that portion to:
url = '' fname='PyPDF2-master' sname='PyPDF2' dname='scripts/PyPDF2' print 'Downloading '+dname+'...' urllib.urlretrieve(url, fname+'.zip') print 'Extracting...' with ZipFile(fname+'.zip', 'r') as z: z.extractall() if os.path.isdir(dame): shutil.rmtree(dname) shutil.move(fname+'/'+sname, dname) print 'Cleaning up...' shutil.rmtree(fname) os.remove(fname+'.zip')
Cheers.
Jason
Now the best way is to use Ulysses for iPad. It adjusts the width of the whitespace between words and between letters so the PDF looks great; CSS-based PDF converters usually don't do this. And it handles images easily.
Later versions of Ulysses will have an X-callback scheme, so maybe we can send Markdown from Editorial to be converted to PDF.
I don't like the available styles much, so I wrote a workflow so I can edit them on the iPad:
Re: Adjusting "whitespace"
That's nothing special. You can enable kerning in Editorial as well. Add "font-feature-settings: "kern"" to your CSS. Other OpenType features like proportional figures ("pnum") also work.
I really hope we will be able to generate PDF with the inbuilt iOS PDF engine in the next update.
- iamjebautista
I personally prefer using cloud service like pdfmyurl.com. Their APIs are extremely easy to use and their pricing is better than their competitors.
As the owner of GrabzIt I would like to recommend you check us out we provide a highly flexible HTML to PDF API. The linked example has a Python demo for your convenience. | https://forum.omz-software.com/topic/1718/other-ways-to-convert-markdown-html-to-pdf-in-ios | CC-MAIN-2020-10 | refinedweb | 1,257 | 58.89 |
CODEX
Julia v1.5 Testing: How to Organize Tests
We explore how Julia tests are organized differently from what you may be used to in other testing frameworks.
Julia development practices will likely not be the same as what you have experienced in Java, JavaScript, Python, Ruby and other popular programming languages.
Thus in this story I will do a sort of quick recap of how testing is often done in other languages and compare that with the common practice followed in Julia as exemplified by the Julia standard library.
How to effectively run tests: Julia v1.5 Testing: Best Practices.
No Tests But Nested Test Sets
Testing in Julia is a lot more free form than what you may be used to. For contrast let me show some examples from other tests frameworks.
Pytest
Pytest is a frequently used testing framework for Python. Here one simply prefixes functions that represents tests with
test_ as shown below:
# Python: Pytest
def capital_case(x):
return x.capitalize()
def test_capital_case():
assert capital_case('semaphore') == 'Semaphore'
In Python one would execute these tests by running:
$ pytest
Go Unit Tests
Go comes with a builtin unit testing framework. Why I am showing all these frameworks instead of jumping straight to Julia? Because these work how people are used to. And I need something to contrast with to help clarify how Julia testing is different.
// Go
package main
import "testing"
func TestSum(t *testing.T) {
total := Sum(5, 5)
if total != 10 {
t.Errorf("Sum was incorrect, got: %d, want: %d.", total, 10)
}
}
For Go tests you put them in a file which ends with
_test such as
foobar_test.go. Each test is placed in a function starting with
Test.
$ go test
This will look for the files ending with
_test.go and treat every function with a
Test prefix taking a
testing.T type argument as a test.
JUnit
In Java JUnit is commonly used. Each test is a method on a test class as shown below:
// Java: JUnit Tests
public class MyTests {
@Test
public void multiplicationOfZeroIntegersShouldReturnZero() {
MyClass tester = new MyClass(); // MyClass is tested
// assert statements
assertEquals(0, tester.multiply(10, 0), "10 x 0 must be 0");
assertEquals(0, tester.multiply(0, 10), "0 x 10 must be 0");
assertEquals(0, tester.multiply(0, 0), "0 x 0 must be 0");
}
}
These classes are then collected into a test suite, thus you can avoid making enormous test classes:
Java: JUnit
@RunWith(Suite.class)
@SuiteClasses({
MyClassTest.class,
MySecondClassTest.class })
public class AllTests {
}
Julia Test Sets
In Julia we do away with this artificial separation between test methods, test classes, test suites etc. Instead everything gets mashed into one concept called a
testset. These are more flexible than what you find in other frameworks which is why developers coming from other frameworks may feel uncomfortable with the much looser form use in Julia testing.
In Julia everything is much more free form. You tailor the test framework more to your own preferences and style. This is possible because test sets can be nested.
Here is an example from my Little Man Computer (LMC) assembler.
@testset "Disassembler tests" begin
"
@test disassemble(600) == "BRA 0"
@test disassemble(645) == "BRA 45"
@test disassemble(782) == "BRZ 82"
end
end
I have have defined test sets for each major component. So e.g. the assembler, disassembler and simulator are all represented by a different test set. Each of these test sets have sub test sets which test aspects of that component.
Thus a Julia
@testset corresponds to both a test function as well as a test class, and a test suite.
What to Put in a Test Set
There are a lot of different ideas of what should be in a unit test. Many swear by to having only one specific thing being tested per test. The Julia convention for test sets is that each test set has a collection of related tests. This is best understood by simply looking at real world tests found in the Julia standard library.
The test sets I show as examples here will be shortened a bit by me as there is not particular value in showing the full length of each test.
# Julia: abstractarray.jl tests
A = rand(5,4,3)
@testset "Bounds checking" begin
@test checkbounds(Bool, A, 1, 1, 1) == true
@test checkbounds(Bool, A, 5, 4, 3) == true
@test checkbounds(Bool, A, 0, 1, 1) == false
@test checkbounds(Bool, A, 1, 0, 1) == false
@test checkbounds(Bool, A, 1, 1, 0) == false
end
@testset "vector indices" begin
@test checkbounds(Bool, A, 1:5, 1:4, 1:3) == true
@test checkbounds(Bool, A, 0:5, 1:4, 1:3) == false
@test checkbounds(Bool, A, 1:5, 0:4, 1:3) == false
@test checkbounds(Bool, A, 1:5, 1:4, 0:3) == false
end
You can see here that tests defined for
abstractarray.jl are made so that each test set check a number of related things. Also there are no fixtures. We simply put e.g. the array being tested on called
A outside the test sets. That makes it available in every test.
Let us do another example by looking at the test for individual character represented by the
Char type.
# Julia: char.jl tests
@testset "basic properties" begin
@test typemin(Char) == Char(0)
@test ndims(Char) == 0
@test getindex('a', 1) == 'a'
@test_throws BoundsError getindex('a', 2)
# This is current behavior, but it seems questionable
@test getindex('a', 1, 1, 1) == 'a'
@test_throws BoundsError getindex('a', 1, 1, 2)
@test 'b' + 1 == 'c'
@test typeof('b' + 1) == Char
@test 1 + 'b' == 'c'
@test typeof(1 + 'b') == Char
@test 'b' - 1 == 'a'
@test typeof('b' - 1) == Char
@test widen('a') === 'a'
# just check this works
@test_throws Base.CodePointError Base.code_point_err(UInt32(1))
end
@testset "issue #14573" begin
array = ['a', 'b', 'c'] + [1, 2, 3]
@test array == ['b', 'd', 'f']
@test eltype(array) == Char
array = [1, 2, 3] + ['a', 'b', 'c']
@test array == ['b', 'd', 'f']
@test eltype(array) == Char
array = ['a', 'b', 'c'] - [0, 1, 2]
@test array == ['a', 'a', 'a']
@test eltype(array) == Char
end
Again you can see that we group related tests into one test set. The second test set I added as an example because it shows how Julia developers also use a popular advice about testing which is to add tests for bugs which has popped up in the past to avoid regressing on the bug again.
Nesting
A test set with code you are testing can also contain other test sets. Here is an example from the testing of the
Dict type used to represent a dictionary in Julia.
# Julia: dict.jl tests
@testset "Dict" begin
h = Dict()
for i=1:10000
h[i] = i+1
end
for i=1:10000
@test (h[i] == i+1)
end
for i=1:2:10000
delete!(h, i)
end
h = Dict{Any,Any}("a" => 3)
@test h["a"] == 3
h["a","b"] = 4
@test h["a","b"] == h[("a","b")] == 4
h["a","b","c"] = 4
@test h["a","b","c"] == h[("a","b","c")] == 4
@testset "eltype, keytype and valtype" begin
@test eltype(h) == Pair{Any,Any}
@test keytype(h) == Any
@test valtype(h) == Any
td = Dict{AbstractString,Float64}()
@test eltype(td) == Pair{AbstractString,Float64}
@test keytype(td) == AbstractString
@test valtype(td) == Float64
@test keytype(Dict{AbstractString,Float64}) === AbstractString
@test valtype(Dict{AbstractString,Float64}) === Float64
end
end
You can see here that the dictionary named
h tested on inside the inner test set was actually defined first in the outer test set.
Using Loops
It is easy in Julia to repeat tests across different kinds of data using loops.
let x = Dict(3=>3, 5=>5, 8=>8, 6=>6)
pop!(x, 5)
for k in keys(x)
Dict{Int,Int}(x)
@test k in [3, 8, 6]
end
end
We can even loop on the whole test set itself. Here we are running the same set of test for both the
== and
isequal function:
@testset "equality" for eq in (isequal, ==)
@test eq(Dict(), Dict())
@test eq(Dict(1 => 1), Dict(1 => 1))
@test !eq(Dict(1 => 1), Dict())
@test !eq(Dict(1 => 1), Dict(1 => 2))
@test !eq(Dict(1 => 1), Dict(2 => 1))
end
How to Write Fixtures in Julia
For a lot of testing frameworks we have the concept of fixtures. That means some data which is initialized and used repeatedly in multiple tests. In Julia the belief is that this is just over-engineering and it simpler and more obvious what is going on by being explicit.
Immutable Fixtures
That means either we put the reuse object outside multiple test sets like this:
A = rand(5,4,3)
@testset "Bounds checking" begin
@test checkbounds(Bool, A, 1, 1, 1) == true
@test checkbounds(Bool, A, 5, 4, 3) == true
end
@testset "vector indices" begin
@test checkbounds(Bool, A, 1:5, 1:4, 1:3) == true
@test checkbounds(Bool, A, 0:5, 1:4, 1:3) == false
end
Mutable Fixtures
Or if the state is modified so we need to recreate it each time, when we would instead use a function to create it:
test_array() = rand(5,4,3)
@testset "Bounds checking" begin
A = test_array()
@test checkbounds(Bool, A, 1, 1, 1) == true
@test checkbounds(Bool, A, 5, 4, 3) == true
end
@testset "vector indices" begin
A = test_array()
@test checkbounds(Bool, A, 1:5, 1:4, 1:3) == true
@test checkbounds(Bool, A, 0:5, 1:4, 1:3) == false
end | https://medium.com/codex/julia-v1-5-testing-how-to-organize-tests-5f7a76e29038?source=---------3---------------------------- | CC-MAIN-2021-10 | refinedweb | 1,575 | 67.49 |
Reading analog voltage with ADC and attenuation
Hi all,
I am playing with a rangefinder ultrasonic sensor (MB7360 from Maxbotix) and I have some question regarding the way to correctly read the sensor values.
The sensor operates at voltage between 2.7V and 5.5V, so I hooked it up on the 3.3V pin of the expansion board.
I am using the sensor's analog voltage output to read the distance measured by the sensor. In the spec-sheet it is mentioned that
- the output is referenced to the sensor ground and Vcc (which is 3.3V, right?)
- the scale factor is Vcc / 5120 per 1 mm
- using a 10 bits ADC, we just need to multiply the voltage read by 5 to obtain the distance
Since the maximum voltage output is 3.3V, I used an attenuation of 11 dB and I am using this piece of code to get the distance:
from machine import ADC # setting up the Analog/Digital Converter with 10 bits adc = ADC(bits=10) # create an analog pin on P20 for the ultrasonic sensor apin = adc.channel(pin='P20', attn=ADC.ATTN_11DB) # get distance dist = apin() * 5
With that code, the readings are not accurate, so I was wondering if I need to scale the distance to take into account the attenuation? (sorry if it's a stupid question, this is new to me)
Many thanks for your help/comments/suggestions!
Cheers,
Johan
PS: the sensor has also other outputs such as a Pulse Width output and a serial output (RS232 format), but the former seems to be difficult to measure using a LoPy (correct me if I am wrong, maybe I missed something while searching in the forum) and I don't have a RS232 <-> TTL converter with me for the later(plus I'd like to avoid using additional boards).
@jojo said in Reading analog voltage with ADC and attenuation:
serial output (RS232 format),
As far as I understand the data sheet, the voltage levels of the serial output are 0 and Vcc. If you run the sensor at Vcc=3.3v, then these ouput levels are ocmpatible with the xxPy devices. You can try to connect the output to the input of UART 1, 9600 baud. If you receive gibberish, then an inverter may be needed, which can be a single 2n7000 Transistor (S->GND, D->Rx input, G->Sensor-ouput). You might need a pullup-resitor at the Rx-input.
To test, whether that works, connect it to a USB/UART bridge and open a serial terminal emulator.
- JardCrocker
Hi...i am a new user here. As per my knowledge you should run this sensor at Vcc of 3.3V. So you do not need a factor of x of range scaling, but you might need it for calibration. You can try ADC in a range other than 12 bits. It might be that in lower than 12 bits mode you have to shift right the returned value by 1 or 2 bits.
@robert-hh
Thanks for all the clarifications! I'll switch to an ADC of 12 bits and give it a try.
@jojo The internal range of the ADC is 0-1V. The attentiation of 11dB gives the range of 0-3.3V, which is what you need for our sensor, running at an Vcc of 3.3V. So you do not need a factor of x of range scaling, but you might need it for calibration.
I never used the ADC in a range other than 12 bits. It might be that in lower than 12 bits mode you have to shift right the returned value by 1 or 2 bits. I have to try. So if the value you get is off by a factor of 4, that this may be the reason.
@robert-hh
Thanks for the quick reply! :)
I should have said that when I use:
dist = apin() * 5
it is already a shortcut for
dist = apin() * 5120 / 1024
where 5120 is the sensor range and 1024 is the range of the ADC using 10 bits. I was wondering if because there is an attenuation, I also have to scale the value of
apin()by a factor
x:
dist = apin() * 5 * x
Also, thanks for the suggestions. I should have mentioned that the piece of code is just a simplified exemple. In my code I also take multiple readings and then use the median (I'm not too found of the mean due to the huge variability). I agree that using a RS232 <-> TTL converter is probably the best option.
@jojo With an attn of 11db, the range of the ADC is 0-3.3V. You used 10 bits, so 1024 is equivalent to about 5 meters. I would assume then that the distance in meters you should get is:
ADC_RANGE = const(1024) sensor_range = 5.0 dist = apin * sensor_range/ ADC_RANGE
If you use bits=12, then ADC_RANGE has to be set to 4096. You might need to adapt sensor_range for calibration. And be warned, the ADC of ESP is not very good. It is nonlinear and noisy. It might be advisable instead of a single value to take the average of several values.
Anyhow, from that data sheet it looks as anyhow using the serial output is the most precise option. | https://forum.pycom.io/topic/1611/reading-analog-voltage-with-adc-and-attenuation | CC-MAIN-2018-17 | refinedweb | 888 | 70.94 |
[
]
k918912 commented on WW-5021:
-----------------------------
@[~yasser.zamani]
I think more explanation is needed. Root application doesn't mean that it's the main application.
{quote}The demand of /struts/domTT.js means your root app is Struts, isn't it?! If it is,
then it should work and 404 means another issue that should be investigated. If it isn't,
then I think you should investigate who has generated the /struts/domTT.js (without context
path) http request.{quote}
I know, there is no bug in Struts, it is generating the correct result *but* my load balancer
is only forwarding specific namespaces to my Struts application. So my load balancer gets
a request to /test and routes it to the "root" Struts application, which in turn has actions
mapped under /test, so everything works fine. Except for static resources, which I can't map
to a namespace (which is what this whole ticket is about). So my application is generating
/struts/domTT.js, but in my load balancer I can't (for company policy reasons) route /struts
to my application.
>) | http://mail-archives.us.apache.org/mod_mbox/struts-issues/201902.mbox/%3CJIRA.13215199.1549966078000.351094.1550841060195@Atlassian.JIRA%3E | CC-MAIN-2019-13 | refinedweb | 180 | 67.15 |
Hi there, I’m getting this error when running the Alienbot program:
make_exit() missing 1 required positional argument: ‘reply’
I’ve tried looking for this error on StackOverflow and mostly have found answers relatings to class instances. But I’m not using classes. Here is my code:
def greet():
name = input("What is your name? ")
will_help = input("Hi {}, I’m Etcetera. I’m not from this planet. Will you help me learn about your planet? ".format(name))
for item in will_help:
if item in negative_responses:
print(“Goodbye”)
else:
return True
greet()
def make_exit(reply):
reply = list(exit_commands)
for reply in make_exit:
if reply in exit_commands:
print(“Goodbye”)
return True
make_exit()
Thank you! | https://discuss.codecademy.com/t/missing-1-required-positional-argument-alienbot-project/433262 | CC-MAIN-2020-29 | refinedweb | 112 | 56.96 |
TypeNameTraits specialization for Array. More...
#include <Teuchos_Array.hpp>
TypeNameTraits specialization for Array.
NOTE: Use of this class requires that either that the type T be defined or that a TypeNameTraits<T> specialization exists. In order to not restrict the use of Array<T> for undefined pointer types (where T=U*), this TypeNameTraits class specialization will not be used in core Array functionality. This might seem trivial except that some MPI implementations use pointers to undefined structs and if you want to portably story these undefined struct pointers in an Array, then you can't use this traits class. C++ is quite lacking in cases like this.
Definition at line 687 of file Teuchos_Array.hpp. | http://trilinos.sandia.gov/packages/docs/r10.6/packages/teuchos/doc/html/classTeuchos_1_1TypeNameTraits_3_01Array_3_01T_01_4_01_4.html | CC-MAIN-2014-35 | refinedweb | 114 | 55.84 |
0 Members and 1 Guest are viewing this topic.
% git grep 'operator ()'gui/citylist_stats_t.cc: bool operator ()(const stadt_t* a, const stadt_t* b)gui/curiositylist_stats_t.cc: bool operator ()(const gebaeude_t* a, const gebaeude_t* b)gui/factorylist_stats_t.cc: bool operator ()(const fabrik_t* a, const fabrik_t* b)gui/labellist_stats_t.cc: bool operator ()(const koord a, const koord b)
// only this works with O3 optimisation! return ((a.x-b.x)|(a.y-b.y))==0;
return (a.x == b.x) && (a.y == b.y);
You don't want to dispute prissi's optimizations He will bring some obscure reason like pipelining and will be right.
(Before there was *(uint32)&a==*(uint32)&b, which did not work out with O3 optimisations and was not to the liking of some compiler).
On readability: The comparison of koordinates is one of the major eater of calculation time (albeit at total on 1.1% of all time).
(a.x==b.x && a.y==b.y) is slower, since it has a conditional which usually invalides the pipe. | https://forum.simutrans.com/index.php?topic=1443.0 | CC-MAIN-2021-31 | refinedweb | 170 | 51.55 |
This action might not be possible to undo. Are you sure you want to continue?
++
Discrete Event Simulation System
Version 3.0
User Manual
by András Varga
Last updated: December 16, 2004
OMNeT++ Manual –
Document History
Date 2004/12 2003/06 2003/06 2003/04-06 Author Change AV updated for the OMNeT++ 3.0 release AV Mentioned Grace and ROOT in section "Visualizing...". Added section "Using STL in message classes". AV OMNeT++ 2.3 released AV "Design of OMNeT++" chapter revised, extended, and renamed to "Customization and Embedding". Added "Interpreting Cmdenv output" section to the "Running the Simulation" chapter. Added section about Akaroa in "Running the Simulation" chapter. Expanded section about writing shell scripts to control the simulation. Added background info about RNGs and warning about old RNG in "Class Library" chapter; revised/extended "Deriving new classes" section in same chapter. Bibliography converted to Bibtex, expanded and cleaned up; citations added to text. "Parallel Simulation" chapter: contents removed until new PDES implementation gets released. Revised and reorganized NED chapter. Section about message sending/receiving and other simple module related functions moved to chapter "Simple Modules"; cMessage treatment from "Simulation Library" merged with message subclassing chapter into new chapter "Messages". Deprecated cPacket. Removed sections "Simulation techniques" and "Coding conventions", and their useful fragments were incorporated elsewhere. Added/created sections about message transmission modeling, and using global variables. Added sections explaining how to implement broadcasts and retransmissions. Revised section about dynamic module creation. Deprecated putaside-queue, receiveNew(), receiveOn(). Added section "Object ownership management"; removed section on "Using shared objects". AV OMNeT++ 2.3b2 released AV OMNeT++ 2.3b1 released AV Added chapter about message subclassing; revised chapter about running the simulation and incorporated new Cmdenv options; added new distributions and clarified many details in NED expr. handling section Ulrich Converted from Word to LaTeX Kaage AV Documented new ini file options about Envir plugins AV Refinements on the Parsec chapter
2003/03 2003/02 2003/01
Summer 2002 2002/03/18 2002/01/24
iii
OMNeT++ Manual –
2001/10/23
AV
Updated to reflect changes since 2.1 release (see include/ChangeLog)
iv
. . . . . . . . .2 The import directive . . . . . .4. 2. .1 Components of a NED description .1 Modeling concepts . . . . . . . . . . . . .3 Channel definitions . . . . . . . . . . . . . . . . . 2. . . .3 Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . .1. . . . . . . . . . . . . . . .1 Building and running simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . links . . . . . . . . . . . . . . . . . . . . . . . 12 3. . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . 2. . . . . . . . . . . . 11 3. .OMNeT++ Manual – CONTENTS Contents Contents 1 Introduction 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . 13 3. . . . . . . . . .1. . . . . . . . . . . . . . . . . .5 Comments . . . .3. . . . . . . . . 1. . . . 11 3. . . . . . . . . . . . . . . . . . . . . .3 Using OMNeT++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 v . . . . . 2.1. . . . . . . gates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Simple module parameters . 3 The NED Language v 1 1 2 2 5 5 5 6 6 6 7 7 7 8 8 9 11 3. . . . . . . . . . . 11 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Simple module gates . . . . . . . . . . . . . . . . . . 2 Overview 2. . .2 Module types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . .1 What is OMNeT++? . .6 Topology description method . . . . . . . . . . . . . . . . . . .4 Modeling of packet transmissions . . . . . . . . . . 2. . . . . . . . . . .2 Reserved words . .3 Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . .1 Hierarchical modules . 2. . . . . . . . . . . . . . . . . . . . . .2 Programming the algorithms . . . . . . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . .4. . . . . . . . . . .4 Case sensitivity . . . . 1. . . . . . . . . . . 11 3. 2. . . . . . . . . . 2. .2 What is in the distribution . . . . . . 13 3. . . . . . . . . . . . .3 Identifiers . . . . . .1. . . . . . . . . . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3. . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3. . .2 Organization of this manual .1. . . . . . . . . . . . . .1 NED overview . . . . . . . . . . 12 3. . . . . . .1. . . .4 Simple module definitions . . . . . . . . . . . . . . . . . . .5 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . . . . . .1 Simulation concepts . .7. . . . . . . . . 40 4. . . . . . . .1 Overview . . . . . . . . . . . . . . . . data rate . . . . . . .7. . 26 3. . . . . . . . . . . . . . . .2 The event loop . . . . . . . . . . . . . . . . . . . . .7 Functions . . . . . . . . . . . .2 Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 XML documents and the XPath subset supported . . . . . . . .1. . . . . . . .2 Multiple transmissions on links .6 Conditional parameters and gatesizes sections . . . . . .7. 15 3. . . .2. . . . . . . . . . . . 24 3. . . . . . . . 38 4. .1. . . . . . . . . . . .5. 27 3. . .7.5. . . .7. . . . . . . . . . . . . . . . . . . . 15 3. . . . . . . . . . . . . . . . . . . . . . 39 4. . . . . . . 40 4.5 FES implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 The sizeof() and index operators . .3. . . . . . . . . . . . . . . . . . . . .5 Compound module definitions . . . . 23 3. . . . . . . . . . . . . . . . .3 Simple modules in OMNeT++ . . . . . . . .4 Events in OMNeT++ . . . . . . . 20 3. . . . . . . . . . . . . . . . . . . . . . . . .10 XML binding for NED files . . . . . . . . . . . . . . . . 26 3. . . . . . . . . . . . .1 Generating NED files . . . .5. . . . . . . . . . . . . . . . . 25 3. . . .2 Referencing parameters .1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Assigning values to submodule parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Network definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3. . . . . . . . . . . . . . . . . . . . . 34 3. . . . . . . . . . . . . . . . . . . .8. . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4. . . . . . . bit error rate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8. . . 35 4 Simple Modules 37 4. . .7 Connections . . . . . . . . . . . . . . . . . . . . . . . . . .2 Building the network from C++ code . . . . . . . . . . . . . . . . . . . . . . 19 3. . . . . . .5 The xmldoc() operator . . . . 19 3. . . . . . . . . . . . . .8. . .OMNeT++ Manual – CONTENTS 3. . . .1 Delay. . . . . . . . . . . . . . . . . . . . . . . . . 37 4. . .7. . . . . . 32 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4. . . .1. . . 16 3. . . . .1 Compound module parameters and gates . . . . . . . . .3 Operators . . . . . . . . 29 3. . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Design patterns for compound modules . . . .9. . .9.8 Parameterized compound modules . . . . . . . . . . . . . . . . . . . . . . . . . .1 Constants . . . . . . . . . . . . . . . . . . 17 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Discrete Event Simulation . . . .9 Large networks . . .3 Submodule type as parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3. . 41 4. . .3 Defining simple module types .2 Packet transmission modeling . . . . .1. . . . 29 3. . . . . . . . . 42 vi . . . .5. . . . . . .7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4. . . . . .5 Defining sizes of submodule gate vectors . .7. . . 23 3. . 18 3. . . 33 3. . . . . 42 4. . . . . . . . . . . . . . . . . . . . .8 Random values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3. . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . 35 3. . . . . . . . . . . . . . . . . 24 3. . .2. . . . . .7 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7. . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Defining new functions . . . . .3 Topology templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Connection parameters .4 Direct message sending . . . . . . 62 4. . . . . . . . . . . . . . 70 4. . . . . . . . . . .6. . .3. . . . . . . .1 The cMessage class . . . . . . . . . . . . . . . . . . .2 Overview . . . . 68 4. 77 5 Messages 79 5. .5 Module deletion and finish() . . . . . . . . . . .1 Gate objects . . . . . .1. . . .1 When do you need dynamic module creation . . . . . . .1 Sending messages . . . . . . . . . . . 70 4. . . . . . . . . . . . .11 Dynamic module creation . . . . .4. . . . . . . . .1 Messages and packets . . . . . . . . . . 65 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 Finite State Machines in OMNeT++ . . . . . . . . . . . . . . . . . . . . . . . . 74 4. . . . . . . . . . . . . . . . . . . .3. . . 64 4. . . . . . . . . . . . . . . . . 64 4. . . 65 4. . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . . . . 44 4. . . . . . .11. . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4. . . . . . . . . . . . . . . . . . . . .6. . . . . .8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Sending and receiving messages . . . . . . . . . . . . . . . . . . . . .8 Stopping the simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4. .5 Receiving messages . . . . . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . .11. . . . . . .3. . . 71 4. . . . . . . . . . .11. . . . . . . . . . . . . . . . . . . . . . .3 Several modules. . . . . . 68 4. . . . . . . . . . . . . . . . . . . . . . . .6. . . . . . .4 Adding functionality to cSimpleModule . . . . . . . . . . . . .2 Broadcasts and retransmissions . . . . . . 81 vii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4. . . . . . . . . . . . . . . 74 4. . . . . . . . . . . . . . . . . . . . . .3 initialize() and finish() . . . . . . . . . . . . . . . . . . . .2 Self-messages . . .4 Reusing module code via subclassing . . . . . . . . . . . . . . . . 79 5. . . . . . . . . . . . . . . .11. . . . . . . . . . . . . . . . . . .1 handleMessage() . . . . . . . . . . .6. .11. . .3 Creating modules . . . . . . . . . . . 67 4. . . . . . . . . single NED interface . . . . . . . .3 Delayed sending . . . . . . . . . . . . . . . . . . . .9 Walking the module hierarchy .1. . . . . . . . . . . . . . . . . . . . . . . . . . .2 activity() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Transmission state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4. . . . . . . . . . . . . . . . . . . . . . . .4. . . . . 68 4. . .7 Removing connections . . . . . . . . . 57 4. .8. . . . . 70 4. . . . . . . . . . . . . . .5 Using global variables . . . . . . . . . . . . . . . .8. . . . . .10 Direct method calls between modules . . . . . . . . . . . . 66 4. . 61 4. . 51 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4. . . . . . . . . . . . . . . . . . . . . . . . . 77 4.6. . . . .8.4 Deleting modules . . . . . 57 4. . . .2 The module type registration . . 46 4. . . . . . . . . . . . . . . . . . . . .4 Connectivity . . . . . . . . . . 79 5. . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . . . . . . . . . . .6. . .6 The wait() function . . . . . . . .6 Creating connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11. . . . 46 4. . . . . . . . . . . . .8 Accessing gates and connections . . . . . . .7 Modeling events using self-messages . . . . . . .6. . . . 46 4. . . . . . . .3. . 62 4. . .7 Accessing module parameters . . . . . .OMNeT++ Manual – CONTENTS 4. . 43 4. . . . . .4 The class declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4. . . . .
. . . 81 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 6. . .1. . . .7 Using STL in message classes . . . . . . 108 6. . . . . . . . . . . . . .4. . . . . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 5. . . . . . .1 Base class . . . . . 97 5. . 104 6. . . . . 112 6. . RNG mapping . . . . .5 Using existing C++ types . . . . . . . . . .1. . . 90 5. . . . . . . . . . . . . . . .4 Random variates . 85 5. . . . . . . .5 Attaching parameters and objects . . . . . . . . . . . . . . .4 Generating random numbers . . . . . . .1 Class library conventions . . . . . . 113 6. . . . . . . . . .9 What else is there in the generated code? . 104 6. . . . .1. . . . . . . . . . . . . . .6. . . . . . . 111 6. . . . . . . . . . . . . . . . . 103 6. .2 Message definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 6. . . . . . . . . . . .6. . . 110 6. . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . .2.6. . . . .2. . . .1. . . . . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 5. . . . . . . . . . . 99 6 The Simulation Library 101 6. . . . . . . . .1 Random number generators . . . .2 Expandable array: cArray . . . . . . . . . . . . . . . . . . . . . . . 84 5. . . . . . . . . . . . . . . . . . 108 6. . . . . . . .3 Simulation time conversion . . . . . . . . . . . . . . . 105 6. . . . . . . . . . . . . .7 Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 6. . . . 83 5. . . . . . . . . 112 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 fullName() and fullPath() . . .4. . .8 Summary . . . . . . . . . . . . . . . 108 6. . . . . . . . . . . . . . .4. . 102 6. . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . 87 5. . . . . . . . . . . . . . . 93 5. . . . .1 Introduction . . . . . . . . . . . . . . . . . . . . .2. . . . . . . .6 Customizing the generated class . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . . . . . . . . . . 103 6. . . . . . . . . .1 Reading the value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Queue class: cQueue . . . . . . . 102 6. . . . . . . . . . . . . . . . . . . .4 Inheritance. . . . . . . . . . . . . . .3 Accessing the RNGs . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . .2 Setting and getting attributes .2. . . 106 6. . . .5 Random numbers from histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . .5. . . 106 6. . . . . . . . . . . . . 114 viii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 6. .4 cPar storage types . .6 Copying and duplicating objects . . . . . . . . . . . . . . . . 92 5. .2 Declaring enums . . . . . . . . . . . . . . . . . . . . . composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Modelling packets . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . 102 6. . 111 6. . . . . . .5 Container classes . . . . 87 5. . 103 6. . . .1. . . . . .3 Message declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . .3 Setting cPar to return random numbers . . .4 Name attribute . . . . . . . . . . . .OMNeT++ Manual – CONTENTS 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . .7 Routing support: cTopology . . . . . . . . . . . . . . . . . .2 Random number streams.2. . . . . . . . .2 Changing the value . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Logging from modules . . . .2. . . . . .4 Encapsulation . . . . .6 The parameter class: cPar . . . . . . . . .3 className() . . . . . . . . . . . . . . . .
. 147 7. .10 WATCHes and snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 7. 130 6. . . . . . . . . . . .2 cObject virtual methods . . . . . . . . . . . . 124 6.4 Details . . . . . . . . . . . . . . . .9 Recording simulation results . . . . . . . . . . . . . .1 Installation . . . . . . . . . . 135 6. . . . . . . . . . . . . . . . . . . . 136 6. . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . 139 6. . . . . . . . . . 117 6. . . . . . . . . . . . . .3. . . . . . . . . . . . . . . . . . . . .1 Overview . . . . . . . . . . . . .9. . . 132 6. . . . . . . . . . . . . . . . 146 7. . . . . . .1 Overview . . . . . . . . . . . . . . . . .3 Shortest paths . . . . . . . . . 135 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 6. . . . . . . . . . . . .4 Ownership is managed transparently . . . . . 141 7 Building Simulation Programs 143 7. . . . . . . . . . . . . . . . . . . . . . . . . . .OMNeT++ Manual – CONTENTS 6. . . .12. . . . . . . .10. 115 6. . . . . . . . . . . . . . . . . . . . . .8.5 Garbage collection . . . . . . . . . . .2 Distribution estimation . . . 125 6. . . . . . . . . . . . . . . . . . . . . . . . 144 7.1 cStatistic and descendants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11. . . . . . . . . . . . . . . . . . . . 146 7. . . . . 130 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 6. . . . . . . . . . . 127 6. . . . .11. . . . . 143 7. . . . 128 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 What cQueue and cArray do . . . . . . .2 Building simulation models on the command line . . . . . . . . .10. . . . . . . . . . . . . . . . . . . . .12. . . . . . . . . . . . .2 Using Unix and gcc . . . . . . . . . . .12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12. . . . . .7. . . . . . . . . . . . .9. . . . . . . . . . . . . . . . . . . . .1 Ownership tree . . . . . . . . . . . . . . . . . . . 146 7. . . . . . . . . . . . . . . .1 cObject or not? . . . . . . . . . .7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . .3 Class registration . . . . . . . . . . . . . . . . . .2 Purpose . .13 Tips for speeding up the simulation . . . 125 6. . .2 Output scalars . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Transient detection and result accuracy . . . . . . . . . . . . .8. . . . . . . . .3 Objects are deleted by their owners . . . . . . . . . 119 6. . . . .3 Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 6. . . . . . . . . . 147 ix . .3 Using Windows and Microsoft Visual C++ . . . . . . . . . . . 127 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Basic usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Deriving new classes . . . . . . . . .12.11. . . . . . . . . . . . . . . 126 6. . .4 Static vs shared OMNeT++ system libraries . . . . . . . . . . . . . . . . . . . .11. . . . . . . . . . . . . . .8. . . . . . . . .4 Getting coroutine stack usage .12 Object ownership management . . .8. . . . . . .2. . . . . . . . . . . .2 Building simulation models . . . . . . . . . . . 135 6. . . . . . . . . . . . . . . . 132 6. . . . . . . . . . . . . . . 144 7. . . . . . . . . . . . . . . . . 131 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 6. . . . . . . . . . . . . . . . . . . . 137 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6. . . . . . .8 Statistics and distribution estimation . . . . . . . . . . . . .7. . . . . . . .1 WATCHes .2 Snapshots . . . . . . . . . . . . . . . . . . . . 130 6. . . . . . . .3. . . .3 Multi-directory models . . . .1 Output vectors: cOutVector . . . . . . . . .1 Installation . . . . . . . . . . . . . . 130 6. . . . . . . . . . . . . . . .3 The k-split algorithm . . . . . . . . . . . . . . . . . . . . . . . . .2. .10.
. . . . .1 Number of RNGs . . . . . . . 156 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Setting module parameters in omnetpp. . . . . 157 8. . . . . . . . . .3 RNG mapping . . . . . . . . .1 Command-line switches . . . . . . . . . . . . . . . . . . . . . . . . . 168 8. .10 Akaroa support: Multiple Replications in Parallel . . . .9. . . . . . . . . .2 Tkenv ini file settings . . . . 159 8. . . . . . . . . . . . . . . . . . . 152 8. . . .8 Tkenv: the graphical user interface . . . . . . . 155 8. . . . .6.ini . . . . . . . . . . . . . . . . . . . . . . . .9 Repeating or iterating simulation runs .1 Introduction . . . . . . . . . . . . . . . . . . . . . .2 RNG choice . . . . . . . . . . . .8. . . . . . . .8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 8. 158 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 8. . . . .7 Cmdenv: the command-line interface . . . . . . . . . . . . . . . . . . . 159 8. . . . . . . . . . . . . . . . . . . . . . . . . . 151 8. . .6. . . . .2 What is Akaroa . .4 In Memoriam. . . . . . . . . 163 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 8. . . . . . . . . . . . . 157 8. . 151 8. . . . . . . . . . . . . . . . 166 8. . . . . . . . . . . . . . . . . 165 8. . . . . . . . .2. . . . . . . . 151 8.6. . . . . . . . . . . . . . . . .8. . . . . . 170 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 An example . . . . . . . . . . . . . . . . . . . . . . . 169 8. . 165 8. . .2 Cmdenv ini file options . . . . . . . . . . . . . . . . . . . . . . .6 The [General] section . . . . . . . . . . .10. . . . . . . . . . . . . . 160 8. . . . . . . . . . . . . . . . . . . . . . .5 Manual seed configuration . . . . . . 149 8. . . . .2 Using wildcard patterns . . . . . . . . . . . . . . . . . . . . .2. 155 8. . .2. . . . . . . . . . . 158 8. . . . . . . . .7. . .7. . . . . . .3 Variations over seed value (multiple independent runs) . . . .2 Variations over parameter values . . . . . .OMNeT++ Manual – CONTENTS 7. . . . . . . .6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 x . . . . . . . . .2 The concept of simulation runs .3. . . . . . . . . .4. . . . . . . . . .1 Run-specific and general sections . . . . . .5 Configuring output vectors . . . . . . .2. . . . . . . . . . . . . . . . . . 149 8. . . . . 167 8. . . .5 Sections . . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . .1 Command-line switches . . . . . . . . . . . . . . . . . . 154 8. . . . . . . . 147 8 Configuring and Running Simulations 149 8. . . . . . . . . . . . . . . . .2 The configuration file: omnetpp. . .3 Building simulation models from the MSVC IDE . . . . . . . . . . . . . 152 8. .6. . . . . . . . . .7. . . . . . . . . .6 Choosing good seed values: the seedtool utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10. . . . . . . .3 Using the graphical environment . .4. . . . .3 Interpreting Cmdenv output . . . . . . . . . . . . . . . . . . . . . . . . .9. . . .6. . . . . . . . . . .6 Configuring the random number generators . . . . . . . . . . . . . . . . . . . .1 Executing several runs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 8. . . . . . . . . .4 Automatic seed selection . . . . . . . . . .1 User interfaces . .3 Dynamic NED loading . . . . . . . . . . . . . . . . . . . . 149 8.4. . . . . . . . . . . .ini . . . . . . . . . . .3 File syntax . . . . . . . . . . . . . . . . . . . . 159 8. . . . .9. . . . 162 8. . . . . . 168 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 File inclusion . . . . . . . . . .2. . . . . . . . . . .8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Applying the defaults . . . . 161 8. . . . . . . . . . . . . . . . .
. . . . . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 11 Documenting NED and Messages 193 11. . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 10. . . . . . . . . .6. . . . . . . . .2 Bubbles . . . . .3. . . .3 Analysis and visualization tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Scalar statistics . . . . . . . . . 182 9. . . . . . . . . .2 The Scalars tool . . . . . . . . . . . . . . .1 Plotting output vectors with Plove . . . . . 184 9. . 191 10. . . . . . . . . . . . . . . .2. . . . . . . . . . . . . 177 9. . . . . . . . . . . . . . . . . . . . . 181 9. . . .3. . . . . . . . . . . . . . . . . .3. . . 181 9. . . . . . . . . . . . . . .3 The icons . . . . . . . . .5 Message display strings . . . . . . . . . . . . . . . . . . . . . . . 180 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Categorized icons . . . . . . . . . . . . . . .3. . . . . . . . . . . . . . . . .1 Format of output scalar files . . . . . . . . . . . . . . . . . . . . . . . . . .1 The bitmap path .3 Using Akaroa with OMNeT++ . . . . . . . . . . . . . . . 184 9. . . . . . . . . . . . .2. . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . 172 8. . . . . . . . . . 177 9. . . . . . . . . . 185 10 Analyzing Simulation Results 187 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 9. . . . . . . 189 10. . . . . .1 Keyboard and mouse bindings . . . . . . . . . . . . . . . . . .1 Display strings . .2 Format of output vector files . . . . . . . . . . . . .2 Submodule display strings . . . . . . . . . . . . . . . . . . . . . . . . . . 178 9. . . . . . . . . . . . . . . . . . . . . . .1 Changing display strings at runtime . . . . . . . . . . . . . .10. .4 Connection display strings . . . . . . . . . . . . .2 Colors . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 9. . . .1. . . .1. . . . 183 9. . . . . . . . . . . . .6 Enhancing animation . . . . . . . . . . . . . . . . .11. . . . . . . . . . . . .2 ROOT . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . . .11. . . . . . . . . . . . . . . . . . . . 183 9. . . . . . .1 Color names . . . . . . .4 Layouting . . . . . . . 191 10. . . . . . . .OMNeT++ Manual – CONTENTS 8. . . . . . . . . . . . .1 Display string syntax . . . . . . . . . . .3. . . . . . . . . . 180 9. . . 188 10. . . . . 193 xi . . . . . . . . .2 Icon colorization . . .1. . .1 Output vectors . . . . . . . . . . . . 187 10. . . . . . 189 10. 182 9. . . . . .3 Gnuplot . . . . . . . 183 9. . . . . . . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Grace . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 10. . . . 171 8. . . .1. . . . . . . . .11 Typical problems . . . . . . . . . . 191 10. . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Overview . . . . . .1 Stack problems . . 172 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 GNED – Graphical NED Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 9. . .3 Working without Plove . . . . . . . . . . . . . . . . . . 174 9 Network Graphics And Animation 177 9. . . . . . . . . . . . . . . . . . . . . . . . . . . .6. . . . . . . . . . . . . . .3 Background display strings . . .3 Icon size . . . . . . . . . . . . . .2 Memory leaks and crashes . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .2 Assessing available parallelism in a simulation model . . . . . . . . . . . . .3. . . . . . . . . . 202 12. . . . .OMNeT++ Manual – CONTENTS 11. . . . . . . . .2. . . . 198 11. . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5. 193 11. . . . . . . . . . 197 11. . . . . . . .3. . . . . . . . . . . . . . . . 213 13.1 Multiple projects . . . . . . . 197 11. . 216 13. . . . . . . . . . . . . . .5. . . . 195 11. . . .5 Design of PDES Support in OMNeT++ . . . .6 Where to put comments . . . . 216 13. . . . . . . . . . . . . . . . . . . . . . . 215 13. proxy gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. . . .3 Customizing Envir . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . .4 How does opp_neddoc work? . . . . . . . . . . . . . 215 13. . . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . .9 Incorporating externally created pages . . . . . . . . . . . . . . . . . Tkenv and Cmdenv . . . . . .4 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 13 Customization and Embedding 211 13. . . . . .5. . . . . . . . . . . . . . . . . 213 13. . . . . . . . . . . .2 Embedding OMNeT++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Documentation comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 12 Parallel Distributed Simulation 201 12. . . . . . . . . . . . . . . . . . . . . . . . .3. . . . . 198 11. . 202 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 The coroutine package . . . . . . . . . 213 13. . . . . . . .2. . . . . . 211 13. . . . . . . . . . . . .2 Authoring the documentation .3 Special tags . . . . . . . 217 A NED Language Grammar References Index 219 223 226 xii .3. . .5 Envir. . . . . . . . .1 The global simulation object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5. . 213 13. 193 11. . . . . . . . . . . . . . . . . 199 11. . . . . . . . . . . . . . . . . . .1 The main() function . . . . . 203 12. . . . . . 212 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 12. . . . . .2. . . . . .1 Architecture . . . . . . . .8 Adding extra pages . . . . . . . . . . . . . . . . .1 Introduction to Parallel Discrete Event Simulation . . . . . . . . . . . 196 11. . . . . 194 11. . . 201 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 11. . . . . . . . . . .2. . . . . . . . . . . . . . . . . . . .4 The Model Component Library . . . . . .3 Sim: the simulation kernel and class library . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 11. . . .3. . . . . . . . . . . . . . . . . . . . . .2 The cEnvir interface . . . . . . . . . . . . . . . . . . . . . . . . . 201 12. . . . .2. . . . . . . . .4 Additional text formatting using HTML . . . . 206 12. . . . . . . .4 Implementation of the user interface: simulation applications . . . . . . . . . . . . . . .7 Customizing the title page . . . . . . . . . . . .2 Parallel Simulation Example . .2 Text layout and formatting . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Overview . . . . .3 Placeholder modules. .3 Invoking opp_neddoc . . . . . . . . . . . . . . .5 Escaping HTML tags . . . . . . . . . . . . . . . . .3 Parallel distributed simulation support in OMNeT++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
through gates and connections. Parameters can be used to customize module behaviour and to parameterize the model’s topology. which allows the user to reflect the logical structure of the actual system in the model structure. and they are programmed in C++ using the simulation library. These modules are termed simple modules. User interfaces also facilitate demonstration of how a model works. Modules communicate through message passing. Modules can send messages either directly to their destination or along a predefined path. The simulator as well as user interfaces and tools are portable: they are known to work on Windows and on several Unix flavours. OMNeT++ can even 1 . . The depth of module nesting is not limited. An OMNeT++ model consists of hierarchically nested modules. Models do not need any special instrumentation to be run in parallel – it is just a matter of configuration. Messages can contain arbitrarily complex data structures. using various C++ compilers.OMNeT++ Manual – Introduction Chapter 1 Introduction 1. OMNeT++ can use several mechanisms for communication between partitions of a parallel distributed simulation. Advanced user interfaces make the inside of the model visible to the user. The parallel simulation algorithm can easily be extended or new ones plugged in. OMNeT++ simulations can feature varying user interfaces for different purposes: debugging.1 What is OMNeT++? OMNeT++ is an object-oriented modular discrete event network simulator. modeling any other system where the discrete event approach is suitable. . OMNeT++ also supports parallel distributed simulation. The simulator can be used for: • traffic modeling of telecommunication networks • protocol modeling • modeling queueing networks • modeling multiprocessors and other distributed hardware systems • validating hardware architectures • evaluating performance aspects of complex software systems • . This is very useful in the development/debugging phase of the simulation project. for example MPI or named pipes. demonstration and batch execution. Modules at the lowest level of the module hierarchy encapsulate behaviour. Modules can have their own parameters. allow control over simulation execution and to intervene by changing variables/objects inside the model.
• Finally.hu) was also interested in parallel simulation. and simulation of the NIM game which survived until OMNeT++ 3. He implemented the FDDI model (practically unchanged until now).3 Credits OMNeT++ has been developed by András Varga (andras@omnetpp. Chapter 13 explains the architecture and the internals of OMNeT++. 1. These student exchanges were organized by Dr. andras. 4 and 6 are the programming guide. This chapter will be useful to those who want to extend the capabilities of the simulator or want to embed it into a larger application. nedc was further developed and refactored several times until it finally retired and got replaced by nedtool in OMNeT++ 3. • Appendix A provides a reference of the NED language. because simulations can be run in parallel even under the GUI which provides detailed feedback on what is going on.2 Organization of this manual The manual is organized the following way: • The chapters 1 and 2 contain introductory material • The second group of chapters. The first version of nedc was finally developed in summer 1995. OMNEST is the commercially supported version of OMNeT++. • The chapters 9 and 11 elaborate the topic further. My fellow student Ákos Kun started to program the first NED parser in 1992-93. George van Montfort. and wrote some example simulations. for example the original version of Token Ring. nedc was first called JAR after their initials until it got renamed to nedc. The diploma thesis of Zoltán Vass (spring 1996) was to prepare OMNeT++ for parallel execution over PVM to OMNeT++. by three exchange students from TU Delft: Jan Heijmans. and György Pongor at TU Budapest. the simulation concepts and their implementation in OMNeT++. Gábor Lencse (lencse@hit. nevertheless I’d like to acknowledge the work of the following people.0. Leon Rothkranz at TU Delft. First of all. The second group of Delft exchange students (Maurits André.varga@omnest. and added some extensions into NED for SSM. but it was abandoned after a few months. • Chapter 12 is devoted to the support of distributed execution.OMNeT++ Manual – Introduction be used for classroom presentation of parallel simulation algorithms.org. They performed some testing of the simulation library. In the early stage of the project. 2 . 3. and present the tools OMNeT++ provides to support these tasks.com).hu).bme. They present the NED language. explain how to write simple modules and describe the class library. These extensions have been removed since then (OMNeT++ 3. I’d like thank Dr György Pongor (pongor@hit. OMNeT++ is only free for academic and non-profit use – for commercial purposes one needs to obtain OMNEST licenses from Omnest Global. several people have contributed to OMNeT++. 1. Inc. This code has been replaced with the new Parallel Simulation Architecture in OMNeT++ 3. namely a method called Statistical Synchronization (SSM).0. Although most contributed code is no longer part of the OMNeT++. • The following chapters. Alex Paalvast and Robert van der Leij. 8 and 10 deal with practical issues like building and running simulations and analyzing results. by explaining how one can customize the network graphics and how to write NED source code comments from which documentation can be generated. 7.bme.0 does parallel execution on different principles).0. my advisor at the Technical University of Budapest who initiated the OMNeT++ as a student project. Gerard van de Weerd) arrived in fall 1995.
It would be impossible to mention everyone here. 3 . and the list is constantly growing – instead. which was a huge undertaking and great help. k-split was later reimplemented by András. the README and ChangeLog files contain acknowledgements. Ulrich can also be credited with converting the User Manual from Microsoft Word format to LaTeX. the OMNeT++ CVS was hosted at the University of Karlsruhe.OMNeT++ Manual – Introduction The P 2 algorithm and the original implementation of the k-split algorithm was programmed in fall 1996 by Babak Fakhamzadeh from TU Delft. Between summer 2001 and fall 2004. Credit for setting up and maintaining the CVS server goes to Ulrich Kaage. Several bugfixes and valuable suggestions for improvements came from the user community of OMNeT++.
OMNeT++ Manual – Introduction 4 .
1. which communicate by passing messages to each another. Model structure is described in OMNeT++’s NED language. Figure 2.1). The depth of module nesting is not limited. 5 . which can also contain submodules themselves (Fig.OMNeT++ Manual – Overview Chapter 2 Overview 2. The top level module is the system module. OMNeT++ models are often referred to as networks. this allows the user to reflect the logical structure of the actual system in the model structure.1 Modeling concepts OMNeT++ provides efficient tools for the user to describe the structure of the actual system. as opposed simple modules which are at the lowest level of the module hierarchy. Simple modules contain the algorithms in the model. 2. Some of the main features are: • hierarchically nested modules • modules are instances of module types • modules communicate with messages through channels • flexible module parameters • topology description language 2. The system module contains submodules. The user implements the simple modules in C++.1: Simple and compound modules Modules that contain submodules are termed compound modules. using the OMNeT++ simulation class library.1 Hierarchical modules An OMNeT++ model consists of hierarchically nested modules.
2). jobs or customers in a queuing network or other types of mobile entities. or define link types and use them throughout the whole model. messages typically travel through a series of connections. Such series of connections that go from simple module to simple module are called routes. gates. 2. or a gate of one submodule and a gate of the compound module (Fig.1. Compound modules act as ‘cardboard boxes’ in the model.OMNeT++ Manual – Overview 2.1. to start and arrive in simple modules. Each connection (also called link) is created within a single level of the module hierarchy: within a compound module. in Chapter 8. bit error rate and data rate. Messages can contain arbitrarily complex data structures.1. without affecting existing users of the module type. all three being optional. The message can arrive from another module or from the same module (self-messages are used to implement timers). One can specify link parameters individually for each connection. Finally. This allows the user to split a simple module into several simple modules embedded into a compound module. While describing the model. which facilitate the modeling of communication networks. links Modules communicate by exchanging messages. 6 .3 Messages. instances of these module types serve as components for more complex module types. aggregate the functionality of a compound module into a single simple module. messages are sent out through output gates and arrive through input gates. the user creates the system module as an instance of a previously defined module type. Simple modules can send messages either directly to their destination or along a predefined path. messages can represent frames or packets in a computer network.2 Module types Both simple and compound modules are instances of module types. Figure 2.4 Modeling of packet transmissions Connections can be assigned three parameters.2: Connections Due to the hierarchical structure of the model. Module types can be stored in files separately from the place of their actual usage. 2. one can connect the corresponding gates of two submodules. or vica versa. all modules of the network are instantiated as submodules and sub-submodules of the system module. When a module type is used as a building block. This feature will be discussed later. In an actual simulation. The “local simulation time” of a module advances when the module receives a message. transparently relaying messages between their inside and the outside world. This means that the user can group existing module types and create component libraries. Gates are the input and output interfaces of modules. Propagation delay is the amount of time the arrival of the message is delayed by when it travels through the channel. but can be useful in other models too: propagation delay. the user defines module types. 2. there is no distinction whether it is a simple or a compound module. through gates and connections.
and the way the internal connections are made. but rather start repeating its first bits soon after they arrive – in other words. the sending of the message in the model corresponds to the transmission of the first bit.6 Topology description method The user defines the structure of the model in NED language descriptions (Network Description). and can freely use objectoriented concepts (inheritance. The following classes are part of the simulation class library: • modules. connections etc.The NED language will be discussed in detail in Chapter 3. number of gates. or can contain XML data trees. When data rates are in use. The simulation programmer can choose between event-driven and process-style description. Simulation objects (messages. polymorphism etc) and design patterns to extend the functionality of the simulator. 2. They have been designed to work together efficiently. creating a powerful simulation programming framework. If you want to model such networks.) • transient detection and result accuracy detection classes 7 .ini.g. • parameters • messages • container classes (e. queue.) are represented by C++ classes. numeric or boolean values. modules. Data rate is specified in bits/second. and for parameterizing the model topology.OMNeT++ Manual – Overview Bit error rate speficifies the probability that a bit is incorrectly transmitted. gates. and the arrival of the message corresponds to the reception of the last bit. This model is not always applicable. supported by the OMNeT++ simulation class library.1. and allows for simple noisy channel modelling. 2. queues etc. and values input interactively by the user. Parameters can be assigned either in the NED files or the configuration file omnetpp. array) • data collection classes • statistic and distribution estimation classes (histograms. Parameters may be used to customize simple module behaviour. Parameters can take string. Numeric-valued parameters can be used to construct topologies in a flexible way. for example protocols like Token Ring and FDDI do not wait for the frame to arrive in its entirety. P 2 algorithm for calculating quantiles etc. random variables from different distributions. Numeric values include expressions using other parameters and calling C functions. frames “flow through” the stations.5 Parameters Modules can have parameters. 2. parameters can define the number of submodules. the data rate modeling feature of OMNeT++ cannot be used. and it is used for calculating transmission time of a packet. The full flexibility and power of the programming language can be used. Within a compound module.1.2 Programming the algorithms The simple modules of a model contain algorithms as C++ functions. being delayed only a few bits.
3. When the program is started.lib extension) • User interfaces. 2. compiled and put together into libraries (. Running the simulation and analyzing the results The simulation executable is a standalone program. The output of the simulation is written into data files: output vector files.a or . OMNeT++ will translate message definitions into full-fledged C++ classes. or imported into spreadsheets like OpenOffice Calc.OMNeT++ Manual – Overview The classes are also specially instrumented. Then all C++ sources are compiled and linked with the simulation kernel and a user interface to form a simulation executable. in the simplest case. thus it can be run on other machines without OMNeT++ or the model files being present. the NED files are compiled into C++ source code. awk or perl might be required. NED files can be written using any text editor or the GNED graphical editor. This feature has made it possible to create a simulation GUI where all internals of the simulation are visible. • Message definitions (. using the NEDC compiler which is part of OMNeT++. You can define various message types and add data fields to them. They are C++ files. This file contains settings that control how the simulation is executed. This manual briefly describes some data plotting programs and how to use them with OMNeT++. output scalar files . written in C++. First. allowing one to traverse objects of a running simulation and display information about them such as name. this will be discussed later). It is not expected that someone will process the result files using OMNeT++ alone: output files are text files in a format which can be read into math packages like Matlab or Octave. or batch execution of simulations. compiling and running simulations are discussed. This contains the code that manages the simulation and the simulation class library. OMNeT++ user interfaces are used in simulation execution. gates etc. throughput vs offered load).g.1 Using OMNeT++ Building and running simulations This section provides insight into working with OMNeT++ in practice: Issues such as model files. it reads a configuration file (usually called omnetpp. demonstration. class name. with . values of model parameters.cc suffix. It can draw bar charts. It is written in C++. The configuration file can also prescribe several simulation runs. Output scalar files can be visualized using the Scalars tool.a or . • Simple modules sources. Gnumeric or MS Excel (some preprocessing using sed. state variables or contents. Simulation programs are built from the above components. they will be executed by the simulation program one after another.msg files). and it is outside the scope of OMNeT++ to duplicate their efforts. An OMNeT++ model consists of the following parts: • NED language topology description(s) (. or export data via the clipboard for more detailed analysis into spreadsheets and other programs. The simulation system provides the following components: • Simulation kernel. There are several user interfaces.ini).h/. and possibly the user’s own output files. compiled and put together to form a library (a file with .lib files). 8 . x-y plots (e.3 2. etc. OMNeT++ provides a GUI tool named Plove to view and plot the contents of output vector files. to facilitate debugging. All these external programs provide rich functionality for statistical analysis and visualization.ned files) which describe the module structure with parameters.
3. Component libraries Module types can be stored in files separate from the place of their actual use. The user would test and debug the simulation with a powerful graphical user interface. etc. nedc. and finally run it with a simple and fast user interface that supports batch execution. and possibly allow the user to intervene by changing variables/objects inside the model. containing software bundled with OMNeT++. message compiler sim/ simulation kernel parsim/ files for distributed execution netbuilder/files for dynamically reading NED files envir/ common code for user interfaces cmdenv/ command-line user interface tkenv/ Tcl/Tk-based user interface gned/ graphical NED editor plove/ output vector analyzer and plotting tool scalars output scalar analyzer and plotting tool 9 . readme.) include/ header files for simulation models lib/ library files bitmaps/ icons that can be used in network graphics doc/ manual (PDF). The flexibility of the topology description language also supports this approach. and distribute it as a standalone simulation tool. the omnetpp directory on your system should contain the following subdirectories. (If you installed a precompiled distribution. The same simulation model can be executed with different user interfaces. The user can specify in the configuration file which model is to be run. 2.2 What is in the distribution If you installed the source distribution. to control simulation execution.) The simulation system itself: omnetpp/ OMNeT++ root directory bin/ OMNeT++ executables (GNED. or there might be additional directories.g. This is very important in the development/debugging phase of the simulation project. some of the directories may be missing. This enables the user to group existing module types and create component libraries. The graphical user interface can also be used to demonstrate a model’s operation. manual/ manual in HTML tictoc-tutorial/ introduction into using OMNeT++ api/ API reference in HTML nedxml-api/ API reference for the NEDXML library src/ sources of the documentation src/ OMNeT++ sources nedc/ NED compiler. license. without any change in the model files themselves. e. This allows one to build one large executable that contains several simulation models. Universal standalone simulation programs A simulation executable can store several independent models that use the same set of simple modules.OMNeT++ Manual – Overview User interfaces The primary purpose of user interfaces is to make the internals of the model visible to the user. Just as important. etc. a hands-on experience allows the user to get a ‘feel’ of the model’s behaviour.
etc..OMNeT++ Manual – Overview nedxml/ utils/ test/ core/ distrib/ .. directories for sample simulations models the Aloha protocol Closed Queueing Network The contrib directory contains material from the OMNeT++ community. NEDXML library makefile-creator. documentation tool. regression test suite regression test suite for the simulation library regression test suite for built-in distributions Sample simulations are in the samples directory. 10 . which contain integration components for Microsoft Visual C++.. samples/ aloha/ cqn/ . contrib/ octave/ emacs/ directory for contributed material Octave scripts for result processing NED syntax highlight for Emacs You may also find additional directories like msvc/.. etc.
2 Reserved words The writer of the network description has to take care that no reserved words are used for names. NED files can be loaded dynamically into simulation programs.OMNeT++ Manual – The NED Language Chapter 3 The NED Language 3. gates. The NED language facilitates the modular description of a network.1. parameters.1 Components of a NED description A NED description can contain the following components.3 Identifiers Identifiers are the names of modules. The reserved words of the NED language are: import channel endchannel simple endsimple module endmodule error delay datarate const parameters gates submodules connections gatesizes if for do endfor network endnetwork nocheck ref ancestor true false like input numeric string bool char xml xmldoc 3. or translated into C++ by the NED compiler and linked into the simulation executable.1. channel attributes and functions.1. This means that a network description may consist of a number of component descriptions (channels. Files containing network descriptions generally have a . 3. The EBNF description of the language can be found in Appendix A. The channels. networks. simple modules and compound modules of one network description can be reused in another network description. submodules. channels.1 NED overview The topology of a model is specified using the NED language. simple/compound module types).ned suffix. in arbitrary number or order: • import directives • channel definitions • simple and compound module definitions • network definitions 3. 11 .
For example. the convention is to capitalize the beginning of every word. it is recommended that you begin the names of modules. This feature is described in Chapter 11. with the usual C++ syntax: comments begin with a double slash ‘//’. If you have identifiers that are composed of several words. gates and submodules with a lower-case letter. e. and the names of parameters..1. endchannel Three attributes can be assigned values in the body of the channel declaration. 3.ned file does not cause that file to be compiled with the NED compiler when the parent file is NED compiled.ned extension. one must compile and link all network description files – not only the top-level ones. and last until the end of the line.1. Identifiers may only begin with a letter or the underscore. error is the 12 .. only the declaration information is used. prefix the name you’d like to have with an underscore. TCP and Tcp are two different names. i. NED comments can be used for documentation generation. use the NED compiler’s -I <path> command-line option to name the directories where the imported files reside. The channel name can be used later in the NED description to create connections with these parameters. all of them are optional: delay. Comments are ignored by the NED compiler.3 Channel definitions A channel definition specifies a connection type of given characteristics.OMNeT++ Manual – The NED Language Identifiers must be composed of letters of the English alphabet (a-z.g. After importing a network description. When a file is imported. Also. The syntax: channel ChannelName //. You can also include a path in the filenames. delay is the propagation delay in (simulated) seconds.4 Case sensitivity The network description and all identifiers in it are case sensitive. much like JavaDoc or Doxygen.e. one can use the components (channels. or better. numbers (0-9) and the underscore “_”. importing a .. error and datarate. 3. simple/compound module types) defined in it. If you want to begin an identifier with a digit. Also. A-Z).ned 3. Example: import "ethernet". channels and networks with a capital letter.2 The import directive The import directive is used to import declarations from another network description file.5 Comments Comments can be placed anywhere in the NED file. You can specify the name of the files with or without the . Underscores are rarely used. 3. _3Com. // imports ethernet.
gates: //. numeric is assumed. numeric const (or simply const). used for calculating transmission time of a packet. The parameter type can optionally be specified as numeric.ini is described in Chapter 8.OMNeT++ Manual – The NED Language bit error rate that speficifies the probability that a bit is incorrectly transmitted.0018 // sec error 1e-8 datarate 128000 // bit/sec endchannel 3. For example. parameter names begin with lower-case letters. 13 .. address : string. Simple module types are identified by names. By convention.. numOfMessages : const. The attributes can appear in any order. A simple module is defined by declaring its parameters and gates. string. By convention. or xml.1 Simple module parameters Parameters are variables that belong to a module.. If the parameter type is omitted. Example: channel LeasedLine delay 0. Simple modules are declared with the following syntax: simple SimpleModuleName parameters: //. and datarate is the channel bandwidth in bits/second. Simple module parameters can be queried and used by simple module algorithms. omnetpp. The values should be constants. Parameters are declared by listing their names in the parameters: section of a module description. gates: //.ini. endsimple Parameters are assigned from NED (when the module is used as a building block of a larger compound module) or from the config file omnetpp. module names begin with upper-case letters. Example: simple TrafficGen parameters: interarrivalTime.4 Simple module definitions Simple modules are the basic building blocks for other (compound) modules. Parameters are identified by names.... endsimple 3.4. bool. a module called TrafficGen may have a parameter called numOfMessages that determines how many messages it should generate.
gate names begin with lower-case letters. The starting and ending points of the connections between modules are gates. 3.0. OMNeT++ wraps the XML parser (LibXML. but not to change it afterwards. and the xmldoc() operator. OMNeT++ contains built-in support for XML config files. and let the modules read and process the file.. An empty bracket pair [] denotes a gate vector. uniformly distributed or from various distributions.8) would return a new random number from the truncated normal distribution with mean 2.4. Gates are identified by their names. reads and DTD-validates the file (if the XML document contains a DOCTYPE).. It is recommended to mark every parameter with const unless you really want to make use of the random numbers feature. OMNeT++ supports simplex (one-directional) connections. Gate vectors are supported: a gate vector contains a number of single gates. const parameters will be evaluated only once at the beginning of the simulation then set to a constant value.). Gates are declared by listing their names in the gates: section of a module description. Elements of the vector are numbered from zero. Then you’d put these parameters into an external config file. so you might as well describe your configuration in XML.OMNeT++ Manual – The NED Language Random parameters and const Numeric parameters can be set to return random numbers. lets you pick parts of the document via an XPath-subset notation. caches the file (so that if you refer to it from several modules.0 version. From the 3. You can point xml-type module parameters to a specific XML file (or to an element inside an XML file) via the xmldoc() operator. gates: 14 . By convention. This can be achieved with declaring the parameter to be const. You may want the initial parameter value to be chosen randomly. For example. These days. You’d pass the file name to the modules in a string parameter. Expat. Examples: simple NetworkInterface parameters: //. gates: in: fromPort. and presents the contents to you in a DOM-like object tree. You can assign xml parameters both from NED and from omnetpp. it’ll still be loaded only once). XML is increasingly becoming a standard format for configuration files as well. endsimple simple RoutingUnit parameters: //. etc. This machinery can be accessed via the NED parameter type xml. setting a parameter to truncnormal(2.0 and standard deviation 0. XML parameters Sometimes modules need more complex input than simple module parameters can describe.. For example. Messages are sent through output gates and received through input gates. fromHigherLayer. out: toPort.8 every time the parameter is read from the simple module (from C++ code). this is useful for specifying interarrival times for generated packets or jobs.2 Simple module gates Gates are the connection points of modules.ini.. toHigherLayer. so there are input and output gates.
It is useful to think about compound modules as “cardboard boxes” that help you organize your simulation model and bring structure into it. if the parameter was assigned a random value. A compound module definition looks similar to a simple module definition: it has gates and parameters sections. 3. The syntax for compound modules is the following: module CompoundModule parameters: //.4. There are two additional sections.. Thus. and parameters can also be used in defining the connections inside the compound module. Otherwise. too) begin with upper-case letters. Parameters can also be used in defining the internal structure of the compound module: the number of submodules and sizes of gate vectors can be defined with the help of parameters.. endmodule All sections (parameters.. By convention.. connections: //. out: input[]. Typically. submodules. and they can be used wherever simple modules can be used. specified in a numOfPorts parameter. Parameters affecting the internal structure should always be declared const. gates.1 Compound module parameters and gates Parameters and gates for compound modules are declared and work in the same way as with simple modules. connections) are optional. Any module type (simple or compound module) can be used as a submodule. Submodules may use parameters of the compound module. described in sections 3.2.5 Compound module definitions Compound modules are modules composed of one or more submodules. endsimple The sizes of gate vectors are given later. gates: //. As a practical example. one could get 15 ..OMNeT++ Manual – The NED Language in: output[].. compound modules can also have gates and parameters.. Like simple modules. when the module is used as a building block of a compound module type.5. every instance of the module can have gate vectors of different sizes. 3. module type names (and so compound module type names.6) or as a building block for other compound modules. you can create a Router compound module with a variable number of ports. so that accessing them always yields the same value. compound module parameters are passed to submodules and used for initializing their parameters.4.. No active behaviour is associated with compound modules – they are simply for grouping modules into larger components that can can be used either as a model (see section 3. submodules and connections. They may be connected with each other and/or with the compound module itself. submodules: //.1 and 3.
you can assign values to their parameters. This is done with an expression between brackets right behind the module type name. Example: module Router parameters: packetsPerSecond : numeric.. A zero value as module count is also allowed. The module type must be known to the NED compiler. submodules: //. submodule names begin with lower-case letters. Submodules are instances of a module type... either simple or compound – there is no distinction. It is possible to define vectors of submodules.. When defining submodules.5. you have to specify their sizes.. and the size of the vector may come from a parameter value. it must have appeared earlier in the same NED file or have been imported from another NED file. numOfPorts : const. submodule2: ModuleType2 parameters: //.. The expression can refer to module parameters. gatesizes: //. Submodules are identified by names.. endmodule Module vectors It is possible to create an array of submodules (a module vector). gatesizes: //. which is surely not what was meant.. and if the corresponding module type has gate vectors.. Example: module CompoundModule //.... out: outputPort[].2 Submodules Submodules are defined in the submodules: section of a compound module declaration. bufferSize : numeric.. connections: //. submodules: submodule1: ModuleType1 parameters: //. gates: in: inputPort[]. that is. endmodule 3. By convention. Example: module CompoundModule parameters: 16 .OMNeT++ Manual – The NED Language a different value each time the parameter is accessed during building the internals of the compound module..
1 If you like... The syntax is the following: module RoutingTestNetwork parameters: routingNodeType: string. node2: routingNodeType like RoutingNode... That is all – now you are free to assign any of the "DistVecRoutingNode". submodules: node1: routingNodeType like RoutingNode. 1 All the above is achieved via the like keyword. For example. AntNetRouting1Node.out0 --> node2.. and the routingNodeType parameter is like a “pointer to a base class” which may be downcast to specific types. in the config file (omnetpp. Then you can tell NED that types of the submodules inside RoutingTestNetwork are not of any fixed module type. "AntNetRouting1Node" or "AntNetRouting2Node" string constants to this parameter (you can do that in NED.. which will serve as a testbed for your routing algorithms. To be able to do such checks. the above solution somewhat similar to polymorphism in object-oriented languages – RoutingNode is like a “base class”. so that one can easily ‘plug in’ any module there. NED gives you the possibility to add a string-valued parameter. Currently.OMNeT++ Manual – The NED Language size: const. or even enter it interactively). etc. Suppose you programmed the needed routing algorithms as simple modules: DistVecRoutingNode. If you specify a wrong value. but contained in the routingNodeType parameter.in0. you’ll get a runtime error at the beginning of the simulation: module type definition not found. submod2: Node[size] //... Inside the RoutingTestNetwork module you assign parameter values and connect the gates of the routing modules.. submod3: Node[2*size+1] //. connections nocheck: node1. NED wants to make sure you didn’t misspell parameter or gate names and you used them correctly. say "FooBarRoutingNode" when you have no FooBarRoutingNode module implemented.ini). // should hold the name // of an existing module type gates: //. but you want to be able to switch to other routing algorithms easily. say routingNodeType to the RoutingTestNetwork compound module. assume the purpose of your simulation study is to compare different routing algorithms.3 Submodule type as parameter Sometimes it is convenient to make the name of a submodule type a parameter. and your network will use the routing algorithm you chose. You have also created the network topology as a compound module called RoutingTestNetwork.5. 17 . NED requires some help from you: you have to name an existing module type (say RoutingNode) and promise NED that all modules you’re going you specify in the routingNodeType parameter will have (at least) the same parameters and gates as the RoutingNode module. RoutingTestNetwork has DistVecRoutingNode hardcoded (all submodules are of this type).. submodules: submod1: Node[3] //. endmodule 3. //. AntNetRouting2Node. To provide some degree of type safety. DistVecRoutingNode and AntNetRouting1Node are like “derived classes”.
endmodule The RoutingNode module type does not need to be implemented in C++. The latter means that the expression is evaluated at runtime each time its value is accessed (e.OMNeT++ Manual – The NED Language //.org").g. opening up interesting possibilities for the modeler. The like phrase lets you create families of modules that serve similar purposes and implement the same interface (they have the same gates and parameters) and to use them interchangeably in NED files.4 Assigning values to submodule parameters If the module type used as submodule has parameters. for flexibility reasons it is often very useful not to “hardcode” parameter values in the NED file. with the syntax submodule. or if the value isn’t there either.ini). various parameters (most commonly.. DistVecRoutingNode. The input keyword When a parameter does not receive a value inside NED files or in the configuration file (omnetpp.. useParam1: bool. because no instance of it is created.etc. you can specify a prompt text and a default value. Parameters can be passed by value or by reference. p2 = param1+param2. submodules: submodule1: Node parameters: p1 = 10. endmodule The expression syntax is very similar to C. Expressions may contain constants (literals) and parameters of the compound module being defined.7. You can also refer to parameters of the already defined submodules. the simulator will prompt you to enter it interactively.. The syntax is the following: 18 .parametername). from simple module code).g. Example: module CompoundModule parameters: param1: numeric.ini where they can be changed more easily. param2: numeric. If you plan to make use of interactive prompting. it is merely used to check the correctness of the NED file.ini). As a value you can use a constant (such as 42 or "www. or write an arbitrary expression containing the above. AntNetRouting1Node. the user will be prompted to enter its value at the beginning of the simulation. you can assign values to them in the parameters section of the submodule declaration.parametername (or submodule[index]. Expressions are described in detail in section 3. Indeed. parameters of the compound module). p3 = useParam1==true ? param1 : param2.5. It is not mandatory to mention and assign all parameters. //. but to leave them to omnetpp. the actual module types that will be substituted (e. 3. On the other hand. Unassigned parameters can get their values at runtime: either from the configuration file (omnetpp..) do not need to be declared in the NED files.foo.
If you omit gatesizes for a gate vector. submodules: node1: Node gatesizes: inputs[2]. endmodule gatesizes is not mandatory. // prompt text cacheSize = input. prompt processingTime = input(10ms). outputs[numPorts]. 3.5 Defining sizes of submodule gate vectors The sizes of gate vectors are defined with the gatesizes keyword. endsimple module CompoundModule parameters: numPorts: const. out: outputs[].6 Conditional parameters and gatesizes sections Multiple parameters and gatesizes sections can exist in a submodule definition and each of them can be tagged with conditions. parameters or expressions.5. One reason for omitting gatesizes is that you’ll want to use the gate++ (“extend gate vector with a new gate”) notation later in the connections section. // default value. Example: module Chain parameters: count: const. Gate vector sizes can be given as constants. "Number of processors?").OMNeT++ Manual – The NED Language parameters: numCPUs = input(10.5.. The third version is actually the same as leaving out the parameter from the list of assignments. 3. it will be created with zero size. but you can use it to make it explicit that you do not want to assign a value from the NED file. submodules: node : Node [count] parameters: position = "middle". node2: Node gatesizes: inputs[numPorts]. 19 . //. An example: simple Node gates: in: inputs[]. outputs[2]. parameters if index==0: position = "beginning"..
The arrow can point either left-to-right or right-to-left. It lists the connections.node2. 20 . node1.output --> node2.OMNeT++ Manual – The NED Language parameters if index==count-1: position = "end". connections: //. One-to-many and many-to-one connections can be achieved using simple modules that duplicate messages or merge message flows. Example: module CompoundModule parameters: //. gatesizes: in[2].7 Connections The compound module definition specifies how the gates of the compound module and its immediate submodules are connected.. endmodule The source gate can be an output gate of a submodule or an input gate of the compound module. connections: node1. the last definition will take effect.5. separated by semicolons..input <-. endmodule If the conditions are not disjoint and a parameter value or a gate size is defined twice. gates: //. but this is rarely needed). This feature is very convenient for connecting nodes of a network: simple Node gates: in: in[].input.. you cannot connect two output gates or two input gates. without having to declare the vector size in advance with gatesizes.output. values intended as defaults should appear in the first sections. 3. that is. //. it is usually associated with some processing anyway that makes it necessary to use simple modules. submodules: //.. gatesizes if index==0 || index==count-1: in[1]. Only one-to-one connections are supported. Gate directions must also be observed. in[1].. You can connect two submodules or a submodule with its enclosing compound module. The gate++ notation allows you to extend a gate vector with new gates. you can also connect two gates of the compound module on the inside. This means that NED does not permit connections that span multiple levels of hierarchy – this restriction enforces compound modules to be self-contained.. (For completeness. so a particular gate may only be used occur in one connection.. and the destination gate can be an input gate of a submodule or an output gate of the compound module.. overwriting the former ones. out: out[]. The rationale is that wherever such fan-in or fan-out occurs in a model. Thus. Connections are specified in the connections: section of a compound module definition.. and thus promotes reusability.. out[2].
the NED sources must contain the definition of the channel.in++ <-.outGate --> error 1e-9 delay 0.node[4]. One can also specify the channel parameters directly: node1.node[2].out++.out++ --> node[4]. node[3].OMNeT++ Manual – The NED Language endsimple module SmallNet submodules: node: Node[6].node[1].in++.in++ <-.outGate --> node2.out++ --> node[2].inGate. node[0]. endmodule A connection: • may have attributes (delay. • may be conditional.out++ --> node[4]. Either of the parameters can be omitted and they can be in any order.out++.out++.node[5]. • may occur inside a for-loop (to create multiple connections).node[4]. node[4]. node[4].outGate --> Fiber --> node2. node[1].in++ <-. bit error rate or data rate) or use a named channel. You can specify a channel by its name: node1. Single connections and channels If you do not specify a channel.in++ <-.out++ --> node[5].inGate. node[3]. no transmission delay and no bit errors: node1. node[1]. Loop connections If submodule or gate vectors are used.in++. connections: node[0].in++ <-.out++. it is possible to create more than one connection with one statement.inGate.in++.in++. node[1].out++.001 --> node2. In this case. node[1].in++. This is termed a multiple or loop connection.out++ --> node[1]. These connection types are described in the following sections. the connection will have no propagation delay. A multiple connection is created with the for statement: 21 .
n do node1. 22 . Since this check can be inconvenient at times.. separated by semicolons.. and the decision is made individually each time whether to create the the connection or not..3...4 do //. for i=0.outGate[i] --> node2[i].inGate endfor.. One can also use an index in the lower and upper bound expressions of the subsequent indices: for i=0. The if condition is evaluated for each connection (in the above example. module RandomConnections parameters: //.OMNeT++ Manual – The NED Language for i=0. endfor.outGate[i] --> node2[i]. j=i+1.1: Loop connection One can place several connections in the body of the for statement. 3. endfor.4 do node1. it can be turned off using the nocheck modifier. using the if keyword: for i=0. j=0..4.inGate if i%2==0. In the above example we connected every second gate.. One can create nested loops by specifying more than one indices in the for statement. for each i value). with the first variable forming the outermost loop. NED requires that all gates be connected. Figure 3. as shown in the next section..1. endfor. The following example generates a random subgraph of a full graph.4 do //. Conditions may also use random variables. The result of the above loop connection can be illustrated as depicted in Fig.. The nocheck modifier By default.. Conditional connections Creation of a connection can be made conditional.
g.6 Network definitions Module module declarations (compound and simple module declarations) just define module types. which presumably contains further compound modules of types WirelessHost.ini). This means that a simple module querying a non-const parameter during simulation may get different values every time (e. connections nocheck: for i=0. you do not need to assign values to all parameters. you need to write a network definition. submodules: //. ftpTraffic=true. if the value involves a random variable. etc. Other expressions (including const parameter values) are evaluated only once.3. There can be several network definitions in your NED file or NED files. j=0. When an expression is used for a parameter value. 3. You’ll typically want to use a compound module type here. They are built with the usual math operators.. Just as in submodules. The syntax of a network definition is similar to that of a submodule declaration: network wirelessLAN: WirelessLAN parameters: numUsers=10.ini) or will be interactively prompted for. they can use parameters taken by value or by reference. endfor. httpTraffic=true. The simulation program that uses those NED files will be able to run any of them. only module types without gates can be used in network definitions. 3.60). it is the simple modules’ responsibility not to send messages on gates that are not connected. WirelessLAN is the name of previously defined compound module type. XML-type parameters can be assigned with the xmldoc() operator. although it is also possible to program a model as a self-contained simple module and instantiate it as a “network”. A network definition declares a simulation model as an instance of a previously defined module type. endmodule When using nocheck. endnetwork Here. 23 .7 Expressions In the NED language there are a number of places where expressions are expected. or it contains other parameters taken by reference).. contain random and input values etc.1)<0. Naturally. WirelessHub. also described in this section.1). distanceFromHub=truncnormal(100. you typically select the desired one in the config file (omnetpp.4. see 3. To actually get a simulation model that can be run. call C functions. Expressions have a C-style syntax. Unassigned parameters can get their values from the config file (omnetpp. XML-type parameters can be used to conveniently access external XML files or parts of them.OMNeT++ Manual – The NED Language gates: //.. it is evaluated each time the parameter value is accessed (unless the parameter is declared const.n-1 do node[i].in[i] if uniform(0..out[j] --> node[j].n-1.
2 Referencing parameters Expressions can use the parameters of the enclosing compound module (the one being defined) and of submodules defined earlier in NED file. // 30 min The following units can be used: Unit ns us ms s m h d Meaning nanoseconds microseconds milliseconds seconds minutes (60s) hours (3600s) days (86400s) 3. further modules up in the module hierarchy will be searched for the parameter.5s recoveryIntvl = 0. Like ancestor. meaning that runtime changes to the parameter will propagate to all modules which take that parameter by reference. It is provided for the rare case when it is really needed. Time constants Anywhere you would put numeric constants (integer or real) to mean time in seconds..param. it will affect the whole model. you can also specify the time in units like milliseconds. In another setup.5h. The first one (ancestor param) means that if compound module doesn’t have such a parameter. with the following differences: 24 . ref param takes the parameter by reference.7. in search for an optimum: one defines a parameter at the highest level of the model. // 0. parameters: propagationDelay = 560ms. The syntax for the latter is submod. // 390. reference parameters may be used to propagate status values to neighbouring modules.param or submod[index]. String constants String constants use double quotes. and lets other modules take it by reference – then if you change the parameter value at runtime (manually or from a simple module). minutes or hours: .560s connectionTimeout = 6m 30s 500ms.1 Constants Numeric and string constants Numeric constants are accepted in their usual decimal or scientific notations. ref should also be used very sparingly. There are two keywords that you can use with a parameter name: ancestor and ref. 3. ancestor is considered bad practice because it violates the encapsulation principle and can only be checked at runtime..7.OMNeT++ Manual – The NED Language 3.7.3 Operators The operators supported in NED are similar to C/C++ operators. One possible use is tuning a model at runtime.
bitwise complement power-of multiply. 25 .. Similarly. >= <. then the result is converted back to double. doubles are converted to unsigned long 2 using the C/C++ builtin conversion (type cast).out. The following example describes a router with several ports and one routing unit.in. // one PPP for each input gate parameters: interfaceId = 1+index. the operation is performed. ## ?: Meaning unary minus.3.. Here’s the complete list of operators. in order of decreasing precendence: Operator -. the operands are converted to long. #) have been raised to bind stronger than relational operations. module Router gates: in: in[].7. // one gate pair for each port out[sizeof(in)]. 2 In case you are worried about long values being not accurately represented in doubles. then the result is converted back to double.port[i]. divide. «. and integer numbers in that range are represented without rounding errors. For the bitwise operators.4 The sizeof() and index operators A useful operator is sizeof(). subtract bitwise shift bitwise and.sizeof(in)-1 do in[i] --> port[i]. For modulus (%). !. out: out[]. greater or equal less. |. /. gatesizes: in[sizeof(in)]. % +. The index operator gives the index of the current submodule in its module vector. or.. less or equal logical operators and. connections: for i = 0. IEEE-754 doubles have 52 bit mantissas. ||. # == != >. this is not the case. out[i] <-. ∼ ^ *. » &. // 1. the operands are converted to bool using the C/C++ builtin conversion (type cast). modulus add. |. the operation is performed.OMNeT++ Manual – The NED Language • ^ is used for power-of (and not bitwise XOR as in C) • # is used for logical XOR (same as != between logical values). This precedence is usually more convenient than the C/C++ one. We assume that gate vectors in[] and out[] have the same size. negation. and ## is used for bitwise XOR • the precedence of bitwise operators (&. routing: RoutingUnit. which gives the size of a vector gate. xor the C/C++ “inline if ” 3. or. xor equal not equal greater. submodules: port: PPPInterface[sizeof(in)].2. for the logical operators &&. <= &&. || and ##. All values are represented as doubles.
out --> routing. Element tag names and "*" can have an optional predicate in the form "[position]" or "[@attribute=’value’]". From the C++ code you’d access the XML element like this: cXMLElement *rootelement = par("xmlparam"). point them to XML files or to specific elements inside XML files.OMNeT++ Manual – The NED Language port[i]. You can then navigate the document tree. This feature is meant to facilitate merging several smaller XML config files into a single larger one. If the expression matches several elements. "//" means an element any levels under the current element.7.5 The xmldoc() operator The xmldoc() operator can be used to assign XML-type parameters. Expression syntax is the following: • An expression consists of path components (or "steps") separated by "/" or "//".xml") or [Parameters] **.in <-.config = xmldoc("conf. 26 .ini: [Parameters] **. and store it in variables or your internal data structure. • A path component can be an element tag name.g. • "/" means child element (just as e. endfor. cXMLElement is documented in Chapter 6." or "..". "/config/profile[@id=’2’]"). xmldoc() has two flavours: one accepts a file name. port[i].routing. Examples: xmlparam = xmldoc("someconfig. in /usr/bin/gcc). You can also read XML parameters from omnetpp.xml").6 XML documents and the XPath subset supported xmldoc() with two arguments accepts an XPath-like expression to select an element within the document.out[i]. extract the information you need.7. details are documented below. OMNeT++ supports a subset of the XPath 1. the second accepts a file name plus an XPath-like expression which selects an element inside the XML file. the first element (in preorder depth-first traversal) will be selected.xmlValue(). xmlparam = xmldoc("someconfig. endmodule 3.config = xmldoc("all-in-one. ".in[i]. The cXMLElement class provides a DOM-like access to the XML document. "/config/interfaces/interface[2]") 3.interface[*].interface[*]. Positions start from zero.xml". "*".xml".0 specification. that is.
Such parameters. it is only evaluated once at the beginning of the simulation. These interpretations are consistent with the XPath specification. log(). return different values each time they are evaluated. Random variate functions use one of the random number generators (RNGs) provided by OMNeT++. parent element. If the parameter is declared as const. • functions that generate random variables: uniform. ceil().7 Functions In NED expressions.7. but you can specify which one is to be used. unless declared as const. etc.7.". and subsequent queries on the parameter will always return the same value. floor(). alternative axis syntax (using "::") and more powerful predicates. and an element with any tag name.9.7. for our purposes (finding elements in XML config files) the above support is sufficient. see 3.h> library functions: exp(). respectively. 27 . It is possible to add new ones. exponential. OMNeT++ has the following predefined distributions: Function Description Continuous distributions 3 While the XPath specification defines other axes. 3. Examples: • /foo – the root element which must be called <foo> • /foo/bar – first <bar> child of the <foo> root element • //bar – first <bar> anywhere (depth-first search!) • /*/bar – first <bar> child of the root element which may have any tag name • /*/*/bar – first <bar> child two levels below the root element • /*/foo[0] – first <foo> child of the root element • /*/foo[1] – second <foo> child of the root element • /*/foo[@color=’green’] – first <foo> child which has attribute "color" with value "green" • //bar[1] – a <bar> element anywhere which is the second <bar> among its siblings • //*[@color=’yellow’] – any element anywhere which has attribute "color" with value "yellow" • //*[@color=’yellow’]/foo/bar – first <bar> child of first <foo> child of a "yellow-colored" element anywhere 3 3. By default this is generator 0. you can use the following mathematical functions: • many of the C language’s <math..OMNeT++ Manual – The NED Language • ".8 Random values Expressions may contain random variates from different distributions. cos(). "." and "*" mean current element. sin(). normal and others were already discussed.
rng=0) uniform integer from a. alpha2. c. 1 // exponential with mean=5 (thus parameter=0..2.b where b>0 triang(a. rng=0) binomial distribution with parameters n>=0 and 0<=p<=1 geometric(p. rng=0) binomial distribution with parameters n>0 and 0<=p<=1 poisson(lambda.9). rng=0) generalized Pareto distribution with parameters a. b. 0.. s. Examples: intuniform(0. 3. rng=0) student-t distribution with i>0 degrees of freedom cauchy(a. beta. rng=0) Weibull distribution with parameters a>0.9 Defining new functions To use user-defined functions. p. The C++ function must take 0. 3. rng=0) beta distribution with parameters alpha1>0.1. one has to code the function in C++. the functions will use random number generator 0. rng=0) triangular distribution with parameters a<=b<=c. b. and you can easily add new ones (see section 3.3) // one of: 0. 2. rng=0) Poisson distribution with parameter lambda uniform(a. rng=0) gamma distribution with parameters alpha>0. .10)/10 exponential(5) 2+truncnormal(5. 0.2) // normal distr with mean 7 truncated to >=2 values The above distributions are implemented with C functions. beta>0 beta(alpha1. or 4 arguments of type double and return a double.b bernoulli(p.7. rng=0) exponential(mean. rng=0) If you do not specify the optional rng argument. b. a!=c lognormal(m. rng=0) normal(mean. rng=0) Cauchy distribution with parameters a. b. The function must be registered in one of the C++ 28 . p. 1.7. rng=0) lognormal distribution with mean m and variance s>0 weibull(a. b. Your distributions will be treated in the same way as the built-in ones. normal distribution truncated to nonnegative rng=0) values gamma_d(alpha.b) exponential distribution with the given mean normal distribution with the given mean and standard deviation truncnormal(mean. b and shift c Discrete distributions intuniform(a. stddev...9. rng=0) geometric distribution with parameter 0<=p<=1 negbinomial(n. b.OMNeT++ Manual – The NED Language uniform distribution in the range [a. c. alpha2>0 erlang_k(k. 0. b>0 pareto_shifted(a. rng=0) Erlang distribution with k>0 phases and the given mean chi_square(k. mean. stddev. rng=0) result of a Bernoulli trial with probability 0<=p<=1 (1 with probability p and 0 with probability (1-p)) binomial(n. rng=0) chi-square distribution with k>0 degrees of freedom student_t(i.
In this case you have to register the wrapper function with the Define_Function2() macro which allows a function to be registered with a name different from the name of the function that implements it.8 Parameterized compound modules With the help of conditional parameter and gatesize blocks and conditional connections. _wrap_factorial. double b) { return (a+b)/2. 3. you can create wrapper function that takes all doubles and does the conversion.h> double average(double a. submodules: proc: Processor parameters: av = average(a. endmodule If your function takes parameters that are int or long or some other type which is not double. The compound module is built using three module types: Application. DataLink.1 Examples Example 1: Router The following example contains a router module with the number of ports taken as parameter. } static double _wrap_factorial(double k) { return factorial((int)k).h> long factorial(int k) { . } Define_Function2(factorial. 3. After this. } Define_Function(average.OMNeT++ Manual – The NED Language files with the Define_Function() macro. the average() function can be used in NED files: module Compound parameter: a. RoutingModule.b. An example function (the following code must appear in one of the C++ sources): #include <omnetpp. 2)..8. The number 2 means that the average() function has 2 arguments. We assume 29 .. one can create complex topologies. 1). You can do the same if the return value differs from double.b). #include <omnetpp.
routing. out[1]. numOfPorts: const.input[numOfPorts] <-.node[i+1]. portIf[i].numOfPorts-1 do routing.output. buffersize = rteBuffersize. gatesizes: input[numOfPorts+1]. gatesizes if index==0 || index==count-1: in[1]. connections: for i=0. endmodule 30 .out[i!=0 ? 1 : 0] --> node[i+1]. endfor.input.output[numOfPorts] --> localUser. portIf[i]. submodules: node : Node [count] gatesizes: in[2]. portIf: PPPNetworkInterface[numOfPorts] parameters: retryCount = 5. routing: RoutingUnit parameters: processingDelay = rteProcessingDelay.inputPorts[i].toHigherLayer.portIf[i].fromHigherLayer.count-2 do node[i]. routing. routing. endfor. module Router parameters: rteProcessingDelay.in[0].output[i] --> portIf[i].toPort --> outputPorts[i].OMNeT++ Manual – The NED Language that their definition is in a separate NED file which we will import.input[i] <-.fromPort <-. connections: for i = 0. out[2]. gates: in: inputPorts[].localUser. output[numOfPorts+1]. one can create a chain of modules like this: module Chain parameters: count: const.. node[i].. endmodule Example 2: Chain For example.in[i!=0 ? 1 : 0] <-. import "modules". submodules: localUser: Application. windowSize = 2. rteBuffersize. out: outputPorts[].out[0].
downright --> node[2*i+2]. Each node except the ones at the lowest level of the tree has to be connected to exactly two nodes. simple BinaryTreeNode gates: in: fromupper.downleft --> node[j]. submodules: node: BinaryTreeNode [ 2^height-1 ].fromupper. node[i].. connections nocheck: for i=0. module BinaryTree2 parameters: height: const. connectedness. connections nocheck: for i = 0. endfor. so we can use a single loop to create the connections.downright --> node[j]. The following code generates a random subgraph of a full graph: module RandomGraph parameters: count: const.OMNeT++ Manual – The NED Language Example 3: Binary Tree One can use conditional connections to build a binary tree. endsimple module BinaryTree parameters: height: const. but this error message is turned off here with the nocheck modifier.2^height-2.. out: downleft. Consequently. j = 0.2^height-2 do node[i].0 31 .fromupper if j==2*i+1. endmodule Example 4: Random graph Conditional connections can also be used to generate random topologies. An alert reader might notice that there is a better alternative to the above code.downleft --> node[2*i+1]. endmodule Note that not every gate of the modules will be connected. submodules: node: BinaryTreeNode [ 2^height-1 ]. node[i].fromupper.. // 0. it is the simple modules’ responsibility not to send on a gate which is not leading anywhere. By default. out: downright. endfor. an unconnected gate produces a run-time error message when the simulation is started.2^(height-1)-2 do node[i]. The following NED code loops through all possible node pairs.0<x<1.fromupper if j==2*i+2. and creates the connections needed for a binary tree.
.. BinaryTree can also be regarded as an example of this pattern where the inner j loop is unrolled. j=0.. endfor..in[i] if i!=j && uniform(0.out[j] --> node[j]. endmodule Note the use of the nocheck modifier here too. The RandomGraph compound module (presented earlier) is an example of this pattern.out[j] --> node[rightNodeIndex(i.1)<connectedness. endfor.N-1 do node[i].Nnodes.2 Design patterns for compound modules Several approaches can be used when you want to create complex topologies which have a regular structure.out[. out[count].] if condition(i.in[. Though this pattern is very general. gatesizes: in[count].. ‘Enumerate All Connections’ A third pattern is to list all connections within a loop: 32 .. It can be generalized like this: for i=0.j) function can be formulated.. its usage can be prohibitive if the N number of nodes is high and the graph is sparse (it has much fewer connections that N 2 ).j). ‘Connections of Each Node’ The pattern loops through all nodes and creates the necessary connections for each one.8..j)]. the condition would return whether node j is a child of node i or vica versa. 3.j) can be formulated. A condition is used to “carve out” the necessary interconnection from the full graph: for i=0.. to turn off error messages given by the network setup code for unconnected gates. three of them are described below.N-1. For example. The Hypercube compound module (to be presented later) is a clear example of this approach. but the pattern can generate any graph where an appropriate condition(i..OMNeT++ Manual – The NED Language submodules: node: Node [count].count-1. connections nocheck: for i=0. The applicability of this pattern depends on how easily the rightNodeIndex(i. The following two patterns do not suffer from this drawback.Nconns(i)-1 do node[i]. j=0.] --> node[j]. endfor. j=0.count-1 do node[i]. ‘Subgraph of a Full Graph’ This pattern takes a subset of the connections of a full graph. when generating a tree structure.in[j].
and you can use them wherever needed in you simulations. With topology templates. butterfly.8. An example: hypercube The concept is demonstrated on a network with hypercube interconnection. You can write such modules which implement mesh. perfect shuffle or other topologies. The pattern can also be used to create a random subset of a full graph with a fixed number of connections. When building an N-dimension hypercube. 3. e.Nconnections-1 do node[leftNodeIndex(i)]. 3. hypercube. you can resort to specifying constant submodule/gate vector sizes and explicitly listing all connections.3 Topology templates Overview Topology templates are nothing more than compound modules where one or more submodule types are left as parameters (using the like phrase of the NED language). The pattern can be used if leftNodeIndex(i) and rightNodeIndex(i) mapping functions can be sufficiently formulated.in[..].OMNeT++ Manual – The NED Language for i=0. nodetype. endsimple module Hypercube parameters: dim.ned): simple Node gates: out: out[]. like you would do it in most existing simulators.out[. endfor. in: in[]. you can reuse interconnection structure..2: Hypercube topology The hypercube topology template is the following (it can be placed into a separate file. submodules: 33 .2). The Serial module is an example of this approach where the mapping functions are extremely simple: leftNodeIndex(i)=i and rightNodeIndex(i)=i+1. we can exploit the fact that each node is connected to N others which differ from it only in one bit of the binary representations of the node indices (see Fig.... Figure 3. In the case of irregular structures where none of the above patterns can be employed.g hypercube.] --> node[rightNodeIndex(i)].
endnetwork If you put the nodetype parameter to the ini file. simple Hypercube_PE gates: out: out[].out[j] --> node[i # 2^j]. while the second one is better for writing larger scale.g. for example when the topology information comes from an external source like a network management program. Perl also has extensions to access SQL databases. in[dim]. 3. you substitute the name of an existing module type (e. nodetype = "Hypercube_PE". in: in[]. etc. The module type implements the algorithm the user wants to simulate and it must have the same gates that the Node type has. In the next sections we examine both methods.9 Large networks There are situations when using hand-written NED files to describe network topology is inconvenient. The topology template code can be used through importing the file: import "hypercube.dim-1 do node[i].9. "DeflectionRoutingNode".g.1 Generating NED files Text processing programs like awk or perl are excellent tools to read in textual data files and generate NED files from them. 34 . each algorithm implemented with a different simple module type – you just have to supply different values to nodetype.. "Hypercube_PE") for the nodetype parameter.ned". you can use the same simulation model to test e. so it can also be used if the network topology is stored in a database. several routing algorithms in a hypercube.. connections: for i=0. building the network from C++ code The two solutions have different advantages and disadvantages. 3. endmodule When you create an actual hypercube. The first is more useful in the model development phase. j=0. endsimple network hypercube: Hypercube parameters: dim = 4. generating NED files from data files 2. In such case.OMNeT++ Manual – The NED Language node: nodetype[2^dim] like Node gatesizes: out[dim].in[j].2^dim-1. such as "WormholeRoutingNode". more productized simulation programs. you have two possibilities: 1. // # is bitwise XOR endfor.
10 XML binding for NED files To increase interoperability. nedtool-created _n. in section 4. e.9.ned. Using nedtool as NED compiler to generate C++ code: nedtool wireless. this method is recommended when the simulation program has to be somewhat more productized.OMNeT++ Manual – The NED Language The advantage is that the necessary awk or perl program can be written in a relatively short time. 3.org. One practical application of XML is the opp_neddoc documentation generation tool which is described in Chapter 11. Since writing such code is more complex than letting perl generate NED files. stylesheet transformations (XSLT) can be used to extract information from NED files.11). a network design tool. and it defines a "grammar" for XML files. 35 . 3. The nedtool program (which also translates NED to C++ code) can be used to convert between NED and XML. The code would read the topology data from data files or a database. Several switches control the exact content and details of the resulting XML as well as the amount of checks made on the input.cc files output by nedtool. Converting the XML representation back to NED: nedtool -n wireless.g.xml.2 Building the network from C++ code Another alternative is to write C++ code which becomes part of the simulation executable.xml The result is wireless_n. for example when OMNeT++ and the simulation model is embedded into a larger program. You can generate C++ code from the XML format. The code which you need to write would be similar to the *_n. create NED files from external info present in XML form.ned It generates wireless_n. 4 XML is well suited for machine processing. and any XML file which corresponds to the NED DTD can be converted to NED. Converting a NED file to XML: nedtool -x wireless. For example.cc C++ files compile much faster. or the other way round.ned The resulting code is more compact and less redundant than the one created by nedtool’s predecessor nedc. More info can be found on the W3C web site. The resulting NED files can either be translated by nedtool into C++ and compiled in. www. or loaded dynamically. using dynamic module creation (to be described later. and build the network directly. the NED-creating program can be easily modified. and it is inexpensive to maintain afterwards: if the structure of the data files change. As a result. too: nedtool wireless. NED files (and also message definition files) have an XML representation.xml 4 DTD stands for Document Type Descriptor.w3. Any NED file can be converted to XML.
OMNeT++ Manual – The NED Language
36
OMNeT++ Manual – Simple Modules
Chapter 4
Simple Modules.
4.1
Simulation concepts
This section contains a very brief introduction into how Discrete Event Simulation (DES) works, in order to introduce terms we’ll use when explaining OMNeT++ concepts and implementation.
4.1.1
Discrete Event Simulation (in contrast to continuous systems where state changes are continuous). Those systems that can be viewed as Discrete Event Systems can be modeled using Discrete Event Simulation. (Other systems can be modelled e.g. with continuous simulation models.) For example, computer networks are usually viewed as discrete event systems. Some of the events are: • start of a packet transmission • end of a packet transmission • expiry of a retransmission timeout This implies that between two events such as start of a packet transmission and end of a packet transmission, nothing interesting happens. That is, the packet’s state remains being transmitted. Note that the definition of “interesting” events and states always depends on the intent and purposes of the person doing the modeling. If we were interested in the transmission of individual bits, we would have included something like start of bit transmission and end of bit transmission among our events. The time when events occur is often called event timestamp ; with OMNeT++ we’ll say arrival time (because in the class library, the word “timestamp” is reserved for a user-settable attribute in the event class). Time within the model is often called simulation time, model time or virtual time as opposed to real time or CPU time or which refers to how long the simulation program has been running or how much CPU time it has consumed. 37
OMNeT++ Manual – Simple Modules
4.1.2
The event loop first, initialization step usually builds the data structures representing the simulation model, calls any user-defined initialization code, and inserts initial events into the FES to ensure that the simulation can start. Initialization strategy can differ considerably from one simulator to another. The subsequent loop consumes events from the FES and processes them. Events are processed in strict timestamp order in order to maintain causality, that is, to ensure that no more events left (this happens rarely in practice), or when it isn’t necessary for the simulation to run further because the model time or the CPU time has reached a given limit, or because the statistics have reached the desired accuracy. At this time, before the program exits, the simulation programmer will typically want to record statistics into output files.
4.1.3
Simple modules in OMNeT++
In OMNeT++, events occur inside simple modules. Simple modules encapsulate C++ code that generates events and reacts to events, in other words, implements the behaviour of the model. The user creates simple module types by subclassing the cSimpleModule class, which is part of the OMNeT++ class library. cSimpleModule, just as cCompoundModule, is derived from a common base class, cModule. cSimpleModule, although stuffed with simulation-related functionality, doesn’t do anything useful by itself – you have to redefine some virtual member functions to make it do useful work. These member functions are the following: • void initialize() • void handleMessage(cMessage *msg) • void activity() • void finish() 38
OMNeT++ Manual – Simple Modules In the initialization step, OMNeT++ builds the network: it creates the necessary simple and compound modules and connects them according to the NED definitions. OMNeT++ also calls the initialize() functions of all modules. The handleMessage() and activity() functions are called during event processing. This means that the user will implement the model’s behavior in these functions. handleMessage() and activity() implement different event processing strategies: for each simple module, the user has to redefine exactly one of these functions. handleMessage() is a method that is called by the simulation kernel when the module receives a message. activity() is a coroutine-based solution which implements the process interaction approach (coroutines are non-preemptive (i.e. cooperative) threads). Generally, it is recommended that you prefer handleMessage() to activity() – mainly because activity() doesn’t scale well. Later in this chapter we’ll discuss both methods including their advantages and disadvantages. Modules written with activity() and handleMessage() can be freely mixed within a simulation model. The finish() functions are called when the simulation terminates successfully. The most typical use of finish() is the recording of statistics collected during simulation.
4.1.4
Events in OMNeT++
OMNeT++ uses messages to represent events.. Simulation time in OMNeT++ is stored in the C++ type simtime_t, which is a typedef for double. Events are consumed from the FES in arrival time order, to maintain causality. More precisely, given two messages, the following rules apply: 1. the message with earlier arrival time is executed first. If arrival times are equal, 2. the one with smaller priority value is executed first. If priorities are the same, 3. the one scheduled or sent earlier is executed first. Priority is a user-assigned integer attribute of messages. Storing simulation time in doubles may sometimes cause inconveniences. Due to finite machine precision, two doubles calculated in two different ways do not always compare equal even if they mathematically should be. For example, addition is not an associative operation when it comes to floating point calculations: (x + y) + z! = x + (y + z)! (See [Gol91]). This means that it is generally not a good idea to rely on arrival times of two events being the same unless they are calculated in exactly the same way. One may suggest introducing a small simtime_precision parameter in the simulation kernel that would force t1 and t2 to be regarded equal if they are “very close” (if they differ less than simtime_precision). This approach, however, would be more likely to cause confusion than actually cure the problem.
4.1. 39
OMNeT++ Manual – Simple Modules
4.2
4.2.1
Packet transmission modeling
Delay, bit error rate, data rate
Connections can be assigned three parameters, which facilitate the modeling of communication networks, but can be useful for other models too: • propagation delay (sec) • bit error rate (errors/bit) • data rate (bits/sec) Each of these parameters is optional. One can specify link parameters individually for each connection, or define link types (also called channel types) once and use them throughout the whole model. The propagation delay is the amount of time the arrival of the message is delayed by when it travels through the channel. Propagation delay is specified in seconds. The bit error rate has influence on the transmission of messages through the channel. The bit error rate (ber) is the probability that a bit is incorrectly transmitted. Thus, the probability that a message of n bits length is transferred without bit errors is: Pnobiterror = (1 − ber)l ength The message has an error flag which is set in case of transmission errors. The data rate is specified in bits/second, and it is used for transmission delay calculation. The sending time of the message normally corresponds to the transmission of the first bit, and the arrival time of the message corresponds to the reception of the last bit (Fig. 4.1).
Figure 4.1: Message transmission The above model may not be suitable to model all protocols. In Token Ring and FDDI, stations start to repeat bits before the whole frame arrives; in other words, frames “flow through” the stations, being delayed only a few bits. In such cases, the data rate modeling feature of OMNeT++ cannot be used. If a message travels along a route, passing through successive links and compound modules, the model behaves as if each module waited until the last bit of the message arrives and only started its transmission afterwards. (Fig. 4.2). Since the above effect is usually not the desired one, typically you will want to assign data rate to only one connection in the route. 40
This implementation was chosen because of its run-time efficiency. within the send() call. every calculation is done once.2.3: Connection with a data rate While a message is under transmission. In the actual implementation of queuing the messages at busy gates and modeling the transmission delay. other messages have to wait until the transmission is completed. a message will have a certain nonzero transmission time.2 Multiple transmissions on links If a data rate is specified for a connection. Figure 4. depending on the length of the connection.OMNeT++ Manual – Simple Modules Figure 4. it is not scheduled individually for each link. If the connection with a data rate is not directly connected to the simple module’s output gate but is the second one in the route. you have to check the second gate’s busy condition. but the beginning of the modeled message transmission will be delayed. Implementation of message sending Message sending is implemented like this: the arrival time and the bit error flag of a message are calculated immediately after the send() (or a similar) function is invoked. but rather. That is. The OMNeT++ class library provides functions to check whether a certain output gate is transmitting or to learn when it finishes transmission.2: Message sending over multiple channels 4. This implies that a message that is passsing through an output gate. just as if the gate had an internal queue for the messages waiting to be transmitted. You can still send messages while the gate is busy. if the message travels through several links before it reaches its destination. 41 . “reserves” the gate for a given period (“it is being transmitted”).
If you change the delay (or the bit error rate. gates do not have internal queues. if link parameters change while a message is “under way” in the model. events and messages are separate entities. output gates also have packet queues where packets will be buffered until the channel is ready (available for transmission). OMNeT++ gates don’t have associated queues. you can chose one of two paths: • write a sender module such that it schedules events for when the gate finishes its current transmission and sends then. a send operation includes placing the message in the packet queue and scheduling an event. The approach of some other simulators Note that some simulators (e. the C++ source for a Sliding Window Protocol implementation might look like this: // file: swp. you can implement channels with simple modules (“active channels”). For example. Then the message will be stored in the event queue (FES) until the simulation time advances to its arrival time and it is retrieved by its destination module. The drawback is. However. OPNET) assign packet queues to input gates (ports).OMNeT++ Manual – Simple Modules messages do not actually queue up in gates. that is. With that approach. the INET Framework follows this approach. • alternatively. OMNeT++’s approach is potentially faster than the solution mentioned above because it doesn’t have the enqueue/dequeue overhead and also spares an event creation. In some implementations.1 Defining simple module types Overview The C++ implementation of a simple module consists of: • declaration of the module class: your class subclassed from cSimpleModule (either directly or indirectly) • a module type registration (Define_Module() or Define_Module_Like() macro) • implementation of the module class For example.3 4. Similar for data rate: if a data rate changes during the simulation. If it is important to model gates and channels with changing properties. and messages sent are buffered at the destination module (or the remote end of the link) until they are received by the destination module. the modeling of messages sent “just before” the parameter change will not be accurate. or the data rate) of a link during simulation. The place where sent but not yet received messages are buffered is the FES. the change will affect only the messages that are sent after the change. as the time when each gate will finish transmission is known at the time of sending the message. 4. In OMNeT++ one can implement point-to-point transmitter modules with packet queues if needed.g. the arrival time of the message can be calculated in advance. Consequence The implementation has the following consequence. all subsequent messages will be modelled correctly.3. which signals the arrival of the packet. although it should. Namely.cc #include <omnetpp. that changes to channel parameters do not take effect immediately. Instead.h> 42 . that message will not be affected by the parameter change.
3.. endsimple) to determine what gates and parameters this module should have. Suppose you have three different C++ module classes (TokenRingMAC. Define_Module() should not be put into header files. toHigherLayer. This line tells OMNeT++ that you want to use the SlidingWindowProtocol C++ class as a simple module type. out: toNetw.. // module type registration: Define_Module( SlidingWindowProtocol ). because the compiler generates code from it which should only appear in one . and that it should look for an associated NED simple module declaration with the same name (simple SlidingWindowProtocol .2 The module type registration The above example contained the following module type declaration: Define_Module(SlidingWindowProtocol).0) virtual void handleMessage(cMessage *msg). we should have an associated NED declaration which might look like this: // file: swp.. the Define_Module_Like() macro takes two arguments and associates the class with a NED simple module declaration of a different name. EthernetMAC.ned simple SlidingWindowProtocol parameters: windowSize: numeric const. FDDIMAC) which have identical gates and parameters. }. Then you can create a single NED declaration.cc file. single NED interface An alternative form of the module type registration. you can reuse an existing NED simple module definition for several simple module types.3 Several modules. You can use this form when you have several modules which share the same interface.3).OMNeT++ Manual – Simple Modules // module class declaration: class SlidingWindowProtocol : public cSimpleModule { Module_Class_Members(SlidingWindowProtocol. To support submodule types defined as parameters in NED files (see section 3. 4. } In order to be able to refer to this simple module type in NED files.cSimpleModule. endsimple 4.3. gates: in: fromNetw..5. // implementation of the module class: void SlidingWindowProtocol::handleMessage(cMessage *msg) { . fromHigherLayer. GenericMAC for them and write the following module type registrations in the C++ code: 43 .
GenericMAC). handleMessage(). activity(). // if macType=="EthernetMAC" --> OK! . finish()). you have to write a constructor and some more functions. (This will be discussed in detail later. or write them yourself. 44 . Section 3. Define_Module_Like(EthernetMAC. endmodule The macType parameter should take the value "TokenRingMAC". you have two choices: 1. GenericMAC). }. but stacksize needs some explanation..cSimpleModule.) As an example. either use a macro which expands to the “stock” version of the functions 2. Define_Module_Like(FDDIMAC.4 The class declaration As mentioned before.OMNeT++ Manual – Simple Modules Define_Module_Like(TokenRingMAC. baseclass. simple module classes have to be derived from cSimpleModule (either directly or indirectly). The value for the parameter can even be given in the ini file. The first two arguments are obvious (baseclass is usually cSimpleModule). GenericMAC). the module code runs as a coroutine. This gives you a powerful tool to customize simulation models (see also Topology templates. EthernetMAC.3).0) .. For simple modules implemented with handleMessage() it should be zero. In addition to overwriting some of the previously mentioned four member functions (initialize(). you use the Module_Class_Members() macro: Module_Class_Members(classname. submodules: mac: macType like GenericMAC.8. 4.. FDDIMAC module types in your NED files. "EthernetMAC" or "FDDIMAC". stacksize). so it will need a separate stack of 16-32K. and a submodule of the appropriate type will be created. so when writing the C++ class declaration.. Using macro to declare the constructor If you choose the first solution. because NED doesn’t know about them (their names don’t appear in any NED file you could import). You won’t be able to directly refer to the TokenRingMAC. but you can use them wherever a submodule type was defined as a parameter to the compound module: module Host parameters: macType: string.3. Some of this task can be automated. but if you use activity(). the class declaration class SlidingWindowProtocol : public cSimpleModule { Module_Class_Members(SlidingWindowProtocol.
handleMessage() will be used.g. because it will be called by OMNeT++-generated code. stacksize).OMNeT++ Manual – Simple Modules expands to something like this: class SlidingWindowProtocol : public cSimpleModule { public: SlidingWindowProtocol(const char *name. The constructor should take the following arguments (which also have to be passed further to the base class): • const char *name. Expanded form of the constructor If you have data members in the class that you want to initialize in the constructor. If you make a mistake (e. }. activity() will be used. unsigned stacksize) : cSimpleModule(name. cModule *parent. cModule *parent. Then you have to write the constructor yourself. parent. you cannot use the Module_Class_Members() macro. . 45 . unsigned stacksize=0) : cSimpleModule(name. queue("queue") { // initialize data members } Stack size decides between handleMessage() and activity() • if the specified stack size is zero. you forget to set zero stack size for a handleMessage() simple module): the default versions of the functions issue error messages telling you what the problem is. unsigned stacksize=0). • if it is greater than zero. stacksize) {} . parent... TokenRingMAC(const char *name. // a data member TokenRingMAC(const char *name. }. cModule *parent. the coroutine stack size You should not change the number or types of the arguments taken by the constructor. An example: class TokenRingMAC : public cSimpleModule { public: cQueue queue. which is the name of the module • cModule *parentmodule... pointer to the parent module • unsigned stacksize=stacksize.
OMNeT++ Manual – Simple Modules
4.3.
4.4
Adding functionality to cSimpleModule
This section discusses cSimpleModule’s four previously mentioned member functions, intended to be redefined by the user: initialize(), handleMessage(), activity() and finish().
4.4.1
handleMessage()
Function called for each event The idea is that at each event (message arrival) we simply call a user-defined function. This function, handleMessage(cMessage *msg) is a virtual member function of cSimpleModule which does nothing by default – the user has to redefine first receiving a message from other modules. Programming with handleMessage() To use the handleMessage() mechanism in a simple module, you must specify zero stack size for the module. This is important, because this tells OMNeT++ that you want to use handleMessage() and not activity(). Message/event related functions you can use in handleMessage(): • send() family of functions – to send messages to other modules 46
OMNeT++ Manual – Simple Modules • scheduleAt() – to schedule an event (the module “sends a message to itself ”) • cancelEvent() – to delete an event scheduled with scheduleAt() You cannot use the receive() family: • state (e.g. IDLE/BUSY, CONN_DOWN/CONN_ALIVE/...) • other variables which belong to the state of the module: retry counts, packet queues, etc. • values retrieved/computed once and then stored: values of module parameters, gate indices, routing information, etc. • pointers of message objects created once and then reused for timers, timeouts, etc. • variables/objects for statistics collection first call(s) to handleMessage(). After the first. Application area handleMessage() is in most cases a better choice than activity(): 1. When you expect the module to be used in large simulations, involving several thousand modules. In such cases, the module stacks required by activity() would simply consume too much memory. 2. For modules which maintain little or no state information, such as packet sinks, handleMessage() is more convenient to program. 3. Other good candidates are modules with a large state space and many arbitrary state transition possibilities (i.e. where there are many possible subsequent states for any state). Such algorithms are difficult to program with activity(), or the result is code which is better suited for handleMessage() (see rule of thumb below). Most communication protocols are like this. Example 1: Protocol models: 47
OMNeT++ Manual – Simple Modules class FooProtocol : public cSimpleModule { protected: // state variables // ... virtual void processMsgFromHigherLayer(cMessage *packet); virtual void processMsgFromLowerLayer(FooPacket *packet); virtual void processTimer(cMessage *timer); public: Module_Class_Members(FooProtocol, cSimpleModule, 0);. Example 2: Simple traffic generators and sinks The code for simple packet generators and sinks programmed with handleMessage() might be as simple as the following pseoudocode: PacketGenerator::handleMessage(msg) { create and send out a new packet; schedule msg again to trigger next call to handleMessage; } PacketSink::handleMessage(msg) { delete msg; } Note that PacketGenerator will need to redefine initialize() to create m and schedule the first event. The following simple module generates packets with exponential inter-arrival time. (Some details in the source haven’t been discussed yet, but the code is probably understandable nevertheless.) class Generator : public cSimpleModule { 48
OMNeT++ Manual – Simple Modules Module_Class_Members(Generator,cSimpleModule,0) // note zero stack size!); } Example 3: Bursty traffic generator A bit more realistic example is to rewrite our Generator to create packet bursts, each consisting of burstLength packets. We add some data members to the class: • burstLength will store the parameter that specifies how many packets a burst must contain, • burstCounter will count in how many packets are left to be sent in the current burst. The code: class BurstyGenerator : public cSimpleModule { Module_Class_Members(Generator,cSimpleModule,0) // note the zero stack size!); } 49
msg). msg). } } Pros and Cons of using handleMessage() Pros: • consumes less memory: no separate stack needed for simple modules • fast: function call is faster than switching between coroutines Cons: • local variables cannot be used to store state information • need to redefine initialize() Usually. • Ptolemy (UC Berkeley) uses a similar method. OMNeT++’s FSM support is described in the next section. • SMURPH (University of Alberta) defines a (somewhat eclectic) language to describe FSMs. and uses a precompiler to turn it into C++ code. 50 .OMNeT++ Manual – Simple Modules void BurstyGenerator::handleMessage(cMessage *msg) { // generate & send packet cMessage *pkt = new cMessage.0). often topped with something like a state machine (FSM) which hides the underlying function calls. scheduleAt(simTime()+exponential(5. // if this was the last packet of the burst if (--burstCounter == 0) { // schedule next burst burstCounter = burstLength. • NetSim++ clones OPNET’s approach. Such systems are: • OPNETT M which uses FSM’s designed using a graphical editor.0). send(pkt. handleMessage() should be preferred to activity(). Other simulators Many simulation packages use a similar approach. } else { // schedule next sending within burst scheduleAt(simTime()+exponential(1. "out").
(The simulation can continue if there are other modules which can run.2 activity() Process-style description With activity(). etc.4. ie. you can code the simple module much like you would code an operating system process or a thread. When the activity() function exits. For example.) The most important functions you can use in activity() are (they will be discussed in detail later): • receive() – to receive messages (events) • wait() – to suspend execution for some time (model time) • send() family of functions – to send messages to other modules • scheduleAt() – to schedule an event (the module “sends a message to itself ”) • cancelEvent() – to delete an event scheduled with scheduleAt() • end() – to finish execution of this module (same as exiting the activity() function) The activity() function normally contains an infinite loop. It has also been observed that activity() does not encourage a good programming style. Application area Generally you should prefer handleMessage() to activity(). The main problem with activity() is that it doesn’t scale because every module needs a separate coroutine stack. the module is terminated.OMNeT++ Manual – Simple Modules 4.() } 51 . You can wait for an incoming message (event) at any point of the code. you can suspend the execution for some time (model time!). this is the case when programming a network application. There is one scenario where activity()’s process-style description is convenient: when the process has many states but transitions are very limited. with at least a wait() or receive() call in its body. from any state the process can only go to one or two other states.
Later. state variables inside activity() would become data members in the module class. } } should rather be programmed as: void Sink::handleMessage(cMessage *msg) { delete msg. The body of the infinite loop would then become the body to handleMessage(). 52 . } Activity() is run as a coroutine activity() is run in a coroutine. delete msg. Dynamic module creation will be discussed later. and you’d initialize them in initialize(). and transferTo() involves a switch from one processor stack to another. when otherCoroutine does a transferTo(firstCoroutine) call. there’s no point in using activity() and the code should be written with handleMessage(). execution of the first coroutine will resume from the point of the transferTo(otherCoroutine) call. Example: void Sink::activity() { while(true) { msg = receive(). including local variables are preserved while the thread of execution is in other coroutines. Coroutines are a sort of threads which are scheduled non-preemptively (this is also called cooperative multitasking). If your activity() function contains no wait() and it has only one receive() call at the top of an infinite loop. you may dynamically create them as instances of the simple module above. There are situations when you certainly do not want to use activity(). From one coroutine you can switch to another coroutine by a transferTo(otherCoroutine) call. Then this coroutine is suspended and otherCoroutine will run. The full state of the coroutine.OMNeT++ Manual – Simple Modules wait(some time) receive data on network connection if (connection broken) { continue outer loop // loop back to outer while() } wait(some time) } close connection by sending CLOSE command to transport layer if (close not successful) { // handle error } wait(some time) } } If you have to handle several connections simultaneously. This implies that each coroutine must have its own processor stack.
the simulation kernel transfers the control to the module’s coroutine. so their implementations contain a transferTo(main) call somewhere. reuses events return } Thus. It is important to understand. when the module has an event. however. nor does he need to care about the coroutine library implementation. even before the initial53 . simple modules using activity() are “booted” by events (”starter messages”) inserted into the FES by the simulation kernel before the start of the simulation. time + wait interval) transferTo(main) retrieve current event if (current event is not e) { error } delete e // note: actual impl. and the simulation programmer doesn’t ever need to call transferTo() or other functions in the coroutine library. as implemented in OMNeT++: receive() { transferTo(main) retrieve current event return the event // remember: events = messages } wait() { create event e schedule it at (current sim.OMNeT++ Manual – Simple Modules Coroutines are at the heart of OMNeT++. it will transfer the control back to the simulation kernel by a transferTo(main) call. These starter messages are inserted into the FES automatically by OMNeT++ at the beginning of the simulation. the event loop looks like this (simplified): while (FES not empty and simulation not yet complete) { retrieve first event from FES t:= timestamp of this event transferTo(module containing the event) } That is. It is expected that when the module “decides it has finished the processing of the event”. Initially. because they are where • simulation time elapses in the module. The functions which request events from the simulation kernel are the receive() and wait(). Starter messages Modules written with activity() need starter messages to “boot”. How does the coroutine know it has “finished processing the event”? The answer: when it requests another event. how the event loop found in discrete event simulators works with coroutines. When using coroutines. Their pseudocode. the receive() and wait() calls are special points in the activity() function. and • other modules get a chance to execute.
. state can be stored in local variables of activity() 54 . MySimpleModule::activity() { declare local vars and initialize them initialize statistics collection variables while(true) { . so you can find out if you overestimated the stack needs. Because finish() cannot access the local variables of activity().. 16 or 32 kbytes is usually a good choice. you can store everything (state information. }. { . You do need finish(). Local variables can be initialized at the top of the activity() function. so there isn’t much need to use initialize(). a typical setup looks like this in pseudocode: class MySimpleModule. } } MySimpleModule::finish() { record statistics into file } Pros and Cons of using activity() Pros: • initialize() not needed. This cannot be automated. you have to put the variables and objects containing the statistics into the module class.. finish()... OMNeT++ can also tell you how much stack space a module actually uses.OMNeT++ Manual – Simple Modules ize() functions are called. packet buffers. which occupy a lot of stack space. etc. You still don’t need initialize() because class members can also be initialized at the top of activity(). variables for statistics collection activity(). Coroutine stack size The simulation programmer needs to define the processor stack size for coroutines. Thus. OMNeT++ has a built-in mechanism that will usually detect if the module stack is too small and overflows. if you want to write statistics at the end of the simulation.) in them. but you may need more if the module uses recursive functions or has local variables. initialize() and finish() with activity() Because local variables of activity() are preserved across events.. however.
The calling order is the reverse of the order of initialize(): first submodules. not with a runtime error). Both simple and compound modules have initialize() functions. 4. (The bottom line is that at the moment there is no “official” possibility to redefine initialize() and finish() for compound modules. The philosophy is quite similar to OMNeT++. but after the initial events (starter messages) have been placed into the FES by the simulation kernel. then the encompassing compound module. being “just” a programming language. Other simulators Coroutines are used by a number of other simulation packages: • All simulation software which inherits from SIMULA (e. and only if it terminated normally (i. PARSEC. Future versions of OMNeT++ will support adding these functions to compound modules. • run-time overhead: switching between coroutines is somewhat slower than a simple function call • does not enforce a good programming style: using activity() tends to lead to unreliable. A compound module’s initialize() function runs before that of its submodules. it has a more elegant syntax but far fewer features than OMNeT++.OMNeT++ Manual – Simple Modules • process-style description is a natural programming model in some cases Cons: • limited scalability: coroutine stacks can unacceptably increase the memory requirements of the simulation program if you have several thousands or ten thousands of simple modules. The finish() functions are called when the event loop has terminated.4.e.e.3 initialize() and finish() Purpose initialize() – to provide place for any user setup code finish() – to provide place where the user can record statistics after the simulation has completed When and how they are called The initialize() functions of the modules are invoked before the first event is processed.) This is summarized in the following pseudocode: perform simulation run: build network (i. C++SIM) is based on coroutines. • Many Java-based simulation libraries are based on Java threads. cons outweigh pros and it is a better idea to use handleMessage() instead. the system module and its submodules recursively) 55 . • The simulation/parallel programming language Maisie and its successor PARSEC (from UCLA) also use coroutines (although implemented with “normal” preemptive threads). spaghetti code In most cases. the unofficial way is to write into the nedtool-generated C++ code.g. although all in all the programming model is quite different.
e. finish() is only a good place for writing statistics. } initialize() vs. because OMNeT++ keeps track of objects you create and disposes of them automatically (a sort of automatic garbage collection). initialize(0) is called for all modules. one can use multi-stage initialization. At the beginning of the simulation. Modules have two functions which can be redefined by the user: void initialize(int stage). It cannot track objects that are not derived from cObject. when one-stage initialization provided by initialize() is not sufficient. For each module. destructor Keep in mind that finish() is not always called. Code like that cannot be placed into the constructor since the network is still being set up when the constructor is called. then initialize(1). Cleanup code should go into the destructor. result postprocessing and other operations which are supposed to run only on successful completion. Actually.g.OMNeT++ Manual – Simple Modules insert starter messages for all submodules using activity() do callInitialize() on system module enter event loop // (described earlier) if (event loop terminated normally) // i. This is because modules often need to investigate their surroundings (maybe the whole network) at the beginning of the simulation and save the collected info into internal tables. for a two56 . numInitStages() must be redefined to return the number of init stages required. int numInitStages() const. e. constructor Usually you should not put simulation-related code into the simple module constructor. initialize(2). Garbage collection is discussed in more detail in section 6. however.5. so they may need to be deleted manually by the destructor. so it isn’t a good place for cleanup code which should run every time the module is deleted. Multi-stage initialization In simulation models. you rarely need to write a destructor yourself. etc. finish() vs.12. You can think of it like initialization takes place in several “waves”.
This often makes program code unnecessarily complicated. If you do not redefine the multi-stage initialization functions.4 Reusing module code via subclassing It is often needed to have several variants of a simple module. and the default initialize(int stage) simply calls initialize(). 4. thus the existing one will remain in effect and return 1.0) virtual void recalculateTimeout(). then subclass from it to create the specific simple module types.5 Finite State Machines in OMNeT++ Overview Finite State Machines (FSMs) can make life with handleMessage() easier.. TransportProtocol. and initialize(int stage) must be implemented to handle the stage=0 and stage=1 cases.. OMNeT++ provides a class and a set of macros to build FSMs. This can also be witnessed in the design of the PARSEC simulation language (UCLA). }. void ModifiedTransportProtocol::recalculateTimeout() { //. “End-of-Simulation” event The task of finish() is solved in several simulators by introducing a special end-of-simulation event. An example: class ModifiedTransportProtocol : public TransportProtocol { public: Module_Class_Members(ModifiedTransportProtocol. A good design strategy is to create a simple module class with the common functionality. This is not a very good practice because the simulation programmer has to code the models (often represented as FSMs) so that they can always properly respond to end-of-simulation events. If you forget it.OMNeT++ Manual – Simple Modules stage init. } 4. 57 . numInitStages() should return 2. Define_Module( ModifiedTransportProtocol ). so for PARSEC end-of-simulation events were dropped in favour of finish() (called finalize() in PARSEC). in whichever state they are. Its predecessor Maisie used end-of-simulation events. the default behavior is single-stage initialization: the default numInitStages() returns 1.4. The key points are: 1 Note const in the numInitStages() declaration. 1 The callInitialize() function performs the full multi-stage initialization for that module and all its submodules. by C++ rules you create a different function instead of redefining the existing one in the base class. but – as documented in the PARSEC manual – this has led to awkward programming in many cases. OMNeT++’s FSMs work very much like OPNET’s or SDL’s.
ACTIVE = FSM_Steady(2). break.. State changes (transitions) must be put into the exit code. case FSM_Enter(state1): //.newState). break... At each event (that is.. its entry or exit code) may contain a further full-fledged FSM_Switch() (see below). The FSM starts from the state with the numeric code 0. SEND = FSM_Transient(1). 58 . This means that any state (or rather. OMNeT++’s FSMs can be nested. }. undergoes a series of state changes (runs through a number of transient states). //. SLEEP and ACTIVE are steady states and SEND is transient (the numbers in parentheses must be unique within the state type and they are used for constructing the numeric IDs for the states): enum { INIT = 0.. break. The possible states are defined by an enum. • You can assign program code to handle entering and leaving a state (known as entry/exit code). Thus between two events.. • Entry code should not modify the state (this is verified by OMNeT++). Staying in the same state is handled as leaving and re-entering the state... }. In the following example. FSM_Switch(). at each call to handleMessage()).OMNeT++ Manual – Simple Modules • There are two kinds of states: transient and steady. where you have cases for entering and leaving each state: FSM_Switch(fsm) { case FSM_Exit(state1): //. which simply stores the new state in the cFSM object: FSM_Goto(fsm. case FSM_Enter(state2): //. The actual FSM is embedded in a switch-like statement.. The FSM API FSM state is stored in an object of type cFSM. SLEEP = FSM_Steady(1).. case FSM_Exit(state2): //. break. the enum is also a place to define. the system is always in one of the steady states. State transitions are done via calls to FSM_Goto(). the FSM transitions out of the current (steady) state. and finally arrives at another steady state. This allows you to introduce sub-states and thereby bring some structure into the state space if it would become too large. Transient states are therefore not really a must – they exist only to group actions to be taken during a transition in a convenient way. this state is conventionally named INIT. which state is transient and which is steady.
exiting) (ev << "FSM " << (fsm).. In the ACTIVE state. 59 . The code was taken from the Fifo2 sample simulation.name() << ((exiting) ? ": leaving state " : ": entering state ") << (fsm). the module does nothing.. the simulation will terminate with an error message.OMNeT++ Manual – Simple Modules Debugging FSMs FSMs can log their state transitions ev. #define FSM_DEBUG #include <omnetpp.h. FSM FSM .h> The actual logging is done via the FSM_Print() macro. SLEEP and ACTIVE. In the SLEEP state.h. #define FSM_Print(fsm. #define FSM_DEBUG // enables debug output from FSMs #include <omnetpp. but you can change the output format by undefining FSM_Print() after including omnetpp.cSimpleModule. it sends messages with a given inter-arrival time.. FSM FSM FSM FSM .... you have to #define FSM_DEBUG before including omnetpp.. FSM FSM ..stateName() << endl) Implementation The FSM_Switch() is a macro. with the output looking like this: . An example Let us write another bursty generator.h> class BurstyGenerator : public cSimpleModule { public: Module_Class_Members(BurstyGenerator. but if you’re dying to see it. It is currently defined as follows. (The actual code is rather scary. It will have two states. It expands to a switch() statement embedded in a for() loop which repeats until the FSM reaches a steady state. GenState: leaving state SLEEP GenState: entering state ACTIVE GenState: GenState: GenState: GenState: leaving state ACTIVE entering state SEND leaving state SEND entering state ACTIVE GenState: leaving state ACTIVE GenState: entering state SLEEP To enable the above output. it is in cfsm.) Infinite loops are avoided by counting state transitions: if an FSM goes through 64 transitions without reaching a steady state.ini and providing a new definition instead.0).
}. // variables used int i. // the virtual functions virtual void initialize(). case FSM_Enter(SLEEP): // schedule end of sleep period (start of next burst) scheduleAt(simTime()+exponential(sleepTimeMean). Define_Module( BurstyGenerator ).0. WATCH(i). SEND = FSM_Transient(1).OMNeT++ Manual – Simple Modules // parameters double sleepTimeMean. sendIATime = par("sendIATime"). sleepTimeMean = par("sleepTimeMean").startStopBurst). ACTIVE = FSM_Steady(2).setName("fsm"). 60 . } void BurstyGenerator::handleMessage(cMessage *msg) { FSM_Switch(fsm) { case FSM_Exit(INIT): // transition to SLEEP state FSM_Goto(fsm. scheduleAt(0. // FSM and its states cFSM fsm. double sendIATime. burstTimeMean = par("burstTimeMean"). break. cMessage *startStopBurst. void BurstyGenerator::initialize() { fsm. i = 0. sendMessage = new cMessage("sendMessage").SLEEP). // always put watches in initialize() startStopBurst = new cMessage("startStopBurst"). }. SLEEP = FSM_Steady(1). virtual void handleMessage(cMessage *msg). cMessage *sendMessage. cPar *msgLength. enum { INIT = 0. startStopBurst). msgLength = &par("msgLength"). double burstTimeMean.
ACTIVE). cMessage *job = new cMessage(msgname). job->setLength( (long) *msgLength ).OMNeT++ Manual – Simple Modules break. break. "job-%d". store. Message objects are created using the C++ new operator and destroyed using the delete operator when they are no longer needed. } FSM_Goto(fsm. // transition to ACTIVE state: if (msg!=startStopBurst) { error("invalid event in state ACTIVE"). send( job.ACTIVE). case FSM_Enter(ACTIVE): // schedule next sending scheduleAt(simTime()+exponential(sendIATime). case FSM_Exit(SEND): { // generate and send out job char msgname[32]. messages travel between modules via gates and connections (or are sent 61 . sprintf( msgname. // return to ACTIVE FSM_Goto(fsm. case FSM_Exit(SLEEP): // schedule end of this burst scheduleAt(simTime()+exponential(burstTimeMean). and collect statistics about what was going on. schedule and destroy messages – everything else is supposed to facilitate this task. case FSM_Exit(ACTIVE): // transition to either SEND or SLEEP if (msg==sendMessage) { FSM_Goto(fsm. Messages in OMNeT++ are instances of the cMessage class or one of its subclasses. sendMessage). The essence of simple modules is that they create. modify. send. } } } 4. During their lifetimes. FSM_Goto(fsm. receive. } else if (msg==startStopBurst) { cancelEvent(sendMessage).6 Sending and receiving messages On an abstract level. job->setTimestamp(). break.SEND). "out" ). an OMNeT++ simulation model is a set of simple modules that communicate with each other via message passing. } break. break. ++i).SLEEP). } else { error("invalid event in state ACTIVE"). startStopBurst). ev << "Generating " << msgname << endl.
Do not do it – you cannot send the same message object multiple times. index determines though which particular output gate this has to be done. const char *gateName. all we need to know about them is that they are referred to as cMessage * pointers. in section 4. wait(5). a message object can be sent through an output gate using one of the following functions: send(cMessage *msg. cGate *gate). int gateId). you might feel tempted to use the same message in multiple send() operations. int index=0). the argument gateName is the name of the gate the message has to be sent through. send(cMessage *msg. // send via outGates[i] The following code example creates and sends messages every 5 simulated seconds: int outGateId = findGate("outGate"). They are described in section 4. The second and third functions use the gate Id and the pointer to the gate object.3. it is modeled as described earlier in this manual.1 Sending messages Once created. 4. otherwise. The solution in such cases is duplicating the message. two frequently occurring tasks in protocol simulation. i). In the first function. representing internal events of that module. send(cMessage *msg.2. If you want to have full control over the transmission process. They are faster than the first one because they don’t have to search through the gate array. Message objects can be given descriptive names (a const char * string) that often helps in debugging the simulation. At this point. the index argument is not needed.6. bypassing the connections). or they are scheduled by and delivered to modules.2 Broadcasts and retransmissions When you implement broadcasts or retransmissions. "outGates". outGateId). } Modeling packet transmissions If you’re sending messages over a link that has (nonzero) data rate. 62 . If this gate is a vector gate. The message name string can be specified in the constructor. so it should not surprise you if you see something like new cMessage("token") in the examples below.OMNeT++ Manual – Simple Modules directly. "outGate"). while(true) { send(new cMessage("packet"). Messages are described in detail in chapter 5. 4. Examples: send(msg.6. send(msg. you’ll probably need the isBusy() and transmissionFinishes() member functions of cGate.8.
and retain the original. and finally (when no more retransmissions will occur): delete packet. whenever it comes to (re)transmission. "out". Broadcast can be implemented in a simple module by sending out copies of the same message. You might have noticed that copying the message for the last gate is redundant (we could send out the original message). Once the message arrived in the destination module. As described above. i). i++) { cMessage *copy = (cMessage *) msg->dup(). and will eventually be delivered to the destination module. "out". i<n-1. destroy it immediately. i<n. i). n-1). i++) // note n-1 instead of n { cMessage *copy = (cMessage *) msg->dup(). you cannot just hold a pointer to the same message object and send it again and again – you’d get the not owner of message error on the first resend. } delete msg. Example: for (int i=0. The sender module should not even refer to its pointer any more. 63 . Why? A message is like any real world object – it cannot be at two places at the same time. "out". send(copy.OMNeT++ Manual – Simple Modules Broadcasting messages In your model. you should create and send copies of the message. you may need to broadcast a message to several destinations. Creating and sending a copy: // (re)transmit packet: cMessage *copy = (cMessage *) packet->dup(). When you are sure there will not be any more retransmission. When implementing retransmissions. or store it for further handling. The same applies to messages that have been scheduled – they belong to the simulation kernel until they are delivered back to the module. the message object no longer belongs to the module: it is taken over by the simulation kernel. Instead. Once you’ve sent it. for example on every gate of a gate vector. you cannot use the same message pointer for in all send() calls – what you have to do instead is create copies (duplicates) of the message object and send them. so it can be optimized out like this: for (int i=0. // send original on last gate Retransmissions Many communication protocols involve retransmissions of packets (frames). "out"). send(copy. } send(msg. that module will have full authority over it – it can send it on. send(copy. you can delete the original message.
cModule *mod. 4. 2 4. 64 .6.3 Delayed sending It is often needed to model a delay (processing time.005. double delay. double delay. 0. cGate *gate) In addition to the message and a delay. double delay.005. cGate *gate). Delayed sending can be achieved by using one of these functions: sendDelayed(cMessage *msg. In OMNeT++. The effect of the function is the same as if the module had kept the message for the delay interval and sent it afterwards. If the message is with another module.6. int gateId) sendDirect(cMessage *msg. An example: cModule *destinationModule = parentModule()->submodule("node2"). you’ll get a runtime error: not owner of message. all message sending functions check that you actually own the message you are about to send. etc. send( msg. const char *gateName. the module needs dedicated gates for receiving via sendDirect()). If the module needs to react to messages that arrive during the delay. there is no difference between messages received directly and those received over connections. There is also a more straightforward method than those mentioned above: delayed sending. Example: sendDelayed(msg. except for the extra delay parameter. The gate should be an input gate and should not be connected (that is. The delay value must be non-negative. int gateId). 0. wait() cannot be used and the timer mechanism described in Section 4. “Self-messages”. it merely checks that the owner of the message is the module that wants to send it.. cModule *mod.7. int index=-1 sendDirect(cMessage *msg.6. The sendDirect() function does that: sendDirect(cMessage *msg. That is. sendDelayed(cMessage *msg. double delay = truncnormal(0.OMNeT++ Manual – Simple Modules To enforce the rules above. The arguments are the same as for send().12). sendDelayed(cMessage *msg.) immediately followed by message sending. delay. it also takes the destination module and gate. because it uses the object ownership management (described in Section 6. 2 The feature does not increase runtime overhead significantly. "inputGate"). the sending time of the message will be the current simulation time (time at the sendDelayed() call) plus the delay. it is possible to implement it like this: wait( someDelay ). destinationModule. would need to be employed. const char *gateName.0001). sendDirect(new cMessage("packet"). double delay. it is currently scheduled or in a queue etc. "outgate" ).4 Direct message sending Sometimes it is necessary or convenient to ignore gates/connections and send a message directly to a remote destination module. int index). double delay. "outGate"). double delay. At the destination module.
the wait() function is implemented by a scheduleAt() followed by a receive().6 The wait() function With activity() only! The wait() function’s implementation contains a receive() call which cannot be used in handleMessage().6. described in chapter 6) in addition to the wait interval.. the function returns a NULL pointer.0.0. and receiveNewOn() were deprecated in OMNeT++ 2. // process message } 4.5 Receiving messages With activity() only! The message receiving functions can only be used in the activity() function. // handle timeout } else { .OMNeT++ Manual – Simple Modules 4. The receive() function accepts an optional timeout parameter. cMessage *msg = receive( timeout ).. 3 Putaside-queue and the functions receiveOn(). The wait() function suspends the execution of the module for a given amount of simulation time (a delta). receive() is a member of cSimpleModule. receiveNew(). // generate and send message . If you expect messages to arrive during the wait period. you can use the waitAndEnqueue() function. } It is a runtime error if a message arrives during the wait interval.. Messages are received using the receive() function..) { // wait for a (potentially random amount of) time. wait() is often called hold.. In other simulation software.) If an appropriate message doesn’t arrive within the timeout period.3 and removed in OMNeT++ 3. Messages that arrive during the wait interval will be accumulated in the queue.. so you can process them after the waitAndEnqueue() call returned. (This is a delta. It takes a pointer to a queue object (of class cQueue. 65 . An example: for(. cMessage *msg = receive(). handleMessage() gets received messages in its argument list. Internally. specified // in the interArrivalTime module parameter wait( par("interArrivalTime") ).6. The wait() function is very convenient in modules that do not need to be prepared for arriving messages. 3 simtime_t timeout = 3. not an absolute simulation time. for example message generators. if (msg==NULL) { .. wait( delay ).
Self-messages are used to model events which occur within the module.. the module may call the isSelfMessage() member of any received message to determine if it is a self-message. the server model will want to schedule an event to occur when the job finishes processing.OMNeT++ Manual – Simple Modules cQueue queue("queue"). For example.empty()) { // process messages arrived during wait interval . scheduleAt(simtime()+delta. As another example. if (recvd!=msg) // hmm.7 Modeling events using self-messages In most simulation models it is necessary to implement timers. .. msg). } 4. cMessage *recvd = receive(). Whenever it begins processing a job. msg). 66 .. Self-messages are delivered to the module in the same way as other messages (via the usual receive calls or handleMessage()). usually calculated as simTime()+delta: scheduleAt(absoluteTime. if the simulation kernel didn’t provide it already: cMessage *msg = new cMessage(). waitAndEnqueue(waitTime.... the message would be delivered to the simple module at a later point of time. &queue). first you have to cancel it using cancelEvent(). so that it can begin processing the next job. because it will have to resent the packet then. msg). suppose you want to write a model of a server which processes jobs from a queue. here’s how you could implement your own wait() function in an activity() simple module. Scheduling an event The module can send a message to itself using the scheduleAt() function. As an example.. when a packet is sent by a communications protocol model. In OMNeT++ you solve such tasks by letting the simple module send a message to itself. if (!queue.6. or schedule events that occur at some point in the future. scheduleAt() accepts an absolute simulation time. some other event occurred meanwhile: error! . Messages used this way are called self-messages. it has to schedule an event that would occur when a timeout expires. scheduleAt(simtime()+waitTime.
cancelEvent( msg ). cancelEvent() gives an error if the message is not in the FES. windowSize). Implementing timers The following example shows how to implement timers: cMessage *timeoutEvent = new cMessage("timeout"). you can call the error() member function of cModule.. must be >=1". This is particularly useful because self-messages are often used to model timers.0. scheduleAt(simTime()+10. timer can be cancelled now: delete cancelEvent(timeoutEvent). as it will be added by OMNeT++.8 Stopping the simulation Normal termination You can finish the simulation with the endSimulation() function: endSimulation(). //.. 67 . After having it cancelled. The cancelEvent() function takes a pointer to the message to be cancelled. and also returns the same pointer. It is used like printf(): if (windowSize<1) error("Invalid window size %d. if (msg == timeoutEvent) { // timeout expired } else { // other message has arrived.OMNeT++ Manual – Simple Modules Cancelling an event Scheduled self-messages can be cancelled (removed from the FES). Stopping on errors If you want your simulation to stop if it detects an error condition. Do not include a newline (“\n”) or punctuation (period or exclamation mark) in the error text. } 4. Typically you don’t need endSimulation() because you can specify simulation time and CPU time limits in the ini file (see later). you may delete the message or reuse it in the next scheduleAt() calls. cMessage *msg = receive().6. timeoutEvent).
it is best to store a reference to it and re-read the value each time it is needed: cPar& waitTime = par("waitTime"). and an overloaded form of the function lets you access elements of a vector gate: cGate *outgate = gate("out").0)) in the NED source or the ini file.12. 4. double processingDelay = par("processingDelay"). the above code results in a different delay each time. wait( (simtime_t)waitTime ).. for(. The cPar class is a general value-storing object. cGate *outvec5gate = gate("outvec". If the parameter was taken by reference (with a ref modifier in the NED file). etc. If the parameter is a random variable or its value can change during execution.) { //. so parameter values can be read like this: int numTasks = par("numTasks"). They can also be queried on the parameters of the link (delay. The cPar class is discussed in more detail in section 6.12..5). Gate objects know whether. Parameter values can also be changed from the program.1 Accessing gates and connections Gate objects Module gates are cGate objects. data rate. Thus.6. } If the wait_time parameter was given a random value (e.8 4. other modules will also see the change.g. Or: cPar& waitTime = par("waitTime"). parameters taken by reference can be used as a means of module communication. waitTime = 0. exponential(1.8. during execution.. It supports type casts to numeric types.7 Accessing module parameters Module parameters can be accessed by calling the par() member function of cModule: cPar& delayPar = par("delay"). and to which gate they are connected. 68 .OMNeT++ Manual – Simple Modules 4.) The gate() member function of cModule returns a pointer to a cGate object. An example: par("waitTime") = 0.
The type() member function returns a character.OMNeT++ Manual – Simple Modules For gate vectors. Gate IDs do not change during execution. Gate vectors are guaranteed to occupy contiguous IDs. you can also call the gateSize() method of cModule. The isVector() member function can be used to determine if a gate belongs to a gate vector or not. the functions using gate IDs are a bit faster. size() returns 1 and index() returns 0. The gate ID is returned by the id() member function: int id = outgate->id().0). the first form returns the first gate in the vector (at index 0). The gate’s position in the array is called the gate ID. int id2 = findGate("outvect". ’I’ for input gates and ’O’ for output gates: char type = outgate->type() // --> ’O’ Gate IDs Module gates (input and output. Given a gate pointer. For non-vector gates. which does the same: int size2 = gateSize("out"). single and vector) are stored in an array within their modules.id()+k. the array may look like this: ID 0 1 2 3 4 5 6 dir input output name[index] fromApp toApp empty input in[0] input in[1] input in[2] output status The array may have empty slots. 69 . You can also obtain gate IDs with the findGate() member of cModule: int id1 = findGate("out"). Zero-size gate vectors are represented with a placeholder gate whose size() method returns zero and cannot be connected. Message sending and receiving functions accept both gate names and gate IDs. For a module with input gates fromApp and in[3] and output gates of toApp and status. you can use the size() and index() member functions of cGate to determine the size of the gate vector and the index of the gate within the vector: int size2 = outvec5gate->size(). so it is often worth retrieving them in advance and using them instead of gate names. // --> size of outvec[] int index = outvec5gate->index().5). // --> 5 (it is gate 5 in the vector) Instead of gate->size(). thus it is legal to calculate the ID of gate[k] as gate("gate".
double d = chan->delay()..8. 4. You can also change the channel attributes with the corresponding setXXX() functions. double e = chan->error(). transmission data rate. if (gate("TxGate")->isBusy()) // if gate is busy. transmissionFinishes() returns the simulation time when it finished its last transmission.4 Connectivity The isConnected() member function returns whether the gate is connected. An example: cMessage *packet = new cMessage("DATA"). 70 . that (as it was explained in section 4.OMNeT++ Manual – Simple Modules 4. the transmissionFinishes() member function returns the simulation time when the gate is going to finish transmitting. For input gates. You could use the following code: if (gate("mygate")->toGate()->isBusy()) //. cChannel *chan = outgate->channel(). "TxGate"). packet->setLength( 1000 ).3 Transmission state The isBusy() member function returns whether the gate is currently transmitting.2.2) changes will not affect messages already sent. All interesting attributes are part of its subclass cBasicChannel. the function is fromGate(). the gate to which it is connected is obtained by the toGate() member function. the changes will affect only the messages that are sent after the change. 4. error and data rate values.8. Note that if data rates change during the simulation. } send( packet. and if so. If the connection with a data rate is not directly connected to the simple module’s output gate but is the second one in the route.simTime()). wait until it { // becomes free wait( gate("TxGate")->transmissionFinishes() . even if they have not begun transmission yet. Note. so you have to cast the pointer before getting to the delay. cChannel is a small base class.8.) The semantics have been described in section 4. (If the gate in not currently transmitting.2 Connection parameters Connection attributes (propagation delay.. which is available via the source gate of the connection. If the gate is an output gate. double r = chan->datarate(). however. you have to check the second gate’s busy condition. bit error rate) are represented by the channel object. cBasicChannel *chan = check_and_cast<cBasicChannel *>(outgate->channel()).
cGate *othergate = (gate->type()==’O’) ? gate->toGate() : gate->fromGate(). the index() and size() member functions can be used to query its index and the vector size: ev << "This is module [" << module->index() << "] in a vector of size [" << module->size() << "].9 Walking the module hierarchy Module vectors If a module is part of a module vector. } cModule *destmod = gate->ownerModule(). if (othergate) ev << "gate is connected to: " << othergate->fullPath() << endl. ev << "gate is connected to: " << othergate->fullPath() << endl. The module ID is used internally by the simulation kernel to identify modules. if (gate->isConnected()) { cGate *othergate = (gate->type()==’O’) ? gate->toGate() : gate->fromGate(). there are two convenience functions which do that: sourceGate() and destinationGate(). } An alternative to isConnected() is to check the return value of toGate() or fromGate(). while (gate->toGate()!=NULL) { gate = gate->toGate(). Module IDs Each module in the network has a unique ID that is returned by the id() member function. but luckily. To find out to which simple module a given output gate leads finally. The following code is fully equivalent to the one above: cGate *gate = gate("somegate").\n". 71 . else ev << "gate not connected" << endl. you would have to walk along the path like this (the ownerModule() member function returns the module to which the gate belongs): cGate *gate = gate("out"). } else { ev << "gate not connected" << endl. 4.OMNeT++ Manual – Simple Modules cGate *gate = gate("somegate").
and it starts the search at the top-level module.5)->submodule("grandchild"). they return -1 or NULL. use cSubModIterator. Module IDs are guaranteed to be unique. cModule’s findSubmodule() and submodule() member functions make it possible to look up the module’s submodules by name (or name+index if the submodule is in a module vector). } 72 .module( id ). !iter. Walking up and down the module hierarchy The surrounding compound module can be accessed by the parentModule() member function: cModule *parent = parentModule().) The cSimulation::moduleByPath() function is similar to cModule’s moduleByRelativePath() function. and the latter returns the module pointer. because otherwise the second version would crash with an access violation because of the NULL pointer dereference. compoundmod->moduleByRelativePath("child[5]. you can ask the simulation object (a global variable) to get back the module pointer: int id = 100. If you know the module ID. cModule *mod = simulation. The moduleByRelativePath() member function can be used to find a submodule nested deeper than one level below. the parameters of the parent module are accessed like this: double timeout = parentModule()->par( "timeout" ). respectively.OMNeT++ Manual – Simple Modules int myModuleId = id(). an ID which once belonged to a module which was deleted is never issued to another module later. If the submodule is not found. Iterating over submodules To access all modules within a compound module. For example.grandchild"). (Provided that child[5] does exist. iter++) { ev << iter()->fullName(). For example: for (cSubModIterator iter(*parentModule()). The first one returns the numeric module ID of the submodule. would give the same results as compoundmod->submodule("child".5).end(). cModule *submod = compoundmod->submodule("child".5). int submodID = compoundmod->findSubmodule("child". For example. That is. even when modules are created and destroyed dynamically.
an error gets thrown from check_and_cast. 73 . The check_and_cast<>() template function on the second line is part of OMNeT++. For example: cModule *neighbour = gate( "outputgate" )->toGate()->ownerModule(). the solution might be calling one simple module’s public C++ methods from another module.10 Direct method calls between modules In some simulation models. and checks the result: if it is NULL. It does a standard C++ dynamic_cast. since the name() function returns the same for all modules: for (cSubModIterator iter(*parentModule()). so normal C++ method calls will work.OMNeT++ Manual – Simple Modules (iter() is pointer to the current module the iterator is at. the called module is in the same compound module as the caller. For input gates. Using check_and_cast saves you from writing error checking code: if calleeModule from the first line is NULL because the submodule named "callee" was not found. callee->doSomething(). or if that module is actually not of type Callee. use cGate’s fromGate(). iter++) { if (iter()->isName(name())) // if iter() is in the same // vector as this module { int itsIndex = iter()->index(). (Further ways to obtain the pointer are described in the section 4. you would use fromGate() instead of toGate(). however: • how to get a pointer to the object representing the module. Callee *callee = check_and_cast<Callee *>(calleeModule). In such cases. Typically. This makes the following code: cModule *calleeModule = parentModule()->submodule("callee"). Simple modules are C++ classes. so the parentModule() and submodule() methods of cModule can be used to get a cModule* pointer to the called module.9.) The cModule* pointer then has to be cast to the actual C++ class of the module. check_and_cast raises an OMNeT++ error. • how to let the simulation kernel know that a method call across modules is taking place. // do something to it } } Walking along links To determine the module at the other end of a connection. so that its methods become visible. !iter. Two issues need to be mentioned. there might be modules which are too tightly coupled for message-based communication to be efficient.end(). 4. toGate() and ownerModule() functions.) The above method can also be used to iterate along a module vector.
one could also delete static modules during simulation (though it is rarely useful. As another example.1 Dynamic module creation When do you need dynamic module creation In some situations you need to dynamically create and maybe destroy modules. . Why is this necessary in the first place? First. Each module type (class) has a corresponding factory object of the class cModuleType. (You would write a manager module that receives connection requests and creates a module for each connection.11.) statement). The cModuleType object also knows what gates and parameters the given module type has to have. but to be able to do that. connections) may depend on parameter values and gate vector 74 . and dispose of them when they leave the area.. the Tkenv simulation GUI can animate method calls. you may create a new module whenever a new user enters the simulated area. it is possible to call its factory method and create an instance of the corresponding module class – without having to include the C++ header file containing module’s class declaration into your source file. Once created and started. } 4. for example. void Callee::doSomething() { Enter_Method("doSomething()").11. Enter_Method() expects a printf()-like argument list – the resulting string will be displayed during animation. If you create a compound module. This object is created under the hood by the Define_Module() macro.) 4. dynamic modules aren’t any different from “static” modules. when implementing a server or a transport protocol. For example. it might be convenient to dymically create modules to serve new connections. Enter_Method_Silent() does not animate the call. when simulating a mobile network. and. in order to several internal mechanisms to work correctly.11 4. The solution is to add the Enter_Method() or Enter_Method_Silent() macro at the top of the methods that may be invoked from other modules. the situation is more complicated. in case of Enter_Method(). These calls perform context switching.. it has to know about them. and it has a factory function which can instantiate the module class (this function basically only consists of a return new module-class(. (One such mechanism is ownership handling. The cModuleType object can be looked up by its name string (which is the same as the module class name).) Both simple and compound modules can be created dynamically. you have to know a bit about how normally OMNeT++ instantiates modules. (This info comes from compiled NED code.) Second. For a compound module. because its internal structure (submodules.2 Overview To understand how dynamic module creation works.) Simple modules can be created in one step.OMNeT++ Manual – Simple Modules The second issue is how to let the simulation kernel know that a method call across modules is taking place. It is often convenient to use direct message sending with dynamically created modules. all its submodules will be created recursively. notify the simulation GUI so that animation of the method call can take place. the simulation kernel always has to know which module’s code is currently executing. Once you have its pointer. and dispose of them when the connection is closed.. The Dyna example simulation does something like this..
Expanded form If the previous simple form cannot be used. this message is created automatically by OMNeT++. There are 5 steps: 1. however: because it does everything in one step. // create (possibly compound) module and build its submodules (if any) cModule *module = moduleType->create("node". simple modules with activity() need a starter message. set parameter values and gate vector sizes.11.OMNeT++ Manual – Simple Modules sizes. and to connect gates before initialize() is called. For statically created modules. create module 3. for compound modules it is generally required to first create the module itself. second. set up parameters and gate sizes (if needed) 4. Calling initialize() has to take place after insertion of the starter messages. This method can be used for both simple and compound modules. this function is mainly useful for creating basic simple modules.) can be done with one line of code. you do not have the chance to set parameters or gate sizes. Thus. you have to do this explicitly by calling the appropriate functions.3 Creating modules The first step. call function that creates activation message(s) for the new simple module(s) Each step (except for Step 3. cModule *parentmod) convenience function to get a module up and running in one step.) Because of the above limitation. find factory object 2. and these messages should be processed after the starter message. (initialize() expects all parameters and gates to be in place and the network fully built when it is called. 75 . Simplified form cModuleType has a createScheduleInit(const char *name.this). this). Its applicability is somewhat limited. where Step 3 is omitted: // find factory object cModuleType *moduleType = findModuleType("WirelessNode"). and then call the method that creates its submodules and internal connections. call function that builds out submodules and finalizes the module 5. because the initializing code may insert new messages into the FES. As you know already. 4. See the following example. It does create() + buildInside() + scheduleStart(now) + callInitialize(). mod = modtype->createScheduleInit("node". finding the factory object: cModuleType *moduleType = findModuleType("WirelessNode"). but for dynamically created modules.
11. 4 Example: mod->callFinish(). mod->deleteModule(). 3). but you can still manually invoke it. Currently. module->scheduleStart(simTime()). and schedule it module->buildInside(). A simple module can also delete itself. cModule *module = moduleType->create("node".4 Deleting modules To delete a module dynamically: module->deleteModule(). // set up parameters and gate sizes before we set up its submodules module->par("address") = ++lastAddress. If you’re deleting a compound module. 4. the code goes between the create() and buildInside() calls: // create cModuleType *moduleType = findModuleType("WirelessNode").OMNeT++ Manual – Simple Modules module->buildInside().5 Module deletion and finish() When you delete a module during simulation. module->setGateSize("in". in order to discourage its invocation from other modules. you must delegate the job to a module outside the compound module. // create activation message module->scheduleStart( simTime() ).) How the module was created doesn’t play any role here: finish() gets called for all modules – at the end of the simulation. 76 . 4. If a module doesn’t live that long. It is usually not a good idea to invoke finish() directly. 3). You can use the callFinish() function to arrange finish() to be called.11. in this case. callFinish() will recursively invoke finish() for all submodules. its finish() function is not called automatically (deleteModule() doesn’t do it. this). the deleteModule() call does not return to the caller. If you want to set up parameter values or gate vector sizes (Step 3. you cannot safely delete a compound module from a simple module in it. module->setGateSize("out".). // create internals. this involves recursively destroying all its submodules. finish() is not invoked. If the module was a compound module. callFinish() will do the context switch for the duration of the call. and if you’re deleting a simple module from another module. 4 The finish() function is even made protected in cSimpleModule.
this). connectTo() also accepts a channel object as an additional.7 Removing connections The disconnect() method of cGate can be used to remove connections. bit error rate and data rate.6 Creating connections Connections can be created using cGate’s connectTo() method. channel). and may be removed from further OMNeT++ releases. channel->setDelay(0. As an example. if one has been set. Channels are subclassed from cChannel. 5 The earlier connect() global functions that accepted two gates have been deprecated. cModule *b = modtype->createScheduleInit("b". Almost always you’ll want use an instance of cBasicChannel as channel – this is the one that supports delay. cModule *a = modtype->createScheduleInit("a".11.b are modules 4. The channel object will be owned by the source gate of the connection. // a.001). This method has to be invoked on the source side of the connection. a->gate("out")->connectTo(b->gate("in")). srcGate->disconnect().this). The source and destination words correspond to the direction of the arrow in NED files.11. we create two modules and connect them in both directions: cModuleType *moduleType = findModuleType("TicToc"). optional argument. 77 . setError() and setDatarate() methods to set up the channel attributes. cBasicChannel has setDelay(). and expects the destination gate pointer as an argument: srcGate->connectTo(destGate). b->gate("out")->connectTo(a->gate("in")). It also destroys the channel object associated with the connection. and you cannot reuse the same channel object with several connections. 5 connectTo() should be invoked on the source gate of the connection.OMNeT++ Manual – Simple Modules 4. An example that sets up a channel with a delay: cBasicChannel *channel = new cBasicChannel("channel"). a->gate("out")->connectTo(b->gate("in").
OMNeT++ Manual – Simple Modules 78 .
encapsulated message. but the information is still in the message object when a module receives the message. they will be discussed later: parameter list. Some are used by the simulation kernel. control info and context pointer. frames. entities travelling in a system and so on. • The priority attribute is used by the simulation kernel to order messages in the message queue (FES) that have the same arrival time values. 79 . cells. which can be freely used by the simulation programmer. bits or signals travelling in a network. packets. Attributes A cMessage object has number of attributes.OMNeT++ Manual – Messages Chapter 5 Messages 5. They are mostly used by the simulation kernel while the message is in the FES. A more-or-less complete list: • The name attribute is a string (const char *).1). • The message kind attribute is supposed to carry some message type information. • The bit error flag attribute is set to true by the simulation kernel with a probability of 1−(1−ber)length when the message is sent through a connection that has an assigned bit error rate (ber). • The time stamp attribute is not used by the simulation kernel. Zero and positive values can be freely used for any purpose. you can use it for purposes such as noting the time when the message was enqueued or re-sent. sending (scheduling) and arrival time. others are provided just for the convenience of the simulation programmer.1. Negative values are reserved for use by the OMNeT++ simulation library. • A number of read-only attributes store information about the message’s (last) sending/scheduling: source/destination module and gate. and it is generally very useful to choose a descriptive name.1 5. Objects of cMessage and subclasses may model a number of things: events. • The length attribute (understood in bits) is used to compute transmission delay when the message travels through a connection that has an assigned data rate. messages. This attribute is inherited from cObject (see section 6.1 Messages and packets The cMessage class cMessage is a central class in OMNeT++. • Other attributes and data members make simulation programming easier. in animations).1. The message name appears in many places in Tkenv (for example.
Most commonly. including message parameters (cPar or other object types) and encapsulated messages.() methods described below. the message length. so the following statements are also valid: cMessage *msg = new cMessage(). sending one and keeping a copy). you would create a message using an object name (a const char * string) and a message kind (int): cMessage *msg = new cMessage("MessageName". cMessage *msg = new cMessage("MessageName"). its data members can be changed by the following functions: msg->setKind( kind ). msg->priority(). msg->timestamp(). 80 . msg->setPriority( priority ). This can be done in the same way as for any other OMNeT++ object: cMessage *copy = (cMessage *) msg->dup(). Message kind is usually initialized with a symbolic constant (e. msg->setTimestamp( simtime ). an enum value) which signals what the message object represents in the simulation (i. It is a good idea to always use message names – they can be extremely useful when debugging or demonstrating your simulation. Both arguments are optional and initialize to the null string ("") and 0. the priority. a job. msgKind). Length and priority are integers.) Please use positive values or zero only as message kind – negative values are reserved for use by the simulation kernel. msg->setLength( length ). msg->setTimestamp(). and the bit error flag is boolean. a jam signal.g.. The two are equivalent. priority. or cMessage *copy = new cMessage( *msg ). a data packet. With these functions the user can set the message kind. etc. bit error flag). The setTimeStamp() function without any argument sets the time stamp to the current simulation time..OMNeT++ Manual – Messages Basic usage The cMessage constructor accepts several arguments. The cMessage constructor accepts further arguments too (length. the error flag and the time stamp.e. msg->length(). The resulting message is an exact copy of the original. Duplicating messages It is often necessary to duplicate a message (for example. msg->setBitError( err ). msg->hasBitError(). Once a message has been created. The values can be obtained by the following functions: int k int p int l bool b simtime_t t = = = = = msg->kind(). but for readability of the code it is best to set them explicitly via the set.
it other words. It is not used by the simulation kernel. While the message is scheduled. A scheduled message can also be cancelled (cancelEvent()). arrivalModuleId(). Intended purpose: a module which schedules several self-messages (timers) will need to identify a selfmessage when it arrives back to the module. Context pointer cMessage contains a void* pointer which is set/returned by the setContextPointer() and contextPointer() functions: void *context =. void *context2 = msg->contextPointer().1.. msg->setContextPointer( context ).3 Modelling packets Arrival gate and time The following methods can tell where the message came from and where it arrived (or will arrive if it is currently scheduled or under way. 5. simtime_t creationTime() simtime_t sendingTime()..) int int int int senderModuleId(). The following two methods are just convenience functions that combine module id and gate id into a gate object pointer. The context pointer can be made to point at a data structure kept by the module which can carry enough “context” information about the event. of class cMessage or a class derived from it. you can call the isSelfMessage() method to determine if it is a self-message.OMNeT++ Manual – Messages 5.() methods.... 81 . senderGateId(). ie. The following methods return the time of creating and scheduling the message as well as its arrival time. arrival time is the time it will be delivered to the module. A message is termed self-message when it is used in such a scenario – otherwise self-messages are normal messages. such as a periodically firing timer on expiry of a timeout. simtime_t arrivalTime(). bool isScheduled(). When a message is delivered to a module by the simulation kernel. It can be used for any purpose by the simulation programmer. if it was scheduled with scheduleAt() or was sent with one of the send. bool isSelfMessage().2 Self-messages Using a message as self-message Messages are often used to represent events internal to a module. The isScheduled() method returns true if the message is currently scheduled. and it is treated as a mere pointer (no memory management is done on it). the module will have to determine which timer went off and what to do then. arrivalGateId().1.
etc). and attached to the messages representing packets. When the command doesn’t involve a data packet (e. simtime_t arrivalTime(). The PDU type is usually represented as a field inside the message class. cMessage *msg = receive(). int gindex=0). a TCP implementation sending down a TCP packet to IP will want to specify the destination IP address and possibly other parameters. cPolymorphic *controlInfo(). This additional information is represented by control info objects in OMNeT++. the message kind field (kind(). } 82 .. instances of class IPv6Datagram represent IPv6 datagrams and EthernetFrame represents Ethernet frames) and/or in the message kind value. bool arrivedOn(int id). protocol layers are usually implemented as modules which exchange packets. the protocol type is usually represented in the message subclass. if (dynamic_cast<IPv6Datagram *>(msg) != NULL) { IPv6Datagram *datagram = (IPv6Datagram *)msg. communication between protocol layers requires sending additional information to be attached to packets. The following methods return message creation time and the last sending and arrival times. SEND. setKind() methods of cMessage) should carry the command code. When IP passes up a packet to TCP after decapsulation from the IP header. bool arrivedOn(const char *gname.OMNeT++ Manual – Messages cGate *senderGate(). And there are further convenience functions to tell whether the message arrived on a specific gate given with id or name+index. Control info objects have to be subclassed from cPolymorphic (a small footprint base class with no data members). When a "command" is associated with the message sending (such as TCP OPEN. cPolymorphic *removeControlInfo(). For example. Identifying the protocol In OMNeT++ protocol models. TCP CLOSE command). Here. it’ll want to let TCP know at least the source IP address. cGate *arrivalGate(). a dummy packet (empty cMessage) can be sent. cMessage has the following methods for this purpose: void setControlInfo(cPolymorphic *controlInfo). However.. simtime_t creationTime() simtime_t sendingTime(). Control info One of the main application areas of OMNeT++ is the simulation of telecommunication networks. For example.g. Packets themselves are represented by messages subclassed from cMessage. The C++ dynamic_cast operator can be used to determine if a message object is of a specific protocol. . CLOSE.
cMessage *tcpseg = new cMessage("tcp").2 and customized messages 5. userdata->setLength(8*2000).4 Encapsulation Encapsulating packets It is often necessary to encapsulate a message into another when you’re modeling layered protocols of computer networks. ev << tcpseg->length() << endl.1. You can get back the encapsulated message by decapsulate(): cMessage *userdata = tcpseg->decapsulate(). decapsulate() will decrease the length of the message accordingly. An exception: when the encapsulating (outer) message has zero length. The length of the message will grow by the length of the encapsulated message. Although you can encapsulate messages by adding them to the parameter list. Let us see an example which assumes you have added to the class an std::list member called messages that stores message pointers: void MessageBundleMessage::insertMessage(cMessage *msg) { take(msg). (It is recommended that you use the message definition syntax 5. The encapsulate() function encapsulates a message into another one. These are done via the take() and drop() methods. so its length is left at zero. The encapsulatedMsg() function returns a pointer to the encapsulated message. OMNeT++ assumes it is not a real packet but some out-of-band signal.2. tcpseg->setLength(8*24). It is also an error if the message to be encapsulated isn’t owned by the module. The second encapsulate() call will result in an error. cMessage *userdata = new cMessage("userdata"). or NULL if no message was encapsulated. and release them when they are removed from the message. There is one additional “trick” that you might not expect: your message class has to take ownership of the inserted messages. tcpseg->encapsulate(userdata). there’s a better way. // --> 8*2024 = 16192 A message can only hold one encapsulated message at a time. // store pointer } void MessageBundleMessage::removeMessage(cMessage *msg) { messages. an error occurs. If the length would become negative. // take ownership messages.6 to be described later on in this chapter – it can spare you some work.push_back(msg). but you can subclass cMessage and add the necessary functionality. or you can use STL classes like std::vector or std::list. // remove pointer 83 .) You can store the messages in a fixed-size or a dynamically allocated array.OMNeT++ Manual – Messages 5.remove(msg). Encapsulating several messages The cMessage class doesn’t directly support adding more than one messages to a message object. except if it was zero.
1. msg->addObject( pklenDistr ). hasObject(). Only objects that are derived from cObject (most OMNeT++ classes are so) can be attached. Using cPars is also errorprone because cPar objects have to be added dynamically and individually to each message object. if you still need to use cPars. You can attach non-object types (or non-cObject objects) to the message by using cPar’s void* pointer ’P’) type (see later in the description of cPar). Attaching objects The cMessage class has an internal cArray object which can carry objects. deprecated way of adding new fields to messages is via attaching cPar objects. the preferred way to do that is via message definitions. the worst being large memory and execution time overhead. sometimes as much as 80%. The old.11 contains more info about the things you need to take care of when deriving new classes. However. Section 6.. subclassing benefits from static type checking: if you mistype the name of a field in the C++ code. .2).2.sizeof(struct conn_t)). cPar’s are heavyweight and fairly complex objects themselves. The addObject().OMNeT++ Manual – Messages drop(msg).. // release ownership 5. An example: struct conn_t *conn = new conn_t. } You will also have to provide an operator=() method to make sure your message objects can be copied and duplicated properly – this is something often needed in simulations (think of broadcasts and retransmissions!). msg->par("conn"). getObject(). removeObject() methods use the object name as the key to the array. the internal cArray object will not be created.NULL. // conn_t is a C struct msg->addPar("conn") = (void *) conn. } You should take care that names of the attached objects do not clash with each other or with cPar parameter names (see next section). You add a new parameter to the message with the addPar() member function. here’s a short summary how you can do it. This saves both storage and execution time. In contrast. An example: cLongHistogram *pklenDistr = new cLongHistogram("pklenDistr"). If you do not attach anything to the message and do not call the parList() function. Attaching parameters The preferred way of extending messages with new data fields is to use message definitions (see section 5.configPointer(NULL. described in chapter 5..5 Attaching parameters and objects If you want to add parameters or objects to a message. . and get back a reference to the parameter object with 84 . if (msg->hasObject("pklenDistr")) { cLongHistogram *pklenDistr = (cLongHistogram *) msg->getObject("pklenDistr").. There are several downsides of this approach. already the compiler can detect the mistake. It has been reported that using cPar message parameters might account for a large part of execution time.
Message parameters can be accessed also by index in the parameter array.1 Message definitions Introduction In practice. 5.OMNeT++ Manual – Messages the par() member function. The subclassing approach for adding message parameters was originally suggested by Nimrod Mesika. Example: msg->addPar("destAddr").2. int destAddress. writing the necessary C++ code can be a tedious and time-consuming task.2 5. . the natural way of extending cMessage is via subclassing it. if you’re modelling packets in communication networks. However.msg file with the following contents: message MyPacket { fields: int srcAddress. a getter and a setter method). OMNeT++ offers a more convenient way called message definitions. Even if you decide to heavily customize the generated class. This is a temporary solution until the C++-based nedtool is finished. int hops = 32.. saving you a lot of typing. }. based on feedback from the community. • The compiler that translates message descriptions into C++ is a perl script opp_msgc. you’ll need to add various fields to cMessage to make it useful. C++ code is automatically generated from message definitions. You could write a mypacket. Since the simulation library is written in C++. The findPar() function returns the index of a parameter or -1 if the parameter cannot be found. you need to have a way to store protocol header fields in message objects. because for each field you need to write at least three things (a private data member. In OMNeT++. there’s nothing to worry about: you can customize the generated class to any extent you like. Message definitions provide a very compact syntax to describe message contents. The first message class Let us begin with a simple example. there’s little you can do about it. For example. A common source of complaint about code generators in general is lost flexibility: if you have a different idea how the generated code should look like. The message subclassing feature in OMNeT++ is still somewhat experimental. long destAddr = msg->par("destAddr"). and the resulting class has to integrate with the simulation framework. 85 . message definitions still save you a great deal of manual work. meaning that: • The message description syntax and features may slightly change in the future. Suppose that you need message objects to carry source and destination addresses as well as a hop count. The parameter can then be accessed using an overloaded par() function.. hasPar() tells you if the message has a given parameter or not. msg->par("destAddr") = 168. however.
The mypacket_m. it does. If you process mypacket.msg with the message subclassing compiler. (This aligns with the idea behind STL – it was designed to be nuts and bolts for C++ programs). . while you can probably (ab)use the syntax to generate classes and structs used internally in simple modules. Also.. so it seems to be a good idea to deal with them right here..h will contain the following class declaration: class MyPacket : public cMessage { .. virtual void setSrcAddress(int srcAddress). templates.. The mypacket_m.h" . mypacket_m...OMNeT++ Manual – Messages The task of the message subclassing compiler is to generate C++ classes you can use from your models as well as “reflection” classes that allow Tkenv to inspect these data stuctures. Do not look for complex C++ types. MyPacket *pkt = new MyPacket("pkt"). So in your C++ file. as well as “reflection” code that allows you to inspect these data stuctures in the Tkenv GUI.cc file contains implementation of the generated MyPacket class. optionally leaving the implementation to you – so you can implement fields (dynamic array fields) using std::vector. The generated mypacket_m.cc. conditional compilation. • .cc file should be compiled and linked into your simulation. 86 . it will create the following files for you: mypacket_m. This is meant for defining message contents.. and data structure you put in messages. virtual int getSrcAddress() const. }.. .. pkt->setSrcAddress( localAddr ).h and mypacket_m. the latter will be automatically taken care of. and it should be included into your C++ sources where you need to handle MyPacket objects.. etc. it defines data only (or rather: an interface to access data) – not any kind of active behaviour. an attempt to reproduce the functionality of C++ with another syntax. Also. you could use the MyPacket class like this: #include "mypacket_m.h contains the declaration of the MyPacket C++ class.. The goal is to define the interface (getter/setter methods) of messages rather than their implementations in C++. a generic class generator. A simple and straightforward implementation of fields is provided – if you’d like a different internal representation for some field. Message definitions focus on the interface (getter/setter methods) of the classes. this is probably not a good idea. It is not: • .) What is message subclassing not? There might be some confusion around the purpose and concept of message definitions. There are questions you might ask: • Why doesn’t it support std::vector and other STL classes? Well.. Defining methods is not supported on purpose. you can have it by customizing the class. (If you use the opp_makemake tool to generate your makefiles.
OMNeT++ Manual – Messages • Why does it support C++ data types and not octets. FooPacket. and OMNeT++ wants to support other application areas as well. the generated class will have a protected data member. there would always be new data types to be adopted. 5. etc. Enum values need to be unique. The following sections describe the message syntax and features in detail. virtual void setHasPayload(bool hasPayload). virtual void setSourceAddress(int sourceAddress). The latter makes it possible to display symbolic names in Tkenv. Processing this description with the message compiler will produce a C++ header file with a generated class. TCP = 2. For each field in the above description.3 Message declarations Basic use You can describe messages with the following syntax: message FooPacket { fields: int sourceAddress. followed by the field name with its first letter converted to uppercase. plus creates an object which stores text representations of the constants. bits. virtual bool getHasPayload() const. int destAddress..? That would restrict the scope of message definitions to networking. Thus. 87 . 5. As it does not conflict with the above principles. virtual int getDestAddress() const. it might be added someday.2 Declaring enums An enum {. bool hasPayload. FooPacket will be a subclass of cMessage.. FooPacket will contain the following methods: virtual int getSourceAddress() const.2. An example: enum ProtocolTypes { IP = 1. the set of necessary concepts to be supported is probably not bounded. Furthermore. bytes. }.2. • Why no embedded classes? Good question. }. virtual void setDestAddress(int destAddress).} generates a normal C++ enum. The names of the methods will begin with get and set. a getter and a setter method.
Initialization code will be placed in the constructor of the generated class. Two constructors will be generated: one that optionally accepts object name and (for cMessage subclasses) message kind. }. unsigned long • double Field values are initialized to zero. bool hasPayload = false. The enum has to be declared separately in the message file. Initial values You can initialize field values with the following syntax: message FooPacket { fields: int sourceAddress = 0. int kind=0). 88 . unsigned char • short. unsigned short • int. Data types for fields are not limited to int and bool. You can use the following primitive types (i. }. Appropriate assignment operator (operator=()) and dup() methods will also be generated. The message compiler can than generate code that allows Tkenv display the symbolic value of the field. FooPacket(const FooPacket& other). Example: message FooPacket { fields: int payloadType enum(PayloadTypes). unsigned int • long.e. and a copy constructor: FooPacket(const char *name=NULL.OMNeT++ Manual – Messages Note that the methods are all declared virtual to give you the possibility of overriding them in subclasses. int destAddress = 0. Enum declarations You can declare that an int (or other integral type) field takes values from an enum. primitive types as defined in the C++ language): • bool • char.
. This means that you need to call the set. The generated getter and setter methods will have an extra k argument. }.ArraySize() method internally allocates a new array. long route). an exception will be thrown.. void setRouteArraySize(unsigned n). }. void setRoute(unsigned k. Existing values in the array will be preserved (copied over to the new array. the array index: virtual long getRoute(unsigned k) const.OMNeT++ Manual – Messages Fixed-size arrays You can specify fixed size arrays: message FooPacket { fields: long route[4]. and another one for returning the current array size. The set.) The default array size is zero. unsigned getRouteArraySize() const. If you call the methods with an index that is out of bounds. virtual virtual virtual virtual long getRoute(unsigned k) const. String members You can declare string-valued fields with the following syntax: message FooPacket { fields: string hostName.ArraySize() before you can start filling array elements.. long route).. In this case. }. Dynamic arrays If the array size is not known in advance. The generated getter and setter methods will return and accept const char* pointers: 89 . you can declare the field to be a dynamic array: message FooPacket { fields: long route[]. the generated class will have two extra methods in addition to the getter and setter methods: one for setting the array size. virtual void setRoute(unsigned k.
For example. char. 90 . you’ll probably need to: • set up a hierarchy of message (packet) classes. the generated C++ code will look like: class FooPacket : public FooBase { . char a).) to cMessage.. Inheritance among message classes By default. }. • use not only primitive types as fields. However..4 Inheritance.. }. .. }. messages are subclassed from cMessage. virtual void setHostName(const char *hostName). composition So far we have discussed how to add fields of primitive types (int. message FooPacket { fields: char chars[10].OMNeT++ Manual – Messages virtual const char *getHostName() const.2. NOTE: a string member is different from a character array. but if you have more complex models. you can explicitly specify the base class using the extends keyword: message FooPacket extends FooBase { fields: . that is. but also structs. which is treated as an array of any other type. virtual void setChars(unsigned k. This might be sufficient for simple models. For the example above.. Inheritance also works for structs and classes (see next sections for details). not only subclass from cMessage but also from your own message classes. The following section describes how to do this.. The generated object will have its own copy of the string. classes or typedefs. double. Sometimes you’ll want to use a C++ type present in an already existing header file. another time you’ll want a struct or class to be generated by the message compiler so that you can benefit from Tkenv inspectors. 5. will generate the following methods: virtual char getChars(unsigned k).
short version.. the generated code is different. the following code is generated: // generated C++ struct MyStruct { char array[10]. thus it will not have name(). If there is no extends. (Actually. For the definition above.. only the class keyword is used instead of message. you’ll need structs and other classes (rooted or not rooted in cObject) as building blocks. To create a class with those methods. short version. className(). }. the generated class will not be derived from cObject. }. structs we’ll cover in the next section. “C-style” meaning “containing only data and no methods”. methods. instead the fields are represented by public data members. in the C++ a struct can have methods. and in general it can do anything a class can. }.OMNeT++ Manual – Messages Defining classes Until now we have used the message keyword to define classes. It cannot have string or class as field. A struct can have primitive types or other structs as fields. you have to explicitly write extends cObject.. either directly or indirectly. etc. Inheritance is supported for structs: struct Base { .) The syntax is similar to that of defining messages: struct MyStruct { fields: char array[10]. The syntax for defining classes is almost the same as defining messages. 91 . The generated struct has no getter or setter methods. which implies that the base class is cMessage. But as part of complex messages. However.. class MyClass extends cObject { fields: . Slightly different code is generated for classes that are rooted in cObject than for those which are not. Classes can be created with the class class keyword. Defining plain C structs You can define C-style structs to be used as fields in message classes. }.
.}} and its type announced (see Announcing C++ types). }. Pointers Not supported yet.2. The generated class will contain an IPAddress data member (that is. Using structs and classes as fields In addition to primitive types. there are limitations: • dynamic arrays are not supported (no place for the array allocation code) • “generation gap” or abstract fields (see later) cannot be used. declared in a C++ header) in a message definition. that is. But because a struct has no member functions. byte2. not a pointer to an IPAddress). you have to announce those types to the message compiler.h struct IPAddress { int byte0. byte3. you can also use other structs or objects as a field.h file: // ipaddress. 92 . virtual void setSrc(const IPAddress& src).. The following getter and setter methods will be generated: virtual const IPAddress& getSrc() const. if you have a struct named IPAddress. You also have to make sure that your header file gets included into the generated _m. 5.5 Using existing C++ types Announcing C++ types If you want to use one of your own types (a class. it must either be a struct or class defined earlier in the message description file. }.OMNeT++ Manual – Messages struct MyStruct extends Base { . because they would build upon virtual functions. defined in an ipaddress.. }. For example. or it must be a C++ type with its header file included via cplusplus {{. you can write the following: message FooPacket { fields: IPAddress src. The IPAddress structure must be known in advance to the message compiler. byte1.. struct or typedef. Suppose you have an IPAddress structure.h file so that the C++ compiler can compile it.
when setting a integer field named payloadLength. The effect of the first three lines is simply that the #include statement will be copied into the generated foopacket_m.this->payloadLength. struct IPAddress. That is. the message file (say foopacket. }} directive. The message compiler itself will not try to make sense of the text in the body of the cplusplus {{ .. you’ll get a C++ compiler error in the generated header file. struct IPAddress.OMNeT++ Manual – Messages To be able to use IPAddress in a message definition.6 Customizing the generated class The Generation Gap pattern Sometimes you need the generated code to do something more or do something differently than the version generated by the message compiler. the noncobject keyword should be used: class noncobject IPAddress. this->payloadLength = payloadLength. } 93 . The distinction between classes derived and not derived from cObject is important because the generated code differs at places. If it is not.. The next line.h" }}.msg) should contain the following lines: cplusplus {{ #include "ipaddress.2. 5. you might also need to adjust the packet length. tells the message compiler that IPAddress is a C++ struct. This information will (among others) affect the generated code. Classes can be announced using the class keyword: class cSubQueue.h file to let the C++ compiler know about the IPAddress class. it should look something like this: void FooPacket::setPayloadLength(int payloadLength) { int diff = payloadLength . The above syntax assumes that the class is derived from cObject either directly or indirectly. setLength(length() + diff). The generated code is set up so that if you incidentally forget the noncobject keyword (and thereby mislead the message compiler into thinking that your class is rooted in cObject when in fact it is not). the following default (generated) version of the setPayloadLength() method is not suitable: void FooPacket::setPayloadLength(int payloadLength) { this->payloadLength = payloadLength. } Instead. For example.
Register_Class(FooPacket). the largest drawback of generated code is that it is difficult or impossible to fulfill such wishes. }. returning to our original example about payload length affecting packet length. If you process the above code with the message compiler. FooPacket_Base(const FooPacket_Base& other)..g. object oriented programming offers a solution. Hand-editing of the generated files is worthless.} virtual cObject *dup() {return new FooPacket(*this). The idea is that you have to subclass from FooPacket_Base to produce FooPacket. virtual int getSrc() const.). // make constructors protected to avoid instantiation FooPacket_Base(const char *name=NULL). fields: int payloadLength. because they will be overwritten and changes will be lost in the code generation cycle. It is enabled with the following syntax: message FooPacket { properties: customize = true. e. the code you’d write is the following: 94 . The properties section within the message declaration contains meta-info that affects how generated code will look like. This practice is known as the Generation Gap design pattern. Note that it is important that you redefine dup() and provide an assignment operator (operator=()).OMNeT++ Manual – Messages According to common belief. while doing your customizations by redefining the necessary methods.} }. constructors cannot be inherited. }. the generated code will contain a FooPacket_Base class instead of FooPacket. virtual void setSrc(int src). public: . However. class FooPacket_Base : public cMessage { protected: int src. because not everything can be pre-generated as part of FooPacket_Base. This minimum code is the following (you’ll find it the generated C++ header too. There is a minimum amount of code you have to write for FooPacket. A generated class can simply be customized by subclassing from it and redefining whichever methods need to be different from their generated versions. The customize property enables the use of the Generation Gap pattern. So.. return *this.
dup() // .OMNeT++ Manual – Messages class FooPacket : public FooPacket_Base { // here come the mandatory methods: constructor. fields: abstract bool urgentBit. this is the situation when you want to store a bitfield in a single int or short. virtual void setUrgentBit(bool urgentBit) = 0. virtual void setPayloadLength(int newlength). 5. so that you can immediately redefine the abstract (pure virtual) methods and supply your implementation.. and provide an underlying implementation using vector<T>. the message compiler generates no data member. See the following message declaration: 95 . It is also useful for implementing computed fields. push(). // copy contructor. That is. } Abstract fields The purpose of abstract fields is to let you to override the way the value is stored inside the class. vector and stack are representations of a sequence – same abstraction as dynamic-size vectors. and generated getter/setter methods will be pure virtual: virtual bool getUrgentBit() const = 0. // set the new length FooPacket_Base::setPayloadLength(newlength).7 Using STL in message classes You may want to use STL vector or stack classes in your message classes.. etc. you can declare the field as abstract T fld[]. } void FooPacket::setPayloadLength(int newlength) { // adjust message length setLength(length()-getPayloadLength()+newlength). For example. For an abstract field. }. on the underlying STL object. and still you want to present bits as individual packet fields. You can declare any field to be abstract with the following syntax: message FooPacket { properties: customize = true. This is possible using abstract fields. After all. pop().2. operator=(). Usually you’ll want to use abstract fields together with the Generation Gap pattern. You can also add methods to the message class that invoke push_back(). and still benefit from inspectability in Tkenv.
You can write the following C++ file then to implement foo and bar with std::vector and std::stack: #include <vector> #include <stack> #include "stlmessage_m.size(). fields: abstract Item foo[]. foo = other.} // foo methods virtual void setFooArraySize(unsigned int size) {} virtual unsigned int getFooArraySize() const {return foo. const Item& afoo) {foo[k]=afoo.bar.h" class STLMessage : public STLMessage_Base { protected: std::vector<Item> foo. int kind=0) : STLMessage_Base(name. STLMessage_Base::operator=(other).} virtual Item& getBar(unsigned int k) {throw new cException("sorry"). // will use vector<Item> abstract Item bar[]. } virtual cObject *dup() {return new STLMessage(*this). public: STLMessage(const char *name=NULL. } message STLMessage { properties: customize=true. bar = other. You can implement everything as you like.} 96 .} // bar methods virtual void setBarArraySize(unsigned int size) {} virtual unsigned int getBarArraySize() const {return bar.name()) {operator=(other STLMessage& operator=(const STLMessage& other) { if (&other==this) return *this. return *this. double b.OMNeT++ Manual – Messages struct Item { fields: int a.} virtual void addToFoo(const Item& afoo) {foo. no data members or anything concrete.foo.} virtual Item& getFoo(unsigned int k) {return foo[k]. std::stack<Item> bar.size().} virtual void setFoo(unsigned int k. // will use stack<Item> } If you compile the above.kind) {} STLMessage(const STLMessage& other) : STLMessage_Base(other.push_back(afoo). in the generated code you’ll only find a couple of abstract methods for foo and bar.
setBar(int k.top(). STL itself was purposefully designed with a low-level approach. char. Well you could expose them (by adding a vector<Item>& getFoo() {return foo. classes (both rooted and not rooted in cObject). int.} 5. You can generate: • classes rooted in cObject • messages (default base class is cMessage) • classes not rooted in cObject • plain C structs The following data types are supported for fields: • primitive types: bool. const Item&) could not be implemented. setFooArraySize(). long. double • string. unsigned short.pop(). It could still be implemented in a less efficient way using STL iterators.push(abar). void setBar(unsigned int k. setBarArraySize() are redundant. 3. declared with the message syntax or externally in C++ code • variable-sized arrays of the above types (stored as a dynamically allocated array plus an integer for the array size) Further features: • fields initialize to zero (except struct members) 97 . You may regret that the STL vector/stack are not directly exposed. and efficiency does not seem to be major problem because only Tkenv is going to invoke this function.OMNeT++ Manual – Messages virtual virtual virtual virtual }. unsigned int. presented as const char * • fixed-size arrays of the above types • structs. The exception will materialize in a Tkenv error dialog when you try to change the field value. short. to provide “nuts and bolts” for C++ programming.} method to the class) but this is probably not a good idea. const Item& bar) {throw new cException("sorry"). 2. and STL is better used in other classes for internal representation of data. void barPush(const Item& abar) {bar.} Item& barTop() {return bar. getBar(int k) cannot be implemented in a straightforward way (std::stack does not support accessing elements by index). but this is not particularly a problem. Register_Class(STLMessage).} void barPop() {bar. a dynamically allocated string. Some additional notes: 1.8 Summary This section attempts to summarize the possibilities.2. unsigned long.
Hypercube) use message definitions. Example simulations Several of the example simulations (Token Ring. fixed-size arrays double field[4]. double d). unsigned getFieldArraySize(). void setField(unsigned k. d void setField(double d) = 0. and you have to write: class Foo : public Foo_Base { . dynamic arrays double field[].ouble getField() = 0.. For example. double getField(unsigned k). Dyna. double getField(unsigned k). void setField(unsigned k.. abstract fields abstract double field. void setFieldArraySize(unsigned n).. string type string field. although this is not written out in the following table): Field declaration primitive types double field. • inheritance • customizing the generated class via subclassing (Generation Gap pattern) • abstract fields (for nonstandard storage and calculated fields) Generated code (all generated methods are virtual. in Dyna you’ll find this: 98 . class Foo_Base { . }. double d). unsigned getFieldArraySize().. }. customized class class Foo { properties: customize=true. void setField(double d). void setField(const char *). Generated code double getField(). const char *getField().OMNeT++ Manual – Messages • fields initializers can be specified (except struct members) • assigning enums to variables of integral types.
..h and dynapacket_m.) use the generated message classes 5. return fieldname[k]. There is a solution however: one can supply Tkenv with missing “reflection” information about the new class. "power".cc. ..cc are produced by the message subclassing compiler from it. because C++ does not support “reflection” (extracting class information at runtime) like for example Java does. the message compiler also generates reflection code which makes it possible to inspect message contents in Tkenv.. In real code. freq and power should be private members.. and getter/setter methods should exist to access them. etc. The problem cannot be solved entirely within Tkenv.9 What else is there in the generated code? In addition to the message class and its implementation. doesn’t know about your C++ instance variables. }. This descriptor class might look like this: class RadioMsgDescriptor : public Descriptor { public: virtual int getFieldCount() {return 2. You’d notice one drawback of this solution when you try to use Tkenv for debugging. being just another C++ library in your simulation program. server. Also. .) that should be written. } 1 Note that the code is only for illustration. .cc. Reflection info might take the form of a separate C++ class whose methods return information about the RadioMsg fields. While cPar-based message parameters can be viewed in message inspector windows..msg defines DynaPacket and DynaDataPacket. msg->freq = 1. fields added via subclassing do not appear there. double power. the above class definition misses several member functions (constructor.} if (k<0 || k>=2) return NULL. msg->power = 10. • dynapacket_m. assignment operator. and they contain the generated DynaPacket and DynaDataPacket C++ classes (plus code for Tkenv inspectors). You could write the following: 1 class RadioMsg : public cMessage { public: int freq. suppose you manually subclass cMessage to get a new message class. To illustrate why this is necessary.2. 99 .} virtual const char *getFieldName(int k) { const char *fieldname[] = {"freq".0. The reason is that Tkenv. • other model files (client. Now it is possible to use RadioMsg in your simple modules: RadioMsg *msg = new RadioMsg().OMNeT++ Manual – Messages • dynapacket.
// not found } //. int k) { if (k==0) return msg->freq. if (k==1) return msg->power.0. }.. Then you have to inform Tkenv that a RadioMsgDescriptor exists and that it should be used whenever Tkenv finds messages of type RadioMsg (as it is currently implemented. whenever the object’s className() method returns "RadioMsg"). but not much. Tkenv can use RadioMsgDescriptor to extract and display the values of the freq and power variables. 100 . The actual implementation is somewhat more complicated than this.OMNeT++ Manual – Messages virtual double getFieldAsDouble(RadioMsg *msg. So when you inspect a RadioMsg in your simulation.. return 0.
9) • dynamic module creation (section 4.OMNeT++ Manual – The Simulation Library Chapter 6 The Simulation Library OMNeT++ has an extensive C++ class library which you can use when implementing simple modules. cDoubleHistogram.7 and 4. cKSplit classes • making variables inspectable in the graphical user interface (Tkenv): the WATCH() macro (cWatch class) • sending debug output to and prompting for user input in the graphical user interface (Tkenv): the ev object (cEnvir class) 101 . cPSquare.6) • access to module gates and parameters via cModule member functions (sections 4.11) This chapter discusses the rest of the simulation library: • random number generation: normal(). cVarHistogram. Parts of the class library have already been covered in the previous chapters: • the message class cMessage (chapter 5) • sending and receiving messages. scheduling and canceling events. etc.8) • accessing other modules in the network (section 4. • module parameters: cPar class • storing data in containers: the cArray and cQueue classes • routing support and discovery of network topology: cTopology class • recording statistics into files: cOutVector class • collecting simple statistics: cStdDev and cWeightedStddev classes • distribution estimation: cLongHistogram. exponential(). terminating the module or the simulation (section 4.
Functionality and conventions that come from cObject: • name attribute • className() member and other member functions giving textual information about the object • conventions for assignment. 6.1. and it defaults to NULL (no name string). // returns "cMessage" 6.. duplicating the object • ownership control for containers derived from cObject • support for traversing the object tree • support for inspecting the object in graphical user interfaces (Tkenv) • support for automatic cleanup (garbage collection) at the end of the simulation Classes inherit and redefine several cObject member functions.4 Name attribute An object can be assigned a name (a character string). You can get a pointer to the internally stored copy of the name string like this: 102 .1.1.) and its getter counterpart is named foo(). 6. length = msg->length(). An example: cMessage *timeoutMsg = new cMessage("timeout"). the length attribute of the cMessage class can be set and read like this: msg->setLength( 1024 ).3 className() For each class.1. the className() member function returns the class name as a string: const char *classname = msg->className().1 Class library conventions Base class Classes in the OMNeT++ simulation library are derived from cObject.) For example. The name string is the first argument to the constructor of every class.2 Setting and getting attributes Member functions that set and query object attributes follow consistent naming.1 6. (The get verb found in Java and some other libraries is omitted for brevity.. The setter member function has the form setFoo(. You can also set the name after the object has been created: timeoutMsg->setName("timeout").OMNeT++ Manual – The Simulation Library 6. in the following we’ll discuss some of the practically important ones. copying.
the empty string "" and NULL are treated as equivalent by library objects.subnet1. // --> "net. // --> "node" ev << this->fullName(). sprintf("msg is ’%80s’". const char *str = msg->name(). operator=() can be used to copy contents of an object into another object of the same type. dup() returns a pointer of type cObject*. For example: 103 .) For many of them. for a module node[3] in the submodule vector node[10] name() returns "node".subnet1".subnet1. fullName() and fullPath() are extensively used on the graphical runtime environment Tkenv. there is a corresponding iterator class that you can use to loop through the objects stored in the container. For other objects. That is. This is a deep copy: object contained in the object will also be duplicated if necessary. duplicating contained objects also if necessary.5 fullName() and fullPath() Objects have two more member functions which return strings based on object names: fullName() and fullPath(). dup() works by calling the copy constructor. but when fullPath() is used as a "%s" argument to sprintf() you have to write fullPath().OMNeT++ Manual – The Simulation Library const char *name = timeoutMsg->name().7 Iterators There are several container classes in the library (cQueue. if the node[3] module above is in the compound module "net.1. That is. This is especially useful in the case of message objects. operator=() does not copy the name string – this task is done by the copy constructor. For gates and modules which are part of gate or module vectors. That is. name() and fullName() return const char * pointers. so it needs to be cast to the proper type: cMessage *copyMsg = (cMessage *) msg->dup(). // --> returns "" 6. cArray etc. <additional args>).6 Copying and duplicating objects The dup() member function creates an exact copy of the object. If you create a message object with either NULL or "" as name string. which in turn relies on the assignment operator between objects.c_str(). 6. // note c_str() 6. // --> "timeout" For convenience and efficiency reasons. its fullPath() method will return "net. msg->fullPath(). fullPath() returns fullName(). and fullPath() returns std::string.node[3]" className(). prepended with the parent or owner object’s fullPath() and separated by a dot.1.c_str()). and fullName() returns "node[3]". "" is stored as NULL but returned as "". fullName() is the same as name(). and also appear in error messages. This makes no difference with ev«. char buf[100].node[3]". // --> "node[3]" ev << this->fullPath(). cMessage *msg = new cMessage(NULL. it will be stored as NULL and name() will return a pointer to a static "".1. ev << this->name(). fullName() returns the name with the index in brackets.
EV << "Packet " << msg->name() << " received\n".ini so that it doesn’t slow down simulation when it is not needed.disabled() call returns true when ev« output is disabled. The ev. 104 . 6. (This output can also be disabled from omnetpp. //. A more sophisticated implementation of the same idea is to define an EV macro which can be used in logging statements instead of ev. sequence number is " << seqNum << endl. ev << "queue full. seqNum). you can open a text output window for every module. one would simply write EV« instead of ev«.) In Tkenv. You can send debugging output to ev with the C++-style output operators: ev << "packet received. The definition: #define EV ev. It is not recommended that you use printf() or cout to print messages – ev output can be controlled much better from omnetpp. OMNeT++ provides utility functions.OMNeT++ Manual – The Simulation Library cQueue queue. we introduce it here. !queueIter. it is simply dumped to the standard output. discarding packet\n".3 Simulation time conversion Simulation time is represented by the type simtime_t which is a typedef to double.. An alternative solution is ev. In the command-line user interface (Cmdenv). sequence number is %d\n". using Tkenv. } 6. Thus. The slightly tricky definition of EV makes use of the fact that the « operator binds looser than ?:.disabled()) ev << "Packet " << msg->name() << " received\n".ini and it is more convenient to view. which convert simtime_t to a printable string ("3s 130ms 230us") and vica versa.end(). one can write code like this: if (!ev. One can save CPU cycles by making logging statements conditional on whether the output actually gets displayed or recorded anywhere. The ev object represents the user interface of the simulation. The exact way messages are displayed to the user depends on the user interface. queueIter++) { cObject *containedObject = queueIter(). such as in Tkenv or Cmdenv “express” mode.printf("packet received.2 Logging from modules The logging feature will be used extensively in the code examples.disabled()?std::cout:ev And after that. for (cQueue::Iterator queueIter(queue).printf(): ev. the runtime GUI.
For non-random numbers. it returns 0. pp.net. usually between 0 or 1 and 232 or so.ini 1 There are real random numbers as well. strToSimtime0() can be used if the time string is a substring in a larger string. and 623-dimensional equidistribution property is assured. An example: char buf[32]. simtime_t t = strToSimtime("30s 152ms"). and returns the value. because it makes simulation runs repeatable. Rather. The result is placed into the char array pointed to by the second argument. This is a useful property and of great importance. -1 is returned. MT is also very fast: as fast or faster than ANSI C’s rand(). simTimeToStr(t2.org/. This RNG is still available and can be selected from omnetpp. Instead of taking a char*. it takes a reference to char* (char*&) as the first argument. MT has a period of 21 9937 − 1. or sometimes pseudo random number generators or PRNGs to highlight their deterministic nature. The function sets the pointer to the first character that could not be interpreted as part of the time string. t2=%s\n".4.4 Generating random numbers Random numbers in simulation are never random.1 Random number generators Mersenne Twister By default. 105 . try www. If the string cannot be entirely interpreted.noentropy. 1 Starting from the same seed. Such algorithms and their implementations are called random number generators or RNGs. ev.OMNeT++ Manual – The Simulation Library The simtimeToStr() function converts a simtime_t (passed in the first argument) to textual form.g. If the second argument is omitted or it is NULL. Algorithms take a seed value and perform some deterministic calculations on them to produce a “random” number and the next seed. simtimeToStr() will place the result into a static buffer which is overwritten with each call. simtimeToStr(t1).455.comscire. simtime_t t = strToSimtime0(s).buf)). or the Linux /dev/random device. Nishimura [MN98]. 6. Matsumoto and T. // now s points to "and something extra" 6. and returns a simtime_t. RNGs always produce the same sequence of random numbers. OMNeT++ uses the Mersenne Twister RNG (MT) by M. The strToSimtime() function parses a time specification passed in a string. RNGs produce uniformly distributed integers in some range.com. The "minimal standard" RNG OMNeT++ releases prior to 3. Another variant.0 used a linear congruential generator (LCG) with a cycle length of 231 − 2. see e. It never returns -1. they are produced using deteministic algorithms. if nothing at the beginning of the string looked like simulation time.random.. 441-444. const char *s = "30s 152ms and something extra". described in [Jai91].("t1=%s. Matematical transformations are used to produce random variates from them that correspond to specific distributions.
.ini (section 8.6). The Akaroa RNG also has to be selected from omnetpp. A simulation technique called variance reduction is also related to the use of different random number streams. you can also select Akaroa’s RNG as the RNG underlying for the OMNeT++ random number functions.6). The mapping allows for great flexibility in RNG usage and random number streams configuration – even for simulation models which were not written with RNG awareness. 6. In OMNeT++.4. This RNG is only suitable for small-scale simulation studies. n − 1]. 1). It also contains useful links and references on the topic.1) They also have a counterparts that use generator k: int dice = 1 + genk_intrand(k. the seedtool program can be used for selecting good seeds (section 8. if a network simulation uses random numbers for generating packets and for simulating bit errors in the transmission. // uses generator k double prob = genk_dblrand(k).5 double p = dblrand(). and it is well worth reading. this arrangement would allow you to perform several simulation runs with the same traffic but with bit errors occurring in different places. Since the seeds for each stream can be configured independently. For example.3. Examples: int dice = 1 + intrand(6).ini (section 8.3 Accessing the RNGs The intrand(n) function generates random integers in the range [0. the cycle length of about 231 is too small (on todays fast computers it is easy to exhaust all random numbers). As shown by Karl Entacher et al. For the "minimal standard RNG".6). 6. Overlap in the generated random number sequences can introduce unwanted correlation in your results. This mechanism. For example. // dblrand() produces numbers in [0. // "" 106 . based on the cRNG interface. streams are identified with RNG numbers.6.6).2 Random number streams. and the structure of the generated “random” points is too regular.ini (section 8. that is. and dblrand() generates a random double on [0. from several independent RNG instances.10). RNG mapping Simulation programs may consume random numbers from several streams. one candidate to include could be L’Ecuyer’s CMRG [LSCK02] which has a period of about 2191 and can provide a large number of guaranteed independent streams. Other RNGs OMNeT++ allows plugging in your own RNGs as well. is described in section 13. in [EHW02]. It is also important that different streams and also different simulation runs use non-overlapping series of random numbers. These functions simply wrap the underlying RNG objects.4. it might be a good idea to use different random streams for both. The Akaroa RNG When you execute simulations under Akaroa control (see section 8.5.OMNeT++ Manual – The Simulation Library (Chapter 8). // result of intrand(6) is in the range 0. The [Hel98] paper provides a broader overview of issues associated with RNGs used for simulation. The RNG numbers used in simple modules may be arbitrarily mapped to the actual random number streams (actual RNG instances) from omnetpp. The number of random number streams as well as seeds for the individual streams can be configured in omnetpp.6).
normal distribution truncated to nonnegative rng=0) values gamma_d(alpha. rng=0) beta distribution with parameters alpha1>0. rng=0) generalized Pareto distribution with parameters a. a!=c lognormal(m.OMNeT++ Manual – The Simulation Library The underlying RNG objects are subclassed from cRNG.4 Random variates The following functions are based on dblrand() and return random variables of different distributions: Random variate functions use one of the random number generators (RNGs) provided by OMNeT++. b. beta. b. stddev. alpha2. cRNG *rng1 = rng(1). rng=0) lognormal distribution with mean m and variance s>0 weibull(a. b. 6. rng=0) Weibull distribution with parameters a>0. OMNeT++ has the following predefined distributions: Description Continuous distributions uniform(a. s. The argument to rng() is a local RNG number which will undergo RNG mapping. b. rng=0) student-t distribution with i>0 degrees of freedom cauchy(a. alpha2>0 erlang_k(k. rng=0) uniform distribution in the range [a. beta>0 beta(alpha1. c. rng=0) gamma distribution with parameters alpha>0. rng=0) uniform integer from a. stddev. By default this is generator 0. rng=0) triangular distribution with parameters a<=b<=c. p.b bernoulli(p. rng=0) chi-square distribution with k>0 degrees of freedom student_t(i. cRNG contains the methods implementing the above intrand() and dblrand() functions. b.4. c. rng=0) Erlang distribution with k>0 phases and the given mean chi_square(k. b.. rng=0) exponential distribution with the given mean normal(mean. and they can be accessed via cModule’s rng() method. The cRNG interface also allows you to access the “raw” 32-bit random numbers generated by the RNG and to learn their ranges (intRand(). b>0 pareto_shifted(a. intRandMax()) as well as to query the number of random numbers generated (numbersDrawn()). rng=0) normal distribution with the given mean and standard deviation truncnormal(mean. rng=0) Cauchy distribution with parameters a. b and shift c Discrete distributions intuniform(a. but you can specify which one to be used.b) exponential(mean.b where b>0 triang(a. rng=0) binomial distribution with parameters n>=0 and 0<=p<=1 Function 107 . rng=0) result of a Bernoulli trial with probability 0<=p<=1 (1 with probability p and 0 with probability (1-p)) binomial(n. mean.
cVarHistogram. p.1: cQueue: insertion and removal The basic cQueue member functions dealing with insertion and removal are insert() and pop(). so for example the outcome of tossing a coin could be written as intuniform(1. cPar. This feature is documented later. etc.4.OMNeT++ Manual – The Simulation Library geometric(p. rng=0) geometric distribution with parameter 0<=p<=1 binomial distribution with parameters n>0 and 0<=p<=1 Poisson distribution with parameter lambda They are the same functions that can be used in NED files. with the statistical classes. 6. its implementation generates a number with normal distribution and if the result is negative. 6.1 Container classes Queue class: cQueue Basic usage cQueue is a container class that acts as a queue. truncnormal() is the normal distribution truncated to nonnegative values.5 6. cKSplit or cPSquare classes are there to generate random numbers from equidistant-cell or equiprobable-cell histograms. it keeps generating other numbers until the outcome is nonnegative. If you register your functions with the Register_Function() macro. cQueue uses a double-linked list to store the elements.5. rng=0) poisson(lambda. such as cMessage. intuniform() generates integers including both the lower and upper limit. Figure 6. The cLongHistogram. you can use them in NED files and ini files too.2). cQueue can hold objects of type derived from cObject (almost all classes from the OMNeT++ library). new elements are inserted at its head and elements are removed at its tail. cDoubleHistogram. // insert messages 108 . Normally. you can write your own functions. Internally. If the above distributions do not suffice.5 Random numbers from histograms You can also specify your distribution as a histogram. rng=0) negbinomial(n. They are used like this: cQueue queue("my-queue"). A queue object has a head and a tail. cMessage *msg.
Iterators Normally. However.remove( msg ). i++) { msg = new cMessage. cQueue::Iterator. the () operator to get a pointer to the current item. cObject::cmpbyname.1). but it can also act as a priority queue. iter++) { 109 .pop(). and inserts it there.end(). regardless of the ordering function. } // remove messages while( ! queue. that is. } The length() member function returns the number of items in the queue. If you want to use this feature. queue. and empty() tells whether there’s anything in the queue. !iter. Otherwise it acts as any other OMNeT++ iterator class: you can use the ++ and – operators to advance it. true ).empty() ) { msg = (cMessage *)queue. i<10. without affecting queue contents. cQueue implements a FIFO. the insert() function uses the ordering function: it searches the queue contents from the head until it reaches the position where the new item needs to be inserted. 0 or 1 as the result (see the reference for details). The insertBefore() and insertAfter() functions insert a new item exactly before and after a specified one. The pop() function can be used to remove items from the tail of the queue. delete msg. 1=head. An example of setting up an ordered cQueue: cQueue sortedqueue("sortedqueue". it can keep the inserted objects ordered. you can examine each object in the queue.OMNeT++ Manual – The Simulation Library for (int i=0. // sorted by object name. Priority queue By default. The tail() and head() functions return pointers to the objects at the tail and head of the queue. you have to provide a function that takes two cObject pointers. and the remove() function can be used to remove any item known by its pointer from the queue: queue. compares the two objects and returns -1. ascending If the queue object is set up as an ordered queue. if you use an iterator class. There are other functions dealing with insertion and removal. and the end() member function to examine if you’re at the end (or the beginning) of the queue. The cQueue::Iterator constructor takes two arguments.insert( msg ). you can only access the objects at the head or tail of the queue. the first is the queue object and the second one specifies the initial position of the iterator: 0=tail. An example: for( cQueue::Iterator iter(queue.
cArray works as an array. it is reallocated. you can write: delete array. You can also search the array or get a pointer to an object by the object’s name: int index = array.find(p).p). Par *p = (cPar *) array["par"]. Getting a pointer to an object at a given index: cPar *p = (cPar *) array[index]. } 6.remove(index).find("par"). //. int index = array.5. Internally.remove( index ). Adding an object at the first free index: cPar *p = new cPar("par").OMNeT++ Manual – The Simulation Library cMessage *msg = (cMessage *) iter(). for storing module parameters and gates. the index position or the object pointer: array. array. 110 . If you also want to deallocate it..2 Expandable array: cArray Basic usage cArray is a container class that holds objects derived from cObject. you’ll get an error message): cPar *p = new cPar("par"). but it grows automatically when it gets full. cArray is implemented with an array of pointers. when the array fills up. and internally.add( p ).. Adding an object at a given index (if the index is occupied. array.remove( p ). Creating an array: cArray array("array"). cArray stores the pointers of the objects inserted instead of making copies. Finding an object in the array: int index = array.addAt(5. cArray objects are used in OMNeT++ to store parameters attached to messages. int index = array. You can remove an object from the array by calling remove() with the object name.remove("par"). The remove() function doesn’t deallocate the object. but it returns the object pointer.
The items() member function returns the largest index plus one. 2 cPar objects used to be employed also for adding parameters (extra fields) to cMessage. double foo = (double) par("foo").7) are represented as cPar objects. for (int i=0.2) got supported. i++) { if (array[i]) // is this position used? { cObject *obj = array[i]. 2 Module parameters are accessed via cModule’s par() method: cPar& par(const char *parameterName). but these types were used primarily for message parameters before message definitions (section 5. i<array.6. double doubleValue(). numeric (long or double).OMNeT++ Manual – The Simulation Library Iteration cArray has no iterator.1 Reading the value cPar has a number of methods for getting the parameter’s value: bool boolValue(). 3 Thus. const char *. long longValue(). but it is easy to loop through all the indices with an integer variable. The module parameter name is the cPar object’s name. ev << obj->name() << endl. and you cannot create such module parameters from NED.2) are a far superior solution in every respect. 111 . 6. that is. While technically this is still feasible. long. any of the following ways would work to store a parameter’s value in a variable: double foo = par("foo").6 The parameter class: cPar Module parameters (as discussed in section 4. and also for cXMLElement *. const char *stringValue(). There are also overloaded type cast operators for C/C++ primitive types including bool.items(). and the object can store any parameter type supported by the NED language. 3 cPar also supports the void * and cObject * types. } } 6. bool. If you use the par("foo") parameter in expressions (such as 4*par("foo")+2). cXMLElement *xmlValue(). double foo = par("foo"). In that case you have to clarify by adding either an explicit cast ((double)par("foo") or (long)par("foo")) or use the doubleValue() or longValue() methods.doubleValue(). double. string and XML config file reference. the C++ compiler may be unable to decide between overloaded operators and report ambiguity. int. message definitions (section 5.
12. cPar pp = pp = pp = pp("pp"). the parameter value will be searched for in the configuration (ini) file.setDoubleValue(intuniform.setInput(true).g.0.0).setDoubleValue(genk_normal.0.setDoubleValue(exponential.setStringValue("one two three"). use the genk_xxx versions of the random functions: rnd.// uniform distr. There are also overloaded assignment operators for C++ primitive types. One is the set. an input flag can be set. // exponential distr. // normal distr. 100. // make it an input parameter double d = (double)foo.3 Setting cPar to return random numbers Setting cPar to call a function with constant arguments can be used to make cPar return random variables from different distributions: cPar rnd("rnd"). (mean) intuniform(). foo. "one two three". For numeric and string types.setDoubleValue(normal. if it is not found there. 5. the user will be offered to enter the value interactively. when the object’s value is first used. The above functions use number 0 from the several random number generators. Short strings (less than ∼20 chars) are handled more efficiently because they are stored in the object’s memory space (and are not dynamically allocated). 100.0). foo.6.setPrompt("Enter foo value:").. rnd.setLongValue(12). const char *. To use another generator. are ordinary C functions taking double arguments and returning double.setDoubleValue(2.7371).2 Changing the value There are many ways to set a cPar’s value. Examples: cPar foo("foo"). 5. foo. 3. rnd.0)) and its return value used. 2.5. The cPar object makes its own copy of the string.Value() member functions: cPar& foo = par("foo"). so the original one does not need to be preserved..0. normal() etc.OMNeT++ Manual – The Simulation Library 6. In this case. foo. and cXMLElement *. normal(100. they will be mentioned in the next section. -10. // uses generator 3 112 . // the user will be prompted HERE 6. foo.dev) rnd.0.7371. the function will be called with the given constant arguments (e. Each time you read the value of a cPar containing a function like above. 10.6.0). 10.0). (mean. cPar can also store other types which yield numeric results such as function with constant args.
int long longValue(). Description string value. op=(double).2 or 3 doubles and return a double. The isNumeric() function tells whether the object stores a data types which allows the doubleValue() method to be called. 113 . Can also be retrieved from the object as double. [double]. op long(). double-precision floating point value. 6. Example: cPar par = 10L. string. bool. signed long integer value. This type is mainly used to generate random numbers: e. const char * stringValue(). bool boolValue(). op double(). F function setDoubleValue( MathFunc. op double(). op=(bool).6. Type Storage Member functions char type S string setStringValue( const char *). The function is given by its pointer. op bool(). Storage types are internally identified by type characters. // returns storage type ’L’ The all cPar data types and are summarized in the table below. Mathematical function with constant arguments. L long setLongValue(long).g.setDoubleValue(hist).. char typechar = par. rnd2. // the distribution cPar rnd2("rnd2").. double.. it must take 0.. D double setDoubleValue(double). [double]. The type character is returned by the type() method. op=(const char *). op const char *(). Short strings (len<=27) are stored inside cPar object.1. [double]).4 cPar storage types cPar supports the basic data types (long.type(). double doubleValue(). double doubleValue(). op=(long). B boolean setBoolValue(bool). without using heap allocation.OMNeT++ Manual – The Simulation Library A cPar object can also be set to return a random variable from a distribution collected by a statistical data collection object: cDoubleHistogram hist =. the function takes mean and standard deviation and returns a random variable of a certain distribution. boolean value. Can also be retrieved from the object as long (0 or 1). XML) via several storage types.
can use math operators (+-*/^% etc). op double(). cXMLElement *xmlValue(). even the type() function will return the type in the other cPar (so you’ll never get ’I’ as the type). Ownership management is done through takeOwnership(). double doubleValue().7 6. double doubleValue(). function calls (function must take 0.1 Routing support: cTopology Overview The cTopology class was designed primarily to support routing in telecommunication or multiprocessor networks. distrib.1. refer to other cPars (e. setDoubleValue( cStatistic*). Runtime-evaluated compiled expression. void *pointerValue().) Memory management can be controlled through the configPointer() member function. I indirect value 6. cPar *redirection(). All value setting and reading operates on the other cPar. The expression must be given in an array of cPar::ExprElem structs.int). Expression can contain constants. non-cObject object etc. The expression should be supplied in a method of an object subclassed from cDoubleExpression. M P void* pointer O object pointer pointer to a non-cObject item (C struct. Reference to an XML element.2 or 3 doubles and return a double). op cObject *().g. value is redirected to another cPar object. op=(cObject *). setDoubleValue( cPar::ExprElem*. op void *(). pointer to an object derived from cObject. cancelRedirection(). op double(). XML setXMLValue( cXMLElement *node). module parameters).OMNeT++ Manual – The Simulation Library X expr. setRedirection(cPar*).7. cPar objects. A cTopology object stores an abstract representation of the network in graph form: 114 . setObjectValue(cObject*). This redirection can only be broken with the cancelRedirection() member function. bool isRedirected(). op cXMLElement*(). setPointerValue(void*). cDoubleExpression *expr). op=(void *). op double(). cObject *objectValue(). Runtime-evaluated Reverse Polish expression. random variable generated from a distribution collected by a statistical data collection object (derived from cStatistic). Module parameters taken by ref use this mechanism. found in an XML config file. double doubleValue(). C T compiled setDoubleValue( expr.
OMNeT++ Manual – The Simulation Library • each cTopology node corresponds to a module (simple or compound).) cTopology topo. Second. "Host". connections) is preserved: you can easily find the corresponding module for a cTopology node and vica versa. edges) and network model (modules. typeNames[1] = "Host". The graph will include all connections among the selected modules. A dynamically assembled list of module types can be passed as a NULL-terminated array of const char* pointers.extractByModuleType(typeNames). NULL). topo. An example for the former: cTopology topo. just as module gates are. You can specify which modules (either simple or compound) you want to include in the graph. topo. 115 . all nodes are at the same level.extractByModuleType("Router".2 Basic usage You can extract the network topology into a cTopology object by a single function call. If you’re writing a router or switch model. typeNames[0] = "Router".extractByParameter( "includeInTopo". Any number of module types can be supplied. You have several ways to select which modules you want to include in the topology: • by module type • by a parameter’s presence and its value • with a user-supplied boolean function First. The mapping between the graph (nodes. &yes ). const char *typeNames[3]. you can extract all modules which have a certain parameter: topo. Graph edges are directed. the cTopology graph can help you determine what nodes are available through which gate and also to find optimal routes. The cTopology object can calculate shortest paths between nodes for you. typeNames[2] = NULL.7. In the graph. there’s no submodule nesting. the list must be terminated by NULL. or in an STL string vector std::vector<std::string>.extractByParameter( "ipAddress" ). you can specify which node types you want to include. The following code extracts all modules of type Router or Host. gates. (Router and Host can be either simple or compound module types. You can also specify that the parameter must have a certain value for the module to be included in the graph: cPar yes = "yes". and • each cTopology edge corresponds to a link or series of connecting links. topo. Connections which span across compound module boundaries are also represented as one graph edge. 6.
extractFromNetwork( selectFunction. ev << " It has " << node->outLinks() << " conns to other nodes\n".) Once you have the topology extracted. cGate *gate = node->out(j)->localGate(). (sTopoLinkIn and cTopology::LinkOut are ‘aliases’ for cTopology::Link. you can determine the modules and gates involved. it returns NULL). the implementation is a bit tricky here: the same graph edge object cTopology::Link is returned either as cTopology::LinkIn or as cTopology::LinkOut so that “remote” and “local” can be correctly interpreted for edges of both directions.OMNeT++ Manual – The Simulation Library The third form allows you to pass a function which can determine for each module whether it should or should not be included. outLinks() return the number of connections. (If the module is not in the graph. The remoteNode() function returns the other end of the connection. You can have cTopology pass supplemental data to the function through a void* pointer. The correspondence between a graph node and a module can be obtained by: cTopology::Node *node = topo. ev << " and " << node->inLinks() << " conns from other nodes\n". cTopology::Node’s other member functions let you determine the connections of this node: inLinks(). Consider the following code (we’ll explain it shortly): for (int i=0.nodes(). and node(i) returns a pointer to the ith node. void *) { return mod->parentModule() == simulation. i<topo. } } The nodes() member function (1st line) returns the number of nodes in the graph. nodeFor() uses binary search within the cTopology object so it is fast enough. we’ll talk about them later. A cTopology object uses two types: cTopology::Node for nodes and cTopology::Link for edges. An example which selects all top-level modules (and does not use the void* pointer): int selectFunction(cModule *mod. localGateId() and remoteGateId() return the gate pointers and ids of the gates involved. i++) { cTopology::Node *node = topo. for (int j=0. you can start exploring it.node(i).systemModule(). in(i) and out(i) return pointers to graph edge objects. ev << " Connections to other modules are:\n". j<node->outLinks(). The nodeFor() member function returns a pointer to the graph node for a given module.) 116 . By calling member functions of the graph edge object. cModule *module = node->module().nodeFor( module ). } topo. (Actually. remoteGate(). NULL ). an cTopology::Node structure. ev << " " << neighbour->module()->fullPath() << " through gate " << gate->fullName() << endl. ev << "Node i=" << i << " is " << node->module()->fullPath() << endl. and localGate(). j++) { cTopology::Node *neighbour = node->out(j)->remoteNode().
In the simplest case. if (node == NULL) { ev < "We (" << fullPath() << ") are not included in the topology. The result can then be extracted using cTopology and cTopology::Node methods. that is. The cTopology’s targetNode() function returns the target node of the last shortest path search. If the shortest paths were created by the . ev << "There are " << node->paths() << " equally good directions.targetNode()) { ev << "We are in " << node->module()->fullPath() << endl. node = path->remoteNode(). Walking along the path from our module to the target node: cTopology::Node *node = topo. You can enable/disable nodes or edges in the graph.nodeFor( targetmodulep ). it returns the number of hops.. The paths() member function returns the number of edges which are part of a shortest path. A real-life example when we have the target module pointer. all edges are assumed to have the same weight. finding the shortest path looks like this: cModule *targetmodulep =. This is done by calling their enable() or disable() member functions. ev << "Taking gate " << path->localGate()->fullName() << " we arrive in " << path->remoteNode()->module()->fullPath() << " on its gate " << path->remoteGate()->fullName() << endl. The algorithm is computationally inexpensive. cTopology finds shortest paths from all nodes to a target node. ev << node->distanceToTarget() << " hops to go\n"..3 Shortest paths The real power of cTopology is in finding shortest paths in the network to support optimal routing.nodeFor( this ). cTopology::LinkOut *path = node->path(0). taking the first one\n".. topo. only one of the several possible shortest paths are found.\n".. paths() will always return 1 (or 0 if the target is not reachable).7. } else if (node->paths()==0) { ev << "No path to destination..SingleShortestPaths() function. The .unweightedSingleShortestPathsTo( targetnode ).OMNeT++ Manual – The Simulation Library 6. } } The purpose of the distanceToTarget() member function of a node is self-explanatory. cTopology::Node *targetnode = topo. each call to unweightedSingleShortestPathsTo() overwrites the results of the previous call.MultiShortestPathsTo() functions find all paths. } else { while (node != topo. In the unweighted case. Naturally.\n". and path(i) returns the ith edge of them as cTopology::LinkOut. 117 . at increased run-time cost. This performs the Dijkstra algorithm and stores the result in the cTopology object... Disabled nodes or edges are ignored by the shortest paths calculation algorithm. The enabled() member function returns the state of a node or edge in the topology graph.
j++) { cTopology::LinkOut *link = thisnode->out(i). mean. topo. cVarHistogram. automatically have a partitioning created where each bin has the same number of observations (or as close to that as possible). min(). thisnode->disable().nodeFor( this ). standard deviation. cPSquare and cKSplit. sqrSum() with the obvious meanings.unweightedSingleShortestPathsTo( targetnode ). other shortest path algorithms will also be implemented: unweightedMultiShortestPathsTo(cTopology::Node *target). mean(). based on an adaptive histogram-like algorithm. cDoubleHistogram. } In the future. j<thisnode->outLinks().OMNeT++ Manual – The Simulation Library One usage of disable() is when you want to determine in how many hops the target node can be reached from our node through a particular output gate. 6. but accepts weighted observations. They are all derived from the abstract base class cStatistic. • cStdDev keeps number of samples. but you must disable the current node to prevent the shortest paths from going through it: cTopology::Node *thisnode = topo. Basic usage One can insert an observation into a statistic object with the collect() function or the += operator (they are equivalent). weightedSingleShortestPathsTo(cTopology::Node *target). stddev(). • cPSquare is a class that uses the P 2 algorithm described in [JC85]. An example usage for cStdDev: 118 .1 Statistics and distribution estimation cStatistic and descendants There are several statistic and result collection classes: cStdDev. It is the only weighted statistics class. LongHistogram. you calculate the shortest paths to the target from the neighbor node. • cWeightedStdDev is similar to cStdDev. ev << "Through gate " << link->localGate()->fullName() << " : " << 1 + link->remoteNode()->distanceToTarget() << " hops" << endl. • cKSplit uses a novel. one can also think of it as a histogram with equiprobable cells. weightedMultiShortestPathsTo(cTopology::Node *target). for (int j=0. • cVarHistogram implements a histogram where cells do not need to be the same size. You can manually add the cell (bin) boundaries. variance().8 6. or alternatively. cWeightedStdDev can be used for example to calculate time average. max(). cStdDev has the following methods for getting statistics out of the object: samples(). • cLongHistogram and cDoubleHistogram are descendants of cStdDev and also keep an approximation of the distribution of the observations using equidistant (equal-sized) cell histograms. experimental method. To calculate this. minimum and maximum value etc. The algorithm calculates quantiles without storing the observations. sum(). thisnode->enable().8. cWeightedStdDev.
The following member functions exist for setting up the range and to specify how many observations should be used for automatically determining the range. variance = stat.setRangeAuto(100. setNumFirstVals(numFirstvals).variance().5 is the range extension factor. You may specify the range explicitly (based on some a-priori info about the distribution) or you may let the object collect the first few observations and determine the range from them. Figure 6. Methods which let you specify range settings are part of cDensityEstBase.2 Distribution estimation Initialization and usage The distribution estimation classes (cLongHistogram. cDoubleHistogram.5). cPSquare and cKSplit) are derived from cDensityEstBase. histogram. rangeExtFactor).collect( normal(0. rangeExtFactor). Here. double mean = stat.8.OMNeT++ Manual – The Simulation Library cStdDev stat("stat"). 20 is the number of cells (not including the underflow/overflow cells. cVarHistogram. numFirstvals.mean().upper). i<10.stddev(). 1. 119 . setRangeAutoUpper(lower. It means that the actual range of the initial observations will be expanded 1. numFirstvals. i++) stat. 20).samples(). standardDeviation = stat.max(). and 100 is the number of observations to be collected before setting up the cells. setRange(lower. largest = stat. 6.1) ). double smallest = stat. for (int i=0. see later). rangeExtFactor).1.2: Setting up a histogram’s range After the cells have been set up. This method increases the chance that further observations fall in one of the cells and not outside the histogram range. setRangeAutoLower(upper. collection can go on. setRangeAuto(numFirstvals. long numSamples = stat. Distribution estimation classes (except for cPSquare) assume that the observations are within a range. The following example creates a histogram with 20 cells and automatic range estimation: cDoubleHistogram histogram("histogram".min().5 times and this expanded range will be used to lay out the cells.
int count = histogram. Figure 6. 20). cell(int k) returns the number of observations in cell k. plus cPSquare and cKSplit. Afterwards.3: Histogram structure after setting up the cells You create a P 2 object by specifying the number of cells: cPSquare psquare("interarrival-times". Getting histogram data There are three member functions to explicitly return cell boundaries and the number of observations is each cell.OMNeT++ Manual – The Simulation Library The transformed() function returns true when the cells have already been set up.samples(). These functions work for all histogram types.basepoint(i). and cellPDF(int k) returns the PDF value in the cell (i.cells().cellPDF(i). You can force range estimation and setting up the cells by calling the transform() function. Figure 6.basepoint(i+1)-histogram. i++) { double cellWidth = histogram. i<histogram. cells() returns the number of cells. //. The observations that fall outside the histogram range will be counted as underflows and overflows.e. } 120 . double pdf = histogram.. basepoint(int k) returns the kth base point. between basepoint(k) and basepoint(k+1)).. for (int i=0.4: base points and cells An example: long n = histogram. a cPSquare can be used with the same member functions as a histogram. The number of underflows and overflows are returned by the underflowCell() and overflowCell() member functions.cell(i).
saveToFile( f ). // random number from the cPSquare Storing/loading distributions The statistic classes have loadFromFile() member functions that read the histogram data from a text file.setDoubleValue(&histogram). uses bin boundaries previously defined by addBinBound() 121 . and use a histogram object with loadFromFile(). The cells will be set up so that as far as possible. histogram. calls the histogram object’s random() function: double rnd = (double)rndPar. // load stored distribution fclose( f2 ). cStdDev assumes normal distribution. respectively. and whenever it is asked for the value. You can also wrap the distribution object in a cPar: cPar rndPar("rndPar"). // save the distribution fclose( f ). where you specify cell boundaries explicitly before starting collecting • automatic. You can also use saveToFile()that writes out the distribution collected by the histogram object: FILE *f = fopen("histogram. FILE *f2 = fopen("histogram. The cPar object stores the pointer to the histogram (or P 2 object).random()."w"). you can describe it in histogram form stored in a text file. If you need a custom distribution that cannot be written (or it is inefficient) as a C function. Modes are selected with a transform-type parameter: • HIST_TR_NO_TRANSFORM: no transformation. where transform() will set up the cells after collecting a certain number of initial observations.dat".loadFromFile( f2 ). hist2. Random number generation from distributions The random() member function generates random numbers from the distribution stored by the object: double rnd = histogram. Histogram with custom cells The cVarHistogram class can be used to create histograms with arbitrary (non-equidistant) cells."r"). an equal number of observations fall into each cell (equi-probable cells). rndPar.OMNeT++ Manual – The Simulation Library The pdf(x) and cdf(x) member functions return the value of the Probability Density Function and the Cumulated Density Function at a given x. It can operate in two modes: • manual.} cDoubleHistogram hist2("Hist-from-file").dat".
.... Each collected observation increments the corresponding observation count. how to ˜ divide it to obtain m. ˜ Two natural distribution methods are even distribution (when m. The method was proposed by Varga and Fakhamzadeh in 1997.. m..i. and m..i. equal-sized cells with observation counts ni...2 .. We start out with a histogram range [xlo . The ni observation count is remembered and is called the mother observation count to the newly created cells.1 : m.i... and intermediate nodes contain mother observation counts for their children. s.... but for integers Creating an object: cVarHistogram(const char *s=NULL..i estimated amount of observations in the tree nodes... Experience shows that k = 2 worked best....k = n.. Naturally. 6. including the sample size.. ˜ especially in the leaves..2 = · · · = m. In other words.... the total number of observations that fell into each cell of the partition has to be determined. ni.....2 : · · · : s..2 + · · · + m.i ...i.i be the total observation count in a cell n.1 . Further observations may cause cells to be split further (e.. We are interested in the n.ni. The primary advantage of k-split is that without having to store the observations. It was designed for on-line result collection in simulation programs.. but here we deal with the one-dimensional version only. n2 .. if we have n.i plus the observation counts in all its sub-.i...3 The k-split algorithm Purpose The k-split algorithm is an on-line distribution estimation method...i the mother observations propagated to the cell.1 .k ). Even distribution is 122 ..i +m.. thus creating a k-order tree of observation counts where leaves contain live counters that are actually incremented by new observations...k = s. int transformtype=HIST_TR_AUTO_EPC_DBL). Rangemin and rangemax is chosen after collecting the numFirstVals initial observations..1 = m.8. sub-sub-. the cell is split into k smaller..i.. If an observation falls outside the histogram range.1.k etc. it gives a good estimate without requiring a-priori information about the distribution.i estimated observation amount in a cell...i.i. mother observations in each internal node of the tree must be distributed among its child cells and propagated up to the leaves.2 · · · m..i = n.k ) and proportional distribution (when m... When an observation count ni reaches a split threshold.. · · · nk .i. cells). The algorithm The k-split algorithm is an adaptive histogram-type estimate which maintains a good partitioning by doing cell splits...1...i.. m. For density estimation..i. · · · ni.).. int numcells=11.g.. Let n. xhi ) with k equal-sized histogram cells with observation counts n1 .i.k that can be propagated to child cells. the range is extended in a natural manner by inserting new level(s) at the top of the tree.i..i be the (mother) observation count for a cell..OMNeT++ Manual – The Simulation Library • HIST_TR_AUTO_EPC_DBL: automatically creates equiprobable cells • HIST_TR_AUTO_EPC_INT: like the above.. . etc.i. The fundamental parameter to the algorithm is the split factor k.2 : · · · : m.. ni..1 + m. For this purpose.i..1 ... One cannot add cell boundaries when the histogram has already been transformed..1 : s.... The k-split algorithm can be extended to multi-dimensional distributions. Manually adding a cell boundary: void addBinBound(double x).k initialized to zero.
. Note that while n. The histogram estimate ˜ calculated from k-split is not exact. 123 .i..e. OMNeT++ contains an experimental implementation of the k-split algorithm. Strictly speaking. This introduces a certain cell division error....... we distribute mother observations evenly..i..i where λ ∈ [0... 1] n n Figure 6.j = (1 − λ)˜ ···... the algorithm is not very sensitive to the choice of the initial range.. when the algorithm is only used to create an optimal partition from a larger number of Npre observations. a linear combination of them seems appropriate. i.5: Illustration of the k-split algorithm. the k-split algorithm is semi-online.i /k + λ˜ ···. Because of the range extension and cell split capabilities. the observation counts are cleared and the Npre observations are fed into k-split once again. m. k = 2.. the cKSplit class. The numbers in boxes represent the observation count values optimal when the s.j values are large compared to m.OMNeT++ Manual – The Simulation Library Figure 6.6: Density estimation from the k-split cell tree.i and thus n. It has been shown that the partition created by k-split can be better than both the equi-distant and the equal-frequency partition.j /s···.. This way all mother (nonleaf) observation counts will be zero and the cell division error is eliminated. Thus we can regard k-split as an on-line method. When the partition has been created.i s..j values are very small. K-split can also be used in semi-online mode.i. where λ = 0 means even and λ = 1 means proportional distribution: m···. We assume λ = 0. because the frequency counts calculated in the above manner contain a degree of estimation themselves..i.i are integers..i are typically real numbers. and proportional distribution is good when the s. It has been shown that the cell division error can be reduced to a more-than-acceptable small value.j . In practice. the λ parameter should be selected so that it minimizes that error..i. so very few observations are sufficient for range estimation (say Npre = 10). Research on k-split is still under way. because its needs some observations to set up the initial histogram range.
Detection of the end of the transient period and a certain result accuracy is supported by OMNeT++. simulation must proceed until enough statistical data has been collected to compute result with the required accuracy.OMNeT++ Manual – The Simulation Library The cKSplit class The cKSplit class is an implementation of the k-split method. the performance after the system has reached a stable state) is of interest. void printGrids(). The initial part of the simulation is called the transient period. The transient detection and result accuracy objects will do the specific algorithms on the data fed into the result object and tell if the transient period is over or the result accuracy has been reached. The user can attach transient detection and result accuracy objects to a result object (cStatistic’s descendants). int cell). The base classes for classes implementing specific transient detection and result accuracy detection algorithms are: • cTransientDetection: base class for transient detection • cAccuracyDetection: base class for result accuracy detection Basic usage Attaching detection objects to a cStatistic and getting pointers to the attached objects: addTransientDetection(cTransientDetection *object). int treeDepth(sGrid& grid). double *_critdata).rootgrid’s reldepth) sum of cells & all subgrids (includes ‘mother’) observations ‘inherited’ from mother cell cell values 6. only the steady state performance (i. int mother. int reldepth. long total. sGrid& grid(int k). // // // // // index of parent grid depth = (reldepth . cTransientDetection *transientDetectionObject(). sGrid& rootGrid(). addAccuracyDetection(cAccuracyDetection *object). After the model has entered steady state. cAccuracyDetection *accuracyDetectionObject(). }. double *\_divdata). 124 . Member functions: void setCritFunc(KSplitCritFunc _critfunc.4 Transient detection and result accuracy In many simulations.8. struct sGrid { int parent. void setDivFunc(KSplitDivFunc \_divfunc.e. double realCellValue(sGrid& grid. int treeDepth(). void rangeExtension( bool enabled ). int cells[K].
void setParameters(int reps=3.9. and checks the difference of the two averages to see if the transient period is over. }.OMNeT++ Manual – The Simulation Library Detecting the end of the period: • polling the detect() function of the object • installing a post-detect function Transient detection Currently one transient detection algorithm is implemented. double wind=1. You’d record values from handleMessage() or from a function called from handleMessage(). class Sink : public cSimpleModule { protected: cOutVector endToEndDelayVec. The vector name can be passed in the constructor. 6. Accuracy detection Currently one accuracy detection algorithm is implemented. The cTDExpandingWindows class uses the sliding window approach with two windows. The record() method is used to output a value (or a value pair) with a timestamp.3). int reps=3). but in the usual arrangement you’d make the cOutVector a member of the module class and set the name in initialize(). double acc=0. The following example is a Sink module which records the lifetime of every message that arrives to it.e. 125 .0) virtual void initialize(). public: Module_Class_Members(Sink. i. The algorithm implemented in the cADByStddev class is: divide the standard deviation by the square of the number of values and check if this is small enough. void setParameters(double acc=0.cSimpleModule. there’s one class derived from cAccuracyDetection. cOutVector responseTimeVec("response time"). there’s one class derived from cTransientDetection.3. i.9 6.e.1 Recording simulation results Output vectors: cOutVector Objects of type cOutVector are responsible for writing time series data (referred to as output vectors) to a file. int minw=4. virtual void handleMessage(cMessage *msg).1. The object name will serve as the name of the output vector.
multiple runs and output scalars are the way to produce Throughput vs.cSimpleModule.0) 126 . If the output vector object is disabled or the simulation time is outside the specified interval. In the following example we create a Sink module which calculates the mean. The format and processing of output vector files is described in section 10. avgThroughput).record(eed). You can configure output vectors from omnetpp. For example. or limit it to a certain simulation time interval for recording (section 8. } You can record whole statistics objects by calling their recordScalar() methods. if you have a Tkenv inspector window open for the output vector object. } All cOutVector objects write to a single output vector file named omnetpp. regardless of the state of the output vector object.msg->creationTime(). record() doesn’t write anything to the output file. You can use outputs scalars • to record summary data at the end of the simulation run • to do several runs with different parameter settings/random seed and determine the dependence of some measures on the parameter settings.5). Output scalars are recorded with the recordScalar() method of cSimpleModule. 6. An example: void Transmitter::finish() { double avgThroughput = totalBits / simTime(). Offered Load plots.2 Output scalars While output vectors are to record time series data and thus they typically record a large volume of data during a simulation run.OMNeT++ Manual – The Simulation Library Define_Module(Sink). output scalars are supposed to record a single value per simulation run. declared as part of cStatistic. standard deviation. void Sink::initialize() { endToEndDelayVec. and you’ll usually want to insert this code into the finish() function. minimum and maximum values of a variable. delete msg.setName("End-to-End Delay").vec by default. recordScalar("Average throughput".1. and records them at the end of the simulation. class Sink : public cSimpleModule { protected: cStdDev eedStats. } void Sink::handleMessage(cMessage *msg) { simtime_t eed = simTime() .9.ini: you can disable writing to the file. endToEndDelayVec. the values will be displayed there. However. public: Module_Class_Members(Sink.
The object remembers the address and type of your variable. } The above calls write into the output scalar file which is named omnetpp. virtual void handleMessage(cMessage *msg).collect(eed). } void Sink::finish() { recordScalar("Simulation duration".i). eedStats. Define_Module(Sink).setName("End-to-End Delay"). eedStats. char. you’ll see your WATCHed variables and their values there. and output from different simulation runs are separated by special lines. etc.1 WATCHes and snapshots WATCHes You may want some of your int. virtual void finish(). char c. The format and processing of output vector files is described in section 10. The WATCH() macro expands to a dynamically created cWatch object. When you open an inspector for the simple module in Tkenv and click the Objects/Watches tab in it. simTime()). WATCH(i). 6. You can also set watches for variables that are members of the module class or for structure fields: 127 .OMNeT++ Manual – The Simulation Library virtual void initialize().recordScalar(). delete msg. The macro expands to something like: new cWatch("i". Data are always appended at the end of the file.10. long.sca by default. In this case. variables to be inspectable in Tkenv and to be output into the snapshot file. The output scalar file is preserved across simulation runs (unlike the output vector file which gets deleted at the beginning of every simulation run). You can also make a WATCH for pointers of type char* or cObject*. }.10 6. but this may cause a segmentation fault if the pointer does not point to a valid location when Tkenv or snapshot() wants to use it. Tkenv also lets you change the value of a WATCHed variable. void Sink::initialize() { eedStats. WATCH(c).2. double. } void Sink::handleMessage(cMessage *msg) { simtime_t eed = simTime() .msg->creationTime(). you can create cWatch objects for them with the WATCH() macro: int i.
) The snapshot file output is detailed enough to be used for debugging the simulation: by regularly calling snapshot().msgQueue). like this: snapshot().2 Snapshots The snapshot() function outputs textual information about all or selected objects of the simulation (including the objects created in module functions by the user) into the snapshot file. Actual file name can be set in the config file. The function can be called from module functions. If you run the simulation with Tkenv. An example of a snapshot file: [. you can also create a snapshot from the menu. WATCH() creates a dynamic cWatch object.sna. and we do not want to create a new object each time handleMessage() is called. the best place for WATCHes is the top of the activity() function. If you use handleMessage(). // dump this simple module and all its objects snapshot(&simulation.. obj is the object whose inside is of interest. (The snapshot file name has an extension of . // dump future events This will append snapshot information to the end of the snapshot file. bool snapshot(cObject *obj = &simulation. The arguments: label is a string that will appear in the output file.sna.10.. objects changed over the simulation. one can trace how the values of variables. as each call would create a new cWatch object! If you use activity(). the whole simulation (all modules etc) will be written out. By default. default is omnetpp. place the WATCH() statement into initialize(). Placement of WATCHes Be careful not to execute a WATCH() statement more than once.] (cSimulation) ‘simulation’ begin Modules in the network: ‘token’ #1 (TokenRing) ‘comp[0]’ #2 (Computer) ‘mac’ #3 (TokenRingMAC) ‘gen’ #4 (Generator) ‘sink’ #5 (Sink) ‘comp[1]’ #6 (Computer) ‘mac’ #7 (TokenRingMAC) ‘gen’ #8 (Generator) ‘sink’ #9 (Sink) ‘comp[2]’ #10 (Computer) ‘mac’ #11 (TokenRingMAC) ‘gen’ #12 (Generator) ‘sink’ #13 (Sink) end (TokenRing) ‘token’ begin 128 . const char *label = NULL). 6.timeout ).OMNeT++ Manual – The Simulation Library WATCH( lapbconfig. // dump the whole network snapshot(this).
mac.0364005251 ( 36ms) Src=#4 0-->1 (cMessage) Tarr=0.#10) (cArray) ‘token.0163553310 ( 16ms) Src=#4 0-->1 (cMessage) Tarr=0. 129 .005.003) (F) 0.0158105774 ( 15ms) length: 33536 kind: 0 priority: 0 error: FALSE time stamp: 0.] begin 3 (L) 10000 (L) truncnormal(0.parameters’ num_stations (cModulePar) num_messages (cModulePar) ia_time (cModulePar) THT (cModulePar) data_rate (cModulePar) cable_delay (cModulePar) end [.0158105774 ( 15ms) Src=#4 0-->2 (cMessage) Tarr=0.0514466766 ( 51ms) Src=#4 end Dest=#3 Dest=#3 Dest=#3 Dest=#3 Dest=#3 Dest=#3 Dest=#3 Dest=#3 Dest=#3 Dest=#3 Dest=#3 (cMessage) ‘token.0370745702 ( 37ms) Src=#4 0-->2 (cMessage) Tarr=0.OMNeT++ Manual – The Simulation Library #1 params #1 gates comp[0] comp[1] comp[2] end (cArray) (n=6) (cArray) (empty) (cCompoundModule.local-objects.send-queue’ begin 0-->1 (cMessage) Tarr=0..comp[0].0..#6) (cCompoundModule.mac.0158105774 ( 15ms) arrived: 0.0000000 ( 0.0387984129 ( 38ms) Src=#4 0-->1 (cMessage) Tarr=0.send-queue.#2) (cCompoundModule..0158106 (D) end [.comp[0].0457462493 ( 45ms) Src=#4 0-->2 (cMessage) Tarr=0.] It is possible that the format of the snapshot file will change to XML in future OMNeT++ releases..0242203591 ( 24ms) Src=#4 0-->2 (cMessage) Tarr=0.0487308918 ( 48ms) Src=#4 0-->2 (cMessage) Tarr=0.01 (D) 4000000 (L) 1e-06 (D) (cQueue) ‘token.0300994268 ( 30ms) Src=#4 0-->1 (cMessage) Tarr=0.0205628236 ( 20ms) Src=#4 0-->2 (cMessage) Tarr=0.0-->1’ begin #4 --> #3 sent: 0.local-objects.00s) parameter list: dest (cPar) 1 (L) source (cPar) 0 (L) gentime (cPar) 0.
. It checks the intactness of a predefined byte pattern (0xdeadbeef) at the stack boundary. The mechanism usually works fine. but occasionally it can be fooled by large – and not fully used – local variables (e. } In user interfaces that do not support debugging. stack violation occurs. //. 6. breakpoints stop execution and the state of the simulation can be examined. which you have to consider individually for each class. } The value includes the extra stack added by the user interface library (see extraStackforEnvir in envir/omnetapp.11. and reports “stack violation” if it was overwritten. cObject already carries (or provides a framework for) significant functionality that is either relevant to your particular purpose or not.10.. breakpoint("before-processing"). OMNeT++ contains a mechanism that detects stack overflows. it unnecessarily consumes memory. you can use the stackUsage() call which tells you how much stack the module actually uses.3 Breakpoints With activity() only! In those user interfaces which support debugging. If the stack is too large. From the Feb99 release. it may be preserved intact and OMNeT++ does not detect the stack violation. To be able to make a good guess about stack size. which is currently 8K for Cmdenv and at least 16K for Tkenv. SUN Solaris needs more space.OMNeT++ Manual – The Simulation Library 6. you have to ask yourself whether you want the new class to be based on cObject or not. It is most conveniently called from finish(): void FooModule::finish() { ev << stackUsage() << "bytes of stack used\n".g.h). 6. You can set a breakpoint inserting a breakpoint() call into the source: for(.) { cMessage *msg = receive().10. char buffer[256]): if the byte pattern happens to fall in the middle of such a local variable.4 Getting coroutine stack usage It is important to choose the correct stack size for modules.11 6. send( reply_msg. if it is too small. e. breakpoint() calls are simply ignored. Subclassing cObject generally means you have more code to write (as 4 The actual value is dependent on the operating system. 130 .g.1 Deriving new classes cObject or not? If you plan to implement a completely new class (as opposed to subclassing something already present in OMNeT++). 4 stackUsage()also works by checking the existence of predefined byte patterns in the stack area. breakpoint("before-send"). Both solutions have advantages and disadvantages. Note that we are not saying you should always subclass from cObject. so it is also subject to the above effect with local variables. "out" ).
except the name string. The implementation should call the function passed for each object it contains via pointer or as data member. see the API Reference on cObject on how to implement forEachChild(). etc. If your class has at least one virtual member function. you must redefine some member functions so that objects of the new type can fully co-operate with other parts of the simulation system. with NULL as default name string. The following methods must be implemented: • Constructor. so it has its overhead) and ownership management (see section 6. RoutingTableEntry. the following function should be implemented: • Iteration function. are better not sublassed from cObject. TCPConnectionDescriptor. • Destructor. only virtual functions. and another one with no arguments (must be present). It is also used by snapshot() and some other library functions. then call the assignment operator (see below). The two are usually implemented as a single method. void forEachChild(cVisitor * v). A more or less complete list of these functions is presented here. consider subclassing from cPolymorphic. which does not impose any extra cost because it doesn’t have data members at all. 5 The most significant features cObject has is the name string (which has to be stored somewhere. 6.12) which also has the advantages but also some costs.11. then you must subclass from cObject. If your class contains other objects subclassed from cObject. For example. It should copy the contents of the other object into this one. • Duplication function. in the these sections “OMNeT++ object” should be understood as “object of a class subclassed from cObject” 131 . It is usually a one-line function. MACAddress. The following methods are recommended to implement: 5 For simplicity. The copy constructor is used whenever an object is duplicated. etc. The usual implementation of the copy constructor is to initialize the base class with the name (name()) of the other object it receives. In turn. for example it will be more visible in Tkenv and can be automatically garbage-collected (this will be discussed later). • Assigment operator. either via pointers or as data member. If you need to store your objects in OMNeT++ objects like cQueue. or you’ll want to store OMNeT++ classes in your object. that is. it will integrate into OMNeT++ better. It should create and return an exact duplicate of the object. cObject *dup() const. you do not need to redefine forEachChild() unless your class is a container class. implemented with the help of the new operator and the copy constructor. X& operator=(const X&) for a class X. You do not need to worry about the length of the list: most functions are not absolutely necessary to implement. See later what to do if the object contains pointers to other objects.2 cObject virtual methods Most classes in the simulation class library are descendants of cObject. At least two constructors should be provided: one that takes the object name string as const char * (recommended by convention). If you want to derive a new class from cObject or a cObject descendant.OMNeT++ Manual – The Simulation Library you have to redefine certain virtual functions and adhere to conventions) and your class will be a bit more heavy-weight. forEachChild() makes it possible for Tkenv to display the object tree to you. to perform searches on it. As a general rule. small struct-like classes like IPAddress. which must have the following signature for a class X: X(const X&). • Copy constructor.
which can create any object given the class name as a string. an omnetpp. we needed to have the following line somewhere in the code: Register_Class(cMersenneTwister). createOne() is used by the Envir library to implement omnetpp.. 6. dynamically allocated noncObject data (an array of doubles).OMNeT++ Manual – The Simulation Library • Object info. 132 . double *array.4 Details We’ll go through the details using an example. createOne() is also needed by the parallel distributed simulation feature (Chapter 12) to create blank objects to unmarshal into on the receiving side. the class will contain an int data member.ini entry such as rng-class="cMersenneTwister" would result in something like the following code to be executed for creating the RNG objects: cRNG *rng = check_and_cast<cRNG*>(createOne("cMersenneTwister")). and a dynamically allocated OMNeT++ object (a cMessage). redefine all above mentioned cObject member functions. info() is displayed at several places in Tkenv.. • Detailed object info. std::string info(). rules and tips associated with them. netPack() and netUnpack() methods. if you want objects of this type to be transmitted across partitions.. and explain the conventions.11. To demonstrate as much as possible. (see Chapter 13) For example. It contains the declarations of all methods discussed in the previous section.". // // file: NewClass. 6.h // #include <omnetpp. We create a new class NewClass. cQueue queue.3 Class registration You should also use the Register_Class() macro to register the new class. These methods are needed for parallel simulation. detailedInfo() is also displayed by Tkenv in the object’s inspector. The info() function should return a one-line string describing the object’s contents or state. But for that to work. • Serialization. it can return a multi-line description.11.h> class NewClass : public cObject { protected: int data. an OMNeT++ object as data member (a cQueue).ini options such as rng-class="." or schedulerclass=". The class declaration is the following. It is used by the createOne() factory function. std::string detailedInfo().. This method may potentially be implemented in addition to info().
name()) into the function body.h> <string.name()) { array = new double[10]. We’ll discuss the implementation method by method. msg = NULL. . NewClass::NewClass(const NewClass& other) : cObject(other. (Alternatively. } The constructor (above) calls the base class constructor with the name of the object.h> <iostream. array = new double[10]. You need to call take() for cObject-based data members.h> "newclass. operator=(other). virtual ~NewClass(). NewClass& operator=(const NewClass& other). int d=0). NewClass(const NewClass& other). }.h" Register_Class( NewClass ). NewClass::NewClass(const char *name.cc file: // // file: // #include #include #include #include NewClass.OMNeT++ Manual – The Simulation Library cMessage *msg. virtual std::string info(). take(&queue).cc <stdio. it is passed here to the base class constructor. we could have written setName(other. Because by convention the assignment operator does not copy the name member. NewClass::~NewClass() 133 . virtual cObject *dup() const. int d) : cObject(name) { data = d. msg = NULL. virtual void forEachChild(cVisitor *v).. Here’s the top of the . take(&queue). to avoid crashes. You need to call take() for cObject-based data members. } The copy constructor relies on the assignment operator. then initializes its own data members..) Note that pointer members have to be initialized (to NULL or to an allocated object/memory) before calling the assignment operator. public: NewClass(const char *name=NULL.
you’ll most probably want to make a deep copy of the data where they point.name()). you should implement the assigment operator to call copyNotSupported() – it’ll throw an exception that stops the simulation with an error message if this function is called.msg && other. If so (that is. If the class contains pointers. because it might be disastrous.msg. else msg = other.msg->dup()). cObject *NewClass::dup() const { return new NewClass(*this). you need to take ownership into account. If you do not want to implement object copying and duplication.queue. if (msg->owner()==this) delete msg. consequently we only copy 134 . data = other. The base class part is copied via invoking the assignment operator of the base class. queue = other. we should make sure we’re not trying to copy the object to itself. &other==this). } Complexity associated with copying and duplicating the object is concentrated in the assignment operator.data. If the contained object is not owned then we assume it is a pointer to an “external” object. New data members are copied in the normal C++ way.setName(other.12. we return immediately without doing anything. and not just copy the pointer values. i<10. if (msg && msg->owner()==this) delete msg. for (int i=0. so it is usually the one that requires the most work from you of all methods required by cObject.msg->owner()==const_cast<cMessage*>(&other)) take(msg = (cMessage *)other. except the name string. return *this. cObject::operator=(other).queue. like the one above. if (other. i++) array[i] = other. The assignment operator copies contents of the other object to this one. It should always return *this. NewClass& NewClass::operator=(const NewClass& other) { if (&other==this) return *this. } The dup() functions is usually just one line. } The destructor should delete all data structures the object allocated.OMNeT++ Manual – The Simulation Library { delete [] array. If the class contains pointers to OMNeT++ objects.array[i]. First. queue. cObject-based objects should only be deleted if they are owned by the object – details will be covered in section 6.
If you plan to program small simple modules only. one-line string about the object. 6.OMNeT++ Manual – The Simulation Library the pointer. sanity checks. It usually works transparently.str(). out << "data=" << data << ". since the string will be shown in tooltips and listboxes. } The forEachChild() function should call v->visit(obj) for each obj member of the class. } The info() method should produce a concise. you can probably safely skip this section. The other direction. but it is useful to know what it does exactly so that it doesn’t interfere with the cleanup code and destructors you write. void NewClass::forEachChild(cVisitor *v) { v->visit(queue). enumerating the objects owned can be done via forEachChild() that loops through all contained objects and checking the owner of each object. while it may own attached cPar objects or another message (added to it via encapsulate()). But if your simple module code is getting more complex and you’re getting memory leaks or seemingly unexplicable segmentation faults because of double deletion of objects.12. it is probably time to read the following discussion. Details of ownership management will be covered in section 6. The sources of the Sim library (include/. return out. See the virtual functions of cPolymorphic and cObject in the class library reference for more information.12 Object ownership management OMNeT++ has a built-in ownership management mechanism which is used for garbage collection. From an object you can navigate to its owner by calling the owner() method.1 Ownership tree Any cObject-based object can be both owner of other objects and can at the same time be owned by another object. a message object (cMessage) may reside in a queue (cQueue) and be owned by that queue. defined in cObject.12. if (msg) v->visit(msg). You should try not to exceed 40-80 characters.2 Purpose The purpose of maintaining the ownership tree is threefold: 135 . 6. 6. and as part of the infrastructure supporting Tkenv inspectors. For example.12. If it is owned. array[0]=" << array[0]. See the API Reference for more information of forEachChild(). src/sim/) can serve as further examples. we duplicate it and become the owner of the new object. std::string NewClass::info() { std::stringstream out.
those associated with wrong ownership handling. 136 . this means if you delete a message. from activity(). this can be changed). you have to check owner() of each object before you delete it.OMNeT++ Manual – The Simulation Library • to provide a certain degree of garbage collection (that is. 6 Note that it is not necessary for a container object like a queue to actually own all inserted objects.g. If you just create a message object inside a simple module (e. as explained later. The following line: cMessage *msg = new cMessage("HELLO"). some errors of the same kind still cannot be detected automatically. encapsulated in another message.e. Some examples of programming errors that can be caught by the ownership facility: • attempts to send a message while it is still in a queue.e.12. like calling member functions of a message object which has been sent to (and so currently kept by) another module. automatic deletion of objects that are no longer needed) • to prevent certain types of programming errors. etc. messages) inserted into a cQueue or a cArray will be owned by that object (by default – this can be changed.3 Objects are deleted by their owners The concept of ownership is that the owner has the exclusive right and duty to delete the objects it owns. handleMessage() or any function called from them). you should implement it so that it deletes the owned objects in the destructor – that is. 6. This behavior can be controlled via the takeownership flag.4 Ownership is managed transparently Automatic transfer of ownership Ownership is usually established and managed automatically. 6. its encapsulated message (see encapsulate() method) and attached cPar objects are also deleted. and cPar’s added to a message will also become owned by the message object (again. Of course. 6 If you create a new class. and if not detected automatically. But objects are not being stored in another object have an owner as well. • attempts to send/schedule a message while it is still owned by the simulation kernel (i. If you delete a queue. to all connected modules) The above errors are easy to make in the code. scheduled as a future event) • attempts to send the very same message object to multiple destinations at the same time (ie. etc. It is not hard to guess that objects (i. which enables Tkenv to display which objects are present (and where) in the simulation. they could cause random crashes which are usually very difficult to track down. namely. Messages encapsulated into other messages (by cMessages’s encapsulate() method). as described later). • to provide some “reflection” (in the Java sense).12. it will be owned by simple module. to find “lost” (leaked) objects. As an example. all messages it contains and also owns will also be deleted. and they are deallocated automatically when the message object is deleted.
At that time. When you restart the simulation in Tkenv or begin a new run in Cmdenv. 6.e. it is redundant but does no harm: its destructor will also remove it from the owner’s list (which might be the module’s local object list). Here’s how it is done in the simulation kernel.pop(). Garbage collection and your module destructors Note that this garbage collection can nicely co-exist with module destructors you write. one expects all dynamically allocated objects to be properly destructed and memory released. and (b) deleting all messages in the Future Events Set. you don’t have to worry about writing module destructors: everything is taken care of automatically.5 Garbage collection How it is done The local objects list is also the reason why you rarely need to put delete statements in your simple module destructors. This means that all objects on the module’s local objects list (i. or inside a queue. OMNeT++ has to clean up the previously running simulation. and in many more cases. the container object “drops” the ownership of the object. you need to carefully examine the error message: which object has the ownership of the message. because then the message is probably owned by another module (i.12.e. Sanity checks The send() and scheduleAt() functions make use of the ownership mechanism to do some sanity checking: the message being sent/scheduled must be owned by the module’s local objects list. When you get the error message ("not owner of object"). the local objects list is also deleted in addition to the module’s gates and parameters. or currently scheduled. 137 . The result is that as long as you only have dynamically allocated memory as (or within) cObject-based objects. class MyModule : public cSimpleModule 7 More precisely: to the currently executing module. Thus. an innocent-looking cMessage *msg = queue. to the currently active simple module’s list). If it is not. objects you allocated and need to be garbage collected) will also be deleted. and then probably you’ll need to fix the logic somewhere in your program. This involves (a) deleting all modules in the network. so double deletion will not occur. when cPar’s are removed from a cArray. and this is exactly what we need as garbage collection. which is not trivial since the simulation kernel does not know what objects have been created by simple modules. When a simple module gets deleted. a message or some other object – in either case. the local objects list of the simple module (again. because that is the best guess a cMessage constructor can do.OMNeT++ Manual – The Simulation Library actually creates the message object and automatically adds it to the module’s object list. already sent). Modules (both simple and compound) can also be dynamically deleted during simulation (deleting a compound module just consists of recursively deleting all submodules). If you delete an object explicitly. then an error occured. when a message is removed from a queue). In that case. why’s that. statement actually involves a transfer of ownership of the message object from the queue to the simple module. The same thing happens when a message is decapsulated from another message. 7 The local objects list also plays a role when an object is removed from a container object (e. and the object will “join” its default owner. you do not have any authority to send it.g.
. STL objects or your non-cObject rooted classes) are invisible to the ownership mechanism discussed here. C++ arrays of integers.. remember not to put any destructor-like code inside the module’s finish() function. doubles. Can it crash? A potential crash scenario is when the object ownership mechanism deletes objects before your code does. the finish() functions will not be called and thus. // deleting the message objects can be left to // the garbage collection mechanism } In any case. cMessage *timeoutmsg. .g. MyModule::~MyModule() { delete [] distances. }..OMNeT++ Manual – The Simulation Library { . class MyModule : public cSimpleModule { . // so we need to clean up it manually } It is similar when you have arrays of cMessage pointers (or in general any other non-OMNeT++ data structure which holds pointers to cObject-rooted objects). } // redundant but does no harm Other allocated memory (e.. }. // array allocated via new double [] ... cMessage **events. memory will be leaked.. structs or pointers) or objects which have nothing to do with cObject (e. not aware of the ownership mechanism and not knowing that the objects have already been 138 . // array allocated via new cMessage *[] . }.. and must be deleted in the destructor in the conventional way. // we need to delete only the pointer array itself.. Then it is enough if you delete the array or the data structure. and your code. class MyModule : public cSimpleModule { .. MyModule::~MyModule() { delete timeoutmsg.g. MyModule::~MyModule() { delete [] events. The main reason is that whenever your simulation stops with an error (or you just stop it within Tkenv). double *distances.. // OMNeT++ knows nothing about this vector. the objects will be cleaned up via the garbage collection mechanism..
however. the above order of destruction is not guaranteed and crash is possible. because the garbage collection mechanism is embedded deeply in the base class of your simple module. However. Here’s what the insert operation of cQueue (or cArray) does: • insert the object into the internal array/list data structure • if the takeOwnership flag is true. but they need to be properly destructed (their destructors called) so that the memory they allocated can be released. } 139 . if some of your objects have been sent to other modules (e. thus it is guaranteed by C++ language rules to take place after all your destructor-related code (your simple module class’s destructor and the destructors of data members you added to the simple module class) have executed.) The default behaviour of cQueue and cArray is to take ownership of the objects inserted. Garbage collection of activity() simple modules Another interesting aspect is what happens when an activity() simple module is deleted. the implementation relies a side effect of C++ exceptions. Insertion cArray and cQueue have internal data structures (array and linked list) to store the objects which are inserted into them. otherwise just leave it with its original owner The corresponding source code: void cQueue::insert(cObject *obj) { // insert into queue data structure . They themselves need not (and must not) be deleted using the delete operator. This situation will be discussed later in more detail. tries to delete them again.OMNeT++ Manual – The Simulation Library deleted. (Whether they own an object or not can be determined from that object’s owner() pointer. they do not necessarily own all of these objects. inside a message) while their ownership stayed with the original module (which is a situation one should not allow to happen). // take ownership if needed if (takeOwnership()) take(obj). take ownership of the object. 6. one must work hard to add a nonstandard way of storing objects in a message. However.. Note that this cannot happen as long as objects stay within the module. Objects that were local variables of activity() are just left on the coroutine stack.12.6 What cQueue and cArray do How can the ownership mechanism operate transparently? It is useful to look inside cQueue and cArray.. To produce the above crash. This behavior can be changed via the takeOwnership flag. because they might give you a hint what behavior you need to implement when you want to use non-OMNeT++ container classes to store messages or other cObject-based objects. after we’ve discussed how containers like cQueue and cArray work. that is stack unwinding. For doing that.g.
you can delete it. however the question is whether the contained objects should also be duplicated or only their pointers taken over to the duplicate cArray or cQueue. defaultOwner() is a virtual method returning cObject* defined in cObject. the same question arises in three places: the assignment operator operator=(). 140 . This is acomplished by the drop() function. the convention is that copying is implemented in the assignment operator. // release ownership if needed if (obj->owner()==this) drop(obj). the copy constructor and the dup() method. The convention followed by cArray/cQueue is that only owned objects are copied. otherwise just leave it with its current owner After the object was removed from a cQueue/cArray. Object copying The ownership mechanism also has to be taken into consideration when a cArray or cQueue object is duplicated. The duplicate is supposed to have the same content as the original. return obj. the ownership is expected to be transferred to the simple module’s local objects list. which transfers the ownership to the object’s default owner. where obj->owner()==this. or if it is not needed any more. } 8 Destructor The destructor should delete all data structures the object allocated. In OMNeT++. the remove() method of cQueue is implemented like this: cObject *cQueue::remove(cObject *obj) { // remove object from queue data structure ... When you remove an object from a queue or array.OMNeT++ Manual – The Simulation Library Removal Here’s what the remove family of operations in cQueue (or cArray) does: • remove the object from the internal array/list data structure • if the object is actually owned by this cQueue/cArray. only the owned ones are deleted – that is. and the contained but not owned ones will have their pointers taken over and their original owners left unchanged. release ownership of the object. and its implementation returns the currently executing simple module’s local object list. As an example. (The copy constructor just constructs an empty object and invokes assigment. and the other two just rely on it. 8 Actual code in src/sim is structured somewhat differently. while dup() is implemented as new cArray(*this)). you may further use it. The release ownership phrase requires further explanation. but the meaning is the same. From the contained objects. In fact.
• Try to minimize message creations and deletions. you can place #ifdefs around your ev« and calls and turn off the define when compiling the simulation for speed.13 Tips for speeding up the simulation Here are a few tips that can help you make the simulation faster: • Use message subclassing instead of adding cPar’s to messages. You can do this in the ini file. • Turn off the display of screen messages when you run the simulation. 141 .OMNeT++ Manual – The Simulation Library 6. • Store the module parameters in local variables to avoid calling cPar member functions every time. Alternatively. Reuse messages if possible.
OMNeT++ Manual – The Simulation Library 142 .
a.ned suffix. you first need to translate the NED files and the message files into C++. on Windows) To build an executable simulation program.a (or libtkenv. This section discusses how to use the simulation system on the following platforms: • Unix with gcc (also Windows with Cygwin or MinGW) • MSVC 6. etc). and the DLL (which is the Windows equivalent of shared libraries) would be a file named tkenv. using the NED compiler (nedc) and the message compiler (opp_msgc). in files with .lib.1 Overview As it was already mentioned. libcmdenv. you do not have to worry about the above details. You’ll need to link with the following libraries: • The simulation kernel and class library. and all object files need to be linked with the necessary libraries to get an executable.a. etc). called sim_std (file libsim_std.OMNeT++ Manual – Building Simulation Programs Chapter 7 Building Simulation Programs 7.<version>). sim_std. The common part of all user interfaces is the envir library (file libenvir.obj on Windows). the file name for the static library would be something like libtkenv.lib.so (or libtkenv. These are files with the . Luckily. and the specific user interfaces are tkenv and cmdenv (libtkenv.o files on Unix/Linux.cc files (or . Let us suppose you have a library called Tkenv. You have to link with envir. The following figure gives an overview of the process of building and running simulation programs.msg suffix. • Message definitions. an OMNeT++ model physically consists of the following parts: • NED language topology description(s). and the shared library would be called libtkenv. On a Unix/Linux system.<version>).a. in . and . • User interfaces. etc). After this step.cpp.a. and also different for static and shared libraries. The Windows version of the static library would be tkenv. File names for libraries differ for Unix/Linux and for Windows.a.0 on Windows 143 . plus either tkenv or cmdenv.dll.so. because automatic tools like opp_makemake will take care of the hard part for you. the process is the same as building any C/C++ program from source: all C++ sources need to be compiled into object files (. • Simple modules implementations and other C++ code.
) opp_makemake has several options. (It can also handle large models which are spread across several directories. based on the source files in the current directory. If you compile from source.2 Using Unix and gcc This section applies to using OMNeT++ on Linux.2.1: Building and running simulation 7.<platform> files that provide up-to-date. 144 .2 Building simulation models The opp_makemake script can automatically generate the Makefile for your simulation program. 7. and also more or less to Cygwin and MinGW on Windows. Solaris. more detailed and more precise instructions. with the -h option it displays a summary. etc./configure followed by make. so it is better to refer to the readme files. you can expect the usual GNU procedure: . 7. this is covered later in this section.2. FreeBSD and other Unix derivatives.1 Installation The installation process depends on what distribution you take (source. Here in the manual we can give you a rough overview only. precompiled RPM.) and it may change from release to release.OMNeT++ Manual – Building Simulation Programs Figure 7. The doc/ directory of your OMNeT++ installation contains Readme.
*.h) in a directory. your simulation program should build. opp_makemake will refuse to overwrite it. you can generate Makefile.g. Here is a list of important ones: Target Action The default target is to build the simulation executable Adds (or refreshes) dependencies in the Makefile Deletes all files that were produced by the make process Regenerates the Makefile using opp_makemake (this is useful if e. it will automatically insert makefrag into the resulting makefile. *. Thus if you simply type make.ned. The name of the executable will be the same as the name of the directory containing the files.) in the configure script and correct them if necessary.in instead of Makefile with opp_makemake’s -m option. the Makefile contains other targets. In addition to the simulation executable. The warnings during the dependency generation process can be safely ignored. With the -i option.cc.msg. write your make rules into a file called makefrag.OMNeT++ Manual – Building Simulation Programs % opp_makemake -h Once you have the source files (*. but it regenerates the Makefile. if opp_makemake has changed) Similar to make makefiles. it is advisable to add them by typing make depend. You can force overwriting the old Makefile with the -f option: % opp_makemake -f If you have problems. You can then use autoconf-like configure scripts to generate the Makefile. 145 . check the path definitions (locations of include files and libraries etc.in instead depend clean makefiles makefile-ins If you already had a Makefile in that directory. If you want better portability for your models. too. Then re-run configure for the changes to take effect. *. after upgrading OMNeT++. you can also name other files to be included into Makefile. When you run opp_makemake. Tkenv is the default): % opp_makemake -u Tkenv Or: % opp_makemake -u Cmdenv The name of the output file is set with the -o option (the default is the name of the directory): % opp_makemake -o fddi-net If some of your source files are generated from other files (for example. You can specify the user interface (Cmdenv/Tkenv) with the -u option (with no -u. cd there then type: % opp_makemake This will create a file named Makefile. The freshly generated Makefile doesn’t contain dependencies. you use generated NED files).
In each subdirectory (say app/ and routing/).. If you want static linking. more detailed and more precise instructions can be found in the doc/ directory of your OMNeT++ installation. Another reason might be that you want to run the executable on another machine without having to worry about setting the LD_LIBRARY_PATH variable (which should contain the name of the directory where the OMNeT++ shared libraries are). several opp_makemake options and the [General]/load-libs= ini file option allow you to do so.4 Static vs shared OMNeT++ system libraries Default linking uses the shared libraries.OMNeT++ Manual – Building Simulation Programs 7. If you’re willing to play with shared and run-time loaded libraries. then it will link an executable with the object files in the two directories. make will descend into app/ and routing/./routing in the app/ directory. in the file Readme. only compiling has to be done. 146 . find the build_shared_libs=yes line in the configure. you could run opp_makemake -n -I. The -I option is for both C++ and NED files.3 Using Windows and Microsoft Visual C++ This is only a rough overview.2. run make in both. In our example./configure make clean make 7.MSVC. shared or run-time loaded (shared) libraries. run opp_makemake -n The -n option means no linking is necessary. and vice versa.2. Here we discuss static linking. your source files may be spread across several directories. run opp_makemake app/ routing/ This results in recursive makefiles: when you build the simulation. Up-to-date.3 Multi-directory models In the case of a large project. You have to decide whether you want to use static linking. 7. In your toplevel source directory. One reason you would want static linking is that debugging the OMNeT++ class library is more trouble with shared libraries. You may need to use the -I option if you include files from other directories.user script and change it to build_shared_libs=no Then you have to re-run the configure script and rebuild everything: .
OMNeT++ Manual – Building Simulation Programs 7. Tcl/Tk is missing the TCL_LIBRARY environment variable which is normally set by the installer. which can be found in the MSVC bin directory (usually C:\Program Files\Microsoft Visual Studio\VC98\Bin). with Custom Build Step commands to invoke the NED compiler (nedtool) on them.cc files generated by nedtool to the project. MPI). • can’t find a usable init.vc command) after you get the different component directories right in configuser. open a command window (Start menu -> Run. To change to Tkenv. 7. –> type cmd). and you can get a working system up and running very fast. it collects all the names of all source files in the directory. You also need to add the _n.3. then re-link the executable. Compilation should be painless (it takes a single nmake -f Makefile.vc The most common problem is that nmake (which is is part of MSVC) cannot be found because it is not in the path. or to recompile with support for additional packages (e. select “Debug-Tkenv” or “Release-Tkenv”..3.3. you need to set this variable yourself to the Tcl lib/ directory.vc. the sample simulations link with Cmdenv if you rebuild them from the IDE. Later you’ll probably want to download and build the source distribution too. mostly the same as the Unix version. choose Build|Set active configuration from the menu. you need to add NED files to the project. Changes since OMNeT++ 2. There is an AddNEDFileToProject macro which performs exactly this task: adding a NED file and the corresponding _n.vc.bat. See the readme file for rationale and more hints. and stack size set to as low as 64K. If you see this message. It contains all necessary software except MSVC. installer version.cc file. and configuring the Custom Build Step. to debug into them. and creates a makefile from them. • changed compiler settings. The resulting makefile is called Makefile.3). Its usage is very similar to the similarly named tool for Unix. then cd to the directory of your model and type: opp_nmakemake opp_nmakemake has several command-line options. You can fix this by running vcvars32. It is best to start by copying one of the sample simulations. If you want to use compiled NED files (as opposed to dynamic NED loading. Additional software needed for the compilation is also described in doc/. Reasons for that might be to compile the libraries with different flags. Then you can build the program by typing: nmake -f Makefile.2: You’ll need exception handling and RTTI turned ON. By default. If you get this message. To use opp_nmakemake. 147 .2 Building simulation models on the command line OMNeT++ has an automatic MSVC makefile creator named opp_nmakemake which is probably the easier way to go. described in section 8.MSVC for more!): • how to get the graphical environment..1 Installation It is easiest to start with the binary. Some caveats (please read doc/Readme.3 Building simulation models from the MSVC IDE You can also use the MSVC IDE for development. 7.tcl. Akaroa.g. If you run opp_nmakemake in a directory of model sources.
cpp $(InputPath) Outputs: $(InputName)_n. After you added a .cc files as C++ sources.0 doesn’t recognize .cpp For msg files you need an analogous procedure. • file name extension: MSVC 6. 148 . and set a Custom Build Step for them: Description: NED Compiling $(InputPath) Command: nedc -s _n. Do a web search to find out what exactly you need to change.ned file to the project.cpp file. to convince MSVC by changing by the corresponding registry entries.cpp extension. Your options are to switch to the . you also have to add a _n.OMNeT++ Manual – Building Simulation Programs • adding NED files.
ini file which can be used to run the Fifo1 sample simulation under Cmdenv. Common functionality in Tkenv and Cmdenv has been collected and placed into the Envir library.1 The configuration file: omnetpp. using Cmdenv. then run actual simulation experiments from the command line or shell script. This also means that.ini and the common part of the user interfaces. Both user interfaces accept command-line arguments. and you choose between them by linking one or the other into your simulation executable. 8. Configuration and input data for the simulation are described in a configuration file usually called omnetpp. and the two parts interact through a welldefined interface. Currenly.1 User interfaces OMNeT++ simulations can be run under different user interfaces.2 8.2. (Creating the executable was described in chapter 7). The following sections explain omnetpp. Both user interfaces are supported on Unix and Windows platforms.OMNeT++ Manual – Configuring and Running Simulations Chapter 8 Configuring and Running Simulations 8. other settings are in effect regardless of the user interface. The user interface is separated from the simulation kernel. 149 . too.ini An example For a start. describe Cmdenv and Tkenv in detail. let us see a simple omnetpp. which can be thought of as the “common base class” for the two user interfaces. Some entries in this file apply to Tkenv or Cmdenv only. then go on to specific problems. Both Tkenv and Cmdenv are provided in the form of a library. Tkenv is also better suited for educational or demonstration purposes. two user interfaces are supported: • Tkenv: Tcl/Tk-based graphical. windowing user interface • Cmdenv: command-line user interface for batch execution You would typically test and debug your simulation under Tkenv. you can write your own user interface or embed an OMNeT++ simulation into your application without any change to models or the simulation library. if needed.ini.
5 ev/sec=58754.4 ev/sec=59066.5 ev/sec=59808..694 (13h 57m) Elapsed: 0m 3s ** Event #300000 T=75217.9 150 .bits_per_sec = 10 The file is grouped into sections named [General].47 ( 5d 4h) Elapsed: 0m 30s ** Event #1900000 T=474429.67 ( 1d 10h) Elapsed: 0m 8s ** . [Cmdenv] and [Parameters].3826 ev/sec=0 ev/sec=0 ev/sec=60168. and the entries in this case specify that the network named fifonet1 should be simulated and run for 500./fifo1) on the command prompt.vec [Cmdenv] express-mode = yes [Parameters] # generate a large number of jobs of length 5... .fifo. and vector results should be written into the fifo1...simulation stopped.00s) Elapsed: 0m 0s ** Event #0 Event #100000 T=25321.10 according to Poisson fifonet1. OMNeT++ Discrete Event Simulation (C) 1992-2003 Andras Varga See the license for distribution terms and warranty disclaimer Setting up Cmdenv (command-line user interface). The entry in the [Cmdenv] section tells Cmdenv to run the simulation at full speed and print periodic updates about the progress of the simulation.gen..vec file. each one containing several entries...21 ( 4d 21h) Event #1800000 T=449573.OMNeT++ Manual – Configuring and Running Simulations [General] network = fifonet1 sim-time-limit = 500000s output-vector-file = fifo1.ia_time = exponential(1) fifonet1. Calling finish() at end of Run #1.76 ( 1d 3h) Elapsed: 0m 6s ** Event #500000 T=125239.8523 Max queueing time: 10.7 ev/sec=59453 ev/sec=58719. *** Module: fifonet1.597 (20h 53m) Elapsed: 0m 5s ** Event #400000 T=100125.000 simulated seconds. Elapsed: 0m 28s ** Event #1700000 T=424529.num_messages = 10000000 fifonet1.10) # processing speeed of queue server fifonet1.9 ev/sec=60168. The [General] section applies to both Tkenv and Cmdenv.99 ( 7h 2m) Elapsed: 0m 1s ** Event #200000 T=50275. T=0.gen.6 ev/sec=59772..0000000 ( 0.msg_length = intuniform(5. When you build the Fifo1 sample with Cmdenv and you run it by typing fifo1 (or on Unix. The [Parameters] section assigns values to parameters that did not get a value (or got input value) inside the NED files..5473 Standard deviation: 1.sink*** Total jobs processed: 9818 Avg queueing time: 1.. Lines that start with “#” or “. you should see something like this.” are comments. Running simulation...gen.66 ( 5d 18h) Elapsed: 0m 34s ** <!> Simulation time limit reached -. Preparing for Run #1. Setting up network ‘fifonet1’.06 ( 5d 11h) Elapsed: 0m 32s ** Event #2000000 T=499417.
4 File inclusion OMNeT++ supports including an ini file in another.g. Long lines can be broken up using the backslash notation: if the last character of a line is "\". fixed and varying part etc. via the include keyword.. [General] occurs twice in the file).2. and it can be processed using Plove or other tools. it will be merged with the next line. and will be ignored during processing..3 File syntax The ini file is a text file consisting of entries grouped into different sections. which cannot be increased by breaking up the line using backslashes. Currently there is a 1024character limit on the line length. queueing times).vec contains vector data recorded during simulation (here. and the output from them are displayed. This Cmdenv output can be customized via omnetpp. 8. The output file fifo1. Example: [General] # this is a comment foo="this is a single value \ for the foo parameter" [General] # duplicate sections are merged bar="belongs to the same section as foo" 8.2 The concept of simulation runs OMNeT++ can execute several simulation runs automatically one after another. the simulation time. The size of the ini file (the number of sections and entries) is not limited. At the end of the simulation.. the elapsed (real) time. or together for all runs. If multiple runs are selected. option settings and parameter values can be given either individually for each run.2. Also. if you have two sections with the same name (e. This limit might be lifted in future releases. and the performance of the simulation (how many events are processed per second. depending in which section the option or parameter appears.2. This feature allows you to partition large ini files into logical units. On my machine this run took 34 seconds." are comments. they will be merged.OMNeT++ Manual – Configuring and Running Simulations End run of OMNeT++ As Cmdenv runs the simulation. include parameters.ini . 151 . The order of the sections doesn’t matter. the first two values are 0 because there wasn’t enough data for it to calculate yet).ini entries.ini . An example: # omnetpp. periodically it prints the sequence number of the current event. the finish() methods of the simple modules are run. Lines that start with "#" or "..ini include per-run-pars. 8.
Contains Cmdenv-specific settings. • The network option selects the model to be set up and run. For details. h.2.4 Configures recording of output vectors. For details.sna Name of the snapshot file. OMNeT++ will split send() calls to two steps. OMNeT++ lists the names of ini file entries for which the default values were used. preload-ned-files = List of NED files to be loaded dynamically (see 8.8.6.vec Name of output vector file.5 [OutVectors] 8. For details. output-scalar-file = omnetpp. Almost every one these options can also be put into the [Run n] sections. If enabled. • The output file names can be set with the following options: output-vector-file.3). network = The name of the network to be simulated. num-rngs = 1 Number of random number generators Name and default value 152 . s. [Run 2].6 The [General] section The most important options of the [General] section are the following.5 Sections The following sections can exist: Section [General] [Run 1]. see section 8.7. For details. The full list of supported options follows.. see section 8. see section 8. outputscalar-file and snapshot-file. cpu-time-limit = Duration of the simulation in real time. This can at times be useful for debugging ini files.2 Contains Tkenv-specific settings.. sim-time-limit = Duration of the simulation in simulation time. . etc. You can specify filtering by vector names and by simulation time (start/stop recording).2 Contains values for module parameters that did not get a value (or got input value) inside the NED files. see section 8. see section 8. The result of each snapshot() call will be appended to this file. m.OMNeT++ Manual – Configuring and Running Simulations 8.2. For details. can be used). These sections may contain any entries that are accepted in other sections. Per-run settings have priority over globally set ones. [Cmdenv] [Tkenv] [Parameters] Description Contains general settings that apply to all simulation runs and all user interfaces. Description [General] ini-warnings = yes When enabled. output-vector-file = omnetpp. • The length of the simulation can be set with the sim-time-limit and the cpu-time-limit options (the usual time units such as ms. pause-in-sendmsg = no Only makes sense with step-by-step execution. snapshot-file = omnetpp.sca Name of output scalar file.2. Contains per-run settings.
Specifies seeds for the cMersenneTwister and the cLCG32 RNGs (substitute N with the RNG number: 0. List of shared libraries (separated by spaces) to load in the initialization phase.) or simple modules.h. Part of the Envir plugin mechanism: selects the class from which all configuration will be obtained.ini with some other implementation. The class has to implement the cScheduler interface defined in envirext. Enables parallel distributed simulation (see chapter 12). or you can use your own RNG class (it must be subclassed from cRNG).vec../lib/ospfrouting" Turning it on will cause the host name and process Id to be appended to the names of output files (e. It can be "cMersenneTwister".. Specifies the total stack size (sum of all coroutine stacks) in kilobytes./lib/rng2 . gen1-seed=.dll on Windows and . distributed and distributed parallel simulation. The simulation program still has to bootstrap from an omnetpp. This plugin interface allows for implementing real-time. omnetpp. e. The class has to implement the cConfiguration interface defined in envirext.3. 1. seed-N-lcg32 = total-stack-kb = load-libs = fname-append-host = false parallel-simulation = false scheduler-class = cSequentialScheduler configuration-class = cInifile The RNG class to be used. Part of the Envir plugin mechanism: selects the scheduler class. 153 .5.. etc. This obsoletes the random-seed= and gen0-seed=. This is especially useful for parallel distributed simulation (chapter 12). hardwarein-the-loop. entries which are no longer in use.OMNeT++ Manual – Configuring and Running Simulations rng-class = "cMersenneTwister" seed-N-mt =..so on Unix systems. "cLCG32".sca). This feature can be used to dynamically load Envir extensions (RNGs.3. OMNeT++ appends a platform-specific extension to the library name: . default is auto seed selection..g. this option lets you replace omnetpp.). You need to increase this value if you get the “Cannot allocate coroutine stack. omnetpp. More details in section 13. More details in section 13. database input..g. 2.ini though (which contains the configuration-class setting). output vector managers. or "cAkaroaRNG".” error. etc.5. Example: load-libs = ".h. In other words.
ned It is also possible to use list files.ned @.ned networks/testnetwork1.ini. one can use dynamic NED loading.ned’ . The class has to implement the cSnapshotManager interface defined in envirext.lst where the nedfiles.5.ned router.5.3 Dynamic NED loading Prior to OMNeT++ 3. The key is the preload-ned-files= configuration option in the [General] section of omnetpp.0 up.3.OMNeT++ Manual – Configuring and Running Simulations outputvectormanager-class = cFileOutputVectorManager outputscalarmanager-class = cFileOutputScalarManager snapshotmanager-class = cFileSnapshotManager Part of the Envir plugin mechanism: selects the output vector manager class to be used to record data from output vectors. Part of the Envir plugin mechanism: selects the output scalar manager class to be used to record data passed to recordScalar(). compiled and linked into the simulation program. The class has to implement the cOutputVectorManager interface defined in envirext./nedfiles. with the @ notation: [General] preload-ned-files = *. NED files had to be translated into C++ by the NED compiler. This option should list the names of the NED files to be loaded when the simulation program starts. 8.ned The Unix find command is often a very convenient way to create list files (try find . More details in section 13.ned transport/udp/udp..h.ned networks/*.h. From OMNeT++ 3. the list file can also contain wildcards.0.3.lst file contains the list of NED files. More details in section 13. Part of the Envir plugin mechanism: selects the class to handle streams to which snapshot() writes its output. > listfile.ned network/ip/ip. More details in section 13. and can also save model development time.lst). and references to other list files: 154 -name ’*. one per line. This results in more flexibility.3.h. The class has to implement the cOutputScalarManager interface defined in envirext. Moreover.5.ned Wildcards can also be used: [General] preload-ned-files = *. Example: [General] preload-ned-files = host. like this: transport/tcp/tcp. which means that a simulation program can load NED files at runtime when it starts – compiling NED files into the simulation program is no longer necessary.
ini.lst Files given with relative paths are relative to the location of the list file (and not to the current working directory). In contrast. Since parameters assigned in NED files cannot be overridden in omnetpp. It is important to note. channel and any number of networks as well. An example omnetpp. module parameters are referred to by their full paths or hiearchical names.ini.numHosts = 15 net. An example omnetpp.numHosts comes from the [Parameters] section [Run 3] # override both setting in [Parameters] net. plus the parameter name (see section 6. The run-specific settings take precedence over the overall settings.transactionsPerSecond = 100 [Run 1] # uses settings from the [Parameters] section [Run 2] net.server. one can think about them as being “hardcoded”. It does not matter whether you use all or just some of them in the simulations.4 Setting module parameters in omnetpp. sections of the ini file.1 Run-specific and general sections Values for module parameters can be placed into the [Parameters] or the [Run 1].ini entry.OMNeT++ Manual – Configuring and Running Simulations transport/tcp/*.transactionsPerSecond = 150 # overrides the value in [Parameters] # net. That is. that the loaded NED files may contain any number of modules.ned @moreprotocols. the transport directory and moreprotocols. channel etc for it has been loaded.ned transport/udp/*.server. This name consists of the dot-separated list of the module names (from the top-level module down to the module containg the parameter).1.lst.ini which sets the numHosts parameter of the toplevel module and the transactionsPerS parameter of the server module: [Parameters] net. whatever the current working directory is.transactionsPerSecond = 100 8. and as long as every module.ini – in this order.server.ini: [Parameters] net. 8.numHosts = 20 net.lst in the example above are expected to be in the same directory as nedfiles. which can be assigned a value in NED files or in omnetpp.numHosts = 15 net.server.4.ini. You will be able to select any of the networks that occur in the loaded NED files using the network= omnetpp. it is easier and more flexible to maintain module parameter settings in omnetpp.ini Simulations get input via module parameters.transactionsPerSecond = 150 155 . network setup will be successful. In omnetpp.5). [Run 2] etc.
If you want to include ’}’ in the set. An example ini file: [Parameters] *.2 Using wildcard patterns Models can have a large number of parameters to be configured. put it at a position where it cannot be interpreted as character range.queue**. {xyzc-f} matches any of the characters x. 156 # specifics come first # catch-all comes last .150] : index range: any number in square brackets in the range 38. for example: {a-z-} or {-a-z}.150 (e. Catch-all settings should come last. and that character ranges should be written with curly braces instead of square brackets (that is. it must be the first character: {}a-z}.e.. Also note that **.foo.g.. plus the underscore. sequence of digits) in the range 38. y.host[3]. because square brackets are already reserved for the notation of module vector indices). 99) • [38.queue1. To include ’-’ in the set.queue*.) • * : matches zero or more characters except dot (. the first matching occurrence is used. and it would be tedious to set them oneby-one in omnetpp. f. OMNeT++ supports wildcards patterns which allow for setting several model parameters at once. This means that you need to list specific settings first. The notation is a variation on the usual glob-style patterns.150 (e. The most apperent differences to the usual rules are the distinction between * and **.bufSize or net. while ** can be used to match several components in the path. A backslash is always taken as literal backslash (and NOT as escape character) within set definitions.g.bufSize would match net. z. c.bufSize as well! Sets. the order of entries is important: if a parameter name matches several wildcardspatterns..waitTime = 6ms *.waitTime = 10ms Asterisk vs double asterisk The * wildcard is for matching a single module or parameter name in the path name. **.queue*.bar.host[*]. e.) • ** : matches zero or more character (any character) • {a-f} : set: matches a character in the range a-f • {^a-f}: negated set: matches a character NOT in the range a-f • {38.ini. [99]) • backslash (\) : takes away the special meaning of the subsequent character Precedence If you use wildcards. d. For example.4.bufSize matches the bufSize parameter of any module whose name begins with queue in the model. or as a negated set: {^}a-z}.host[0]. Pattern syntax: • ? : matches any character except dot (.150} : numeric range: any number (i. {_a-zA-Z0-9} matches any letter or digit. negated sets Sets and negated sets can contain several character ranges and also enumeration of characters.bufSize selects only queues immediately on network level.queue*. For example.. while *. and more general ones later. any-letter is {a-zA-Z} not [a-zA-Z].OMNeT++ Manual – Configuring and Running Simulations 8.waitTime = 5ms *.
]. every line which begins with *. In practice. The following example sets ttl (time-to-live) of hostA’s ip module to 5. but very often.use-default = yes To make use of all defaults in NED files.bufSize = 18 *. it will be removed in some future version. The size of output vector files can easily reach a magnitude of several ten or hundred megabytes. or 0.0. false or empty string if there was no default value in the NED file. The specification must use exactly two dots. Caveat: *{17.. 117 and 963217 as well. the ** wildcard did not exist.ip.1.0 – so ini files have to be updated. because the * can also match digits! An example for numeric ranges: [Parameters] *.19} will match a17. you’d add the following to omnetpp.5 Configuring output vectors As a simulation program is evolving.3 to 3.queue[3.bufSize = 6 # this will only affect queues 0. and * matched dot as well. This will switch back to the old behaviour.5].. to check the new one against it). it is becoming capable of collecting more and more statistics. further tweaking is rarely necessary.11 Compatibility In OMNeT++ versions prior to 3. 157 .use-default=yes setting assigns the default value to the parameter.bufSize = 10 *.ip. only some of the recorded statistics are interesting to the analyst..OMNeT++ Manual – Configuring and Running Simulations Numeric ranges and index ranges Only nonnegative integers can be matched.*. – that’ll do most of the time.use-default = yes 8. 8. The start or the end of the range (or both) can be omitted: {10.ini: [Parameters] **.*.4.*.[New!] The <parameter-name>. [Parameters] **.queue[*]. while all other nodes in the network will get the default specified with input() in the NED files. you can add the line #% old-wildcards at the top of (each) old ini file.queue[12...2 and 6. If you still want to run the old omnetpp. {..3 Applying the defaults It is also possible to utilize the default values specifified with input(default-value) in the NED files. should be changed to begin with **.hostA.ini (for example.}.ttl. Since #% old-wildcards is only provided to ease transition from OMNeT++ 2.. This means that ini files written for earlier OMNeT++ versions may have a different meaning when used in OMNeT++ 3.0.99} or {.} are valid numeric ranges (the last one matches any number).ttl = 5 **.
6.**.e.2 RNG choice The rng-class= configuration entry sets the random number generator class to be used. you can control how cOutVector objects record data to disk. 8. Output vector configuration is given in the [OutVectors] section of the ini file.End-to-End Delay. By default.60s interval.interval = start. [Run 2] etc sections individually for each run. You can turn output vectors on/off or you can assign a result collection interval.6 Configuring the random number generators The random number architecture of OMNeT++ was already outlined in section 6.g. and disables collection of output vectors except all end-to-end delays and the ones in any module called Router2.6. As with parameter names.1 Number of RNGs The num-rngs= configuration entry sets the number of random number generator instances (i. all output vectors are turned on. 10h 30m 45.interval = . Start and stop values can be any time specification accepted in NED and config files (e. It defaults to "cMersenneTwister".enabled = no The above configuration limits collection of all output vectors to the 1s.objectname. The object name is the string passed to cOutVector in its constructor or with the setName() member function. Referencing an RNG number greater or equal to this number (from a simple module or NED file) will cause a runtime error.interval = 1s. Output vectors can be configured with the following syntax: module-pathname.. An example: # # omnetpp.2s). the Mersenne Twister RNG. Other available classes are "cLCG32" (the "legacy" RNG of OMNeT++ 2.interval = start.objectname.. wildcards are allowed in the object names and module path names.enabled = yes **. or in the [Run 1].. Here we’ll cover the configuration of RNGs in omnetpp. 158 .enabled = yes **.60s **..objectname. with a cycle length of 23 1 − 2). random number streams) available for the simulation model (see 6.ini.OMNeT++ Manual – Configuring and Running Simulations In OMNeT++. 8.3 and earlier versions.10). cOutVector eed("End-to-End Delay").4. see section 8.ini # [OutVectors] **.stop module-pathname. and "cAkaroaRNG" (Akaroa’s random number generator.enabled = yes/no module-pathname. 8.objectname.Router2.4).stop module-pathname..
rng-0 = 1 **. 8. due to the extreme long sequence of the RNG. etc. [Run 2]. the number in the [Run 1]. 1 For the cLCG32 random number generator.gen[*]. Reasons for doing that may be that you want to use variance reduction techniques.6.. some RNGs can be configured manually. and some automatically. For the same the run number and RNG number. If the run number or the RNG number is different. OMNeT++ does its best to choose different seeds which are also sufficiently apart in the RNG’s sequence so that the generated sequences don’t overlap.5 Manual seed configuration In some cases you may want manually configure seed values. due to the extremely long sequence of MT. OMNeT++ uses a table of 256 pre-generated seeds. The RNG is initialized from the 32-bit seed value seed = runN umber ∗ numRngs + rngN umber. RNG mapping may be specified in omnetpp. OMNeT++ always selects the same seed value for any simulation model. and all noisychannel module’s default (N=0) RNG to physical RNG 2. The author would however be interested in papers published about seed selection for MT. or you may want to use the same seeds for several simulation runs.rng-N=M (where N.noisychannel[*]. Index into the table is calculated with the runN umber ∗numRngs+ rngN umber formula.ini.M are numeric. [General] num-rngs = 3 **. and the RNG number. The following example maps all gen module’s default (N=0) RNG to physical RNG 1.rng-0 = 2 This mapping allows variance reduction techniques to be applied to OMNeT++ models. section names).e. fullfilling the latter condition is easy. [General] <modulepath>. because the range of this RNG is rather short (23 1 − 1. Care should be taken that one doesn’t exceed 256 with the index.ini. 8. (This implies that simulation runs participating in the study should have the same number of RNGs set).ini. 1 While (to our knowledge) no one has proven that the seeds 0. 159 . Automatic and manual seed selection can co-exist: for a particular simulation.2. M<num-rngs) This maps module-local RNG N to physical RNG M. or it will wrap and the same seeds will be used again. without any model change or recompilation. The mapping allows for great flexibility in RNG usage and random number streams configuration – even for simulation models which were not written with RNG awareness. the situation is more difficult.4 Automatic seed selection Automatic seed selection gets used for an RNG if you don’t explicitly specify seeds in omnetpp. For this RNG..6.3 RNG mapping The RNG numbers used in simple modules may be arbitrarily mapped to the actual random number streams (actual RNG instances) from omnetpp. equally spaced in the RNG’s sequence. It is best not to use the cLCG32 at all – cMersenneTwister is superior in every respect. For the cMersenneTwister random number generator. The automatic seed selection mechanism uses two inputs: the run number (i.. are well apart in the sequence. about 2 billion).1.6. The syntax of configuration entries is the following. this is probably true.OMNeT++ Manual – Configuring and Running Simulations 8.
6... the g option is the most important. which has a practically infinite period length (2^19937). OMNeT++ provides a standalone program to generate seed values (seedtool is discussed in section 8.. Suppose you have 4 simulation runs that need two independent random number generators each and you want to start their seeds at least 10. you have to put the necessary seed entries into the [General] section.) will have their seeds automatically assigned. which makes about 2.3.6.6 Choosing good seed values: the seedtool utility The seedtool program can be used for selecting seeds for the cLCG32 RNG. (C) 1992-2004 Andras Varga See the license for distribution terms and warranty disclaimer.147 million random numbers.000.000 values apart. 8. To use a seed value for all runs. the program prints out the following help: seedtool . and you can specify those seeds explicitly in the ini file. This RNG has a period length of 2^31-2. Generates seeds for the LCG32 random number generator. You would type the following command: C:\OMNETPP\UTILS> seedtool g 1 10000000 8 The program outputs 8 numbers that can be used as random number seeds: 160 . p and t were used internally to generate a hash table of pre-computed seeds that greatly speeds up the tool. The following ini file explicitly initializes two of the random number generators.part of OMNeT++/OMNEST. For practical use...OMNeT++ Manual – Configuring and Running Simulations For the cLCG32 RNG. Usage: seedtool seedtool seedtool seedtool seedtool seedtool seedtool i s d g g t p seed index seed1 seed2 seed0 dist seed0 dist n - index of ’seed’ in cycle seed at index ’index’ in cycle distance of ’seed1’ and ’seed2’ in cycle generate seed ’dist’ away from ’seed0’ generate ’n’ seeds ’dist’ apart. [General] gen0-seed = 1768507984 gen1-seed = 33648008 All other random number generators (2. and uses different seed values for each run: [Run 1] seed-0-lcg32 = 1768507984 seed-1-lcg32 = 33648008 [Run 2] seed-0-lcg32 = 1082809519 seed-1-lcg32 = 703931312 . The first seed value can be simply 1. Note that Mersenne Twister is also available in OMNeT++. When started without command-line arguments.6). starting at ’seed0’ generate hashtable print hashtable The last two options.
Load a shared object (. this allows you to partition your configuration file..g. For example.. 8. another one most of the module parameters. Multiple -l switches are accepted. Command line switches: 161 . another one the module parameters you change often. By dynamically loading all simple module code and compiled network description (_n. The default is omnetpp.ini.o files on Unix) you can even eliminate the need to re-link the simulation program after each change in a source file. The runs to be executed can be passed via command-line argument or in the ini file.so files may contain module code etc. This option overrides the runs-to-execute= option in the [Cmdenv] section of the ini file (see later). Specify the name of the configuration file. then exits. portable and fast user interface that compiles and runs on all platforms.. Multiple -f switches can be given. subsequent ones will still be executed. If one run stops with an error message.OMNeT++ Manual – Configuring and Running Simulations 1768507984 33648008 1082809519 703931312 1856610745 784675296 426676692 1100642647 You would specify these seed values in the ini file. Your .7 Cmdenv: the command-line interface The command line user interface is a small. -r 2./fddi -h OMNeT++ Discrete Event Simulation (C) 1992-2003 Andras Varga See the license for distribution terms and warranty disclaimer Setting up Cmdenv (command-line user interface). Cmdenv is designed primarily for batch execution.1 Command-line switches A simulation program built with Cmdenv accepts the following command line switches: -h -f <fileName> The program prints a short help message and the networks contained in the executable. Cmdenv uses simply executes some or all simulation runs that are described in the configuration file..4.) It specifies which runs should be executed (e. (Shared objects can be created with gcc -shared. one file can contain your general settings.so file on Unix). -l <fileName> -r <runs> All other options are read from the configuration file.6-8). 8.7. An example of running an OMNeT++ executable with the -h flag: % .
It accepts a comma-separated list of run numbers or run number ranges. module output.34. etc.ini. e.2. networks. if no runs are specified in the ini file. • Express mode can be used for long simulation runs: only periodical status update is displayed about the progress of the simulation. <runs> is a comma-separated list of run numbers or run number ranges. Cmdenv executes all runs that have ini file sections. 1..g. use the given ini file instead of omnetpp. -l <library> Available networks: FDDI1 NRing TUBw TUBs Available modules: FDDI_MAC FDDI_MAC4Ring . The -r command line option overrides this ini file setting. for example 1. Cmdenv does one run. Selects “normal” (debug/trace) or “express” mode. execute the specified runs in the ini file. If the value is missing.7-9.7. In normal mode only: printing module ev« output on/off In normal mode only: printing event banners on/off express-mode=yes/no (default: no) module-messages=yes/no (default: yes) event-banners=yes/no (default: yes) 162 . The library can contain modules. selected by the express-mode ini file entry: • Normal (non-express) mode is for debugging: detailed information will be written to the standard output (event banners.2 Cmdenv ini file options Cmdenv can be executed in two modes. The full list of ini file options recognized by Cmdenv: Entry and default value [Cmdenv] runs-to-execute = Description Specifies which simulation runs should be executed.OMNeT++ Manual – Configuring and Running Simulations -h -f <inifile> -r <runs> print this help and exit. Available channels: End run of OMNeT++ 8.5-10. load the specified shared library on startup. etc)..
g. 8.97 Messages: created: 55532 present: 6553 in FES: 8 T=148.. protocol simulations tend to require more processing per event than e. and on the other hand it depends on the complexity (amount of calculations) associated with processing one event.80713 ev/simsec=2011. this will produce an update every few seconds. etc) and delivery on the standard output Call fflush(stdout) after each event banner or status update. simsec/sec.15 Messages: created: 66605 present: 7815 in FES: 7 .3 Interpreting Cmdenv output When the simulation is running in “express” mode with detailed performance display enabled. The output looks like this: . Specifies the extra amount of stack (in kilobytes) that is reserved for each activity() simple module when the simulation is run under Cmdenv.7. Turning on autoflush can be useful with printf-style debugging for tracking down program crashes.8 simsec/sec=9. ev/simsec. T=123. Cmdenv periodically outputs a three-line status info about the progress of the simulation.OMNeT++ Manual – Configuring and Running Simulations message-trace=yes/no (default: no) autoflush=yes/no (default: no) status-frequency=<integer> fault: 50000) (de- performance-display=yes/no fault: yes) (de- extra-stack-kb = 8 In normal mode only: print a line about each message sending (by send(). Turning it on results in a 3-line entry printed on each update.scheduleAt(). On one hand it depends on your hardware (faster CPUs process more events per second).64698 ev/simsec=2030. The second line displays info about simulation performance: • ev/sec indicates performance: how many events are processed in one real-time second. queueing 163 . For example. and • the elapsed time (wall clock time) since the beginning of the simulation run.. perhaps a few times per second) In express mode only: print detailed performance information.6 simsec/sec=9...55496 ( 2m 28s) Elapsed: 0m 15s ** Event #300000 Speed: ev/sec=19584. The first line of the status display (beginning with **) contains: • how many events have been processed so far • the current simulation time (T). containing ev/sec.74354 ( 2m 3s) Elapsed: 0m 12s ** Event #250000 Speed: ev/sec=19731. and for a typical model. affects both express and normal mode. In express mode only: print status update every n events (on today’s computers. number of messages created/still present/currently scheduled in FES.
then either you have a memory leak and losing messages (which indicates a programming error). This number includes the messages in the FES. 8. you can expect the event density double. The most important feaures are: • message flow animation • graphical display of statistics (histograms etc. because some (many) of them may have been deleted since then. • In FES: the number of messages currently scheduled in the Future Event Set. how fast the simulation is progressing compared to real time. • Present: the number of message objects currently present in the simulation model. too. on the size of the simulation model. since it allows one to get a detailed picture of the state of simulation at any point of execution and to follow what happens inside the network. • Created: total number of message objects created since the beginning of the simulation run. • simsec/sec shows relative speed of the simulation. the number of messages present is more useful than perhaps one would initially think. Nevertheless the value is still useful. In any case. on the complexity of events. Tkenv supports interactive execution of the simulation. tracing and debugging. how many simulated seconds can be done in one real second. thus the latter produce higher ev/sec values. this value is independent of the size (number of modules) in your model. Event density only depends on the simulation model. that is. while in a bank teller simulation this value is probably well under 1. This value virtuall depends on everything: on the hardware. The second value. and the average simulation time between events as well. regardless of the hardware used to simulate it: in a cell-level ATM simulation you’ll have very hight values (109 ). • ev/simsec is the event density: how many events are there per simulated second. that is. to implement wait() in an activity() simple module). if the number of messages does not increase. Tkenv is recommended in the development stage of a simulation or for presentation and educational purposes. it does not mean that you do not have a memory leak (other memory leaks are also possible). This does not mean that this many message object actually exist. and it is important because it may indicate the ‘health’ of your simulation. It can indicator of the ‘health’ of the simulation: if it is growing steadily. because by far the most common way of leaking memory in a simulation is by not deleting messages. the number of messages created (see above) minus the number of messages already deleted. It also does not mean that you created all those messages – the simulation kernel also creates messages for its own use (e. Of course. or the network you simulate is overloaded and queues are steadily filling up (which might indicate wrong input parameters).) and output vectors during simulation execution • separate window for each module’s text output • scheduled messages can be watched in a window as simulation progresses 164 .OMNeT++ Manual – Configuring and Running Simulations networks. The third line displays the number of messages.8 Tkenv: the graphical user interface Features Tkenv is a portable graphical windowing user interface. It also depends on the size of your model: if you double the number of modules in your model.g.
then exits.. This can speed up the process of verifying the correct operation of the simulation program and provides a good environment for experimenting with the model during execution.8.o files on Unix) you can even eliminate the need to re-link the simulation program after each change in a source file. By dynamically loading all simple module code and compiled network description (_n. You can get more information about Tcl/Tk on the Web pages listed in the Reference. If there’s no defaultrun= entry or the value is 0. Multiple -f switches can be given. Macintosh.. The default is omnetpp. Load a shared object (. When used together with gdb or xxgdb. variables etc. Specify the name of the configuration file. For example. Results can be displayed as histograms and time-series diagrams.8. Multiple -l switches are accepted. This value is significantly higher than the similar one for Cmdenv – handling GUI events requires a large amount of stack space. default-run = 1 The following configuration entries are of marginal usefulness. 8. Your . this allows you to partition your configuration file. Specifies which run Tkenv should set up automatically after startup.) -l <fileName> 8. one file can contain your general settings.so files may contain module code etc. another one the module parameters you change often. normal and fast execution • labeled breakpoints • inspector windows to examine and alter objects and variables in the model • simulation can be restarted • snapshots (detailed report about the model: objects.) during execution. Windows.OMNeT++ Manual – Configuring and Running Simulations • event-by-event. Entry and default value extra-stack-kb = 48 Description [Tkenv] Specifies the extra amount of stack (in kilobytes) that is reserved for each activity() simple module when the simulation is run under Tkenv.2 Tkenv ini file settings Tkenv accepts the following settings in the [Tkenv] section of the ini file.ini. because corresponding settings are also 165 . Tkenv can speed up debugging a lot. Tkenv is built with Tcl/Tk.) Tkenv makes it possible to view simulation results (output vectors etc.so file on Unix). Tkenv will ask which run to set up.1 Command-line switches A simulation program built with Tkenv accepts the following command line switches: -h -f <fileName> The program prints a short help message and the networks contained in the executable. (Shared objects can be created with gcc shared. and it work on all platforms where Tcl/Tk has been ported to: Unix/X. another one most of the module parameters.
Entry and default value use-mainwindow = yes print-banners = yes breakpoints-enabled = yes Description [Tkenv] Enables/disables writing ev output to the Tkenv main window. Output messages are displayed in the main window and module output windows. Delay between steps when you slow-execute the simulation.tkenvrc file. Enables/disables message flow animation.0 methodcalls-delay = show-layouting = true 8. Sets delay after method call animation. you can execute the simulation event-by-event.tkenvrc file in the current directory – the ini file settings are only used if there is no . animation is turned off. the speedup can get close to 10 (or the configured event count). Message animation is active and inspector windows are updated after each event. In Run mode. You can fully interact with the user interface while the simulation is running: you can open inspectors etc. The inspectors and the message output windows are updated after each 10 events (the actual number can be set in Options|Simulation options and also in the ini file). Specifies whether the simulation should be stopped at each breakpoint() call in the simple modules.8. You can stop the simulation with the Stop button on the toolbar. and the GUI settings take precedence. Specifies the speed of message flow animation. Number of events executed between two display updates when in Fast execution mode.3s animation-enabled = yes animation-msgnames = yes animation-msgcolors = yes animation-speed = 1.3 Using the graphical environment Simulation running modes in Tkenv Tkenv has the following modes for running the simulation : • Step • Run • Fast run • Express run The running modes have their corresponding buttons on Tkenv’s toolbar. In Step mode. Fast mode is several times faster than the Run mode. Enables/disables displaying message names during message flow animation. Show layouting process of network graphics. Tkenv stores the settings in the . In Fast mode. update-freq-fast = 10 update-freq-express = 500 animation-delay = 0. 166 . the simulation runs with all tracing aids on. Enables/disables using different colors for each message kind during message flow animation. Number of events executed between two display updates when in Express execution mode. Enables/disables printing banners for each event.OMNeT++ Manual – Configuring and Running Simulations accessible in the Simulation options dialog in the Tkenv GUI.
The gauges displayed are similar to those in Cmdenv. It was an experiment. To solve the problem. You can interact with the simulation only once in a while (1000 events is the default as I recall). You have to explicitly push the Update inspectors button if you want an update. .. This possibility is built into the makefiles and can be optionally enabled. double. objects can be viewed through inspectors. In Step. To start. inspectors are updated automatically as the simulation progresses.8. which is a semicolon-separated list of directories and defaults to omnetpp-dir/bitmaps. there is a possibility to compile the script parts into Tkenv. all tracing disabled.cc. use the WATCH() macro in the C++ code. which gets included into tkapp. The default location of the scripts is passed compile-time to tkapp. and can also copy the pointer value to the clipboard. This can be invaluable for debugging: when the simulation is running under a debugger like gdb or the MSVC IDE.cc.tcl script files.OMNeT++ Manual – Configuring and Running Simulations In Express mode. Turbo Vision was an excellent character-graphical windowing environment. Embedding Tcl code into the executable A significant part of Tkenv is written in Tcl. .3. XEnv never got too far because it was really very-very slow to program in Motif. Configuring Tkenv In case of nonstandard installation. The existence of a separate script library can be inconvenient if you want to carry standalone simulation executables to different machines.4 In Memoriam.tcl files into C code (tclcode. described in section 8. 167 . A GUI written in pure X/Motif. you can paste the object pointer into the debugger and have closer look at the data structures. (See section ?? as well). . thus the run-time overhead of the user interface is minimal. just use double-clicks and popup menus that are brought up by right-clicking. . Inspectors In Tkenv. it may be necessary to set the OMNETPP_TKENV_DIR environment variable so that Tkenv can find its parts written in Tcl script. originally shipped with Borland C++ 3. char etc. choose Inspect|Network from the menu. the simulation runs at about the same speed as with Cmdenv. There used to be other windowing user interfaces which have been removed from the distribution: • TVEnv.cc).) appear in Tkenv. Tkenv inspectors also display the object pointer. Module output is not recorded in the output windows any more. The default path from where the icons are loaded can be changed with the OMNETPP_BITMAP_PATH variable.7. written before I stumbled into Tcl/Tk and discovered its immense productivity in GUI building. The details: the tcl2c program (its C source is there in the Tkenv directory) is used to translate the . Run and Fast Run modes. A Turbo Vision-based user interface. 8. Usage should be obvious. To make ordinary variables (int.1./bitmaps. • XEnv. the first interactive UI for OMNeT++. and it can be overridden at run-time by the OMNETPP_TKENV_DIR environment variable. in several . Tkenv has a status bar which is regularly updated while the simulation is running.
with parameters for the different runs given in the runs./wireless .. Tcl. do .ini -r $i done 168 . i++)). 8. Ruby might also have justification for this purpose.ini runs./run You can simplify the above script by using a for loop. #! /bin/sh . In the example below. do .1 Executing several runs In simple cases. but other languages like Perl. you can use a C-style loop: #! /bin/sh for ((i=1.ini runs./wireless .9. $i<50. then you can execute it by typing . run. we skip run 6. the contrib/octave/ directory contains example scripts (contributed by Richard Lyon). and invoke your simulation with the -r flag each time.ini -r $i done If you have many runs. The -f flag lets you use a file name different from omnetpp. since you can leave out or add runs.ini file. give it x (executable) permission using chmod. type it in a text file called e./wireless ./wireless -f runs./wireless -f runs. The following script executes a simulation named wireless several times. and then a good solution is to write a control script that takes care of the task automatically. We’ll use the Unix ‘Bourne’ shell (sh.. . you’ll usually want to run several simulations. sections of omnetpp.ini -r -r -r -r 1 2 3 4 -f runs.OMNeT++ Manual – Configuring and Running Simulations 8.ini.ini runs. It is very practical. to achieve statistically more reliable results. Unix shell is a natural language choice to write the control script in. and include run 15 instead. or you may want (should want?) to run the same model with the same parameter settings but with different random number generator seeds.g. [Run 2].ini. #! /bin/sh for i in 3 2 1 4 5 7 15 8 9 10. or change the order of runs by simply editing the list – to demonstrate this./run: % chmod +x run % . etc. the variable i iterates through the values of list given after the in keyword. You may want to run the model with various parameter settings.9 Repeating or iterating simulation runs Once your model works reliably. you may define all simulation runs needed in the [Run 1]. The next sections are only for Unix users. If you’d prefer Matlab/Octave. Running a simulation several times by hand can easily become tedious./wireless -f -f -f -f runs.ini -r 10 To run the above script. bash) to write the control script. Matlab/Octave./wireless .
ini # include variable part And have the following as control script.ini. here’s the “runall” script of Joel Sherrill’s File System Simulator. they are grouped using parentheses.ini echo "Wireless.filesystem_type = \"PassThroughFileSystem\"" echo "filesystem. and redirected together.beta=$beta" >> params. #! /bin/bash # # This script runs multiple variations of the file system simulator. #! /bin/sh for alpha in 1 2 5 10 20 50. do ( echo "[Parameters]" echo "filesystem. and use it via ini file inclusion.. but you can spare some typing this way. (omnetpp.9.syscalliface_type = \"PassThroughSysCallIface\"" echo "filesystem.OMNeT++ Manual – Configuring and Running Simulations 8.1 0." all_schedulers="FIFOScheduler SSTFScheduler CScanScheduler.accessmanager_type = \"MutexAccessManager\"" echo "filesystem. The net effect is the same.n = 10 . using the > and » operators. not just numbers. or you want to try all possible combinations of two or more parameters.3 0. do for s in ${all_schedulers}. For example.generator_type = \"GenerateFromFile\"" echo "filesystem." for c in ${all_cache_managers}. It uses two nested loops to explore all possible combinations of the alpha and beta parameters.iolibrary_type = \"PassThroughIOLibrary\"" echo "filesystem.ini like this: [General] network = Wireless [Parameters] Wireless.diskscheduler_type = \"${s}\"" echo "filesystem./wireless done done As a heavy-weight example. do echo "Wireless. The solution might be to generate only a small fraction of the ini file with the variable parameters.2 0. # params.2 Variations over parameter values It may not be practical to hand-write descriptions of all runs in an ini file. # other fixed parameters include params.5. Note that params.cache_type = \"${c}\"" echo "filesystem. do for beta in 0.physicaldisk_type = \"HP97560Disk\"" 169 . especially if there are many parameter settings to try. you might write your omnetpp...4 0.ini is created by redirecting the echo output into file.) Note that instead of redirecting every echo command to file..ini includes the generated algorithms.
“just to be safe.” • When can we stop the simulation? We want to wait long enough so that the statistics we are collecting can “stabilize”.) The seeds are 10 million numbers apart in the sequence (seedtool parameter). However. A possible solution is to look at the statistics while the simulation is running. For the simulation to produce statistically reliable results. otherwise there will be overlaps in the sequences and the runs will not be independent.1 Akaroa support: Multiple Replications in Parallel Introduction Typical simulations are Monte-Carlo simulations: they use (pseudo-)random numbers to drive the simulation model.txt‘.ini.txt for seed in ‘cat seeds. say. Neither questions are trivial to answer.ini .10. by its width relative to the mean. One possible criterion is given by the confidence level.3 Variations over seed value (multiple independent runs) The same kind of control script can be used if you want to execute several runs with different random seeds. please read [PJL02] and be horrified. But ex ante it is unknown how many observations have to be collected to achieve this level – it must be determined runtime.ini should include parameters. (omnetpp. and decide at runtime when enough data have been collected for the results to have reached the required accuracy. 170 . #! /bin/sh seedtool g 1 10000000 500 > seeds.ini .vec" ) > parameters./filesystem done done 8.OMNeT++ Manual – Configuring and Running Simulations ) >algorithms. this is neither simple (how do you know what is “long enough”?) nor practical (even with today’s high speed processors simulations of modest complexity can take hours. 10. do ( echo "[General]" echo "random-seed = ${seed}" echo "output-vector-file = xcube-${seed}. more precisely. The following code does 500 runs with independent seeds. when can we start collecting data? We usually do not want to include the initial transient when the simulation is still “warming up. can reach the required sample size to be statistically trustable. one has to carefully consider the following: • When is the initial transient over. One might just suggest to wait “very long” or “long enough”. and one may not afford multiplying runtimes by. so one run should not use more random numbers than this.”) If you need further convincing.10 8.9./xcube done 8.
the simulation would be sped up approximately in proportion to the number of processors used and sometimes even more. and writes a report of the results to the standard output. Akaroa2 decides by a given confidence level and precision whether it has enough observations or not. generating statistically equivalent streams of simulation output data. This process combines the independent data streams.10. see chapter 6). the needed simulation execution time is usually n times smaller compared to a one-processor simulation (the required number of observations are produced sooner). and calculates from these observations an overall estimate of the mean value of each parameter. When it judges that is has enough observations it halts the simulation.2 What is Akaroa Akaroa [EPM99] addresses the above problem. The OMNeT++ simulation must be configured in omnetpp. • On each host where you want to run a simulation engine. Then you use akrun to start a simulation. These data streams are fed to a global data analyser responsible for analysis of the final results and for stopping the simulation when the results reach a satisfactory accuracy. According to its authors. New Zealand and can be used free of charge for teaching and non-profit research activities. Collected data from the processes are sent to the akmaster process. akrun waits for the simulation to complete.10. Configuring OMNeT++ for Akaroa First of all. Akaroa (Akaroa2) is a “fully automated simulation tool designed for running distributed stochastic simulations in MRIP scenario” in a cluster computing environment. MRIP stands for Multiple Replications in Parallel. The independent simulation processes run independently of one another and continuously send their observations to the central analyser and control process. start akslave in the background.] where command is the name of the simulation you want to start. Parameters for Akaroa are read from the file named Akaroa in the working directory. You can place some of the output vectors under Akaroa control. If n processors are used. 171 . Thus.. The basic usage of the akrun command is: akrun -n num_hosts command [argument.e.ini so that it passes the observations to Akaroa. In MRIP. you have to compile OMNeT++ with Akaroa support enabled. you have to start up the system: • Start akmaster running in the background on some host. Akaroa was designed at the University of Canterbury in Christchurch. with the same parameters but different seed for the RNGs (random number generators)). The above description is not detailed enough help you set up and successfully use Akaroa – for that you need to read the Akaroa manual. 8. and when the required precision has been reached. The simulation model itself does not need to be changed – it continues to write the observations into output vectors (cOutVector objects.OMNeT++ Manual – Configuring and Running Simulations 8. akmaster tells the simulation processes to terminate.3 Akaroa Using Akaroa with OMNeT++ Before the simulation can be run in parallel under Akaroa. Each akslave establishes a connection with the akmaster. the computers of the cluster run independent replications of the whole simulation process (i. The results are written to the standard output.
foo” OMNeT++ detected that the module has used more stack space than it has allocated. ** wildcards here (see section 8... However.4.akaroa=true . and produce exactly the same results! Then you need to specify which output vectors you want to be under Akaroa control.sca).5. Your can prevent this from happening using the fname-append-host ini file entry: [General] fname-append-host=yes When turned on.g.11.vec. if you only want a few vectors be placed under Akaroa. via NFS or Samba) on all computers in the cluster.<vectorname>. see section 13.akaroa=false # catches everything not matched above Using shared file systems It is usually practical to have the same physical disk mounted (e. because all OMNeT++ simulation processes run with the same settings. 2 Akaroa’s RNG is a Combined Multiple Recursive pseudorandom number generator (CMRG) with a period of approximately 2191 random numbers. 172 .*. By default. you can use the following trick: <modulename>. all simulation processes would run with the same RNG seeds. all output vectors are under Akaroa control. the <modulename>. You can use the *.akaroa=false setting can be used to make Akaroa ignore specific vectors.OMNeT++ Manual – Configuring and Running Simulations You need to add the following to omnetpp. It is vital to obtain random numbers from Akaroa: otherwise. snapshot files). omnetpp. 8. output scalar. they would overwrite each other’s output files (e. The solution is to increase the stack for that module type. **.1 Typical problems Stack problems “Stack violation (FooModule stack too small?) in module bar. For example.2).3. and provides a unique stream of random numbers for every simulation engine. omnetpp.11 8.ini: [General] rng-class="cAkaroaRNG" outputvectormanager-class="cAkOutputVectorManager" These lines cause the simulation to obtain random numbers from Akaroa. 2 For more details on the plugin mechanism these settings make use of.<vectorname1>. it appends the host name to the names of the output files (output vector. and allows data written to selected output vectors to be passed to Akaroa’s global data analyser.<vectorname2>.g. You can call the stackUsage() from finish() to find out actually how much stack the module used.akaroa=true <modulename>.
but not the full 1MB is actually “committed”. the CreateFiber() Win32 API doesn’t allow the RSS to be specified. because physical memory is also a limiting factor). it is easy to run out of the 2GB possible address space (2GB/1MB=2048). This means that a 2GB address space will run out after 2048 fibers. 8MB). which is way too few. or on an existing executable using the editbin /stack utility. If you get the above message. This is the way simulation executable should be created: linked with the /stack:65536 option. Each fiber has its own stack. the default stack limit is 8192K (that is. You can do so in omnetpp. you won’t even be able to create this many fibers. For example. and about 48K when using Tkenv. You need to set a low (!) “reserved stack size” in the linker options.e. The more advanced CreateFiberEx() API which accepts RSS as parameter is unfortunately only available from Windows XP. (In practice.e.) “Segmentation fault” On Unix. i. and you can raise the allowed maximum stack size up to 64M.bar” The resolution depends on whether you are using OMNeT++ on Unix or on Windows.x. via the /stack linker option. plus the extra-stack-kb amount for Cmdenv/Tkenv – which makes about 16K with Cmdenv. see next section). The alternative is the stacksize parameter stored in the EXE header. Resource limits are inherited by child processes. fiber and thread stacks. I recommend to set it to a few K less than the maximum process stack size allowed by the operating system (ulimit -s. Therefore. and with 1MB being the default.4. A more detailed explanation follows. for example 64K (/stack:65536 linker flag) will do. reserved in the address space.ini: [General] total-stack-kb = 2048 # 2MB There is no penalty if you set total-stack-kb too high. including about 4000 dynamically created modules. which can be set via the STACKSIZE . For example. after applying the editbin /stacksize:65536 command to dyna.OMNeT++ Manual – Configuring and Running Simulations “Error: Cannot allocate nn bytes stack for module foo. The “reserved stack size” is an attribute in the Windows exe files’ internal header. The following sequence can be used under Linux to get a shell with 256M stack limit: 173 . This parameter specifies a common RSS for the main program stack.def file parameter. Windows. I was able to successfully run the Dyna sample with 8000 Client modules on my Win2K PC with 256M RAM (that means about 12000 modules at runtime. by default 1MB (this is the “reserved” stack space – i. Unfortunately. the 1MB reserved stack size (RSS) must be set to a smaller value: the coroutine stack size requested for the module. or with the editbin Microsoft utility. has physical memory assigned to it). you have to increase the total stack size (the sum of all coroutine stacks). It can be set from the linker. you may get a segmentation fault during network setup (or during execution if you use dynamically created modules) for exceeding the operating system limit for maximum stack size. in Linux 2. or the /stack:65536 parameter applied using editbin later. The ulimit shell command can be used to modify the resource limits. Unix. 64K should be enough.exe. You can use the opp_stacktool program (which relies on another Microsoft utility called dumpbin) to display reserved stack size for executables. if you set the total stack size higher. You need a low reserved stack size because the Win32 Fiber API which is the mechanism underlying activity() uses this number as coroutine stack size. $ ulimit -s 65500 $ ulimit -s 65500 Further increase is only possible if you’re root.
that is.. or trying to delete one for a second time. from the Tkenv menu. Tkenv increases the stack size of each module by about 32K so that user interface code that is called from a simple module’s context can be safely executed. (If the model is large. i. you should probably consider transforming (some of) your activity() simple modules to handleMessage(). If you’re leaking non-cObject-based objects or just memory blocks (structs. it you’re tight with memory. and reviewing the list in the dialog that pops up.so and the following line to /etc/security/limits. int/double/struct arrays. • crashes. 8. you cannot find them via Tkenv. section 8.. function.3. it is still possible you’re leaking other cObject-based objects.. you can switch to Cmdenv.) If the number of messages is stable. see e.11. you can change the limit in the PAM configuration files. Edit /usr/src/linux/include/linux/sched. 174 . You’ll probably need a specialized memory debugging tool like the ones described below. If you find that the number of messages is steadily increasing.conf: * hard stack 65536 A more drastic solution is to recompile the kernel with a larger stack limit. Both Tkenv and Cmdenv are able to display the number of messages currently in the simulation. it may take a while for the dialog to appear.h and increase _STK_LIM from (8*1024*1024) to (64*1024*1024). • heap corruption (enventually leading to crash) due to overrunning allocated blocks. In Redhat Linux (maybe other systems too). By far the most common ways leaking memory in simulation programs is by not deleting messages (cMessage objects or subclasses).e..d/login: session required /lib/security/pam_limits. Finally. etc..7. forgetting to delete objects or memory blocks no longer used. usually due to referring to an already deleted object or memory block. Cmdenv does not need that much extra stack. writing past the end of an allocated array.OMNeT++ Manual – Configuring and Running Simulations $ su root Password: # ulimit -s 262144 # su andras $ ulimit -s 262144 If you do not want to go through the above process at each login. Eventually.g. You can also find them using Tkenv’s Inspect|From list of all objects. You can do so by selecting Inspect|From list of all objects.2 Memory leaks and crashes The most common problems in C++ are associated with memory allocation (usage of new and delete): • memory leaks. you need to find where the message objects are. allocated by new). add the following line to /etc/pam. activity() does not scale well for large simulations.. Once you get to the point where you have to adjust the total stack size to get your program running.
the latter one has proved to be far more efficient than using any kind of memory debugger. MPatrol and dmalloc. MemProf. This is a commercial tool. Not particularly cheap. writing past the end of an allocated block. etc. Other good ones are NJAMD. or memory leaks). 3 The number one of these tools is Purify from Rational Software. The best seems to be Valgrind used by the KDE people. review it looking for bugs. Most of the above tools support tracking down memory leaks as well as detecting double deletion. you can use specialized tools to track them down. In my experience. but it has very good reputation and proved its usefulness many times.OMNeT++ Manual – Configuring and Running Simulations Memory debugging tools If you suspect that you may have memory allocation problems (crashes associated with double-deletion or accessing already deleted block. while ElectricFence seems to be included in most Linux distributions. There are several open source tools you can try. 3 Alternatively. you can go through the full code. 175 .
OMNeT++ Manual – Configuring and Running Simulations
176
OMNeT++ Manual – Network Graphics And Animation
Chapter 9
Network Graphics And Animation
9.1
9.1.1
Display strings
Display string syntax
Display strings specify the arrangement and appearance of modules in graphical user interfaces (currently only Tkenv): they control how the objects (compound modules, their submodules and connections) are displayed. Display strings occur in NED description’s display: phrases. The display string format is a semicolon-separated list of tags. Each tag consists of a key (usually one letter), an equal sign and a comma-separated list of parameters, like: "p=100,100;b=60,10,rect;o=blue,black,2" Parameters may be omitted also at the end and also inside the parameter list, like: "p=100,100;b=,,rect;o=blue,black" Module/submodule parameters can be included with the $name notation: "p=$xpos,$ypos;b=rect,60,10;o=$fillcolor,black,2" Objects that may have display strings are: • submodules – display string may contain position, arrangement (for module vectors), icon, icon color, auxiliary icon, status text, communication range (as circle or filled circle), etc. • connections – display string can specify positioning, arrow color, arrow thickness • compound modules – display string can specify background color, border color, border thickness • messages – display string can specify icon, icon color, etc. The following NED sample shows where to place display strings in the code. module ClientServer submodules: pc: Host; display: "p=66,55;i=comp"; // position and icon 177
OMNeT++ Manual – Network Graphics And Animation server: Server; display: "p=135,73;i=server1"; connections: pc.out --> server.in display "m=m,61,40,41,28"; // note missing ":" server.out --> pc.in display "m=m,15,57,35,69"; display: "o=#ffffff"; // affects background endmodule
9.1.2
Submodule display strings
The following table lists the tags used in submodule display strings: Tag p=xpos,ypos Meaning Place submodule at (xpos,ypos) pixel position, with the origin being the top-left corner of the enclosing module. Defaults: an appropriate automatic layout is where submodules do not overlap. If applied to a submodule vector, ring or row layout is selected automatically. Used for module vectors. Arranges submodules in a row starting at (xpos,ypos), keeping deltax distances. Defaults: deltax is chosen so that submodules do not overlap. row may be abbreviated as r. Used for module vectors. Arranges submodules in a column starting at (xpos,ypos), keeping deltay distances. Defaults: deltay is chosen so that submodules do not overlap. column may be abbreviated as col or c. Used for module vectors. Arranges submodules in a matrix starting at (xpos,ypos), at most itemsperrow submodules in a row, keeping deltax and deltay distances. Defaults: itemsperrow=5, deltax,deltay are chosen so that submodules do not overlap. matrix may be abbreviated as m. Used for module vectors. Arranges submodules in an ellipse, with the top-left corner of the ellipse’s bounding box at (xpos,ypos), with the width and height. Defaults: width,height are chosen so that submodules do not overlap. ring may be abbreviated as ri.
p=xpos,ypos,row,deltax
p=xpos,ypos,column,deltay
p=xpos,ypos,matrix, row,deltax,deltay
itemsper-
p=xpos,ypos,ring,width,height
178
OMNeT++ Manual – Network Graphics And Animation
p=xpos,ypos,exact,deltax,deltay
b=width,height,rect b=width,height,oval o=fillcolor,outlinecolor,borderwidth
i=iconname,color,percentage
is=size
i2=iconname,color,percentage
r=radius,fillcolor,color,width
q=queue-object-name
t=text,pos,color
Used for module vectors. Each submodule is placed at (xpos+deltax, ypos+deltay). This is useful if deltax and deltay are parameters (e.g.:”p=100,100,exact,$x,$y”) which take different values for each module in the vector. Defaults: none exact may be abbreviated as e or x. Rectangle with the given height and width. Defaults: width=40, height=24 Ellipse with the given height and width. Defaults: width=40, height=24 Specifies options for the rectangle or oval. For color notation, see section 9.2. Defaults: fillcolor=#8080ff (a lightblue), outlinecolor=black, borderwidth=2 Use the named icon. It can be colorized, and percentage specifies the amount of colorization. Defaults: iconname: no default – if no icon name is present, box is used; color: no coloring; percentage: 30% Specifies the size of the icon. size can be one of l, vl, s and vs (for large, very large, small, very small). If this option is present, size cannot be included in the icon name ("i=" tag) with the "i=<iconname>_<size>" notation. Displays a small "modifier" icon at the top right corner of the primary icon. Suggested icons are status/busy, status/down, status/up, status/asleep, etc. The arguments are analoguous with those of "i=". Draws a circle (or a filled circle) around the submodule with the given radius. It can be used to visualize transmission range of wireless nodes. Defaults: radius=100, fillcolor=none, color=black, width=1 (unfilled black circle) Displays the queue length next to submodule icon. It expects a cQueue object’s name (as set by the setName() method, see section 6.1.4). Tkenv will do a depth-first search to find the object, and it will find the queue object within submodules as well. Displays a short text by the icon. The text is meant to convey status information ("up", "down", "5Kb in buffer") or statistics ("4 pks received"). pos can be "l", "r" or "t" for left, right and top. Defaults: radius=100, pos="t", color=blue
Examples: "p=100,60;i=workstation" "p=100,60;b=30,30,rect;o=4" 179
1. see section 9. For color notation.1. with (0. Specifies the exact placement of the connection arrow. destpx.height. They can contain the following tags: Tag p=xpos.srcpy.o=blue.5 Message display strings Message objects do not store a display string by default.50. The arguments can be abbreviated as a.2.height.rect b=width.width Examples: "m=a. outlinecolor=black.3 Background display strings Compound module display strings specify the background. Defaults: color=black.e. srcpy.2. For color notation.w. see section 9. Display enclosing module as a rectangle with the given height and width.destpy Meaning Drawing mode. Defaults: width. destpy.4 Connection display strings Tags that can be used in connection display strings: Tag m=auto m=north m=west m=east m=south m=manual. Each value is a percentage of the width/height of the source/destination module’s enclosing rectangle.50 would connect the centers of the two module rectangles. Specifies the appearance of the arrow. Defaults: fillcolor=#8080ff (a lightblue). Thus.oval o=fillcolor.s.1. borderwidth=2 b=width. width=2 o=color.srcpx.destpx.ypos) pixel position. The manual mode takes four parameters that explicitly specify anchoring of the ends of the arrow: srcpx. but you can redefine the cMessage’s displayString() method and make it return one.OMNeT++ Manual – Network Graphics And Animation 9. Defaults: width. const char *CustomPacket::displayString() const 180 .0) being the top-left corner of the window.50. height are chosen automatically Specifies options for the rectangle or oval.outlinecolor.borderwidth 9.n.50. m=m. height are chosen automatically Display enclosing module as an ellipse with the given height and width.ypos Meaning Place enclosing module at (xpos. with the upper-left corner being the origin.3" 9.
1 Colors Color names Any valid Tk color specification is accepted: English color names (blue.rect.borderwidth Meaning Ellipse with the given height and width.height. lightgray. and percentage specifies the amount of colorization.OMNeT++ Manual – Network Graphics And Animation { return "i=msg/packet_vs".2.outlinecolor.15. #rrggbb format (where r. wheat) or #rgb. It can be colorized. borderwidth=1 Use the named icon. It is also possible to specify colors in HSB (hue-saturation-brightness) as @hhssbb (with h. 9.g. from white to bright red. The following tags can be used in message display strings: Tag b=width. Defaults: width=10. b being hex digits). Brightness of icon is also affected – to keep the original brightness. Examples: 181 .5" 9.2 Icon colorization The "i=" display string tag allows for colorization of icons. Defaults: fillcolor=red. in one of 8 basic colors (the color is determined as message kind modulo 8). For color notation. Defaults: width=10. color: no coloring.height.2 9. } This display string affects how messages are shown during animation. You can produce a transparent background by specifying a hyphen ("-") as color.percentage Examples: "i=penguin" "b=15. percentage: 30% i=iconname. a message kind dependent colors is used (like default behaviour). If color name is "kind". and message kind dependent coloring can also be turned off there.rect o=fillcolor. height=10 Rectangle with the given height and width. they are displayed as a small filled circle. height=10 Specifies options for the rectangle or oval. HSB makes it easier to scale colors e.b are hex digits). and with the message class and/or name displayed under it The latter is configurable in the Tkenv Options dialog. s. specify a color with about 50#008000 mid-green). outlinecolor=black.color.g. a small red solid circle will be used.o=white. By default.2. Percentage has no effect if the target color is missing.2. see section 9.kind. It accepts a target color and a percentage as the degree of colorization. Defaults: iconname: no default – if no icon name is present.oval b=width.
#808080. protocols.symbolic icons for various devices • place/ . adding a line export OMNETPP_BITMAP_PATH="/home/you/bitmaps.3.icons that can be used for messages 182 .0. 9. etc. on Windows. As people usually run simulation models from the model’s directory. The default bitmap path is compiled into GNED and Tkenv with the value "omnetpp-dir/bitmaps. 9.gold" creates a gold server icon • "i=place/globe./bitmaps" – which will work fine as long as you don’t move the directory.bashrc or /. • abstract/ . You can also add to the bitmap path from omnetpp. building.subnet. with the bitmap-path setting: [Tkenv] bitmap-path = "/home/you/model-framework/bitmaps. Both the GNED editor and Tkenv need the exact location of this directory to load the icons. if you’re using the bash shell.white. which will result in the rest of the directories being ignored. city. These categories include: • block/ . represented by folders. town.1 The icons The bitmap path In the current OMNeT++ version. a semicolon-separated list of directories.OMNeT++ Manual – Network Graphics And Animation • "i=device/server.bash_profile will do./home/you/extra-bitmaps" The value should be quoted. otherwise the first semicolon separator will be interpreted as comment sign..network devices: servers. The compiled-in bitmap path can be overridden with the OMNETPP_BITMAP_PATH environment variable. environment variables can be set via the My Computer –> Properties dialog. routers. Icons are loaded from all directories in the bitmap path. The icons shipped with OMNeT++ are in the bitmaps/ subdirectory./bitmaps" to /.ini.. and you’ll also be able to load more icons from the bitmaps/ subdirectory of the current directory. The way of setting environment variables is system specific: in Unix.3.2 Categorized icons Since OMNeT++ 3. map symbols • msg/ .3 9. this practically means that custom icons placed in the bitmaps/ subdirectory of the model’s directory are automatically loaded.100" yields a "burnt-in" black-and-white icon Colorization works with both submodule and message icons. icons are organized into several categories. etc). hosts.100" makes the icon grayscale • "i=block/queue.icons for subcomponents (queues. module icons are GIF files. • device/ .
The algorithm doesn’t move any module which has fixed coordinates. small. using a variation of the SpringEmbedder algorithm. ring or other arrangements (defined via the 3rd and further args of the "p=" tag) will be preserved – you can think about them as if those modules were attached to a wooden framework so that they can only move as one unit. we don’t want to move that one). There is also friction built in. Caveats: • If the full graph is too big after layouting. Larger networks usually produce satisfactory results. <edgelen>=40. and these icons can be referenced from display strings by naming the subdirectory (subdirectories) as well: "subdir/icon". row. You can load any of your existing NED files. 9. SpringEmbedder is a graph layouting algorithm based on a physical model.<attraction>=0. especially when the number of submodules is small.e.<maxiter>=500. OMNeT++ tries it as "old/icon" as well. edit the 183 . you can specify a sufficiently large bounding box in the background display string. "subdir/subdir2/icon". In display strings.3 Icon size Icons come in various sizes: normal. very small.random number seed) can be specified via the "l=" background display string tag. _vs. The physical rules above have been slightly tweaked to get better results. in order to prevent oscillation of the nodes.3. unless it contains any fixed-position module. For compatibility. so longish modules (such as an Ethernet segment) may produce funny results. Predefined row. subdirectory) name. and connections are sort of springs which try to contract and pull the nodes they’re attached to. Its current arguments are (with default values): "l=<repulsion>=10. The layouting algorithm simulates this physical system until it reaches equilibrium (or times out). 9. if the display string contains a icon without a category (i. matrix. Sizes are encoded into the icon name’s suffix: _l. _s. or the "is" (icon size) display string tag ("i=device/router.0) icons are in the old/ folder. it is scaled back so that it fits on the screen. • Size is ignored by the present layouter. etc.OMNeT++ Manual – Network Graphics And Animation Old (pre-3. "b=2000.is=l"). ring. Parameters to the layouter algoritm (repulsive/attractive forces. number of iterations. Tkenv and GNED now load icons from subdirectories of all directories of the bitmap path. large. • The algorithm is prone to produce erratic results. (For obvious reasons: if there’s a module with manually specified position. one can either use the suffix ("i=device/router_l"). GNED works directly with NED files – it doesn’t have any internal file format. Graph nodes (modules) repent each other like electric charges of the same sign. The "l=" tag is somewhat experimental and its arguments may change in further releases. etc) layouts.3. 9.3000".<rngseed>". Modules which have not been assigned explicit positions via the "p=" tag will be automatically placed by the algorithm.4 Layouting OMNeT++ implements an automatic layouting feature. or when using predefined (matrix. The "Re-layout" toobar button can then be very useful. To prevent rescaling. e.g.5 GNED – Graphical NED Editor The GNED editor allows you to design compound modules graphically.
gates. connections. Changing colors. While editing the graphics.popup menu tion: Double-click on submodule: go into submodule Click name label edit name Drag&drop module type from the tree view create a submodule of that type to the canvas Mouse 9. or text may convey status change. the graphics will be totally reconstructed from the NED source and the display strings in it. you can call the module’s displayString() method: 184 . One consequence of this is that indentation will be “canonized”. GNED is a fully two-way visual tool.6. Comments in the original NED are preserved – the parser associates them with the NED elements they belong to. so comments won’t be messed up even if you edit the graphical representation extensively by removing/adding submodules. To get a pointer to the cDisplayString object. edit in there and switch back to graphics. and regenerating the NED text when you save the file.OMNeT++ Manual – Network Graphics And Animation compound modules in it graphically and then save the file back. cDisplayString also lets you manipulate the string. networks etc. Other components in the NED file (simple modules. parameters.: add to selection Click in empty area: clear selection Drag a selected object: move selected objects Drag submodule or connection: move it Drag either end of connection: move that end Drag corner of (sub)module: resize module Drag starting in empty area: select enclosed submodules/connections Del key delete selected objects Both editing modes: Right-click on module/submodule/connec. Your changes in the NED source will be immediately backparsed to graphics. icon. you can always switch to NED source view. 9. in fact. The mouse bindings are the following: Effect In draw mode: Drag out a rectangle in empty area: create new submodule Drag from one submodule to another: create new connection Click in empty area: switch to select/move mode In select/move mode: Click submodule/connection: select it Ctrl-click submodule/conn.6 9. channels.5.1 Enhancing animation Changing display strings at runtime Often it is useful to manipulate the display string at runtime. Display strings are stored in cDisplayString objects inside modules and gates. etc.1 Keyboard and mouse bindings In graphics view. and changing a module’s position is useful when simulating mobile networks. GNED works by parsing your NED file into an internal data structure.) will survive the operation. there are two editing modes: draw and select/mode. GNED puts all graphics-related data into display strings.
it is recommended to make these calls conditional on ev..2. The class facilitates tasks such as finding out what tags a display string has. The ev.3").2 Bubbles Modules can let the user know about important events (such as a node going down or coming up) by displaying a bubble with a short message ("Going down".2.0. it merely parses the string as data elements separated by semicolons.0.OMNeT++ Manual – Network Graphics And Animation cDisplayString *dispStr = displayString(). dispStr->setTagArg("x". "Coming up".6.jim.isGUI()) bubble("Going down!").p=beta. An example: dispStr->parse("a=1.isGUI() call returns false when the simulation is run under Cmdenv.3" 9."jim").p=alpha. dispStr->setTagArg("p". so one can make the code skip potentially expensive display string manipulation. dispStr->insertTag("x").) This is done by the bubble() method of cModule.125.. if (ev.isGUI(). equal signs and commas. adding new tags.a=1. etc.2. The internal storage method allows very fast operation. The class doesn’t try to interpret the display string in any way. dispStr->setTagArg("x". adding arguments to existing tags. As far as cDisplayString is concerned. ev << dispStr->getString(). zero or more arguments separated by commas.. it will generally be faster than direct string manipulation. An example: bubble("Going down!")."joe"). "p=100. cDisplayString *gateDispStr = gate("out")->displayString()."beta"). // result: "x=joe. cDisplayString *bgDispStr = parentModule()->backgroundDisplayString(). If the module contains a lot of code that modifies the display string or displays bubbles. and each tag has a name and after an equal sign. a display string (e. 185 .g. removing tags or replacing arguments.i=cloud") is a string that consist of several tags separated by semicolons. The method takes the string to be displayed as a const char * pointer. nor does it know the meaning of the different tags.
OMNeT++ Manual – Network Graphics And Animation 186 .
link utilization. by cOutVector objects (see section 6. queue lengths. they can do density estimation by calculating histograms etc. You can save the graphs to files (as Encapsulated Postscript or raster formats such as GIF) with a click. in omnetpp. you’ll get output vector files as a result of a simulation.1 Output vectors Output vectors are time series data: values with timestamps. 10. Plove automatically reads the .OMNeT++ Manual – Analyzing Simulation Results Chapter 10 Analyzing Simulation Results 10. and how to process it. You can use output vectors to record end-toend delays or round trip times of packets.1). you can also copy the graph to the clipboard in a vector format (Windows metafile) and paste it into other applications. You can use Plove to look into the output vector files and plot vectors from them.0. queueing times.ini you can disable vectors or specify a simulation time interval for recording (see section 8. the number of dropped packets. 187 . All cOutVector objects write to the same. Plove is a handy tool for plotting OMNeT++ output vectors. titles and labels.ploverc file in your home directory. Output vectors are recorded from simple modules. etc. smoothing. Filters can do averaging. The following sections describe the format of the file. common file. truncation of extreme values.9. dots etc) for each vector can be set as well as the most frequent drawing options like axis bounds. Plove has been a front-end to gnuplot. Data written to cOutVector objects from simple modules are written to output vector files. and you can create new filters by parameterizing and aggregating existing ones.1. The file contains general application settings.1 Plotting output vectors with Plove Plove features Typically. including the custom filters you created. scaling. – anything that is useful to get a full picture of what happened in the model during the simulation run. 1 Note: prior to OMNeT++ 3. Some filters are built in. On Windows. but it is still available in the OMNeT++ source distribution. Line type (lines. Since output vectors usually record a large amount of data.5). On startup. You can apply several filters to a vector. 1 Filtering the results before plotting is possible. This older version of Plove is no longer supported.
and its columns are: vector Id. you load an output vector file (. 10. F4. As the first step.895 1 14.1.OMNeT++ Manual – Analyzing Simulation Results Usage First. Actual data recorded in this vector are on data lines which begin with the vector Id.vec: vector 1 1 12. you’ll probably want to automate processing of the output vector files.086 2 24.vec Or. and multiplicity (usually 1). To adjust drawing style.66664666 "subnet[4]. A vector declaration line introduces a new output vector. module of creation. you can get the list of all vectors in the file by typing: 188 . and ctrl+left click selects/deselects individual items. The file is textual. This works for several selected vectors too. name of cOutVector object. delete vectors you don’t want to deal with. You can copy vectors from the left pane to the right pane by clicking the button with the right arrow icon in the middle. F8. OMNeT++ lets you use any tool you see fit for this purpose.. click the Options.66666666 4577.2 Format of output vector files An output vector file contains several series of data produced during simulation. button.960 1 23. grey ’+’ and grey ’*’. Selection works as in Windows: dragging and shift+left click selects a range.srvr" "queue length" 1 2. you can put it back into the left pane for storage. and it looks like this: mysim.3 Working without Plove In case you have a large number of repeated experiments.63663666 2355. The PLOT button will initiate plotting the selected vectors in the right pane. 10.term[12]" "response time" 2355.126 vector 2 2 16.. The left pane works as a general storage for vectors you’re working with. You can find the appropriate vector line with a text editor or you can use grep for this purpose: % grep "queue length" vector. octave. F6.66666666 8. F5. you must find out the Id of the vector. Further columns on data lines are the simulation time and the recorded value.1.026 "subnet[4].00000000000. Plove accepts nc/mc-like keystrokes: F3.44766536 1 There two types of lines: vector declaration lines (beginning with the word vector).vec) into the left pane. awk.00000000000. because the output vector files are text files and their format is simple enough to be processed by common tools such as perl. If you set the right options for a vector but temporarily do not want it to hang around in the right pane. Extracting vectors from the file You can use the Unix grep tool to extract a particular vector from the file. rename them etc. you can duplicate vectors if you want to filter the vector and also keep the original. (Plove never modifies the output vector files themselves. You can load several vector files. change vector title or add a filter. These changes will not affect the vector files on disk. etc. and data lines.) In the right pane.
which is 6 in this case.2. with code like this: void EtherMAC::finish() { 189 .960 2.086 2355. to compare model behaviour under various parameter settings. and grep the file for the vector’s data lines: grep ^6 vector. output scalars are more useful.vec would create the files mysim1.026 8.2 Scalar statistics Output vectors capture the transient behaviour of the simulation run.126 4577.vec contains the appropriate vector. This problem is eliminated by the OMNeT++ splitvec utility (written in awk).vec This will output the appropriate vector line: vector 6 "subnet[4].term[12]" 12. However.00000000000. vector6.vec > vector6. Using splitvec The splitvec script (part of OMNeT++) automates the process described in the previous section: it breaks the vector file into several files which contain one vector each.vec etc.vec Now. into spreadsheets or other programs (10.44766536 1 As you can see.895 2355.srvr" "queue length" 16. The only potential problem is that the vector Id is there at the beginning of each line and this may be hard to digest for some programs that you use for postprocessing and/or visualization.vec. usually from the finish() methods of modules. the vector Id column has been stripped from the files.OMNeT++ Manual – Analyzing Simulation Results % grep ^vector vector.66664666 23.3). mysim2. 10.63663666 24.00000000000. to be discussed in the next section. with contents similar to the following: mysim1. The resulting files can be directly loaded e.srvr" "queue length" 1 Pick the vector Id.vec: # vector 2 "subnet[4].66666666 14.g.1 Format of output scalar files Scalar results are recorded with recordScalar() calls. The command % splitvec mysim.66666666 "response time" 1 mysim2.vec: # vector 1 "subnet[4]. 10.
] 235.mac" scalar "lan. numBytesReceivedOK). 8*numBytesSent/t).mac" scalar "lan.mac" scalar "lan. numFramesReceivedOK). recordScalar("rx channel idle (%)". "simulated time" "rx channel idle (%)" "rx channel utilization (%)" "rx channel collision (%)" "frames sent" "frames rcvd" "bytes sent" "bytes rcvd" "frames/sec sent" "frames/sec rcvd" "bits/sec sent" "bits/sec rcvd" "simulated time" "rx channel idle (%)" "rx channel utilization (%)" "rx channel collision (%)" "simulated time" "rx channel idle (%)" "rx channel utilization (%)" "rx channel collision (%)" 120.011312 run 2 "lan" scalar "lan.hostA. 190 .hostA. if (t==0) return. creating x-y plots (offered load vs throughput-type diagrams).] numFramesSent).40820676 0. recordScalar("collisions". numBytesSent).011312 99 3088 64869 3529448 0.mac" [. recordScalar("bits/sec sent". 8*numBytesReceivedOK/t)...mac" scalar "lan. recordScalar("bytes sent". t).hostC.hostC. recordScalar("frames sent".hostA.249243 97. recordScalar("bits/sec rcvd"..hostB.mac" scalar "lan. } The corresponding output scalar file (by default.hostA.mac" scalar "lan.mac" scalar "lan. recordScalar("bytes rcvd". numFramesSent/t).mac" scalar "lan.hostB. numCollisions).mac" scalar "lan.hostA.mac" "simulated time" [. omnetpp.823290006 25. several simulation runs can record their results into a single file – this facilitates comparing them.mac" scalar "lan. recordScalar("frames/sec rcvd".hostA. recordScalar("simulated time". 100*totalSuccessfulRxTxTime/t).hostA.] scalar "lan.6799953 4315.hostB.hostB.hostA.mac" scalar "lan.mac" scalar "lan.hostA. standard deviation. recordScalar("frames/sec sent".sca) will look like this: run 1 "lan" scalar "lan.83 120.011312 120.mac" [.5916992 2. recordScalar("frames rcvd". 100*totalChannelIdleTime/t). 100*totalCollisionTime).5916992 2.mac" scalar "lan..) In addition.hostA.hostA.hostA.40820676 0.hostC. (If you record statistics objects (cStatictic subclasses such as cStdDev) via their recordScalar() methods.mac" scalar "lan.63632 234808.OMNeT++ Manual – Analyzing Simulation Results double t = simTime().hostA.. recordScalar("rx channel collision (%)". numFramesReceivedOK/t).249243 97. recordScalar("rx channel utilization (%)". they’ll generate several lines: mean. etc.mac" scalar "lan.40820676 0.mac" scalar "lan. etc.hostC.249243 97..5916992 2.mac" scalar "lan.678665 Every recordScalar() call generates one "scalar" line in the file.mac" scalar "lan.
but there is a Windows version. The bar chart toolbar button creates – well – a bar chart in a new window.000. Alternatively.64. ROOT and PlotMTV. Other. You load the appropriate file by selecting it in a dialog box. etc. ** wildcards.. correlation. MIF. and is distributed under a BSD-like license. they can also create various plots. too. It is probably harder to get started using ROOT than with either Gnuplot or Grace. but the number of rows is usually limited to about 32.2.sca file. run number.000.2 ROOT ROOT is a powerful object-oriented data analysis framework. ROOT was developed at CERN. You can copy the selected rows to the clipboard by Edit|Copy or the corresponding toolbar button. You can open a scalar file either from the Scalars program’s menu or by specifying it as a command-line argument to Scalars. The program displays the data in a table with columns showing the file name.. There are also open-source programs directly for plotting. It can draw bar charts. as PostScript.3. etc. histogram). and the value.) One straightforward solution is to import or paste them into spreadsheet programs such as OpenOffice Calc. It was developed for Unix. SVG. fitting.OMNeT++ Manual – Analyzing Simulation Results 10. a “C/C++ interpreter” aimed at processing C/C++ scripts. with strong support for plotting and graphics in general. GIF.5. As of June 2003. JPEG and PNG formats. Gnuplot still being the most commonly used one. (The filters also accept *. Grace 1. PNM. but if you are serious about analysing 191 . In addition to their support for statistical computations. module name where it was recorded.g. a successor of ACE/gr or Xmgr) is a GPL-ed powerful data visualization program with a WYSIWIG point-and-click graphical user interface.g. x-y plots (e.1 Grace Grace (also known as xmgrace.) You could actually load further scalar files into the window. throughput vs offered load). ROOT is based on CINT.2 The Scalars tool The Scalars program can be used to visualize the contents of the omnetpp.g. and paste them e. Matlab or the statistics package R. It can also be exported to EPS. one can use numerical packages such as Octave. MS Excel or Gnumeric. in various image formats. It has many useful features like built-in statistics and analysis functions (e. into OpenOffice Calc.12 can export graphics to (E)PS. and it also sports its own built-in programming language. 10.3. You can customize the chart by right-clicking on it and choosing from the context menu. These programs can produce output in various forms (on the screen. or export data via the clipboard for more detailed analysis into spreadsheets or other programs. splines. There’re usually too many rows to get an overview. Gnumeric or MS Excel. and thus analyse them together. 10. PDF. 10.3 Analysis and visualization tools Output vector files (or files produced by splitvec) and output scalar files can be analysed and/or plotted by a number of applications in addition to Plove and Scalars. or as metafile via the Windows clipbard (the latter is not available on Unix of course). so you can filter by choosing from (or editing) the three combo boxes at the top. potentially more powerful ones include Grace. These programs have good charting and statistical features. The icon bar and menu commands can be used to customize the graph.
stanford. Gnuplot can also plot 3D graphs. you can type: plot "mysim1.3 Gnuplot Gnuplot has an interactive command interface.slac.2] replot Several commands are available to adjust ranges.vec" with lines.edu/ curt/omnet++/) shows examples what you can achieve using ROOT with OMNeT++. you can copy the resulting graph to the clipboard from the Gnuplot window’s system menu. you will find that ROOT provides power and flexibility that would be unattainable the other two programs.vec (produced by splitvec) plotted in the same graph. 10.3. On Windows. you would type: set yrange [0:1. labels. To plot the data in mysim1. "mysim4. Curt Brune’s page at Stanford (. Gnuplot is available for Windows and other platforms.vec and mysim4.OMNeT++ Manual – Analyzing Simulation Results simulation results. plotting style. then insert it into the application you are working with.vec" with lines To adjust the y range. 192 . scaling etc.
the result is an easily browsable and very informative presentation of the source code.1 Authoring the documentation Documentation comments Documentation is embedded in normal comments. Still. Javadoc and Doxygen use special comments (those beginning with / **. The documentation also includes clickable network diagrams (exported via the GNED graphical editor) and module usage diagrams as well as inheritance diagrams for messages. 1 Example: // // An ad-hoc traffic generator to test the Ethernet models. // destination MAC address protocolId: numeric. and presents their details including description. one still has to write documentation comments in the code. parameters. Like Javadoc and Doxygen.2. gates. opp_neddocgenerated documentation lists simple and compound modules. 11. All // comments that are in the “right place” (from the documentation tool’s point of view) will be included in the generated documentation. extract-private and extract-static). In OMNeT++ there’s no need for that: NED and the message syntax is so compact that practically all comments one would want to write in them can serve documentation purposes. // mean for exponential interarrival times gates: 1 In contrast. ///. which means that it can hyperlink simple modules and message classes to their C++ implementation classes in the Doxygen documentation. //< or a similar marker) to distinguish documentation from “normal” comments in the source code. // value for SSAP/DSAP in Ethernet frame waitMean: numeric. // simple Gen parameters: destAddress: string. combined with extract-all. there is a way to write comments that don’t make it into the documentation – by starting them with //#.2 11. 193 . unassigned submodule parameters and syntax-highlighted source code. opp_neddoc makes use of source code comments. Of course.OMNeT++ Manual – Documenting NED and Messages Chapter 11 Documenting NED and Messages 11. opp_neddoc works well with Doxygen.1 Overview OMNeT++ provides a tool which can generate HTML documentation from NED files and message definitions. If you also generate the C++ documentation with some Doxygen features turned on (such as inline-sources and referenced-by-relation.
and can be used to comment out unused NED code or to make “private” comments like FIXME or TBD. // simple Sink parameters: // You can turn statistics generation on and off.2. like in LaTeX or Doxygen. Processing of frames received from higher layers: . Example: // // // // // // Ethernet MAC layer.this is done by higher layers. -. // mean for exponential interarrival times gates: out: out. gates: in: in. 194 .OMNeT++ Manual – Documenting NED and Messages out: out. endsimple // to Ethernet LLC You can also place comments above parameters and gates. Lines beginning with ‘-’ will be turned into bulleted lists. // value for SSAP/DSAP in Ethernet frame //# burstiness: numeric. MAC performs transmission and reception of frames. Paragraphs are separated by empty lines.sends out frame to the network . //# FIXME above description needs to be refined // simple Gen parameters: destAddress: string.not yet supported waitMean: numeric. // to Ethernet LLC endsimple 11.no encapsulation of frames -. and lines beginning with ‘-#’ into numbered lists.2 Text layout and formatting If you write longer descriptions. Text formatting works like in Javadoc or Doxygen – you can break up the text into paragraphs and create bulleted/numbered lists without special commands. This is // a very long comment because it has to be described what // statistics are collected (or not). // destination MAC address protocolId: numeric. you’ll need text formatting capabilities. and use HTML for more fancy formatting. This is useful if they need long explanations. Those lines will be ignored by the documentation generation. // // An ad-hoc traffic generator to test the Ethernet models. statistics: bool. Example: // // Deletes packets and optionally keeps statistics. begin it with //#. endsimple If you want a comment line not to appear in the documentation.
<center>. <what>bar</what> will be rendered literally as “<what>bar</what>” (unlike HTML where unknown tags are simply ignored.> tag to create links within the page: // // // // // // See the <a href="#resources">resources</a> in this page. // You can also use the <a href=. <table>..2.>. <body>.. Supported frame types: -# IEEE 802. The most useful of these tags are: <i>. <i>.. If you insert links to external pages (web sites).org/" target="_blank">IEEE 802 // Committee’s site</a>... <sub>.ieee802. you can use the<b>Resources</b></a> . <br>. <caption>.. <input>. An example usage: // // @author Jack Foo // @date 2005-02-11 // 11. The complete list of HTML tags interpreted by opp_neddoc are: <a>.3 Special tags OMNeT++_neddoc understands the following tags and will render them accordingly: @author. <dfn>. <dl>. @warning.</a> (link). <sub>. PAUSE is not implemented yet.</sub> (subscript). <ul>. <code>.. @see. <tt>. <h2>. <sup>. <sup>.</i> (italic). <ol>. @since.. @bug... <img>. see the // <a href=" Manual – Documenting NED and Messages // // // // // // // . <var>.</tt> (typewriter font)... (Alternatively. <dt>.. @version. <td>.4 Additional text formatting using HTML Common HTML tags are understood as formatting commands. i. <kbd>. Any tags not in the above list will not be interpreted as formatting commands but will be printed verbatim – for example. <small>. used in switches). @todo. <br> (line break). <multicol>.2. For example. <p>. <h3> (heading). <b>. . <h1>. <span>. <em>. <tr>.can send PAUSE message if requested by higher layers (PAUSE protocol.</b> (bold). Examples: // // For more info on Ethernet and other LAN standards. <hr>. its useful to add the target="_blank" attribute to ensure pages come up in a new browser window and not just in the current frame which looks awkward. @date.
2. i<10. 11. will be rendered as “Use the <i> tag (like <i>this</i>) to write in italic.. } </pre> will be rendered as // my preferred way of indentation in C/C++ is this: for (int i=0. but HTML tags continue to be interpreted (or you can turn them off with <nohtml>.</nohtml> tag. Example: // // // // // // // <pre> // my preferred way of indentation in C/C++ is this: <b>for</b> (<b>int</b> i=0.OMNeT++ Manual – Documenting NED and Messages You can use the <pre>..5 Escaping HTML tags Sometimes may need to off interpreting HTML tags (<i>.” <nohtml>. Prefixing the word with a backslash will achieve the same. i<10. i). etc.) as formatting instructions. <b>. either of the following will do: 196 . see later). } HTML is also the way to create tables. i++) { printf(<i>"%d\n"</i>.</nohtml> will also prevent opp_neddoc from hyperlinking words that are accidentally the same as an existing module or message name.. i). Line breaks and indentation will be preserved. i++) { printf("%d\n". and rather you want them to appear as literal <i>. That is.. // Use the <nohtml><i></nohtml> tag (like <tt><nohtml><i>this</i></nohtml><tt>) // to write in <i>italic</i>. For example.. You can achieve this via surrounding the text with the <nohtml>. <b> texts in the documentation.</pre> HTML tag to insert souce code examples into the documentation.
or b) after the documented item.. endsimple Do not try to comment groups of parameters together. Example: // // // // // // // @titlepage <h1>Ethernet Model Documentation</h1> This documents the Ethernet model created by David Wu and refined by Andras Varga at CTIE.. but is separated from the first import. This is a) above the documented item. The directive to be used is @page.6 Where to put comments You have to put the comments where nedtool will find them.</h1> HTML tag to define a title. // In \IP networks.. on the same line. and it can appear in any file-level comment (see above). 11. module. 11.2.7 Customizing the title page The title page is the one that appears in the main frame after opening the documentation in the browser. The result will be awkward. channel. etc.2. routing is. Australia.. but it is probably a good idea to create a separate index. If you put it above. routing is.ned file for it. 197 . You can use the <h1>. By default it contains a boilerplate text with the generic title “OMNeT++ Model Documentation”.2.. The lines you write after the @titlepage line up to the next @page line (see later) or the end of the comment will be used as the title page. definition by at least one blank line)... make sure there’s no blank line left between the comment and the documented item. Monash University. Blank lines detach the comment from the documented item. 11. You can supply your own version of the title page adding a @titlepage directive to a file-level comment (a comment that appears at the top of a NED file. In theory you can place your title page definition into any NED or MSG file. You probably want to customize that. Example: // This is wrong! Because of the blank line. You probably want to begin with a title because the documentation tool doesn’t add one (it lets you have full control over the page contents). this comment is not // associated with the following simple module! simple Gen parameters: . Melbourne.8 Adding extra pages You can add new pages to the documentation in a similar way as customizing the title page. and at least change the title to the name of the documented simulation model.OMNeT++ Manual – Documenting NED and Messages // In <nohtml>IP</nohtml> networks. Both will prevent hyperlinking the word IP if you happen to have an IP module in the NED files.
.">.. The @externalpage directive is similar in syntax @page: // @externalpage filename. Title of the Page The documentation tool does not check if the page exists or not.. The <tt>examples/</tt> directory.2.html">here</a>. 11. The lines after the @page line up to the next @page line or the end of the comment will be used as the page body.9 Incorporating externally created pages You may want to create pages outside the documentation tool (e..">. This is possible.OMNeT++ Manual – Documenting NED and Messages The syntax of the @page directive is the following: // @page filename.. You can create links to the generated pages using standard HTML. using a HTML editor) and include them in the documentation.html). // The structure of the model is described <a href="structure. and they will be added to the page index... using the <a href="... all you have to do is declare such pages with the @externalpage directive in any of the NED files. All HTML files are placed in a single directory... Examples .html. @page examples. so you don’t have to worry about specifying directories.</a> tag. Example: // // // // // // // // // // @page structure. The pages can then be linked to from other pages using the HTML <a href=".3 Invoking opp_neddoc The opp_neddoc tool accepts the following command-line options: opp_neddoc .g. Directory Structure The model core model files and the examples have been placed into different directories.html.. part of OMNeT++ (c) 2003-2004 Andras Varga 198 ..html.html.NED and MSG documentation tool. // 11.</a> tag. The page title you supply will appear on the top of the page as well as in the page index. You don’t need to add a title because the documentation tool automatically adds one. Title of the Page Please choose a file name that doesn’t collide with the files generated by the documentation tool (such as index. Example: // // @titlepage // . It is your responsibility to copy them manually into the directory of the generated documentation and then to make sure the hyperlinks work..
e.g. -a. Usage: opp_neddoc options files-or-directories . <filename> specifies name of XML tag file generated by Doxygen -d <dir>. file names are handled case sensitively.msg files are collected (e.ned and *. --no-diagrams do not generate usage and inheritance diagrams -z. --help displays this help text Files specified as arguments are parsed and documented.ned and *.xml can be used to generate other documentation that refers to pages in this documentation via HTML links. 199 .msg files under them (in that directory subtree) are documented. gned also exports an images.. --no-figures do not generate diagrams -p.ned does NOT process files in foo/bar/ or any other subdirectory.msg files. --debug print invocations of external programs and other info -h. Bugs: (1) handles only files with . other files are silently ignored.ned and . Wildcards are accepted and they are NOT recursive.1 Multiple projects The generated tags.g.3.ned and .msg files recursively (’opp_neddoc -a’ is equivalent to ’opp_neddoc . (2) does not filter out duplicate files (they will show up multiple times in the documentation). --doxytagfile <filename> turn on generating hyperlinks to Doxygen documentation. 11. nedtool parses them and outputs the resulting syntax tree in XML – a single large XML file which contains all files. 11.xml file which describes which image was generated from which compound module.4 How does opp_neddoc work? *. -t option must also be present to turn on linking to Doxygen. Default: .OMNeT++ Manual – Documenting NED and Messages Generates HTML model documentation from ./html -t <filename>./api-doc/html -n. --silent suppress informational messages -g. --all process all *. The *. (3) on Windows. relative to the opp_neddoc output directory (-o option). For directories as arguments. foo/*.’) -o <dir> output directory. via the find command if you used the -a option on Unix) and processed with nedtool.. --no-unassigned-pars do not document unassigned parameters -x.ned files are processed with the -c (export-diagrams-and-exit) option of gned. This causes gned to export diagrams for the compound modules in Postscript. defaults to . all . Postscript files are then converted to GIFs using convert (part of the ImageMagick package).msg extensions.. --doxyhtmldir <dir> directory of Doxygen-generated HTML files.ned and . and also contains additional info (coordinates of submodule rectangles and icons in the image) for creating clickable image maps. --no-source do not generate source code listing -s.
or text) document. 200 . let alone regular expressions. XSLT is a very powerful way of converting an XML document into another XML (or HTML. channel. the comments in the generated HTML file are processed with a perl script. The perl script also performs syntax hightlighting of the source listings in the HTML. comment formatting and source code coloring whould have been very difficult to achieve from XSLT. Additionally. so that external documentation can link to this one. the stylesheet reads images.xml and uses its contents to make the compound module images clickable. As a final step.0 version of XSLT will improve on this. which (at least in its 1. names. Perhaps the 2.) The whole process is controlled by the opp_neddoc script. (Not even simple find/replace is supported in strings. etc.OMNeT++ Manual – Documenting NED and Messages The XML file containing parsed NED and message files is then processed with an XSLT stylesheet to generate HTML.xml file for the latter task.html file.0 version of the standard) completely lacks powerful string manipulation functions.) This last step.xml file which describes what is documented in which . The stylesheet also outputs a tags. (It uses the info in the tags. and puts hyperlinks on module. message.
Conservative algorithms prevents incausalities from happening. we’ll need the following variables: 201 . For parallel execution. but detects and repairs them. implementing optimistic synchronization in OMNeT++ would require – in addition to a more complicated simulation kernel – writing significantly more complex simple module code from the user. There are two broad categories of parallel simulation algorithms that differ in the way they handle causality problems outlined above: 1. 2. The following paragraphs provide a brief picture of the problems and methods of parallel discrete event simulation (PDES). the model is to be partitioned into several LPs (logical processes) that will be simulated independently on different hosts or processors. Optimistic synchronization may be slow in cases of excessive rollbacks. Without synchronization. Optimistic synchronization allows incausalities to occur. a message sent by one LP could arrive in another LP when the simulation time in the receiving LP has already passed the timestamp (arrival time) of the message. The Null Message Algorithm exploits knowledge of the time when LPs send messages to other LPs. because it requires periodic state saving and the ability to restore previous states. 12. Each LP will have its own local Future Event Set. Interested readers are strongly encouraged to look into the literature. Conservative simulation tends to converge to sequential simulation (slowed down by communication between LPs) if there’s not enough parallelism in the model. it may advance until t + ∆t without the need for external synchronization. or parallelism is not exploited by sending a sufficient number of ‘null’ messages. and uses ‘null’ messages to propagate this information to other LPs.OMNeT++ Manual – Parallel Distributed Simulation Chapter 12 Parallel Distributed Simulation 12. sending out anti-messages to cancel messages sent out during the period that is being rolled back. This would break causality of events in the receiving LP. Optimistic synchronization is extremely difficult to implement. etc.1 Introduction to Parallel Discrete Event Simulation OMNeT++ supports parallel execution of large simulations. thus they will maintain their own local simulation times. If an LP knows it won’t receive any messages from other LPs until t + ∆t simulation time. In any case.2 Assessing available parallelism in a simulation model OMNeT++ currently supports conservative synchronization via the classic Chandy-Misra-Bryant (or null message) algorithm [CM79]. The main issue with parallel simulations is keeping LPs synchronized in order to avoid violating the causality of events. To assess how efficiently a simulation can be parallelized with this algorithm. Repairing involves rollbacks to a previous state.
The OMNeT++ design places a big emphasis on separation of models from experiments. The main rationale is that usually a large number of simulation experiments need to be done on a single model before a 1 Notations: ev: events. The OMNeT++ displays these values on the GUI while the simulation is running. P is usually in the range of 20. The authors’ measurements on a Linux cluster interconnected via a 100Mb Ethernet switch using MPI yielded τ =22µs which is consistent with measurements reported in [OF00]. and not where the model is executed. sec: real seconds. R and E After having approximate values of P . simsec: simulated seconds 202 . The architecture is modular and extensible. τ can be determined using simple benchmark programs. E. R strongly depends on both the model and on the software/hardware environment where the model executes. With λ < 1. E and R usually stay relatively constant (that is.1: Performance bar in OMNeT++ showing P .100.g..3 12. E depends on the model only. They are also intuitive and easy to measure. calculate the λ coupling factor as the ratio of LE and τP: λ = (LE)/(τ P ) Without going into the details: if the resulting λ value is at minimum larger than one. The implementation relies on the approach of placeholder modules and proxy gates to instantiate the model on different LPs – the placeholder approach allows simulation techniques such as topology discovery and direct message sending to work unmodified with PDES. so it can serve as a framework for research on parallel simulation. see Figure 12. • τ latency (sec) characterizes the parallel simulation hardware.1. 1 P depends on the performance of the hardware and the computation-intensiveness of processing an event.000. E is determined by the size. P .) • R relative speed measures the simulation time advancement per second (simsec/sec). Depending on the nature of the simulation model and the performance of the computer. When simulating telecommunication networks and using link delays as lookahead. For details see the paper [AVE03]. 12. • L lookahead is measured in simulated seconds (simsec). cell-level ATM models produce higher E values than call center simulations.500. L and τ . The design allows simulation models to be run in parallel without code modification – it only requires configuration. Figure 12.3.. L is typically in the msimsec-µsimsec range. display little fluctuations in time). poor performance is guaranteed. there is a good change that the simulation will perform well when run in parallel. In large simulation models.1 Parallel distributed simulation support in OMNeT++ Overview This chapter presents the parallel simulation architecture of OMNeT++. τ is the latency of sending a message from one LP to another. the detail level and also the nature of the simulated system (e. Note that R = P/E.000 ev/sec. • E event density is the number of events that occur per simulated second (ev/simsec). but rather in the range 10. Specialized hardware such as Quadrics Interconnect [qua] can provide τ =5µs or better. Cmdenv can also be configured to display these values. P is independent of the size of the model.OMNeT++ Manual – Parallel Distributed Simulation • P performance represents the number of events processed per second (ev/sec).
for use on shared memory multiprocessors without the need to install MPI. In OMNeT++. An alternative communication mechanism is based on named pipes. and can be useful for educational purposes (to analyse or demonstate messaging in PDES algorithms) or to debug PDES algorithms. OMNeT++ supports the Null Message Algorithm with static topologies. Setting up the model on various LPs as well as relaying model messages across LPs is already taken care of and not something the implementation of the synchronization algorithm needs to worry about (although it can intervene if needed. more precisely. using link delays as lookahead. Following the above principle.2 Parallel Simulation Example We will use the Parallel CQN example simulation for demonstrating the PDES capabilities of OMNeT++. thus it is a natural requirement to be able to carry out experiments without disturbing the simulation model itself.OMNeT++ Manual – Parallel Distributed Simulation conclusion can be drawn about the real system. The implementation of the Null Message Algorithm is also modular in itself in that the lookahead discovery can be plugged in via a defined API. ISP can be used for benchmarking the performance of the Null Message Algorithm. to fully exploit the power of multiprocessors without the overhead of and the need to install MPI. OMNeT++ allows simulation models to be executed in parallel without modification. Also supported is the Ideal Simulation Protocol (ISP) introduced by Bagrodia in 2000 [BT00]. Additionally. ISP is a powerful research vehicle to measure the efficiency of PDES algorithms. It communicates via text files created in a shared directory. Additionally. The laziness of null message sending can be tuned. it helps determine the maximum speedup achievable by any PDES algorithm for a particular model and simulation environment. Experiments tend to be ad-hoc and change much faster than simulation models. 12. models can be executed without any synchronization. a file system based communication mechanism is also available. PDES algorithms are also represented by C++ classes that have to implement a very small API to integrate with the simulation kernel. Currently implemented lookahead discovery uses link delays. The constraints are the following: • modules may communicate via sending messages only (no direct method call or member access) unless mapped to the same processor • no global variables • there are some limitations on direct sending (no sending to a submodule of another module. Implementation of a shared memory-based communication mechanism is also planned for the future. the new communications mechanism can be selected for use in the configuration. OMNeT++ primarily uses MPI. New communication mechanisms can be added by implementing a compact API (expressed as a C++ class) and registering the implementation – after that. which can be useful for educational purposes (to demonstrate the need for synchronization) or for simple testing. unless mapped to the same processor) • lookahead must be present in the form of link delays • currently static topologies are supported (we are working on a research project that aims to eliminate this limitation) PDES support in OMNeT++ follows a modular and extensible architecture. the Message Passing Interface standard [MPI94]. because the necessary hooks are provided). but it is possible to implement more sophisticated ones and select them in the configuration. Nearly every model can be run in parallel. as partitioning and other PDES configuration is entirely described in the configuration files. No special instrumentation of the source code or the topology description is needed. both optimistic and conservative. The model consists of N tandem queues where each tandem consists of a switch and k single-server queues 203 . For the communication between LPs (logical processes).3. New PDES synchronization algorithms can be added in a similar way.
that is. This is done by the following lines: [Partitioning] *.tandemQueue[2]**.partition-id = 0 *.3: Partitioning the CQN model To run the CQN model in parallel. we have to configure it for parallel execution. assign modules to processors.ini. The last queues are looped back to their switches.3). For configuration. Then we have to select the communication library and the parallel simulation algorithm.tandemQueue[1]**.tandemQueue[0]**.partition-id = 1 *. the configuration is in a text file called omnetpp.partition-id = 2 The numbers after the equal sign identify the LP. Figure 12. using uniform distribution.2). In OMNeT++. we assign tandems to different LPs (Figure 12. Figure 12. Each switch randomly chooses the first queue of one of the tandems as destination. The queues and switches are connected with links that have nonzero propagation delays. and enable parallel simulation: [General] 204 .OMNeT++ Manual – Parallel Distributed Simulation with exponential service times (Figure 12. Lookahead is provided by delays on the marked links.2: The Closed Queueing Network (CQN) model To run the model in parallel. Our OMNeT++ model for CQN wraps tandems into compound modules. first we have to specify partitioning.
When using LAM-MPI [lam]. proxy gates When setting up a model partitioned to several LPs. Figure 12. modules can use direct message sending to any sibling 205 . Alternatively.4: Screenshot of CQN running in three LPs 12. The GUI interface can be useful for educational or demonstation purposes./cqn -p0.3 Placeholder modules.) The graphical user interface of OMNeT++ can also be used (as evidenced by Figure 12./cqn -p2. one will usually want to select the command-line user interface. Also. OMNeT++ displays debugging output about the Null Message Algorithm. OMNeT++ uses placeholder modules and proxy gates./cqn -p1.3 & . The main advantage of using placeholders is that algorithms such as topology discovery embedded in the model can be used with PDES unmodified. every module has all of its siblings present in the local LP – either as placeholder or as the “real thing”. placeholders represent sibling submodules that are instantiated on other LPs. Proxy gates take care of forwarding messages to the LP where the module is instantiated (see Figure 12. With placeholder modules. When named pipes or file communications is selected. one can run the processes by hand (the -p flag tells OMNeT++ the index of the given LP and the total number of LPs): . the opp_prun OMNeT++ utility can be used to start the processes. independent of the selected communication mechanism.4). etc.3 & .OMNeT++ Manual – Parallel Distributed Simulation parallel-simulation=true parsim-communications-class = "cMPICommunications" parsim-synchronization-class = "cNullMessageProtocol" When the parallel simulation is run. In the local LP. the mpirun program (part of LAM-MPI) is used to launch the program on the desired processors.3.3 & For PDES. LPs are represented by multiple running instances of the same program.5). (OMNeT++ provides the necessary configuration options. EITs and EOTs can be inspected. and redirect the output to files.
Since submodules can be on different LPs.4 Configuration Parallel simulation configuration is the [General] section of omnetpp. Instantiation of compound modules is slightly more complicated.OMNeT++ Manual – Parallel Distributed Simulation module. as it violates encapsulation). simply because placeholders are empty and so its submodules are not present in the local LP.3. Entry and default value [General] Description 206 .ini. including placeholders. and are represented by placeholders everywhere else (Figure 12. Figure 12. the compound module may not be “fully present” on any given LP.5: Placeholder modules and proxy gates Figure 12. compound modules are instantiated wherever they have at least one submodule instantiated. Thus.6). A limitation is that the destination of direct message sending cannot be a submodule of a sibling (which is probably a bad practice anyway.6: Instantiating compound modules 12.. and it may have to be present on several LPs (wherever it has submodules instantiated).
Controls how often the Null Message Algorithm should send out null messages. an exception is thrown somewhere inside the standard C library. Windows: default value is "omnetpp". Selects the lookahead class for the Null Message Algorithm. BEWARE: for mysterious reasons. The following configuration entries are only examined if parallel-simulation=true Enables debugging output Size of MPI send buffer to allocate. which materializes itself in OMNeT++ as an "Error: (null)" message.5 means every lookahead/2 simsec. which means that pipe names will be of the form "\\. the value is understood in proportion to the lookahead. the class must be subclassed from cNMPLookahead. e.000 <int> The above 3 options control the cFileCommunications class. you can make it move read files to another directory instead ("comm/read/" by default). Unix: default value is "comm/". Strangely. When that point is reached. it deletes files that were read. By default.OMNeT++ Manual – Parallel Distributed Simulation parallel-simulation default: false = <true/false> parsim-debug = <true/false> default: true parsim-mpicommunicationsmpibuffer = <bytes> default: 256K * (numPartitions-1) + 16K parsim-namedpipecommunicationsprefix = <string> default: "omnetpp" or "comm/" Enables parallel distributed simulation. a deadlock can occur. which means that the named pipes will be created with the name "comm/pipe-xx-yy". this can be reproduced in both Linux and Windows.5 parsim-idealsimulationprotocoltablesize = default: 100. it appears that there cannot be more than about 19800 files in a directory.. (one entry is 8 bytes. a useful configuration setting is 207 .g. so 100. 0..1> default: 0. If the buffer is too small.000 corresponds to 800K allocated memory) When you are using cross-mounted home directories (the simulation’s directory is on a disk mounted on all nodes of the cluster).\pipe\omnetpp-xx-yy" (where xx and yy are numbers).. (see below) parsim-filecommunicationsprefix = <string> default: "comm/" parsim-filecommunicationspreserve-read = <true/false> default: false parsim-filecommunicationsread-prefix = <string> default: "comm/read/" (see below) parsim-nullmessageprotocol-lookaheadclass = <class name string> default: "cLinkDelayLookahead" parsim-nullmessageprotocollaziness = <0. Size of chunks (in table entries) in which the external events file (recorded by cISPEventLogger) should be loaded. By enabling the "preserveread" setting. The "comm/" subdirectory must already exist when the simulation is launched. see MPI_Buffer_attach() MPI call. Controls the naming of named pipes.
10. so that partitions do not overwrite each other’s output files. The message class and other classes in the simulation library can pack and unpack themselves into such buffers. cProxyGate classes.OMNeT++ Manual – Parallel Distributed Simulation [General] fname-append-host=yes It will cause the host names to be appended to the names of all output vector files.7. (See section 8. for configuring proxy gates. which can be removed from the simulation kernel if not needed. and encapsulate MPI send/receive calls. The receiving LP unpacks the message and injects it at the gate the proxy gate points at. cPlaceHolderModule. partitioning layer and synchronization layer. processing model messages outgoing from the LP. The implementation basically encapsulates the cParsimSegment. which encapsulate packing and unpacking operations for primitive C++ types. specific implementations like the MPI one (cMPICommunications) subclass from this. The Synchronization layer encapsulates the parallel simulation algorithm. The services include send. Parallel simulation algorithms are also represented by classes. and messages (model messages or internal messages) arriving from other LPs. blocking receive. The Partitioning layer is responsible for instantiating modules on different LPs according to the partitioning specified in the configuration. It intercepts messages that arrive at proxy gates and transmits them to the destination LP using the services of the communication layer. Figure 12. The matching buffer class cMPICommBuffer encapsulates MPI pack/unpack operations. The send/receive operations work with buffers. subclassed from the cParsimSynchronizer abstract class.3. It consists of three layers. with a modular and extensible architecture. The parallel simulation algorithm is invoked on the following hooks: event scheduling. this layer also ensures that cross-partition simulation messages reach their destinations.3) 12. The overall architecture is depicted in Figure 12. from the bottom up: communication layer. The Communications layer API is defined in the cFileCommunications interface (abstract class). The purpose of the Communication layer is to provide elementary messaging services between partitions for the upper layer. During the simulation.5 Design of PDES Support in OMNeT++ Design of PDES support in OMNeT++ follows a layered approach. nonblocking receive and broadcast. event scheduling is a function invoked by the simulation kernel to determine the next 208 . The first hook.7: Architecture of OMNeT++ PDES implementation The parallel simulation subsytem is an optional component itself.
the provided API itself would allow implementing optimistic protocols. 2 Unfortunately. The Ideal Simulation Protocol (ISP. too. Currently only link delay based lookahead discovery has been implemented. Note that although we implemented a conservative protocol. We also expect that because of the modularity. 209 . see [BT00]) implementation consists in fact of two parallel simulation protocol implementations: the first one is based on the null message algorithm and additionally records the external events (events received from other LPs) to a trace file. The second hook is invoked when a model message is sent to another LP.OMNeT++ Manual – Parallel Distributed Simulation simulation event. extensibility and clean internal architecture of the parallel simulation subsystem. and it allows the parallel simulation algorithm to process its own internal messages from other partitions. the second one executes the simulation using the trace file to find out which events are safe and which are not. it also has full access to the future event list (FEL) and can add/remove events for its own use. The third hook is invoked when any message arrives from other LPs. but it is possible to implement more sophisticated ones. e. so it could perform saving/restoring model state if model objects support this 2 . The parallel simulation algorithm has access to the executing simulation model. also it uses this hook to periodically send null messages. including user-programmed simple modules. The null message protocol implementation itself is modular. the OMNeT++ framework has the potential to become a preferred platform for PDES research. Conservative parallel simulation algorithms will use this hook to block the simulation if the next event is unsafe. configurable lookahead discovery object. the null message algorithm processes incoming null messages here.g. the null message algorithm uses this hook to piggyback null messages on outgoing model messages. the null message algorithm implementation (cNullMessageProtocol) blocks the simulation if an EIT has been reached until a null message arrives (see [BT00] for terminology). support for state saving/restoration needs to be individually and manually added to each class in the simulation. it employs a separate.
OMNeT++ Manual – Parallel Distributed Simulation 210 .
The following diagram shows the high-level architecture of OMNeT++ simulations: Figure 13. Embedding OMNeT++ into applications can be achieved implementing a new user interface in addition to Cmdenv and Tkev. but for simplicity we’ll use the word linking here. 1 • Envir is another library which contains all code that is common to all user interfaces.1: Architecture of OMNeT++ simulation programs The rectangles in the picture represent components: • Sim is the simulation kernel and class library. hiding all other user interface internals.1 Architecture OMNeT++ has a modular architecture. Some aspects of Envir can be customized via plugin interfaces.) 1 Use of dynamic (shared) libraries is also possible.2. main() is also in Envir. Envir presents itself towards Sim and the executing model via the ev facade object. 211 . Sim exists as a library you link your simulation program with.3 and 13.OMNeT++ Manual – Customization and Embedding Chapter 13 Customization and Embedding 13.5. or by replacing Envir with another implementation of ev (see sections 13. Envir provides services like ini file handling for specific user interface implementations.
Sim and its classes use Envir to print debug information. The main() function provided as part of Envir determines the appropriate user interface class (subclassed from TOmnetApp).) that are all instances of components in the model component library.printf()). networks.2 Embedding OMNeT++ This section discusses the issues of embedding the simulation kernel or a simulation model into a larger application. Envir presents a single facade object (ev) that represents the environment (user interface) toward Sim – no Envir internals are visible to Sim or the executing model. What you’ll absolutely need for a simulation to run is the Sim library. 212 . and Tkenv and Cmdenv both subclass from TOmnetApp. simulation (of class cSimulation). so one can redefine the output vector storing mechanism by changing Envir. is the facade of the user interface towards the executing model. It also refers to the component library when dynamic module creation is used. ev. The arrows in the figure show how components interact with each other: • Executing Model vs Sim. The simulation kernel instantiates simple modules and other components when the simulation model is set up at the beginning of the simulation run. You may or may not want to keep Envir. and instructs Sim to do so.ini. The modules of the executing model are stored in the main object of Sim. The ev object. Envir contains the main simulation loop (determine-nextevent. Envir is in full command of what happens in the simulation program. • The Model Component Library consists of simple module definitions and their C++ implementations. • Sim vs Model Component Library. During simulation model setup. Envir determines which models should be set up for simulation. • Sim vs Envir. Envir presents a framework and base functionality to Tkenv and Cmdenv via the methods of TOmnetApp and some other classes. Envir supplies parameter values for Sim when Sim asks for them. It contains objects (modules. Envir defines TOmnetApp as a base class for user interfaces. The model uses ev to write debug logs (ev«. Envir catches and handles errors and exceptions that occur in the simulation kernel or in the library classes during execution. compound module types. etc. The machinery for registering and looking up components in the model component library is implemented as part of Sim. A simulation program is able to run any model that has all necessary components linked in. so you do not want Cmdenv and Tkenv. Sim writes output vectors via Envir. A simulation is linked with either Cmdenv or Tkenv. In turn. • Executing Model vs Envir. Envir contains the main() function where execution begins.OMNeT++ Manual – Customization and Embedding • Cmdenv and Tkenv are specific user interface implementations. the executing model calls functions in the simulation kernel and uses classes in the Sim library. You probably do not want to keep the appearance of the simulation program. The simulation kernel manages the future events and invokes modules in the executing model as events occur. channels. creates an instance and runs it – whatever happens next (opening a GUI window or running as a command-line program) is decided in the run() method of the appropriate TOmnetApp subclass. • The Executing Model is the model that has been set up for simulation. You can keep Envir if its philosophy and the infrastructure it provides (omnetpp. logically part of Envir. channels. execute-event sequence) and invokes the simulation kernel for the necessary functionality (event scheduling and event execution are implemented in Sim). • Envir vs Tkenv and Cmdenv. Sim’s or the model’s calls on the ev object are simply forwarded to the TOmnetApp instance.) 13. message types and in general everything that belongs to models and has been linked into the simulation program.
4 The Model Component Library All model components (simple module definitions and their C++ implementations. code that sets up a network or builds the internals of a compound module comes from compiled NED source. Then your application.1 The global simulation object The global simulation object is an instance of cSimulation. 13.OMNeT++ Manual – Customization and Embedding certain command-line options etc. compound module types. which are part of the standard Win32 API. message types. since chapters 4 and 6. simulation has two basic roles: • it stores modules of the executing model • it holds the future event set (FES) object 13.3.) that you compile and link into a simulation program 213 . etc. cSimpleModule has cCoroutine as one a base class.ini). Moreover. it is possible to write an integrated environment where you can put together a network using a graphical editor and right after that you can run it.3. What we can do here is elaborating on some internals that have not been covered in the general chapters. the embedding program will take the place of Cmdenv and Tkenv. • On Windows. and encapsulates much of the functionality of setting up and running a simulation model. The source code for the simulation kernel and class library reside in the src/sim/ subdirectory. No problem. 13. It stores the model. SwitchToFiber(). your program can contain pieces of code similar to what is currently generated by nedc and then it can build any network whose components (primarily the simple modules) are linked in. Normally. networks. The coroutines are represented by the cCoroutine class. the Fiber functions (CreateFiber(). practically) must implement the cEnvir member functions from envir/cenvir. It allocates stack by deep-deep recursions and then plays with setjmp() and longjmp() to switch from one to another. It is based on Kofoed’s solution[Kof95]. then you have to replace it. you want the model parameters to come from a database not from omnetpp. channels.2 The coroutine package The coroutine package is in fact made up of two coroutine packages: • A portable coroutine package creates all coroutine stacks inside the main stack.) fit into your design. etc) are used. Classes covered in those chapters are documented in more detail in the API Reference generated by Doxygen. and part of chapter 5 are all about this topic. but you have full control over the simulation. You may not like the restriction that your simulation program can only simulate networks whose setup code is linked in. Your Envir replacement (the embedding application.h. 13. If Envir does not fit your needs (for example.3 Sim: the simulation kernel and class library There is little to say about Sim here. without intervening NED compilation and linkage.
) When the simulation program starts up. you can have the contents of its component library printed. a new cModuleType object will be added to the modtypes object. 214 (C) 1992-2004 Andras Varga ."FIFO".. The cModuleType object also stores the name of the corresponding NED module declaration./fddi -h OMNeT++ Discrete Event Simulation . The cModuleType object will act as a factory: when its create() method is called it will produce a new module object of class FIFO via the above static function FIFO__create. which holds the list of available module types. Available channels: . If your simulation program is linked with Cmdenv or Tkenv. Let us see the module registrations as an example. cModule *parentmod) { return new FIFO(name. in other cases you have to write them in your C++ source. Available networks: FDDI1 NRing TUBw TUBs Available modules: FDDI_MAC FDDI_MAC4Ring . Register_Class(). End run of OMNeT++ Information on components are kept on registration lists.instance()->add( new cModuleType("FIFO". Any model that has all its necessary components in the component library of the simulation program can be run by that simulation program. Define_Network(). Define_Module_Like().. There are macros for registering components (that is. } EXECUTE_ON_STARTUP( FIFO__mod. The Define_Module(FIFO). For components defined in NED files. Define_Function(). using the -h switch..(ModuleCreateFunc)FIFO__create) ). the macro calls are generated by the NED compiler. modtypes....OMNeT++ Manual – Customization and Embedding are registered in the Model Component Library. and a few others. This makes it possible to add the gates and parameters declared in NED to the module when it is created. parentmod). macro expands to the following code: static cModule *FIFO__create(const char *name. % . for adding them to the registeration lists): Define_Module().
for simple modules. a class derived from cChannel.g. they are completely separated from the simulation kernel. Every cNetworkType object is a factory for a specific network type. 13. (E. Every cClassRegister object is a factory for objects of a specific class. Actual simulation is done in cEnvir::run() (see later).5. List of channel types. Registration lists are implemented as global objects. one has to register it using the Register_Class(classname) macro List of functions taking doubles and returning a double (see type MathFuncNoArg. src/tkenv/ directories. cModuleType channeltypes Define_Channel() cChannelType Register_Class() cClassRegister classes functions Define_Function() cFunctionType 13. The registration lists are: List variable networks Macro/ Objects on list Define_Network() cNetworkType Function List of available networks. given the class name as a string. the statement ptr = createOne("cArray") creates a cArray object. modtypes Define_Module(). 215 . That is. Define_Module() macros for compound modules occur in the code generated by the NED compiler.OMNeT++ Manual – Customization and Embedding The machinery for managing the registration lists are part of the Sim library.) To enable a class to work with createOne(). List of available classes of which one can create an instance.1 The main() function The main() function of OMNeT++ simply sets up the user interface and runs it.5 Envir.. Define_Network() macros occur in the code generated by the NED compiler. The list is used by the createOne() function: it can create an object of any class. the Define_Module() lines are added by the user. Usually. Tkenv and Cmdenv The source code for the user interface of OMNeT++ resides in the src/envir/ directory (common part) and in the src/cmdenv/. Every cModuleType object is a factory for a specific module type. a cNetworkType object has methods for setting up a specific network. Define_Module_Like(). A cFunctionType object holds a pointer to the function and knows how many arguments it takes. Every cChannelType object acts as a factory for a channel type.MathFunc3Args). The classes in the user interface are not derived from cObject.. List of available module types.
The following plugin interfaces are supported: • cRNG. cEnvir maintains a pointer to a dynamically allocated simulation application object (derived from TOmnetApp. To actually implement and select a plugin for use: 1.2). It provides an output stream to which snapshots are written (see section 6. It handles recording the scalar output data. defined in the Envir library. its member functions contain little code.2 The cEnvir interface The cEnvir class has only one instance. The default output scalar manager is cFileOutputScalarManager.5. 216 . for a custom RNG.OMNeT++ Manual – Customization and Embedding 13.g. database input. • cConfiguration. distributed and distributed parallel simulation.g. defined in the Envir library. hardwarein-the-loop. cRNG) to create your own version. Interface for the random number generator. windowing in Tkenv) • cEnvir provides methods for the simulation kernel to access configuration information (for example. e. module parameter settings) • cEnvir also provides methods that are called by simulation kernel to notify the user interface of certain events (an object was deleted. defined in the Envir library. This plugin interface allows for implementing real-time. IMPORTANT: make sure the executable actually contains the code of your class! Over-optimizing linkers (esp. • cOutputVectorManager.3 Customizing Envir Certain aspects of Envir can be customized via plugin interfaces. Register the class by putting the Register_Class(MyRNGClass) line into the C++ source.g. The default snapshot manager is cFileSnapshotManager. • cScheduler. cEnvir basically a facade. stdin/stdout for Cmdenv. see later) which does all actual work.) are documented in the API Reference. the actual implementation is different for each user interface (e. on Unix) tend to leave out code to which there seem to be no external reference. output via the cModule::recordScalar() family of functions. Subclass the given interface class (e. it option lets you replace omnetpp. a global object called ev: cEnvir ev. It defines a class from which all configuration will be obtained. • cSnapshotManager. etc. a module was created or deleted.) 13. • cOutputScalarManager. 2. a message was sent or delivered.ini with some other implementation.10. cEnvir member functions perform the following groups of tasks: • I/O for module activities. In other words. The classes (cRNG. 3. The scheduler class.5. cScheduler. It handles recording the output for cOutVector objects. Compile and link your interface class into the OMNeT++ simulation executable. The default output vector manager is cFileOutputVectorManager. etc.
ini to tell Envir use your class instead of the default one. The original omnetpp. which returns a pointer to the configuration object (cConfiguration). • Some of them implement the cEnvir functions (described in the previous section) • Others implement the common part of all user interfaces (for example: reading options from the configuration files. Then everything goes on as normally. this setting is rng-class in the [General] section. TOmnetTkApp are derived from TOmnetApp.4 Implementation of the user interface: simulation applications The base class for simulation application is TOmnetApp.2. An example which reads the parsim-debug boolean entry from the [General] section. using the new configuration object. documented in section 8. 4.ini (or the ini file(s) specified via the "-f" command-line option) are read. [General]/configuration-class is examined.g. the startup sequence is the following (see cEnvir::setup() in the source code): 1. rng-class. making the options effective within the simulation kernel) • The run() function is pure virtual (it is different for each user interface). true).) 3. "parsim-debug". omnetpp.config()->getAsBool("General". No other settings are taken from it. (Also the ones specified with the "-l" commandline option.OMNeT++ Manual – Customization and Embedding 4. TOmnetApp’s data members: • a pointer to the object holding configuration file contents (type cInifile). The configuration object may read further entries from the ini file (e. TOmnetApp’s member functions are almost all virtual. Specific user interfaces such as TCmdenv. schedulerclass. Startup sequence for the configuration plugin For the configuration plugin. with true as default: bool debug = ev. database connect parameters. [General]/load-libs from the new configuration object is processed. This enables plugin classes to have their own config entries.ini cInifile configuration object is deleted. For RNGs. Add an entry to omnetpp. outputscalarmanager-class and snapshotmanagerclass. 5. Shared libraries in [General]/load-libs are loaded. outputvectormanager-class. Ini file entries that allow you to select your plugin classes are configuration-class. How plugin classes can access the configuration The configuration is available to plugin classes via the config() method of cEnvir. a configuration object of the given class is instantiated.5. or XML file name).6. First. and if it is present. 2. 6. 217 . 13.
218 .OMNeT++ Manual – Customization and Embedding • the options and switches that can be set from the configuration file (these members begin with opt_) Simulation applications: • add new configuration options • provide a run() function • implement functions left empty in TOmnetApp (like breakpointHit(). objectDeleted()).
separated by commas 1 or more times a. The networkdescription symbol is the sentence symbol of the grammar. separated with a comma and (optionally) spaces. tabs or new line characters. channeldefinition ::= 219 . tabs or new line characters. separated by spaces a or b the character a keyword identifier networkdescription ::= { definition. the {xxx. In this description. and {xxx„. notation [a] {a} {a. The language only distinguishes between lower and upper case letters in names. in some cases we use textual definitions. } .} {a. the network topology description language of OMNeT++ will be given using the extended BNF notation.} notation stands for one or more xxx’s separated with spaces.. For ease of reading. } definition ::= include | channeldefinition | simpledefinition | moduledefinition | networkdefinition include ::= include { fileName . horizontal tab and new line characters counts as delimiters.. so one or more of them is required between two elements of the description which would otherwise be unseparable... ’//’ (two slashes) may be used to write comments that last to the end of the line. Space...} stands for one or more xxx’s. but not in keywords.} a|b ‘a’ bold italic meaning 0 or 1 time a a 1 or more times a...OMNeT++ Manual – NED Language Grammar Appendix A NED Language Grammar The NED language...
.. ] [ gatesizeblock.. ] } | { submodulename : parametername [ vector ] like moduletype [ substparamblock.. ] gate ::= gatename [ ’[]’ ] submodblock ::= submodules: { submodule. ] } substparamblock ::= parameters [ if expression ]: 220 ... } submodule ::= { submodulename : moduletype [ vector ] [ substparamblock. } ...OMNeT++ Manual – NED Language Grammar channel channeltype [ delay numericvalue ] [ error numericvalue ] [ datarate numericvalue ] endchannel simpledefinition ::= simple simplemoduletype [ paramblock ] [ gateblock ] endsimple [ simplemoduletype ] moduledefinition ::= module compoundmoduletype [ paramblock ] [ gateblock ] [ submodblock ] [ connblock ] endmodule [ compoundmoduletype ] moduletype ::= simplemoduletype | compoundmoduletype paramblock ::= parameters: { parameter . parameter ::= parametername | parametername | parametername | parametername | parametername | parametername : : : : : const [ numeric ] string bool char anytype gateblock ::= gates: [ in: { gate .. } . ] [ out: { gate ... } ..... ] [ gatesizeblock..
..’’ expression normalconnection ::= { gate { --> | <-...OMNeT++ Manual – NED Language Grammar { substparamname = substparamvalue. } . } .. } . } do { normalconnection . connection ::= normalconnection | loopconnection loopconnection ::= for { index.} gate [ if expression ]} | {gate --> channel --> gate [ if expression ]} | {gate <-.. connblock ::= connections [ nocheck ]: { connection .. endfor index ::= indexvariable ’=’ expression ‘‘.. } . ] gatename [vector] networkdefinition ::= network networkname : moduletype [ substparamblock ] endnetwork vector ::= ’[’ expression ’]’ parexpression ::= expression | otherconstvalue expression ::= expression + | expression | expression * | expression / | expression % | expression ^ expression expression expression expression expression expression 221 .channel <-..... substparamvalue ::= ( [ ancestor ] [ ref ] name ) | parexpression gatesizeblock ::= gatesizes [ if expression ]: { gatename vector .gate [ if expression ]} channel ::= channeltype | [ delay expression ] [ error expression ] [ datarate expression ] gate ::= [ modulename [vector].
. "prompt-string" ’)’ default ::= expression | otherconstvalue 222 .expression numconstvalue inputvalue [ ancestor ] [ ref ] parametername sizeof ’(’ gatename ’)’ index numconstvalue ::= integerconstant | realconstant | timeconstant otherconstvalue ::= ’characterconstant’ | "stringconstant" | true | false inputvalue ::= input ’(’ default . ] ’)’ ..OMNeT++ Manual – NED Language Grammar | | | | | | | | | | | | | | | | | | expression == expression expression != expression expression < expression expression <= expression expression > expression expression >= expression expression ? expression : expression expression and expression expression or expression not expression ’(’ expression ’)’ functionname ’(’ [ expression .
The Art of Computer Systems Performance Analysis. 23(1):5–48. 1999. David Goldberg. Dr. Delft. Wiley. Download sorce from. Vajtersic and A. ACM Computing Surveys. Don’t trust parallel Monte Carlo. The P 2 algorithm for dynamic calculation of quantiles and histograms without storing observations. In Hungarian. Dept.Theory and Applications. Editors: R. What every computer scientist should know about floating-point arithmetic.org/. Alex Paalvast. Ahmet Sekercioglu András Varga and Gregory K. Hellekalek. K.lam-mpi. Network simulation using the JAR compiler for the OMNeT++ simulation system. L. New York. Entacher. IEEE Transactions on Software Engineering SE-5. International Society for Computer Simulation. 223 [BT00] [CM79] [EHW02] [EPM99] [Gol91] [Hel98] [HPvdL95] [Jai91] [JC85] [Kof95] [lam] [Len94] . M. International Society for Computer Simulation. R. Misra.. 26-29 Oct. M. 28(10):1076–1085. P. A practical efficiency criterion for the null message algorithm. Wegenkittl. G. jul 1998. Master’s thesis. Stig Kofoed.sbg.ddj. Ewing. 11(4):395–414. Technical University of Budapest. Uhl. P. McNickle. Akaroa2: Exploiting network computing by distributing stochastic simulation. In Proceedings of the European Simulation Symposium (ESS 2003). and S.OMNeT++ Manual – REFERENCES References [AVE03] Y. see. ACM SIGSIM Simulation Digest.mat. A simple OMNeT++ queuing experiment using parallel streams. Hechenleitner. 1991. 2003. Raj Jain. Technical report. 2002. 2003. B. Raj Jain and Imrich Chlamtac. Graphical network editor for OMNeT++. 1995. and Robert van der Leij.zip/. Portable multitasking in C++. 2000. PARALLEL NUMERICS’02 . Performance evaluation of conservative algorithms in parallel simulation languages. Technical University of Budapest.11/mtask. K. Author’s page is a great source of information. Egan.ac. November 1995. The Netherlands. Distributed simulation: A case study in design and verication of distributed programs. Trobec. Zinterhof. 1985. Communications of the ACM. 1994. and D. Warsaw. pages 89– 105. pages 175–181. Bagrodia and M. Gábor Lencse. 1991. Jan Heijmans. Pawlikowski. Chandy and J. Takai. (5):440–452. 28(1):82–89. Dobb’s Journal. In Proceedings of the European Simulation Multiconference ESM’99. of Telecommunications. 1979.at/. LAM-MPI home page. June 1999.
In Proceedings of the Annual Students’ Scientific Conference (TDK). Fox. D. and Gerard van de Weerd.ac. In Hungarian. 2002. Message Passing Interface Forum. 1986. 1995. Atlanta. In Proceedings of the 4th Annual Linux Showcase & Conference.umontreal. In Proceedings of the Western Multiconference on Simulation (WMC’98) / Communication Networks and Distributed Systems (CNDS’98). Jeong. George van Montfort. 1993. Using the OMNeT++ discrete event simulation system in education. International Society for Computer Simulation. 42(4):372. Schrage. 1998. journal contains abstract. UK. 2000. Springer-Verlag. and W. 1991. L. October 10-14.com/. [OF00] Hong Ong and Paul A. January 11-14.math. 8(1):3–30. J. András Varga. University of Technology. OMNeT++ extensions and examples.iro. and L. International Society for Computer Simulation. A Guide to Simulation. Operations Research.jp/ matumoto/emt. San Diego. November 1999. MPI: A message-passing interface standard. György Pongor. K. Technical report. Parameterized topologies for simulation programs. Dept. Lappeenranta. In Proceedings of the European Simulation Symposium (ESS’93).html. R. 1994. 1998.html. 2000. Performance comparison of LAM/MPI. György Pongor. Technical University of Budapest. M. Oct. The USENIX Association. Bratley P. Data Communications Laboratory. Dept. 25-28. MPICH and MVICH on a Linux cluster connected by a Gigabit Ethernet network. Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator. Simard. on CD-ROM issue. Master’s thesis. Lee. Source code can be downloaded from. Source code can be downloaded from. Technical University of Budapest. L’Ecuyer. Chen. of Telecommunications. [MN98] [MPI94] [MvMvdW95] André Maurits. OMNET: An object-oriented network simulator. Matsumoto and T. OMNeT++ . An objected-oriented random-number package with many long streams and substreams. György Pongor. Portable user interface for the OMNeT++ simulation system. András Varga. and J. 1992. 1992. Kelton.keio.. 1998.OMNeT++ Manual – REFERENCES [LSCK02] P. 50(6):1073–1075. on Modeling and Computer Simulation. jan 2002..portable simulation environment in C++. Technical report. Nottingham. Statistical Synchronization: A different approach of parallel discrete event simulation. 1992. In Hungarian. Farrell. CA.quadrics. of Telecommunications. International Society for Computer Simulation. In Proceedings of the European Simulation Symposium (ESS’98).ca/ lecuyer/papers. October 26-28. E. András Varga. E. On credibility of simulation studies of telecommunication networks. IEEE Communications Magazine. IEEE Transactions on Education. B. New York. On the efficiency of the Statistical Synchronization Method. The Netherlands. 224 [PFS86] [PJL02] [Pon91] [Pon92] [Pon93] [qua] [Var92] [Var94] [Var98a] [Var98b] [Var99] . Nishimura. 8(3/4):165–414. 1993. H. Finland. K-split – on-line density estimation for simulation result collection. Quadrics home page. Technical University of Budapest. 1994. Delft. ACM Trans. András Varga. Technical University of Budapest. András Varga. Technical report. Pawlikowski. pages 132–139.
Brent Welch. pages 94–98. András Varga Y. 1997. The Netherlands. 1996. October 19-22. Passau. András Varga and Babak Fakhamzadeh. Technical University of Budapest. October 19-22. Flexible topology description language for simulation programs. In Hungarian. In Proceedings of the 9th European Simulation Symposium (ESS’97). 1997. [VP97] [Wel95] [YASE03] 225 . 1997. PVM extension of OMNeT++ to support Statistical Synchronization. International Society for Computer Simulation. Egan. Germany. International Society for Computer Simulation. Germany. Ahmet Sekercioglu and Gregory K. 2003. 26-29 Oct. 1995. András Varga and György Pongor. Parallel simulation made easy with omnet++. Passau. Practical Programming in Tcl and Tk. Delft. 1997. 2003. Master’s thesis. pages 225–229. In Proceedings of the 9th European Simulation Symposium (ESS’97).OMNeT++ Manual – REFERENCES [Vas96] [VF97] Zoltán Vass. In Proceedings of the European Simulation Symposium (ESS 2003). Prentice-Hall. The K-Split algorithm for the PDF approximation of multi-dimensional empirical distributions without storing observations.
21 breakpoints-enabled. 12. 95 cancelRedirection(). 31 cGate. 81 cell(). 65. 216 bernoulli(p. 120 cFileOutputVectorManager. 110. 103. 166 cDisplayString. 216 beta(alpha1. rng=0). 58 binary heap. 107 226 . 82 cells. 66. 165. 213. 166 cDensityEstBase. 51. 40. 90 buildInside(). 107 cFSM. 101. 12. 37. 68. 216. 121 cChannel. 173. 88. 21 bool. 215 binary tree. 166 cConfiguration. 70. 73. 107 chain. 76 callInitialize(). 28. 114 arrivalGate(). 77 addBinBound(). 189 cFileCommunications. 119 arrivalGateId(). 139. 69. 81. 11 breakpoint. 84 cClassRegister. 75. 130 delay. 40. 21 bubble(). 166 parameters./fifo1. 82 cDoubleHistogram. 66. 70. 137. p. 121 animation-speed. 12. 217 animation-enabled. 84. 107 139. 75. 77 breakpointHit(). 28. alpha2. 136. 213 animation-msgcolors. 120 arrivalModuleId(). 44–47. 163 cEnvir. 39. 124. 166 cCoroutine. rng=0). 130. 101. 38 animation-delay. 113 definition. cauchy(a. 79 arrivedOn. 67. 50–54. 185 char. 28. 113 definitions. 216 basepoint(). 81 abstract. b. 217 average(). 42 cDoubleExpression. 57. 11. 128. 12 boolValue(). 215 Akaroa. 185 arrival time. 28. 140 activity(). 12. 39 cFunctionType. 41. 107 cFileSnapshotManager. 120 autoflush. 84 cChannelType. 38. 82 cells(). 73 cAccuracyDetection. 136. 88 datarate. 35. 34. 108. 195 cADByStddev. 215 awk. 119 animation-msgnames. 215 addObject(). 81 cellPDF(). 216. 154. 154. rng=0). 77 breakpoint(). 170 cCompoundModule. rng=0). 125 chi_square(k. 75 cancelEvent(). 77. 28. 77 bool(). 93 OMNeT++_neddoc. 166 cdf(). 8. 47.OMNeT++ Manual – INDEX Index . 215 addPar(). 207 cFileOutputScalarManager. 125 callFinish(). rng=0). 218 name. 39. 41 channel. 150 #include. 184. 114 accuracy detection. 40. 153. 76 check_and_cast<>(). 118. 125 cArray. 29 cEnvir::run(). 163. 77 binomial(n. 111. 120 arrivalTime(). 154. 30 bit error. 62. 166 error. 101. 174 cBasicChannel.
114 configuration-class. 165 command line user interface. 125 Dijkstra algorithm. 188. 124 class. 116 cTopology::LinkOut. 81 contextPointer(). 29. 76 CreateFiber(). 125 customization. 109. 118. 93 className(). 82 copy constructor. 184 227 . 215 delayed sending. 216 cPar. 101. 54 cout. 80. 79. 118–120 CPU time. 100. 171. 111. 118 disconnect(). 39. 50. 174. 185 cModuleType. 139 deleteModule(). 82 cRNG. 101. 14 const char*. 114. 101. 67–69. 131. 108. 90. 38. 84. 81 controlInfo(). 190 cStatistic. 214. 177 tags. 117 disable(). 154. 135 cPSquare. 65. 42. 132. 118 command line switches. 42. 138. 21 removing.OMNeT++ Manual – INDEX cInifile. 128 cWeightedStdDev. 134 coroutine. 43. 99. 42. 179 cQueue::Iterator. 83 default-run. 104. 152 cQueue. 153. 215 cObject. 108. 53. 44. 108. 215 Define_Module_Like(). 101. 75. 137. 217 configPointer(). 121 cWatch. 114 cXMLElement*(). 93. 140. 37 cpu-time-limit. 212. 130–135. 97. 213 cSimulation. 135– 137. 107. 101. 77 connectTo(). 111–114. 107 debugging. 140 Define_Channel(). 161 config(). 89 context pointer. 68. 108. 101 cXMLElement. 102. 216 cScheduler. 211 cVarHistogram. 117 cTopology::Node. 114 cPolymorphic. 70 dblrand(). 77 loop. 154. 158. 97. 117. 108. 124. 79–85. 103 cLongHistogram. 99. 121. 213 createOne(). 101. 121. 213 cSnapshotManager. 52. 131. 136. 153. 135. 76 density estimation. 131 collect(). 126 cStdDev. 74. 146 decapsulate(). 127. 103. 126. 103. 111. 124. 118. 116 cTopology::LinkIn. 165 defaultOwner(). 91. 101. 82. 88. 22. 72. 101. 41 data rate change. 64 delete. 39 cMessages. 137–140. 215 cObject *dup() const. 139. 114. 215 creationTime(). 190 cSubModIterator. 135. 127. 116. 87. 136 cModule. 71 detect(). 38. 118. 217 cKSplit. 118–120. 106. 91. 108. 119. 74. 214. 107. 153 cSimpleModule. 101. 214. 72. 77 connection. 117 cTransientDetection. 6. 214. 180. 215 Define_Function2(). 178 displayString(). 216 cSequentialScheduler. 216 cStatictic. 126. 108–110. 161. 26. 180 cMessageHeap. 73. 77 const. 174. 161 cMessage. 37 display strings. 145 connect(). 215 Define_Network(). 153. 116. 123. 187 destinationGate(). 114–117 cTopology::Link. 216 cOutputVectorManager. 213 stack size. 141 cPars. 75. 72 cTDExpandingWindows. 46. 104 cOutputScalarManager. 43. 44. 108. 214. 101. 103 copyNotSupported(). 114 data rate. 20. 77 discrete event simulation. 29 creating. 56. 118. 109 create(). 21 conditional. 118 cWeightedStddev. 91. 216 cOutVector. 76. 215 cNetworkType. 29 Define_Module(). 215 Define_Function(). 187. 217 configure script. 102. 84. 81. 154. 65. 153. 125. 91. 39. 102. 101. 101. 119 Cmdenv. 125 cTopology. 106.
53. 131. 38 gamma_d(alpha. 187 finalize(). 162 events. 114 drop(). 39. 53. 114 doubleValue(). 216 ev. 153 FooPacket. 46 gned mouse bindings. 67 ev. 54–57. 70 conditional. beta. 101 exponential(mean. 57. 59 FSM_Goto(). 58. 138. 149. 42. 28. 74 FEL.printf(). 59 fullName(). 107 express-mode. 119 even. 58 FSM_Print(). 108 get. 90 extra-stack-kb. 104. 28. 107 error(). 46. 53 causality. 67 entry code. 79 initial. 25. 50. 38 FES. 71 id. 87 getObject(). 19 vector index. 150 filtering results. 90. 42. 58 enum {. 141 event. 6. 154 findGate().. 165 extraStackforEnvir. 132 double(). 47 exit code. rng=0). 107 proportional. 41. 57 fname-append-host. 122 multi-dimensional. 103 fullPath(). 140 dup(). 99. 28. 57 find. 99 DynaPacket. 104. 38. 51. 135. 107 double. rng=0). 94.}. 13–15. 59 nested. 153. 136 encapsulatedMsg(). 55 event timestamp. 122 predefined. 72 finish(). 184 Gnuplot. 58 FSM_DEBUG. 163. 130 factory function. 122 online estimation. 100 fromGate(). 68 busy condition. 130. 44. 83. 109 end-of-simulation. 83. 46. 39. 103. 59. 99 DynaDataPacket. 85 findSubmodule(). 79 freq. 69 gdb. 19 destination. 108 custom. 121 estimation. 71. 73 FSM. 151. 58 exponential(). 83 end(). 69 vector. 57 endSimulation(). 101. 122 random variables. 126. 150 fifo1. 27. rng=0). 67. 113.OMNeT++ Manual – INDEX distanceToTarget(). 59 FSM_Switch(). 150. 38. 69 size. 88. 94 for(). 99 embedding. 69 vector size. 140 DynaDataPacke. 109 enable(). 14. 211 empty(). 66. 107 gate. 117 enabled(). 87 Envir. 68 gateSize(). 47. 188 228 . 50. rng=0). 117 distribution.vec. 84 global variables. 28. 39. 151 fifonet1. 70. 76. 69 gate(). 163 fifo1. 94 FooPacket_Base. 39. 154 erlang_k(k. 28 future events. 201 event loop. 37 event-banners. 165 geometric(p. 59 forEachChild(). 112 as histogram. 75 fflush(stdout). 37. 108. 135 frames. 113. mean. 162 extends. 192 grep. 88. 69 findPar(). 87. 117 encapsulate(). 103 functions user-defined. 172 finite state machine.
56 length(). 38. 58. 32 k. 166 intuniform(). 128. 62. 68 isNumeric(). 135 max(). 37 isBusy(). 156 attaching non-object types. 6. 6 dynamic deletion. 80 multi-stage. 107 model IPAddress. 215 id(). 29. 118 file inclusion. 79. 71 accessing parameters. 150. 57 exchanging. 76 iter(). 66. 5 loadFromFile(). 16 isRedirected(). 118 equal-sized. 146 destructor. 76 link delay. 52–57. 43 LD_LIBRARY_PATH. 68 isSelfMessage(). 73 parameters. encapsulation. 85 long. 112 min(). rng=0). 109 length. 39. 70. 56 declaration. 44. 90. rng=0). 125. 121 229 . 187 LongHistogram. 119 main(). 56 data members. 114 as parameter. 213 equiprobable-cells. 52. 88 head(). 112 time stamp. 93 time. 69. 80 initialize(int stage). 211. 143 insertBefore(). 109 message-trace. 46–48. b.OMNeT++ Manual – INDEX handleMessage(). 113 histogram. 5. 161 mean(). 84 lognormal(m. 23 info(). 15 items(). 91 wildcards. 80 input. 83 128 error flag. 116 hasObject(). 65. 17 isScheduled(). 109 dynamic creation. 6 inLinks(). 107 between modules. 50. 44. 108. 106 methodcalls-delay. 136. 107 hasPar(). 28. 11. 109 message definitions. 80 initialize(). s. 71 make. 151 message. 220 isVector(). localGate(). 145 index(). 47. 152 priority. 80 input flag. 75. 74 link. 111 deletion. 66. 19 load-libs. 89 constructor. 56 duplication. 70 module isConnected(). 112. 174 localGateId(). 113 array. 84 initial events. 69 definition. 71 math operators. 25 dependencies. 69. 81 compound. 11 Makefile. 92. 67 initialization. 88. 39. 163 int. 95 method calls intrand(). 73 intrand(n). 38 cancelling. 15 patterns. 84 ini-warnings. 38. 116 kind. 80 insert(). 50. 145 import directives. 125. 42 gate sizes. 116 66. 118 intuniform(a. 80 insertAfter(). 45. 44–48. 153 hierarchy. 118 longValue(). 81 communication. 39. 109 long(). 113 range estimation. 28. 57. 145 index. 39. 152 attaching objects. 108. 118 ini file. 118 longjmp().
19 if. 147 Multiple Replications in Parallel. 34 files. 108 netPack().OMNeT++ Manual – INDEX id. 5. 18. 143 components. 6 vector. 19 sizeof(). 144–146 opp_msgc. 117 multitasking cooperative. 101. 152 definitions. 215 new cArray(*this). 25 keywords. 73 watches. 152 numeric constants. 13 submodules. 35. 19 graphical editor. 190. 13 display. 12 include. 94. 8. 23. 17. 196 optimal routes. 114 omnetpp. 37–39. 7. 22. rng=0). 23 parameters. 107 num-rngs. 86 name(). 12 comments. 12 include files. 220 definition. 16 lookup. 161. 115 optimal routing. 15. 132 network. 140 opp_makemake. 53. 8. 14 gatesizes. 132 netUnpack(). 154. 11 bool. 147 negbinomial(n. 2. 9 parameters. 116 nodes(). 24 file generation. 11. 35. p. 72 moduleByRelativePath(). 88. 103 objectDeleted(). 103 duplication. 151. 167 operator=(). 167 OMNETPP_TKENV_DIR. 84. 165 omnetpp. 116 noncobject. 21. rng=0). 91. 42–44. 72 parameters. 13 ref. 20 const. 22 gates. 11 import files. 191 omnetpp. 13 connections. 112 normal(mean. 106. 149. 13 language.sca. 13. 103. 28 gatesizes. 201. 85 opp_neddoc. 193. 8. 11 list of. 143 functions. 2. 140 nodeFor(). 127 module-messages. 162 Module_Class_Members(). 72 moduleByRelativePath(). 155 by reference. 71 iteration. 23 operators. 52 MyPacket. 103. 12 compiler. 33 nocheck. 12 like. 68 string. 25 nedc. 218 objectValue(). 20. 27. 13 gates. 14 simple. 170 MultiShortestPathsTo(). stddev. 18 types. 131 ned case sensitivity. 14 xml. 219 nested for statements. 11 connections. 12 include path. 130 submodule. 86. 16. 16 xml. 68 const. 177 for.sna. 22 import. 14 stack size. 44 moduleByPath(). 117 230 . 7. 93 normal(). 28.ini. 6. 28. 11. 57 object copy. 128 OMNETPP_BITMAP_PATH. 31. 32 numeric. 73. 85. 72 MSVC. 35 nedtool. 56. 71 libraries. 24 numInitStages(). 18. 22 network definition. 11 description. 8 graphical interface. 21 expressions. 146 index operator. 183 identifiers.
84 PARSEC. 162 samples(). 85. 57 path(). 107 rng-class. 152 payloadLength. 34. 152 print-banners. 217 outputvectormanager-class. 214. 73 ownership. 81 senderModuleId(). 166 printf(). 125. 106. 75 sed. 109 RadioMsg. 72. 163 perl. 191 pointerValue(). 89 setContextPointer(). rng=0). 8. 81 sendingTime(). 218 runs-to-execute. 163 send. 154. 201 parallel-simulation. 135. 71. 187. 160 segmentation fault. b. 46. 152 output-vector-file. 145 gate. 108 pop(). 170 variables.. 114 Register_Class(). 82 senderGateId(). 109 order. 94 queue iteration. 153. 217 routing support. 107 parList(). 126 recordScalar(). 201 optimistic. 137. 118 saveToFile(). 217 overflowCell(). 121 Scalars. 62 scalar file. 105 random(). 111 parallel simulation. 187. 126 output-scalar-file. 37 receive timeout.. 28. 121 numbers from distributions. 116 remoteNode(). 67. 99. 47. 137. 173 self-message. 99. 116 output file. 64. 191 scheduleAt(). 51. 65–67. 217 scheduleStart(). 215 Register_Class(MyRNGClass). 82 231 . 136 packets. 153 seed-N-mt. 51. 154 vector file. 116 remoteGateId(). 114 run(). 68. 154. 8 scalars. 93 PDES. 136. 67 send(). 100 preload-ned-files. 47. 216 Register_Function(). 139 ownerModule(). 188 vector object. 189.OMNeT++ Manual – INDEX outLinks(). 108. 108 remoteGate(). 154. see module parameters parentModule(). 126.. 8. 46. 84 result accuracy. 107 seeds. 82 removeObject(). c. 8 seed-N-lcg32.(). 66 cancelling. 51–53. 102. 114 poisson(lambda. 132. 28 rng(). 100 RadioMsgDescriptor. 109 power. 124 rng. 152 outputscalarmanager-class. 87 set. 65 receive().. 163 scheduler-class. 117 pause-in-sendmsg. 109. rng=0). 126 vector. 35 Plove. 190 redirection(). 121 real time. 81 sendDelayed().ArraySize(). 153. 217. 81 setControlInfo(cPolymorphic *controlInfo). 152. 153 parameters. 201 pdf(). 153 seedtool. 120 owner(). 140 removeControlInfo(). 81. 62–64. 104 properties. 73 pareto_shifted(a. 28. 201 conservative. 64 senderGate(). 82 set. 41. 157. 64 sendDirect(). 112 random number generator. 79 par(). 65 record(). 121 performance-display. 116 remove(). 110. 100 random numbers. 117 paths(). 81.
128. 107 type(). 37 simulation time limits. 217 topology. 32 perfect shuffle. 127. 152. 217 time units. 164 kernel. 173 transferTo(). 132 stddev(). 108 truncnormal(mean. 52 for Tkenv. 33 random. 32. 105 simulation. 130. 88 unsigned int. 69. see module submodule(). 54. 83. 154. 93 setTimeStamp(). 75 state transition. 127. 88. 213 setName(). 32 total-stack-kb. 46. 28. 121 transformed(). 154 snapshot-file.OMNeT++ Manual – INDEX setDatarate(). 173 underflowCell(). 8 user interface. 161. 77 setError(). 55. 33 description. c. 28. stddev. 132 std::string info(). 179 setPayloadLength(). 189. 77 setDelay(). 25 skiplist. 51 switch(). 24 Tkenv. 71 splitvec. 77 setjmp(). 131. 8 concepts. 113. 216–218 TOmnetTkApp. 11 butterfly. 117 templates. 58 transmission time. 124. 109 take(). 73 TOmnetApp. 147 TCmdenv. 213 tail(). 107 truncnormal(). 120 uniform(a. 118 stack. 62. 107 unsigned char. 72. 33 tree. 37 configuration file. 191. 80 shared libraries. 105 strToSimtime0(). 172 usage. 41 transmissionFinishes(). 107 submodule. 166 sim-time-limit. 212 building. 118 steady states. 192 sprintf(). 71 sizeof(). 39 snapshot file. b. 158. 118 suspend execution. 130 size. 8. 69. 146 status-frequency. 146 shared objects. 67 SingleShortestPaths(). 31 shortest path. 116 stringValue(). 133 takeOwnership(). 113 strToSimtime(). 117 size(). 117 tcl2c. 213 multiple runs. 167 TCL_LIBRARY. 128 snapshot(). 151 running. 58 sTopoLinkIn. 143. 114 targetNode(). 164 toGate(). 114 ulimit. 125 transient states. rng=0). 130. 54 violation. 103 sqrSum(). 28. 163 std::string detailedInfo(). 33 patterns. 59 SwitchToFiber(). 165 short. 174 overflow. 217 sourceGate(). 120. 70 triang(a. 53. 120 transient detection. 152 snapshotmanager-class. rng=0). 28. 53 transform(). rng=0). 70. 33 mesh. 39. b. 71. 172 starter messages. 58 static linking. 105 simtimeToStr(). 9 simulation time. 52. 73 sum(). 211. 8 debugging. 173 too small. 212. 7 external source. 130 stackUsage(). 115 show-layouting. 66 simtime_t. 101. 34 hypercube. 8. 95 shortest path. 105 student_t(i. 153. 88 232 . rng=0). 152 simTime().
45. 101. 107 xml. 127. 149 variance(). 28. 47. b. 166 use-mainwindow. 88 unweightedSingleShortestPathsTo(). 51–53. 64–66 waitAndEnqueue(). 166 update-freq-fast.OMNeT++ Manual – INDEX unsigned long. 117 update-freq-express. 26 xmlValue. 166 user interface. rng=0). 88 unsigned short. 118 virtual. 165 zero stack size. 14 xmldoc(). 128. 88 virtual time. 167 weibull(a. 65 WATCH(). 37 wait(). 8. 114 xxgdb. 46 233 . | https://www.scribd.com/doc/59959656/OMNET | CC-MAIN-2017-09 | refinedweb | 77,034 | 52.26 |
You've Got 6 Months To Become A Millionaire. Here Are 10 Ways To Make It Happen.
How to become a millionaire this year (is it actually.
Amazing writers are urgently needed a good content writers and business planner are needed for this care.. fi....
Control the execution of the plans and programs of the human resources subsystems in a central human resources unit, planning and applying the technical guidelines in the development of the plans and programs, to adapt the rules and procedures according to the needs of the resources system humans..... :-)
Please Sign Up or Login to see details..
Need a platform to upload, view, edit and track financial documents for a banking firm using Laravel
I have put together this financial model. It’s not very clean and looking for someone who can make is nicer and professional.
We will be providing 1.Planning(which will include floor plan with seating) 2.3d modelling 3. Realistic renders.. The...growth opportunities. Be a part of)....
Need someone who can work on financial econometric models and examine the series of stock price and return (need to use CAPM)
I need to up...forecast inf is manually replaced in feeder excel tabs with actual information from our accounting system. This requires two steps: 1. Consolidate the two entities into one dataset from our ERP 2. Input this data into the feeder excel tabs in the forecast model, over-writing the previous forecast with actuals. Once this is done, I manually amend a summary output sheet to report on the revised Financial Year forecast. FRUSTRATIONS / areas for improvement 1. The process is very manual, disjointed and subject to human error; it also takes a lot of time 2. There is not currently an easy way to do a variance analysis of monthly / periodic actuals v previous budget on a consolidated basis. 3. The summary reports are very basic and can be improved with visualisation / gra... purch
.. to ... s.., ... contact:...... system with PF, Gratuity etc to be defined • Standard Expense Management with department and account heads that can be created and item can be selected within the head. • At start of financial year each department will be given a budget • Generation of Ledger in a particular format (format will be provided) • Dashboard to show active members, members with pending fee, members with late fee, upcoming event for venue, over all expenditure vs budget for year, individual department budget/expense (color change if nearing budget and red if over.
How to become a millionaire this year (is it actually possible?).
Determine how much money you should earn monthly to cover your expenses and save for the rainy day.
Has financial planning for your startup become a nightmare? Here are some expert tips for you. | https://www.freelancer.pk/job-search/financial-planning/ | CC-MAIN-2022-27 | refinedweb | 461 | 55.13 |
5.9. Network in Network (NiN)¶
LeNet, AlexNet, and VGG all share a common design pattern: extract the spatial features through a sequence of convolutions and pooling layers and then post-process the representations via fully connected layers. The improvements upon LeNet by AlexNet and VGG mainly lie in how these later networks widen and deepen these two modules. An alternative is to use fully connected layers much earlier in the process. However, a careless use of a dense layer would destroy the spatial structure of the data entirely, since fully connected layers mangle all inputs. Network in Network (NiN) blocks offer an alternative. They were proposed by Lin, Chen and Yan, 2013 based on a very simple insight - to use an MLP on the channels for each pixel separately.
5.9.1. NiN Blocks¶
We know that the inputs and outputs of convolutional layers are usually four-dimensional arrays (example, channel, height, width), while the inputs and outputs of fully connected layers are usually two-dimensional arrays (example, feature). This means that once we process data by a fully connected layer it’s virtually impossible to recover the spatial structure of the representation. But we could apply a fully connected layer at a pixel level: Recall the \(1\times 1\) convolutional layer described in the section discussing channels. This somewhat unusual convolution can be thought of as a fully connected layer processing channel activations on a per pixel level. Another way to view this is to think of each element in the spatial dimension (height and width) as equivalent to an example, and the channel as equivalent to a feature. NiNs use the \(1\times 1\) convolutional layer instead of a fully connected layer. The spatial information can then be naturally passed to the subsequent layers. The figure below illustrates the main structural differences between NiN and AlexNet, VGG, and other networks.
Fig. 5.12 The figure on the left shows the network structure of AlexNet and VGG, and the figure on the right shows the network structure of NiN.
The NiN block is the basic block in NiN. It concatenates a convolutional layer and two \(1\times 1\) convolutional layers that act as fully connected layers (with ReLu in between). The convolution width of the first layer is typically set by the user. The subsequent widths are fixed to \(1 \times 1\).
In [1]:
import gluonbook as g
5.9.2. NiN Model¶
NiN was proposed shortly after the release of AlexNet. Their convolutional layer settings share some similarities. NiN uses convolutional layers with convolution\).
In addition to using NiN blocks, NiN’s design is significantly different from AlexNet by avoiding dense connections entirely: Instead, NiN uses a NiN block with a number of output channels equal to the number of label classes, and then uses a global average pooling layer to average all elements in each channel for direct use in classification. Here, the global average pooling layer, i.e. the window shape, is equal to the average pooling layer of the input spatial dimension shape. The advantage of NiN’s design is that it can significantly reduce the size of model parameters, thus mitigating overfitting. In other words, short of the average pooling all operations are convolutions. However, this design sometimes results in an increase in model training time.
In [2]:.
In [3]:)
5.9.3. Data Acquisition and Training¶
As before we use Fashion-MNIST to train the model. NiN’s training is similar to that for AlexNet and VGG, but it often uses a larger learning rate.
In [4]: 2.2230, train acc 0.169, test acc 0.234, time 100.2 sec epoch 2, loss 1.6444, train acc 0.384, test acc 0.546, time 96.3 sec epoch 3, loss 1.2441, train acc 0.535, test acc 0.604, time 96.3 sec epoch 4, loss 1.0579, train acc 0.599, test acc 0.641, time 96.4 sec epoch 5, loss 0.9600, train acc 0.630, test acc 0.648, time 96.4 sec
5.9.
5.9.5. Problems? | http://gluon.ai/chapter_convolutional-neural-networks/nin.html | CC-MAIN-2019-04 | refinedweb | 683 | 59.19 |
A = 16 _COLS = 16 # class, just to draw a grid of button, also # should rotate. class grid(ui.View): def __init__(self): self.btns = [] # just create the buttons rows * columns __USE_COPY = False if not __USE_COPY: start = time.time() for i in range((_COLS * _ROWS) ): btn = ui.Button(title = str(i)) btn.action = self.hit_test self.btns.append(btn) self.add_subview(btn) finish = time.time() else: start = time.time() btn = ui.Button() for i in range((_COLS * _ROWS) ): new_btn = copy.copy(btn) new_btn.title = str(i) new_btn.action = self.hit_test self.btns.append(new_btn) self.add_subview(new_btn) finish = time.time() print finish - start self.style() def style(self): self.background_color = 'white' for btn in self.btns: btn.background_color = 'red' btn.tint_color = 'white' btn.border_width = .5 def layout(self): if self.superview: self.frame = superview.bounds w,h = self.width / _COLS, self.height / _ROWS x = y = 0 for btn in self.btns: btn.width, btn.height = w,h btn.x, btn.y = x * w, y * h x += 1 if not x % _COLS : x = 0 y += 1 def hit_test(self, sender): print 'hit - ', sender.title if __name__ == '__main__': x = grid().present('')
When timing things, I like to use
elapsed_time.pywhich allows you to write:
with timer("download Pythonista Forums page"): html = requests.get('').text
and it will print
Elapsed time (download Pythonista Forums page): 0:00:00.513742
I ran some timings and did not see much difference between the two approaches:
Elapsed time (True): 0:00:00.285801 Elapsed time (True): 0:00:00.258893 Elapsed time (True): 0:00:00.270147 Elapsed time (True): 0:00:00.289374 Elapsed time (True): 0:00:00.283184 --> avg. 0.2774798 --> 8.56% faster Elapsed time (False): 0:00:00.369390 Elapsed time (False): 0:00:00.278358 Elapsed time (False): 0:00:00.288801 Elapsed time (False): 0:00:00.280331 Elapsed time (False): 0:00:00.289258 --> avg. 0.3012276
In both cases it almost always takes less than a third of a second to build all the cells.
@ccc, I will run some timings later. I am sure I seen 80 to 90% increase. I did run it multiple times to make sure it wasn't a caching issue. Oh, well, I will just split them out 2 Functions and run the timings as you have with your timer function to see.
I ran it on an iPad 2 air, what did you run it on? I will also try my iphone 6 later, will be interesting to compare.
Thanks again
import platform ; platform.platform()# --> 'Darwin-14.0.0-iPad3,4-32bit'
I am running iOS 8.3 so why is it still 32-bit??
Elapsed time (False 16x16): 0:00:00.199482
Elapsed time (False 16x16): 0:00:00.221685
Elapsed time (False 16x16): 0:00:00.176133
Elapsed time (False 16x16): 0:00:00.166889
Elapsed time (False 16x16): 0:00:00.192668
avg 191371
Elapsed time (True 16x16): 0:00:00.106144
Elapsed time (True 16x16): 0:00:00.103462
Elapsed time (True 16x16): 0:00:00.121247
Elapsed time (True 16x16): 0:00:00.109012
Elapsed time (True 16x16): 0:00:00.104777
avg 108,928
approx 43% speed increase
Darwin-14.0.0-iPad5,4-32bit
not sure why 32bit, this is what i get
Sorry, tried to fix the formatting 3 times without luck
@ccc, I don't understand the contextlib at all. I sort of think I know what your timer code is doing. I run the below code and it seems ok. Wanted to ask you if the below code is ok, or are there side effects I don't understand?
the code below can not run, it's just the concept
if __name__ == '__main__': def month_changing(sender, d) : if _DEBUG :print 'holy crap, month will change', sender, d with timer('Create Calender'): d = datetime.datetime(2015,11, 5) x = cal_view(200, date = d ) with timer('set an attribute'): x.day_widgets[15].day_ind_visible(True) x.month_will_change = month_changing x.present('sheet')
To mix it up a little further.... I assume it all works. Just want to double check.
if __name__ == '__main__': def month_changing(sender, d) : with timer('Month Changing'): if _DEBUG :print 'holy crap, month will change', sender, d pass with timer('Create Calender'): d = datetime.datetime(2015,11, 5) x = cal_view(200, date = d ) with timer('set an attribute'): x.day_widgets[15].day_ind_visible(True) x.month_will_change = month_changing x.present('sheet')
If the code above could run then it would run just as you expect it to run. :-)
The
contextlibstuff is supercool in a mind bending way because it allows you to build your own
with xxx:context managers thru the magic of the builtin
yieldcommand which is the like the quantum leap of Python.
Yieldand
yield fromare not easy to get fixed in you mind but they can be quite powerful once mastered.
@ccc, ok thanks. Still learning the simple stuff at the moment. But will put it on my to learn list, it's a big list :) I am sure you got my meaning. The code runs, just too much to include here, wanted to show a real example rather than some test code.
Thanks... | https://forum.omz-software.com/topic/1873/a-class-just-to-draw-a-grid-of-buttons-has-some-interesting-options | CC-MAIN-2017-51 | refinedweb | 863 | 87.82 |
in reply to Re3: Encapsulation through stringification - a variation on flyweight objectsin thread Encapsulation through stringification - a variation on flyweight objects
This]
The documented API are the methods uuid, load, save & mark. The hash key _change is an implementation detail.
Now, Mary's writing a module for representing the state of vending machines. She needs the information to persist, finds Persist on CPAN, and decides to use this as her base class.]
Now, despite sticking to the published API, Mary is going to have a nasty time debugging her code. She'll have to go and read the source for Persist to find out that Bob's implementation detail ($self->{_change} = boolean value indicating whether an object has changed) clashes with her implementation detail ($self->{_change} = object representing available change in the vending machine).
Note this is not deliberate. Mary is not sneaking a look inside Bob's module and using the hash for her own nefarious means - it's an accident.
You get exactly the same issue with "private" methods. What if Bob decides to extend Persist to only load the objects when needed. As part of this he adds a _loaded method that will return true when the object is fully loaded from backing store. Without changing the published API his new version of Persist will break when used with Mary's old VendingMachine module - because it clashes with Mary's _loaded method. Nasty.
There are, of course, ways around these issues. You can use inside out objects to get around problems with attribute clashes. You can use alternate calling styles to get around problems with private methods. However these, and other techniques, all require a fair amount of discipline and expertise to use well.
Good encapsulation is a pretty darn basic feature of an object oriented language. In my opinion its absence hurts perl. It makes it harder to write good modular reusable code. It makes it easier for people to score points in those pointless language flame fests. Good encapsulation should be a basic part of perl (and will be in perl6... huzzah!).
Enough ranting :-) You might also find these exchanges on private attributes and private methods of interest.
Does that accurately sum it.
Pretty much.
It might be useful to separate out the concepts of encapsulation and data-hiding.
A package global variable is encapsulated within it's package (declaring $Foo::fribble does not interfere with $Bar::fribble), but it's not hidden (you can access $Foo::fribble from the Bar package by explicitly stating the package name).
Contrast this with a lexical variable which is both encapsulated within its scope and hidden from other code (ignoring closures and PadWalker :-)
Language support for the encapsulation of class state and behaviour is, for me, the big lack in perl5 OO.
Using the default perl OO style of key/value pairs in a hashref to represent an objects state gives you a single namespace for attributes across all the classes that the object belongs to. The same applies to methods. Using the normal $self->method style means you have a single namespace for methods across all the classes the object belongs to. They are not encapsulated.
Imagine having to develop functional/procedural perl modules without packages. You would have to make sure that every module used different subroutine names and different global variables. While the situation isn't so desperate in the perl5 OO world, because deep inheritence hierarchies are rare, it can still be a problem.
In perl5 you cannot encapsulate the implementation details of your class from its public interface easily - its complex (e.g. lexical closures), non-obvious (e.g. inside out objects) and can involve a lot of developer overhead (e.g. prefixing all attributes with the package name and remembering to call all private methods as subroutines).
This is why I'm looking forward to things like submethods in perl6 ;-)
Yes
No
Results (278 votes). Check out past polls. | http://www.perlmonks.org/index.pl?node_id=247643 | CC-MAIN-2017-13 | refinedweb | 657 | 55.03 |
Welcome to the third post in my Doing Crystal series. In this post I'll be focusing on Crystal's type system, it's benefits, and the drawbacks. If you haven't read the other articles in this series you can find them here, and here for posts one and two respectively.
Static vs Dynamic Typing
Static typing has existed in programming for years, going back as far as FORTRAN which was first released back in 1957. Now in truth all programming languages are typed, even languages such as JavaScript and Ruby have types such as Integers, Arrays, and Strings. This is necessary because in the real world things have specific properties which are unique to that thing. Numbers and strings are inherently different and, even though you could technically add a number to a string by taking the string down to its binary representation and adding the number to that, in real world terms it just doesn't make sense. Hence, we have types.
The difference is in how the types are handled. With languages like JavaScript and Ruby types are handled dynamically. This allows you to do things like the following Ruby example:
def first_and_last(arr) if arr.length > 0 return [arr.first, arr.last] end [] end puts first_and_last(["Hello", "fellow", "developers"]) # => ["Hello", "developers"] puts first_and_last(42) # => NoMethodError (undefined method `length' for 42:Integer)
As you can see, the method
first_and_last is supposed to accept an Array and return the first and last elements as a new Array. It works fine when handed the type of data it expects, but when handed a number it throws a runtime error
NoMethodError. Dynamic typing can be extremely handy, but it can also be detrimental as a large number of runtime errors (or errors that occur while your program is running as opposed to when it's compiled) occur when the program attempts to use a method that doesn't exist, or when a variable's type changes unexpectedly.
Now let's look at the same code from before, but in Crystal.
def first_and_last(arr : Array(U)) forall U if arr.size > 0 return [arr.first, arr.last] end [] of U end puts first_and_last(["Hello", "fellow", "developers"]) puts first_and_last(42)
For this one I didn't show an output. Why? Because the program won't compile. Let's go over the program line by line, and then I'll explain why the compilation fails.
def first_and_last(arr : Array(U)) forall U
First we do a method definition. This is similar to the Ruby example, but there a a couple of important differences. First we have the weird
arr : Array(U) syntax. This is setting the property name to
arr and the type of
arr to an
Array of type
U.
U in this case is a placeholder type, and outside the scope of this tutorial, but suffice it to say it allows
U to be anything. The
forall U part at the end creates the
U generic.
if arr.size > 0 return [arr.first, arr.last] end
This is exactly the same as the Ruby example save the slight method name change for getting the size of an array. In Ruby it's
length and in Crystal it's
size.
[] of U
In Crystal all things have a specific type. This prevents runtime errors and lowers memory usage since the program can allocate the resources it knows it needs. As such, all Arrays, Hashes, Sets, etc. have to be explicitly typed and that is what this line is doing. If the Array the method is handed doesn't have anything in it we just return an empty Array. Truthfully we probably should've returned the same array we were given, but I wanted to show an example of assigning an Array a type.
puts first_and_last(["Hello", "fellow", "developers"])
This line will work as expected and return
["Hello", "developers"].
puts first_and_last(42)
This is the line that breaks things. Our method expects an
Array, but instead we handed it an
Int32. Because of this breach of contract the compiler throws an exception.
no overload matches 'first_and_last' with type Int32 Overloads are: - first_and_last(arr : Array(U)) first_and_last(42) ^~~~~~~~~~~~~~
Yes, it's still an error, but this time it's happening before you release your code. Catching bugs early is a wonderful thing.
Type Declaration in Crystal
You've seen a little of how types are declared in Crystal, now let's look at some more examples. Types are almost always declared in the following way:
# var_name : Type arr : Array(Int32) = [1, 2, 3] str : String = "Hello, world!" int : Int32 = 42 hash : Hash(String, String) = {"user" => "watzon"}
Like with Ruby, everything in Crystal is an Object and all Objects are valid Types, so custom classes, structs, etc. are also valid types. Now, there is another way to declare a type when it comes to Hashes and Arrays.
arr : Int32 arr = [] of Int32 # Assigning type declaration hsh : Hash(String, String) hsh = {} of String => String # Assigning type declaration
With most types (Int, String, Class) you can just assign the object to a variable without explicitly declaring the type. This is called type inference and it's extremely handy. You can do the same with Arrays and Hashes as well, provided they contain data, but if they're empty as in the previous example you will have to explicitly declare the type of the Array or Hash.
Type Inference
Type inference is a handy feature that almost gives the appearance of dynamic typing... sometimes. Let's use our first example again.
def first_and_last(arr : Array(U)) forall U if arr.size > 0 return [arr.first, arr.last] end [] of U end
Because we explicitly declare that the parameter
arr is an Array we know that that parameter will have several helpful methods that allow us to act on the data stored in the Array. Array, however, is not the only class to contain many of those methods. There are other enumerable classes in Crystal that have
#size,
#first, and
#last methods such as
Set and
Deque. Currently though, you could not use any of those classes in our
first_and_last method. You could of course do this:
def first_and_last(arr : Indexable(U)) forall U if arr.size > 0 return [arr.first, arr.last] end [] of U end
Now any class that includes the
Indexable module can be passed into
first_and_last, but there is an easier, albeit less explicit way to handle things.
def first_and_last(arr) if arr.size > 0 return [arr.first, arr.last] end arr end
But wait, where did the types go? They're still there don't worry, but now instead of you having to explicitly declare the type of the parameter
arr the compiler will infer the type based on what operations you perform on it. There are several classes that have
#first,
#last, and
#size methods, and now all of them are valid inputs.
Union Types
One very powerful aspect of Crystal's type system is the ability to create type "unions". Here is an example of a union type.
arr = [] of Int32 | String
The pipe
| operator creates a union between two types, allowing you to use either both
Int32 and
String types in that array. How awesome is that? Union types can also be generated dynamically by the compiler.
arr = ["Age", 32]
The variable
arr in this case would be assigned the type
Array(String, Int32) by the compiler. This also, of course, means that any operations performed on the data in the array have to check the type of the item before doing anything, unless they are doing something that is applicable to both types. For example:
arr = ["Age", 32] arr.map { |a| a.chars }
chars is a method that exists on the
String class and returns an array of all the characters in the String. The method does not, however, exist on the
Int32 class. Because of that this code will not compile. Instead you'd have to do something like the following:
arr = ["Age", 32] arr.map { |a| a.chars if a.is_a?(String) }
Things can definitely get messy when dealing with unions, so keep that in mind.
Conclusion
Crystal's type system is very powerful and I've really only scratched the surface. If you want to learn more about it I'd suggest looking at the Crystal reference.
Please don’t forget to hit one of the the Ego Booster buttons (personally I like the unicorn), and if you feel so inclined share this to social media. If you share to twitter be sure to tag me at @_watzon.
Some helpful links:
Find me online:
Discussion (2)
Nice explanations. Crystal looks very cool. Keep the great posts!
Thanks for reading! | https://practicaldev-herokuapp-com.global.ssl.fastly.net/watzon/doing-crystal-3-types-types-types-5gdf | CC-MAIN-2021-10 | refinedweb | 1,453 | 72.97 |
In this Python tutorial, we will learn how to get the absolute value in Python. First, we will use one of Pythons built-in functions abs() to do this. In this section, we will go through a couple of examples of how to get the absolute value. Second, we will import data with Pandas and use the abs method to get the absolute values in a Pandas dataframe.
For those of us who prefer audio-visual tutorials, there’s also a YouTube video explaining the content of this absolute value in Python tutorial (check the end of the post).
Python Absolute Value Tutorial
Now, before we go on with the examples on how to get the absolute value of a number using Python, we will go quickly into what absolute value is:
What is an absolute value?
Pretty simple; it means how far a value is from zero.
Python abs() Function
The Python abs() function is one of the math functions in Python. This function will return the positive absolute value of a specific number or an expression. In the next sections, we will see plenty of examples of how to get the absolute value in Python. First, however, we are going to have a look at the syntax of the abs() function.
Python abs syntax
The syntax of the abs() function in the Python programming language is as shown below:
abs(x)
Now, x can be any number that we want to find the absolute value for. For instance, if x is positive or negative zero, Pythons abs() function will return positive zero.
If we, however, put in something that is not a number we will get a TypeError (“bad operand type for abs(): ‘str’”.
How to get Absolute Value in Python with abs() Example 1
The abs function will enable us to find the absolute value of a numeric value. In this how-to get absolute value in Python example, we are going to find the absolute values of different data and display the output.
abs(-33)
Python abs() Example 2
Now, if we have a list of numbers, we cannot use the abs() function as we did in the first example. Note, if we do we get a TypeError, again. Thus, in this example, we are going to use Python list comprehension and the abs() function.
numbers = [-1, -2.1, -3, -444] [abs(number) for number in numbers]
Note, it is also possible to import the math module and use the fabs() method to get the absolute value of a number in Python. However, when using fabs(), we will get the absolute value as a float:
import math math.fabs(-33)
Python get Absolute Values in Python using Pandas
Now, if we want to get absolute values from a dataset we can use Pandas to create a dataframe from a datafile (e.g., CSV). In this Python absolute value example, we are going to find the absolute values for all the records present in a dataframe. First, we will use Python to get absolute values in one column using Pandas abs method. Second, we will do the same but this for two columns in the dataset. Finally, we will get the absolute values for all columns in the Pandas dataframe.
Now, for this absolute value in Python example, we are going to use the CSV data in the image above. If needed, see the post about Pandas read csv method to understand the steps in importing data from a CSV file. Here’s how to do it, with the example file (python_absolute_value.csv):
import pandas as pd df = pd.read_csv('python_absolute_value.csv')
Now, when we have the data loaded we are ready to get the absolute values using Python Pandas.
Python Pandas Absolute Values Example 1
In the first Python absolute values example using Pandas, we are going to select one column (“D”):
df['D'].abs()
Python Pandas Absolute Values Example 2
Now, in the second absolute values in Python example, we are going to select two columns (“D” and “F”):
df[['D', 'F']].abs()
Now, if needed there’s more information about slicing and indexing Pandas dataframes in that post.
Python Pandas Absolute Values Example 3
Finally, we are going to get the absolute values from all columns in the Pandas dataframe:
df.abs()
Absolute Value in Python YouTube Tutorial:
Here’s a YouTube tutorial explaining, by examples, how to get the absolute value in Python:
Conclusion: Absolute Value in Python
Now, in this post, we learned how to get the absolute value in Python. It was pretty simple, we just used the abs() function. Second, we learned how to do the same task but with data stored on our computers (e.g., from a CSV file).
| https://www.marsja.se/how-to-get-absolute-value-in-python-with-abs-and-pandas/ | CC-MAIN-2020-24 | refinedweb | 791 | 60.45 |
- Author:
- sleytr
- Posted:
- June 15, 2007
- Language:
- Python
- Version:
- .96
- mail permission
- Score:
- 0 (after 0 ratings)
You can use this method to send information mails to the related staff members about section specific site activity. All users which explicitly permitted to 'change' given object will be informed about activity.
If you defined get_absolute_url in your model then you can simply use it like this;
` obj=form.save()
mail2perm(obj) `
Or you can define your custom urls ;
from util.mail2perm import mail2perm,domain
reply=get_object_or_404(Reply,user=request.user,pk=id)
mail2perm(reply,url=''%(domain,reply.id))
Please login first before commenting. | https://djangosnippets.org/snippets/287/ | CC-MAIN-2017-43 | refinedweb | 102 | 50.73 |
In over 20 years programming this is the single best overview of any language ever!
[Comment by Member 11032252]
JavaScript was developed in 10 days in May 1995 by Brendan Eich, then working at Netscape, as the HTML scripting language for their browser Navigator 2 (more about history). Brendan Eich said (at the O'Reilly Fluent conference in San Francisco in April 2015): "I did JavaScript in such a hurry, I never dreamed it would become the assembly language for the Web".).
This article, which is also available as a PDF file, has been extracted from the book Building Front-End Web Apps with Plain JavaScript, which is available as an open access online book. It tries".
string
number
boolean
v
typeof(v)
typeof(v)==="number"
There are five basic reference types: Object, Array, Function, Date and RegExp. Arrays, functions, dates and regular expressions are special types of objects, but, conceptually, dates and regular expressions are primitive data values, and happen to be implemented in the form of wrapper objects.
Object
Array
Function
Date
RegExp;
null
the special data value undefined, which is the implicit initial value of all variables that have been declared but not initialized.
undefined Bond") ...
The number of characters of a string can be obtained by applying the length attribute to a string:
length).
3.1e10
NaN
isNaN(
)
Unfortunately, a built-in function, Number.isInteger, for testing if a number is an integer has only been added).
Number.isInteger
parseInt
parseFloat
n
String(n)
Like in Java, there are two pre-defined !!.
true
false
!
&&
||
!!
For equality and inequality testing, always use the triple equality symbols === and !== instead of the double equality symbols == and !=. Otherwise, for instance, the number 2 would be the same as the string "2", since the condition (2 == "2") evaluates to true in JavaScript.
===
!==
==
!=
(2 == "2")
Assigning an empty array literal, as in var a = [], is the same as invoking the Array() constructor without arguments, as in var a = new Array().
var a = []
Array()
var a = new Array()
Assigning an empty object literal, as in var o = {}, is the same as invoking the Object() constructor without arguments, as in var o = new Object(). Notice, however, that an empty object literal {} is not really empty, as it contains properties and methods inherited from Object.prototype. So, a truly empty object has to be created with null as prototype, like in var o = Object.create( null).
var o = {}
Object()
var o = new Object()
{}
Object.prototype
var o = Object.create( null)
x
typeof(x)==="string"
typeof(x)==="boolean"
String(x)
Boolean(y)
typeof(x)==="number"
parseFloat(y)
Number.isInteger(x)
parseInt(y)
typeof(x)==="object"
x.toString()
JSON.stringify(x)
JSON.parse(y)
Array.isArray(x)
y.split()
typeof(x)==="function"
new Function(y)
x instanceof Date
x.toISOString()
new Date(y)
x instanceof RegExp
new RegExp(y)
*) May require a polyfill.
window
for
function foo() {
for (var i=0; i < 10; i++) {
... // do something with i
}
}
Instead, and this is exactly how JavaScript is interpreting this code,:
<script>
'use strict';
It is generally recommended that you use strict mode, except your code depends on libraries that are incompatible with strict mode.
A JS object is essentially a set of name-value-pairs, also called slots, where names can be property names, function names or keys of a (hash) map. Objects can be created in an ad-hoc manner, using JavaScript's object literal notation (JSON), without instantiating a class:
var person1 = { lastName:"Smith", firstName:"Tom"};
var o1 = Object.create( null); // an empty object with no slots
JS only have property slots. function slots like, for instance,
var person1 = {
lastName: "Smith",
firstName: "Tom",
getFullName: function () {
return this.firstName +" "+ this.lastName;
}
}; more advanced namespace mechanism can be obtained by using an mmediately invoked JS function expression, as explained below.
A typed object instantiates a class that is defined either by a JavaScript constructor function or by a factory object. See the section “Defining and using classes” below.
A JS array represents, in fact, the logical data structure of an array list, which is a list where each list item can be accessed via an index number (like the elements of an array). Using the term 'array' without saying 'JavaScript array' creates a terminological ambiguity. But for simplicity, we will sometimes just say 'array' instead of 'JavaScript array'.
A variable may be initialized with a JavaScript
a[4] = 7;
The contents of an array a are processed with the help of a standard for loop with a counter variable counting from the first array index 0 to the last array index, which is a.length-1:
a.length-1
for (i=0; i < a.length; i++) { ...}
Since arrays are special types of objects, we sometimes need a method for finding out if a variable represents an array. We can test, if a variable a represents an array with Array.isArray( a).
Array.isArray( a)
For adding a new element to an array, we append it to the array using the push operation as in:
push
a.push( newElement);
For deleting an element at position i from an array a, we use the pre-defined array method splice as in:
i
splice
a.splice( i, 1);
For searching a value v in an array a, we can use the pre-defined array method indexOf, which returns the position, if found, or -1, otherwise, as in:
indexOf
if (a.indexOf(v) > -1) ...
For looping over an array a, we have two options: for loops, or the array method forEach. In any case, we can use a for loop, as in the following example:
forEach
var i=0;
for (i=0; i < a.length; i++) {
console.log( a[i]);
}
If performance doesn't matter, that is, if a is sufficiently small (say, it does not contain more than a few hundred elements), we can use the pre-defined array method forEach, as in the following example, where the parameter elem iteratively assumes each element of the array a as its value:
elem
a.forEach( function (elem) {
console.log( elem);
})
For cloning an array a, we can use the array function slice in the following way:
slice pre-defined function Object.keys(m), which returns an array of all keys of a map m. For instance,
Object.keys(m)
m pre-defined delete operator as in:
delete:
Object.keys iportant types of data structures supported by JavaScript are:
array lists, such as ["one","two","three"], which are special JS objects called 'arrays', but since they are dynamic, they are rather array lists as defined in the Java programming language.
["one","two","three"]
records, which are special JS objects, such as {firstName:"Tom", lastName:"Smith"}, as discussed above,
{firstName:"Tom", lastName:"Smith"}
maps, which are also special JS objects, such as {"one":1, "two":2, "three":3}, as discussed above,
{"one":1, "two":2, "three":3}
entity tables, like for instance the Table 2 shown below, which are special maps where the values are entity records with a standard ID (or primary key) slot, such that the keys of the map are the standard IDs of these entity records.
Notice that our distinction between maps, records and entity tables in JavaScript is a purely conceptual distinction, which is not supported by the JavaScript execution semantics. For a JavaScript engine, both {firstName:"Tom", lastName:"Smith"} and {"one":1, "two":2, "three":3} are just objects, and it would interpret the map-style object {"one":1, "two":2, "three":3} in the same way as the record-style object {one:1, two:2, three:3}. in a map.
{one:1, two:2, three:3}
"one"
"two"
Making such conceptual distinctions helps in the logical deign of a program, and mapping them to syntactic distinctions, even if they are not interpreted differently, helps to better understand the intended computational meaning of the code and therfore improves its readbility.
As shown in Figure 1 below, JS functions are special JS objects, having an optional name property and a length property providing their number of parameters. If a variable v references a function can be tested with
name
if (typeof( v) === "function") {...}
Since JS functions are JS objects, they can be stored in variables, passed as arguments to functions, returned by functions, have properties and can be changed dynamically. Therefore, functions are first-class citizens, and JavaScript can be viewed as a functional programming language,
The general form of a function definition is an assignment of a function expression to a variable:
var myFunction = function theNameOfMyFunction () {...}
where theNameOfMyFunction is optional. When it is omitted, the function is anonymous. In any case, functions are invoked via a variable that references the function. In the above case, this means that the function is invoked with myFunction(), and not with theNameOfMyFunction().
theNameOfMyFunction
myFunction()
theNameOfMyFunction()
Anonymous function expressions are called lambda expressions (or shorter lambdas) in other programming languages.
As an example of an anonymous function expression being passed as an argument in the invocation of another (higher-order) function, we can take a comparison function being passed to the pre-defined function sort for sorting the elements of an array list. Such a comparison function must return a negative number if its first argument is:
sort
var list = [[1,2],[1,3],[1,1],[2,1]];
list.sort( function (x,y) {
return ((x[0] === y[0]) ? x[1]-y[1] : x[0]-y[0]);
});
A function declaration has the following form:
function theNameOfMyFunction () {...}
It is equivalent to the following named function definition:
var theNameOfMyFunction = function theNameOfMyFunction () {...}
that is, it creates both a function with name theNameOfMyFunction and a variable theNameOfMyFunction:
this
result
var sum = function (numbers) {
var result = 0;
numbers.forEach( function (n) {
result += n;
});
return result;
};
console.log( sum([1,2,3,4]));:
arguments:
Array.prototype.forEach
numbers:
call
var sum = function () {
var result = 0;
Array.prototype.forEach.call( arguments, function (n) {
result = result + n;
});
return result;
};
A variant of the Function.prototype.call method, taking all arguments of the method to be invoked as a single array argument, is Function.prototype.apply.
Function.prototype.call
Function.prototype.apply
Whenever a method defined for a prototype is to be invoked without a context object, or when a method defined.
bind
Function.prototype.bind
var querySel = document.querySelector.bind( document)
querySel
This pattern has been proposed in the WebPlatform.org artcile JavaScript best practices. modern software applications, especially within declared with a range/type, and with other meta-data, such as constraints. There should also be two introspection features: (2) an is-instance-of predicate that can be used for checking if an object is a direct or non-direct (with method overriding). In addition, it is desirable to have support for multiple inheritance and multiple classifications, for allowing objects to play several roles at the same time by instantiating several role classes.
There is no explicit class concept in JavaScript. (and implemented in the ES6 class syntax).
new
class
In the form of a factory object that uses the predefined Object.create method for creating new instances of a class. In this approach, the constructor-based inheritance mechanism has to be replaced by another mechanism. Eric Elliott has argued that factory-based classes are a viable alternative to constructor-based classes in JavaScript (in fact, he even condemns the use of classical inheritance and constructor-based classes, throwing out the baby with the bath water).
Object.create
When building an app, we can use both types the mODELcLASSjs library, has many advantages, which are summarized in Table 3, the constructor-based approach enjoys the advantage of higher performance object creation.
Only in ES6, a user-friendly syntax for defining constructor-based classes has been introduced (with the new keywords class, constructor, static, extends and super). This new syntax allows defining a simple class hierarchy in three steps.
constructor
static
extends
super
In Step 1.a), a base class Person is defined with two properties, firstName and lastName, as well as with an (instance-level) method toString and a static (class-level) method checkLastName:
Person
toString
checkLastName
class Person {
constructor( first, last) {
this.firstName = first;
this.lastName = last;
}
toString() {
return this.firstName + " " +
this.lastName;
}
static checkLastName( ln) {
if (typeof(ln)!=="string" ||
ln.trim()==="") {
console.log("Error: " +
"invalid last name!");
}
}
}
In Step 1.b), class-level ("static") properties are defined:
Person.instances = {};
Finally, in Step 2, a subclass is defined with additional properties and methods that possibly override the corresponding superclass methods:
class Student extends Person {
constructor( first, last, studNo) {
super.constructor( first, last);
this.studNo = studNo;
}
// method overrides superclass method
toString() {
return super.toString() + "(" +
this.studNo +")";
}
}
In ES5, we can define a constructor-based class hierarchy in the form of constructor functions, following a code pattern recommended by Mozilla in their JavaScript Guide. This code pattern requires seven steps for defining a simple class hierarchy. Because such a complex pattern is quite unwieldy, it can be preferable to use a library like cLASSjs for facilitating the definition of constructor-based classes and class hierarchies.:
prototype:
Step 2.a): Define a subclass with additional properties:
function Student( first, last, studNo) {
// invoke superclass constructor
Person.call( this, first, last);
// define and assign additional properties
this.studNo = studNo;
}
By invoking the supertype constructor with Person.call( this, ...) for any new object created, and referenced by this, as an instance of the subtype Student,.
Person.call( this, ...)
Student.
Object.create( Person.prototype)
Person.prototype
Student.prototype
new Person()
Step 2c): Define a subclass method that overrides a superclass method:
Student.prototype.toString = function () {
return Person.prototype.toString.call( this) +
"(" + this.studNo + ")";
};
An instance of a constructor-based class is created by applying the new operator to the constructor function and providing suitable arguments for the constructor parameters:
var pers1 = new Person("Tom","Smith");
The method toString is invoked on the object pers1 of type Person by using the 'dot notation':
pers1
alert("The full name of the person are: " +
pers1.toString());
When an object o is created with o = new C(...), where C references a named function with name "C", the type (or class) name of o can be retrieved with the introspective expression o.constructor.name, which returns "C". However, the Function::name property used in this expression is supported by all browsers except Internet Explorer up to version 11.
o
o = new C(
C
o.constructor.name
Function::name 1, every constructor function has a reference to a prototype as the value of its reference property prototype. When a new object is created with the help of new, its __proto__ property is set to the constructor's prototype..
__proto__
f = new Foo()
Object.getPrototypeOf(f)
f.__proto__
Foo.prototype
new Foo()
In this approach we define a JS object Person (actually representing a class) with a special create method that invokes the predefined Object.create method for creating objects of type Person:
create
var Person = {
name: :
getFullName.
writable: true
enumerable: true
In a general approach, like in the mODELcLASSjs library for model-based development, we would not repeatedly define the create method in each class definition, but rather have a generic constructor function for defining factory-based classes. Such a factory class constructor, like mODELcLASS, would also provide an inheritance mechanism by merging the own properties and methods with the properties and methods of the superclass.
JavaScript is object-oriented, but in a different way than classical OO programming languages such as Java and C++. There is no explicit class concept in JavaScript. Rather, classes have to be defined in the form of special or enumerations.
For a front-end app, we need to be able to store data persistently on the front-end device. Modern web browsers provide two technologies for this purpose: the simpler one is called Local Storage, and the more powerful one is called IndexDB."].
localStorage
getItem
setItem
removeItem
clear
localStorage["id"] = 2901465
var id = localStorage["id"]
The following example shows how to create an entity table and save its serialization to Local Storage:
var people = {};
people["2901465"] = {id: 2901465, name:"Tom"};
people["3305579"] = {id: 3305579, name:"Su"};
people["6492003"] = {id: 6492003, name:"Pete"};
try {
localStorage["personTable"] = JSON.stringify( people);
} catch (e) {
alert("Error when writing to Local Storage\n" + e);
}
Notice that we have used the predefined method JSON.stringify for serializing the entity table people into a string that is assigned as the value of the localStorage key "personTable". We can retrieve the table with the help of the predefined de-serialization method JSON.parse in the following way:
JSON.stringify
people
personTable
JSON.parse
var people = {};
try {
people = JSON.parse( localStorage["personTable"]);
} catch (e) {
alert("Error when reading from Local Storage\n" + e);
}
Good open access books about JavaScript are
Speaking JavaScript, by Dr. Axel Rauschmayer.
Eloquent JavaScript, by Marijn Haverbeke.
Building Front-End Web Apps with Plain JavaScript, by Gerd Wagner
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
records, which are special JS objects, such as {firstName:"Tom", lastName:"Smith"}, as discussed above,
maps, which are also special JS objects, such as {"one":1, "two":2, "three":3}, as discussed above,
struct person_record {
public string firstName;
public string lastName;
};
person_record pers1;
pers1.firstName = "Tom";
pers1.lastName = "Smith";
age
[10,2],[1,3],[1,1],[2,1]
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages. | https://www.codeproject.com/Articles/1006192/JavaScript-Summary | CC-MAIN-2022-27 | refinedweb | 2,903 | 53.21 |
Encapsulation vs. Inheritance
A Code Example
Take a look at a specific code example that illustrates the problem that exists between encapsulation and inheritance. Consider the following class called Mammal presented in Listing 3.
// Class Mammal public class Mammal { private String color; public void growHair(){ System.out.println("Hair Growing"); } }
Listing 3
In this class, you have a private attribute called color and a public method called growHair(). To use the Mammal class, you create an application called Packaging (the choice of this name will become clear later). This class is presented in Listing 4.
//Class Packaging public class Packaging { public static void main (String args[]){ Mammal mammal = new Mammal(); mammal.growHair(); mammal.color = "blue"; } }
Listing 4
Figure 4
You can now test your encapsulation principle by attempting to have the application access the private attribute color as seen in Listing 5.
//Class Packaging public class Packaging { public static void main (String args[]){ Mammal mammal = new Mammal(); mammal.growHair(); mammal.color = "blue"; // try to access private attribute } }
Listing 5
As you can see in Figure 5, the compiler just won't accept this.
Figure 5
This was all expected; however, try to add inheritance to the mix by adding a class called Dog, as seen in Listing 6.
//Class Dog public class Dog extends Mammal{ private int barkFrequency; public void bark(){ System.out.println("Dog Barking"); } }
Listing 6
Now, you can start doing some interesting things. First, you can try to access Mammal's attribute color from the Dog class—see Listing 7.
//Class Dog public class Dog extends Mammal{ private int barkFrequency; public void bark(){ System.out.println("Dog Barking"); color = "blue"; } }
Listing 7
When you run this, the compiler complains again as seen in Figure 6. Yet, this may seem incorrect. Because Dog Is-A Mammal, doesn't the Dog contain all the attributes of Mammal? In short, is it not true that Dog inherits all the attributes and methods of Mammal?
Figure they are mutually exclusive. How can this conundrum be addressed?
Because encapsulation is the primary object-oriented mandate, you must make all attributes private. Making the attributes public is not an option. Thus, it appears that the use of inheritance may be severely limited. If a subclass does not have access to the attributes of its parent, this situation presents a sticky design problem.
Page 3 of 4
| http://www.developer.com/design/article.php/10925_3525076_3/Encapsulation-vs-Inheritance.htm | CC-MAIN-2015-18 | refinedweb | 393 | 56.86 |
Type Constructor Design
A type constructor is used to initialize static data in a type. It is called by the common language runtime (CLR) before any instances of the type are created. Type constructors are static (Shared in Visual Basic) and cannot take parameters.
The following guidelines help ensure that your use of static constructors complies with best practices.
Do make type constructors private.
A type constructor, also called a class constructor or static constructor, is used to initialize a type. The CLR calls the type constructor before the first instance of the type is created or any static members on the type are called. If a type constructor is not private, it can be called by code other than the CLR. Depending on the operations performed in the constructor, this can cause unexpected behavior.
Do not throw exceptions from type constructors.
If a type constructor throws an exception, the type is not usable in the application domain where the exception was thrown.
Consider initializing static fields inline rather than explicitly using static constructors because the CLR can optimize the performance of types that do not have an explicitly defined static constructor.
The following code example demonstrates a design that cannot be optimized.
Public Class BadStaticExample Shared runId as Guid Shared Sub New() runId = Guid.NewGuid() End Sub ' Other members... End Class
public class BadStaticExample { static Guid runId; static BadStaticExample() { runId = Guid.NewGuid(); } // Other members... }
public ref class BadStaticExample { static Guid runId; static BadStaticExample() { runId = Guid::NewGuid(); } // Other members... };
The following code example can be optimized.
Public Class GoodStaticExample Shared runId as Guid = Guid.NewGuid() ' Other members... End Class
public class GoodStaticExample { static Guid runId = Guid.NewGuid(); // Other members... }
public ref class GoodStaticExample { static Guid runId = Guid::NewGuid(); // Other members... };
For more information on design guidelines, see the "Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries" book by Krzysztof Cwalina and Brad Abrams, published by Addison-Wesley, 2005.
See Also
Concepts
Other Resources
Design Guidelines for Developing Class Libraries | https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms229018(v=vs.100) | CC-MAIN-2019-22 | refinedweb | 332 | 50.84 |
Lesson 12 - Importing modules and the math module in Python
Python Basics Importing modules and the math module in Python
In the previous lesson, Tuples, sets, and dictionaries in Python, we learned about multi-dimensional lists in Python. In today's tutorial, we're going to learn to use libraries. Mainly, the math library.
Libraries
Libraries (or modules) provides us with useful data types, functions, and tools for making even better programs. They're made so we don't have to re-write something someone else has already written for us. If we make our programs using existing modules, the development process will be much more comfortable and quick.
We import libraries using the
import command, at the
beginning of our source file.
import module_name
Then, we call module functions as they were in the module's methods:
module_name.function_name()
We can also choose to only import certain functions:
from module_name import function_name
Then, the function would be globally accessible:
function_name()
We could even make everything from the module be accessible globally. However, be careful with this approach and use it only if you know exactly what you're doing:
from module_name import *
math
First, let's introduce you to the Python math module - math. We have to import it in order to use it:
#!/usr/bin/python3 import math
The module provides 2 fundamental constants for us:
pi and
e. Pi, as you all know, is the number Pi (3.1415...), and
e is Euler's number, the base of the natural logarithm (2.7182...).
I'm sure you'll get how to work with them. For completeness' sake, let's print
these constants to the console:
{PYTHON} import math print("Pi: %f" % (math.pi)) print("e: %f" % (math.e))
The result:
Console application Pi: 3.141593 e: 2.718282
As you can see, we can call everything from the math module.
math module methods
Now, let's go over the methods that the math module provides.
ceil(), floor() and random()
All of these functions are related to rounding. Ceil() always rounds upwards
and
floor() rounds downwards no matter what. If you just need
ordinary rounding, use the global
round() function which takes a
decimal number as a parameter and returns the rounded number as a double
data type in the way we learned in school (from 0.5 it rounds upwards,
otherwise downwards). The
round() function is from the standard set
of functions and isn't dependent on the math module.
We'll certainly use
round() very often. I've used the other
functions for things such as determining the number of pages in a guestbook. If
we had 33 comments and we only printed 10 comments per page, these comments
would take up 3.3 pages. The result must be rounded up since we would actually
need 4 pages.
{PYTHON} import math print(round(3.1)) print(round(3.6)) print(math.ceil(3.1)) print(math.floor(3.6))
The output:
Console application 3 4 4 3
fabs() and abs()
The fabs() method takes a decimal (float) number as a parameter and returns
its absolute value (which is always positive). We also have the global
abs() function which works with integers.
{PYTHON} import math print(math.fabs(-2.2)) print(math.fabs(2.2)) print(abs(-2)) print(abs(2))
The output:
Console application 2.2 2.2 2 2
sin(), cos(), tan()
These classic trigonometric functions all take an angle as a float, which has to be entered in radians (not degrees if your country uses them). To convert degrees to radians we multiply them by (Math.PI / 180). The return value is also a double.
acos(), asin(), atan()
These are inverse trigonometric (arcus, sometimes cyclometric) functions, which return the original angle according to its trigonometric value. The parameter is a float and the returned angle is in radians (also as a float). If we wanted the angle in degrees, we'd have to divide the radians by (180 / Math.PI).
pow() and sqrt()
Pow() takes two parameters. The first is the base of the power and the second is the exponent. If we wanted to calculate 23, the code for it would be as follows:
{PYTHON} import math print(math.pow(2, 3))
Sqrt() is an abbreviation for SQuare RooT, which returns the square root of the number given as a double. Both functions return a double as the result.
{PYTHON} import math print(math.sqrt(12))
exp(), log(), log2, log10()
Exp() returns Euler's number raised to the given exponent. Log() returns the
natural logarithm of the given number or the logarithm of the base entered as
the second parameter. Log10() returns the decadic logarithm of the number and
log2() returns the binary logarithm.
{PYTHON} import math print(math.log(16, 4)) print(math.log10(1000)) print(math.log2(32))
The output:
Console application 2.0 3.0 5.0
Hopefully, you noticed that the method list lacks any general root function. We, however, can calculate it using the functions the math module provides.
We know that roots work like this: the 3rd root of 8 = 8^(1/3). Therefore, we can write the following bit of code:
{PYTHON} import math print(math.pow(8, (1/3)))
Division
Programming languages often differ in how they perform the division of numbers. You need to be aware of these issues to avoid being, unpleasantly, surprised afterwards. Let's write a simple program:
{PYTHON} a = 5 / 2 b = 5.0 / 2 c = 5 / 2.0 d = 5.0 / 2.0 e = 5 // 2 f = 5.0 // 2 g = 5 // 2.0 h = 5.0 // 2.0 print(a) print(b) print(c) print(d) print(e) print(f) print(g) print(h)
We divide 5/2 several times in the code. Mathematically, it's 2.5.
Nonetheless, the results will not be the same in all cases. Can you guess what
we'll get in each case? Go ahead, give it a try
The program output will be the following:
Console application 2.5 2.5 2.5 2.5 2 2.0 2.0 2.0
We see the result of division using the
/ operator is always
decimal (float).).
The remainder after division
In our applications, we often need the remainder after integer division (i.e.
modulo). In our example
5 // 2, the integer result is 2 and modulo
is 1 (what's left over). Modulo is often used to determine whether a number is
even (remainder of division by 2 is 0). You would use it, for example, to draw a
checkerboard and fill in the fields based on whether they are even or odd,
calculate the deviance of your position in a square grid, and so on.
In Python, as in C-like languages in general, modulo is a percent sign, i.e.
%:
{PYTHON} print(5 % 2) # prints 1
Well, that's all I've got for today. In the next lesson, Declaring functions in Python, we'll learn to declare custom functions and to decompose our programs into multiple logical parts.
No one has commented yet - be the first! | https://www.ict.social/python/basics/importing-modules-and-the-math-module-in-python | CC-MAIN-2018-51 | refinedweb | 1,187 | 66.44 |
Agenda
See also: IRC log
<ChrisW> Stella, can you scribe today?
yes
<ChrisW> Scribe: StellaMitchell
<Harold> Hi Dough, Should we refer to CycL?
<DougL> Hi, sure.
<ChrisW>
<ChrisW> RESOLVED: accept F2F9 Minutes
Chris: any objections to accepting minutes from F2F9? ... none
<csma> no
<Harold> Doug how? (I found something online, but maybe you have more precise ref)
Chris: no minutes from March 4th yet
Leora: I just sent out the minutes from March 4th
Chris: any adjenda ammendments? ... none
csma: Jos also wanted to discuss appendix of swc doc
chris: we will talk about that during the publication plan
<DougL> The wikipedia page for CycL references the CycL syntax document (near the bottom)
<Harold> OK.
Chris: any news on F2F10? Axel (host) is not here
<csma> yes
Chris: f2f10 will be in deri Galway on May 26-28
<csma> ACTION: Axel to update the F2F10 wiki page [recorded in]
<trackbot-ng> Created ACTION-443 - Update the F2F10 wiki page [on Axel Polleres - due 2008-03-18].
Chris: (a 3 day meeting)
Chris: Action review:
cw: action-423 is pending discussion
<Harold> ACTION-423:
harold: the rest of my actions are continued
sandro: action-435 (request
namespace for functions and operators)
... it's turning out to be harder than expected. I need help from the working group
... I have been in touch with xquery+xpath WGs
csma: action-434, change due date to March 21st
cw: csma, any news from the OMG meeting?
csma: the only thing that might be of interest to this group is that there is request for proposals on svbr vocab on date and time that is aligned with owl and uml
<josb> no
cw: jos, mike, what news from owl task force?
miked: no news
cw: I understand that there is work going on in owl wg to consider a blessed (recommended) fragment of owl for ??
<Harold> DLP is the intersection of Horn logic and Description Logic.
s /??/dlp/
<josb> s/bld/DLP/
<sandro> Zhe (Alan) Wu, at Oracle
cw: Gary, do you know about this?
Gary: no
miked: I will attend the owled workshop in early april
cw: please bring the swc doc to
their attention and solicit feedback
... at f2f10 we pretty much agreed on builtins
... but in the documented issue there is one item left open, about order of the arguments
<csma> PROPOSED: BLD builtins are not sensitive to order as they are in query
<csma> languages and production rules (closing issue-40).
<ChrisW> PROPOSED: BLD builtins are not sensitive to order as they are in query languages and production rules (closing issue-40).
csma: I have no objection to that resolution, but I wonder what it means that they are sensitive to order
<ChrisW> PROPOSED: BLD builtins are not sensitive to order
harold: if you call a builtin before all arguments are bound, you can have a problem in some implentations
csma: in rif all bindings are done outside of the rule, so we would not have this problem
<Harold> PROPOSED: BLD builtin calls are not sensitive to order of conjunctions
harold: is the above wording ok with you, csma?
csma: yes, even the original wording was fine, but just might be a little confusing
<ChrisW> PROPOSED: BLD builtins are not sensitive to order of evaluation
<sandro> +1
<MichaelKifer> -1
cw: any objections to the above proposal? ... none
<ChrisW> PROPOSED: BLD builtins are not sensitive to order of evaluation
<MichaelKifer> +1
<DougL> +1
<josb> +1
<Harold> +1
<Hassan> 0
<IgorMozetic> +1
<sandro> Chris: I think Michael was saying "-1" on IRC to "does anyone object?"
<LeoraMorgenstern> +1
<ChrisW> RESOLVED: BLD builtins are not sensitive to order of evaluation (closing issue 40)
<csma> do you have some wine to celebrate?
<csma> ACTION: ChrisW to close issue 40 [recorded in]
<trackbot-ng> Sorry, couldn't find user - ChrisW
<csma> ACTION: cwelty to close issue 40 [recorded in]
<trackbot-ng> Created ACTION-444 - Close issue 40 [on Christopher Welty - due 2008-03-18].
<ChrisW>
cw: we agreed on syntax, but not on semantics yet
<Harold>
cw: above, are links to 2 proposals for semantics
<csma> PROPOSED: Approve Michael's alternative proposal on lists [6] and
<csma> update FLD+BLD syntax/semantics accordingly to reflect that and the
<csma> previous resolution on lists
harold: I have no preference
between the two. I think we should use the "alternative"
proposal
... I think on one level the semantics interpretation is more complicated in mk's (alternative) proposal
... it is kind of unusual, but it seems to work
cw: can you clarify?
<Harold> These functions are required to satisfy the following: Itail(a1, ..., ak, Iseq(ak+1, ..., ak+m)) = Iseq(a1, ..., ak, ak+1, ..., ak+m).
harold: this leads us into the realm of semantic description that is more expressive than the original
<josb> yes
cw: any other discussion on this? are people ready to accept this semantics?
<LeoraMorgenstern> So, we are voting for one of the two pages?
<Hassan> Why not use the standard free algebra style of semantics?
cw: does anyone feel uncomfortable accepting the semantics of the "alternative" proposal?
<ChrisW> PROPOSED: Approve Michael's alternative proposal on lists and update FLD+BLD syntax/semantics accordingly to reflect that and the previous resolution on lists
cw: does anyone object to the above resolution?
<LeoraMorgenstern> I'm confused. Which wiki page are we voting for?
hak: I think it is overly
complicated
... there are standard semantics for lists everwhere, why are we reinventing the wheel
hb: to keep it n-ary
hak: that is just syntax
hb: first step was to eliminate
pairs from the syntax, and then we eliminated pairs from the
semantics too
... and how would you deal with rest variables?
<Harold> Itail deals with rest variables.
hak: just a logic variable
mk: we have a model theory so
when we introduce a new kind of term we have to define the
interpretation of this new kind of term in the model
theory
... you have to be specific about your proposal
<Harold> Direct treatment of 'Seq(' TERM+ ` | ` TERM ')'.
hak: use standard semantics and syntactic sugar transformation
<Harold> In particular 'Seq(' TERM+ ` | ` Var ')'.
hak: I don't object, I am just saying my opinion
cw: any other comments?
... sequence semantics in the alternatives and pairs semantics was the original
<Harold> Michael, Pair is a function symbol, so I eliminated that from the syntax, moving it to the semantics.
mk: if you don't have function symbols, you cannot treat it as syntactic sugar
cw: so advantage is you can handle lists without requiring functions
gary: it is good to decouple them (lists and function symbols) for production systems
<Hassan> fine
<Hassan> ???
<ChrisW> PROPOSED: Approve Michael's alternative proposal on lists and update FLD+BLD syntax/semantics accordingly to reflect that and the previous resolution on lists
cw: any objections to
above?
... none
<sandro> +1
<DougL> +1
<Hassan> 0
<Harold> +1
<IgorMozetic> +1
<LeoraMorgenstern> +1
<MichaelKifer> +1
<mdean> +1
<sandro> Gary on phone: +1
<josb> +1
<ChrisW> RESOLVED: Approve Michael's alternative proposal on lists and update FLD+BLD syntax/semantics accordingly to reflect that and the previous resolution on lists
cw: hb, can you give an update on this discussion
hb: we agreed at previous meeting
to remove reification from bld
... we also discussed at f2f10 about going back to making a distiction in the grammar between functions and predicates
... and also bring in syntax for builtins
cw: and also Jos had an action to
add metadata and iris to the syntax
... people have agreed to remove reificaiton and to add metadata and iris
... so the remaining issue is whether to distinguish between functions and predicates in the grammar
hb: mk said it is a good idea to keep uniterm
cw: we are not proposing to
remove uniterms...just in how they are used in the
grammar
... yes, it changes the markup by distinguising functions from predicates
... but still they will have the same syntax
<josb> the grammar:
hb: we want to handle future hilog extensions
cw: mk, where do you stand on this issue? does distinguishing functions and predicates in the syntax make it more difficult to do hilog extensions?
mk: no, I don't think it
does
... that's why I wanted to make bld grammar a specialization of fld grammar
... (so that it can be extended in a compatible way)
hb: I'm not convinced this will
work
... yes, hilog would be generalization of bld
jos: I proposed 2 grammars: fld and bld. the fld one contains hilog
<josb> I give up....
<sandro> josb, is your BLD grammar a subset of your FLD grammar?
<josb> Yes
csma: I don't understand the current discussion
<josb> the grammar:
csma: ..fld and bld are the same in the area of subject of predicates and functions
<josb> I showed that you CAN!
<josb>
sandro: I think harold is saying that if you split uniterm into functions and predicates in fld then you can't extend to hilog
<josb> right
<Harold> We want to read BLD documents (with BLD facts and rules) into future HLD (HiLog) documents.
csma: but hilog distinguishes between predicates and functions
<Harold> Therefore BLD documents should not separate oreds and funcs.
<Harold> Therefore BLD documents should not separate preds and funcs.
cw: mk, you made a proposal for the grammars for fld and bld. Can you summarize
<josb> Harold, just read the grammars I proposed...................
mk: I proposed a framework to use around the grammars that jos had proposed
hb: I explained my point above in the irc
mk: I understand that you are
saying we need to also consider how it will look in xml, and
not just in bnf
... I think it would be possible to accomplish the extensible design in xml
... I wanted to show the concept in bnf, but intended that it would carry over to xml
... I didn't think hard about this yet, so can't say for sure whether it is possible
cw: this should be ok in xml
mk: it has to be checked
cw: how will we go about checking this?
<Harold> E.g., the BLD XML-like Atom(a Fun(f c d) e) cannot be importet unchanged in HLD.
<Harold> E.g., the BLD XML-like Uniterm(a Uniterm(f c d) e) cannot be importet unchanged in HLD.
sandro: why can it not be imported?
cw: someone has to demonstrate that there is an xml syntax that can be specialized from hilog to bld
<Harold> E.g., the BLD XML-like Atom(a Fun(f c d) e) cannot be importet unchanged in HLD.
<Harold> <Harold> E.g., the BLD XML-like Uniterm(a Uniterm(f c d) e) cannot be importet unchanged in HLD.
<Harold> E.g., the BLD XML-like Uniterm(a Uniterm(f c d) e) CAN be importet unchanged in HLD.
sandro: jos says he has done this
mk: jos hasn't done it for hilog yet, so he would have to do that
<csma> Fallbacks!
cw: rif is an interchange syntax, we would not break hilog by requiring they use this format
<josb> FLD subsumes hilog
<josb> so, I did it for hilog
cw: hilog requires functions to
be allowed in places where they are not conventioally used in
other languages
... it doesn't require that you don't distinguish between them
<Harold> And ( ?x = Uniterm(f c d) Uniterm(a ?x e) )
<Harold> And ( ?x = Uniterm(f c d) ?x(a ?x e) )
hb: in above example, ?x occurs
in 2 places... at the top level it is an atom
... the other occurrence is not
cw: the distinction is there is what you typed, why is it a problem to call it out syntactically
sandro: (something about parse trees)
csma: I agree with what sandro said
<Harold> At the time you write ?x = Uniterm(f c d) you don't need to say how it's going to be used: So both ?x occurrences in ?x(a ?x e) are fine.
csma: problem may occur when using a bld doc in hilog dialect
.
<josb> right
<josb> +1 to Sandro
<Harold> And ( ?x = Uniterm(f c d) Pre(?x)(a Fun(?x) e) )
hb: is the above what you mean, mk?
mk: no
<Harold> And ( ?x = Uniterm(f c d) Pred(?x)(a Fun(?x) e) )
mk: I am not proposing to mark it up. The basic difference between your grammar and jos's is just at the top level
<Harold> And ( ?x = Uniterm(f c d) ?x(a ?x e) ?x )
hb: what about the above? is this possible?
mk: yes, the x's will be marked as atom, but inside they will all be uniterms
cw: let's move this discussion to email
<sandro> ACTION: Harold to make the case, in e-mail, based on examples in 11 March meeting, for keeping Uniterm in the XML [recorded in]
<trackbot-ng> Created ACTION-445 - Make the case, in e-mail, based on examples in 11 March meeting, for keeping Uniterm in the XML [on Harold Boley - due 2008-03-18].
csma: we didn't discuss the orthogonal item of having the syntax (presentation and xml) distinguish between logical and builtin functions and predicates
sandro: we decided that already
csma: one proposal distinguishings builtins from logical and one distinguishes functions and predicates, but neither does both
<Harold> For reference, I talked about Hterms (Uniterm) in the W3C Submission of SWSL-Rules:
jos: it is still not clear how
the xml syntax will be defined
... i.e. how it relates to presenation syntax
cw: we agreed that the mapping would be in a table, but that the xml syntax would be as close as possible to presentation, so that the mapping woujld be trivial
<Harold> For instance, the HiLog term ?Z(?X,a)(b,?X(?Y)(d)) is serialized as shown below:
csma: for the predicate production you would need to have 2 entries in the table
<Harold> <Hterm>
<Harold> <op>
<Harold> <Hterm>
<Harold> <op><Var>Z</Var></op>
<Harold> <Var>X</Var>
<Harold> <Con>a</Con>
<Harold> </Hterm>
<Harold> </op>
<Harold> <Con>b</Con>
<Harold> <Hterm>
<Harold> <op>
<Harold> <Hterm>
<Harold> <op><Var>X</Var></op>
<Harold> <Var>Y</Var>
<Harold> </Hterm>
<Harold> </op>
jos: the table is to translate the syntax, it does not care about bnf or schema, just about syntax
<Harold> <Con>d</Con>
<Harold> </Hterm>
<Harold> </Hterm>
jos: I need to see how the xml can be derived from the bnf - I am skeptical
hak: I think it can be derived, I have been working on a tool that can do this
csma: if we allow metadata inside uniterms for roundtripping purposes...
hak: you need to annotate the bnf
csma: we may want to have things in the xml syntax that we don't have to reflect in the presenation syntax
<sandro> hak: you want a forgetful homomorphism
cw: csma, please put your point
in an email, with an example
... I don't think we should publish next working draft without having syntactic issues revolved
<csma> ACTION: csma to write an email with an example of XML that should not be derived from the BNF of the prez syntax [recorded in]
<trackbot-ng> Sorry, couldn't find user - csma
cw: : we can dedicate next week's telcon to all these syntactic issues
sandro: and I have two syntactic issues, which I will describe in email
<csma> ACTION: christian to write an example of XML that should not be derived from the BNF of the prez syntax [recorded in]
<trackbot-ng> Created ACTION-446 - Write an example of XML that should not be derived from the BNF of the prez syntax [on Christian de Sainte Marie - due 2008-03-18].
cw: are fld/ bld ready to be reviewed?
mk: there are some outstanding
issues, I sent an email about it
... I will not be at next week's telecon
... I will plan to make all my changes by saturday
<csma> +1 to postpone
cw: I think we need to postpone
our schedule by one week
... and then reevaluate where we are with syntactic issues
... actions assigned today are critical, so that we can resolved syntactic issues at next week's telecon
csma: can we talk about jos's issue about appendix?
<josb>
jos: in the current swc document,
the appendix describes embedding, but this is really more of an
implementatin hint
... so it shouldn't really be part of swc doc, it should ideally be in another document, so I'd like to move it to another doc that can be published as a working group note
cw: you don't like it in appendix because it makes the document longer?
jos: no, because it doesn't belong there, because it's a different topic from the main document
<Harold> Jos, Sandro, I think a Working Note is too level a document to be referred to from a Proposed Recommendation.
sandro: I think people would want it in the same document...it is ok to have non normative parts of the document
cw: agree
<IgorMozetic> I'm in favor in keeping it in
jos: I don't object to leaving it as a non normative appendix
mk: I don't object either
jos: ok, agreed
This is scribe.perl Revision: 1.133 of Date: 2008/01/18 18:48:51 Check for newer version at Guessing input format: RRSAgent_Text_Format (score 1.00) Succeeded: s/??/xquery+xpath WGs/ Succeeded: s/bld/??/ FAILED: s/bld/DLP/ Succeeded: s/ hb:/cw: hb,/ Succeeded: s/inthe/in the/ Succeeded: s/between terms and predicates/between functions and predicates/ Succeeded: s/ilog/hilog/ Succeeded: s/occurance/occurrence/ Found Scribe: StellaMitchell Inferring ScribeNick: StellaMitchell Default Regrets: DaveReynolds AxelPolleres Agenda: Got date from IRC log name: 11 Mar 2008 Guessing minutes URL: People with action items: axel christian chrisw csma cwelty harold[End of scribe.perl diagnostic output] | http://www.w3.org/2008/03/11-rif-minutes.html | crawl-002 | refinedweb | 2,977 | 66.67 |
Technical Articles
Tax Service – Extend the Integration of SAP S/4HANA (on premise) with Tax Service.
The tax service integration uses standard data to calculate taxes in a business transaction. However, there are cases when you need more specific information to calculate your taxes. To enable the system to identify this data, you can extend the tax service integration by executing the following steps:
Finding the Extendable Interfaces
Find the interfaces where you can extend the tax service integration.
These interfaces implement the IF_TXS_CLASS_ENHANCEMENT interface. To see all the Comprehensive Interfaces available for enhancement, follow the steps below:
Procedure
- Access transaction SE80
- Select Repository Browser.
- Select Class/Interface in the object category field.
- Enter IF_TXS_CLASS_ENHANCEMENT in the Object Name field.
- Expand the Comprehensive Interface interfaces.
- Read the interface documentation and determine the interface in which you need to extend the tax service integration.
Aligning with your SAP Partner for Tax Calculation
Procedure
Align with your SAP Partner for tax service about this new information since it affects the tax calculation.
Note: When you create a new key/value pair, use a namespace where the key name starts with “cust_”. For example, cust_ownProduction.
Creating Your New Class
Create a new class and inherit the methods from the standard class you previously determined.
To execute this step, follow the instructions below:
Procedure
- Access transaction SE24.
- Enter the name of your new class.
- Choose Create and Save.
- Go to the Properties tab.
- Choose the Superclass pushbutton.
- Enter the localization class that implements your determined interface.
- Choose Save.
- Implement a business logic according to your needs.
- Choose Activate.
Setting Your Class
Procedure
- Go to Customizing for Integration with Other SAP Components, choose SAP Localization Hub, tax service Enhance Localization Interfaces for Tax Service.
- Set your own class to be executed in place of the tax service standard localization classes for a determined interface.
Example
See an example of how to extend the integration of SAP S/4HANA with tax service:
Assume that John is the tax specialist of the company and needs the system to calculate taxes for the company’s purchases.
The company has some suppliers that resell or produce the goods interchangeably and this fact impacts the tax calculation for this purchase operation.
The tax service integration does not identify if the supplier produces these goods or resells them. To enable the system to identify this data, John asks the IT specialist, Donna, to take action.
Donna and John decide that they need to add a new field to the payload that identifies if the supplier resells or produces the goods. Based on this decision, Donna determines that she needs to extend the integration in the IF_TXS_ADDITIONAL_ITEM_INFO interface.
Donna contacts the company’s SAP Partner for tax service and aligns with them about this new information in the payload. Donna then creates the ZCL_TXS_ADDITIONAL_ITEM_INFO new class, inherits methods from the standard class CL_TXS_ADDITIONAL_ITEM_INFO, and reimplements the APPEND_ADDITIONAL_ITEM_INFO method.
In this method, Donna first calls the super method to keep SAP standard additional item information and then, implements her own logic by adding a key/value pair with information required for tax calculation.
Important: In every key/value pair that you add under your own logic, the key name must start with the cust_ string, for example, cust_ownProduction.
She names the key cust_OwnProduction to represent the information that they need to correctly calculate taxes.
The logic for the value information depends on the business of the company and must be extracted according to its data model.
Donna creates the ZCL_TXS_ADDITIONAL_ITEM_INFO class and it is now available in the Enhance Localization Interfaces for Tax Service customizing activity. She adds this class in the Class field and the IF_TXS_ADDITIONAL_ITEM_INFO in the Interface field. since this logic is valid for Brazil, Donna adds BR in the Country field.
With this implementation complete, John can calculate taxes considering if the supplier resells or produces the goods involved in this business transaction.
If you would like to see more blog posts about the tax service, follow the tags SAP Localization Hub and SAP tax service in the SAP Community.
Hi Jaqueline
Thanks for the post, How can the extension be done for cloud version? From documentation, I did not see any option listed there.
Thanks
Hi Dheeraj,
SAP doesn't offer this functionality at the moment for the Cloud version of SAP S/4HANA.
In the SAP S/4HANA Cloud you can configure and extend the software using the configuration steps in the Manage Your Solution app and the Configuration applications in the Fiori Lauchpad. It is not the same as what we describe in this blog post, though.
For more information on how the tax service integrates with SAP S/4HANA Cloud, have a look at our official documentation in Help Portal under this link:
If you would like to know more about the tax service in general terms, here is the link to our main page in the Help Portal:
Cheers, | https://blogs.sap.com/2019/12/19/tax-service-extend-the-integration-of-sap-s-4hana-on-premise-with%E2%80%AFtax-service/ | CC-MAIN-2022-33 | refinedweb | 825 | 53.51 |
Hi Guys,
I wanted to know how to access the methods of grandparent class from the child class (when those methods in child class are overridden) using super keyword. Please help.
Printable View
Hi Guys,
I wanted to know how to access the methods of grandparent class from the child class (when those methods in child class are overridden) using super keyword. Please help.
Why do you think you need to do this? Sounds like a symptom of bad design to me.
Just a thought, as in how do you get it.
I'm not convinced you can, and I'm not convinced you should. Like I said, it's more likely a symptom of a bad design.
I get what you are saying. But as I was attending a Java training class, a student came up with this question, so we were asked to find an answer for the same. As 'super' is used to get the methods of parent class, how can super be manipulated to get the methods of grandparent class.
Well, let me know what you come up with. I don't see an obvious way, other than adding methods in the parent class that can call methods in the grandparent class.
As Kevin mentioned, this is poor design and a situation that should be avoided at all costs - if something is designed this way, its time to redesign. That being said, you could use reflection to accomplish this, but its an ugly solution to an already ugly problem that may not always work.
I tried this:
Code java:
public class InnerClassTest { public static void main(String... args){ new ClassC().print(); } } class ClassA{ public void print(){ System.out.println("A"); } } class ClassB extends ClassA{ public void print(){ System.out.println("B"); } } class ClassC extends ClassB{ public void print(){ try { ((Class<ClassC>)this.getClass().getSuperclass().getSuperclass()).getMethod("print").invoke(this); } catch (Exception e) { e.printStackTrace(); } } }
But that just ends up calling ClassC's print() method, which results in a StackOverflowException, which is what I would expect. Hmph.
I think its a lot uglier than that. You need to get the grandparent Class, create a new instance of said class, - and this is where it gets ugly real fast - set all the appropriate values of the newly constructed grandparent object (assuming the classes are 'bean'-like, with getters and setters, you use the child values to set the grandparent values), then finally invoke the method. Did I mention this is ugly? ;)
This thread has been cross posted here:
Although cross posting is allowed, for everyone's benefit, please read:
Java Programming Forums Cross Posting Rules
The Problems With Cross Posting
oh I didnt know about that
Ack, crossposting, not cool. | http://www.javaprogrammingforums.com/%20java-theory-questions/11569-super-keyword-printingthethread.html | CC-MAIN-2017-39 | refinedweb | 452 | 71.04 |
CodeGuru Forums
>
.NET Programming
>
C-Sharp Programming
> Can I reference a struct outside my DLL?
PDA
Click to See Complete Forum and Search -->
:
Can I reference a struct outside my DLL?
capitolc
August 6th, 2008, 11:03 AM
I'm creating a DLL to use in another application.
I have a struct full of different variables.
I want to create a new instance of this struct within different classes I have inside the DLL.
I then want to reference or access these variables within this struct outside the DLL by way of an interface calling a function that returns the struct.
Can this be done??
I successfully return other data types using an interface, but can't use the same syntax to return my struct. I can't even initialize my struct in the scope of a class (as I can with other data types).
Can what I'm tyring to do be done??
Arjay
August 6th, 2008, 06:17 PM
Please refer to the DLL as a 'class library' or 'assembly' (they aren't called Dlls anymore in .Net).
I mention this because I want to be sure we are on the same page for what you are trying to do. I am going to assume that you have started by creating a 'class library' project and want expose a struct inside a class library.
For this to be visible, you need to mark the struct as public (i.e public struct Foo { }).
In the application where you want to use the struct, you need to add a reference to the class library that contains the struct. To do this, just right click on the References node in the solution explorer and choose 'add reference'.
There are several tabs that open. You can browse to the assembly or choose one from another project that's in your solution.
Next, in order to use the struct inside the code, you need to include the namespace for the class library (e.g. using MyClassLibNamespace;).
capitolc
August 15th, 2008, 02:23 PM
I appreciate the help, thanks. Maybe I should have complained to the fact I was trying to access my Class Library within a C++ application. I have, however, made a work-a-round.
// my interface giving public access from outside the library
public interface IClass1
{
// my function that performs the routine
void Function1();
// my functions that returns values
double Value1();
int Value2();
string Value3();
};
// my public struct accessible throughout any class within my library
public struct myData
{
public int iX;
public string sY;
public double dZ;
};
// my class inherited from my public interface. Executable code goes here.
public class myClass1 : IClass1
{
private myData sData; /* created a struct type variable within scope of class */
// simple public functions to return private variables
// This is my work-around since I could not return a struct data type
public int Value2() { return sData.iX; }
public string Value3() { return sData.sY; }
public double Value1() { return sData.dX; }
// the public function made accessible outside the class library
public void Function1()
{
// be sure to assign the values to the local struct instance
sData.iX = 123;
sData.sY = "Person Name";
sData.dZ = 987.369
// enter rest of your code here to run routine when called
}
// a private function not seen outside the library, but visible within this class
private void Function2()
{
// another function within this class to perform another routine
// use any variables defined within class or create local variables
}
}
This was my solution to my problem... and It Worked!
MadHatter
August 15th, 2008, 02:59 PM
Please refer to the DLL as a 'class library' or 'assembly' (they aren't called Dlls anymore in .Net).
Crap! I hate it when I'm the last to know something. Whoever thought of not calling them dll's anymore ought to change their file extension to convey that.
Zaccheus
August 18th, 2008, 08:38 AM
I think there's a subtle difference between assemblies and DLLs, a DLL is a module (as it has always been) and an assembly can consist of one or more modules.
MadHatter
August 18th, 2008, 09:06 AM
the file type is a dynamic link library regardless of what it contains. what it contains is either a module, assembly, resource, or whatever else we choose to place in it.
being that typical .net exe's and dll's are not native images like a dll from C/C++ I think there could be an argument for making them separate file types instead of reading for a header value in each exe or dll to know whether to compile it or not.
you can rename a .exe to a .dll and use it as a reference, so there's no exporting that would normally take place for a dll in other languages, so IMO the "boundry" between a "class library" "console application" and "windows application" are identical outside of the extra platform calls that are performed to initialize / create a console window in a console app.
codeguru.com | http://forums.codeguru.com/archive/index.php/t-458767.html | crawl-003 | refinedweb | 832 | 70.02 |
I have written several Windows services in .NET over the years, and they have all required some sort of housekeeping to occur in the background (e.g. archive or back up files every hour).
The approach I have used was to create a worker thread that sleeps and iterates until the desired time interval has elapsed. For example:
public class Housekeeping { public Housekeeping() { _thread = new Thread(HousekeepingThread); } private bool _active; private Thread _thread; public void Start() { _active = true; _thread.Start(); } public void Stop() { _active = false; _thread.Join(); } private void HousekeepingThread() { int iterations = 0; while (_active) { if (++iterations >= 720) { DoWork(); iterations = 0; } Thread.Sleep(5000); } } private void DoWork() { // do some work } }
After an hour (720 iterations X 5000 ms = 1 hour), the DoWork method is called and some work is performed. The thread then resumes sleeping and iterating until the next hour interval elapses.
The reason for sleeping 5 seconds and iterating (instead of simply sleeping for one hour) is to make the thread more manageable. If the calling program initiates the Stop method, it won’t have to wait more than 5 seconds to abort (although it could be a bit longer if DoWork is called). This avoids having to abort the thread, which is not very graceful.
This approach is ok, and gives the illusion of some housekeeping occurring “every hour”, but there are a couple of problems with this that I never really considered until I recently read a discussion of timers (in the excellent book C# 3.0 in a Nutshell, by Joseph and Ben Albahari).
In Chapter 19, Threading, the authors point out the exact technique that I have been using, and its shortcomings. Nothing like seeing your approach used as an example of what not to do. 🙂
The problem with this pattern (perhaps it’s really an anti-pattern) is that a thread resource is tied up to do nothing but mainly sleep, and the DoWork method will not really be called every hour but will instead slip as time goes on (since DoWork takes some time to perform).
The solution to all of this is to use a timer. There are several timers in .NET, but for this example we’ll rewrite our Housekeeping class to use System.Threading.Timer:
public class Housekeeping { private Timer _timer; public void Start() { int hourMs = 1000 * 60 * 60; _timer = new Timer(DoWork, null, hourMs, hourMs); } public void Stop() { _timer.Dispose(); } private void DoWork(Object stateInfo) { // do some work } }
Not only is this simpler, but you don’t have to create your own thread. The Timer class will use a thread from the thread pool to execute your callback delegate, so you won’t tie up a thread resource that does nothing but sleep!
Keep in mind that your callback may execute on different threads, so it must be thread safe.
But the best part of the Timer class is that your callback method gets executed on time. In our example, it will fire exactly after one hour, and then fire exactly every hour thereafter.
Much easier than creating your own thread and managing the time interval yourself!
Hi Larry!
In my new gig I work on a dozen Windows services and they all follow the “Larry-Pattern”. When the opportunity presents itself, I refactor the services to timers. Aside from the points you mentioned, you avoid an unnecessary context switch and will better utilize on-chip caching.
Comment by David Chappelle — July 8, 2009 @ 10:01 am |
Hey Dave, good to hear from you!
Glad that you’re cleaning up the code at your new job. And you can’t name this pattern after me because I learned it from someone else. 🙂
Now that I know about timers, this other technique seems so brute force.
Comment by Larry Parker — July 8, 2009 @ 7:30 pm | | https://larryparkerdotnet.wordpress.com/2009/07/07/using-timers-instead-of-managed-threads/ | CC-MAIN-2018-30 | refinedweb | 637 | 70.63 |
as module or builtin), you may see the WARNING. But, that should notcause any other problems with C-states, P-states, or anything else.Is that what you are seeing?The below patch is not a workaround for the problem. Infact it will makesituation worse with constant stream of prinkts and can reduce theC-state residency and turbo upside.Thanks,Venki> --- a/arch/x86/kernel/hpet.c> +++ b/arch/x86/kernel/hpet.c> @@ -376,7 +376,7 @@ static void hpet_set_mode(enum clock_event_mode mode,> static int hpet_next_event(unsigned long delta,> struct clock_event_device *evt, int timer)> {> - u32 cnt;> + u32 cnt, check;> > cnt = hpet_readl(HPET_COUNTER);> cnt += (u32) delta;> @@ -387,7 +387,12 @@ static int hpet_next_event(unsigned long delta,> * what we wrote hit the chip before we compare it to the> * counter.> */> - WARN_ON_ONCE((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt);> + check = (u32)hpet_readl(HPET_Tn_CMP(timer));> + if(check != cnt) {> + printk("hpet_next_event: hpet_writel failed: 0x%x != 0x%x\n",> + check, cnt); > + hpet_writel(cnt, HPET_Tn_CMP(timer));> + }> > return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;> }> | https://lkml.org/lkml/2009/11/13/488 | CC-MAIN-2014-15 | refinedweb | 166 | 57.47 |
Unicode handling¶
This document explains how Unicode and related issues are handled in CKAN. For a general introduction to Unicode and Unicode handling in Python 2 please read the Python 2 Unicode HOWTO. Since Unicode handling differs greatly between Python 2 and Python 3 you might also be interested in the Python 3 Unicode HOWTO.
Note
This document describes the intended future state of Unicode handling in CKAN. For historic reasons, some existing code does not yet follow the rules described here.
New code should always comply with the rules in this document. Exceptions must be documented.
Overall Strategy¶
CKAN only uses Unicode internally (
unicode on Python 2). Conversion to/from
ASCII strings happens on the boundary to other systems/libaries if necessary.
Encoding of Python files¶
Files containing Python source code (
*.py) must be encoded using UTF-8, and
the encoding must be declared using the following header:
# encoding: utf-8
This line must be the first or second line in the file. See PEP 263 for details.
String literals¶
String literals are string values given directly in the source code (as opposed
to strings variables read from a file, received via argument, etc.). In
Python 2, string literals by default have type
str. They can be changed to
unicode by adding a
u prefix. In addition, the
b prefix can be used
to explicitly mark a literal as
str:
x = "I'm a str literal" y = u"I'm a unicode literal" z = b"I'm also a str literal"
In CKAN, every string literal must carry either a
u or a
b prefix.
While the latter is redundant in Python 2, it makes the developer’s intention
explicit and eases a future migration to Python 3.
This rule also holds for raw strings, which are created using an
r
prefix. Simply use
ur instead:
m = re.match(ur'A\s+Unicode\s+pattern')
For more information on string prefixes please refer to the Python documentation.
Note
The
unicode_literals future statement is not used in CKAN.
Best Practices¶
Use
io.open to open text files¶
When opening text (not binary) files you should use io.open instead of
open. This allows you to specify the file’s encoding and reads will return
unicode instead of
str:
import io with io.open(u'my_file.txt', u'r', encoding=u'utf-8') as f: text = f.read() # contents is automatically decoded # to unicode using UTF-8
Text files should be encoded using UTF-8 if possible.
Normalize strings before comparing them¶
For many characters, Unicode offers multiple descriptions. For example, a small
latin
e with an acute accent (
é) can either be specified using its
dedicated code point (U+00E9) or by combining the code points for
e
(U+0065) and the accent (U+0301). Both variants will look the same but
are different from a numerical point of view:
>>> x = u'\N{LATIN SMALL LETTER E WITH ACUTE}' >>> y = u'\N{LATIN SMALL LETTER E}\N{COMBINING ACUTE ACCENT}' >>> print x, y é é >>> print repr(x), repr(y) u'\xe9' u'e\u0301' >>> x == y False
Therefore, if you want to compare two Unicode strings based on their characters you need to normalize them first using unicodedata.normalize:
>>> from unicodedata import normalize >>> x_norm = normalize(u'NFC', x) >>> y_norm = normalize(u'NFC', y) >>> print x_norm, y_norm é é >>> print repr(x_norm), repr(y_norm) u'\xe9' u'\xe9' >>> x_norm == y_norm True
Use the Unicode flag in regular expressions¶
By default, the character classes of Python’s re module (
\w,
\d,
…) only match ASCII-characters. For example,
\w (alphanumeric character)
does, by default, not match
ö:
>>> print re.match(ur'^\w$', u'ö') None
Therefore, you need to explicitly activate Unicode mode by passing the re.U flag:
>>> print re.match(ur'^\w$', u'ö', re.U) <_sre.SRE_Match object at 0xb60ea2f8>
Note
Some functions (e.g.
re.split and
re.sub) take additional optional
parameters before the flags, so you should pass the flag via a keyword
argument:
replaced = re.sub(ur'\W', u'_', original, flags=re.U)
The type of the values returned by
re.split,
re.MatchObject.group, etc.
depends on the type of the input string:
>>> re.split(ur'\W+', b'Just a string!', flags=re.U) ['Just', 'a', 'string', ''] >>> re.split(ur'\W+', u'Just some Unicode!', flags=re.U) [u'Just', u'some', u'Unicode', u'']
Note that the type of the pattern string does not influence the return type.
Filenames¶
Like all other strings, filenames should be stored as Unicode strings internally. However, some filesystem operations return or expect byte strings, so filenames have to be encoded/decoded appropriately. Unfortunately, different operating systems use different encodings for their filenames, and on some of them (e.g. Linux) the file system encoding is even configurable by the user.
To make decoding and encoding of filenames easier, the
ckan.lib.io module
therefore contains the functions
decode_path and
encode_path, which
automatically use the correct encoding:
import io import json from ckan.lib.io import decode_path # __file__ is a byte string, so we decode it MODULE_FILE = decode_path(__file__) print(u'Running from ' + MODULE_FILE) # The functions in os.path return unicode if given unicode MODULE_DIR = os.path.dirname(MODULE_FILE) DATA_FILE = os.path.join(MODULE_DIR, u'data.json') # Most of Python's built-in I/O-functions accept Unicode filenames as input # and encode them automatically with io.open(DATA_FILE, encoding='utf-8') as f: data = json.load(f)
Note that almost all Python’s built-in I/O-functions accept Unicode filenames
as input and encode them automatically, so using
encode_path is usually not
necessary.
The return type of some of Python’s I/O-functions (e.g. os.listdir and os.walk) depends on the type of their input: If passed byte strings they return byte strings and if passed Unicode they automatically decode the raw filenames to Unicode before returning them. Other functions exist in two variants that return byte strings (e.g. os.getcwd) and Unicode (os.getcwdu), respectively.
Warning
Some of Python’s I/O-functions may return both byte and Unicode strings for a single call. For example, os.listdir will normally return Unicode when passed Unicode, but filenames that cannot be decoded using the filesystem encoding will still be returned as byte strings!
Note that if the filename of an existing file cannot be decoded using the filesystem’s encoding then the environment Python is running in is most probably incorrectly set up.
The instructions above are meant for the names of existing files that are
obtained using Python’s I/O functions. However, sometimes one also wants to
create new files whose names are generated from unknown sources (e.g. user
input). To make sure that the generated filename is safe to use and can be
represented using the filesystem’s encoding use
ckan.lib.munge.munge_filename:
>> ckan.lib.munge.munge_filename(u'Data from Linköping (year: 2016).txt') u'data-from-linkoping-year-2016.txt'
Note
munge_filename will remove a leading path from the filename. | https://docs.ckan.org/en/2.7/contributing/unicode.html | CC-MAIN-2019-35 | refinedweb | 1,175 | 56.96 |
Hello! I post a lot of things on Twitter and it’s basically impossible for anyone except me to keep with them, so I thought I’d write a summary of everything I posted on Twitter in 2020 so far.
A lot of these things I eventually end up writing about on the blog, but some of them I don’t, so I figured I’d just put everything in one place.
I’ve made most of the links to non-Twitter websites.
comics
Let’s start with the comics, since that’s a lot of what I write there.
debugging
These are from a debugging zine I’m still trying to finish. ()
- 2020-05-28: learn one thing at a time
- 2020-05-26: share your debugging stories 🐛
- 2020-05-26: know your spy tools
- 2020-05-22: investigate bugs together
- 2020-05-21: let your bugs teach you
- 2020-05-05: on reproducing your bugs
- 2020-05-04: debugging tips: check your assumptions
- 2020-05-04: writing code with bugs is normal
- 2020-04-27: if you understand a bug, you can fix it
- 2020-04-19: debugging is hard. take breaks.
- 2020-04-13: when debugging, your attitude matters
writing tips
- 2020-05-19: how I write: highlight the main ideas
- 2020-05-18: how I write: always write for 1 person
computer science
- 2020-05-07: hash functions are amazing
- 2020-05-06: binary search
linux/systems
These are part of a potential sequel to bite size linux
- 2020-05-27: command line arguments
- 2020-01-28: network protocols
- 2020-01-22: clock_gettime: track CPU usage
- 2020-01-18: what’s a shell?
- 2020-01-16: libc
- 2020-01-15: terminals
- 2020-01-13: inodes & hard links
- 2020-01-12: assembly
- 2020-01-10: CPU scheduling
- 2020-01-08: terminal escape codes (tweet)
- 2020-01-07: file locking (tweet)
miscellaneous
- 2020-03-09: pull request tip: ask when you’re unsure! (tweet)
- 2020-01-09: IMSI catchers (fake cellphone towers). with @rival_elf (tweet)
containers
These mostly got published as How Containers Work. As usual the final zine was edited a lot and some of these didn’t make it into the zine at all or I significantly rewrote the version in the zine.
- 2020-04-13: how containers work: user namespaces (tweet)
- 2020-04-09: how containers work: PID namespaces (tweet)
- 2020-03-18: how containers work: namespaces
- 2020-03-17: container networking (tweet)
- 2020-03-16: container layers (tweet)
- 2020-03-11: containers vs VMs (tweet)
- 2020-03-10: the Linux kernel features that make containers work (tweet)
- 2020-03-10: container images: package every single dependency together (tweet)
- 2020-03-09: how containers work: chroot (tweet)
- 2020-03-05: containers are processes (tweet)
- 2020-02-26: container networking (tweet)
- 2020-02-20: containers aren’t magic
- 2020-02-19: container fun: how to make a namespace (tweet)
- 2020-02-18: virtual machines (tweet)
- 2020-02-13: play with your containers (tweet)
- 2020-02-11: how containers work: seccomp-bpf
- 2020-02-10: container registries (tweet)
- 2020-02-06: what’s a container? (tweet)
- 2020-02-03: why containers?
- 2020-01-14: how containers work: capabilities
- 2020-01-06: how containers work: cgroups
questions
A bunch of work on.
- 2020-07-08: questions about DNS
- 2020-07-06: questions about IPv4
- 2020-06-29: questions about event loops / asynchronous programming
- 2020-06-24: questions about unix processes
- 2020-06-21: questions about http status codes
- 2020-06-20: questions about content delivery networks
- 2020-06-19: questions about CORS
- 2020-06-18: questions about TLS certificates
- 2020-06-17: questions about git branches
- 2020-06-16: questions about git commits
- 2020-06-15: questions about HTTP request headers:
- 2020-06-13: questions about sockets
- 2020-06-10: questions about UDP
flashcards
A bunch of earlier work on. I came up with a direction for this project I liked better () and won’t be updating that site further.
- 2020-04-30: some flashcards on HTTP
- 2020-04-21: made some flashcards on SQL
- 2020-04-20: some new flashcards: reverse proxies! (like nginx/haproxy)
- 2020-03-21: some new flashcards are up, this time on TLS!
- 2020-03-16: made some DNS flashcards today in the continuing flashcards experiment
- 2020-03-06: more flashcard experiments: here are 15 linux flashcards on memory & signals & sockets & a few other things
- 2020-02-28: more learning game experiments: here’s a tiny container flashcards thing I made on a plane this week
videos
At the beginning of the year I did some experiments in making screencasts. It was fun but I haven’t done more so far. These are all links to youtube videos.
- 2020-02-17: a quick video on http status codes
- 2020-02-09: some demos of how to make HTTP requests with curl
- 2020-02-04: how DNS works
- 2020-01-01: euclid’s algorithm: a fast way to find the greatest common factor
threads
I’m not a big Twitter thread person (I’d usually rather write a blog post) but I wrote one thread so far this year about how I think about the zine business:
zine announcements
- 2020-04-24: How Containers Work! announcement (tweet)
- 2020-01-31: Become a SELECT Star! announcement (tweet)
giveaways
I know that $12 USD is a lot of money for some people, especially folks in countries like Brazil with a weaker currency relative to the US dollar. So periodically I do giveaways on Twitter so that people who can’t afford $12 can get the zines. I aim to give away 1 copy for every sale.
- 2020-07-10: 1000 copies of How Containers Work (tweet)
- 2020-05-05: 1000 copies of Bite Size Linux (tweet)
- 2020-04-28: 700 copies of How Containers Work (tweet)
- 2020-04-26: 500 copies of How Containers Work (tweet)
- 2020-03-29: 1500 copies of Bite Size Linux (tweet)
- 2020-03-18: 1200 copies of Bite Size Command Line (tweet)
- 2020-02-08: 500 more copies of Become a SELECT Star (tweet)
- 2020-02-06: 500 copies of Become a SELECT Star (tweet)
polls
very occasionally I ask people questions:
- 2020-03-10: what problems have you run into in practice when using containers? I’m trying to put together a list of container downsides for the zine I’m writing. (tweet)
- 2020-02-11: what are some man pages related to containers? (tweet)
that’s all!
I’ve been thinking about trying to do a monthly summary here of what I’m writing on Twitter. We’ll see if that happens! | https://jvns.ca/blog/2020/07/10/twitter-summary-from-2020-so-far/ | CC-MAIN-2021-04 | refinedweb | 1,103 | 59.77 |
signbit − test sign of a real floating-point number
#include <math.h>
int signbit(x);
Link with −lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
signbit():
_XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
or cc -std=c99
signbit() is a generic macro which can work on all real floating-point types. It returns a nonzero value if the value of x has its sign bit set.
This is not the same as x < 0.0, because IEEE 754 floating point allows zero to be signed. The comparison -0.0 < 0.0 is false, but signbit(−0.0) will return a nonzero value.
NaNs and infinities have a sign bit.
The signbit() macro returns nonzero if the sign of x is negative; otherwise it returns zero.
No errors occur.
C99, POSIX.1-2001. This function is defined in IEC 559 (and the appendix with recommended functions in IEEE 754/IEEE 854).
copysign(3)
This page is part of release 3.41 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at. | http://man.sourcentral.org/slack140/3+signbit | CC-MAIN-2018-43 | refinedweb | 180 | 78.04 |
Download | JavaDoc | Source | Github | Forums | Support
If you use ActiveMQ 5.x that ships with Camel 1.x and you upgrade it to use Camel 2.0 you can get an exception while starting.
The reason is basically that the XML namespace changed in Camel 2.0 as explained below.
When Camel went from an activemq subproject to a top level apache project, they changed the URIs for their xml schemas to reflect this in Camel 2.0.
To fix this, in activemq.xml change all occurrences of:
to
and
These will probably occur in the xsi:schemaLocation attribute of the top level beans tag (both) and in the xmlns attribute in the camelContext element (just the first). | http://camel.apache.org/exception-beandefinitionstoreexception.html | CC-MAIN-2017-04 | refinedweb | 118 | 84.37 |
>
Hi Unity Answers Community,
I was wondering, (may be answered before but couldn't find the answer), is there a "set" data type in Unity's C#?
That is, an enum which elements could be present or not in a single time (e.g: in a game, the enemy's immunities: fire, water and death)
something that could be easily implementable in the Inspector, much like the Culling mask of a Camera.
I was dreaming of a syntax like:
public set ImmunitiesSet of {
Fire,
Ice,
Holy
}
that automagically shows up properly in the inspector and allows Mask-like operations.
Since I'm pretty sure there isn't a native solution, in your experience what's the most straightforward way to implement this, in the most general case?
Thanks for your time.
Enum all the way. having a strongly typed list is nice although i dont think it can contain spaces. might just use a dictionary enum, string
Answer by Bunny83
·
Mar 28, 2014 at 02:11 AM
Sure, you can use enums as bitmask, however you're limited to 32 values of course. Also you should use hex numbers to specify the bitmask values, it's less error prone ;)
public enum SomeBitMask
{
Value1 = 0x0001,
Value2 = 0x0002,
Value3 = 0x0004,
Value4 = 0x0008,
Value5 = 0x0010,
Value6 = 0x0020,
Value7 = 0x0040,
// ...
}
To display a bitmask dropdown list in the inspector you can use this property drawer i've written.
Looks like a nice solution, I'll take some time to study it.
I was also wondering if changing the enum element types to string would be a nice move (to allow an infinite number of elements) or not. Or maybe a hashmap. I fear to overcomplicate this, this really should have been a native data structure.
@NeatWolf:The great thing about bitmasks is that they are fast and don't require much memory (just one "int" [4 bytes]).
Enums can only use an integral type as underlying type, so a string doesn't work, especially since a string isn't a value-type and doesn't have bit-operator support ;)
You could boost the bitmask up to 64 values by using ulong / int64 as underlying type but you won't get any further than that. If you need more than 32 / 64 you might want to use the HashSet type. It's of course slower and requires more memory but does support "unlimited" elements.
ps:If the question is answered, could you accept one of the answers to close the question?
Answer by gfoot
·
Mar 28, 2014 at 01:08 AM
Depending on the use case you could use a bit field, combining emum values together, but it's not particularly well-supported by the language.
It is far clearer to just use a class containing a few public bool members.
public class Immunities
{
public bool Fire;
public bool Ice;
public bool Holly;
}
Then you can add an Immunities field to your components and check the boxes in the Inspector, and the syntax for checking them from code is straightforward and readable.
This means I have to rewrite part of the code, and the inspector editor class almost each time, but I see your point.
Why do you say it's not particularly well supported? Does something weird happen to have something like
public enum Immunities
{
Fire=1,
Ice=2,
Holy=4
}
and doing some bitmasking?
I just meant that custom code to manage bitfields is more complex to write and use than if you let the language do the heavy lifting by splitting the bits into separate bools.
Compare this:
if (myImmunities & Immunity_Ice)
{
myImmunities |= Immunity_Holly;
myImmunities &= ~Immunity_Fire;
}
To this:
if (myImmunities.Ice)
{
myImmunities.Holly = true;
myImmunities.Fire = false;
}
For me, the second is much clearer to read, with less potential for error at the call site.
However, the code to check whether two instances have some flags in common is much briefer with the bit field version, because that's what bit fields are particularly good for.
If you do go with a bit field anyway (a lot of people do), you may be able to wrap it in a struct and provide properties to make it look more like the bool version. It depends a bit on the usage.
Also, whichever way you go, you shouldn't have to rewrite your editor class each time you change the elements in your class/enum - you should probably be using reflection in the editor class to automatically present whichever ones are defined (like Unity does in the default Inspector).
But the point of sets and set operations is to work on sets itself. So a union operation would be much more complicated with your "set".
How would you combine (union) those two sets:
Immunities set1 = new Immunities();
set1.Fire = true;
Immunities set2 = new Immunities();
set2.Ice = true;
set2.Holy = true;
// [...]
Immunities combined = set1 | set2;
Set operations are the msin point of using sets, right?
Sure, like many things it depends exactly what you're going to use it for. If set operations are the focus then a bit field will work better; and there's always the option of HashSet, which has a wider range of data is automatically sent to Unity by the end user's Unity project content
1
Answer
Is it possible to use a custom object in java (my WeaponObject) as a data type (like Vector3)
1
Answer
Creating a data type instance difference question
1
Answer
How to create an agenda or timetable system?
1
Answer
Facebook cannot find my Unity data file.
1
Answer | https://answers.unity.com/questions/675177/whats-the-best-way-to-implement-a-set-data-type-in.html | CC-MAIN-2019-26 | refinedweb | 925 | 59.13 |
!
Created attachment 292558
vi session screenshot of mailbox showing null bytes in message file
Please note that the screenshot has been modified to obfuscate potentially
proprietary data. These fields are clearly designated with red boxes.
This screenshot is quite representative of the problem, demonstrating how
entire or partial sections of messages are replaced with null bytes, in what
appear to be 1:1 byte replacements. The following message is properly
delineated in the message "mbox" file with a new special From line:
From <...
Few questions:
1. How did these corrupted files look like from server end ?
2. As stated in the problem statement, "RHEL 4.5" doesn't have this issue but
it is not clear when the platform was moved back to RHEL 4.5, was the
server moved too ? What are the OSs running on server with and without
the problem ? What is server's filesystem (GFS, ext3, etc) ?
Intuitively, if file size and offset are correct but file contens were
partially filled with "NULL" characters, it normally implies the file
spaces are allocated but file contents are not there. We need to isolate
whether this is really a NFS client issue as stated or it is a server
(nfsd and/or filesystem) issue.
The NAS servers reportedly in use here are the following:
1. Customer A: NetApp 3020c running OnTAP v7.2.2
2. Customer B: NetApp 3020c
So, both are using NetApp.
We have contacts at NetApp if they should be brought into the discussion.
However, one note that may or may not be in the case so far, but should be, is
that the "null bytes" problem disappeared when Customer A went to a single NFS
client (taking one CommuniGate Pro "Backend Server" offline). It is only with
two or more NFS clients (Backend Servers) online that the problem can occur.
NetApp uses a proprietary filesystem called "WAFS". I am unsure whether NetApp
can provide filesystem/
device, but it may be possible.
If we can attempt to reproduce these tests in-house, we do have a NetApp device
on which to try this; although the model number and NetApp OS version may
differ, and would need to be researched.
ok, thanks ! Was wondering whether GFS clusters were involved. With above
info, I would say this does look like an NFS client issue at this moment.
Info will be passed to Red Hat NFS kernel folks.
Thanks for the detailed BZ.
> Duplicating this problem will be challenging, though we believe possible ...
I am making arrangements to make RHEL 5.1 available to you. If you can reproduce
the problem that will be the first step.
Yes, thanks for the detailed bug report. I've looked over this and have a question:
2. Have one NFS client modify a non-binary, text file, using C++ operations such
as lseek(), write(), and fsync() (all filehandles are properly fsync()'d when
closed by an NFS client)
3. No less than 6 seconds later, have a second NFS client open the same file,
modify it (lseek/
is there any sort of fcntl locking going on here? You don't mention any so I
assume not...
Would it be possible for you to write a small a reproducer program and give us a
set of steps to duplicate this? Trying to troubleshoot this in the context of a
MTA is going to be tricky. It'll be much easier if we can reduce the reproducer
down.
Ideally we would, yes, write such a program. We do not have one currently for
this particular problem.
For the previous NFS-related "file-caching" bug (fixed in the 2.6.13/2.6.14
kernels by Trond Mykelbust), we did produce such a tool. However, that tool does
not appear to trigger this new problem.
I hope to be trying to reproduce this issue next week. If we can do so reliably,
we can write such an application.
Sincerely,
-t
Excellent. I'll set this to NEEDINFO for now. Go ahead and set it back to
ASSIGNED once you have more info to go on.
Created attachment 294295
Trivial testcase that should demonstrate the problem
Instructions for the trivial testcase script:
Please edit the variables 'filename' and 'remote' depending on your
test environment.
The testcase should be run on NFS client number 1. '$remote' is another
NFS client that shares the same NFS namespace (and has access to the file
${filename})
Created attachment 294296
NFS: Fix a potential file corruption issue when writing
Proposed fix for the bug.
Thanks, Trond. Let me see what we can do about getting this in soon.
Yep, the reproducer here is indeed trivial and consistently fails. The patch
seems to fix it and looks sane. got some test kernels on my people page with this patch. Thom, would you be
able to test your product on them and let me know if they correct the issue?
Note that these kernels are based on develoment builds and aren't fully QA'ed,
so please only deploy them for testing purposes...
http://
Excellent work all around, thank you folks. Thank you, Trond. I hope to test
with the new kernel today.
Excellent. I've just posted a new set of test kernels on my people page
(jtltest.20). I'd recommend using those instead of any earlier ones since those
kernels should also have the fixes for the vmsplice() local exploit that was
disclosed recently.
Let me know how it goes.
I have confirmed that the new kernel 2.6.18-81.el5 looks to have eliminated the
null bytes problem, when using the testcase that Trond provided.
I am also running a "SPECmail" test on this environment today, with the new
kernel in place, in order to verify proper behaviour under higher load. Thanks,
sincerely, -t
More supporting detail - I ran two SPECmail tests this afternoon. Each test used
2 Linux NFS client servers, attached to a shared NFS storage volume. The kernels
used were as follows, along with the results:
Test tool: SPECmail (spec.org) v1.01
Server application: CommuniGate Pro 5.2.0 x86-64, 0+2 Dynamic Cluster
NFS server: NetApp FAS270
OS: RedHat 5.1 x86_64 [RHEL5.
Test 1:
Kernel vmlinuz-
Resulted in null byte in CommuniGate Pro "mailbox" files
(I will attach a sample mailbox file demonstrating the null bytes.)
Test 2:
Kernel vmlinuz-
Resulted in no null bytes in mailboxes
Thank you, please let me know if there are any questions. Sincerely.
Created attachment 295054
INBOX mailbox with 1 message replaced with null bytes
Verified based on customer's report as well as the testcase.
uh, the bug watch updater is on crack.. the upstream bug is "verified" not "invalid"..
http://
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Description of problem:
CommuniGate Systems is reporting this case on behalf of two CommuniGate/RedHat customers running RedHat Enterprise Server 5.1 and seeing some problems related to file integrity on this platform. We have two customers who upgraded their CommuniGate Pro cluster nodes to RedHat 5.1, from an earlier RHES 4.1 version. In both these cases, the kernel reportedly in use is this: 2.6.18-53.el5
We also have reports of a possibly identical problem with a customer running this kernel version, though we don't have the specifics of the Linux OS version: kernel version 2.6.18-8.1.8
In both of these cases, the customers began to get what appear to be
"null bytes" in mailboxes. I will a screenshot png of one of
these mailboxes, as seen with vi.
The mount options used are:
32768,wsize= 32768,hard, intr,timeo= 600,bg, retrans= 2,noatime
tcp,rsize=
The output of "mount -v" for one of these customers showed the following:
30.35.5: /vol/CGPweb on /CGPweb type nfs nfsvers= 3,proto= tcp,rsize= 32768,wsize= 32768,timeo= 600,hard, intr,bg, acregmax= 6,addr= 172.30. 35.5)
>>>172.
>>>(rw,
The exact operating system in use was:
>>>Linux MSA 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686 i686 i386 GNU/Linux Red Hat Enterprise Linux 5.
When I last researched this in detail, it appeared that the byte offsets
and total sizes were still correct after the null bytes were inserted;
only the contents of those bytes were replaced with null characters. So,
it appeared at first glance that it was a 1:1 replacement of valid data
with "corruption"-type data of some sort.
When analyzing CommuniGate Pro logs (which report the file sizes and offsets of all messages), we found two types of symptoms:
1. a missing message with null bytes inserted instead (1:1 replacement of characters bytes into NULL bytes)
2. no missing message, but null bytes between/within two messages, and there is some indication that parts of some messages are missing (and replaced with NULL bytes)
A key question that is not 100% clearly answered is whether there is any indication of additional bytes ever being added, or if the null bytes are simply byte-replacement of data. From the available evidence, it appears that there is just 1:1 byte replacement.
Also, shile this is not 100% confirmed - CommuniGate Pro appears to be getting the correct byte offsets from the file system, as noted in the "math" parts of this document. This would suggest a problem that is different than the previous pre-2.6.13 Linux NFS kernel problem. Also, the time interval between some of the events that insert null bytes is rather large, often times 10+ minutes of interval between events.
Of these two customers, both went back to RedHat 4.5, and the problem
immediately disappeared. We have many customers running RedHat ES 4.5 successfully. Earlier RedHat versions than this still have a different NFS kernel bug which can cause serious problems in an CommuniGate Pro Dynamic Cluster when NFS-based. (A few years ago, we discovered a Linux
kernel bug related to NFS client handling in the kernel (s... | https://bugs.launchpad.net/ubuntu/+source/linux/+bug/199037 | CC-MAIN-2019-18 | refinedweb | 1,697 | 73.47 |
The NFS Gateway for HDFS allows HDFS to be mounted as part of the client's local file system.
This release of NFS Gateway supports and enables the following usage patterns:
Users can browse the HDFS file system through their local file system on NFSv3 client compatible operating systems.
Users can download files from the the HDFS file system on to their local file system
Users can upload files from their local file system directly to the HDFS file system
Prerequisites:
The NFS gateway machine needs everything to run an HDFS client like Hadoop core JAR file, HADOOP_CONF directory.
The NFS gateway can be on any DataNode, NameNode, or any HDP client machine. Start the NFS server on that machine.
Instructions: Use the following instructions to configure and use the HDFS NFS gateway:
Configure settings for the HDFS NFS gateway:
NFS gateway uses the same configurations as used by the NameNode and DataNode. Configure the following three properties based on your application's requirement:
Edit the
hdfs-default.xmlfile on your NFS gateway machine and modify the following property:
<property> <name>dfs.access.time.precision</name> <value>3600000</value> <description>The access time for HDFS file is precise upto this value. The default value is 1 hour. Setting a value of 0 disables access times for HDFS. </description> </property>
Update the following property to
hdfs-site.xml:
<property> <name>dfs.datanode.max.xcievers</name> <value>1024</value> </property>
Add the following property to
hdfs-site.xml:
<property> <name>dfs.nfs3.dump.dir</name> <value>/tmp/.hdfs-nfs</value> </property>
Optional - Customize log settings.
Edit the
log4j.propertyfile to add the following:
To change trace level, add the following:
log4j.logger.org.apache.hadoop.hdfs.nfs=DEBUG
To get more details on RPC requests, add the following:
log4j.logger.org.apache.hadoop.oncrpc=DEBUG
Start NFS gateway service.
Three daemons are required to provide NFS service:
rpcbind(or
portmap),
mountdand
nfsd. The NFS gateway process has both
nfsdand
mountd. It shares the HDFS root "
/" as the only export. It is recommended to use the
portmapincluded in NFS gateway package as shown below:
Stop
nfs/
rpcbind/
portmapservices provided by the platform:
service nfs stop service rpcbind stop
Start package included
portmap(needs root privileges):
hadoop portmap
OR
hadoop-daemon.sh start portmap
Start
mountdand
nfsd.
No root privileges are required for this command. However, verify that the user starting the Hadoop cluster and the user starting the NFS gateway are same.
hadoop nfs3
OR
hadoop-daemon.sh start nfs3
Stop NFS gateway services.
hadoop-daemon.sh stop nfs3 hadoop-daemon.sh stop portmap
Verify validity of NFS related services.
Execute the following command to verify if all the services are up and running:
Verify if the HDFS namespace is exported and can be mounted by any client.
showmount -e $nfs_server_ip
You should see output similar to the following:
Exports list on $nfs_server_ip : / (everyone)
Mount the export “/”.
Currently NFS v3 is supported and uses TCP as the transportation protocol is TCP. The users can mount the HDFS namespace as shown below:
mount -t nfs -o vers=3,proto=tcp,nolock $server:/ $mount_point
Then the users can access HDFS as part of the local file system except that, hard/symbolic link and random write are not supported in this release. We do not recommend using tools like vim, for creating files on the mounted directory. The supported use cases for this release are file browsing, uploading, and downloading.
User authentication and mapping:
NFS gateway in this release uses
AUTH_UNIXstyle.
NFS gateway converts UID to user name and HDFS uses username for checking permissions.
The system administrator must ensure that the user on NFS client machine has the same name and UID as that on the NFS gateway machine. This is usually not a problem if you use same user management system (e.g., LDAP/NIS) to create and deploy users to HDP nodes and to client node.
If the user is created manually, you might need to modify UID on either client or NFS gateway host in order to make them the same.
The following illustrates how the user ID and name are communicated between NFS client, NFS gateway, and NameNode. | http://docs.hortonworks.com/HDPDocuments/HDP1/HDP-1.3.2/bk_user-guide/content/user-guide-hdfs-nfs.html | CC-MAIN-2014-42 | refinedweb | 697 | 56.86 |
The whole point of showing the user a list of items is so that they can interact with it. You can manipulate the data on display in various ways and handle events when the user selects an item.
Perhaps the most important thing is to deal with the user selecting and item. The usual way of doing this is to write a handler for the OnItemClickListener. This passes four parameters
onItemClick(AdapterView parent, View view, int position, long id)
The AdapterView is the complete View displayed by the container, the View is the View object the user selected, the position in the collection and the id is the items id number in the container. For an ArrayAdapter the id is the same as the array index.
You can use this event to find out what the user has selected and modify it. For example the event handler:
AdapterView.OnItemClickListener mMessageClickedHandler = new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { ((TextView)v).setText("selected"); } };
AdapterView.OnItemClickListener mMessageClickedHandler = new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { ((TextView)v).setText("selected");
} };
sets each item the user selects to "selected" - not useful but you could change color to grey out the selection.
It is important to know that changing what the View object displays doesn't change the data stored in the associated data structure. That is in this case setting a row to "selected" doesn't change the entry in the String array.
To set the handler to the ListView you would use:
myList.setOnItemClickListener( mMessageClickedHandler);
You can also set the selection in code using:
myList.setSelection(position);
where position is the zero based position of the item in the list and you can scroll to show any item using
myList.smoothScrollToPosition(position);
A subtle point worth mentioning is that you can't make use of the view object that is passed to the event handler to display the selection in another part of the layout.
A View object can only be in the layout hierarchy once.
In most cases this isn't a problem because you can usually manually clone the View object. For example, in this case the View object is a TextView and so you can create a new TextView and set its Text property to be the same as the the one in the list. For example:
TextView w=new TextView(getApplicationContext()); w.setText( ((TextView)v).getText()); LinearLayout myLayout= (LinearLayout) findViewById(R.id.layout); myLayout.addView(w);
This can be more of a nuisance if the View object is more complex.
One of the slightly confusing things about using adapters is the relationship between what is displayed and what is in the underlying data structure. You can change the data but if you want to see the change in the container you have to use an adapter notify method to tell that the data has changed.
For example, if you change an element of the array:
myStringArray[0]="newdata";
then nothing will show until you use:
ListView myList= (ListView) findViewById(R.id.listView); ArrayAdapter myAdapt= (ArrayAdapter)myList.getAdapter(); myAdapt.notifyDataSetChanged();
Notice that you have to cast the ListAdapter returned from getAdapter to an ArrayAdapter to call the notify method.
There is a second way to change the data using the ArrayAdapter itself. This provides a number of methods to add, insert, clear, remove and even sort the data in the Adapter. The big problem is that if you use any of these then the underlying data structure associated with the Adapter has to support them.
For example the add method adds an object onto the end of the data structure but if you try:
myAdapt.add("new data");
with the program as currently set up you will find that you get a runtime crash. The reason is that in Java an array has a fixed size and the add method tries to add the item to the end of the array which isn't possible.
If you want to add items to the end of an array like data structure you need to use an ArrayList and not just a simple array. An ArrayList can increase and decrease its size.
For example we can create an ArrayList from out existing String array:
ArrayList<String> myArrayList= new ArrayList<String>();
and you can associate this new ArrayList with the adapter instead of the String array:
ArrayAdapter<String> myAdapter= new ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, myArrayList);
Following this you can use:
and you will see the new data at the end of the displayed list. You may have to scroll to see it.
As long as you are using an ArrayList you are safe to use all of the adapter data modifying methods:
add(item)addAll(item1,item2,item3...)clear() //remove all datainsert(item,position)remove(item)
add(item)
addAll(item1,item2,item3...)
clear() //remove all data
insert(item,position)
remove(item)
You can also make use of
getCount() //get number of elementsgetItem(position) // get itemgetItemId(position) //get item id
and
getPosition(item)
So far we have just made use of the system provided layout for the row. It is very easy to create your own layout file and set it so that it is used to render each row - but you need to keep in mind that the only data that will be displayed that is different on each row is derived from the items .toString method.
The simplest custom layout has to have just a single TextView widget which is used for each line. In fact this is so simple it has no advantage over the system supplied layout so this is really just to show how things work.
Use Android Studio to create a new layout in the standard layout directory and call it mylayout.xml. Use the designer or text editor to create a layout with just a single TextView object. Create a new layout and accept any layout type for the inital file. You will can then place a TextView on the design. You wont be able to delete the layout however as the editor will not allow you to do it. Instead you need to switch to Text view and edit the file to remove the layout:
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=" apk/res/android"
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:
Notice that you need the xmlns attribute to make sure that the android namespace is defined.
To use the layout you simply provide its resource id in the ArrayAdapter constructor:
ArrayAdapter<String> myAdapter= new ArrayAdapter<String>( this, R.layout.mylayout, myStringArray);
If you try this you wont see any huge difference between this and when you use the system layout android.R.layout.simple_list_item_1.
The next level up is to use a layout that has more than just a single TextView in it. The only complication in this case is that you have to provide not only the id of the layout but the id of the TextView in the layout that you want to use for the data.
For example, if you create a layout with a horizontal LinearLayout and place a CheckBox, and two TextViews:
Then you can use the layout by creating the ArrayAdapter with:
ArrayAdapter<String> myAdapter= new ArrayAdapter<String>( this, R.layout.mylayout, R.id.textView2, myStringArray);
assuming that the TextView you want the data to appear in is textView2.
The result is a little more impressive than the previous example:
Notice that each of the View objects in the layout gives rise to a distinct instance per line. That is your layout may only have had one CheckBox but the ListView has one per line. This means that when the user selects the line you can retrieve the setting of the CheckBox say. It also means that a ListView can generate lots and lots of View objects very quickly and this can be a drain on the system.
There are a few things that you need to know if you are going to successfully handle onItemClick events.
The first is that your layout can't have any focusable or clickable Views. If it does then the even isn't raised and the handler just isn't called.
The solution is to stop any View object in the container from being focusable. Add
android:descendantFocusability="blocksDescendants"
to the LinearLayout say or use the property window to set it to blocksDescendants:
With this change the event handler should be called but now you need to keep in mind that the View object passed as v in:
public void onItemClick(AdapterView parent, View v, int position, long id)
is the complete View object for the row and not just the TextView. That is in the case of the example above it would be the LinearLayout plus all of its children.
If you are going to work with the View object you have to access the objects it contains and you can do this is in the usual way. For example:");
} };
Notice that you can use findViewById in the View that is returned. | https://www.i-programmer.info/programming/android/7849-android-adventures-listview-and-adapters.html?start=1 | CC-MAIN-2021-17 | refinedweb | 1,531 | 59.84 |
#include <environment.h>
List of all members.
Determine bootstrapping of root classes.
Load a class via bootstrap classloader.
Set
Ready For Exceptions state.
This function must be called as, soon as VM becomes able to create exception objects. I.e. all required classes (such as java/lang/Trowable) are loaded.
Get
Ready For Exceptions state.
TRUE, if VM is able to create exception objects.
Globals.
If set to true, DLRVM will store JARs which are adjacent in boot class path into single jar entry cache.
This will optimize lookups on class loading with bootstrap class loader.
If set to true by the
-compact_fields command-line option, the VM will not pad out fields of less than 32 bits to four bytes.
However, fields will still be aligned to a natural boundary, and the
num_field_padding_bytes field will reflect those alignment padding bytes.
If set to true by the
-sort_fields command line option, the VM will sort fields by size before assigning their offset during class preparation.
This will be set to either
NULL or
heap_base depending on whether compressed references are used.
Preloaded strings.
Preloaded methods.
Preloaded classes.
Object of
java.lang.Error class used for JVMTI JIT PopFrame support.
Offset to the
vm_class field in
java.lang.Class.
VM initialization timestamp.
Total method compilation time in msec.
Total loaded class count.
Total unloaded class count.
Total unloaded class count.
The initial amount of Java heap memory (bytes).
The initial amount of used memory (bytes).
The VM state.
See
VM_STATE enum above.
Genereated on Tue Mar 11 19:26:01 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable. | http://harmony.apache.org/subcomponents/drlvm/doxygen/vmcore/html/struct_global___env.html | CC-MAIN-2014-15 | refinedweb | 275 | 70.39 |
Re: Probability Problem
- From: Elliot Temple <curi@xxxxxxx>
- Date: Tue, 25 Apr 2006 00:09:08 -0700
I think I got it. I noticed my code is essentially the same as Tim Peter's (plus the part of the problem he skipped). I read his code 20 minutes before recreating mine from Alex's hints. Thanks!
def main():
ways = ways_to_roll()
total_ways = float(101**10)
running_total = 0
for i in range(1000-390+1):
j = i + 390
running_total += ways[i] * ways[j]
print running_total / total_ways**2
print ways[:10]
def ways_to_roll():
result = [1]
for i in xrange(10):
result = combine([1] * 101, result)
return result
def combine(a, b):
results = [0] * (len(a) + len(b) - 1)
for i, ele in enumerate(a):
for j, ele2 in enumerate(b):
results[i+j] += ele * ele2
return results
main()
# output: 3.21962542309e-05 and
# [1, 10, 55, 220, 715, 2002, 5005, 11440, 24310, 48620]
# 3.21962542309e-05 is 32 out of a million
On Apr 24, 2006, at 9:14 PM, Alex Martelli wrote:
Elliot Temple <curi@xxxxxxx> wrote:
On Apr 24, 2006, at 8:24 PM, Alex Martelli wrote:
Lawrence D'Oliveiro <ldo@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
In article <mailman.4949.1145931967.27775.python-list@xxxxxxxxxx>,
Elliot Temple <curi@xxxxxxx> wrote:
Problem: Randomly generate 10 integers from 0-100 inclusive, and sum
them. Do that twice. What is the probability the two sums are 390
apart?
I think the sum would come close to a normal distribution.
Yes, very close indeed, by the law of large numbers.
However, very close (in a math course at least) doesn't get the cigar.
You can compute the requested answer exactly with no random number
generation whatsoever: compute the probability of each result from
0 to
1000, then sum the probabilities of entries that are exactly 390
apart.
That was the plan, but how do I get the probability of any given
result? (in a reasonable amount of time)
BTW I'm not in a math course, just curious.
OK, I'll trust that last assertion (sorry for the hesitation, but it's
all too easy to ``help'' somebody with a homework assignment and
actually end up damaging them by doing it FOR them!-).
I'm still going to present this in a way that stimulates thought, rather
than a solved problem -- humor me...!-)
You're generating a uniformly distributed random number in 0..100 (101
possibilities), 10 times, and summing the 10 results.
How do you get a result of 0? Only 1 way: 0 at each attempt --
probability 1 (out of 1010 possibilities).
How do you get a result of 1? 10 ways: 1 at one attempt and 0 at each
of the others - probability 10 (again in 1010'ths;-).
How do you get a result of 2? 10 ways for '2 at one attempt and 0 at
each of the others', plus, 10*9/2 ways for '1 at two attempts and 0 at
each of the others' -- probability 55 (ditto).
...and so forth, but you'd rather not work it out...
So, suppose you start with a matrix of 101 x 10 entries, each of value 1
since all results are equiprobable (or, 1/1010.0 if you prefer;-).
You want to compute the number in which you can combine two rows. How
could you combine the first two rows (each of 101 1's) to make a row of
201 numbers corresponding to the probabilities of the sum of two throws?
Suppose you combine the first entry of the first row with each entry of
the second, then the second entry of the first row with each entry of
the second, etc; each time, you get a sum (of two rolls) which gives you
an index of a entry (in an accumulator row starting at all zeros) to
increment by the product of the entries you're considering...
Can you generalize that? Or, do you need more hints? Just ask!
Alex
--
-- Elliot Temple
.
- References:
- Probability Problem
- From: Elliot Temple
- Re: Probability Problem
- From: Lawrence D'Oliveiro
- Re: Probability Problem
- From: Alex Martelli
- Re: Probability Problem
- From: Elliot Temple
- Re: Probability Problem
- From: Alex Martelli
- Prev by Date: Re: MS VC++ Toolkit 2003, where?
- Next by Date: Re: MS VC++ Toolkit 2003, where?
- Previous by thread: Re: Probability Problem
- Next by thread: Re: Probability Problem
- Index(es): | http://coding.derkeiler.com/Archive/Python/comp.lang.python/2006-04/msg03787.html | crawl-002 | refinedweb | 723 | 70.13 |
While.
Go To Definition
Go To Definition (F12) is now enabled on Resources (Local, System & Extension SDK), Bindings, Properties and XAML Elements (UserControls, CustomControls & System types). In the following section, let’s look into the changes in more detail.
Resource:
System type
You can use Go to Definition on System or Extension SDK types. Doing so will navigate you directly to the Object Browser:
Local type (Custom control):
Binding Expression.
IntelliSense for:
Setting Grid.Background to a System brush
Setting TextBlockStyle to a System style
Setting GridView.Style to a Local resource
Code Snippets!
Better commenting support
The XML standard does not support nested comments, but we have added support to ensure that the result of commenting a region of code which already contains comments will be standards compliant:
IntelliSense matching
We have updated IntelliSense matching support in the XAML editor to include camel case, substring and fuzzy matching.
Fuzzy matching
Notice how we select StackPanel even though you might have mistyped it as ‘StakPa”.
CamelCase matching
You don’t need to type long Type names anymore. Its abbreviation will work just fine, e.g typing “ABB” will select AppBarButton.
Substring matching
For example, typing “Sized” will select VariableSizedWrapGrid.
Start Tag / End Tag refactoring
This feature automatically updates the start or end tag of a XAML element while you are editing its corresponding start or end tag. Moreover adding the ‘/’ character to a start tag will remove the corresponding end tag without affecting the element’s inner content.
Tag refactoring
Removing the end tag
Other Improvements:
- Move line up/down (Alt + Up Arrow, Alt + Down Arrow)
- Scrollbar enhancements.
Are these features available in the Preview version of VS 2013 ?
Excellent additions!! Thank you VS Client Tools Team.
@dbContext: The IntelliSense and Go To definition features are only available for Windows Store Apps in the Preview. It will be made available for all other (WPF, SL, Windows Phone) platforms in the next release of Visual Studio 2013.
Is there any reason the IntelliSense is inconsistently matched only, not filtered as it is in the code? For example, with ABB, no reason for BitmapIcon, or with the Sized example, I would expect the VariableSizedWrapGrid to be the only item visible from that list…
@Jan Kučera : Thanks for your feedback. Filtering results to just the matched items is on our backlog.
"All the improvements highlighted here will be available for all XAML platforms (WPF, Silverlight, Windows Phone and Windows Store)" #WIN
Now those are great additions. Wonder why they were not added before!
Really great… waiting for next release… when? To have these great advantages in windows phone I need them!
Too little, too late.
I wished for all of these badly-needed features years ago when I was using VS2010 to develop data visualization software in WPF. However, the slow progress in WPF, XAML, and Visual Studio's support for these technologies has made me jump ship and move on to developing for HTML5.
This is not aimed at the hard-working developers that brought these excellent features into existence, but more towards Ballmer and anyone else that is arrogantly putting the Windows Store ahead of your customer's needs. Seen the new MSDN home page or even the Visual Studio UI? Nobody is clamoring for these changes — there are much more important things you could have been doing:
1. Improve performance of WPF.
2. Use WPF in more of your own products (not just Visual Studio).
3. Come up with a less-verbose version of XAML (think of JSON for setters and KnockoutJS for bindings).
4. Etc.
Good stuff guys! I'm one of those "Always open documents in full XAML view" developers so these additions are much appreciated! Keep up the great work.
Meanwhile, Visual F# doesn't even have semantic syntax highlighting or Go To Definition on types defined outside the current project.
Please add regions!
Also, please make comments collapsible, like they are in the code editor.
very Good
something like resharper
thanks
Nice improvements, I hope I'll be released soon.
Nice new features! Thanks for these
I like those improvements. Another one I'd wish for is x:Static support. It's annoying having to copy and paste all those property names for dynamic resources instead of choosing one from intellisense when using systemcolors like this:
{DynamicResource {x:Static SystemColors.ControlBrushKey}}
…and btw your UserVoice link is broken near the end of the post.
@Juan Pablo : Thanks for the feedback. Unfortunately I cant comment on release dates.
@Florian : Thanks for your feedback. You might be surprised at what gets delivered at RTM. No promises but x:Static is definitely on top of our backlog. I will fix the link shortly.
That's great to know, thanks 🙂
Good stuff! Especially the fact that all these improvements will be showing up for WPF as well as Windows Store apps.
I don't suppose there's any chance WPF could get the XAML breakpoint support that turned up for Silverlight a while back, is there? Pretty please? 🙂
Yes, filtered IntelliSense please…
This post is full of good news for once!
Just two things:
1) PLEASE use PNG for screenshots instead of JPG. Over-compressed JPG looks hideous and makes my eyes bleed (and JPPG files are heavier too).
2) Visual Studio still doesn't seem to support XAML-2009. It only supports XAML-2006. That's in 2013! Isn't that ridiculous?
visualstudio.uservoice.com/…/4176246-support-xaml-2009-in-visual-studio-editor-and-wpf-
Great new features. Love the intellisense and the nested commenting. But really all of them are welcome changes. Hopefully the performance tweaks make a big difference. XAML editor in 2012 has major issues.
hey, guess what? None of these features work, unless you are writing a Windows Store App? Good thing the article doesn't even bother to mention that. Thanks for wasting my time.
@A.R.
You must have missed the 3rd comment up above where it is explicitly stated:
"The IntelliSense and Go To definition features are only available for Windows Store Apps in the Preview. It will be made available for all other (WPF, SL, Windows Phone) platforms in the next release of Visual Studio 2013"
It would also be nice if it were possible to edit XAML while a program is running.
Great features. If they only were available for WPF!
Great !
When dreams come true.
I have this model class:
public class GamesAndJackpotsModel : ModelBase<GamesAndJackpotItemModel>
{
}
than when used in the designer:
d:DataContext="{d:DesignInstance Type=models:GamesAndJackpotsModel}"
has this warning:
Warning 1 The number of generic arguments provided doesn't equal the arity of the generic type definition.
Everything works fine, but I like warning-free code.
The data binding intellisense isn't actually useful in the RC. The only time I get the right list is when I have the d:DataContext on the element in question. It doesn't 'flow' from the parent control like a real data context.
Snippets at last! Awesome stuff guys.
Very nice work, great to see XAML Editing improving.
@Pax: There is a great VSIX that adds region support to the XAML editor.
visualstudiogallery.msdn.microsoft.com/3c534623-bb05-417f-afc0-c9e26bf0e177
@jtas:
Thanks for the info. Unfortunately I use the Express Edition, so no extensions for me ;o)
Great job! before 2013 working with XAML was a pain, now looks like VS team is introducing innovative feature.
Very nice changes, they all contribute little by little to more productivity. I really like the start tag / end tag refactoring.
Thank you very much.
A lot of these features seems what is already there. I was hoping Microsoft will provide a way to set breakpoint in XAML code and stop in that break point and inspect values at run time in xaml code itself.
Hi, it seems there no way to edit the XAML file from VS 2013 blend. when i create a form in blend and the try to import into WPF, then it give an erros as some of the blend featured are not supported in vs 2013 ??? why is this, are you gonna support WPF's XAML edit from blend back and forth ???
@Harikrishna,
In VS 2013, there is no XAML support for 3D in windows Metro app. That would be very good if the XAML supporting Viewport3D or 3D elements for Metro app. WPF had those features, but now the VS 2013 blend is not fully supporting WPF, even there’s no XAML template for WPF in VS 2013. I need to build a slick dashboard (like in science fiction, with Kinect integration), and it will go on 70 inch wall mounted monitor. big investment.
1. what kind of client tool do you recommend for my dashboard project, WPF or Windows app ?
2. Is WPF going to be dead ?
3. Is WPF will have the blend support in VS 2013 (it's not at the moment, i've checked yesterday) as it was ?
4. Is windows Metro app will have the XAML support for Viewport3D /3D elements in the future etc… ?
As a responsible person, I would like to get a clear answer from you.
Thanks a mill.
xaml code snippets has support? like html input <button press tab key for <Button id="button1" runat="server"></Button>
WPF/XAML: IntelliSense in the Xaml editor is not supported in Blend at this point. This is something we are actively investigating now. WPF is a fully supported platform and Blend bundled with Pro, Premium and Ultimate versions of Visual Studio has WPF support. I cant comment on future versions of the product but I will definitely take your feedback to the right folks. Please consider adding feature requests in UserVoice. visualstudio.uservoice.com/…/121579-visual-studio
Why was XAML intellisense suddenly removed? stop making us go to the VS editor (which is much heavier for design work) to get anything done. I have a multi monitor setup to be able to work on both simultaneously. I like my C# in VS and XAML in Blend please. was this removed intentionally? (your article is about it getting more intellisense, not removing anything)
I hope you improve WPF.
WPF is the only good technology MS has ever built.
HTML/JS suck.
If MS looses Windows users, it will die.
And Windows users want WPF apps, not web apps (that are 100% buggy).
When WPF dies, MS will die.
I know there is a cell-phone craze out there, but your deskop is still alive (but you leave it buggy and without good tools). Windows 7 and 8 are full of bugs and bad design decisions.
Its really nice to see that Visual studio still dont have any support for writing CAML and T4(only partially)
Ok that is good job, but I have today discovered a bug in blend 2013 in event code editor when I create an event for a control and put some code in it then click on outside the event code and go back to design mode then again click on the same event handler the mouse cursor will be at the same position when I leaved it.
thanks | https://blogs.msdn.microsoft.com/visualstudio/2013/08/09/xaml-editor-improvements-in-visual-studio-2013/ | CC-MAIN-2017-09 | refinedweb | 1,861 | 65.62 |
The Joy of The Joy of Clojure Closure
The Joy of Clojure has gone to print.1 The tentative timeline is as follows:
- Chapters 1, Clojure Philosophy (the “why” of Clojure) and 9, Combining Data and Code (namespaces, multimethods, prototypes, reify, etc.), will be available as free content from Manning’s Joy page.
- The final EBook version will be released by early March. At the moment it looks like the book will be available in epub, mobi, and pdf formats.
- The source code will be released.
- The paperback will be bound and available sometime in mid-March to book retailers.
- The official website will get a facelift and new/additional content.
It’s has been an absolute pleasure2 working with Chouser3 and our army of Manning4 editors and proofreaders. I would also like to thank Christophe Grand for his excellent5 technical review. Additionally, I would like to thank Steve Yegge for writing the foreword and providing insightful feedback6 that I believe made our book all the stronger. Finally,7 words cannot properly express my deep respect and gratitude to Rich Hickey the creator of Clojure — philosopher-programmer. Without his vision it’s obvious that this book would not have existed, but furthermore my life would be much the poorer.8
The book has taken so much of my time this past year that I can scarcely fathom what to do next9. Whatever it will be,10 I hope I can learn11 even a fraction as much as I did writing Joy.
Hope you like the book.
Fogus signing out.
:f
thanks to Michael Harrison who was kind enough to read a draft of this post
The book currently stands at about 333 pages. There is much that we cut that probably could have benefitted the Clojure community, but for the sake of stronger coherence we decided against inclusion. I personally wrote (roughly) an additional 100 pages of material that didn’t make it. I am not sure what the cut count for Chouser might be, but I suspect it’s significant. Some of this extra material will make it onto the official Joy of Clojure website, blog posts, and perhaps another portion will make it into future editions… when and if they ever materialize. ↩
Well of course not always — but that is to be expected when humans deal with humans. I can sometimes be be surly, so I hope there are no hard feelings. ↩
OMG… Chouser is smart. If you ever have the chance to work closely with someone brilliant then jump12 at the opportunity. It is indeed a humbling experience at times, but you will come out of that experience a smarter and better person overall. There was a time early in the process when I was on the verge of dropping out of the book project, but it was the opportunity to work with Chouser that changed my mind. I’m glad that I did as I found in Chouser a consummate partner and a true friend. ↩
Speaking from no other point of reference, I must say that while I didn’t always agree with the decisions made13 by Manning (a claim that they can make against me also), my overall experience with them was positive. What is the future of publishing? I have no idea. However, I do see that publishing firms have a clear advantage over self-publishing through the stunning strength of their editorial staff. It would be very difficult to self-publish and match the same level of quality obtainable with the help of professional editors and proofreaders. ↩
OMG… Christophe is ridiculously smart. ↩
What can I say about Mr. Yegge that everyone doesn’t already know? I will say that his emails are just as insightful and witty as his blog posts. I was not expecting that, but I was pleasantly surprised. It was almost like receiving my own personalized Drunken Rants. ↩
Obviously there are many more people deserving thanks, and we’ve tried to thank them in the book’s acknowledgements. ↩
Writing a book is a double-edged sword. On the one hand it is a monumental task that one can be proud of when complete. However, on the other hand it is an unbelievable pervasive disturbance in one’s life. To anyone wishing to write a book I have only one piece of advice. Unless you are 100% certain that you want to write a book and are willing to sacrifice time for yourself and with your loved ones, and are able to learn a healthy dose of humility… don’t. I plan to follow14 this advice moving forward. ↩
Having said that, I really think that I’ve spent my book writing capital. For better or for worse, Joy is the best possible book that I am able to produce, and I can’t imagine finding either the ability or the motivation to do it again. Maybe I’m wrong, and a flash of inspiration will hit me one day, but if that is true, then it’s too abstract for me to see even as the remotest possibility. I would much rather return to school and finish my philosophy degree, or learn Haskell15 or OCaml, or Ruby, or Factor, or NBL,16 or Io, or Mozart, or J, or Joy, or complete my black belt, or get a Ph.D, or write an operating system, or learn to play the Piano, or release these 14 half-baked Clojure projects, or learn Yoga, or watch the entire run of STNG, or contribute to CinC, or build a lego city with my kids, or watch more baseball, or take a long trip with my wife, or read the ANSI Common Lisp standard, or write a program for my kids, or explore the inherent efficiencies of nothingness, or build a website with Rails, or learn to play Go and Shogi, or listen to the complete works of Cluster, or all of the above and more. ↩
So I got a job with Relevance working with some extremely bright people… including, but not limited to, the Clojure/core team. I think the words that best describe my feelings are: OMG. todo: expand my vernacular ↩
Of everyone who will ever read Joy, I will have learned the most. ↩
try to be the worst guy in whatever band you’re in
— Pat Metheny
For some strange reason Manning said we had “too many” footnotes! The gall! ↩
I was considering writing a blog post about “How to write a book, blah blah blah” but I realize that said post would be only three sentences: 1) Write the book out of order — about whichever topic(s) happen to motivate you at any given moment. 2) It’s important to write about something that you’re passionate about. 3) The less interesting topics will eventually motivate you, but if they don’t just drop them.17 ↩
I have a series of blog posts on Haskell in mind, but I have no idea if I will ever find the time to write them. Sigh. ↩
I know a fair amount of Javascript, but I could always be stronger, and I feel that js-as-compilation-target has the potential to be huge. I would also love to finish project Doris, but it has mostly been solved by others. ↩
Or trick your co-author into writing them. :-o ↩
16 Comments, Comment or Ping
Alex Miller
Congrats! Thanks for giving us such a beautiful book.
Mar 7th, 2011
fogus
@Alex
Thank you for the kind words. It means a lot.
Mar 7th, 2011
Nikhil Prabhakar
Eagerly waiting for my copy to arrive.
Mar 7th, 2011
Aslak Gronflaten
Looking forward to reading it! Been anticipating it for it for a while now. Good job.
Mar 7th, 2011
Alex Robbins
I’ve already got a copy from the Manning early access program. Can’t wait to get it in .mobi format. It has been great so far! Thanks for your hard work.
Mar 7th, 2011
Daniel Pritchett
I’m proud to be able to dig out my “foreword by Yegge” prediction from HN 213 days ago:
Congrats on wrapping it up – I’m excited to see the final PDF hit my inbox soon.
Mar 7th, 2011
Sam Aaron
Top notch work there! This book has been nothing short of an inspiration to me.
I’m looking forward to holding a copy in my bare hands…
Mar 7th, 2011
pratik patel
fogus, congrats on a well written title. I was an early “anonymous” reviewer of your book as part of the excellent (IMO) Manning review process. I sat next to you (one of the days) at the Clojure Studio in Reston last May! Also, congrats on the new gig.
Mar 8th, 2011
Eric Normand
I can’t wait to read it. Congrats on finishing such a big and important project.
Eric
Mar 8th, 2011
Craig Andera
Congratulations! Enjoyed reading the bits version of the book. Looking forward to receiving the atoms version. Looking forward to working together even more!
Mar 8th, 2011
fogus
@Sam Aaron
Thank you for the kind words. And more importantly, thank you for the incredibly thoughtful commentary. I hope you don’t mind that we added your name to our acknowledgements.
Mar 8th, 2011
fogus
@Daniel Pritchett
I remember that post. Good call. :-)
Mar 8th, 2011
fogus
@Andera
Right back at you! I’m stoked about getting started.
Mar 8th, 2011
Hussein Baghdadi
Congrats, I can’t wait to put my hands on the book. Nice mask BTW.
Mar 8th, 2011
F_D
Congrats Mike! This is a huge accomplishment and I am beyond happy for you and Mr. Houser. I’m also proud to have been a part of the review process… so I think that folks are in for a treat with this one.
Mar 12th, 2011
Maris
I bought this book. But there is no e-book in mobi format. Very disappointing.
Jun 3rd, 2011
Reply to “The Joy of The Joy of Clojure Closure” | http://blog.fogus.me/2011/03/07/the-joy-of-the-joy-of-clojure/ | CC-MAIN-2019-35 | refinedweb | 1,663 | 72.16 |
1993-05-30 Richard Stallman (rms@mole.gnu.ai.mit.edu) * Version 19.10 released. 1993-05-29 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (read_key_sequence): If we changed buffers during read_char, go to replay_sequence. * frame.c (Ficonify_frame, Fmake_frame_invisible): Select some other frame. Move minibuffer off this frame. * frame.c (Fhandle_switch_frame): Don't call Ffocus_frame. (Fredirect_frame_focus): Call Ffocus_frame here. * xterm.c (x_bitmap_icon): Don't free icon_bitmap; create it if it hasn't been created before. * xterm.c (XTread_socket): For UnmapNotify, if frame was visible, mark it now as iconified. (x_make_frame_invisible): If async_iconic, work does need to be done. Don't let this frame stay highlighted. (x_iconify_frame): Don't let this frame stay highlighted. * s/usg5-4-2.h (sigsetmask): #undef this. * sysdep.c (sys_signal): Use 0, not NULL, to set sa_flags. 1993-05-29 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * linux.h (C_OPTIMIZE_SWITCH): Set this to the empty string; configure guesses just fine. * tekXD88.h: New file, from Kaveh Ghazi. * systty.h (CDISABLE): #undef it before re-#defining it. * sysdep.c (sys_siglist): Comment out #endif trailer. * xmenu.c (TRUE, FALSE): Same. * xterm.c (dumprectangle): Same. * emacs.c: Don't include termios.h directly--let systty.h do it. 1993-05-29 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfaces.c [HPUX]: Include time.h and define __TIMEVAL__. * emacs.c (shut_down_emacs): Maybe close X connection. New arg NO_X. (Fkill_emacs): Don't close it here. Pass new arg. (fatal_error_signal): Pass new arg. * xterm.c (x_connection_closed): Pass new arg. * xdisp.c (syms_of_xdisp): Make highlight-nonselected-windows Lisp var. (display_text_line): Obey it. (display_text_line): Really check for just the selected window. * s/usg5-4-2.h: New file. * keyboard.c (menu_bar_items): Save Vinhibit_quit by hand instead of using specbind. (menu_bar_items): Call Fnreverse before restoring Vinhibit_quit. * s/hpux8.h (OLDXMENU_OPTIONS): Add quotations. * m/ibmrt.h (C_SWITCH_MACHINE): Define only if not __GNUC__. (HAVE_FTIME): Defined. (EMACS_BITMAP_FILES): Defined. * xfns.c (Fx_close_current_connection): Clear x_current_display. * xterm.c (XTring_bell): Do nothing if x_current_connection is 0. * buffer.c (reset_buffer): Clear mark_active field here. (reset_buffer_local_variables): Not here. (Fswitch_to_buffer, Fpop_to_buffer): Return the buffer. (Fmove_overlay): Fix data types in last change. * sysdep.c (gettimeofday): Don't store in *tzp if tzp is 0. * process.c (MAXDESC): Get it from FD_SETSIZE if that exists. * s/sco4.h (PTY_ITERATION, PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF): Redefined. (SIGNALS_VIA_CHARACTERS): Defined. [HAVE_SOCKETS] (HAVE_GETTIMEOFDAY): Defined. (MAIL_PROGRAM_NAME): Defined (two alternate definitions). * xfns.c (Fx_list_fonts): Use CHECK_LIVE_FRAME on the frame arg. 1993-05-28 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/hpux8.h (LIBX11_SYSTEM): Defined. * ymakefile: Replace config.h as dep with $(config_h). (really-oldXMenu): Use two make vars to pass values of C_SWITCH_... within doublequotes. * xfns.c (x_figure_window_size): Never set PPosition or PSize. * keymap.c (syms_of_keymap): Create global_map 256 slots long. * cmds.c (keys_of_cmds): Predefined 0240-0376 as self-insert. * xterm.c (XTread_socket, case KeyPress) [HPUX]: Recognize the extended function keys. * buffer.c (Fgenerate_new_buffer_name): New arg IGNORE. (Frename_buffer): Pass new arg. 1993-05-28 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keyboard.c (menu_bar_items): Bind Qinhibit_quit to Qt while we call the keymap accessors; this gets called during redisplay. * ymakefile (alloca.o): Call $(CC), not cc. * s/linux.h (SIGNALS_VIA_CHARACTERS): Try this out for a bit. * buffer.c (Fmove_overlay): If the overlay is changing buffers, do a thorough redisplay. * xfns.c (x_set_frame_parameters): Use the first position/size parameter we find, not the last. * s/hpux8.h: Don't define HAVE_RANDOM. * config.h.in (UNEXEC_SRC): New macro, set by the configure script. * ymakefile (UNEXEC_SRC): Give it a default value here, and make UNEXEC depend on it. * ymakefile (lispdir): Set this in terms of ${srcdir}. 1993-05-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) * dispnew.c (Fsleep_for): Don't return without waiting when SEC is 0. * emacs.c (syms_of_emacs) [CANNOT_DUMP]: Don't defsubr Sdump_emacs*. * alloc.c (mark_object): Add debugging code to check for ptr clobbered. 1993-05-27 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * Version 19.9 released. 1993-05-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (read_char): Correct previous change. 1993-05-27 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * systty.h: Always terminate comments, to avoid confusion. * xfns.c: Make resource manager work correctly even when Vinvocation_name has periods and asterisks in it. (Vxrdb_name): New variable. (Fx_get_resource): Use it instead of Vinvocation_name. (Fx_open_connection): Initialize it to a copy of Vinvocation_name, with the dots and stars replaced by hyphens. (syms_of_xfns): staticpro it here. * xfns.c (Fx_get_resource): Use the proper format string when the attribute has been specified. 1993-05-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfns.c (x_get_resource_string): New function. * ymakefile (ALL_CFLAGS): Put CFLAGS last. 1993-05-26 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * s/sol2.h (SOLARIS_BROKEN_ACCESS): Don't define this. * s/aix3-2.h (C_SWITCH_SYSTEM): Don't define this to be "-ma" if we're using GCC - that's an XLC switch. * s/aix3-2.h (LIBS_SYSTEM): Put -LIM -Liconv here. * systty.h (HAVE_LTCHARS, HAVE_TCHARS): New macros; define them if we have those structures, but *don't* define them if we have TERMIOS, whose functions take care of those parameters; that screws up AIX. (struct emacs_tty): Test those symbols, instead of the ioctl commands. * sysdep.c (emacs_get_tty, emacs_set_tty, new_ltchars, new_tchars) (init_sys_modes): Same. * config.h.in (HAVE_RENAME): Include an #undef for this, so configure will have something to edit. 1993-05-26 Richard Stallman (rms@mole.gnu.ai.mit.edu) * window.c (window_loop, case GET_LRU_WINDOW): Get frame's width properly. * xselect.c (x_get_local_selection): If no conversion function exists for the requested type, just return nil. * s/linux.h (HAVE_TCATTR): Defined. * sysdep.c [HAVE_SOCKETS]: Include socket.h, netdb.h. (get_system_name) [HAVE_SOCKETS]: Use gethostbyname. 1993-05-26 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * s/hpux8.h (LIB_X11_LIB, C_SWITCH_SYSTEM, LD_SWITCH_SYSTEM) (LD_SWITCH_SYSTEM, OLDXMENU_OPTIONS): Add X11R5 directories to the search paths in these lists; they shouldn't do any harm if they don't have X11R5. * s/aix3-2.h (C_SWITCH_SYSTEM): Don't #define this if we're using GCC. 1993-05-26 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xrdb.c (magic_searchpath_decoder): Fix typos. * xdisp.c (display_text_line): Don't call compute_char_face for a non-X frame. * xfns.c (Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted. (syms_of_xfns): Install them only if X11. * ralloc.c (r_alloc_sbrk): Declare already_available as long, not SIZE. * xfns.c (x_set_cursor_type): If arg not recognized, use box cursor. * s/hpux8.h (LD_SWITCH_SYSTEM) [__GNUC__]: Pass -a archive to ld. (HAVE_RANDOM): Defined. * s/hpux.h (rand, srand): Definitions deleted. * keyboard.c (Fcurrent_input_mode): Fix the call to Flist. (make_lispy_event): Fix off-by-1 error with hpos in menu bar. * s/sunos4-1-3.h: New file. * ymakefile (XOBJ) [!HAVE_X_MENU]: Add xfaces.o. * s/irix4-0.h (SIGNALS_VIA_CHARACTERS): Defined. * xterm.c (x_wm_set_size_hint): Don't set hints for max size. 1993-05-25 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m/ibmrs6000.h (LIBS_MACHINE): Add -lIM and -liconv. (HAVE_GETTIMEOFDAY): Deleted. * sysdep.c (wait_for_termination): Don't use the BSD alternative for LINUX. Use the UNIPLUS alternative. * keyboard.c (read_char): If kbd_buffer_get_event returns nil, redisplay and retry. (kbd_buffer_get_event): If event is handled here, return nil. (swallow_events): New function. * process.c (wait_reading_process_input): Call that. * ralloc.c (POINTER): Always use char *. * s/sol2.h (C_SWITCH_X_SYSTEM): Deleted. (LD_SWITCH_SYSTEM): Delete the -L option, leave just -R. * m/symmetry.h (PTY_TTY_NAME_SPRINTF, PTY_NAME_SPRINTF): Use pty_name, not ptyname. * syntax.c (Fforward_comment): Arg is a Lisp_Object. Convert it to an int. * ymakefile (alloca.o): Get alloca.c and alloca.s from ${srcdir}. * floatfns.c (logb): Don't declare if hpux. * syntax.c (Fforward_comment): Always set point. * s/dgux.h, s/hpux.h, s/esix.h (HAVE_GETTIMEOFDAY): Deleted. * s/irix4-0.h (C_ALLOCA, alloca): Definitions deleted. [!NOT_C_CODE]: Include alloca.h. (NEED_SIOCTL): #undef this. * xterm.h (PIXEL_TO_CHAR_COL, PIXEL_TO_CHAR_ROW): Fix mismatch in arg names. * xfns.c (Fx_open_connection): Set xrm_option correctly. 1993-05-25 David J. MacKenzie (djm@wiki.eng.umd.edu) * xfns.c (x_figure_window_size): Make the default frame coords (0,0). 1993-05-25 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * Version 19.8 released. 1993-05-25 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xfns.c: Clear out the old face stuff. (x_face_table, n_faces, x_set_face, x_set_glyph, Fx_set_face_font) (Fx_set_face, Fx_get_face): Removed. (syms_of_xfns): Remove defsubr for Fx_set_face. Arrange for font names to get fully resolved - no wildcards. * xfns.c (x_set_frame_parameters): Store the value in the frame parameter alist before we call the setter function, so the setter function can touch up the value if it chooses. (x_set_foreground_color, x_set_background_color): Call recompute_basic_faces, so their GC's will reflect the changes. (x_new_font): Add extern declaration - this returns a Lisp_Object now, the fully resolved font name. (x_set_font): Accept the fully resolved name from x_new_font, and put it in the frame's parameter alist. Call recompute_basic_faces. * xterm.c (x_new_font): Return the fully resolved font name, Qnil (if no match), or Qt (match, but unacceptable metrics). * xterm.c (x_new_font): Don't call init_frame_faces. * xterm.h: New section for declarations for xfaces.c. (init_frame_faces, free_frame_faces, intern_face) (face_name_id_number, same_size_fonts, recompute_basic_faces) (compute_char_face, compute_glyph_face): Declare these here. * xfaces.c (same_size_fonts): We can now remove this extern declaration. * xfns.c (face_name_id_number): Likewise. * xterm.c (intern_face): Likewise. * xterm.c (dumpglyphs): Remember that the default faces can have null fonts, too. * xfns.c (Fx_list_fonts): Remember that FACE may not have a font specified. Don't specify 30000 as the maximum limit on the number of fontns returned - 2000 is more reasonable. * xfaces.c (build_face, unload_font, free_frame_faces): Don't forget to block input while making X calls. Treat faces as structures specifying modifications to the frame's parameters, rather than things which need to specify a complete set of parameters by themselves. * xfaces.c (init_frame_faces): Don't set up the two frame display faces by querying the GC - just leave all their fields blank, and call recompute_basic_faces, letting build_face do the work of consulting the frame when necessary. (recompute_basic_faces): New function. (compute_base_faces): New function for obtaining the "identity" for compute_char_face and compute_glyph_face. (compute_char_face, compute_glyph_face): Call it, instead of copying FRAME_DEFAULT_FACE. * xfns.c (x_make_gc): No need to call init_frame_faces here. * xfaces.c (intern_frame_face): This can be static. * dispextern.h (struct face): New field - `copy', to help us with resource allocation. * xfaces.c (free_frame_faces): Do free the first two faces; don't free anything from a face that's a copy. (intern_frame_face): Mark every face we intern as a copy; its resources are actually a combination of the real faces. (Fset_face_attribute_internal): No need to check if we're trying to free one of the frame's GC's; they never enter into the picture. * casetab.c: Fix formatting, so as not to confuse etags. * xfns.c (Fx_list_fonts): New function. (face_name_id_number): Add extern declaration for this. * xfaces.c (face_name_id_number): Make this externally visible, and make the FRAME argument a FRAME_PTR, not a Lisp_Object. (compute_char_face): Call face_name_id_number properly. * xfaces.c (unload_color): Don't free the pixel for now. * xfaces.c (merge_faces): You can't tell if a font is a character-cell font or not by testing whether or not it has a per_char table. They all do. * xterm.c (x_new_font): Same deal. * xfns.c (Fx_list_fonts): Same deal. * m/iris4d.h: Dyke out the section which specifies how to get the load average. * paths.h (PATH_INFO): New path, to edited by the configuration process. * callproc.c (Vconfigure_info_directory): New variable, used internally by build process. (syms_of_callproc): DEFVAR it and initialize it. * keyboard.c (Fcurrent_input_mode): Use XFASTINT to build the last element of the return value, not XSETINT. 1993-05-24 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) Changes for OSF/1: * mem-limits.h [__osf__ && (__mips || mips)]: #include <sys/time.h> and <sys/resource.h>. (get_lim_data): OSF wants a definition like BSD4_2's. * s/osf1.h: #include "bsd4-3.h", not "s-bsd4-3.h". * ymakefile (LIBX): Put LD_SWITCH_X_SITE before the libraries, so it actually has an effect. Some makes can't handle form feed characters in their makefiles. * s/usg5-3.h: Remove form feed. * s/template.h, m/template.h: Remove form feeds. * xfns.c (select_visual): Include the screen number in the template of things XGetVisualInfo must match. 1993-05-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/dgux.h (NO_GET_LOAD_AVG): Test _M88KBCS_TARGET, not __GNUC__. * xterm.c (XTread_socket, ConfigureNotify case): Convert from parent window, not Emacs window. (XTread_socket): Handle ReparentNotify events. * m/i860.h: New file. * keyboard.c (lispy_function_keys): Add kp-numlock. Fix kp-backspace. 1993-05-24 Thorsten Ohl (ohl@chico.harvard.edu) * m/next.h (C_SWITCH_MACHINE): Definition deleted. * lread.c: Don't #undef NULL. 1993-05-24 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * buffer.c (Fmake_overlay): Put beg and end in the right order. (Fmove_overlay): If beg and end are markers, make sure they're in the right buffer. 1993-05-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (modify_event_symbol): If a name_table elt is null, generate a name to use. Don't crash. * fileio.c (Fread_file_name): If input is empty, do return the default even if !insert_default_directory. * xterm.c (XTread_socket): For ConfigureNotify event, translate coordinates if send_event field is false provided the x-coord value is not large. 1993-05-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/irix4-0.h (NO_MATHERR): Defined. * floatfns.c [NO_MATHERR]: Undef HAVE_MATHERR. 1993-05-24 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * fileio.c (Ffile_writable_p): Pass XSTRING (foo)->data to ro_fsys, not XSTRING (foo). * xterm.c (x_new_font): Reject fonts with varying spacing. We don't support them yet. * xfns.c (x_set_font): Report the error message properly. * xfns.c (Fx_parse_geometry): No need to call check_x here; it doesn't interact with the server at all, and we need it in order to create our first frame. 1993-05-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/linux.h (HAVE_SETSID): Defined. (HAVE_SOCKETS): Defined. * process.c (create_process): Ignore retval from TIOCSTTY. (sys_siglist) [LINUX]: Don't even declare it. 1993-05-24 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * syssignal.h (sys_signal): Declare the second argument to have type signal_handler_t. We're told this is necessary for Linux. 1993-05-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/dgux.h (NO_GET_LOAD_AVG): Define, if __GNUC__. 1993-05-23 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * s/hpux8.h (NO_SIOCTL_H): Defined. 1993-05-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/linux.h (HAVE_DUP2, HAVE_ALLOCA_H): Deleted. 1993-05-23 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * syssignal.h: Don't #include <signal.h> * alloc.c: #include <signal.h>, but before "config.h". 1993-05-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfaces.c (Fset_face_attribute_internal): Don't call unload_font for the frame's own font. * xfns.c (check_x): New function. Call it in almost every Lisp function in this file. (x_set_menu_bar_lines_1): Pass both args in recursive call. 1993-05-23 Paul Eggert (eggert@twinsun.com) * editfns.c (Fcurrent_time_zone): Make `am' an int, not long. 1993-05-23 Jim Blandy (jimb@geech.gnu.ai.mit.edu) Changes for SGI from Matthew J Brown <mjb@doc.ic.ac.uk>. * m/iris4d.h, m/iris5d.h: Don't use the --cckr CC switch if we're using GCC. * m/iris4d.h . * config.h.in (LD_SWITCH_X_SITE, C_SWITCH_X_SITE): Change the #defines to #undef's, so ../configure knows it should tweak them. * xterm.c (x_scroll_bar_report_motion): Set *TIME whether or not the mouse is over a scroll bar. * xfaces.c (Fset_face_attribute_internal): Don't free the frame's normal_gc or reverse_gc. * keyboard.c (make_lispy_movement): Deal properly with mouse motion outside of all windows. * lisp.h (GLYPH_FACE): Remember that the face portion of a glyph can be 24 bits, not just eight. 1993-05-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xterm.c: Move signal.h and stdio.h before config.h. * editfns.c (Fcurrent_time_zone): Assign gmt, instead of init. 1993-05-22 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * Version 19.7 released. * Makefile.in (SUBMAKEFLAGS): Add CFLAGS to the list. * puresize.h [not HAVE_X_WINDOWS] (PURESIZE): Make this 185k, not 196k. We're actually using ~180k. * editfns.c: #include <sys/types.h>, to get time_t for Eggert's changes. 1993-05-22 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (FRAME_SUPPORT): Add mouse.elc, select.elc, scroll-bar.elc. * xdisp.c (display_text_line): Highlight in any frame's sel window. * keyboard.c (modifier_names): Update to match *_modifier in termhooks. 1993-05-22 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * xterm.c (x_scroll_bar_handle_click): Never grab the scroll bar; that feature requires more support to work correctly. * keyboard.c (make_ctrl_char): New function. (read_char): Call it. (kbd_buffer_store_event): Call it to see if the new character is the quit or stop character. (make_lispy_event): Call it. 1993-05-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfns.c (x_window_to_frame): Use XGCTYPE. 1993-05-21 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * process.c (Fopen_network_stream): Deal with older systems, which only have the h_addr field in their struct hostent. * systty.h [SYSV_PTYS]: #include <sys/types.h>. Francesco Potorti` <pot@fly.CNUCE.CNR.IT> says it's necessary on his machine, and it should be harmless. 1993-05-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * sysdep.c (wait_for_termination): Copy code from 18.59 (but sans BSD4_1 alternatives). 1993-05-21 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * ymakefile (alloca.o): #define malloc and free to be xmalloc and xfree on the command line of this compilation. * s/sco4.h (TIME_WITH_SYS_TIME): This is no longer needed. * s/linux.h: Remove copyright notices by Michael K. Johnson and Rik Faith. They have both sent in papers now which make their changes public domain. * sysdep.c (sys_suspend): Set synch_process_alive, so that wait_for_termination has something to wait for. 1993-05-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xdisp.c (display_text_line): Highlight only in selected window. * xfns.c (syms_of_xfns): Don't make Lisp vars x-mode-pointer-shape and x-nontext-pointer-shape. 1993-05-20 Ian Lance Taylor (ian@cygnus.com) * s/sco4.h (SCO): Don't define (no longer needed). (HAVE_SYS_TIME_H): Don't define (set by configure). (TIME_WITH_SYS_TIME): Define. 1993-05-20 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * dispnew.c (preserve_other_columns): Remember to multiply the size argument to bcopy by the size of a glyph. 1993-05-20 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (read_key_sequence): Reexamine this_command after pre-command-hook runs. * xterm.c (x_find_modifier_meanings): If some keys are meta and alt, make them just meta, not alt. 1993-05-19 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) Some time-handling patches from Paul Eggert: * editfns.c (Fcurrent_time_zone): Take an optional argument specifying what (absolute) time should be used to determine the current time zone. Yield just offset and name of time zone, including DST correction. Yield time zone offset in seconds, not minutes. (lisp_time_argument, difftm): New functions. (Fcurrent_time_string): Use lisp_time_argument. * systime.h (EMACS_CURRENT_TIME_ZONE, EMACS_GET_TZ_OFFSET, EMACS_GET_TZ_NAMES): Remove. * config.h.in: Add HAVE_TM_ZONE. Some more changes from Michael K. Johnson for Linux. *. Some changes from Michael K. Johnson for Linux. * sysdep.c (sys_siglist): Don't define this if HAVE_SYS_SIGLIST is #defined. That lets the system provide it, if it has it. * syssignal.h (sigmask): Only define this if <signal.h> hasn't given us a definition already. * syssignal.h (sys_sigpause): Fix argument in prototype. * sysdep.c (init_signals): The masks are called empty_mask and full_mask, not signal_empty_mask and signal_full_mask. (signal_handler_t): Moved .... * syssignal.h: ... to here. * systty.h (EMACS_SET_TTY_PGRP): Call tcsetpgrp with the correct arguments. * emacs.c (main): Don't try to establish signal handlers for SIGBUS and SIGSYS unless they're actually #defined. * systty.h [HAVE_TERMIO, __DGUX]: #include <sys/ioctl.h>. * xdisp.c (redisplay_window): Compute the scrollbar start and end properly. 1993-05-19 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (Fcurrent_input_mode): Return META as 3-way flag. 1993-05-19 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * fileio.c (Ffind_file_name_handler): Check that FILENAME is a string. * process.c (wait_reading_process_input): Undo change of April 29th, since that re-introduces the race condition the comments are warning about. Call clear_waiting_for_input before calling status_notify, though. * process.c (wait_reading_process_input): Don't forget to call clear_waiting_for_input when we exit the loop because process input has arrived. Changes for Silicon Graphics Iris 5D. * unexelfsgi.c: New file; like unexelf.c, but tolerates program segments above BSS. * m/iris5d.h: New file. * s/irix5-0.h: New file. * process.c [__sgi] (allocate_pty): Give up immediately if pty is inaccessible. 1993-05-19 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (follow_key): Check char in range before UPPERCASEP. 1993-05-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfns.c (x_set_menu_bar_lines): Fix typo in last change. * keyboard.c (make_lispy_event): Controlify lower case letters too. 1993-05-18 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xdisp.c (display_text_line): If the newline (or C-m, in selective-display) has a non-default face, apply that face to the remainder of the line, so that the fill occupies the entire line. * xterm.c (x_new_font): Tell the frame display faces about the newly chosen font. Make sure that all the display faces use fonts of the. * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have menu bars. * keyboard.c (read_key_sequence): Don't lay down an unwind_protect to restore the original buffer until we actually get a mouse click. * window.c (window-dedicated-p): Doc fix. 1993-05-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xterm.c (XTread_socket): Turn off ControlMask for XLookupString. * keyboard.c (make_lispy_event): Controlify here. 1993-05-17 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xdisp.c (redisplay_window): Make the scrollbar reflect the extent of the visible region, not the whole buffer. * xfaces.c (free_frame_faces): Don't free the resources from the first two faces. * lisp.h (malloc, realloc): Declare these to return void *, to avoid conflicts with ANSI header files. * sysdep.c (reset_sys_modes): Test the return value of EMACS_SET_TTY properly. * systty.h (EMACS_GET_TTY, EMACS_SET_TTY): Document the return values. 1993-05-16 Jim Blandy (jimb@totoro.cs.oberlin.edu) * config.h.in (STDC_HEADERS, TIME_WITH_SYS_TIME, CRAY_STACKSEG_END, STACK_DIRECTION): Add #undef clauses for these, since otherwise the autoconf tests in configure.in won't do us much good. 1993-05-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) * buffer.c (overlays_at): New arg EXTEND. (Foverlays_at, Fnext_overlay_change): Pass 1. * xfaces.c (compute_char_face): Pass 0. Try first with small overlay_vec, then use a big enough one. * lread.c (syms_of_lread): Make Vcurrent_load_list ordinary Lisp var. Set up Qcurrent_load_list. (readevalloop): Specbind Qcurrent_load_list instead of ad-hoc saving. (build_load_history): Do nothing when loading pure files. * xterm.c (dumpglyphs): Create a temporary merged gc when cursor falls on char with non-default face. * xterm.h (x_display): New field cursor_foreground_pixel. * xfns.c (x_set_cursor_color): Set cursor_foreground_pixel. * casefiddle.c (casify_region): Remove mistaken arg to record_change. 1993-05-15 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * xfaces.c (Fset_face_attribute_internal): Jolt redisplay, so it knows something has changed. * xfaces.c (unload_color): Don't try to unload the standard black or white pixel. More changes from David Mackenzie. * ymakefile (emacs): No need to edit srcdir into a lisp file and then load it; we can just take advantage of the PATH_DUMPLOADSEARCH. (crt0.o): Remember that crt0.c is in ${srcdir}. Install David Mackenzie's patches to make ${srcdir} work. *}. * process.c (wait_reading_process_input): If we're running Solaris, it's not necessary to check if we should redeliver SIGIO, according to David Mackenzie. * s/sol2.h: #include "usg5-4.h", and #define const. * systime.h: Borrow CPP sequence from getdate.y to include the proper combination of <time.h> and <sys/time.h>. 1993-05-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) * window.h (struct window): New slot region_showing. * xdisp.c (mark_window_display_accurate): Set region_showing fields. (redisplay_window): Update region_showing field. (display_text_line): Set region_showing to t if will show one. * xselect.c (Fx_selection_exists_p): Handle nil, t as SELECTION arg. Don't die if SELECTION is not recognized. * dispnew.c (direct_output_forward_char): Just give up if region is being highlighted. * xdisp.c (redisplay, redisplay_window): Don't use the cursor-motion special-case code if the region is or was highlighted. * xfaces.c (compute_char_face): New args REGION_BEG, REGION_END. Don't sort if noverlays is 0 or 1. * dispnew.c (direct_output_for_insert): Pass those args. * xdisp.c (display_text_line): Pass those args, describing the region if the mark is transient and active. 1993-05-14 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * buffer.c (Fmove_overlay): If the overlay is in no buffer and the BUFFER argument has been omitted, put it in the current buffer, for symmetry with move-marker. * buffer.c (Fdelete_overlay): Make the overlay's markers point nowhere, not at 1. Do this after calling redisplay_region, so that code knows what section has changed. 1993-05-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xdisp.c (display_menu_bar): Update FRAME_MENU_BAR_ITEMS here. * keyboard.c (command_loop_1): Don't do it here. * keymap.c (access_keymap): Handle any length vector. (store_in_keymap): Likewise. (Fcopy_keymap): Likewise. 1993-05-14 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * buffer.c (Foverlay_start, Foverlay_end, Foverlay_buffer) (Foverlay_properties): Functions moved here from subr.el. 1993-05-13 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xfaces.c (compute_char_face): When merging the overlays, traverse sortvec, not overlay_vec; the latter isn't the one we sorted. * xterm.c (dumpglyphs): Give the cursor higher priority than the face specified by the glyph under it. * xterm.c (dumpglyphs): Move the underline up a row. I dislike the way X addresses pixels. Quickdraw is much nicer. * xfaces.c (intern_face): If the face has a GC, but it's not the default or modeline face, abort. Nothing but those two faces should have a GC *and* be passed to intern_face. (compute_char_face, compute_glyph_face): After copying the frame's default face into face, to use as a base case for calculation, set the `gc' member to zero; that way we don't have things lying around that look like display faces but aren't. * xfaces.c (intern_frame_face): When copying the new face into the frame's face array, remember that the number of bytes to copy is sizeof (*new_face), not sizeof (new_face). * xfaces.c (compute_char_face): Assume that W is displaying the current buffer. Abort if it isn't. * lisp.h (Lisp_Overlay): New tag. . * buffer.c (Foverlay_get): Return Qnil if the requested property is missing from the property list. The text property routines can now modify buffers other than the current one. * insdel.c (modify_region): New argument BUFFER. Select that buffer while we prepare for the modification, and switch back when we're done. * textprop.c (add_properties, remove_properties): Pass the buffer being modified as the first argument to modify_region. * editfns.c (Fsubst_char_in_region, Ftranslate_region): Pass the current_buffer as the first argument to modify_region. * casefiddle.c (casify_region): Same. * dispnew.c (direct_output_for_insert): Compute the face of the character we're inserting properly. * xterm.c (dumpglyphs): Pass the proper arguments to intern_face. * xterm.c (dumpglyphs): Don't increment left twice. * intervals.c (set_point): Check for point out of bounds before checking for an empty interval tree. * cmds.c (Fforward_char): Check proposed new position, and then set point, instead of setting point to a potentially invalid position. * lread.c, data.c: If STDC_HEADERS is #defined, include <stdlib.h> to get the extern declarations for atof. That's where it is in POSIX. 1993-05-12 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * ymakefile (xfaces.o): Add window.h to the dependencies. *. * xdisp.c (copy_rope, copy_part_of_rope): Add face argument. (display_text_line): Initialize current_face to zero. Apply it to characters as we write them to the display matrix. (display_string): Pass the new argument to copy_rope. * xdisp.c (display_text_line): Handle the locations of face changes properly. * textprop.c (Fnext_single_property_change, Fprevious_single_property_change): Pass arguments to textget in the right order. * ymakefile (xfns.o): Remove duplication of buffer.h in dependencies. * ymakefile ($(OLDXMENU)): Remove extraneous call to `rm'. 1993-05-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keymap.c (Faccessible_keymaps): Use whatever size the vector has. (Fwhere_is_internal): Likewise. (describe_vector): Likewise. (current_minor_maps): Call Findirect_function, so symbols can be used in place of actual maps. * xdisp.c (display_text_line): Use break; to exit loop at eol. Duplicate the short MAKE_GLYPH loop after the main loop. If no display table, do obey selective_display_ellipses. (copy_part_of_rope): Arg FROM is now Lisp_Object *. * xfaces.c: Do include window.h. (compute_char_face): Supply third arg of Fget_text_property. * keyboard.c (make_lispy_event): Don't set shift modifier for C-^. * callproc.c (child_setup): Omit duplicates from new env array. 1993-05-10 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * fileio.c (ro_fsys) [SOLARIS_BROKEN_ACCESS]: Check for the filesystem being ro, since Solaris 2.1 doesn't. (file-writable-p): Call ro_fsys. * s/sol2.h (SOLARIS_BROKEN_ACCESS): Define this. * systime.h: Use the strategy from getdate.y to include the proper combination of <time.h> and <sys/time.h>. * xfns.c (Fx_create_frame): Use an XLFD name for the default font, instead of "9x15" or whatever it was. * xdisp.c (display_text_line): Make face-handling code conditional on HAVE_X_WINDOWS macro. Perhaps this isn't the best approach, but it'll do for now. * xdisp.c (display_text_line): We can't use the FRAME_DEFAULT_FACE macro here; that's x-specific. Just don't pass the second argument. * xfaces.c (compute_glyph_face): Remove the BASIC_FACE argument; use F's default face. 1993-05-09 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xfaces.c (Fmake_face_internal): Do nothing for non-X frames. * dispextern.h (struct face): Add cached_index member. * xfaces.c (get_cached_face): Use it to avoid unnecessary searches of face_vector. * xfaces.c (intern_face): Renamed from get_display_face. * xfns.c (x_make_gc): After building the GC's for the frame, call init_frame_faces to set up the first two faces. * xfaces.c (init_frame_faces): Don't just try to copy the default and mode line faces from some other random frame; instead, consult the normal_gc and reverse_gc members of the frame, and build the faces based on their parameters. Adjust the face computation functions to return frame face ID's, not pointers to display faces; since we call these functions during display construction, we don't want the display faces yet. * xfaces.c (intern_frame_face): New function. (compute_char_face, compute_glyph_face): Apply intern_frame_face to the computed face, and return the frame face's ID, instead of calling intern_face and returning a pointer to a display frame. * xfaces.c: Describe the facial data structures. It took me a while to figure them out; perhaps this will save someone else the trouble. Arrange to tell redisplay about changes in overlays. * xdisp.c (redisplay_region): New function. * buffer.c (Fmove_overlay): Call redisplay_region on the areas the overlay has enclosed or left. (Fdelete_overlay): Call redisplay_region on the area the overlay used to occupy. (Foverlay_put): Call redisplay_region on the area the overlay now occupies; we may have put a face property on it. * buffer.c (Fmove_overlay): Doc fix. * xdisp.c (redisplay): If we're doing a thorough redisplay (all windows on all frames involved), go ahead and flush the GC cache - call clear_face_vector. * xdisp.c (display_text_line): Apply faces to characters according to overlays and text properties; use compute_char_face and compute_glyph_face to figure out what face to use, and where a new face starts. * xterm.c (dumpglyphs): Use the upper bits of the glyphs to decide which frame face to use. Call GLYPH_FOLLOW_ALIASES to make sure we're implementing the glyph table properly. If we're not using the default or mode line face, call intern_face to find a display face for the frame face selected by the glyph code. Implement underlining. Remove the `font' argument; we have to derive this from the frame and face anyway. Change all callers. * disptab.h (GLYPH_FOLLOW_ALIASES): New macro. * xterm.c (x_destroy_window): Call free_frame_faces. The GNU coding standards specify that CFLAGS should be left for users to set. * ymakefile (ALL_CFLAGS): Set this to the long string of compilation switches, not CFLAGS. Changed all uses. (CFLAGS): Make this default to just -g. (.c.o): Define new default rule, to make sure that the right flags get to the compilations. 1993-05-09 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (read_char): Exit kbd macro if Vexecuting_macro is t. * pwd.h: File deleted. 1993-05-08 Jim Blandy (jimb@totoro.cs.oberlin.edu) * s/sunos4shr.h: Apply changes from David J. Mackenzie; this isn't used by any configuration right now, but he's trying to make it work. #include "sunos4-1.h" instead of "bsd4-2.h". (O_NDELAY): Don't define this. (SYSTEM_MALLOC): Don't define this, either. (LD_SWITCH_SYSTEM): Remove the definition for this. * Makefile.in (DEFS): Remove this; we have configure build a config.h file directly, instead of having lots of -D flags. * Makefile.in (CFLAGS): Don't make this carry DEFS from the configure script; the coding standards say that CFLAGS should be left for the user to tweak. 1993-05-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (do_mouse_tracking): Now static. * xmenu.c (Fx_popup_menu): Add a vector of prefix keys for the panes. (keymap_panes): Allocate that vector. (single_keymap_panes): Fill in that vector. (xmenu_show): Return a list of events, not just one event. * keyboard.c (read_char_menu_prompt): Expect Fx_popup_menu to return a list of events. Don't lose any of them. * xfns.c (Fx_get_mouse_event, Fx_mouse_events): Code deleted. * window.c (Vmouse_event): Var deleted. (syms_of_window): Don't make it a Lisp var. * keyboard.c (read_avail_input, Fset_input_mode): Make meta_key a three-value variable to support 8-bit input. 1993-05-07 Jim Blandy (jimb@totoro.cs.oberlin.edu) * ymakefile [__GNUC__ && __GNUC__ > 1] (LIB_GCC): Set this even if LINKER is #defined. * ymakefile ($(OLDXMENU)): Remove the link before we re-create it; not all versions of ln have the `-f' flag. Use the LN_S variable, inherited from src/Makefile. * Makefile.in (LN_S): New variable, edited by top Makefile. (SUBMAKEFILE): New variable, containing all flags to pass to recursive makes. * config.h.in: Adjust this for use by autoconf's AC_CONFIG_HEADER, instead of AC_OUTPUT. * xfaces.c (get_display_face): Use face_eql instead of writing it out. 1993-05-06 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keymap.c (Fwhere_is_internal): If FIRSTONLY is non-nil, avoid returning a non-ascii key sequence unless FIRSTONLY is the symbol `non-ascii'. * config.h.in: Remove mention of GLYPH datatype; that shouldn't be a user option. * lisp.h (GLYPH, MAKE_GLYPH, GLYPH_CHAR, GLYPH_FACE): New macros. 1993-05-06 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfns.c (x_get_arg): Call Fintern, not intern. * systime.h [SCO]: Include time.h. * s/sco4.h: New file. * ymakefile (LIBXMENU): Delete -loldX. * emacs.c (main): Handle -display like -d. 1993-05-05 Jim Blandy (jimb@totoro.cs.oberlin.edu) * s/template.h: Explain the relative significance of the SIGIO and INTERRUPT_INPUT macros. * ymakefile (buffer.o, insdel.o): Note that these files also depend on blockinput.h. * blockinput.h (UNBLOCK_INPUT): We cannot assume that SIGIO is defined everywhere this file is #included; merge the two definitions for defined (SIGIO) and ! defined (SIGIO) into one, which calls reinvoke_input_signal if interrupt_input_pending is set. * keyboard.c (reinvoke_input_signal): New function. 1993-05-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * window.c (Fdisplay_buffer): Add space to prompt. 1993-05-04 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keyboard.c (syms_of_keyboard): Doc fix for extra-keyboard-modifiers. * lisp.h (CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT, CHAR_CTL) (CHAR_META): Shift these all up one bit, back to where they were. 1993-05-02 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keymap.c (Fdefine_prefix_command): Doc fix. * ymakefile (C_DEBUG_SWITCH): Undo April 10 change. 1993-05-01 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (Fsuspend_emacs): Doc fix. 1993-04-30 Jim Blandy (jimb@totoro.cs.oberlin.edu) * data.c (Ffset): Refuse to set the function value of t or nil. 1993-04-29 Jim Blandy (jimb@totoro.cs.oberlin.edu) Implement. * lisp.h (CHAR_ALT, CHAR_SUPER, CHAR_HYPER): New constants, in case we need them. * termhooks.h (alt_modifier, super_modifier, hyper_modifier) (shift_modifier, ctrl_modifier, meta_modifier): Define these in terms of the CHAR_mumble macros, to avoid having the same thing defined in two places. * keyboard.c (kbd_buffer_get_event): Don't generate switch-frame events if they'd only switch to the frame already selected. This avoids lots of extra switch-frame events when using a separate minibuffer. 1993-04-29 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (Fthis_command_keys): Doc fix. * process.c (wait_reading_process_input): Move the status_notify call before the set_waiting_for_input call. * fileio.c (Fexpand_file_name): Undo last change--too risky for now. * data.c (Fdefine_function): New function (same code as Fdefalias). 1993-04-28 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * eval.c (do_autoload): Fixed the bug in the autoload-saving code. 1993-04-28 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c (Fcurrent_input_mode): New function. 1993-04-27 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * eval.c (un_autoload): Don't try to save old autoload forms when we load something in. Something about the code now conditioned out by UNLOAD was screwing up ordinary autoloads, notably of picture.el. When I figure out what, I'll fix and re-enable this code. 1993-04-27 Jim Blandy (jimb@totoro.cs.oberlin.edu) * buffer.c (syms_of_buffer): Doc fix for buffer-display-table. * systime.h: Doc fix. (EMACS_SET_USECS): Remember that a `usec' is a microsecond, not a millisecond. What's three orders of magnitude between friends? * dispnew.c (Fsit_for, Fsleep_for): Remember to multiply the `milliseconds' argument by 1000 to get microseconds. 1993-04-26 Roland McGrath (roland@geech.gnu.ai.mit.edu) * fileio.c (Fexpand_file_name): Don't remove trailing / from NEWDIR if just "/". 1993-04-26 Jim Blandy (jimb@totoro.cs.oberlin.edu) * m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/mips.h, * m/sps7.h, s/hpux.h, s/usg5-4.h (HAVE_DUP2): Removed; derived by configure script. * s/hpux.h, s/irix3-3.h, s/aix3-1.h (HAVE_GETHOSTNAME): Removed; derived by configure. * keyboard.c (read_key_sequence): Let the `modifiers' variable in the code which deals with KEY being unbound be an int, not a Lisp_Object. * config.h.in (getenv): Don't test THIS_IS_YMAKEFILE to see if we should exclude the getenv declaration; instead, test NOT_C_CODE. Per suggestion from Francesco Potorti`. * ymakefile (NOT_C_CODE): Define this; it's true, and useful. * dispnew.c (Fsleep_for, Fsit_for): Allow SECONDS to be a floating point value. 1993-04-26 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * sysdep.c (read_pending_input): Fix the garbaged-modifiers bug under System Vs previous to r4. 1993-04-25 Jim Blandy (jimb@totoro.cs.oberlin.edu) * systty.h (EMACS_GET_TTY, EMACS_SET_TTY): Move these into functions in sysdep.c. * sysdep.c (emacs_get_tty, emacs_set_tty): Here they are. * sysdep.c (emacs_set_tty): Call tcsetattr over and over again until it does all of what we ask it to, or returns an error. * search.c (Freplace_match): Arrange for markers sitting at the beginning or end of the original text to float to the corresponding position in the replacement text. 1993-04-25 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * window.c (Fset-window-buffer): Set horizontal-scrolling on a window to zero when we connect it to a new buffer. * buffer.c: Doc fix. 1993-04-24 Jim Blandy (jimb@totoro.cs.oberlin.edu). 1993-04-23 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * data.c (Fdefine_function): Changed name back to Fdefalias, so we get things in a known-good state. * buffer.h (BUF_NARROWED, NARROWED): New macros to test whether a region restriction has narrowed the buffer. 1993-04-17 Richard Stallman (rms@mole.gnu.ai.mit.edu) * systime.h: Comment fixes. * data.c (Fdefine_function): New function. * lisp.h (LOADHIST_ATTACH): New macro. (Vcurrent_load_list, Vload_history): Vars declared. * eval.c (defun, defmacro, defvar, defconst): Attach symbol argument to the list of globals for the input source. (do_autoload): Save the old autoloads, in case we ever unload. * fns.c (provide, require): Put appropriately-marked conses in the current-globals list. * lread.c (readevalloop): New argument is the source file name (or nil if none). All calls changed. Do the two-step necessary to call build_load_history with the correct current-globals list for the current recursion. (build_load_history): New function. (eval_region, eval_buffer): Call readevalloop with new arg. (load_history): New variable. 1993-04-16 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * lread.c (readevalloop): New argument is the source file name (or nil if none). All calls changed. Do the two-step necessary to call build_load_history with the correct current-globals list for the current recursion. (build_load_history): New function. (Feval_region, Feval_buffer): Call readevalloop with new arg. (Vload_history): New variable. * fns.c (Fprovide, Frequire): Put appropriately-marked conses in the current-globals list. * eval.c (Fdefun, Fdefmacro, Fdefvar, Fdefconst): Attach symbol argument to the list of globals for the input source. (do_autoload): Save the old autoloads, in case we ever unload. * data.c (Fdefine_function): New function. 1993-04-16 Jim Blandy (jimb@totoro.cs.oberlin.edu) * fileio.c (Fmake_symbolic_link): If a file already exists under the link's filename, delete the file which the link would replace, not the file the link would point at. * config.h.in (volatile): Don't define this to be the empty string if some file has #defined HAVE_VOLATILE. * emacs.c (SEPCHAR): Instead of defining this to be ',' on VMS and ':' elsewhere, just have it default to ':' if not #defined, and #define it to be ',' in s/vms.h; OS/2 will need it to be ';'. * s/vms.h (SEPCHAR): #define this to be ','. * s/template.h (SEPCHAR): Mention this. 1993-04-13 Jim Blandy (jimb@totoro.cs.oberlin.edu) * s/vms.h (xfree): #define this to emacs_xfree, to avoid case conflict with XFree; on VMS, external symbols are case-insensitive. * s/usg5-4.h (HAVE_GETTIMEOFDAY): Deleted; ../configure figures that out now. Changes for Emacs 19 from Thorsten Ohl <ohl@chico.harvard.edu>: * s/mach2.h: Copied from the Emacs 18.59 distribution. Don't define NO_REMAP, define START_FILES as `pre-crt0.o' instead. Define LIB_MATH as `-lm', to override the default `-lm -lc' (there is no libc on the NeXT). * ymakefile (STARTFILES): Allow config.h to set this value even if ORDINARY_LINK is defined. * unexnext.c: Fix subdirectories for the machine dependent include files for NeXTStep 3.0; #include <mach/mach.h> and <mach-o/loader.h> instead of <mach.h> and <sys/loader.h>. (getsectbyname): Remove prototype for this; the system #include files take care of that. (malloc_cookie): New variable. (unexec_doit): Set malloc_cookie to the result returned by malloc_freezedry. * emacs.c (main): Declare malloc_cookie to be extern, so that we can get the value set when we dumped and pass it to malloc_jumpstart. * systime.h: The NeXT has a timezone function. 1993-04-12 Jim Blandy (jimb@totoro.cs.oberlin.edu) * ymakefile ($(OLDXMENU)): Remove $(OLDXMENU) before trying to link in a new version. * lisp.h (Qrange_error, Qdomain_error, Qsingularity_error) (Qoverflow_error, Qunderflow_error): Add extern to these declarations. 1993-04-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfaces.c: Don't include Xmu/Drawing.h. 1993-04-10 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * Makefile.in (xmakefile): Recognize the -O option with a numeric optimization level. * ymakefile (C_DEBUG_SWITCH): If we're using version 2 of GCC or higher, use -O99 instead of plain -O. 1993-04-09 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c (command_loop_1): Rebuild menu bar if update_mode_lines is set. long_to_cons and cons_to_long are generally useful things; they're needed whether or not X is defined. * xselect.c (long_to_cons, cons_to_long): Moved from here... * data.c (long_to_cons, cons_to_long): ... to here. * lisp.h (long_to_cons, cons_to_long): Add extern declaration. * xmenu.c (Qmenu_enable): Definition moved... (syms_of_xmenu): ... along with initialization ... * keyboard.c (Qmenu_enable): ... to here ... (syms_of_keyboard): ... and here. * keyboard.c (kbd_buffer_get_event): If we get a selection clear or selection request event, but we were compiled without the window-system-specific code to handle it, abort. Don't try to call a function which doesn't exist. * keyboard.c (make_lispy_event): In the code which processes mouse clicks, declare f to be a FRAME_PTR, not a struct frame *; this works when MULTI_FRAME is not #defined. * xfaces.c (sort_overlays): Define this to be static, as declared. * callproc.c (relocate_fd): Make messages string literals, not initialized arrays. * alloc.c (__malloc_hook, __realloc_hook, __free_hook): Declare these extern, not static. (!) * alloc.c (__malloc_hook, old_malloc_hook, __realloc_hook) (old_realloc_hook): Declare that the functions these point to return void *, not void. Adjust for autoconf merger. *}. * buffer.c (Fmake_overlay, Fmove_overlay): New optional BUFFER arguments. (recenter_overlay_lists): New argument BUF, to use instead of the current buffer. (Foverlay_recenter): Pass the appropriate arguments to recenter_overlay_lists. * buffer.c (Fdelete_overlay): Don't assume that overlay is in the current buffer. Don't forget to declare the argument a Lisp_Object. * dispnew.c (getenv): Extern declaration deleted; this is done in config.h. * Makefile.in (tagsfiles): Remove external-lisp from this list of files; we're not distributing it, so the normal build process shouldn't depend on it. * dispnew.c (init_display): Compare the return value of getenv to zero before setting display_arg, instead of just using the pointer as a truth value. 1993-04-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xdisp.c (message, message1): If noninteractive and cursor_in_echo_area, don't print a newline at end of message. * fns.c (Fy_or_n_p): Echo the answer just once, at exit. * keyboard.c (echo_dash): Do nothing if echoptr is 0. * buffer.c (Fkill_all_local_variables): Store each var's current value in the buffer's alist entry, before reverting to the default value. 1993-04-07 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keyboard.c (apply_modifiers): Fix typo in sanity check. * keyboard.c (interrupt_input_blocked, interrupt_input_pending): Remove `extern' keywords - these are the definitions. 1993-04-07 Richard Stallman (rms@mole.gnu.ai.mit.edu) * blockinput.h (UNBLOCK_INPUT): Fix typo. (interrupt_input_blocked): Make this signed int. * search.c (search_buffer): Fix typo in previous change. * insdel.c, buffer.c: Include blockinput.h. * xterm.c: Fix typo in comment delimiter. 1993-04-07 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * m/imbrs6000.h: If we're using GCC, define ORDINARY_LINK instead of defining LINKER to use cc. * s/aix3-1.h (LINKER): Don't use cc for linking command if we're using GCC. * s/aix3-2.h (SYSTEM_MALLOC): Undefine this. * xterm.c (updating_frame): Declare this extern instead of static, so it's the same variable as the updating_frame in term.c. (XTupdate_begin, XTupdate_end): Don't bother to set updating_frame; the term.c functions take care of that for us. 1993-04-05 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * s/vms.h (EXEC_SUFFIXES): Add definition for this. 1993-03-31 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * xfaces.c: Doc fixes. Put interrupt input blocking in a separate file from xterm.h.. * keyboard.c (parse_modifiers, apply_modifiers): Make sure we're not trying to create modifier masks using integers which are unrepresentable as lisp values. 1993-03-30 Jim Blandy (jimb@geech.gnu.ai.mit.edu) New macros NULL_DEVICE and EXEC_SUFFIXES, to give the name of the". * s/vms.h (NULL_DEVICE): #define this. Rename int-to-string to number-to-string, since it can handle floating-point as well as integer arguments. subr.el defines the former as an alias for the latter. * data.c (Fnumber_to_string): Renamed from Fint_to_string. (wrong_type_argument): Adjust caller. (syms_of_data): Adjust defsubr. * fns.c (concat): Adjust caller. * lisp.h (Fnumber_to_string): Adjust extern declaration. * mocklisp.c (Finsert_string): Adjust caller. * process.c (status_message): Adjust caller. 1993-03-28 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * systty.h [NO_PTY_H]: Don't include pty.h. * m/delta88k.h [USG5_4]: Alternate defining of LIBS_SYSTEM, LIBX11_SYSTEM, HAVE_RANDOM, BSTRING. (NO_PTY_H): Defined. * fileio.c (Fwrite_region): Don't fail to set visit_file. * keyboard.c (command_loop_1): Clear force_start of selected_window after reading each key sequence. (read_char): Clear Vquit_flag when we return C-g for it. * fileio.c (Fexpand_file_name): Default DEFALT at beginning, before expanding it. But avoid unneeded or infinite recursive expand. 1993-03-26 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * editfns.c (Fchar_equal): Don't ignore high bits of character. * fileio.c (Fwrite_region): Set visit_file after expanding file arg. Also expand VISIT arg if specified. * frame.c (make_frame): Init face_alist field. 1993-03-25 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * xselect.c (SELECTION_QUANTUM): Don't use XMaxRequestSize on R3; access the display structure directly. 1993-03-25 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * ymakefile (xfns.o): Depend on buffer.h. * buffer.h (struct buffer): Field `fieldlist' deleted. * search.c (Freplace_match): Clean up criterion about converting case. If old text has any capitalized words, capitalize new text. * xfaces.c: New file. * ymakefile (XOBJ): Add xfaces.o. (xfaces.o): New target. * emacs.c (main): Call syms_of_xfaces. * buffer.h (OVERLAY_START, OVERLAY_END, OVERLAY_VALID): New macros. (OVERLAY_POSITION): Likewise. (searchbuf): Decl deleted--doesn't belong here. Delete include of regex.h for VMS. * dired.c (searchbuf): Declare here. * frame.h (struct frame): New field face_alist. * alloc.c (mark_object): Mark face_alist of a frame. * ymakefile (xselect.o): Depend on dispextern.h. * xterm.h (FRAME_FACES, FRAME_N_FACES, FRAME_DEFAULT_FACE) (FRAME_MODE_LINE_FACE): New macros. (struct x_display): New fields faces, n_faces. * dispextern.h (struct face): New fields pixmap_h, pixmap_w. Field `font' is now a pointer. * fns.c (Fy_or_n_p): Ensure cursor_in_echo_area = 0 when quit. 1993-03-24 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * dispnew.c (getenv): Add extern declaration. * ymakefile (really-oldXMenu): Pass C_SWITCH_SITE and C_SWITCH_SYSTEM to the inferior make as separate flags, instead of passing just C_SWITCH_SITE as CFLAGS. * keymap.c (Fkeymapp): Doc fix. * xterm.h (x_focus_frame): Add extern keyword to declaration. * xterm.c [VMS]: Don't #include <sys/termio.h> and <string.h>. * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm. * process.c [VMS] (DCL_PROMPT): Remove hack. (WIFSTOPPED, WIFSIGNALED, WIFEXITED, XRETCODE, WSTOPSIG) (WCOREDUMP, WTERMSIG): New dummy definitions. (deactivate_process): Add missing semicolon. * dispnew.c (init_display): Get display name from environment properly on VMS as well as Unix. 1993-03-24 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * buffer.c (init_buffer_once, reset_buffer): Delete last vestige of fieldlist slot. (Fregion_fields): Finally deleted. * keymap.c (push_key_description): Ignore bits above meta_modifier. 1993-03-23 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * buffer.c (overlays_at, recenter_overlay_lists): New functions. (Fmake_overlay, Fdelete_overlay, Foverlay_get, Foverlay_put): Likewise. (Fmove_overlay, Foverlays_at, Fnext_overlay_change): Likewise. (Foverlay_lists, Foverlay_recenter): Likewise. * buffer.h (struct buffer): New fields overlay_center, overlays_before, overlays_after. 1993-03-23 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * config.h.in (HAVE_XFREE386): New flag, set by configure script. If it's set, #define LIBX11_SYSTEM and HAVE_RANDOM as appropriate for XFree386. * sysdep.c (random, srandom): Don't define these if HAVE_RANDOM is #defined. * config.h.in (C_SWITCH_X_SITE, LD_SWITCH_X_SITE): New flags. * ymakefile (C_SWITCH_X_SITE, LD_SWITCH_X_SITE): Provide default values. Include C_SWITCH_X_SITE in CFLAGS, include LD_SWITCH_X_SITE in LIBX, and pass C_SWITCH_X_SITE to the make which builds the X Menu library. 1993-03-22 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry. (Fx_color_defined_p): Renamed from Fx_defined_color. (syms_of_xfns): Adjusted. 1993-03-22 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * indent.c (current_column, Findent_to, position_indentation): (Fmove_to_column, compute_motion): Allow tab_width up to 1000. * xdisp.c (display_string, display_text_line): Allow tab_width up to 1000. * keyboard.c (Fsuspend_emacs): Change suspend-hooks back to suspend-hook and make it a normal hook. * s/dgux.h: Decide automatically whether to use COFF or ELF. 1993-03-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fns.c (Fy_or_n_p): Handle `recenter' response type. * s/dgux.h (HAVE_TERMIO, SIGNALS_VIA_CHARACTERS): Defined. 1993-03-21 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * frame.c (Fhandle_switch_frame): Renamed from Fselect_frame. Doc changed in anticipation of new purpose. (Fselect_frame): Just call Fhandle_switch_frame for now. 1993-03-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xdisp.c (decode_mode_spec): Handle `%l'. (display_count_lines): New function. (redisplay_window): Update base_line_number and base_line_pos fields. Always update mode line if it's an integer. * window.h (struct window): New fields base_line_number and base_line_pos. * window.c (Fselect_window): Use Fhandle_switch_frame. (Fset_window_configuration): Likewise. 1993-03-20 Jim Blandy (jimb@geech.gnu.ai.mit.edu) Use the `visiblity' parameter to determine the initial state of the frame, instead of the `iconic-startup' and `suppress-initial-map' parameters. * xfns.c (x_icon): Test the Qvisibility parameter against Qicon, instead of the Qiconic_startup against Qt. (x_create_frame): Test Qvisibility against Qnil and Qicon, instead of testing Qsuppress_initial_map and Qvisibility. (Qicon): New symbol. (Qiconic_startup, Qsuppress_initial_map): Removed. (syms_of_xfns): Adjusted appropriately. * xfns.c (x_set_visibility): Instead of interpreting only Qt as `make the frame visible' and everything else as `iconify the frame', interpret Qicon as `iconify the frame' and everything else as `make the frame visible.' * xfns.c (x_get_arg): When the type of the resource is `symbol', return `true' and `on' as Qt, and `false' and `off' as Qnil. 1993-03-20 Richard Stallman (rms@mole.gnu.ai.mit.edu) * emacs.c (init_cmdargs): Fix simple bug in previous change. 1993-03-20 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * dispnew.c (Fsleep_for): Make this take two arguments SECONDS and MILLISECONDS, which add, rather than a second argument which says "treat the first argument as milliseconds." (Fsit_for): Same thing. (Fsleep_for_milliseconds): Deleted; this can be done with Fsleep_for. * process.c (wait_reading_process_input): Doc fix. * systime.h (EMACS_HAS_USECS): #define this if HAVE_TIMEVAL is #defined. * dispnew.c (sit_for): Doc fix. * sysdep.c (reset_sys_modes): Fix usage of EMACS_SET_TTY. * callproc.c (child_setup): Make sure that in, out, and err are not less than three. (relocate_fd): New function. * xterm.c (x_term_init): If the X connection is already in file descriptor zero, don't dup it and close the old one. * s/hpux8.h, s/sunos4-1.h (OLDXMENU_OPTIONS): Define this, as in Emacs 18. * xfns.c (Fx_open_connection): If we have X11R5, use XrmSetDatabase to set the display's database. In older versions, just store the value into x_current_display->db. * xterm.h (HAVE_X11R5): Define this where appropriate. * frame.c (Fraise_frame, Flower_frame): Renamed from Fframe_to_front and Fframe_to_back. (syms_of_frame): Adjusted appropriately. * fileio.c (HAVE_FSYNC): Define, if appropriate. (Fwrite_region): Use HAVE_FSYNC. * s-aix3-2.h (HAVE_FSYNC): Define. * emacs.c (Finvocation_name): New function. . 1993-03-20 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * xfns.c (Fx_display_color_p): Renamed from Fx_color_display_p. (syms_of_xfns): Use new name in defsubr. 1993-03-19 Eric S. Raymond (eric@geech.gnu.ai.mit.edu) * Makefile.in (unlock, relock): New productions to assist with version control. 1993-03-19 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * fileio.c (Fvisited_file_modtime): New function. (Fset_visited_file_modtime): Accept an argument specifying time value. If arg is nil, really use the filename handler. * xselect.c (cons_to_long, long_to_cons): No longer static. 1993-03-18 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * frame.h (FOR_EACH_FRAME): Change the definition so that FRAME_VAR is a lisp object. * dispnew.c (WINDOW_CHANGE_SIGNAL, do_pending_window_change): Adjusted appropriately. * xdisp.c (redisplay): Adjusted appropriately. * dispnew.c (Fredraw_frame): Give this appropriate definitions for MULTI_FRAME and non-MULTI_FRAME configurations. (Fredraw_display): Give this a non-MULTI_FRAME-dependent definition. 1993-03-18 Richard Stallman (rms@geech.gnu.ai.mit.edu) * lisp.h (CHECK_LIVE_WINDOW): Use Qlive_window_p. * xfns.c (x_screen): Make this var file scope. (Fx_server_version): Use Fcons, not list3. 1993-03-17 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * xterm.c (term_get_fkeys): Less klugey version of the last fix. * Makefile.in (versionclean): New production nukes binaries and DOC files, forcing a re-load, re-dump and re-makedoc. 1993-03-17 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c: Doc fix. 1993-03-17 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xterm.c (x_display_box_cursor, x_display_bar_cursor): Don't display the cursor on garbaged frames. 1993-03-17 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * term.c (term_get_fkeys) Supply second args for all tgetstr calls. 1993-03-17 Richard Stallman (rms@mole.gnu.ai.mit.edu) * process.c (Fprocess_send_eof): Make sure proc is running. * s/irix4-0.h (_getpty): Declare this, not _get_pty. 1993-03-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfns.c (Fx_server_vendor, Fx_server_version, Fx_display_pixel_width) (Fx_display_pixel_height, Fx_display_mm_width, Fx_display_mm_height) (Fx_display_screens, Fx_display_planes, Fx_display_color_cells) (Fx_display_visual_class, Fx_display_backing_store) (Fx_display_save_under): New functions. (x_screen_count, Vx_vendor, x_release, x_screen_height_mm) (x_screen_width_mm, Vx_backing_store, x_save_under, Vx_screen_visual) (x_visual_strings): Vars deleted. (Fx_open_connection): Don't init those vars. (syms_of_xfns): Set up new functions. Don't set up those vars as Lisp vars. Nor x-screen-width and x-screen-height. 1993-03-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * cmds.c (overwrite_binary_mode): Deleted; this implements the. Rename `live-window-p' to `window-live-p', for consistency with `frame-live-p'. * window.c (Fwindow_live_p): Renamed from Flive_window_p. * lisp.h (CHECK_LIVE_WINDOW): Change to use Qwindow_live_p. (Qwindow_live_p): Extern declaration renamed fom Qlive_window_p. 1993-03-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xmenu.c (xmenu_show): Do BLOCK_INPUT; unblock just before returning. * xterm.h [SIGIO] (UNBLOCK_INPUT): Resignal if x_pending_input. 1993-03-15 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * frame.c (Fframe_height, Fframe_width): Fix doc strings to match those of the multi-frame versions in frame.el. Accept an optional argument FRAME, also for consistency. * floatfns.c (logb): Add extern declaration for this. * floatfns.c (Flogb): Under SYSV, implement this using frexp. 1993-03-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (dispnew.o): Depend on termhooks.h. * xmenu.c (list_of_items): Allow strings among the alist items; they make nonselectable lines. 1993-03-14 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * dired.c (Fdirectory_files): Recompile MATCH (if specified) after expanding the file name and all; those might compile regexp of their own, and change searchbuf. * keyboard.h (internal_last_event_frame): This should be extern, dummy. * fns.c (Fy_or_n_p): Display the answer. Some VMS changes from Richard Levitte <levitte@e.kth.se>: * [VMS] systime.h: Include vmstime.h. VMS has the timezone variable and the tzname array. * s/vms.h: VMS does have select. mth$dmod is the same as Unix's drem. Use the time functions in vmstime.c. No need to rename the malloc routines if we're using GNU malloc. PURESIZE needs to be 330000. * vmstime.c, vmstime.h: New files. * systty.h: Don't try to initialize extern declarations under VAX C. * vmspaths.h (PATH_LOADSEARCH): Include EMACS_LIBRARY:[LOCAL-LISP] in PATH_LOADSEARCH. (PATH_EXEC): Use EMACS_LIBRARY:[LIB-SRC] instead of [ETC]. * sysdep.c [VMS] (init_sys_modes): Don't allocate process_ef. [VMS] (queue_kbd_input): Build events structure correctly. [VMS] (gethostname): New function. [VMS] (getwd): Don't get the PATH environment variable; that's dumb. Call getcwd. 1993-03-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xdisp.c (display_menu_bar): Assume FRAME_MENU_BAR_ITEMS already set. Fill out line with spaces. Put explicit spaces between items. * keyboard.c (command_loop_1): Set FRAME_MENU_BAR_ITEMS here. * window.c (Fdelete_other_windows): Handle FRAME_MENU_BAR_LINES. * keyboard.c (menu_bar_items): Reverse the list when done. * xmenu.c (single_keymap_panes): When storing in ENABLES, check def before enabled. * ymakefile (really-oldXMenu): Renamed from ${oldXMenudir}$(OLDXMENU). Add @true. ($(OLDXMENU)): Depend on really-oldXMenu. The idea is to make sure libXMenu11.a is always updated if nec. * keyboard.c (command_loop_1): Typo calling Qrecompute_lucid_menubar. (read_key_sequence): Likewise. Also fix call to Vrun_hooks. 1993-03-13 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * ymakefile (YMF_PASS_LDFLAGS): Doc fix. 1993-03-13 Richard Stallman (rms@mole.gnu.ai.mit.edu) * print.c (PRINTPREPARE): Handle marker that points nowhere. * apollo.h (NO_X_DESTROY_DATABASE): Defined. * undo.c (record_property_change, record_delete, record_insert): Don't make boundary or touch last_undo_buffer if cur buf has no undo. * ymakefile [__GNUC__ > 1]: Delete the conditional for GCC 2.4. [__GNUC__ > 1] (LIB_GCC): Use -print-libgcc-file-name to find libgcc.a. (YMF_FIND_LIBGCC_A): Definitions and uses deleted. 1993-03-13 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * s/usg5-4.h: Remove extraneous text after #undef LIB_X11_LIB. 1993-03-13 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xterm.c (Xatom_wm_change_state): Define here. * xfns.c (Xatom_wm_change_state): Just declare. . * dispnew.c: Include termhooks.h. * frame.h (FRAMEP): Macro deleted. * xselect.c: Total rewrite, derived from Lucid's version. * keyboard.c (kbd_buffer_get_event): Handle selection_clear_event and selection_request_event events. * xterm.c (XTread_socket): Handle NEW_SELECTIONS alternative: queue events for SelectionRequest and SelectionClear; call functions for SelectionNotify and PropertyNotify. * termhooks.h (selection_request_event, selection_clear_event): New event kinds. * xterm.h (SELECTION_EVENT_DISPLAY): New macro. (SELECTION_EVENT_REQUESTOR, SELECTION_EVENT_SELECTION) (SELECTION_EVENT_TARGET, SELECTION_EVENT_PROPERTY) (SELECTION_EVENT_TIME): New macros. (struct selection_input_event): New structure. * process.c (wait_reading_process_input): New option to wait till a given cons cell has a non-nil car. Delete vipc conditionals. 1993-03-12 Jim Blandy (jimb@totoro.cs.oberlin.edu) * ymakefile (YMF_FIND_LIBGCC_A): New macro, to help GCC find libgcc.a even when -nostdlib is in effect. Define it to be the empty string if nobody else establishes a value for it. (temacs): Include it in the list of flags passed to the linker. * ymakefile (LINKER): If we have GCC 2.4 or later, use the -nostartfiles option instead of -nostdlib. (LIBGCC): Under GCC 2.4 or later, define this to be the empty string. 1993-03-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xmenu.c (xmenu_show): New arg enable_list. . * lisp.h (INTEGERP, SYMBOLP, MARKERP, STRINGP, VECTORP): New macros. (COMPILEDP, BUFFERP, SUBRP, PROCESSP, FRAMEP, WINDOWP): New macros. (WINDOW_CONFIGURATIONP, FLOATP): New macros. 1993-03-12 Paul Eggert (eggert@twinsun.com) * cmd.c (internal_self_insert): Check that tab_width does not exceed 20, to be consistent with indent.c and xdisp.c. 1993-03-12 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * term.c (CONDITIONAL_REASSIGN): Fixed reference to tigetstr. This should have been tgetstr, but I typoed and tigetstr happens to link and even do the right thing if you're on a System V box. 1993-03-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c . * xmenu.c (Fx_popup_menu): Allow a frame instead of a window, in arg. Use Fcar, Fcdr when extracting from event, to check data types. 1993-03-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * frame.h (FRAME_MENU_BAR_ITEMS): New macro (two versions). (struct frame): New field menu_bar_items. * alloc.c (mark_object): Mark the menu_bar_items field. * xdisp.c (display_menu_bar): New function. (redisplay_window): Call display_menu_bar. * term.c (tigetstr): Add dummy definition to make Emacs link again. * keyboard.c (syms_of_keyboard): Set up Qmenu_bar. (menu_bar_items): New function. (menu_bar_one_keymap, menu_bar_item): New functions. (make_lispy_event): Handle menu bar events. (read_key_sequence): Make dummy prefix `menu-bar' for menu bar events. 1993-03-11 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) * term.c (fkey_table): Added many more keycap cookies to the fkey_table; it now supports the full intersection of the set of X keysyms and terminfo capabilities. See my lisp directory ChangeLog entry for this date, and lisp/term/README, for details. 1993-03-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * floatfns.c (Flogb): Fix use of IN_FLOAT. Fix arg names. Don't confuse Lisp_Object with integer. 1993-03-11 Jim Blandy (jimb@totoro.cs.oberlin.edu) * process.c (process_send_signal): In the TERMIOS code for sending control characters to processes, don't try to return Qnil; just return. 1993-03-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * dispnew.c (change_frame_size): Handle FRAME_MENU_BAR_LINES. * frame.c (Fframe_parameters): Report menu-bar-lines parm. (syms_of_frame): Set up Qmenu_bar_lines. * frame.h (FRAME_MENU_BAR_LINES): New macro. (struct frame): New field menu_bar_lines. * xfns.c (x_frame_parms): Add elts for visibility and menu-bar-lines. (enum x_frame_parm): Likewise. (x_set_menu_bar_lines, x_set_menu_bar_lines_1): New functions. (x_set_visibility): New function. (Fx_create_frame): Handle menu-bar-lines parm. (x_report_frame_params): Report Qvisibility. (syms_of_xfns): Set up Qvisibility. * keyboard.c (command_loop_1): Typo in last change. * xmenu.c (syms_of_xmenu): Set up Qmenu_enable. (single_keymap_panes): Test menu-enable property of symbol to decide whether to include it in the menu. 1993-03-10 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (command_loop_1): Adjust to the fact that display tables are now vectors of vectors, not vectors of strings. 1993-03-10 Jim Blandy (jimb@totoro.cs.oberlin.edu) * floatfns.c (Flogb): Undo the change of Feb 22. * ymakefile (OLDXMENU): Don't assume that we have symbolic links available; use `ln -f' instead of `ln -s'. * xterm.c (x_find_modifier_meanings): XDisplayKeycodes only appeared in X11R4; for earlier versions, just access the members of the Display directly. * xrdb.c (get_user_db): Since xrdb.c doesn't #include xterm.h, we can't test HAVE_X11R4 to see how we should get the resource manager string; cheat. * unexec.c (copy_text_and_data): Error message tweaked. * systime.h (timezone): Add an explicit declaration for this variable under USG 5-4. * sysdep.c (read_input_waiting): Set e.frame_or_window, not e.frame; the latter doesn't exist anymore. * sysdep.c (start_of_data): If ORDINARY_LINK is #defined, we don't have the data_start symbol defined, so we'll just use the address of environ. * s/usg5-4.h: Changes from Eric Raymond: If we're doing ordinary linking, define LIB_STANDARD appropriately. Give LIBS_DEBUG a null definition; usg5-4 has no -lg. #define LIBS_STANDARD as "-lc"; usg5-4 has no -lPW. #define NSIG, if it's not already defined. #define HAVE_TERMIOS instead of HAVE_TCATTR. Provide our own definition of LIB_X11_LIB. * s/usg5-3.h (LIBX11_SYSTEM): Eric Raymond says the libraries here were slightly wrong. * m/intel386.h (LIB_STANDARD): If USG5_4 is #defined, there's no need to include `-lPW'; that has been merged with `-lc'. * emacs.c (__do_global_ctors, __do_global_ctors_aux) (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__, __main): Don't define these if ORDINARY_LINK is #defined; in that case, the standard linking procedure will find definitions for these. * syssignal.h (sigunblock): Add definition which works under SYSVr4. * emacs.c (fatal_error_signal): Unblock the signal which we're handling using sigunblock. 1993-03-09 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xfns.c (x_make_gc): Don't forget to block X input around the X calls in this function. * xfns.c [not HAVE_X11R4] (select_visual): It's v->visualid, not x->visualid. x isn't defined. * m/template.h, s/template.h: Mention that `etc/MACHINES' and `configure' should be updated whenever support for a configuration is added or improved. * process.c [! subprocesses] (wait_reading_process_input): Remember to re-enable polling for input. * keyboard.c [POLL_FOR_INPUT] (quit_throw_to_read_char): If we're polling for input, abort; input polling should always be suppressed while we're waiting for input. * keyboard.c (interrupt_signal): Remove extern declaration of Vwindow_system; this is no longer used. 1993-03-09 Richard Stallman (rms@mole.gnu.ai.mit.edu) * editfns.c (Fcurrent_time_string): Optional arg specifies time. * keymap.c (Fdefine_key): Use proper meta-bit to clear. * intervals.c (set_point): Check invisibility of following character, not previous character. * floatfns.c (FLOAT_CHECK_ERRNO): Define unless NO_FLOAT_CHECK_ERRNO. * floatfns.c:. * fns.c (Fy_or_n_p): Use query-replace-map. * keymap.c (access_keymap): Handle ints beyond the ASCII range. (store_in_keymap): Likewise. (Faccessible_keymaps): Use meta_modifier. Use vectors for the key sequences. (Fwhere_is_internal): Use meta_modifier. (append_key): Always return a vector. * lisp.h (Qrange_error, Qdomain_error, Qsingularity_error): (Qoverflow_error, Qunderflow_error): New vars. * data.c (syms_of_data) [LISP_FLOAT_TYPE]: Define new error conditions: Qarith_error, Qrange_error, Qdomain_error, Qsingularity_error, Qoverflow_error, Qunderflow_error. 1993-03-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * systty.h: Define HAVE_TCATTR based on HAVE_TERMIOS earlier. (struct emacs_tty): Separate the struct decl from the EMACS_..._TTY... macro definitions. Use HAVE_TCATTR to decide whether to use `struct termios'. * xfns.c (Fx_pixel_width, Fx_pixel_height): Fns deleted. (syms_of_xfns): Don't install them. (x_user_set_name): Function deleted. (x_char_height, x_char_width): New functions. * frame.c (Fframe_char_height, Fframe_char_width): (Fframe_pixel_height, Fframe_pixel_width): New functions, two versions of each. [MULTI_FRAME] (syms_of_frame): Make them Lisp functions. [!MULTI_FRAME] (syms_of_frame): Likewise. Also Fselected_frame. * xterm.c (XTread_socket): Don't reverse the chars that XLookupString returns. Use all of them. Save last 100 chars and keysyms in temp_buffer. 1993-03-07 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * buffer.c (syms_of_buffer): Make erase-buffer a disabled command. 1993-03-07 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (keyboard.o): Depend on intervals.h. (keymap.o): Depend on termhooks.h. * keyboard.c: Include intervals.h. (read_key_sequence): Use get_local_map. * textprop.c (Fget_text_property): Use textget. (Fnext_single_property_change): Likewise. (Fprevious_single_property_change): Likewise. * intervals.c (textget): Handle categories. (get_local_map): New function. (verify_interval_modification): Call textget correctly. * textprop.c (syms_of_textprop): Set up Qcategory, Qlocal_map. * intervals.h: Declare those vars. Declare textget, get_local_map. * keymap.c: Include termhooks.h. (push_key_description): Handle all modifiers. Handle large character codes. (Fkey_description): Move the meta bit, if arg is string. (Fsingle_key_description): Don't alter integer value. Make tem long enough. * keyboard.c (read_key_sequence): Use meta_modifier for meta keys when handling function_key_map. * lread.c (syms_of_lread): Set up Qascii_character. (Fread_char, Fread_char_exclusive): Use that property to convert symbols like tab, return, M-return,... to ASCII. * keyboard.c (follow_key): Downcase shift_modifier as well as ASCII. (command_loop_1): Run pre-command-hook and post-command-hook. Set this_command before running pre-command-hook. (syms_of_keyboard): Set up vars for those hooks. * buffer.c (reset_buffer_local_variables): Reset mark_active. (syms_of_buffer): New buffer-local var `mark-active'. (init_buffer_once): Initialize mechanism for it. 1993-03-06 Jim Blandy (jimb@totoro.cs.oberlin.edu) * dispnew.c (init_display): Initialize Vwindow_system. * ymakefile (SHELL): No need to set this twice; remove one. * emacs.c (main): SIGIOT isn't defined on all systems; don't set its signal handler unless it is. * sysdep.c (init_baud_rate): Use input_fd, instead of fd; the latter is undefined. * dired.c (NAMLEN): Never use d_nameln to get the length of the directory entry's name; it is used inconsistently. Always call strlen instead. 1993-03-06 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (syms_of_keyboard): Handle gaps in modifier_names. (modifier_names): Reorder to match termhooks.h. * keyboard.c (parse_modifiers_uncached): Detect `s-', not `super-'. (apply_modifiers_uncached): Make `s-', not `super-'. * lread.c: Include termhooks.h. (read_escape): Handle \H, \A, \s. Use ..._modifier. * ymakefile (lread.o): Depend on termhooks.h. * termhooks.h (alt_modifier, super_modifier, hyper_modifier): (shift_modifier, ctrl_modifier, meta_modifier): Renumber the bits. * keyboard.c (make_lispy_event): For ASCII event, the ..._modifier bits are the right bits to return. * keyboard.c (lispy_function_keys): Add codes starting at 0xff00 and running through 0xffff. * xterm.c (x_alt_mod_mask, x_super_mod_mask, x_hyper_mod_mask): New variables. (x_find_modifier_meanings): Set them. (x_convert_modifiers): Check for them. (XTread_socket): Handle BackSpace, etc, function keys. * keyboard.c (read_char): Move metabit when fetching from string macro. * callint.c (check_mark): Error if mark is not active. * editfns.c (save_excursion_save): Save mark_active of buffer. (save_excursion_restore): Restore mark_active of buffer. Run activate-mark-hook if it's on, or deactivate-mark-hook if it turns off. (region_limit): Error if mark inactive, if transient-mark-mode. * insdel.c (prepare_to_modify_buffer): Set Vdeactivate_mark. * keyboard.c (command_loop_1): Clear Vdeactivate_mark before cmd. Clear mark_active if command set Vdeactivate_mark. Run deactivate-mark-hook at that time, or activate-mark-hook. (syms_of_keyboard): Define variable deactivate-mark. * buffer.c (syms_of_buffer): New buffer-local var `mark-active'. (init_buffer_once): Initialize mechanism for it. * buffer.h (struct buffer): New field mark_active. * intervals.c (verify_interval_modification): Handle insertions specially. For non-insertions, check only the chars being changed. `modification-hooks' property is now a list of functions. (set_point): Ignore chars outside current restriction. * textprop.c (Qmodification_hooks): Renamed from Qmodification. (syms_of_textprop): Changed accordingly. * keyboard.c (syms_of_keyboard): New lisp var unread-command-char. (Finput_pending_p): Test unread_command_char. (Fdiscard_input, quit_throw_to_read_char, init_keyboard): Set it. (read_char): Fetch from it. 1993-03-05 Jim Blandy (jimb@totoro.cs.oberlin.edu) * textprop.c (Fadd_text_properties): Initialize the modified flag. Use a "for (;;)" loop at the end of the function, to indicate that all exiting is taken care of inside the loop. (Fremove_text_properties): Same. 1993-03-05 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (LIB_MATH): Delete -lc, since duplicates LIB_STANDARD. * buffer.c (check_protected_fields): Variable deleted. (syms_of_buffer): Delete vars buffer-field-list and check-protected-fields. * insdel.c (check_protected_fields): Delete decl. * disptab.h (DISP_INVIS_VECTOR): Renamed from DISP_INVIS_ROPE. (DISP_CHAR_VECTOR): Renamed from DISP_CHAR_ROPE. All callers changed. * xdisp.c (copy_rope): Expect FROM to be a vector. (copy_part_of_rope): New function. (display_string): Expect display table elts to be vectors. * indent.c (current_column, Fmove_to_column, compute_motion): Expect display table elts to be vectors. * alloc.c (Fmake_rope, Frope_elt): Fns deleted. * lisp.h (CHAR_META, CHAR_SHIFT, CHAR_CTL): New macros. * lread.c (read_escape): Handle M-, C- and S- for new convention. (read1): Move the meta bit to the right place for a string. * keyboard.c (Fthis_command_keys, Fread_key_sequence): Fix calls to make_event_array. * macros.c (Fend_kbd_macro): Fix call to make_event_array. * alloc.c (make_event_array): Renamed from make_array. Chars that fit in a string are 0...127 and their meta variants. * keyboard.c (make_lispy_event): Put meta and shift modifiers into an integer. (read_avail_input): Set the modifiers field in the events read. (kbd_buffer_get_event): Pass thru integer event untruncated. (read_char): Likewise. (read_key_sequence, read_char): Only -1 means EOF. (kbd_buffer_store_event): Don't ignore 0200 bit in quit char. (follow_key): Use new meta bit flag. * xterm.c (XTread_socket): Set bufp->modifiers for all kinds of keys. * keymap.c (Flookup_key): Use 0x800000 as meta-bit if from vector. (Fdefine_key): Likewise. 1993-03-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * dgux.h (ELF): Handle this parameter. [! COFF] (UNEXEC, USG_SHARED_LIBRARIES): New definitions. (_BSD_TTY_FLAVOR): Don't define if already defined. (C_COMPILER, LINKER, MAKE_COMMAND): New definitions. 1993-03-04 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c (Fsuspend_emacs): Remember that `suspend-hooks' isn't necessarily bound. 1993-03-04 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * Makefile.in (xmakefile): Add missing quote. 1992-03-03 Wilson H. Tien (wtien@urbana.mcd.mot.com) * unexelf.c (unexec): Move data2 section header up so all section headers will be in ascending order. This will prevent the unexeced emacs that being processed by other applications (such as strip) to fail. 1993-03-02 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/isc2-2.h (S_IFLNK): Add #undef. (C_SWITCH_SYSTEM): Add conditional definition. (NO_ASM, USE_UTIME, NO_X_DESTROY_DATABASE): Defined. (LIB_STANDARD): Alternate definition if __GNUC__. (SIGTSTP): #undef deleted. (LIBS_SYSTEM): Define only if HAVE_X_WINDOWS. * s/isc3-0.h: New file. * unexelf.c: Handle rounding of section boundaries. (round_up): New function. 1993-03-02 Karl Berry (karl@cs.umb.edu) * s/isc2-2.h (USG_SHARED_LIBRARIES, CLASH_DETECTION, NO_FCHMOD): Define. (HAVE_TIMEVAL): Do not define. (NO_ASM): Only define once. 1993-03-02 Jim Blandy (jimb@totoro.cs.oberlin.edu) * print.c (float_to_string): Define buf to be an unsigned char, to match the data field of strings. * keyboard.c (kbd_buffer_get_event): Protect assignment to Vlast_event_frame in a "#ifdef MULTI_FRAME" clause. * syntax.c (describe_syntax_1): Delete excess arg to describe_vector. (check_syntax_table): Delete excess arg to wrong_type_argument. 1993-03-01 Jim Blandy (jimb@totoro.cs.oberlin.edu) * buffer.c (buffer-undo-list): Doc fix. * xdisp.c (redisplay): Protect calls to request_sigio and unrequest_sigio in "#ifdef SIGIO" clauses; these are not defined * cmds.c (Fnewline): Doc fix. 1993-03-01 Richard Stallman (rms@mole.gnu.ai.mit.edu) * insdel.c (del_range): Update point before offset_intervals. * intervals.h: Don't include dispextern.h more than once. (INTERVAL_VISIBLE_P): NILP test was backwards. * intervals.c (intervals_equal): Handle one arg null and other not. (set_point): Considerable rewrite. Handle intervals both before and after the old and new point values. Redo handling of invisible intervals, and of motion hooks. (textget): New function. * textprop.c (Fadd_text_properties, Fremove_text_properties): Add len>0 as condition for main loop. Abort if reach a null interval. (Fset_text_properties): Abort if reach a null interval. (Ftext_properties_at, Fget_text_property): Return nil if POS is end of OBJECT. (add_properties): Use NILP to test result of Fequal. No longer inline. (remove_properties): No longer inline. (set_properties): Total rewrite as function. (validate_interval_range): Don't alter *begin at end of buffer. But do search for a position just before the end. Return null for an empty string. 1993-02-28 Richard Stallman (rms@mole.gnu.ai.mit.edu) * Makefile.in (emacs, temacs): Add @true to prevent Make confusion. * lread.c (read1--strings with properties case): Detect end of list, and invalid syntax, using recursive read1 calls. * intervals.c (graft_intervals_into_buffer): create_root_interval needs Lisp object arg. Set tree to new root interval. Don't test TREE_LENGTH if buffer has no intervals. Rearrange code to copy properties so that it really does merge the inserted ones into the inherited ones. (traverse_intervals): Pass `arg' on recursive calls. (split_interval_left): Use new_length as basis for length of new. * print.c (print--string case): Any non-null interval means print intervals. Get rid of var obj1; just use obj. * textprop.c (validate_interval_range): Allow 0 as position in string. Add 1 to specified string positions. (Fprevious_single_property_change): Subtract 1 if object is string. (Fnext_single_property_change): Likewise. (Fprevious_property_change, Fnext_property_change): Likewise. * xterm.c (x_do_pending_expose, XTframe_rehighlight): (x_window_to_scrollbar): Use XGCTYPE. 1993-02-28 Jim Blandy (jimb@totoro.cs.oberlin.edu) Use the term `scroll bar', instead of `scrollbar'. * alloc.c, frame.c, frame.h, indent.c, keyboard.c, keyboard.h, * lisp.h, term.c, termhooks.h, window.c, window.h, xdisp.c, xfns.c, * xterm.c, xterm.h: Terminology changed. Don't generate switch-frame events by checking Vlast_event_frame; use a separate variable for that bookkeeping. In order to generate them properly, we may need to fiddle with it. * keyboard.c (internal_last_event_frame): New variable. (command_loop_1): Check internal_last_event_frame, not Vlast_event_frame. (read_char, kbd_buffer_store_event): Set both Vlast_event_frame and internal_last_event_frame. (kbd_buffer_get_event): Check internal_last_event_frame to decide whether to generate a switch-frame event. Set Vlast_event_frame after each event. (init_keyboard): Initialize both Vlast_event_frame and internal_last_event_frame. * keyboard.h (internal_last_event_frame): Add extern declaration for this. * frame.c (Vlast_event_frame): Remove external declaration for this. (Fselect_frame): Set internal_last_event_frame to Qnil to force a switch-frame event, not Vlast_event_frame; the latter is supposed to convey information to the user. * keyboard.c (syms_of_keyboard): Doc fix for unread_command_events. 1993-02-26 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (syms_of_keyboard): Doc fix. 1993-02-26 Jim Blandy (jimb@totoro.cs.oberlin.edu) * ymakefile (LIBES): Exchange the order of LIB_MATH and LIB_STANDARD, to avoid duplicated symbols under SunOS. * buffer.c (syms_of_buffer): Add the extra argument to the commented-out DEFVAR_PER_BUFFER for `mode-line-format', so make-docfile will find the docstring properly. 1993-02-25 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (intervals.o): Dep on intervals.c, not textprop.c. * textprop.c (remove_properties): Call modify_buffer. (add_properties): Likewise. * undo.c (record_property_change): Typo in last change. * cmds.c (syms_of_cmds): Typo in last change. * print.c (print): Never declare OBJ arg as `register'. Special handling for strings with intervals. (print_intervals): New function. * lread.c (read1): Handle reading strings with properties. * intervals.c (traverse_intervals): New arg ARG. * alloc.c (mark_interval): Add ignored arg. (mark_interval_tree): Pass new arg to traverse_intervals. 1993-02-24 Jim Blandy (jimb@totoro.cs.oberlin.edu) *. * print.c (float_to_string): Define buf to be an unsigned char, to match the data field of strings. * lisp.h (RETURN_UNGCPRO): Remove "do ... while (0)" wrapper around macro. * data.c (Fstring_to_number): Declare p to be an unsigned char, to match the data field of strings. * data.c (Fstring_to_number): Just skip tabs and spaces; don't use the <ctype.h> macros. The <ctype.h> stuff apparently varies from locale to locale more than we'd like. Don't include <ctype.h>. 1993-02-24 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * buffer.c (Ferase_buffer): Added interactive spec. 1993-02-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * undo.c (Fprimitive_undo): Handle property-change undo entry. (record_property_change): New function. * textprop.c (Fadd_text_properties): Pass new arg to add_properties. (Fremove_text_properties): Likewise. (add_properties, remove_properties): New arg OBJECT. Record undo info. (Fput_text_property): New function. * buffer.c (syms_of_buffer): Doc fix. * cmds.c (syms_of_cmds): New var `overwrite-binary-mode'. (internal_self_insert): Handle that var. 1993-02-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (read_avail_input): Args to `kill' were backwards. 1993-02-23 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * alloc.c (make_pure_float): Assure that PUREBEG + pureptr is aligned, not pureptr itself. * emacs.c (fatal_error_signal): Unblock the signal before we try to deliver it to ourselves. #include "syssignal.h" to get the right definitions. * abbrev.c (Fexpand_abbrev): Only copy the text we're going to expand - from wordstart to wordend, not from wordstart to point - into the buffer. There might be non-word text between wordend and point. 1993-02-23 Richard Stallman (rms@geech.gnu.ai.mit.edu) * unexec.c (adjust_lnnoptrs): Handle symentry.n_type == 0x2400. (make_hdr) [USG_SHARED_LIBRARIES]: Set bias using bss_start. 1993-02-22 Jim Blandy (jimb@totoro.cs.oberlin.edu) * process.c: Make sure we don't miss processes exiting, by having the sigchld handler clear *input_available_clear_time. (wait_reading_process_input): Check for process activity after setting the timeout and calling set_waiting_for_input. (sigchld_handler): If the process which has exited is one we care about, clear *input_available_clear_time. * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after switching frames, to make sure we'll get a switch-frame event. (Vlast_event_frame): Add external declaration for this here. * alloc.c (make_pure_float): Align pureptr according to __alignof, if it's available, or sizeof (struct Lisp_Float) if it's not. * .gdbinit (xprocess): New command. * floatfns.c (Flogb): Always implement this by calling Flog, even on non-USG systems, which supposedly have a logb function. (Fround): Always implement this by calling floor, even on systems that have rint. * process.c (process_send_signal): Use TERMIOS functions in preference to BSD ioctls. Some systems attempt to provide the BSD functions for backward compatibility, and get it wrong. * data. 1993-02-22 Charles Hannum (mycroft@hal.gnu.ai.mit.edu) * ibmrs6000.h (C_ALLOCA, STACK_DIRECTION): Only define if HAVE_ALLOCA is not defined. (X_DEFAULT_FONT): Change to `fixed', as `Rom14.500' only works on the console. * aix3-1.h: Changes from 18.58. (HAVE_TERMIOS): Changed from HAVE_TERMIO. (unix): Define. * sysdep.c (child_setup_tty): Recognize HAVE_TERMIOS as well as HAVE_TERMIO. * xrdb.c (getuid): Remove declaration. * systty.h [HAVE_TERMIOS]: Include fcntl.h. * systime.h [_AIX]: Move test outside of previous #if. (EMACS_GET_TZ_OFFSET) [USG]: Don't declare twice. Prefer tzset. * keyboard.c (init_keyboard): Recognize HAVE_TERMIOS as well as HAVE_TERMIO. * aix3-2.h: New file. Specifies difference between AIX 3.1 and 3.2. 1993-02-20 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) * keyboard.c (Fsuspend_emacs): Make tem not register. * syntax.c (Fforward_comment): New function. * search.c (Fskip_syntax_backward): New function. (Fskip_syntax_forward): Likewise. (skip_chars): New argument syntaxp. * alloc.c (Fmemory_limit): Doc fix. 1993-02-19 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (Fsuspend_emacs): Rename suspend-hook to suspend-hooks and run it manually. * keymap.c (describe_map): Call Fkey_description before build_string. 1993-02-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (Fopen_dribble_file): Doc fix. * lread.c (syms_of_lread): Doc fix. 1993-02-18 Jim Blandy (jimb@totoro.cs.oberlin.edu) * textprop.c (Fget_text_property): Fix typo in function's declaration. * floatfns.c (IN_FLOAT): Make this work properly when SIGTYPE is void. *. * config.h.in: #define USE_TEXT_PROPERTIES by default. * alloc.c (mark_object, mark_buffer): Remove some unused variables. * buffer.c (Fswitch_to_buffer): Pass the correct number of arguments to Fnext_window. * buffer.c (Fbury_buffer): Pass the correct number of arguments to Fother_buffer. * bytecode.c (Fbyte_code): Pass the correct number of arguments to temp_output_buffer_show. * callint.c (Fcall_interactively): Pass the correct number of arguments to wrong_type_argument. * casefiddle.c (caseify_object): Same. * casetab.c (check_case_table): Same. * search.c (Fstore_match_data): Same. * syntax.c (check_syntax_table): Same. * callproc.c (delete_temp_file): Declare this to return Lisp_Object, to smooth type-checking. * data.c (wrong_type_argument): Pass the correct number of arguments to Fstring_to_int. * data.c (arithcompare): Add a default case which aborts, just to make me happy. * dispnew.c (sit_for): Pass the correct number of arguments to gobble_input. * editfns.c (Fmessage): Don't forget to return a value when args[0] == Qnil. * fns.c (Fequal): Call internal_equal to recurse on elements of lists and vectors, not Fequal. * frame.c (Fdelete_frame): If FRAME is a dead frame, return Qnil, not nothing. * keyboard.c (echo_char): Apply XINT to c before passing it to push_key_description. * keyboard.c (recursive_edit_1, command_loop_1): Pass the proper number of arguments to unbind_to. * lread.c (Feval_buffer): Same. * window.c (Fscroll_other_window): Same. * keyboard.c (command_loop_1): Apply XINT to c before passing it to internal_self_insert and direct_output_for_insert. * keyboard.c (make_lispy_movement): Rename the variable `part' declared in the block handling scrollbar movement to `part_sym', to avoid potential conflicts with the argument named `part'. Apparently the semantics of expressions like this are unclear. * keyboard.c (Fread_key_sequence): Backslash the newlines in this docstring. * textprop.c (Fget_text_property): Same. * keymap.c (Fdescribe_vector): Pass the proper number of arguments to describe_vector. * syntax.c (describe_syntax_1): Same. * minibuf.c (Fdisplay_completion_list): Pass the proper number of arguments to Flength. * xmenu.c (list_of_items): Same. * window.c (Fset_window_configuration): Pass the proper number of arguments to Fselect_frame. * xfns.c (x_set_icon_type): Pass the proper number of arguments to x_bitmap_icon. * xterm.c (XTread_socket): Pass the proper number of arguments to construct_mouse_click. * config.h.in (HAVE_CONST): New macro. If it's not #defined, #define const to be the empty string. * config.h.in: If we're not __STDC__, define volatile to be the empty string. * buffer.h: Remove code which #includes "undo.h" if lint is defined. undo.h no longer exists. * buffer.c (buffer_slot_type_mismatch): Make symbol_name an unsigned char *, to match the type of a string's data. 1993-02-17 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) * process.c (Fstart_process): Jimb's change of December 11 had a misplaced paren. This only became apparent because of jimb's change on February 8 to Fexpand_file_name. * callproc.c (Fcall_process): Ditto. 1993-02-17 Jim Blandy (jimb@totoro.cs.oberlin.edu) * callproc.c (init_callproc): Move the initialization of Vprocess_environment to its own function. (set_process_environment): This is that. * emacs.c (main): Call set_process_environment earlier than init_callproc. 1993-02-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) * buffer.c (Frename_buffer): Make prefix arg set UNIQUE. 1993-02-14 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xterm.c (x_set_window_size): Call change_frame_size instead of just setting the `rows' and `cols' members of the frame, and leaving the window tree in complete disarray. * dispnew.c (remake_frame_glyphs): When re-allocating the frame's message buffer when echo_area_glyphs is pointing at it, relocate echo_area_glyphs too. Same for previous_echo_glyphs. * window.h (previous_echo_glyphs): Add extern declaration for this. * frame.c (Fframe_parameters): Report the `minibuffer' parameter of". * xdisp.c (message): Set echo_frame to the frame whose message buf we want to use, not to the message buf itself. 1993-02-13 Richard Stallman (rms@mole.gnu.ai.mit.edu) * textprop.c (Fadd_text_properties): Put OBJECT arg last. Make it optional. (Fset_text_properties, Fremove_text_properties): Likewise. (Fnext_single_property_change, Fprevious_single_property_change): (Fnext_property_change, Fprevious_property_change): Likewise. (Ferase_text_properties): #if 0. (Fget_text_property): New function. * s/irix4-0.h (C_SWITCH_MACHINE): Don't define if GCC. 1993-02-13 Jim Blandy (jimb@totoro.cs.oberlin.edu) * s/usg5-4.h: #include "usg5-3.h", not "s-usg5-3.h". 1993-02-11 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xterm.c (x_io_error_quitter): New function. (x_error_quitter): Note that this is only used for protocol errors now, not I/O errors. (x_term_init): Set the I/O error handler to x_io_error_quitter. 1993-02-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * editfns.c (Finsert_buffer_substring): Proper error for non-ex buffer. (Fcompare_buffer_substrings): Likewise. 1993-02-10 Jim Blandy (jimb@totoro.cs.oberlin.edu) *. 1993-02-10 Richard Stallman (rms@mole.gnu.ai.mit.edu) * editfns.c (Fcompare_buffer_substrings): Ignore case if case-fold-search is non-nil. 1993-02-08 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keymap.c (Flookup_key, Fkey_binding, Flocal_key_binding) (Fglobal_key_binding, Fminor_mode_key_binding): Add a new optional argument ACCEPT_DEFAULT, to control whether this function sees bindings for t. (Fwhere_is_internal, describe_map_tree, describe_map_2) (describe_vector): Pass the proper arguments to Flookup_key. * fileio.c (Fexpand_file_name): Pass DEFALT through Fexpand_file_name before using it. * fileio.c (Fexpand_file_name): Doc fix. 1993-02-07 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xdisp.c (message): Use the message buffer of the frame we're going to display the message on to format the message, not that of the selected frame. 1993-02-07 Richard Stallman (rms@mole.gnu.ai.mit.edu) * Makefile (emacs, temacs): Add no-op commands to these rules. * dispnew.c (char_ins_del_cost): Use FRAME_WIDTH, not FRAME_HEIGHT. * editfns.c (Fcompare_buffer_substrings): New function. 1993-02-06 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (extra_keyboard_modifiers): New Lisp var. (read_char): Support ctl and meta bits in extra_keyboard_modifiers. * xterm.c (XTread_socket): Support extra_keyboard_modifiers. 1993-01-29 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * window.c (Fscroll_left, Fscroll_right): Don't forget to apply XWINDOW to selected_window before passing it to window_internal_width. * xmenu.c (Fx_popup_menu): Don't forget to turn the frame-relative coordinates for the menu position into root-window-relative coordinates. * lread.c (read1): Although digits followed by a '.' are an integer, a single . by itself (like, say, \.) should be a symbol. 1993-01-25 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * fns.c (internal_equal): Protect the clause for comparing numbers of different types with a "#ifdef LISP_FLOAT_TYPE". 1993-01-25 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/hpux8.h [__GNUC__] (LD_SWITCH_SYSTEM): Remove -a. [__GNUC__] (ORDINARY_LINK): Defined. * m/sparc.h [TERMINFO]: Don't define LIBS_TERMCAP. 1993-01-25 Jim Blandy (jimb@totoro.cs.oberlin.edu) `live-frame-p' has become `frame-live-p'. * frame.c (Qlive_frame_p): Renamed to Qframe_live_p. (Flive_frame_p): Renamed to Fframe_live_p. (syms_of_frame): Defsubrs and initializations adjusted. * frame.h (CHECK_LIVE_FRAME): Use Qframe_live_p, not Qlive_frame_p. (Qlive_frame_p): Changed extern declaration to Qframe_live_p. * lread.c (read1): Treat a string of digits ending in a period as an integer. Turn `first-change-function' into `first-change-hook'. * buffer.c (Vfirst_change_function): Renamed to Vfirst_change_hook. (Qfirst_change_hook): New symbol, for passing to Vrun_hooks. (syms_of_buffer): Change DEFVAR; initialize Qfirst_change_hook. * buffer.h (Vfirst_change_function): Renamed to Vfirst_change_hook. (Qfirst_change_hook): Added declaration. * insdel.c (signal_before_change): Change references to Vfirst_change_function, and apply Vrun_hooks to Qfirst_change_hook, instead of just calling Vfirst_change_function directly. x-selection-value has been renamed to x-selection. x-own-selection has been renamed to x-set-selection, and the order of its arguments has been reversed, for consistency with other lisp functions like put and aset. * xselect.c (Fx_own_selection): Rename to Fx_set_selection, reverse the order of the args, and therefore make the type non-optional. Doc fix. (Fx_selection_value): Rename to Fx_selection; make the type argument non-optional, for symmetry with Fx_set_selection. Doc fix. (syms_of_xselect): Adjusted. * xselect.c (Fx_own_selection, Fx_selection_value): Remove "#if 0"'ed code which made cut buffers look like a special selection type. * xfns.c (Vx_selection_value): Removed extern declaration for this; it's never used. * data.c (Fcompiled_function_p): Renamed to Fbyte_code_function_p. (syms_of_data): Adjusted. * data.c (Fnumberp, Fnumber_or_marker_p): Use the NUMBERP macro, instead of writing it out. * fns.c (internal_equal): If the operands are both numbers, compare them numerically, so that (equal 1.0 1) => t. Compare Lisp_Compiled objects like vectors. Add lisp functions to raise and lower frames. * termhooks.h (frame_raise_lower_hook): New hook. * term.c (frame_raise_lower_hook): Define it. * frame.c (Fframe_to_front, Fframe_to_back): New functions. (syms_of_frame): defsubr them. * xterm.c (XTframe_raise_lower): New function. (x_term_init): Set frame_raise_lower_hook to XTframe_raise_lower. * frame.c: Doc fixes. 1993-01-24 Jim Blandy (jimb@totoro.cs.oberlin.edu) Make the cursor style a frame parameter. * xterm.h (struct x_display): Rename the `text_cursor_kind' member to `current_cursor'; add new member `desired_cursor'. (FRAME_DESIRED_CURSOR): New accessor for new member. * xterm.c (x_display_bar_cursor): Rewritten so as not to damage the characters the cursor is displayed over, and to handle transitions between box and bar styles. (x_display_bar_cursor, x_display_box_cursor): Use current_cursor instead of text_cursor_kind. (Vbar_cursor): Delete external declaration. (x_display_cursor): Use the FRAME_DESIRED_CURSOR accessor instead of Vbar_cursor to decide how to draw the cursor. * xfns.c (Vbar_cursor): Remove definition. (Qbar, Qbox, Qcursor_type): New symbols. (syms_of_xfns): Init and staticpro them; remove DEFVAR for Vbar_cursor. (x_set_cursor_type): New setter. (x_frame_parms): Add it to the list. (Fx_create_frame): Get default values for the cursor type. * frame.c (Fmouse_position): Pass the appropriate arguments to *mouse_position_hook; the protocol was changed, but this caller wasn't fixed. * xterm.c (XTclear_frame): Call x_scrollbar_clear. (x_scrollbar_clear): New function. * xterm.c (XTflash): Totally rewritten. Only defined if HAVE_TIMEVAL and HAVE_SELECT are defined, since we use select for our timing. (timeval_subtract): New function, to help XTflash. (x_invert_frame): Removed. This didn't work anyway. (XTring_bell): Remove "#if 0" around call to XTflash, and remove calls to x_invert_frame. If both HAVE_TIMEVAL and HAVE_SELECT aren't defined, then just do the ordinary beep. * window.c (Fscroll_other_window): Prefer windows on the selected frame, then look for windows on other visible frames. * keyboard.c (Fmouse_click_p): Removed; with the 'e' spec, this isn't necessary anymore. (syms_of_keyboard): Remove defsubr for it. * keyboard.h (Fmouse_click_p): Remove extern declaration for it. * xfns.c (gray_bits): Remove this declaration; the same data is in <X11/bitmaps/gray>. #include that instead. [not HAVE_X11] (x_set_border_pixel): Use gray_width and gray_height, instead of assuming that the bitmap is 16x16. (x_make_gc): Instead of creating a pixmap and then calling XPutImage to make it into a grey stipple, just call XCreatePixmapFromBitmapData to do it all at once. * xterm.c (x_text_icon): Move the request for font information into the "not HAVE_X11" part of the function; the X11 code doesn't need this. * xterm.c (x_wm_set_icon_pixmap): Instead of setting the icon_pixmap to None, just remove IconPixmapHint from the flags of the XWMHints structure. * window.c (Fprevious_frame): Use prev_frame when we get to the end of the current frame, not next_frame. Doc fix. * frame.c (prev_frame): Remove "#if 0" from this function. It turns out we do need it, to make prev_frame work right. * frame.c (next_frame): Check that FRAME is a live frame. * frame.c (Fselect_frame): Remove "#ifdef MULTI_FRAME" clause around the code which calls Ffocus_frame; this code is already inside an "#ifdef MULTI_FRAME" clause. (next_frame, prev_frame, Fnext_frame): For the same reasons, remove the "#ifdef MULTI_FRAME" clause around these functions. unread-command-event has been replaced by unread-command-events. * commands.h (unread_command_event): Change extern declaration. * keyboard.c (unread_command_event): Change the definition. (syms_of_keyboard): Change DEFVAR, and adjust the docstring. (command_loop_1, read_char, Finput_pending, Fdiscard_input) (quit_throw_to_read_char, init_keyboard): Change to use unread_command_events, with the new semantics. * lread.c (read_char): Same. * minibuf.c (temp_echo_area_glyphs): Same. * xterm.c (unread_command_event): Remove external declaration for this; it is only used by obsolete code. * Makefile.in: Some makes can't handle comments in the middle of commands; move them to before the whole rule. 1993-01-21 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c (make_lispy_event): When handling a mouse click event on a window, change x and y from screen coordinates to window coordinates even when the click isn't in the text area. * xterm.c (x_scrollbar_create): Remove code which asks for EastGravity for windows; Emacs can't correctly deal with them moving around unexpectedly. * xterm.c (XTread_socket): Minor reformatting. * xterm.c (x_set_window_size): Always mark the frame garbaged. * window.c (Vmouse_window): Variable removed; it can't be handled properly without race conditions, and the events give you all the information you need anyway. (syms_of_window): Remove DEFVAR. * callint.c (Fcall_interactively): Change the `@' spec to select the window of the first parameterized event in the key sequence which invoked the command, instead of using Vmouse_window, which isn't even updated anymore. Adjust the documentation accordingly. 1993-01-20 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xterm.c (x_scrollbar_create): Set the scrollbars to use EastGravity. * keyboard.c (make_lispy_event): Deal with button releases with no stored down-going position. Make sure we always store a Qnil in the right button_down_location element after using it. 1993-01-19 Jim Blandy (jimb@totoro.cs.oberlin.edu) * frame.c (Fdelete_frame): Clear the frame's display after calling the window-system-dependent frame destruction routine. We no longer need to pass the display as a separate argument to x_destroy_window. * xterm.c (x_destroy_window): Put the code which clears out f's display here, right after we free the storage it points to. Put everything, including the code which clears x_focus_frame and x_highlight_frame, inside the BLOCK/UNBLOCK_INPUT pair. * dispnew.c (Fredraw_display): Undo change of Jan 12; redraw only frames whose garbaged flag is set. The change to FRAME_SAMPLE_VISIBILITY on Jan 14 should address the problem better. keyboard.c (read_char_menu_prompt): Test HAVE_X_WINDOWS, not HAVE_X_WINDOW. The CPP symbol indicating whether or not we have mouse menu support under X Windows is HAVE_X_MENU, not not NO_X_MENU. * emacs.c (main): Test HAVE_X_MENU, instead of NO_X_MENU. * keyboard.c (read_char_menu_prompt): Same. * ymakefile: Same. * keyboard.c (read_char, read_char_menu_prompt): Use the EVENT_HAS_PARAMETERS macro from keyboard.h, instead of writing it out. * keyboard.c (read_char_menu_prompt): Doc fix. * keyboard.c (read_char_menu_prompt): Fix test for no menus; comparing name to Qnil doesn't work if we are called with no maps. * keymap.c (Fdefine_key): Call Fkey_description to make the string to use in the error message. 1993-01-18 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * window.c (Fdisplay_buffer): Doc fix. 1993-01-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xterm.c (x_window_to_scrollbar): Search frames' condemned_scrollbars list as well; input might arrive during redisplay. (x_scrollbar_report_motion): Don't forget to BLOCK_INPUT. (XTjudge_scrollbars): Clear the condemned scrollbar list before traversing it, so we don't try to process an event on a scrollbar we've killed. 1993-01-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (Frecent_keys): Doc fix. 1993-01-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) * window.c (Fwindow_at): Doc fix. 1993-01-14 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xterm.c (x_scrollbar_create): Include PointerMotionHintMask in the event mask for scrollbars. * dispnew.c (Fredraw_display): DEFUN was missing a closing paren. * term.c (set_vertical_scrollbar_hook, condemn_scrollbars_hook, redeem_scrollbar_hook, judge_scrollbars_hook): Removed dumbo "externs" from these. They're supposed to be real definitions. * .gdbinit: Add "-geometry +0+0" to default args. (xscrollbar): New command. Make scrollbar structures into lisp objects, so that they can be. * frame.h (FRAME_SAMPLE_VISIBILITY): Make sure frame is marked as. * xfns.c (Fx_create_frame): After mapping the frame, call SET_FRAME_GARBAGED, not just plain FRAME_GARBAGED. *. * xdisp.c (display_string): Add new variable `f', to be W's frame. Use it to set desired_glyphs, and to get the frame's width to decide whether or not to draw vertical bars. * xdisp.c (display_text_line): If we're using vertical scrollbars, don't draw the vertical bars separating side-by-side windows. (display_string): Same thing. Draw spaces to fill in the part of the mode line that is under the scrollbar in partial-width windows. * xfns.c (Qvertical_scrollbars): New symbol. Use it as the name of the parameter which decides whether or not the frame has scrollbars, instead of Qvertical_scrollbar. (Fx_create_frame): Adjusted accordingly. (syms_of_xfns): Initialize and staticpro Qvertical_scrollbars. (x_set_vertical_scrollbar): Renamed to x_set_vertical_scrollbars. (x_frame_parms): Adjusted accordingly. *. * xfns.c (x_set_name): To request that the modelines be redrawn, execute the statement "update_mode_lines = 1;" instead of the silly statement "update_mode_lines;". * xfns.c (x_set_vertical_scrollbars): Don't try to set the X window's size if the frame's X window hasn't been created yet. * xfns.c (x_figure_window_size): Set the frame's vertical_scrollbar_extra field before trying to calculate its pixel dimensions. * xfns.c (x_window): When calling x_implicitly_set_name for the sake of drawing the name for the first time, remember to clear and set the frame's explicit_name member as well as its name member. (Fx_create_frame): Set the frame's explicit_name member if the user specified the name explicitly. * xdisp.c (display_text_line): Use the usable internal width of the window, as calculated above, as the limit on the length of the overlay arrow's image, rather than using the window's width field, less one. * xdisp.c (redisplay): Call condemn_scrollbars_hook and judge_scrollbars_hook whenever they are set, not just when the frame has vertical scrollbars. *. * xterm.c (XTmouse_position): Entirely rewritten, using XTranslateCoordinates. Call x_scrollbar_report_motion to handle scrollbar movement events. (x_scrollbar_report_motion): New function, to help out XTmouse_position. * keyboard.c (apply_modifiers): Don't assume that the Qevent_kind property of BASE is set when we first create the new modified symbol. Check that the Qevent_kind property is properly set each time we return any symbol. * termhooks.h (struct input_event): Replace the frame member with a Lisp_Object member by the name of frame_or_window. Doc fixes. Remove the scrollbar member; instead, use frame_or_window to hold the window whose scrollbar was clicked. * keyboard.c (kbd_buffer_store_event, kbd_buffer_get_event, make_lispy_event): Adjust references to frame member of struct input_event to use frame_or_window now. * xterm.c (construct_mouse_click, XTread_socket): Same. *. * keyboard.c (kbd_buffer_frames): Renamed to kbd_buffer_frame_or_window, and made to exist even when MULTI_FRAME isn't defined; single-frame systems might have scrollbars. Use it to GCPRO the frame_or_window field in the event queue. (kbd_buffer_store_event, kbd_buffer_get_event, stuff_buffered_input): Set and clear the appropriate element of kbd_buffer_frame_or_window, whether or not MULTI_FRAME is #defined. (read_avail_input): When reading characters directly from stdin, set the frame_or_window field of the event appropriately, depending on whether or not MULTI_FRAME is #defined. (Fdiscard_input, init_keyboard): Zap kbd_buffer_frame_or_window, not kbd_buffer_frames. (syms_of_keyboard): Initialize and staticpro kbd_buffer_frame_or_window, whether or not MULTI_FRAME is #defined. * keyboard.c (head_table): Make Qscrollbar_movement have a Qevent_kind property of Qmouse_movement, not Qscrollbar_movement. * keyboard.c (read_key_sequence): If we decide to throw away a mouse event which has prefix symbols (`mode-line', `vertical-scrollbar', etcetera), remember that we may have to unwind two characters, not just one. * keyboard.c (read_key_sequence): Doc fixes. * keyboard.c (kbd_buffer_store_event): Fix reversed sense of test for focus redirection. * keyboard.c (read_char): Don't echo mouse movements. *. * xdisp.c (echo_area_display): Move the assignment of f and the check for visibility out of the "#ifdef MULTI_FRAME" clause; they should work under any circumstances. * xdisp.c (redisplay_window): If we're not going to redisplay this window because it's a minibuffer whose contents have already been updated, go ahead and jump to the scrollbar refreshing code anyway; they still need to be updated. Initialize opoint, so it's known to be valid when we jump. Calculate the scrollbar settings properly for minibuffers, no matter what they are displaying at the time. * xdisp.c (redisplay_windows): Don't restore the current buffer and its point before refreshing the scrollbars; we need the buffer accurate. 1993-01-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * print.c (float_to_string): Add final 0 if text ends with decimal pt. * dispnew.c (Fredraw_display): Redraw all visible frames. Make the non-multi-frame version interactive. 1993-01-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c (Fset_default_file_modes, Fdefault_file_modes): Renamed from Fset_umask and Fumask; sense of arg is reversed. (Fwrite_region): Doc fix. 1993-01-10 Richard Stallman (rms@mole.gnu.ai.mit.edu) * print.c (float_to_string): Add `.0' at end if needed. * lread.c (Fload): If warn that .elc file is older, inhibit the ordinary message that would follow. 1993-01-09 Jim Blandy (jimb@totoro.cs.oberlin.edu) * fileio.c (Fdo_auto_save): Add CURRENT_ONLY argument, as described in doc string. 1993-01-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fns.c (Frandom): Change arg name. * editfns.c: Doc fixes. 1993-01-07 Richard Stallman (rms@mole.gnu.ai.mit.edu) * unexhp9k800.c (unexec): Don't call exit, just return. 1993-01-07 Jim Blandy (jimb@totoro.cs.oberlin.edu) * config.h.in: Protect against multiple #inclusions. * config.h.in: Add a declaration for getenv. * xfns.c (Fx_get_resource): Add CLASS argument, to give class of ATTRIBUTE. [not HAVE_X11]: Change definition of Fx_get_resource macro accordingly. (x_get_arg): Add CLASS argument, to give the class of ATTRIBUTE. Pass it along to Fx_get_resource. (x_figure_window_size, x_icon): Pass new argument to x_get_arg. (x_default_parameter): Add XCLASS argument, to give the class of XPROP. Pass it along to x_get_arg. (Fx_create_frame): Pass new args to x_get_arg and x_default_parameter. * xfns.c (Fx_create_frame): Use the same resource names and classes as xterm and Emacs 18. 1993-01-03 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfns.c (Fx_get_resource): Use EMACS_CLASS to make class_key even if SUBCLASS is specified. I don't know whether that is right, but that's what the doc says. Cosmetic changes in arg names and doc string. 1992-12-29 Roland McGrath (roland@geech.gnu.ai.mit.edu) * ralloc.c: [! emacs] [HAVE_CONFIG_H]: #include "config.h" 1992-12-21 Roland McGrath (roland@geech.gnu.ai.mit.edu) * Makefile.in (tagsfiles): New variable. (TAGS): Depend on $(tagsfiles); use that in cmds. (tags): Separate phony rule; depends on TAGS. 1992-12-21 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c: Protect all references to kbd_buffer_frames with #ifdef MULTI_FRAME. * frame.h (struct frame): New fields `can_have_scrollbars' and . * xdisp.c: #include "termhooks.h". (redisplay, redisplay_window): Use set_vertical_scrollbar_hook, condemn_scrollbars_hook, redeem_scrollbar_hook, and judge_scrollbars_hook to make scrollbars redisplay properly. * keyboard.c (Qscrollbar_movement, Qvertical_scrollbar,. * xterm.h (struct x_display): Delete v_scrollbar, v_thumbup, v_thumbdown, v_slider, h_scrollbar, h_thumbup, h_thumbdown, h_slider, v_scrollbar_width, h_scrollbar_height fields. * keyboard.c (Qvscrollbar_part, Qvslider_part, Qvthumbup_part) (Qvthumbdown_part, Qhscrollbar_part, Qhslider_part, Qhthumbup_part) (Qhthumbdown_part, Qscrollbar_click): Deleted; part of an obsolete interface. (head_table): Removed from here as well. (syms_of_keyboard): And here. * keyboard.h: And here. (POSN_SCROLLBAR_BUTTON): Removed. * xscrollbar.h: File removed - no longer necessary. * xfns.c: Don't #include it any more. (Qhorizontal_scroll_bar, Qvertical_scroll_bar): Deleted. (syms_of_xfns): Don't initialize or staticpro them. (gray_bits): Salvaged from xscrollbar.h. (x_window_to_scrollbar): Deleted. (x_set_horizontal_scrollbar): Deleted. (enum x_frame_parm, x_frame_parms): Remove references to x_set_horizontal_scrollbar. (x_set_foreground_color, x_set_background_color, x_set_border_pixel): Remove special code to support scrollbars. (Fx_create_frame): Remove old scrollbar setup code. (install_vertical_scrollbar, install_horizontal_scrollbar, adjust_scrollbars, x_resize_scrollbars): Deleted. * xterm.c (construct_mouse_click): This doesn't need to take care of scrollbar clicks anymore. (XTread_socket): Remove old code to support scrollbars. Call new functions instead for events which occur in scrollbar windows. (XTupdate_end): Remove call to adjust_scrollbars; the main redisplay code takes care of that now. (enum window_type): Deleted. * ymakefile: Note that xfns.o no longer depends on xscrollbar.h. * xterm.c (x_set_mouse_position): Clip mouse position to be within frame. * xterm.c: Adjust the first line of each page to have a reasonable description. This makes pages-directory more useful. * xterm.c (x_do_pending_expose): Declare this routine only if HAVE_X11 is not #defined; X11 doesn't need it. (XTread_socket): Protect call to x_do_pending_expose with `#ifdef HAVE_X11'. * xfns.c (syms_of_xfns): Delete defvars for x_mouse_x and x_mouse_y. That interface hasn't been live for years. (x_mouse_x, x_mouse_y): Delete these variables. * xterm.c (notice_mouse_movement): Deleted; obsolete and unused. * keyboard.c (Fread_key_sequence): Doc fix. * keyboard.c (make_lispy_event): Buttons are numbered starting with zero now. * keyboard.c (make_lispy_event): Use the proper accessors when manipulating the `x' and `y' fields of struct input_event. * keyboard.c (parse_modifiers_uncached): Remember that strncmp returns zero if the two substrings are equal. * keyboard.c (do_mouse_tracking, Ftrack_mouse): Doc fix. * keyboard.c (read_char): Don't put mouse movements in this_command_keys. * xfns.c (Fx_create_frame): Don't initialize the wm_hints field here. (x_window): Do it here, along with all the similar stuff. 1992-12-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * callint.c (Fcall_interactively): For `s', use Fread_string. 1992-12-20 Jim Blandy (jimb@totoro.cs.oberlin.edu) Properly handle focus shift events, so the cursor is filled and hollow at the appropriate times, even in titleless windows. * xterm.c (x_focus_event_frame): New variable. (XTread_socket): When we receive a FocusIn event that's not NotifyPointer, record the frame in x_focus_event_frame. When we receive a FocusOut event that's not NotifyPointer, clear it. When we get a LeaveNotify event, don't take it seriously if we still have focus. * xterm.c (XTread_socket): Remove special code in EnterNotify case to handle scrollbars and fake mouse motion events. 1992-12-19 Jim Blandy (jimb@totoro.cs.oberlin.edu) * floatfns.c (Flog): Fix unescaped newline in string. * frame.c (Fnext_frame): Same. * textprop.c (Fprevious_single_property_change): Same. (syms_of_textprop): Same, for DEFVAR for `interval_balance_threshold'. Change the meaning of focus redirection to make switching windows work properly. Fredirect_frame_focus has the details. * frame.h (focus_frame): Doc fix. [not MULTI_FRAME] (FRAME_FOCUS_FRAME): Make this Qnil, which indicates no focus redirection, instead of zero, which is selected_frame. * frame.c (make_frame): Initialize f->focus_frame to Qnil, rather than making it point to frame itself. (Fselect_frame): If changing the selected frame from FOO to BAR, make all redirections to FOO shift to BAR as well. Doc fix. (Fredirect_frame_focus): Doc fix. Accept nil as a valid redirection, not just as a default for FRAME. (Fframe_focus): Doc fix. * keyboard.c (kbd_buffer_store_event, kbd_buffer_get_event): Deal with focus redirections being nil. * xterm.c (XTframe_rehighlight): Doc fix. Deal with focus redirections being nil. * window.c (Fset_window_configuration): Don't restore the frame's focus redirection if the target frame is now dead. * ymakefile (ralloc.o): This no longer depends on xterm.h. * ymakefile (all, xemacs): We build an executable called `emacs' now, not `xemacs'. * Makefile.in (distclean, xemacs, doxemacs): Same. * xterm.h (PIXEL_WIDTH, PIXEL_HEIGHT): Change name of parameter from `s' to `f'; it's a frame pointer. 1992-12-18 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c (kbd_buffer_frames): New vector, to GCPRO frames in kbd_buffer. (kbd_buffer_store_event): When we add an event to kbd_buffer, make sure to store its frame in kbd_buffer_frames. (kbd_buffer_get_event): When we remove an event from kbd_buffer, make sure to set the corresponding element of kbd_buffer_frames to Qnil, to allow the frame to get GC'd. (Fdiscard_input, init_keyboard): Clear all elements of kbd_buffer_frames to nil. (syms_of_keyboard): Create and staticpro kbd_buffer_frames. * xterm.c (x_error_quitter): Just abort, so we can look at the core to see what happened. 1992-12-17 Jim Blandy (jimb@totoro.cs.oberlin.edu) * buffer.c (Frename_buffer): Set update_mode_lines. 1992-12-14 Jim Blandy (jimb@totoro.cs.oberlin.edu) * scroll.c (do_scrolling): When bcopying the max_ascent field from current_frame to temp_frame, remember that max_ascent is an array of shorts, not ints. It's a pain to remember that you can't assign to FRAME->visible. Let's change all references to the `visible' member of struct frame to use the accessor macros, and then write a setter for the `visible' field that does the right thing. * frame.h (FRAME_VISIBLE_P): Make this not an l-value. (FRAME_SET_VISIBLE): New macro. * frame.c (make_terminal_frame, Fdelete_frame): Use FRAME_SET_VISIBLE. (Fframe_visible_p, Fvisible_frame_list): Use FRAME_VISIBLE_P and FRAME_ICONIFIED_P. * dispnew.c (Fredraw_display): Use the FRAME_VISIBLE_P and FRAME_GARBAGED_P accessors. * xdisp.c (redisplay): Use the FRAME_VISIBLE_P accessor. * xfns.c (x_set_foreground_color, x_set_background_color, x_set_cursor_color, x_set_border_pixel, x_set_icon_type): Use the FRAME_VISIBLE_P accessor. (Fx_create_frame): Use FRAME_SET_VISIBILITY. * xterm.c (clear_cursor, x_display_bar_cursor, x_display_box_cursor): Use FRAME_SET_VISIBILITY. 1992-12-12 Jim Blandy (jimb@totoro.cs.oberlin.edu) * ymakefile (CFLAGS): #define HAVE_CONFIG_H too. * Makefile.in (distclean): Don't delete machine.h or system.h; they don't exist anymore. * Makefile.in (distclean): Don't delete autosave or backup files. (extraclean): New target; like distclean, but delete autosave and backup files too. 1992-12-11 Jim Blandy (jimb@totoro.cs.oberlin.edu) * search.c (Fskip_chars_forward, Fskip_chars_backward): Return the distance traveled. (skip_chars): Return the distance traveled, as a Lisp_Object. * macros.c (Fend_kbd_macro): Don't use XFASTINT to check if arg is negative; XFASTINT only works on values known to be positive. (Fexecute_kbd_macro): Check QUIT in the repetition loop. If the macro is null, no characters are actually being read, so this matters. *}. * ymakefile (lisp): Don't include version.el in this list. Give subprocess creation a way to find a valid current directory. * fileio.c (find_file_handler): Rename this to. * fileio.c (syms_of_fileio): Add staticpros for Qexpand_file_name, Qdirectory_file_name, Qfile_name_directory, Qfile_name_nondirectory, Qfile_name_as_directory. 1992-12-07 Jim Blandy (jimb@totoro.cs.oberlin.edu) * window.c (Fset_window_configuration): If we're restoring the configuration of a dead frame, don't bother rebuilding its window tree, restoring its focus redirection, or temporarily resizing it to fit the saved window configuration. If the frame which was selected when the configuration was captured is now dead, don't try to select it. * frame.c (Fdelete_frame): Delete all the windows in the frame's window tree, using delete_all_subwindows. * window.c (delete_all_subwindows): Don't make this static anymore. 1992-12-03 Jim Blandy (jimb@totoro.cs.oberlin.edu) Make sure that frames' visible flag only changes at acceptable times. See FRAME_SAMPLE_VISIBILITY's comments for details. * frame.h (struct frame): New fields called async_visible and async_iconified. (FRAME_SAMPLE_VISIBILITY): New macro, with MULTI_FRAME and non-MULTI_FRAME definitions. * xdisp.c (redisplay): Call FRAME_SAMPLE_VISIBILITY to set the visible and iconified flags appropriately for each frame. (message1): Call FRAME_SAMPLE_VISIBILITY to set the visible and iconified flags for the minibuffer frame. * frame.c (make_frame): Initialize async_visible and async_iconified properly. * xfns.c (Fx_create_frame): Initialize f->async_visible too. * xterm.c (XTread_socket): When we get MapNotify, UnmapNotify, Expose, ExposeWindow, or UnmapWindow, set f->async_visible, not f->visible. (x_do_pending_expose, x_raise_frame, x_lower_frame) (x_make_frame_invisible, x_make_frame_visible, x_iconify_frame): Test and set f->async_visible and f->async_iconified, not f->visible or f->async_iconified. * keyboard.c (kbd_store_ptr): Declare this to be volatile, if __STDC__ is #defined. (Fdiscard_input): Use cast to keep GCC from complaining about the assignment of kbd_store_ptr to kbd_fetch_ptr. * xdisp.c (redisplay): Use FOR_EACH_FRAME to apply redisplay_windows to the root window of each frame. This makes a #ifdef MULTI_FRAME unneeded, but it also means we recompute buffer_shared from scratch even on non-MULTI_FRAME configurations. Don't skip elements of Vframe_list that aren't frames; go ahead and crash here. * xdisp.c (redisplay): Remove #ifdef MULTI_FRAME around the code which updates separate minibuffer frames specially; there's nothing there that won't work on a single-frame configuration. * dispextern.h (struct frame_glyphs): Doc fix. 1992-12-02 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * dispnew.c: Remove dyked-out copy of safe_bcopy. * environ.c: File removed; Changes on 1/13/1992 made it unnecessary. 1992-12-01 Jim Blandy (jimb@totoro.cs.oberlin.edu) * process.c (wait_reading_process_input): Doc fix. 1992-11-26 Richard Stallman (rms@mole.gnu.ai.mit.edu) * next.h: Copy changes from 18.59: (NeXT): Defined. (BIG_ENDIAN): Define only if __BIG_ENDIAN__. (m68000, COMPILER_REGISTER_BUG): Defs deleted. (SIGN_EXTEND_CHAR, LIB_X11_LIB, NO_T_CHARS_DEFINES, UNEXEC): Defined. (LIBS_DEBUG, LIB_GCC, C_SWITCH_MACHINE, ORDINARY_LINK): Defined. (TEXT_START, TEXT_END, DATA_END, LD_SWITCH_MACHINE): Defined. (KERNEL_FILE): #undef it. (environ): Define as _environ. 1992-11-25 Jim Blandy (jimb@totoro.cs.oberlin.edu) * doc.c (store_function_docstring): New function, made from part of Fsnarf_documentation, which handles docstrings for macros properly. (Fsnarf_documentation): Call store_function_docstring. * data.c (indirect_function): Delete unused argument ERROR. 1992-11-23 Jim Blandy (jimb@apple-gunkies.gnu.ai.mit.edu) * Makefile.in (clean): Remove prefix-args. 1992-11-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/sol2.h (LD_SWITCH_SYSTEM): Make alternate version for GCC. 1992-11-19 Jim Blandy (jimb@totoro.cs.oberlin.edu) * m/sparc.h: Don't include <sys/param.h> here; that screws up the xmakefile. Instead, include it in getloadavg.c, which is the only place that uses LOAD_AVE_CVT, which is the only reason <sys/param.h> was here in the first place. 1992-11-15 Jim Blandy (jimb@totoro.cs.oberlin.edu) * dispnew.c [not MULTI_FRAME] (Fredraw_display): Pass the correct number of arguments to mark_window_display_accurate. * undo.c (Fprimitive_undo): Remove whitespace in front of #ifdef and #endif. * systty.h: Doc fix. * systty.h, process.c, buffer.h, callproc.c, sysdep.c, dired.c: Added VMS changes from Roland Roberts. * vmspaths.h: New version from Roland Roberts. * xdisp.c (display_string): Use w's buffer's value of tab-width to display the string, instead of the current buffer's, which could be anything. * s/sol2.h (LD_SWITCH_SYSTEM): Add -R option. * process.c (read_process_output): Save, widen, insert the process output, and then restore the restriction if inserting text outside the visible region. 1992-11-14 Jim Blandy (jimb@totoro.cs.oberlin.edu) * buffer.c (Ferase_buffer): Doc fix. * dispnew.c (safe_bcopy): Use the right terminating condition in the loop which uses multiple bcopy calls to transfer a block to an overlapping higher block. 1992-11-13 Jim Blandy (jimb@totoro.cs.oberlin.edu) * process.c (Fstart_process): Establish an unwind-protect to remove PROC from the process list if an error occurs while starting it. (start_process_unwind): New function to help with that. (create_process): There's no need to explicitly call remove_process if the fork fails; the record_unwind_protect in Fstart_process will take care of it. * commands.h (unread_command_event): Doc fix. Don't ever throw away switch-frame events. * lread.c: #include "keyboard.h". (Fread_char, Fread_char_exclusive): Don't signal an error for or throw away switch-frame events; instead, put them off until after we've found a character we can respond to. * commands.h (unread_switch_frame): Declare this extern. * keyboard.c (unread_switch_frame): Don't declare this static. * ymakefile (lread.o): Note that this depends on keyboard.h. * keyboard.c (Vlast_event_frame): Doc fix. * process.c (wait_reading_process_input): Test the C preprocessor symbol "ultrix", not "__ultrix__" to see if we should ignore ENOMEM errors from select. * fileio.c (Fexpand_file_name): Don't fiddle with "/." if it's the entire string. * buffer.c (Fbury_buffer): Make this behave as in 18.59, although that behavior is very odd - only remove the buffer from the selected window if BUFFER was nil or omitted. * keyboard.c (read_char): Write composite events to the dribble file properly. * keyboard.c (init_keyboard): Initialize Vlast_event_frame to Qnil, rather than the selected frame. * mem-limits.h [DATA_SEG_BITS] (EXCEEDS_LISP_PTR): Remember to remove DATA_SEG_BITS from the pointer before testing if the pointer fits in VALBITS. * Makefile.in (doxemacs, dotemacs): Explicitly pass along the CC variable in these rules, just as in the `doall' rule. * ralloc.c (relocate_some_blocs): Handle BLOC == NIL_BLOC. (free_bloc): This can now be simplified. * ralloc.c (r_alloc_sbrk): When we allocate new space for the malloc heap, zero it out even if we don't have any blocs in the free list. 1992-11-12 Jim Blandy (jimb@totoro.cs.oberlin.edu) * process.c (process_send_signal): On systems which have both the TIOCGETC and TCGETA ioctls, just use the former. * xselect.c (Fx_get_cut_buffer): Correct check for buf_num in range. * xselect.c (Fx_get_cut_buffer, Fx_set_cut_buffer): Fix error message format; use NUM_CUT_BUFFERS instead of literal 7. * keyboard.c (lispy_modifier_list): Added sanity check before indexing into modifier_symbols. * keyboard.c (add_command_key): When copying the contents of the old this_command_keys to new_keys, remember to multiply size by sizeof (Lisp_Object) to get the amount we really need to copy. Rename unread_command_char to unread_command_event; it has subtly different semantics now, and we should use `make-obsolete-variable' to warn people. * command.h (unread_command_char): Change name in extern declaration. * keyboard.c (unread_command_char): Rename. (command_loop_1, read_char, Finput_pending, Fdiscard_input) (quit_throw_to_read_char, init_keyboard, syms_of_keyboard): Change references. * lread.c (Fread_char): Change reference. * minibuf.c (temp_echo_area_glyphs): Change reference to unread_command_char to unread_command_event. * xfns.c (unread_command_char): Change name in extern declaration to unread_command_event. 1992-11-11 Jim Blandy (jimb@totoro.cs.oberlin.edu) * m/pmax.h: Don't define SYSTEM_MALLOC; this was only necessary for Ultrix version 4.1, and the current version is 4.3. * s/bsd4-2.h, s/bsd4-3.h: #define SIGNALS_VIA_CHARACTERS. * process.c (process_send_signal): Put all the code for sending signals via characters in a #ifdef SIGNALS_VIA_CHARACTERS. Decide whether to use the Berkeley-style or SYSV-style ioctls by seeing which ioctl commands are #defined. * minibuf.c (read_minibuf): If get_minibuffer gives the new minibuffer a nil default directory, find another buffer with a better default directory and use that one's instead. 1992-11-10 Jim Blandy (jimb@totoro.cs.oberlin.edu) * process.c (process_send_signal): Doc fix. * keyboard.c (read_key_sequence): Don't use save_excursion_{save,restore} to protect the caller against buffer switches; use Fset_buffer and Fcurrent_buffer; redisplay might change point, and we don't want to undo that. * keyboard.c (kbd_buffer_get_event): When checking a mouse movement for a frame switch, don't assume Vlast_event_frame contains a Lisp_Frame object. 1992-11-06 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/dgux.h (SYSTEM_TYPE): Use berkeley-unix. 1992-11-04 Jim Blandy (jimb@totoro.cs.oberlin.edu) * alloc.c: #include "frame.h" unconditionally. frame.h does the right thing when MULTI_FRAME isn't defined. * Makefile.in: Rearrange dependencies to make sure that xmakefile is built before we try to use it, even using a parallel make. Changes for SYSV from Eric Raymond: * process.c [SYSV]: Don't include <termios.h>, <termio.h>, or <fcntl.h>. (process_send_signal): Don't try to send SIGTSTP unless SIGTSTP is defined. * sysdep.c (init_baud_rate) [HAVE_TERMIO, not HAVE_TCATTR]: Use TCGETA, not TIOCGETP. * systime.h [USG] (EMACS_GET_TZ_OFFSET): Assign to *(offset), not (offset). Don't forget the while corresponding to the do. Include USG in the list of systems that have a tzname array. * keyboard.c (read_key_sequence): Removed the replay_sequence_new_buffer label; replay_sequence should be here instead. Arrange to get compile-time errors for uses of Lisp_Frame in a non-MULTI_FRAME configuration. * lisp.h [not MULTI_FRAME]: Don't declare the Lisp_Frame tag. * minibuf.c (read_minibuf): Protect call to Fredirect_frame_focus with a #ifdef MULTI_FRAME. * window.c (Fset_window_configuration): Protect call to Fselect_frame with a #ifdef MULTI_FRAME. [not MULTI_FRAME] (Fcurrent_window_configuration): Don't bother setting the window configuration's selected_frame member. * keyboard.c (Vlast_event_frame): Arrange for this to exist iff MULTI_FRAME is defined. [not MULTI_FRAME] (syms_of_keyboard): Don't DEFVAR Vlast_event_frame. [not MULTI_FRAME] (read_char): Don't try to set Vlast_event_frame. [not MULTI_FRAME] (kbd_buffer_store_event): Don't try to set Vlast_event_frame for quit characters. [not MULTI_FRAME] (kbd_buffer_get_event): Don't try to generate switch-frame events. * buffer.c (init_buffer): If PWD is accurate, use it instead of calling getwd. #include <sys/types.h> and <sys/stat.h>, for the call to stat. Indicate whether an autoload form stands for a keymap or not. * eval.c (Fautoload): Renamed fifth argument TYPE. Document the fact that (eq TYPE 'keymap) means FUNCTION will become a keymap when loaded. (Fmacroexpand): Instead of assuming that every autoload form with a fifth element is a macro, actually check the fifth element against t and `macro', which are the only values which denote macroness. * keymap.c (get_keymap_1): Don't try to autoload OBJECT's function unless the autoload form indicates that it's a keymap. 1992-11-03 Jim Blandy (jimb@totoro.cs.oberlin.edu) * .gdbinit (mips): New command. 1992-10-31 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c (Fmake_directory_internal): Renamed from Fmake_directory. Pass nil as third arg to handler. Lisp function `make-directory' is now in files.el. 1992-10-30 Jim Blandy (jimb@totoro.cs.oberlin.edu) Clean up errors due to treating Lisp_Objects like integers. * abbrev.c (Funexpand_abbrev): Just assign the last abbrev's value to val; don't use XSET. Make sure that the value of the abbrev-symbol is a string. * alloc.c (Frope_elt): Declare arguments to be Lisp_Objects. * buffer.c (reset_buffer): Don't assign to b->save_length as if it were an int; use XFASTINT. * buffer.h (Fbuffer_name, Fget_file_buffer): Added external declarations. * bytecode.c (Fbyte_code): Use EQ to compare string_saved with bytestr. * casefiddle.c (operate_on_word): Declare end to be an int, not a Lisp_Object. * casetab.c (set_case_table): Declare this to be static, and return a Lisp_Object. Add static declaration for this before Fset_case_table and Fset_standard_case_table. (Fset_case_table, Fset_standard_case_table): Return the return value of set_case_table, instead of returning garbage. * commands.h (unread_command_char): Declare this to be a Lisp_Object, not an int. * data.c (Fset): See if current_alist_element points to itself using EQ, not ==. (float_arith_driver): Declare this extern above arith_driver. * dired.c (find_file_handler): Declare this extern. (Ffile_attributes): Use NILP, not == Qnil. * dispextern.h (sit_for): Declare this extern. * doc.c: #include keyboard.h. * floatfns.c (Flog): Don't forget to declare the BASE argument a Lisp_Object. * fns.c: #include keyboard.h. (Fdelete): Check if Fequal returns Qnil, not zero. * frame.c: #include buffer.h. *.h (get_keymap_1, Fkeymapp, reorder_modifiers) (Fmouse_click_p, read_char): Add external declarations for these. * keymap.c (Fdefine_key, Flookup_key, describe_map): Don't assume that Flength returns an integer. * lisp.h (Fdefault_boundp, make_float, Ffloat, Fnth, Fcopy_alist) read.c (read_char): Add an extern declaration for this, indicating that it returns a Lisp_Object. * minibuf.c (read_minibuf): Use EQ to compare, not ==. (temp_echo_area_glyphs): Use XFASTINT to assign to unread_command_char. * print.c (print): Cast the frame's address to an integer before passing it to sprintf to form the frame's printed form. * process.c (status_convert): Declare this to return a. * search.c (Fstore_match_data): Don't assume Flength returns a C integer. * undo.c (record_insert): Use accessors on BEG and LENGTH. (truncate_undo_list): Use NILP, not == Qnil. * window.c (Fwindow_width, Fset_window_hscroll): Use accessors on w->width, w->left, w->hscroll, and arguments. (replace_window): Use EQ, not ==. (Fdelete_window): p->top and p->left are not C integers. (Fnext_window, Fprevious_window): Use EQ, not ==. * window.h (make_window, window_from_coordinates, Fwindow_dedicated_p): Add extern declarations for these. * xdisp.c (redisplay): Use ! EQ to compare the old and new arrow positions, not !=. (mark_window_display_accurate): Barf if WINDOW isn't a window. (display_string): Test buffer_defaults.ctl_arrow using NILP, instead of comparing it with zero. * xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is. * xselect.c (own_selection): selection_type is an X Atom value, not a Lisp_Object. (x_selection_arrival): Declare this static, and add a forward declaration at the top of the page. * xterm.c (x_convert_modifiers): Declare this to return an. * xterm.h (x_screen_count, x_release, x_screen_height) (x_screen_height_mm, x_screen_width, x_screen_width_mm) (x_save_under, x_screen_planes): Declare this as ints, to match their definitions in xterm.c. * ymakefile: Note the new dependencies caused by the new #inclusions above. * xdisp.c (last_arrow_position, last_arrow_string): Make these static. * process.c (pty_process): Variable deleted; it's no longer used. (syms_of_process): Don't initialize it. * buffer.h (struct buffer_local_types): This declaration needed an extern qualifier. * floatfns.c (Fexpt): Don't return the value of the XSET function call; that's not guaranteed to be the value assigned. * dired.c (Ffile_attributes): Doc fix. * lisp.h (DEFVARLISP, DEFVARBOOL, DEFVARINT, DEFVARPERBUFFER): Removed these definitions; we should be using the versions whose names use underscores. * keyboard.c (echobuf): Make this 300 characters, not 100. This isn't a real fix, but it's quick. 1992-10-30 Richard Stallman (rms@mole.gnu.ai.mit.edu) * callint.c (preserved_fns): New var. (Fcall_interactively): Preserve all fns listed in preserved_fns. (syms_of_callint): Set preserved_fns and staticpro it. Don't set up Qregion_beginning or Qregion_end. 1992-10-29 Richard Stallman (rms@mole.gnu.ai.mit.edu) * dispnew.c (count_blanks): Leave argument r constant, and increment p. 1992-10-28 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xdisp.c (message): Re-write this in terms of message1. (message1): Move code to clear out echo_area_glyphs and previous_echo_glyphs from message to here. *. * keyboard.c (follow_key): Ask get_keymap_1 to perform autoloads. (read_key_sequence): When pursuing potential bindings in the function key map, ask get_keymap_1 to perform autoloading. This is hardly important, but it's consistent. *. 1992-10-28 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/irix3-3.h (HAVE_SETSID, IRIX): Defined. * s/irix4-0.h: New file. 1992-10-27 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) * sysdep.c (get_system_name): Use gethostname for USG systems if HAVE_GETHOSTNAME is defined. * s/hpux7.h, s/irix3-3.h (HAVE_GETHOSTNAME): Define it. 1992-10-27 Jim Blandy (jimb@totoro.cs.oberlin.edu) * callproc.c: Arrange for synchronous processes to get SIGINT the. 1992-10-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) * unexmips.c [sony, IRIS_4D]: Include getpagesize.h and fcntl.h. (unexec): #if 0 the error check of hdr.fhdr.f_nscns. Clear text_section->s_scnptr. * callint.c (Fcall_interactively): Preserve (region-beginning) and (region-end) into the command history when they appear in an interactive spec which is a call to `list'. * batcomp.com: New file. Waiting for papers from richard@ttt.kth.se. 1992-10-23 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * emacs.c (main): Correct spelling of HAVE_X_WINDOW to HAVE_X_WINDOWS in conditionals around the call to syms_of_xmenu. 1992-10-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ralloc.c (relinquish): Adjust page_break_value by amount of memory actually given back. (r_alloc_sbrk): Provide hysteresis in relocating the blocs. 1992-10-22 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ralloc.c (relinquish): Sign of arg to *real_morecore was backwards. 1992-10-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ralloc.c (relinquish): Never free less than extra_bytes; keep extra_bytes of empty space. (obtain): Always get extra_bytes additional space. (r_alloc_init): Set extra_bytes and page_size. (ALIGNED, ROUNDUP, ROUND_TO_PAGE): Use page_size. 1992-10-20 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (syms_of_keyboard): Properly staticpro this_command_keys. * mem-limits.h (get_lim_data): Make it static. * ymakefile (mallocobj): Use vm-limit.o along with ralloc.o. * ralloc.c [emacs]: Define POINTER and SIZE. [!emacs]: Delete definition of EXCEEDS_LISP_PTR. * eval.c (grow_specpdl): Increase max_specpdl_size before Fsignal. 1992-10-19 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xfns.c (x_set_face): Dyked out this function; it has no callers, and refers to an obsolete version of struct face. * xterm.c (compose_status): New variable. (XTread_socket): Pass it by reference to XLookupString. 1992-10-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/esix5r4.h (BROKEN_FIONREAD): Defined. 1992-10-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/vms5-5.h: New file. 1992-10-16 Jim Blandy (jimb@totoro.cs.oberlin.edu) * xdisp.c (message): If M is zero, clear echo_area_glyphs and previous_echo_glyphs, so that the minibuffer shows through. * editfns.c (Fmessage): With no arguments, clear any active message; let the minibuffer contents show through. * minibuf.c (temp_echo_area_glyphs): Don't clear echo_area_glyphs and previous_echo_glyphs; let message do that work. * keyboard.c (this_command_keys): Make this a vector, instead of an array of Lisp_Objects. (this_command_keys_size): Deleted. (echo, add_command_key, Fthis_command_keys): Adjusted appropriately. (init_keyboard): Don't allocate it here. (syms_of_keyboard): Allocate it here, and staticpro it. * keyboard.h (this_command_keys): Extern declaration changed. Doc fix. * callint.c (Fcall_interactively): Change handling of 'e' spec; this_command_keys is now a vector. * keyboard.c (read_char): Call ourselves with the appropriate number of arguments. (read_char_menu_prompt): If USED_MOUSE_MENU is zero, don't try to store things in it. * window.c: Try to deal coherently with deleted windows: (Flive_window_p): New function. (Qlive_window_p): New variable, to name it in type errors. (syms_of_window): Defsubr Slive_window_p, init and staticpro Qlive_window_p. * lisp.h (CHECK_LIVE_WINDOW): New predicate. (Qlive_window_p): Extern declaration for this. * window.c (decode_window): Use CHECK_LIVE_WINDOW instead of CHECK_WINDOW; the only thing a user should be able to do to a dead window is check its type. (Fcoordinates_in_window_p, Fnext_window, Fprevious_window) (Fdelete_other_windows, Fselect_window, Fsplit_window) (Fscroll_other_window): Use CHECK_LIVE_WINDOW instead of CHECK_WINDOW. * frame.c (make_frame_without_minibuffer, Fwindow_frame): Same. * sunfns.c (Fsun_menu_internal): Same. * xmenu.c (Fx_popup_menu): Same. * window.c (Fdelete_window): If WINDOW is a deleted window, do nothing; there's no harm in allowing people to delete deleted windows. Delete all of WINDOW's subwindows, too. (delete_all_subwindows): Set the buffer, vchild, and hchild of the windows we delete all to nil. * window.h (struct window): Doc fix. * window.c (Fwindow_minibuffer_p): Make the WINDOW argument optional, like all the other window-querying functions. * window.c (Fpos_visible_in_window_p): Use decode_window to handle the WINDOW argument, instead of writing out that function's code. * window.c (check_frame_size): Don't define this extern; that doesn't mean anything. * xterm.c: Clean up some of the caps lock handling: (x_shift_lock_mask): New variable. (x_find_modifier_mappings): Set it, based on the modifier mappings. (x_convert_modifiers): Use x_shift_lock_mask, instead of assuming that the lock bit always means to shift the character. (XTread_socket): When handling KeyPress events, don't pass an XComposeStatus structure along to XLookupString. When handling MappingNotify events, call XRefreshKeyboardMapping for both MappingModifier and MappingKeyboard events, not just the latter. 1992-10-15 Jim Blandy (jimb@totoro.cs.oberlin.edu) * window.c (Fdelete_window): Choose an alternative when we delete any frame's selected window, not just when we delete the selected frame's selected window. 1992-10-15 Roland McGrath (roland@geech.gnu.ai.mit.edu) * vm-limit.c (check_memory_limits): Declare __morecore. Remove unused variable `result'. 1992-10-15 Roland McGrath (roland@geech.gnu.ai.mit.edu) * vm-limit.c (morecore_with_warning): Removed. (check_memory_limits): New fn; most code from morecore_with_warning, but only checks limits, doesn't do any work. (memory_warnings): Set __after_morecore_hook to check_memory_limits; don't set __morecore. 1992-10-14 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * intervals.c (traverse_intervals): New parameter `depth'. Increment this when passing recursively. * alloc.c (mark_interval_tree): Pass 0 as initial depth argument to traverse_intervals. * xterm.h: Declaration of struct face removed. * dispextern.h: New element of frame structure `max_ascent'. Removed elements `nruns' and `face_list'. LINE_HEIGHT and LINE_WIDTH macros removed. New struct face with associated typedef FACE declared, along with accessing macros. * scroll.c (do_scrolling): Don't bcopy non-existant `nruns' or `face_list' elements. Do copy new `max_ascent' frame element. * dispnew.c (scroll_frame_lines): All references to frame elements `nruns' and 'face_list' removed. Handle new element `max_ascent'. (free_frame_glyphs): Don't free nonexistent elements `nruns' and `face_list'; do free `max_ascent' element. (make_frame_glyphs): Don't allocate nonexistent elements `nruns' and `face_list'; do allocate `max_ascent' element. (update_frame): Replaced use of macro LINE_HEIGHT with element frame element `pix_height'. 1992-10-14 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c (modify_event_symbol): Arrange to set the click_modifier bit on otherwise unmodified mouse clicks. * keymap.c (store_in_keymap): Don't forget to QUIT in the keymap-scanning loop. Don't treat vectors as binding tables if they're the wrong length. 1992-10-12 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (kbd_buffer_get_event): Remember that *mouse_position_hook may set *FRAME to 0; don't generate switch-frame events in this case. Fix fencepost bug in fetching events from keyboard buffer. 1992-10-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (ralloc.o): Delete dep mem_limits.h (vm-limit.o): Rename dep to mem-limits.h. 1992-10-12 Roland McGrath (roland@geech.gnu.ai.mit.edu) * ralloc.c: Removed #include "mem-limits.h". [emacs]: Moved #undef NULL and #include "getpagesize.h" here. [! emacs]: #include <unistd.h>, <malloc.h>, <string.h>. (r_alloc_init): Use NIL, not NULL. 1992-10-12 Roland McGrath (roland@geech.gnu.ai.mit.edu) * ralloc.c (sbrk): Removed decl. (real_morecore): New static variable. (warnlevel, warn_function, check_memory_limits): Removed. (obtain): Don't call check_memory_limits. (obtain, relinquish, r_alloc_sbrk): Use (*real_morecore) in place of sbrk; it returns 0 for errors, not -1. (r_alloc_init): Set real_morecore to old value of __morecore. Don't initialize lim_data or warnlevel, and don't call get_lim_data. (memory_warnings): Function removed. 1992-10-12 Roland McGrath (roland@geech.gnu.ai.mit.edu) * vm-limit.c (warnfunction): Renamed to warn_function (was used inconsistently). (morecore_with_warning, memory_warnings): Change callers (were inconsistent). 1992-10-12 Roland McGrath (roland@geech.gnu.ai.mit.edu) * mem-limits.h (start_of_data): Removed extra defn. (get_lim_data): Define to return void. 1992-10-12 Roland McGrath (roland@geech.gnu.ai.mit.edu) * mem_limits.h: File renamed to mem-limits.h. * vm-limit.c, ralloc.c: Changed #includes. 1992-10-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * syntax.c (find_defun_start): scan_buffer returns start of line; no need to advance over newline. * vm-limit.c (morecore_with_warning): Reduce warnlevel when usage drops far enough. * ralloc.c (check_memory_limits): Likewise. * vm-limit.c (memory_warnings): Renamed from malloc_init. Don't set lim_data or warnlevel. Use start_of_data if start is 0. * ralloc.c (memory_warnings): New function; just set warning data. Use start_of_data if start is 0. * emacs.c (Fdump_emacs, main): Use memory_warnings. * mem_limits.h [!emacs]: Don't define POINTER, SIZE or NULL. (start_of_data): Define as macro, if !emacs. * ralloc.c [!emacs]: Don't include config.h or lisp.h; instead, use stddef.h. Define POINTER, SIZE, EXCEEDS_LISP_PTR. * vm-limit.c [!emacs]: Don't include config.h or lisp.h; instead, use stddef.h. Define POINTER, SIZE, EXCEEDS_LISP_PTR. * ralloc.c [. * mem_limits.h (EXCEEDS_LISP_PTR): Renamed from EXCEEDS_ELISP_PTR. * vm-limit.c (morecore_with_warning): Use EXCEEDS_LISP_PTR. * ralloc.c (check_memory_limits): Use EXCEEDS_LISP_PTR. 1992-10-10 Jim Blandy (jimb@totoro.cs.oberlin.edu) * keyboard.c (Vlast_event_frame): Make this variable exist even when MULTI_FRAME isn't #defined. People might find it necessary for writing correct programs, even when the programs don't explicitly use multiple frames. (read_char, kbd_buffer_store_event, kbd_buffer_get_event): No need to test MULTI_FRAME before setting Vlast_event_frame. (syms_of_keyboard): DEFVAR Vlast_event_frame whether or not MULTI_FRAME is defined. * keyboard.c: Add switch-frame events. (Qswitch_frame): New event header symbol. (head_table): Include Qswitch_frame in the table of event heads. (kbd_buffer_get_event): Detect when a frame switch has occurred, and return a frame switch event before the enqueued event. (make_lispy_switch_frame): New function. (unread_switch_frame): New variable. (read_key_sequence): Don't throw away the key sequence if the user switches frames in the middle of the sequence. Instead, when we receive a switch-frame event in the middle of a key sequence, save it, and stuff it into unread_switch_frame when the sequence is complete. (read_char): If unread_switch_frame is set, return that value. (command_loop_1): No need to check Vlast_event_frame and select new frames here; that's taken care of by switch-frame events now. (syms_of_keyboard): Initialize and staticpro unread_switch_frame. * keyboard.h (Qswitch_frame): Declare this extern. * frame.c: #include "commands.h" and "keyboard.h". (Fselect_frame): Make this interactive, and accept switch-frame events as arguments, so we can bind this function to switch-frame events. (keys_of_frame): New function; bind switch-frame to Fselect_frame. * emacs.c (main): Call keys_of_frame. * keymap.c (initial_define_lispy_key): New function, for defining non-ascii keys. * ymakefile: Note that frame.o depends on commands.h and keyboard.h. * callint.c (Fcall_interactively): Allow multiple 'e' specs. (Finteractive): Doc fix. * keyboard.h (this_command_keys, this_command_key_count): Added external declarations. * keymap.c (access_keymap): Treat bindings for Qt as default bindings, when new argument T_OK is non-zero. (get_keyelt, Fdefine_key, Flookup_key): Call access_keymap with T_OK false. * keyboard.c (follow_key, read_key_sequence): Call access_keymap with T_OK true. * keyboard.c (apply_modifiers): Copy the value of BASE's Qevent_kind property to the new symbol. * keyboard.c (syms_of_keyboard): Qevent_kind should be initialized to intern ("event-kind"), not intern ("event-type"). 1992-10-10 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c (Fwrite_region): If VISIT is a file name, use that as file name to visit, and print it in the message. Use it for file locking too. * m-ibmps2-aix.h [__GNUC__ >= 2] (LIB_STANDARD): Don't define. 1992-10-09 Jim Blandy (jimb@totoro.cs.oberlin.edu) * ymakefile (FLOATSUP): Renamed to FLOAT_SUPPORT. (FRAME_SUPPORT, VMS_SUPPORT): New macros. (lisp): Rebuild this from loadup.el, using the _SUPPORT macros. * ymakefile [HAVE_X_WINDOWS, not NO_X_MENU, HAVE_X11] (LIBXMENU): Link against -loldX, to get the association table functions. * xterm.c, xrdb.c: #include <stdio.h> before "xterm.h", to avoid warnings about redefining NULL under GCC 2.2.2. 1992-10-09 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m/pyrmips.h: New file. * s/aix3-1.h (PTY_ITERATION, etc.): Defined. (FIRST_PTY_LETTER): Deleted. 1992-10-07 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * m/sparc.h: Include <sys/param.h>, to define the FSCALE constant. * ymakefile (YMF_PASS_LDFLAGS): Refer to the prefix-args program using "./prefix-args", not just "prefix-args"; some people don't have . in their paths. 1992-10-06 Richard Stallman (rms@mole.gnu.ai.mit.edu) * link.com: Use gcclib if compiling with GCC. * fileio.c (directory_file_name): Don't clobber the envvar when handling top-level rooted dir. * ymakefile (LIB_STANDARD): If ORDINARY_LINK, default this to empty. * m/ibmps2-aix.h [USG_SHARED_LIBRARIES]: Define ORDINARY_LINK. Undef LIB_STANDARD. Modify LD_SWITCH_MACHINE. * unexnext.c: New file. * emacs.c (main) [NeXT]: Call malloc_jumpstart. 1992-10-05 Richard Stallman (rms@mole.gnu.ai.mit.edu) * window.c (window_loop): Pass 2nd arg to Fother_buffer. * frame.c (make_frame): Likewise. * callint.c (Fcall_interactively): Likewise. * buffer.c (Fkill_buffer): Likewise. (Fswitch_to_buffer, Fpop_to_buffer, Fbury_buffer): Likewise. 1992-10-03 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (read_key_sequence): Treat mouse clicks on non-text. * alloc.c (Fmemory_limit): New function. (syms_of_alloc): Defsubr it. * window.c (SAVE_WINDOW_DATA_SIZE): Define this using sizeof, instead of just saying it's 7; that way, we won't get screwed if we add members to struct save_window_data. * window.c (struct save_window_data): Save the currently selected frame, too. (Fset_window_configuration): Restore the frame's selected window using Fselect_window, and then restore the selected frame using Fselect_frame. (Fcurrent_window_configuration): Record the currently selected frame. Update docstring to describe the information now recorded. 1992-10-02 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * process.c (wait_reading_process_input): Ultrix select seems to return ENOMEM when interrupted. So, under Ultrix, treat ENOMEM like EINTR. * keyboard.c (modifier_names): The modifier is named "control", not "ctrl". * keyboard.c (modify_event_symbol): Make sure that the unmodified event header gets the proper properties set on it, by recursing and letting the same code build the properties for all event symbols. * keyboard.c (Qmouse_click): Fix typo which assigned `mouse-click' symbol to Qmouse_movement. 1992-10-02 Richard Stallman (rms@mole.gnu.ai.mit.edu) * undo.c (Fprimitive_undo): When undoing an insert, move point and then delete. 1992-10-02 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * intervals.c: `copy_intervals' no longer static. * intervals.h: Declare `copy_intervals'. * buffer.c: #include intervals.h. * ymakefile: New macro "INTERVALS", controlled by "USE_INTERVALS", which defines the interval include file "intervals.h". New entries for "intervals.c" and "textprop.c". * lisp.h: Declare Qbuffer_or_string_p. 1992-10-02 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xterm.c (x_find_modifier_meanings): If there are no. * window.c (Fset_window_configuration): Clean up the way we save and restore the frame's size. * termhooks.h (struct input_event): Doc fix. (NUM_MOUSE_BUTTONS): New constant. (click_modifier): New modifier. (NUM_MODIFIER_COMBOS): Removed. * keyboard.h (EVENT_HAS_PARAMETERS): Definition changed - all events.c (echo_char, read_char): Apply EVENT_HEAD without first testing for EVENT_HAS_PARAMETERS; EVENT_HEAD works properly on all sorts of events now. (read_key_sequence): Use the new accessors to decide in which window an event occurred. * keymap.c (access_keymap, store_in_keymap, Fsingle_key_description): No need to check for EVENT_HAS_PARAMETERS before using EVENT_HEAD; the latter now works properly on all sorts of events. * keyboard.c (Qevent_unmodified): Replaced by... (Qevent_symbol_elements): New property. (syms_of_keyboard): Initialize and staticpro the latter, not the former. * keyboard.h (Qevent_unmodified): Extern declaration replaced by... (Qevent_symbol_elements): This. (EVENT_HEAD_UNMODIFIED): Use the Qevent_symbol_elements property, rather than the Qevent_unmodified property. *. * xmenu.c: #include "keyboard.h". (Fx_popup_menu): Use the event accessors defined in keyboard.h, instead of writing out cars and cdrs. * ymakefile: Note that xmenu.o depends on keyboard.h. 1992-10-02 Joseph Arceneaux (jla@wookumz.gnu.ai.mit.edu) * textprop.c: Conditionalize all functions on "USE_TEXT_PROPERTIES". * intervals.c: Conditionalize all functions on "USE_TEXT_PROPERTIES". Removed #include of "screen.h". * alloc.c: #include "intervals.h". (init_intervals, make_interval, mark_interval, mark_interval_tree): New functions conditionally defined. (make_uninit_string): Call INITIALIZE_INTERVAL. (INIT_INTERVALS, UNMARK_BALANCE_INTERVALS, MARK_INTERVAL_TREE): New macros, conditionally defined. (mark_object): Call MARK_INTERVAL_TREE in case Lisp_String. (gc_sweep): If text properties are in use, place all unmarked intervals on the free list. Call UNMARK_BALANCE_INTERVALS on `buffer->intervals' when unmarking `buffer'. (compact_strings): Include INTERVAL_PTR_SIZE in calculation for target of bcopy when relocating strings. (init_alloc_once): Call INIT_INTERVALS. (make_pure_string): Include INTERVAL_PTR_SIZE in calculation of `size'. Moved static declaration of `mark_object' and other functions up in the file. * fileio.c (Finsert_file_contents): Call offset_intervals if text was actually inserted. #include "intervals.h". 1992-09-30 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * data.c: Qbuffer_or_string_p added. * syntax.c (describe_syntax): Use insert_char to insert `match'. * buffer.c (reset_buffer): Do INITIALIZE_INTERVAL on the buffer's interval component. (Fkill_buffer): Likewise. * editfns.c (make_buffer_string): Call copy_intervals_to_string. (Finsert_buffer_substring): Call graft_intervals_into_buffer. #include "intervals.h". * insdel.c: #include "intervals.h" (prepare_to_modify_buffer): Call verify_interval_modification. (insert_from_string): Call offset_intervals and graft_intervals_into_buffer. (del_range): Call offset_intervals. (insert): Call offset_intervals. * emacs.c: #include "intervals.h". (main): Call syms_of_textprop. This is only really present if Emacs is compiled with USE_TEXT_PROPERTIES defined. * buffer.h: New macro TEMP_SET_PT. If intervals are used, SET_PT and TEMP_SET_PT are function calls. Similarly for BUF_SET_PT and BUF_TEMP_SET_PT. Added DECLARE_INTERVALS to buffer structure to conditionally compile an interval tree into it. * intervals.h: Declare temp_set_point. 1992-09-30 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * ymakefile (config.h): Doc fix. 1992-09-30 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * config.h.in: Added a slot for definition of USE_TEXT_PROPERTIES, controlling compilation of interval code. If using GNUC, support inline functions. * lisp.h: Conditionally define interval structure and macros. Add DECLARE_INTERVALS to struct Lisp_String. 1992-09-30 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * buffer.c (Fother_buffer): Add back the VISIBLE_OK argument. It got removed with no comment or ChangeLog entry, and append-to-buffer uses it. * window.c (struct save_window_data): Add a member called focus_frame, to save and restore the screen's focus frame. (Fset_window_configuration): Redirect the frame's focus as indicated in the window configuration. (Fcurrent_window_configuration): Record the frame's current focus. * minibuf.c (read_minibuf): Don't bother to save the current frame's focus, and have read_minibuf_unwind restore it; saving and restoring the window configurations will take care of that. (read_minibuf_unwind): Don't worry about restoring the frame's focus. * window.c (Fset_window_configuration): Don't select the frame just because we restored its configuration. * window.c (Fset_window_configuration): Don't forget to set the frame's selected window when we can't call Fselect_window. * xterm.c (x_meta_mod_mask): New variable, indicating which X modifier bits denote meta keys. (x_find_modifier_meanings): New function, to set x_meta_mod_mask. (x_convert_modifiers): Use that. (x_term_init): Call x_find_modifier_meanings. * data.c (Fmake_local_variable): If SYM forwards to a C variable, swap in the value for the current buffer immediately. * lisp.h: Doc elaboration for Lisp_Buffer_Local_Value. 1992-09-29 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * textprop.c (Ferase_text_properties): Merge intervals when possible. 1992-09-29 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xselect.c (Qcut_buffer0): Symbol removed; we're using a new. * keymap.c (access_keymap): Don't forget to QUIT while scanning the keymap. * keyboard.c (recent_keys): This needs to be staticpro'ed. Change it from a C array, which is a pain in the neck to staticpro, into a lisp vector, which is easier. (read_char, Frecent_keys): Access recent_keys as a lisp vector, not a C array. (syms_of_keyboard): Set recent_keys to be a vector, and staticpro it. * ymakefile (xfns.o): This doesn't depend on xselect.c. * xterm.h (ROOT_WINDOW): Use the DefaultScreen macro, not the XDefaultScreen function. * frame.c (Fdelete_frame): Call Fselect_frame with the appropriate number of arguments. * data.c (Frem): Use the `fmod' function under SunOS, Ultrix, and HP/UX, not just under USG systems. * buffer.c (Fbury_buffer): This used to undisplay the buffer being. 1992-09-28 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * frame.c (Fselect_frame, Fframe_root_window) (Fframe_selected_window, Fnext_frame, Fmake_frame_visible) (Fmake_frame_invisible, Ficonify_frame): Doc fixes. * ralloc.c: Since the users of the relocating allocation code. 1992-09-28 Richard Stallman (rms@mole.gnu.ai.mit.edu) * insdel.c (del_range): Call record_delete before updating point. * fileio.c (Finsert_file_contents): Do record_insert, then inc MODIFF. * undo.c (record_delete): Record pos before the deletion. (Fprimitive_undo): Go back to recorded position. 1992-09-28 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) *". 1992-09-27 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (read_char): If we're returning an event from a macro, set Vlast_event_frame to Qmacro, instead of leaving it set to the frame of the previous real event. (read_key_sequence): If Vlast_event_frame isn't a frame, don't bother switching buffers. (syms_of_keyboard): Doc fix for Vlast_event_frame. (Vlast_event_frame): Doc fix. * termhooks.h (alt_modifier, hyper_modifier, super_modifier) (down_modifier, drag_modifier): New modifiers, to support the new input system. Re-arranged modifiers so that their bits are in canonical order; this makes reorder_modifiers slightly simpler. * keyboard.c (format_modifiers, reorder_modifiers): Handle the new modifier bits. * keymap.c (access_keymap): Remove code to notice bindings for Qt. 1992-09-25 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xmenu.c (single_keymap_panes): Handle vectors properly. 1992-09-25 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keymap.c (Fwhere_is_internal): Don't forget to advance map to the next element when we find something that is neither a vector nor a cons. Don't forget to QUIT in the appropriate places, either. 1992-09-23 Joseph Arceneaux (jla@geech.gnu.ai.mit.edu) * textprop.c (Fset_text_properties): Merge adjacent intervals with the same properties. (Fnext_single_property_change, Fprevious_single_property_change): New subrs. * intervals.c (merge_interval_left, merge_interval_right): Abort if caller tries to merge first (or last, respectively) interval. Delete the interval node after merging. (copy_intervals): Use `split_interval_right' rather than creating new intervals with make_new_interval and attaching them explicitly. (verify_interval_modification): Changed error message. GCPRO hooks before calling Fnreverse, and correctly Fcdr down the list. Also, don't cons multiple copies of the same consecutive modification hook. (temp_set_point): New function. (set_point): Call point-left and point-entered hooks if moving between text with different properties. Use the old and new positions as arguments to these calls. * intervals.c, intervals.h (map_intervals, make_buffer_interval) (make_string_interval, run_hooks): Deleted. 1992-09-23 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keymap.c (DENSE_TABLE_SIZE): Doc fix. (keymap_table): Function removed; this function exists only to support an incorrect understanding of the format of keymaps. (access_keymap, store_in_keymap, Fcopy_keymap) (Faccessible_keymaps): Correctly handle vectors at any point in the keymap; don't assume it must be at the front. (describe_map): Instead of calling describe_vector on the vector in the cadr of the keymap (if present) and then calling describe_alist to do the rest, just call describe_map_2. (describe_alist): Renamed to describe_map_2; call describe_vector when we encounter a vector in the list. * xmenu.c (single_keymap_panes): Comment out the code which tries to handle a dense keymap's table; it uses keymap_table, and the rest of the code never uses the table contents anyway. * keymap.c (access_keymap, store_in_keymap): Clarify error message for non-ASCII characters. * process.c [SIGCHLD && !BSD && !UNIPLUS && !HPUX] (create_process): #if 0 out the code which sets the child's handler for SIGCHLD to sigchld; the code which gives sigchld its value has been diked out under these CPP symbols, so this should be diked out too. * indent.c (Fmove_to_column): Pass the right number of arguments to Findent_to. 1992-09-22 Jim Blandy (jimb@kropotkin.gnu.ai.mit.edu) * emacs.c (emacs_priority): Doc fix. (main): Use nice, not setpriority; we just need a simple, portable call to nice here. * callproc.c (child_setup): Use nice, not setpriority. * sysdep.c (sys_suspend): Don't try to use "nice (- nice (0))" to set the subshell's priority to normal; nice doesn't return a defined value on all systems. Instead, since emacs_priority gives the priority that Emacs was nastied to, we can use it to reset the priority in a straightforward way. [BSD4_1], [USG], [VMS] (setpriority): Remove dummy and compatibility definitions of setpriority. * keymap.c (access_keymap): Return the binding of Qt as the binding for all unbound characters. * fileio.c (syms_of_fileio): Don't try to defsubr Sunix_sync unless it's actually been defined - that is, if unix is #defined. * xrdb.c (x_get_resource): Cast the value being assigned to ret_value->addr, rather than ret_value->addr itself; only GCC allows you to cast lvalues. *. 1992-09-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * alloc.c (mark_object): Avoid car recursion on cons with nil in cdr. Avoid recursion on constants-vector of a compiled function. * oldXMenu: Symlink deleted; anything that uses it needs fixing in any case to work properly on systems without symlinks. 1992-09-20 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/sol2.h: New file. * fileio.c: Don't include sys/dir.h. * s/usg5-4.h (LIBS_SYSTEM): Move non-default libraries here. (LIB_STANDARD, START_FILES): Deleted. (ORDINARY_LINK): Defined. * ymakefile [ORDINARY_LINK]: Default LD to $(CC) and make START_FILES and LIB_STANDARD empty. (C_SWITCH_X_MACHINE, C_SWITCH_X_SYSTEM): New macros, default empty. (CFLAGS): Use them. 1992-09-19 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (${etc}DOC): Use OBJECTS_SYSTEM and OBJECTS_MACHINE. * dired.c [VMS]: Include string.h, rms.h, rmsdef.h. [VMS] (Ffile_version_limit): New function. * sysdep.c (sys_suspend): Read EMACS_PARENT_PID envvar for parent. * syntax.c (scan_lists): When searching back for comment: if comment-end is 2 chars, assume it does end a comment. Otherwise, scan back to previous comment-end to see if there's a comment starter between. Also record whether the string quotes between the start and the end are paired and uniform. If so, skip to comment starter. If not, scan from start of defun to find comment starter if any. (find_defun_start): New function. * alloc.c (mark_object): Save last 500 values of objptr. Check for clobberage of ptr, when marking a vector. 1992-09-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keymap.c (get_keyelt): Skip menu help string after menu item name. 1992-09-18 Jim Blandy (jimb@pogo.cs.oberlin.edu) * buffer.c (Fget_buffer_create): Doc fix. * lisp.h (struct handler): Remove the poll_suppress_count member of this structure; it is always equal to the poll_suppress_count of its catchtag structure. The non-local exit code in eval.c is difficult enough to understand as it is; needless duplication doesn't help. * eval.c (Fcondition_case): Rearranged for clarity. Don't worry about setting h.poll_suppress_count; it's guaranteed to be the same as c.poll_suppress_count. (internal_condition_case): Don't worry about h.poll_suppress_count. (Fsignal): Use h->tag->poll_suppress_count instead of h->poll_suppress_count. * eval.c (Fsignal): It's okay for the debugger to return to the caller if the caller was signalling a quit. * eval.c (unbind_catch): Restore the polling suppression count here, instead of in Fsignal and Fthrow. (Fthrow, Fsignal): Don't restore the polling suppression count here. * lisp.h (struct specbinding, struct handler): More documentation. * eval.c (struct catchtag): More documentation. 1992-09-17 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (LIBX): Don't use -loldX. 1992-09-17 Jim Blandy (jimb@pogo.cs.oberlin.edu) * minibuf.c (get_minibuffer): Enable undo in minibuffers. 1992-09-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (LIBXMENU): Check NO_X_MENU, not HAVE_X_MENU * emacs.c (main): Use X menu code if HAVE_X_WINDOWS and not NO_X_MENU. * keyboard.c (read_char_menu_prompt): Likewise. * config.h.in: Delete everything about config.h. * emacs.c: Eliminate HIGHPRI as compilation option. (emacs_priority): New C variable, also Lisp variable. (main): Set the priority iff emacs_priority is nonzero. 1992-09-14 Jim Blandy (jimb@pogo.cs.oberlin.edu) * eval.c (entering_debugger): Variable renamed when_entered_debugger, and is now a timestamp based on num_nonmacro_input_chars. (init_eval): Initialize when_entered_debugger, not entering_debugger. (call_debugger): Set when_entered_debugger to the current value of num_nonmacro_input_chars. (find_handler_clause): Don't call debugger unless num_nonmacro_input_chars is greater than when_entered_debugger; that way, we won't call the debugger unless the user has had a chance to take control. (Fbacktrace): Don't clear entering_debugger here. * keyboard.h (num_nonmacro_input_chars): Added extern declaration for this. * fns.c (Fy_or_n_p): After testing for a QUIT, clear Vquit_flag. Otherwise, if Fy_or_n_p is called while Vinhibit_quit is true and the user presses C-g, this function goes into an infinite loop. * dispnew.c (get_display_line): Don't abort if the frame is invisible; since unmap events are handled at the interrupt level, a screen may become invisible at any time. 1992-09-13 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c (Fverify_visited_file_modtime): Pass buffer itself to handler, if have handler. (Fwrite_region): GCPRO around Fexpand_file_name, Ffile_name_directory. (Fread_file_name_internal): GCPRO around file name manip. (Ffile_writable_p, Ffile_readable_p): Use abspath, not filename, (Ffile_executable_p, Ffile_exists_p): to run the handler. (Fset_file_modes, Ffile_directory_p, Ffile_modes): Likewise. (Ffile_newer_than_file_p): GCPRO around expand_and_dir_to_file. 1992-09-13 Jim Blandy (jimb@pogo.cs.oberlin.edu) * s/bsd4-3.h: Give the BSD4_3 and BSD symbols the same numeric definitions they'll get in <sys/param.h>, to avoid warnings. * m/hp9000s300.h: Don't include <sys/wait.h>. This really shouldn't be necessary. (BIG_ENDIAN): Define this as "4321", to agree with <machines/endian.h>, and avoid warnings. * systime.h: Re-arrange inclusion of <sys/time.h> and <time.h> so that they don't both get included under BSD, and do both get included under AIX. * xdisp.c (display_mode_line): If the only other frames are minibuffer frames, don't name the frame after the in the selected window. We can use Fnext_frame to do this test easily. 1992-09-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * process.c (Faccept_process_output): Initialize useconds. * keyboard.c (num_nonmacro_input_chars): New variable. (read_char): Use num_nonmacro_input_chars to decide on auto-save & gc. Increment it when appropriate. (record_auto_save): Use num_nonmacro_input_chars. * fileio.c (Ffile_name_directory, Ffile_name_nondirectory): (Ffile_name_as_directory, Fdirectory_file_name, Fexpand_file_name): Call find_file_handler. (syms_of_fileio): Set up Qfile_name_directory, etc. (Fcopy_file): Call find_file_handler for newname as well as for filename. (syms_of_fileio): Initialize Vfile_name_handler_alist. 1992-09-11 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callint.c (Fcall_interactively): Remove the 'K' interactive code, in favor of 'e'; that's a better name. 1992-09-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s/esix5r4.h: New file. * sysdep.c (init_sys_modes): Handle VDSUSP like V_DSUSP. Use CDISABLE, not CDEL. Turn off IEXTEN if it exists. * systty.h (CDISABLE): New macro; may be defined from CDEL. * keyboard.c (command_loop_1): Bind inhibit-quit to t when in Fsit_for. 1992-09-10 Jim Blandy (jimb@pogo.cs.oberlin.edu) * Makefile.in: Add comments starting with "# DIST: " explaining that this gets munged by the configure script. 1992-09-10 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s-aix3-1.h (HAVE_GETHOSTNAME): Defined. 1992-09-09 Jim Blandy (jimb@pogo.cs.oberlin.edu) * frame.c (choose_minibuf_frame): Abort if the selected frame has nil in its minibuffer_window slot; this shouldn't happen any more. * window.c (minibuffer_window): Accept an optional FRAME argument; if specified, return the minibuffer used by that frame. * keymap.c (describe_buffer_bindings): Adjust key_heading to match the format used by describe_map_tree. Also, don't reprint the "key binding" header above the global bindings if we've already printed it for the local bindings; it's clear enough that the columns mean the same thing as above. 1992-09-08 Jim Blandy (jimb@pogo.cs.oberlin.edu) * ralloc.c (r_re_alloc): Instead of allocating a new bloc at the end of the heap, copying the data to it, and then freeing the original bloc, just expand the original block. This saves a copy and a call to sbrk, and also removes the large spike in memory allocation that would occur when resizing large buffers. And it's less code. * keyboard.h (Vkeyboard_translate_table): Declare this extern here, so describe_buffer_bindings can use it. * keymap.c (describe_buffer_bindings): Declare buf and bufend... 1992-09-05 Jim Blandy (jimb@pogo.cs.oberlin.edu) * systime.h: Always #include <time.h>, not just when NEED_TIME_H is defined. It gets us struct tm. #include <sys/time.h> whenever HAVE_TIMEVAL is defined and NEED_TIME_H isn't. * systime.h: Note that the tz_dsttime field of the struct timezone returned by gettimeofday doesn't say whether daylight saving is _currently- active; rather it specifies whether it is *ever* active. (EMACS_GET_TZ_OFFSET_AND_SAVINGS): Removed `savings_flag' argument, and renamed to EMACS_GET_TZ_OFFSET. Don't try to extract savings information. EMACS_CURRENT_TIME_ZONE should call localtime to figure out whether DST is active. * m/hp9000s300.h: #include <sys/wait.h> before doing anything else, to avoid conflicts between the system's and Emacs's definitions of BIG_ENDIAN. * keymap.c (describe_buffer_bindings): Set the current buffer to descbuf before calling current_minor_maps; that function's value depends on the values of buffer-local variables. Don't set the current buffer to Vstandard_output until afterwards. * keymap.c (describe_buffer_bindings): If Vkeyboard_translate_table is in effect, describe its effects. * frame.c (Fnext_frame): Doc fix. * frame.c (prev_frame): #if 0'd out; nobody uses this. * frame.c (next_frame): The logic which determines whether a frame is acceptable to return was misarranged; rewrote it. (prev_frame): Same thing. 1992-09-05 Richard Stallman (rms@mole.gnu.ai.mit.edu) * syntax.c (scan_lists): Improve smarts for backwards scan of comments. Don't modify comstyle inside that loop. If string quotes don't match up, don't take value from OFROM; instead, parse forward using scan_sexps_forward. (scan_sexps_forward): Return value via a pointer passed in. New element in state contains char addr of last comment-starter seen. (Fparse_partial_sexp): Change call to scan_sexps_forward. 1992-09-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xmenu.c (xmenu_show): If no panes, just return. * keyboard.c (last_nonmenu_event): New var. (syms_of_keyboard): New Lisp var. (read_key_sequence): Use that instead of prev_event. * commands.h (last_nonmenu_event): Declared. * callint.c (Fcall_interactively): For `K', use last_nonmenu_event. Make `e' alias for `K'. 1992-09-03 Jim Blandy (jimb@pogo.cs.oberlin.edu) * editfns.c (Fcurrent_time_string): Change docstring to indicate that we will probably add the timezone to the end, now that we have it available on many systems. * xrdb.c: Don't include <X11/Xos.h>. Under R4, it stupidly insists on defining SIGCHLD, even if it already has a definition. (file_p): Use the constant 4 instead of R_OK; empirically, the number is more portable than the symbol if you count the #include hair you have to go through to get R_OK defined. Ffile_readable_p does this too. * xterm.c (x_wm_set_size_hint): Set the base_width and base_height members of size_hints, if they're available (X11R4 and after); otherwise, approximate the right thing, by using min_width and min_height as the base size. 1992-09-02 Barry A. Warsaw (warsaw@anthem.nlm.nih.gov) Extended syntax.c in the following ways to support up to 2 orthogonal comment styles per mode. This is needed for C++. Bit 6 of syntax table entry for a character indicates it is part of the `b' comment style. Otherwise it is part of the `a' style. * syntax.h (SYNTAX_COMMENT_STYLE): New macro. * syntax.c (Fmodify_syntax_entry): Set that flag for `b'. (describe_syntax): Print the `b' flag. (scan_lists, scan_sexps_forward): Handle the new flag. (Fparse_partial_sexp): Return new element in value. 1992-09-02 Roland McGrath (roland@geech.gnu.ai.mit.edu) * fileio.c (syms_of_fileio): Doc fix for Vfile_name_handler_alist. 1992-09-02 Jim Blandy (jimb@pogo.cs.oberlin.edu) * keyboard.c (kbd_buffer_get_event): When performing the FRAME_FOCUS_FRAME redirection, don't modify the frame field of the event; that fatally corrupts mouse click events. Instead, just perform the redirection on the value assigned to Vlast_event_frame. *. * window.c (Fset_window_configuration): Don't signal an error if the frame size saved in the window configuration doesn't match the frame's current size; instead, temporarily resize the frame while installing the window configuration. This is important because using the minibuffer saves and restores the current window configuration, and you don't want to signal an error just because the user resized the frame while using the minibuffer. * doc.c (Fsnarf_documentation): Signal an error if this is called in a dumped Emacs. * alloc.c (mark_object): Mark a symbol's name after marking its value, function, and property list rather than before; this way, symbols' names are readable, giving us a chance to detect some kinds of heap corruption. 1992-09-02 Richard Stallman (rms@mole.gnu.ai.mit.edu) * emacs.c (__main, __do_global_dtors): New dummy functions. (__do_global_ctors_aux, __do_global_ctors): Fix typo in fn names. 1992-09-01 Jim Blandy (jimb@pogo.cs.oberlin.edu) * prefix-args.c: New file. See comment at top of file. * ymakefile (YMF_PASS_LDFLAGS): Use the prefix-args program to affix the -Xlinker prefix to the linker arguments. (prefix-args): New target. (temacs): Depend on prefix-args. * xterm.c (x_catch_errors): Don't forget to initialize x_caught_error_message to the null string, so x_check_errors can tell when an error has occurred. * unexmips.c (mark_x): Declare this as static void at the top of the file and at the function definition. * keyboard.c (input_available_signal): Declare this to return SIGTYPE. * xrdb.c (getuid): Declare this to return short. * s/bsd4-3.h: Remove definition of SIGTYPE macro; Mt. Xinu says it's int, but Ultrix says it's void. Since the SIGTYPE guessing code in the `configure' script gives the correct answer for both of these cases, there's no point in listing it here. * systime.h (EMACS_CURRENT_TIMEZONE): Change documentation to indicate that *OFFSET should be set to the number of minutes EAST of Greenwich, which is what Ed Reingold says real time gurus want. Changed the definition of the EMACS_GET_TZ_OFFSET_AND_SAVINGS macro to reflect this. Buggily, the Fcurrent_time_zone function was already expecting minutes east of GMT. * Makefile.in (distclean): Remove backups from the `m' and `s' directories, too. * m/mips.h: Merge changes from Emacs 18.58: [NEWSOS5]: Changes so this file can be used with s/newsos5.h. (SIGN_EXTEND_CHAR): Define this using a cast to signed char. I guess the MIPS compiler and its derivatives all have this type. (HAVE_ALLOCA, C_ALLOCA): Define the former if we're compiling with GCC, and the latter otherwise. (C_SWITCH_MACHINE): Defined, instead of C_SWITCH_SYSTEM. (LINKER): Defined, if BSD. (XUINT, XSET, XUNMARK): Add parentheses to eliminate warnings from GCC. Reindent to fit in 80 columns. INHIBIT_BSD_TIME prevents including bsd/sys/time.h. * s/newsos5.h: New file for Sony NEWS-OS release 5, courtesy of Chris Hanson <cph@klia.ai.mit.edu>. * m/mips.h: Don't undefine LOAD_AVE_TYPE; the comment says that Emacs 19 has the crocks to handle it properly. * m/pmax.h: Merge changes from Emacs 18.58: (LIB_STANDARD, COFF, TERMINFO): Cancel out definitions from m/mips.h which are only appropriate for USG. (MAIL_USE_FLOCK, HAVE_UNION_WAIT): Do define these. (BROKEN_O_NONBLOCK): Defined. (LINKER): Don't define this. [OSF1]: Undef C_ALLOCA, define HAVE_ALLOCA. * s/osf1.h: New file. * s/bsd4-3.h: Merge changes from Emacs 18.58: (BSD, BSD4_3): Just define these, don't fret about numerical values or version numbers. * m/hp9000s300.h: Merge changes from Emacs 18.58, and hp300bsd.h: Change configuration note to say it's okay to use this file for BSD. Add comment saying that NOMULTIPLEJOBS must be defined for versions of HP/UX before 6.5. Don't define BIG_ENDIAN if it seems that <endian.h> has already done so. [BSD4_3] Define m68000, instead of hp9000s300; crt0.c uses these to decide what sort of startup code to use. [not BSD4_3] Under HP/UX, always define the BSD memory functions (bcopy, bzero, and bcmp) in terms of the SYSV string functions (memcpy, memset, and memcmp), not just under HP/UX 5; version 6's BSD compatibility library has reported bugs in `signal'. (NEED_BSDTTY): Move this symbol's definition inside the "not BSD4_3" conditional, since it's only relevant to HP/UX. * m/hp300bsd.h: File deleted, since m/hp9000s300.h now works with both HP/UX and BSD; it includes m/hp300bsd.h's specifications. * m/hp9000s300.h: Remove definition for SIGN_EXTEND_CHAR; this is only used by the regexp code, which has its own portable definition these days. 1992-08-31 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keymap.c (Fmake_sparse_keymap): New optional arg. Callers changed. (Fmake_keymap): Likewise. * emacs.c (__do_global_ctors, __do_global_ctors_aux): New dummy fns. (__CTOR_LIST__, __DTOR_LIST__): New dummy variables. * fileio.c (Fdo_auto_save): Always call record_auto_save. * keyboard.c (read_char): Call read_char_menu_prompt here. Accept 4 new args to pass to it. Include them in recursive call. Don't delay before starting echo if prev_event was a mouse event. Test for eof in batch mode now understands C is a Lisp_Object. (read_key_sequence): Don't call it here; always call read_char. Don't change last_event_buffer after a mouse menu input. (read_char_menu_prompt): Arg PROMPT deleted. Return nil if nothing to do. * xmenu.c (Fx_popup_menu): Treat coords relative to spec'd window. (single_keymap_panes): New function; contains guts of keymap_panes. If a command binding for submenu has a prompt string starting with @, make a separate pane for it at this level. * xfns.c (Fx_track_pointer): Pass new args to read_char. (Fx_select_region, Fx_horizontal_line): Likewise. * lread.c (Fread_char): Pass new args to read_char. (Fread_event, Fread_char_exclusive): Likewise. * fns.c (Fy_or_n_p): Pass new args to read_char. 1992-08-30 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (read_key_sequence): Keep track of prev_event. Pass new proper args to read_char_menu_prompt. (read_char_menu_prompt): New arg prev_event. Use Fx_popup_menu. Handle any number of keymaps, not just LOCAL and GLOBAL. Invert meaning of arg PROMPT. Test of menu_prompting was backwards. * keymap.c (keymap_table): No longer static. * xmenu.c (keymap_panes): New function. (Fx_popup_menu): Accept keymap or list of keymaps as MENU argument. Accept mouse button event as POSITION argument. 1992-08-29 Richard Stallman (rms@mole.gnu.ai.mit.edu) * cmds.c (internal_self_insert): Assume Fexpand_abbrev expanded something if it incremented MODIFF. 1992-08-28 Richard Stallman (rms@mole.gnu.ai.mit.edu) * unexmips.c (unexec): Allow sections in any order. Adjust addresses of rdata section as well as data section. * buffer.c (syms_of_buffer): Made buffer-display-table, buffer-field-list and buffer-undo-list allow any type of value. 1992-08-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fns.c (Fappend): Doc fix. 1992-08-24 Jim Blandy (jimb@pogo.cs.oberlin.edu) * s/usg5-4.h: Incorporate changes from 18.58: (LIBX10_SYSTEM): Undefine this. (GNULIB): Definition deleted -- done in ymakefile. (LIB_STANDARD): Don't use GNULIB. (HAVE_TCATTR): Defined. * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user hasn't specified the icon position. Let the window manager put the icon where it likes. * xterm.c (x_make_frame_invisible): Don't forget to check the return value of XWithdrawWindow; it could indicate that the window wasn't successfully redrawn. * sysdep.c (init_baud_rate): Re-arranged order of conditionals - test TERMIOS before TERMIO; when two options might both be defined, test the most recent first, so that the most recent functions get used. * sysdep.c [HAVE_TERMIO] (init_baud_rate): Don't use tcgetattr unless HAVE_TCATTR is defined. Only very rarely do termio systems have the tc{get,set}attr macros. * window.c (coordinates_in_window): Do not assume that all one-line windows are the minibuffer, or that all minibuffers are one line high. Use MINI_WINDOW_P. * systerm.h: Renamed to systty.h, to be more consistent with everything else in Unix. * dispnew.c, emacs.c, keyboard.c, process.c, sysdep.c: #include directive changed. * ymakefile: References to systerm.h changed. * s/usg5-3.h: Merged changes from 18.58: (HAVE_SYSV_SIGPAUSE): Defined. (BROKEN_TIOCGETC): Defined. 1992-08-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * process.c (WCOREDUMP): Define only if not defined. (create_process) [HAVE_SETSID]: Use TIOCSCTTY if exists. 1992-08-20 Jim Blandy (jimb@pogo.cs.oberlin.edu) * fileio.c (Fdo_auto_save): Call Fsleep_for with the appropriate number of arguments. * fns.c (Fyes_or_no_p): Same. * dispnew.c (update_frame): Change the way we handle cursor_in_echo_area. Firstly, ignore this if the frame we're updating doesn't have a minibuffer. Secondly, don't handle the selected frame specially. Thirdly, don't assume that the minibuffer is only one line high. If cursor_in_echo_area < 0, put the cursor in the upper-left corner; if cursor_in_echo_area > 0, put it on the lowest non-empty line in the minibuffer window, or on the top line. * dispnew.c (direct_output_for_insert): Fail if cursor_in_echo_area is set; we don't want to do the typing there. (direct_output_for_insert): Same. 1992-08-19 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c (x_make_frame_invisible): Use XWithdrawWindow when available [HAVE_X11R4]; send the UnmapNotify event when appropriate [HAVE_X11]; just unmap the window if that's all that's needed [not HAVE_X11]. * xterm.c (x_set_text_property): Removed; it's only called from one place. Who wants *another* layer of indirection? * xfns.c (x_set_name): Use XSetWM{Name,IconName} when available [HAVE_X11R4], or XSetIconName and XStoreName otherwise. * xterm.h (FRAME_X_WINDOW): New macro, for readability. * xterm.c, xfns.c, xselect.c: Use it. * emacs.c (Fkill_emacs): Doc fix. (syms_of_emacs): Doc fix for Vkill_emacs_hook. * xterm.c (x_death_handler): Renamed to x_connection_closed. (x_term_init): Use x_connection_closed as the SIGPIPE handler. * xterm.c (acceptable_x_error_p, x_handler_error_gracefully, x_error_handler): Removed; you can't catch X errors this way, since you can't perform X operations from within an X error handler, and even though we call error, we're still within an X error handler. (x_error_quitter, x_error_catcher): New functions, for panicking on and catching X protocol errors. (x_caught_error_message): Buffer for caught X errors. (x_catch_errors, x_check_errors, x_uncatch_errors): New functions for catching errors. (x_term_init): Set the error handler to x_error_quitter, rather than x_error_handler. * xfns.c (x_set_mouse_color): Use x_catch_errors, x_check_errors, and x_uncatch errors to avoid crashing if the user selects an odd cursor. * xterm.c (x_proto_requests): Removed; it's not important. * xterm.c (events): Array removed; it's not used. * xfns.c (select_visual): Use XVisualIDFromVisual when available [HAVE_X11R4]. * xrdb.c (get_user_db): Use XResourceManagerString when available [HAVE_X11R4]. * window.c (change_window_height): If the size of the window will shrink below the minimum, this code would only try to delete it if it had a parent. Well, even if the window doesn't have a parent, you want Fdelete_window to signal an error, since you're trying to resize one of the undeleteable windows into nothingness. So call Fdelete_window even if the window doesn't have a parent. * window.c (MINSIZE): Add kludge so that the minibuffer is always allowed to shrink to one line in height. (MINSIZE, CURBEG, CURSIZE): Change these so that their argument are always Lisp_Objects, not struct window *'s. (change_window_height): Changed accordingly. 1992-08-18 Jim Blandy (jimb@pogo.cs.oberlin.edu) * frame.h (struct frame): New member - explicit_name. * frame.c (make_frame): Clear it. * xfns.c (x_set_name): Take new argument EXPLICIT, instead of OLDVAL. (x_explicitly_set_name, x_implicitly_set_name): New functions. (x_frame_parms): Use x_explicitly_set_name here. (x_window): Use x_implicitly_set_name here. * xdisp.c (display_mode_line): Use x_implicitly_set_name here. * xterm.c (x_wm_hints): Variable deleted. This has to be per-screen. Duh. * xterm.h (struct x_display): New member: wm_hints. * xterm.c (x_wm_set_window_state, x_wm_set_icon_pixmap, x_wm_set_icon_position): Use F->wm_hints, rather than x_wm_hints. (x_term_init): Don't initialize x_wm_hints here. * xfns.c (Fx_create_frame): Instead, initialize f->x_wm_hints here. * xterm.c (x_set_text_property): Properly balance the BLOCK_INPUTs and UNBLOCK_INPUTs. And remember that VALUE is the string we want to set the name to, not PROPERTY. 1992-08-17 Jim Blandy (jimb@pogo.cs.oberlin.edu) * frame.c (make_minibuffer_frame): Don't set this to auto-raise by default. It's annoying. * frame.c (make_minibuffer_frame): Set the prev field of the minibuffer window on a minibuffer-only frame to Qnil, rather than having it point to itself. This confuses code (Fprevious_window and change_window_height, for example), and is only an attempt to support a convention that can't really be used in Emacs 19 anymore. * window.h: Document the fact that we can no longer assume that the minibuffer's previous window is the root window, since a minibuffer window in a minibuffer-only frame has a prev field of nil. * frame.h [not MULTI_FRAME] (FRAME_ROOT_WINDOW): Define this by reference to the_only_frame.root_window, rather than by assuming that minibuf_window->prev is the root window. While this is true in the non-multi-frame case, we want to discourage this assumption in code. * dispnew.c [not MULTI_FRAME] (Fredraw_display): Use FRAME_ROOT_WINDOW instead of minibuf_window->prev. * xdisp.c (redisplay, init_xdisp): Same. * window.c (Fset_window_configuration): Removed #if 0'd code which assumes that minibuf_window is on the same frame as the window configuration. Removed special case for windows whose prevs point to themselves. * window.c (Fset_window_configuration): Rename the argument from ARG to CONFIGURATION, so it matches the docstring. The make-docfile program cares. * window.c [MULTI_FRAME] (syms_of_window): Don't staticpro minibuf_window; the frame list will take care of it. * xterm.h (HAVE_X11R4): Since we can autodetect this, and can write code more likely to be future-compatible, define this when appropriate. * xterm.c (x_set_text_property): Define this appropriately for X11R3 and X11R4. * xterm.c (x_set_text_property): Make this take a Lisp_Object string as an argument, rather than a pointer and a length. * xfns.c (x_set_name): Caller changed. *. 1992-08-15 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c: Doc fixes. More SYSV portability changes from Eric Raymond: * xterm.c [USG5]: Don't include <sys/types.h>. * xterm.c (x_make_frame_invisible): Instead of calling XWithdraw window, which isn't widely available, write out what it does, since that's not much. (x_iconify_frame): Explicitly perform both the X11R3 and X11R4 methods for iconification; don't use XIconifyWindow, since that's not present in R3. * xterm.c (x_wm_set_size_hint): Don't bother setting the base_width and base_height members; their function is performed just as well by the min_width and min_height members, and if we use XSetNormalHints instead of XSetWMNormalHints, we can be compatible with R3. * xterm.c (x_error_handler): There is no way to invoke the default error handler which works on all versions of X11, so don't bother; call XGetErrorText and print the message ourselves. * xterm.c (x_term_init): Don't use MAXHOSTNAMELEN; this isn't defined on all systems. Since we only use that as an initial guess anyway, it's not very important. 1992-08-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) * abbrev.c (Fexpand_abbrev): If pre-expand hook changes the buffer, assume that means we "did an expansion". * cmds.c (internal_self_insert): Ignore value of Fexpand_abbrev; instead, check whether buf is modified when it returns. 1992-08-14 Jim Blandy (jimb@pogo.cs.oberlin.edu) Applied SYSV portability changes from Eric Raymond: * xrdb.c [USG5]: Define SYSV, and then include <unistd.h>. Apparently, Xlib.h include string.h if SYSV is defined, and strings.h if not. Don't include <sys/types.h>; just declare getuid to return an int. Big deal. (MAXPATHLEN): If this is not defined by the system's include files, give it a value of 256. (get_user_db): Fetch the defaults directly from the display structure, rather than using XResourceManagerString; that function doesn't exist in the older versions of X. * xterm.c (x_set_text_property): New function. * xfns.c (x_set_name): Use it instead of XSetWMName and XSetWMIconName. * xfns.c (select_visual): Fetch the visual id directly from v; don't call XVisualIDFromVisual, since that function is not available in earlier versions of X. * term.c (term_get_fkeys): Some systems define `static' to be the empty string, which means that you can't have constant initialized arrays inside a function. So move the `keys' array outside of the function. * xdisp.c (decode_mode_spec): Same deal, with lots_of_dashes. * xfns.c (x_make_gc): Same deal, regarding cursor_bits. *. * systime.h [not HAVE_TIMEVAL] (EMACS_USECS, EMACS_SET_USECS): Don't forget to define dummy versions of these. * systime.h [USE_UTIME]: time_t is a typedef, not a struct. Don't prefix it with `struct'. * systerm.h (EMACS_SET_TTY_PGRP): When there doesn't seem to be any way to do this, don't forget to give it a dummy definition. * sysdep.c (select): There's no need to cast the return value of signal anymore, since we have the SIGTYPE macro defined. * sysdep.c (read_input_waiting): When scanning for quit characters, use the value of quit_char, rather than assuming that C-g is the quit character. And don't forget to declare i. * sysdep.c [USG5]: Don't include fcntl.h. * s/usg5-3.h: Eric Raymond writes: Define HAVE_SELECT and BSTRINGS only if HAVE_X_WINDOWS is on, because that means we'll be linking in the shared libraries containing the BSD emulations. Teach the file about the shared libraries necessary to link X programs, because AT&T doesn't supply static libraries for X. Also, fix the incorrect assertion that -lg cannot be used with SVr3. Finally, force USE_UTIMES and BROKEN_TIOCGWINSZ. (Note for the future; there may be a utimes(2)) emulation lurking in the X shared libraries.) * s/usg5-4.h (USE_UTIME): Remove this definition; the C library still doesn't have utimes. * ralloc.c (get_bloc): When initializing new_bloc->variable, cast NIL to (POINTER *). (malloc_init): Give warning if sbrk returns zero. Wonder what that's supposed to mean. * process.c (process_send_signal): Don't send SIGTSTP if the system doesn't have that facility. * process.c: [USG5] Don't include <fcntl.h>. [USG] Don't bother including <termios.h>, <termio.h>, or <fcntl.h>; systerm.h takes care of all that. Remove the "mis;tak-+;;" line from the code; apparently this section of code does get used. * minibuf.c (Fread_from_minibuffer): Put this function's doc string into a comment; it's too long for the PCC preprocessor. Rah. (Fcompleting_read): Same deal. * keyboard.c (init_keyboard): Changed "#endif SIGIO" to "#endif /* SIGIO */" * mocklisp.c (Fml_substr): Same sort of thing. * process.c (wait_reading_process_input): Same. * floatfns.c (Fexpm1, Flog1p): Function removed; it's not widely available, and hardly vital. (syms_of_floatfns): Adjusted appropriately. * floatfns.c (Flog): Accept optional second arg, being the base for the logarithm. [USG] (Flogb): Define this in terms of Flog. * data.c [USG] (Frem): Call fmod, rather than drem. Rah. * emacs.c [USG5]: Don't #include <fcntl.h> for these systems. * alloc.c (Fmake_marker): Removed the test for being called from a signal handler. The original bug is probably gone, the test wasn't written portably, and it should probably go somewhere else anyway - say, funcall or eval. End of changes from Eric Raymond. * xfns.c (Fx_create_frame): Make the default for the icon-type parameter nil, not t. It seems to cause problems with some X servers. * lisp.h (DEFVAR_PER_BUFFER): Add new argument, TYPE, to help check the types of buffer-local variable slots. * buffer.c (syms_of_buffer): Call DEFVAR_PER_BUFFER with the new TYPE argument. * abbrev.c (syms_of_abbrev): Same. * buffer.c (buffer_local_types): New variable. (buffer_slot_type_mismatch): New function. * buffer.h (buffer_local_types): New extern declaration. * data.c (store_symval_forwarding): When storing through a Lisp_Buffer_Objfwd, check if the slot requires a particular type, and report an error if the types clash. * lread.c (defvar_per_buffer): Support new TYPE argument, by setting the appropriate slot in buffer_local_types. 1992-08-13 Jim Blandy (jimb@pogo.cs.oberlin.edu) * window.c (window_loop): This used to keep track of the first window processed and wait until we came back around to it. Sadly, this doesn't work if that window gets deleted. So instead, use Fprevious_window to find the last window to process, and loop until we've done that one. * window.c [not MULTI_FRAME] (init_window_once): Don't forget to set the `mini_p' flag on the new minibuffer window to t. * window.c (Fwindow_at): Don't check the type of the frame argument. * window.c [not MULTI_FRAME] (window_loop): Set frame to zero, instead of trying to decode it. * frame.h [not MULTI_FRAME] (the_only_frame): Put a comment above this indicating that it's not GCPRO'd. Put parens around some of the FRAME_* macros' definitions. [not MULTI_SCREEN] (Fselected_frame): New function. * frame.h [not MULTI_FRAME] (FRAME_ROOT_WINDOW): Define this in terms of minibuf_window, rather than by reference to the_only_frame. * window.c (init_window_once): Initialize minibuf_window before FRAME_ROOT_WINDOW, so the latter actually points to something. * keyboard.c (Fexecute_mouse_event): Dyked-out function deleted. We're not going to use this mouse interface. (Vmouse_window, Vmouse_event, Vmouse_event_function) (Vmouse_left_hook, Vmap_frame_hook, Vunmap_frame_hook) (Vmouse_motion_handler): Variables deleted; they were to be used by Fexecute_mouse_event. (syms_of_keyboard): Same. (command_loop_1): Remove dyked-out code to support Fexecute_mouse_event. (read_char): Same. * keyboard.c (Vlast_event_frame): Don't define this window if MULTI_FRAME is not #defined. (syms_of_keyboard): Same. (kbd_buffer_store_event): Don't try to work with Vlast_event_frame if MULTI_FRAME is not #defined. (kbd_buffer_get_event): Same. * keyboard.c (Fdiscard_input): Removed dyked-out code from when unread_command_char's quiescent value was -1, not nil. * frame.c (make_frame): Stop passing zero to make_window; it's not expecting any arguments. 1992-08-12 Jim Blandy (jimb@albert.gnu.ai.mit.edu) * unexsunos4.c: Deleted "$Log" header in comments at top of file; this was beginning to grow RCS hair, which we don't want. * xmenu.c: Same deal. 1992-08-11 Jim Blandy (jimb@pogo.cs.oberlin.edu) * fileio.c (Fread_filename): Don't add one here. * minibuf.c (Fcompleting_read): Instead, stop subtracting one here, so this function lives up to its doc string, which I think specifies an okay way to work. * doc.c (Vdata_directory): Removed; this is declared in callproc.c. (syms_of_doc): Initialization removed. * xfns.c (x_get_arg): Return Qunbound for an unspecified resource, not nil. That way, we can tell the difference between a false resource and an unspecified resource. (x_default_error): Use DEFLT if x_get_arg returns Qunbound, not Qnil. (x_figure_window_size, x_icon, Fx_create_frame): Deal with Qunbound and Qnil properly. * xfns.c (Fx_create_frame): Pass the correct number of arguments to x_set_font. * xfns.c [not HAVE_X11] (Fx_create_frame): Delete section that's only included if we *do* have X11. Blind patching. * xfns.c (x_icon): Rewritten to call x_wm_set_icon_position and x_wm_set_window_state instead of calling XSetWMHints directly. * xterm.c (x_wm_hints): New variable. fns.c (x_default_parameter): Don't call store_frame_param here; it's already taken care of by x_set_frame_parameters. * xfns.c (Fx_create_frame): Check for the `icon-type', `auto-raise', and `auto-lower' parameters. Have `icon-type' default to t, indicating that we want the nifty gnu in our icons. (Qauto_lower): New symbol. * xfns.c (x_set_icon_type): UNBLOCK_INPUT before reporting the error, not after. error doesn't return, sklitch-brain. * xterm.c (x_set_window_size): Call check_frame_size to make sure that the requested dimensions are within acceptable limits. Store the new size information in the frame structure. * xfns.c (x_set_frame_parameters): Properly recognize changes to the height of the frame. Recognize changes of the frame's position. * xfns.c (x_set_frame_parameters): Iterate over ALIST while the current element is cons, not while it's non-nil. (syms_of_xfns): Call init_x_parm_symbols after interning all the other atoms; init_x_parm_symbols expects Qx_frame_parameter to be initialized. 1992-08-10 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xfns.c (Qbackground_color, Qborder_color, Qborder_width) (Qcursor_color, Qfont, Qforeground_color, Qgeometry) (Qhorizontal_scroll_bar, Qicon_left, Qicon_top, Qiconic_startup) (Qinternal_border_width, Qleft, Qmouse_color, Qparent_id) (Qsuppress_icon, Qsuppress_initial_map, Qtop, Qundefined_color) (Qvertical_scroll_bar, Qwindow_id, Qx_frame_parameter): New symbols, with lisp code to rebuild syms_of_xfns. (syms_of_xfns): Initialize and staticpro them. (Qheight, Qminibuffer, Qname, Qnone, Qonly, Qwidth) (Qunsplittable): Add extern declaration for these. (x_init_parm_symbols): Don't initialize Qx_frame_parameter here; it's done in syms_of_xfns. (x_default_parameter): Change the argument char *PROPNAME into a Lisp_Object PROP; let the caller take care of interning the atom. (Fx_geometry, x_figure_window_size, x_icon, Fx_create_frame): Use the new Q... variables, instead of interning things. * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly) (Qunsplittable, Qwidth, Qx): New symbol, with lisp code to rebuild syms_of_frame. (syms_of_xfns): Initialize and staticpro them. (Fframep, Fframe_visible_p, Fframe_parameters): Use the new Q... variables, instead of interning things. (store_in_alist): Change the argument char *PROPNAME into a Lisp_Object PROP; let the caller take care of interning the atom. * frame.c (Fframe_visible_p): Doc fix. * frame.c (Fframe_parameters): When figuring the `minibuffer' parameter, if FRAME doesn't have a minibuffer, return `none', not nil. If it does have a minibuffer with other windows, return the window. * frame.c (Fmodify_frame_parameters): Don't write out the loop for processing X frame parameters here; do it in the x specific code. Call the function which deals with this stuff x_set_frame_parameters, not x_set_frame_parameter. * xfns.c (x_set_frame_param): Replaced by x_set_frame_parameters. (x_set_frame_parameters): Process the alist of parameters here. Notice `width', `height', `top', and `left' parameters. Hold off changing the frame size and position until the end, so we can do both parameters at once when they are both specified. (x_default_parameter): Call x_set_frame_parameters, not x_set_frame_param. * frame.c (Fmake_frame_visible, Fmake_frame_invisible) (Ficonify_frame, Fframe_parameters, Fmodify_frame_parameters) (Fset_frame_height, Fset_frame_width, Fset_frame_size) (Fset_frame_position): Place clauses controlled by FRAME_X_P inside `#ifdef HAVE_X_WINDOWS ... #endif' clauses. * frame.c (Fset_frame_position): Doc fix. * dispnew.c (Fredraw_frame): Call clear_frame_records before calling update_end, so that x_display_box_cursor can rely on the contents of f->current_glyphs. * xfns.c (x_figure_window_size): Indicate that this function returns an int, rather than just leaving it unstated. * xterm.c (x_wm_set_size_hint): Don't try to set the base_height and base_width elements of size_hints if PBaseSize is not #defined. Set the minimum frame size according to the information returned by check_frame_size. * window.h (MIN_SAFE_WINDOW_HEIGHT, MIN_SAFE_WINDOW_WIDTH): Macros removed. (check_frame_size): New extern declaration. * window.c (MIN_SAFE_WINDOW_HEIGHT, MIN_SAFE_WINDOW_WIDTH): Macros defined here now. (check_frame_size): New function. * dispnew.c (change_frame_size): Call check_frame_size here, rather than writing out its code. Don't declare newheight and newwidth to be register variables, since we take their address. * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make sure the count on the symbol's `byte-code-meter' property does not overflow. * bytecode.c (syms_of_bytecode): Add a docstring for byte-metering-on. 1992-08-08 Jim Blandy (jimb@pogo.cs.oberlin.edu) * dispnew.c (in_display): Variable deleted; it's only ever used as an unofficial parameter to change_frame_size. (change_frame_size): New argument, DELAY, which when non-zero indicates to delay the size change until later. This should be passed as one from signal handlers. (window_change_signal): Call change_frame_size with a DELAY of 1. (do_pending_window_change): Call change_frame_size with DELAY of 0. * frame.c [MULTI_SCREEN] (Fset_frame_height, Fset_frame_width, Fset_frame_size): Same. [not MULTI_SCREEN] (Fset_frame_height, Fset_frame_width, Fset_frame_size, Fset_screen_height, Fset_screen_width): Same. * keyboard.c (Fsuspend_emacs): Call change_frame_size with the proper arguments - the height and width are the second and third arguments, not the first and second. Pass 0 for DELAY. * xfns.c (Fx_create_frame): Call change_frame_size with a DELAY of 0. * xterm.c (XTread_socket, x_do_pending_expose): Call change_frame_size with a DELAY of 1. * xterm.c (in_display): Deleted this; it's never used in xterm.c, and there is another variable by the same name in dispnew.c. * frame.c [not MULTI_SCREEN] (Fset_frame_height, Fset_frame_width) (Fset_frame_size, Fframe_height, Fframe_width): New functions, for use when Emacs is not compiled with multiple screens. [not MULTI_SCREEN] (Fset_screen_height, Fset_screen_width): Functions added for backward compatibility with Emacs 18. These would be just aliases, except that the version 18 functions don't take a FRAME argument. [not MULTI_SCREEN] (syms_of_frame): New function, to defsubr the above and add screen-height and screen-width as aliases for Fframe_height and Fframe_width. * emacs.c (main): Call syms_of_frame unconditionally. When MULTI_FRAME is not defined, it still provides the Fframe_width, Fframe_height, Fset_frame_width, and Fset_frame_height functions. * frame.c (Fset_frame_width): Change the size of FRAME, not of selected_frame. * frame.c (Fset_frame_width, Fset_frame_height): Declare the `frame' argument to be a Lisp_Object. It used to be undeclared. 1992-08-07 Jim Blandy (jimb@pogo.cs.oberlin.edu) * dispnew.c, frame.c, frame.h, keyboard.c, scroll.c, term.c, * window.c, xdisp.c, xfns.c xterm.c (FRAME_IS_TERMCAP, FRAME_IS_X) (FRAME_HAS_MINIBUF): Renamed these to FRAME_TERMCAP_P, FRAME_X_P, and FRAME_HAS_MINIBUF_P, for consistency with the rest of the frame macros. * window.h (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): New macros. * window.c (check_min_window_sizes): New function. (set_window_height): Call it. (Fsplit_window, change_window_height): Call it, instead of writing out its code. * dispnew.c (change_frame_size): If newlength or newwidth are too small (according to the value of MIN_SAFE_WINDOW_{WIDTH,HEIGHT}), force them larger. This isn't really right, but it's better than crashing. * editfns.c (Fcurrent_time_zone): Doc fix. 1992-08-06 Jim Blandy (jimb@pogo.cs.oberlin.edu) * editfns.c (Fcurrent_time_zone): Don't forget to include code to signal an error when EMACS_CURRENT_TIME_ZONE is not defined. 1992-08-06 Joseph Arceneaux (jla@gnu.ai.mit.edu) * doc.c (Vdata_directory): Declared. (syms_of_doc): Initialized. * fileio.c (Fread_filename): Add 1 to the offset position for the cursor when reading file names. 1992-08-05 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * systime.h (EMACS_CURRENT_TIME_ZONE): New macro. * editfns.c (Fcurrent_time_zone): New function. (syms_of_editfns): defsubr it. * keyboard.c (read_key_sequence): Clear the eighth bit of the character from the key sequence, NOT the index of the character IN the key sequence. How many tries will it take to get it right? 1992-08-04 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * eval.c (syms_of_eval): Doc fix for debug-on-quit. 1992-08-03 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callproc.c (Fcall_process): Doc fix. Used to claim that Fcall_process doesn't wait when BUFFER was nil. It does. 1992-07-30 Jim Blandy (jimb@pogo.cs.oberlin.edu) * keyboard.c (read_key_sequence): Scan for function keys when t >= mock_input, not when t > mock_input. We do want to scan for function keys when t == mock_input. * keyboard.c (read_key_sequence): Don't increment fkey_end when testing to see if keybuf[fkey_end] is a meta-character. 1992-07-27 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * Makefile.in (TAGS): Generate tags for files in ../external-lisp too. 1992-07-26 Richard Stallman (rms@mole.gnu.ai.mit.edu) * eval.c (find_handler_clause): For quit, don't check Vdebug_on_error. (wants_debugger): Rewrite so it cannot get an error. * callint.c (Fcall_interactively): Handle enable-recursive-minibuffers property on the command, by enabling recursive minibuffers. (syms_of_callint): Set Qenable_recursive_minibuffers. 1992-07-24 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * frame.c (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame): Make the first argument optional, defaulting to selected_frame. (Ficonify_frame, Fmake_frame_invisible): Add interactive specs, so we can bind these directly to C-z. 1992-07-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c (Fread_file_name): Use new calling convention for Fcompleting_read, with history as Qfile_name_history. (syms_of_fileio): Set Qfile_name_history; set the var to nil. Do staticpro for the recently created Q* vars. * minibuf.c (read_minibuf): Two additional args histvar and histpos. All calls changed. (Fcompleting_read): Last arg is now HIST--(HISTVAR . HISTPOS). Arg INIT can now be (INITIAL-STRING . INITIAL-POSITION). Pass BACKUP_N arg to read_minibuf properly as Lisp object. (Fread_from_minibuffer): Likewise. (syms_of_minibuf): Set Qminibuffer_history and staticpro it. * eval.c (Ffuncall, Feval): Support subrs with 7 args. * fns.c (Fyes_or_no_p): Use Fread_string, not read_minibuf. * callint.c (Fcall_interactively): For 'S', use Fread_no_blanks_input rather than read_minibuf. 1992-07-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) * minibuf.c (Vminibuffer_history_variable): New variable. (syms_of_minibuf): Define variable minibuffer-history-variable. (read_minibuf): Push the string on specified history list. 1992-07-23 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * Makefile.in (doall, doxemacs, dotemacs): Put quotes around CC=${CC}. Don't include $(MAKEOVERRIDES); that is always implicit. 1992-07-22 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (read_key_sequence): If we have read a meta-character, prefix it with meta_prefix_char before looking it up in the function key keymap. * lread.c (Fread_char_exclusive): Code this with a do-while loop, not a while loop with its body repeated. * lread.c (Fread_event): Don't make this function's definition conditional on X-windows. It ought to be there no matter how Emacs was built. (syms_of_lread): Don't make its defsubr conditional either. * lread.c (Fread_char): Doc fix. * fileio.c (find_file_handler): It's called Vfile_name_handler_alist, not Vfile_handler_alist. (Fwrite_region): Declare the variable named `handler'. (Fverify_visited_file_modtime): Use `b->filename', not `filename'. (Fset_visited_file_modtime): Declare the variable named `handler'. * dired.c (Fdirectory_files, Ffile_name_completion): Use `dirname', not `filename'. (Qfile_attributes): New variable. (syms_of_dired): Initialize it. * xselect.c (Fx_own_selection): If we're trying to set cut-buffer0, and the value is too large for the X server (as indicated by the max_request_size member of the X Display), just set the buffer to the empty string, and return nil. 1992-07-21 Richard Stallman (rms@mole.gnu.ai.mit.edu) * search.c (fast_string_match): New function. * fileio.c (find_file_handler): New function. (Fcopy_file, Fmake_directory, Fdelete_directory, Fdelete_file): (Frename_file, Fadd_name_to_file, Fmake_symbolic_link): (Ffile_exists_p, Ffile_executable_p, Ffile_readable_p, Ffile_symlink_p) (Ffile_writable_p, Ffile_directory_p, Ffile_accessible_directory_p): (Ffile_modes, Fset_file_modes, Ffile_newer_than_file_p): (Fwrite_region, Fverify_visited_file_modtime): Use find_file_handler; call the handler and return. (Finsert_file_contents): Use find_file_handler; cannot just return after the handler, but must handle VISIT. (syms_of_fileio): Set up Qcopy_file, etc. * dired.c (Fdirectory_files, Ffile_name_completion): (Ffile_name_all_completions, Ffile_attributes): Use find_file_handler; call the handler. (syms_of_dired): Set Qfile_attributes, etc. 1992-07-21 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xselect.c (Fx_own_selection): Initialize val to nil, so that if we don't get the selection, we don't return garbage. When setting cut-buffer0, set val to the string pasted. * xfns.c (x_set_name): If ARG is nil, set the frame's name to the current x_id_name. * xdisp.c (display_mode_line): If we should set the frame's name, but there is only one frame currently active, call x_set_name with nil as the name; this will display samething generically appropriate. 1992-07-20 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * lread.c (isfloat_string): Recognize floats without a leading integer part, noting that "e5" is a symbol, not a floating point number. * xdisp.c (message, message1): When displaying a message, don't make the minibuf frame visible unless the selected frame is also visible. This means that frames won't pop up unless the user is actually interacting with Emacs. * xdisp.c (display_mode_line): If Emacs is currently supporting only one screen, don't change the title of the screen to the name of the current buffer; this is only annoying in this case. We should probably think more carefully about how screens should be named. 1992-07-19 Richard Stallman (rms@mole.gnu.ai.mit.edu) * process.c (allocate_pty): Handle PTY_OPEN. Delete system-specific alternatives to PTY_NAME_SPRINTF and PTY_TTY_NAME_SPRINTF. 1992-07-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * callint.c (Fprefix_numeric_value): Fix typo: test raw, not val. 1992-07-17 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xfns.c (x_window): x_set_name normally ignores requests to set the name if the requested name is the same as the current name. This is the one place where that assumption isn't correct; f->name is set, but the X server hasn't been told. So fake it out. * emacs.c [sun] (main): On suns, localtime caches the value of the time zone rather than looking it up every time. This means that the dumped Emacs doesn't check the value of the TZ environment variable. Call tzset before entering the editing loop to check the new TZ value. 1992-07-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * dired.c (Fdirectory_files): Don't forget to pass the REGP argument to compile_pattern. * search.c (compile_pattern): If REGP is zero, don't call re_set_registers; nobody cares. * fileio.c (auto_save_error): Pass the correct number of arguments to Fsleep_for. * lread.c: Include <ctype.h> at the top of the file, instead of just before isfloat_string; read0 wants to use it too. * process.c (Fdelete_process, Fprocess_status, Fprocess_send_region) (Fprocess_send_string, Fprocess_send_eof, Finterrupt_process): Doc fixes. * process.c (Fprocess_status): Use get_process to find the process denoted by the PROC argument, not Fget_process. 1992-07-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xdisp.c: Doc fix. 1992-07-14 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * window.c (syms_of_window): Doc fix for pop-up-frames. * frame.c (Fframe_parameters): Note that if FRAME is omitted, it defaults to the selected frame. * frame.c (Fframe_height, Fframe_width): Blocked out these functions; they have no C callers, and can be written nicely in lisp. * frame.c (Fframe_pixel_size): Function removed; there aren't enough other functions available to make this useful. We need functions describing the size of the characters of a font. * xterm.h, xterm.c, xselect.c, xmenu.c, xfns.c, xdisp.c, window.h, * window.c, termopts.h, termhooks.h, termchar.h, term.c sysdep.c, * scroll.c, screen.c, screen.h, process.c, print.c, minibuf.c, * lisp.h keyboard.c, indent.c, fns.c, emacs.c, dispnew.c, * dispextern.h, cm.h, alloc.c, config.h.in: Screens are now called frames, to avoid even more confusion with X terminology than Emacs's "windows" already cause. All macros, functions, and variables renamed; all uses changed. * screen.c, screen.h: Renamed to frame.c and frame.h. All #includers changed. * ymakefile: Adjusted appropriately. * buffer.c: Doc fixes. * xfns.c (Fx_store_cut_buffer): Reversed sense of test for non-X screen. * window.c (Frecenter): Doc fix; this function places point in the middle of the current window, not the current screen. * window.c (temp_output_buffer_show): Use WINDOW_SCREEN macro instead of accessing the member directly. 1992-07-13 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * print.c (print): Changed code which prints screen objects to use the SCREEN_LIVE_P macro instead of testing the screen structure directly. * alloc.c (undo_threshold, undo_high_threshold): Variables renamed to undo_limit and undo_strong_limit. (Fgarbage_collect): Uses changed. (syms_of_alloc): DEFVARs and docstrings changed. * undo.c (truncate_undo_list): Comment adjusted. * lread.c (read0): Allow floating-point numbers to begin with a period. `(0 .5)' denotes a list of two numbers, not a dotted pair. 1992-07-11 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fns.c, callproc.c: Doc fix. 1992-07-10 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * bytecode.c (Bsymbol_function, Bfset): Removed comments saying that these are no longer generated. Jamie Zawinski's byte compiler does generate them, and he's actually collected statistics on how often these functions are called. 1992-07-09 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * screen.c (store_screen_param): Clarify error message. * xterm.c (x_make_screen_visible): Undo the change made on June 30; that is not the right solution. Apparently there are three states a window may be in: normal, iconified, and invisible. 1992-07-08 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * eval.c (Fmacroexpand): Code cleaned up; there's no need to handle forms like ((macro lambda ...) ...) specially. * fileio.c (Finsert_file_contents): Signal an error if we're asked to read from a named pipe. 1992-07-07 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * m/*.h (SIGN_EXTEND_CHAR): Removed these definitions. The only place they were used is in regex.c, and nowadays that has its own definition, which works for any machine. The definitions in the machine description files usually didn't work if given an unsigned character as an argument, anyway. 1992-07-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * buffer.c: Doc fix. 1992-07-02 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * minibuf.c (Fdisplay_completion_list): Declared new variables used in rms' previous change. 1992-07-02 Richard Stallman (rms@mole.gnu.ai.mit.edu) * minibuf.c (Fdisplay_completion_list): Handle non-buffer stream. 1992-07-01 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * window.c (Fdisplay_buffer): Add interactive spec. 1992-06-30 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * mem_limits.h: EXCEEDS_ELISP_PTR declared here. * ralloc.c: No longer declared here. * vm-limit.c: Nor here. Also, include "lisp.h" before "mem_limits.h" and additionally include "config.h". 1992-06-30 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c (x_make_screen_visible): Don't de-iconify the window; iconification is orthogonal to visibility. * emacs.c (syms_of_emacs): Change docstring for `kill-emacs-hook' to describe it as a hook, not as a single function. 1992-06-29 Jim Blandy (jimb@pogo.cs.oberlin.edu) * minibuf.c (Fread_no_blanks_input): Corrected maximum number of arguments from one to two. * emacs.c (Vkill_emacs_hook): Declare this here; it should have a docstring, so we might as well DEFVAR it. (syms_of_emacs): Initialize it, and DEFVAR_LISP it with an appropriate docstring. 1992-06-28 Jim Blandy (jimb@pogo.cs.oberlin.edu) * lread.c (Feval_buffer): Make the DEFUN match the C argument list; this takes two optional arguments, not just one. * lisp.h (Lisp_Buffer_Local_Value): Comments neatened. * data.c (Fset): Fixed conditional which tests whether the cache is invalid. It used to be pretty munged, and would always declare the cache invalid for Lisp_Buffer_Local_Value variables. Now it declares the cache invalid if the buffer is wrong (obviously), of 1992-06-27 Jim Blandy (jimb@pogo.cs.oberlin.edu) * data.c (Fset): Comments reformatted for readability. * xterm.c (last_mouse_movement_time): New variable. (note_mouse_position): Set it. (XTmouse_position): Return its current value as the position's timestamp. * keyboard.c (Qvertical_split): Renamed to `vertical-line', since the window arrangement is actually referred to as a `horizontal split.' (make_lispy_event, make_lispy_movement, syms_of_keyboard): Uses renamed here. * keyboard.h (Qvertical_split): Extern declaration changed here. * window.c (Fcoordinates_in_window_p): Changed this to return `vertical-line' at the appropriate times, rather than `vertical-split'. * window.c (Fcoordinates_in_window_p): Put symbol names in opposing single quotes - `vertical-split', for example. * fileio.c (Fexpand_file_name): Don't signal an error if USERNAME in a "~USERNAME/..." filename isn't a real user; just leave the "~USERNAME" unchanged. * fileio.c (Fmake_symbolic_link): Rename argument `NEWNAME' to `LINKNAME', to conform with the docstring. * Makefile.in (CPP): Pass `-Is -Im' to CPP, to make sure that machine- and system-dependend files can include each other properly. * ymakefile (CFLAGS): Add those directories to the #include path here too. * Makefile.in (xmakefile): Build this via a temporary file, so that if preprocessing fails we don't nuke the xmakefile. * fileio.c: There are two versions of Fexpand_file_name defined here; the latter is inside a `#if 0' clause. Change its DEFUN to a DEAFUN, so that its docstring doesn't make it into the DOC file and supercede the real docstring. * callint.c (Fcall_interactively): For the 'K' interactive spec, set varies[i] to -1, indicating that the mouse click should be quoted if the function makes it into the command history, and that this argument by itself does not qualify the command to be recorded in the history. 1992-06-26 Jim Blandy (jimb@pogo.cs.oberlin.edu) * data.c (Frem): The drem function will sometimes return a negative number. If it does, add the divisor to it, to make it positive. * screen.c: Put '#ifdef MULTI_SCREEN' after the inclusion of config.h. * window.c (Fpos_visible_in_window_p): Remember to apply XSCREEN to w->screen before applying SCREEN_WIDTH. * screen.h [not MULTI_SCREEN] (last_nonminibuf_screen): Removed #definition of this; it's confusing when debugging. * screen.c (last_nonminibuf_screen): Variable moved from here... * dispnew.c (last_nonminibuf_screen): to here, beside selected_screen. They should both exist, even if the multi-screen support is not present. * dispnew.c [not MULTI_SCREEN] (the_only_screen): New variable. Instead of having the non-multi-screen version of Emacs refer to lots of different variables scattered hither and yon, we'll just declare this new variable, of type `struct screen', and define the single-screen versions of the `SCREEN_foo' macros to reference its elements. This avoids conflicts between names of local variables and names of global variables describing the screen, and simplifies some of the differences between the multi-screen and single-screen cases. * screen.h (enum output_method, struct screen): Removed these from the `#ifdef MULTI_SCREEN' conditional. * screen.h [not MULTI_SCREEN] (the_only_screen): extern declaration for it here. [not MULTI_SCREEN] (SCREEN_CURRENT_GLYPHS, SCREEN_DESIRED_GLYPHS) (SCREEN_TEMP_GLYPHS, SCREEN_HEIGHT, SCREEN_WIDTH) (SCREEN_NEW_HEIGHT, SCREEN_NEW_WIDTH, SCREEN_CURSOR_X) (SCREEN_CURSOR_Y, SCREEN_ROOT_WINDOW, SCREEN_INSERT_COST) (SCREEN_DELETE_COST, SCREEN_INSERTN_COST, SCREEN_DELETEN_COST) (SCREEN_MESSAGE_BUF, SCREEN_SCROLL_BOTTOM_VPOS): Macros changed to refer to the_only_screen. * dispnew.c [not MULTI_SCREEN] (one_screen_cursX) (one_screen_cursY, one_screen_current_glyphs) (one_screen_desired_glyphs, one_screen_temp_glyphs) (delayed_screen_width, delayed_screen_height): Variables deleted; they're all now kept in the_only_screen. * xdisp.c [not MULTI_SCREEN] (message_buf): Variable deleted; same fate. * term.c [not MULTI_SCREEN] (one_screen_width, one_screen_height): Variables deleted; same fate. * screen.h [not MULTI_SCREEN]: Extern declarations for the above variables removed. * window.c [not MULTI_SCREEN] (root_window): Variable deleted. [not MULTI_SCREEN] (init_window_once): Use SCREEN_ROOT_WINDOW to refer to the root window, instead of referring to it directly. * window.h [not MULTI_SCREEN] (root_window): Extern declaration removed. * scroll.c [not MULTI_SCREEN] (insert_line_cost, delete_line_cost, insert_n_lines_cost, delete_n_lines_cost): Variables deleted; same fate. * dispnew.c [not MULTI_SCREEN] (cursX, cursY): Renamed to `one_screen_cursX' and `one_screen_cursY'. * screen.h [not MULTI_SCREEN] (cursX, cursY, SCREEN_CURSOR_X) (SCREEN_CURSOR_Y): Extern declarations and macros changed accordingly. * term.c [not MULTI_SCREEN] (screen_width, screen_height): Renamed to `one_screen_width' and `one_screen_height', so as not to conflict with local variables when referenced by the `SCREEN_foo' macros. * screen.h [not MULTI_SCREEN] (screen_width, screen_height): Extern declarations changed accordingly. * termchar.h (screen_width, screen_height): Extern declarations deleted. Everyone should go through the `SCREEN_foo' macros. (SCREEN_WIDTH, SCREEN_HEIGHT): Changed accordingly. 1992-06-25 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callint.c (Fcall_interactively): When making a copy of the spec string, cast the return value of `alloca' to `unsigned char *', not `char *', to match the type of `string'. * xselect.c (Fx_own_selection): Cast XSTRING (string)->data to a char *, so it can be comfortably passed to XStoreBytes. * filelock.c (strcpy): Declare this to return char *. 1992-06-24 Jim Blandy (jimb@pogo.cs.oberlin.edu) * dispnew.c (current_glyphs, desired_glyphs, temp_glyphs): Renamed to have the prefix `one_screen_', so that the screen macros can refer to them without conflicting with local variables. * screen.h [not MULTI_SCREEN] (SCREEN_CURRENT_GLYPHS, SCREEN_DESIRED_GLYPHS, SCREEN_TEMP_GLYPHS): Changed accordingly. * keyboard.c (read_key_sequence): Put the code which restarts the key sequence in a `#ifdef MULTI_SCREEN' conditional. * screen.h [not MULTI_SCREEN]: Added definitions for CHECK_LIVE_SCREEN and SCREEN_FOCUS_SCREEN for the non-multi-screen case. * screen.h [not MULTI_SCREEN]: The name is `SCREEN_MINIBUF_ONLY_P', not `SCREEN_IS_MINIBUF_ONLY'. * xdisp.c [not MULTI_SCREEN] (Fredraw_display): Removed definition here; the non-multi-screen version is already defined in dispnew.c, alongside the multi-screen version. (syms_of_xdisp): Don't try to defsubr Sredraw_display; it doesn't exist. * lread.c (Fread_char_exclusive): Remove this from the `#ifdef HAVE_X_WINDOWS' conditional; it is appropriate in any context. * eval.c (Fsignal): Put call to TOTALLY_UNBLOCK_INPUT under the protection of a `#ifdef HAVE_X_WINDOWS' conditional. * keyboard.c (kbd_buffer_get_event): Expect *mouse_position_hook to return the timestamp as an unsigned long, not a lisp_Object. This matches the change made to `struct input_event'. (make_lispy_movement): Change argument TIME to an unsigned long. * xterm.c (XTmouse_position): Change TIME argument to a pointer to an unsigned long. * termhooks.h (mouse_position_hook): Doc fix. * term.c (mouse_position_hook): Doc fix. * termhooks.h (struct input_event): If MULTI_SCREEN is defined, declare the .screen element to be `struct screen *'; otherwise, declare it to be `int'. See the comment in the file for why I've done this obviously wrong thing. * print.c (printbufidx): Doc fix. * xdisp.c (message_buf_print): Doc fix. * dispextern.h (message_buf_size): Variable deleted; it's no longer used, since the message buffer is always the width of the screen. * screen.h [not MULTI_SCREEN] (message_buf): Add extern declaration for it here. (message_buf_print): Added extern declarations here for both the MULTI_SCREEN and non-MULTI_SCREEN cases. * dispextern.h (message_buf, message_buf_print): Deleted extern declaration for these here. It should never be used directly; it should always be used through the SCREEN_MESSAGE_BUF macro. * dispnew.c (temp_glyphs): Added back this variable declaration; screen.h and various other places referred to this; where did it go? * screen.h [not MULTI_SCREEN] (temp_glyphs, desired_glyphs, current_glyphs): Add extern declarations for these. * dispnew.c (cancel_my_columns): Use SCREEN_DESIRED_GLYPHS macro, instead of assuming that a SCREEN_PTR is actually a pointer to something; it isn't if we're not using any of the screen support. Remove the variable `screen', and find the value for `desired_glyphs' directly. * xdisp.c (echo_area_display): Use the SCREEN_DESIRED_GLYPHS macro to find screen's desired cursor position, instead of assuming that a SCREEN_PTR is a pointer to something. (display_mode_line): Same. * window.c (Fpos_visible_in_window_p): Use the SCREEN_WIDTH macro. (replace_window): Use the SCREEN_ROOT_WINDOW macro. (window_loop): Use the SCREEN_WIDTH macro. * dispnew.c (update_screen): Enclose the statement which increments `downto' in a `#ifdef HAVE_X_WINDOWS' conditional. * screen.h [MULTI_SCREEN and not MULTI_SCREEN] (FOR_EACH_SCREEN): New macro. * dispnew.c (window_change_signal, do_pending_window_change): Use FOR_EACH_SCREEN instead of assuming that Vscreen_list exists. * window.h (root_window): Added extern declaration for this. * screen.c: Enclose the entire file in a #ifdef MULTI_SCREEN conditional. 1992-06-23 Richard Stallman (rms@mole.gnu.ai.mit.edu) * window.c (Fset_window_dedicated_p): Replaces Fset_window_buffer_dedicated. Second arg just t or nil. 1992-06-22 Richard Stallman (rms@mole.gnu.ai.mit.edu) * syntax.h (SYNTAX, SYNTAX_MATCH, SYNTAX_COMSTART_FIRST, etc.): Cast character to unsigned char before indexing. 1992-06-19 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c (x_wm_set_size_hint): Set size_hints.flags to indicate that we are providing the base_width and base_height data. * xfns.c (Fx_create_screen): Default the internal border width to 2; this matches XTerm. * syntax.c (Fparse_partial_sexp): Doc fix. * syntax.c (Fparse_partial_sexp): Added phony argument list to comment containing the docstring for this function, so that make-docfile.c will get the right arguments. * xfns.c (x_set_name): Don't go through the X11 brouhaha to set the name unless we're actually setting it to something different from the current name. 1992-06-18 Jim Blandy (jimb@pogo.cs.oberlin.edu) * eval.c (syms_of_eval): Don't forget to escape the ends of the lines in the docstring for `debug-on-quit'. * keyboard.c (Fread_key_sequence): Reversed sense of CONTINUE_ECHO argument - set this_command_key_count to zero iff CONTINUE_ECHO is Qnil, not iff it's non-Qnil. 1992-06-17 Jim Blandy (jimb@pogo.cs.oberlin.edu) * search.c: Changed to remember the object in which the last search was done, so that markers from match data are placed in that buffer, instead of the current buffer. (search_regs_from_string): Replaced with... (last_thing_searched): This is either Qnil, meaning no searching has been done, Qt, meaning that the last search was done in a string, or a buffer object, meaning that the last search was done in that buffer. (syms_of_search): Initialize and staticpro last_thing_searched. (Flooking_at, search_buffer): Set last_thing_searched to the current buffer. (Fstring_match): Set last_thing_searched to Qt. (Fmatch_data): Test last_thing_searched to see if any searching has been done, and construct integers or markers in the right buffer. Abort if it's not Qt, Qnil, or a buffer. (Fstore_match_data): Set last_thing_searched according to the things we find in LIST. 1992-06-16 Jim Blandy (jimb@pogo.cs.oberlin.edu) * fns.c (Fload_average): Document the fact that this sometimes returns a list of fewer than three elements, on systems which don't provide 5- and 15-minute load averages. 1992-06-15 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c (XTread_socket): If an event arrives to a screen S, don't attribute them to SCREEN_FOCUS_SCREEN (S) here. Do that synchronously, when the events are dequeued. This keeps events from being accidentally routed to the wrong screen, if we temporarily redirect a screen's focus. * keyboard.c (kbd_buffer_store_event): If the character being stuffed is a quit character, do the SCREEN_FOCUS_SCREEN redirection to it here. (kbd_buffer_get_event): And do it here, before returning the event. * eval.c (Finteractive_p): This assumed that if the function in the top frame of the lisp backtrace was not a Lisp_Compiled object, then Finteractive_p must have an explicit frame on the top of the stack, which we could skip. It didn't bother to follow the symbol function chaining, and it would break if any C code called from a non-compiled function tried to call Finteractive_p anyway. Changed this to actually check if the top frame's effective function is the Lisp_Subr for Finteractive_p. This also used to skip any number of frames for special forms and/or Fbytecode calls. Changed this to skip an Fbytecode frame (if present), followed by any number of special form frames. 1992-06-14 Jim Blandy (jimb@pogo.cs.oberlin.edu) * eval.c (struct backtrace): Doc fix. 1992-06-12 Jim Blandy (jimb@pogo.cs.oberlin.edu) * m/hp300bsd.h (LOAD_AVE_TYPE): This is long, not double. (LOAD_AVE_CVT): Adjusted as appropriate. * fns.c: Moved lots of system-dependent preprocessor cruft dealing with getting the load average to `getloadavg.c'. (Fload_average): Guts moved to `getloadavg.c'. * getloadavg.c: New file, containing the necessary mess to get the load average on many different systems. This file is supposed to be Emacs-independent. * ymakefile (obj): Add getloadavg.o to the list. (getloadavg.o): Note that this depends on its source, and config.h. * screen.c (Fdelete_screen): Typo in loop looking for new last_nonminibuf_screen - change `screen = XCONS (screens)->cdr` to `screens = XCONS (screens)->cdr` * xdisp.c (echo_area_display): Don't neglect to draw all the lines of the minibuffer window (or echo area) when a message is being displayed. If the minibuffer is more than one line high, they should all be blanked. 1992-06-10 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * sysdep.c [POSIX_SIGNALS] (sys_signal): Fix typo - rather than calling new_action as if it were a function, call sigaction. 1992-06-09 Richard Stallman (rms@mole.gnu.ai.mit.edu) * lisp.h (Qnumberp, Qnumber_or_marker_p): Declared. * eval.c (wants_debugger): Changed NULL to NILP. Who installed these calls to NULL? 1992-06-09 Jim Blandy (jimb@pogo.cs.oberlin.edu) * dispnew.c (Fsit_for): Don't forget to actually set sec from ARG. * termhooks.h (struct input_event): Doc fix - for mouse clicks, .x and .y give the position in characters, not in pixels. * keyboard.c (format_modifiers): Order the modifier letters alphabetically - control, meta, shift, and up. 1992-06-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * xfns.c: Move some extern decls out of #if 0, to top of file. 1992-06-08 Jim Blandy (jimb@pogo.cs.oberlin.edu) * window.c (Fcoordinates_in_window_p): Docstring fix. * buffer.c (Fother_buffer): Put a comma between arguments BUFFER and VISIBLE_OK in the argument list. Duh. * screen.c (Fdelete_screen): Remember that s is a SCREEN_PTR *, not a Lisp_Object. * search.c (search_regs): Doc fix. (compile_pattern): Take a new argument - the search register structure - so we can reassure the regex routines that the registers have been allocated. (Flooking_at, Fstring_match, search_buffer): Changed to pass &search_regs to compile_pattern. (search_buffer): When we've searched for a literal string and found it, make sure that the search registers are allocated before stuffing the location of the search into them. (Fstore_match_data): If we need to allocate more registers, allocate them using re_set_registers, instead of just storing the new registers and hoping that regex doesn't free them. * search.c (Freplace_match): Doc fix. 1992-06-07 Richard Stallman (rms@mole.gnu.ai.mit.edu) * screen.c (Fdeiconify_screen): Function deleted. It was the same as make-screen-visible. 1992-06-06 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c: Doc fix. * floatfns.c (Fcbrt): Renamed from Fcube_root, and #if 0'd. * lisp.h (CHECK_NUMBER_OR_FLOAT*): Use Qnumberp or Qnumber_or_marker_p. * data.c (syms_of_data): Staticpro those. (Qinteger_or_float_p, Qinteger_or_float_or_marker_p): Deleted. (Fnumberp, Fnumber_or_marker_p): Define these always, but make them work even if not LISP_FLOAT_TYPE. 1992-06-05 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * config.h.in: Undefine REL_ALLOC if a system specific file defines SYSTEM_MALLOC. * sysdep.c (save_signal_handlers): Cast result of signal to avoid compiler warning. * process.c (send_process): Likewise. 1992-06-05 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (Fread_key_sequence): New 2nd arg CONTINUE_ECHO added for the sake of universal-argument. 1992-06-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * editfns.c (Fset_default_file_mode): Function deleted. (Funix_sync): Moved. * fileio.c (Funix_sync): Moved to here. * xfns.c (Fx_erase_rectangle, Fx_draw_rectangle, Fx_contour_region): (Fx_uncontour_region): #if 0 these. (x_rectangle, outline_region): Likewise. (syms_of_xfns): #if 0 the defsubrs. * dispnew.c (Fsleep_for, Fsit_for): Clean up error messages. * eval.c, print.c, keyboard.c: Doc fix. * xfns.c (Fx_horizontal_line): Disabled, since not documented. * fileio.c (Fdelete_directory): Renamed from Fremove_directory. * unexencap.c: Deinstalled (renamed to =unexencap.c) since awaited papers never arrived. * xfns.c: Doc fix. 1992-06-04 Roland McGrath (roland@geech.gnu.ai.mit.edu) * eval.c (stack_trace_on_error, debug_on_error): Made Lisp_Objects V*. (syms_of_eval): Changed DEFVAR_BOOLs to DEFVAR_LISPs. (wants_debugger): New fn. (find_handler_clause): Use it to look in debug-on-error and stack-trace-on-error lists. 1992-06-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * floatfns.c (Fbessel_*, Ferf, Ferfc, Flog_gamma): Turned off; not clearly worth including. (Fasinh, Facosh, Fatanh, Fsinh, Fcosh, Ftanh): Likewise. 1992-06-03 Richard Stallman (rms@mole.gnu.ai.mit.edu) * minibuf.c, keyboard.c: Doc fix. * window.c (Fwindow_at): Fix number of args--minimum 2, max 3. * screen.c: Doc fix. 1992-06-02 Richard Stallman (rms@mole.gnu.ai.mit.edu) * lread.c (Feval_buffer): Don't read any arguments, if interactive. 1992-06-02 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * screen.c (make_screen_without_minibuffer): Apply XSCREEN to Vdefault_minibuffer_screen before calling SCREEN_LIVE_P. The argument to SCREEN_LIVE_P must be a SCREEN_PTR, not a Lisp_Object. * dispnew.c (Fsit_for): This used to compare arg with 0 and return Qt immediately. It should actually call sit_for anyway, because sit_for needs to test for input and do the redisplay. (sit_for): Compare sec and usec with zero here, after we've looked for input and done a redisplay. * lread.c (Feval_buffer): Use NILP, not NIL_P. 1992-06-01 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * buffer.h: New macro, BUF_SET_PT. * lread.c: New subr `eval-buffer', replaces `eval-current-buffer', which is now defined in simple.el. 1992-05-30 Jim Blandy (jimb@pogo.cs.oberlin.edu) * screen.c (Fdelete_screen): If we're deleting the default minibuffer screen, try to find another minibuffer screen. 1992-05-29 Jim Blandy (jimb@pogo.cs.oberlin.edu) * buffer.c (Fother_buffer): New optional argument VISIBLE_OK, indicating that buffers currently visible in windows should not be discriminated against. 1992-05-28 Ken Raeburn (raeburn@cygnus.com) * screen.c (Fdelete_screen): Fix bugs in walking screen list. (make_screen_without_minibuffer): Signal an error if the default minibuffer screen is dead. * xfns.c (x_set_name): Use ICCCM-conforming scheme for changing window name in X11. (Fx_create_screen): Likewise. 1992-05-27 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xselect.c: Support getting and setting the obsolete X cut buffers. (Qcut_buffer0): New atom, denoting the X cut buffer 0. (syms_of_xselect): Initialize and staticpro it. (Fx_own_selection): If TYPE is Qcut_buffer0, interpret this to mean that we should set cut buffer 0 to STRING. (Fx_selection_value): If TYPE is Qcut_buffer0, interpret this to mean that we should retrieve the value of cut buffer 0. 1992-05-21 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c (construct_mouse_click): Removed extra assignment of result->timestamp. * keyboard.c (last_event_timestamp): Doc fix. * xselect.c (last_event_timestamp): Declare it extern here. (mouse_timestamp): Variable deleted. last_event_timestamp is a more accurate thing to use here. (own_selection, get_selection_value): Use last_event_timestamp instead of mouse_timestamp. * keyboard.c (make_lispy_event): Pass the event's timestamp through the make_number function, to assure that it is properly tagged before incorporating it into the lispy event. * xterm.c (construct_mouse_click): The timestamp element of a struct input_event is no longer a Lisp_Object; it is now an unsigned long. So don't use XSET to assign to it. (XTread_socket): Same here, in processing KeyPress events. * keyboard.c (Fexecute_extended_command): Properly initialize this_command_keys to the concatenation of the sequence that invoked Fexecute_extended_command, the characters making up the name of the command we're running, and a return character. Previously, this code would set it to the last key typed while reading the function name from the minibuffer, followed by the name of the function being run. 1992-05-20 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c (x_display_box_cursor): Draw the cursor at curs_{x,y}, rather than at s->cursor_{x,y}. If cursor_in_echo_area is set, then s->cursor_{x,y} does not accurately describe the position of the cursor. However, if we're not updating, then curs_{x,y} are garbage; set them from s->cursor_{x,y}. * dispnew.c (update_screen): Check current_screen->enable and current_screen_used to see if there is any text on the last line, not desired_screen->{enable,used}. When the line isn't enabled, move to line SCREEN_HEIGHT (s) - 1, not SCREEN_HEIGHT (s). Rearranged conditionals. * dispnew.c (cursor_in_echo_area): Document the interpretations of positive and negative values of this variable. 1992-05-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * dispnew.c (Fding): If have arg, don't end a keyboard macro. 1992-05-18 Jim Blandy (jimb@pogo.cs.oberlin.edu) * dispnew.c (sit_for): New function, which is a slight generalization of Fsit_for; you can tell it that it's waiting for input, so C-g gets handled properly. (Fsit_for): Call it, instead of replicating all its guts. * keyboard.c (read_char): Call sit_for instead of Fsit_for, and indicate that we're awaiting keyboard input. * dispnew.c (Fsit_for): Rename arguments to match docstring. Use NILP instead of EQ (foo, Qnil). If nodisp is non-nil, call wait_reading_process_input with do_display 0, instead of 1; this will inhibit spurious redisplays when process input arrives during a sit-for. * process.c (Faccept_process_output): Pass zero as read_kbd argument to wait_reading_process_input when PROC is nil, not when PROC is non-nil. * process.c (wait_reading_process_input): Declare read_kbd to be a Lisp_Object, and use the tagging to tell the difference between a process object and an integer. * dispnew.c (Fsleep_for, Fsit_for, Fsleep_for_millisecs): Pass read_kbd argument to wait_reading_process_input as a Lisp_Object. * keyboard.c (kbd_buffer_get_event): Same. * process.c (Faccept_process_output, send_process): Same. * keyboard.c (read_char): Use save_getcjmp and restore_getcjmp instead of doing the bcopy explicitly. * xterm.c (XTread_socket): When handling an EnterWindow event, don't bother to check waiting_for_input. It's not necessary. * keyboard.c (read_char): Don't clear waiting_for_input and input_available_clear_time here. (quit_throw_to_read_char): It's already done here. * keyboard.c (quit_throw_to_read_char): Use clear_waiting_for_input instead of clearing waiting_for_input explicitly. 1992-05-18 Jim Blandy (jimb@pogo.cs.oberlin.edu) * keyboard.c (read_char): Call clear_waiting_for_input instead of clearing waiting_for_input and input_available_clear_time explicitly. 1992-05-15 Jim Blandy (jimb@pogo.cs.oberlin.edu) * ymakefile [defined (__GNUC__) and __GNUC__ > 1]: Define YMF_PASS_LDFLAGS so that it can deal with an empty flags argument. * callproc.c (Fcall_process): Under VMS, a nil INFILE argument means to read from "NLA0:", not "/dev/null". * callproc.c (Fcall_process): Use nil as the value for display (the fourth argument) when nargs >= 4, not when nargs >= 3. 1992-05-14 Jim Blandy (jimb@pogo.cs.oberlin.edu) * termhooks.h: Change timestamp from a Lisp_Object to an unsigned long. * keyboard.c (kbd_buffer_store_event): We don't have to apply the XINT macro to the timestamp member of the event anymore. * process.c (wait_reading_process_output): Don't turn off polling. * sysdep.c (setpgrp_of_tty): Pass the address of pid, not pid itself. * process.c: Deleted cpp tangle for dealing with system-dependent tty handling; #included "systerm.h". * systerm.h: Add some of the things that were done in process.c: If titan is #defined, then we should include <sys/ttyhw.h> and <sys/stream.h> along with the other SYSV pty stuff. If HPUX is #defined, then EMACS_HAVE_TTY_PGRP isn't true. If XENIX is #defined, then we shouldn't try to use TIOCGETC. * ymakefile: Note that process.o depends on systerm.h now. 1992-05-13 Richard Stallman (rms@mole.gnu.ai.mit.edu) * callint.c (Fprefix_numeric_value): Value 1 for symbol other than `-'. 1992-05-13 Jim Blandy (jimb@pogo.cs.oberlin.edu) * cmds.c (Fforward_line): If the buffer is empty, don't try to see if it contains a newline, and moving nowhere at eob after non-newline should return 1, not 0. * search.c (scan_buffer): Doc fix. * buffer.c (Fbuffer_disable_undo): Accept a buffer name as an argument. 1992-05-12 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c: Include config.h first thing. * keyboard.c (clear_input_pending): New subroutine. * process.c (wait_reading_process_input): Make C-g really quit in sit-for case. * ymakefile (LD_SWITCH_SYSTEM): Don't use -X with GCC. 1992-05-12 Jim Blandy (jimb@pogo.cs.oberlin.edu) * eval.c (Fapply): Use indirect_function, instead of doing a dumb loop. * keymap.c (get_keymap_1): Same. * macros.c (Fexecute_kbd_macro): Same. * buffer.c (init_buffer_once): Don't disable undos for *scratch* here. Do it in loadup.el. * buffer.c (init_buffer_once): Doc fix. * doc.c (Fdocumentation): After extracting the doc string from a lambda or autoload expression, don't fall through to the default case and signal an invalid function error; instead, do a `break'. * doc.c (Fdocumentation): Use EQ (x, y) instead of XSYMBOL (x) == XSYMBOL (y). * doc.c (Fdocumentation): When decyphering a function made from conses, use 'else if' for the chain of alternatives instead of just 'if'. It used to be that each alternative returned, but that's not true anymore. * alloc.c (Fgarbage_collect): Don't call truncate_undo_list on buffers whose undo list is 't. * doc.c (Fdocumentation): Renamed argument `fun1' to `function', so make-docstring will list argument consistently with the docstring. 1992-05-11 Joseph Arceneaux (jla@churchy.gnu.ai.mit.edu) * xterm.h: Removed definition of `RES_CLASS'. * xfns.c (x_get_arg): Eliminated `screen_name' parameter. No longer uses screen name as X resource search component. All calls to x_get_arg changed accordingly. Global variable `screen_class' and #define `SCREEN_CLASS' removed. * xterm.c (XTread_socket): Added basic structure for handling various ClientMessage events, using new global variables `Xatom_wm_take_focus', `Xatom_wm_save_yourself', `Xatom_wm_delete_window', `Xatom_wm_configure_denied', `Xatom_wm_moved'. * xfns.c: Declare these variables extern. (syms_of_xfns): Initialize these variables. * xselect.c (Fx_own_selection, Fx_selection_value): New optional parameter `type', to specify the selection type. (syms_of_xselect): New symbols Qprimary, Qsecondary, Qclipboard initialized. 1992-05-11 Jim Blandy (jimb@pogo.cs.oberlin.edu) * data.c (Qcyclic_function_indirection): New error condition. (indirect_function, Findirect_function): New functions. (syms_of_data): Initialize Qcyclic_function_indirection, put the error properties on it, and staticpro it. Defsubr Findirect_function. * lisp.h (indirect_function, Findirect_function): Declare them here. * callint.c (Fcall_interactively): Get symbol's function by calling indirect_function, instead of just looping. * doc.c (Fdocumentation): Same. * eval.c (Finteractive_p, Fcommandp, do_autoload, Feval) (Ffuncall): Same. * keyboard.c (Fcommand_execute): Same. * data.c (Fsymbol_function): Name the argument `symbol' instead of `sym', so make-docstring will list argument consistently with the docstring. * process.c (wait_reading_process_input): Make sure the screen isn't garbaged (and therefore not displayed) before we enter the select and start waiting for input. * keyboard.c: #include <systime.h>. * ymakefile (keyboard.o): This depends on systime.h. * keyboard.c (input_available_clear_word): Replaced with input_available_clear_time, which is a pointer to an EMACSTIME; sometimes the time information is larger than a single word. (read_char): Changed ..._word to ..._time. (input_available_signal): Use the EMACS_SET_SECS_USECS macro to clear *input_available_clear_time, instead of zapping a zero into *input_available_clear_word. (set_waiting_for_input, clear_waiting_for_input): Adjusted appropriately. 1992-05-10 Jim Blandy (jimb@pogo.cs.oberlin.edu) * editfns.c (make_buffer_string): New function. * lisp.h (make_buffer_string): Declare it here. * editfns.c (Fbuffer_substring): Call make_buffer_string instead of writing it out. (Fbuffer_string): Call make_buffer_string instead of make_string, so we can deal with buffer relocations. * minibuf.c (read_minibuf): Same here. 1992-05-09 Jim Blandy (jimb@pogo.cs.oberlin.edu) * syssignal.h (sigunblock): New macro, taken from 18.58's emacssignal.h file. * sysdep.c (request_sigio): Use the sigunblock macro to enable reciept of SIGWINCH, instead of the dysfunctional sigblockx. 1992-05-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * search.c: Doc fix. 1992-05-06 Jim Blandy (jimb@pogo.cs.oberlin.edu) * emacs.c (decode_env_path): If EVARNAME is zero, don't try to call getenv on it. * lread.c (init_lread): When we don't have an environment variable to check, pass 0 instead of the empty string. * alloc.c (Fmake_marker): Use `SIGMASKTYPE' instead of `int'. Instead of calling sigsetmask twice - once to get the mask, and again to restore it - call sigblock, specifying no additional signals. 1992-05-05 Jim Blandy (jimb@pogo.cs.oberlin.edu) * alloc.c: #include <syssignal.h>, for the sake of the bug-catching code in Fmake_marker. ymakefile: Add dependency. * syssignal.h [not POSIX_SIGNALS] (SIGFULLMASK): New definition, for symmetry with the "defined (POSIX_SIGNALS)" case. * callproc.c (child_setup): Since we always get the environment from Vprocess_environment, don't bother to take the environment the subprocess should inherit as an argument anymore. * process.c (create_process): Don't pass environment as a variable. Just preserve it across call to fork. 1992-05-04 Jim Blandy (jimb@pogo.cs.oberlin.edu) * floatfns.c: #include <syssignal.h>. (float_error): Use SIGEMPTYMASK instead of zero. * syssignal.h [POSIX_SIGNALS] (sigmask): Defined to expand to a statement expression under GCC, or a function call otherwise. (sigpause, sigblock, sigunblock, sigsetmask): These are now K&R-compatible macros. * systerm.h [POSIX_SIGNALS] (sys_sigmask): Here is the function the POSIX version of sigmask calls when we're not compiling with GCC. * alloc.c (Fmake_marker): Undo changes of Apr 29. * callproc.c (Fcall_process): Same. * data.c (arith_error): Same. * floatfns.c (float_error): Same. * keyboard.c (gobble_input): Same. * sysdep.c (request_sigio, unrequest_sigio) 1992-04-29 Jim Blandy (jimb@pogo.cs.oberlin.edu) * x11term.h (CLASS): Change this from "emacs" to "Emacs"; class names should always start with an upper-case letter. * syssignal.h: Arranged cpp conditionals so that the specific cases come first, generic cases last. * syssignal.h (sigpause, sigblock, sigunblock, sigsetmask): Macros removed; they require GCC, and Emacs 19 should compile without GCC. (EMACS_SIGPAUSE, EMACS_SIGBLOCK, EMACS_SIGUNBLOCK) (EMACS_SIGSETMASK, EMACS_SIGFREE, EMACS_SIGHOLDX, EMACS_SIGBLOCKX) (EMACS_SIGUNBLOCKX, EMACS_SIGPAUSEX): These are new macros that don't require GCC, but expand to statements. * callproc.c (Fcall_process): Use new EMACS_SIG* macros from syssignal.h. * keyboard.c (gobble_input): Same. * sysdep.c (request_sigio, unrequest_sigio): Same. * x11term.h (BLOCK_INPUT, UNBLOCK_INPUT): Same. * alloc.c (Fmake_marker): Same. * data.c (arith_error): Same. * floatfns.c (float_error): Same. 1992-04-28 Jim Blandy (jimb@pogo.cs.oberlin.edu) * ymakefile: If we're using GCC version 2.0 or later, use "$(CC) -nostdlib" as the linker. This will allow us to find libgcc.a even when GCC puts it in a really weird place. (YMF_PASS_LDFLAGS): New macro. (temacs): Use it. * s/hpux.h: Doc fix. * filelock.c (egetenv): Declare this. (lock_path, SUPERLOCK_NAME, superlock_path): New variables and macros. (MAKE_LOCK_PATH, lock_file, unlock_file, lock_superlock): Use the variables lock_path and superlock_path instead of the PATH_LOCK and PATH_SUPERLOCK macros. (init_filelock): New function. * emacs.c (main): Call the init_filelock function. * paths.h.in (PATH_SUPERLOCK): Removed. This is now calculated from PATH_LOCK or from the EMACSLOCKDIR environment variable. * filelock.c (MAKE_LOCK_PATH): New macro. (lock_file, unlock_file, Ffile_locked_p): Use it. * syntax.c (Fmodify_syntax_entry): Note that '-' is a synonym for ' ' (both denote whitespace), that '\\' denotes the escape class, and that '/' denotes the character-quote class. The description used to claim that '\\' denoted the character-quote class, and neglected to mention '-' and '/'. * filelock.c (lock_file): Doc fix. 1992-04-27 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callproc.c (init_callproc): Get the default Vexec_path from the environment variable "EMACSPATH"; get Vdata_directory from "EMACSDATA". * ymakefile: Fix #endif and #else comments. 1992-04-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) * ymakefile (xemacs): Link xemacs to temacs if HAVE_SHM. * ymakefile (paths.h, config.h): Never copy, always fail. * process.c (wait_reading_process_input): Redisplay if screen_garbaged. Call do_pending_window_change first. Include dispextern.h. * ymakefile (process.o): Added dependency. * ymakefile (OLDXMENU_OPTIONS): New macro, used compiling oldxmenu. 1992-04-25 Jim Blandy (jimb@pogo.cs.oberlin.edu) * ymakefile: Changed all references to LD_CMD to LINKER, for compatibility with the 18.58 configuration files. * s/aix3-1.h, s/sunos4shr.h: Same here. * ymakefile: Doc fixes. * ymakefile (CC, MAKE): Set these variables from optional macros. Change all uses of `make' to ${MAKE}. * ymakefile: Use HAVE_X11 as alias for X11. * ymakefile (LIB_GCC, GNULIB_VAR): Handle GCC 2. * process.c (allocate_pty): Re-arranged conditionals to put the system-specific-case first, and the generic case in the #else section, for consistency with the rest of Emacs. * process.c (allocate_pty): Wait until we fail to open three ptys in a row before concluding that we've reached the end of the ptys. 1992-04-22 Jim Blandy (jimb@pogo.cs.oberlin.edu) * ralloc.c: #include "getpagesize.h". * search.c (Flooking_at): Use search_regs.num_regs instead of RE_NREGS. As of regex version 0.4, the compiler allocates the registers, and may allocate more than RE_NREGS. (search_buffer): Same. (Freplace_match): Use search_regs.num_regs to tell how many registers are valid. Also note that if none are valid, no search has been performed. (match_limit): Same. (Fmatch_data): Same. (Fstore_match_data): If we're trying to store more registers than search_regs has allocated, re-allocate them to make room. 1992-04-21 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callproc.c (egetenv): Declare the type of VAR. * lisp.h: Don't undefine NULL. There is no longer any conflict. * lisp.h (NUMBERP): New macro. * editfns.c (Fformat): Protect the sections that deal with Lisp_Float objects with a "#ifdef LISP_FLOAT_TYPE". * bytecode.c (Fbyte_code): Use the NUMBERP macro instead of explicitly checking for the Lisp_Float tag. * callint.c (Fcall_interactively): Same here. * xrdb.c (magic_searchpath_decoder): Re-allocate string as needed, rather than making it a fixed-size array. * xfns.c (Fx_rebind_key): Don't declare modifier_list to be a register variable. It's too big, and we need the address of its first element when we pass it to XRebindKeysym anyway. * fileio.c (Fdo_auto_save): Doc fix. 1992-04-20 Jim Blandy (jimb@pogo.cs.oberlin.edu) * search.c (search_buffer): Cast RE_EXACTN_VALUE to char, because the regex-0.4 distribution says so. * ymakefile (dired.o): This depends on regex.h. * process.c (wait_reading_process_input): There is code here which sends SIGIO to Emacs if we thought we had input available but didn't get SIGIO. If the system doesn't have SIGIO, then #ifdef it out. * print.c (Fexternal_debugging_output): Arguments were declared ANSI-style - rewritten in K&R 1 fashion. * floatfns.c (IN_FLOAT): Cast the zero in the `else' clause of the conditional expression to SIGTYPE, to match the type of the float_error call in the `then' clause. * s/hpux8.h: #define HPUX8; this is supposed to be customary procedure, and fileio.c was expecting it, but somehow it didn't get defined. * sysdep.h: Move inclusions of [AIX] <sys/hft.h>, <sys/devinfo.h>, <sys/pty.h>, <unistd.h> [NEED_BSDTTY] <sys/bsdtty.h>, [HPUX and HAVE_PTYS] <sys/ptyio.h>, [SYSV_PTYS] <sys/tty.h>, <sys/pty.h>, and [pfa] <sys/file.h> to systerm.h; also move undefinition of LLITOUT under BSD4_1 to systerm.h. * systerm.h: They're here. * xterm.c (XTcursor_to, XTclear_end_of_line): Declare to return int in the function definitions as well as their declarations. 1992-04-19 Jim Blandy (jimb@pogo.cs.oberlin.edu) * fileio.c (directory_file_name): When checking if the string ends with '/', check that slen is a valid length *before* examining dst[slen-1], not after. 1992-04-18 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xterm.c (x_death_handler): New function. (x_error_handler): Call x_death_handler to shut down Emacs. (x_term_init): Use x_death_handler to handle SIGPIPE, instead of x_error_handler, which expects to be passed a display and an event. * process.c (send_process): This used to set a handler to catch SIGPIPEs when writing to a subprocess, and then set the handler to SIGDFL after writing, but this would stomp on the SIGPIPE handler for for the X connection. So restore the prevous handler instead of changing to SIGDFL. 1992-04-18 Richard Stallman (rms@mole.gnu.ai.mit.edu) * indent.c (compute_motion): Fix skipping invis lines and truncation at right margin. 1992-04-17 Jim Blandy (jimb@pogo.cs.oberlin.edu) * s/hpux.h (PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF): Use pty_name, not ptyname. * s/rtu.h: Same. * process.c (pty_process): Add 'int' to the declaration 'static pty_processes;'. This makes it a happy declaration even when static has been #defined as the empty string. * xterm.c (XTcursor_to, XTclear_end_of_line): Same. * unexec.c (sbrk): Declare this to return void * if __STDC__ is defined, or char * otherwise. * lread.c (init_lread): Re-cleaned logic. To determine whether the load path was changed before dumping, cons up a dump path and compare it. This method is more localized and accurate. (initial_path): Variable removed. (syms_of_lread): Don't staticpro. * floatfns.c (float_error): Declare and define this to return SIGTYPE. * systime.h [HAVE_TIMEVAL] (EMACS_GET_TIME): Declare dummy to be a real struct timezone, instead of an EMACS_TIME. Since HAVE_TIMEVAL is defined, struct timezone ought to be declared, so there's no harm in passing the genuine article. * sysdep.c [USG] (rename): Place under the protection of a new preprocessor symbol, HAVE_RENAME. * s/hpux.h (HAVE_RENAME): Defined. * sysdep.c [USG] (setpriority): Declare to return int, not void. * s/template.h: Add template section for HAVE_TERMIOS. * term.c (cursor_to, raw_cursor_to, fatal): Do declare the types of the arguments. 1992-04-15 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callint.c (Fcall_interactively): When the interactive spec is a string, it may be relocated while reading the arguments. To avoid this, make a copy of the spec to refer to, instead of using a pointer to the data of the spec string. * callint.c (Fcall_interactively): When following the function chain of a symbol, check for quits. 1992-04-13 Jim Blandy (jimb@pogo.cs.oberlin.edu) * lread.c (init_lread): Make the load path default to PATH_LOADSEARCH when we're not dumping (null purify-flag), and PATH_DUMPLOADSEARCH when we are (not (null (purify-flag))). Change from April 7th incorrectly always used PATH_DUMPLOADSEARCH. * lread.c (init_lread): Cleaned up logic; to determine whether the load path was changed before dumping, remember the initial value and compare against it. (initial_path): New variable to support this. (syms_of_lread): staticpro initial_path. * ymakefile: Renamed filenames like "*-dist" to "*.in". * config.h.in: Doc fixes. 1992-04-11 Jim Blandy (jimb@pogo.cs.oberlin.edu) * config.h-dist: Renamed to config.h.in, for consistency with the installation conventions of other GNU programs. * paths.h-dist: Renamed to paths.h.in. 1992-04-11 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) * termcap.c: Declare getenv. 1992-04-08 Jim Blandy (jimb@pogo.cs.oberlin.edu) * Makefile: Renamed to Makefile.in; the configure script will edit this to produce Makefile. 1992-04-07 Jim Blandy (jimb@pogo.cs.oberlin.edu) * paths.h-dist (PATH_DUMPLOADSEARCH): New macro. * lread.c (init_lread): If we're building an Emacs to be dumped, use PATH_DUMPLOADSEARCH as the default load path, so we can correctly find our lisp files. * config.h-dist, paths.h-dist: Added "-*- C -*-" to top lines, so Emacs will know that these are really C source. 1992-04-03 Jim Blandy (jimb@pogo.cs.oberlin.edu) * search.c (syms_of_search): When allocating memory searchbuf.buffer, cast the return value of malloc to unsigned char *, not char *; this changed in the most recent version of the regex code. 1992-03-31 Jim Blandy (jimb@pogo.cs.oberlin.edu) * doc.c (Fdocumentation): Don't forget to end each line of the docstring with "\n\". * process.c (Fprocess_connection): Change "#ifdef 0" around this function to "#if 0". * eval.c (Flet, FletX): Signal an error if one of the let's binding clauses has more than one value form, as in (let ((a 1 2)) a). * eval.c (Ffuncall): Re-install change of March 10; I don't know why it went away. * search.c (compile_pattern): Declare the variable which holds the return value of re_compile_pattern to be const, if this is ANSI C. * alloc.c (xrealloc): Change "ese" to "else". * crt0.c (start1) [sun_soft]: Change 'jst' to 'jsr'. The Sun assembly language manual doesn't list any 'jst' instruction, I don't know of one personally, and all the analogous code around it uses 'jsr'. * crt0.c [m68k]: Merged with GNU C Library's version: added conditionals for sun_68881, sun_fpa, sun_soft. * config.h-dist: Adjusted for renaming of share-lib to etc. * lread.c (read1): Same. * doc.c (Fdocumentation_property, Fsnarf_documentation): Same. * ymakefile: Same. 1992-03-30 Jim Blandy (jimb@pogo.cs.oberlin.edu) * crt0.c: Merged changes from 18.58: [hp9000s300]: Set flag_fpa. Define float_loc. [new hp assembler]: Double flag_fpa and flag_68881 if %d2!=0. (start1): Declare to be static at the top of the file. (_start): Removed static declaration in this function; since everyone wants it, we'll just put it here. 1992-03-20 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c (Finsert_file_contents): Allow quitting from I/O. (Fcopy_file): Likewise. 1992-03-20 Jim Blandy (jimb@pogo.cs.oberlin.edu) * m-intel386.h (HAVE_ALLOCA): Inhibit if C_ALLOCA. (LIB_STANDARD): Alternate USG value if __GNUC__ or C_ALLOCA * alloc.c (xrealloc): If handed a NULL pointer for the block to resize, malloc a new block and return that. Not all reallocs do this. * m/elxsi.h: Doc fix. 1992-03-18 Jim Blandy (jimb@pogo.cs.oberlin.edu) * dispnew.c (Fsleep_for): Call wait_reading_process_input, whether or not we have process support; let the emulator do the work. * emacs.c (fatal_error_signal, Fkill_emacs): Call kill_buffer_processes even when subprocesses is not #defined; we have a stub. * process.c [not defined (subprocesses)] (Fget_buffer_process, init_process, syms_of_process): New stub versions of these functions. * emacs.c (main): Call init_process and syms_of_process whether or not subprocesses is #defined. * xdisp.c (decode_mode_spec): Call Fget_buffer_process whether or not subprocesses is #defined. 1992-03-17 Jim Blandy (jimb@pogo.cs.oberlin.edu) * keyboard.c (kbd_buffer_get_event): Call wait_reading_process_input, even when subprocesses is not #defined, instead of doing a whole lot of hairy SIGIO-pausing stuff. * dispnew.c (Fsit_for): Call wait_reading_process_input, whether or not subprocesses is #defined. * process.c (wait_reading_process_input): Since we're no longer checking for exceptional conditions in the call to select, all of the different ways to call select for different systems have become the same; remove the #if conditionals around this. * keyboard.c (read_char): When returning quit_char because we got an interrupt signal, claim that the character came from the currently selected screen. 1992-03-16 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callproc.c (Fcall_process): Doc fix. * process.c [not defined (subprocesses)] (kill_buffer_processes): New dummy version of this function. * buffer.c (Fkill_buffer): Removed '#ifdef subprocesses' protection from the call to kill_buffer_processes; this is safe whether or not we actually have subprocesses. 1992-03-14 Jim Blandy (jimb@pogo.cs.oberlin.edu) * m/pfa50.h: New file. * process.c (create_process, process_send_signal): Added changes for m/pfa50.h. * sysdep.c: Same. * unexec.c: Same. 1992-03-14 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callproc.c (child_setup): Always put the child in its own process group. 1992-03-13 Jim Blandy (jimb@pogo.cs.oberlin.edu) * mem_limits.h (POINTER): Doc fix. * ralloc.c: Don't #include lisp.h and xterm.h; we no longer need to block input in critical sections. (r_alloc, r_alloc_free, r_re_alloc): Don't use BLOCK_INPUT and UNBLOCK_INPUT; these are no longer needed. (struct bp): Doc fix. 1992-03-11 Jim Blandy (jimb@pogo.cs.oberlin.edu) * ralloc.c (obtain): When deciding how many pages to request, take into account the amount of spare bytes at the end of the current page; let get be ROUNDUP (size - already_available), instead of ROUNDUP (size). (relinquish): Re-organized for clarity. * editfns.c (Fcurrent_time): Updated to return the current time's seconds split into two 16-bit integers (similar to the system used by file-attributes), and the milliseconds. 1992-03-10 Jim Blandy (jimb@pogo.cs.oberlin.edu) * process.c (Faccept_process_output): Add new optional argument TIMEOUT-MSECS, and return non-nil iff we actually got some input from the process(es). (wait_reading_process_input): Make return value indicate whether we got some input from the specified process, when read_kbd is a process, or from any process when read_kbd isn't particular. * indent.c (Fmove_to_column): Pass the correct number of arguments to Findent_to. * eval.c (Ffuncall): If a subr is asking for too many arguments, abort instead of printing an error message; this is an internal flaw in Emacs, and the subr cannot be called. 1992-03-06 Roland McGrath (roland@geech.gnu.ai.mit.edu) * doc.c (Fdocumentation, Fdocumentation_property): Take optional new arg to not pass results thru substitute-command-keys. 1992-03-05 Jim Blandy (jimb@pogo.cs.oberlin.edu) * unexmips.c (unexec): When setting up the data_section header, calculate the size of the section as "brk - data_start," not "brk - DATA_START". 1992-02-23 Jim Blandy (jimb@pogo.cs.oberlin.edu) * fileio.c: #include "systime.h". (Fcopy_file): Use the systime.h macros to copy the time to the new file. * ymakefile: Note that fileio.o depends on systime.h. * ymakefile (dispnew.o): Note that this depends on systerm.h and systime.h. (editfns.o, xterm.o, sysdep.o): Note that this depends on systime.h. (emacs.o, keyboard.o, process.o, sysdep.o): Note that these depend on systerm.h. * systerm.h: Expanded to handle getting and setting terminal parameters: (struct emacs_tty): New structure, which consolidates all of the old tty parameter structures. (EMACS_GET_TTY, EMACS_SET_TTY, EMACS_TTY_TABS_OK): New macros. * sysdep.c (TABS_OK): Definitions of this macro removed; EMACS_TTY_TABS_OK replaces it. (TERMINAL): Definitions removed; now we use struct emacs_tty. [VMS] (input_chan): Renamed to... (input_fd): and defined even when VMS isn't; in that case, we leave it initialized to zero, which is the input tty. This allows us to use the EMACS_GET_TTY and EMACS_SET_TTY for both VMS and Unix. (discard_tty_input): Use struct emacs_tty and its macros instead of TERMINAL. Replace some of conditional with a call to EMACS_GET_TTY. (child_setup_tty): Use struct emacs_tty and its macros instead of TERMINAL and conditionals. (old_gtty, old_ltchars, old_tchars, old_lmode): Replaced by... (old_tty): New variable. (lmode): Made conditional on BSD4_1, since it's only used by the BSD4_1 support code now. (init_sys_modes): Define tty to be a struct emacs_tty, not a TERMINAL. Use macros to get and set parameters for VMS and Unices. Set lmode, tchars, and ltchars along with the rest of the tty state. (tabs_safe_p): Use EMACS_GET_TTY and EMACS_TTY_TABS_OK instead of conditionals. (reset_sys_modes): Use EMACS_SET_TTY to restore the settings from old_tty, instead of using hairy conditionals. * sysdep.c (get_screen_size): Neatened; now each system of reporting the screen size is separated from the rest. * systerm.h (EMACS_HAVE_TTY_PGRP, EMACS_GET_TTY_PGRP, EMACS_GET_TTY_PGRP): New macros to handle setting a tty's current process group. * sysdep.c (setpgrp_of_tty): Use the above, instead of conditionals. * sysdep.c: #include "systerm.h". #ifs that choose #include files moved from here... * systerm.h: to here. * sysdep.c [APOLLO]: We now undefine TIOCSTART not here but... * systerm.h: here. * sysdep.c [BROKEN_TIOCGETC]: We now undefine TIOCGETC not here but... * systerm.h: here. * sysdep.c [BROKEN_FIONREAD]: We now undefine FIONREAD and FASYNC not here but... * systerm.h: here. * process.c (process_send_signal): Steal 18.58's version of this, but incorporate the support for VMS signals. * syssignal.h (EMACS_KILLPG): New macro. * process.c (process_send_signal): Use it. * sysdep.c (sys_suspend): Use it. * syssignal.h (SIGCHLD): If we have SIGCLD and not SIGCHLD, define SIGCHLD as an alias for SIGCLD. * sysdep.c: Remove code for above. * sysdep.c (init_baud_rate): Rather than trying to maintain the illusion of an abstraction with the OSPEED and SETOSPEED macros, just use conditionalized code for each terminal kind. This is the only place we ever need this functionality. (OSPEED, SETOSPEED): Definitions removed. 1992-02-22 Jim Blandy (jimb@pogo.cs.oberlin.edu) * sysdep.c: Moved definition of sigunblock macro to ... * syssignal.h: Here. * hftctl.c: #include <sys/uio.h> before #including <sys/tty.h>. (hfqry, hfskbd): Declare these functions as static before all uses. * unexaix.c (make_hdr, mark_x, copy_text_and_data, copy_sym): Declare as static before all uses. Remove extraneous semicolons from #ifdefs of COFF and XCOFF. (unrelocate_symbols): Cast the initializers of t_start and d_start to ulong. * s/template.h: Include a clause for the HAVE_TERMIO flag. 1992-02-21 Jim Blandy (jimb@pogo.cs.oberlin.edu) * keyboard.c (read_char): Don't clear Vquit_flag when we catch an interrupt and return a quit_char; this change (Mar 21 1991) is too large a change in functionality for the cleanliness it gains. * pwd.h: Renamed to vms-pwd.h, so that we don't get it by accident when we #include <pwd.h> with the `-I.' flag given to the compiler. * editfns.c [VMS]: Changed to include vms-pwd.h instead of pwd.h. * fileio.c [VMS]: Same. * filelock.c [VMS]: Same. * sysdep.c [VMS]: Same. * xrdb.c: Changed to #include "vms-pwd.h" if VMS is defined, instead of including <pwd.h> unconditionally. * window.c (Fset_window_display_table): Rearranged to make etags happy. * xterm.c (XTread_socket): Clear the meta flag from the keypress event before handing it to XLookupString. 1992-02-20 Jim Blandy (jimb@pogo.cs.oberlin.edu) * sysdep.c: No need to test #ifdef TIOCGETP before #undefing it. 1992-02-19 Jim Blandy (jimb@pogo.cs.oberlin.edu) * systime.h: New file. * dispnew.c: #include "systime.h" to get <time.h> or <sys/time.h>, whichever is appropriate, instead of using a conditional. (Fsleep_for, Fsit_for, Fsleep_for_millisecs): Use the systime.h macros instead of HAVE_TIMEVAL conditionals. * editfns.c: #include "systime.h" to get <time.h> or <sys/time.h>, whichever is appropriate, instead of using a conditional. * fileio.c: Same. * process.c: Same. * xterm.c: Same. (wait_reading_process_input): Use the systime.h macros. * sysdep.c: #include "systime.h" to get <time.h> or <sys/time.h>, whichever is appropriate, instead of using a conditional. * m/template.h: Add description of NO_SOCK_SIGIO. * sysdep.c (reset_sys_modes): Doc fix. * keyboard.c (sigfree, sigholdx, sigblockx, sigunblockx) (sigpausex): Definitions moved to syssignal.h. * dispnew.c: Doc fix. * systerm.h: New file, to consolidate the system-dependent terminal-handling trash. * emacs.c: #include systerm.h. (main): Use systerm.h macros instead of conditionals. * dispnew.c: #include systerm.h. (update_screen): Use EMACS_OUTQSIZE instead of the direct ioctl. * keyboard.c: #include systerm.h to get the proper FIONREAD header files, instead of using conditional. * syssignal.h: Added copyright notice. * emacssignal.h: Renamed to syssignal.h, to be like sysdep.c. * data.c, keyboard.c, process.c, sysdep.c, ymakefile: Changed #include directives. 1992-02-15 Jim Blandy (jimb@pogo.cs.oberlin.edu) * m/intel386.h: Don't bother casting the argument to the signal function; the SIGTYPE code in config.emacs ought to take care of this. * buffer.c (record_buffer): Doc fix. 1992-02-13 Jim Blandy (jimb@pogo.cs.oberlin.edu) * s/iris3-6.h: #define HAVE_GETWD. 1992-02-11 Jim Blandy (jimb@pogo.cs.oberlin.edu) * window.c (Fwindow_at): Accept position as two arguments, not a cons of numbers. * window.c (scroll_command): Undo the Jan 31 change; do set the current buffer to the selected window's buffer. A simple set-buffer will make these two different. 1992-02-10 Jim Blandy (jimb@pogo.cs.oberlin.edu) * callproc.c (Fcall_process): Clear synch_process_death and synch_process_retcode to zero before forking the process. * process.c (synch_process_death, synch_process_retcode): Don't declare them extern here. * process.h (synch_process_death, synch_process_retcode): Declare them extern here, along with synch_process_alive. * s/hpux.h: Define CLASH_DETECTION. * window.c (init_window_once): Don't pass any arguments to make_window. * keyboard.c (command_loop_1): Move the label directly_done out of the else block to just after the else block. This shouldn't change the semantics of the code, but appears to avoid a compiler bug on SCO Unix V.3.2v2. * fileio.c (Fset_umask, Fumask): New functions. (syms_of_fileio): defsubr them. * undo.c (Fprimitive_undo): When undoing a deletion with the point before the deleted text, use Finsert_before_markers so that the mark will end up on the other side of the text, if it's in the area at all. * xdisp.c (redisplay): Properly compute TAB_OFFSET for compute_motion. * keyboard.c (command_loop_1): Don't check whether cursor is at edge of screen here. * dispnew.c (direct_output_forward_char): Check here, and return zero if it can't be done. And compare the cursor position to the window boundaries, not the screen boundaries. 1992-02-05 Jim Blandy (jimb@pogo.cs.oberlin.edu) * screen.c (Fscreen_parameters): If the screen has a minibuffer window on another screen, return the window, instead of nil. (store_screen_param): If the value of the minibuffer parameter is a window, try to make it the surrogate minibuffer window. (Qminibuffer): New variable, to support above change. (syms_of_screen): Initialize and staticpro it. * m/tad68k.h: New file. * fileio.c (Ffile_accessible_directory_p): New function. (syms_of_fileio): defsubr it. * callproc.c: #include <errno.h>. (child_setup): Accept yet another argument, current_dir. Don't try to report an error here if current_dir is inaccessible; this function is called in a vforking process. Just have the process exit with an error code. (Fcall_process): Make sure that the current directory is okay here, before we fork. Pass the current_dir argument. * process.c (create_process): Same here. * callproc.c (Fcall_process): Don't assign into args[1] when nargs < 2. Instead, use a new variable called infile. Re-arranged logic which processes the BUFFER argument. 1992-02-03 Jim Blandy (jimb@pogo.cs.oberlin.edu) * fileio.c (Fexpand_file_name): Doc fix. * scroll.c (line_ins_del): Since we're calculating the array from end to beginning, make the indices go that way, and thus clearly get the right boundary. This used to ignore the [0] element, and write in the [screen_height] element, which doesn't exist. 1992-02-03 Richard Stallman (rms@mole.ai.mit.edu) * xdisp.c (redisplay, try_window_id): Special case for change at beginning of line, if using selective display. 1992-01-31 Jim Blandy (jimb@pogo.cs.oberlin.edu) * m/delta88k.h: Added USUAL-OPSYS information, for the config.emacs script to use. * window.c (scroll_command): Don't bother setting the current buffer to the selected window's buffer; this should always already be the case. Add check just in case. * indent.c (compute_motion): Don't pack vpos and hpos into one int; use separate variables hpos/vpos and prev_hpos/prev_vpos. (vmotion): Use largest int as tovpos arg to compute_motion. 1992-01-30 Jim Blandy (jimb@pogo.cs.oberlin.edu) * window.c: #include "keyboard.h" to get the Qmode_line and Qvertical_split declarations. * ymakefile (window.o): Note that this depends on keyboard.h. * callproc.c (getenv_internal): Cast the pointer to the variable's value to a char *; elisp strings are unsigned char *'s. And valuelen is an int *, not an int **. * scroll.c (do_scrolling): Document meaning of enable flag in temp_screen. 1992-01-30 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m-orion105.h (C_DEBUG_SWITCH, LIBS_DEBUG): Defs deleted. 1992-01-29 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m-iris4d.h (C_SWITCH_MACHINE): New definition. 1992-01-28 Jim Blandy (jimb@pogo.cs.oberlin.edu) * term.c: #include "keyboard.h", for Vfunction_key_map. * keyboard.h: Declare Vfunction_key_map. * keyboard.h: New file, for external declarations used in processing keyboard input and events. * lisp.h (Qmode_line, Qvertical_split, num_input_chars) (poll_suppress_count): Extern declarations moved to keyboard.h. * keyboard.c: #include "keyboard.h". (Qvscrollbar_par, Qvslider_part, Qvthumbup_part) (Qvthumbdown_part, Qhscrollbar_part, Qhslider_part) (Qhthumbleft_part, Qhthumbright_part): Moved declarations here from xfns.c, so they're with the other event heading symbols. * eval.c: #include "keyboard.h". * ymakefile (callint.o, keyboard.o, keymap.o, xfns.o, eval.o): Note that these depend on keyboard.h. * xfns.c: The above symbols aren't here any more. #include "keyboard.h" to get them. (syms_of_xfns): Don't initialize or staticpro them. * keyboard.h: Added extern declarations for the above. * callint.c: #include "keyboard.h". * xfns.c (Vmouse_screen_part): Variable removed, no longer used. (syms_of_xfns): Changed accordingly. * xterm.c (Qmouse_moved): Variable removed, no longer used. (Qmouse_click, Qscrollbar_click): Removed. These are now event types, in keyboard.c and keyboard.h; they're no longer used in this way. (Vmouse_window, Vmouse_screen_part): Extern declarations removed. (XTread_socket): Don't assign to Vmouse_window or Vmouse_screen_part. (syms_of_xterm): Changed accordingly. * keyboard.h (EVENT_HAS_PARAMETERS, EVENT_HEAD, EVENT_WINDOW) (EVENT_BUFFER_POSN, EVENT_SCROLLBAR_BUTTON, EVENT_WINDOW_POSN) (EVENT_TIMESTAMP, EVENT_HEAD_UNMODIFIED, EVENT_HEAD_KIND): New macros to recognize and access events that have parameters, like mouse events. * keyboard.c (read_char, echo_char, Fmouse_click_p) (read_key_sequence): Use them. * keymap.c: #include "keyboard.h". (access_keymap, store_in_keymap, Fsingle_key_description): Use the macros from keyboard.h. * keyboard.c (Qevent_kind): New symbol, naming the property of an event header where we put the event's type. (Qfunction_key, Qmouse_click, Qscrollbar_click): New symbols, used to tag different kinds of events. (Qevent_unmodified): New symbol, naming the property of an event header where we put an unmodified version of the event header. (modify_event_symbol): Take a new argument, SYMBOL_KIND, whose value should be put on the Qevent_kind property of each symbol we make. Set the Qevent_unmodified property of each symbol we make. (make_lispy_event): Pass the appropriate SYMBOL_KIND argument to modify_event_symbol. (struct event_head, head_table): New tables, to simplify the initialization of some of the event heads. (syms_of_keyboard): Initialize and staticpro the symbols given in head_table, and put the Qevent_kind and Qevent_unmodified properties on them. Initialize all of the new symbols listed above. * keyboard.c (lispy_function_keys, lispy_mouse_names): Renamed these from function_key_names and mouse_names, and moved them outside of make_lispy_event, since static doesn't work on all systems, and these can't be automatic. 1992-01-28 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fileio.c (Fwrite_region): Remove Alliant conditional. * crt0.c: Conditionals for ALLIANT_2800. * m/alliant-2800.h: New file. * unexfx2800.c: New file. * m-mips4.h (C_DEBUG_SWITCH): Alternate defn for GCC. * sysdep.c [VMS] (sys_write): Special case for fixed-length with carriage-control characters. * s/isc2-2.h (NOMULTIPLEJOBS): Undef this. (LIB_STANDARD): Add -lPW. (LIBS_SYSTEM): Defined. * m/intel386.h (signal): Optionally don't define it. 1992-01-27 Jim Blandy (jimb@pogo.cs.oberlin.edu) * s/template.h: Document the SIGTYPE macro. * s/bsd4-3.h: Define the SIGTYPE macro. * data.c (Fsymbol_value): Extract all the innards of this function into find_symbol_value, except the code which signals an error. (find_symbol_value): New function. * lisp.h (find_symbol_value): Declare it. * keymap.c (current_minor_maps): Use it, instead of a call to Fboundp and Fsymbol_value per every minor map, for every key sequence read. * xterm.c (x_make_screen_visible): Don't raise the window. This causes the window to pop to the front every time a message appears, which isn't desirable. * screen.c (Fselect_screen, Fdelete_screen, Fset_mouse_position) (Fmake_screen_visible, Fmake_screen_invisible, Ficonify_screen) (Fdeiconify_screen, Fscreen_parameters, Fmodify_screen_parameters) (Fset_screen_height, Fset_screen_width, Fset_screen_size) (Fset_screen_position): Use SCREEN_IS_X macro instead of testing for output_x_window. * xfns.c (adjust_scrollbars, Fx_store_cut_buffer): Same. 1992-01-25 Jim Blandy (jimb@pogo.cs.oberlin.edu) * term.c (term_get_fkeys): New function. (term_init): Call term_get_fkeys. 1992-01-21 Jim Blandy (jimb@pogo.cs.oberlin.edu) * editfns.c (Ffollchar, Fprevchar): Renamed to Ffollowing_char and Fprevious_char, for consistency. Renamed Sfollchar and Sprevchar too. (syms_of_editfns): Fixed defsubrs. * lisp.h (Ffollchar, Fprevchar): Renamed extern declarations as above. * editfns.c (Ffollowing_char): Return 0 at the end of the buffer, as advertised. Doc fix. (Fprevious_char): Doc fix. * config.h-dist: Rearranged to define user parameters before including the machine and opsystem files, so the files can have conditionals on the parameters. 1992-01-15 Jim Blandy (jimb@pogo.cs.oberlin.edu) * keyboard.c (read_key_sequence): When expanding a function key recognized with Vfunction_key_map, don't scan the expansion for further function key sequences. * keyboard.c (Vfunction_key_map): Real declaration moved to keymap.c; this declaration made extern. (syms_of_keyboard): DEFVAR and initialization of Vfunction_key_map moved to keymap.c, since it should be initialized to a keymap, but we don't want to rely on Qkeymap being initialized now. * keymap.c (Vfunction_key_map): Variable moved here. (syms_of_keymap): DEFVAR and init here. * keymap.c (Fglobal_key_binding): Doc fix. 1992-01-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m-delta88.h: New file. * window.c (window_scroll): New arg `noerror'. (scroll_command, Fscroll_other_window): Pass that arg. 1992-01-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) * process.c (sigchld_handler): Set synch_process_death and synch_process_retcode. 1992-01-14 Jim Blandy (jimb@pogo.cs.oberlin.edu) * config.h-dist (SIGTYPE): New macro to help give signal handlers the correct type. * s/usg5-3.h (SIGTYPE): Define this to be void. * dispnew.c (window_change_signal): Declare this to return SIGTYPE. * emacs.c (fatal_error_signal): Same. * data.c (arith_error): Same. * process.c (create_process_1, send_process_trap, create_process_sigchld, sigchld_handler): Same. (create_process): Declare sigchld according to SIGTYPE. This means we don't have to cast the return value of signal. * keyboard.c (input_poll_signal, interrupt_signal): Declare these to return SIGTYPE. (kbd_buffer_store_event): Include a forward declaration for interrupt_signal here. * sysdep.c (struct save_signal): Say the handler returns SIGTYPE instead of int. (save_signal_handlers): So we don't have to cast the return value from signal here. (sys_suspend): Declare oldsig according to SIGTYPE. (select): Declare old_trap using SIGTYPE. (select_alarm, wait_for_termination_signal): Declare these to return SIGTYPE. * emacs.c: #include <termios.h>, if we have it. (fatal_error_signal): If we have termios, use tcgetpgrp to get the terminal's process group. * process.c: If we have termios, #include <termios.h> instead of <termio.h>. (process_send_signal): If we have termios, use tcgetpgrp to get the terminal's process group. Have gid default to the child's pid, to simplify the logic below. * sysdep.c (flush_pending_output): If we are using termios, make this function a no-op; since we're not in the tty's pgroup, we would get a SIGTTIN. 1992-01-13 Jim Blandy (jimb@pogo.cs.oberlin.edu) * config.h-dist: Removed MAINTAIN_ENVIRONMENT clause. * callproc.c: Removed support for MAINTAIN_ENVIRONMENT. (init_callproc): Use getenv instead of egetenv to initialize Vshell_file_name. * emacs.c (decode_env_path): Use getenv instead of egetenv * lisp.h: Removed support for MAINTAIN_ENVIRONMENT. * process.c: Same. * ymakefile: Same. * dispnew.c (init_display): Call getenv instead of egetenv. * editfns.c (Fgetenv): Function moved... * callproc.c (Fgetenv): To here, and made to scan Vprocess_environment instead of using the usual C getenv function. (getenv_internal): New function. (egetenv): New function. * lisp.h: Added extern declaration for egetenv. * editfns.c (syms_of_editfns): Adjusted. * callproc.c (syms_of_callproc): Adjusted. * window.h (minibuf_prompt_width): Declare this extern here, after minibuf_prompt. minibuf.c: Don't extern declare it here. indent.c: As above. * dispnew.c (buffer_posn_from_coords): If there is a prompt in the minibuffer, account for its width when computing the buffer position. * Makefile (doall): Explicitly export CC to the xmakefile. * ymakefile: Use /* */ around comments; # confuses cpp. * ymakefile: Note that ralloc.o depends on mem_limits.h, xterm.h, and config.h. Note that vm-limit.o depends on mem_limits.h. * lread.c (read_escape): Return \a as '\007', not '\a'; the latter isn't portable, and this routine would have to be revised anyway to deal with anything other than ASCII. * keymap.c (current_minor_maps): Rewritten not to use function-local static variables, to accomodate DGUX. * xterm.h (UNBLOCK_INPUT): Replace "abort ()" with "(abort (), 0)", to avoid type conflicts on odd systems like Ultrix. * xrdb.c: Include <sys/types.h>, and declare getuid to return uid_t. * xdisp.c (redisplay_window): Use SET_PT macro instead of assigning to point. insdel.c (insert_from_string): Same. * xterm.c (XTcursor_to): Declare it static at the function definition, as well as at the top of the file. (dumpglyphs): Removed declarations for buf and cp; these variables are never used. * lisp.h (NULL): Renamed to NILP, so as not to conflict with <stdio.h>, and <stddef.h>. All callers changed; all #undefinitions of NULL removed. 1992-01-12 Jim Blandy (jimb@pogo.cs.oberlin.edu) * xdisp.c (message): #ifdef NO_ARG_ARRAY, make a local block to declare the explicit argument array. * config.h-dist: Instead of reaching the machine- and system-dependent files through symlinks, replace the strings 1992-01-09 Jim Blandy (jimb@pogo.cs.oberlin.edu) * keyboard.c (stuff_buffered_input): Don't forget to increment kbd_fetch_ptr while looping through kbd_buffer. 1992-01-08 Jim Blandy (jimb@occs.cs.oberlin.edu) * keyboard.c (read_avail_input): Don't forget to fill in the screen field in events read from the terminal. * sysdep.c (kbd_input_ast, read_input_waiting): Call kbd_buffer_store_event with a `struct input_event *', not a character or a Lisp_Object. 1991-12-21 Jim Blandy (jimb@occs.cs.oberlin.edu) * bytecode.c (docall): Don't remove protection from the arguments to Ffuncall. 1991-12-20 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (Vfunction_key_map): New variable. (read_key_sequence): Changed to recognize and substitute bindings in Vfunction_key_map at any point in the sequence, unless they conflict with ordinary bindings. (syms_of_keyboard): DEFVAR, document, and initialize Vfunction_key_map. 1991-12-19 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keymap.c (Vminor_mode_map_alist): New variable, to support keymaps for minor modes. (current_minor_maps, Fminor_mode_key_binding, Fcurrent_minor_mode_maps): New functions. (Fkey_binding): Rewritten to scan for minor mode bindings too. (syms_of_keymap): DEFVAR, document, and initialize Vminor_mode_map_alist, and defsubr the new Ffunctions. (describe_buffer_bindings): Describe the bindings established by minor modes too. * keyboard.c (follow_key): New function, to support... (read_key_sequence): Completely rewritten to handle scanning an arbitrary number of keymaps at a time. * keyboard.c (Fread_key_sequence): GCPRO keybuf, since it can hold lisp expressions while waiting for input. Don't pass too many arguments to read_key_sequence. (command_loop_1): Don't pass too many arguments to read_key_sequence. * keyboard.c (add_command_key): New function; there are several places that add keys to this_command_keys, so we make one function to do the work. (read_char, Fexecute_extended_command): Call add_command_key instead of writing out its code again. (init_keyboard): Allocate this_command_keys according to this_command_keys_size. * lread.c (read1): Change comment to use `share-lib' instead of `etc'. * doc.c (Fdocumentation_property, Fsnarf_documentation): Update docstring similarly. (Fsnarf_documentation): Use "../share-lib/" instead of "../etc/" to find doc file while dumping. * unexaix.c: Similar doc fix. * ymakefile (etcdir): Variable removed. (libsrc, archlib, sharelib): New variables, to take the place of etcdir. 1991-12-18 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * ymakefile (CFLAGS): Don't automatically include C_DEBUG_SWITCH in the value for CFLAGS; the configuration script will take care of choosing the debugging and optimization switches. * config.h-dist: Copy the GLYPH definitions from config.h to here. 1991-12-16 Richard Stallman (rms@mole.gnu.ai.mit.edu) * abbrev.c (Fexpand_abbrev): Run pre-abbrev-expand-hook. (syms_of_abbrev): Define that variable. 1991-12-13 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * m/m-*.h: Since the m- is now redundant, renamed all files to remove it, and changed references within files. * s/s-*.h: Same business. 1991-12-11 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * config.h-dist (MULTI_SCREEN): Define this automatically when we're using a window system. 1991-12-09 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * m/m-*.h (i.e. all machine config files): Added USUAL-OPSYS comments to tell the configuration script what sort of operating system this machine typically runs. * config.h-dist (MScreenWidth, MScreenLength): Deleted; no longer used. 1991-12-08 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * editfns.c (Fcurrent_time): New function, to return the current time as a number, like the Unix time(3) function. This might be fun to port. (syms_of_editfns): defsubr it. 1991-12-05 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keymap.c (Vminor_mode_map_alist): New variable. (current_minor_maps): New function. (Fcurrent_minor_mode_maps): New function. (syms_of_keymap): DEFVAR, document, and initialize Vminor_mode_map_alist, and defsubr Fcurrent_minor_mode_maps. * callproc.c (Vdata_directory): New lisp variable, for the directory containing architecture-independent data files. (init_callproc): Initialize Vdata_directory from PATH_DATA, and make sure it exists. Renamed execdir to tempdir, because we use it for both Vexec_directory and Vdata_directory. (syms_of_callproc): Doc fix for Vexec_directory, new DEFVAR_LISP for Vdata_directory. * paths.h-dist (PATH_DATA): New path macro, to initialize Vdata_directory. * doc.c (get_doc_string): Use Vdata_directory to find the docstrings, not Vexec_directory. * lisp.h (Vdata_directory): New extern declaration, for above users. * config.h-dist: Changed references to ../etc to ../share-lib. * callint.c (Fcall_interactively): For the 'k' interactive code, cast the type of the symbol name before passing it to error. 1991-12-02 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (make_lispy_movement): Move call to mouse_position_hook from here... (kbd_buffer_get_event): To here, for symmetry with non-movement events. * keyboard.c (kbd_buffer_get_event): Set Vlast_event_screen for mouse movements, too. 1991-11-27 Jim Wilson (wilson@wookumz.gnu.ai.mit.edu) * alloca.c (alloca): Add parens to make precedence clearer. 1991-11-26 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) * search.c: Need to include sys/types.h because of recent mod to regex.h. 1991-11-25 Richard Stallman (rms@mole.gnu.ai.mit.edu) * bytecode.c: BYTE_CODE_METER and BYTE_CODE_SAFE undefined by default. (METER_CODE): Define same name whether metering or not. (BinsertN): New byte code. (Fbyte_code): Improve overflow/underflow error messages. (docall): Put back previously lost code to remove protection from funcall args. 1991-11-25 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * lisp.h (make_array): New extern declaration. * alloc.c (make_sequence): Renamed to make_array; more accurate. * keyboard.c (Fread_key_sequence, Fthis_command_keys): Callers fixed. * macros.c (Fend_kbd_macro): Callers fixed. 1991-11-15 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (cmd_error): If an error occurs before somebody has provided a screen to print it on, print it to stderr and exit Emacs. Handle batch-mode errors with the same code. * lisp.h (Qexternal_debugging_ouput): New extern declaration, for use in cmd_error. * screen.c (Fscreen_pixel_size, Fset_screen_position): Doc fix. * window.c (Fwindow_at): Typecheck COORDINATES more thoroughly. * screen.c (read_mouse_position): Function deleted. (Fread_mouse_position): Renamed to Fmouse_position, and changed to use mouse_position_hook. (syms_of_screen): Adjusted accordingly. * xfns.c (x_read_mouse_position): Function deleted. * screen.h (SCREENP): The non-MULTI_SCREEN case used to say this was false for all objects, but it should be true for the terminal screen, so make its definition the same as in the MULTI_SCREEN case. * screen.h (SCREEN_LIVE_P): New predicate. (CHECK_LIVE_SCREEN): New type-checking macro. (Qlive_screen_p): New error-reporting symbol. * screen.c (Qlive_screen_p): Declare the new symbol. (Flive_screen_p): New lisp predicate. (syms_of_screen): Initialize, staticpro, and defsubr the lot. * dispnew.c (Fredraw_screen): Use CHECK_LIVE_SCREEN. * screen.c (Fscreen_root_window, Fscreen_selected_window) (Fnext_screen, Fset_mouse_position, Frestore_screen_configuration) (Fmake_screen_visible, Fmake_screen_invisible, Ficonify_screen) (Fdeiconify_screen, Fscreen_visible_p, Fredirect_screen_focus) (Fscreen_focus, Fmodify_screen_parameters, Fset_screen_height) (Fset_screen_width, Fset_screen_size, Fset_screen_position) (Fselect_screen): Use CHECK_LIVE_SCREEN. * window.c (Fwindow_at, Fcurrent_window_configuration): Use CHECK_LIVE_SCREEN. * xfns.c (Ffocus_screen, Fx_pixel_width, Fx_pixel_height): Use CHECK_LIVE_SCREEN. * screen.c (Fdelete_screen): Do nothing if SCREEN is already deleted. * screen.c (Qscreenp): Staticpro this symbol. * xfns.c (Fx_create_screen): Doc fix. * xfns.c (Fx_create_screen): Give the screen a minibuffer if the 'minibuffer parameter is t or nil; nil is the default value for omitted parameters, and t is intuitive. 1991-11-14 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * eval.c (specbind): Check that the thing being bound is a symbol. (funcall_lambda): Signal an invalid-function error if the arguments are not all symbols. 1991-11-08 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.c (Fselect_screen): Don't select dead screens. * print.c (print): Print dead screen objects starting with "#<dead screen". * keyboard.c (read_key_sequence): Make sure that the compound events actually have valid window fields. * window.c (next_screen_window): Function deleted; Fnext_window can now do its job properly. (window_from_coordinates, window_loop): Call Fnext_window instead of next_screen_window. * xdisp.c (redisplay): Don't clear out minibuffer windows in the midst of the screen loop here. That's confusing. (redisplay_window): Since this needs special code to detect minibuffers anyway, put it here. And clear all the lines of a multi-line minibuffer, not just the first one. 1991-11-07 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.c (Fdelete_screen): When searching Vscreen_list for a new value for last_nonminibuf_screen, remember that the screens live in the cars of the list, not the cdrs. * xterm.c (x_make_screen_visible): Rearranged for clarity. * xdisp.c (echo_area_display): Rearranged for clarity. 1991-11-06 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.c (next_screen, prev_screen): New meaning for MINI_SCREEN argument helps implement the behavior of Fnext_window. (Fnext_screen): Document the new behavior. * screen.c (make_minibuffer_screen): Do set has_minibuffer for minibuffer-only screens. (Fscreen_parameters): Correctly generate value of minibuffer parameter using SCREEN_HAS_MINIBUF and SCREEN_MINIBUF_ONLY_P. * screen.h (SCREEN_HAS_MINIBUF): New predicate. * dispnew.c (change_screen_size): Use it. * screen.c (Fdelete_screen): Use it. * screen.c (Vglobal_minibuffer_screen): Renamed Vdefault_minibuffer_screen to better describe its significance. (make_screen_without_minibuffer, syms_of_screen): Adjusted. * xfns.c (Fx_create_screen): Doc string adjusted. * xdisp.c (display_mode_line): Make the code which names the screen after the current buffer not depend on Vglobal_minibuffer_screen. * xterm.c (Vglobal_minibuffer_screen): Don't declare this extern here; it's never used. 1991-11-05 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.c (Fdelete_screen): Document the fact that surrogate minibuffer screens may not be deleted. * screen.h (SCREEN_MINIBUF_ONLY_P): New predicate, true iff the screen's only window is a minibuffer, aka a "minibuffer screen" or a "minibuffer-only" screen. * dispnew.c (change_screen_size): Use it. * screen.c (Fselect_screen, next_screen, prev_screen) (Fdelete_screen): Use it. * window.c (Fdisplay_buffer): Use it. * screen.c (next_screen, prev_screen): Make MINIBUF a lisp boolean, not a C boolean. (Fnext_screen, Fdelete_screen): Changed to fit. * window.c (Fnext_window, Fprevious_window): Changed to fit. * screen.c (make_screen_without_minibuffer): Error string improvement. * screen.c (syms_of_screen): Doc grammar fix for Vemacs_iconified. * screen.c (next_screen): Added some sanity checks, rewrote comments. * screen.h (Vglobal_minibuffer_screen): Don't declare this. It shouldn't be used for anything but screen creation. * window.c (Fminibuffer_window): Vglobal_minibuffer_screen is not necessarily the screen containing the current minibuffer window. Also, call choose_minibuf_window; it does much of the work here. (Fnext_window): Used to insist on looping through all screens if Vglobal_minibuffer_screen was non-nil. Now includes screen's minibuffer window according to MINIBUF, no matter what screen it's on, and ignores Vglobal_minibuffer_screen. Loop termination logic cleaned up. Clarified doc string. (Fprev_window): Same problems as Fnext_window, above. * screen.c (Vglobal_minibuffer_screen): Documentation rewritten to emphasize that it is only a parameter of the creation of minibufferless screens, and not an indication of where the minibuffer is. (prev_screen): Used to assume that Vglobal_minibuffer_screen was the only minibuffer-only screen, and would enter an infinite loop if Vglobal_minibuffer_screen was the only screen in the list. Rewritten to fix these problems. * minibuf.c (Vglobal_minibuffer_screen): Don't declare it extern here; it's not used. * editfns.c (Fmessage): Don't call Fmake_screen_visible here. * xdisp.c (message, message1): Call it here, so that Emacs C functions like Fy_or_n_p make the screen visible too. 1991-11-04 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (readable_events): If EVENT_QUEUES_EMPTY, we can short-circuit and say no. Otherwise, if do_mouse_tracking, we can short-circuit and say yes. These things let us scan the event queue less often. * termhooks.h (mouse_tracking_enable_hook): Replaced by... (mouse_moved, mouse_position_hook): It turns out that it is possible and no less efficient simply to tell Emacs if the mouse has moved since last noticed, and let it ask for the current mouse position; X's pointer motion hints are a cool thing. * term.c (mouse_tracking_enable_hook): Replaced by... (mouse_position_hook): New, simpler interface. * keyboard.c (struct movement, movement_buf, movement_ptr): Replaced by... (mouse_moved): This flag, to be used in conjuction with mouse_position_hook. (EVENT_QUEUES_EMPTY): Adjusted to use mouse_moved instead of movement_buf and movement_ptr. (tracking_off, Ftrack_mouse): Don't call mouse_tracking_enable hook. (note_mouse_position): Moved to xterm.c. (get_mouse_position): Replaced by mouse_position_hook. (make_lispy_event): Movement event generation code moved out to a separate function... (make_lispy_movement): Create a mouse movement event for the current mouse position. Use mouse_position_hook instead of get_mouse_position. Added static declaration for this above... (kbd_buffer_get_event): Use mouse_moved instead of movement_buf and movement_ptr. Call make_lispy_movement instead of make_lispy_event. (init_keyboard): Initialize do_mouse_tracking. Don't init movement_ptr and movement_buf. * xterm.h (STANDARD_EVENT_SET): Add PointerMotionMask and PointerMotionHintMask to the set. * xterm.c (pixel_to_glyph_translation): Renamed to pixel_to_glyph_coords, made static, simplified to take advantage of constant-size characters, and extended to return the bounding rectangle of the glyph returned. (construct_mouse_click): The 'button' field of a button event is the button number, not a mask; convert it to a mask before frobbing x_mouse_grabbed. Call pixel_to_glyph_coords properly. (last_mouse_screen, last_mouse_glyph): New variables, to keep track of when the pointer has moved to a different glyph. (note_mouse_position): Moved here from keyboard.c and made static. Check if the new mouse position is over a new glyph. If it is, set mouse_moved flag; otherwise, call XQueryPointer to get the next motion event. (XTmouse_tracking_enable): No longer needed, since pointer motion hints let us implement the simpler mouse position hook. (XTmouse_position): New hook. Call XQueryPointer to get the current mouse position and request notification about the next mouse movement. Clear the mouse_moved flag. (pixel_to_glyph_coords, construct_mouse_click, note_mouse_position, XTmouse_position): Put these all on the same page. (XTread_socket): Case MotionNotify, call note_mouse_position with the right args; don't call pixel_to_glyph_translation. (x_term_init): Set mouse_position_hook instead of mouse_tracking_enable_hook. 1991-10-31 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xdisp.c (redisplay_window): When trying to avoid starting display at the end of the buffer: check that startp < ZV, not startp <= ZV. 1991-10-29 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xterm.c (x_do_pending_expose, XTmouse_tracking_enable): Use SCREEN_IS_X instead of testing output_method directly. 1991-10-26 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xdisp.c (redisplay): In the single-screen optimization, always update the minibuffer's screen as well as the selected screen, no matter what the echo_area_glyphs are. This makes sure that messages get cleared after a keystroke. 1991-10-25 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * callint.c (Finteractive): Doc fix. * xterm.c (XTmouse_tracking_enable): Block input while changing the screens' input selection masks. * window.c (change_window_height): If the window being resized is the only window of the screen, no size change is possible; make the delta be zero. Exit without "changing" the sizes of any windows if the delta is zero. * alloc.c: Don't bother to include xterm.h. (Fgarbage_collect): Don't bother to BLOCK_INPUT here, since we don't cons in the input handler. 1991-10-21 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * window.c (init_window_once): Set last_nonminibuf_screen to the initial terminal screen, so that poor Fdisplay_buffer doesn't try to create a new screen on a terminal. 1991-10-19 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m-intel386.h (signal): Optionally don't define it. * s-isc2-2.h (DONT_DEFINE_SIGNAL): Define this. 1991-10-18 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * scroll.c (line_ins_del): Don't calculate costs off the end of mf and ov; use < in loop condition, not <=. * scroll.c (scroll_cost): Logic rearranged. * dispnew.c (change_screen_size): Change "SCREEN_IS_TERMCAP (screen) == output_termap" to "SCREEN_IS_TERMCAP (screen)" (window_change_signal): Use SCREEN_IS_TERMCAP predicate instead of testing output_method_directly. 1991-10-15 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xterm.h (STANDARD_EVENT_SET): Include ButtonReleaseMask in STANDARD_EVENT_SET. * xterm.c (XTmouse_tracking_enable): Don't bother or'ing ButtonReleaseMask with the STANDARD_EVENT_SET. * dispnew.c (buffer_posn_from_coords): If the coordinates are off past the end of a line, return them as being *before* the newline, not after. * keyboard.c (kbd_buffer_get_event): Set input_pending after reading the event, no matter what sort of event it is - i.e., move the assignment to input_pending outside of the event lispifying conditional. * keyboard.c (note_mouse_position): Don't record a "new" mouse position unless it really differs from the last one returned. * keyboard.c (kbd_buffer_read_char): Renamed to kbd_buffer_get_event, for consistency with kbd_buffer_store_event. * window.c (Fwindow_at): Modified to take the coordinates as a pair, not a two-element list, for ease of use and compatibility with events. Make SCREEN argument second and optional. (Fcoordinates_in_window_p): Modified to take and return the coordinates as above, and to distinguish the right border as well as the mode line. (window_from_coordinates): Modified to distinguish the right border as well as the mode line. * lisp.h (Qmode_line, Qvertical_split): Declare this extern, from keyboard.c. * keyboard.c (make_lispy_event): Distinguish a window's right border from its text area. * window.c (coordinates_in_window): Make it static. * window.c (Flocate_window_from_coordinates): Renamed to Fwindow_at. (syms_of_window): Adjusted. * lisp.h: Adjusted to say so. * screen.c (Fcoordinates_in_window_p, window_from_coordinates, Flocate_window_from_coordinates): Functions moved to window.c. (syms_of_screen): Adjusted. * window.c (Fcoordinates_in_window_p, window_from_coordinates, Flocate_window_from_coordinates): Here they are. (syms_of_window): Adjusted. * lisp.h: Adjusted to say so. 1991-10-14 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xterm.c (XTclear_end_of_line): This used to try to get the cursor out of the way by comparing the line being cleared with s->cursor_y, which is meaningless; it should have compared it with s->phys_cursor_y. Changed to just mark the cursor as cleared if it's in the area we're clearing. 1991-10-13 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m-intel386.h: Fix typo in #endif. 1991-10-12 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * callint.c (Fcall_interactively): Added new interactive spec 'K', for mouse clicks. Added explanation to doc string. Removed 'e' spec, which didn't work with the new input model anyway. * keyboard.c (Fmouse_click_p): New function. (syms_of_keyboard): defsubr it. * keyboard.c (EVENT_QUEUES_EMPTY): Clarified comment. (tracking_off): Change "if (!readable_events)" to "if (!readable_events ())". (Ftrack_mouse): Doc fix. (kbd_buffer_read_char): Fix brainos in tossing of unwanted events. Don't use EVENT_QUEUES_EMPTY to set input_pending; call readable_events. 1991-10-11 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (Qmode_line): New quoted symbol. (syms_of_keyboard): Initialize and staticpro it. (make_lispy_event): Use it to indicate when a mouse position is in a window's mode line. * xterm.c (XTread_socket): Consider the window to be resized if either the character or pixel dimensions have changed; this will catch font size changes. 1991-10-08 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * process.c (wait_reading_process_input): Removed all the exceptional condition stuff. Emacs lacks any way to respond to such a state, and selecting for it without responding to it can make Emacs loop indefinitely. * xterm.c (XTread_socket, construct_mouse_click): Make sure that all enqueued events have their timestamp field set. * termhooks.h (struct input_event): Doc fix. * keyboard.c (last_event_timestamp): New variable. (get_mouse_position, kbd_buffer_store_event, kbd_buffer_read_char): Make sure to fill in Vlast_event_screen and last_event_timestamp. * xselect.c (mouse_timestamp): Don't use this anymore. (last_event_timestamp): Use this instead. (Fx_own_selection, Fx_own_clipboard, Fx_get_selection) (Fx_get_clipboard): Use last_event_timestamp instead of mouse_timestamp. * xdisp.c (redisplay): Don't pass extra arguments to update_screen. * keyboard.c (echo_truncate): Don't call echo here; this results in extraneous echoing of characters. (read_key_sequence): After calling echo_truncate, call echo_char to put the character we just read into the minibuffer, if appropriate. * keyboard.c (read_key_sequence): Removed unused argument no_redisplay. 1991-10-01 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xfns.c (x_create_screen): Initialize phys_cursor_x to -1, to indicate that the screen has no displayed cursor. * xfns.c (x_create_screen): Let InternalBorderWidth default to 1. * xterm.c (x_display_bar_cursor): Declare this to be static void. * xterm.c (XTupdate_begin): Don't turn off the cursor. This makes ugly flickering. Instead, make it okay for XTins_del_lines to do so: * screen.h (struct screen): New field phys_cursor_glyph, keeping track of the glyph under the currently displayed cursor. Since current_glyphs is sometimes inaccurate when we want to undraw the cursor (as when XTins_del_lines is called from do_scrolling), we can't always get the GLYPH from there. * xterm.c (x_draw_single_glyph): Take the glyph to draw as an argument, instead of taking it from the screen matrix. (x_display_box_cursor): Set and use s->phys_cursor_glyph. * ymakefile: Note that scroll.o and xmenu.o depend on screen.h. 1991-09-29 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (make_lispy_event): When building mouse movement event, use `m', not `event', dummy. 1991-09-26 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.c (Fscreen_parameters): Return the proper value for the 'minibuffer parameter for minibuffer-only screens. * xdisp.c (redisplay_window): When the start position is forced, constrain it to be within the visible region anyway. * xterm.c (XTwrite_glyphs): Instead of turning off the cursor before we write, just notice if we wrote over it. * xfns.c (x_decode_color): If a screen has two planes, then it is considered a color screen, and we should look up the color value. * ymakefile: Include xselect.o and xrdb.o in XOBJ even when HAVE_X_MENU is not defined. * fns.c (Fdelete): This used to be named Fdelq; Roland forgot to change the function name in his August 17 change. (syms_of_fns): defsubr Fdelete. 1991-09-24 Richard Stallman (rms@mole.gnu.ai.mit.edu) * alloca.c: Do nothing if alloca is defined as a macro. 1991-09-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * m-pfa50.h: New file. 1991-09-06 Richard Stallman (rms@mole.gnu.ai.mit.edu) * unexec.c: Add conditionals for COFF_ENCAPSULATE. 1991-08-17 Roland McGrath (roland@geech.gnu.ai.mit.edu) * fns.c (Fdelete): New fn. We have member now; we should have delete too. 1991-08-16 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xfns.c (x_get_arg): Clean bad characters out of the screen name before using it as a resource key. * abbrev.c (Fexpand_abbrev): Don't let capitalization go past point. * sysdep.c (sys_suspend): Don't use & before array name. * sysdep.c [BROKEN_FIONREAD]: Undefine FASYNC. * m-tandem-s2.h (START_FILES, LIB_STANDARD): Added. * s/s-aix3-1.h: Define HAVE_TCATTR. * xfns.c (Fx_grab_cursor, Fx_ungrab_cursor): Functions removed. 1991-08-15 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * bytecode.c (Qbyte_code_meter): New. (Bend_of_line, Bset_marker, Bmatch_beginning, Bmatch_end, Bupcase) (Bdowncase, BRgoto, BRgotoifnil, BRgotoifnonnil) (BRgotoifnilelsepop, BRgotoifnonnilelsepop, BlistN, BconcatN): New byte codes. (Fbyte_code): Implemented new codes listed above. Added code to count how many times a function is called. (syms_of_bytecode): Initialize and staticpro Qbyte_code_meter. * xfns.c (x_window): When setting the class hints, use the screen's name as the res_name. * xfns.c (x_make_screen_name): New function. (Fx_create_screen): Use x_get_arg to find screen name; if none has been specified, use x_make_screen_name; don't set the name again at the bottom. (x_get_arg): If SCREEN_NAME is nil, don't pass any class to Fx_get_resource. * xfns.c (x_get_arg, x_default_parameter): Take an extra argument TYPE, instead of encoding the type in the first letter of the property name. 1991-08-15 Roland McGrath (roland@albert.gnu.ai.mit.edu) * buffer.c (Fkill_all_local_variables): Don't pass Fmake_local_variable too many args. Use Fset instead. 1991-08-14 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xfns.c (emacs_class): Variable removed. (EMACS_CLASS): New macro, specifying Emacs class for xrdb use. Use a class of "Emacs", to be compatible with previous versions. (Fx_get_resource, x_window, Fx_open_connection): Use macro here. * buffer.c (Fgenerate_new_buffer): Function moved to lisp/files.el. (Fgenerate_new_buffer_name): New function which does only the name-choosing work Fgenerate_new_buffer used to do. (Frename_buffer): Added second optional argument DISTINGUISH, which lets rename_buffer use generate-new-buffer-name if non-nil. Return the name the buffer was given. Do nothing if new name is already buffer's name. * xfns.c (Fx_get_resource): Take third argument CLASS, and require it to be specified whenever NAME is. All callers changed. [not HAVE_X11] (Fx_get_default): Only take the one arg. [not HAVE_X11] (Fx_get_resource): Toss the second two args. 1991-08-13 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xfns.c (Fx_close_current_connection): Add \n to error message. * keyboard.c (make_lispy_event): Added HP keys into the function_key_names array. * xterm.c (XTread_socket): For KeyPressed events, strip the keysym's vendor-specific bit, and take a shot at fitting it into the Emacs key numbering. * screen.c (Vdefault_screen_alist): Definition moved from screen.el to here. (syms_of_screen): DEFVAR_LISP and initialize it here. * screen.h: Declare it here. * xfns.c (x_get_arg): Use it here. * screen.c (make_screen): When choosing a buffer for the screen's root window, shy away from buffers whose names start with a space. 1991-08-11 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * process.c (exec_sentinel, exec_sentinel_unwind): Move these above status_notify. * eval.c (Qinhibit_quit): New variable, to support Aug 5 changes to process.c. (syms_of_eval): Initialize and staticpro above. * lisp.h: Added extern declaration for above. 1991-08-10 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * regex.c (re_search_2): When searching with the fastmap, test for a translate table outside of the loop, not inside the loop. 1991-08-10 Richard Stallman (rms@mole.gnu.ai.mit.edu) * fns.c (Fequal): Don't crash on circular structure. (internal_equal): New subroutine does the recursion. * print.c (print): Recognize circular car pointers. 1991-08-10 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * process.c (wait_reading_process_input): Ignore exceptional conditions on the keyboard input. 1991-08-06 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * lisp.h: Fiddled with formatting. * process.c (exec_sentinel_unwind): New function. (exec_sentinel): Restore the process's sentinel, using an unwind_protect. 1991-08-05 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c: Doc fix. 1991-08-05 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * dired.h: Don't include search.h; it doesn't exist. * process.c (read_process_output, exec_sentinel): Bind Qinhibit_quit to true and call the filter directly instead of through a condition-case. (run_filter): Removed. (this_filter, filter_process, filter_string): Variables now unnecessary. * xfns.c (Fx_get_resource): Take the screen name as an optional argument and look up resources using the name of the screen as part of the key. [not HAVE_X11] (Fx_get_default): Take optional 2nd arg NAME and ignore it. (x_get_arg): Take the screen name as an arg, and call Fx_get_resource with that argument. (x_default_parameter, x_figure_window_size, x_icon): Pass the screen's name to x_get_arg. (Fx_create_screen): Make sure the screen name is either nil or a string, and pass it to x_get_arg. * xfns.c (Vx_screen_defaults): Variable removed; such settings belong in the .Xdefaults file. (syms_of_xfns): Don't defvar it here. (Fx_create_screen): Don't use it here. * keyboard.c (classify_object): #if 0'd function finally removed. * xterm.c (Qmapped_screen, Qunmapped_screen, Qexited_scrollbar) (Qexited_window, Qredraw_screen): Unused, so removed. (syms_of_xterm): Don't bother to initialize above. * xterm.c (init_input_symbols): Renamed to syms_of_xterm, for consistency. (x_term_init): Don't call it here. * xfns.c (syms_of_xfns): Don't call syms_of_xselect here. * emacs.c (main): Call them here. * xterm.c (invocation_name): Made this a Lisp_Object, so that its string value could be relocated properly. (x_term_init, x_text_icon): Adjusted code appropriately. (syms_of_xterm): staticpro invocation_name. * xfns.c (invocation_name): Changed extern declaration, deleted extra declaration. (Fx_get_resource): Adjusted code appropriately. 1991-08-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * lread.c (read1): Accept #[...] for bytecode object. * print.c (print): Print them that way. 1991-08-01 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * fileio.c (Fexpand_file_name): Avoid doing strlen (0). * editfns.c, filelock.c [VMS]: Use pwd.h from Emacs, not from system. * fileio.c [VMS]: Likewise. Also include stddef.h, string.h. Include perror.h only once. [VMS] (file_name_as_directory, directory_file_name): Remove assignments from if conditions. (Fexpand_file_name): Remove excess slash from end of user's home dir. 1991-08-01 Richard Stallman (rms@mole.gnu.ai.mit.edu) * emacs.c (main): Add SIGIO conditional within AIX conditional. * xdisp.c (try_window_id): Compute proper position for screen bottom when all changes are below the screen. When first computing bp, don't go more than HEIGHT + 1 lines. 1991-07-31 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xterm.c (x_destroy_window): If we're destroying the currently highlighted screen, clear x_highlight_screen. * xdisp.c (display_text_line, display_string): Don't go past endp for multi-column chars. 1991-07-28 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * lread.c (init_lread): If Vload_path was set specially before dumping, preserve it by default. * process.c (process_send_signal): Notice and deal if the TIOCGPGRP ioctl says that the subprocess has no pgrp. * xdisp.c (try_window_id): Always update window_end_* if successful. * process.h (subtty): New slot. * process.c (create_process): Set it. (process_send_signal): Use it. * alloc.c (Fmake_rope): Doc fix. * screen.c (Fselect_screen): Doc fix. * vms-pp.c: Fix comment. * keymap.c (Fkeymapp, Fdefine_prefix_command): Doc fixes. * window.c (window_select_count): No longer static. (init_window_once): Increment window_select_count, to give each window a unique use_time. * window.h (window_select_count): extern this here. * screen.c (make_screen): Stamp a new screen's selected window with the proper selection time. * ymakefile: xselect.o depends on screen.h, xterm.h, and config.h. xrdb.o depends on config.h. xterm.o depends on gnu.h. * xfns.h: File removed - it only declared Vx_send_movement_events. All includers changed. 1991-07-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keymap.c (Fcopy_keymap): Don't recursively copy maps inside symbols. 1991-07-27 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xdisp.c (redisplay): If echo_area_display puts text in a surrogate minibuffer screen, don't neglect to update it. * keyboard.c (kbd_buffer_store_event): Make sure Vlast_event_screen is set properly for quit characters. 1991-07-26 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (command_loop_1): Pass both arguments to Fselect_screen. * screen.c (make_screen): Divide the size by sizeof (Lisp_Object) before passing it to Fmake_vector. * screen.h [not MULTI_SCREEN] (SCREEN_SCROLL_BOTTOM_VPOS): Fixed definition. * screen.c: #include termhooks.h and therefore stdio.h. (make_screen): Initialize focus_screen member. (Fdelete_screen): Refuse to delete SCREEN if it is a surrogate minibuffer for some other screen, not just if it's the global minibuffer screen. (Fredirect_screen_focus, Fscreen_focus): New function. (syms_of_screen): defsubr Sredirect_screen_focus. * window.c: Don't include termhooks.h or stdio.h. (Fselect_window): Removed grunge to support minibuffer hack. * screen.h (struct screen): Added focus_screen member, and accessor for it. * alloc.c (mark_object): Mark focus_screen member of Lisp_Screens. * xterm.c (XTscreen_rehighlight): Use the focus_screen member to decide which screen to highlight. (XTread_socket): Use focus_screen when enqueuing keystrokes. * minibuf.c (read_minibuf, read_minibuf_unwind): Shift the selected screen's focus around appropriately. * termhooks.h (screen_rehighlight_hook): Doc fix. * lisp.h (CHECK_IMPURE): Moved definition... * puresize.h (CHECK_IMPURE): To here. 1991-07-25 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * dispnew.c (buffer_posn_from_coords): Bufp is broken; don't use it. * xterm.c (XTscreen_rehighlight): Neatened sloppy logic. * keyboard.c (read_key_sequence): When truncating a key sequence, don't forget to put the new keystroke back in this_command_keys. Do this before calling echo_truncate, and don't call echo_char. 1991-07-24 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xterm.c (x_term_init): Initialize x_focus_screen and x_highlight_screen. * xterm.c (XTscreen_rehighlight): Handle things correctly when x_focus_screen is 0. (XTread_socket): Process EnterNotify and LeaveNotify events with .focus == 0 properly. For FocusOut events, pass the right arguments to x_new_focus_screen. * fileio.c (Finsert_file_contents): Use RETURN_UNGCPRO macro. * buffer.c (Fbuffer_name): Fix typo in doc string. (syms_of_buffer): Fix typo in before_change_function name. 1991-07-23 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.h (CHECK_SCREEN): Define a dummy version of this when MULTI_SCREEN is not defined. * sysdep.c (init_signals, sys_signal, sys_sigpause): New functions. (sys_sigblock, sys_sigunblock, sys_sigsetmask): New functions. * sysdep.c (_sobuf): Unsigned chars if DGUX. * sysdep.c [DGUX]: Include file.h. [DGUX] (sys_siglist): New variable. * x11term.c (x_init_1) [SYSV_STREAMS]: Don't close the old descriptor. * keyboard.c (read_key_sequence): Treat function keys like ascii characters. * lread.c (init_lread, syms_of_lread): New names for init_read and syms_of_read, for consistency. * emacssignal.h: New file. * data.c, keyboard.c, process.c, sysdep.c: Include it. * data.c (arith_error): Use SIGEMPTYMASK. * keyboard.c (sigfree, sigunblockx): Use SIGEMPTYMASK. (sigholdx, sigblockx): Use sigmask. (gobble_input): Use sigblockx instead of sigholdx, so that any other blocked signals stay blocked during and after the call to read_avail_input. * process.c (create_process): Use sigmask. [FASYNC] (request_sigio): Use sigunblock. * xterm.c (sigmask): Removed #definition here. * ymakefile (keyboard.o, process.o, sysdep.o, data.o): Make these depend on emacssignal.h. * window.c (Fselect_window): Modify surrogate minibuffer hack to make the minibuffer the selected window of the selected screen, AND select the minibuffer window's screen. * minibuf.c (read_minibuf): If the minibuffer window is on a different screen, save that screen's configuration too. * window.c (Fset_window_configuration): Use SCREEN_ accessor to get at a screen's root window. Removed unused variable screen_to_select. (Fcurrent_window_configuration): Take an optional argument SCREEN. All callers changed. * window.c (auto_new_screen, Vauto_new_screen_function): Renamed to pop_up_screens and pop_up_screen_function, to be parallel with pop_up_windows. (display_buffer, syms_of_window): Changed appropriately. * fns.c (Fload_average) [DGUX]: Add code to support DGUX. * s-dgux.h, m-aviion.h: New files. * emacs.c (main) [POSIX_SIGNALS]: Call init_signals. * screen.c (Fdelete_screen): Update last_nonminibuf_screen if the screen it's currently pointing to gets deleted. 1991-07-22 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.c (last_nonminibuf_screen): New variable. (Fselect_screen): Set last_nonminibuf_screen if appropriate. 1991-07-21 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.h (last_nonminibuf_screen): Added declarations for new variable. * minibuf.c (active_screen): Variable removed. (read_minibuf): Removed code to set and clear active_screen. * window.c (Fdisplay_buffer): Rewritten to use last_nonminibuf_screen. * screen.c (next_screen): Use SCREEN_ accessors instead of ->. * window.c (Fdisplay_buffer): Removed reference to Fx_create_screen; we should rely on the auto-new-screen-function being set to something appropriate. 1991-07-21 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (read_key_sequence): Restore the state of this_command_key_count along with the echoing state. 1991-07-20 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xfns.c (Fx_synchronize): New function. (syms_of_xfns): defsubr it. * xdisp.c (redisplay): Don't turn on all_windows whenever we're using a separate minibuffer screen. Even if there is some tweak necessary, this wasn't it. * process.c (status_notify): Do not forget to UNGCPRO. * screen.c (next_screen): Re-work logic to skip minibuffer-only screens so that it doesn't loop indefinitely, even when the only screen is a minibuffer-only screen. Skip all screens that are only minibuffers, not just when they are the global minibuffer screen. * xdisp.c (message, message1): If the screen's message buffer is 0, toss the message; don't check the window system against the screen output_method. 1991-07-19 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (read_key_sequence): When we truncate the echo buffer because the user has switched screens, re-echo the character that caused the truncation. * lread.c (Fload): Change "source newer than ..." message not to refer to "libraries." What is a "library," anyway? * window.c: #include "termhooks.h", and therefore <stdio.h> too. [MULTI_SCREEN] (Fselect_window): If the window being selected is the selected screen's minibuffer, but it lives on another screen, don't select that other screen - call the screen_rehighlight_hook instead. * termhooks.h (screen_rehighlight_hook): New hook, so that Emacs can shift the screen highlighting when needed. * term.c (screen_rehighlight_hook): Define it. * xterm.c (x_highlight_screen): New variable. (x_new_focus_screen): Move the rehighlighting code to... (XTscreen_rehighlight): New function. (x_display_bar_cursor, x_display_box_cursor): Use x_highlighted_screen instead of x_focus_screen. (x_term_init): Initialize screen_rehighlight_hook. * ymakefile: Make window.o depend on termhooks.h. * xfns.c (Fx_create_screen): Add mention of global-minibuffer-screen to docstring. * screen.c (make_screen_without_minibuffer): Improve error message displayed when Vglobal_minibuffer_screen is not a proper screen. 1991-07-18 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * config.h (PURESIZE): Definition moved to... * puresize.h: New file. (PURESIZE): Define this here. This will allow people to change their pure storage allocation without having to recompile most of Emacs. * data.c: #include puresize.h, since CHECK_IMPURE needs PURESIZE. * alloc.c: #include puresize.h. [HAVE_SHM] (pure_size): New variable, so that XPNTR doesn't depend on PURESIZE. [HAVE_SHM] (init_alloc_once): Initialize pure_size here. * lisp.h [HAVE_SHM] (XPNTR): Defined in terms of pure_size, instead of PURESIZE. (pure_size): Extern declaration added here. * ymakefile: Added puresize.h to dependencies for alloc.c and data.c's .o files. * emacs.c (main): Doc fix for kludge to scan for -d. 1991-07-17 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * termhooks.h (struct input_event): #if 0'd out the definition for the screen_selected event type, and added the stipulation that the {non_,}ascii_keystroke events specify the screen they happen in. * xterm.c (x_new_focus_screen): Don't enqueue a screen_selected event. (XTread_socket): Calls to x_new_focus_screen in the EnterNotify, FocusIn, LeaveNotify, and FocusOut event code don't worry about enqueued events any more. * keyboard.c (new_selected_screen): Removed - see below. (Vlast_event_screen): New variable, visible to lisp code. (echo_length, echo_truncate): New functions. (readable_events): Removed screen_selected events from the set of things to skip. (kbd_buffer_store_event): Don't bother collapsing consecutive screen_selected events. (kbd_buffer_read_char): Don't process screen_selected events. (make_lispy_event): Re-arrange scrollbar events to put the window whose scrollbar was diddled right after the identifying symbol, for consistency. (read_key_sequence): Let the selected screen and the location of the event affect the keymap used to find its binding. (Fread_key_sequence): Update docstring. (syms_of_keyboard): Added DEFVAR_LISP for Vlast_event_screen. 1991-07-15 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * screen.c (next_screen): If !mini_screen, only exclude the global minibuffer screen when the minibuffer is its only window. (Fnext_screen): Make the docstring clearer about what MINISCREEN means. * window.c (Fother_window): Indicate that it takes both a required and optional argument, instead of just one required. 1991-07-15 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * buffer.c (Fkill_buffer): Rehacked kill-buffer-hooks to use standard name kill-buffer-hook, and to use set_buffer_internal instead of Fset_buffer. Use static variable containing symbol instead of intern. (syms_of_buffer, init_buffer_once): Qkill_buffer_hook = 'kill-buffer-hook. 1991-07-15 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keymap.c (Fsingle_key_description): When describing a listy object, take the car to find the symbol that heads it, not the cdr. * dispnew.c (buffer_posn_from_coords): Pass col and line to compute_motion in the correct order. * keyboard.c (make_lispy_event): When calculating rows and columns for mouse clicks and movement events, don't forget to subtract the position of the window's top left corner before passing them to buffer_posn_from_coords. * screen.c (coordinates_in_window): Removed useless test for *y == screen_height, and screen_height variable; this would be out of range of all the windows anyway. * xdisp.c (message1): Removed code to ignore messages before X has started up; this issue has hopefully been addressed by the condition-case in startup.el. * editfns.c (init_editfns): Make user_name char * instead of unsigned char *, since that's what most of the usages seem to want. And when expanding ampersands in AMPERSAND_FULL_NAME mode, don't try to use user_name as a string; use Vuser_name. * minibuf.c (assoc_for_completion): New function. (do_completion): Use that to check for exact match. * minibuf.c (Ftry_completion): Fix handling of matches aside from case. If ignoring case, and all else equal, try to preserve the case of the characters in the input. * process.c (status_notify): GCPRO tail. * sysdep.c (creat_copy_attrs, rename_sans_version): Always set protection to O:REWD when creating file. Added new function rename_sans_version, which strips the version number from the target filename, renames the temporary file to this filename, and then sets the file protection of this new file to be the same as the file being edited. * sysdep.c [VMS]: Include pwd.h from Emacs. Use sys/file.h if GCC. (F_SETFL) [VMS]: Undefine this, to control conditionals. (getpwnam): Make `full' unsigned. (creat_copy_attrs): Add some casts. (sys_access): Change prvmask and CHECKPRIV to use bitfields. Add some casts, and make dummy an unsigned short int. Don't use & on constants. (vmserrstr): Add a cast. (sys_creat): Define va_count before this function. 1991-07-14 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * sysdep.c (sys_sleep, input_wait_timeout): Don't use & on constant. [VMS]: Include pwd.h from Emacs. Use sys/file.h if GCC. (bzero, bcopy) [VMS]: Don't take address of `length'. * sysdep.c (sys_suspend): Cast value of `signal' to insulate from changed value type in sysV.3. * sysdep.c (child_setup_tty): Turn off erase & kill chars for BSD. * sysdep.c (discard_tty_input): Use TIOCFLUSH on Apollo. (init_sys_modes): Avoid TIOCSTART on Apollo. * sysdep.c: If HAVE_TERMIOS is not defined, define tcgetattr in terms of the TIOCGETP ioctl. (init_sys_modes): Handle VSUSP, V_DSUSP if HAVE_TCATTR. (discard_tty_input, init_baud_rate, child_setup_tty) (init_sys_modes, tabs_safe_p, reset_sys_modes): Use tcgetattr, and if HAVE_TCATTR, use tcsetattr. 1991-07-13 Jim Blandy (jimb@churchy.gnu.ai.mit.edu) * s-hpux8.h: New file. * fileio.c [HPUX8]: Don't include errnet.h. * unexhp9k800.c (unexec): Local variable i to avoid compiler bug? * sysdep.c (insque) [WRONG_NAME_INSQUE]: New function. * s-386ix.h (WRONG_NAME_INSQUE): Define it. * xdisp.c (message_buf_print): New variable. (message): Clear it here. * dispextern.h: Declare it here. * print.c (printchar, strout): Set it and test it here. * keyboard.c (command_loop_1): Don't clear last_command when start macro. * keyboard.c (read_command_char): Exit at eof if noninteractive. * indent.c (invalidate_current_column): New function. * editfns.c (Fwiden, Fnarrow_to_region): Call it. * process.c (create_process): Use O_NOCTTY whenever defined, unless USG. * process.c (Fprocess_send_eof): If using a pipe, close it. (close_process_descs): Check IN and OUT for nonzeroness. * process.c (process_send_signal): Use interrupt chars to send certain signals to the process group. (TIOCGETC): Undefine this if it is not really usable. * sysdep.c (discard_tty_input): Do nothing if read_socket_hook. * xfns.c (x_set_mouse_color): Change the default pointer shapes to be closer to xterm and emacs 18. * xterm.c (x_focus_on_screen, x_unfocus_screen): These no longer call XSetInputFocus, because I think that the X-windows ICCCM says that only the window manager can do this sort of thing. * keyboard.c (read_char): When there is an unread command character, goto reread_first when this_command_key_count is zero, not when it is >= 0. (command_loop_1): Reset this_command_key_count only if there is no prefix argument. This makes echoing of keystrokes work correctly. 1991-07-11 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * eval.c (Finteractive_p): Changed "! XTYPE (foo) == Lisp_Bar" to "XTYPE (foo) != bar". 1991-07-11 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * eval.c (apply1): Don't forget to UNGCPRO before returning. * xterm.c (XTupdate_begin): Undisplay the cursor here; do_scrolling will call XTins_del_lines when the screen matrix is inaccurate, so we cannot undisplay the cursor then, but do_scrolling is always called within an update. 1991-07-10 David J. MacKenzie (djm@nutrimat) * termcap.c, tparam.c [!emacs, USG || STDC_HEADERS]: Define bcopy in terms of memcpy. 1991-07-09 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * scroll.c (do_scrolling): Use correct termination condition for loop that uses the glyph pointers for the deleted lines to fill in the inserted lines. 1991-07-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) * editfns.c: Doc fix. 1991-07-03 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * dispnew.c (line_hash_code): Test m->highlight[vpos], not m->highlight. All lines were getting hash codes of -1, because the highlight vector was never NULL. Golly. * process.c (list_processes_1): Handle status of network streams. 1991-07-02 Richard Stallman (rms@mole.gnu.ai.mit.edu) * doc.c (Fdocumentation_property): Pass only strings to Fsubstitute_command_keys. 1991-07-02 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * editfns.c (init_editfns): If neither of the environment variables are set, DON'T set Vuser_name to Vuser_real_name; it's supposed to reflect the EFFECTIVE uid. Get the full name according to Vuser_name if it differs from Vuser_real_name, not if they are equal. And pass Vuser_name to getpwnam in that case instead of user_name, which might be 0. * lisp.h (RETURN_UNGCPRO): New macro. * bytecode.c (Fbyte_code): Do not remove GC protection from the stack when making a function call, because the caller is responsible for protecting the arguments to a MANY-arg'ed function. * eval.c (Fapply): If we use funcall_args, GCPRO it. And when we call Ffuncall with funcall_args, tell it the correct length of funcall_args, no matter which branch allocated it. (Ffuncall): Don't gcpro the arguments before calling Fgarbage_collect. (Feval): If we're calling a subr that takes MANY args, don't UNGCPRO until after we call the subr. (apply1, call0, call1, call2, call3): GCPRO the arg arrays passed to Ffuncall and Fapply. * callproc.c (Fcall_process, Fcall_process_region): Don't GCPRO the argument array. * editfns.c (Finsert, Finsert_before_markers): Don't GCPRO the argument array. Added comment about when GCPROing is not needed. * mocklisp.c (Finsert_string): Don't GCPRO the argument array. * keyboard.c (init_keyboard): Handle SIGQUIT with interrupt_signal on any system that has HAVE_TERMIO, not just on USG systems. 1991-07-01 Richard Stallman (rms@mole.gnu.ai.mit.edu) * editfns.c (init_editfns): Test that user_name isn't 0. 1991-06-29 Richard Stallman (rms@mole.gnu.ai.mit.edu) * search.c: Doc fixes. 1991-06-28 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keyboard.c (make_lispy_event): Let the posns of mouse clicks and mouse movements be nil when window_from_coordinates returns a NON-window, not when it returns a window. Since posn is a lisp object, don't call make_number when consing up the event. Don't call make_number on the code member of the event. * keyboard.c (struct movement): Make the x, y, and time members Lisp_Objects, since it's easier to convert from a Lisp_Object than to. (note_mouse_position): Adjusted for the above. (make_lispy_event): Removed code to make Lisp_Objects for those members. * xterm.c (XTread_socket): When handling LeaveNotify events, remember that the focus member of the event is true when the receiving window now has the focus, not when it is losing it. * xfns.c (Ffocus_screen): Don't signal an error if SCREEN is already the focus screen. 1991-06-26 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * alloc.c (Fmake_rope): Use sizeof (GLYPH) instead of 2 to determine how large the string should be, and changed doc string to describe ropes as strings of glyphs, not just as strings of character pairs. (Frope_elt): Use sizeof (GLYPH) as the element size, instead of assuming that the elements are two bytes. * lisp.h (typedef GLYPH): Moved the definition from here... * config.h (typedef GLYPH): to here, so people can elect to get better performance if they don't want to use huge fonts. * xterm.c (dumpglyphs): Use XDrawImageString or XDrawImageString16, Depending on sizeof (GLYPH). * data.c (Fsetq_default): Call Fset_default to do the assignments, not plain Fset. The following changes were contributed by Jamie Zawinski <jwz@lucid.com>: * bytecode.c (Fbyte_code): BYTE_CODE_SAFE and BYTE_CODE_METER options added. Added Bmark, Bscan_buffer, Bset_mark to support error-checking for these obsolete bytecodes. Added Bunbind_all to support tail-call optimization (not yet implemented). Did NOT add the relative branch opcodes that were in the version of bytecode.c that Jamie sent. The branching bytecodes now only QUIT if they take the branch. Btemp_output_buffer_show, Bforward_char, Bforward_word, Bskip_chars_forward, Bskip_chars_backward, and Bforward_line passed the wrong number of arguments to their subrs. Brem, Bbuffer_substring, Bdelete_region, Bnarrow_to_region, Bstringeqlsign, Bstringlss, Bequal, Bnthcdr, Bmember, Bassq, Bsetcar, and Bsetcdr passed arguments to the subr in the wrong order. 1991-06-25 Jim Blandy (jimb@churchy.gnu.ai.mit.edu) * doc.c (Fdocumentation): Added a QUIT test to the loop that finds the symbol's function value. 1991-06-24 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * xterm.c (dumprectangle): Removed call to XFlushQueue here. * keyboard.c (command_loop_1): Call Fselect_screen to establish the new selected screen after the key sequence has been read, not at the top of the loop. This way, a key sequence will happen in the screen it was typed at, or (to be more precise) the screen its last character was typed at. * keyboard.c (fast_read_one_key): Function deleted, since it had been #if 0'd out a long time ago. (command_loop_1): Support for fast_read_one_key removed. * eval.c (Ffuncall): Do GCPRO the arguments, contrary to the May 16 change. The convention appears to be that the MANY-arged callee must protect its own arguments. (Fapply): Don't protect funcall_args; they are the caller's responsibility. * bytecode.c (Fbyte_code): GCPRO the section of the stack *above* the args to Ffuncall, since it will be protected again once Ffuncall returns and therefore should stay valid. If it is not protected, string relocation may make it invalid. * mocklisp.c (Finsert_string): GCPRO the arguments, since insert may cause a garbage collection. * editfns.c (Finsert, Finsert_before_markers): GCPRO the arguments, since insert may cause a garbage collection. * callproc.c (Fcall_process, Fcall_process_region): GCPRO the arguments, since insert may cause a garbage collection. 1991-06-20 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * buffer.h (struct buffer_text, struct buffer): Small change to comments. * search.c (Fmatch_beginning, Fmatch_end): Fixed doc strings to indicate that non-regexp searches set these too. * window.c (Fset_window_start): If window is not the selected window, set windows_or_buffers_changed, so that redisplay will know that it should redisplay the window. * callint.c (Finteractive): Changed doc string to indicate that the interactive prompts are passed through format. 1991-06-20 Roland McGrath (roland@albert.gnu.ai.mit.edu) * buffer.c (syms_of_buffer): buffer-undo-list doc fix. 1991-06-11 Roland McGrath (roland@albert.gnu.ai.mit.edu) * data.c (Fsetq_default): Take multiple SYM, VAL args; syntax now parallel to setq. 1991-05-25 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (kbd_buffer_read_char): Fix wait-for-input loop so that we always process/toss events we don't want to return. * screen.c (Fselect_screen): Call Ffocus_screen instead of x_new_selected_screen, which doesn't exist anymore. * xfns.c (Ffocus_screen): Declare the type of the SCREEN argument. * xfns.c (Fx_track_pointer): Function #if 0'd out - I don't think that this is a feature that we want. (syms_of_xfns): Elide the defsubr for the above. * xterm.c (x_mouse_screen, x_input_screen): Variable deleted, since all we really need is x_focus_screen; all other issues are the realm and responsibility of the window manager. (x_new_selected_screen): Renamed to x_new_focus_screen, and modified not to do thiogs inappropriate for signal handlers. (XTread_socket): Change the handling of EnterNotify, LeaveNotify, FocusOut and FocusIn events to use x_new_selected_screen, and ditched code that deals with x_mouse_screen and x_input_screen, since they don't exist anymore. (x_display_bar_cursor, x_display_box_cursor): Compare s with x_focus_screen to see what form the cursor should take. (x_destroy_window): Don't bother with x_input_screen. * xfns.c (x_mouse_screen): Removed extern declaration for this. (Fx_grab_pointer): Confine the pointer to x_focus_screen, not x_mouse_screen. This is wrong, but will make emacs compile until this gets fixed. 1991-05-23 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (get_input_pending): Don't use trim_events; use readable_events instead. * keyboard.c (make_lispy_event): Remove case for window_sys_event, since that type of event doesn't exist anymore. * minibuf.c (Fcompleting_read): Document the backup-n argument. * dispnew.c (init_display): Don't declare alternate_display extern here. I can't figure out what this feature is, and it's broken. * emacs.c (main): Don't test alternate_display and put its value in the environment. 1991-05-22 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (struct movement): Made .used an int instead of a char, since that's more likely to be stored atomically on SPARCS and similar machines. * termhooks.h (struct input_event): Removed the window_sys_event, since it's not used anywhere. Added screen_selected event type. The event handling code used to change the current buffer, selected window, and selected screen out from under running lisp code. Now we wait for a more convenient time by enqueuing an event. * xterm.c (XTread_socket): When handling FocusIn events and EnterNotify events with the focus member set, enqueue a selected_screen event instead of calling x_new_selected_screen. * keyboard.c (trim_events): Function deleted; it is a bad idea to delete events based on the current tracking state, since tracking might be re-enabled later. (readable_events): New function which searches the input queue for readable events. (tracking_off): Call readable_events to see if we should redisplay. (kbd_buffer_read_char): Toss events that we are not interested in. This is a better place to do it than trim_events, since we know that do_mouse_tracking will not change. Also, handle screen_selected events. (new_selected_screen): New variable, holding the screen which should become selected the next time through command_loop_1. (syms_of_keyboard): Initialize and staticpro new_selected_screen. (command_loop_1): If there is a new screen to be selected, do so. 1991-05-21 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xdisp.c (message): Removed the if at the top that did not display messages if the current screen was a termcap screen and a window system will be used. The change to startup.el on May 18, 1991 replaces this. * ralloc.c (check_memory_limits): If the address returned by the allocator is not representable in a Lisp_Object, call memory_full instead of printing a very silly "warning" message. 1991-05-19 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * xterm.c (XTread_socket): Don't overwrite the end of the buffer with function keys. * keyboard.c (tracking_off): Update input_pending after reading all the input. * process.c: #include "screen.h". (wait_reading_process_input): Check if any screens have been newly mapped and need updating. * xterm.c (XTread_socket): Don't SET_SCREEN_GARBAGED when the screen is unmapped; do this when is mapped. (dumprectangle): Don't dump any data for garbaged screens. 1991-05-18 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * sysdep.c (init_sys_modes): Moved the clauses that set up interrupt-driven input out of the "if running on a terminal" clause, since these may need to be set up even when running on a window system. 1991-05-17 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * process.c (Fprocess_status): For network connections, return Qopen and Qclosed instead of Qrun and Qexit, as documented. * lread.c (read1): Removed code that treated numbers starting with a zero as octal. 1991-05-16 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * eval.c (Ffuncall): Don't gcpro the arguments; the caller protects them. (Fapply): Gcpro funcall_args, if we use them. * xterm.c (notice_mouse_movement): #if 0'd this function out. (XTread_socket): #if 0 the code that fakes motion events for moving in and out of windows. Also, rearrange the MotionNotify case to give character rows and columns to note_mouse_position, not pixel x and y positions. Don't deal with scrollbars here. * termhooks.h (struct input_event): Removed the mouse_movement event kind. * keyboard.c (movement_buf): A new buffer for mouse-movement events. This is hairier than you might think; see the comments for this and the comments for note_mouse_position and get_mouse_position for an explanation of why this is hairy. (movement_ptr): Where the event handler should store new mouse locations. (EVENT_QUEUES_EMPTY): New macro, to be used in the places that used to compare kbd_fetch_ptr to kbd_store_ptr to see if there were any events available; this macro tests the mouse movement buffer too. (Qmouse_movement): New symbol to head mouse movement events with. (trim_events): Mouse movement events are no longer in kbd_buffer, so don't try to trim them. (tracking_off, kbd_buffer_read_char, get_input_pending): Use EVENT_QUEUES_EMPTY. (get_mouse_position): New function to retrieve a mouse position from the buffer properly, no matter when the event-handling signal occurs. (kbd_buffer_read_char): If there is something in kbd_buffer, make an event for that; if there is a mouse movement, make an event for that; otherwise, the while loop lied. (make_lispy_event): Added code to produce mouse movement events. (init_keyboard): Clear the mouse movement buffer. (Qmouse_moved, Qredraw_screen, Qmapped_screen, Qunmapped_screen) (Qexited_window, Qexited_scrollbar): Removed extern declarations for these, since they're no longer generated. (syms_of_keyboard): Initialize and staticpro Qmouse_movement, remove DEFVAR_LISP for Vignore_mouse_events. 1991-05-14 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * lread.c (read1): Correctly parenthesize the shift when parsing octal numbers, and signal an error if we see a non-octal digit. 1991-05-13 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (trim_events): New function, to remove uninteresting events from the input queue. (get_input_pending): Call trim_events before checking the queue, so as not to advertise input we don't care about. (Ftrack_mouse): A new function to enable mouse tracking for a block of code. (tracking_off): A function for unwind_protection; restore the mouse tracking state to what it was outside of the track-mouse (syms_of_keyboard): defsubr track-mouse. (make_lispy_event): Find the window io which the click occurred when processing mouse_click events, instead of trusting the window tree in the signal-handling code. Include the buffer position in the click event. * xterm.c (construct_mouse_click): Return the click's screen, not its window, and don't bother updating Vmouse_window. Calculate the row and column of text-area clicks using pixel_to_glyph_translation, since we know that those data structures are alive in signal handlers. * screen.c (window_from_coordinates, Flocate_window_from_coordinates): Moved these to window.c, since I need to be able to call them even if we don't have multi-screen support. (syms_of_screen): Removed defsubr for Flocate_window_from_coordinates. * window.c (window_from_coordinates, Flocate_window_from_coordinates): Here they are. (syms_of_window): Here is the defsubr. * keyboard.c (note_mouse_position): New function to enqueue mouse movement events properly. (current_movement_event): New variable, to support the above. See its comment for more explanation. * termhooks.h (struct input_event): Change the .window member to .screen, make it a struct screen *, and indicate that those events which used to return windows now return screens. It is unsafe for the event reader to traverse the window structure, because it can be called by a signal handler. 1991-05-10 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keyboard.c (Vignore_mouse_events): Variable deleted. (make_lispy_event): For mouse and scrollbar clicks, return the position as a pair of numbers, not a list of two numbers. 1991-05-09 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * keyboard.c (do_mouse_tracking): Define this variable, which controls whether kbd_buffer_read_char will ignore button up and mouse movement events. * termhooks.h: Declare do_mouse_tracking here. * xterm.h (STANDARD_EVENT_SET): New constant, giving the event mask all the windows use. * xfns.c (Vx_send_mouse_movement_events): Removed this variable; XTmouse_tracking_enable and do_mouse_tracking do its job better. (syms_of_xfns): Remove the DEFVAR_LISP for the above. (x_window): Don't ask for any pointer motion events or button release events by default; use the unmodified STANDARD_EVENT_MASK. The user will ask for them explicitly if he or she wants them. And don't ask for backing store. * xterm.c (XTmouse_tracking_enable): New function to request/unrequest detailed mouse tracking information of the server, and set the flag used by XTread_socket. (x_term_init): Set mouse_tracking_enable_hook to XTmouse_tracking_enable here. (XTread_socket): Handle mouse movement events by calling note_mouse_position. * xterm.c (XTread_socket): For MapNotify events, go ahead and set the screen's visible flag, so Expose events will work. Clear the iconified flag. * editfns.c (Finsert_char): Return immediately if n <= 0, not just if n < 0, so that the `while' below does not become an infinite loop. * term.c (mouse_tracking_enable_hook): Added this variable to allow emacs to request that the window system start or stop detailed mouse tracking. * termhooks.h (mouse_tracking_enable_hook): Declare it here. * xfns.c: Declare the functions before initializing x_screen_parm_table to point to them. * xterm.c (XTread_socket): Don't send Qmapped_screen, Qunmapped_screen, Qexited_scrollbar, Qexited_window, Qredraw_screen - these are not features that we want to support. 1991-05-07 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * editfns.c (Finsert_char): Let strlen be the minimum of n and 256, not the maximum, so we use an n-byte buffer when n < 256, and a 256-byte buffer many times when n > 256. 1991-05-05 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keymap.c (Fkeymapp): Fixed docstring to give the right definition of a keymap. 1991-05-03 Richard Stallman (rms@mole.gnu.ai.mit.edu) * data.c (Fcompiled_function_p): New function. 1991-05-03 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * xfns.c (struct x_screen_parm_table): New type for recording information about screen parameters. (x_screen_parms): New table describing the existing parameters. (init_x_parm_symbols, x_set_screen_param): Use x_screen_parms instead of a large switch statement. (x_figure_window_size): Make the default case of the switch call abort instead of signalling an error, since window_prompting's value is internally generated. 1991-05-01 Jim Blandy (jimb@churchy.gnu.ai.mit.edu) * keymap.c (describe_map_tree): GCPRO the maps variable; Fkey_description calls Fmapconcat, which eventually calls Ffuncall, which can garbage-collect. 1991-04-28 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * dispnew.c (buffer_posn_from_coords): Use the information in bufp to reduce the distance compute_motion must scan, when possible. 1991-04-27 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (syms_of_keyboard): Qtop_level is initialized and staticpro'd in syms_of_data too. Don't staticpro (or initialize) it again here. * macros.c (syms_of_macros): Since executing-macro and executing-kbd-macro are actually the same variable, use DEFVAR_LISP_NOPRO for the second one so it doesn't get staticpro'd twice. * process.c (syms_of_process): Don't staticpro or initialize Qexit here, since syms_of_eval already does this and it's bad to staticpro something twice. (Qexit): Remove declaration here, so there will be a compilation error if someone rearranges eval.c without fixing the Qexit stuff. * eval.c (syms_of_eval): Add comment here to say that syms_of_process cares about Qexit too. * lread.c (init_obarray): Don't staticpro Vobarray, since the DEFVAR_LISP in syms_of_read takes care of that. 1991-04-22 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * window.c (save_window_save): Always get the selected window's value of point from its buffer, not just when it's also the current buffer. * lisp.h (Qdisabled): Declare this here so that the keys_of_* files can disable the commands they define. * casefiddle.c (keys_of_casefiddle): Make upcase-region and downcase-region disabled, by default. 1991-04-16 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * bytecode.c (PUSH): Alliant can't be bothered to implement the preincrement operator right, so use a comma. * print.c (syms_of_print): staticpro Qexternal_debugging_output. * editfns.c (clip_to_bounds): No longer static - used in window.c. * window.c (unshow_buffer): Use clip_to_bounds to make sure we change point to something legal. 1991-04-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) * sysdep.c: Changes in formatting and comments. 1991-04-12 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * editfns.c (Fbuffer_substring): Don't call make_string, because it may cause a compaction and move the buffer, and then copy the wrong data. * keyboard.c (read_char): Only GC if we've actually done enough consing since the last gc to make it worthwhile. 1991-04-11 Jim Blandy (jimb@geech.gnu.ai.mit.edu) * keymap.c (access_keymap): Canonicalize the order of the modifiers when you look up a symbol in a keymap, too. (where-is-internal): If the keymap in which we found the definition was reached by meta-prefix-char, replace it with the metized character. * eval.c (Fcondition_case): Initialize the `handler_list' member of the catchtag. * keyboard.c (read_char): Reset recent_keys_index when it is greater than OR EQUAL to the number of elements in recent_keys, stupid. * keymap.c (access_keymap): When fetching the car of listy events, no need to call Fcar_safe - extract the car directly. * keyboard.c (read_key_sequence): Don't extract the car from listy events here since 1) it strips information that we need from the events, and 2) access_keymap will take care of that for us. * macros.c (Qexecute_kbd_macro): New variable, used by Fexecute_command. (syms_of_macros): Initialize and staticpro Qexecute_kbd_macro. * lisp.h: Add extern declaration for Qexecute_kbd_macro. * keyboard.c (Fcommand_execute): Add an entry to the command history for keyboard macros too. * xterm.c (XTread_socket): If we get a MappingNotify event whose request == MappingKeyboard, someone has changed the keyboard mapping, and we should get the new mapping with XRefreshKeyboardMapping. 1991-04-10 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) * commands.h: Declare last_command_char to be a Lisp_Object, not an integer (ack). * cmds.c (Fself_insert_command): If last_command_char is not an integer, beep. * minibuf.c (Fself_insert_and_exit): Same thing. * keyboard.c (format_modifiers): New function, factoring out code from modify_event_symbol and reorder_modifiers. (modify_event_symbol): Call format_modifiers instead of doing the work inline. (reorder_modifiers): New function to put the modifiers on a modified symbol in the canonical order. * keymap.c (modify_event_symbol): Prepend the modifiers so they appear in the canonical order: `M-C-S-U-'. (store_in_keymap): If IDX is a symbol, put the modifiers in the canonical order before storing. 1991-04-09 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keymap.c (Flocal_set_key, Fglobal_set_key): When checking types of arguments, allow KEYS to be a vector or string, not just a string. (keymap_table): New static function to replace duplicated code in access_keymap and store_in_keymap. (access_keymap): Use keymap_table. (store_in_keymap): Use keymap_table, and put non-character definitions in dense keymaps *after* the vector. * fileio.c (directory_file_name): Remove trailing slashes from single-letter names like "a/" too. Let slen be the string length, not one less than the string length. * keyboard.c (Fset_input_mode): Don't complain that QUIT isn't an ASCII character if it is nil - it is an optional parameter. * keymap.c (Faccessible_keymaps): Use meta-characters in the key sequences returned, carefully making sure that the sequences still appear in order of increasing length. 1991-04-04 Richard Stallman (rms@mole.gnu.ai.mit.edu) * vmsfns.c (vms_trnlog): Increased size of str to 256 elements. (vms_symbol): Increased size of str to 1025 elements. 1991-03-24 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * dispnew.c (pixel_to_glyph_translation): Moved this function to xterm.c, since it is specific to X and only called by the X code. * xterm.c (pixel_to_glyph_translation): Here it is. 1991-03-22 Richard Stallman (rms@mole.gnu.ai.mit.edu) * s-usg5-4.h (DATA_SEG_BITS): Definition deleted. * m-intel386.h (DATA_SEG_BITS): Define here if USG5_4. 1991-03-22 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keymap.c (Faccessible_keymaps): Produce meta-characters in the key sequences instead of [meta-prefix-char CHAR] sequences. 1991-03-21 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keymap.c (Flookup_key): If KEY is a zero-length array, then return KEYMAP; this is more algebraically satisfying. * dispnew.c (Fsit_for): If the time to sit is zero and there is no input available, then return Qt, not Qnil. * keyboard.c (read_char): If a quit occurs and we return quit_char, clear Vquit_flag, so we don't end up returning it again and again... All lisp code does this manually if they call read-char with quits inhibited, so it's the right thing to do. 1991-03-20 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (read_char): If there is still no input available after an auto-save, do a garbage-collection. * undo.c (truncate_undo_list): Always leave at least one undo record in the undo list. And use sizeof (struct Lisp_Cons), etc. instead of 8, etc. * keyboard.c (read_char): When deciding whether to wrap recent_keys_index back to 0, compare it against sizeof (recent_keys)/sizeof(recent_keys[0]), not sizeof (recent_keys). (quit_char): This can't be anything but an ASCII character, so it shouldn't be a Lisp_Object. The declaration's comment says why. (read_char, init_keyboard): Treat quit_char as an int now. (Fset_input_mode): As above, and signal an error if QUIT is not an ASCII character. * callint.c (Fprefix_numeric_value): Use XFASTINT to initialize val, not raw. * fileio.c (Fmake_symbolic_link): Don't expand FILENAME; this would make it impossible to make a link to a relative name. 1991-03-19 Jim Blandy (jimb@pogo.gnu.ai.mit.edu) * keyboard.c (syms_of_keyboard): Removed the DEFVAR_BOOL for meta-flag. This cannot be a lisp variable because we need to change the terminal settings whenever this flag changes. Change this through set-input-mode instead. 1991-03-19 Richard Stallman (rms@mole.gnu.ai.mit.edu) * keyboard.c (read_avail_input): Raise SIGHUP if no input on AIX. 1991-03-19 Jim Blandy (jimb@churchy.ai.mit.edu) * keyboard.c (kbd_buffer_store_event, kbd_buffer_read_char) (read_key_sequence, Fexecute_extended_command, Fset_input_mode) (init_keyboard, syms_of_keyboard): Use XSET (var, Lisp_Int, exp) instead of XSETINT (var, exp) in those cases where var is not known to already be a Lisp_Int. * search.c (skip_chars): Same. * xterm.c (construct_mouse_click, XTread_socket): Same. * callint.c (Fprefix_numeric_value): Make sure to return a Lisp_Int even when RAW is a cons whose car is not a Lisp_Int. * process.c (sigchld_handler): When searching for a process whose pid is -1, make sure that the pid is an int first, since network streams are in Vprocess_alist too. * keyboard.c (syms_of_keyboard): Added DEFVAR_BOOL for meta-flag. Emacs 18 had this, and I see no entry in the ChangeLog saying that it was purposefully removed. 1991-03-17 Jim Blandy (jimb@geech.ai.mit.edu) * keymap.c (Fcopy_keymap, Faccessible_keymaps, describe_map) (append_key): Minor typos and brainos corrected. * keyboard.c (read_char): Removed code to find the vector in a (kbd-macro . VECTOR) - style macro, since the macro is represented by the vector itself. (read_char_menu_prompt): Changed to correctly recognize the new dense keymap structures. (read_key_sequence): Changed code that checks for keymapness to use get_keymap_1 instead of doing the indirection and keymapness testing itself. (Fcommand_execute): A keyboard macro is now a string or a vector. (Fexecute_extended_command): When expanding this_command_keys, remember that it is now an array of Lisp_Objects, not chars. * doc.c (Fdocumentation): Rearranged into a switch statement, and made vectors macros, not keymaps. * eval.c (Fcommandp): Removed code to recognize (kbd-macro . VECTOR) as a command, and added code to recognize vectors as commands. * macros.c (Qkbd_macro): Variable deleted. (syms_of_macros): Initialization of Qkbd_macro removed. 1991-03-14 Jim Blandy (jimb@pogo.ai.mit.edu) * minibuf.c (keys_of_minibuf): Changed all calls to initial_define_lisp_key to calls to initial_define_key. * keymap.c (describe_map): Adjusted to handle the new style of keymap. 1991-03-14 Richard Stallman (rms@mole.ai.mit.edu) * fileio.c (Fwrite_region): On VMS, don't try rewriting old version. 1991-03-14 Jim Blandy (jimb@pogo.ai.mit.edu) * keymap.c (Faccessible_keymaps): Adjusted to handle the new style of keymap. (Fwhere_is_internal): Handle the new-style of keymaps. Additionally, only check to see if a match is shadowed by a binding in the local keymap when LOCAL_KEYMAP is non-nil, instead of comparing elt against DEFINITION yet again. (describe_map_tree): Handle key sequences that are vectors, as well as those that are strings. 1991-03-13 Jim Blandy (jimb@churchy.ai.mit.edu) * commands.h, keymap.c (meta_map, control_x_map): Make these Lisp_Objects, not Lisp_Vectors. keymap.c (syms_of_keymap): Same. * keymap.c (Fuse_global_map): There is no longer any reason to insist that KEYMAP must be a dense keymap; delete the code that does so. 1991-03-12 Jim Blandy (jimb@wookumz.ai.mit.edu) * commands.h, lisp.h: Changed global_map and current_global_map to be Lisp_Objects, not Lisp_Vectors. keyboard.c (read_key_sequence): Same. keymap.c (Fkey_binding, Fglobal_key_binding, Fglobal_set_key) (Fuse_global_map, Fwhere_is_internal, describe_buffer_bindings) (syms_of_keymap): Same. * keymap.c (Fdefine_key): Braino: increment idx and clear metized flag even when the element of the key sequence isn't a character. (Flookup_key): Fix same braino. 1991-03-10 Jim Blandy (jimb@wookumz.ai.mit.edu) * keymap.c (get_keyelt): Use access_keymap to resolve indirect entries, instead of duplicating its code. (Fcopy_keymap): Handle the new keymap structure. 1991-03-09 Richard Stallman (rms@mole.ai.mit.edu) * eval.c (struct catchtag): New field handlerlist. (internal_catch, internal_condition_case): Set that field. (unbind_catch): Use it. 1991-03-08 Richard Stallman (rms@mole.ai.mit.edu) * m-intel386.h (signal): Maybe define if USG. * keyboard.c (echo_char): Don't have space at end of echobuf. 1991-03-07 Jim Blandy (jimb@albert.ai.mit.edu) * keyboard.c (syms_of_keyboard): Initialize mouse_syms, instead of doing func_key_syms twice. Don't deal with scrollbar_syms, since it doesn't exist. 1991-03-06 Jim Blandy (jimb@pogo.ai.mit.edu) * keymap.c (access_keymap, store_in_keymap): Changed to handle the new style of keymaps. * fns.c (Fassq, Fcopy_alist): Changed docstring to promise to ignore elements of LIST that are not conses. See access_keymap and copy_keymap for a cheap excuse. 1991-03-06 Richard Stallman (rms@mole.ai.mit.edu) * s-vms.h (DATA_START): Remove `+ 512'. 1991-03-05 Jim Blandy (jimb@spiff.ai.mit.edu) * keymap.c (Fmake_keymap): Rewritten to construct the new dense keymap structure: (keymap VECTOR . ALIST). Docstring adjusted accordingly. This means that the keyboard macro stupidity (see Feb 27, keyboard.c) is no longer needed. 1991-03-03 Richard Stallman (rms@mole.ai.mit.edu) * sysdep.c (MEMORY_IN_STRING_H): New compilation flag. * s-isc2-2.h: New file. 1991-02-27 Jim Blandy (jimb@churchy.ai.mit.edu) * macros.c (Qkbd_macro): New variable, to hold the symbol `kbd-macro', which we use to tag vector-style keyboard macros. (syms_of_macros): Initialize and staticpro Qkbd_macro. * eval.c (Fcommandp): Recognize the new keyboard macros. * keyboard.c (Fcommand_execute): A keyboard macro is now a string, or a cons whose car is the symbol `kbd-macro' and whose cdr is a vector of events; previously, macros were strings or vectors, but that makes it difficult to tell the difference between macros and dense keymaps. (read_char): Handle the new macros correctly, and re-allocate this_command_keys correctly. 1991-02-26 Richard Stallman (rms@mole.ai.mit.edu) * s-vms.h (calloc): Define like malloc, etc. 1991-02-26 Jim Blandy (jimb@spiff.ai.mit.edu) * xterm.c (XTread_socket): Move enter_timestamp outside of the function; static variables inside functions don't always work in Emacs. * editfns.c (in_accessible_range): Deleted - insufficently general. (clip_to_bounds): New function, much like in_accessible_range, except that the upper and lower bounds are arguments. (goto_char, save_restriction_restore): Rewritten to use clip_to_bounds instead of in_accessible_range. 1991-02-25 Jim Blandy (jimb@pogo.ai.mit.edu) * keymap.c (initial_define_lisp_key): Turn KEY into a Lisp_Int before passing it to store_in_keymap. * buffer.c (reset_buffer_local_variables): Don't try to initialize the buffer's mouse_map and function_key_map fields, since they don't exist anymore. * macro.c (kbd_macro_buffer, kbd_macro_ptr, kbd_macro_end): These are now all pointers to Lisp_Objects instead of chars. (Fend_kbd_macro): Use make_sequence. (store_kbd_macro_char): Argument c is now a Lisp_Object. Change call to xrealloc to ask for Lisp_Objects instead of chars. Set kbd_macro_end to the same place in the new buffer as it was in the old one, not to the end of the buffer. (Fexecute_kbd_macro): Allow MACRO to be a string or a vector. (syms_of_macros): Allocate Lisp_Objects instead of chars for kbd_macro_buffer. * alloc.c (make_sequence): New function, useful to keyboard.c and macro.c. * keyboard.c (Fread_key_sequence): Use make_sequence. (Fthis_command_keys): Use make_sequence. 1991-02-24 Jim Blandy (jimb@churchy.ai.mit.edu) * keymap.c (Fwhere_is): If the command can't be found, the message is now "foobie is not on any key.", instead of "... any keys.". * keyboard.c (input_poll_signal): Pass 0 to read_avail_input, instead of `&junk'. Removed variable `junk'. (command_loop_1): Updated to handle the unified function key/mouse event/keystroke arrangement. (Finput_pending_p): Removed vestiges of code to handle unread_input_char value of -1, since this doesn't happen anymore. (read_char): Adapted to handle lispy events. (read_char_menu_prompt): Allocate `menu' buffer using alloca, instead of a variable-sized array, which is gcc-specific. (Frecent_keys): Return the most recent "keystrokes" as a vector, to accomodate lispy events. (Fset_input_mode): Accomodate non-characters as quit keys. If this is a bad thing, init_sys_modes will tell us. (init_keyboard): this_command_keys is now an array of Lisp_Objects; adjust the amount of storage we request to hold it. Remember that quit_char can be any keystroke. (syms_of_keyboard): last_command_char, last_input_char, help_char, menu_prompt_more_char and meta_prefix_char are now DEFVAR_LISPs instead of DEFVAR_INTs. 1991-02-24 Richard Stallman (rms@mole.ai.mit.edu) * process.c (wait_reading_process_input): Use NETCONN_P. 1991-02-23 Jim Blandy (jimb@pogo.ai.mit.edu) * keyboard.c (recent_keys, this_command_keys) (menu_prompt_more_char, help_char, last_command_char, quit_char) (last_input_char): Changed to Lisp_Objects, so we can use function keys for them. (Vglobal_function_map): Variable deleted. (echo_char): Echo function keys too. The argument C is now a Lisp_Object instead of a char. (Fread_key_sequence): Removed sludge to handle window events specially, and added sludge to handle sequences with non-characters in them. (classify_object): Elided, since this should go away soon. (read_key_sequence): Adapted to look up symbols in keymaps, just like characters. 1991-02-23 Richard Stallman (rms@mole.ai.mit.edu) * process.c (send_process): Handle EAGAIN like EWOULDBLOCK. 1991-02-22 Jim Blandy (jimb@pogo.ai.mit.edu) * doc.c (substitute_command_keys): Call describe_map_tree with only three arguments, since the CHARTAB arg has been disposed of. * keymap.c (Fcurrent_global_map, Fuse_local_mouse_map): Functions deleted, since the mouse maps are no longer separate from the key maps. (append_key): New function, which handles tacking a single keystroke on the end of a key sequence, promoting strings to vectors when needed. (Faccessible_keymaps): Adjusted to return vectors for key sequences, when necessary. (Fkey_description): Removed stuff to handle mouse buttons and other things specially, since this work will go into Fsingle_key_description. (Fsingle_key_description): SIMPLIFIED to handle everything correctly! Jeepers! (Fwhere_is_internal): Scan the assoc-list at the end of dense keymaps, and construct strings or vectors. (where_is_string, describe_buffer_bindings): Simplified by deleting code to handle mouse button bindings specially. (describe_map_tree): Removed CHARTAB argument; this was a kludge to print out mouse events nicely, and is no longer necessary. Nobody was using it anyway. (describe_map): Removed ugly hack to handle mouse buttons specially, added code to describe alists on dense keymaps, and removed CHARTAB argument. (describe_alist): Made to handle bindings of symbols as well as characters. Removed CHARTAB argument. (describe_vector): Removed CHARTAB argument, allocated KLUDGE outside of loop and GCPRO'd it. (syms_of_keymap): Remove last vestiges of Vglobal_mouse_map, Vmouse_button_names, Suse_local_mouse_map, Scurrent_local_mouse_map. * buffer.h (struct buffer): Removed mouse_map and function_key_map members, since they are now handled by the keymap element. * keyboard.c (syms_of_keyboard): Change initialization of meta_prefix_char, since it's now a Lisp_Object. * keymap.c (Fkeymapp): Rewrote this to use get_keymap_1; now it's a one-liner instead of a 13-liner. (DENSE_TABLE_SIZE): Created new constant for the # of lookup-style entries in a dense keymap, and the index of the map's assoc list. Used it where appropriate. (Fcopy_keymap): Notice that 129'th element in dense keymaps. (Fdefine_key, Flookup_key): Reworked to deal with vectors of symbols and characters as well as strings for key sequences. (meta_prefix_char): Changed from an int to a Lisp_Object. 1991-02-21 Richard Stallman (rms@mole.ai.mit.edu) * fileio.c (report_file_error): Don't downcase "I/O". 1991-02-20 Jim Blandy (jimb@geech.ai.mit.edu) * keymap.c (access_keymap): Allow IDX to be any sort of bindable event, and deal with the extended keymaps. IDX is now a Lisp_Object instead of an int, obviously. (store_in_keymap): Allow IDX to be any sort of bindable event, and deal with the extended keymaps. IDX is now a Lisp_Object. * xterm.c (construct_mouse_click): Add code to set the up_modifier bit for ButtonRelease events. * keyboard.c (kbd_buffer_store_event): Use XFASTINT and XSETINT to access event->code, since it's a Lisp_Object. (kbd_buffer_read_char): Golly, perhaps we should increment kbd_fetch_ptr to remove the event we just read from the queue. (modify_event_symbol): Stupid fixes: correctly look up unmodified symbols when cache entry has a modified symbol vector. And, when first adding the modified symbol vector, copy the old slot value into it correctly. 1991-02-19 Jim Blandy (jimb@pogo.ai.mit.edu) * keyboard.c (command_loop_1): #if 0 the block of code which handles mouse events and other lispy events specially, since I hope it will go away soon. * dispnew.c (Fsleep_for_millisecs): Pass all four arguments to wait_reading_process_input, instead of just the first two. * process.c (wait_reading_process_input): Remove support for only waiting for mouse input, since that has been superceded. This removes X dependencies from process.c, and eliminates some references to code that should only exist when using X10. * keyboard.c (mouse_moved_symbol, redraw_screen_symbol, mapped_screen_symbol, unmapped_screen_symbol, exited_window_symbol, exited_scrollbar_symbol): Renamed to Qmouse_moved, Qredraw_screen, Qmapped_screen, Qunmapped_screen, Qexited_window, Qexited_scrollbar, just as done in xterm.c. (classify_object): Removed code to look up a function key in the global and local function key keymaps, since this will be done more generally. (Fexecute_mouse_event): Elided this function with a #if 0; I think it will go away once the more general keymap stuff is implemented, but I'm not sure. (syms_of_keyboard): Removed defsubr for Sexecute_mouse_event. (where_is_string, describe_buffer_bindings, syms_of_keymap): Elided code to handle mouse button bindings specially; I hope this will go away. * lread.c (syms_of_lread): Change defsubr for eval-buffer to defsubr for eval-current-buffer. * keymap.c (syms_of_keymap): defvar for Vglobal_function_map removed, since that variable has disappeared. * xterm.c (x_func_key_to_sym): Removed entirely, since we no longer convert X keycodes to symbols in this section of code. (x_convert_modifiers): New function to turn the X modifier bits into struct input_event modifier bits. (encode_mouse_button): Removed, since this work isn't done here anymore. (Vx_send_mouse_movement_events): Add an extern declaration for this. * termhooks.h: Only define struct input_event if the module has previously #included lisp.h; this avoids forcing simple modules like cm.c to #include lisp.h. * term.c: #include "lisp.h" before #including "termhooks.h", since the latter uses Lisp_Objects now. * xfns.c (syms_of_xfns): Delete the defsubr for Sx_window_id, since Fx_window_id is gone. * xterm.c (construct_mouse_event): Construct a struct input_event instead of a lispy event. * screen.c (coordinates_in_window): Added explanatory comment. (window_from_coordinates): Change PART, whose returned values are dependent on X-windows, to be called MODELINE_P, with appropriate new return values. * xterm.c (notice_mouse_movement): Handle the X-windows dependent stuff that used to be in window_from_coordinates here instead. (XTread_socket): Modified to produce struct input_events instead of lispy events. 1991-02-18 Jim Blandy (jimb@pogo.ai.mit.edu) * termhooks.h: Added up_modifier to the enum for modifier bits; this bit will be applied to mouse events. (struct input_event): Changed specification of non_ascii_keystroke events to send the function key number instead of a symbol. * keyboard.c (modify_event_symbol): Re-arranged to work well with function key/mouse button numbers instead of symbols. And if (MODIFIERS & up_modifer), prepend "U-" to the name of the symbol being constructed. (make_lispy_event): Use the new modify_event_symbol. * xterm.c (notice_mouse_movement): Adjusted this function to work with a struct input_event instead of producing an s-expression. * xterm.c, xfns.c: Made all references to x_mouse_queue, x_expose_queue, and the functions which manipulate them conditional on having X10, since only X10 code ever places anything in these queues. 1991-02-15 Jim Blandy (jimb@pogo.ai.mit.edu) * termhooks.h: Define struct input_event, to represent input events while they sit in the keyboard input buffer. Using lisp objects to represent input events is a bad idea because the routines which enqueue them can be called from signal handlers, and therefore should not cons. * keyboard.c (kbd_buffer, kbd_fetch_ptr, kbd_store_ptr): Change these to be of type `struct input_event *'. (kbd_buffer_store_event): Manipulate struct input_events instead of lisp objects. (make_lispy_event): New function, to construct a lisp-style event corresponding to a particular struct input_event. (modify_event_symbol): New function, to add modifier prefixes to a symbol, and look the new symbols up quickly if they've already been created. (kbd_buffer_read_char): Call make_lispy_event to turn the thing in the keyboard buffer into the form that read_char is expecting. (Qwith_modifier_keys): Define this new symbol variable. (syms_of_keyboard): Initialize and protect Qwith_modifier_keys. * xterm.c (init_input_symbols): Rearranged the code that produces the func_key_syms array. (x_func_key_to_sym): Simplified, since more will be handled in make_lispy_event. (XTread_socket): When handling KeyPress events, don't pass the state of the modifier keys to x_func_key_to_sym, since it doesn't care any more. * sysdep.c (kbd_input_ast, end_kbd_input, read_input_waiting): Rename kbd_buffer_store_char to kbd_buffer_store_event. * keyboard.c (stuff_buffered_input): Since the keyboard buffer holds lisp objects, only stuff entries that are Lisp_Ints, and XINT them before passing them to stuff_char. (kbd_buffer_store_char): Make this not a static function, since sysdep.c calls it. And rename it kbd_buffer_store_event. * keyboard.c (kbd_buffer, kbd_fetch_ptr, kbd_store_ptr): Made these variables static, to document the fact that they're only used within keyboard.c. 1991-02-13 Jim Blandy (jimb@pogo.ai.mit.edu) * xterm.c (init_input_symbols): Remove the `xk-' prefix from all the function key symbols, since they're going to be used for function keys from all sorts of terminals, not just when running under X. * lread.c (read_escape): Removed support for mouse button escapes (\S-, \U-, \C- applied to digits), because they're being replaced by something more rational. 1991-02-09 Richard Stallman (rms@mole.ai.mit.edu) * buffer.c: Doc fix. * sysdep.c (dup2): Rewrite of non-F_DUPFD case. 1991-02-08 Richard Stallman (rms@mole.ai.mit.edu) * m-intel386.h (LOAD_AVE_CVT): Add extra parens. * s-usg5-4.h (LIBX11_SYSTEM): #undef it. 1991-02-07 Richard Stallman (rms@mole.ai.mit.edu) * s-esix.h: New version from kayvan. Adds HAVE_X11 conditional, NEED_PTEM_H, USG_SYS_TIME, USE_UTIME, LIBS_DEBUG; removes #undef sigsetmask, LIBS_SYSTEM, ESIX, MISSING_UTIMES. 1991-02-06 Richard Stallman (rms@mole.ai.mit.edu) * process.c (Faccept_process_output): Second arg gives timeout. 1991-02-06 Jim Blandy (jimb@geech.ai.mit.edu) * lread.c (read_escape): Added support for \S- and \U- escapes (for binding mouse buttons), and noted that \C- must work on digits. * xterm.c (init_input_symbols): Was mistakenly renamed init_inputs; named back. * xterm.c (construct_mouse_click, encode_mouse_button): Rewritten to build new-style mouse events. * dispnew.c (update_line): Write a zero into obody[olen] to make sure the lines in current_screen->glyphs remain terminated. * xdisp.c (display_string, display_text_line): Don't write off the end of the line and destroy the zero terminator when expanding a tab. * fns.c (Fy_or_n_p): Accept C-] (usually abort-recursive-edit) as well as C-g to quit. 1991-02-05 Jim Blandy (jimb@geech.ai.mit.edu) * sysdep.c, s-aix3-1.h, s-hpux.h, s-iris3-5.h, s-iris3-6.h, * s-irix3-3.h, s-rtu.h, s-sunos4-1.h, s-unipl5-0.h, s-unipl5-2.h, * s-usg5-0.h, s-usg5-2-2.h, s-usg5-2.h, s-usg5-3.h, s-xenix.h: Globally replaced INTERRUPTABLE with INTERRUPTIBLE. * xterm.c (construct_mouse_event): Renamed to construct_mouse_click, since there are kinds of mouse events besides clicks (movement, for example). (XTread_socket): Rename calls here. * xterm.c (mapped_screen_symbol, unmapped_screen_symbol) (exited_scrollbar_symbol, exited_window_symbol) (redraw_screen_symbol, mouse_moved_symbol): Renamed to Qmapped_screen, Qunmapped_screen, Qexited_scrollbar, Qexited_window, Qredraw_screen, Qmouse_moved, to agree with naming conventions elsewhere in Emacs. * xfns.c (text_part_sym, modeline_part_sym) (vertical_scrollbar_sym, vertical_slider_sym, vertical_thumbup_sym) (vertical_thumbdown_sym, horizontal_scrollbar_sym) (horizontal_slider_sym, horizontal_thumbleft_sym) (horizontal_thumbright_sym): Renamed to Qtext_part, Qmodeline_part, Qvscrollbar_part, Qvslider_part, Qvthumbup_part, Qvthumbdown_part, Qhscrollbar_part, Qhslider_part, Qhthumbleft_part, Qhthumbright_part, to agree with the naming conventions elsewhere in Emacs. * xterm.c (XTread_socket): While handling EnterNotify events, clear Vmouse_event here. (notice_mouse_movement): Don't clear it here. 1991-02-04 Richard Stallman (rms@mole.ai.mit.edu) * s-sunos4-0.h: Renamed from s-sunos4.h. (read, write, open, close): Macro defs moved to s-sunos4-1.h. (INTERRUPTABLE_*): Likewise. * s-sunos4-1.h: New file. 1991-02-04 Jim Blandy (jimb@churchy.ai.mit.edu) * keymap.c (Vglobal_mouse_map, Vglobal_function_map): Variables removed in preparation for conversion to unified keymap format. (Fmake_keymap): Make vector keymaps with 129 entries; the last will be an assoc-list for looking up symbols. Update docstring to describe 129'th element. (Fmake_sparse_keymap): Update docstring to say that you can bind symbols in these maps too. (Fkeymapp): Recognize 129-element vectors as keymaps, not 128-element vectors. (get_keymap_1): wrong_type_argument can no longer return a new value supplied by the debugger; remove loop to support this. * xterm.c (XTread_socket): When handling EnterNotify events, enqueue fake mouse events iff Vx_send_mouse_movement_events != Qnil. * xfns.c (Fx_window_id): Function removed; Fscreen_parameters already provides this information. * xterm.c (x_term_init): Cleaned up the code to get the host name, and removed fixed limit on host name length. * window.c (Fscroll_other_window): Don't explicitly save current_buffer and point; the save_excursion will take care of that anyway. * dispnew.c (safe_bcopy): Rewritten to handle overlapping regions with multiple calls to bcopy instead of a stupid copy loop. * xterm.c, xfns.c (Vscreen_part, Vx_send_movement_events): These variables renamed to Vmouse_screen_part, Vx_send_mouse_movement_events. * lread.c (Feval_buffer): Function deleted. (Feval_current_buffer): Removed "#if 0 ... #endif" around this function. 1991-02-03 Richard Stallman (rms@mole.ai.mit.edu) * Makefile, ymakefile (SHELL): Force use of sh. * s-usg5-4.h (USG5_4): Define it. (LOAD_AVE_*): Don't define them. * m-intel386.h (LOAD_AVE_*): Define, if USG5_4. * buffer.c (Fbuffer_local_variables): Omit slots with no names. 1991-02-03 Jim Blandy (jimb@geech.ai.mit.edu) * xterm.c (x_term_init, init_input_symbols): Moved these to the bottom of the file, 1) to be consistent with the other files, and 2) so it can initialize some variables I want. 1991-02-02 Jim Blandy (jimb@churchy.ai.mit.edu) * xterm.h: Added external declaration for x_focus_screen. * search.h: File deleted. * buffer.h: Declare searchbuf here instead. * screen.c (Ffocus_screen, Funfocus_screen): Moved these functions to xfns.c, since they're x-specific. (syms_of_screen): Removed defsubr calls for above. * xfns.c (Ffocus_screen, Funfocus_screen): Here they are. (syms_of_xfns): The defsubrs are here now. * buffer.h (PT): Make this expand to an expression which is not an l-value, to prevent people from assigning to it. If everyplace uses SET_PT, it will be easier to merge in the interval code. (point): Similar changes here. (SET_PT): This can no longer be written in terms of PT, so write out current_buffer->text.pt. * xterm.c (x_new_font): Rewritten to remove arbitrary limit on size of x_font_table. (x_font_table_size): Created new variable. (n_available_fonts, font_names, font_info, MAX_FONTS): Deleted these variables/macros. * dispnew.c (scroll_screen_lines): Instead of disabling the lines vacated by the scroll (i.e. zeroing enable), mark them as enabled but empty. * callint.c (Fcall_interactively): Move UNGCPRO down, so that stuff is protected while we build the command history entry and do the function call. * xterm.c (XTupdate_end): Turn cursor on, even if we don't currently have the focus. * minibuf.c (temp_echo_area_glyphs): Clear echo_area_glyphs and previous_echo_glyphs, so the message we're displaying will supercede any existing message. * keyboard.c: Removed external declaration of echo_area_glyphs, since it's declared in window.h. 1991-01-31 Jim Blandy (jimb@pogo.ai.mit.edu) * xterm.c (XRINGBELL): Pass 0 as the second argument to XBell; respect the user's preferences. 1991-01-30 Jim Blandy (jimb@pogo.ai.mit.edu) * xterm.c (x_draw_single_glyph): New function, created to simplify cursor drawing/undrawing. (x_display_box_cursor): Rewritten to properly handle the box cursor in its filled and hollow forms. * xterm.h (enum text_cursor_kinds): Added enum for the different kinds of cursors which might be displayed in a window. (struct x_display): Added member `text_cursor_kind' which says which kind of cursor is currently being displayed in the window, so we can arrange to redraw it effectively. * keyboard.c (command_loop_1): When handling the forward_char command, don't let point move to the location after the end of the buffer. * keyboard.c (poll_suppress_count): Define this even if POLL_FOR_INPUT is not defined, because this makes lots of #ifdef clauses unnecessary, and doesn't hurt, because {start,stop}_polling become nops. * config.h, config.h-dist: Make these #include "system.h" and "machine.h", and let the config script link these appropriately, instead of using the machine-specific names and expecting the user to edit this file. 1991-01-29 Jim Blandy (jimb@churchy.ai.mit.edu) * window.c (Fdelete_window): sib is a Lisp_Object; treat it as such. * xterm.c (screen_unhighlight): When the focus leaves a screen, draw the cursor as a box instead of making it disappear entirely. 1991-01-29 Richard Stallman (rms@mole.ai.mit.edu) * unexec.c (make_hdr) [TPIX]: Set f_hdr.f_nscns and f_thdr.f_scnptr. * sysdep.c [BROKEN_TIOCGWINSZ]: Undef TIOCGWINSZ. * process.c (wait_reading_process_input): Don't ignore a zero-length read on a network connection. Do close it. * sysdep.c (hft_init, hft_reset): Pass &junk as arg to HFQERROR. Do nothing if not HFT. 1991-01-29 Jim Blandy (jimb@albert.ai.mit.edu) * xfns.h: Created, to declare things defined in xfns.c. Declare Vx_send_movement_events. * xfns.c: #include "xfns.h". (Vx_send_movement_events): Define this variable. (syms_of_xfns): DEFVAR_LISP it. * xterm.c: #include "xfns.h". (XTread_socket): Place a mouse-moved event in the buffer iff Vx_send_movement_events says to. 1991-01-28 Jim Blandy (jimb@geech.ai.mit.edu) * ymakefile: Noted that callint.o depends on mocklisp.h, and dired.o on search.h. * environ.h: Deleted - its creation in the first place was misguided. callproc.h: Removed #include "environ.h", and added declarations for environ.h * buffer.c (syms_of_buffer): Add more detailed documentation to buffer-undo-list. * lisp.h (poll_suppress_count): Add external declaration for this here. 1991-01-28 Richard Stallman (rms@mole.ai.mit.edu) * m-sun3-68881.h, m-sun3-fpa.h, m-sun3-soft.h: New files. 1991-01-27 Jim Blandy (jimb@geech.ai.mit.edu) * lisp.h (struct handler): Add poll_suppress_count member, so we can restore poll_suppress_count when we handle an error. * eval.c (struct catchtag): Add it here too, for throws. (internal_catch, Fcondition_case, internal_condition_case): Record the value of poll_suppress_count here in the handler and catch tag. (Fthrow, Fsignal): Restore it here. 1991-01-25 Jim Blandy (jimb@churchy.ai.mit.edu) * xterm.c (x_display_box_cursor): If we're undrawing the cursor by redrawing the character underneath it, draw according to that line's highlight, instead of assuming it's in the normal GC. 1991-01-25 Richard Stallman (rms@mole.ai.mit.edu) * buffer.h (PTR_CHAR_POS): Value was too small by 1. 1991-01-16 Richard Stallman (rms@mole.ai.mit.edu) * doprnt.c (doprnt): Check for overflow in fmtcpy. 1991-01-16 Jim Blandy (jimb@churchy.ai.mit.edu) * window.c (Fdelete_window): If the deletee gives its space to its next sibling, that sibling needs to have its top/left side pulled back to where the deletee's is. 1991-01-15 Jim Blandy (jimb@geech.ai.mit.edu) * doc.c (Fsnarf_documentation): Handle attaching docstrings to bytecode objects too. * syntax.h (syntax_spec_code): Make external declaration for this unsigned char to match the definition in syntax.c. * indent.c (compute_motion): Added comments describing how it can be used. 1991-01-15 Richard Stallman (rms@mole.ai.mit.edu) * process.c (create_process): Use SETUP_SLAVE_PTY if defined. * s-usg5-4.h (HAVE_PTYS, HAVE_SETSID): Defined. (HAVE_WAIT_HEADER, WAITTYPE, wait3, WRETCODE): New macros. (TIOCSIGSEND): Alias for TIOCSIGNAL. (FIRST_PTY_LETTER): Overridden. (PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF, SETUP_SLAVE_PTY): New macros. * m-ibmrs6000.h (CANNOT_DUMP): Undefine it. (UNEXEC): Define it. (PURE_SEG_BITS, SHMKEY): Define only if CANNOT_DUMP. (LINKER): Override it. Then add -bnodelcsect. * xfns.c (Fx_get_default): Try reversing XGetDefault args if it fails. 1991-01-13 Richard Stallman (rms@mole.ai.mit.edu) * s-usg5-4.h (LOAD_AVE_CVT): Cast value to int. * keyboard.c (read_avail_input): Signal SIGHUP if FIONREAD fails. * ymakefile: Put tokens after #endif into comment. * filelock.c (lock_file_owner_name): Declare argument type. * syntax.c (syntax_spec_code): Type now unsigned char. * process.c (wait_reading_process_input): Call status_notify even when not doing redisplay. * emacs.c (Fkill_emacs): Turn off SIGIO before exiting. * s-usg5-3.h (USG5_3): Define it. * m-ibmps2-aix.h [USG5_3]: Define TEXT_START as 0. Don't define DATA_START or DATA_END or TEXT_END or DATA_SEG_BITS. Override various other symbols at end of file. 1991-01-12 Jim Blandy (jimb@churchy.ai.mit.edu) * window.c (window-configuration-p): Closing paren needed. Added. * keyboard.c (command_loop_1): When displaying a message over an active minibuffer, call Fsit_for with three arguments, not two. 1991-01-12 Richard Stallman (rms@mole.ai.mit.edu) * s-irix3-3.h (HAVE_SYSVIPC): Defined. 1991-01-12 Jim Blandy (jimb@pogo.ai.mit.edu) * dispnew.c (buffer_posn_from_coords): Compute_motion starting from bufp[y] instead of counting from the top of the window. 1991-01-11 Richard Mlynarik (mly@pizza.ai.mit.edu) * window.c (window-configuration-p): Needed. Added. 1991-01-11 Jim Blandy (jimb@churchy.ai.mit.edu) * dispnew.c (buffer_posn_from_coords): Remember to deduce space for the line continuation markers and the window separators from the window width. 1991-01-11 Richard Stallman (rms@mole.ai.mit.edu) * m-tower32v3.h (VALBITS, GCTYPEBITS): Use 26 bits for pointer. 1991-01-10 Richard Stallman (rms@mole.ai.mit.edu) * fileio.c (Fcopy_file): Always close descriptors. * s-sunos4.h: read, write, open and close are interruptable. 1991-01-09 Jim Blandy (jimb@churchy.ai.mit.edu) * xterm.c, dispnew.c (pixel_to_char_translation): Renamed to pixel_to_glyph_translation, and rewritten. Just get coordinates, don't return anything. (buffer_posn_from_coords): New function - given a window and co-ordinates on the screen, find the buffer position at those co-ordinates. 1991-01-08 Jim Blandy (jimb@geech.ai.mit.edu) * alloc.c (Fmake_byte_code): Flesh out docstring. * window.c (window_loop): Pick the first window correctly, even when screen == 0. * dispnew.c (scroll_screen_lines): Don't forget to call update_begin at the top of the down-scrolling section. And rotate by amount, not -amount, in the up-scrolling section. * xterm.h (MAX_FONTS, x_font_table, n_fonts): Removed external declarations for these variables, since they're declared static in xterm.c and not used elsewhere. * xterm.c (MAX_FONTS): Moved definition of this to here from xterm.h. * xterm.c (x_new_font): If you can't find the requested font, return a code which indicates this, instead of calling abort. 1991-01-07 Jim Blandy (jimb@churchy.ai.mit.edu) * xdisp.c (redisplay, display_mode_line): To test Vglobal_minibuffer_screen for validity, you must check that its type is Lisp_Screen; comparing it to Qnil isn't good enough. * screen.c (syms_of_screen): Initialize Vglobal_minibuffer_screen to Qnil; otherwise, it inhibits decent redisplay (is that another bug?) * dispnew.c (init_display): Make sure that the standard input is a terminal here. * emacs.c (main): Not here, since we don't know yet if we want to use a window system of some sort. * xfns.c (x_make_gc): Delete code to support default_face and highlight_face, since they're part of the interval code, and shouldn't be installed yet. * dispnew.c (init_display): Calculate_costs expects a screen parameter; pass selected_screen, instead of nothing. * search.c (Freplace_match): Protect STRING. * process.c (run_filter): New function. (read_process_output, exec_sentinel): Use run_filter to call the process's filter function. (status_notify): GCPro MSG. * process.c (Fopen_network_stream): Protect various args. * print.c (Fprin1_to_string, Fprint): Protect OBJ. * lread.c (Feval_region): Check type of B. * keymap.c (describe_alist): Protect ELT_PREFIX and TEM2. (describe_vector): Likewise for ELT_PREFIX and TEM1. 1991-01-06 Richard Stallman (rms@mole.ai.mit.edu) * sysdep.c (init_sys_modes): Turn off VSUSP and V_DSUSP if they exist. Only on a MIPS. 1991-01-05 Jim Blandy (jimb@spiff.ai.mit.edu) * xselect.c (x_answer_selection_request): For incremental, set format to 32 and send only 1 element. Pass the address of size, not size itself. (x_selection_arrival): For incremental, delete the property containing the size of the transfer. This generates a PropertyNotify to the owner, starting the exchange. * xrdb.c (get_user_app): Pass correct number of parameters to sprintf. * xfns.c (x_window): Don't use backing store or saveunders; they seem to slow down suns. (x_icon): Set the InputHint to the window manager to False. (x_make_gc): Initialize gc_values.line_width to zero before creating the normal video GC, since it uses it. And set the default_face and hilite_face gcs here. (install_vertical_scrollbar): Add 2 to thumbdown y position, and don't add ibw. * insdel.c (insert, del_range): Use SET_PT rather than assigning point directly. * window.c (Fselect_window): Here too. * xdisp.c (redisplay_all_windows): Removed static declaration for this nonexistent function. 1991-01-04 Jim Blandy (jimb@pogo.ai.mit.edu) * window.c (window_loop): Neatened up. MINI being non-zero now makes it recognize active minibuffer windows. Iterates properly over multiple screens when asked nicely. (Fget_lru_window, Fget_largest_window): SCREENS arguments are now declared as a Lisp_Object, and documented. (Fget_buffer_window): SCREENS argument is now documented. (Fdelete_other_windows): Delete other windows on the argument window's screen, not the current screen. * screen.c (window_from_coordinates): Changed other reference to Fnext_window to use next_screen_window; see below. * window.c (Fnext_window, Fprevious_window): Accept non-nil, non-t values for mini, and don't turn off all-screens when mini is t but there is no global minibuffer screen. Remove screen_{root,mini} variables. (Fother_window): Added second argument all_screens. * undo.c (record_delete): Removed dead variable llength. * data.c (Qkeyp, Fkeyp): Removed these and supporting code. * keymap.c (Fsingle_key_description): Report an error instead of calling wrong_type_argument. * lisp.h (Qkeyp): Removed external declaration for this. 1991-01-03 Richard Stallman (rms@mole.ai.mit.edu) * search.c (search_buffer): Return starting position if count == 0. 1991-01-02 Jim Blandy (jimb@pogo.ai.mit.edu) * scroll.c (do_scrolling): Use correct limits on loop to clear lines just inserted--old version lost a line. * screen.c: #ifdef HAVE_X_WINDOWS, #include xterm.h (Ffocus_screen, Funfocus_screen): Use Joe's new definitions, and only define these functions ifdef HAVE_X_WINDOWS. (window_from_coordinates): Use next_screen_window instead of Fnext_window, so that global minibuffers work. * lread.c (syms_of_read): Don't forget to defsubr read-char-exclusive. * lisp.h (Fscreenp, Fselect_screen, Ffocus_screen) (Funfocus_screen, Fselected_screen, Fwindow_screen) (Fscreen_root_window, Fscreen_selected_window, Fscreen_list) (Fnext_screen, Fdelete_screen, Fread_mouse_position) (Fset_mouse_position, Fmake_screen_visible, Fmake_screen_invisible) (Ficonify_screen, Fdeiconify_screen, Fscreen_visible_p) (Fvisible_screen_list, Fscreen_parameters) (Fmodify_screen_parameters, Fscreen_pixel_size, Fscreen_height) (Fscreen_width, Fset_screen_height, Fset_screen_width) (Fset_screen_size, Fset_screen_position, Fcoordinates_in_window_p) (Flocate_window_from_coordinates, Frubber_band_rectangle): Added extern declarations for all these. * lisp.h (Qscreenp): Added an extern declaration for this. * lisp.h (DBL_DIG): Added constant for the maximum number of decimal digits a float could print to. Used in print.c. * keymap.c (Fkey_description): Produce pretty descriptions of mouse and window system events too. (Fsingle_key_description): Signal an error if obj is not a key. * data.c (Fkeyp, Qkeyp): Added predicate to recognize things which can be bound - this includes keys, symbols (for function keys and window system events), and conses (for mouse events). * lisp.h (Qkeyp): Added external declaration for this. * keyboard.c (Frecursive_edit): Don't specbind the standard IO here. (recursive_edit_1): Do it here, and don't forgot to unbind_to. (command_loop_1): Reset no_redisplay after mouse commands. (classify_object): Place the object in read_key_sequence_cmd. (Fread_key_sequence): Recognize that when read_key_sequence returns -1 or -2, it's a mouse event or window system event. 1991-01-01 Jim Blandy (jimb@pogo.ai.mit.edu) * fileio.c (Fwrite_region): We should dereference GPT_ADDR[-1] before comparing it to '\n' for VMS cruft. (Fdo_auto_save): Don't call run-hooks before it's defined. This only happens before emacs is dumped, when loading inc-vers.el. * eval.c (Fsignal): TOTALLY_UNBLOCK_INPUT here. (error): Not here. (Feval): We use argvals[0..5], so declare it to have six elements instead of just five. 1990-12-30 Richard Stallman (rms@mole.ai.mit.edu) * eval.c (Fsignal): Don't ever return. Call error instead if user tries to use debugger to return. * eval.c (unbind_to): New second arg is value to return. gcpro it. All callers changed to pass the arg; if a caller uses unbind_to just before returning, it passes as this arg the value it wants to return, then it returns whatever comes back. 1990-12-28 Jim Blandy (jimb@geech.ai.mit.edu) * print.c (print): Put obj in a non-register variable so we could gcpro it. Also fixed some syntax errors. * editfns.c (Fformat): Declare nstrings, and declare nstrings and strings in a local block. (Fformat): XFLOAT(args[n]) isn't a float; ->data is. 1990-12-27 Richard Stallman (rms@mole.ai.mit.edu) * m-tower32.h: Add comments for how to optimize. * m-tower32v3.h: New file. * fileio.c (Fwrite_region): Save errno around unlock_file. 1990-12-26 Richard Stallman (rms@mole.ai.mit.edu) * editfns.c (Fformat): Handle floats. Convert between int and float. Don't truncate value at null char coming from doprnt. * doprnt.c (doprnt): Replace tembuf with malloced buff if too small. Handle %e, %f and %g. 1990-12-25 Richard Stallman (rms@mole.ai.mit.edu) * abbrev.c (Fexpand_abbrev): Use insert_from_string, not insert. (Funexpand_abbrev): Likewise. * doc.c (Fsubstitute_command_keys): Likewise. * editfns.c (Finsert, Finsert_before_markers): Likewise. * minibuf.c (Fminibuffer_complete_word): Likewise. * mocklisp.c (Finsert_string): Use insert1. * vmsfns.c (Fdefault_subproc_input_handler): Likewise. * print.c: Don't use strout for the text of a Lisp string. (print_string): New function to use instead. (print): Use print_string when no escapes needed. When printing with escapes, protect the string and check addr often. 1990-12-24 Richard Stallman (rms@mole.ai.mit.edu) * insdel.c (insert_from_string): New function. 1990-12-20 Richard Stallman (rms@mole.ai.mit.edu) * term.c (ins_del_lines): Handle scroll region wrt chars_wasted. 1990-12-16 Jim Blandy (jimb@pogo.ai.mit.edu) * Globally renamed InsStr to insert_string. 1990-12-15 Richard Stallman (rms@mole.ai.mit.edu) * s-usg5-3.h (USG_SHARED_LIBRARIES): Define it. * m-intel386.h (C_SWITCH_MACHINE): New macro. 1990-12-15 Jim Blandy (jimb@pogo.ai.mit.edu) * alloc.c (STRING_FULLSIZE): Use sizeof(struct Lisp_String) instead of sizeof(int). 1990-12-14 Jim Blandy (jimb@pogo.ai.mit.edu) * keyboard.c (Fread_key_sequence): Clear this_command_key_count here; who unfixed this? 1990-12-12 Richard Stallman (rms@mole.ai.mit.edu) * abbrev.c (Fdefine_abbrevs): Don't crash when EXPANSION is nil. 1990-12-11 Richard Stallman (rms@mole.ai.mit.edu) * eval.c (Fmacroexpand): Change handling of (foo . bar) in ENV. 1990-12-10 Richard Stallman (rms@mole.ai.mit.edu) * m-pmax.h (SYSTEM_MALLOC): Define it. * process.c (wait_reading_process_input): Ignore failure with EIO. 1990-12-09 Richard Stallman (rms@mole.ai.mit.edu) * m-iris4d.h (LOAD_AVE_CVT): Divide by 1024. (LIB_STANDARD): Use -lbsd first. (LIBS_MACHINE): Don't use -lbsd here. * s-irix3-3.h (ADDR_CORRECT): Macro deleted. (LIBS_MACHINE): Macro deleted. (LDAV_SYMBOL): Delete the `_' from start of symbol. * process.c (create_process): Delete duplicate sigsetmask. * m-ibmrt.h (RTPC_REGISTER_BUG, SHORT_CAST_BUG): Macros deleted. (C_SWITCH_MACHINE): Use -D to define alloca. (SIGN_EXTEND_CHAR): Use a cast. 1990-12-05 Jim Blandy (jimb@pogo.ai.mit.edu) * keyboard.c (Fsuspend_emacs): Protect STUFFSTRING. (cmd_error): Protect TAIL while printing. (input_poll_signal, start_polling): Use polling_period. (syms_of_keyboard): Initialize it and make it a Lisp var. * fns.c (Fyes_or_no_p): Protect PROMPT for entire loop. * fileio.c (Frename_file): Protect args. * fileio.c (Fadd_name_to_file): Protect the args. (Fcopy_file, Fmake_symbolic_link): Likewise. (Finsert_file_contents): Protect FILENAME. 1990-12-04 Jim Blandy (jimb@geech.ai.mit.edu) * eval.c (Fbacktrace): gcpro TAIL. * emacs.c (Fkill_emacs): gcpro ARG. * editfns.c (Fformat): Remove remains of gcpro'd args. * dispnew.c (syms_of_dispnew): Don't clobber Vwindow_system_version if CANNOT_DUMP. * dired.c (file_name_completion): Check that FILE is a string. * buffer.c (Fbury_buffer): Don't init BUF1. * doc.c (Fsubstitute_command_keys): Protect STR and don't keep a pointer to the middle of it. * m-hp9000s300.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Override for BSD. * process.c (sigchld_handler): Clear synch_process_alive if the dying process isn't in the table at all. * callproc.c (call_process_cleanup): Clear synch_process_alive. 1990-12-03 Jim Blandy (jimb@geech.ai.mit.edu) * callproc.c (Fcall_process): Change synch_process_pid to synch_process_alive, as a general flag that we are waiting for a synchronous process to die. This obviates the need to block SIGCHLDs until we know the pid. * sysdep.c (wait_for_termination): Wait for synch_process_alive to be false. * process.c (sigchld_handler): If pid not recognized, look for a process recorded with pid -1. (create_process): Set pid to -1 before the fork. Store correct pid right after the fork. Don't change sigchld handler on system V. * process.c (Fstart_process): Set BUFFER before other string vars so a gc in Fget_buffer_create won't clobber them. 1990-11-30 Richard Stallman (rms@mole.ai.mit.edu) * keyboard.c (read_command_char): Save and restore getcjmp. 1990-11-29 Richard Stallman (rms@mole.ai.mit.edu) * process.c (status_convert): Use WRETCODE for exited process. 1990-11-26 Richard Stallman (rms@mole.ai.mit.edu) * s-usg5-4.h (LIB_STANDARD): Add libucb.a. (NEED_PTEM_H): Define this instead of NEED_SIOCTL. * m-ibm370aix.h, m-ibmps2-aix.h, m-ibmrs6000.h (NEED_SIOCTL): Undefine this. (NEED_PTEM_H): Likewise. * s-sunos4.h (O_NDELAY): Don't define this. * print.c (Fwith_output_to_temp_buffer): Don't eval first arg twice. 1990-11-22 Richard Stallman (rms@mole.ai.mit.edu) * m-hp9000s300.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Alternate defs for BSD. 1990-11-21 Jim Blandy (jimb@churchy.ai.mit.edu) * dispnew.c (init_display): Check if we're using a window system before trying to initialize the terminal. If someone has indicated that they want to use a window system, we shouldn't bother initializing the terminal. This is especially important when the terminal is so dumb that emacs gives up and doesn't bother using the window system. 1990-11-20 Jim Blandy (jimb@churchy.ai.mit.edu) * print.c (Fexternal_debugging_output): Added new function which writes a character to stderr, for use when debugging emacs with gdb. 1990-11-14 Jim Blandy (jimb@churchy.ai.mit.edu) * dispnew.c (window_change_signal): Used to assume that SIGWINCHes always applied to the currently selected screen. Now it scans the list of screens for a screen controlled by termcap, and changes that screen's size. 1990-11-13 Richard Stallman (rms@mole.ai.mit.edu) * fileio.c (err_str): New macro. (Finsert_file_contents, Fwrite_region): Use it in error messages. 1990-11-12 Richard Stallman (rms@mole.ai.mit.edu) * insdel.c (del_range): Supply missing arg to gap_left. 1990-11-11 Jim Blandy (jimb@churchy.ai.mit.edu) * regex.c: Disabled definition of NULL from lisp.h * crt0.c (_start): Added static declaration of start1. * xfns.c: Added definition for Vbar_cursor. (syms_of_xfns): Added DEFVAR_LISP clause for Vbar_cursor. * xterm.c (XTread_socket): Passed &event.xkey instead of &event to XLookupString, so things will typecheck nicely. * Globally rewrote all references to Vmouse_buffer to use the buffer viewed by Vmouse_window instead. * alloc.c (xmalloc, xrealloc): Removed calls to {un,}hold_window_change. The new SIGWINCH-handling code and do_pending_window_change make them unnecessary. 1990-11-11 Richard Stallman (rms@mole.ai.mit.edu) * process.c (wait_reading_process_input): Make Available static; don't clear when a nonzero bit is found. * fns.c (Fnthcdr): Stop loop if reach end. * dispnew.c: Include fcntl.h if HAVE_TERMIO. 1990-11-10 Jim Blandy (jimb@pogo.ai.mit.edu) * alloc.c (make_uninit_string): No longer declared static, and extern declaration added to lisp.h. It's used in dired.c. 1990-11-08 Jim Blandy (jimb@geech.ai.mit.edu) * dispnew.c (do_pending_window_change): Changed incorrect call to change_window_size_1 into a loop which scans list of screens and resizes those that need resizing. 1990-11-06 Richard Stallman (rms@mole.ai.mit.edu) * m-ibmrs6000.h (CANNOT_DUMP): Define it. * process.c (create_process): Unblock SIGCHLD in the child. * process.c (wait_reading_process_input): Don't read input from more than one process between calls to `select'. 1990-11-02 Richard Stallman (rms@mole.ai.mit.edu) * callint.c (syms_of_callint): Initialize Vprefix_arg and Vcurrent_prefix_arg. 1990-11-01 Richard Stallman (rms@mole.ai.mit.edu) * dired.c (Fdirectory_files): Avoid using MAXNAMLEN. 1990-10-31 Jim Blandy (jimb@churchy.ai.mit.edu) * process.c (MAXDESC): Enclosed definition in `#ifndef ... #endif' clause. * bytecode.c: Included syntax.h to declare syntax_code_spec. * syntax.h (syntax_spec_code): Added extern declaration for this. * floatfns.c (float_error): Added static declaration for this at the top of the file. 1990-10-29 Jim Blandy (jimb@pogo.ai.mit.edu) * indent.c (position_indentation): Renamed stray `bf_cur' to `current_buffer', and old `CharAt' usages to `FETCH_CHAR'. * buffer.c (Fbuffer_disable_undo): The symbol object for this subroutine was still named Sbuffer_flush_undo, and the symbol's lisp name was similarly out of date. Renamed both, and added an alias in lisp/subr.el . * keyboard.c (Fset_input_mode): A `meta_flag' had escaped being renamed to `meta_key'. 1990-10-29 Richard Stallman (rms@mole.ai.mit.edu) * process.c (Fprocess_send_region, Fprocess_send_string): Break data into bunches less than 500 bytes. Accept process output between bunches. ??? Must update manual. 1990-10-29 Jim Blandy (jimb@pogo.ai.mit.edu) * window.c (Fset_window_start, window_scroll): Renamed stray references to `redo_mode_line' to `update_mode_line'. * xdisp.c (decode_mode_spec): Renamed stray references to `bf_cur' and `bf_modified' to `current_buffer' and `MODIFF'. 1990-10-25 Jim Blandy (jimb@pogo.ai.mit.edu) * environ.h: File created - contains declarations for users of the environment variable list. * callproc.c (environ): Removed extern declaration of environ, and included environ.h. 1990-10-24 Jim Blandy (jimb@pogo.ai.mit.edu) * callproc.c (init_callproc): Removed extern declaration of environ - it's already taken care of at the top of the file. * mocklisp.h: File created - externally declares certain functions defined in mocklisp.c. * lisp.h (Fread_buffer, Fread_key_sequence): Added extern declarations for these functions. * callint.c (ml_apply, Fread_buffer, Fread_key_sequence): Removed extern declarations for these functions, included mocklisp.h. Moved external declaration of index to top of file. 1990-10-24 Richard Stallman (rms@mole.ai.mit.edu) * ymakefile (GNULIB_VAR): New make variable. (LIBES): Use that, not GNULIB directly. (GNULIB): Don't define if already defined. 1990-10-23 Jim Blandy (jimb@geech.ai.mit.edu) * indent.h (last_known_column_point): Added extern declaration for this variable. * buffer.c (last_known_column_point): Removed extern declaration for this variable, included indent.h. (Vprin1_to_string_buffer): Removed extern declaration - it's already in lisp.h. * lisp.h (catchlist, backtrace_list, stack_bottom) (current_global_map): Added extern declarations for these variables. * alloc.c: Removed external declarations for catchlist, backtrace_list, and stack_bottom, since this file includes lisp.h. * callint.c (current_global_map): Removed extern declaration. * search.h: New file - declares searchbuf. * dired.c (Fdirectory_files): Removed extern declaration of searchbuf, included search.h. * Globally renamed `CHAR_AT_POSITION' to `FETCH_CHAR'. 1990-10-22 Richard Stallman (rms@mole.ai.mit.edu) * keyboard.c (quit_char): New variable. (init_keyboard): Initialize it. (Fset_input_mode): New optional arg to set quit_char. (command_loop_1, read_char, kbd_buffer_store_char): (read_avail_input): Use quit_char, not C-g. * sysdep.c (init_sys_modes): Use quit_char to set special chars. * xterm.c (x_term_init): Pass new arg to Fset_input_mode. 1990-10-22 Jim Blandy (jimb@pogo.ai.mit.edu) * xdisp.c: Added `extern' declaration for command_loop_level. * term.c (term_init): Internal cleanups. (write_glyphs): Renamed argument `start' to `string'. 1990-10-21 Richard Stallman (rms@mole.ai.mit.edu) * xterm.c (FIONREAD): Undefine if BROKEN_FIONREAD. (SIGIO): Undefine if no FIONREAD. (ioctl.h, termio.h, strings.h, string.h): Include them before those. * alloc.c (make_vector_from_string, Fvector_from_string): Functions deleted. * sysdep.c (select): Handle timeout == 0. Add var local_timeout. * alloc.c (make_uninit_string, make_float): Use VALIDATE_LISP_STORAGE. (Fcons, Fmake_vector, Fmake_symbol, Fmake_marker): Likewise. (Fmake_vector_from_list): Likewise. (VALIDATE_LISP_STORAGE): New macro. 1990-10-20 Richard Stallman (rms@mole.ai.mit.edu) * dispnew.c (scrolling): Give up if some new lines not enabled. (update_screen): Rework outq logic. * xdisp.c (message, message1): Clear noninteractive_need_newline. 1990-10-19 Jim Blandy (jimb@pogo.ai.mit.edu) * scroll.c (do_scrolling): Allocate queue using alloca instead of variable-sized arrays. 1990-10-19 Richard Stallman (rms@mole.ai.mit.edu) * buffer.c: Doc fix. 1990-10-18 Jim Blandy (jimb@pogo.ai.mit.edu) * print.c (internal_with_output_to_temp_buffer): Install an unwind_protect to make sure the current buffer is restored. * minibuf.c (read_minibuf): Call recursive_edit_1 instead of Frecursive_edit, to support the new command_loop_level arrangement. * malloc.c (calloc): Added this function, in case something linked with emacs calls it. * lread.c (openp): Since access returns 0 on success, change that into a 1 before returning it. * lisp.h: Deleted DEFSIMPLE and DEFPRED, since they're no longer used. 1990-10-18 Richard Stallman (rms@mole.ai.mit.edu) * m-intel386.h (alloca): Define as builtin, if using GCC. * m-att3b.h (NEED_PTEM_H): Define this for 3b2. * s-aix3-1.h (SYSV_SYSTEM_DIR): Define it. * print.c (print): Improve error message for bad data type. 1990-10-18 Jim Blandy (jimb@pogo.ai.mit.edu) * keymap.c (Flookup_key): Rearranged to use an index into the key sequence instead of a pointer and a level counter. 1990-10-18 Richard Stallman (rms@mole.ai.mit.edu) * floatfns.c (sinh, cosh): On VMS, define to use exp. (IN_FLOAT): Detect errors reported using errno. (float_error): Define function unconditionally. Reestablish handler when called, if not BSD. 1990-10-17 Richard Stallman (rms@mole.ai.mit.edu) * m-delta.h (C_DEBUG_SWITCH): Don't define this. 1990-10-17 Jim Blandy (jimb@pogo.ai.mit.edu) * keyboard.c (command_loop): Made call to command_loop_2 conditional on minibuf_level too (it used to be only conditional on command_loop_level), since this is what 18.56 and all the other functions in Emacs 19 keyboard.c do. 1990-10-16 Jim Blandy (jimb@pogo.ai.mit.edu) * keyboard.c (read_char): Don't echo dash if there is already something else being displayed in the echo area. 1990-10-16 Richard Stallman (rms@mole.ai.mit.edu) * process.c (status_convert): If killed by signal, use WTERMSIG. * data.c (arith_error): Reestablish handler on VMS. * keyboard.c (start_polling, stop_polling): New functions. (input_poll_signal): New function, handles periodic alarms. (read_command_char): Turn off polling temporarily. * xdisp.c (redisplay): Likewise. * process.c (wait_reading_process_input, create_process): Likewise. 1990-10-16 Jim Blandy (jimb@pogo.ai.mit.edu) * indent.c (position_indentation): Instead of using CharAt, use a pointer to scan the buffer - this is faster. * emacs.c (Fdump_emacs): The conditional expression which passes symname to unexec was missing a `: 0'. * dispnew.c (rotate_vector): Was rotating backwards. 1990-10-15 Jim Blandy (jimb@pogo.ai.mit.edu) * dired.c (file_name_completion): Use scmp to compare names. 1990-10-15 Richard Stallman (rms@mole.ai.mit.edu) * process.c (create_process): Don't turn off handling of SIGCHLD. Just set a flag if a signal comes in when not wanted. (create_process_sigchld): New signal handler. 1990-10-14 Richard Stallman (rms@mole.ai.mit.edu) * bytecode.c: De-implement Bmark, Bset_mark, Bscan_buffer. Mark Bsymbol_function, Bfset, Bread_char as obsolete. Implement codes Bmult, Bforward_char...Bwiden, and Bstringeqlsign...Bintegerp. 1990-10-12 Jim Blandy (jimb@pogo.ai.mit.edu) * buffer.c (list_buffers_1): Select the buffer given in Vstandard_output using Fset_buffer instead of set_buffer_internal. * buffer.c (set_buffer_internal): Deleted variable swb - it's never used. * buffer.c (count_modified_buffers): Function deleted - it's not used anymore. 1990-10-11 Jim Blandy (jimb@pogo.ai.mit.edu) * buffer.c (reset_buffer_local_variables, buffer_local_variables): added support for default values for buffer local variables which do not have a DEFVAR_PER_BUFFER, as described in the comments above buffer_local_flags. * buffer.c (Fget_buffer_create): Move initialization of b->save_length and b->last_window_start to reset_buffer. 1990-10-11 Richard Stallman (rms@mole.ai.mit.edu) * m-ibmps2-aix.h (LOAD_AVE_TYPE, LOAD_AVE_CVT): Define them. (C_DEBUG_SWITCH): Delete -fstrength-reduce. * unexmips.c (unexec): Add conditional for MIPS2. 1990-10-10 Richard Stallman (rms@mole.ai.mit.edu) * m-iris4d.h (LIBS_MACHINE): Use -lsun, don't use -lPW. * unexelf.c: New file. * s-usg5-4.h: New file. * unexec.c [USG_SHARED_LIBARARIES]: Numerous changes under this cond. (copy_text_and_data): New second argument. 1990-10-10 Jim Blandy (jimb@pogo.ai.mit.edu) * alloc.c (gc_sweep): Only unchain markers that are in a buffer. 1990-10-10 Mike Rowan (mtr@apple-gunkies) * process.c: Merged in more changes from 18.56: update_status, FD_SET changes (define all the FD_ macros). Other small changes. 1990-10-09 Jim Blandy (jimb@churchy.ai.mit.edu) * xdist.c (decode_mode_spec): Reworked code to handle %* - it now goes like `if return else if return else ... return' instead of using a conditional operator. * xdist.c (fmodetrunc): Function deleted - no longer used. 1990-10-09 Richard Stallman (rms@mole.ai.mit.edu) * xdisp.c (decode_mode_spec): Handle dashes in wide windows. 1990-10-08 Richard Stallman (rms@mole.ai.mit.edu) * sysdep.c (sys_open, sys_close, sys_read, sys_write): Don't handle EAGAIN. * process.c (wait_reading_process_input): Handle nread==-1 for O_NDELAY like O_NONBLOCK. * s-vms.h (LINK_CTRL_SHARE): Turn on again. tranle@intellicorp.com found it needed in VMS 5.3. * emacs.c (main): Move VMS declaration of environ outside function. * vmsfns.c (Fdefault_subproc_input_handler): InsCstr -> insert. 1990-10-07 Richard Stallman (rms@mole.ai.mit.edu) * m-pmax.h (START_FILES): Handle crt0.o in different dir in Ultrix 4.0. * s-sunos4.h (O_NDELAY): Define only if not defined. 1990-10-06 Jim Blandy (jimb@pogo.ai.mit.edu) * sysdep.c (tabs_safe_p, get_screen_size): Renamed `sg' to `tty'. * sysdep.c (init_baud_rate): Rearranged code for calculating baud_rate. 1990-10-05 Jim Blandy (jimb@pogo.ai.mit.edu) * search.c (Freplace_match): Used Finsert_buffer_substring instead of place and deleted place. * search.c (place): Function removed. * process.c (count_active_processes): Deleted; not used. * minibuf.c (read_minibuf): Renamed `prefix' argument to `initial'. 1990-10-01 Jim Blandy (jimb@pogo.ai.mit.edu) * lread.c (Fload): Renamed `MISSING-OK' to `NOERROR'. * keyboard.c (describe_map): Renamed `keys' to `string'. * keyboard.c `Vauto_save_interval' unrenamed back to `auto-save-interval'. * keymap.c (Fdefine_key, Flookup_key): Renamed arguments called `keys' to `key'. 1990-10-01 Richard Stallman (rms@mole.ai.mit.edu) * sysdep.c (sys_open, sys_close, sys_read, sys_write): Handle EAGAIN like EINTR. 1990-09-30 Richard Stallman (rms@mole.ai.mit.edu) * insdel.c (gap_left, gap_right): Use bcopy if requested. New config parameters GAP_USE_BCOPY, BCOPY_SAFE_UPWARD, and BCOPY_SAFE_DOWNWARD. * eval.c (find_handler_clause): Bind debug-on-error to nil. (Qdebug_on_error): New variable. (syms_of_eval): Initialize that. * sysdep.c: Include various headers for ptys, for hpux, aix, and sysv. * dispnew.c (preserve_other_columns): Fix args to second bcopy. 1990-09-30 Jim Blandy (jimb@pogo.ai.mit.edu) * keyboard.c: `auto_save_interval' renamed to `Vauto_save_interval', since it *is* a lisp-accessible variable. * fileio.c (Fdo_auto_save): Call record_auto_save so that read_char knows when we've auto-saved. * keyboard.c (record_auto_save): Added function to support the new auto-save conditions. * keyboard.c (read_char): Use num_input_chars and last_auto_save instead of keystrokes to decide when to autosave. * keyboard.c (keystrokes): Variable deleted. 1990-09-30 Mike Rowan (mtr@spike.ai.mit.edu) * keyboard.c, alloc.c: Added malloc warning code from 18.56. * dispnew.c, xdisp.c: (un)hold_window_change no longer exists; added do_pending_window_change from 18.56. * process.c, process.h: Add the raw_status_low and raw_status_high code from 18.56. 1990-09-29 Richard Stallman (rms@mole.ai.mit.edu) * alloca.s: Handle ns32000 like ns16000. * m-ns32000.h: New file. * lread.c (Fload): Warn if elc file older than source file. * ymakefile (LIB_X11_LIB): New parameter, default -lX11. (LIBX): Use that. * Makefile (xmakefile): Delete junk.c at the beginning. * hftctl.c: Include termios.h before termio.h. Define TCGETS and TCSETS if nec. Give some forward declarations for the static functions. Reformat in usual GNU style. * m-orion105.h (LOAD_AVE_TYPE, FSCALE): Changed from double and 1.0. * m-delta.h: New file. 1990-09-28 Richard Stallman (rms@mole.ai.mit.edu) * fns.c (Frequire): Undo certain things on failure, like autoload. 1990-09-28 Jim Blandy (jimb@pogo.ai.mit.edu) * fileio.c (Fwrite_region): Renamed variable `fd' to `desc' and changed argument to open from `1' to `O_WRONLY'. * fileio.c (O_WRONLY): Added clause to define this if not already defined. * emacs.c (Fdump_emacs): Removed a_name variable. * emacs.c (Fkill_emacs): Removed code which asked about modified buffers and running subprocesses. * editfns.c (Fcurrent_time_string): Renamed variable `now' to `current_time'. * dispnew.c (update_line): Renamed variables `m1' and `m2' to `begmatch' and `endmatch'. * dispnew.c (update_screen): Use preempt_count as a limit instead of a counter; count with i instead. * dispnew.c (visible_bell, inverse_video, baud_rate) (Vwindow_system): Rearranged comments. 1990-09-27 Richard Stallman (rms@mole.ai.mit.edu) * emacs.c (main) : Set the DISPLAY environment value when both of MAINTAIN_ENVIRONMENT and HAVE_X_WINDOW are defined. * m-convex.h (LIB_STANDARD, LIBS_MACHINE): Remove these, they cause an unnecessary C1/C2 dependency. * m-convex.h (LD_SWITCH_MACHINE): Use -e__start to specify where crt0.c begins. * m-convex.h (HAVE_SETSID): Define; must call setsid when creating an inferior with a different controlling tty. * process.c (create_process): Rearrange so that HAVE_SETSID will be seen when not under USG. * m-convex.h (S_IFMT etc): Define in case of posix compilation. * m-convex.h (FIRST_PTY_LETTER): Do it at runtime. * unexconvex.c (first_pty_letter): Routine to locate lowest pty. * unexconvex.c: Rewrite so it can cope with thread-local sections. * sysdep.c (select): Use process_tick and update_tick, not child_changed. 1990-09-23 Richard Stallman (rms@mole.ai.mit.edu) * keyboard.c (Fsuspend_emacs): Check screen size after resume. 1990-09-19 Richard Stallman (rms@mole.ai.mit.edu) * editfns.c: Doc fix. 1990-09-18 Richard Stallman (rms@mole.ai.mit.edu) * window.c (Fsplit_window): Minor cleanup. 1990-09-17 Richard Stallman (rms@mole.ai.mit.edu) * emacs.c (main) [USG_SHARED_LIBRARIES]: Call brk. 1990-09-13 Richard Stallman (rms@mole.ai.mit.edu) * floatfns.c (float_error_arg): New variable. (IN_FLOAT): New arg; sets float_error_arg. All uses changed. (float_error): Use that value when signaling error. 1990-09-11 Richard Stallman (rms@mole.ai.mit.edu) * unexaix.c, m-ibmr2.h, s-aix3-1.h: New files. * ymakefile (allocaobj): New variable. Used in otherobjs. Eliminates assignment of mallocobj using itself. (mallocobj): Handle SYSTEM_MALLOC without HAVE_ALLOCA. (xemacs): Use -nl option if HAVE_SHM. * sysdep.c: Change IBMRTAIX conditionals to AIX. Move hft.h to the top. [IBMR2AIX]: Use termios.h and change macros accordingly. (child_setup_tty): Change IBMRTAIX to AIX. (setpgrp_of_tty): Handle IBMR2AIX. (init_sys_modes): Handle IBMR2AIX. Output special things for AIX. (reset_sys_modes): Output special things for AIX. (hft_init, hft_reset): Conditionals for IBMR2AIX. * process.c: Change IBMRTAIX to AIX controlling time.h. [AIX]: Include sys/pty.h and unistd.h. (wait_reading_process_input): If AIX, handle EBADF differently. (create_process): Handle HAVE_SETSID. Change conditional to AIX. * lisp.h (XPNTR): New definition if HAVE_SHM. (NULL): Undef before defining. * emacs.c (main): If HAVE_SHM, call map_in_data. Use AIX, not IBMRTAIX, for signal conditional. (Fdump_emacs_data): New function if HAVE_SHM. (Fdump_emacs): Don't define if HAVE_SHM. * alloc.c (pure, PUREBEG): If HAVE_SHM, define place for a segment. 1990-09-03 Mike Rowan (mtr@apple-gunkies) * sysdep.c: Added setup_pty from 18.56 * process.c: Merged in 18.55->6 changes. Same for process.h globally replaced: redisplay_preserving_echo_area -> redisplay_preserve_echo_area SetBfp -> set_buffer_internal buffer_flush_undo -> buffer_disable_undo redo_mode_line -> update_mode_line (window.h) 1990-08-31 Richard Stallman (rms@mole.ai.mit.edu) * data.c (Fmake_local_variable): If var is local when set, make it local now in this buffer. * data.c (Fstring_to_int): Finish eliminating second arg. * data.c (Faset): Require integer as third arg for string. 1990-08-28 Richard Stallman (rms@mole.ai.mit.edu) * search.c: Doc fix. * screen.h (SCREEN_SCROLL_BOTTOM_VPOS): New macro. * xdisp.c (screen_bottom_vpos): Variable used if just one screen. (redisplay, try_window_id): Set that field in screen. * dispnew.c (scrolling, update_screen): New arg scroll_bottom_vpos. * dispnew.c (scroll_screen_lines): Mark newly empty lines as empty. (scrolling): Give up if any line in current_screen not enabled. 1990-08-27 Roland McGrath (roland@churchy.ai.mit.edu) * dired.c (Ffile_attributes): Return the device number too (elt 11 of the returned list). 1990-08-27 Richard Stallman (rms@mole.ai.mit.edu) * sysdep.c (wait_for_kbd_input): Frob waiting_for_input here. * keyboard.c (kbd_buffer_read_command_char): Not here. * sysdep.c (wait_for_kbd_input): Clear process_ef before snarfing process input. * fileio.c (Fdirectory_file_name): On VMS, leave space for log name. * sysdep.c (init_sys_modes): Clear process_ef only the first time. * vmsfns.c (process_exit): Logic of deletion was wrong. (Fspawn_subprocess): Correctly reuse existing struct process_list. 1990-08-22 Richard Stallman (rms@mole.ai.mit.edu) * m-plexus.h (LD_SWITCH_MACHINE): New macro. 1990-08-22 Joseph Arceneaux (jla@geech) * xterm.c (XTread_socket): Cleaned up #ifdefs prior to event reading loop. Also handle FIOSNBIO. 1990-08-19 Joseph Arceneaux (jla@geech) * xterm.c (dumplyphs): Last vestige of MScreenWidth removed. * config.h: MScreenWidth, MScreenHeight definitions removed. 1990-08-18 Joseph Arceneaux (jla@geech) * scroll.c (do_scrolling): Pass the correct sizes to bcopy. * dispnew.c (make_screen_glyphs): Likewise. 1990-08-16 Joseph Arceneaux (jla@churchy.ai.mit.edu) * dispnew.c (scroll_screen_lines, free_screen_glyphs): Only deal with the X components of screen_glyphs if SCREEN_IS_X. free_screen_glyphs now takes screen argument. * window.c (Fnext_window, Fprevious_window): Fixed typo. New behaviour: mini non-nil implies all_screens if global mini screen exists, implies current screen only if not. (Fdisplay_buffer): Simplification of multi-screen code. 1990-08-15 Richard Stallman (rms@mole.ai.mit.edu) * buffer.c: Doc fix. 1990-08-15 Joseph Arceneaux (jla@churchy.ai.mit.edu) * dispnew.c (update_line): Simplification of pixel size code, only done if screen is X. (update_screen): Only set pixel stuff if screen is X. 1990-08-14 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-targon31.h (NO_REMAP): Definition removed. (SEGMENT_MASK): New macro. 1990-08-14 Joseph Arceneaux (jla@churchy.ai.mit.edu) * lread.c (eval-region): Don't set opoint to point, etc. Fnarrow_to_region from BEGV, not b. (eval-buffer): New subr, generalization of eval-current-buffer. (eval-current-buffer): Moved to elisp, in simple.el. * xfns.c (x_y_pos): Nuked. Replaced by pixel_to_char_translation and notice_mouse_movment (dispnew.c, xterm.c). (Fx_point_coordinates): Also nuked. (mouse_buffer_offset): New lisp variable. * xterm.c (notice_mouse_movement): Use it in call to pixel_to_char_translation. * screen.h: For non-multiscreen, XSCREEN returns selected_screen, as does WINDOW_SCREEN. * xdisp.c (display_mode_line): Set desired_glyphs->bufp to 0 for mode line. All occurences of struct screen * replaced with SCREEN_PTR. 1990-08-13 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xmenu.c (list_of_items, list_of_panes): Fixed wrong params to wrong_type_argument. 1990-08-12 Joseph Arceneaux (jla@churchy.ai.mit.edu) * dispnew.c (pixel_to_char_translation): New algorithm for finding y. * xfns.c (install_*_scrollbar): No more height, width parameters. Don't block input here. (x_set_*_scrollbar): Block input here. * xterm.c (notice_mouse_motion): Check if the mouse is still in the window. (encode_mouse_button): Don't bother about motion types. 1990-08-11 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-convex.h (C_SWITCH_MACHINE, LIB_STANDARD, LIBS_MACHINE): (LD_SWITCH_MACHINE): Add definitions for Convex V 4.0. 1990-08-11 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_grab_pointer): Call XCreateFontCursor on shape, setting new variable grabbed_cursor. Return Qt if successful, Qnil otherwise. (Fx_ungrab_pointer): Free grabbed_cursor if non zero. Return Qnil. 1990-08-10 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (x_figure_window_size): Don't set pixel sizes until height and width are determined. 1990-08-08 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_grab_pointer): New parameter to explicitly ignore keyboard events. * xterm.c (notice_mouse_movement): Use pixel_to_char_translation to get char position and buffer offset. 1990-08-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c [NEED_PTEM_H]: New flag macro says include ptem.h. 1990-08-07 Joseph Arceneaux (jla@churchy.ai.mit.edu) * dispextern.h: Element bufp of screen_glyphs no longer dependent on X windows. * xdisp.c (display_text_line): Likewise. * xfns.c (Fx_grab_pointer, Fx_ungrab_pointer): New subrs. (x_figure_window_size): Set pixel_width and pixel_height of screen, using font height and width. * xfns.c: Vmouse_grabbed renamed Vmouse_depressed. * xterm.c: Likewise. (construct_mouse_event): Don't check mouse coordinates; this is done by the notice_mouse_motion. Don't grab the mouse here. * dispnew.c (update_line): Set the pix_width and pix_height of the line. This fashion of doing so is temporary. 1990-08-06 Joseph Arceneaux (jla@churchy.ai.mit.edu) * dispextern.h: screen_glyphs struct elements bottom_right_x, bottom_right_y changed to pix_width and pix_height. * scroll.c: Likewise. * dispnew.c: Likewise. (update_screen): Set top_left_x, top_left_y for X windows. * xterm.h: Macros PIXEL_{WIDTH,HEIGHT} now use the display structure elements. 1990-08-05 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (x_window_to_scrollbar): Return Lisp symbol in parameter PART_PTR, rather than string. Declare these symbols. New variable Vscreen_part, indicates which part of the screen the mouse is in. * xterm.c (notice_mouse_motion): Do XQueryPointer first thing. Set Vmouse_event to Qnil. (construct_mouse_event): Don't check if mouse has moved or not. When returning cons, part is now already lisp symbol. (XTread_socket): Set Vmouse_window = Vscreen_part = Qnil when leaving screen, as well as setting x_mouse_x = x_mouse_y = -1. * keyboard.c: Vmouse_window, Vmouse_event declared extern and no longer DEFVARed: they are already delclared in window.c. * screen.c (window_from_coordinates): Use Fnext_window, even if MULTI_SCREEN, to obtain the next window. This is an test. Also, new paramater part returns text or modeline symbol. (Flocate_window_from_coordinates): Pass &part to window_from_coordinates. (coordinates_in_window): Don't say modeline if window_height is 1, as this is likely to be the minibuffer. 1990-08-04 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.c (Fcoordinates_in_window_p): Doc fix. Simplified. (window_from_coordinates): New function. (Flocate_window_from_coordinates): Use it. * keyboard.c (classify_object): New function for dealing with the input object. New symbol, mouse-motion, called here. Call to mouse-motion-handler now takes no parameters. (read_key_sequence): Use the new function. Don't set keybuf[0] to 0. * xterm.c (init_input_symbols): Create all the Lisp symbols returned in the input stream. (func_key_syms): New array to hold all symbols for function keys. (x_func_key_to_sym): Use this array. (notice_mouse_movement): New function for dealing with motion events. (XTread_socket): Use it here. 1990-08-02 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * callproc.c (child_setup): Report error in chdir. 1990-08-01 Joseph Arceneaux (jla@churchy.ai.mit.edu) * lisp.h: New macro XFLOATINT. extract_float declared. * floatfns.c (Ffloor): Call floor, not ceil. (extract_float): No longer static. * bytecode.c (Fbyte_code): Correctly handle floats in case Beqlsign. 1990-07-31 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keyboard.c (read_key_sequence): When downcasing letters, don't change the value returned in keybuf. (This is an experiment; it might be unpleasant in things such as C-h c, but it is an improvement for M-x global-set-key.) 1990-07-30 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * eval.c: Doc fix. 1990-07-28 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * s-iris*.h (SYSTEM_TYPE): Change silicon-graphics-unix to irix. 1990-07-26 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * indent.c (Fmove_to_column): End-test was off by 1. * abbrev.c (Fexpand_abbrev): Return nil if alloca arg would be neg. 1990-07-26 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xdisp.c (display_text_line): String to rope copy for inserting arrow text. 1990-07-25 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xdisp.c (display_mode_line): Check that the name has actually changed before calling x_set_name. * ralloc.c (check_memory_limits): New function. Also check if new memory will be larger than elisp pointer. (r_alloc_sbrk): Call this function. (relocate_blocs_upward, relocate_blocs_downward): Eliminated. (r_alloc_sbrk): Use relocate_some_blocs instead of the eliminated functions. * vm-limit.c (morecore_with_warning): Check if new memory larger than elisp pointer size. 1990-07-24 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keyboard.c (save_getcjmp, restore_getcjmp): New functions. (read_char): Use them around Fdo_auto_save. * process.c (read_process_output, exec_sentinel): Use them. * fileio.c (Fdo_auto_save): Run auto-save-hook. 1990-07-24 Joseph Arceneaux (jla@churchy.ai.mit.edu) * dispnew.c (safe_bcopy): No longer static. * ralloc.c (relocate_blocs_upward, relocate_blocs_downward): Use safe_bcopy. * mem_limits.c: typedef SIZE. 1990-07-19 Joseph Arceneaux (jla@churchy.ai.mit.edu) * fileio.c (Finsert_file_contents): Initialize how_much when exiting main loop. * m/m-mips.h: Added stuff from the 18.56 version. 1990-07-18 Joseph Arceneaux (jla@churchy.ai.mit.edu) * indent.c (Fmove_to_column): Set end to ZV. 1990-07-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * editfns.c (init_editfns): Let envvar NAME override full name. * buffer.c (list_buffers_1): Avoid error with list-buffers-directory. 1990-07-17 Joseph Arceneaux (jla@churchy.ai.mit.edu) * buffer.c (list_buffers_1): Don't check list-buffers-directory. 1990-07-16 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xdisp.c (display_text_line): Don't print ellipsis if they're off the left edge. 1990-07-10 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * s-386-ix.h: Define BROKEN_TIOCGETC. 1990-07-09 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-pmax.h: Undef LD_SWITCH_MACHINE, change DATA_START and DATA_SEG_BITS. 1990-07-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * s-iris3-6.h (HAVE_GETWD): Define this. (KERNEL_FILE): Change to /unix. (sigsetmask, sigblock, NEED_ERRNO, C_SWITCH_MACHINE): Turn off. (SIGIO): Don't undefine it. (LIBS_MACHINE): Remove -lbsd. * minibuf.c (Fall_completions, do_completion): Treat nil as alist. (Ftry_completion): Likewise. 1990-07-01 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c: Undefine TIOCGETC if BROKEN_TIOCGETC defined. * s-usg5-3.h, s-xenix.h: Define BROKEN_TIOCGETC. 1990-06-26 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (Fopen_network_connection): Minor cleanup. 1990-06-20 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-sun3.h: Add comments for dealing with 68881. 1990-06-19 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-ibmps2-aix.h [__GNUC__]: Define LIB_STANDARD and C_DEBUG_SWITCH, and don't define LIBS_MACHINE. (HAVE_WAIT_HEADER): Define this. Also reordered definitions so recently added ones are together. 1990-06-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * insdel.c (insert): Error if buffer would get too long. * fileio.c (Finsert_file_contents): Likewise. 1990-06-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * syntax.c (scan_sexps_forward): Allow Squote inside symbols. 1990-06-16 Joseph Arceneaux (jla@geech) * window.c (Fscroll_other_window): Don't unbind_to. Keep track of current_buffer and point explicitly. 1990-06-15 Joseph Arceneaux (jla@churchy.ai.mit.edu) * term.c (cursor_to): Only add chars_wasted if not calling hook. (clear_end_of_line_raw): Likewise. (clear_end_of_line): Check that screen is termcap before using chars_wasted. (ins_del_lines): Eliminated local copybuf[]. (calculate_ins_del_char_costs): Now has screen parameter. DCICcost: Change to char_ins_del_costs and defined with SCREEN_WIDTH (screen). DC_ICcost: Changed to char_ins_del_vector. * term.h: DCICcost no longer defined here. DC_ICcost no longer declared here. * dispnew.c: char_ins_del_cost defined here. char_ins_del_vector declared extern here. 1990-06-14 Joseph Arceneaux (jla@churchy.ai.mit.edu) Globally replaced screen_width with macro SCREEN_WIDTH (selected_screen). * dispnew.c (init_display): Don't set SCREEN_WIDTH, etc. from screen_width. (change_window_size): No longer check output_type and set ScreenRows. 1990-06-11 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * indent.c (Findent_to): Don't fail to return value. (Fmove_to_column, Fcurrent_column): Doc fixes. 1990-06-06 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (echo_prompt): Now uses glyphs. echobuf, echobuf_ptr: These variables now glyphs. 1990-06-05 Joseph Arceneaux (jla@churchy.ai.mit.edu) * fileio.c (Fdo_auto_save): Use glyphs_to_str_copy to set omessage. * alloc.c (Fgarbage_collect): Ditto. * xdisp.c (message): message_buf set here, realloced if smaller than screen width. message_buf now type GLYF *. New variable message_buf_size holds its size. Use temp_buf for call to doprnt, then use str_to_glyph_cpy to set echo_area_glyphs. * print.c (printchar, strout): Use message_buf_size. Convert to glyfs before assigning chars. (str_to_glyph_cpy, str_to_glyph_ncpy) (glyph_to_str_cpy, glyph_to_str_ncpy): New functions. 1990-06-03 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (command_loop_1): Clear this_command_key_count here. (Fread_key_sequence): And here. (read_key_sequence): Not here. * dispnew.c (update_screen): Add missing else in handling cursor_in_echo_area. * xdisp.c (redisplay_window): Eliminate lpoint. Alter opoint if point should be changed permanently in the selected window. * window.c (unshow_buffer): Don't set pt in selected window's buffer. * xdisp.c (decode_mode_spec): Don't truncate buffer or file name. * editfns.c (Finsert_buffer_substring): Don't fail to set beg, end. * keyboard.c (command_loop_level): New variable. Used in place of RecurseDepth, but different meaning. (recursive_edit_1): New function. (Frecursive_edit): Call it. * minibuf.c (read_minibuf): Call recursive_edit_1. * xdisp.c (RecurseDepth): Variable deleted. display_minibuffer_message renamed echo_area_display. * print.c: Include dispextern.h. (printchar, strout): Use message_buf. * scroll.c (CalcIDCosts): Dynamically allocate ILcost, etc. (ILcost, DLcost, ILncost, DLncost): Now pointers. (do_scrolling): Use alloca for queue. * term.c (term_init): selected_screen as arg to calculate_costs. (calculate_costs): Dynamically allocate chars_wasted, copybuf, DC_ICcost. Set RPov based on actual width. (chars_wasted, copybuf, DC_ICcost): Now pointers. * xterm.c (x_term_init): Don't set dont_calculate_costs anymore. 1990-06-02 Joseph Arceneaux (jla@churchy.ai.mit.edu) * term.c (calculate_ins_del_char_costs, string_cost_one_line): Made static. * dispnew.c: Declare scrolling_1; * scroll.c (CalcIDCosts, CalcIDCosts1, CalcLID): Renamed calculate_ins_del_char_costs, ins_del_costs, and line_ins_del. CalcIDCosts1 and CalcLID also renamed. (calculate_scrolling): Now void. * Global renaming: bf_modified -> MODIFF. CharAt -> CHAR_AT_POSITION. BufferSafe{Floor,Ceiling} -> BUFFER_{FLOOR,CEILING}_OF. SetPoint -> SET_PT. * xterm.c (x_term_init): Don't CalcIDCosts here anymore. 1990-06-01 Joseph Arceneaux (jla@churchy.ai.mit.edu) * print.c: Include dispextern.h. (printchar, strout): Use message_buf. * sysdep.c (get_screen_size): Don't use MscreenWidth, MscreenLenght. * term.c: Likewise. * scroll.c (CalcIDCosts, CalcIDCosts1, CalcLID): These now take a screen argument. (CalcIDCosts): Dynamically allocate ILcost, etc. (ILcost, DLcost, ILncost, DLncost): Now pointers. (do_scrolling): Use alloca for queue. * dispnew.c (remake_screen_structures): Allocate message_buf. Don't use MscreenWidth, MscreenLenght. * xdisp.c: bf_cur replaced with current_buffer. Calls to SetBfx deleted. message_buf is now char *. (message): Use SCREEN_WIDTH macro as limit for doprnt. * indent.c (current_column): Detect special case when point == BEGV. * buffer.h (struct buffer_text): Component modified renamed to modiff. All refs changed to macros below. (MODIFF, BUF_MODIFF): New macros. Macro SetBfx removed. Macro SetPoint renamed SET_PT. * fileio.c (Fexpand_file_name): Simplified. 1990-06-01 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dired.c: Doc fix. 1990-05-31 Joseph Arceneaux (jla@churchy.ai.mit.edu) * search.c (Fsearch_forward): Docstring fix. 1990-05-31 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dired.c: Comment added. 1990-05-31 Joseph Arceneaux (jla@churchy.ai.mit.edu) * process.c (Fprocess_connection): Return the type of a process object. (syms_of_process): Initialize pty_process and stream_process. Declare Fprocess_type. * process.h New element type to struct Lisp_Process. * syntax.c (scan_sexps_forward): Initialize curlevel->last to -1. 1990-05-28 Joseph Arceneaux (jla@churchy.ai.mit.edu) * fileio.c (Finsert_file_contents): Use new variable how_much to hold read result. 1990-05-24 Joseph Arceneaux (jla@churchy.ai.mit.edu) * lread.c (read_char_exclusive): New subr. 1990-05-24 David Lawrence (tale@pogo.ai.mit.edu) * fileio.c (file_executable_p): New function. 1990-05-23 Joseph Arceneaux (jla@churchy.ai.mit.edu) * insdel.c (make_gap): Only set BEG_ADDR if BUFFER_REALLOC was successful. * editfns.c (syms_of_editfns): DEFVAR the new variables. * eval.c (Finteractive_p): Don't skip the first frame if the function was compiled. * print.c (print): Use ... only for conses, and instead of normal print. 1990-05-22 Joseph Arceneaux (jla@churchy.ai.mit.edu) * Renamed meta_flag meta_key. * termopts.h: Comment changes. 1990-05-20 Joseph Arceneaux (jla@churchy.ai.mit.edu) * buffer.h: upcase_table and downcase_table are now Lisp_Objects. * alloc.c (mark_object, gc_sweep): Related changes. * casetab.c: Ditto. 1990-05-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * minibuf.c (Fall_completions): Protect STRING from gc. Copy ALIST to TAIL to protect it. * paths.h-dist: Doc fix. 1990-05-17 Joseph Arceneaux (jla@churchy.ai.mit.edu) * search.c (Flooking_at, search_buffer): Use new accessors. * indent.c (Fcurrent_column): Likewise. * minibuf.c (read_minibuf): Likewise. * regex.c (re_match_2): Use PTR_CHAR_POS. * editfns.c (Fbuffer_size, Fnarrow_to_region, Fbuffer_substring): (Fbuffer_string, Finsert_buffer_substring): Likewise. (save_restriction_restore): Likewise. * dispnew.c (direct_output_for_insert): Likewise. * fileio.c (Fwrite_region, Finsert_file_contents): Likewise. (Fdo_auto_save): Likewise. * insdel.c (move_gap, gap_left, gap_right, make_gap): Likewise. (InsCStr, del_range, modify_region): Likewise. * process.c (Fprocess_send_region): Likewise. * xdisp.c (try_window, try_window_id, display_text_line): Likewise. (redisplay): Likewise. * buffer.c (list_buffers_1): Likewise. * marker.c (marker_position, Fset_marker, set_marker_restricted): (Fmarker_position): Likewise. * window.c (unshow_buffer, Fset_window_configuration): Likewise. (Fset_window_buffer): Likewise. * editfns.c (save_restriction_restore): Use a macro to alter point. * lread.c (readchar): Use new accessors, and avoid knowing about the text field of a buffer. * window.c (Fpos_visible_in_window_p): Likewise. * buffer.h (struct buffer): Make the syntax table a Lisp object. * alloc.c (mark_buffer): No need to treat it specially. * syntax.c (Fsyntax_table, Fset_syntax_table, Fdescribe_syntax): (Fmodify_syntax_entry): Adjust for this change. * buffer.c (reset_buffer_local_variables): Need not be special. (init_buffer_once): Make this slot a defaulted local variable. * syntax.h: Adjust macros for this change. (Vstandard_syntax_table): Define as macro, in buffer_defaults. * syntax.c (syms_of_syntax): Don't staticpro it here. (Fset_syntax_table): Set the flag in local_var_flags. * buffer.h (struct text): Represent the buffer dimensions with new slots, memory, begv, pt, gpt, zv, z and gap_size. (BEGV, etc.): Use new slots. (CharAt): Likewise. (BufferSafeCeiling, BufferSafeFloor): Use new slots; fix old bugs. (bf_p1, bf_s1, etc.): Old macros deleted. * buffer.c (Fget_buffer_create): Set up memory and new slots. (Fkill_buffer): Likewise. * insdel.c (move_gap, gap_left, gap_right, make_gap): Update new slots. (del_range, InsCStr): Likewise. * fileio.c (Finsert_file_contents): Likewise. * window.c (temp_output_buffer_show): Likewise. * xdisp.c (decode_mode_spec, try_window_id): Likewise. * insdel.c (make_gap): Complete rewrite. Arg is amount of new gap to create. All calls changed. (gap_left): New argument NEWGAP. * buffer.c (Fset_buffer): Check for deleted buffer. (SetBfp): Don't check. (SetBfp, Frename_buffer): Local cleanups. * print.c (PRINTPREPARE): Use Fset_buffer. * buffer.c (SetBfp): Don't bother with selected window or its point. * window.c (Fselect_window): Always set pointm of old window. * editfns.c: Eliminate all use of DEFSIMPLE and DEFPRED. * indent.c, keyboard.c: Ditto. * search.c (skip_chars): Eliminate PointLeft and PointRight. * cmds.c (SelfInsert): Likewise. 1990-05-16 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xdisp.c (try_window): No return value. Fix calls to try_window. * Global variable RedoModes is now redraw_mode_line. 1990-05-13 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keymap.c (Fdefine_key, Flookup_key): Local cleanups. * sysdep.c (sys_suspend): Use save_signal_handlers and restore_signal_handlers to save and restore signal state. * indent.c (Findent_to): Merge guts of indentation into here. (position_indentation): Scan with a pointer, for speed. * casefiddle.c (operate_on_word): Just return the other end. (Fupcase_word, Fdowncase_word, Fcapitalize_word): Pass that value to casify_region. * editfns.c (init_editfns): Store system and user names as strings to avoid arbitrary limits. * keymap.c (describe_vector, describe_alist): Make elt_prefix and elt_describer responsible for indentation and newlines. Local cleanups. (describe_command): Do indentation and newline. (describe_map): Add space to end of prefix. * syntax.c (describe_syntax): Do indentation and newline. 1990-05-12 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (create_process) [not USG]: Put subproc in pgrp 0. 1990-05-10 Joseph Arceneaux (jla@churchy.ai.mit.edu) * dispextern.h: New struct screen_glyfs replaces struct display_line. * screen.c: New screen elements current_glyfs, desired_glyfs, and temp_glyfs. * dispnew.c (make_screen_glyfs, free_screen_glyfs): (remake_screen_glyfs): New functions. (make_display_lines, new_display_line, return_display_line): Functions deleted. (change_screen_size, init_display): Use the new functions. (cancel_line, clear_screen_records, get_display_line): Rewritten for new data structures. get_display_line no longer returns anything. (preserve_other_columns, preserve_my_columns): Likewise. (cancel_my_columns, direct_output*): Likewise. (update_screen, update_line, quit_error_check, scrolling): Likewise. (scroll_screen_lines): Likewise. (rotate_vector, safe_bcopy): New subroutines. (line_hash_code, line_draw_cost): Cleaned up. Args are different, and hash computation too. (update_screen): Rearrange buffer-emptying code. * xdisp.c (display_minibuf_message, redisplay): Rewritten for new structures. (display_text_line, display_mode_line): Likewise. (display_mode_element, display_string): Likewise. (decode_mode_spec): Local cleanups. * scroll.c (do_scrolling): Rewritten for new data structures. * xterm.c (XTflash): Use this new structure. * editfns.c (in_accessible_range): New function. (Fgoto_char, save_restriction_restore): Use it. (save_excursion_save, Fcurrent_time_string): Local cleanups. * process.c (Fprocess_kill_without_query): New arg; new return value. (count_active_processes): Function deleted. * fileio.c (Finsert_file, Fwrite_region): Local cleanups. * fns.c (Fsubstring): Local cleanup. * keyboard.c (echo_prompt, echo_char, echo_dash, echo): New functions. (cancel_echoing): Likewise. (immediate_echo, echoptr): New variables. (command_loop_1, request_echo, get_char, read_key_sequence): (set_waiting_for_input, interrupt_signal): Related changes. (get_char): No more declaration of request_echo. Local cleanups. (this_command_key...): New variables. (Fexecute_extended_command, Fthis_command_keys): Related changes. (init_keyboard, get_char): Likewise. * macros.c (Fstart_kbd_macro): Local cleanup. * minibuf.c (read_minibuf): No more delcaration of Frestore_screen_configuration. * search.c (Fregexp_quote): Simplified. 1990-05-08 Joseph Arceneaux (jla@churchy.ai.mit.edu) * process.c (Fopen_network_stream): Also handle numeric inet addresses. 1990-05-06 Joseph Arceneaux (jla@churchy.ai.mit.edu) * alloca.c: #ifdef __STDC__ rather than X3J11/ 1990-05-03 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c (Fmake_symbolic_link): Delete old file if permitted. 1990-05-02 Joseph Arceneaux (jla@churchy.ai.mit.edu) * data.c (Fstring_to_int): Delete disabled feature of accepting `yes' and `no'. * xdisp.c (redisplay, redisplay_preserving_echo_area): Two functions replace DoDsp. All callers changed. (redisplay, redisplay_window): Eliminate `inhibit_hairy_id'. (redisplay_window): No return value. Local cleanups. * alloc.c (Fmake_marker): Delete `modified' field. * insdel.c (adjust_markers): Likewise. * abbrev.c (Fdefine_mode_abbrev): Clean up error message. 1990-05-01 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_draw_rectangle, Fx_erase_rectangle): Simplified. * xterm.c (x_display_cursor): Don't check s->phys_x when drawing cursor. * undo.c: New version. * undo.h: No longer exists. * alloc.c (Fgarbage_collect): Call truncate_undo_list. (syms_of_alloc): Define vars undo-threshold and undo-high-threshold. * buffer.c (Fget_buffer_create): Set undo_list to t or nil. (Fbuffer_disable_undo, Fbuffer_enable_undo): Likewise. (Fkill_buffer): Likewise. (init_buffer_once): Set up local variable buffer-undo-list. (syms_of_buffer): Likewise. * buffer.h: New element undo_list in struct buffer. * fileio.c (Finsert_file_contents): Store nil in undo_list. * buffer.c: Variable bf_text deleted. (Fkill_buffer, SetBfp): Delete code that worked with it. (SetBfx): Now a macro in buffer.h * editfns.c (Fwiden, Fnarrow_to_region): Related changes. (save_restriction_save, save_restriction_restore): Likewise. (Finsert_buffer_substring): Likewise. * fileio.c (Fdo_auto_save): Likewise. * insdel.c (make_gap): Likewise. * lread.c (readchar): Likewise. * marker.c (Fmarker_position, marker_position): Likewise. (Fset_marker): Likewise. * xdisp.c (DoDsp): Likewise. 1990-04-30 Joseph Arceneaux (jla@churchy.ai.mit.edu) * buffer.h: New macro R_ALLOC_SET_BUFFER for declaring all the text pointers of a buffer to the relocating allocator. * buffer.c (Fbury_buffer, SetBfx, SetBfp): Use the macro. * editfns.c (Finsert_buffer_substring): Ditto. * fileio.c (Fdo_auto_save): Ditto. * insdel.c (make_gap): Ditto. * xfns.c (adjust_scrollbars): Don't set bf_cur->text. 1990-04-26 Joseph Arceneaux (jla@churchy.ai.mit.edu) * minibuf.c: Declare active_screen struct screen *, not Lisp_Screen *. 1990-04-19 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (XTupdate_end): Only x_display_cursor if s is x_input_screen. 1990-04-19 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fns.c (Fy_or_n_p): If a C-g comes in and does not quit, quit by hand. * buffer.c (Frename_buffer): Allow renaming to same name it has. 1990-04-19 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_open_connection): Attach xrdb to x_current_display. 1990-04-17 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (dumpborder): Now only used for X10. (highlight, unhighlight): New functions for X11. 1990-04-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * cm.c (Wcm_init): Return -2 if screen size not specified. * term.c (term_init): Special error message for that case. 1990-04-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * s-sunos4.h, s-sunos4shr.h (SYSTEM_MALLOC): Define it. 1990-04-15 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_get_resource): Concatenate invocation_name before the resource tag. (Fx_create_screen): Use the latest resource id's. 1990-04-13 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_get_resource): New subr. (Fx_open_connection): Call x_load_resources. New parameter xrm_string. * xrdb.c: New file for doing resource manager stuff. * xscrollbar.h: New file for scrollbar bitmaps. * xselect.h: New file for the X selection stuff. * ymakefile: Take note of these new files. 1990-04-10 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (x_term_init): Use MAXPATHLEN. 1990-04-09 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * buffer.c (list_buffers_1): Get filename from list-buffers-directory. 1990-04-06 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.c (coordinates_in_window): Return -1 if in modeline of window. (Fcoordinates_in_window_p): Return Qt if in modeline of window. (Flocate_window_from_coordinates): Use next_screen_window if MULTI_WINDOW is defined. 1990-04-05 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (construct_mouse_event): Deal with the motion events first. Only grab the mouse when in the scrollbar. 1990-04-04 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.c (coordinates_in_window): Include mode line as part of window. * xterm.c (XTread_socket): Initialize nbytes to 0. (x_display_cursor): Don't draw if screen not selected. * xdisp.c (DoDsp): Additional checks for screen being visible. 1990-04-03 Joseph Arceneaux (jla@churchy.ai.mit.edu) * editfns.c (Fmessage): If there is a global minibuffer screen, raise it before displaying the message. * window.c (window_loop): Parameter SCREENS now affects which screen is scanned for windows. All subrs calling window_loop must pass a Lisp_Object here now. 1990-04-01 Joseph Arceneaux (jla@churchy.ai.mit.edu) * window.c (window_loop): Additional parameter mini to control minibuffer selection or not. (Fget_lru_window): (Fget_largest_window): (Fget_buffer_window): (Fdelete_other_windows): (Fdelete_windows_on): (Freplace_buffer_in_windows): Use that parameter. 1990-03-29 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.c (Fselect_screen): Raise the selected screen. * window.c (Fget_buffer_window): (Fget_largest_window): (Fget_lru_window): New parameter all_screens. (Fdisplay_buffer): Use the new param in Fget_lru_window, Fget_buffer_window, and Fget_largest_window. (Fscroll_other_window): Use new param in Fget_buffer_window. * buffer.c (Fother_buffer): Ditto. * xterm.c (x_display_cursor): Always draw the cursor if ON is true. Don't check if the screen S is selected or equal to mouse-screen. * xfns.c (Fx_track_pointer): Don't turn off cursor, just call x_display_cursor. 1990-03-28 Joseph Arceneaux (jla@churchy.ai.mit.edu) * data.c (Fmake_local_variable): Give the variable value nil if unbound. * window.c (Fnext_window, Fprevious_window): For MULTI_SCREEN, check if Vglobal_minibuffer_screen is non-nil and maybe call next_screen. * screen.c (Fscreen_selected_window): (Fscreen_root_window): If screen is nil, use selected-screen. 1990-03-27 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (XTread_socket): SET_SCREEN_GARBAGED which returning symbol which causes DoDsp to be invoked. * keyboard.c (read_key_sequence): Don't SET_SCREEN_GARBAGED here. * screen.h: New macro SET_SCREEN_GARBAGED. * xfns.c: * window.c: * sysdep.c: * keyboard.c: * dispnew.c: Use the new macro. 1990-03-25 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_own_selection): Only take one argument, string. 1990-03-24 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (select_visual): Catch bullshit machines whose hardware doesn't support the X server pixel depth by looking at colormap_size. (x_decode_color): Use x_screen_planes to check for color. 1990-03-23 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (x_display_cursor): Try using vertical bar cursor. (clear_cursor): Call x_display_cursor for X11. * xfns.c: Zotzed Vx_pointer_mask. (Fx_track_pointer): Call x_display_cursor if we just wasted the cursor. Break out of loop if no display line. Use mode line cursor if we're there. (x_y_pos): New function. (x_set_font): Dont' set x_font_{width,height}, they are gone. 1990-03-22 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_track_pointer): Check that s == selected_screen each time through loop. If event is nil, read mouse position. * keyboard.c (get_char): DoDsp only if selected_screen visible. * xterm.c (XTread_socket): Mark screen as visible only on expose event. * emacs.c (main): Check here for "-d" option and set display_arg. * dispnew.c (init_display): Set Vwindow_system, etc. if display_arg. 1990-03-21 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (read_key_sequence): Don't DoDsp if the screen was just unmapped. (command_loop_1): Call the mouse motion handler before calling read_key_sequence. (interrupt_signal): Fixed typo checking screen type. * xfns.c (Fx_track_mouse): Don't crash because of null display line. Don't set obj til call to get_char. * xterm.c (x_term_init): Disable SIGWINCH here. * fns.c (Fmember): New subr. * dispnew.c (init_display): Don't check env variable DISPLAY to set Vwindow_system. Now done in startup.el. * emacs.c: Removed variables xargc, xargv. 1990-03-20 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_track_pointer): Go faster. * screen.h: New macro SCREENP. * window.c (Fminibuffer_window): Rewritten. 1990-03-19 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c (perror): Control with HAVE_PERROR as well as HPUX. * s-hpux.h (HAVE_PERROR): Define it. 1990-03-19 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (command_loop_1): Restructured handling of X event things. (read_key_sequence): Handle new `unmapped-screen' symbol with new Vunmap_screen_hook. * xterm.c (XTread_socket): Return unmapped-screen symbol if the window for UnmapNotify events. * lread.c (Feval_region): GCPRO opoint. 1990-03-16 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (command_loop_1): Call mouse-motion handler with argument. Also, don't call undo-boundary. * process.c (create_process): Set the process group for BSD at the same time as for USG. 1990-03-14 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (x_new_selected_screen): Set x_input_screen here. 1990-03-11 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c: Vx_mouse_grabbed now Vmouse_grabbed. (XTread_socket): Generate exited-window symbols on LeaveNotify even if screen is focused. * xfns.c: Vx_mouse_grabbed now Vmouse_grabbed. (outline_region): Now static. (Fx_track_pointer): Check x_mouse_screen == s in loop. 1990-03-10 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (encode_mouse_button): Correctly get the button from Motion events. * xfns.c (x11_encode_mouse_button): Nuked. (encode_mouse_button, Fx_mouse_events, Fx_get_mouse_event): #if 0'd. * keyboard.c (get_char): Re-set obj if we've keyboard-translated c. 1990-03-08 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (x_focus_screen): No longer static. (x_error_handler): Use XDefaultIOError. * screen.c (Ffocus_screen): New subr, removed Fscreen_has_focus. (Fselect_screen): New, optional parameter no_enter. (Frestore_screen_configuration): (Fdelete_screen): Pass second parm Qnil to Fselect_screen. * window.c (Fdisplay_buffer, Fset_window_configuration): Pass second parm Qnil to Fselect_screen. 1990-03-07 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.c (Fscreen_has_focus): New subr. (Fselect_screen): Use x_focus_on_screen to physically select the screen. 1990-03-06 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (x_set_mouse_position): Moved to xterm.c. * fileio.c (Fremove_directory): New subr. * screen.c (Frelease_focused_screen): Just call x_unfocus_screen. * xterm.c (XTread_socket): On FocusOut, if s isn't mouse screen, return exited-window. On LeaveNotify, simplify if expression for dumpborder. Reworked FocusIn/FocusOut events. (x_unfocus_screen): Check that screen is x_focus_screen. (x_set_mouse_position): Moved from xfns.c. Use new macro XWarpPointer. * xterm.h: New macro XWarpPointer. * buffer.c: Replaced Fbuffer_flush_undo with Fbuffer_disable_undo. * process.c: Ditto. 1990-03-05 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (XTupdate_end): Use parameter s rather than updating_screen. (XTread_socket): On EnterNotify, don't check s != focus_screen before selecting. On Focus In/Out don't set/reset mouse_screen. 1990-03-04 Joseph Arceneaux (jla@churchy.ai.mit.edu) * eval.c: If using X windows, include xterm.h. (error): TOTALLY_UNBLOCK_INPUT if using X. * xterm.h (BLOCK_INPUT, UNBLOCK_INPUT): No signal stuff, just inc and decrement x_input_blocked. * xfns.c (adjust_scrollbars): Don't BLOCK_INPUT. (x_set_font): Check result of x_new_font. Call error if nonzero. (x_set_icon_type): Check result of x_*_icon, maybe call error. * screen.c (Fdeiconify_screen): Use x_make_screen_visible rather than x_deiconify_screen. Return screen. (Fmake_screen_visible): Don't raise it here. Return screen. * xterm.c (XTwrite_glyfs): Don't show cursor if screen is global-minibuffer-screen. (x_new_selected_screen): Do dumpborder and check auto-raise here, rather than XEvent switch. (x_deiconify_screen): No longer exists. (x_do_pending_expose, x_clear_cursor): (x_invert_screen, scraplines, stufflines, x_bitmap_icon): (x_text_icon, x_new_font): Don't BLOCK_INPUT. (XTins_del_lines): BLOCK_INPUT here. (XTupdate_end): Don't turn on cursor if minibuffer-screen. (XTread_socket): On MotionNotify, just that screen is selected before processing. (XTtopos): If updating_screen, just set x and y, don't flush. (x_bitmap_icon): (x_text_icon): (x_new_font): Return 1 if failed, don't call error. (x_make_screen_visible): Raise the screen as well. 1990-03-02 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.c (Frelease_focused_screen): Just check that screen is selected. 1990-02-28 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.c (Fselect_screen_focused, Frelease_focused_screen): New subrs. * xterm.c (x_focus_on_screen, x_unfocus_screen): New procedures to implement focusing. 1990-02-28 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * casefiddle.c: Doc fix. 1990-02-28 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.h: Redefined BLOCK_INPUT and UNBLOCK_INPUT to use sigblock and sigsetmask if available. * xterm.c: Declare BLOCK_INPUT_mask if have SIGIO and FIONREAD. 1990-02-27 Joseph Arceneaux (jla@churchy.ai.mit.edu) * minibuf.c (Fread_from_minibuffer): Initialize pos to 0. 1990-02-25 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (read_key_sequence): Handle mapped-screen event symbol by calling new hook Vmap_screen_hook. * xterm.c (x_make_screen_invisible): Use the new Xlib function XWidthdrawWindow. (x_iconify_screen): Use the new Xlib function XIconifyWindow. (XTread_socket): Return mapped-screen symbol to signal mapped-screen events. 1990-02-23 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (command_loop_1): Check the character for width 1 before doing direct_output_forward, as well as the cursor position on the screen. * xdisp.c (DoDsp): Use redisplay_windows rather than redisplay_all_windows, which was removed. 1990-02-22 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * unexencap.c: New file, waiting for papers. 1990-02-22 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c: Removed much debugging stuff. * xterm.c: Removed much debugging stuff. (x_error_handler): For X11, if caught BadAlloc error while converting selection (note new variable x_converting_selection), just set new variable x_selection_alloc_error. * xfns.c: Massive changes for crufty selection processing details. New X atoms: Xatom_clipboard, Xatom_delete, Xatom_insert_selection, Xatom_insert_property, Xatom_pair. 1990-02-21 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (kbd_buffer_store_char): Check NULL objects. * xterm.c (XTread_socket): Correctly advance bufp for all KeyPress events. 1990-02-20 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (kbd_buffer_get_char): Use KBD_BUFFER_SIZE rather than sizeof kbd_buffer. (read_key_sequence): Upon redraw-display symbol, set screen_garbaged. * xterm.c (XTread_socket): On EnterNotify events, make sure to return mouse event for both scrollbars and windows. 1990-02-19 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * casefiddle.c (casify_region): Move the new statement. 1990-02-19 Joseph Arceneaux (jla@churchy.ai.mit.edu) * casefiddle.c (casify_region): Return if beginning and end same. 1990-02-18 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (kbd_buffer_store_char): Use KBD_BUFFER_SIZE rather than sizeof kbd_buffer. * fns.c (Fy_or_n_p): Only accept ints from get_char. 1990-02-18 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * minibuf.c (Fread_from_minibuffer): New arg POSITION. * unexsunos4.c: New file. Waiting for papers. * s-sunos4shr.h: New file. * emacs.c (main) [RUN_TIME_REMAP]: Call run_time_remap. * ymakefile (LD): Let config file override with LD_CMD. 1990-02-14 Joseph Arceneaux (jla@albert.ai.mit.edu) * keyboard.c (read_avail_input): Pass read_socket_hook KBD_BUFFER_SIZE rather than doing sizeof (buf). * xterm.c (XTread_socket): Set event.type = MotionNotify when entering screen or scrollbar to fake motion event. 1990-02-13 Joseph Arceneaux (jla@churchy.ai.mit.edu) * window.c (next_screen, prev_screen): Moved to screen.c. (Fnext_window): If mini non-nil, count the separate minibuffer screen. * screen.c (Fnext_screen): New subr. 1990-02-12 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * xdisp.c (display_text_line, try_window, try_window_id, DoDsp): Don't display overlay arrow on more than one line in a window. 1990-02-12 Joseph Arceneaux (jla@albert.ai.mit.edu) * doprnt.c (doprnt): Expand size of tembuf to 512. 1990-02-10 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * minibuf.c (Fread_no_blanks_input): Make second arg optional. 1990-02-09 Joseph Arceneaux (jla@churchy.ai.mit.edu) * keyboard.c (get_char): Remember to set obj when executing macro. (read_key_sequence): Handle the exited-scrollbar symbol. Compare obj, not read_key_sequence_cmd. * xterm.c (x_make_screen_visible, x_deiconify_screen): Check window-manager variable. (x_make_screen_invisible, x_iconify_screen): Don't use new R4 calls (they crash), do it ourselves. (XTread_socket): Return exited-scrollbar symbol when doing so. 1990-02-08 Joseph Arceneaux (jla@albert.ai.mit.edu) * xterm.c (construct_mouse_event): Rewritten to do mouse-motion compression. All mouse processing now done here. Also, just use nil and t for x-mouse-grabbed. Record buttons pressed in new variable x_mouse_grabbed. XGrabPointer on button depression. * xfns.c (Fx_horizontal_line): Use x_mouse_grabbed. 1990-02-07 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xdisp.c (DoDsp): If only updating selected screen, but there is a minibuffer screen, update it as well. 1990-02-06 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_pixel_width, Fx_pixel_height): New subrs. * xterm.h: New components pixel_width, pixel_height, to x_display. * xterm.c (XTread_socket): On configure notify, set these components. * window.c (Fset_window_configuration): Select the screen of the root window if it's not the selected_screen. * minibuf.c (read_minibuf): Remove all the screen selection stuff, now that this is integrated in Fset_window_configuration. 1990-02-05 Joseph Arceneaux (jla@churchy.ai.mit.edu) * screen.h: Declare Vglobal_minibuffer_screen. * xdisp.c (DoDsp): Set all_windows if using global-minibuffer-screen. 1990-02-03 Joseph Arceneaux (jla@geech) * window.c (Fset_window_configuration): Make sure to set window->next to nil for a minibuffer-only screen. * screen.c (make_minibuffer_screen): Set mini_window->next nil. 1990-02-01 Joseph Arceneaux (jla@albert.ai.mit.edu) * screen.c (make_screen): Set wants_modeline elt to 1. * window.c (Fset_window_configuration): Use screen->root_window as arg to delete_all_subwindows rather than minibuf_window->prev. * minibuf.c (read_minibuf): Don't unwind with Frestore_screen_configuration. Save selected_screen if different than minibuf screen, and re-select it after reading minibuf. * screen.c: #if 0 Fscreen_configuration, Frestore_screen_configuration. 1990-02-01 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-ibmps2-aix.h: Undef NEED_SIOCTL. (SIGN_EXTEND_CHAR): Cast to `signed char'. 1990-01-28 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xfns.c (Fx_track_pointer): Rewrote this to loop while there are mouse events. * xterm.c (XTread_socket): Return left-window-event symbol upon LeaveNotify. * keyboard.c (read_key_sequence): Handle this symbol. 1990-01-27 Joseph Arceneaux (jla@churchy.ai.mit.edu) * xterm.c (x_display_cursor): Use dumpglyfs with SPACEGLYF for cursor, as `XFillRectaogle's kill HP-BSD server. * xterm.h: Added nontext_cursor, modeline_cursor to x_display structure. * xfns.c (x_set_mouse_color, Fx_track_pointer): Changes to use nontext_cursor. 1990-01-25 Joseph Arceneaux (jla@albert.ai.mit.edu) * xterm.h: Changed the face structure for X11 to handle GCs and pixmaps. * xterm.c (XTread_socket): Return a motion event when mouse enters scrollbar or window. (x_make_screen_invisible): Use the new X11R4 function XWithdrawWindow. (x_iconify_screen): Use the X11R4 function XIconfifyWindow. (dumpglyfs): Use the new face structure. * xfns.c (install_vertical_scrollbar, install_horizontal_scrollbar): Accept EnterNotify events. Use XMapSubwindows rather than mapping each one. (Fx_set_face_font): New subr for X11 to set face GC. 1990-01-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c (direct_output_for_insert): Give up if buf in 2 windows. * keyboard.c (command_loop_1): Dumb bugs disabled special fast display for character motion. * xdisp.c (DoDsp): For cursor motion within line, hpos result from compute_motion is relative to window. 1990-01-24 Richard Stallman (rms@albert.ai.mit.edu) * eval.c (Fmacroexpand): Handle explicit macros ((macro ...) ...). 1990-01-18 Joseph Arceneaux (jla@spiff) * undo.c (Fundo_more): Fixed typo. 1990-01-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * xdisp.c (display_text_line): When checking HPOS for continuation line, compensate for w->left. 1990-01-15 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c [no FIONREAD]: Undefine SIGIO. * buffer.c (SetBfp): Use XTYPE to test for no selected window yet. * editfns.c, dispnew.c, fileio.c, process.c, sysdep.c, xterm.c: Uniformly let NEED_TIME_H control use of time.h instead of sys/time.h. * xterm.h (TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT): Don't use SIGIO if no FIONREAD. 1990-01-15 Joseph Arceneaux (jla@spiff) * xfns.c (x_set_mouse_color): Set non-text pointer shape with new variable Vx_nontext_pointer_shape. * keyboard.c: More checks for evil bug which trashes kbd_*_ptr. * m/hp300bsd.h: Try using BSD load average stuff. 1990-01-11 Joseph Arceneaux (jla@spiff) * xfns.c (x_draw_pixmap): New routine. 1990-01-10 Jim Kingdon (kingdon@pogo) * m/hp300bsd.h: New file 1990-01-08 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_window_id): New subr. * screen.c (make_screen): Set wants_modeline elt to mini_p. If mini_p 0, then set root_window->next to nil. 1990-01-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * editfns.c (Fchar_after): Set N after coercing marker. 1990-01-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * buffer.c (Fkill_all_local_variables): Force mode line update. 1990-01-05 Joseph Arceneaux (jla@spiff) * insdel.c: Declare Vfirst_change_function. * keyboard.c (read_key_sequence): Function keys are now lisp symbols. (kbd_buffer_store_char): Abort if store pointer past buffer. Temproarry; This shouldn't be able to happen. (read_key_sequence): #ifdef HAVE_X_WINDOWS code which handles complex objects. (command_loop_1): Check not termcap screen before processing non-char input. (kbd_{store,fetch}_char): More debugging checks. * screen.c (make_screen): Set root_window height to 9 if mini_p. (make_minibuffer_screen): Set the mini window's next, prev, and screen elements. * xterm.c (x_func_key_to_sym): New function, uses new variable func_key_syms. (XTread_socket): Use this in KeyPress event for function keys. (XTflash): Draw solid rectangle in middle of screen. (x_set_offset): Set the size hints as well when doing this. (XTflash): Just dumpglyfs instead of redrawing the screen after flashing the rectangle. * lread.c (syms_of_lread): defsubr Fread_event. 1990-01-04 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * buffer.h, buffer.c (Vfirst_change_function): New Lisp variable. * insdel.c (signal_before_change): Call that function. * keyboard.c (cmd_error): Don't crash if TAIL is nil. 1989-12-31 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * minibuf.c: Doc fixes. 1989-12-28 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (create_process): Unhold SIGCHLD in the child. 1989-12-27 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (create_process): Treat HPUX like BSD for sigsetmask. 1989-12-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fns.c (Fmapconcat): Gcpro SEP around mapcar1. 1989-12-23 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c (get_display_line): Don't touch X data if not using X. * syntax.c (Fscan_sexps): Fix fatal documentation typo. * lread.c: Include commands.h. * xterm.c (construct_mouse_event): Delete unreached return at end. (x_wm_set_size_hint): #if 0 some broken code. * cmds.c (SelfInsert): Set HAIRY if have before or after change hooks. * editfns.c (Fsubst_char_in_region, Ftranslate_region): Call signal_after_change for chars changed. * undo.c (Fundo_more): When undoing Uchange, do signal_after_change. * casefiddle.c (casify_region): Do modify_region before the change, signal_after_change afterward. * insdel.c (prepare_to_modify_buffer): Call signal_before_change. (del_range, InsCStr): Call signal_after_change. (signal_after_change, signal_before_change): New functions. 1989-12-20 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c (init_display) [VMS]: Downcase terminal type. 1989-12-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c: Use NEED_SIOCTL to control use of sioctl.h. * m/m-mips.h, m/m-iris4d.h: Define that. * m/m-ibmps2-aix.h (NEED_SIOCTL, HAVE_UNION_WAIT, HAVE_PTYS): Define. (HAVE_SYSVIPC, HAVE_SOCKETS, X_DEFAULT_FONT): Define. (sigsetmask): #undef this. 1989-12-15 Joseph Arceneaux (jla@spiff) * lread.c (Fread_char): Catch error if read non-char. (Fread_event): New subr. Return any input object. 1989-12-14 Joseph Arceneaux (jla@spiff) * xfns.c: New variable Vx_no_window_manager. (Fx_track_pointer): If bufp < 0, abort. * xterm.c (XTread_socket): When leaving window, set x_mouse_x and x_mouse_y to -1. 1989-12-13 Joseph Arceneaux (jla@spiff) * xterm.c (XTread_socket): On ConfigureNotify events, return "redraw-screen" symbol. (dumpborder): Only do border stuff if x-no-window-manager non nil. Also check if there is a tracking rectangle. (XTupdate_begin): If there is a mouse tracking rectangle, erase it. * keyboard.c (read_key_sequence): Return -2 for symbols. (command_loop_1): DoDsp when 'redraw-screen arrives as input. For mouse events, call Fexecute_mouse_event with read_key_sequence_cmd instead of Vmouse_event. 1989-12-08 Joseph Arceneaux (jla@spiff) * process.c (create_process): For not USG, properly set the process group. 1989-12-07 Joseph Arceneaux (jla@spiff) * term.c (topos): Under X Windows, abort if topos_hook not correct. Temporary. * xfns.c (Fx_horizontal_line): New subr. 1989-12-05 Joseph Arceneaux (jla@spiff) * keyboard.c (Fexecute_mouse_event): Don't set Vmouse_window here for X11. * xterm.c (construct_mouse_event): Vx_mouse_grabbed now indicates which keys are depressed. (construct_mouse_event): Set Vmouse_window here. 1989-12-04 Joseph Arceneaux (jla@spiff) * screen.c (coordinates_in_window): New function. (Fcoordinates_in_window_p): Rewritten to use above. * dispextern.h: New element bufp for display_line structure when using X windows. * xdisp.c (redisplay_window): Set this to the position in the buffer of the first char in this display line. * dispnew.c (get_display_line): Set this to -1 here. 1989-12-03 Joseph Arceneaux (jla@spiff) * alloc.c: Upped NSTATICS from 200 to 256. * xterm.c (XTread_socket): Report MotionNotify events only if mouse has changed character position. Call x_read_mouse_position. Set Vmouse_event here. * xfns.c (x_read_mouse_position): Set new global variables x_mouse_x and x_mouse_y. * keyboard.c: Vignore_mouse_events: New variable. * syntax.c (Fscan_sexps): Doc change. * lread.c (Fread_char): Return only chars. If new variable Vignore_mouse_events non nil, execute any mouse events which appear. 1989-12-01 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_track_pointer): Draw half-sized rectangles for '\n'. (x_rectangle): Draw half-size if negative argument. * xterm.c (XTread_socket): Abort if garbage collecting when doing mouse events. * ymakefile: #define FLOATSUP if LISP_FLOAT_TYPE defined. * emacs.c (main): If BSD, set pgrp to pid. 1989-11-30 Joseph Arceneaux (jla@spiff) * callint.c (Fcall_interactively): For case 'e', set varies[i] to avoid entering in the command history. * xterm.c: Removed the function x_indicate_pointer_char. (XTread_socket): When leaving window, erase mouse tracking box if it exists. * xfns.c (Fx_track_pointer): New function, does what x_indicate_pointer_char used to. (x_read_mouse_position): Subtract internal_border_width. * screen.c: No rubber-banding function for X11. * window.c (Fmove_to_window_line): Document string fix. 1989-11-29 Joseph Arceneaux (jla@spiff) * lread.c (Fread_char): Return a Lisp_Object (directly from get_char). * keyboard.c: * xterm.c: Function keys now arrive as cons cells. 1989-11-27 Joseph Arceneaux (jla@spiff) * keyboard.c (read_key_sequence): Handle Lisp_Symbols on input (function keys). Also, handle these and mouse events with prefixes (by ignoring the prefixes for now). * xfns.c: New variable Vx_mouse_grabbed. * xterm.c (construct_mouse_event): Use it. (XTread_socket): Return Lisp_Symbol for function key. * buffer.c (reset_buffer_local_variables): Set function_key_map to Qnil. 1989-11-24 Joseph Arceneaux (jla@spiff) * buffer.h: Per-buffer function key maps. * keyboard.c (read_avail_input): Convert chars to Lisp_Objects in case of stdin. 1989-11-22 Joseph Arceneaux (jla@spiff) * keyboard.c (read_key_sequence): Check type of object returned from get_char. Handle mouse events (set Vmouse_event) and function keys. (get_char_menu_prompt): Return a Lisp_Object. (Fexecute_mouse_event): No longer set Vmouse_event. Vmouse_window set here. * xterm.c (XTread_socket): KeyPress events now return Lisp_Objects, as do ButtonPress events. (construct_mouse_event): New function. (encode_mouse_button): New function. 1989-11-21 Joseph Arceneaux (jla@spiff) * keyboard.c (kbd_buffer_store_char, kbd_buffer_get_char): Store and get Lisp_Objects. (get_char): Use those Lisp_Objects. * fileio.c (Fread_filename_internal): If exactly complete, but string was modified, return string. * minibuf.c (temp_minibuf_message): Pass correct arguments to Fsit_for. 1989-11-18 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * s-386-ix.h: New file. 1989-11-17 Joseph Arceneaux (jla@spiff) * xterm.c (dump_rectangle): Flush the X queue. 1989-11-16 Joseph Arceneaux (jla@spiff) * xmenu.c (xmenu_show): Use ButtonReleaseMask instead of ButtonRelease. * fileio.c (Fmake_directory): New subr. 1989-11-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * config.h-dist (C_SWITCH_SITE, LD_SWITCH_SITE): Mention these. (HAVE_X11): Renamed from X11 and defined by default. It shoukld have no effect when not using X. 1989-11-14 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_get_selection, x_selection_arrival): Use &event instead of event. (x_selection_arrival): For incremental selections, loop on XGetWindowProperty if one is not enough. 1989-11-13 Joseph Arceneaux (jla@spiff) * ymakefile: Just link if ../oldXMenu/libXMenu11.a already exists. 1989-11-09 Joseph Arceneaux (jla@spiff) * m/m-sparc.h: If __GNUC__ use "-O", else "-O2" 1989-11-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * search.c (Fstore_match_data): A marker pointing nowhere, treat as 0. 1989-11-08 Joseph Arceneaux (jla@spiff) * search.c (Fmatch_data): Fixed typo. * insdel.c (make_gap): Use BUFFER_REALLOC instead of realloc. * buffer.c (Fget_buffer_create): Use new define BUFFER_ALLOC in place of malloc, and set b->data. (Fkill_buffer): Use BUFFER_FREE on b->data, rather than malloc on b->p1 + 1. * buffer.h: New element data in buffer_text structure. New define for it, bf_data. 1989-11-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * marker.c (Fset_marker): Don't force POS into visible range. * window.c (set_marker_restricted): New function does what Fset_marker did. All calls in this file now use the new function. 1989-11-07 Joseph Arceneaux (jla@spiff) * buffer.h: Defines for allocating buffer variables. * ralloc.c: Completely rewritten. * alloc.c (xmalloc, xrealloc): Return 0 immediately for requests of 0 size. 1989-11-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * search.c (Flooking_at, Fstring_match, search_buffer): Record in search_regs_from_string whether matching against a string. (Fmatch_data): Save data as integers if from a string. * s-umips.h: Now include either s-usg5-2-2.h or s-bsd4-3.h and then override as needed. * m-mips.h: System dependence deleted. LD_SWITCH_MACHINE remains w/ options needed on all systems. * m-pmax.h: A little of that (LIBS_DEBUG) moved here. No need to undef LIBS_MACHINE. * fns.c (Fload_average): FIXUP_KERNEL_SYMBOL_ADDR is now general hook. * s-umips.h: Define it. * sysdep.c: Handle BROKEN_FIONREAD. 1989-11-03 Joseph Arceneaux (jla@spiff) * config.h-dist: Mention LISP_FLOAT_TYPE, GNU_MALLOC, and REL_ALLOC. * s/s-umips.h: New file. 1989-11-03 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (Fopen_network_stream): Handle EINTR in connect. Describe errno in err msg if connect fails. 1989-11-02 Joseph Arceneaux (jla@spiff) * vm-limit.c: New file. * ralloc.c: New file. * ymakefile: Take vm-limit.o into account. 1989-11-02 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * alloc.c (staticvec): Make this a simple vector of pointers rather than an alias for a vector of chars. 1989-11-01 Joseph Arceneaux (jla@spiff) * window.c: Moved some functions (save_window_save, replace_window, unshow_buffer) around. * search.c: Moved function place. * lread.c: Moved function read_escape. * unexec.c: Declarations for make_hdr, copy_text_and_data, copy_sym. Declare mark_x as static void. * dispextern.h: Removed declaration of new_display_line. * emacs.c: Do malloc_init if GNU_MALLOC. * gmalloc.c (malloc_init): New function. * xfns.c (x_rectangle, Fx_draw_rectangle, Fx_erase_rectangle) (outline_region, Fx_countour_region, Fx_uncontour_region): New subroutines for drawing rectangles and things. (Fx_point_coordinates): New subr. 1989-10-31 Joseph Arceneaux (jla@spiff) * All .c and .h files: New copyright header. 1989-10-30 Joseph Arceneaux (jla@spiff) * gmalloc.c: New GNU malloc. * emacs.c (main, Fdump_emacs): No malloc init if GNU_MALLOC. * ymakefile: Check if GNU_MALLOC defined. 1989-10-27 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_pointer_char): New subr. * xterm.c (x_indicate_pointer): New procedure. * alloc.c (Fmake_vector_from_list, make_vector_from_list): New subrs. 1989-10-26 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * xterm.c (x_term_init): Negate arg to fcntl F_SETOWN if F_SETOWN_SOCK_NEG. * keyboard.c (Fset_input_mode) [NO_SOCK_SIGIO]: No interrupt input if using a socket. * m-sequent.h: Define NO_SOCK_SIGIO, F_SETOWN_SOCK_NEG, MAIL_USE_FLOCK. 1989-10-26 Joseph Arceneaux (jla@spiff) * xterm.c (x_handle_error_gracefully): Make sure to completely release input before returning, using: * xterm.h New macro TOTALLY_UNBLOCK_INPUT. * xmenu.c (xmenu_quit): No longer use this error_handler; use default one. 1989-10-25 Joseph Arceneaux (jla@spiff) * config.h-dist: Comment fix. 1989-10-24 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_draw_lines, translate_vectors): New functions. 1989-10-21 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * search.c (search_buffer): Always find null string. * window.c (window_loop): For UNSHOW_BUFFER, don't Fset_buffer unless window is the selected one. 1989-10-20 Joseph Arceneaux (jla@spiff) * xdisp.c (display_minibuf_message): Choose minibuf screen first of all. Return if not visible. 1989-10-19 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (x_handle_error_gracefully): New procedure to handle non-fatal X errors. (x_error_handler): Use it. (acceptable_x_error_p): New macro. * xfns.c (Fx_own_selection): Use second parameter SCREEN. * xdisp.c (message, message1): No longer displays messages when using X but not yet mapped. 1989-10-18 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-pyramid.h (NO_ARG_ARRAY): Define if using GCC. 1989-10-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * vmsfns.c (process_command_input): Call clear_waiting_for_input. 1989-10-14 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * syntax.c (scan_words): If words_include_escapes not 0, treat Sescape and Scharquote like Sword. (syms_of_syntax): Define Lisp variable. * process.c (wait_reading_process_input): Get rid of kbd_count. Use detect_input_pending. * sysdep.c (select, read_input_waiting): Likewise. (read_input_waiting): Don't read directly into kbd_buffer; use kbd_buffer_store_char. * keyboard.c: Don't define kbd_count. * keyboard.c (read_key_sequence): Reject the prefix char generated for a Meta char, if it finds a non-prefix definition. 1989-10-13 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (wait_reading_process_input): READ_KBD==2 means wait until have mouse input. * xfns.c (Fx_get_mouse_event): Use that. * xterm.c (mouse_event_pending_p): New subroutine. 1989-10-13 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (x_selection_arrival): (x_send_incremental): (x_answer_selection_request): New procedures for incremental selection transfer. 1989-10-12 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * lread.c (complete_filename_p): New function which replaces absolute_filename_p. This one doesn't consider "~" valid. 1989-10-12 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * buffer.c: Comment fix. 1989-10-11 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (Fx_open_connection) New X atoms Xatom_incremental and Xatom_multiple. * xterm.h: New macros MAX_SELECTION and SELECTION_LENGTH. * process.c (child_sig): Check pid <= 0 in case WNOHANG not defined. 1989-10-11 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * termcap.c (tgetent, gobble_line): Always store null at end of bfr. Allocate one extra byte at end to ensure space. Clean up order of arithmetic when updating ptrs into buffer after xrealloc. 1989-10-10 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (Fx_open_connection): Make all X Atoms here. * xterm.c (x_iconify_screen): Cleaned up this code. (x_term_init): Removed warpmouseondeiconify stuff. 1989-10-09 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xdisp.c (DoDsp): Make sure to call unhold_window_change after before all returns. * minibuf.c (read_minibuf): Changed set_mouse_position to Fset_mouse_position. * xterm.c (XTread_socket): dumprectangle (whole screen) instead of DoDsp in ConfigureNotify event. (x_wm_set_size_hint): New calculations for size_hints. * screen.c (Fset_mouse_position): No more function set_mouse_position; use x_set_mouse_position directly. * xfns.c (x_set_cursor_color): Really decode Vx_cusor_fore_pixel if set. Define new cursor before freeing old. This may eliminate a server bug on the Sony. Also check for invisible cursors. (x_set_mouse_color): Check for invisible pointers. (x_resize_scrollbars): BLOCK_INPUT whilst doing operations. (adjust_scrollbars): Likewise. 1989-10-03 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m/m-hp9000s800.h (XUNMARK): Delete definition. (S_IFLNK): Do not undef it. 1989-10-03 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * dispnew.c (get_display_line): If screen not visible, abort. 1989-10-02 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (x_make_screen_visible): Set s->visible, unset s->iconified for HAVE_X11. 1989-09-29 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (XTread_socket): Check screen s before proceeding for MapNotify event. * xterm.c: No longer sets the variable mouse_down_timestamp. * xfns.c (Fx_get_mouse_event): mouse_timestamp (formerly mouse_down_timestamp) set here. Also, mask out upper 9 bits before doing XSET. 1989-09-28 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (Fx_geometry): Kludge for the case of position `-0'. (Fx_get_mouse_event): Also return the time stamp as last list elt. (Fx_color_display_p): (Fx_defined_color): (x_decode_color): (defined_color): Eliminate screen argument. (Fx_create_screen): No more ColorMap component to display.x. * xterm.h: Likewise. 1989-09-27 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (Fx_own_selection, Fx_get_selection, x_disown_selection): New funcs, which use new variables Vx_selection_value, x_begin_selection_own, mouse_down_timestamp, requestor_time, requestor_window, property_name, and x_begin_selection_own. * xterm.c (XTread_socket): Only do stuff if s for FocusOut under X11. SelectionClear: SelectionRequest: SelectionNotify: New events to handle the selection inter-client communication mechanism. ButtonPress: Set mouse_down_timestamp. 1989-09-26 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c: New variable Vx_cursor_fore_pixel. 1989-09-23 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lread.c (openp): Don't ! the result of `access'. 1989-09-22 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c (Fread_file_name_internal): Try to work properly if dirs are specified using environment vars. Preserve use of vars. 1989-09-21 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c: Comment fix. 1989-09-18 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_get_cut_buffer): XFree the data returned by XFetchBytes. 1989-09-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c (Fwrite_region): Reinstall #if 0 around fstat. 1989-09-12 Joseph Arceneaux (jla@spiff) * xfns.c (defined_color): New function to test if a color is currently defined. (x_decode_color): Use defined_color. (Fx_defined_color): New subr. (select_visual): Select the appropriate X11 Visual. (Fx_open_connection): Use select_visual. screen_visual now global and used when making emacs windows. (Fx_color_display_p): New subr. 1989-09-11 Joseph Arceneaux (jla@spiff) * fileio.c (Fwrite_region): Fixed typo. * keyboard.c (Fdiscard_input): Fixed typo. * window.c (Fnext_window): Fixed typos. * alloc.c (xmalloc, xrealloc): hold_window_changes whilst doing the associated operations. * dispnew.c (init_display): (Fsleep_for, Fsit_for): * process.c (Faccept_process_output): * keyboard.c ({clear,set}_waiting_for_input): (quit_throw_to_get_char, get_char): * xdisp.c (DoDsp, message, message1): Undid changes of Aug. 23 (see below); accept window changes most of the time. 1989-09-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keyboard.c: Eliminate kbd_count, and use two pointers, kbd_fetch_ptr and kbd_store_ptr. Assume buffer is empty when they are equal. This should eliminate timing error. (kbd_buffer_store_char): Update kbd_store_ptr when storing. Don't ever fill the entire buffer. (kbd_buffer_get_char): Update kbd_fetch_ptr when fetching. (stuff_buffered_input): Likewise. (get_input_pending): Compare the two pointers. * fileio.c (Fwrite_region): Reenable using fstat rather than stat to get the modtime of the file just written, except on VMS and APOLLO. 1989-09-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * emacs.c, doc.c, filelock.c: Move Emacs header includes after system header includes, and #undef NULL in between. 1989-08-30 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c [SYSV_PTYS]: If `titan', include some other files. 1989-08-29 Joseph Arceneaux (jla@spiff) * fileio.c: read-file-name replaced with new version, formerly called new-read-file-name. 1989-08-26 Richard Stallman (rms@apple-gunkies.ai.mit.edu) * window.c (Fscroll_other_window): Use save-excursion (in effect) to save and restore current buffer and point. (window_scroll): If selected window's buffer isn't current, make it current, using save-excursion to go back. 1989-08-24 Richard Stallman (rms@apple-gunkies.ai.mit.edu) Use two variables to convey reason for synch process death, to avoid consing in signal handler. They are synch_process_death and synch_process_retcode. * callproc.c (Fcall_process): Use both variables. * process.c (child_sig): Set both variables. 1989-08-24 Joseph Arceneaux (jla@spiff) * xterm.c (x_wm_set_size_hint): Use new ICCCM values for size_hints. 1989-08-24 Richard Stallman (rms@apple-gunkies.ai.mit.edu) * buffer.c: Doc fix. 1989-08-24 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_create_screen): X11 part. Set height and width to 0 before calling change_screen_size. * buffer.c (kill-all-local-variables): Changed doc string. 1989-08-23 Richard Stallman (rms@apple-gunkies.ai.mit.edu) * dispnew.c (init_display): Call hold_window_change. (Fsleep_for, Fsit_for): Temporarily unhold, while waiting. * process.c (Faccept_process_output): Likewise. * keyboard.c ({clear,set}_waiting_for_input): Temporarily unhold. (quit_throw_to_get_char, get_char): Rehold. * xdisp.c (DoDsp, message, message1): Unhold and rehold momentarily before any real work. * Makefile (CPP): Use $(CC). 1989-08-22 Joseph Arceneaux (jla@spiff) * xfns.c (x_set_mouse_color): Use new variables Vx_pointer_mask, Vx_pointer_shape. 1989-08-21 Richard Stallman (rms@apple-gunkies.ai.mit.edu) * alloc.c (malloc_warning): Do nothing if ignore_warnings. (init_alloc_once): Set ignore_warnings while initializing allocation. * buffer.c: Doc fix. 1989-08-21 Joseph Arceneaux (jla@spiff) * xterm.c (x_calc_absolute_position): New function to calculate positive screen position. (x_set_position): Use it. (x_reset_cursor): No longer exists. * xfns.c (x_set_mouse_color): Reset the cursor even if there's no X window. (x_figure_window_size): Use x_calc_absolute_position. (x_set_mouse_color): Rewrote this function. Always set cursor and its color. If the window exists, then attach the cursor to it. No longer uses x_reset_cursor. (x_create_window): (x_set_background): (x_set_foreground): Use x_set_mouse_color instead of x_reset_cursor. 1989-08-18 Richard Stallman (rms@hobbes.ai.mit.edu) * vmsfns.c: Define PRV$V_... syms if prvdef.h does not. 1989-08-18 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_geometry): New subr. (x_figure_window_size): Don't worry about "geometry" here anymore; now done in x-win.el. (x_icon): Look in parms for iconic-startup rather than in variable. 1989-08-16 Joseph Arceneaux (jla@spiff) * xfns.c (x_set_*_scrollbar): Don't destroy a scrollbar if it doesn't exist. Also set scrollbar size only if actually creating one. (x_set_name): Don't do anything if the X window doesn't exist. Set the icon name as well. (x_window): Set the class hints for the window. 1989-08-16 Richard Stallman (rms@hobbes.ai.mit.edu) * lread.c (Fload): Fix unterminated comment. * scroll.c (scrolling_max_lines_saved): Replace fixed threshold of 20 with 1/4 of average length of lines. 1989-08-13 Joseph Arceneaux (jla@spiff) * ymakefile: Do ${make} for oldXMenu. 1989-08-13 Richard Stallman (rms@hobbes.ai.mit.edu) * eval.c: Doc fix. 1989-08-12 Richard Stallman (rms@hobbes.ai.mit.edu) * emacs.c (main): Check for failure opening -t device. Fatal error if terminal isn't a real terminal. * window.c (Fscroll_other_window): Let Vother_window_scroll_buffer specify a buffer to scroll. 1989-08-11 Richard Stallman (rms@hobbes.ai.mit.edu) * dispnew.c: Handle BROKEN_FIONREAD as in other files. 1989-08-09 Joseph Arceneaux (jla@spiff) * ../oldXMenu/Makefile: Removed all the unneccessary X stuff. 1989-08-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c (barf_or_query_if_file_exists): When signalling, provide the expected args for a file-error. 1989-08-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c: Let NEED_BSDTTY control include of bsdtty.h. * process.c [BSD or STRIDE]: If ioctl.h fails to define O_NDELAY, and we need it, try fcntl.h. * s-bsd*.h, s-rtu.h, s-umax.h, s-unipl*.h: Define HAVE_UNION_WAIT. * m-stride.h: Likewise. * process.c: Decide which type to use with `wait' according to HAVE_UNION_WAIT. If WAITTYPE already defined, assume everything all set up for this. * m-hp9000s300.h: Unless NOT_C_CODE or NO_SHORTNAMES, define WAITTYPE and WRETCODE, and include sys/wait.h. 1989-08-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * callproc.c (child_setup): Get rid of junk in #if 0. 1989-08-03 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * abbrev.c (Fdefine_abbrev): Allow nil spec'd as expansion. (Fexpand_abbrev): Eliminate abbrev length limit; use alloca. Eliminate redundant tests, always true. Record positions of both start and end of abbrev. Handle whitespace following the abbrev, before point. * callproc.c (Fcall_process_region): Use unwind-protect to delete temp file. * lread.c (load_unwind): Free the pointer-word malloc'd in Fload. 1989-08-02 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * emacs.c (Fdump_emacs): Doc fix. 1989-08-02 Joseph Arceneaux (jla@spiff) * xfns.c: Reorganized several functions to be in same order as the enum list. (x_set_border_color): For X11, don't set pix to -1 for gray values. (Fx_create_screen): Simplified this function even more. 1989-07-31 Joseph Arceneaux (jla@spiff) * keymap.c: New subrs Fuse_local_mouse_map, Fcurrent_local_mouse_map. * xfns.c (x_set_mouse_color): (x_set_cur): No need to redraw display after doing these. (Fx_get_mouse_event): Accept motion events. (x11_encode_mouse_button): Encoding a la X11, except for one kludge. This is used only for motion events. * xterm.c (XTread_socket): Handle motion eveots. 1989-07-26 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_create_screen): I couldn't take it any more, the ugliness of this routine offended me too deeply. It is now completely rewritten for X11 and uses subroutines: (x_figure_window_size) (x_create_window) (x_icon) (x_make_gc) (Fx_draw_rectangle): (Fx_erase_rectangle): New subrs. * m/m-intel386.h: Changes in LOAD_AVE_TYPE, LOAD_AVE_CVT, and FSCALE to make loadst work correctly. 1989-07-24 Joseph Arceneaux (jla@spiff) * xfns.c (Fmodify_screen_parameters): Check s->output_method before looping through alist. (Fx_create_screen): Call x_default_parameter for font. Don't add the scrollbar widths when making the main window: this is done when the scrollbar is actually made. (x_set_vertical_scrollbar): Set v_scrollbar_width here instead of in install_vertical_scrollbar. Also, pass that function macros PIXEL_WIDTH, PIXEL_HEIGHT as args. (x_set_horizontal_scrollbar): Likewise. * xterm.c (x_set_window_size): Don't call the things called anyway upon the ConfigureNotify event. (x_set_offset): Use the screen-size lisp variables for these calculations. * xterm.h: Added the screen parameter declarations from xfns.c for X11. 1989-07-21 Joseph Arceneaux (jla@spiff) * sysdep.c: Don't include sioctl.h on mips. * buffer.c (Flist_buffers): Pass prefix as arg. * editfns.c (Finsert_char): Insert at most 256 chars at a whack. * xterm.c (x_draw_box): Moved cursor box right by one pixel. 1989-07-20 Joseph Arceneaux (jla@spiff) * xfns.c: New variable x_screen_visuals, set if Fx_open_display, to be used in screen-color-p. * process.c (create_process): Don't call setpgrp_of_tty here. Also, do setpgrp for USG regardless of HAVE_PTYS. * callproc.c (child_setup): Ignore argument set_pgrp and always do setpgrp_of_tty. (Fcall_process): Don't call setpgrp_of_tty here. * keyboard.c (command_loop_1): Make sure Vprefix_arg is NULL before finalizing_kbd_macro_chars; 1989-07-19 Joseph Arceneaux (jla@spiff) * xfns.c (Fx_rebind_key): Completely rewrote this function for X11. 1989-07-13 Joseph Arceneaux (jla@spiff) * emacs.c: * process.c: * unexec.c: * m/m-ibmrt-aix.h: Changed IBMRTAIX to IBMAIX. * sysdep.c: Likewise. Also, don't define our closedir if IBMAIX. * m/m-ibmps2-aix.h: New file. 1989-07-12 Joseph Arceneaux (jla@spiff) * xdisp.c (message, message1): If using x, but haven't mapped the window yet, use noninteractive output. * dispnew.c (Fredraw_display): Don't redraw a screen which is not visible. * xterm.c (x_set_window_size): Don't DoDsp if screen isn't visible. * xfns.c (x_set_mouse_color) (x_set_border_color) (x_set_cursor_color) (x_set_background_color) (x_set_foreground_color): Don't redraw when screen isn't visible. 1989-07-11 Joseph Arceneaux (jla@gluteus) * xterm.c (x_term_init, XTread_socket): Use ConnectionNumber for both X10 and X11. This is #defined for X10. * screen.c (Fset_screen_width, Fset_screen_height): These now take a SCREEN argument. 1989-07-10 Joseph Arceneaux (jla@gluteus) * xterm.c (x_set_window_size): Call x_wm_set_size_hint. (x_new_font): Don't call x_wm_set_size_hint. * xfns.c (x_set_internal_border_width): Don't call x_set_resize_hint, and call x_set_window_size after BLOCK_INPUT. * screen.c, dispnew.c (Fset_screen_width, Fset_screen_height): These functions have moved to screen.c. 1989-07-07 Joseph Arceneaux (jla@sugar-bombs.ai.mit.edu) * eval.c (Ffuncall): Handle 6 arguments. Also, print a nice error message if there are more than 6 args. * fns.c (Fyes-or-no-p): * minibuf.c (read_minibuf_unwind): (Fread_minibuffer): (Fread_no_blanks_input): (Fcompleting_read): Extra arg to read_minibuf. * callint.c (Fcall_interactively): * keyboard.c (Fexecute_extended_command): * minibuf.c (Fread_command): (Fread_function): (Fread_variable): (Fread_buffer): Extra arg to Fcompleting_read. 1989-07-05 Joseph Arceneaux (jla@spiff) * minibuf.c (read_minibuf): New argument back_n is number of characters to back-up point by. (Fcompleting_read): Same. * fileio.c (Fnew_read_file_name): New version of Fread_file_name using the above features. (Finsert_file_contents): Check for negative file length. 1989-07-03 Joseph Arceneaux (jla@spiff) * xfns.c (x_pixel_width, x_pixel_height) New functions. * screen.c (Fscreen_pixel_size): New subr. 1989-06-30 Joseph Arceneaux (jla@spiff) * xterm.c: Use invocation_name as argument to XGetDefaults. 1989-06-29 Joseph Arceneaux (jla@spiff) * xterm.c (x_error_handler) #ifdef sony_news use XDefaultError instead of XPrintDefaultError due to weirdness in Sony library. * xterm.c: Avoid infinite raise/lower, enter/leave cycle when both auto_raise and auto_lower are set by checking times between consecutive Enter events. 1989-06-27 Joseph Arceneaux (jla@sugar-bombs.ai.mit.edu) * screen.c (Fselect_screen): * window.c (Fselect_window): The previous strategy was bugging the lisp stuff, so these are now rewritten. 1989-06-26 Joseph Arceneaux (jla@galapas.ai.mit.edu) * cm.c (Wcm_init): Don't check for Wcm.cm_ds, since this has been removed. (losecursor): This function now a #define in cm.h. * xterm.c (x_iconify_screen): Send message to root window to do this, as per latest Inter-Client Communications Conventions. This is commented out until it's implemented by X. For now, do it with the iconic_state hint. (x_deiconify_screen): For X11, just Map the window, as per the new ICCC. (x_make_screen_visible): Only handle visible and iconified screen elements for X10; these variables are handled in event processing for X11. (x_make_screen_invisible): Send an UnmapNotify event to the root window to aprise the window manager of the change. (XTread_socket): Catch VisibilityNotify events. 1989-06-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fsplit_window): If horizontal, round left window size up. 1989-06-24 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * cm.h (cmplus): Improve formatting. Use losecursor when reach end of line, if losewrap. * cm.h: New fields to handle multi-line and multi-char motion, and both max and min cost for certain operations. * term.c (term_init): Init those fields. * term.c (clear_end_of_line_raw): Don't clear last char of last line if autowrap. * abbrev.c (Finsert_abbrev_table_description): Make 2nd arg optional. 1989-06-23 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c, lisp/term/x-win.el: C routine Fscreen_color_p now lisp function x-color-screen-p in x-win.el. (x_set_cursor_color): New method: first disallow same cursor as background, then if cursor not foreground, use it as cursor foreground. 1989-06-22 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lisp.h (XPNTR): Don't define if already defined. 1989-06-22 Joseph Arceneaux (jla@cream-of-wheat.ai.mit.edu) * screen.c: New subrs Ficonify_screen, Fdeiconify_screen, Fread_mouse_position, Fset_mouse_position. * xterm.c: New functions x_deiconify_screen, x_iconify_screen. 1989-06-22 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fsplit_window, change_window_height): Enforce minimum of 2 for window_min_width and window_min_height. 1989-06-22 Joseph Arceneaux (jla@galapas.ai.mit.edu) * dispnew.c (unhold_window_change): Don't set and unset in_display before and after calling change_screen_size. 1989-06-21 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * buffer.c (Fkill_buffer): Ignore errors deleting auto-save file. Delete only if delete-auto-save-files. * data.c (Fmake_local_variable): Don't change value if unbound. 1989-06-20 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * screen.c (Fselect_screen): Use x_set_mouse_position instead of x_enter_screen. * xterm.c (x_enter_screen): Deleted, now merged with * xfns.c (x_set_mouse_position): If the position is negative, use the center screen position. * data.c (swap_in_symval_forwarding): Declared tem1. (Fset): Changed variable name void to voide. Also, set it to a C true/false, rather than Qt or Qnil. 1989-06-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * eval.c (Fdefvar): Operate on default value if sym is buffer-local. (Fdefconst): Likewise. Allow buffer-local variables to be void in one buffer or in the default value. * data.c (swap_in_symval_forwarding): New function. (Fboundp, Fsymbol_value): Use that. (default_value): New function. (Fdefault_value): Use that. (Fdefault_boundp): New function, uses that. 1989-06-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * ymakefile: New variable OLDXMENU has filename of libXMenu.a as a target. Make temacs depend on it. 1989-06-15 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * ymakefile [HAVE_X11, HAVE_X_MENU]: Build oldXMenu. * xmenu.c: Get XMenu.h from sibling dir. * buffer.c (Fkill_buffer): Return t if buffer is killed. Delete auto-save file if any. 1989-06-09 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * window.c: Initialize auto_new_screen to 0 (nil). * screen.c (make_screen): Added auto_lower to the list of screen elements initialized. (make_minibuffer_screen): Likewise. 1989-06-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fset_window_point): Don't lose if window's buffer is not current. 1989-06-08 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (Fx_open_connection): Added 9 Lisp variables defined by the screen and server. 1989-06-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-pmax.h: New file. 1989-06-08 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c: Removed superfluous definition of gray_bits. 1989-06-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-hp9000s300.h: Define NEED_BSDTTY unless NOMULTIPLEJOBS. 1989-06-07 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * emacs.c (Fkill_emacs): If under X, call Fx_close_current_connection. This has fixed the "bad file" bug. * xfns.c (Fx_close_current_connection): Added this subr which for the moment serves only to close the X-connection when killing emacs. 1989-06-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-hp9000s800.h: Define NEED_BSDTTY here. * s-hpux.h: Not here. 1989-06-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * s/s-hpux.h: Define NEED_BSDTTY. 1989-06-06 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (x_new_selected_screen): Make the new selected_screen and it's selected_window's screen be the same. (x_enter_screen): Calculate the middle of the screen, and warp the mouse there. Also, raise the screen before doing so. 1989-06-05 Joseph Arceneaux (jla@cream-of-wheat.ai.mit.edu) * xterm.c (x_set_window_size): If not already in DoDsp (checked with variable in_display) then DoDsp here. Handles redisplay after screen configuration. (x_error_handler): Print out stuff about the error if we're in debug mode. * dispnew.c (change_screen_size): No longer call DoDsp here. 1989-06-05 Chris Hanson (cph@kleph) * syntax.c (Fmodify_syntax_entry): Change documentation string to reflect earlier change to action of `p' syntax bit. 1989-06-04 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lread.c (read1): Don't accept "" in middle of string. 1989-05-30 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * search.c (Freplace_match): If \N has nothing to insert, insert nothing. 1989-05-29 Joseph Arceneaux (jla@gracilis.ai.mit.edu) * xfns.c (Fx_create_screen): If parms is nil and Vx_screen_defaults isn't, then use them. (Fdisplay_buffer): Call Fx_create_screen with Qnil. 1989-05-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * syntax.c (scan_lists): Once within a word, treat Squote like Sword. 1989-05-24 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * dispnew.c (change_screen_size): DoDsp if not pretend. 1989-05-23 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * search.c (skip_chars): Dumb error checking for \. 1989-05-22 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * screen.c (Fselect_screen): Under X, basically just warp the cursor into the desired screen. The event handler will then do the right thing. (Frestore_screen_configuration): Don't set the mouse position. * window.c (Fselect_window): If window's screen is not selected, call Fselecte_screen. (Fdisplay_buffer): Call Fx_create_screen with x-screen-parameters as argument instead of nil. * keyboard.c (clear_waiting_for_input): Don't call x_new_selected_screen here. * xterm.c (XTread_socket): Add case slots for CirculateNotify and CirculateRequest events. 1989-05-21 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * doc.c (Fsubstitute_command_keys): Evaluate \\<...> keymap in proper buffer. * keymap.c (Fapropos_internal): New Lisp function, old apropos but only returns a list. 1989-05-20 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (Fopen_network_stream): Don't set kill-without-query. 1989-05-19 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (x_new_selected_screen): This now takes a struct screen pointer as parameter. (XTread_socket): Call x_new_selected_screen *before* dumpborder. 1989-05-16 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (x_window_to_scrollbar): If the caller's not interested in the names--passing 0 for last two parameters--just return the screen pointer. * xterm.c (x_enter_screen): Added this function for warping the pointer into a screen. 1989-05-16 Chris Hanson (cph@kleph) * syntax.c (scan_lists, scan_sexps_forward): Treat characters whose "prefix" bit is on as whitespace when they are encountered between expressions. When they occur within expressions they are treated according to their syntax code. 1989-05-16 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (x_new_selected_screen): Don't call Fselect_screen. Just do everything here. * window.c (Fselect_window): If the screen associated with the window is not selected, warp the mouse, cause an EnterNotify event which then causes the proper screen to become selected. This does *not* call Fselect_screen. * screen.c (Fselect_screen): Now this is *only* a lisp subr. It just calls Fselect_window on the selected window of the screen. 1989-05-15 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * editfns.c (Fsubst_char_in_region): If NOUNDO, do increment tick, but maybe also increment save-tick. 1989-05-15 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (x_set_window_size): Only one #ifdef HAVE_X11 due to new macro in: * xterm.h: New macro XChangeWindowSize for both X10 and X11. * xfns.c (Fx_create_screen): Use XCreateWindow instead of XCreateSimpleWindow to directly set some extra attributes. 1989-05-14 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * syntax.h (SYNTAX_PREFIX): New macro. * syntax.c (Fmodify_syntax_table): Handle `p'; set new flag. (describe_syntax): Describe new flag. (Fbackward_prefix_chars): Move back over such chars. * lread.c (read1): Dumb errors in last change. 1989-05-13 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lread.c (read1): Error if EOF after `?' or in string. * sysdep.c (init_sys_modes) [IBMRTAIX]: Typo; had s for sg. 1989-05-12 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * s/s-usg5-3.h: Define HAVE_SYSVIPC? * alloc.c (Fmake_byte_code): If purifying, purecopy all elements. * ymakefile (LIBXMENU): Use -loldX. Find libXMenu11.a in special place. 1989-05-12 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c (Fx_create_screen): If user has specified `x-iconic-startup' then start emacs in iconic form. Look for icon position in `icon-left' and `icon-top', or use window postion. * xterm.c (x_term_init): If server doesn't respond, use fatal instead of error. Also tell user about -d option. 1989-05-10 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c (init_sys_modes, reset_sys_modes): Handle TIOCGLTC even if HAVE_TERMIO. * print.c (Qprint_escape_newlines): New variable. * minibuf.c (read_minibuf): Make it t locally in minibuffers. * fileio.c (Fcopy_file): Check for error on close. 1989-05-10 Joseph Arceneaux (jla@corn-chex.ai.mit.edu) * xfns.c (adjust_scrollbars): Don't subtract 2 from h_scrollbar_height when calculating `length'. 1989-05-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * eval.c (call_debugger): Set entering_debugger. (find_handler_cause): Don't enter debugger if that's set. (Fbacktrace): Clear it; we are presumably in the debugger. * m/m-sps7.h: New file. 1989-05-08 Joseph Arceneaux (jla@rice-chex.ai.mit.edu) * xterm.c (XTread_socket_hook): For X11, on map and unmap events check the window manager hints for iconification status. * xterm.c (x_make_widow_icon): For X11, just request iconification of the window manager. 1989-05-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m/m-clipper.h: New file. 1989-05-07 Joseph Arceneaux (jla@corn-chex.ai.mit.edu) * xfns.c (adjust_scrollbars): Don't subtract 2 from v_scrollbar_width when calculating `height'. * xfns.c (x_set_foreground, x_set_border_pixel): Finished color coordination. Scrollbar border, thump-arrows, and slider pixmap linked with foreground color; slider border with window border. 1989-05-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lread.c (read1): Handle octal integers. * macros.c: Doc fix. * search.c (Fstore_match_data): Allow ints instead of markers. * keyboard.c (get_char_menu_prompt): New function; does menu prompting based on current keymaps. 1989-05-05 Joseph Arceneaux (jla@gracilis.ai.mit.edu) * xfns.c (Fx_set_face): Rewrote the doc-string and renamed the parameters. 1989-05-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * unexec.c: New control parameters COFF_BSD_SYMBOLS, KEEP_OLD_PADDR, KEEP_OLD_TEXT_SCNPTR, ADJUST_TEXT_SCNHDR_SIZE, ADJUST_TEXTBASE, HEADER_INCL_IN_TEXT. * unexec.c: Define IN_UNEXEC as flag for config.h. * keymap.c: Fapropos, etc., deleted. (Now in Lisp code.) * eval.c (Fcommandp): Byte code object is command if interactive slot exists at all. 1989-05-05 Chris Hanson (cph@kleph) * process.c [HPUX && !NOMULTIPLEJOBS]: Include <bsdtty.h>, which defines TIOCGPGRP. 1989-05-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * data.c (Faref, Farray_length): Handle byte-code objects. * fns.c (Flength, concat): Likewise. * data.c (Faref, Faset, Farray_length): Rename arg VECTOR to ARRAY. * m/m-hp9000s300.h: Undefine NOMULTIPLEJOBS. * keyboard.c (Fcommand_execute): Treat bytecode object as function. * callint.c (Fcall_interactively): Separate decoding of fcn from handling of it. * alloc.c (Fmake_byte_code): Renamed from Fmake_compiled_code. Make it pure if Vpurify_flag is non-nil. (Fpurecopy): Handle byte-code objects. * keyboard.c (get_char): Use Fsit_for for echoing timeout, not alarm. Do this before timeout for auto-save since the latter is longer. (request_echo): Function deleted. ({set,clear}_waiting_for_input): No need for echo_now, echo_flag. 1989-05-04 Joseph Arceneaux (jla@gracilis.ai.mit.edu) * xterm.c (x_lower_window, x_raise_window): Don't do anything if the window isn't visible. * xfns.c (x_set_foreground_color): Recolor the scrollbar windows appropriately, compatible with xterm. * xterm.c (x_reset_cursor): Do cursor recoloring. 1989-05-04 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fns.c (Frandom): With number as arg, return value < that number. * sysdep.c [USG, BSD4_1] (random): Call `rand' twice, to get 30 bits of significance. 1989-05-03 Joe Arceneaux (jla@gracilis.ai.mit.edu) * xterm.c (x_draw_box): Use the cursor_gc. * xfns.c (x_set_cursor_color, x_create_screen): Do a better job with cursor colors, and use 0 line width for the cursor_gc. 1989-05-02 Richard Stallman (rms@sugar-bombs.ai.mit.edu) Begin changing representation of compiled functions. * lisp.h (enum Lisp_Type): New type code Lisp_Compiled, like a vector. (COMPILED_*): Names for slots in those vectors. * alloc.c (Fmake_compiled_code): New function. * eval.c (Fcommandp, Feval, Ffuncall, funcall_lambda): Handle fcns of type Lisp_Compiled. (Fcommandp, Fapply): Avoid directly nested ifs. * print.c (print): Handle Lisp_Compiled objects. * callint.c (Fcall_interactively): Likewise. * doc.c (Fdocumentation): Likewise. * keyboard.c (Fopen_dribble_file): nil as arg means close it. * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c: * casefiddle.c, cmds.c, data.c, dired.c, dispnew.c, doc.c, editfns.c: * eval.c, fileio.c, filelock.c, floatfns.c, fns.c, keyboard.c: * keymap.c, lread.c, minibuf.c, mocklisp.c, print.c, process.c: * screen.c, search.c, syntax.c, undo.c, vmsfns.c: Many doc fixes. 1989-04-30 Joseph Arceneaux (jla@hobbes) * xterm.c (XTring_bell): Wasn't passing selected_screen to XTflash. Fixed this. * xterm.c (XTread_socket): Don't check if server died under X11. Temporary. 1989-04-30 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fdelete_other_windows): Bug getting top edge. 1989-04-29 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keyboard.c (get_char): Auto save if enough time elapses. (auto_save_timeout): New Lisp variable. * xdisp.c (try_window, try_window_id): Set w->redo_mode_line if should show percentage instead of `Bot'. 1989-04-29 Joe Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c (x_term_init): Don't set visible bell, as it pre-empts .emacs control. 1989-04-26 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * doc.c (syms_of_doc): Make Vdoc_file_name a Lisp variable named internal-doc-file-name. 1989-04-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-news.h: m-news800.h renamed. Removed EXPLICIT_SIGN_EXTEND and COMPILER_REGISTER_BUG. Removed SEGMENT_MASK and sigmask. LOAD_AVE_TYPE is now `double'; LOAD_AVE_CVT changed too. Define m68000 if not defined. 1989-04-24 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * ymakefile: If COFF_ENCAPSULATE, define LD as gcc -nostdlib. * sysdep.c: Unconditionally include sys/ioctl.h. * m/m-mips.h [USG]: Define LIBS_TERMCAP. If HAVE_X11, define HAVE_VFORK. 1989-04-23 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m/m-altos.h: Use termcap, not terminfo. Define COFF_ENCAPSULATE if using gcc. Use built-in alloca if using gcc. Define PURESIZE. * lread.c (absolute_filename_p): On ALTOS, @ means absolute. * process.c: Missing #endif. * fileio.c (Finsert_file_contents): Define `p' for last change. * buffer.c, floatfns.c: Typos in DEFUN doc strings. * keyboard.c: Typo in DEFVAR_LISP doc string. * window.c (Fdelete_other_windows): Fix confusion about type of W. 1989-04-22 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * ymakefile (LDFLAGS): Forgot to use LD_SWITCH_SITE. * xterm.c (XTflash): Draw the bars here. (x_invert_screen): Change to invert entire window. (stufflines): Changed args to XClearArea. (XTread_socket): Clean up handling of KeyPress events. For LeaveWindow, ignore uninteresting ones and handle autolower. For FocusIn, ignore if unknown window, and handle autoraise. For MotionNotify, add real handling for X11. For ConfigureNotify, count width of scroll bars. Don't call change_screen_size redundantly; ignore linked expose events. Update left and top pos if nec. For button events, ignore if not in known window or scrollbar. (x_new_selected_screen): Takes screen as arg. (x_error_handler): Arg type different for X11. (x_set_window_size) [HAVE_X11]: Call change_screen_size before x_wm_set_size_hint. (x_make_window_visible): Make scroll bars visible too, if any. (x_lower_window): New fn. (x_wm_set_size_hint): Take account of width of scroll bars. Ior specified hint flags with those already set. * xterm.h (HSCROLL_HEIGHT): HSCROLL_WIDTH is renamed. (MAXWIDTH): Increased to 300. (MAXHEIGHT): Increased to 100. (DISPLAY_SCREEN_ARG): Remove parentheses. (ButtonReleased, WhichMouseButton): Delete definitions. * xmenu.c: Adapted to new X interface. X11ONLY replaced with xDISPLAY. Many X11 conditionals removed. * xfns.c (x_set_cursor_color): Special case if matches foreground. (Fx_create_screen): Typo for HSCROLL_HEIGHT. Use BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT. Set PRETEND arg to change_screen_size. Delete gray_bits; this value made global. Don't call install_*_scrollbar here. (x_set_horizontal_scrollbar): Define this for real. (x_set_vertical_scrollbar): Corrent args to install_vertical_scrollbar. (install_vertical_scrollbar): New local slider_pixmap, and set it. Delete locals GC_values, temp_gc. Change arrow_width, arrow_height (appears to be undefined) to 16. Un-if-0 this code. Use border_pixel, not foreground_pixel, for scrollbar. (install_horizontal_scrollbar): Define this for real. (adjust_scrollbars): Handle horizontal scrollbar. Define XMoveResizeWindow as XConfigureWindow if X10 to simplify. (x_resize_scrollbars): Remove #if 0 from quick-exit case. Really handle horizontal scrollbar. Simplify using new macro. (Fx_get_mouse_event): Mostly ignore events other than buttons. Use many new macros to handle X10 and X11. (encode_mouse_button): New fn: encoding of which button, broken out. * xfns.c (left_arror_cursor, etc.): New vars. (x_screen_parm, init_x_parm_symbols, x_set_screen_param): Define X_PARM_AUTOLOWER. * xdisp.c (display_string, redisplay-window, DoDsp): Use SCREEN_WIDTH, SCREEN_HEIGHT. 1989-04-21 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * indent.c (compute_motion): Use SCREEN_WIDTH. * dispnew.c (update_line): Use SCREEN_WIDTH. (update_screen): Use SCREEN_HEIGHT. 1989-04-20 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c: Rename Vauto_new_screen_hook, Vdisplay_buffer_hook, and Vtemp_buffer_show_hook to ..._function. * keyboard.c: Rename mouse_hook to mouse_event_function. * buffer.c, buffer.h, cmds.c: blink-paren-hook and auto-fill-hook renamed to -function. * fileio.c (Finsert_file_contents): Allow quit in read. (Fwrite_region): Allow quit in write. 1989-04-19 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * doprnt.c (doprnt): Comment out %b since sprintf can't do it. * Change X11 to HAVE_X11 everywhere. * m-sun3.h: Define C_SWITCH_MACHINE as -fsoft. 1989-04-18 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c: Don't define wstopsig, wtersig if already defined. * sysdep.c [VMS] (sys_getenv): Copy the string before returning it. * m-alliant.h: Define `vector'. 1989-04-13 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (wait_reading_process_input) [sun]: If SIGIO failed to be sent, send it by hand. 1989-04-12 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fdelete_other_windows): Recenter window to avoid scrolling. 1989-04-11 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * indent.c: Include screen.h. * indent.c (pos_tab_offset, Fvertical_motion): Compute internal width correctly and uniformly. * xdisp.c (try_window, try_window_id): Use exact internal width to update tab_offset. (try_window_id): pos_tab_offset value needs adjustment only if starting a line in middle of a character. 1989-04-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c [USG]: If TIOCGWINSZ defined, include sioctl.h. 1989-04-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * eval.c (Fbacktrace): Set Vprint_level to 3 throughout. * fns.c (Fload_average): nlist data structure is funny on convex. * window.c (scroll_command): Scroll at least 1 line in specd direction. * cm.c (calccost): NTABS was off by 1 sometimes; take account of the starting position modulo 8. * fileio.c (Fexpand_file_name): Don't simplify /../ at start of name. * callint.c: Doc fixes. * process.c (create_process): On all USG systems, not just IRIS and AIX, don't pre-open pty's tty. Move the setpgrp done for USG (no real change). Tell child_setup to do a setpgrp. * callproc.c (child_setup): New arg says whether to setpgrp. Never setpgrp on USG. (Fcall_process): Tell child_setup not to setpgrp. * sysdep.c (init_sys_modes, reset_sys_modes): Don't try to hack TIOCGLTC, TIOCGETC, etc. if HAVE_TERMIO. Don't bother to undef these for XENIX. 1989-04-03 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * ymakefile (LIBES): Put LIBX first; it may depend on LIBS_MACHINE. * m-sequent.h: Define HAVE_ALLOCA. 1989-04-02 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * term.c (term_init): Can't use scroll region if no abs positioning. 1989-04-01 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (Fopen_network_stream): Close desc. if connect fails. 1989-03-31 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * minibuf.c (Fall_completions): gcprotect ALLMATCHES and TAIL, not STRING. * keyboard.c (read_avail_input): Handle EBADSLT like EAGAIN. 1989-03-29 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * term.c (term_init): Either ic or ip or im or IC => can insert chars. * minibuf.c (read_minibuf_unwind): Ensure minibuf writable for erasure. 1989-02-23 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-convex.h: Undefine NO_ARG_ARRAY. Changed defns of DATA_SEG_BITS and XINT. Define alloca for GCC compilation. 1989-02-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m-ibmrt-aix.h: Define BROKEN_FIONREAD. 1989-02-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keymap.c (Fdefine_prefix_command): Set both value and fn defn, with separate syms specified for each purpose. 1989-02-15 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * callproc.c (Fcall_process): Open /dev/null with O_WRONLY. 1989-02-14 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (window_scroll): Allow scrolling to very end (empty screen) if that's exactly where we wanted to scroll to. 1989-02-11 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * data.c (Fkill_local_variable): New local to simplify big stmt. 1989-02-09 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * xdisp.c (display_text_line): cvt chars to glyfs for overlay arrow. * sysdep.c (init_sys_modes, child_setup_tty) [IBMRTAIX]: Don't ignore BRK, and don't signal it. * process.c (pty): An IBMRTAIX conditional. (create_process): Another here. 1989-02-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keymap.c (Fdefine_prefix_command): Use Ffset, not Fset. 1989-02-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c (Fset_visited_file_modtime): New fn. * xfns.c (Fx_create_screen) [X10]: XCreateWindow wants pixmaps as args. 1989-02-03 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c (Fsit_for): It accepts 3 args. 1989-02-02 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * xterm.c (XTread_socket): For X10, make EVENT an XKeyPressedEvent. (x_set_resize_hint): Call XSetResizeHint. * process.c: Declare interrupt_input. * sysdep.c (init_sys_modes): TIOCSTART, not TCSTART. 1989-01-28 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * xterm.h (struct x_display): `GC' renamed `gc' in all field names. Field `ColorMap' renamed to `color_map'. (face_gc_values): face_GC_values renamed. 1989-01-28 Joe Arceneaux (rms@sugar-bombs.ai.mit.edu) * xterm.h (face_GC): Var deleted. (struct x_display): New field face_GC. (VSCROLL_WIDTH, HSCROLL_WIDTH): Moved here. (MINWIDTH, MINHEIGHT, MAXWIDTH, MAXHEIGHT): New vars. Eliminate them! (BLACK_PIX_DEFAULT): Typo in definition. (WHITE_PIX_DEFAULT): Typos in definitions; was the black default. * xterm.c: Include ioctl.h only if BSD. Include termio.h otherwise. (XMapWindow) [X11]: Typo in definition. (METABIT): New definition; maybe not needed. (hostname, id_name, invocation_name, Vcommand_line_args): New vars declared for main icon title. (x_debug): Init to 1 if XDEBUG defined. (dumpglyfs) [X11]: Changed args to XDrawImageString. If debugging, do XFlushQueue. Use screen's face_gc rather than old global one. (XTflash) [not BSD]: Avoid `struct itimerval'; use `alarm'. (events): New table of event type names. (XTread_socket): EVENT is now an XEvent even on x10. Translate modifier key 1 into meta-bit. For EnterNotify event, don't dumpborder or x_new_selected_screen if there is an x_focus_screen. For LeaveNotify event, don't ignore due to nonzero subwindow. For ConfigureNotify, change screen size. Do `select' check for SIGHUP only if HAVE_SELECT. (x_new_selected_screen): An arg, SCREEN. (x_display_cursor): dumpglyfs args changed. (x_draw_box): Add GC arg to XDrawRectangle; change other args. (clear_cursor): Change args to XClearArea. (dumpborder): Check x_input_screen, not selected_screen. (x_text_icon): For X11, new arg to XGetDefault. Cast values stored in icon_label. (x_term_init): Hair to calculate name for icon. Don't init_sigio unless SIGIO defined. Call Fset_input_mode. For X11, new arg to XGetDefault. Set _Xdebug if debugging. (x_new_font) Use XGetFont. Get GC values from the screen structure. (x_reset_cursor): Don't call XRecolorCursor. (x_set_window_size): Call x_wm_set_size_hint, not x_set_size_hint. (x_set_resize_hint): For X11, call x_wm_set_size_hint. (x_wm_set_size_hint, x_wm_set_window_state, x_wm_set_icon_pixmap): (x_wm_set_icon_position): New fns for X11. * xfns.c: For X11, include Xutil.h (VSCROLL_WIDTH): Moved to xterm.h. (face_GC): Don't declare it. (id_name): Declare this. (x_decode_color): Check `white' and `black' first of all. (x_set_foreground_color) [X11]: Reset foreground and background. (x_set_background_color) [X11]: Missing arg to XSetWindowBackground. (x_set_cursor_color) [X11]: Reset foreground and background. (x_read_mouse_position) [X11]: Changed call to XQueryPointer. (x_set_mouse_position) [X11]: Add args to XWarpPointer. (Fx_create_screen): Set some temporary geometry parms at the beginning. For X11, changed setup of iconidentity, and implement rubber-banding. For X11, implement merging individual geometry parms. For X11, changed args to XCreateSimpleWindow. For X11, call x_wm_set_size_hint. Specify name when creating icon. Don't call XSetForeground, XSetBackground before making border tile. New var `cursor_bits'. Init the screen's GC's. * screen.c (Frubber_band_rectangle): For X11, just return nil. 1989-01-24 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * buffer.c (Fbuffer_modified_tick): New fn. * window.c (Fnext_window): Accept 3 args from Lisp. 1989-01-23 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c (sys_suspend): Handle case of SIGTSTP but not BSD. 1989-01-20 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c (init_sys_modes): Do TIOCSTART if def, like TCXONC. 1989-01-19 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (wait_reading_process_input): New 2nd arg is extra usecs. All callers changed. * dispnew.c (Fsit_for, Fsleep_for): New 2nd arg says 1st arg counts in milliseconds. * buffer.c (Fkill_all_local_variables): Implement permanent locals. 1989-01-18 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keymap.c (get_keyelt): Allow indirection within (STRING . DEFN). 1989-01-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (wait_reading_process_input): If select returns there is kbd input, but detect_input_pending can't find it, signal SIGIO. This may avoid the X loop-on-logout bug. * process.c (wait_reading_process_input): Flush fix_screen_hook. * termhooks.h, term.c: Likewise. * xdisp.c (Fredraw_display): Don't do set_terminal_modes. * dispnew.c (Fredraw_screen): Likewise. * eval.c (Fcond): If no args, return nil. 1989-01-15 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * eval.c (Fbacktrace_frame): Require one arg. Return nil if too high. 1989-01-14 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * minibuf.c (read_minibuf): Set Vminibuf_scroll_window before switching windows. * xterm.c (XTread_socket): If no HAVE_SELECT, wait for input if new arg WAITP is non0. Do this by not bothering to test for presence of input before reading some. Check for dead connection only if new arg EXPECTED is nonzero. All callers changed (keyboard and sysdep). * keyboard.c: Simplify keyboard input. (read_avail_input): Don't assume buffer is empty. Don't call get_input_pending; do FIONREAD here. Don't do FIONREAD if read_socket_hook, just tell it don't wait. Arg EXPECTED is passed to read_socket_hook. (input_available_signal): Use read_avail_input. (gobble_input): Use read_avail_input; arg EXPECTED passed along. (get_input_pending): Let gobble_input do the work. VMS keyboard input should have interrupt_input nonzero. * keyboard.c (Fset_input_mode, init_keyboard): [VMS] Always set interrupt_input to 1. (get_input_pending): Special case deleted. 1989-01-13 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c (auto_save_1): Always make auto-save file owner-writable. * eval.c (Fbacktrace_frame): New fn. * buffer.h: Define `fieldlist' field in a buffer. * buffer.c (Fregion_fields): Return list of fields overlapping specified region. (syms_of_buffer): New variable buffer-field-list. (reset_buffer): Clear the fieldlist. (init_buffer_once): Set up default and flag for buffer-field-list. * insdel.c (prepare_to_modify_buffer): If check_protected_fields, call Fregion_fields to detect error. Delete buffer_modify_hook. * callint.c (Fcall_interactively): Bind `command-debug-status' for each interactive command. * keyboard.c (command_loop_1): Count # commands read. (num_input_keys): New Lisp variable. * m/m-gould.h, m/m-ibmrt-aix.h, m/m-sequent.h, m/m-sparc.h, * m/m-sun3.h, m/m-symmetry.h: Define A_TEXT_SEEK. * unexec.c (copy_text_and_data): Don't check A_TEXT_OFFSET, just A_TEXT_SEEK. * unexconvex.c: Likewise. * unexconvex.c: machine/*.h unconditionally. * process.c (pty): Delete RTU, HPUX, IRIS alternatives to PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF. * s/s-hpux.h: Define PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF. * s/s-rtu.h: Likewise. * s/s-iris*.h: Define PTY_TTY_NAME_SPRINTF. * sunfns.c (Fsun_change_cursor_icon): Avoid ambiguity in eval order. 1989-01-12 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * data.c (Fdefault_value): If var set up with default value as current, take the current value slot, more up to date than the default slot. 1989-01-11 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c (init_display): Don't handle SIGWINCH if using X. * fileio.c (Fdo_auto_save): If file has shrunk, turn off auto-save. This avoids duplicate messages and allows M-x auto-save to turn it on. * lread.c (Fload): Look in Vafter_load_alist. (syms_of_load): Define after-load-alist. 1989-01-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dired.c (Fdirectory_files): 4th arg NOSORT non-nil means don't sort. * syntax.c (scan_lists): Change Sendcomment case so that ignoring comments works even for newline-terminated comments. * minibuf.c (read_minibuf): Default Vminibuf_scroll_window to the window that was selected. 1989-01-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fns.c (do_yes_or_no_p): Typo, call2 => call1. * eval.c (Fbacktrace): Each frame item should have a newline. * emacs.c (Fkill_emacs): Don't run hook if noninteractive. * eval.c: Define Vrun_hooks. (syms_of_eval): Initialize Vrun_hooks. * indent.c (Fmove_to_column): Use del_range; Fdelete_backward non ex. * ymakefile (objs, floatfns.o): Re-add this file. (LIBX): Install X11 case. * ymakefile (LIB_GCC): Now a cpp macro, like all other LIB_... Define null if not using GCC. * lread.c (unreadchar): New function to unread a char by stuffing it back into its stream. Now unread chars work properly between multiple reads. (UNREAD): Now calls that function. (readchar): Don't us `unrch'; variable deleted. (various): Don't initialize `unrch'. (readevalloop): No need to save and restore `unrch'. (read1): Don't unread a -1. * keymap.c (get_keyelt): If keymap defn is (STRING . FOO), remove just FOO. Will help HierarKey. 1989-01-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * unexmips.c [IRIS_4D]: Don't include fcntl.h. (unexec): Look for LIT8, LIT4 sections iff they are defined. * buffer.c (Fkill_all_local_variables): Force redisplay of mode lines. 1989-01-02 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * emacs.c (main): Do the setpgrp before handling -t. * keyboard.c (Fsuspend_emacs): Use run-hooks to run suspend-hook and suspend-resume-hook. * buffer.c (Fkill_buffer): Execute kill-buffer-hooks with buffer to be killed as current buffer. * buffer.c (count_modified_buffers): ModExist renamed. * emacs.c (Fkill-emacs): Execute kill-emacs-hook. * fileio.c (auto_save_1): Set auto_save_mode_bits from visited file. (Fwrite_region) [not VMS]: If auto-saving, write file with that mode. * fileio.c (Fwrite_region): If START is a string, write that string. 1989-01-01 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lisp.h (XMARKBIT, XSETMARKBIT): If mark bit is sign bit, use sign-test for XMARKBIT; value is then 1 or 0. Make XSETMARKBIT test 2nd arg for nonzeroness only. * m/m-mips.h: Last batch of changes are only for USG. (XMARKBIT, XSETMARKBIT): Deleted; the new default ones are good. * editfns.c (Fformat): Use princ for %s. New format %S converts everything (even strings) with prin1. * doprnt.c (doprnt): Treat %s like %S. * print.c (Fprin1_to_string): Opt 3nd arg non-nil does princ. 1988-12-31 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * data.c (Fstring_to_int): Correct max # args. 1988-12-30 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * ymakefile (LIBES, LIB_GCC): If using GCC, link with gnulib. 1988-12-29 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * editfns.c: Many doc improvements. 1988-12-28 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lisp.h (CHECK_NATNUM): New macro. * indent.c (Fmove_to_column): 2nd arg t means indent till spec'd column or change tab to spaces if necessary. * m/m-iris4d.h: (Conditionally) delete DEFAULT_ENTRY_ADDRESS and change START_FILES and LIB_STANDARD. * s/s-iris3-6.h: Define sigblock as no-op. * m/m-mips.h: Cancel defn of VIRT_ADDR_VARIES, `static'. Undef SIGIO. Define BROKEN_FIONREAD. Define various HAVE_... flags a la BSD. Add options, libraries for linking and compilation. * unexmips.c (unexec): Handle additional optional sections now likely. New scheme for recording what sections there are. Make handling of the LIT8,LIT4 sections conditional (not on IRIS). * fns.c (do_yes_or_no_p): New interface to Lisp function yes-or-no-p. Allows the user to redefine that function. All callers of Fyes_or_no_p changed. * data.c (Fmakunbound): Don't allow nil or t as arg. * m/m-orion105.h (LOAD_AVE_TYPE): Now `long'. 1988-12-27 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c (unhold_window_change): Don't signal SIGWINCH. Instead, do pending size-changes here, while holding any new size-changes that arrive, so they become pending. Loop around to get the new pending ones. (change_screen_size): Clear any previous pending size-change. * search.c (place): Was clipping to (1- (point-max)) by mistake. 1988-12-24 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fdelete_window): Give all this window's space to one adjacent sibling. 1988-12-23 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keymap.c (describe_alist): Don't lose on non-cons-cell alist elts. (Fwhere_is_internal): Don't fail to step down the alist. (Faccessible_keymaps): Considerable confusion in alist case. * lread.c (Feval_current_buffer, Feval_region): Save and restore point as a marker, not a number. Don't restore it at all if printflag is t. * print.c (float_to_string): Mostly rewritten; output format is now a printf %-spec. (Qfloat_output_format): Doc changed to match. 1988-12-22 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * ymakefile (obj): Include floatfns.o. * data.c (syms_of_data): Fix typo Snumberp_or_marker_p. Allow keymaps to have other keymaps as tails. Thus, one keymap can inherit from another. * keymap.c (Fwhere_is_internal): Ignore non-cons elements of alist. (Faccessible_keymaps): Support symbols as alist indices. Ignore alist elements that aren't conses. * m/m-sun386.h (LDAV_SYMBOL): Define as "avenrun" with no underscore. * lread.c (read_escape): Support ANSI C `\x...' hex escapes. * bytecode.c (Fbyte_code): Fix jump operators for change in `pc'. 1988-12-21 Joe Arceneaux (jla@gracilis.ai.mit.edu) * ymakefile: Commented #endif LISP_FLOAT_TYPE. Also changed the code pertaining to X11 to use the same files as X10. * bytecode.c (Fbyte_code): Declared unsigned char *pc. 1988-12-19 Joe Arceneaux (jla@apple-gunkies.ai.mit.edu) * xterm.c: Finished a first cut of the X11 version. 1988-12-18 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * sysdep.c (select): `buf' is now unsigned char. 1988-12-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m/m-elxsi.h: Don't define WORD_MACHINE or CANNOT_DUMP. Do define symbols for load average. Define COFF and ADJUST_EXEC_HEADER. 1988-12-16 Joe Arceneaux (jla@apple-gunkies.ai.mit.edu) * sink.h, sinkmask.h: Same file now works for both X10 and X11. * xterm.c, xfns.c (x_text_icon) Can now take new name as parameter. 1988-12-16 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m/m-is386.h: No need to undef HAVE_PTYS, HAVE_SOCKETS, SYSV_PTYS since s-usg5-3.h no longer defines them. 1988-12-14 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * bytecode.el (Fbyte_code): Cache the pointer in the string to avoid recalculating it at each fetch. Also turn off the error check for stack overflow/underflow. 1988-12-14 Joe Arceneaux (jla@apple-gunkies.ai.mit.edu) * xfns.c: Made the first cut for X11 version. * xterm.c (x_reset_cursor): Did the X11 version. 1988-12-14 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keyboard.c (Fexecute_mouse_event): Set Vmouse_event. Doc fix. Run Vmouse_hook at the end. (syms_of_keyboard): Define var `mouse-hook'. 1988-12-13 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * term.c (insert_glyfs): Typo, was fetching G twice. 1988-12-10 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keymap.c (describe_buffer_bindings): Print mouse bindings too. (describe_map): If have a chartab, use mouse-describe-key for prefixes. * keymap.c (describe_{map,map_tree,alist}, describe_vector): Extra arg mapping chars to their names. Calls changed. * syntax.c (describe_syntax_1): Call changed. * keymap.c (Vglobal_mouse_map): Make it exist unconditionally. * keymap.c (apropos1): Clean up. Do where-is-internal only if there is a function definition. Use mouse-describe-key to turn mouse key sequences into strings. (Fwhere_is): Check the mouse map too; (Fwhere_is_internal): New arg is global map to use. All callers changed in keypad.c and doc.c. (where_is_string): New fn cvts result of Fwhere_is_internal to string. 1988-12-09 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * emacs.c (stack_bottom): New variable, set in main. * alloc.c (Fgarbage_collect): Save a copy of the entire stack contents. 1988-12-07 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * editfns.c (Funix_umask, Funix_sync): New functions. * process.c (Fsignal_process): New function. 1988-12-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * editfns.c (Fsubst_char_in_region): Fix typo in when to un-modify buf. 1988-12-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (create_process): Take the usg's setpgrp and the close-and -open of the tty outside the TIOCNOTTY conditional, since TIOCNOTTY is always missing outside BSD. Now the TIOCNOTTY conditional controls only the TIOCNOTTY. 1988-12-04 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * lread.c (Feval_current_buffer, Feval_region): If there is an error, don't restore original point. * s-hpux.h (SHORT_CAST_BUG): Define this, for HPUX version 6.2. * ymakefile (THIS_IS_YMAKEFILE): Define macro to tell m- files to do special things. * m/m-ns16000.h (LOAD_AVE_TYPE, etc.): Don't define them if USG. * m/m-ns16000.h [USG]: Define various macros differently. (munnari!sibyl.eleceng.ua.oz.au!ian@uunet.uu.net). * sysdep.c (reset_sys_modes): Don't output a CR here. * term.c (reset_terminal_modes): Do it here, but first do a newline if it's a magic cookie terminal. * sysdep.c (sys_suspend) [USG]: Use `nice' to set subshell pri. to 0. * sysdep.c (TIOCSETN) [USG]: Use TCSETAW, not TCSETA. * sysdep.c (setpriority) [USG]: No longer a no-op; use `nice'. * keymap.c (Fwhere_is_internal): New 4th arg inhibits looking thru indirect definitions--so you can search for one. * alloc.c, fns.c, search.c: Doc fix. 1988-12-01 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * process.c (read_process_output): Insert with insert_before_markers. * filelock.c (lock_file_1, lock_superlock): If USG, use chmod instead of fchmod. * environ.c (Fsetenv): Doc fix. 1988-11-25 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * eval.c (do_autoload): Verify FUNNAME is a symbol. 1988-11-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * fileio.c (Fread_file_name): New arg specifies initial minibuf cntnts. * callint.c (Fcall_interactively): Calls changed. 1988-10-08 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * insdel.c (make_gap): Error if buffer size exceeds range of Lisp int. 1988-10-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fsplit_window): Prevent error in Fset_window_buffer. * sysdep.c (gettimeofday): Store -1 thru tzp so caller knows invalid. * xdisp.c (message): Pass 0 as new arg to doprnt. * callint.c (Fcall_interactively): Likewise. * editfns.c (format1): * doprnt.c (doprnt): Allow 0 as FORMAT_END arg meaning null-terminated. 1988-10-05 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * keyboard.c: If UNIPLUS, include ioctl.h. * sysdep.c (utime): Use new flag IRIS_UTIME, not IRIS. * s-iris*.h: Define that flag. 1988-10-04 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * term.c (term_init): If have `im' capability, permit ins/del char even without `ic'. 1988-10-03 Richard Stallman (rms@corn-chex.ai.mit.edu) * m/m-hp9000s300.h: Conditionals for BSD vs HPUX. * ymakefile: Look for C_SWITCH_SITE, LD_SWITCH_SITE. 1988-09-30 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * editfns.c (Fformat): Allow nulls in the format. * doprnt.c (doprnt): Likewise. End of format string is new arg. 1988-09-28 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * m/m-7300.h: Undefine SHORTNAMES. Supposedly newer Unix now. * print.c (print): Support new var print_length. (syms_of_print): Define Lisp var print-length. * eval.c (Fbacktrace): Print unevalled form with print_length = 3. * Makefile (tags): Add TAGS as alternate target. Process the files in ../lisp/term. 1988-09-27 Richard Stallman (rms@corn-chex.ai.mit.edu) * doprnt.c (doprnt): Handle %-20s. * editfns.c (Fformat): Likewise (make enough space for it). * minibuf.c (do_completion): If get "Complete but not unique" twice in a row, display all completions. New var last_exact_completion. 1988-09-26 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * dispnew.c (baud_rate): Now a Lisp variable, not a function. * termcap.c (tputs) [emacs]: Use baud_rate as the speed. 1988-09-19 Richard Stallman (rms@gluteus.ai.mit.edu) * window.c (Fset_window_configuration): Set deleted windows' buffer to nil, via new function delete_all_subwindows. * window.c (Fset_window_buffer): Reject deleted windows. * window.c (init_window_once): Init the ->buffer fields to satisfy error check in Fset_window_buffer. * xmenu.c (Fx_popup_menu): 1st arg is now ((X Y) WINDOW). * process.c (child_sig): If synch process terminates, clear synch_process_pid and record synch_process_death. * callproc.c (Fcall_process): Return synch_process_death. Always set synch_process_pid and do it with SIGCHLD masked off. * sysdep.c (wait_for_termination) [subprocesses and not VMS]: Use alarms to check every second whether synch_process_pid is 0. 1988-09-17 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * xdisp.c (redisplay_window): If window-point is outside restriction then correct it in the window. * window.c (Fdelete_buffer): Don't change buffer's point to a value outside its restriction. * sysdep.c (init_sys_modes) [MULTI_SCREEN]: Set Vterminal_screen's garbaged bit. 1988-09-16 Richard Stallman (rms@corn-chex.ai.mit.edu) * keyboard.c (kbd_buffer_get_char): VMS now uses same code as Unix. * vmsproc.c: New file for VMS only. * callproc.c [VMS]: Omit Fcall_process and child_setup_tty. * emacs.c (main) [VMS]: Call init_vmsproc and syms_of_vmsproc. * lread.c (OBARRAY_SIZE): Change slightly to 509 (prime). * keyboard.c, dispnew.c, term.c, xterm.c (meta_flag): MetaFlag renamed. * keyboard.c (Fset_input_mode): 3rd arg sets meta_flag. (syms_of_keyboard): Variable meta-flag deleted. * sysdep.c (init_sys_modes): Don't override parity settings if meta_flag is 0. 1988-09-15 Richard Stallman (rms@corn-chex.ai.mit.edu) * search.c (Fsearch_forward, etc.): All buffer-search functions return new the value of point if they succeed. 1988-09-13 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * cmds.c (Fnewline): Correct test of ARG1 to inhibit auto-fill. 1988-09-12 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * window.c (Fdelete_window): Put nil as buffer of the deleted window. This makes select-window get an error earlier. 1988-09-06 Richard Stallman (rms@sugar-bombs.ai.mit.edu) * search.c (search_buffer, string_match, looking_at): Report matcher stack overflow as error, not just failure to match. * data.c (Fmake_local_variable): Add local variable to simplify too-complex expression. * fileio.c (Fdo_auto_save): No "file has shrunk" msg if < 5000 chars. See ChangeLog.2 for earlier changes. Copyright (C): 136a8e5c-4f83-403b-9132-874f1c47f8a9 | http://opensource.apple.com/source/emacs/emacs-88.1/emacs/src/ChangeLog.3 | CC-MAIN-2016-30 | refinedweb | 81,539 | 54.79 |
in reply to
Variable Variables
Doing something like this is bad practice, for a variety of
reasons. Mostly because if someone adds a form field that
you did not prepare for, it might affect a different part
of the script. For example, if someone added a form field
called "key" your script would die because it would try to
set $key to the form value, which is also the
loop iterator.
If you want to avoid calling $query->param()
each and every time you want to access the form values,
and I sympathize, you should try something like this:
use strict;
use CGI;
my $query = new CGI; # this will import the form values
my %vars = $query->Vars(); # this will "export" the form values
print "Name: ", $vars{name}, "\n";
[download]
...et cetera. See the CGI.pm manpage for more info
about the Vars syntax.
'kaboo
I also like the $query->Vars(); suggestion. never seen that before. cool :-)
I understand what you're saying... he only creates the
variables in the list he defines for the foreach loop. I
guess what I was trying to imply was that whomever edits
the form and adds a field is going to have to come into
the CGI script and modify that too, creating the situation
I described. =) You would hope the programmer in question
would realize their folly and change the formfield name so
that it wouldn't break the script, but never forget
O'Toole's postulate: Murphy was an optimist.
There's also import_names(), which takes an argument of a namespace (anything but main:: ;) to import parameters into, so that you can say $namespace::var instead of param('var') or $cgi->param('var').
use CGI qw/import_names/;
import_names('X');
print $X::hello;
[download]
Another case of TMTOWTDI. :)))
--k.
my %args = ();
# get cgi parameters into a hash. preserve multi-valued
# parms
for my $p ( $cg->param() )
{
my @tmp = $cg->param($p);
if ( scalar @tmp == 1 ) { $args{$p} = $tmp[0] }
else { $args{$p} = [ @tmp ] }
}
[download]
Before coming here, and before CGI.pm matured, I was a
notorious advocate of
cgi-lib.pl. As a matter of fact, part of the reason that the Vars method in CGI.pm was added was to facilitate the transition of cgi-lib.pl users over to CGI.pm. In cgi-lib.pl you would do something like this:
require "cgi-lib.pl";
&ReadParse(*input); # store form values in the glob "input"
print &PrintHeader; # print HTML header
print "Name: ", $input{name}, "<br>\n";
[download]
This was very nice syntax and worked well for me for many moons. =) When the form parser would encounter multiple values for a single field name, it would string them together with the NUL character (by default), so you could do this:
print "First value: ", $input{valueList}, "<br>\n";
print "All values: ",
join("<br>\n", split(/\0/, $input{valueList}));
[download]
And it would do exactly what you'd expect it to do. Neat, huh? Well, conveniently enough, CGI.pm inherited this behaviour. But don't take my word for it:
#!/usr/bin/perl -w
# /~alakaboo/cgi-perl/multi.pl
use strict;
use CGI;
my $q = new CGI;
my %v = $q->Vars();
print $q->header('text/plain');
{
local $" = "\n";
my @tmp = split /\0/, $v{ar};
print "@tmp";
}
[download]
Yes
No
A crypto-what?
Results (167 votes),
past polls | http://www.perlmonks.org/index.pl?node_id=44927 | CC-MAIN-2014-10 | refinedweb | 552 | 71.14 |
JPA @Basic Annotation
Last modified: May 10, 2019
1. Overview
In this quick tutorial, we'll explore the JPA @Basic annotation. We'll also discuss the difference between @Basic and @Column JPA annotations.
2. Basic Types
JPA support various Java data types as persistable fields of an entity, often known as the basic types.
A basic type maps directly to a column in the database. These include Java primitives and their wrapper classes, String, java.math.BigInteger and java.math.BigDecimal, various available date-time classes, enums, and any other type that implements java.io.Serializable.
Hibernate, like any other ORM vendor, maintains a registry of basic types and uses it to resolve a column's specific org.hibernate.type.Type.
3. @Basic Annotation
We can use the @Basic annotation to mark a basic type property:
@Entity public class Course { @Basic @Id private int id; @Basic private String name; ... }
In other words, the @Basic annotation on a field or a property signifies that it's a basic type and Hibernate should use the standard mapping for its persistence.
Note that it's an optional annotation. And so, we can rewrite our Course entity as:
@Entity public class Course { @Id private int id; private String name; ... }
When we don't specify the @Basic annotation for a basic type attribute, it is implicitly assumed, and the default values of this annotation apply.
4. Why Use @Basic Annotation?
The @Basic annotation has two attributes, optional and fetch. Let's take a closer look at each one.
The optional attribute is a boolean parameter that defines whether the marked field or property allows null. It defaults to true. So, if the field is not a primitive type, the underlying column is assumed to be nullable by default.
The fetch attribute accepts a member of the enumeration Fetch, which specifies whether the marked field or property should be lazily loaded or eagerly fetched. It defaults to FetchType.EAGER, but we can permit lazy loading by setting it to FetchType.LAZY.
Lazy loading will only make sense when we have a large Serializable object mapped as a basic type, as in that case, the field access cost can be significant.
We have a detailed tutorial covering Eager/Lazy loading in Hibernate that takes a deeper dive into the topic.
Now, let's say don't want to allow nulls for our Course‘s name and want to lazily load that property as well. Then, we'll define our Course entity as:
@Entity public class Course { @Id private int id; @Basic(optional = false, fetch = FetchType.LAZY) private String name; ... }
We should explicitly use the @Basic annotation when willing to deviate from the default values of optional and fetch parameters. We can specify either one or both of these attributes, depending on our needs.
5. JPA @Basic vs @Column
Let's look at the differences between @Basic and @Column annotations:
- Attributes of the @Basic annotation are applied to JPA entities, whereas the attributes of @Column are applied to the database columns
- @Basic annotation's optional attribute defines whether the entity field can be null or not; on the other hand, @Column annotation's nullable attribute specifies whether the corresponding database column can be null
- We can use @Basic to indicate that a field should be lazily loaded
- The @Column annotation allows us to specify the name of the mapped database column
6. Conclusion
In this article, we learned when and how to use JPA's @Basic annotation. We also talked about how it differs from the @Column annotation.
As usual, code examples are available over on Github. | https://www.baeldung.com/jpa-basic-annotation | CC-MAIN-2021-43 | refinedweb | 599 | 54.52 |
.
Activity
Every time I tried to make the output more unambiguous, I ended up with a more complex output that still at times proved ambiguous in practice. For example, if you decide to render strings in a special way, then what about strings contained in a collection? What about strings contained in some custom type? And what about strings containing quotes? In the end I decided to start out simple and see how it goes. If one keeps in mind that power asserts just print a (Groovy) string representation of the values, it's not too difficult to make sense of outputs like the one above (and refine the assertion).
Printing the values' types is an interesting idea, but would add a lot of noise for unambiguous cases (which are far more frequent). We could try to be clever and only add type information for equality comparisons where the string representations of both sides are identical, but that's beyond the scope of the current power assert implementation.
The most frequent ambiguity that I've seen in practice is string vs. number (like above). So maybe we should finally try to introduce literal syntax here and there, possibly also for collections (since Groovy already supports it). More opinions are welcome.
Any opinions on how to proceed with this issue? Would you like to see literal syntax used in power asserts (e.g. "2067" instead of 2067)?
I vote for "2067".
def j = "5" assert 5 == j Assertion failed: assert 5 == j | | | "5" false
I would leave it the way it is if the two toString() values are different, and add type information if the two toString()s are the same. The String example is just one case. This happens a lot more when equals() is not implemented.
> I would leave it the way it is if the two toString() values are different, and add type information if the two toString()s are the same.
Since we don't have any structural information about the assertion at runtime (e.g. we can't tell it's a == comparison), all we could do is to add type information whenever two of the values have the same toString() representation. This would again mean lots of noise.
changed fix version
Peter, I think you mentioned it somewhere already... why again did you not mark Strings especially again? | http://jira.codehaus.org/browse/GROOVY-4520?focusedCommentId=246024&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel | CC-MAIN-2014-15 | refinedweb | 393 | 72.87 |
Reverse.
Surveying the battlefield
As usual, I start by just loading the game into Il2CppInspector to see what happens:
The supplied metadata file is not valid.
This error means the
global-metadata.dat file doesn’t have the expected form. Specifically it starts with the magic bytes (signature)
AF 1B B1 FA followed by a 32-bit integer containing the IL2CPP version number (at the time of writing, a value from
0F-1B). This is followed up by a long list of offset/length pairs demarcating the various metadata tables in the file – learn more in this article about IL2CPP’s load process.
Here is an example of the start of
global-metadata.dat from an empty project:
Note that an “empty” Unity project still includes a pile of DLLs like
mscorlib.dll,
UnityEngine.dll and so on so it’s not really empty at all. The header ends at offset
0x110 and this is location is also the start of the first table.
global-metadata.dat for Honkai Impact 4.3 (PC version):
Ouch, this doesn’t look very appetizing. At a casual glance it just looks encrypted or compressed, but there are actually some nuggets of data in here.
Bytes
0x00-0x3F don’t make any obvious sense, and neither do the bytes from
0x158 onwards, but at least some of the data from
0x40-0x157 seems to mean something. We can surmise this both from the fact there is a smattering of zeroes (low-entropy data), and that it at least vaguely resembles the metadata header from the empty project. The areas around
0x60-0x6F,
0xD8-0xDF,
0xF0-0xF7,
0x100-0x10F and
0x140-0x14F seem garbled, but the rest does seem like a set of file offsets and lengths.
You essentially have to determine this by carefully reading all the hex values by eye. Values are stored little-endian, meaning that the first byte of a value is the least significant byte (LSB) (bits 0-7), and the final byte is the most significant (MSB) (bits 24-31 in the case of 32-bit values). Given that the file is
0x0353C7DC bytes long, we can try to verify that these suspected offset/length pairs do actually make sense. The final pointer at offset
0x150 is to offset
0x033AFECC, with a length specified at offset
0x154 as
0x00188908 bytes. This means the block pointed to ends at
0x035387D4, which is indeed inside the bounds of the file.
Let’s continue our investigation by scrolling down the file to see if the whole thing is encrypted or if there is anything else in plaintext. There is a large block of garbled data starting around offset
0x158, and then around
0x14647C-0x146480, it ends and we start to see normal metadata tables again:
Scrolling further, the rest of the file appears to contain normal data, except for one curious repeating pattern:
Every so often, there is a block of
0x40 garbled bytes in the middle of other data. After skipping around the file some more, we determine this happens like clockwork every
0x353C0 bytes.
We can determine from the offset/length lists in the header that these are not separate data structures, but embedded within valid lists. Therefore we can assume we’re looking at encryption. We can rule out trivial schemes like single-byte XOR because the encrypted blocks are high entropy (the distribution of values in the blocks is statistically even; see entropic security), so we are probably looking at strong encryption or a one-time pad (OTP) – the latter could potentially be a XOR blob (a block of random bytes to be XORed with the encrypted data to decrypt it).
Is there an OTP key hiding in the file somewhere? Looking at the second screenshot above, we might surmise (looking at the right hand three bytes on each of the four encrypted lines) that a XOR blob would contain sequential values
1E AE BE,
51 6D AD,
58 7A 03 and so on. We search for other occurrences of these in the file but come up blank.
The encryption may not be a XOR blob, or the XOR blob may be stored in the binary or an asset file, or the XOR blob may be obfuscated. On this occasion we come up empty-handed, but it’s important to exclude obvious potentially easy paths before we get our hands dirty analyzing assembly code, as it could save us a lot of time. We’re out of luck in this case though.
How far back in the file does this periodic block encryption go? The first encrypted offset we found is
0x174A40 (first of the two screenshots above), the block gap is
0x353C0 bytes. These two are exactly divisible with no remainder, therefore it’s plausible to imagine the first encrypted block starts at
0x0 – ie. the very first byte in the file. This also lines up with our earlier observation that bytes
0x00-0x3F are probably encrypted.
Let’s finish our analysis of the metadata by assessing the file’s coverage. In a normal
global-metadata.dat, every byte is accounted for: that is to say, every single byte in the file is part of a header or table – there is no extraneous data. We do this by taking all of the offset/length pairs in the header and merging them together to map out all of the used regions in the file, then seeing if there is anything left over.
Why do we do this? Well, because hiding data in files is extremely common. In PE files (Windows
exes and
dlls), a highly common technique is to set the image size in the header to a value smaller than the true length of the file, and then add additional hidden data at the end. This data could be secret code, decryption keys or anything else.
In this case, we are aware that some of the offsets and lengths may be encrypted, but we work with what we’ve got anyway:
1C7AA8 + 1BE4E4 = 385F8C 385F8C + 4E4A8 = 3D4434 3D4434 + 382CD8 = 75710C 75710C + 9040 = 76014C (16 bytes of unknown data) 76014C + 10C0 = 76120C 76120C + 2398 = 7635A4 7635A4 + 3F7E50 = B5B3F4 B5B3F4 + 6F50 = B62344 B62344 + CEA58 = C30D9C C30D9C + 25044 = C55DE0 C55DE0 + 994 = C56774 C56774 + A0B60 = CF72D4 CF72D4 + 56BB8 = D4DE8C D4DE8C + 99E8 = D57874 D57874 + 7490 = D5ED04 D5ED04 + B84 = D5F888 (8 bytes of unknown data) 15C0D8C + 3B4AA0 = 197582C 197582C + 74C = 1975F78 (8 bytes of unknown data) 1975F78 + 5C5238 = 1F3B1B0 (16 bytes of unknown data) 1F3B1B0 + 13F8 = 1F3C5A8 1F3C5A8 + 1DA4 = 1F3E34C 1F3E34C + 139200 = 207754C 207754C + 11B9A00 = 3230F4C 3230F4C + 15294 = 32461E0 32461E0 + 169CEC = 33AFECC (16 bytes of unknown data) 33AFECC + 188908 = 35387D4
This is a breakdown of the data from
0x40-0x158.
The bytes at
0x158-0x1C7AA8,
0xD5F888-0x15C0D8C and
0x35387D4-0x3538CDC (the end of the file) are unaccounted for. We navigate to each of these offsets to see if there is anything of interest.
0x158-0x146480 contain probably encrypted data as mentioned earlier.
0x146480-0x1A7238 appear to contain a single table (we know this because it consists of a long sequence of what appears to be offsets and lengths, in ascending order).
0x1A7238-0x1AC558 contain another similar table, and so on. These look like normal metadata tables.
0xD5F888-0x15C0D8C contains the .NET symbol table (we know this because the data in this block is just human-readable strings). The most interesting block is probably the end of the file – a pointer to itself (the offset at
0x35387D4 contains the value
0x35387D4), four zeroes and then precisely
0x4000 of high entropy data – this may be encrypted data, or a decryption blob.
I haven’t included screenshots of everything here, but if your eyes are glazing over at all of these numbers right now, that’s perfectly okay: the best way to follow all of this is simply to open the metadata file into a hex editor and explore these file offsets for yourself. There is no special magic in how I determined these table boundaries: it is all determined by eye, by looking carefully and methodically for obvious patterns in the data to indicate groups of related data together in one place, and sudden changes in the data to indicate the boundaries between different kinds of data.
Let us now take a breath, step back and summarize what we’ve learned so far:
- There are
0x40-byte blocks of unknown encryption every
0x353C0bytes, starting most likely from the beginning of the file
- There are some unknown pieces of data in the file header
- A normal metadata header for this version of IL2CPP is
0x110bytes. The header here appears to be
0x158bytes long. The total amount of unknown data in the header is
0x40bytes. This leaves a question mark over another 8 bytes.
- There are three blocks of data that are unaccounted for. One contains various metadata tables and may be accounted for when we decrypt the first
0x40bytes of the header. The second contains the string table. The third contains unknown data with a precise size of
0x4000bytes.
Whether or not this information will actually be useful down the line is another question. As it turns out, some of it is and some of it isn’t. The key takeaway here is to just take a little bit of time to perform a superficial analysis of the data by eye and see what patterns can be spotted. Often, this insight is enough to determine a strategy to decrypt a file on its own, but in this case we’re going to need to step up our game.
Fun fact: In 2017, small indie game company Blizzard Entertainment encrypted one of its game’s main DLLs by using the standard Blowfish algorithm with the maximum 448-bit key size, and appending the key to the end of the DLL file. Variations on this kind of technique are a timeless classic – be aware of it!
To the trenches!
Clearly, we need to find out how to decrypt the metadata file. To do this, we first need to find out where in the code the decryption occurs. There are various ways of doing this, and you can certainly just trace the binary using static analysis in a disassembler, but there is an easier way.
ProcMon is an excellent piece of software to have in your arsenal. It allows you to – among other things – capture Windows API calls occurring in a target process and produce a stack trace from the call site. We’ll use this to find out where in Honkai Impact
global-metadata.dat is accessed and then examine the code.
When ProcMon first loads, you’ll want to clear the default filters and create a new filter as follows:
This instructs ProcMon to capture all file accesses to
global-metadata.dat coming from
BH3.exe, which is Honkai Impact’s root process. Open
C:\Program Files\Honkai Impact 3rd\Games in file explorer, double-click on
BH3.exe, wait for the epilepsy seizure warning to appear then press Alt+F4 to kill the process. In ProcMon, you’ll see something like this:
Now we can see all of the API calls made using
global-metadata.dat‘s file handle. Don’t be confused by the calls to
CreateFile – this function can be used not just to create files but also to open existing files, which is the case here. We note calls to
CreateFileMapping, which maps a file to a region of unallocated virtual memory without actually loading it from storage. When the application attempts to read from one of these memory addresses, the Windows kernel will read the corresponding portion of the file if necessary – this is called demand paging and reduces memory consumption at the expense of requiring an open file handle for however long the file contents are needed. It also means the file may be read out-of-order.
Note that the kernel will read the file in blocks – not just specifically the requested bytes – as an optimization. As you can see above, the page size is 32KB (each read has a length of 32,768 bytes). With this in mind, notice how the application reads the very end of the file first: the first call to
ReadFile is at offset 55,791,616 (
0x3535000) and has a length of 30,684 bytes (less than 32KB because the file size is not exactly divisible by 32KB); taking us to
0x353C7DC or the length of the file. The fact the kernel reads from
0x3535000 doesn’t mean the application requested precisely these bytes. It may have just wanted a portion of the data, but the kernel will always read in page-sized blocks when using demand paging. Recall that there is a blob of
0x4000 bytes of unknown data at the end of the file, beyond the metadata tables. We know that
global-metadata.dat is usually read from the start, because the header at the beginning of the file contains the information needed to find everything else in the file. Reading the end of the file first is therefore highly suspicious, and lends credence to the theory that this data is needed first to be used in some kind of decryption function.
Let’s double-click on the
ReadFile event where the data is read from offset zero – ie. the start of the file – and select the Stack tab to see the stack trace (the most recent calls appear first):
Native\UserAssembly.dll is what is normally called
GameAssembly.dll in the Unity app’s root folder, but it has been moved and renamed by the developers here.
The first thing to note is that you should ignore the function names shown in the Location column: these assume the files have symbols available, so while they will be accurate for Windows DLLs like
ntoskrnl.exe, they will be incorrect for our game. ProcMon just looks through the export table to find the function with the nearest starting address before the call site and assumes that is the name of the function. It is easy to tell the function names are wrong because they have massive offsets into the function start addresses: while
UnityMain + 0x36 is almost certainly an instruction
0x36 bytes into
UnityMain, we very much doubt that
il2cpp_value_box (which converts a value type into a boxed reference type) is either
0x589113F bytes long, or would be playing any role in loading a file. This call is really being made from another, unexported function. The good news is that the absolute call addresses in the Address column will be correct in all cases, so we’ll focus on these.
All of the kernel mode calls (those prefixed by a K in the Frame column) can be ignored – these all basically just deal with the file read (or other API call) requested by the application and aren’t important to us. The relevant call is the final one made by our application, which is at address
0x7FFF4E2C385 in
UnityPlayer.dll. This is the instruction which actually triggers the kernel to read data from the underlying storage.
In a normal Unity application,
global-metadata.dat is read exclusively by the main game binary and not touched by
UnityPlayer.dll, so the fact that
UserAssembly.dll here calls back into
UnityPlayer.dll to perform a read is suspicious. It may indicate custom decryption code added to
UnityPlayer.dll.
We now want to trace through the code to see exactly what is happening, so we load up both
UnityPlayer.dll and
UserAssembly.dll into IDA. We also want to compare the shipped
UnityPlayer.dll with one from a blank Unity project. We can determine the game’s Unity version by simply looking at the EXE’s file properties, or by loading an asset file into a hex editor and looking at the version string at the top. Honkai Impact 3rd uses Unity 2017.4.18f1, which in itself is noteworthy because Windows standalone IL2CPP support was not introduced until Unity 2018.1.0 – there is a considerable amount of customization going on here. We need to work with the closest version we can to minimize the amount of code changes in
UnityPlayer.dll, so we install Unity 2018.1.0 via Unity Hub, create a blank 3D template project, set the scripting backend to IL2CPP, the architecture to x64, enable PDB generation so that we can see all of the symbols (function names and so on) when we disassemble our own DLL, but disable ‘Development build’ so that it doesn’t emit lots of extra debugging code in every function that will just confuse us, leave everything else at their default settings in the hope that the developers did the same, click Build, wait a while and then open our freshly-baked
UnityPlayer.dll into IDA as well. When loading three binaries into IDA, strong coffee is advised.
DLLs have a preferred image base address – commonly but not always
0x180000000 – but they are usually allocated at a non-preferred base address in memory. IDA will initially display virtual addresses relative to the DLL’s preferred image base. For example, if the preferred image base of
UserAssembly.dll is
0x180000000 and the offset of the
il2cpp_init function from the image base is
0x123456 bytes, IDA will display this function at virtual address
0x180123456. However, if it is loaded in memory at
0x200000000 when actually executed, the address of
il2cpp_init shown in ProcMon’s stack trace will be
0x200123456. To make the stack trace line up with the disassembly, we need to fix this somehow. There are two options: subtract the difference between preferred and actual image bases from every address with a calculator while moving around in the file, or change the image base address of the file in IDA. The latter is much less error-prone, so we’ll do that. This step is called rebasing. To do it, choose Edit -> Segments -> Rebase program… from the IDA menu, and set the options as follows:
The Process tab of the event in ProcMon helpfully shows us the loaded image base of every DLL used by the application:
In the case above, we’ll rebase
UserAssembly.dll to
0x7FFF3C520000 and
UnityPlayer.dll to
0x7FFF4E280000. You can also do this when you first load the files by ticking Manual load and accepting all the defaults on the many dialog boxes that appear besides the image base address, which is the first dialog.
If you live near a beach, now is a good time to take a midnight swim, or perhaps – as I did – just stare wistfully out of the window contemplating whether the rebase or the heat death of the Universe will win. It’s coming.
Tip: It can be hard to understand the output of ProcMon without an anchor reference. For IL2CPP games, creating a blank Unity project and watching how it behaves in ProcMon will give you an excellent baseline to help you spot sneaky changes in production code.
Tip: ProcMon captures millions of events every minute and consumes large amounts of resources. Even when you have filters enabled, all events are still captured – just not displayed. Close ProcMon as soon as you are finished using it – it will crash eventually if you don’t.
Threading the needle
We start by navigating to the top of the user mode call stack,
0x7FFF4E2C3E85 in
UnityPlayer.dll:
.text:00007FFF4E2C3E6C mov [rbp+0D30h+anonymous_28], rax .text:00007FFF4E2C3E73 mov rax, [rbp+0D30h+anonymous_69] .text:00007FFF4E2C3E77 mov rcx, [rbp+0D30h+anonymous_30] .text:00007FFF4E2C3E7E mov rdx, [rbp+0D30h+anonymous_28] .text:00007FFF4E2C3E85 movups xmm0, xmmword ptr [rax+rcx] .text:00007FFF4E2C3E89 movups xmmword ptr [rdx], xmm0 .text:00007FFF4E2C3E8C mov rsi, [rbp+0D30h+anonymous_23] .text:00007FFF4E2C3E90 sub rsp, 20h .text:00007FFF4E2C3E94 mov r8d, 0B00h ; Size
Note that the instruction pointer (EIP for x86, RIP for x64) is incremented before it’s pushed onto the stack, so the actual instruction that triggers the call to
ReadFile is the previous one, at
0x7FFF4E2C3E7E. It’s just a
mov, so it is likely triggering the read call by attempting to read from an uninitialized location in the demand paged memory range. Not very interesting. We scroll up and down in this function and discover it is both huge and obfuscated using a technique called control flow obfuscation. Here is the control flow graph (CFG) for this function:
Essentially this is a form of multi-level control flow flattening. In a nutshell, the function is a giant finite state machine (FSM) controlled by an arbitrarily-introduced state variable. The function loops repeatedly in its entirety, performing a very small action on each loop iteration based on the state variable, then updating the state variable. The actions are buried within many layers of
if and
switch statements, making it very difficult to reverse engineer by static analysis. As an analyst, I could not possibly be less excited about this diagram.
At this juncture I should note that the object of static analysis is not to determine what every line in a program does. Disassemblies often consist of millions of lines of code, and trying to weave your way through figuring out what every instruction means is a slow laborious way to accomplish nothing. Instead, we try to judge the overall purpose of functions at a slightly higher level and only delve down into the instruction level for small snippets of code that hold the greatest relevance.
One way to do this is to look at the inputs and outputs of a function rather than its actual code. Consider a 100,000-line obfuscated function which takes two integers as its input and returns one integer. If feeding in 1 and 2 produces an output of 3 every time, and feeding in 11 and 22 produces an output of 33 every time, it’s fairly safe to assume that at least in general, the function sums its two inputs and returns the total. There is no need to reverse engineer the function’s code unless it produces something that deviates from our thesis.
With this in mind, we navigate to the top of the function, give it a name like
DoSomethingWithMetadata and move down in the call stack to where this function is actually called – in this case,
0x7FFF41EE076C in
UserAssembly.dll:
.text:00007FFF41EE075A xor edx, edx .text:00007FFF41EE075C call sub_7FFF41EDD140 .text:00007FFF41EE0761 jmp short loc_7FFF41EE076F .text:00007FFF41EE0763 mov edx, r12d ; _QWORD .text:00007FFF41EE0766 call cs:qword_7FFF43D74F80 .text:00007FFF41EE076C mov rsi, rax .text:00007FFF41EE076C ; } // starts at 7FFF41EE06F0
Looking again at the instruction prior to the one pointed to by the stack, this time we find an actual call, to
qword_7FFF43D74F80, which is an uninitialized static value set at runtime. We know for sure this calls
DoSomethingWithMetadata in
UnityPlayer.dll, so we rename this address to
pDoSomethingWithMetadata (the
p is short for pointer), navigate to the top of the function and invoke the decompiler. The decompiled function is a couple of hundred lines long but the call to the obfuscated function is visible and looks like this:
a6 = 0; v29 = sub_7FFF41EB3860(&a1, 3, 1, 1u, 0, &a6); v26 = v29; if ( !a6 ) { v27 = sub_7FFF41EB36A0(v29, &a6); v28 = v27.LowPart; if ( !a6 ) { v25 = (const void *)sub_7FFF41EDCFE0(v26, 0i64, 0); sub_7FFF41EB3170(v26, &a6); if ( a6 ) sub_7FFF41EDD140(v25); else v0 = pDoSomethingWithMetadata(v25, v28); } }
Immediately we have learned something useful. Our mystery function takes two arguments and returns one. In addition, we know the first argument is a pointer because
v25 has been cast to
const void *. The return value is stored in
v0 and not referenced again until this function ends, whereupon it is passed back to the caller as the return value.
We might be able to determine what
v0 is by moving down in the stack once more, but first we want to try to determine the input arguments. Generally we do this by clicking on the functions around the call to see if we can establish some context – particularly if they use the same arguments or return values subsequently passed as arguments to the function of interest. It doesn’t really matter how you approach this too much, but remember we just want to get an overview of what’s happening without perfectly understanding every function. I start arbitrarily with the prior function call to
sub_7FFF41EDD140, whose only argument is the same as the first argument to the mystery function:
void __fastcall sub_7FFF41EDD140(LPCVOID a1) { LPCVOID lpBaseAddress; // rbx void *v2; // rcx _QWORD *v3; // rax if ( a1 ) { lpBaseAddress = a1; sub_7FFF41EE16C0(&unk_7FFF43D7DF50); UnmapViewOfFile(lpBaseAddress); v2 = qword_7FFF43D7DF58; v3 = (_QWORD *)*((_QWORD *)qword_7FFF43D7DF58 + 1); if ( *((_BYTE *)v3 + 25) ) goto LABEL_15;
The full function is 36 lines but all we need is line 11: this function unmaps a file from memory. By way of illustration, lines 1, 9 and 11 are the only lines I looked at and the only lines of consequence. It doesn’t matter what the rest is – it’s likely to just be error handling and other cleanup. The input argument
a1 is passed to
UnmapViewOfFile and that is this function’s primary purpose. In this case, IDA helps us by automatically naming the Win32 API call for us, as well as renaming
v1 to
lpBaseAddress – the name of the argument to
UnmapViewOfFile in Microsoft’s documentation.
Experienced analysts won’t need to look this up, but if you’re not familiar with an API call, it is especially useful to refer to the official documentation. Let’s see what Microsoft says
lpBaseAddress is:
A pointer to the base address of the mapped view of a file that is to be unmapped. This value must be identical to the value returned by a previous call to the MapViewOfFile or MapViewOfFileEx function.
Since this argument is the same as the first argument to the mystery function, we now know that it is a pointer to demand paged memory. The call is on the other side of the
if branch to the unmap function, so
a6 in the first decompilation above is likely an error flag. We rename the function,
v25 and
a6, as well as setting
a6 to
bool (we don’t bother renaming anything in the unmap function, there is no need to since we have what we needed to learn from it already and won’t be revisiting it):
*&error = 0; v25 = sub_7FFF41EB3860(&v35, 3, 1i64); v26 = v25; if ( !*&error ) { v27 = sub_7FFF41EB36A0(v25, &error); if ( !*&error ) { hFile = sub_7FFF41EDCFE0(v26, 0i64, 0i64); sub_7FFF41EB3170(v26, &error); if ( *&error ) unmapFile(hFile); else v0 = pDoSomethingWithMetadata(hFile, v27); } }
Note that IDA in its infinite wisdom unfortunately also sometimes renumbers all of the other variables when you do this.
Before we go any further, do we have any thoughts on what the second argument – now
v27 – might be? Unlike in .NET, arrays in C and C++ (including blocks of bytes) do not have a convenient
Length property and are actually just raw pointers to memory locations. If you want to know the size of the array, you need to pass it as a separate argument, and that is an extremely common design pattern in C++.
v27 is assigned by
sub_7FFF41EB36A0 so let’s examine that function:
LARGE_INTEGER __fastcall sub_7FFF41EB36A0(void *a1, DWORD *a2) { DWORD *v2; // rbx LARGE_INTEGER result; // rax LARGE_INTEGER FileSize; // [rsp+38h] [rbp+10h] v2 = a2; *a2 = 0; if ( GetFileSizeEx(a1, &FileSize) ) { result = FileSize; } else { *v2 = GetLastError(); result.QuadPart = 0i64; } return result; }
Very straightforward,
a1 is a file handle and the function gets its size with GetFileSizeEx, returning any errors in
a2. Our theory is confirmed.
You can continue to flesh this out a bit if you like, depending on how much detail you need. Here is what I ended up with:
*&error = 0; hFile_1 = fileOpen(&metadataPathname, 3, 1, 1u, 0, &error); if ( !*&error ) { v27 = getFileSize(hFile_1, &error); metadataSize = v27.LowPart; if ( !*&error ) { hFile = mapFile(hFile_1, 0i64, 0); closeFile(hFile_1, &error); if ( *&error ) unmapFile(hFile); else v0 = pDoSomethingWithMetadata(hFile, metadataSize); } }
It should be pretty clear by this point that this code checks that
global-metadata.dat exists, gets its file size, maps it into memory, and – if there were no errors – calls our mystery function with a pointer to the start of the file in paged memory and its length.
What is the result in
v0, and what happens to it when the function we’re analyzing returns to the caller? Obviously the current line of thinking is that the
DoSomethingWithMetadata function decrypts the metadata file, and the return value is a pointer to the decrypted data, or perhaps the number of bytes decrypted or a result or error code.
Let’s step back for a moment. In another Il2CPP article I presented this diagram illustrating the initialization process of IL2CPP as it pertains to loading the metadata:
The relevant part here is that there is a call chain that proceeds
il2cpp_init() ->
il2cpp::vm::Runtime::Init() ->
il2cpp::vm::MetadataCache::Initialize(). There is actually one more function call before
global-metadata.dat is accessed, which you can see from the source code of
libil2cpp/vm/MetadataCache.cpp:
void MetadataCache::Initialize() { s_GlobalMetadata = vm::MetadataLoader::LoadMetadataFile("global-metadata.dat"); s_GlobalMetadataHeader = (const Il2CppGlobalMetadataHeader*)s_GlobalMetadata; IL2CPP_ASSERT(s_GlobalMetadataHeader->sanity == 0xFAB11BAF);
The function
vm::MetadataLoader::LoadMetadataFile is defined in
libil2cpp/vm/MetadataLoader.cpp and looks like this:
void* MetadataLoader::LoadMetadataFile(const char* fileName) { std::string resourcesDirectory = utils::PathUtils::Combine(utils::Runtime::GetDataDir(), utils::StringView<char>("Metadata")); std::string resourceFilePath = utils::PathUtils::Combine(resourcesDirectory, utils::StringView<char>(fileName, strlen(fileName))); int error = 0; FileHandle* handle = File::Open(resourceFilePath, kFileModeOpen, kFileAccessRead, kFileShareRead, kFileOptionsNone, &error); if (error != 0) return NULL; void* fileBuffer = utils::MemoryMappedFile::Map(handle); File::Close(handle, &error); if (error != 0) { utils::MemoryMappedFile::Unmap(fileBuffer); fileBuffer = NULL; return NULL; } return fileBuffer; }
This more or less resembles the decompiled code we just analyzed, except it would seem an
else clause has been added to the final
if to make that sneaky call into
UnityPlayer.dll! Note that the return value of the original version of
LoadMetadataFile is a pointer to the start of the mapped
global-metadata.dat. Since our decompiled version of
LoadMetadataFile returns the value returned by
DoSomethingWithMetadata, it is almost a certainty that
DoSomethingWithMetadata decrypts the metadata and returns a pointer to it, since the caller (
il2cpp::vm::MetadataCache::Initialize()) will expect unencrypted data unless it has been modified too.
We don’t normally have the source code to parts of applications we’re reverse engineering so we’re quite lucky that IL2CPP is open source, but let’s imagine we don’t have that luxury. At this point I want to pull in the
UnityPlayer.dll of our blank project, which we haven’t looked at yet. All the symbols are available so we can easily navigate to
il2cpp::vm::MetadataLoader::LoadMetadataFile, scroll down and compare:
error = 0; v27 = il2cpp::os::File::Open(&path, 3, 1, 1, 0, &error); v28 = v27; if ( !error ) { v29 = il2cpp::os::MemoryMappedFile::Map(v27, 0i64, 0i64); il2cpp::os::File::Close(v28, &error); if ( !error ) goto LABEL_45; il2cpp::os::MemoryMappedFile::Unmap(v29, 0i64); }
(if we didn’t have the symbols, we could just run ProcMon against the project and follow the stack trace as before)
It would indeed seem that the developers who obfuscated Honkai Impact added an extra call to fetch the file size, and an
else branch to call the decryption function if the file was mapped successfully.
Tip: Mastering IDA keyboard shortcuts can dramatically improve your productivity. Here are the shortcuts I used for the session above:
Jump to virtual address: G, type the address, label or function name, Enter
Rename symbol: N, type the symbol name, Enter
Decompile current function: F5
Change variable type: place cursor on the variable, Y, input the type declaration, Enter
Navigate in visited function history: forward and back buttons on mouse
View cross-references to function: place cursor on the function name, X
Sharpen your knives
We’re quietly hopeful we’ve found the decryption function at this point, starting at
0x7FFF4E2C2110, which given the rebased image base of
0x7FFF4E280000 puts it at offset
0x42110 in the file. If we can call this function in isolation, we can decrypt the metadata without needing to reverse engineer that horrendous code, albeit we won’t actually understand how the encryption works.
Note there is no guarantee this will “just work”. There may be other initialization that needs to be performed first, but as always we try to take the path of least resistance. If it doesn’t work, we just have to go back to the disassembly and look through the rest of the call stack to find any other extra code.
It’s arguably easier to use C or C++ for this test, but I like to work in C# so I’ll demonstrate with that. The code is pretty simple:
using System; using System.IO; using System.Linq; using System.Runtime.InteropServices; public static class); public static void Main(string[] args) { IntPtr hModule = LoadLibrary("UnityPlayer.dll"); IntPtr moduleBase = Process.GetCurrentProcess().Modules.Cast<ProcessModule>().First(m => m.ModuleName == "UnityPlayer.dll").BaseAddress; byte[] metadata = File.ReadAllBytes("global-metadata.dat"); var pDecryptMetadata = (DecryptMetadata) Marshal.GetDelegateForFunctionPointer(moduleBase + 0x42110, typeof(DecryptMetadata)); IntPtr pDecrypted = pDecryptMetadata(metadata, metadata.Length); byte[] decryptedMetadata; Marshal.Copy(pDecrypted, decryptedMetadata, 0, metadata.Length); FreeLibrary(hModule); File.WriteAllBytes("global-metadata-decrypted.dat", decryptedMetadata); } }
The Windows APIs
LoadLibrary and
FreeLibrary are used to dynamically load and unload DLLs at runtime. .NET doesn’t have this functionality in the base class library so we use the
DllImport attribute to import them directly from
kernel32.dll where they are defined (lines 8-12) (I will leave it as an exercise for the reader to figure out how
kernel32.dll gets loaded 🙂).
Delegates are .NET’s type-safe version of function pointers, so we define a delegate that matches the signature of the function we want to call and decorate it with
UnmanagedFunctionPointer (lines 14-15). The single argument – a member of the
CallingConvention enum – is extremely important to get right, as it specifies how the delegate arguments will be passed to the unmanaged function, ie. whether they will be passed in registers, pushed onto the stack or a combination thereof. Get this wrong and the target function won’t receive its arguments correctly, and probably crash. For 64-bit applications, it’s actually not much of a problem because all of the common calling conventions – cdecl, stdcall, fastcall and thiscall – behave the same way: the first four arguments are passed in RCX, RDX, R8 and R9, and the rest are pushed on the stack from right-to-left; the return value is supplied in RAX. When working with 32-bit applications, however, all of these calling conventions work differently and you must look at the assembly code to determine which is in use.
Honkai Impact is shipped as 64-bit binary so we don’t need to worry, but just for the sake of completeness let’s take a look at the call site:
.text:00007FFF41EE0720 ; 168: v27 = getFileSize(hFile_1, &error); .text:00007FFF41EE0720 lea rdx, [rbp+57h+error] .text:00007FFF41EE0724 mov rcx, rax .text:00007FFF41EE0727 call getFileSize .text:00007FFF41EE072C ; 169: metadataSize = v27.LowPart; .text:00007FFF41EE072C mov r12, rax .text:00007FFF41EE072F ; 170: if ( !*&error ) .text:00007FFF41EE072F cmp [rbp+57h+error], 0 .text:00007FFF41EE0733 jnz short loc_7FFF41EE076F .text:00007FFF41EE0735 ; 172: hFile = mapFile(hFile_1, 0i64, 0); .text:00007FFF41EE0735 xor r8d, r8d ; dwFileOffsetLow .text:00007FFF41EE0738 xor edx, edx ; dwNumberOfBytesToMap .text:00007FFF41EE073A mov rcx, rbx ; hFile .text:00007FFF41EE073D call mapFile .text:00007FFF41EE0742 mov r14, rax .text:00007FFF41EE0745 ; 173: closeFile(hFile_1, &error); .text:00007FFF41EE0745 lea rdx, [rbp+57h+error] .text:00007FFF41EE0749 mov rcx, rbx .text:00007FFF41EE074C call closeFile .text:00007FFF41EE0751 mov rcx, r14 ; lpBaseAddress .text:00007FFF41EE0754 ; 174: if ( *&error ) .text:00007FFF41EE0754 cmp [rbp+57h+error], 0 .text:00007FFF41EE0758 jz short loc_7FFF41EE0763 .text:00007FFF41EE075A ; 175: unmapFile(hFile); .text:00007FFF41EE075A xor edx, edx .text:00007FFF41EE075C call unmapFile .text:00007FFF41EE0761 jmp short loc_7FFF41EE076F .text:00007FFF41EE0763 ; 177: v0 = pDoSomethingWithMetadata(hFile, metadataSize); .text:00007FFF41EE0763 mov edx, r12d ; _QWORD .text:00007FFF41EE0766 call cs:pDoSomethingWithMetadata .text:00007FFF41EE076C mov rsi, rax
On line 6, the return value from
getFileSize is stored in R12. On line 15, the return value from
mapFile is stored in R14. On lines 20 and 29, RCX and RDX are set to the two arguments of
DoSomethingWithMetadata – the memory pointer (from R14) and the file size (from R12) respectively. The function is called on line 30, and on line 31 the return value from RAX is stored in RSI.
Going back to the C# code, we first load
UnityPlayer.dll into memory (line 18) and then find its base address in memory (line 20). This code iterates through every DLL loaded in the process until it finds one called
UnityPlayer.dll, then takes its base address.
Line 22 loads
global-metadata.dat into an array of bytes. Line 24 is the key, and essentially the main result of our work so far: it creates a delegate which points to our
DoSomethingWithMetadata function at offset
0x42110 from the loaded image base address, using the correct parameter types.
Line 26 calls the function in
UnityPlayer.dll. The returned pointer is in unmanaged memory of course, so lines 28-29 copy it into a managed array. Line 31 releases the lock on the DLL, and line 33 writes the output of the function to a file.
We run the program and open up the output in a hex editor next to the original metadata:
Well, it’s done… something. The first
0x28 (or possibly
0x24) bytes still don’t make any sense to us, but we can clearly see that some bytes have been changed into metadata header entries consistent with what appears immediately following.
The two blocks of unknown data are still as garbled as ever (we assume the one at the end of the file is a decryption key of some kind though), but what about those periodic encrypted
0x40-byte blocks scattered throughout the file?
Gottem!
Next time…
Clearly there is still much work to be done, but we’ve made good headway in a short amount of time. I’m sad to say that this was the easy part: in the next part of this mini-series, we’ll find out how miHoYo abused my spare time by creating a nightmare scenario of metadata reordering, what happened to the string literals (spoiler alert: the large block of encrypted data at the start of the file is the string literals), and how to reverse engineer it all. You won’t want to miss it, it’s going to be tedious as hell. Until next time…
Using your method I tried to use unpack genshin blk file (genshin 1.3), I found LoadFromFileWithMiHoYoPath(UserAssembly:0x4B97870 UnityPlayer:0xBB1650), but he also called the UserAssembly method at the same time, so I found il2cpp_init(string UserAssemblyPath) 0x0B4B5B0 is used to initialize the symbol, but LoadFromFileWithMiHoYoPath still cannot be executed successfully. I am very confused now, I don’t know whether to analyze the assembly or continue to try to make it successfully called
This is such an informative and well written article. I really love it and actually learned a lot from it, thank you! The section “Sharpen your knives” was especially useful, because just like you mentioned using C/C++ would have made it much easier/straight forward (which is what I did most of the time in the past) but using C# for it was exactly what I personally needed. | https://katyscode.wordpress.com/2021/01/17/reverse-engineering-adventures-honkai-impact-3rd-houkai-3-il2cpp-part-1/ | CC-MAIN-2021-21 | refinedweb | 6,551 | 60.65 |
Dear Pythoners, I think I do not yet have a good understanding of namespaces. Here is what I have in broad outline form: ------------------------------------ import Tkinter Class App(Frame) define two frames, buttons in one and Listbox in the other Class App2(Frame) define one frame with a Text widget in it root = Tk() app = App(root) win2 = Toplevel(root) app2 = App2(win2) root.mainloop() ------------------------------------ My understanding of the above goes like this: 1) create a root window 2) instantiate a class that defines a Frame in the root window 3) create another Toplevel window 4) instantiate another class that defines a frame in the Toplevel window (win2) What I cannot figure out is how to reference a widget in app2 from app... I hope this is sort of clear. Any assistance appreciated. Thanks, Larry | https://mail.python.org/pipermail/python-list/2009-April/535492.html | CC-MAIN-2017-17 | refinedweb | 134 | 53.95 |
.
Installation instructions are given in the next step of the lab.
Install the necessary software on your computer: Python, TensorFlow and Matplotlib. Full installation instructions are given here: INSTALL.txt
Clone the GitHub repository:
$ git clone
When you launch the initial python script, you should see a real-time visualisation of the training process:
$ python3 mnist_1.0_softmax.py
Troubleshooting: if you cannot get the real-time visualisation to run or if you prefer working with only the text output, you can de-activate the visualisation by commenting out one line and de-commenting another. See instructions at the bottom of the file.
We will first watch a neural network being trained. The code is explained in the next section so you do not have to look at it now.
Our neural network takes in handwritten digits and classifies them, i.e. states if it recognises them as a 0, a 1, a 2 and so on up to a 9. It does so based on internal variables ("weights" and "biases", explained later) that need to have a correct value for the classification to work well. This "correct value" is learned through a training process, also explained in detail later. What you need to know for now is that the training loop looks like this:
Training digits => updates to weights and biases => better recognition (loop)
Let us go through the six panels of the visualisation one by one to see what it takes to train a neural network.
Here you see the training digits being fed into the training loop, 100 at a time. You also see if the neural network, in its current state of training, has recognized them (white background) or mis-classified them (red background with correct label in small print on the left side, bad computed label on the right of each digit).
To test the quality of the recognition in real-world conditions, we must use digits that the system has NOT seen during training. Otherwise, it could learn all the training digits by heart and still fail at recognising an "8" that I just wrote. The MNIST dataset contains 10,000 test digits. Here you see about 1000 of them with all the mis-recognised ones sorted at the top (on a red background). The scale on the left gives you a rough idea of the accuracy of the classifier (% of correctly recognised test digits)
To drive the training, we will define a loss function, i.e. a value representing how badly the system recognises the digits and try to minimise it. The choice of a loss function (here, "cross-entropy") is explained later. What you see here is that the loss goes down on both the training and the test data as the training progresses: that is good. It means the neural network is learning. The X-axis represents iterations through the learning loop.
The accuracy is simply the % of correctly recognised digits. This is computed both on the training and the test set. You will see it go up if the training goes well.
The final two graphs represent the spread of all the values taken by the internal variables, i.e. weights and biases as the training progresses. Here you see for example that biases started at 0 initially and ended up taking values spread roughly evenly between -1.5 and 1.5. These graphs can be useful if the system does not converge well. If you see weights and biases spreading into the 100s or 1000s, you might have a problem.
The bands in the graphs are percentiles. There are 7 bands so each band is where 100/7=14% of all the values are.
Keyboard shortcuts for the visualisation GUI:
1 ......... display 1st graph only
2 ......... display 2nd graph only
3 ......... display 3rd graph only
4 ......... display 4th graph only
5 ......... display 5th graph only
6 ......... display 6th graph only
7 ......... display graphs 1 and 2
8 ......... display graphs 4 and 5
9 ......... display graphs 3 and 6
ESC or 0 .. back to displaying all graphs
SPACE ..... pause/resume
O ......... box zoom mode (then use mouse)
H ......... reset all zooms
Ctrl-S .... save current image
Handwritten digits in the MNIST dataset are 28x28 pixel greyscale images. The simplest approach for classifying them is to use the 28x28=784 pixels as inputs for a 1-layer neural network.
Each "neuron" in a neural network does a weighted sum of all of its inputs, adds a constant called the "bias" and then feeds the result through some non-linear activation function.
Here we design a 1-layer neural network with 10 output neurons since we want to classify digits into 10 classes (0 to 9).
For a classification problem, an activation function that works well is softmax. Applying softmax on a vector is done by taking the exponential of each element and then normalising the vector (using any norm, for example the ordinary euclidean length of the vector).
We will now summarise the behaviour of this single layer of neurons into a simple formula using a matrix multiply. Let us do so directly for a "mini-batch" of 100 images as the input, producing 100 predictions (10-element vectors) as the output.
Using the first column of weights in the weights matrix W, we compute the weighted sum of all the pixels of the first image. This sum corresponds to the first neuron. Using the second column of weights, we do the same for the second neuron and so on until the 10th neuron. We can then repeat the operation for the remaining 99 images. If we call X the matrix containing our 100 images, all the weighted sums for our 10 neurons, computed on 100 images are simply X.W (matrix multiply).
Each neuron must now add its bias (a constant). Since we have 10 neurons, we have 10 bias constants. We will call this vector of 10 values b. It must be added to each line of the previously computed matrix. Using a bit of magic called "broadcasting" we will write this with a simple plus sign.
We finally apply the softmax activation function and obtain the formula describing a 1-layer neural network, applied to 100 images:
Now that our neural network produces predictions from input images, we need to measure how good they are, i.e. the distance between what the network tells us and what we know to be the truth. Remember that we have true labels for all the images in this dataset.
Any distance would work, the ordinary euclidian distance is fine but for classification problems one distance, called the "cross-entropy" is more efficient.
"Training" the neural network actually means using training images and labels to adjust weights and biases so as to minimise the cross-entropy loss function. Here is how it works.
The cross-entropy is a function of weights, biases, pixels of the training image and its known label.
If we compute the partial derivatives of the cross-entropy relatively to all the weights and all the biases we obtain a "gradient", computed for a given image, label and present value of weights and biases. Remember that we have 7850 weights and biases so computing the gradient sounds like a lot of work. Fortunately, TensorFlow will do it for us.
The mathematical property of a gradient is that it points "up". Since we want to go where the cross-entropy is low, we go in the opposite direction. We update weights and biases by a fraction of the gradient and do the same thing again using the next batch of training images. Hopefully, this gets us to the bottom of the pit where the cross-entropy is minimal.
In this picture, cross-entropy is represented as a function of 2 weights. In reality, there are many more. The gradient descent algorithm follows the path of steepest descent into a local minimum. The training images are changed at each iteration too so that we converge towards a local minimum that works for all images.
To sum it up, here is how the training loop looks like:
Training digits and labels => loss function => gradient (partial derivatives) => steepest descent => update weights and biases => repeat with next mini-batch of training images and labels
The code for the 1-layer neural network is already written. Please open the
mnist_1.0_softmax.py file and follow along with the explanations.
You should see there are only minor differences between the explanations and the starter code in the file. They correspond to functions used for the visualisation and are marked as such in comments. You can ignore them.
import tensorflow as tf X = tf.placeholder(tf.float32, [None, 28, 28, 1]) W = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zeros([10])) init = tf.initialize_all_variables()
First we define TensorFlow variables and placeholders. Variables are all the parameters that you want the training algorithm to determine for you. In our case, our weights and biases.
Placeholders are parameters that will be filled with actual data during training, typically training images. The shape of the tensor holding the training images is [None, 28, 28, 1] which stands for:
# model Y = tf.nn.softmax(tf.matmul(tf.reshape(X, [-1, 784]), W) + b) # placeholder for correct labels Y_ = tf.placeholder(tf.float32, [None, 10]) # loss function cross_entropy = -tf.reduce_sum(Y_ * tf.log(Y)) # % of correct answers found in batch is_correct = tf.equal(tf.argmax(Y,1), tf.argmax(Y_,1)) accuracy = tf.reduce_mean(tf.cast(is_correct, tf.float32))
The first line is the model for our 1-layer neural network. The formula is the one we established in the previous theory section. The
tf.reshape command transforms our 28x28 images into single vectors of 784 pixels. The "-1" in the reshape command means "computer, figure it out, there is only one possibility". In practice it will be the number of images in a mini-batch.
We then need an additional placeholder for the training labels that will be provided alongside training images.
Now, we have model predictions and correct labels so we can compute the cross-entropy.
tf.reduce_sum sums all the elements of a vector.
The last two lines compute the percentage of correctly recognised digits. They are left as an exercise for the reader to understand, using the TensorFlow API reference. You can also skip them.
optimizer = tf.train.GradientDescentOptimizer(0.003) train_step = optimizer.minimize(cross_entropy)
This where the TensorFlow magic happens. You select an optimiser (there are many available) and ask it to minimise the cross-entropy loss. In this step, TensorFlow computes the partial derivatives of the loss function relatively to all the weights and all the biases (the gradient). This is a formal derivation, not a numerical one which would be far too time-consuming.
The gradient is then used to update the weights and biases. 0.003 is the learning rate.
Finally, it is time to run the training loop. All the TensorFlow instructions up to this point have been preparing a computation graph in memory but nothing has been computed yet.
The computation requires actual data to be fed into the placeholders you have defined in your TensorFlow code. This is supplied in the form of a Python dictionary where the keys are the names of the placeholders.
sess = tf.Session() sess.run(init) for i in range(1000): # load batch of images and correct answers batch_X, batch_Y = mnist.train.next_batch(100) train_data={X: batch_X, Y_: batch_Y} # train sess.run(train_step, feed_dict=train_data)
The
train_step that is executed here was obtained when we asked TensorFlow to minimise out cross-entropy. That is the step that computes the gradient and updates weights and biases.
Finally, we also need to compute a couple of values for display so that we can follow how our model is performing.
The accuracy and cross entropy are computed on training data using this code in the training loop (every 10 iterations for example):
# success ? a,c = sess.run([accuracy, cross_entropy], feed_dict=train_data)
The same can be computed on test data by supplying test instead of training data in the feed dictionary (do this every 100 iterations for example. There are 10,000 test digits so this takes some CPU time):
# success on test data ? test_data={X: mnist.test.images, Y_: mnist.test.labels} a,c = sess.run([accuracy, cross_entropy], feed=test_data)
This simple model already recognises 92% of the digits. Not bad, but you will now improve this significantly.
To improve the recognition accuracy we will add more layers to the neural network. The neurons in the second layer, instead of computing weighted sums of pixels will compute weighted sums of neuron outputs from the previous layer. Here is for example a 5-layer fully connected neural network:
We keep softmax as the activation function on the last layer because that is what works best for classification. On intermediate layers however we will use the the most classical activation function: the sigmoid:
To add a layer, you need an additional weights matrix and an additional bias vector for the intermediate layer:
W1 = tf.Variable(tf.truncated_normal([28*28, 200] ,stddev=0.1)) B1 = tf.Variable(tf.zeros([200])) W2 = tf.Variable(tf.truncated_normal([200, 10], stddev=0.1)) B2 = tf.Variable(tf.zeros([10]))
The shape of the weights matrix for a layer is [N, M] where N is the number of inputs and M of outputs for the layer. In the code above, we use 200 neurons in the intermediate layer and still 10 neurons in the last layer.
And now change your 1-layer model into a 2-layer model:
XX = tf.reshape(X, [-1, 28*28]) Y1 = tf.nn.sigmoid(tf.matmul(XX, W1) + B1) Y = tf.nn.softmax(tf.matmul(Y1, W2) + B2)
That's it. You should now be able to push your network above 97% accuracy with 2 intermediate layer with for example 200 and 100 neurons.
As layers were added, neural networks tended to converge with more difficulties. But we know today how to make them behave. Here are a couple of 1-line updates that will help if you see an accuracy curve like this:
The sigmoid activation function is actually quite problematic in deep networks. It squashes all values between 0 and 1 and when you do so repeatedly, neuron outputs and their gradients can vanish entirely. It was mentioned for historical reasons but modern networks use the RELU (Rectified Linear Unit) which looks like this:
In very high dimensional spaces like here - we have in the order of 10K weights and biases - "saddle points" are frequent. These are points that are not local minima but where the gradient is nevertheless zero and the gradient descent optimizer stays stuck there. TensorFlow has a full array of available optimizers, including some that work with an amount of inertia and will safely sail past saddle points.
Accuracy still stuck at 0.1 ? Have you initialised your weights with random values ? For biases, when working with RELUs, the best practice is to initialise them to small positive values so that neurons operate in the non-zero range of the RELU initially.
W = tf.Variable(tf.truncated_normal([K, L] ,stddev=0.1)) B = tf.Variable(tf.ones([L])/10)
If you see your accuracy curve crashing and the console outputting NaN for the cross-entropy, don't panic, you are attempting to compute a log(0), which is indeed Not A Number (NaN). Remember that the cross-entropy involves a log, computed on the output of the softmax layer. Since softmax is essentially an exponential, which is never zero, we should be fine but with 32 bit precision floating-point operations, exp(-100) is already a genuine zero.
Fortunately, TensorFlow has a handy function that computes the softmax and the cross-entropy in a single step, implemented in a numerically stable way. To use it, you will need to isolate the raw weighted sum plus bias on your last layer, before softmax is applied ("logits" in neural network jargon).
If the last line of your model was:
Y = tf.nn.softmax(tf.matmul(Y4, W5) + B5)
You need to replace it with:
Ylogits = tf.matmul(Y4, W5) + B5 Y = tf.nn.softmax(Ylogits)
And now you can compute your cross-entropy in a safe way:
cross_entropy = tf.nn.softmax_cross_entropy_with_logits(Ylogits, Y_)
Also add this line to bring the test and training cross-entropy to the same scale for display:
cross_entropy = tf.reduce_mean(cross_entropy)*100
You are now ready to go deep.
With two, three or four intermediate layers, you can now get close to 98% accuracy, if you push the iterations to 5000 or beyond. But you will see that results are not very consistent.
These curves are really noisy and look at the test accuracy: it's jumping up and down by a whole percent. This means that even with a learning rate of 0.003, we are going too fast. But we cannot just divide the learning rate by ten or the training would take forever. The good solution is to start fast and decay the learning rate exponentially to 0.0001 for example.
The impact of this little change is spectacular. You see that most of the noise is gone and the test accuracy is now above 98% in a sustained way.
Look also at the training accuracy curve. It is now reaching 100% across several epochs (1 epoch = 500 iterations = trained on all training images once). For the first time, we are able to learn to recognise the training images perfectly.
You will have noticed that cross-entropy curves for test and training data start disconnecting after a couple thousand iterations. The learning algorithm works on training data only and optimises the training cross-entropy accordingly. It never sees test data so it is not surprising that after a while its work no longer has an effect on the test cross-entropy which stops dropping and sometimes even bounces back up.
This does not immediately affect the real-world recognition capabilities of your model but it will prevent you from running many iterations and is generally a sign that the training is no longer having a positive effect. This disconnect is usually labeled "overfitting" and when you see it, you can try to apply a regularisation technique called "dropout".
In dropout, at each training iteration, you drop random neurons from the network. You choose a probability
pkeep for a neuron to be kept, usually between 50% and 75%, and then at each iteration of the training loop, you randomly remove neurons with all their weights and biases. Different neurons will be dropped at each iteration (and you also need to boost the output of the remaining neurons in proportion to make sure activations on the next layer do not shift). When testing the performance of your network of course you put all the neurons back (
pkeep=1).
TensorFlow offers a dropout function to be used on the outputs of a layer of neurons. It randomly zeroes-out some of the outputs and boosts the remaining ones by 1/pkeep. Here is how you use it in a 2-layer network:
# feed in 1 when testing, 0.75 when training pkeep = tf.placeholder(tf.float32) Y1 = tf.nn.relu(tf.matmul(X, W1) + B1) Y1d = tf.nn.dropout(Y1, pkeep) Y = tf.nn.softmax(tf.matmul(Y1d, W2) + B2)
You should see that the test loss is largely brought back under control, noise reappears (unsurprisingly given how dropout works) but in this case at least, the test accuracy remains unchanged which is a little disappointing. There must be another reason for the "overfitting".
Before we continue, a recap of all the tools we have tried so far:
Whatever we do, we do not seem to be able to break the 98% barrier in a significant way and our loss curves still exhibit the "overfitting" disconnect. What is really "overfitting" ? Overfitting happens when a neural network learns "badly", in a way that works for the training examples but not so well on real-world data. There are regularisation techniques like dropout that can force it to learn in a better way but overfitting also has deeper roots.
Basic overfitting happens when a neural network has too many degrees of freedom for the problem at hand. Imagine we have so many neurons that the network can store all of our training images in them and then recognise them by pattern matching. It would fail on real-world data completely. A neural network must be somewhat constrained so that it is forced to generalise what it learns during training.
If you have very little training data, even a small network can learn it by heart. Generally speaking, you always need lots of data to train neural networks.
Finally, if you have done everything well, experimented with different sizes of network to make sure its degrees of freedom are constrained, applied dropout, and trained on lots of data you might still be stuck at a performance level that nothing seems to be able to improve. This means that your neural network, in its present shape, is not capable of extracting more information from your data, as in our case here.
Remember how we are using our images, all pixels flattened into a single vector ? That was a really bad idea. Handwritten digits are made of shapes and we discarded the shape information when we flattened the pixels. However, there is a type of neural network that can take advantage of shape information: convolutional networks. Let us try them.
In a layer of a convolutional network, one "neuron" does a weighted sum of the pixels just above it, across a small region of the image only. It then acts normally by adding a bias and feeding the result through its activation function. The big difference is that each neuron reuses the same weights whereas in the fully-connected networks seen previously, each neuron had its own set of weights.
In the animation above, you can see that by sliding the patch of weights across the image in both directions (a convolution) you obtain as many output values as there were pixels in the image (some padding is necessary at the edges though).
To generate one plane of output values using a patch size of 4x4 and a color image as the input, as in the animation, we need 4x4x3=48 weights. That is not enough. To add more degrees of freedom, we repeat the same thing with a different set of weights.
The two (or more) sets of weights can be rewritten as one by adding a dimension to the tensor and this gives us the generic shape of the weights tensor for a convolutional layer. Since the number of input and output channels are parameters, we can start stacking and chaining convolutional layers.
One last issue remains. We still need to boil the information down. In the last layer, we still want only 10 neurons for our 10 classes of digits. Traditionally, this was done by a "max-pooling" layer. Even if there are simpler ways today, "max-pooling" helps understand intuitively how convolutional networks operate: if you assume that during training, our little patches of weights evolve into filters that recognise basic shapes (horizontal and vertical lines, curves, ...) then one way of boiling useful information down is to keep through the layers the outputs where a shape was recognised with the maximum intensity. In practice, in a max-pool layer neuron outputs are processed in groups of 2x2 and only the one max one retained.
There is a simpler way though: if you slide the patches across the image with a stride of 2 pixels instead of 1, you also obtain fewer output values. This approach has proven just as effective and today's convolutional networks use convolutional layers only.
Let us build a convolutional network for handwritten digit recognition. We will use three convolutional layers at the top, our traditional softmax readout layer at the bottom and connect them with one fully-connected layer:
Notice that the second and third convolutional layers have a stride of two which explains why they bring the number of output values down from 28x28 to 14x14 and then 7x7. The sizing of the layers is done so that the number of neurons goes down roughly by a factor of two at each layer: 28x28x4≈3000 → 14x14x8≈1500 → 7x7x12≈500 → 200. Jump to the next section for the implementation.
To switch our code to a convolutional model, we need to define appropriate weights tensors for the convolutional layers and then add the convolutional layers to the model.
We have seen that a convolutional layer requires a weights tensor of the following shape. Here is the TensorFlow syntax for their initialisation:
W = tf.Variable(tf.truncated_normal([4, 4, 3, 2], stddev=0.1)) B = tf.Variable(tf.ones([2])/10) # 2 is the number of output channels
Convolutional layers can be implemented in TensorFlow using the
tf.nn.conv2d function which performs the scanning of the input image in both directions using the supplied weights. This is only the weighted sum part of the neuron. You still need to add a bias and feed the result through an activation function.
stride = 1 # output is still 28x28 Ycnv = tf.nn.conv2d(X, W, strides=[1, stride, stride, 1], padding='SAME') Y = tf.nn.relu(Ycnv + B)
Do not pay too much attention to the complex syntax for the stride. Look up the documentation for full details. The padding strategy that works here is to copy pixels from the sides of the image. All digits are on a uniform background so this just extends the background and should not add any unwanted shapes.
Your model should break the 98% barrier comfortably and end up just a hair under 99%. We cannot stop so close! Look at the test cross-entropy curve. Does a solution spring to your mind ?
A good approach to sizing your neural networks is to implement a network that is a little too constrained, then give it a bit more degrees of freedom and add dropout to make sure it is not overfitting. This ends up with a fairly optimal network for your problem.
Here for example, we used only 4 patches in the first convolutional layer. If you accept that those patches of weights evolve during training into shape recognisers, you can intuitively see that this might not be enough for our problem. Handwritten digits are mode from more than 4 elemental shapes.
So let us bump up the patch sizes a little, increase the number of patches in our convolutional layers from 4, 8, 12 to 6, 12, 24 and then add dropout on the fully-connected layer. Why not on the convolutional layers? Their neurons reuse the same weights, so dropout, which effectively works by freezing some weights during one training iteration, would not work on them.
The model pictured above misses only 72 out of the 10,000 test digits. The world record, which you can find on the MNIST website is around 99.7%. We are only 0.4 percentage points away from it with our model built with 100 lines of Python / TensorFlow.
To finish, here is the difference dropout makes to our bigger convolutional network. Giving the neural network the additional degrees of freedom it needed bumped the final accuracy from 98.9% to 99.1%. Adding dropout not only tamed the test loss but also allowed us to sail safely above 99% and even reach 99.3%
You have built your first neural network and trained it all the way to 99% accuracy. The techniques learned along the way are not specific to the MNIST dataset, actually they are very widely used when working with neural networks. As a parting gift, here is the "cliff's notes" card for the lab, in cartoon version. You can use it to recall what you have learned:
All cartoon images in this lab copyright: alexpokusay / 123RF stock photos | https://codelabs.developers.google.com/codelabs/cloud-tensorflow-mnist/ | CC-MAIN-2017-17 | refinedweb | 4,686 | 64.3 |
deform 0.9.7
Another form generation library
A Python HTML form library. It runs under Python 2.6, 2.7, 3.2 and 3.3.
Please see for the documentation.
See for in-development version.
0.9.7 (2013-03-06)
Bug Fixes
- Readonly checkbox template had a logic error.
0.9.6 (2013-01-10)
Bug Fixes
- Fixed remove bug in nested sequences. See
- Fixed bug wherein items added to a sequence nor the initial items rendered in a sequence would not reflect the correct defaults of the item widget. See
Dependencies
- Depend on and use zope.deprecation to deprecate Set class.
- Deform now depends on Colander >= 1.0a1 (previously it depended on >= 0.8). It requires Colander 1.0a1’s newer cstruct_children and appstruct_children methods of schema objects as well as being able to import objects from Colander that don’t exist in earlier versions.
- Deform now depends on Chameleon >= 2.5.1 (previously it depended on >= 1.2.3). It requires the Markup class supplied by this version or better.
- Deform no longer has a setup_requires dependency on setuptools_git (useless, as the version on PyPI is broken).
- Setup.py now includes all testing requirements in tests_require that are in testing extras and vice versa.
Features
- Allow SelectWidget to produce <optgroup> HTML tags. See
- Allow deform.form.Form constructor to accept an autocomplete keyword argument, which controls the autocomplete attribute of the form tag.
- Add Python 3.3 Trove classifier.
- Pass through unknown keys in a filedict FileData serialization (FBO of passing out of band information).
- deform.Set type deprecated in favor of use of colander.Set.
- Give the preview_url method of the tempstore access to the stored item. [tomster]
- Add style attribute/arguments to textinput-related widgets allowing you to set the style of the tag by hand.
- Allow deform.widget.SequenceWidget constructor to accept an orderable keyword argument. Default is False. If True, allow drag-and-drop reordering of SequenceWidget items (via jQuery UI Sortable).
- The default widget for the colander.Money type is now deform.widgets.MoneyInputWidget.
- Built-in widgets may have a ‘readonly’ attribute/constructor-argument, to indicate that a form field associated with the widget should use its readonly template instead of its normal readwrite template. A readonly keyword argument can still be passed to Field.serialize to render a field as readonly, like in older versions.
- deform.field.Field now has a __contains__ method, which returns True if the named field is a subfield of the field on which it is called.
- deform.field.Field now has a validate_pstruct method which works like validate except it accepts a pstruct directly instead of accepting a list of controls.
- deform.field.Field.validate now accepts a subcontrol argument for validating a submapping of a form.
- In support of “retail” form rendering, the serialize method of widgets now accepts arbitrary keyword arguments. These are used as top-level value overrides to widget templates.
- In support of “retail” form rendering, the serialize method of a Field now accepts arbitrary keyword arguments. These are passed along to it’s widget’s serialize method.
- It is now possible to pass an appstruct argument to the deform.Field (and by extension, the deform.Form) constructor. When you do so, you can omit passing an appstruct argument to the render method of the field/form. Fields set a cstruct value recursively when supplied with an appstruct argument to their constructor. This is in support of “retail” form rendering.
- Form/field objects are now initialized with a cstruct (recursively) when created. This means that accessing form.cstruct will return the current set of rendering values. This value is reset during validation, so after a validation is done you can re-render the form to show validation errors. This is in support of “retail” form rendering.
- Form/field objects now have peppercorn-field-outputting methods: start_mapping, end_mapping, start_sequence, end_sequence, start_rename, end_rename in support of retail form rendering.
- The deform.Field (and therefore deform.Form) classes now expose a render_template method, which injects field and cstruct into the dictionary passed to the template if they don’t already exist in the **kw passed. This is in support of retail form rendering.
- Add set_appstruct and set_pstruct methods to Field; these accept, respectively, an appstruct or a pstruct and set the cstruct related to the field to the deserialized or serialized value.
Documentation
- Add a (weak) “Retail Form Rendering” chapter to the docs.
0.9.5 (2012-04-27)
- Add translations for TinyMCE. Thanks OCHIAI, Gouji.
- Japanese translation thanks to OCHIAI, Gouji.
- Modified Russian translation thanks to aleksandr.rakov
- Date(Time)Widget supports now options to configure it, thx to gaston tjebbes, kiorky
- FileUploadWidget now sanitizes IE/Windows whole-path filenames before passing them back to the caller during deserialization/validation.
- Add docs and dev setup.py aliases ala Pyramid.
- Add MoneyInputWidget widget type.
- Allow a custom i18n domain to be used for the “Add ${subitem_title}” link of a SequenceWidget. See .
- Allow the use of Integer values with SelectWidget. See .
- CheckedInputWidget and CheckedPasswordWidget now populate the “confirm” element with the cstruct value (for edit forms).
- Update to JQuery 1.7.2.
- Update to jquery.form 3.09.
0.9.4 (2012-02-14)
- No longer Python 2.5 compatible. Python 2.6+ is required.
- Python 3.2 compatible.
- Translate title attribute for remove button in sequence fields.
- Do not output empty error messages for sequence items. After translation these would insert the PO file metadata.
- Update to lingua for translations, add french translation
- fix multiple i18n issues.
- Fix a bug where displaying error could lead on an error when you have imbricated Mapping objects
- Fix issue #54: form.pt does not show validation errors from the top node of the schema. See for more information.
- Previously, all CheckedInputWidget and CheckedPasswordWidget fields had hardcoded input[name] attributes of ‘value’ and ‘confirm’. When deserializing a form, this caused colander.null to be passed to the widget deserialization function since neither submitted value matched the name of the field. This change simply replaces ‘value’ with the name of the field and ‘confirm’ with the name of the field with ‘-confirm’ appended.
- In select widget, add css_class to <select> rather than only <option>.
- Allow RichText fields to load their editor only after clicking on them
- There is no longer a deform_ajaxify global javascript function. Instead forms are AJAXified directly by the javascript callback for the form.
0.9.3 (2011-08-10)
- Update Dutch translations.
- Translate title and description of items for sequence fields.
- Add a new API method to field objects: translate. This method will use the translator passed to the underlying renderer to translate message ids into text.
0.9.2 (2011-07-22)
- Chameleon 2 compatibility.
- Use default widgets for a schema’s baseclass if known instead of always falling back to a text widget.
- Deform now includes a beautify.css (contributed by Ergo^) in its static directory, which can be used to make form element styling prettier.
- Moved deformdemo into its own package and Github repository ().
0.9.1 (2011-06-23)
Add Dutch translation.
Add the deform.widget.DateTimeWidget widget, which uses the jQueryUI Timepicker add-on.
DateTimeWidget uses the ISO8601 combined date and time format internally, as expected by colander.DateTime, but converts to the more friendly separate date and time format for display in the widget.
This widget is now the default for colander.DateTime schema types.
Upgrade to jquery-ui 1.8.11, as required by the timepicker.
Compile all .po generate an invalid HTML id if it contained spaces. Now it converts spaces to underscores if they exist in the name. See .
Deformdemo application now has a Time field demonstration.
Deform Chameleon templates now contain i18n:translate tags.
German translation updated.
Fixed invalid HTML generated for “select” widget.
When using an ajax form without a redirect, a submit overwrites the form. In the case of a form validation failure on first submit, no event handlers were registered to submit the form via ajax on the second submit. This is now fixed. See .
0.9 (2011-03-01)
- Moved to GitHub ().
- Added tox.ini for testing purposes.
- Fix select dropdown behavior on Firefox by fixing CSS (closes).
- Removed wufoo.css, minimized form.css. Changed templates around to deal with CSS changes.
- Sequence widgets now accept a min_len and a max_len argument, which influences its display of close and add buttons.
- Convert demo application from repoze.bfg to Pyramid.
- Depend on Chameleon<1.999 (deform doesn’t yet work with Chameleon 2).
0.8.1 (2010-12-17)
Features
- Allow deform.form.Button class to be passed a disabled flag (false by default). If a Button is disabled, its HTML disabled setting will be set true.
0.8 (2010-12-02)
Features
- Added Polish locale data: thanks to Marcin Lulek.
Bug Fixes
- Fix dynamic sequence item adding on Chrome and Firefox 4. Previously if there was a validation error rendering a set of sequence items, the “add more” link would be rendered outside the form, which would cause it to not work. Wrapping the sequence item <li> element in a <ul> fixed this.
0.7 (2010-10-10)
Features
- Added Danish locale.
- Added Spanish locale: thanks to David Cerna for the translations!
- DatePartsWidget now renders error “Required” if all blank or “Incomplete” if partially blank for consistency with the other widgets.
- Different styling involving <li> and <ul> for checkbox choice, checked input, radio choice, checked password, and dateparts widgets (via Ergo^). See.
Dependencies
- Deform now depends on colander version 0.8 or better (the demo wants to use schema bindings).
- Deform now depends on Chameleon (uppercase) rather than chameleon to allow for non-PyPI servers.
Demo
- New addition to the demonstration application: schema binding.
0.6 (2010-09-03)
Features
Sequence widgets are no longer structural by default; they now print the label of the sequence above the sequence adder.
Radio buttons in a radio button choice widget are now spaced closer together and the button is on the left hand side.
The sequence remove button is no longer an image.
The sequence widget now puts the sequence adding link after any existing items in the sequence (previously the link was always beneath the sequence title).
It is now possible to associate a widget with a schema node within the schema directly. For example:
import colander import deform.widget class MySchema(Schema): description = colander.SchemaNode( colander.String(), widget=deform.widget.RichTextWidget() )
For more information, see “Changing the Default Widget Associated With a Field” in the documentation.
The constructor of deform.Field.
Requirements
- This Deform version requires colander version 0.7.3 or better.
Bug Fixes
- RichTextWidget, AutocompleteInputWidget, TextInputWidget with input masks, and CheckedInputWidget with input masks could not be used properly within sequences. Now they can be. See also Internal and Backwards Incompatibilities within this release’s notes. This necessitated new required deform.load() and deform.addCallback() JavaScript APIs.
- Radio choice widgets included within a submapping no longer put their selections on separate lines.
- Rich text widgets are now 500 pixels wide by default instead of 640.
- RadioChoiceWidgets did not work when they were used within sequences. Making them work required some changes to the its template and it added a dependency on peppercorn >= 0.3.
- To make radio choice widgets work within sequences, the deform.addSequenceItem JavaScript method needed to be changed. It will now change the value of name attributes which contain a marker that looks like an field oid (e.g. deformField1), and, like the code which changes ids in the same manner, appends a random component (e.g. deformField1-HL6sgP). This is to support radio button groupings.
- The mapping and sequence item templates now correctly display errors with msg values that are lists. Previously, a repr of a Python list was displayed when a widget had an error with a msg value that was a list; now multiple <p> nodes are inserted into the rendering, each <p> node containing an individual error message. (Note that this change requires colander 0.7.3).
Backwards Incompatibilities
- The JavaScript function deform.load() now must be called by the HTML page (usually in a script tag near the end of the page, ala <script..>deform.load()</script>) which renders a Deform form in order for widgets which use JavaScript to do proper event and behavior binding. If this function is not called, built-in widgets which use JavaScript will no longer function properly.
- The JavaScript function deformFocusFirstInput was removed. This is now implied by deform.load().
- The closebutton_url argument to the SequenceWidget no longer does anything. Style the widget template via CSS to add an image.
Internal
- Provided better instructions for running the demo app and running the tests for the demo app in deformdemo/README.txt.
- Try to prevent false test failures by injecting sleep statements in things that use browser.key_press.
- Moved deformdemo/tests/test_demo.py to deformdemo/test.py as well as moving deformdemo/tests/selenium.py to deformdemo/selenium.py. Removed the deformdemo/tests subdirectory.
- The date input widget now uses JQueryUI’s datepicker functionality rather than relying on JQuery Tools’ date input. The latter was broken for sequences, and the former works fine.
- The various deform* JavaScript functions in deform.js have now been moved into a top-level namespace. For example, where it was necessary to call deformFocusFirstInput() before, it is now necessary to call deform.focusFirstInput().
- Make the TinyMCE rich text widget use mode: 'exact' instead of mode: 'textareas'.
- richtext, autocomplete_input, textinput, checked_input, and dateinput, and form templates now use the new deform.addCallback indirection instead of each registering their own JQuery callback or performing their own initialization logic, so that each may be used properly within sequences.
- Change sequence adding logic to be slightly simpler.
- The sample app form page now calls deform.load() rather than deformFocusFirstInput().
- Added new demo app views for showing a sequence of autocompletes, a sequence of dateinputs, a sequence of richtext fields, a sequence of radio choice widgets and a sequence of text inputs with masks and tests for same.
Documentation
- Added a note about get_widget_resources to the “Basics” chapter.
- Added a note about deform.load() JavaScript requiredness to the “Basics” chapter.
- Add new top-level sections named Widget Templates and Widget JavaScript to the “Widgets” chapter.
0.5 (2010-08-25)
Features
- Added features which make it possible to inquire about which resources (JavaScript and CSS resources) are required by all the widgets that make up a form rendering. Also make it possible for a newly created widget to specify its requirements. See “Widget Requirements and Resources” in the widgets chapter of the documentation.
- Add the get_widget_requirements method to deform.Field objects.
- Add the get_widget_resources method to deform.Field objects.
- Allow deform.Field (and deform.Form) objects to accept a “resource registry” as a constructor argument.
- Add the deform.Field.set_widgets method, which allows a (potentially nested) set of widgets to be applied to children fields of the field upon which it is called.
- Add the deform.widget.TextInputCSV widget. This widget is exactly like the deform.widget.TextAreaCSV widget except it accepts a single line of input only.
- The default widget for colander.Tuple schema types is now deform.widget.TextInputCSV.
- The deform.widget.FileUploadWidget now returns an instance of deform.widget.filedict instead of a plain dictionary to make it possible (using isinstance) to tell the difference between file upload data and a plain data dictionary for highly generalized persistence code.
0.4 (2010-08-22)
Bug Fixes
- When the hidden widget is used to deserialize a field, return colander.null rather than the empty string so that it may be used to represent non-text fields such as colander.Integer. This is isomorphic to the change done previously to deform.TextInputWidget to support nontextual empty fields.
- Fix typo about overriding templates using set_zpt_renderer in templating chapter.
- Fix link to imperative schema within in Colander docs within “Basics”.
- Remove duplicate deform.widget.DateInputWidget class definition.
Features
- Add a deform.widget.RichTextWidget widget, which adds the TinyMCE WYSIWIG javascript editor to a text area.
- Add a deform.widget.AutocompleteInputWidget widget, which adds a text input that can be supplied a URL or iterable of choices to ease the search and selection of a finite set of choices.
- The deform.widget.Widget class now accepts an extra keyword argument in its constructor: css_class.
- All widgets now inherit a css_class attribute from the base deform.widget.Widget class. If css_class` contains a value, the “primary” element in the rendered widget will get a CSS class attribute equal to the value (“primary” is defined by the widget template’s implementor).
- The deform.Field class now as an __iter__ method which iterates over the children fields of the field upon which it is called (for item in field == for item in field.children).
0.3 (2010-06-09)
Bug Fixes
- Change default form action to the empty string (rather than .). Thanks to Kiran.
Features
- Add deform.widget.DateInputWidget widget, which is a date picker widget. This has now become the default widget for the colander.Date schema type, preferred to the date parts widget.
- Add text input mask capability to deform.widget.TextInputWidget.
- Add text input mask capability to deform.widget.CheckedInputWidget.
Backwards Incompatibilities
- Custom widgets must now check for colander.null rather than None as the null sentinel value.
- Dependency on a new (0.7) version of Colander, which has been changed to make using proper defaults possible; if you’ve used the default argument to a colander.SchemaNode, or if you’ve defined a custom Colander type, you’ll want to read the updated Colander documentation (particularly the changelist). Short story: use the missing argument instead.
- If you’ve created a custom widget, you will need to tweak it slightly to handle the value colander.null as input to both serialize and deserialize. See the Deform docs at for more information.
0.2 (2010-05-13)
Every form has a formid now, defaulting to deform. The formid is used to compute the id of the form tag as well as the button ids in the form. Previously, if a formid was not passed to the Form constructor, no id would be given to the rendered form and the form’s buttons would not be prefixed with any formid.
The deform.Form.
0.1 (2010-05-09)
- Initial release.
- Author: Chris McDonough, Agendaless Consulting
- Keywords: web forms form generation schema validation
- License: BSD-derived ()
- Categories
- Intended Audience :: Developers
- Programming Language :: Python
- Programming Language :: Python :: 2.6
- Programming Language :: Python :: 2.7
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.2
- Programming Language :: Python :: 3.3
- Programming Language :: Python :: Implementation :: CPython
- Programming Language :: Python :: Implementation :: PyPy
- Package Index Owner: chrism
- Package Index Maintainer: miohtama
- DOAP record: deform-0.9.7.xml | https://pypi.python.org/pypi/deform/0.9.7 | CC-MAIN-2017-04 | refinedweb | 3,131 | 60.11 |
Hello All, First off, thanks again to all who answered my loop problem Re: 'IndexError....'. I got it understood now. The problem of my script below is in the proceed function: if Y is selected, instead of staying in the option menu, the program just shows the option menu then exits. ditto in the 'really quit program' prompt: i expect to go to main menu if i select N but again program exits. can you guys point me to my error? this is just a simple script but it took me some time to figure out on my own; its a good learning exercise nevertheless. what to do to improve the program further, e.g., make it simple but efficient? i love to hear your good advise. #!/usr/bin/env python # filename: tempConvert.py # description: temperature conversion program # Author: Eri Mendz # Fri Nov 5 13:53:16 AST 2004 import sys def print_options(): print ''' THIS IS A TEMPERATURE CONVERSION PROGRAM. Options: [C] - convert to Celsius [F] - convert to Fahrenheit [P] - print options [Q] - quit ''' print_options() def f2c(ctemp): return (9/5.0)*ctemp + 32 def c2f(ftemp): return (ftemp - 32) * 5/9.0 def proceed(): proceed = raw_input("do another conversion? [Y|N]: ") if proceed == 'y' or proceed =='Y': print_options() else: confirmQuit() def confirmQuit(): ask = raw_input("Really quit program? [Y|N]: ") if ask == 'y' or ask == 'Y' or ask == 'ye' or ask == 'yes': sys.exit("bye") else: print_options() # begin while 1: choice = raw_input("select options: ") if choice == 'c' or choice == 'C': try: getftemp = int(raw_input("enter fahrenheit temperature: ")) print "temp in C is: ", c2f(getftemp) proceed() except ValueError: print "error: not a valid input!" break elif choice == 'f' or choice == 'F': try: getctemp = int(raw_input("enter centigrade temperature: ")) print "temp in F is: ", f2c(getctemp) proceed() except ValueError: print "error: not a valid input!" break elif choice =='p' or choice == 'P': print_options() elif choice =='q' or choice == 'Q': confirmQuit() else: print "invalid option" print "bye" | https://mail.python.org/pipermail/tutor/2004-November/033072.html | CC-MAIN-2016-50 | refinedweb | 324 | 64 |
FreeMarker Grails Plugin
Dependency:
compile ":freemarker:0.4"
Summary
The Grails FreeMarker plugin provides support for rendering FreeMarker templates as views.
Description
IntroductionThe Grails FreeMarker plugin provides support for rendering FreeMarker templates as views.
Getting Started
Installing The FreeMarker PluginInstall the FreeMarker plugin with the install-plugin command:
grails install-plugin freemarker
Rendering FreeMarker TemplatesThe FreeMarker plugin supports rendering FreeMarker templates as views. FreeMarker templates should be defined below the views/ directory in the same places where you might define GSP views. For example, if you have a controller named DemoController that looks like this:
Then you could define a FreeMarker template in grails-app/views/demo/index.ftl that looks like this:
class DemoController { def index = { [name: 'Jeff Beck', instrument: 'Guitar'] }}
<html> <body> Name: ${name} <br/> Instrument: ${instrument}<br/> </body> </html>
FreeMarker Tag LibraryThe FreeMarker plugin contributes a tag called render which is defined in the fm namespace. The tag works much like the render tag that is bundled with grails except that it renders FreeMarker templates instead of GSPs. The template supports the template and model attributes and may be used from any GSP. The following example shows the tag being used from a GSP.
<html> <body> <fm:render </body> </html>
TroubleshootingPer, in applications with more than one view resolver, UrlMappings.groovy may need to be updated. . When adding this plugin to an existing grails project that also uses .gsp by default the "/" mapping will be indeterminate. Fix by setting "/"(view:"/index.gsp") or "/"(view:"/index.ftl") if that is what you want to use.
More InformationFor more information on FreeMarker see the FreeMarker site.
Release Notes
Version 0.3
- Upgrade to FreeMarker 2.3.16
- Improve access to flash scope in a FreeMarker template
Version 0.4
- GPFREEMARKER-11 fix
- Adding FreemarkerViewService and FreemarkerTemplateService
- Packages renamed | http://grails.org/plugin/freemarker | CC-MAIN-2014-49 | refinedweb | 299 | 58.69 |
In this article, We will see how to handle Lists in thymeleaf templates with an example using th:each attribute.
Loop through a Lists
Let’s create a list of Objects first and then supply it to the Model and View. For this reason, We created a
UserInfo object.
public class UserInfo { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String firstName; private String lastName; }
The list we are going to use in our thymeleaf model is from database records. For this reason, We created the following service.
public List<UserInfo> getUsers() { return userInfoRepository.findAllByActiveOrderByIdDesc(true); }
Now that we have a list of UserInfo objects, Let’s write a controller method and map it to a thymeleaf view. In this case, the view name is “home.html”
@RequestMapping(path = "/", method = RequestMethod.GET) public String getUsers(Model model) { List<UserInfo> users = userService.getUsers(); model.addAttribute("userList", users); return "home"; }
Here the list is called userList, and we can use th:each to loop through this list in the
home.html thymeleaf template as shown below.
<table> <tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> </tr> <tr th: <td class="align-middle" th:</td> <td class="align-middle" th:</td> <td class="align-middle" th:</td> </tr> </table>
Empty lists in Thymeleaf View
In the above example, the table would look unpleasant if there are no rows. To handle these cases, You can make use the
List.isEmpty() method along with boolean expressions. Here is how you can do that.
<tr th: <td class="text-center" colspan="3">No Records found. Add some...!</td> </tr>
You can also use the following expressions in the place of
${userList.isEmpty()}.
${userList.empty}– A short form of the above as isEmpty() is a getter for the field empty
#lists.isEmpty(users)– This expression used the built-in #lists utility object from thymeleaf.
Accessing list elements by position
If you want to display only the Nth element of a list, you can use any of the following methods to help yourself.
<div th:</div> <div th:</div>
Here, the first method uses typical java methods from a
List object.The latter uses SpEL to get the second item from a collection.
Loop information of List
With the above examples, there seems to be no way to get the current index of the elements. However, thymeleaf has something for this too. With th:each, you can also get a handle to a stats object that provides some crucial information about the iteration.
To access the stats variable, you need to rewrite your
th:each expression as shown here.
<tr th: <td class="align-middle" th:</td> <td class="align-middle" th:</td> <td class="align-middle" th:</td> <td class="align-middle" th:</td> </tr>
With the stats variable, you get the following aspects of a given list. They are,
Good thing about thymeleaf is that if you don’t ask for a stats variable yourself, it will create one for you silently. For example, you can access the stat variable even without defining one.
<tr th: <td class="align-middle" th:</td> <td class="align-middle" th:</td> <td class="align-middle" th:</td> <td class="align-middle" th:</td> </tr>
As you notice, thymeleaf supplies a
userStat variable for you to make use of. The naming convention would be ** whatever the objectName + Stat**.
Conclusion
To summarize, We learned how to loop through lists using thymeleaf th:each attribute. If you want to learn more about thymeleaf, check out our post on how to build a CRUD web application using thymeleaf.
If you want examples of looping through lists in thymeleaf, checkout this github link. | https://springhow.com/thymeleaf-lists/ | CC-MAIN-2021-10 | refinedweb | 614 | 64.71 |
img_write_file()
Encode a frame to a file on the filesystem
Synopsis:
#include <img/img.h> int img_write_file( img_lib_t ilib, const char* path, const img_encode_callouts_t* callouts, img_t* img );
Arguments:
- ilib
- A handle for the image library, returned by img_lib_attach().
- path
- The full path to the file to create.
-.
Library:
libimg
Use the -l img option to qcc to link against this library.
Description:
This function encodes a frame to a file on the filesystem. This function is only capable of encoding a single frame. A codec is chosen based on the extension included in the provided filename.
The file will be automatically unlinked if the encode fails for any reason. | http://developer.blackberry.com/playbook/native/reference/com.qnx.doc.libimg.lib_ref/com.qnx.doc.neutrino.lib_ref/topic/i/img_write_file.html | CC-MAIN-2016-40 | refinedweb | 109 | 66.33 |
The CrashRpt project is being hosted at.
If you've ever been tasked with debugging a fatal exception, you probably know how difficult it can be given only the user's steps to reproduce. Many factors such as the application's version, user's operating system, and dependent modules may contribute to the eventual crash. This makes duplicating the user's environment and thereby the crash, nearly impossible for all but the most obvious bugs.
The CrashRpt library is a light weight error handling framework. This module will intercept any unhandled exception generated by your application, build a complete debug report, and optionally, mail the report to you.
In this article, a crash report refers to a collection of files intended to help the developer quickly diagnose the cause of a crash. Specifically the crash report includes a minidump, a crash log and up to ten additional application specific files supplied by the application via a crash callback. Of these the most useful will most likely be the application minidump. The minidump contains the call stack, local variables, details all of your application's modules, and can even help pinpoint the source line number that generated the exception.
The CrashRpt DLL works like the new Dr. Watson utility that ships with XP. It intercepts unhandled exceptions, creates a minidump, builds a crash log, presents an interface to allow the user to review the crash report, and finally it compresses and optionally emails the crash report back to you.
When an unhandled exception is detected, CrashRpt notifies the user and allows them to review the report contents. First the main dialog shown above is displayed. From here the user can enter their comments and email address or review the report contents by clicking the hyperlink. This takes them to the details dialog, where they are presented with the files that make up the report. Double clicking on the filename will open that file in its associated program, if an association exists for that file type.
Once the user is satisfied, he may close the details dialog and click the 'Send' button on the main dialog, which will email his complete crash report to you.
Download and unzip the source code attached to this article. Open the complete.dsw workspace located in the top level directory. This workspace contains the source for the two sample applications and the CrashRpt library. You only need to build the CrashRpt project - crashrpt.dsp.
complete.dsw
Notes:
After the build completes, you should end up with the following:
crashrpt\include
crashrpt.h
crashrpt\bin\debug or crashrpt\bin\release
crashrpt.dll
crashrpt\lib
crashrpt.lib
crashrpt\src
[all source files...]
To implicitly link against the library, you need to include the crashrpt.h file and link in the crashrpt.lib file. I find it easiest to add the following two lines to my main application file.
#include "[whateveryourpath]/crashrpt/include/crashrpt.h"
#pragma comment(lib, "[whateveryourpath]/crashrpt/lib/crashrpt")
The library needs to be initialized before it will catch any exceptions. You do this by calling the Install method, usually from your main function. The Install method is detailed below.
Install
//-----------------------------------------------------------------------------
// Install
// Initializes the library and optionally set the client crash callback and
// set up the email details.
//
// Parameters
// pfn Client crash callback
// lpTo Email address to send crash report
// lpSubject Subject line to be used with email
//
// Return Values
// If the function succeeds, the return value is a pointer to the underlying
// crash object created. This state information is required as the first
// parameter to all other crash report functions.
//
// Remarks
// Passing NULL for lpTo will disable the email feature and cause the crash
// report to be saved to disk.
//
CRASHRPTAPI
LPVOID
Install(
IN LPGETLOGFILE pfn OPTIONAL, // client crash callback
IN LPCTSTR lpTo OPTIONAL, // Email:to
IN LPCTSTR lpSubject OPTIONAL // Email:subject
);
All of the parameters are optional. The first parameter is a pointer to a crash callback function defined as:
// Client crash callback
typedef BOOL (CALLBACK *LPGETLOGFILE) (LPVOID lpvState);
You would define this callback only if you wanted to be notified of an application failure, so that you could perform some basic clean up (i.e. close db connections, attempt to save, etc). Otherwise, you can simply pass NULL for this parameter.
NULL
The second parameter defines the email address you want the crash report mailed to, or NULL if you prefer the reports be saved to the user's workstation.
The third parameter is the subject line used in the generated mail message.
The Install function returns a pointer to the underlying object that implements the real functionality of this library. This value is required for all subsequent calls into the library.
If, after you have called Install, you decide to unhook the CrashRpt library, you would call Uninstall.
Uninstall
//-----------------------------------------------------------------------------
// Uninstall
// Uninstalls the unhandled exception filter set up in Install().
//
// Parameters
// lpState State information returned from Install()
//
// Return Values
// void
//
// Remarks
// This call is optional. The crash report library will automatically
// deinitialize when the library is unloaded. Call this function to
// unhook the exception filter manually.
//
CRASHRPTAPI
void
Uninstall(
IN LPVOID lpState // State from Install()
);
You would only ever call Uninstall if you decided, after calling Install, that you did not want the CrashRpt library to intercept exceptions. So, basically you will probably never call this method directly.
The client application can, at any time, supply files to be included in the crash report by calling the AddFile function.
AddFile
//-----------------------------------------------------------------------------
// AddFile
// Adds a file to the crash report.
//
// Parameters
// lpState State information returned from Install()
// lpFile Fully qualified file name
// lpDesc Description of file, used by details dialog
//
// Return Values
// void
//
// Remarks
// This function can be called anytime after Install() to add one or more
// files to the generated crash report.
//
CRASHRPTAPI
void
AddFile(
IN LPVOID lpState, // State from Install()
IN LPCTSTR lpFile, // File name
IN LPCTSTR lpDesc // File desc
);
This is useful when your application uses or produces external files such as initialization files or log files. When a report is generated, it will include these additional files.
You can force report generation by calling the GenerateErrorReport. This is useful if you want to provide an easy way to gather debugging information about your application to help debug a non-fatal bug.
GenerateErrorReport
//-----------------------------------------------------------------------------
// GenerateErrorReport
// Generates the crash report.
//
// Parameters
// lpState State information returned from Install()
// pExInfo Pointer to an EXCEPTION_POINTERS structure
//
// Return Values
// void
//
// Remarks
// Call this function to manually generate a crash report.
//
CRASHRPTAPI
void
GenerateErrorReport(
IN LPVOID lpState,
IN PEXCEPTION_POINTERS pExInfo OPTIONAL
);
If you do not supply a valid EXCEPTION_POINTERS, structure the minidump callstack may be incomplete.
EXCEPTION_POINTERS
To get the most out of the minidump, the debugger needs your application's debug symbols. By default release builds don't generate debug symbols. You can configure VC to generate debug symbols for release builds by changing a couple of project settings.
With the release build configuration selected, on the C/C++ tab under the General category, select 'Program Database' under Debug info.
On the Link tab under the General category, check the 'Generate debug info' option.
Now release builds will generate debug symbols in a PDB file. Keep all executables and PDB files for each release that ships to customers. You will need these files to read minidump files in the debugger.
The crash log is an XML file that describes details about the crash including the type of exception, the module and offset where the exception occurred, as well as some cursory operating system and hardware information. I wrote the crash log to make it easier to catalog crashes. A crash can be uniquely identified by the module, offset and exception code. This information could be inspected by a developer or an automated process, and compared against previously reported problems. If a match is found, the developer or automated process, could inform the user of the solution without having to debug the error again.
The log is divided into four different sections or nodes. The first node is ExceptionRecord we discussed earlier.
ExceptionRecord
Next is the Processor node, which contains a little information about the user's CPU.
Processor
Next is the OperatingSystem node, which contains the user's operating system version information.
OperatingSystem
Last is the Modules node. This node contains the path, version, base address, size, and time stamp for every module loaded by the deceased application.
Modules
The crash dump file is a minidump created with the help of the DbgHelp DLL's MiniDumpWriteDump function. The minidump contains various information about the state of the application when the error occurred including the call stack, local variables, and loaded modules. For more on creating minidumps, check out Andy Pennell's article.
DbgHelp
MiniDumpWriteDump
You can view minidump files in VS.NET or the WinDbg debugger. Because WinDbg is free, I'll use it in the following example. You can download WinDbg from here. I'm using version 6.1.0017.0 in the example.
The sample application included with this article does nothing but generate a null pointer exception. I'll use the sample to generate a crash and demonstrate how to use the resulting minidump.
When you run the sample application, click on the bomb button to generate a null pointer exception, and save the resulting crash report. Then extract the crash.dmp file from the crash report, launch WinDbg, and open the crash dump by pressing CTRL+D.
Next, you need to set the symbol path for WinDbg with the .sympath command. Switch to the command window (ALT+1) and enter .sympath followed by a space followed by the semi-colon delimited list of directories to search.
.sympath c:\downloads\CrashRptTest
Similarly you need to set the executable and source search paths with the .exepath and .srcpath commands.
.exepath c:\downloads\CrashRptTest
.srcpath c:\downloads\CrashRptTest
The final step is to change the debugger context to the context record associated with the exception by entering the .ecxr command.
.ecxr
If everything is configured correctly, you should now be able to walk the call stack, see local variables, and loaded modules. You can even have WinDbg highlight the offending line of code by double clicking the CrashRptTest frame in the Call Stack window (ALT+6). Note: The exact line number may be a little off due to linker optimizations.
CrashRptTest
The CrashRpt library relies on a couple of redistributable libraries. To be sure the library has access to the required files, you can distribute the ZLib and DbgHelp I've included.
As I mentioned earlier, to debug a crash you need not only the minidupmp file, but also the symbol and executable files that make up your application. When preparing a build to be released to clients, you should always save the exact executable modules you ship to clients, along with the corresponding debug symbols. This way when a crash report comes in, you will have the modules and debug symbols that the debugger will need to properly interpret the minidump.
I've received several comments/inquiries about shipping debug builds or debug symbols. You should never ship debug builds or debug symbols as they will not only take up more space on your CD/download/client's workstation, but they will also make reverse engineering your code a trivial exercise. To be clear, what I'm suggesting is modify your release build configuration so that it generates debug symbols, saving both the release builds of your modules and their corresponding debug symbols in your source control system and delivering only the release builds of your modules to clients (as you do today). When a crash report comes in, you use the release build and debug symbols you archived, along with the minidump included in the crash report, to debug the crash.
Note: CrashRpt uses Microsoft's Debug Help library (dbghelp.dll). This library was shipped with Windows XP, but certain versions are redistributable. I recommend you to install the dbghelp.dll file, included in the source/demo attachments, along the crashrpt.dll into your application's directory to avoid the possible conflict or missing dependency issues..
Every executable module (EXE, DLL, OCX, whatever) has a preferred base load address. This is the address in the application's process space that the loader will try to map that module. If two or more modules list the same base load address, the loader will be forced to relocate the modules until each module loads at a unique address. Not only does this slow down the start up time of your application, but it also makes it impossible to debug fatal exceptions. In order to use the minidump file, you must ensure that your application's modules do not collide. You can use rebase.exe or manually override the preferred base load address for each conflicting module. Either way you need to make sure that your application modules always load at the same address for the minidump file to be useful. You can find more information about this in John Robbin's April 1998 MSJ column.
For additional information about topics directly related to this article, see the links below:
Major Changes.
Minor Changes.
Bugs Fixed
This article, along with any associated source code and files, is licensed under The BSD License
#ifndef __in_bcount_opt
#define __in_bcount_opt(x)
#endif
#ifndef __out_bcount_opt
#define __out_bcount_opt(x)
#endif
typedef unsigned long ULONG_PTR;
typedef unsigned long *PULONG_PTR;
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages. | http://www.codeproject.com/Articles/3497/Add-Crash-Reporting-to-Your-Applications-with-the?fid=14054&df=90&mpp=25&sort=Position&spc=Relaxed&tid=2105555 | CC-MAIN-2016-22 | refinedweb | 2,254 | 54.42 |
Port. You create a Web service, make it accessible through your firewall and NAT, and the the cloud-hosted app calls it. That’s as easy as it ought to be.
Unfortunately it’s not always that easy. If the server sits behind an Internet connection with dynamically assigned IP addresses, if the upstream ISP is blocking select ports, if it’s not feasible to open up inbound firewall ports, or if you have no influence over the infrastructure whatsoever, reaching an on-premise service from the cloud (or anywhere else) is a difficult thing to do. For these scenarios (and others) our team is building the Windows Azure platform AppFabric Service Bus (friends call us just Service Bus).
Now – the Service Bus and the client bits in the Microsoft.ServiceBus.dll assembly are great if you have services can can be readily hooked up into the Service Bus because they’re built with WCF. For services that aren’t built with WCF, but are at least using HTTP, I’ve previously shown a way to hook them into Service Bus and have also demoed an updated version of that capability at Sun’s Java One. I’ll release an update for those bits tomorrow after my talk at PDC09 – the version currently here on my blog (ironically) doesn’t play well with SOAP and also doesn’t have rewrite capabilities for WSDL. The new version does.
But what if your service isn’t a WCF service or doesn’t speak HTTP? What if it speaks SMTP, SNMP, POP, IMAP, RDP, TDS, SSH, ETC?
Introducing Port Bridge
“Port Bridge” – which is just a descriptive name for this code sample, not an attempt at branding – is a point-to-point tunneling utility to help with these scenarios. Port Bridge consists of two components, the “Port Bridge Service” and the “Port Bridge Agent”. Here’s a picture:
The Agent’s job is to listen for and accept TCP or Named Pipe connections on a configurable port or local pipe name. The Service’s job is to accept for incoming connections from the Agent, establish a duplex channel with the Agent, and pump the data from the Agent to the actual listening service – and vice versa. It’s actually quite simple. In the picture above you see that the Service is configured to connect to a SQL Server listening at the SQL Server default port 1433 and that the Agent – running on a different machine, is listening on port 1433 as well, thus mapping the remote SQL Server onto the Agent machine as if it ran there. You can (and I think of that as to be more common) map the service on the Agent to any port you like – say higher up at 41433.
In order to increase the responsiveness and throughput for protocols that are happy to kill and reestablish connections such as HTTP does, “Port Bridge” is always multiplexing concurrent traffic that’s flowing between two parties on the same logical socket. When using Port Bridge to bridge to a remote HTTP proxy that the Service machine can see, but the Agent machine can’t see (which turns out to be the at-home scenario that this capability emerged from) there are very many and very short-lived connections being tunneled through the channel. Creating a new Service Bus channel for each of these connections is feasible – but not very efficient. Holding on to a connection for an extended period of time and multiplexing traffic over it is also beneficial in the Port Bridge case because it is using the Service Bus Hybrid connection mode by default. With Hybrid, all connections are first established through the Service Bus Relay and then our bits do a little “NAT dance” trying to figure out whether there’s a way to connect both parties with a direct socket – if that works the connection gets upgraded to the most direct connections in-flight. The probing, handshake, and upgrade of the socket may take 2-20 seconds and there’s some degree of luck involved to get that direct socket established on a very busy NAT – and thus we want to maximize the use of that precious socket instead of throwing it away all the time.
That seems familiar?!
You may notice that SocketShifter (built by our friends at AWS in the UK) is quite similar to Port Bridge. Even though the timing of the respective releases may not suggest it, Port Bridge is indeed Socketshifter’s older brother. Because we couldn’t make up our mind on whether to release Port Bridge for a while, I had AWS take a look at the service contract shown below and explained a few principles that I’m also explaining here and they had a first version of Socketshifter running within a few hours. There’s nothing wrong with having two variants of the same thing.
How does it work?
Since I’m publishing this as a sample, I obviously need to spend a little time on the “how”, even I’ll limit that here and will explain that in more detail in a future post. At the heart of the app, the contract that’s used between the Agent and the Service is a simple duplex WCF contract:
[ServiceContract(Namespace="n:", Name="idx", CallbackContract=typeof(IDataExchange), SessionMode=SessionMode.Required)] public interface IDataExchange { [OperationContract(Action="c", IsOneWay = true, IsInitiating=true)] void Connect(string i); [OperationContract(Action = "w", IsOneWay = true)] void Write(TransferBuffer d); [OperationContract(Action = "d", IsOneWay = true, IsTerminating = true)] void Disconnect(); }
There’s a way to establish a session, send data either way, and close the session. The TransferBuffer type is really just a trick to avoid extra buffer copies during serialization for efficiency reasons. But that’s it. The rest of Port Bridge is a set of queue-buffered streams and pumps to make the data packets flow smoothly and to accept inbound sockets/pipes and dispatch them out to the proxied services. What’s noteworthy is that Port Bridge doesn’t use WCF streaming, but sends data in chunks – which allows for much better flow control and enables multiplexing.
Now you might say You are using a WCF ServiceContract? Isn’t that using SOAP and doesn’t that cause ginormous overhead? No, it doesn’t. We’re using the WCF binary encoder in session mode here. That’s about as efficient as you can get it on the wire with serialized data. The per-frame SOAP overhead for net.tcp with the binary encoder in session mode is in the order of 40-50 bytes per message because of dictionary-based metadata compression. The binary encoder also isn’t doing any base64 trickery but treats binary as binary – one byte is one byte. Port Bridge is using a default frame size of 64K (which gets filled up in high-volume streaming cases due to the built-in Nagling support) and so we’re looking at an overhead of far less than 0.1%. That’s not shabby.
How do I use it?
This is a code sample and thus you’ll have to build it using Visual Studio 2008. You’ll find three code projects: PortBridge (the Service), PortBridgeAgent (the Agent), and the Microsoft.Samples.ServiceBus.Connections assembly that contains the bulk of the logic for Port Bridge. It’s mostly straightforward to embed the agent side or the service side into other hosts and I’ll show that in a separate post.
Service
The service’s exe file is “PortBridge.exe” and is both a console app and a Windows Service. If the Windows Service isn’t registered, the app will always start as a console app. If the Windows Service is registered (with the installer or with installutil.exe) you can force console-mode with the –c command line option.
The app.config file on the Service Side (PortBridge/app.config, PortBridge.exe.config in the binaries folder) specifies what ports or named pipes you want to project into Service Bus:
<portBridge serviceBusNamespace="mynamespace" serviceBusIssuerName="owner" serviceBusIssuerSecret="xxxxxxxx" localHostName="mybox"> <hostMappings> <add targetHost="localhost" allowedPorts="3389" /> </hostMappings> </portBridge>
The serviceBusNamespace attribute takes your Service Bus namespace name, and the serviceBusIssuerSecret the respective secret. The serviceBusIssuerName should remain “owner” unless you know why you want to change it. If you don’t have an AppFabric account you might not understand what I’m writing about: Go make one.
The localHostName attribute is optional and when set, it’s the name that’s being used to map “localhost” into your Service Bus namespace. By default the name that’s being used is the good old Windows computer-name.
The hostMappings section contains a list of hosts and rules for what you want to project out to Service Bus. Mind that all inbound connections to the endpoints generated from the host mappings section are protected by the Access Control service and require a token that grants access to your namespace – which is already very different from opening up a port in your firewall. If you open up port 3389 (Remote Desktop) through your firewall and NAT, everyone can walk up to that port and try their password-guessing skills. If you open up port 3389 via Port Bridge, you first need to get through the Access Control gate before you can even get at the remote port.
New host mappings are added with the add element. You can add any host that the machine running the Port Bridge service can “see” via the network. The allowedPorts and allowedPipes attributes define with TCP ports and/or which local named pipes are accessible. Examples:
- <add targetHost="localhost" allowedPorts="3389" /> project the local machine into Service Bus and only allow Remote Desktop (3389)
- <add targetHost="localhost" allowedPorts="3389,1433" /> project the local machine into Service Bus and allow Remote Desktop (3389) and SQL Server TDS (1433)
- <add targetHost="localhost" allowedPorts="*" /> project the local machine into Service Bus and only allow any TCP port connection
- <add targetHost="localhost" allowedPipes="sql/query" /> project the local machine into Service Bus and allow no TCP connections but all named pipe connections to \.\pipes\sql\query
- <add targetHost="otherbox" allowedPorts="1433" /> project the machine “otherbox” into Service Bus and allow SQL Server TDS connections via TCP
Agent
The agent’s exe file is “PortBridgeAgent.exe” and is also both a console app and a Windows Service.
The app.config file on the Agent side (PortBridgeAgent/app.config, PortBridgeAgent.exe.config in the binaries folder) specifies which ports or pipes you want to project into the Agent machine and whether and how you want to firewall these ports. The firewall rules here are not interacting with your local firewall. This is an additional layer of protection.
<portBridgeAgent serviceBusNamespace="mysolution" serviceBusIssuerName="owner" serviceBusIssuerSecret="xxxxxxxx"> <portMappings> <port localTcpPort="13389" targetHost="mymachine" remoteTcpPort="3389"> <firewallRules> <rule source="127.0.0.1" /> <rule sourceRangeBegin="10.0.0.0" sourceRangeEnd="10.255.255.255" /> </firewallRules> </port> </portMappings> </portBridgeAgent>
Again, the serviceBusNamespace attribute takes your Service Bus namespace name, and the serviceBusIssuerSecret the respective secret.
The portMappings collection holds the individual ports or pipes you want to bring onto the local machine. Shown above is a mapping of Remote Desktop (port 3389 on the machine with the computer name or localHostName ‘mymachine’) to the local port 13389. Once Service and Agent are running, you can connect to the agent machine on port 13389 using the Remote Desktop client – with PortBridge mapping that to port 3389 on the remote box."/>
There’s more to write about this, but how about I let you take a look at the code first. I’ve also included two setup projects that can easily install Agent and Service as Windows Services. You obviously don’t have to use those.
[Updated archive (2010-06-10) fixing config issue:]PortBridge20100610.zip (90.99 KB) | http://vasters.com/archive/Port-Bridge.html | CC-MAIN-2019-39 | refinedweb | 1,977 | 58.82 |
tmpnam - create a name for a temporary file
#include <stdio.h> char *tmpnam(char *s);
The tmpnam() function generates a string that is a valid filename and that is not the same as the name of an existing file.
The tmpnam() function generates a different string each time it is called from the same process, up to {TMP_MAX} times. If it is called more than {TMP_MAX} times, the behaviour is implementation-dependent.
The implementation will behave as if no function defined in this document calls tmpnam().
If the application uses any of the interfaces guaranteed to be available if either _POSIX_THREAD_SAFE_FUNCTIONS or _POSIX_THREADS is defined, the tmpnam() function must be called with a non-NULL parameter.
Upon successful completion, tmpnam() returns a pointer to a string.
If the argument s is a null pointer, tmpnam() leaves its result in an internal static object and returns a pointer to that object. Subsequent calls to tmpnam() may modify the same object. If the argument s is not a null pointer, it is presumed to point to an array of at least {L_tmpnam} chars; tmpnam() writes its result in that array and returns the argument as its value.
No errors are defined.
None.
This function only creates filenames.(), open(), tempnam(), tmpfile(), unlink(), <stdio.h>.
Derived from Issue 1 of the SVID. | http://pubs.opengroup.org/onlinepubs/007908775/xsh/tmpnam.html | CC-MAIN-2017-04 | refinedweb | 218 | 64.51 |
vzzzbxNew Members
Posts97
Joined
Last visited
Content Type
Profiles
Forums
Calendar
Posts posted by vzzzbx
How come interest-only mortgages are only banned for people buying the house to live in? If it's such a risk to loan on an interest-only basis, surely that should also apply to interest-only buy-to-let mortgages?
At least I assume it only applies to owner-occupiers. Somehow the rules always seem to be different for buy-to-let.
And yet the mystery still remains of where the money is coming from to pay for all these price rises. Last time I looked, people's salaries weren't getting any bigger. Looks like it's more and more magic money.
Sooner or later, it's all got to come crashing down. The question remains is whether any of us will still be around to benefit from it.
Not sure I agree that everything on the high street is doomed. Sure it's easier and cheaper to get a lot of things online - try getting bits for your desktop computer from the high street and you'll see what I mean.
However some products simply don't translate well into the online world. Take shoes for instance - they might look good but you really do need to try them on before buying. Even if they have your size in stock, they still might be uncomfortable when you're wearing them. You also still need a post office to be able to post back stuff you bought online that you don't want or isn't right.
Then there's the endless coffee shops and cafes. You've been able to make yourself a cup of coffee or a sandwich at home for years yet they show no sign of disappearing any time soon.
Plus there's the hassle of the useless, useless delivery companies used by the likes of Amazon etc. who don't seem to realise that Mon-Fri between 9am and 5pm isn't a good time to try delivering stuff to your house. Deliver it to work you say? Sure - I'm sure your employer would really like a washing machine delivered to their reception area. If Domino's pizza can deliver in the evenings why can't the likes of Parcel Force? And without a dammed surcharge, darn it!
FINALLY!
The immediate question that springs to my mind is: why wasn't this done a lot sooner?
Also the story doesn't seem to mention any hard definitions of "applicants must satisfy lenders that they can repay a mortgage", so maybe Reckless Lending Bank Plc could still set up really crappy risk policies and lend to anyone able to fog up a mirror.
But at least it does say something about Eric's favourite LIAR LOANS. About time they were thoroughly banned and actually should be made illegal with both the borrower and lender facing jail time, in my opinion.
I've been making something similar too, except mine is designed for predicting your future costs based on assumptions you enter.
One thing I'd say that's hard to compensate for is inflation. If you take a figure of 5% for inflation, then £500 in rent today costs more than £500 in 6 months time. At least in theory. Actually it depends on when/if you get a pay rise. If that's in 3 months time, then the last 3 months rent of £500 are easier to handle than before the pay rise. I notice your spreadsheet doesn't factor inflation into the costs of renting, but does take it into account on the buying side.
Another factor pointed out to me on another thread is the ability to overpay a mortgage, which can mean sometimes it's better to buy now and overpay the mortgage than wait then buy.
Also it's interesting to note that if you assume 5% inflation and 4% mortgage interest, the mortgage company is actually losing money giving you a mortgage. Sure they're losing it slower than if they didn't give the mortgage, but they're still losing cash.
But TPTB/BOE/Govt want to prolong things - they prefer the current situation to a housing collapse and big problems for the banks.
Keeping the housing bubble going is all part of propping up the banks so that the banks can become all dominant in our society once again. They must have that power is, I think, the thinking of the bankers in the BOE.
Ahh but what happens when the banks have rebuilt their balance sheets enough so that they can afford to pull the plug on people in arrears in much greater numbers?
I don't for a moment assume the current amounts of forbearance is the banks being helpful to borrowers out of the goodness of their hearts. I much prefer the explaination that there's a solid financial reason they're choosing this course of action.
Maybe the banks are just biding their time. After all, I assume it must cost quite a bit in up-front fees for a bank to be able to repossess a house, market it, find a buyer and get all the paperwork sorted out. Long-term it's better for the bank to do that, but short term it hits their costs. If the bank's already teetering on the edge of bankruptcy it's probably best to do what they're doing - string things along for a while to build up their reserves until they can afford to pull the plug at a later date.
One thing's for sure, if the slow drops accelerate and become a stampede of folks trying to cash out before they lose everything, it's going to be highly entertaining viewing for all here on HousePriceCrash. I predict many smug posts from the people here along the lines of "told you so!". Music to my ears, I would say.
The real icing on the cake would be for some of those TV property "experts" being wiped out. If that happened, I'd laugh long and hard. Schadenfreude anyone?
Then I would say that this shows that even if one tries to stack the deck in favour of their preferrred answer (that the "new paradigm" of higher house prices is sustainable), reality still comes in to mess things up and show you up for an idiot.
As to further house price rises, it looks like there's not much else left to move over from the "interest" side of the total mortgage cost to the "original loan" side. So short of some more crazy lending, higher incomes for everyone or more people with incomes per household buying together, those numbers don't look like they've got much ability to go any higher.
Sometimes it pays to argue against what you think to be true. Here I tried to find some way to justify the estate agent / deluded seller view and failed. I'm glad I did. It would be worrying if there was some way to make the numbers stack up. This whole site wouldn't be worth much if it really was a one-off "paradigm shift".
It's true there's some fairly obvious flaws in the assumptions - that the interest rate would remain the same for the entire 25 year term being the biggest. It's an oversimplification I used to help pose the original question.
The point of the post was intended to show some sort of crazy logic to the idea of higher house prices being sustainable. (Not that I think they are, I should add). I suppose if you assumed that interest rates can't go up significantly for the next 10-25 years and shut your eyes, run quickly over the shaky assumptions with your fingers in your ears going "LA LA LA", you might come to the conclusion that it's kinda sustainable.
Why was I trying to justify current prices? Mostly so that I can have a rock-solid comeback pointing out why they're not sustainable when I hear stuff like this spouting from the mouths of those who are hoping that prices don't drop any more.
The other one you often hear is that apparently women have suddenly started working in the last 10 years (!) so therefore now that there's two incomes available to pay the mortgage instead of one, it justifies a doubling in house prices. I leave that one as an exercise to those so inclined to point out how ridiculous a statement this is.
Here's an interesting conundrum to pose:
Late 1990's style scenario:
Income: 20k/year
House price: 65k
Price/income ratio: 3.25
Deposit: 6.5k
Mortgage interest rate: 10%
Monthly mortgage payment: £531
Total paid over entire 25-year mortgage term inc. deposit: £165,976
Theoretical current day(ish) scenario (i.e. not entirely the same as today's reality, more of a thought experiment):
Income: 25k/year
House price: 120k
Price/income ratio: 4.8
Deposit: 12k
Mortgage interest rate: 3.2%
Monthly mortgage payment: £523
Total paid over entire 25-year mortgage term inc. depost: £169,035
Did you notice that the total paid over the whole mortgage term is about the same in both scenarios?
Also note the monthly payments. Nearly the same. However look at the headline price of the house: 120k vs. 65k. Surely the 120k price must be too high! Look at the price-to-income ratio - even though the monthly payments and overall mortgage cost over 25 years are nearly the same, one is clearly much higher than the other.
So the question to ask ourselves is: does the house-price-to-income ratio really give us a reliable way to measure whether a house is too expensive or not?
Or more generally: If the overall cost of owning a house over a 25 year mortgage term is X, part of X is the initial loan amount and part of it is interest. Today's lower interest rates mean that the share of X taken up by interest has reduced. Does this then mean that the headline price of a house can increase and have no effect on overall affordability?
I'm wondering if some of the clever folks the frequent this forum can point out any obvious flaws to this argument...
These calc's are flawed!! Using your figures if you can save £2,500 whilst renting @ £900PCM, then surely you can 'save' £2,100PCM when paying mortgage of £1,304. Also from my experience of South West London properties worth £280k seem to go for around £1400PCM (6% gross). Finally if you can really save £2,100 on top of your £1,300a month mortgage, surely you'd be overpaying on your mortgage by a significant amount each month thus reducing the amount it costs you in interest!
Overall I don't disagree with you with renting not always being the wrong choice, but those calcs are all wrong!
Indeed you could save or overpay while paying a mortgage, but that wasn't the point I was trying to make. It was simply to show the fallacy of the statement that "renting is always dead money", when clearly it isn't. However, in the illustration probably I should have put the following disclaimer:
"The following situation assumes that you're working your ar$e off giving up all sorts of things to get the deposit you need for the house. It further assumes that this is unsustainable in the long term and that once you get the mortgage, you'll not be overpaying on it."
However, for the doubters, allow me to present option 5: "the whole in the house way with 1 year renting"
You wait one year renting at £900 per month
After 1 year, you have a £56k deposit (as per option 2)
You get a 20% loan-to-value mortgage of £224k at 3.84%
This gives a monthly mortgage payment of £1191 over 24 years
But you overpay by 2500+900-1191=£2209 each month (again ignoring early repayment charges)
The total payment for the whole mortgage term is £251,965 paid in 6.18 years
Added to your £56k deposit and 1 year's rent of 900x12=£10,800 you've paid £318,765 for your house
Compared to the "whole in the house way" method that Mayalabeille described earlier which costs £316,110. So a difference of £2,655 in favour of Mayalabeille's option.
However, I've not counted the fact you get a lower mortgage interest rate on an 80% loan-to-value mortgage than on a 90% one, neither have I counted the 1 year's interest you'd earn on the deposit fund, nor the fact that house prices are slowly drifting lower at the moment. Even a 1% drop in prices over a year would be worth £2800 on it's own, which would still mean that waiting a year and renting actually saves you money.
All of which goes back to my (badly explained) main point that GIVEN THE RIGHT CIRCUMSTANCES, renting is not "dead money".
I know there is a lot of factor not taken into account but I am starting to be fed up of people manipulating figure to get them say what they want. I can do this to and just proved it.
Yes renting is better in some case, buying in some other. Yes house price are too high and so are rent but giving illustration as this one does not make any sense when it is just to illustrate your own point of view.
Anyway, I hope some people will find all these options illustration useful.
M
Not sure I'd go so far as to say it's manipulating the figures. It's more like saying "given this set of parameters, this is the result". Sure - it's certainly possible to overpay and it does save cash. My original illustration assumed a (hopefully more realistic) situation where people save like crazy for a few years for a deposit, then ease back afterwards because the cash is needed for other things such as insurance, repairs, holidays, kids, pension savings, replacing rust bucket cars and the like.
But yes, if you're hell-bent on paying off the mortgage as fast as possible then the calculations show it's cheaper to get a place now and overpay on it. Even then it might not be so clear-cut because of early repayment charges.
My main motivation for the post was to show those folks who continually trot out the "renting is dead money" mantra that it's not so clear-cut and will depend on the circumstances. So maybe the title should more accurately have been "Renting is sometimes dead money, sometimes not".
(Please take this as constructive criticism)
In scenario 1, can't you move to a better monthly rate once you've paid off some of the capital? (Assuming prices are flat of course!)
No problem, all constructive criticism welcomed!
Yes, you probably could move to a better monthly rate after a while. But then so could scenario 2. What I was trying to do was to give a relatively straightforward argument that lots of people can understand. Perhaps that's not possible with mortgages, but it's worth a try.
Who can save £2500 a month???
Admittedly not many people. Maybe I should make a spreadsheet so people can put their own numbers in to see how much they'd save.
In any case, I think this is a strong case for compulsary teaching of financial literacy in schools. There's far too many people don't do calculations like this before taking the plunge.
We always hear people telling you that "renting is dead money". All that is, except people on this site. So for your edification (and a convenient page to point the doubters to), I present a fully worked example of when renting can save you money against a mortgage.
Enjoy!
The situation:
You want to buy a house costing £280k and prices aren't rising
You have a deposit saved up of £37k
You're currently renting a place for £900/month
You can save £2500/month while renting
Option 1: buy now
You put down a deposit of £28k (10%), holding back £9k for fees, repairs, emergencies etc.
You get a 90% loan-to-value HSBC fee-free mortgage of £252k @ 3.84%
This gives a monthly mortgage payment of £1,308 over 25 years
The total payment for the whole mortgage term is £392,396
Added to your £28k deposit you've paid £420,396 in total for your house
Option 2: rent one year then buy
After 1 year, your deposit fund is now 2500x12+37000=£67k
You put down a deposit of £56k (20%), holding back £11k for fees, repairs, emergencies etc.
You get a 80% loan-to-value HSBC fee-free morgage of £224k @ 3.29%
This gives a monthly mortgage payment of £1126 over 24 years
The total payment for the whole mortgage term is £324,246
Added to your £56k deposit and 1 year's rent at £900/month you've paid £391,046 in total for your house
Summary:
Option 1 total cost = £420,396
Option 2 total cost = £391,046
Meaning option 2 saves you £29,350 total and means your mortgage payments are £182/month cheaper.
For one year's "dead money" renting, that's quite a lot of cash you've saved!
Conclusion: Renting isn't always "dead money". And I've not even counted the extra interest you'd earn investing your deposit fund for one year (3% of £37k = £1,110) and the fact that in this case you'd have an extra £2k in your emergency fund.
It's probably a good thing. Normal London's pretty much at breaking point regarding transport links anyway - just look what happens when an underground line has a train delayed for more than about 5 minutes - it's mayhem!
If you had that plus Olympics numbers, you'd get gridlock. Probably a lot of people realised this along with the warnings and decided to stay away. Can't say I blame them really. I work in London and was seriously contemplating just taking a holiday while the games were on to avoid the inevitable travel hell they were predicting.
In my area of the West Midlands, I'm not seeing much new stuff coming onto the market and the stuff that does is the usual 2007 +10% asking price insanity. This is usually followed by lots of viewings with no offers, followed by a long period of nothing, followed by a slow series of price drops. However, stuff that's halfway decent with a realistic asking price seems to sell quite quickly.
Higher priced stuff seems to sit there doing nothing. I haven't been watching the bottom end, so can't comment on that.
Overall I'd say that not much is coming up for sale and not much is selling. Basically stalemate. Quite a number of bungalows for sale, though.
The idea of automated checkouts isn't a bad idea per se, but the current machines suck. I've been in supermarkets waiting to use the self-service checkouts and they have to have one member of staff permanently by them to sort out issues every time the customer does the most innocuous thing like putting the slightest bit of weight on the bagging area at the wrong time. If memory serves, there was a BBC show a few months ago that claimed it actually took longer on average to serve yourself with those machines than it did with a person.
Now RFID isn't a bad idea because you can simply dump your whole basket into a scanning area and it will count everything in the basket at once. You'd then pay for it and move the basket to a bagging area to pack your stuff away, thereby freeing up the scanner for the next customer. Now that, I'd go for.
But how about all the other companies they're driving out of business? Game? Waterstones? HMV? Currys?
How many times do you hear "I could get it on the Internet for less" - usually when people say that, they tend to mean Amazon more often than not.
Their revenues are consistently up and they're investing in lots of infrastructure to be able to keep the revenues growing. The theory being once they've grown enough, they can simply stop investing so much in new infrastructure and generate large profits.
I also wonder if they'll become the iTunes of e-books. Surely that's got to be worth something...
Who's touting him? ISTR thinking before the election Philip Hammond might make a chancellor, but I'm not so sure now.
Yes, Vince (probably uniquely among members of government, either this one or nulab) warned publicly of the crisis well ahead of time. He was good at that. But his record in government marks him as one of those people who's much better at diagnosing a problem than fixing it.
Although it should be mentioned that (according to Wikipedia anyway) Vince Cable has degree in Economics from Cambridge, a PhD in Economics from Glasgow University and was chief economist to Shell for a couple of years, whereas Osborne got a 2:1 in Modern History from Oxford and his commercial experience was a brief data entry job and a short job folding towels at Selfridges before switching to politics full time.
Of the two, I know which one I'd rather have as chancellor.
It wouldn't be so bad if you were required as a condition of getting those benefits to do some socially useful activities for a few hours each week. Even if it's only something like clearing up litter or re-painting fences.
I get the feeling there's lots of unskilled jobs that need doing to keep things running smoothly that could be done by people on benefits.
It also ignores the old wisdom that "trees don't grow to the sky". A company can only get so big before it can't realistically grow any more. So at some point it will need to keep investors happy by starting to pay them dividends instead of relying on their share price continuing to rise.
I would assume investors don't really care so much whether the returns come from profits or growth, so long as it's a good percentage return on the cost of the shares when they bought them.
What happens when country B is only good at shopping?
Oh! Oh! I know this one! It means they're totally screwed, right?
Or maybe they could operate an export industry of "personal shoppers" or something.
Just to play devil's advocate for a moment, but isn't a free market based on the premise of the supplier who fulfils the customer's needs the best being the one who wins the sale?
If they gave the contract to Bombardier (which would surely be a good thing for the UK economy) based on the fact it's British and not foreign, then we're effectively not working a free market system. This discourages the UK company from needing to improve their offerings because they know unless they're utterly rubbish, they'll win the contract based on their nationality.
It also works both ways. We like it when a British company wins a big contract from a foreign government, but this only works if that government chooses the company that can best supply their needs.
There's also the economic concept of the division of labour. Put simply, it says that if you have two countries A and B and they make two different products X and Y, then the most profitable way for everyone is to have each country produce the products it can make the most efficiently. Hopefully this means that country A produces product X 100% of the time and country B makes product Y 100% of the time. Or more casually, it's more profitable to put Steve Jobs to work running a consumer electronics company full-time than have him spend half his time doing something that he's not quite so good at.
If I buy the house from the bank for £150,000 my bank balance (the bank's liability) drops by £150,000.
The asset side of the bank's balance sheet also drops by £150,000, the book value of the house.
Hence the contraction of both the bank's balance sheet and the broad money supply, each by £150,000.
Still not sure I follow you. Bank A sells the house for £150k to someone who presumably takes out a mortgage with Bank B so they can pay the £150k. So as far as I can tell, the only contraction is from £180k of mortgage debt loaned to Billy the Punter to £150k minus deposit for Ben the Buyer.
Overall the original situation was:
Mortgage owed to bank A: £180k
Equity: -£30k (180k mortgage vs 150k value)
Whereas afterwards (assuming Ben's deposit was 15k):
Mortgage owed to bank B: £135k
Equity: £15k (135k morgage vs 150k value)
Billy's negative equity owned to Bank A: £30k
I make that 135+30=£165k owed to the banks (Bank A and Bank
. Plus Ben's £135k mortgage is backed up by £15k in equity, thereby protecting the bank against future house price falls.
If repossession is happening all over the place, you'd find that Bank A and Bank B are swapping mortgages between themselves, so I'd guess that their balance sheets would drop a bit, but they'd be more protected against further price falls.
Or am I missing something vital?
Get Used To U.s. Yields Nearer 4% Than 2%
in House prices and the economy
Posted
I'm wondering if this is going to be the straw that broke the camel's back. Once investors start demanding a normal, healthy above-inflation return on their investment in US government debt, which is supposed to be the safest possible investment class, everything else has to go up too. Why would you loan anyone else cash if it's more risky than loaning it to the US government and is also paying a lower rate?
It causes a cascade of other things to happen. Rates go up across the board. Taking it further, this puts stress on other areas of the system which could be enough to make them go pop.
It also calls into question those other highly indebted countries like the UK, so could force up the government's cost of borrowing. This could cause a loss of confidence in the UK's ability to repay its debts without having to fire up the printing press to inflate it all away. But that simply means investors will demand a higher yield to make sure that doesn't happen.
You then have to look at the UK banks. Why bother lending out cash on mortgages to get a measly 2-3% return (below inflation), when they could simply lend it to the US government for 10 years and get 4%?
So the UK government could struggle to raise the funds they need to keep going. This might force them to look very carefully at what they're spending their cash on. Anything that isn't essential could face the chop, including such things as stupidly extravagent mortgage guarantee schemes that put them right in the firing line if/when house prices go pop.
I think it will be interesting, to say the least. Once the herd is spooked, even governments can't control the markets. | https://www.housepricecrash.co.uk/forum/index.php?/profile/34162-vzzzbx/content/&type=forums_topic_post&change_section=1 | CC-MAIN-2021-43 | refinedweb | 4,673 | 67.89 |
java lab programs - Java Beginners
for Complex numbers in Java. In addition to methods for basic operations on complex numbers, provide a method to return the number of active objects created.
3... methods in Java.
10. Design a thread-safe implementation of Queue class. Write method return type : - Java Beginners
java method return type : i have one question regarding methods,,, if we create a method with return type as class name (public employee addemp(int... int classasmethod()
{
System.out.println("classasmethod method");
return 10
Java Method Return Value
Java Method Return Value
Java method Return Value return to the code when... the value within the body of method. The
method declared void does not return any
java programs - Java Beginners
java programs i need a program for rational numbers to represent 500/1000 as 1/2 in java using java doc comments Hi Friend,
Try... / no;
}
public RationalClass divide(RationalClass number) {
return am trying to write a program that prompts the user to enter the month and year and displays the number of days in the month. Need help Hi Friend,
Try the following code:
import java.util.
java programs
java programs A union B, transpose of matric, denomination of a given number i need java programs for this category?
Hi Friend...");
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols
Hi
Hi I need some help I've got my java code and am having difficulty to spot what errors there are is someone able to help
import java.util.Scanner;
public class Post {
public static void main(String[] args) {
Scanner sc
hi - Java Beginners
designed to work on the current object. Methods are always part of some class... information.
Thanks.
Hi...hi Hi.... let me know the difference between object and instance
What is the return type of the main method?
What is the return type of the main method? hi,
What is the return type of the main method?
thanks
Hi,
In the java programming the Main() method doesn't return anything hence declared void. In Java, you need
Abstract programs - Java Beginners
Abstract programs give me the Abstract Methods programms
and defind the Abstract Method and Abstract Class Hi friend,
This code will help you.
abstract class A{
public abstract abs_value
function to return value in java
function to return value in java How to return maximum value in java?
Return Value in Java
Logical transformation
Logical transformation hello,
Trying to find a way to do this transformation in Java:
N = same if number < 1000
N = 1000 if number = 0
N = number%1000 if number > 1000
I can't find an answer
Please help
java programs
java programs i need help in understanding the whole concept of the 13 java programs that i hav...here r de programs..
int i,j,m,n;
m...("Factorial is:");
for(i=m;i<=n;i++)
{
int fact=1
Methods in Java - Java Beginners
Methods in Java Hello.
Currently i am involved in a group project... however have been given the job to create a method for storing and recalling 5 questions, which each are lalabeledith 4 answers, i was hoping it would end up
Java Method Return Multiple Values
Java Method Return Multiple Values
In this section we will learn about how a method can return multiple values
in Java.
This example explains you how a multiple values can be return by a method.
This example explains you all
Programs in java - Java Interview Questions
Program in Java decimal to binary i need a java example to String Reverse. Can you also explain the Java decimal to binary with the help...--) dest.append(source.charAt(i)); return dest.toString
java programs - Java Beginners
java programs 1) write a program to print prime numbers?
2) write...; Hi Friend,
1)Prime Numbers:
import java.util.*;
class PrimeNumbers...+" and "+num2+" are:" );
for (int i = num1; i < num2; i++){ {
int j;
for (j = 2
Need help - Java Beginners
Need help To Write a Java program that asks the users to enter a m...
. Then, write a class with the following three methods:
- Method 1 accepts the m * n...[row][i];
}
System.out.println("\nAverage value of row 4
I need your help - Java Beginners
I need your help For this one I need to create delivery class.... Also include these methods to (set the delivery fee, set and get every Delivery.... The system will be terminated if the entry value for delivery code is -1. Save
java programs - Java Beginners
is empty");
return;
} else {
String str = " ";
for (int i = 0; i <= top; i...java programs design a java interface for adt stack .develop two... linkedlist Hi Friend,
Try the following code:
import java.lang.
Return Value From Event - Java Beginners
Return Value From Event I would like to call a method that returns...
}
return value
}
My problem is that mymethod() returns a value before the listener can change value. i want it to wait
programs in java
programs in java . I need an application for managing an educational institute.
That application should provide the details of
Students
Courses
Faculty
Fee details
etc..,
pl z guide me how to write these programe
Java Programs
Java Programs Hello. I need help with the following.
Write...;
System.out.println("Number Square");
for(int i=num1+1;i<num2;i++){
System.out.println(i+"\t"+(i*i));
sum+=(i*i
Java Programs
will help you learn and understand how get method is used
within Java programs...In this section of RoseIndia we are providing several Java programs on
various topics like get example, java exceptions, wrappers class, java pass
value
Programs in java
Programs in java Hi,
What are the best programs in java for a beginner?
Thanks
programs - Java Beginners
.
(by using methods of minimum and maximum of numbers)
3. Write a Java program....
16. Write a Java program to Demonstrate methods of Tree Set class.
17... to illustrates the methods of vector. (use enumeration)
22. Write a Java program
i need your help - Java Interview Questions
i need your help Write a java program that:
i. Allows user to enter 2 numbers from the keyboard
ii. Uses a method to compare the two numbers... than the other.
Hi Friend,
Try the following code:
import
Java Programs
Java Programs Hi,
What is Java Programs?
How to develop application for business in Java technology? Is there any tool to help Java programmer in development of Java Programs?
Thanks
Simple Java Programs for Beginners
of
Java programs covering every topic, method, keywords, classes, functions, etc.
Programs on Hello World Array list, Linked list, Iterate list, Java swing...RoseIndia brings you simple Java programs that can be used and downloaded
what is the need of... - Java Beginners
what is the need of...
what is the need of " return type like void ?
Hi Friend,
In java, method always require a return type.The main method is the client code therefore jvm does not expected any return
Collection of Large Number of Java Sample Programs and Tutorials
In
NavigableMap we use methods to return the key value pair...Collection of Large Number
of Java Sample Programs and Tutorials
Java...
we use methods to return values.
I need help in doing this. - Java Beginners
I need help in doing this. Student DataBase
i will need creating... and their
methods as needed.
What program should do (Tasks):
i) Read data in from... the above tasks (labeled i through iv) will be here. Methods would be the preferred way
Java programs - Java Beginners
Java programs Hello
Please write the following programs for me using GUI.Thanks You.
1. Write a java program that reads the first name, last name.... The program should print the name, age and grade average. Use GUI and method
Return Java Keyword
passes a value back to the calling method after
matching the return type...
int Int_Method()
{
int
i = 5;
return(i...
Return Java Keyword
java programs - Java Beginners
java programs lisp-like list in java to perform basic operations such as car, cdr ,cons Hi Friend,
Try the following code:
import...);
String st=ob.toString();
return Integer.parseInt(st);
}
public List cdr(List
Java programs - Java Beginners
Java programs Could you please write the followong programs for me... with its length and its position in s use printf. Hi friend,
Code...();
if(str.length()==12)
{
for(int i=0;i
java programs - Java Beginners
java programs design a vehicle class hierachy in java.write a program to demonstrate polymorphism Hi Friend,
Try the following code...()
{
System.out.println("I am a bus");
}
}
class Car extends Vehicle{
void
java programs
java programs write java applet program to display an image using drawimage method of an java graphic class
java programs - Java Beginners
java programs Actually i am searching for the source code ,algorithm and flow chart for prime number ...can u suggest me where can i find it??? Hi Friend,
Try the following code:
import java.util.*;
class
Conditional (Logical) Operators
Conditional (Logical) Operators
Conditional operators
return a true or a false value...
C:\nisha>java ConditionalOperator
value of x is 5
value
java programs - Java Beginners
java programs write a program to enter name of book,author's name... name,price and year of publication. Hi Friend,
Try the following... getBook() {
return book;
}
public String getAuthor() {
return author;
}
public
java programs
java programs 1.define frame?
2.what is the need for java programming?
3.list the events of classes?
4.define Event handling?
5.List event listener interface is successfully then i face problem in adding two value please write the code
Simple Java Programs
Simple Java Programs
In this section we will discuss about the Java programs
This section will describe you the various Java programs that will help you... is
Java, how to get Java, how to install Java, Java class, object and methods
Some Notes on Java Programming Environments
that are need to run Java programs. It does not have a compiler.
You'll also...
Appendix 2:
Some Notes on Java Programming Environments
ANYONE WHO...-line environments. All programming
environments for Java require some text
15 Php programs on logical operators
15 Php programs on logical operators I need 15 example programs for logical operators. Please help me out
java method - Java Beginners
java method hi friends, Is there any default return type for methods in java? There is no default return type in java, as a user you have to specify the return type even void
java programs
java programs 1:- java program to copy the contents of one file to another file(input the file names using command-line arguments).
2:- java....
3:-java program to find the repeated digits in a given number.
hi
hi what are the steps mandatory to develop a simple java program?
what is default value for int type of local variable?
what are the keywords available in simple HelloWorld program?
Class is a blueprint of similiar objects(True
hi - Java Beginners
hi hi sir,when i am enter a one value in jtextfield the related values to that value (which is already existed in database) is came to my... phone no sir Hi Friend,
Try the following code:
import
Object Class Methods in Java
We are going to discus about Object Class Methods in Java...(), wait(), etc
Java object class methods are:-
finalize()
clone()
equals...:-
The equals().Method are compare two objects equals. The equals method
return
Overloaded methods - Java Beginners
Overloaded methods Write two overloaded methods that return...[] array)
b) public static double average(double[] array)
Hi Friend...=array.length;
for(int i=0;i
hi
online multiple choice examination hi i am developing online multiple choice examination for that i want to store questions,four options,correct answer in a xml file using jsp or java?can any one help me?
Please
hi - Java Beginners
) with column names,if i am using this table type table(rowno,colno) how i am set...);
}
/** This method is called from within the constructor... of this method is
* always regenerated by the Form Editor
programs - Java Beginners
Java Array Programs How to create an array program in Java? Hi public class OneDArray { public static void main (String[]args){ int [] oneD= new int[5]; for (int i=0; i<oneD.length;i
hi!
hi! how can i write aprogram in java by using scanner when asking... to to enter, like(int,double,float,String,....)
thanx for answering....
Hi...);
System.out.print("Enter integer: ");
int i=input.nextInt
This is what i need - Java Beginners
.
for this question i need just :
one function can read string like (I like...This is what i need Implement a standalone procedure to read...)as (Iliketoplayfootball)
without any compressing the file.
thank you
Hi
Logical Operators in java 7
In this tutorial, we are going to discuss about logical operator in java 7
programs - Java Beginners
in java. Hi friend public class TwoDArray { public static void main(String[] args){ int[][] twoD = new int[8][4]; for (int i=0; i<twoD.length; i++) { for (int j=0; j<twoD[i].length; j++) { twoD[i][j] = i
return code - Java Beginners
: ");
String name = scan.next();
break;//What code to use to return to main menu after the break? So that I can choice next menu..
}
} Hi Friend,
Try...return code import java.util.Scanner;
public class
programs - Java Beginners
program in Java. Hi friend public class ThreeDArray { public static void main(String[] args) { int[][][] threeD = new int[5][4][3]; for (int i = 0; i < 5; ++i) { for (int j = 0; j < 4; ++j) { for (int k = 0; k <
notify and notifyAll methods - Java Beginners
notify and notifyAll methods I need a program demonstrating the methods of notify and notifyAll. please can you suggest me a way out. ...
Rajanikant Hi friend,
import java.util.Collections;
import
writing java programs - Java Beginners
writing java programs How do i write a code to display even numbers from 1 to 50 Hi Friend,
Try the following code:
class... = "";
for (int i = 1; i <=50; i++){
if (i % 2 == 0
stateless session bean with methods error - Java Beginners
stateless session bean with methods error I have to create stateless... three methods in that session bean. I have 4 files created-index.jsp under web... in editor and choose
// "EJB Methods > Add Business Method" or "Web Service
java lab programs - Java Beginners
java lab programs Design a Date class similar to the one provided in the java.util package. Hi Friend,
Try the following code..., 30, 31, 30, 31 };
if (m < 1 || m > 12) return false
factory methods in java?
factory methods in java? what are factory methods in java?
Hi Friend,
Factory methods are static methods that return an instance of the native class like Pattern.compile(), Calendar.getInstance
programs - Java Magazine
Ellipse2D.Double(50,50,80,80));
}
}
Thanks
Rajanikant Hi...);
}
public void setDiameter(int Value) {
Diameter = Value... :
Thanks
Amardeep
java programs
java programs Why word "static" is used in java programs
Java Programs - Java Beginners
Java Programs Dear Sir,
Could you give me the syntax...)
Hi Friend,
Please visit the following link:
Thanks
writing programs - Java Beginners
.
2.And Write a program to find the facorial of a number Hi...[]){
String oddNo = "";
for (int i = 1; i <=50; i++){
if (i % 2 != 0
Fields and Methods in Java
(21);
}
}
Methods of a Class
A Java method is a collection of statements...In this section we are discussing about Fields and Methods in Java. Fields or
variables of class and Methods of a class are important while writing the Java
odject value - Java Beginners
odject value hello friends
i have one doubt on my coding.am posting my code here.
i want to print the value of object.But am confused...(a.toString());
}
}
now instead of test@3e25a5 i got hai.and previous value
hi all - Java Beginners
hi all hi,
i need interview questions of the java asap can u please sendme to my mail
Hi,
Hope you didnt have this eBook. You.../Good_java_j2ee_interview_questions.html?s=1
Regards,
Prasanth HI
java methods - Java Interview Questions
java methods what are native methods? how and when they are use? Hi friend,
The ability to write just one set of code in Java... the so-called native method interface.
Writing native methods involves importing wonder - Java Beginners
I wonder Write two separate Java?s class definition where the first one is a class Health Convertor which has at least four main members:
i... the defined methods
Hi Friend,
Try the following code:
import
What are the methods in Object? - Java Beginners
What are the methods in Object? Hi,
What are the methods in Object? Give example of methods in Object.
Thanks
Hello,
There are lot of method in object class some of are as follows
toString();
wait
java method - Java Beginners
java method i wanna explation about a method
for example..."
//and return a set of mail objects
}}
------------------------
public Mail[] getAllMails(String userName)
I WANNA EXPLATION ABOUT ABOVE METHOD CAN U
hi Friend... - Java Beginners
hi Friend... Hi friend...
I have to import only... plz Explain this...Thank u..
Sakthi
Hi friend,
Java IO :
The Java Input/Output (I/O) is a part of java.io package. The java.io package
how to execuite java programs???
how to execuite java programs??? I have jdk 1.6 installed in my pc.i want to execuite java programs in ms-dos for applet and without using applet.please tell me | http://www.roseindia.net/tutorialhelp/comment/89330 | CC-MAIN-2014-10 | refinedweb | 2,910 | 57.16 |
Want to receive data(internet Time and date ) from Node.js server to Arduino.
Please help.
Thank you.
Want to receive data(internet Time and date ) from Node.js server to Arduino.
Please help.
Thank you.
I don't know anything about Node.js.
Can it connect to a serial port and hence to the Arduino over a USB cable?
Can it connect to the Arduino using bluetooth and a bluetooth module on the Arduino?
In either case the examples in Serial Input Basics should be useful.
If the Arduino needs to connect over Ethernet or Wifi you will need a suitable add-on for the Arduino (or use a Yun which already has them). The ESP8266 is an inexpensive WiFi module.
...R
Yes it is able to send the data to Server through ESP8266-01 wifi module.Now i am trying to receive data from Server to Arduino via ESP8266-01 wifi module.
Thank you.
Fetching data from node.js is the same as any other web page from the client side.
Suggest you search "arduino esp8266 http get"
A couple of likely-looking links below to get you started.
Basically you get the entire web page as a chunk of text which you have to search through to extract the information you want.
Ok.Thank you very much.
Hi rw950431,
I wanted to fetch the JSON data from Server to arduino+Esp8266(Wifi module) and store it into some variable and display in Arduino’s Serial monitor. After implementing the code from the link, the result i
got is attached in image format below.
I am not able to fetch the JSON data from Server.
Please have a look a at the image attached.
Thank you.
I want to fetch the JSON data(time and date) from Node.Js Server to ESP8266-01 using http GET method.
I have used Software serial definition as
#include<SoftwareSerial.h>
SoftwareSerial ser(A8,A9); // Connect TX and RX of ESP8266 (A8 for TX A9 for RX) of ATMEGA2560.
In the code i have written
ser.print(String("GET ") + “/details HTTP/1.1/\r\n” +
“192.168.1.11”+ “\r\n” +
“Connection: close\r\n\r\n”);
// Read all the lines of the reply from server and print them to Serial
Serial.println(“Respond:”);
while(ser.available()){
String line = ser.readStringUntil(’\r’);
Serial.print(line);
}
Serial.println();
Serial.println(“closing connection”);
where ser is defined function for ESP8266-01
192.168.1.11 is Local server IP address from where i have to fetch the JSON data(data and time in my case).
But i am not able to fetch date and time data.
Perhaps try the code from
Yours seems to omit the space between GET and /details and also the "host:" before the IP address.
ok. I have initialized for ESP8266 for ATMEGA 2560 as below shown code and used ser.println function,hope using “ser” is correct?
#include <SoftwareSerial.h>
SoftwareSerial ser(A8,A9);
Then in the esp8266 function as
void esp_8266()
{
String cmd = “AT+CIPSTART=“TCP”,”"; // AT cammand for TCP/IP connection
cmd += “192.168.1.11”; // api.thingspeak.com IP adress
cmd += “”,5000"; // HTTP port no.
ser.println(cmd); // Sending AT cammand
p=1;
if(p == 1)
{
if(ser.find(“Linked”)) // Serching for responce from ESP8266
{
Serial.println(“Connection Made for Receiving data”);
z=0;
}
p=0;
}
int deviceid = serialNumber;
String getStr = “GET /log/345/12/status/”;
getStr += DHT.temperature;
getStr += “/”;
getStr += DHT.humidity;
getStr += “\r\n\r\n”;
cmd = “AT+CIPSEND=”; // AT command to send Data at TCP server
cmd += String(getStr.length()); // send data length
ser.println(cmd); // Wrighting the AT command to ESP8622
if(ser.find(">")) // Serching for responce to send data from ESP8266
{
ser.print(getStr); // Printing the string with sensor data to send on ESP8266 module
}
delay (100);
ser.println(“GET /details HTTP/1.1”);
ser.print("Host: ");
ser.println(“192.168.1.11”);
ser.println(“Connection: close”);
ser.println();
// Read all the lines of the reply from server and print them to Serial
Serial.println(“Respond:”);
while(ser.available()){
String line = ser.readStringUntil(’\r’);
Serial.println(line);
}
Serial.println();
Serial.println(“closing connection”);
}
Hi rw950431,
The stackoverflow link which you provided is not working . can you just have a look one more time.
rw950431 adviced you to try this example, which isn't on stackoverflow. IWhen you ignore someone's advice then s/he will ignore your future requests for advice.
ok.
I tried the example what you mentioned in the link which uses #include<WiFiClient.h>, but i got an error which i attached in the image. | https://forum.arduino.cc/t/node-js-to-arduino/400630 | CC-MAIN-2022-27 | refinedweb | 767 | 59.8 |
Embedding files natively in Go 1.16
One of the most commonly noted upsides of Go is the compilation to a single binary. This makes deployments and dependency requirements easier to handle compared to other languages that require to install in the target system the individual dependencies which can potentially conflict with other software running or require to install duplicated packages.
However, sometimes Go programs not always can be reduced to a single file. Assets like templates or images are not included as part of the binary and they need to manage and deployed independently. Although this has its benefits, like customising templates without having to recompile the whole program, it loses the benefits of a single unit when you do not want or do not expect to make a change in the assets, like with games.
Traditionally, we have relied on third-party packages like
go-bindata or
statik to embed static assets in Go binaries. These tools essentially require to run a command against the assets we want to embed to create a Go file which contains a binary representation of them. Later, you import this generated file in your code and you access the files using some key based on the path or a virtual file system.
These solutions have some issues in terms of development experience. They require an extra step to add/update assets every time they change and having the tool available in each environment in some concrete version. It is also an external dependency, which might be complicated to adopt in certain corporate environments. Also, to keep the component “go-getable”, you need to commit the generated files, which is not ideal either.
In version 1.16 (not available yet as of December 2020), the Go team has introduced a new package named
embed which solves these trade-offs by embedding the files during the building of the binary. Hence, we don't need to run additional commands before running
go build or to track generated files. The
go build system will recognise the directives and populate the variables with the matching files.
How it works
General conditions
- If any patterns are invalid or have invalid matches, the build will fail.
- The directive must immediately precede a line containing the declaration of a single variable. Only blank lines and comments are permitted between the directive and the declaration.
- Patterns must not contain
.or
..path elements nor begin with a leading slash.
- To match everything in the current directory, use
*.
- Patterns must not match files outside the package’s module, such as
.git/or symbolic links.
- Each pattern in a line must match at least one file or non-empty directory.
Embedding a file as a string
- The files are stored as
stringor
[]byte.
- You can use a single
go:embeddirective per variable.
- The directive must refer to a single file.
- You can use a blank import.
package mypackageimport _ "embed"
import "fmt"//go:embed README.md
var r string//go:embed image.png
var img []byte func main() {
fmt.Println(r);
}
Embedding several files as a file system.
- The files are stored as
embed.FS
embed.FSis read-only and safe to use from different goroutines concurrently.
embed.FSimplements
fs.FS, so it can be used with any package that understands file system interfaces
- You can use a single or multiple
go:embeddeclarations. Each declaration can refer to one or multiple paths separated by spaces.
- If a pattern names a directory, all files in the directory are embedded recursively, except that files with names beginning with
.or
_.
- If you use
*after the directory, it will add also files prefixed with
.and
_.
package mypackageimport (
"embed"
"net/http"
"log"
)// It will add the specified files.
//go:embed favicon.ico robots.txt index.html
// It will add all non-hidden file in images, css, and js.
//go:embed image/ css/ js/
// It will add all the files in downloads, including hidden files.
//go:embed downloads/*
var static embed.FSfunc main() {
http.Handle("/", http.FileServer(http.FS(static)))
log.Fatal(http.ListenAndServe(":8080", nil))
}
For more information, check the references below. Do you have any feedback? You can reach me on Twitter.
References
-
-
-
Changelog
- 2020–02–01: As pointed in the comments, the article had a typo in the code directives, which should not contain a space. | https://threkk.medium.com/embedding-files-natively-in-go-1-16-2a2f2070617d | CC-MAIN-2021-17 | refinedweb | 722 | 57.47 |
Have you heard this advice?
You should follow the “Fat models / Skinny views Philosophy”
or…
I think the logic should be in the model
And then, you hear some other advice that confuses you, Right? Have you ever heard this?
Fat models aren’t necessarily a good thing…
Which advice is correct? How do you proceed now that you’re all confused and frustrated at all your bloated models?
You don’t want bloated models though…
You know architecture is important. You know that fat models are preferable to fat views. But, you’re confused because you also have a very messy and bloated model that is getting harder and harder to maintain!
That’s why you really shouldn’t have fat models OR fat views. Developers have a hard time following strict dogma because there are always exceptions to the rule.
So, how can YOU break up your Django models into separate and clean utility classes? How do you clean up your model bloat? Create a custom manager!
Why use a Custom Manager?
Let’s assume you have a model that looks like the following:
class Person(models.Model): email = models.EmailField(max_length=250) first_name = models.CharField(max_length=45) last_name = models.CharField(max_length=45)
You might be tempted to write a function that gets a Person by “email”, then you might write a similar function to retrieve a Person by “last_name”
Something like:
def get_person_by_email(email): return Person.objects.get(email=email) def get_person_by_last_name(last_name): return Person.objects.get(last_name=last_name)
Then, over time, you decide that it would be awesome if you could get all the people in your system with similar domain names in their emails. I want a count of all the people who signed up for my services that have “gmail” email addresses. You could do something like this:
def count_people_by_email_domain(domain): return len(Person.objects.filter(email__endswith="domain"))
You could see that you might have an infinite number of small functions that can manipulate the data anyway that you see fit.
Why not put those functions inside a custom Manager class instead?
That way, instead of writing a bunch of tiny functions and having to import them everywhere you need them, all you have to do is import the model and run the function on the model’s custom Manager class instead!
Let me show you what I mean.
from models import Person # using a custom Manager on email... people = Person.emails.filter_domain(domain) person = Person.emails.get(email) # using a custom Manager on last_name... person = Person.last_names.get(last_name) # etc...
How to Implement a custom manager…
Have I sold you on Custom Managers yet? The great news is that you can break your models up into a bunch of small, specific Manager classes and use them on your models.
Here is a simple Manager class that you can try out right now on our Person Model.
from django.db import models # maybe through your Manager classes into "managers.py" class EmailManager(models.Manager): def filter_domain(self, domain): return super(EmailManager, self).get_queryset().filter(email__endswith=domain) def get(self, email): return super(EmailManager, self).get_queryset().get(email=email) # models.py class Person(models.Model): # our model data... emails = EmailManager()
That’s how you create a manager that encapsulates most of the tiny functions laying around your model. Just throw them into a customer Manager, and you’ll be much happier and so will your models! | https://chrisbartos.com/articles/help-my-models-feel-bloated-why-you-should-write-a-custom-manager/ | CC-MAIN-2018-13 | refinedweb | 571 | 58.99 |
Introduction
Bitcoin is the latest trend in the cryptocurrency world which aims to disrupt the centralized banking system of the world by making it decentralized. Before we jump into the world of crypto-currency we need to understand what is Bitcoin and how to mine with python? If your system is old or python runs slower than other languages on your local machine, then you can read this listicle about “5 Tips and Tricks to speed up your Python Programs” and then continue on with this article.
What is a Bitcoin?
A bitcoin is an online form of currency that was created in January of 2009 by a mysterious man who goes by the pseudonym “Satoshi Nakamoto”. The whitepaper can be found here. The identity of the person is a mystery to date and Bitcoin actually offers a lower transaction fee than a traditional payment system for even a large amount of money and all you need to send someone money is their wallet address.
There are no physical coins lying around with the name bitcoin on them but the whole thing is virtual which is maintained on a public ledger to which everyone has equal access. All the transactions are verified with a huge amount of computing power and they are not issued by any bank. They are truly decentralized and secure at the same time. Bitcoin is also commonly known as “BTC”.
The key points to remember are :
- Bitcoin was launched in 2009 and is the largest cryptocurrency by volume in the world by market cap.
- Bitcoin is traded, created, distributed, and stored using blockchain technology.
- Bitcoin prices have been known to be very volatile with massive growth and crashes.
- It was the first cryptocurrency to meet such popularity and later it inspired a list of other cryptocurrencies or also known as “Altcoins”
Analyzing Bitcoin
The Bitcoin ecosystem is made out of nodes or miners who execute the bitcoin code and store it in the blockchain. Each blockchain contains transactions in them and everyone has the whole blockchain to them, thus they can access and see the new blocks being added to the system and it is tamper-proof.
Anyone can view the transactions happening right now and there are over 12000 nodes as of January 2021 and this number keeps on growing every day. Bitcoins are stored in wallets with their own address and it is managed using the public key and the private key which uses encryption to generate long length of strings. The Public key can be thought of as a bank account number or a UPI ID. It is public and telling it to others will do no harm to you. On the other hand, your private key is like your ATM pin or the UPI ID pin. You should never disclose it to anyone else and keep it private at all times.
What is Peer to Peer Technology?
Bitcoin was perhaps the first digital currency to utilize peer-to-peer technology to create an instant payment system. Any individual with sufficient computing power can become a miner and they process transactions on the blocks. They are motivated by the rewards which is the release of a new bitcoin and transaction fees which is paid in bitcoin.
The miners together make the decentralized authority that upholds the credibility of the whole bitcoin network. It also helps to beat inflation as there will never be more than 21 million bitcoin and by the end of January 2021, 18,614,806 bitcoins have already been mined. Central banking systems can print more currency whenever they want to so that they can match the rate of the growth in goods but Bitcoins work according to the algorithm and it sets the release date ahead of the time to effectively deal with inflation.
What is Bitcoin Mining?
Mining is the process by which bitcoins are gradually released to become a part of the circulation. Mining generally refers to solving a computationally tough mathematical puzzle. Bitcoin Mining is the process of adding verified transactions to the chain and the reward gets halved every 210,000 blocks that are mined. In 2009 the reward was 50 bitcoins per block and after the third halving on 11th MAy 2020, the reward is now down to 6.25 bitcoins.
Any hardware specification can be used for mining but some are just more efficient than the others like ASIC of Application Specific Integrated Circuits or even GPU which outperform the CPU and mine faster than a CPU. One bitcoin can be divided up to 8 decimal places and the smallest unit is known as one Satoshi. If the miners do accept the change, then it can be further divided up into more decimal places.
A Bitcoin Transaction has a miner’s fee attached with it and every transaction is added to a new blockchain and then the next block gets created with the correct hash. With the public key of the sender, the message can be decrypted, and hence never share your private key with anyone.
How to Mine Bitcoin?
Mining is achieved by finding the correct hash which has a preset number of zeros in the beginning and it also signifies the difficulty level. We begin with importing a necessary library.
from bitcoin import *
If you do not have the package, then you can install it via pip :
pip install bitcoin
After that, we need to create our Private and public key, along with our wallet address. We can do that with the following code.
#Generate private key my_private_key = random_key() #display private key print("Private Key: %sn" % my_private_key) #Generate public key my_public_key = privtopub(my_private_key) print("Public Key: %sn" % my_public_key) #Create a bitcoin address my_bitcoin_address = pubtoaddr(my_public_key) print("Bitcoin Address: %sn" % my_bitcoin_address)
Output :
Private Key: 82bd4291ebaa6508001600da1fea067f4b63998ed85d996aed41df944c3762be Public Key: 04f85fa7c009dba8d1e6b7229949116f03cb3de0dfaf4d6ef3e6320a278dfc8dd91baf058fcafe0b5fbf94d09d79412c629d19cc9debceb1676d3c6c794630943d Bitcoin Address: 1FtaFRNgxVqq4s4szhC74EZkJyShmeH5AU
Now we move onto the computational part where we are going to use SHA256 encryption to find the correct hash. We import the library and then do a test run of what SHA256 actually means.
from hashlib import sha256 sha256("ABC".encode("ascii")).hexdigest()
Output :
b5d4045c3f466fa91fe2cc6abe79232a1a57cdf104f7a26e716e0a1e2789df78
When you execute the same code, you will get the same hash code for a particular string and hence it always gives a definite output for a definite input. The length of the hash is 64 and each digit is hexadecimal, which makes it equal to 4 bits and hence the whole number is actually 256 bits and that is why it is also known as SHA256.
Bitcoin follows a protocol that the first ‘n’ number of digits of the has must be zero. Currently the value of ‘n’ stands at 20 but I am gonna show it to you using smaller ‘n’ so that the code actually finishes execution in linear time. The text over which you would apply SHA256 is made up of the Block number, transition details, previous hash value, and since all the 3 previous values are constant for a block and cannot be changed, a new value called ‘Nonce’ is introduced. Our goal is to find the Nonce value so that the hash of the block produces the required number of zeros in the beginning according to the protocol.
We will begin coding by taking a dummy transaction along with the latest block number and the previous hash value. We will begin with 4 zeros in the beginning and work our way up and you will realize why bitcoin mining is a tough job. We begin by defining a SHA256 and a mine Function which we would call.
def SHA256(text): return sha256(text.encode("ascii")).hexdigest()
MAX_NONCE=10000000 # You can also use a while loop to run infinitely with no upper limit def mine(block_number,transaction,previous_hash,prefix_zeros): prefix_str='0'*prefix_zeros for nonce in range(MAX_NONCE): text= str(block_number) + transaction + previous_hash + str(nonce) hash = SHA256(text) # print(hash) if hash.startswith(prefix_str): print("Bitcoin mined with nonce value :",nonce) return hash print("Could not find a hash in the given range of upto", MAX_NONCE)
Then we provide the required details and start mining with 4 zeros at the beginning of the hash.
transactions=''' A->B->10 B->c->5 ''' difficulty = 4 import time as t begin=t.time() new_hash = mine(684260,transactions,"000000000000000000006bd3d6ef94d8a01de84e171d3553534783b128f06aad",difficulty) print("Hash value : ",new_hash) time_taken=t.time()- begin print("The mining process took ",time_taken,"seconds")
Output :
Bitcoin mined with nonce value: 36674 Hash value : 000086ae35230f32b08e9da254bd7ba1b351f11d40bde27a7ebd5e7ec9568f8d The mining process took 0.08681821823120117 seconds
If we change the difficulty value by even 1, hence it will be 5, the output will be.
Output :
Bitcoin mined with nonce value : 2387325 Hash value : 00000f5254db00fa0dde976d53bb39c11f9350292949493943a90610d62c1a5e The mining process took 4.895745515823364 seconds
Hence you can see the drastic change in the time taken by the same code when the difficulty is increased from 4 to 5 and it only keeps on increasing exponentially. Thus that is the main reason why mining one bitcoin takes so much energy and computational power. If that was not enough, you have to be the first one to find the hash or you will not be rewarded. So you are also competing with all the other miners out there and this whole system works on the ‘PoW’ or ‘Proof of Work concept’.
Endnotes
We will discuss more how to connect the mining results to a wallet and how to mine other coins of the same or different concepts in the next part and if you want a sneak peek, you can check out this google collab notebook. If you like my article and want to read more, you can find all my articles listed here. Feel free to reach out to me on LinkedIn for any queries or doubts.
Thank you for reading till the end and Stay safe everyone <3.
The media shown in this article are not owned by Analytics Vidhya and is used at the Author’s discretion.You can also read this article on our Mobile APP
| https://www.analyticsvidhya.com/blog/2021/05/how-to-mine-bitcoin-using-python-part-i/ | CC-MAIN-2021-25 | refinedweb | 1,656 | 58.01 |
Hello!
First of all, I have been using Idea for a long time for Java and it is really great IDE! That's why when I faced with Python I chose PyCharm without hesitation.
Can you please tell me if it is possible to use import autocompletion such as following:
from PyQt4 import ... -> from PyQt4 import QtGui
PyCharm suggests only two .py files for importing from PyQt4. I noticed that most files, including QtGui are .pyd in my project libraries, and PyCharm doesn't notice them.
If it is impossible - can you please tell, what IDE can import such things? I mean after programming on Java I am surprised by poor facilities provided by all Python IDEs.
Thanks!
Now I see the problems with .pyd.. It is something like .DLL, no questions why PyCharm can't introspect this..
I am wondering if everyone uses Qt without autocompletion? It is quite a big library, it is really inconvenient to type all functions by hands..
Thanks.
I found iteresting thing: if I import like this (PyCharm suggest this variant) then I see autocompletion for QtGui - like QtGui.QWidget!
from PyQt4.uic.Compiler.qtproxies import QtGui
Can you tell anything about such approach?
Hello Alex,
In general, PyCharm does support binary modules (by importing them in a running
Python instance and creating .py file stubs for exported declarations), but
PyQt4 does something tricky so we don't understand it well by default. We
plan to fix this before 1.0, and you can watch
to get notified when the problem is fixed.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
"Develop with Pleasure!"
Thanks Dmitry!
I will look at it from time to time. | https://intellij-support.jetbrains.com/hc/en-us/community/posts/205799039-Qt-import-autocompletion?page=1 | CC-MAIN-2019-22 | refinedweb | 279 | 68.06 |
A light-weight library for easy interaction between Python and GNU screen.
Project description
A light-weight library for easy interaction between Python and GNU screen.
This library allows you create, find and kill screen sessions programmatically from Python, as well as send (string) commands to these sessions. You can use this to start other software inside a screen session from a Python script, like this:
import pyscreen #Start a new session and give it something to do session = pyscreen.ScreenSession('myName') session.send_command('echo hello') #Kill a screen session with a particular name session = pyscreen.get_session_with_name('testSession') session.kill() #Print all the id of all sessions for session in pyscreen.get_all_sessions(): print(session.id)
Project details
Release history Release notifications
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages. | https://pypi.org/project/pyscreen/ | CC-MAIN-2018-26 | refinedweb | 142 | 55.13 |
Source code: Lib/xdrlib.py
The.
Packer is the class for packing data into XDR representation. The Packer class is instantiated with no arguments.
Unpacker is the complementary class which unpacks XDR data values from a string buffer. The input buffer is given as data.
See also
Packer instances have the following methods:
Returns the current pack buffer as a string.
Resets the pack buffer to the empty string.().
Packs the single-precision floating point number value.
Packs the double-precision floating point number value.
The following methods support packing strings, bytes, and opaque data:
Packs a fixed length string, s. n is the length of the string but it is not packed into the data buffer. The string is padded with null bytes if necessary to guaranteed 4 byte alignment.
Packs a fixed length opaque data stream, similarly to pack_fstring().
Packs a variable length string, s. The length of the string is first packed as an unsigned integer, then the string data is packed with pack_fstring().
Packs a variable length opaque data string, similarly to pack_string().
Packs a variable length byte stream, similarly to pack_string().)
Packs a fixed length list (array) of homogeneous items. n is the length of the list; it is not packed into the buffer, but a ValueError exception is raised if len(array) is not equal to n. As above, pack_item is the function used to pack each element.
Packs a variable length list of homogeneous items. First, the length of the list is packed as an unsigned integer, then each element is packed as in pack_farray() above.
The Unpacker class offers the following methods:
Resets the string buffer with the given data.
Returns the current unpack position in the data buffer.
Sets the data buffer unpack position to position. You should be careful about using get_position() and set_position().
Returns the current unpack data buffer as a string.
Indicates unpack completion. Raises an Error exception if all of the data has not been unpacked.
In addition, every data type that can be packed with a Packer, can be unpacked with an Unpacker. Unpacking methods are of the form unpack_type(), and take no arguments. They return the unpacked object.
Unpacks a single-precision floating point number.
Unpacks a double-precision floating point number, similarly to unpack_float().
In addition, the following methods unpack strings, bytes, and opaque data:
Unpacks and returns a fixed length string. n is the number of characters expected. Padding with null bytes to guaranteed 4 byte alignment is assumed.
Unpacks and returns a fixed length opaque data stream, similarly to unpack_fstring().
Unpacks and returns a variable length string. The length of the string is first unpacked as an unsigned integer, then the string data is unpacked with unpack_fstring().
Unpacks and returns a variable length opaque data string, similarly to unpack_string().
Unpacks and returns a variable length byte stream, similarly to unpack_string().
The following methods support unpacking arrays and lists:
Unpacks and returns a list of homogeneous items. The list is unpacked one element at a time by first unpacking an unsigned integer flag. If the flag is 1, then the item is unpacked and appended to the list. A flag of 0 indicates the end of the list. unpack_item is the function that is called to unpack the items.
Unpacks and returns (as a list) a fixed length array of homogeneous items. n is number of list elements to expect in the buffer. As above, unpack_item is the function used to unpack each element.
Unpacks and returns a variable length list of homogeneous items. First, the length of the list is unpacked as an unsigned integer, then each element is unpacked as in unpack_farray() above.
Exceptions in this module are coded as class instances:
The base exception class. Error has a single public attribute msg containing the description of the error.
Class derived from Error. Contains no additional instance variables.
Here is an example of how you would catch one of these exceptions:
import xdrlib p = xdrlib.Packer() try: p.pack_double(8.01) except xdrlib.ConversionError as instance: print('packing the double failed:', instance.msg) | http://www.wingware.com/psupport/python-manual/3.3/library/xdrlib.html | CC-MAIN-2014-15 | refinedweb | 682 | 60.21 |
I was recently an invited speaker in a series of STEM talks at Moraine Valley Community College. My talk was called “What can algorithms tell us about life, love, and happiness?” and it’s on Youtube now so you can go watch it. The central theme of the talk was the lens of computation, that algorithms and theoretical computer science can provide new and novel explanations for the natural phenomena we observe in the world.
One of the main stories I told in the talk is about stable marriages and the deferred acceptance algorithm, which we covered previously on this blog. However, one of the examples of the applications I gave was to kidney exchanges and school allocation. I said in the talk that it’s a variant of the stable marriages, but it’s not clear exactly how the two are related. This post will fill that gap and showcase some of the unity in the field of mechanism design.
Mechanism design, which is sometimes called market design, has a grand vision. There is a population of players with individual incentives, and given some central goal the designer wants to come up with a game where the self-interest of the players will lead them to efficiently achieve the designer’s goals. That’s what we’re going to do today with a class of problems called allocation problems.
As usual, all of the code we used in this post is available in a repository on this blog’s Github page.
Allocating houses with dictators
In stable marriages we had
men and
women and we wanted to pair them off one to one in a way that there were no mutual incentives to cheat. Let’s modify this scenario so that only one side has preferences and the other does not. The analogy here is that we have
people and
houses, but what do we want to guarantee? It doesn’t make sense to say that people will cheat on each other, but it does make sense to ask that there’s no way for people to swap houses and have everyone be at least as happy as before. Let’s formalize this.
Let
be a set of people (agents) and
be a set of houses, and
. A matching is a one-to-one map from
. Each agent is assumed to have a strict preference over houses, and if we’re given two houses
and
prefers
over
, we express that by saying
. If we want to include the possibility that
, we would say
. I.e., either they’re the same house, or
strictly prefers
more.
Definition: A matching
is called pareto-optimal if there is no other matching
with both of the following properties:
- Every agent is at least as happy in
as in
, i.e. for every
,
.
- Some agent is strictly happier in
, i.e. there exists an
with
.
We say a matching
“pareto-dominates” another matching
if these two properties hold. As a side note, if you like abstract algebra you might notice that you can take matchings and form them into a lattice where the comparison is pareto-domination. If you go deep into the theory of lattices, you can use some nice fixed-point theorems to (non-constructively) prove the existences of optimal allocations in this context and for stable marriages. See this paper if you’re interested. Of course, we will give efficient algorithms to achieve our goals, which is how I prefer to live life.
The mechanism we’ll use to find such an optimal matching is extremely simple, and it’s called the serial dictatorship.
First you pick an arbitrary ordering of the agents and all houses are marked “available.” Then the first agent in the ordering picks their top choice, and you remove their choice from the available houses. Continue in this way down the list until you get to the end, and the outcome is guaranteed to be pareto-optimal.
Theorem: Serial dictatorship always produces a pareto-optimal matching.
Proof. Let
be the output of the algorithm. Suppose the theorem is false, that there is some
that pareto-dominates
. Let
be the first agent in the chosen ordering who gets a strictly better house in
than in
. Whatever house
gets, call it
, it has to be a house that was unavailable at the time in the algorithm when
got to pick (otherwise
would have picked
during the algorithm!). This means that
took the house chosen by some agent
whose turn to pick comes before
. But by assumption,
was the first agent to get a strictly better house, so
has to end up with a worse house. This contradicts that every agent is at least as happy in
than in
, so
cannot pareto-dominate
.
It’s easy enough to implement this in Python. Each agent will be represented by its list of preferences, each object will be an integer, and the matching will be a dictionary. The only thing we need to do is pick a way to order the agents, and we’ll just pick a random ordering. As usual, all of the code used in this post is available on this blog’s github page.
# serialDictatorship: [[int]], [int] -> {int: int} # construct a pareto-optimal allocation of objects to agents. def serialDictatorship(agents, objects, seed=None): if seed is not None: random.seed(seed) agentPreferences = agents[:] random.shuffle(agentPreferences) allocation = dict() availableHouses = set(objects) for agentIndex, preference in enumerate(agentPreferences): allocation[agentIndex] = max(availableHouses, key=preference.index) availableHouses.remove(allocation[agentIndex]) return allocation
And a test
agents = [['d','a','c','b'], # 4th in my chosen seed ['a','d','c','b'], # 3rd ['a','d','b','c'], # 2nd ['d','a','c','b']] # 1st objects = ['a','b','c','d'] allocation = serialDictatorship(agents, objects, seed=1) test({0: 'b', 1: 'c', 2: 'd', 3: 'a'}, allocation)
This algorithm is so simple it’s almost hard to believe. But it get’s better, because under some reasonable conditions, it’s the only algorithm that solves this problem.
Theorem [Svensson 98]: Serial dictatorship is the only algorithm that produces a pareto-optimal matching and also has the following three properties:
- Strategy-proof: no agent can improve their outcomes by lying about their preferences at the beginning.
- Neutral: the outcome of the algorithm is unchanged if you permute the items (i.e., does not depend on the index of the item in some list)
- Non-bossy: No agent can change the outcome of the algorithm without also changing the object they receive.
And if we drop any one of these conditions there are other mechanisms that satisfy the rest. This theorem was proved in this paper by Lars-Gunnar Svensson in 1998, and it’s not particularly long or complicated. The proof of the main theorem is about a page. It would be a great exercise in reading mathematics to go through the proof and summarize the main idea (you could even leave a comment with your answer!).
Allocation with existing ownership
Now we switch to a slightly different problem. There are still
houses and
agents, but now every agent already “owns” a house. The question becomes: can they improve their situation by trading houses? It shouldn’t be immediately obvious whether this is possible, because a trade can happen in a “cycle” like the following:
Here A prefers the house of B, and B prefers the house of C, and C prefers the house of A, so they’d all benefit from doing a three-way cyclic trade. You can easily imagine the generalization to larger cycles.
This model was studied by Shapley and Scarf in 1974 (the same Shapley who did the deferred acceptance algorithm for stable marriages). Just as you’d expect, our goal is to find an optimal (re)-allocation of houses to agents in which there is no cycle the stands to improve. That is, there is no subset of agents that can jointly improve their standing. In formalizing this we call an “optimal” matching a core matching. Again
is a set of agents, and
is a set of houses.
Definition: A matching
is called a core matching if there is no subset
and no matching
with the following properties:
- For every
,
is owned by some other agent in
(trading only happens within
).
- Every agent
in
is at least as happy as before, i.e.
for all
.
- Some agent in
strictly improves, i.e. for some
.
We also call an algorithm individually rational if it ensures that every agent gets a house that is at least as good as their starting house. It should be clear that an algorithm which produces a core matching is individually rational, because for any agent
we can set
, i.e. force
to consider not trading at all, and being a core matching says that’s not better for
. Likewise, core matchings are also pareto-optimal by setting
.
It might seem like the idea of a “core” solution to an allocation problem is more general, and you’re right. You can define it for a very general setting of cooperative games and prove the existence of core matchings in that setting. See Wikipedia for more. As is our prerogative, we’ll achieve the same thing by constructing core matchings with an algorithm.
Indeed, the following theorem is due to Shapley & Scarf.
Theorem [Shapley-Scarf 74]: There is a core matching for every choice of preferences. Moreover, one can be found by an efficient algorithm.
Proof. The mechanism we’ll define is called the top trading cycles algorithm. We operate in rounds, and the first round goes as follows.
Form a directed graph with nodes in
. That is there is one node for each agent and one node for each house. Then we start by having each agent “point” to its most preferred house, and each house “points” to its original owner. That is, we add in directed edges from agents to their top pick, and houses to their owners. For example, say there are five agents
and houses
with
owning
, and
owning
, etc. but their favorite picks goes backwards, so that
prefers house
most, and
prefers
most,
prefers
(which
also owns), etc. Then the “pointing picture” in the first round looks like this.
The claim about such a graph is that there is always some directed cycle. In the example above, there are three. And moreover, we claim that no two cycles can share an edge. It’s easy to see there has to be a cycle: you can start at any agent and just follow the single outgoing edge until you find yourself repeating some vertices. By the fact that there is only one edge going out of any vertex, it follows that no two cycles could share an edge (or else in the last edge they share, there’d have to be a fork, i.e. two outgoing edges).
In the example above, you can start from A and follow the only edge and you get the cycle A -> 5 -> E -> 1 -> A. Similarly, starting at 4 would give you 4 -> D -> 2 -> B -> 4.
The point is that when you remove a cycle, you can have the agents in that cycle do the trade indicated by the cycle and remove the entire cycle from the graph. The consequence of this is that you have some agents who were pointing to houses that are removed, and so these agents revise their outgoing edge to point at their next most preferred available house. You can then continue removing cycles in this way until all the agents have been assigned a house.
The proof that this is a core matching is analogous to the proof that serial dictatorships were pareto-optimal. If there were some subset
and some other matching
under which
does better, then one of these agents has to be the first to be removed in a cycle during the algorithm’s run. But that agent got the best possible pick of a house, so by involving with
that agent necessarily gets a worse outcome.
This algorithm is commonly called the Top Trading Cycles algorithm, because it splits the set of agents and houses into a disjoint union of cycles, each of which is the best trade possible for every agent involved.
Implementing the Top Trading Cycles algorithm in code requires us to be able to find cycles in graphs, but that isn’t so hard. I implemented a simple data structure for a graph with helper functions that are specific to our kind of graph (i.e., every vertex has outdegree 1, so the algorithm to find cycles is simpler than something like Tarjan’s algorithm). You can see the data structure on this post’s github repository in the file graph.py. An example of using it:
>>> G = Graph([1,'a',2,'b',3,'c',4,'d',5,'e',6,'f']) >>> G.addEdges([(1,'a'), ('a',2), (2,'b'), ('b',3), (3,'c'), ('c',1), (4,'d'), ('d',5), (5,'e'), ('e',4), (6,'f'), ('f',6)]) >>> G['d'] Vertex('d') >>> G['d'].outgoingEdges {('d', 5)} >>> G['d'].anyNext() # return the target of any outgoing edge from 'd' Vertex(5) >>> G.delete('e') >>> G[4].incomingEdges set()
Next we implement a function to find a cycle, and a function to extract the agents from a cycle. For latter we can assume the cycle is just represented by any agent on the cycle (again, because our graphs always have outdegree exactly 1).
# anyCycle: graph -> vertex # find any vertex involved in a cycle def anyCycle(G): visited = set() v = G.anyVertex() while v not in visited: visited.add(v) v = v.anyNext() return v # getAgents: graph, vertex -> set(vertex) # get the set of agents on a cycle starting at the given vertex def getAgents(G, cycle, agents): # make sure starting vertex is a house if cycle.vertexId in agents: cycle = cycle.anyNext() startingHouse = cycle currentVertex = startingHouse.anyNext() theAgents = set() while currentVertex not in theAgents: theAgents.add(currentVertex) currentVertex = currentVertex.anyNext() currentVertex = currentVertex.anyNext() return theAgents
Finally, implementing the algorithm is just bookkeeping. After setting up the initial graph, the core of the routine is
def topTradingCycles(agents, houses, agentPreferences, initialOwnership): # form the initial graph ... allocation = dict() while len(G.vertices) &> 0: cycle = anyCycle(G) cycleAgents = getAgents(G, cycle, agents) # assign agents in the cycle their choice of house for a in cycleAgents: h = a.anyNext().vertexId allocation[a.vertexId] = h G.delete(a) G.delete(h) for a in agents: if a in G.vertices and G[a].outdegree() == 0: # update preferences ... G.addEdge(a, preferredHouse(a)) return allocation
This mutates the graph in each round by deleting any cycle that was found, and adding new edges when the top choice of some agent is removed. Finally, to fill in the ellipses we just need to say how we represent the preferences. The input
agentPreferences is a dictionary mapping agents to a list of all houses in order of preference. So again we can just represent the “top available pick” by an index and update that index when agents lose their top pick.
# maps agent to an index of the list agentPreferences[agent] currentPreferenceIndex = dict((a,0) for a in agents) preferredHouse = lambda a: agentPreferences[a][currentPreferenceIndex[a]]
Then to update we just have to replace the
currentPreferenceIndex for each disappointed agent by its next best option.
for a in agents: if a in G.vertices and G[a].outdegree() == 0: while preferredHouse(a) not in G.vertices: currentPreferenceIndex[a] += 1 G.addEdge(a, preferredHouse(a))
And that’s it! We included a small suite of test cases which you can run if you want to play around with it more.
One final nice thing about this algorithm is that it almost generalizes the serial dictatorship algorithm. What you do is rather than have each house point to its original owner, you just have all houses point to the first agent in the pre-specified ordering. Then a cycle will always have length 2, the first agent gets their preferred house, and in the next round the houses now point to the second agent in the ordering, and so on.
Kidney exchange
We still need one more ingredient to see the bridge from allocation problems to kidney exchanges. The setting is like this: say Manuel needs a kidney transplant, and he’s lucky enough that his sister-in-law Anastasia wants to donate her kidney to Manuel. However, it turns out that Anastasia doesn’t the same right blood/antibody type for a donation, and so even though she has a kidney to give, they can’t give it to Manuel. Now one might say “just sell your kidney and use the money to buy a kidney with the right type!” Turns out that’s illegal; at some point we as a society decided that it’s immoral to sell organs. But it is legal to exchange a kidney for a kidney. So if Manuel and Anastasia can find a pair of people both of whom happen to have the right blood types, they can arrange for a swap.
But finding two people both of whom have the right blood types is unlikely, and we can actually do far better! We can turn this into a housing allocation problem as follows. Anyone with a kidney to donate is a “house,” and anyone who needs a kidney is an “agent.” And to start off with, we say that each agent “owns” the kidney of their willing donor. And the preferences of each agent are determined by which kidney donors have the right blood type (with ties split, say, by geographical distance). Then when you do the top trading cycles algorithm you find these chains where Anastasia, instead of donating to Manuel, donates to another person who has the right blood type. On the other end of the cycle, Manuel receives a kidney from someone with the right blood type.
The big twist is that not everyone who needs a kidney knows someone willing to donate. So there are agents who are “new” to the market and don’t already own a house. Moreover, maybe you have someone who is willing to donate a kidney but isn’t asking for anything in return.
Because of this the algorithm changes slightly. You can no longer guarantee the existence of a cycle (though you can still guarantee that no two cycles will share an edge). But as new people are added to the graph, cycles will eventually form and you can make the trades. There are a few extra details if you want to ensure that everyone is being honest (if you’re thinking about it like a market in the economic sense, where people could be lying about their preferences).
The resulting mechanism is called You Request My House I Get Your Turn (YRMHIGYT). In short, the idea is that you pick an order on the agents, say for kidney exchanges it’s the order in which the patients are diagnosed. And you have them add edges to the graph in that order. At each step you look for a cycle, and when one appears you remove it as usual. The twist, and the source of the name, is that when someone who has no house requests a house which is already owned, the agent who owns the house gets to jump forward in the queue. This turns out to make everything “fair” (in that everyone is guaranteed to get a house at least as good as the one they own) and one can prove analogous optimality theorems to the ones we did for serial dictatorship.
This mechanism was implemented by Alvin Roth in the US hospital system, and by some measure it has saved many lives. If you want to hear more about the process and how successful the kidney exchange program is, you can listen to this Freakonomics podcast episode where they interviewed Al Roth and some of the patients who benefited from this new allocation market.
It would be an excellent exercise to go deeper into the guts of the kidney exchange program (see this paper by Alvin Roth et al.), and implement the matching system in code. At the very least, implementing the YRMHIGYT mechanism is only a minor modification of our existing Top Trading Cycles code.
Until next time!
Really interesting! I’ve never seen the serial dictatorship algorithm before. It seems to me a special case of the Stable Marriage Problem, so we could produce the same algorithm by assigning all house preferences (?) to be equal. Then the houses would never refuse the previous owner (??) and the algorithm flows naturally.
But I’ve never seen this “pareto-optimality”, “…-domination” and so on denomination. Does that come from a related theory or field encompassing stable matching?
The language of pareto-optimality comes from economic theory and optimization, I believe. If you have seen any linear programming, usually the boundary of the feasible region is called the “Pareto frontier,” though I may be remembering this incorrectly.
There is a new interesting result about the complexity of graph isomorphism by Babai, perhaps something to post here in the future.
Interesting post!
In your serial dictatorship code, I understand the keys in the resulting allocations map are supposed to represent indices into the preferences (agents) vector that is supplied to the procedure, but that is not the case. Instead they are indices to the shuffled vector, which is not known to the caller.
Consider for example the case where the supplied preferences are [[‘a’,’b’,’c’],[‘a’,’c’,’b’],[‘c’,’b’,’a’]] (and therefore the objects are [‘a’,’b’,’c’]). With seed equals to 1, the code results in the map {0:’b’,1:’a’,2:’c’}, which is not Pareto optimal. | https://jeremykun.com/2015/10/26/serial-dictatorships-and-house-allocation/ | CC-MAIN-2021-43 | refinedweb | 3,636 | 62.17 |
View Complete Post
Option Explicit
'constantes para auxiliar na verificação do código
Private Const Ascendente As Byte = 0
Newbie at this so pardon me from the onset...
I'm building a site using VWD 2010 Express. The site seems to run fine in the browser but when debugging I get the following errors:
Error 1 c:\....\Site.master.cs(3): error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) (I get this message 4 times)
Error 5 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)
I've gone in to the Web.config and added the following:
<assemblies>
<add assembly
I have VS2008 SP1.. I have a web site that I want to add some Linq to SQL functionality, where is the template located? I can not find it anywhere in the web site or projects templates. What do I need to do to get this template for VS2008?
thanks));
Hi,
I'm trying to get a UDF from my SQL Server database to map to Linq to Entities. I've found an example for the CourseManager sample in the MSDN :
Private
Sub
Button1_Click( Linq to SharePoint(SPMetal) Missing "Author" and "Editor"?)
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend | http://www.dotnetspark.com/links/7652-missing-cast-linq-expression.aspx | CC-MAIN-2017-30 | refinedweb | 232 | 62.78 |
Ok so I thought it was about time we got into the nitty gritty of some “financial analysis”, rather than have me spout info regarding available beginners courses like I’m some sort of salesman. “I want to do some analysis”, I hear you scream…
Well ok then…let’s start. With the Python Pandas module.
So financial analysis usually starts by asking questions. I mean, our analysis has to be focused on something right? Data/financial analysis is just a tool, rather than an end in itself.
So to begin with, we’re going to try to answer 3 very simple questions regarding various stocks we may have in mind:
1) What was the change in the price of the stock over time, along with the volume traded of that stock?
2) What was the average daily return of the stock?
3) What is the correlation between this stock and multiple other stocks we may have in mind?
To carry out this analysis we will be using a python module called Pandas. Pandas is an absolutely awesome Python module; so powerful and easy to use. The name is derived from the term “panel data”, an econometrics term for multidimensional structured data sets.
Pandas is based around an object called a “DataFrame”, which is kind of similar in theory to a data table found in Excel. I believe the wide ranging use of Excel in the financial world is what motivated Wes McKinney (the creator of Pandas) to create Pandas in the first place.
The first thing we need to do is install the pandas module (if you don’t already have it), along with a few other packages.
If you have Python already installed, along with “pip” then it’s as easy as going to the command line and typing:
You can do the same for matplotlib, numpy and seaborn (you may already have these preinstalled with your python distribution anyway)
Note: you may need to upgrade your pip package – if so go to here to find out how.
Once Pandas and the other modules are installed, we need to begin by importing those modules:
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set_style('whitegrid') from pandas.io.data import DataReader
FYI the “sns.set_style(‘whitegrid’)” just sets us up to use a nice pre set plot scheme, provided by the seaborn library. Hopefully it will just make our charts look s a little nicer.
The “from pandas.io.data import DataReader” imports a neat little Pandas capability that allows us to download stock data directly from Yahoo Finance. Can’t ask for better than that, eh?
Then, let us choose a few stocks to analyse. If we take the tech sector we could choose Apple, Google, Microsoft and Amazon.
We can download each of those stocks’ data into a DataFrame from Yahoo as follows:
start_date = '2010/01/01' AAPL = DataReader('AAPL', "yahoo",start_date) GOOG = DataReader('AAPL', "yahoo",start_date) MSFT = DataReader('MSFT', "yahoo",start_date) AMZN = DataReader('AMZN', "yahoo",start_date)
If we then print out one of those DataFrames using the built in Pandas function “.head()” (which prints the top 5 results of the DataFrame) we get the following:
AAPL.head()
Once we have our data in our DataFrames, creating a plot is as simple as using the built in “plot” method and just typing:
AAPL['Adj Close'].plot()
Which produces the following chart
We can even very simply chart out the volume traded by using the following command:
AAPL['Volume'].plot()
Which gives us
Calculating the average daily return of the stock is very simple, and involves 2 steps. Firstly, we need to convert the price series into a daily percent returns series. We can do this using the “pct_change()” function and then the “mean()” function:
AAPL['Daily Return'] = AAPL['Adj Close'].pct_change() AAPL['Daily Return'].mean()
This gives us the output
0.0012557649005606581
Showing that the average daily return over the period 01/01/2010 – 23/03/2016 was 0.12558%. Fantastic!
Ok now let’s look at some correlation calculations. Firstly we need to get a DataFrame set up that holds only the ‘Adjusted Close” prices for each of our 4 tech stocks. We can do this with the following command:
tech_list = ['APPL', 'MSFT', 'GOOG', 'AMZN'] closing_df = DataReader(tech_list,'yahoo',start_date)['Adj Close']
Then run the “pct_change()” function on that DataFrame and store it in a new DataFrame called “rets” as follows:
rets = closing_df.pct_change()
Once we have these daily returns, we can then use the Seaborn “jointplot” function to get a visual representation of the correlation between two of the stocks, along with the “pearson r” value as follows – for example using Google and Microsoft.
sns.jointplot('GOOG', 'MSFT',rets, kind='scatter')
So I hope you can see from this brief introduction to the power of Pandas (along with numpy, matplotlib and seaborn) that it is more than a worthwhile addition to our module library.
This is just a hint of what lies beneath…stay tuned and hopefully I can bring you some more soon.
Thank you so much. Really nice explanation!
Just one thing:
The module pandas.io.data has been moved. So for those that does not know how to solve it, you have to change pandas.io.data for pandas_datareader.
Thanks very much for your comment, that is indeed the case – I shall try to update the post when I get some free time!
The console gives out a unable to read URL error and here it says that the yahoo finance API will be discontinued.
Do you have any other solutions to get the data?
Hi S.P. really sorry for the delay in replying, I’ve been away on my travels and had limited internet connection.
Yeah it’s a real shame that the Yahoo API is being discontinued!
You can always use Quandl as an alternative; it;s not quite as simple as the Yahoo API and requires signing up to but it’s well worth it. It’s got some great databases of financial data – some free, some paid but I only ever use the free ones.
Have a look and see what you think…you’ll also need to install the Python quandl packaged using pip.
Let me know if you need any advice on getting it up and running 😀 | https://www.pythonforfinance.net/2016/03/23/python-pandas/?utm_source=rss&utm_medium=rss&utm_campaign=python-pandas | CC-MAIN-2019-51 | refinedweb | 1,062 | 70.94 |
Produce the highest quality screenshots with the least amount of effort! Use Window Clippings.
A reader recently asked whether P/Invoke is dead since you can use C++ Interop and avoid re-declaring all the functions and structures that you might already have in system header files.
Firstly, P/Invoke is still extremely useful for languages like C# that can’t consume header files, but then that should be obvious. Secondly, P/Invoke can also be useful for calling functions for which you don’t readily have header and lib files for and avoids resorting to calling LoadLibrary followed by GetProcAddress.
What may not be as obvious is that P/Invoke can still be very useful from C++ for other reasons. Although you can avoid P/Invoke entirely in your C++ projects there are times when the code can actually be simpler if you just use P/Invoke instead. Let’s look at a few examples.
Lets say you’re mixing native (HWND) and managed (Windows.Forms.Control and derived classes) windows in a project. You might be using the Form class as the main window for your application and HWNDs (window handles) to represent windows in another process. So the challenge is to get the window text from an HWND and display it in a Windows.Forms control. Essentially the problem boils down to implementing the following function:
String^ GetWindowText(HWND windowHandle);
Given a window handle, we would like to get the window text as a managed string. As a C++ programmer you might naturally write the following implementation:
String^ GetWindowText(HWND windowHandle){ String^ result = String::Empty; int textLength = ::GetWindowTextLength(windowHandle); if (0 < textLength) { std::vector<wchar_t> buffer(textLength + 1); if (0 == ::GetWindowText(windowHandle, &buffer[0], textLength + 1)) { throw gcnew ComponentModel::Win32Exception(::GetLastError(), "The GetWindowText User32 function failed."); } result = Runtime::InteropServices::Marshal::PtrToStringUni(IntPtr(&buffer[0])); } return result;}
We start by getting the text length with a call to the GetWindowTextLength function. If the window has any text, we use the indispensable vector class to manage the buffer that the GetWindowText function will use to write the text to. 1 is added to the length of the buffer as the GetWindowText function null-terminates the text written to the buffer. If you neglect this step the text will be truncated. Finally, the PtrToStringUni helper method from the Marshal class is used to convert the null-terminated string into a managed string.
Another solution is to use the marshalling services provided by the CLR for P/Invoke to avoid the native string management and conversion. Consider the following solution:
using namespace Runtime::InteropServices; [DllImport("User32.dll", CharSet=CharSet::Unicode, SetLastError=true)]int GetWindowText(HWND windowHandle, Text::StringBuilder% text, int count); String^ GetWindowText(HWND windowHandle){ String^ result = String::Empty; int textLength = ::GetWindowTextLength(windowHandle); if (0 < textLength) { Text::StringBuilder buffer(textLength + 1); if (0 == GetWindowText(windowHandle, buffer, buffer.Capacity)) { throw gcnew ComponentModel::Win32Exception(::GetLastError(), "The GetWindowText User32 function failed."); } result = buffer.ToString(); } return result;}
Here we use the DllImport attribute to indicate to the CLR that the GetWindowText function is implemented by the User32 DLL. The function is prototyped with the .NET Framework’s StringBuilder class to represent the text buffer and a tracking reference is used so we can use stack semantics for the StringBuilder object when calling the function. As you can see, the GetWindowText implementation is very similar to the original. We still use the GetWindowTextLength directly as there is no benefit in using P/Invoke for it. Of course the solution using P/Invoke is 7 lines longer than the first solution and requires that you translate the GetWindowText function into a P/Invoke declaration for the CLR. About the only thing good about this solution is that you’re not using native memory which could become a performance problem in some rare cases. Of course you’d want to profile this to actually make such a conclusion.
Here’s a more compelling example. For a project I was working on a few months back I needed to allow the user to pick computers from the network. I decided to use the Active Directory Object Picker dialog box. If you’ve never had the pleasure of using this little gem, its exposed through the IDsObjectPicker COM interface and can be a challenge to get just right even from C++. Needless to say using P/Invoke from C# would just be nightmare. To make life simpler I wrapped the functionally we needed in a DLL written in native C++ and exposed it with the following function:
HRESULT __stdcall BrowseForComputers(HWND parentWindow, bool multiSelect, SAFEARRAY** computers, bool* dialogResult);
I’ll spare you the details of its implementation. For this function it would be very useful to be able to use P/Invoke since there is quite a bit of overhead involved in calling this function. Firstly we need to deal with COM safe arrays which are really not fun to work with. Secondly we need to check the HRESULT error code for failure. And finally we need to check the dialogResult pointer (if you remember MIDL then just think [out,retval]) to check whether the user pressed OK or Cancel. This is where P/Invoke and managed code really makes me smile. Consider the following example of using this function:
); void main(){ array<String^>^ computers = nullptr; if (BrowseForComputers(IntPtr::Zero, // parent true, // multi-select computers)) { for each (String^ computer in computers) { Console::WriteLine(computer); } }}
Although the declaration of the BrowseForComputers function can take a few moments to get just right, using it is very simple and elegant. The CLR takes care of all the marshalling and error translation.
© 2005 Kenny Kerr
A few years ago I wrote about P/Invoke and how it can provide benefits even when C++ Interop is available | http://weblogs.asp.net/kennykerr/archive/2005/06/20/414010.aspx | crawl-002 | refinedweb | 962 | 51.48 |
I have created a project for Android and started out using QCAR without Unity but decided in a later stage of the project to start using Unity. So what I did was to follow the instructions for creating a QCAR Unity project and also followed the instructions on the Unity homepage for integrating Unity to Eclipse.
I seem to have problems loading the created scenes into the application that I have created. What I have understood is that the Unity "blank view" is a blue screen (not a error page) that has nothing on it, which I get when starting the application. I used the following code to start the Unity Player. The code is located in myproject\src and the scenes are located in myproject\assets\Scens (have also tried without the Scens folder).
import android.os.Bundle; import com.unity3d.player.UnityPlayerActivity; public class UnityPlay extends UnityPlayerActivity{ /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } }
The Unity project can be built to the phone and run from there and the scene works with no problem. So the problem seems to be loading the levels, so how do I decide what level to load when starting Unity from my Android application and how do I get it to start?
A question about the archtecture of the QCAR library:
When loading the QCAR library, a myproject/assets/Plugin/Android folder is created. In that folder a AndroidManifest is located with all libraries for QCAR. I do still have a AndroidManifest in my myproject folder and what is the purpose of the AndroidManifest in the plugin folder? Do I really need two AndroidManifest and could the problem be related to this?
The entire QCAR library is imported into the assets folder, is this correct location for it to be located?
EDIT: Where should my java code (android application code) be located for Unity projects?
Be sure to use the class structure outlined in that second thread for QCAR 1.0.6.
One important thing to understand is that Unity uses a single Android Activity, even for multiple scenes. You can set the scene order using the Build Settings menu in Unity.
You'll want to use the AndroidManifest file from the StagingArea as your starting point. See the instructions in this post:
- Kim | https://developer.vuforia.com/forum/unity-extension-technical-discussion/unity-android-starting-blue-screen?sort=2 | CC-MAIN-2022-05 | refinedweb | 390 | 54.22 |
A blog about using ASP.NET for web applications and my work experiences
I've found a serious shortcoming in one of the security methods I've been using. I've inherited two projects in which social security numbers were stored in a database in an unencrypted format. For the web application I don't think the SQL Server 2005 built-in encryption methods are an option because the web hosting company is still using SQL Server 2000. Instead, I used the .NET Framework's built-in cryptography classes found in the System.Security.Cryptography namespace. I used the Rijndael (aka Advanced Encryption Standard (AES)) cipher in a custom assembly which I uploaded to the web server's bin directory without the source code. This encryption method relies on a 128 bit key and an initialization vector (IV) which are basically just byte arrays of 16 numbers.
The shortcoming with this security solution is that the 128 key and initialization vector (IV) can be obtained from the DLL by using Lutz Roeder's .NET Reflector. I was able to reverse engineer my DLL and easily found the keys you would need to decrypt the social security numbers. I then tried using Dotfuscator Community Edition 3.0 to see if it could obscure the keys but I was still able to find them although the variables were renamed a.a and a.b. I was still able to determine that RijndaelManaged was the encryption method and the byte arrays make it obvious that these are the keys (which are identical to the non-obfuscated version). I doubt that any obfuscator tool is going to touch a byte array so you really cannot have your keys in a DLL that can be reversed engineered.
The MSDN article on the RijndaelManaged.CreateEncryptor Method suggests that when you create a new instance of the RijndaelManaged class, it generates a new key and initialization vector (IV). However, this is not very clear and the sample code I've seen used byte arrays to specify the key and initialization vector.
Of course, if someone has a copy of your database and your application files then you are probably screwed anyway.
Why not use an encrypted configuration section (using DPAPI) to store the key and initialization vector? Another option is to write some SQL Server functions to read/write the SSNs and decrypt/encrypt them (using an extended stored procedure to perform the operations).
> a serious shortcoming
Really you need to identify what threats you are trying to protect against, and implement a solution that includes one or more of physical security, authentication and authorization, and possibly encryption.
And as soon as you implement encryption, you have the problem of how to manage the keys.
DPAPI as suggested by Richard above is fine, but it means anyone who can log into the server can decrypt your data. This may be OK if you've properly controlled access to your server. | http://weblogs.asp.net/rrobbins/archive/2008/05/08/asp-net-cryptography-insecurities.aspx | crawl-002 | refinedweb | 493 | 52.29 |
Classification of Celestial Bodies using CNN in Python
Do you also wish to know how we classify objects from an image? So, here it is! In this article, We will build a fundamental image classification model using TensorFlow and Keras. Our main aim is to predict whether the image contains a star or a galaxy with the help of Python programming. To implement our model efficiently using Neural Networks, we need to know about certain libraries beforehand.
The libraries we will be using are TensorFlow and Keras.
- TensorFlow: This is a free and open-source software library developed by researchers and engineers of Google. It can be used for fast computing of Deep Learning models. It has gained this level of popularity because it can support multiple languages for building deep learning models, for instance, Python, C++, JavaScript, and R. The latest stable released version is 2.3.1, 24th September 2020.
- Keras: This is also an open-source library that provides a Python interface for humans. Keras supports multiple backend neural networks computation engines like TensorFlow and Theano. The latest released version is 2.4.0, 18th June 2020.
Now, as we are aware of the basic yet important libraries, we should get into our model-building task. Hey! c’mon don’t worry about installations of libraries, we’ll be doing that in this tutorial. I would request you to open any Python IDE, say Google Colab, enable the GPU from the runtime, and practice this tutorial with me.
Steps involved in Model Building
Let’s now move forward and start stepwise.
Step 1: Understanding the DataSet
Before directly jumping into model-building one should always get insights about the dataset. For this tutorial, you can download the dataset for respective operations. For the dataset, you can click here. (The size of the dataset was large, so posted the drive link). You’ll find 2 folders named as-
- training_set: required for training our model.
- test_set: we required for testing our model.
Inside both the above folders you’ll find 2 more folders containing images of STARS and GALAXY.
So, here’s your Dataset all set.
Before getting ahead you need to install the required libraries (TensorFlow, Keras, matplotlib), for that, you can run the following command in your “.ipynb” file.
pip install package-name
Step 2: Importing the libraries and packages
Libraries are the fundamental blocks of any programming language, we have them to make our task easier. In this section, we will import all the necessary libraries.
import tensorflow as tf from tensorflow import keras from keras.models import Sequential from keras.layers import Conv2D from keras.layers import Activation from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Dense import matplotlib.pyplot as plt
We can also check the version of TensorFlow-
print(tf.__version__)
Output:
2.3.0
Step 2: Building the Convolutional Neural Network Model.
So, while building a model we follow a series of steps or can say we have several layers in model building.
The layers are as follows:
Layer 1: Convolution (1st layer where feature extraction is done on input data)
|
Layer 2: Max Pooling (this layer selects the maximum area it convolves and takes that data further)
|
Layer 3: Flattening (In this, the pooled feature map is converted to a single column and passed to a fully connected layer)
|
Layer 4: Full Connection (Here, we find multiple layers of neurons that contribute to the decision of our model)
Here, ‘relu’ and ‘sigmoid’ are the Activation Functions.
Are you excited to know the implementation of these layers?? Let’s do it then.
# Initialising the CNN my_model = Sequential() # Step 1 - Convolution my_model.add(Conv2D(32, 3, 3, input_shape = (64, 64, 3), activation = 'relu')) # Step 2 - Pooling my_model.add(layers.MaxPooling2D(pool_size = (2, 2))) # Adding a second convolutional layer my_model.add(Conv2D(64, (3, 3))) my_model.add(Activation('relu')) my_model.add(MaxPooling2D(pool_size=(2, 2))) # Adding a third convolutional layer my_model.add(Conv2D(64, (3, 3))) my_model.add(Activation('relu')) my_model.add(MaxPooling2D(pool_size=(2, 2))) # Step 3 - Flattening my_model.add(Flatten()) # Step 4 - Full connection my_model.add(Dense(128, activation = 'relu')) my_model.add(Dense(1, activation = 'sigmoid')) my_model.summary()
Output:
Step 3: Compile the model.
Now, for compiling our model, we use the ‘adam’ optimizer with loss as ‘binary_crossentropy’ function along with ‘accuracy’ metrics.
# Compiling the CNN my_model.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
Step 4: Fitting the CNN to the images.
In this step, you’ll be introduced to the ImageDataGenerator package of Keras. This step helps you build powerful CNN models with a very little dataset – just a few hundreds or thousands of pictures from each category. After this, we’ll train our model. For training, we will be using the ‘fit_generator’ method on our model.('ENTER THE LOCATION OF TRAINING_SET FOLDER', target_size = (64, 64), batch_size = 25, class_mode = 'binary') test_set = test_datagen.flow_from_directory('ENTER THE LOCATION OF TEST_SET FOLDER', target_size = (64, 64), batch_size = 25, class_mode = 'binary') my_model.fit_generator(training_set, samples_per_epoch =790, nb_epoch = 25, validation_data = test_set, nb_val_samples = 270)
Output:
As we can see in the output above, the 1st epoch yields a test_set accuracy of only 70% but as the training gets along, the final epoch yields an accuracy of 97.66% for the test_set, which is pretty good accuracy.
We are good to go now. Do you know a trick? Let me tell you, YOU CAN SAVE YOUR MODEL AS WELL FOR FUTURE USE!
Step 5: Saving the model.
my_model.save('Finalmodel.h5')
Now, let’s visualize our analysis using the most popular library – matplotlib
Step 5: Visualization.
Visualization is a tool that always lets you infer better and useful insights into your model.
- Plot for train_set loss and test_set loss :
import matplotlib.pyplot as plt # Plot the Loss plt.plot(Analysis.history['loss'],label = 'loss') plt.plot(Analysis.history['val_loss'],label = 'val_loss') plt.legend() plt.show()
Output:
2. Plot for train_set accuracy and test_set accuracy :
# Plot the Accuracy plt.plot(Analysis.history['accuracy'],label = 'acc') plt.plot(Analysis.history['val_accuracy'],label = 'val_acc') plt.legend() plt.show()
This completes our Tutorial for Image Classification of Celestial Bodies in Python. So, what are you waiting for now? Open your Python notebook and go get your hands dirty while working with the layers of neurons. We all know Machine Learning is the future technology and I hope the tutorial might have helped you gain an understanding of the same. For more such tutorials on ML, DL using Keras and Tensorflow do checkout the valueml blog page.
For any queries in the above article, you can ask in the comment section. Hope you learned something valuable today. Good Luck Ahead!
Thank You for reading! | https://valueml.com/classification-of-celestial-bodies-using-cnn-in-python/ | CC-MAIN-2021-25 | refinedweb | 1,116 | 51.44 |
LiteZip.dll and LiteUnzip.dll are two Win32 Dynamic Link libraries. The former has functions to create a ZIP archive (ie,. (ie, limitations of these DLLs are:
To allow your C/C++ code to create a zip archive, add the file
litezip.lib to your project, and
#include "LiteZip.h" to your source code..
To take some existing files on disk, and create a zip archive on disk, do the following:
If successful, ZipCreateFile will create an (empty) zip archive on disk, and fill in your HZIP handle.File contains a similiar).
To take a zip archive on disk, and unzip its contents to disk, do the following:
If successful, UnzipOpenFile will open the zip archive on disk, and fill in your HUNZIP handle.
UnzipGetItem will set the ZIPENTRY's Index field to how many items are inside the zip archive.
To extract an item, you first set the ZIPENTRY's Index field to which item you wish to extract (where 0 is the first item, 1 is the second item, 2 is the third item, etc). similiar similiar to the above unzip example, except:.
You can also zip up some existing file into an archive that is created in a memory buffer. You can either supply your own memory buffer (and make sure its big enough to accomodate similiar to the zip example above except:.
March 11, 2006
Added the function ZipAddDir() to LiteZip.dll to easily zip up the contents of a directory (including the contents of its sub-directories). Also included a new C example, ZipDir, to demonstrate this. NOTE: ZipAddDir does not add empty sub-directories to the zip archive.
August 8, 2008
Added support for "raw" archives.
General
News
Question
Answer
Joke
Rant
Admin | http://www.codeproject.com/KB/library/LiteZip.aspx | crawl-002 | refinedweb | 289 | 65.83 |
NAME
getpw - reconstruct password line entry
SYNOPSIS
#define
_GNU_SOURCE /* See feature_test_macros(7) */
#include <sys/types.h>
#include <pwd.h>
int getpw(uid_t uid, char *buf);
DESCRIPTION
The getpw() function reconstructs the password line entry for the given user ID uid in the buffer buf. The returned buffer contains a line of format
name:passwd:uid:gid:gecos:dir:shell VALUE
The.
FILES
/etc/passwd
password database file
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). 5.09 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at | https://man.cx/getpw(3) | CC-MAIN-2022-21 | refinedweb | 109 | 57.87 |
1 Sep 01:12 2004
Re: [Lhms-devel] Re: [RFC] buddy allocator without bitmap(2) [1/3]
Dave Hansen <haveblue <at> us.ibm.com>
2004-08-31 23:12:15 GMT
2004-08-31 23:12:15 GMT
On Tue, 2004-08-31 at 15:55, Hiroyuki KAMEZAWA wrote: > Dave Hansen wrote: > > > On Tue, 2004-08-31 at 03:41, Hiroyuki KAMEZAWA wrote: > > > >>+static void __init calculate_aligned_end(struct zone *zone, > >>+ unsigned long start_pfn, > >>+ int nr_pages) > > > > ... > > > >>+ end_address = (zone->zone_start_pfn + end_idx) << PAGE_SHIFT; > >>+#ifndef CONFIG_DISCONTIGMEM > >>+ reserve_bootmem(end_address,PAGE_SIZE); > >>+#else > >>+ reserve_bootmem_node(zone->zone_pgdat,end_address,PAGE_SIZE); > >>+#endif > >>+ } > >>+ return; > >>+} > > > > > > What if someone has already reserved that address? You might not be > > able to grow the zone, right? > > > 1) If someone has already reserved that address, it (the page) will not join to > buddy allocator and it's no problem. > > 2) No, I can grow the zone. > A reserved page is the last page of "not aligned contiguous mem_map", not zone.(Continue reading) | http://blog.gmane.org/gmane.linux.kernel.mm/month=20040901 | CC-MAIN-2014-35 | refinedweb | 156 | 61.67 |
Creating a colormap from a list of colors¶
For more detail on creating and manipulating colormaps see Creating Colormaps in Matplotlib.
Creating a colormap from a list of colors
can be done with the
LinearSegmentedColormap.from_list method. You must
pass a list of RGB tuples that define the mixture of colors from 0 to 1.
Creating custom colormaps¶
It is also possible to create a custom mapping for a colormap. This is accomplished by creating dictionary that specifies how the RGB channels change from one end of the cmap to the other..:
Above is an attempt to show that for x in the range x[i] to x[i+1], the interpolation is between y1[i] and y0[i+1]. So, y0[0] and y1[-1] are never used.
--- Colormaps from a list ---
colors = [(1, 0, 0), (0, 1, 0), (0, 0, 1)] # R -> G -> B n_bins = [3, 6, 10, 100] # Discretizes the interpolation into bins cmap_name = 'my_list' fig, axs = plt.subplots(2, 2, figsize=(6, 9)) fig.subplots_adjust(left=0.02, bottom=0.06, right=0.95, top=0.94, wspace=0.05) for n_bin, ax in zip(n_bins, axs.ravel()): # Create the colormap cmap = LinearSegmentedColormap.from_list(cmap_name, colors, N=n_bin) # Fewer bins will result in "coarser" colomap interpolation im = ax.imshow(Z, origin='lower', cmap=cmap) ax.set_title("N bins: %s" % n_bin) fig.colorbar(im, ax=ax)
--- Custom colormaps ---)) } # Make a modified version of cdict3 with some transparency # in the middle of the range. cdict4 = {**cdict3, 'alpha': ((0.0, 1.0, 1.0), # (0.25, 1.0, 1.0), (0.5, 0.3, 0.3), # (0.75, 1.0, 1.0), (1.0, 1.0, 1.0)), }
Now we will use this example to illustrate 2) plt.register_cmap(cmap=LinearSegmentedColormap('BlueRed3', cdict3)) plt.register_cmap(cmap=LinearSegmentedColormap('BlueRedAlpha', cdict4))
Make the figure:
fig, axs = plt.subplots(2, 2, figsize=(6, 9)) fig.subplots_adjust(left=0.02, bottom=0.06, right=0.95, top=0.94, wspace=0.05) # Make 4 subplots: im1 = axs[0, 0].imshow(Z, cmap=blue_red1) fig.colorbar(im1, ax=axs[0, 0]) cmap = plt.get_cmap('BlueRed2') im2 = axs[1, 0].imshow(Z, cmap=cmap) fig.colorbar(im2, ax=axs[1, 0]) # Now we will set the third cmap as the default. One would # not normally do this in the middle of a script like this; # it is done here just to illustrate the method. plt.rcParams['image.cmap'] = 'BlueRed3' im3 = axs[0, 1].imshow(Z) fig.colorbar(im3, ax=axs[0, 1]) axs[0, 1].set_title("Alpha = 1") # Or as yet another variation, we can replace the rcParams # specification *before* the imshow with the following *after* # imshow. # This sets the new default *and* sets the colormap of the last # image-like item plotted via pyplot, if any. # # Draw a line with low zorder so it will be behind the image. axs[1, 1].plot([0, 10 * np.pi], [0, 20 * np.pi], color='c', lw=20, zorder=-1) im4 = axs[1, 1].imshow(Z) fig.colorbar(im4, ax=axs[1, 1]) # Here it is: changing the colormap for the current image and its # colorbar after they have been plotted. im4.set_cmap('BlueRedAlpha') axs[1, 1].set_title("Varying alpha") # fig.suptitle('Custom Blue-Red colormaps', fontsize=16) fig.subplots_adjust(top=0.9) plt.show()
References¶
The use of the following functions, methods, classes and modules is shown in this example:
import matplotlib matplotlib.axes.Axes.imshow matplotlib.pyplot.imshow matplotlib.figure.Figure.colorbar matplotlib.pyplot.colorbar matplotlib.colors matplotlib.colors.LinearSegmentedColormap matplotlib.colors.LinearSegmentedColormap.from_list matplotlib.cm matplotlib.cm.ScalarMappable.set_cmap matplotlib.pyplot.register_cmap matplotlib.cm.register_cmap
Out:
<function register_cmap at 0x7f5f3318a550>
Total running time of the script: ( 0 minutes 1.465 seconds)
Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery | https://matplotlib.org/3.4.1/gallery/color/custom_cmap.html | CC-MAIN-2022-33 | refinedweb | 630 | 51.75 |
#include <mlPageRequestProcessor.h>
It can be stopped and resumed at any time, on the granularity of processNextRequest()
Definition at line 45 of file mlPageRequestProcessor.h.
Adds a
cursor that should be processed via its cursor (the ownership stays with the caller).
Definition at line 49 of file mlPageRequestProcessor.h.
Implements PageRequestQueueInterface interface.
Implements ml::PageRequestQueueInterface.
Returns if the tile request needs some more processing.
Process the requests for the given timeBudget given in seconds.
Processes all requests until the cursors have traversed the whole tree and the queue is empty.
Processes the next calculate page request.
Removes all requests that are canceled and no longer needed. | http://www.mevislab.de/fileadmin/docs/current/MeVisLab/Resources/Documentation/Publish/SDK/ToolBoxReference/classml_1_1PageRequestProcessor.html | crawl-003 | refinedweb | 106 | 51.55 |
Intro
hiccup is an interpreter for a subset of tcl.
New Features
- vwait works
- format and interp have basic functionality (interp -safe mostly works)
- expr works as expected, is efficient, and is supported in conditionals. Also, ternary ifs now work.
- apply and lmap have been added
- Floating point is supported natively (as in, not by constantly reparsing strings)
- {*} works.
- Arrays work
- Namespaces are supported (including 'export', 'import', and 'forget')
- switch is fully supported
- non-naive list handling
- Basic support for file channels has been added. Now files can be opened, closed, read from, written to, and appended.
- Procs can now have optional arguments. The 'args' parameter is also supported.
- Thanks to Haskell's laziness, hiccup does some pseudo-shimmering and memoizes parsing. As a result, things are about 30% faster.
- The REPL now uses readline.
- Error messages are much more consistent and useful, and it is significantly harder to create an error that will crash the interpreter.
Background
hiccup was mostly inspired by picol. picol is a neat little tcl subset interpreter in 550 lines of C. I'd been looking for a language to implement in haskell, and picol made me wonder, "Can I make a haskell interpreter that is just as speedy or speedier with less lines?". I was pretty sure the answer would be "Yes", since haskell has the benefit of more libraries and abstractions, and it seems I was mostly right. hiccup had well under 300 lines of code, and I think (minus type declarations, whitespace, comments, tests, and includes :-P ) it still does, despite my compulsion to add random library functions here and there.
I didn't know tcl when I started, so it was also a lovely exercise in learning the language. As I went along, I discovered that the fundamentals of the language are pretty elegant, but most practical things involve messy details that I don't care enough to implement. I'd like to stress that hiccup isn't a complete tcl interpeter, and it is not intended to be.
If anyone has any suggestions for improvements that are within the scope of what I was trying to do here (some basic features, keep it small and relatively efficient), I'd be very interested to hear. I'm looking at you, haskell gurus.
Note: The purpose of this thing wasn't to display my skill or advocate for haskell. It was a bit of fun in my idle time and an exploration of my interest in programming languages. Drawing any conclusions about haskell, tcl, me, or the nature of reality based on this would be silly. :)
Flaws
- interp is incomplete.
- Poor support for IO commands.. fconfigure, socket, fileevent not implemented yet.
- I made this in small blocks of otherwise idle time. I'm not a haskell expert, I'm not a tcl expert, and I wasn't trying all that hard. :-P
Features
- I'm unaware of any inconsistency with real Tcl in parsing or basic operations.
- Can easily be embedded in haskell programs and given custom commands.
- supports upvar, uplevel, and global
- Fairly complete namespace support
- allows ${bracket variable names}
- has puts, exit, eval, return, break, catch, continue, while, if, for, foreach, switch, source, append, split, time, srand, rand.. and more!
- supports lists, allows 'args' binding in method calls
- has some basic math stuff
- Supports some basic string, list, and array operations
- allows running with 'hiccup filename' or without argument as a repl
- various other things
Look at the stuff in the "atests" (acceptance tests) directory for more examples of functionality.
Future
- Soon
- namespace ensemble support
- ::tcl::string:: namespaces for ensembles, ::tcl::mathop, and similar
- Probably
- dict support
- chan ensemble (including reflectedchan)
- A way to extend it to allow user-created tcl types.
- Maybe
- Futures
- dict support
- A more sophisticated bytecode and compiler.
Example
# Here is an example of some stuff hiccup can do. # I think it's neat. namespace import ::tcl::mathop::* proc decr { v { i -1 } } { upvar $v loc incr loc $i } proc memfib x { set ::loc(0) 1 set ::loc(1) 1 for {set ctr 2} { $ctr <= $x } {incr ctr} { set v1 $::loc([- $ctr 1]) set v2 $::loc([- $ctr 2]) set {the sum} [+ $v1 $v2] set ::loc($ctr) ${the sum} } return $::loc($x) } set fcount 21 puts "First $fcount fibonacci numbers in descending order:" while { 2 <= $fcount } { puts -nonewline "[memfib $fcount] " decr fcount } puts "\nDone." proc say_i_havent_been_to { args } { foreach name $args { puts "I've never been to $name." } } say_i_havent_been_to Spain China Russia Argentina "North Dakota" proc is v { return $v } foreach num {0 1 2 3 4 5 6 7 8 9} { set type [switch -- $num { 1 - 9 {is odd} 2 - 3 - 5 - 7 {is prime} 0 - 4 - 6 - 8 {is even} default {is unknown} }] puts "$num is $type" } puts [expr { sin(4) + 44.5 + rand()}] | http://code.google.com/p/hiccup/ | crawl-002 | refinedweb | 798 | 60.85 |
Adding Matlab C/C++ Library to Qt Desktop Application
- sparshturaga
Hi All,
I have created a C shared library using the Matlab C Compiler. I wanted it to be integrated to my Qt Project.
Before adding the library, I first created a standalone C Executable, to see if the code runs. It does. I get Matlab Plots as well. Everything all right till here. But that's not what i want. I need to change the parameters on from the Qt. Hence, the need for the library.
Since I am very new in it, I followed the forums and blogs to get it done. This is essentially what I followed.
My Project file looks something like this
@
QT += core gui
TARGET = seriously
TEMPLATE = app
SOURCES += main.cpp
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
win32-msvc2008: LIBS += -L"C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft/" -lmclmcrrt
INCLUDEPATH += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft"
DEPENDPATH += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft"
win32: PRE_TARGETDEPS += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft/mclmcrrt.lib"
INCLUDEPATH += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/include"
win32: LIBS += -L$$PWD/../../serious/src/ -lserious
INCLUDEPATH += $$PWD/../../serious/src
DEPENDPATH += $$PWD/../../serious/src
win32: PRE_TARGETDEPS += $$PWD/../../serious/src/serious.lib
@
In the code, serious.lib/dll is added as an external binary compiled by Matlab with VS2008 compiler. The Qt Windows libraries are used for compiling the project with VS2008 compiler.
When I try to run the code, the application stops working and it gives me following result : exited with code -1073741819. Segmentation fault seems to be the issue.
Thinking it might be an access violation, I ran Qt as an administrator but to no avail. I don't understand where I am going wrong.
Please help me with this problem.
Thanks & Regards
- trigga_gnome
Are you initializing the MCR and your library? FYI you don't need to add thee MCR lib path to your INCLUDEPATH.
I am currently developing a Qt app that uses the MCR. I had a similar issue when I was not initializing the MCR and my library correctly. I am generating a shared C++ library with MATLAB Compiler. You mention that you are generating a C library (why not C++ when you are using Qt?); I'm not sure if my approach fits but this is what works in my case.
Here is my .pro file:
@
TEMPLATE = app
TARGET = main
extern/include is where my matlab library header file is
INCLUDEPATH += include
extern/include
"C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v81\extern\include"
SDV.lib is my MATLAB Compiler generated .lib file
LIBS += extern\lib\SDV.lib
"C:\Program Files (x86)\MATLAB\MATLAB Compiler Runtime\v81\extern\lib\win32\microsoft\mclmcrrt.lib"
SDV.h is my MATLAB Compiler generated .h file
HEADERS += include/mainWindow.h
include/ui_MainWindow.h
extern/include/SDV.h
FORMS += UIs/MainWindow.ui
win32:DEFINES += NOMINMAX
QT += widgets
Input
SOURCES += src/main.cpp
src/mainWindow.cpp \
RESOURCES += resources.qrc
Output
release:DESTDIR = ../build/release
debug: DESTDIR = ../build/debug
OBJECTS_DIR = $$DESTDIR/obj
MOC_DIR = $$DESTDIR/moc
RCC_DIR = $$DESTDIR/qrc
UI_DIR = include
@
I initialize the MCR and my library in the constructor of MainWindow. I terminate both in the destructor. Here is the code for that:
@
#include "SDV.h"
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
{
if (!mclInitializeApplication(NULL,0) || !SDVInitialize())
{
std::cerr << "could not initialize the library properly"<<std::endl;
return;
}
setupUi(this);
}
MainWindow::~MainWindow()
{
SDVTerminate();
mclTerminateApplication();
}
@
- honestapple
How to debug such an application? I got the same problems. I was using MSVC2008 as an IDE on Window XP platform. I could compile and run the application which called matlab routine through dll. But I got an error of "integer divided by zero". I didn't know where the error come from even whether the application entered the matlab subroutine. Could anyone tell me how to debug such an application?
- trigga_gnome
I imagine that the divide by zero is happening in your c++ code and not the matlab code. I haven't tried this in a Compiler generated dll from C++ code but here is what happens in MATLAB:
@
n = int16(5)
n =
5
d = int16(0)
d =
0
q = n/d
q =
32767
intmax('int16')
ans =
32767
@
Check anywhere in your C++ code that you are doing division. Maybe posting your code would help... | https://forum.qt.io/topic/23531/adding-matlab-c-c-library-to-qt-desktop-application | CC-MAIN-2019-04 | refinedweb | 739 | 52.46 |
Mercurial > dropbear
view libtommath/bn_mp_clear.c @ 457:e430a26064ee DROPBEAR_0.50
Make dropbearkey only generate 1024 bit keys
line source
#include <tommath.h> #ifdef BN_MP], */ /* clear one (frees) */ void mp_clear (mp_int * a) { volatile mp_digit *p; int len; /* only do anything if a hasn't been freed previously */ if (a->dp != NULL) { /* first zero the digits */ len = a->alloc; p = a->dp; while (len--) { *p++ = 0; } /* free ram */ XFREE(a->dp); /* reset members to make debugging easier */ a->dp = NULL; a->alloc = a->used = 0; a->sign = MP_ZPOS; } } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ /* $Revision: 1.3 $ */ /* $Date: 2006/03/31 14:18:44 $ */ | https://hg.ucc.asn.au/dropbear/file/e430a26064ee/libtommath/bn_mp_clear.c | CC-MAIN-2022-40 | refinedweb | 104 | 60.01 |
I have a Node server hosted on an EC2 instance that is trying to connect to Postgres running on the same instance. When I start the server I get an ECONNREFUSED error to the db:
Unable to connect to the database: SequelizeConnectionRefusedError: connect ECONNREFUSED x.x.x.x:5432
import Sequelize from 'sequelize';
const db = new Sequelize('postgres://postgres@52.9.136.53/unloadx' {dialect: 'postgres'});
ps aux | grep postgres
netstat -anp --tcp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp6 0 0 ::1:5432 :::* LISTEN -
nmap x.x.x.x -p 5432
One problem is that you are using the public IP address. That means your database connection is basically going out to the internet and back. This will prevent the Security Group rule from working, and introduce security and latency issues.
If you were trying to connect from another server in the VPC you would want to connect using the private IP. However, since it's on the same instance you can delete the Security Group rule and just use
localhost or
127.0.0.1. | https://codedump.io/share/m73kwctA4IXM/1/unable-to-connect-to-postgres-on-ec2-econnrefused | CC-MAIN-2017-04 | refinedweb | 190 | 52.49 |
Introduction to Java Packages
The following article Java Packages provides an outline for the creation of packages in java.
- The package represents an encapsulation of a set of classes, interfaces, and sub-packages. Packages make the nomenclatures well defined and in close association with coding design context, such that the developer gets a superficial idea.
- Packages also help to control the data encapsulation, as the default and protected members of class appear through the package scope only, they are not public to all of the classes.
- Before getting into the working of packages, let’s first see some terminologies – Subpackage – a subpackage is placed inside another package, like in the java.util.ArrayList, Java is the parent package and util is the subpackage.
Working of Packages
- Packages are mirrored by directories, now questions are how java runtime knows where to look for the packages that have been created by the user?
- By default java runtime uses the current work directory as its start point and if you user created a package is in sub-directory to the main directory then it will be found.
- Another way is to specify the directory path by setting the CLASSPATH environment variable.
- And the last way is to use the CLASSPATH option with java and javac to specify the path to the classes.
- Please note that packages should be named in order of their domain name for simplicity.
- The java compiler has to be aware of the location of a base directory always for locating the classes, for this reason, we need to set environment variables in the system.
- If we take an example of two packages awtand java.awt.event, the latter is a sub-package, hence the directory structure of later shall be containing event directory inside awt, “$BASE_DIR\java\awt\” is the address for parent package and “$BASE_DIR\java\awt\event\” is the address for sub-package.
Types of Packages
- Java offers flexibility to either use built-in java packages or uses the user-created packages based on the use case.
- The built-in packages are always important while coding, as they offer a lot, the rt.jar file carries multiple functionality definitions, which appear in the java.util.* like packages.
Now let us see built-in and user-defined packages in detail –
1. Built-in Packages
Built-in packages contain a large number of java classes and it contains the following packages –
- lang – The object class is found in this particular package, this package is automatically imported, this package bundles up the basic classes.
- util – this is a very crucial package and contains many classes related to collections like ArrayList, HashMap etc, all the data structure implementations are in this class and you need to use them by incorporating them abstractly.
- io – the input-output stream handling and processing related classes are placed in this package, an example of such classes are InputStreamReader and Filereader, etc.
- net – this contains the classes used for performing certain networking-related operations, the example classes are Socket and SocketAddress.
- beans – contains classes related to bean development, components based on java beans architecture.
2. User-Defined Packages
- A user always has the privilege to enclose his created classes into some package, the name, and directory structure of that package can be defined by the user in his custom way only.
- Hence package is just like a namespace carrying generally related classes and if the package is not tagged to any class then it is put into default package.
Example
Package com.supplychains
Class SupplyChainManagement
{
Public void getPrompt()
{
System.out.println(“Welcome to SCM”);
}
}
So this class now can be accessed in other classes by merely importing the package named as “com.supplychains” and then class supply chain management and its member functions and member variables can be accessed.
How to Create Packages in Java?
First of all, you should have a class, let us consider the class structure we portrayed above only.
package com.supplychains
Class SupplyChainManagement
{
Public void getPrompt()
{
System.out.println(“Welcome to SCM”);
}
}
This class shall be saved like say “SupplyChainManagement.java” is the name we saved it with.
- Now compile this file with javac compiler, that can be done by writing javac SupplyChainManagement.java, this will create a .class file in the same directory.
- Now we can use the command, “javac -d. SupplyChainManagement.java”, this command will result in package formation, now directory structure is a thing we have to be keen about, the “.” placed after -d in the above command represents the current working directory. So in the selected directory, a folder will be created and a package will be formed in which the class file created in step 2 will be placed.
- Next step is to compile the package, this can be done with the following command –
“javac -d .. SupplyChainManagement.java “
.. represents the parent directory (like C drive or D drive).
- Hence this way multiple classes can be bundled up in a directory structure that can be accessed in the corresponding order only.
- Now you just need to use an import statement to incorporate this package in any of the java classes, note that java runtime will refer to it with respect to the path set in the environment variable, which contains the root directory only.
Conclusion
Hence, we read a little about packages in java, their creation, their working and how can we create and import our packages from anywhere to any other classes. Packages can be encapsulating the interfaces and classes. A wide variety of built-in packages are already available to exploit the data structure and algorithms, java provides a wide variety and multithreading is also supported via multiple concurrency packages.
Recommended Articles
This is a guide to Java Packages. Here we discuss the introduction, working, and types of the package which include built-in and user-defined packages as well as creation of packages in java. You may also look at the following articles to learn more – | https://www.educba.com/java-packages/?source=leftnav | CC-MAIN-2020-34 | refinedweb | 992 | 52.6 |
and then your program terminates 🙁 . This, as you might already know, is called an EXCEPTION. This article is focussed at Exception Handling in C++.
An Exception is a problem that arises during the execution of a program. It happens under circumstances which are usually unexpected in the normal course of the program, hence the name ‘exception’.
Since an exception leads to undefined behaviour and often causes the program to terminate, it is crucial for you as a programmer to handle exceptions appropriately.
Exception Handling in C++
In C++, the whole task of Exception Handling is performed using three keywords : try, catch and throw. Of these keywords, try and catch are used alongwith a block of statements, which are known as the try block and the catch block, respectively. The throw keyword is used to throw exceptions manually i.e. we test for a certain condition and if that condition occurs, we throw an exception.
The try block
As mentioned above, the try keyword is used with a block of statements, which is known as the try block.
A try block is always followed by one or more catch blocks.
A try block contains the statements in which an exception may occur.
- In case an exception occurs inside the try block, the control shifts to the catch block where the appropriate task is performed.
- If no exception occurs, the subsequent catch block(s) is/are skipped, and the program continues it normal operation.
A try block has the following syntax:
try { // statement(s) to be monitored for exceptions }
For example, a typical try block looks like this:
try { a = b/c; // This statement will generate an exception // if the value of c at runtime is 0 }
The catch block
A try block is always followed by one or more catch blocks. If the programmer is sure that a try block may throw only one type of exception, then only one catch block is used. In case the occurrence of more than one exception is possible, multiple catch blocks are used. Each catch block handles a specific type of exception.
For example, one catch block may handle ‘division by zero’ type of exception, while another block may handle ‘out of bounds’ exceptions.
The syntax of a catch block is:
catch (ExceptionName variablename) { // statements to be executed if this type // of exception is caught }
For example, a typical catch block looks like:
catch (std::out_of_range s1) { std::cout<<"The exception has been caught \n"; std::cout<<" Press Y to continue exceution or any other key to exit the program"; if (((ch = getchar()) == 'Y') || ((ch = getchar()) == 'y')) break; else exit(0); }
If you want to create a generic catch block i.e. a catch block that is capable of handling all types of exceptions, you MUST put an ellipsis i.e. … in the parantheses next to the catch keyword.
catch (...) { // statements }
The throw statement
The throw statement is used to throw exceptions manually i.e. by explicitly specifying the name of the exception to be thrown and caught. As you know, an exception thrown by a throw statement is caught by a catch block.
The syntax of the throw keyword is:
throw <exception-name>;
For example,
double arrchk(int r, int n) { if( r > n ) { throw range_error; } return (a/b); }
A sample program
A sample program that catches and throws an exception using a try block and a catch block
#include <iostream> using namespace std; double divide (int x, int y) { if (y == 0) throw "Cannot divide a number by zero"; return x/y; } int main () { int x, y, z; cout << " Enter two numbers : "; cin >> x >> y; try { z = divide (x, y); cout << x << "/" << y << " = " << z; } catch (const char *msg) { cerr << msg << endl; } getchar (); return 0; }
The above program will throw an exception if the user enters 0 as the value of y, otherwise it will display the value of x/y. Here, the exception to be thrown is of the type const char *, therefore the catch() contains const char *msg in order to catch it.
The following message would be displayed by the above program in case the exception occurs:
Cannot divide a number by zero
If the exception was of the type range_error or overflow_error or any other type, the catch() would contain a declaration of that particular type.
How to Define your own exception type
You can define your own exceptions. To do this, you need to inherit and override the functionality of the exception class.
#include <iostream> #include <exception> using namespace std; class MyEx : public exception { public: const char * what () const throw () { return "Hahaha.. Finally Found the Exception"; } }; int main () { try { throw MyEx (); } catch (MyEx& me) { cout << "Are you looking for me? "<<endl; cout << me.what () << endl; } }
As you can see in the above program, the class MyEx inherits the class exception. It also overrides the what () of the class exception. what () is a public function and it has to be overridden in order to show the cause of the exception defined by us i.e. MyEx. What happens inside the main () is quite clear. The try block throws an exception of the type MyEx which is caught by the subsequent catch block. The catch block tells the user that the exception has been caught and then displays the cause of the exception. You may also include other catch block(s) for catching other exception(s).
The above program has the following output:
Are you looking for me? Hahaha.. Finally Found the Exception
Summary
Exception Handling in C++ is a vast topic in itself. This article was intended to give you a basic idea how exception handling in c++ works. We hope it helps you understand the mechanism of exception handling. In other languages like Java, the process of throwing and catching exceptions is similar. You must always provide a suitable exception handling mechanism in your programs. You certainly don’t want the users of your program(s) to be overwhelmed by the exceptions in them. Wherever you suspect the possibility of an exception, don’t wait. Just try () and catch (). 😀
Nice article. Before reading this article, I thought exceptions were a problem of Java only. I’ve seen several java based apps and games crash with an error like “java.blah.blah” type exceptions. Now, I know about exceptions in C++ and how to prevent them. Thanks!
Another great article from you. Dude, I want to set up a website of my own for hosting my articles and projects, like you have done. Would you guide me?
Certainly.. Check your inbox 😀
Exception Handling is something that every programmer should know. God knows when an unexpected exception sneaks in and ruins user experience. I like this article for it elaborates the basics of exception handling perfectly. | https://www.wincodebits.in/2015/10/exception-handling-in-c.html | CC-MAIN-2018-34 | refinedweb | 1,126 | 61.36 |
Sample: Creating a SQL Server Agent Alert by Using the WMI Provider for Server Events
Applies To: SQL Server 2016 Preview
One common way to use the WMI Event Provider is to create SQL Server Agent alerts that respond to specific events. The following sample presents a simple alert that saves XML deadlock graph events in a table for later analysis. SQL Server Agent submits a WQL request, receives WMI events, and runs a job in response to the event. Notice that, although several Service Broker objects are involved in processing the notification message, the WMI Event Provider handles the details of creating and managing these objects.
First, a table is created in the
AdventureWorks database to hold the deadlock graph event. The table contains two columns: The
AlertTime column holds the time that the alert runs, and the
DeadlockGraph column holds the XML document that contains the deadlock graph.
Then, the alert is created. The script first creates the job that the alert will run, adds a job step to the job, and targets the job to the current instance of SQL Server. The script then creates the alert.
The job step retrieves the TextData property of the WMI event instance and inserts that value into the DeadlockGraph column of the DeadlockEvents table. Notice that SQL Server implicitly converts the string into XML format. Because the job step uses the Transact-SQL subsystem, the job step does not specify a proxy.
The alert runs the job whenever a deadlock graph trace event would be logged. For a WMI alert, SQL Server Agent creates a notification query using the namespace and WQL statement specified. For this alert, SQL Server Agent monitors the default instance on the local computer. The WQL statement requests any
DEADLOCK_GRAPH event in the default instance. To change the instance that the alert monitors, substitute the instance name for
MSSQLSERVER in the
@wmi_namespace for the alert.
USE AdventureWorks ; GO IF OBJECT_ID('DeadlockEvents', 'U') IS NOT NULL BEGIN DROP TABLE DeadlockEvents ; END ; GO CREATE TABLE DeadlockEvents (AlertTime DATETIME, DeadlockGraph XML) ; GO -- Add a job for the alert to run. EXEC msdb.dbo.sp_add_job @job_name=N'Capture Deadlock Graph', @enabled=1, @description=N'Job for responding to DEADLOCK_GRAPH events' ; GO -- Add a jobstep that inserts the current time and the deadlock graph into -- the DeadlockEvents table. EXEC msdb.dbo.sp_add_jobstep @job_name = N'Capture Deadlock Graph', @step_name=N'Insert graph into LogEvents', @step_id=1, @on_success_action=1, @on_fail_action=2, @subsystem=N'TSQL', @command= N'INSERT INTO DeadlockEvents (AlertTime, DeadlockGraph) VALUES (getdate(), N''$(ESCAPE_SQUOTE(WMI(TextData)))'')', @database_name=N'AdventureWorks' ; GO -- Set the job server for the job to the current instance of SQL Server. EXEC msdb.dbo.sp_add_jobserver @job_name = N'Capture Deadlock Graph' ; GO -- Add an alert that responds to all DEADLOCK_GRAPH events for -- the default instance. To monitor deadlocks for a different instance, -- change MSSQLSERVER to the name of the instance. EXEC msdb.dbo.sp_add_alert @name=N'Respond to DEADLOCK_GRAPH', @wmi_namespace=N'\\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER', @wmi_query=N'SELECT * FROM DEADLOCK_GRAPH', @job_name='Capture Deadlock Graph' ; GO
To see the job run, provoke a deadlock. In SQL Server Management Studio, open two SQL Query tabs and connect both queries to the same instance. Run the following script in one of the query tabs. This script produces one result set and finishes.
Run the following script in the second query tab. This script produces one result set and then blocks, waiting to acquire a lock on
Production.Product.
Run the following script in the first query tab. This script blocks, waiting to acquire a lock on
Production.Location. After a short time-out, SQL Server will choose either this script or the script in the sample as the deadlock victim and end the transaction.
After provoking the deadlock, wait several moments for SQL Server Agent to activate the alert and run the job. Examine the contents of the
DeadlockEvents table by running the following script:
The
DeadlockGraph column should contain an XML document that shows all the properties of the deadlock graph event.
WMI Provider for Server Events Concepts | https://technet.microsoft.com/en-us/library/ms186385.aspx | CC-MAIN-2016-30 | refinedweb | 677 | 53.1 |
UFDC Home myUFDC Home | Help | RSS <%BANNER%> TABLE OF CONTENTS HIDE Section A: Main Section B: Regional News Section B: Regional News:... Section B: Regional News conti... Section B: Regional News: Classified...90: Regional News: Editorial/Opinion page B 4 Section B: Regional News continued page B 5 page B 6 page B 7 page B 8 page B 9 page B 10 page B 11 page B 12 Section B: Regional News: Classified Ads page B 13 page B 14 page B 15 page B 16 page B 17 page B 18 Section C: Features and Sports page C 1 page C 2 page C 3 page C 4 page C 5 page C 6 page C 7 page C 8 page C 9 page C 10 Full Text -.Th ''he Sweetest Strawberries T'his Sicde Of ifeaven. U nF a W o o : .. 7, ~ ~ -0 ' jLivaIflovb QtCountp i-t. r. USPS 062-700 Three Sections Starke, Florida Thursday, Oct. 12, 2006 127th Year 11th Issue 50 CENTS I- er ceil: editorlbctelegraphlcom Noteworthy Osteoporosis screenings today Free osteoporosis screenings for men and women age 45 and abore will take place today, Thursday, Oct. 12, from 10 a.m. to noon at the- Starke Senior Center, 104-LNI Gaines Blvd. Osteoporosis is a disease that causes bones to become thin and fragile and break very easily. Learn what you can do to prevent osteoporosis, and take ad\ antage of this free screening to find out if your bones are healthN For more information, call 0386) 462-1551. e\t. 12. Sponsored b. the Department of Elder Affairs, Su%%annee Ri\er Area Health Education Center. Suvannee'River Economic Council and the Center for Osteoporosis in Jackson% ille. Homecoming Parade forms available now Anyone interested in having a vehicle in the Bradford High School Homecoming Parade may pick up forms to do so at the high school's front office. The parade will take place the afternoon of Frida., Oct. 27. For more information, call (904) 966-6075. ., .. Parade route The route for the homecoming parade remains unchanged. Beginning on Washington Street at the high school, the parade %will travel %west to Orange Street. south to Madison Street, west-to Epperson Street. south to Lafayette Street, east 16 Orange, north to Madison, east to BroadwaN Street, then north back to the high school. Events set for domestic violence awareness Peaceful Paths. an organization founded to assist the victims of domestic violence and promote aw areness, will hold special events in recognition of October as Domestic Violence Awareness Month. A candlelight %igil will be held Thursday, Oct. 19, at 6 p.m. in the atrium at Shands Starke on C.R. 230 in Starke. Police Chief Gordon Smith will be the guest speaker. Those ,in attendance will receive refreshments and be able to hear Terry Carpenter sing. .For more information, call (9041 964-5400 and talk to Bob Clayton Sor Barry Warren. Or call (904) 966- 6878 and talk to Donna Ross. On Thursday, Oct. 26, Steve Denmark of Starke will act as guest chef for a cocktail party to be held from 6-8 p.m. at D'Acosta House in Gaines% ille. Tickets are $25. Contact Heather 'Jennings (3352) .373-9744 229-4180 for tickets. All benefit Peaceful Paths. or (877) proceeds CPR classes offered at Shands Shands /Starke and the American Heart Association are offering the following class in CPR for the community: The Heartsaver CPR community course. covering all ages % ill take place on Saturday. Oct. 21, from 8 a.m. to noon. Registration deadline is Friday, Oct. 13. All participants will need to be at least 10 years old. Register by calling Bonny Green at (904) 368-2300, ext. 104, or Billie Engskow at (90-1) 368-2300, ext 254. Buffer rules trouble BY MARK J. CRAWFORD Telegraph Editor Bradford County Commissioners rebuffed proposed -language for a comprehensive e plan amendment the\ felt would limit their authority over zoning and development in the three- mile buffer around Camp Blanding. That three-mile buffer stretches into the county's urban de\ elopment area around the city of Starke. into downtown Starke and encompasses the city of Law ltey. Eriid Ehrbar of the North Central! Florida Regional Planning Council said the state is requiring local governments to place criteria in the future land use elements of their comprehensive plans to achieve compatible land uses around military bases. "They're telling me the\ want to see it in the comp plan." Ehrbar said. Commissioner John Cooper said that compatibility is an issue for the commission to decide and wanted BY MARK J. CRAWFORD Telegraph Editor A special events ordinance approved on first reading by the city of Starke isn't much simpler than the ordinance previously considered. but it does exemptt events sponsored by ,the Bradford County, Fair Association. E ents' sponsored by the city, city occupational license holders and organizations receiving a need-based waiver are also exempt,' but other special e% ents fall under requirements of the 25-page document. . Special events, as defined by the ordinance are non-routine happenings or social acti ities attracting a large number of people that, in the opinion of the police and fire chiefs, require city services to ensure safety, including fairs, festivals, concerts. car shows, etc. Under the ordinance, there are three classes of special events: major events (cost of more than $5,000 in city services), intermediate events (cost between $1,000 and $4,999 in city services), iand minor events (cost less than $1,000 in city services). City services can include staffing, overtime and equipment costs. . Special events, whatever their classification, will require a permit from the city of Starke. Itinerant merchant licenses (see related article) ill also.be required of all vendors at the event from outside of Bradford Counmty. Organizers. must also pay an application fee and a refundable deposit assessed against the cost, incurred by the 6ity, which organizers must also pay for. There is a process -for obtaining a special events permit. Application for a major event must be made no less than 60 days prior to the event. Only a vote of the city commission can, result in an exception. An application fee, to be determined by resolution of the commission, must be paid, and only 50 percent of that amount. will be returned if the application is denied. The commission will also set a schedule of fees for public works' and building department services. See EVENTS, p. 2A Rules being set for outside businesses BY MARK J. CRAWFORD Telegraph Editor The ordinance the city of Starke is considering on peddlers and itinerant merchants will allow Bradford County businesses outside of the city limits to- conduct special sales in Starke. Prior rules did not make that allowance since those businesses do not hold an occupational license with the city. Starke is amending its current rules to include the following definitions of itinerant and resident merchants: Itinerant merchant: Any person who during, the course of selling travels by foot, vehicle or any other type of conveyance from place to place, carrying or transporting goods, wares or merchandise, offering and exposing the same for sale, or making sales and delivering articles purchased, when such activity is engaged for the purpose of profit, and who does not hold a valid See BUSINESS, p. 2A county commission to know" if the board was obligated encroachment: to agree %with objections raised o\er Camp Blanding's local economic zoning matters by Camp Blanding. impact is %worth tens of millions of Total agreement is not statutorily dollars, so protecting operations and required, according to Ehrbar. ensuring there is room to epand The Legislature laid out the theory and remain a vital military training behind such restrictions. In F.S. facility is also important to the local 163.3175. the Legislature requires economy. local go ernments to work with The law requires that commanding military installations to encourage officers at military installations be compatible land uses around such kept up to speed on proposed changes installations to protect the public in land use or land use regulations that from operations at military bases and See BUFFER, p. 9A to protect militarN bases from urban R{ebuen yRots, Ceoi'en gIIuse Foro rime, socials and editorials, see Regional News section. For sports, see Features and Sports section. Dea line noon Tuesday before publication 904-964-6305 (phone) 904-964-8628 (fax) 6 t89076 63869 2 Crash victim remains hospitalized BY CAROLYN EAVES Telegraph Staff I writer -he embankment. As the vehicle edited the ditch, it rotated counterclockwise back onto the roadway and partially ejected More, Cpl. England said. SMbore was transported to Shands Gainesville. ''" 'Moore was not %wearing a seatbelt. ' -'Charges -are pending alcohol results,- 'Cpl. England said. Fall Jam expected to top bike fest attendance BY MARK J. CRAWFORD Telegraph Editor Hotels that filled rooms and restaurants that ran out of food during summer's bike fest may wantto brace themselves for November, when The Charlie Daniels'Band comes to town as part of Starke's Fall Jam. Organizers for the bike !f-.t hale spent months planning their sophomore e% ent. w which is scheduled for Frida) and Saturday, No%. 3 and 4. at the Bradford Count) Fairgrounds. Johnny Watterson of. J&J Motorcycle Accessories has briefed the city commission on what to expect. His prediction is nriofewer than 40,000-60,000 people attending the event, based on the 30,000 tickets .sold when Mol1 --Hatchet headlined the bike fest as well as the sponsors and vendors who have signed on to the event, Even a number of local people who missed bike fest have told Watterson they won't miss the jam, he said. _ Along with The Charlie Daniels Band; 76ganizers- are--bringing _b.ck Blackfoot. Other bands playing the' stage will be Slow Ride featuring original FoghatmemberTony Stevens, Big Engine, Rick Randlett Band, Ganzo Gator, Minor Infractions, Thermal Image, Flashback, Lopal Traffic, Creature, Dirt Road Band, Southern Rukus and Grump. Vendors galore will set up at the fairgrounds, and attractions include Wrestling, bikini and best abs contests, wing eating and tattoo contests, bike games a mechanical bull and more. For, ticket information, call (904) 964-2010. The bike fest raised $17,000 for local charities, and proceeds from alcohol sales will once again be donated to charity. Audrea O'Neal shows off her style at Brooker Elementary on a very special day when students were allowed to sport hats as part of a fund-raiser for hospital patients. For more, see inside. Starke laws will control events, peddlers. Special events ordinance back up for vote Page 2A TELEGRAPH Oct. 12, 2006 Alpha Nu names new officers,. EVENTS welcomes new members Continued from p.1A The Alpha Nu chapter of Delta Kappa Gamma met on Tuesday. Sept. 19. This group of current and retired teachers had its first meeting of the year to establish plans, goals and programs for the upcoming year. The initiation of new members Angie Hopkins and Frances Stahler (both of Starke Elementary) led by the new president, Virginia Walkup (Bradford Middle School), was the highlight of this meeting. Outgoing President Lynn. Marshall (Hampton Ele.) was also honored for her years of service as president. .Current officers are: Walkup, president; Tangelia Bass, vice president; Pam Bryant, corresponding secretary; Carol i'-;r. Starr, treasurer; and Nancy . .Brewer, recording secretary. Alpha Nu will : soon be offering .. :- / '7 a scholarship for .. female Bradford High graduates seeking an education degree. At right is Lynn Marshall, outgoing president of Alpha Nu. .. .., of 26 cents per mile. Application for an intermediate event must .be made no les* than 30 days prior to the event, and a minor event application must be submitted no less than 10 days' prior to the event. , -Applications are submitted through the city manager's office, and the applicant must provide copies of the special events permit and itinerant merchant license application to each vendor, participating. Copies must be returned to the city and licenses paid for within three days of the event. Each separate itinerant merchant must have a license and display that license. The event must be insured in the amount of $1 million and the city named as;additionally insured. The city manager ill re% ieu the. application to determine if the proposed event will be designated a special event and, if so, schedule a meeting with the applicant. During that meeting, the proposed e ent's impact on. the citi will be evaluated .to establish procedural' requirements. necessary city ser ices. appropriate fees. and correct an\ deficiencies to public health and safety The e'ent %ill then be placed on the agenda for approval b\ the city commission. Denials b% the cit* manager ma\ also be appealed to the commission. and the request for an appeal hearing must be made within-- se% en da;is o' the denial. If the application is appro\ ed. the city manager will prepare a checklist of the terms and conditions of the permit and all estimated fees. Required fees must be made prior to issuance of the permil. The police chief will hold final approval on the number of law enforcement officers or private security personnel required bh the event. The police department will be the' sole prmoider of public law enforcement services unless'the chief authorizes other. sworn personnel. Private security will only be required to provide. private security when deemed necessary by the police chief. 'A schedule of events must'be .provided for law enforcement to schedule coverage. The applicant must also cover the cost of off-_ite traffic control. The number of portable restrooms and garbage containers ill be among those things determined by meeting with the city manager. The applicant must pay for garbage ser 'ice and will be'charged bN the.site if the event site is left littered. I A site ketch showing adequate parking facilities must be presented, along with- any proposed street closure. There must be a. parking space for every 2.5 people estimated to attend the e ent. A sketch will also detail the number and. location of enidors.. Other requirement, include- Alcohol sales and consumption mu-,t be conducted i ithinatemporir_ orpermanent permitted structure on property zoned for commercial acti\it\. and the building and parking must mic.t applicable building .codes. Organizers bear the respoisibilit for making sure open col nainers .are nol permitted beyond thedesignated special event site. Food vendors must be licensed by 'the Florida Department of Business and Professional Regulation or the Department of Agriculture and be insured in the amount of $1 million with the city named as additionally insured. Amusement rides and -attractions must meet slate requirements and 'the owner insured in ,the amount of $1 million with the city named as. .additionally insured. All insurance certificates must: be provided to the city -at least 30 days prior to the event. ' *Permits will only be issued to events that comply with zoning and land use regulations. Outdoor noise must be controlled in accordance with the city's noise ordinance. Temporary structures must be structurally .,sound and a, building inspection may bd required. *An e ent headquarters % ill -be designated %%ith contact information provided to the city. Event staff must wear identification in the form of shirts, badges, etc. Special lighting or visual effects such ,as fireworks must be approve ed by the, city manager. CitI commissionersappro ed the ordinance on first reading without comment on Oct. 'K. The second and final reading has not been scheduled. .. Every calling is great when greatdl pursued. ' -Oliver Wendell Holmes Officers for the new year are (-r) Virginia Walkup, Tangella am Bryant, 'Carol Starr and Nancy Brewer. To all the citizens of Starke... especially the citizens of District 1 THANK YOU THANK YOU THANK YOU for allowing me the opportunity to serve as your City Commissioner for the. last 16 years. To the Staff at Jones Funeral Home, My Friends, and Family, THANK YOU for your patience and the time you allowed me to fulfill my duties as Commissioner. Pictured (I-r) are new member Angie Hopkins with her mentor, Pam Bryant, and new member Sheila Evans with her mentor, Frances Stahbler. BUSINESS Cnoritinued from p. 1A o cupational license issued by tI' city, or does not maintain a -hysical business address in, Bradford County. Resident merchant: Any person who holds a valid ocupational license issued by thb city, or maintains a physical business address in Bradford County. The restrictions set forth in thp ordinance apply to itinerant merchants, not resident merchants. Itinerant merchants are ndt allowed to sell or solicit business in-public parks or on city streets, rights of way or sidewalks, nor are they allowed tostop or attempt to'stop people passing by any of those places. Tliey may not block streets, sidewalks or. other public locations. The new ordinance clarifies the license fee that the city wijl charge itinerant merchants and- peddlers. Though it does nol specify a fee, it authorizes th| city commission to adopt a mrnthodology for determining thW appropriate fee, requiring that the licensing fee be based on~a "proration" of fees paid by resident merchants. Itinerant merchants will not beallowed to: Conduct sales at night. The period is defined as the hours between sunset and sunrise. Operate in a temporary structure. Forbidden structures include tents. Place signage on city streets or rights of way. This includes portable or disposable signs, pinwheels and banners. Operate without potable water and an accessible handicapped restroom open to the public. *Attract attention orpatronage through noise, including crying, calling, shouting, ringing a bell, blowing a horn, etc. Conduct sales out of a recreational vehicle, travel trailer or tent. Such items may be displayed if they are for sale, but are otherwise unacceptable at a transient sale. Operate a transient business with more than one vehicle with an attached trailer per parcel of land. All -merchandise must be kept inside the vehicle and attached trailer. These rules do not apply to resident merchants, including those located in Bradford County outside of the city of Starke. A Bradford County car dealership, for example, would. be allowed to conduct a tent sale in the city limits. Such restrictions are intended to discourage itinerant merchants from doing business in the city. Starke's original law on peddlers arose from complaints that local businesses had to compete with outsiders holding tent sales and other sales events. The new ordinance is intended to clarify the older law and classify county businesses as resident merchants. Exceptions to the restrictions include itinerant merchants selling agricultural or food products, yard sales, seasonal fireworks' sales, art shows and festivals or other events approved or co-sponsored by the city of Starke. Events co- sponsored by the Bradford County Fair Association and utilizing the fairgrounds are also exempt. j&ariforb ountp elegrapb Subscription Rate in $3000 Trade Area John M. Miller, Publisher TradeaEditor M.,k Crawiord Sports Editor: Cliff Smrn lley Advertising: K vin Miller Dorn Sanls Darlene Dougtlass Typesetting Joalyce Graham Adcvertisinq aind Newspaper Piro Classified Adv,. 3ookkee iniCJ Eirl W. Ray Virginia DaEughertv Kathi Bennell THANK YOU all for your continued support. Steve Futch Business a Service Directory - Automotive' 'building Supply .--Home Repair *S AUnto.- 'k BRADFORD HOME t Air Conditioning s S ac kson REPAIR & PAINTING and Quick Lube BUILDING SUPPLY 904-966-2024 QUALITY PARTS AND "Where Quality & Service NORTHEAST AND CENTRAL FLORIDA SAME DAY SERVICE are a Family Tradition" BUILDERS INC. Computer Diiaghostics SElectrical. Tires US 301 S. STARKE 904-769-9616 Brakes Engine 964-6078 Additions Timing Belts & More! FREE ESTIMATES! 145 SW 6TH AVE Remodels l TowinJ gftm LAKE BUTLER Custom Homes 7077 SR 21 Keystone Heights, FL 496-3079 Residential / Commercial : 2 miles North oSR 100oo State Certified 352-473-6561 Licenved & itvired CBC #1252824 Home Repair T'royer'5 s-ome PReyair o'Hilt-'.Rit Ird C-l lt (tLc Everett Troyer Jif t ears ,perionce * Home Repairs * 0of Repairs (904) 96 -6852 Cell: (941) 19-9111 Housing Butler Townhomes LLC Lake Butler, FL ATTENTION! Local Residents 95 to 1000'o Financing for qualified buyers. In-house additional financing for deposit requirements. a// It-,i -,:, lhedh le a,', a ''' ient 386-4 6-2020 Title Services - I 9~1;f~ '6 Oct. 12, 2006 TELEGRAPH Page 3A Hatis (0firfi Oct. 6 Brooker Elementary School participated in a national fund-raiser that collected money to provide hats to hospital patients. Students and faculty paid $1 each for the privilege of wearing their favorite hat in school ... something that is normally against the rules. The money went to Heavenly Hats, an organization started by a 15-year-old in Wisconsin that has now grown into a national nonprofit 1111-- 6V~fM--V=* organization. LEFT, ABOVE: Cody Wentworth sports a ball cap. RIGHT, ABOVE: William Forsythe had a stuffed cow on top of his hat. Travis Hinds (at left) mugs for the camera while Randi Leddington (background) looks on. BMS students served after school, on weekends' Saturday School will be held during the month of October at Bradford Middle School on Oct. 14. 21 and 28 from 9a.m.., to noon. These classes are designed to help with current academic classes as well as FCAT testing. Parents are responsible for transportation to and from the school. After-school tutoring is available on Tuesdays, and Thursda)s from 2:45.3:45 p.m. Students can recei% e home%% ork help or small group tutoring during that lime. Computer Lab is also openly on Tuesday and Thursdays from 2:45-3:45. Students ma\ work on technology projects. Internet research or FCAT Explorer. Bus transportation is available for the after-school sessions only. A permission slip went home and is required for students to attend these programs. Please return ASAP. Contact Gavle Wealer at BMS, (904) 966-6705 for arn additional information. YMCA needs reading mentors The YMCA Reads program at Soulhside Elementary needs adult volunteers to mentor students. The program matches first- and second-graders who are struggling with reading with a volunteer mentor. This is also an excellent opportunity for high school students seeking volunteer? e perience. YMCA will trairin oluntecr% in working ilhi students j The program takes place at Southside Elementary School cafeteria from 3-5 p.m., Monday% -Thursday , If Nou would like more,., information, please call (904):' 964-YMCA. Child abuse prevention group meets ' Oct. 18 Join members for the, Bradford-Union Pre% mention Task Force for a brown bags lunch on Wednesday, Oct. 18i , al noon. . The task force., which. works to address the issues ; of child abuse, domestic Silence pre% mention and foster parenting, meets monthly at First Presbiterian Church of Starke. 921 E. Call St. ls!).Sl.ST.3T3%Tk.o5ME 138 E. Call St, SLarke, FL 904/964-4420 You're invited to a Revival Meeting at Harmony Independent Baptist Church of Sitarke October 16 22, 2006 LEFT: Shyla Young had a pink and fuzzy hat. MIDDLE: Wyatt Parrish was going for the Charlie Brown look. RIGHT: Lydia Starling had a flower- gardeners special that was handmade at a tea party hosted in her honor. LEFT: These four kids were ready to rumble in a. variety of headgear. They are (I-r) Tyler White, Madison McClellan, Tylor Callum and Andrew Sadler. RIGHT: Brandon Reis and his bandana. Guest Speakers ~ Monday & Tuesday nights Bro. Bobby Leonard, Monroe, NC Wednesday night" Dr. Ken Pledger, Pastor, Calvary Baptist Church MiddleIiurg, FL Thursday night Camp Tracey Children's Home Jacksonville, FL Friday thru Sunday nights Evangelist Keith Linzy w/Crossroads Rescue Mission Grover, NC 8843 SR 100 East Starke, FL (Approx. 3 miles East of US 301 on SR 100) Your #1 Choice For Repairs and Re-Roofs Steel Buildings & Components LEFT: Catie Blankenship decided to cowboy up. RIGHT: Lindsay Cail opted for Strawberry Shortcake. ABOVE: Isabella Perkins had a hat that would suit any Victorian lady who planned to go to a summer garden party. I l ,'& 4 I f' e. .f j3It i z ~ * Rifles Shotguns Handguns 100 Guns in Stock! |AMMO -REGULAR & SPECIALTY John Dehoff is a grinning cowboy, Take the course opposite to custom and you will do well. -Jean Jacques Rousseau 60-Day Layaway S ima *= Debit Cards Accepted M-F 9-5; Sat. 10-2., Nationwide and international opportunities Be yotu own bios.s and make thousands of dollars without a license or experience. Free training, web tools, marketing material and complete support. Ce the first in your area.. Conditions apply CALL NOW AT 1-877-300-1595 man, _Mg j Have the courage :of your desire. -George Gissing .e < ^ ,' ' Experience... T- -iL 1 i * Structural products Standing seam roof systems R-panels, U-panels, A-panels Full line of accessories ol ALL AMERICAN re'e CONSTRUCTION 1-866-279-5035 fax 904 493-2842 License a Insured For Product Information, Pricing & Order Forms CBC 125f774 caett sebe hts I her. Teaching... 'Is the best experience. I have over 30 years experience., teaching in the classroom. Teaching has given me real world experience... On the problems we face, On the performance we must expect. On the progress we must make. GREG FOR SCHOOL BOARD DISTRICT 2 "Political Advertisement paidfor and approved by Greg AlVarez for School Board District 2" 1 4--, -1 -j 4 Bradford Gun & Pawn US-301 N, Starke 904-964-5440 ! Page 4A TELEGRAPH Oct. 12, 2006 | -I -Schools hold professional 'LAl:m i1. LA^kr #^ n day for educators BY TERESA STONE-IRWIN Tele*graph Siaff\I'riter I he school board ol Bradford County\ will be holding a, professional development day for all Hr.idlord area educators on Mond.i. Oct. 16 from 7:45 a;m to 3.15 p.m. Regul:ir school. \\ill not be in session that day and the programs are being held in various classroom at Bradford High School. Sev eral topics will be covered throughout the da\ in S50 minute sessions each Teachers %will be given instruction' in areas 'such as using digital tools, e-mail. PowerPoint, E\cel. Rierdeep. FCAT E\plorer, physical fitness/wellness and the Florida Reading Initiati e. The same da. a free seminar w ill be held at the 'Starke Conference Center from 9-30 ,a.m. to 2-30 p.m. at the Starke Conference Center, there will be a free seminar for area educators. school counselors. social workerss school .resource officers and parents This all dav seminar. Build Bounce-Back Kids,. focuses on moving children and .outh from risk to resiliencN, and %w hat educators can do to help The training seminar till Ombudsman Council meeting The North Central Florida Long-Term Care Ombudsman Council will meet on Thursday. Oct 19.ait 12:30rp.m at Hospice of North Centra.l Florid,. 42(1(0 N W tV9lhh HBld i (i.iiniesvillc Ihie council is .i group (i1 concerned citi/ens w hose oel is to improve e lie qt.ilii| o1' lile and care for L'wpeill 'hi w'' lin lice.i Is,.'doii '-leiii ..'rcl, i.ilil i., ;LEFT: (L-R)Dianne Murphy and Robert Austin. symbols represent things in the real world. One of participate in the workshop. They are learning new the most basic concepts in Algebra is that symbols methods to use in teaching math to their Starke represent numbers. That concept is sometimes hard for Elementary students. RIGHT: Sherry Colarusso places students to understand. Using these diagrams is just Xs in a venn diagram-a type of visual aide that lets one example of the methods Colarusso taught to Starke -ahielatim aca math meatid-n ralae l A -- -- 1-4" ,.I-- *A- --.- - reiatiuoinniups uy leuttingwerieitary iea er d during te workshops. rstuci entssee maitematicailr Republicans meet tonight The Bradford Countl Republican Executive Committee w ill meet at 7 p.m. tonight, Thursday, Oct. 12, at' the offices of Sonshine Title Company on Edwards Road in Starke. This is a verN important meeting with only a few short weeks to the general election. and the committee is looking to gel out the tole with the help of grass roots workers. .All--regi~teed-Reputblicanfl are urged to attend. -For more information contact rChairnian David L. Dodge at [(904) 964-4610 or (904 "'96- S0431. [ Never mind your happiness; do your duty. -Will Durant Glen A. Johnson 904-769-9163 Glen @JohnsonComputers.us .'I r '** ..'. tit AARP offers driving course AARP offers two-day, four- hour classroom instruction to ,refine dri\ ing skills and de\ elop defensive driving techniques. The cost is $10 and there are no tests, plus a three-year certificate qualifies graduates for an automobile insurance discount. The class %will be offered in Gainestille on the following dates: Oct 14 and 21 (two Saturdaysi from 9 a.m. to I p.m. Nov. 2-3 from 9 a.m. to I p.m. A class %will be offered in Starke on the following date: No% 14-15 from 10 a.m. to 2 p.m. For more information and to register, call i352> 333-3036. Microsoftl Surgery EYE EXAMS CATARACT SURGERY GLAUCOMA DIABETES* LASERS GLASSES Eduardo M. Bedoya, MD Board Certified, American Board of Ophthalmplogy Medicare. Medicaid, Avmed, Blue Croi/Blue Shield & other insurance accepted. . Se habia espanol. Lake City Macclenny 1-866-755-0040 HEAVY EQUIPMENT OPERATOR TRAINING FOR EMPLOYMENT Bulldozers, Backhoes, Loaders, Dump Trucks, Graders, Scrapers, Excavators '-National Certification -Job Placement Assistance 800-405-5833 Associated Training Services Wit UANTEDSMATES POS TAL SEN VIE. ~~~04-10~ ii~ r:t - Statement of Ownership, Management, and Circulation (Requester Publications Only) Bradford County Telegraph 10 l6 1 7-1-17 l10j10l Sept. 28, 2006 I .aftn DO 2 0 o -.o 1 54P.dO~ A- 8 6Aoo k,0.m,1 Weekly ,52 $30.00 P.O. Drawver A. Smarke. FL 32U9 1, Bradford Courty T a8o~ m~om,.. 0--O'CSa of m,0's Woc-G.F.. 0, ^" of a 00.. 0-?" w RO Dra%&er A. SLakrke, FL 32091-9998 9. RAFam m.W n C=Wlele his Ug Ad0..woEf RW. rul5e, 5. dN..g8V Ef 01M. Mtb ble OW MV~O. .""W, John NI. MIiller. P.O. D ra%%er A. Stark-e, FL 32091 -9998 E.WN N.- hv~g Mark Crawford, P.O. Drawer A, Starke, FL 32091-9998 ~vEd I dcpWneWe" John NI Miller. P.O. Drawer A, Starki. FL 32091-095 Bradford County Telegraph. ine PO. Dra Aer A. Srarke. FL 3Xi.91- 9998o John NI and Madge A Millet PO Dra.%er A. Starke. FL 320J91-'9998 8.v -A." ,O Sp u0r 0.c-00540Oo, 0O0A 0554 0..81 000 54.so0 o a. 04.8 NooctwQap*d o8 n P48N 1kWQ 12pu b Mod..~hO~k M3 9a54kessm 14. bD.%%00.5C86548oD.W Bradford County Telegraph Sept. 28,2006 7nfloP=0oft8,g12=00"8.' = 00.80 4. L TotNWobwa(opim(W0pr..o) 5800 -5775 hwm" PaoPj.AqwmewwwMat Oo54o tw n.m ~oPs II ~1002 962 w (2)CpS 'y bj0eo.. 4006 o Or -0- "UM O W 'SSO4247 4298' (4) m )bWb O a --0-' -0- b, ~bypMdo~86(10115W(~ 4 .~~ 5249 5260 Ne.-1o0dC.Op18SW014o mPS F.. 3M41(kkW.. ",k Rq,. 0 3Y d. b~ k- 34 '34 (1 d~ by a P0o54Am OLO Se0.0. 1000) kW d ~. () __ (BY Mat Nw..oMdCoeOmDbbOb~o1d 00454. h f~t 148010. 0ooo M -0- -0- 0.T0Nq~D00.(6010(t,(o(3(34 34 t.-a m~ twoicnv 5283 5294 g. 0op00-A qwwm (s.4(S480V4800.- -Pdbh5e84p0#13)( 517 481 IL o0(.,,ft11g 5800 577'5 O00Ck04o099% 99% rl 1/ 9/06 C001,054,, U50 0. ,l(otAo o860) .00480... ( odo d.w48'11o01.8( 610.1 W050 PSFool35264 8. Wb05200 (Pb.P 2&3) Parents are invited to get involved in the 'Bounce-Back' session at the conference center from 9:30 a.m. to 2:30 p.m. on Oct. 16. also pro% ide information that is designed to increase resilience in educators, as well Learn pre% mention and inter% mention strategies Learn how to reduce stress in NOurself and \our kids. Learn how to move kids from being "at risk" to Sresilient." ' Impro e your o\ resilience. .-* Learn practical tools' to help children, families and community groups o0erconme e\er\da\ problems and unexpected crises. Help others build their coping skills In-sern ice points .ind CEtll are au ailable to participants SThe program is presented b\ the, Northeast Florida Educational Consortium lit ing facilities., adult family\ care homes and lon.g-erm care units in hospital A trained. certified volunteerr ombudsman is giten authority under Florida lai to identity. investigate and resolve compl.int.s made b\. or onli behalf o. long-ternm care lacililt resident., f-or more inforin.alion. pIc.se conItac l' d\ Il),sbierr\ .it i52 955.-510 5 or i,_SSi 8 1--(141)4 E-mail her at d'.'lhcrr\ Ill'" cIdei.il'.Tirrr ir, -r, NOTICE OF PUBLIC, HEARING TO. AMEND THE TEXT OF THE CITY OF STARKE LAND Zonihg Commission of the City of Starke Florida, hereinafter referred to as the Zoning Commission, at a public hearing on October 26, 2006 at 7:00 p.m., or as soon thereafter as the matter can be heard, in the City Commission Meeting Room, City Hall, located at 209 North Thompson Street, Starke, Florida. LDC 06-5, an application by the City Commission, to amend the text of the Land Development Code by amending Article 5, entitled, Permitting and Concurrency Management, by adding a new Section 5-23, entitled Proportionate Fair-Share Transportation Program, to establish a method whereby the impacts of development on transportation facilities can be mitigated by the cooperative efforts of the public and private sectors. CITY OF STAR. jC Johnson Computer Consulting Hardware Softhiare Networking Wint'ow.s 2000 Pro & Server XP Home and Pro Win 98 & 95 AcceSS Excel Word \,EYE CENTER of North Florida general Eye Care & a d Oct. 12,2006 TELEGRAPH Page 5A Southside announces Sept. Terrific Kids A Southside Elementary School recently announced its September Kiwanis A Terrific Kids. They are (1-r): First row, Derrious Mitchell, Terry Spaulding Jr., Thelma Tenly; second row, Tiffany Ritch, Antwane Mitchell, Maya Farmer; Third row, Alex Mejias, Savannah Cooper, Dalton Page, Olivia Faulks, Dasaray Steele, Dixie Adkins, Brice Dixon; fourth row, Daunia Moss-Jackson, Jonathan Ruis, April Wood, Tristen Whittemore, Corey Robinson, Dylan Whittemore; fifth row, Bruce Carlton, Marissa Greenwell, Austin Norman, Brittany Toms, Wisam Fares, Taylor Barnes, John Baier and Austin Burkhart. Honored but not pictured were Austin Davis and Ivy Rankin. , ...... I Hampton Elementary School recently announced its September Kiwanis . f Terrific Kids. They are (I-r): First row, Cameron Clem, Trevor Rogers, CC . SeWoods, Amber Caulk, Sarah Hirsch, Ryan Curtis, Jorge Villafurte; second trd row, Daniel Woods, Sarah Glisson, Maggie Glisson, Jake Johnson, Tiffany Atwood, Marcus Thompson; third row, Rick Stephens and Officer na Bear Bryan. ,pictured ereAusinDavisan Alvarez family reunion set for Oct. 14 A family reunion of the descendants of Joseph "Jose" and Juarna Barbee Alvarez will be held on Saturday, Oct. 14, at Northside Baptist Church on SR-16 in the Fellowship Hall. Friends and family members are urged to bring old photographs, covered dishes,. desserts and tea or drinks. Eating and drinking utensils will be provided. Lunch will be served at about 12:30 p.m. Trick or treat at BC library Wear a Halloween costume and trick or treat at the Bradford County Library. A free book bag from Reading Is Fundamental will be given to each child. "RIF offers enriching activities that spark children's interest in reading," said Ethel G. White, children's services. "And each child involved with IIF gets to choose and keep new books at no cost to the children or to their families." . Learn more about this program that will celebrate 40 years'of encouraging children to read at. Halloween stories, music, activities-and a craft are all part of this special time. Other children's story times are Family Storytime. on Tuesda)s at 10 a.m. for preschoolers with an adult and Mother Goose Time for. babies up to one-Near-old with an adult on ThursdaN s at 10 a.m.. or e-mail the library director at bradford@rieflin.org. It's heritage day at Old Beulah Cemetery Visit Old Beulah Cemetery in Camp Blanding on Saturday, Oct. 14. Anyone interested' in going to the old cemetery can meet at Beulah Baptist Church on S.R., 21, -south of Middleburg at 8:45 a.m.. Bring a covered dish to share following the trip to the cemetery. For .information, call Carolyn Weeks at (904) 529- 9661. No Justice in Bradford County Legal System (Starke). 5 years after divorce still in court. Who's gaining? I CHURCH- Philadelphia Missionary celebrate its 117th homecoming Speaker will be the Rev. Willie, Baptist Church of Lawtey, service on Stinday, Oct. 15, 11 R. Strong Sr. from Orlando. At and the Rev. MarvinA. a.m., followed by the traditional the 3 p.m. worship service Elder McQueen II, pastor, invite the pot luck dinner on the grounds. George Lott will be in charge. public to a church ministry A revival will be held on The public is invited. The Rev. banquet on Saturday, Oct. 14, 7 Monday, Tuesday and James Wilcox is' pastor. p.m., at the Bradford County Wednesday, Oct. 16-18,7 p.m. fairgrounds. Guest speaker will The Wednesday service will be Madison Street Baptist be the Rev. James E. Rackley, youth oriented with a pizza Church in Starke will host a pastor of St. John Missionary bash. The public is invited. For concert by five-time Grammyv- Baptist Church of Lawtey. information, call pastor Don award winning tenor, Larnelle For ticket information, contact Thompson Jr., (904) 782-3881, Harris, on Sunday, Oct. 15. at 6 Paulette Strong at (904) 782- or Harry Green, revival p.m. The MSBC choir will join 3390.. coordinator, (904) 964-6813. Harris three times during the concert The public is in iied. Madison Street Baptist River of Life Church of God, Church will be hosting a fall across from the fairgrounds in New Covenant Baptist festival, "'Heroes Unmasked." Starke, will have its fall bazaar Ministries in%' ies the public to on Tuesday. Oct. 31, at and craft show Friday and an appreciation service and first Bradford Middle School from Saturday, Oct. 20 and 21. Friday / anni'ersar) celebration for 6-8:30 p.m. No costumes hours are 8 a.m. until 6 p.m.; pastor Isaac P. and sister please. Saturday hours are 8 a.m. until Rosemary Brantley on Sunday. 2 p.m. Hot harvest muffins will Oct. 29, 11 a.m. with guest Pleasant Grove Missionary be available Friday morning and church, Tra'.elers Rest of Baptist Church in the soup and sandwiches will be Atlanta and the Rev. J.W. Speedville community and the available for lunch on both Warren of Starke at 3:30 p.m. Rev. James F Jones. pastor. das. There will be a wide Dinner % ill be served following announce that the 116th variety of crafts and food items .the morning worship service. homecoming day scheduled for for sale. Admission is free and Sunday, Oct. 22. has been door prizes will be awarded Walk By Faith Church canceled. hourly. For information, call Ministries and Faith Walk "904j9 4-85 Outreach %ill have a "Taking Pine Valley Congregational (904) 964-8835. Back the Devil', Night" sert ice Holiness Church will have its nrue Vine Ministry will be beginning at 7:30 p.m. on homecoming celebration on celebrating 17 years in ministry .Tuesday, Oct. 31. Speaker for Sunday, Oct. 15, at II a.m. and Saturday and Sunday, Oct. 21-' the evening is prophet Toby 6 p.m. Guest speaker is the Re-. 22. This year's theme is: Ellison from Wauchula. Bobby Griffin. A covered dish Entering New Dimensions in Also the dedication serx ice. luncheon will follow the 2006: Reflecting on the originally planned for Oct. 15 morning service. Re% ival Journey. On Saturday, Oct. 21, 22, has been postponed until services will follow Monday- the weekend will commence Jan. 14-28. 2007. Wednesday. Oct. 16- 18, at 7:30 %with a communitywide fish fr Kingsley Lake Baptist Church p.m. nightly. The Re%. Justin at the Thomas Street Park, 'il Lake h pcin Co rch Griffis will be guest speaker, behind The Apts, from 2-5 p.m. % ill have homecoming on The church is on 178th Loop On Sunday, Oct. 22, special Sunday. Oct. 15 a.m., with beside American Trolley Co. services will be held at 8:30 and Dr. Ed Kirkland returning for Pastor is Joy Thornton. Call II a.m. At the 11 a.m. ser- ice. the service. Dinner on the (904) 364-6304 for information, the True Vine family will grounds following the service. M.L Zion A.M.E. Church of recognize some of the E ervone is welcome. Laey ilI sponsor a concert community's finest leaders. Full Gospel Assembly featuring Ben and Jewel Dinner wil also be served. Church's Teens for Christ Tankerd on Friday, Oct. 20. at 7 Ebenezer Missionary Baptist youth group will build a p.m.!at Bradford High School. Church %\ill observe its pastor dragster for Jesus. Teens from The public is invited, and church anniversary on 13-19 arei ll Pited. For Sunday Oct. 1, at II am. information, call Pastor Leon at Lawley Grace United Sunday Oct. 15, at II a.m. (904i 964-3189. Methodist Church will Panorama Homeless Coalition Inc., the ser- ice pro. ider for Bradford County grants. meets the second Thursday of the month at 6:30 p.m. at 625 Brownlee St. Hospice is hi need of volunteers There will be a volunteer training program soon, and if interested in this important volunteer opportunity' call Carolyn Long. 386-328-7100. The Bradford County Veteran Sen ice Officer days of serve ice are Tuesday and Thursdays, from 8 a.m. to.5 p.m. For inquiries, please call (904) 966-6385. Hey Say No Morel Look Who's 741 mg !^ ELAINE HAILE Oct. 2, 2006 * Bradford%-gh School, class of 200b videos are now available. The cost is $15 each. Contact Nancy Odom at (9I 966-6086 for more information. Happy Birthday Marsha! -7 From lomma e& CLint * A weekly volunteer at three area schools. I am driven by a desire for well- equipped teachers and classrooms. Every youth should be given the opportunity for a high paying job or college education. I am determined to raise the appreciation and compensation of teachers. Bradford County must remain competitive.with other districts or we will continue to lose teachers (like my opponent) to other school systems. We must treat all employees with dignity and respect to ensure a foundation of effective teachers and staff. I'm devoted to community schools. Our future depends on community and parental interest and involvement. That's why :,am the candidate at the school board meetings. With three children in public schools, I am personally invested in the performance of our schools. As your school board member, I will be your voice. I have the time and my time will be spent working and volunteering in BRADFORD County Schools for the best interest of outr students. I would truly appreciate your vote and consideration this November 7th. I DRIVEN DETERMINED DEVOTED "Political Advertisement paid for and approved by Staccy Shuford Crcighton for School Board District 2." Page 6A TELEGRAPH Oct. 12, 2006 Starke commission reorganizes for new year Hampton leaders sw6rn in BY.MARK ,. CRAWFORD 7elegr(a/t Editor. Starke said goodbye to two commissioners and welcomed two more as it entered its newv \ear last week. Steve Futchl who first joi ned the city commission in 1990 and has served as mayor several times, including this. past year, chose not to seek reelection. He has also served as president of the Florida League of Cities this year, a term that will continue through December, and he encouraged the board to remain involved with the league as well .as all of the regional and local organizations that guide the future of the city. More importantly, he said, commissioners should stay involved with the citizens, of Starke, extending a welcoming hand to new residents and businesses. Among challenges that need to be addressed are city streets, maintenance of which.is. very far behind, he said. He also told the board to hold Comcast to- its agreement to improve cable- service in the city within two years. Touchihig on a more sensitive matter-in fact taking this final opportunity to bring the matter up for the first time publicly - Futch told the board to settle the issue of severance pa\ to Ken Sauer once and for all. Futch was the only commissioner, who wouldn't \ote to accept Sauer's resignation in April, when the former city manager \ < facing dismissal. Severance pay iM a Lon traciual matter, and Futch said before long the commission will hate paid their allorney more to fight this battle than it would have cost to -selle %t ilh Sauer. Futch said he is proud of the ci ty of Starke, and he challenged commissioners to make their citizens proud of them. A commissioner alone can't do anything, he said, encour.niv'in ..'ollli ,hiolners to work l h':-i li i r ilic oI h .' llloni good. " The board also said goodbye to Commissioner Larry Davis, and both were presented with plaques and shadowboxes in remembrance of the time they dedicated to the city. Judge Ph llis Rosier swore in the two commissioners who will replace Futch and Davis, Danny Nugent and Tra\is Woods. Wilbur Waters was also sworn in to begin another term on the board. SFollowing the ceremony, Carolyn Spooner was untanimousl\ elected by the new board to serve as mayor in. 2006-2007. This will be her Former Starke Commissioner Steve Futch embraces his daughter, Stephanie, held earlier last month in a reception the city held in-his honor. He served on the commission since 1990. :.,9 'lH'li -1 , Ila, Th, C' 01" 5- 10 Former Starke Commissioner Larry Davis accepts a plaque from Carolyn Spooner, who was unanimously chosen by the new board to serve as mayor for the 2006-2007 year.:' second time. serving as mayor, arid she thanked her fellow commissioners for their vote of confidence, saying she looked forward to the board members working together as the city moves forward. Commissioner Tommy Chastain also received unanimous support as he was designated: the city's vice mayor. Aswelcomeswereexchanged. thecity's attorney,Terry Brown. offered a prediction of things to come, telling the new board that Starke is primed to change . more in the nel ti\ e.)ears than it has in the last 25;. Hampton city officials sworn in last week included new council members Myrtice Green, Layne Stone and Charles Hall, and incumbents Frantz Innocent and Mayor Jim Mitzel. City Clerk Jane Hall led the group in reciting the oath of office. Mitzel assigned city departments to council members as follows: Councilwoman Dot Shealey will chair toe fire department, Innocent will chair-the police department, (Charles) Hall will chair the water department, Green will chair the recreation department and Stone will chair the street department. Pictured above (1-r) are Mitzel, Charles and Jane Hall, Innocent, Stone and Green. Pictured above with Judge Phyllis Rosier (third from right) are Starke Commissioners Travis-Woods, Danny Nugent and Wilbur Waters. Waters was reelected to the District 5 seat last month. Nugent joins-the board for the first time as commissioner from District 1. District 3 was won in a runoff by Woods, who is returning to the board after an absence of several years. NOTICE I Tax Impact.of Value Adjustment Board| County of Bradford Rowe selected as fire chief BY MARK J. CRAWFORD Telegraph Editor Starke firefighterTom Rowe, formerly the department's assistant chief, has been promoted to the position ;of chief, following the retirement of Dwayne Hardy., One city commissioner, Carolyn Spooner, objected to hiring Rowe for the position. Spooner raised questions about .shift work and certifications. Like Hardy before him, Rowe will work shifts like the other firefighters. Spooner objected to not having a chief on duty with regular hours, from 8 a.m. to 5 p.m., saying it would limit his accessibility. She also said the position of fire chief should require thb individual to be certified by the state as an EMT and a fire inspector, so that the head of the department is also the most credentialed person. Commissioner Wilbur Waters, however, said Rowe would be available "with a beep of his radio, just like he is now." The city might also have to hire two new firefighters instead of one to ensure there would be three firefighters per shift. As for fire inspection duties, there are three firefighters with that certification already,one for eachshift,and EMTicertification is not a requirement of the job description. It was suggested by commissioners, however, that those certifications be pursued. There were only two applicants for the position, both of whom were interviewed by Project Director Ricky Thompson. Thompson expressed complete confidence in his selection. Day or night, he said, Rowe is a dedicated employee. "He's more than qualified, in my opinion." Thompson said. "He's definitely dedicated to the city of Starke." Rowe knows the people here and has a good rapport with them, Thompson said, adding that he's knowledgeable, hard working, trustworthy and dependable. "The city's very fortunate to have and employee like that," he said. "I feel very comfortable ,:ith Tom. He's earned his co- workers' respect." That's particularly important when dangerous jobs require co-yorkers to place their lives in each other's hai Thompson said. Starting .salary for position of fire chief is se $45,000. The world is advancing. Adva with it -Giuseppi Mazzini Read Together, Florida, Statewide Reading Event October 2006 Read the book. Play The Zero Game online. Compete in an essay contest for college scholarships (high school students). :IhE E- 0&-'.1E Register online for a drawing to win a trip to Washington, DC. Sponsored by W Washington Mutual Read Together, Florida is a month-long reading celebration managed by: Volunteer Florida FOUNDATION Manager of the Governor's Family Literacy Initiative f Members of The Board : Honorable Ross Chandler Honorable John S. Cooper nds, Board of County Commissioners District No. I Board of County Commissioners District No. Ill the A at Honorable Eddie J. Lewis Honorable Bobby Carter Board of County Commissioners District No.. V School Board District No. II nce Honorable James Watson School Board District No. V The Value Adjustment Board meets each year to hear petitions and render decisions relating to ad valorem tax assessments, exemptions, tax deferrals, and classifications. The following table summarizes this year's action by the board. All taxpayers should be aware that board actions which reduce taxable value cause tax rates applicable to all property to be proportionally higher. Questions concerning the actions taken by this Board may be addressed to the chairperson or clerk at the following telephone numbers: Chairperson Honorable James Watson (904) 966-6800 Name Phone Clerk Honorable Ray Norman (904) 966-6280 Name Phone Tax Year 2006 I ~ _ c; Oct. 12, 2006 TELEGRAPH Page 7A Zookeepers from the Santa Fe Community College Teaching Zoo shared a number of reptiles and reptile facts with the students at Hampton Elementary School Oct. 9. Students learned about the reptiles and got to touch them, although they were only allowed to touch the alligator's tail. A corn snake, box turtle and skink were also available in the live demonstration. ABOVE: (L-R) Taylor Gatlin touches the alligator while Zachary Windle looks on. Zookeeper Justin Thompson makes sure the mouth gets nowhere near the children. ABOVE, RIGHT: (R-L) Emily Moore and Samantha Turner take an opportunity to touch the alligator's tail. BELOW, RIGHT: Dakota Webb was not really pulling the alligator's tail, he was feeling the bony ridge that runs along the back of the tail. (L-R) Jeremiah Bozarth and Shawn Smith are eager to ask questions about the reptiles. SFCC Teaching Zoo provides free animal The Teaching Zoo has 75 species. schedule a weekday tour. Admission animals and Halloween ha and more than 200 individual is free. will be on hand from 3-7:3 animals. It is open for weekend The zoo is located on the Admission for this event o tours with no appointment Northwest Gainesville Campus of perishable food item per p4 necessary. Tours leave every 30 SFCC off North Road (3000 NW The food is donated to are, minutes from 9 a.m. to 2 p.m. on 83rd Street). The zoo will be closed charities to help feed the n Saturday and Sundays. during semester break (Dec. 19-Jan. For more information, ca Weekday tours can be 'scheduled .14). 395-5601., three days in advance. Contact Check out the Boo at the Zoo Anita Batey at (352) 395-5601 to event on Oct. 31. Free candy, fun hunting, 30 p.m. ne non- erson. a. , eedy. ill (352) 54 Hours * Classes Start in October Monday, Tuesday & Thursday * Free 3-5 p.m. , Must be on Free or Reduced Lunch At Starke Elementary, Southside & Lawtey Contact Carolyn Folsom. Title I Office at 966-6801 askfor ACHIEVE YMCA meets a week early The YMCA Founders Committee will meetThursday, Oct. 19, at 5:30 p.m. The committee meets in the Family Service Center, 611 N. Orange St. in Starke. Anyone interested in becoming involved is invited to attend. 'YOU CAN OWNUPTO $100,000 S m 1 Nk IUFE INSURANCE Absolutely NO Medical Exams or Questions i Easy, One-Time Premium Worry-Free Wealth Transfer Payment (Ss.o0 Minimum) to Loved Ones or Charity v Ages 45 to 85 BGo online! IN 1-1 C4ALLTOLL-FREE [if REE a 2 Ho pi URS A DAY1.2800L.2B4.7745 = 7 J45 Mf _:ddjj ;111.177-111 MWWI Free George Foreman Grill when you open a Home Equity Line of Credit PRIME MINU MERCANTILE BANK-occupled or secondary residences only Property insurance is required, and flood insurance will be required if property is located in a Special Flood Hazard Area Title insurance and appraisal are required if loan amount is greater than S250,000. Minimum credit line of S 10,000. Bank will pay the costs associated with opening the home equity line of credit for credit lines up to S250,000 (cldsing costs typically range from SO to S2.000). Interest-only option is available for a term of 120 months, Please note that interest-only minimum payment will not repay the outstanding pnncipal balance on your line. You will be required to pay any outstanding balance in a single payment at matunty Maximum term is 180 months. Rates and terms subject to change without notice Some restrictions may apply. See your local branch for additional product Information Consult your tax advisor regarding the deductibility of interest. Member FDIC 0t Equal Housing Lender ROBERTS INSURANCE Read4 iv Seuwe lfa"! Wle Have The uperience ... We Can Help Wffh 411 Your insurance feeds! Auto Home Mobile Home BUSINESS, GROUP & INDIVIDUAL LIFE, HEALTH, DISABILITY & DENTAL, CANCER & ACCIDENT SCOTT ROBERTS Agent/Owner AVOURLWVE Aw 0- (Rirns~s 0caaueana~ LORI THOMPSON Agent We also represent 10 OTHER MAJOR INSUR4ACE COMPANIES We& Itne all the Brndford Co#unt Area tO call on s today! 904-964-7826 986 N. Temple Ave., Starke S(across from BC Courthouse) J I n pwqwv bb amarnma/Aug pp service 199L ../'"" ,-f"1' ^*- Page 8A TELEGRAPH Oct. 12, 2006 YMCA golf tourney will help build new center The YMCA is committed to building strong kids, strong families and strong communities. It is also committed to building a new YMCA center here in Bradford County. The golf tournament planned for Saturday, Dec. 16, will: help raise money toward that goal. Set at the Starke Golf and Country Club, YMCA volunteers and staff hope to best last year's tournament, which raised more than $6,000. Teams of four can -register for $200 for the Four-Man Best Ball Scramble. There will be morning and afternoon flights, andlunch will be served from 12:30-1:30 p.m.. A special drawing will award prizes to those who enter the tournament. YMCA will be holding a silent auction during the tournament. Proceeds from the auction and snack and drink. sales will also benefit YMCA- :in Bradford County. To register your team, please call (904) 964-YMCA. Pageant and talent show applications available The Third Annual Tiny Miss, Little Miss, Petite Miss, and Junior Miss Princess Pageant and Talent Competition will be held on Saturda), Nov. 11I, at 6 p.m. in the Bradford High School auditorium. The pageant is open to girls from 0-12 )ears. I. Please see application for details, or call Angelia at (904) 368-9153. Sale of red ribbons to support anti- drug program Red Ribbon Week is set for Oct. 23-31 this year and the Bradford County Juvenile Justice Shared Services Council will be selling large red ribbons for display on storefronts. Proceeds from the sale of the ribbons will go to help fund a variety of activities being :planned at Bradford Middle School during Red Ribbon Week. Activities will encourage young people to pledge to stay away from illegal drugs and to refrain from using legal drugs in an illegal manner. To order a red ribbon, contact Elaine Slocum at (904) 964- 5088. For more information, contact Nancy Alvarez at the Bradford County Courthouse (904) 966-6280. Starke to meet Oct. 17 The next meeting of the Starke City Commission will be Tuesday, Oct. 17, at 7 p.m. For more information, call (904) 964-5027. LEGALS IN THE CIRCUIT COURT FOR BRADFORD COUNTY, FLORIDA File Number: 04-2006-CP-0101 SBy: Tasher Allen As Deputy Clerk 9/284tchg. 10/19, TAX DEED 2006-1 NOTICE OF APPLICATION FOR TAX DEED NOTICE IS HEREBY GIVEN, that CLYDE DEWITT HERSEY, the holders) of the following certificate has filed said certificate for a tax deed to be issued thereon. The certificate number and year of issuance, the description lool,the Southerly boundary of the right-of-way of County Road 225 formery State Road S-225); thence South 77 degrees 14 minutes, 19 seconds East, along said Southerly bounday.'405.77 feet to the centerline of an existing road for the Point of Beginni 128 of the Southeast comer of said SE 1/4 of NE 1/4). NAME IN WHICH ACCESSED: June C. Rice. follows:.: 504 YEAR OF ISSUANCE. 2000 DESCRIPTION OF PROPERTY: A parcel of land lying and being in the SE 1/4 of the NE 14 of Section 21, Township 6 South, Range 22 iEast, descnbed run Southeasterly at right angles to said right-of-way line a distance of 330 feet, thence run Northeasterly parallel to said right-ol Point of Beginning. NAME IN WHICH ACCESSED- Michael A. Chandler. 21st day of September. S2006. RAY NORMAN CLERK OF THE CIRCUIT COURT BRADFORD COUNTY, FLORIDA By: Carol Williams Persons with disabilities requesting reasonable accommodations to participate in this proceeding should contact (904) 966-6280. 9,284tchg 10/19 TAX DEED 2006:WHICH ACCESSED: George Goetzmnan and Tim A. Goetzman. 21st day of September, 2006. RAY NORMAN, CLERK OF THE CIRCUIT COURT BRADFORD COUNTY, FLORIDA By: Carol Williams Persons witn disabilities requesting reasonable accommodations to participate in this proceeding should contact (904) 966-6280. 9/28 4tchg. 10/19 PUBLIC AUCTION A PUBLIC AUCTION will be held at C&C Mini Storage at Handi-House Portable Buildings, 1670 S. US-301, in Starke, Fla., on Oct. 14, 2006, at 10:00a.m. Robert Keeling, 2-82 Ciara Williams 1-72 Adriane Cochran 1-69 John Huffman 1-54 Jessica Whittemore 1-38 10/52tchg. 10/12. ITEM I ADVERTISEMENT FOR BIDS Sealed bids for roadway construction on: PART A: NE 185th Street (Mark Lee Starling Road) PART B: NE 28th Avenue (Luke Road) "will be received by Bradford County Commission at the office of the County Clerk, County Courthouse, in Starke until 3 p.m. Daylight Savings Time, October 19,2006. Bids will be opened and then publicly read aloud. The CONTRACT DOCUMENTS. consisting of Advertisement for Bids, Information for.Bidders, Bid, Bid Bond, Agreement. general Conditions, Supplemental General ,Conditions, Payment Bond, Specifications, and Addenda may be 'examined at the following locations: Owner: Bradford County Courthouse Clerk's Office U S. 301 Starke, Rorida,32091 Engineer Dyer, Riddle; Mills & Precourt, Inc. 4110 SW 34I $100.00 for each set. No refund will be made for the CONTRACT DOCUMENTS Construction time is 180 days. BASE BID includes constructing 1.7 miles of asphaltic concrete road, earthwork, drainage works, testing, surface course, striping, grassing, signage, environmental protection measures and safety measures. Bidder shall visit site prior to submission of bid to gain understanding of the extent of work. One Contract will be let for both roads. 10/5 2tchg. 10/12- ITEM I ADVERTISEMENT FOR BIDS Sealed bids for roadway construction on: BRADFORD COUNTY - SW CR C-231 Resurfacing and Widening will be received by Bradford County Commission at the office of the County Clerk, County Courthouse, in Starke until 3:30 p.m. Daylight Savings Time, October 19, 2006. Bids will be opened and then publicly read aloud. The CONTRACT DOCUMENTS. consisting of Advertisement for Bids, Information for Bidders, Bid, Bid Bond, Agreement, General Conditions, Supplemental General Conditions, Payment Bond, Performance Bond, Drawings, Specifications, and Addenda may be examined at the following locations: Owner: Bradford County Courthouse, Clerk's Office, U.S. 301 Starke, Florida 32091 Engineer. DRMP 4110 SW 34th Street, Suite 8, Gainesville, Florida, 32608 Copies of the CONTRACT DOCUMENTS may be obtained at the office of the Engineer located at 4110 SW 34th Street, Suite .8, Gainesville, Florida 32608, upon payment of $50.00 for each set, checks only (cash and credit cards will not be accepted). No refund will be made for the CONTRACT DOCUMENTS. Construction time is 180 days. BIASE BID includes but not limited .to construction of earthwork, grading, .providing fill, coordination with utility companies, milling surface and base (partial), limerock base for widening, and asphaltic concrete surface course, striping, trafficmaintenance, drainage works, safety measures and other items considered a normal'part of this type of work 10/52tchg.10/12 LEGAL ADVERTISEMENT CITY OF LAWTEY MOODY APPLICATION FOR SPECIAL EXCEPTION Pursuant to Section 12.2 Lawtey Land Development Regulations a petition for a special exception has been submitted for consideration of the 'Lawtey Planning & Zoning Board. The application was submitted by Michael R. Moody, Kevin C. Moody and Nancy M. Ralston-Farr to permit by special exception a recreational vehicle park and campground on 40 +/- acres zoned County A-2 and described as follows: Legal Description of Property for which the Special. Exception is Sought The North Half of the Southwest Quarter of the Northwest Quarter of Section 23, Township 5 South, Range 22 East of Bradford County, 'Florida. Together with a non-exclusive easement for ingress and egress over and upon the west 15.0 feet,of the NW of NW of theNW of Section 23, Township 5 South, Ranrge 22 East, Bradford County, Florida. Subject to the Right of Way of Courtty.. Road 125. Present Zoning District for the Subject Property: County A-2 Present 'Future land Use Plan designation for the Subject Property: Residential, low density. One public hearing will be held before ,the Lawley Planning & Zoring Board on the following evening: 7:00 p m., Tuesday, October 16, 2UUb at the Lawtey City Hall, 2783 W. Lake St., Lawtey, Florida. If anyone with a disability is in need of assistance to attend'these two hearings please call the Town Clerk, telephone (904) 782-3454. S 10/2tchg. 10/12 CITY OF STARKE INVITATION FOR BIDS FOR SALE OF REAL PROPERTY NOTICE IS HEREBY GIVEN that the - City of Starke, Florida, offers for sale to the public a residence on a 195x292 lot, located at 212 Redgrave Street, in Starke, Florida. The property is zoned "Municipal." The lock home has three bedrooms and three baths, CHA, carport and fenced rear yard. The property Is offered for sale on an "as is" basis No actual or implied warranties of habitability, condition, merchantability or fitness for any general or specific use are hereby given. The property is offered for sale to the highest bidder. The City reserves the right to reject any and all bias without qualification or limitation. Buyer will be responsible for all expenses necessary and incident to the recording of the deed. All bids shall be submitted on the form provided by the City. Copies of the Did App!ication Packet may be obtained c contacting Linda W. Johns, Cry Clerk, at Post Office Drawer C, Starke, FL 32091, or in person at City Hall, 209 North Thompson Streel, Starke, Florida. Sealed bids will be received until 5:00 p.m. on Friday, Oct. 13, 2006, at City Hall, located at 209 North Thompson Street, in Starke, Florida. 10/52tchg.10/12 ADVERTISEMENT 18th day of October, 2006, at 12:00 noon, on premises where said property has been stored and which are located at Santa Fe Storage. 1630 North Temple Ave., Starke, Florida, County of Bradford, State of Florida, the following: Edward Strong, Unit #1-19 Michelle Adkins, Unit #1-15 Shawn Coleman, Unit #1-22 Bridgett Holder, Unit #G-18 Care Hodge, Unit nG-36 Jalanda Hankerson, Unit #1-23 Blanch Jones, Unit #C-5 Quinque Robison, Unit #K-1 Andrea Smith, Unit #1-53 Kyle Wendell. Unit #1-42 Elizabeth Lee, Unit #A-2 and G-15 10/52tchg. 10/12, IN THE CIRCUIT COURT OF FLORIDA EIGHTH JUDICIAL CIRCUIT, IN AND FOR BRADFORD COUNTY, FLORIDA CASE NO.: 2006-272-CA NORITA V. DAVIS and STEFAN.M. DAVIS, SUCCESSOR TRUSTEE OF THE RONNIE C. DAVIS REVOCABLE LIVING TRUST DATED 02/03/03, Plaintiff, vs WILLIAM L. TYLER; UNKNOWN SPOUSE OF WILLIAM L TYLER; SHARON G. WATERS; UNKNOWN SPOUSE OF SHARON G. WATERS, Defendants. NOTICE OF SALE Notice.is hereby given that, pursuant to the Summary.Final Judgment of Foreclosure dated October 4. 2006,1. h Worsh ip i the lowuse of the e The Somewhere this weekly The churches and businesses listed below urge you to attend the chi .Fromallof us at WESTERN STEER FAMILY STEAKHOUSE US 301 S., Star(e 964-8061 STARKE UNITED PENTECOSTAL CHURCH SUNDAY MORNING: 10:00 AM. SUNDAY EVENING: 6:00 P.M. WED. BIBLE STUDY: 7:30 P.M. 2324 SE SR-16, STRIKE 904-964-9619 ARCHIE TANNER FUNERAL HOME Ri 4.Bo< 1519.Slart.e FL 32091 Pree larpir,n, Funeral Arii ngA.j .I Hriipial Equi' rirnil M.:..u.T,.r,.Is 964-5757 ArchieM. Tanner, LF.D St. Mark's Episcopal Church Come t L Hr Worsi Sunday Worship: 11:00 am Children's Church:11:00 am 212 N. Church Sireel*Starke, FL.964-6126 Suburban Carpet Cleaners Professional Carpet & Upholstery Cleaning "FOR THOSE WHO INSIST ON THE BEST' DAVID HAMILTON 964-1800 or 1-800-714-1184 Come worship with us STARKE SEVENTH DAY ADVENTIST CHURCH Church Saturday 9:30 am. School Saturday 10:45 am. Mid-week Study Tuesday 7:30 p.m. .- Morgan Road Baptist Church fkittk CAmsh Nikart/ 3784 NW CR-233 904-964-4422 Sunday School 9:45 a.m.' Morning Worship ............................ 11:00 a.m. Evening Worship ..................... 6:00 p.m. Wednesday Worship ..........................7:00 p.m. SS Tree Service Removal Topping Trimming Storm Damage 7wm 8estdhltZs Jtrscd & I( AuI RED STARLING 352-485-2197 MOBILE 352-538-0733 First United Methodist Church (904) 964-6864 8:30 & 11 am. Trad. Worship 9:45 a.m. Contemp. Worship TULLER CHIROPRACTIC CENTER Chimpraclic Care When You Need It! Dr. Richard C. Tuller 260B S. Lawrence Blvd. Keystone Heights 473-7213 JACKSON BUILDING SUPPLY Where Quality |n & Service are a Family Traditloni Stauke 964-6078 Lake Budtl 496-3079 Virgil A. Berry, D.C. Yain e ic 601 E. Call StV 964-8018 Lewis Timber Co. Hwy. 301 S. P.O. Box 207 Starke 964-6871 CA Lur WITNESS my hand and otticial seal of said Court this 4th day of Octob.r,, 2 0 0 6 *, . RAY NORMAN'/ Clerk of Court BY: Carol Williams: DEPUTY CLERK If you are a person with a disabilft, who needs any accommodatiornaiFm Order to participate in this proceeding you are entitled, at no cost to youth; the provision of certain assistance$ Please contact the Couif vowj9 impaired call (800) 955-8770. ' BEVIN G; RITCH -- 1418 NW 6th Street Post Office Box 1025 (352) 376-3201 .Gainesville, FL 32602 Florida Bar # 143762 Attorney for Plaintiff 10/12 2tchg.10q." 9 LEGAL NOTICE ^ THE FIRST JOBS FIRST WAGI. COMMITTEE of FloridaWorks S be holding a meeting on ThursdayM October 18,2006, at 11:00 a.m. at Vhe? Eastside High School. 1201 S.E. Street, Gainesville, Fla. Please: contact Celia Chapman at.(352) 955-7 6096 with any questions you may have: 10/121 tchg. ADVERTISEMENT . Bid For OCTOBER 12, 2006 CITY STARKE CONVERSION OF EXISTING SIMPLEX RADIO SYSTEM TO A REPEATER RADIO SYSTEM Sealed bids will be received by the City of Starke (CITY OF STARKE), 209 N Thompson St.. Starke, Florida. 32091 until 11:00 a.m., on Novemg 13, 2006, when at that time Bids .tE be opened publicly by a CITY STARKE representative. The bid is for Conversion of Existin Simplex Radio System to a Repeat Radio System as more fullp" described in the bid package. Bid packages for this project may Be! obtained from the CITY OF STARKE, at the above address. No bid may be altered, withdrawn r resubmitted after the schedule. closing time for receipt of bids. I ' received after the day and time stac above will not be considered and be returned to the bidder unopened:" The CITY OF STARKE will accept bids from companies who have established, through demonstrated expertise and experience that they are qualified to provide the service as specified. The CITY OF STARKE reserves t , right to reject any and all bids in t6 or in part and/6r to waive defects'-t bids. This bid is-echeduled to be awarded on November 17, 2006. All Bidders% will be notified of the award at that time. However, not withstanding the intent to award at this time, all bids must be firm for a period of 90 days after the date set for opening of bids. Ricky Thompson Acting City Manager City of Starke 10/12 ltchg. CITY OF STARKE GAS INFORMATION % PLEASE BE AWARE THAT THEB-- NEW CITY OF STARKE GHAS. USER FEES WERE CHANGED FEBRUARY 7, 2006 TO REFLECT, THE FOLLOWING: .' S TRIP CHARGE $25.00 TURN GAS ON-LIGHT 2 - PILOT $20.00 GUARANTEED SAME DAY ;. :- SERVICE- $20.00 10/121tich: NOTICE OF INTENTION TO "-; REGISTER FICTITIOUS -" NAME I '; 2 Pursuant to Section 865.09, Floridaio. Statutes, notice is hereby given tjtIa') the undersigned, Darryl and Latoria - Haile, 818 N. Oak St., Starke, FL ' 32091, joint owners, doing businre under the firm name, of: D'iD Complete Lawn Service aS Pressure Washing, 818 N. Oak Starke, FL 32091, intends to regisv said fictitious name under tS aforesaid statute. I Dated this 10th day of October, 20( in Bradford County. 10/121tco. iyT*,WL rch of your choice! iverofLfe Churdcofqodi t anyScfml....- 10m S MgWo 11UU 2225 N. Temple Ave., Starke 964-8835 Jones Funeral Home ar Ova so yews STEVE & CINDY FUTCH Starke 964-6200 Keystone Heights 473-3176 SCommunity State Bank Your Home-Owned lndpudent Bank Starke 964-7830 Lake Butler *496-3333 DOUGLAS BATTERY OF STARKE We rebuild starters, alternators & generators. Auto Marine Crcle Batteries 407 N. Temple 964-7911 DENMARK FURNITURE^^^^^^^^ It's a fact, yu cn dbtter at^^ -. --- -- .......-- .ct. 12, 2006 TELEGRAPH Page 9A Directions: - Preheat oven to 375 degrees. Lightly spoon flour into a dr . measuring cup and level with a knife. Combine flour, 1/4 cup granulated sugar and brown sugar in a bowl: cut in margarine, with a pastry blender or 2 knives until mixture resembles coarse- meal. Combine sliced peaches and lemon juice in a large bowl; toss gently to coat. Add raspberries, I tbsp. granulated sugar and the cornstarch: toss gentle. Spoon fruit mixture into an 8- A inch square baking dish coated with cooking spra), and drizzle raspbenrr jam evenly over fruit mixture. Sprinkle with flour mixture. Bake at 375 degrees for 45 minutes or until brown. AIM- Breast cancer awareness month October is recognized as National Breast Cancer Awareness Month. This national observance gives the community an opportunity to educate women on the importance of early detection of the disease. Not only do we recognize the importance of early detection, but we also recognize breast cancer survivors, individuals struggling with the disease, family members and friends who support these individuals through the entire process. An early detection plan should include the following: * Clinical breast examinations every three years from ages 20- 39, then every year thereafter. * Monthly) breast self-examinations beginning at age 20. Look' for any changes in your breasts. * Baseline mammogram by the age of 40. * Mammogram ever one to two Nears for "omen 40-49, depending on-previous findings. * Mammogram everN year for women 50 and older. * A personal calendar to record your self-exams, mammograms and doctor appointments. * A low-fat diet, regular exercise, and no smoking or drinking. ,' ,. a ,' , f~ '- --/ .w as.t .;e/(i / s-,tt e. Peachy Crisp Preparation Time: I hour Serves: 6 Number of Five-A-Day Servings: 2 Ingredients: 1/2 cup all-purpose flour 1/4 cup granulated sugar 114 cup packed brown sugar . 3 tbsp. chilled stick margarine or butter, cut into small pieces 6 cups sliced, peeled peaches (about 3 Ibs) 2 tsp. lemon juice I cup raspberries I tbsp. granulated sugar I tbsp. cornstarch I tbsp. seedless raspberry jam cooking spray BUFFER Continued from p. 1A would affect thd land in. close proximity to the installation. Notice inchItles the opportunity to. review and comment on proposed changes. The county must consider such comments in making decisions and also forward the comments "to the state land planning agency.: To facilitate cooperation, counties \ eire required to add a nonvoting member representing local military installations to their' zoning boards. The same standards apply to municipalities. Ehrbar took the proposed language for Bradford County's comprehensi% e plan amendments from Clay and. Escambia counties, which already have language acceptable by the Florida Department of. Community Affairs. She said DCA Wants the county to add the three-mile buffer on its future land use map. At first she sent language to DCA that would preclude the count) from labeling land anything other than agriculture within the three-mile buffer as long as that land was not within the county's urban development area around the-city. When DCA realized the urban development area had been excluded from compatibility requirements, there were concerns, but Ehrbar said she told them it wasn't reasonable to keep the county from approving development in the urban development area. particularly when the highest household density allowed would be 20 units per acre, and that would only be allowed if central water and sewer service were available. rvr Ddge awarded medal of distinction National Republican Congressionall. Committee ChAirman Tom Reynolds has-announced that David L. Dodge has been chosen as a 2006 Congressional Medal of Distinction winner.. Dodge was selected based on unyielding support of the Republican Party, outstanding leadership in business and contributions to the local economy. Dodge is chairman of the Bradford County Republican' Executive Committee and the Voter Registration Committee' for the Republican Party of Florida. "Mr. Dodge has served as an honorary chairman of the'. "Business Advisory Council and has provided much needed support. This award could not have gone to a more. deserving candidate," Reynolds said. If you don't run your own life, somebody else will.. -John Atkinson OFFERS Cs 1815C A copy machine with the very latest ,technology. _ 18 copies per minute . Letter or legal size. 96 MP Ram Memory -' 'with Connectivity and | Print/Network Specification. IICALL RUSTY FOR INFORMATION THE OFFICE SHOP 20-Y"ARS EXPERIENCE ON ALL OFFICE MACHINE REPAIRS - (904) 110 W. Call St., Starke, FL FAX: f964-5764 ta us oqwte our at aorder... (904) 964-6905 ,). ,. 6 .. Trick or treat .Pumpkin k.cape in downtown = Trick or tr.. athSlarke. he Sitarke City 1 - Srset for Oct. Commission has designated se fo ..I O l ct Saturda\. Oct. 28. as the 28 official night to trick or treat 2 8 i n the, city. To,, coicide with hc iGreat ,,he cty. INKJET CARTRIDGES U IIIC BRTLC2IBK $25.49 HP21 ........................18.37 BRTLC2 1C..............14.99 HP19 ................... 33.9923 BRC2IY.......^......14.99 HP78............ 54.99 P28 ...... .............. 2 85 BC2 IBK............. ....8.75 HP56................... 24.05 BC1IC ..................21.99 HP57............ 39.99 B3eBK..... 1395 HP94 ....24,.05 BeC........ .. 11 95 HP95.............. 28.55 BC13eM..... .. 195 2612A......98.00 B13eY.11.95 C7115X..................90.00 26 I O 6A............A... 103.5Q Item No.CQ2624X...............10 008 EPST040120............. 29.95 CAME40..............108.00 EPS-S020047...... ......21.95 92274A..............866.00 EPS-S020049........... 32.95 C4092A................. 59.90 Call for Selection & Prices ... 92295A................116.00 We probably can get the hard-to-find cartridges COMPETITIVE PRICES * THE OFFICE SHOP ON ALLOFFICEMACHINEREPAIRS (904) 110 W. Call St., Starke, FL FAX: 964-5764 dt usoqwteyo o oner_,-.. 904 964-6905 ~I Counts Manager Jim Crawford said criteria relating to military institutions was being imposed that didn't apply to a training base like Camp Blanding. "They have no way of justifying not building a single- story building \itihin 1.000 yards of the. base," Cra% ford said. It's not thai there aren't compatible uses available within the buffer, Ehrbar said. The primary concern is intense ,residential development, but she didn't think there would be a problem \\ith industrial development, for example. Residential development more intense than that allowed under agricultural land use- one house per file acres or one house per 15 acres-is considered objectionable. But the area east of Starke where the urban development area is being expanded is growing residentiallN, Cooper said. Commissioner Eddie Le~ is, pointing out that the entire city of Law tey was within the buffer, said that city is growing residentially as well, having just annexed a proposed subdivision. A residential development across from Camp Blanding in Clay Count) is a DRI, development of regional impact. that was in the works prior to that county's comprehensive plan amendments regarding the Camp. It was allowed to move forward, although a large undeveloped conservation area had to be inserted between the development and the base. It is precisely that t)pe of encroachment that is the target of the comp plan requirements. Ehrbar thinks DCA may be comfortable now with development taking place as allowed in the urban development area as long as the area is not expanded. The county's attempt to expand its i t -ad~~sr: urban development area around Starke to the east could become- a "'massive issue," Ehrbar said.- Cooper said he didn't have a problem with. language requiring the board to factor in comments and suggestion from Camp Blanding when- considering building and- zoning matters. He did object to language that would restrict- the board from acting in some way. -. "I don't want to limit my development rights because- of Camp Blanding. I want to: factor them in," Cooper said. - Chairman John Wayne_ Hersey said limits on residential, development could negativelyE impact the tax base ofa count-) that is more than 70 percent:- timberland. Based on concerns by- the commission, language- restricting its developmental authority 'within the three-mil&- boffer. will be excluded fron-- the comp plan amendments. although the) will include- language committing the county- to work with Camp Blanding. - Ehrbar said the board would-: be able to adopt the necessary amendments and mo\ e for% ard-- \\ith developmental acti'it,il . but \ague language concerning- future development in the-= three-mile buffer ill place the= county in noncompliance with= DCA. According to DCA's Web!-- site. if the agency finds them- amendments are not in- compliance, the county must= take remedial actions to--- bring its comprehensive plan=:_ into compliance to avoid an_ administrati e hearing. Although the buffer includes:- portions of Starke and Lawtey,. the county has no jurisdiction there, so its comp planzz amendments do not address _- those cities. Pleasant Grove Action Group to meet Oct. 16 The regular monthLy-.meeting of the Pleasant Grove Action Group will be held on Monday, Oct. 16, at 7 p.m. in the annex of Pleasant Grove United Methodist Church on N.W. 177th St. All concerned citizens are urged to attend. VFW to meet- Oct. 19 VFW Post 1016 will have its general meeting at 7 p.m on Thursday Oct. 19. AA %ote will be held to lower required quorum from six to five. - Call (904) 612-1433 for more, information. Health career fair at Shands Starke Santa Fe Community College Andrews Center and Slhands S. / In addition, there will be an evening forum from 6:.30-8:30 p.m. at the Andrews Center Cultural Building, 201 E. Call St. Health care is likely to be one of the biggest sources of -jobs in the future. Join the staff and students from Santa Fe Community College to learn about the 17 different health sciences programs offered. Ombudsman Council meeting , The North Central Florida Long-Term Care Ombudsman, Council will meet on Thursday, Oct. 19,at 12:30 p.m. atHospice of North Central' Florida, 4200 N.W. 90th Blvd in Gainesville The council-is a group of concerned citizens whose goal is to improve the quality of life and care for people who live in licensed long-termcare facilities such as nursing homes, assisted living facilities, adult family care homes and long-term care units in hospitals. A trained,; certified volunteer ombudsman is given authority under Florida law to ideritify, investigate and resoh e complaints made by, or on behalf of, long-term care facility residents. For more information, please . contact Jod\ Dolsberr) at (352) 955-5015 or (888) 831-0404 E-mail her at dolsberryjL@ elderaffairs.org. Brooker meets Oct. 17 The town of Brooker. meets. on the third Tuesday of each. month, and the next meeting will be Tuesday, Oct. 17, at 7 p.m. at city hall. These meetings are open to the public. For information or Page 10A TELEGRAPH Oct. 12, 2006 to receive an agenda, call (352) 485-1.02 .. County T convenes."- Oct. 1 9 The Bradford County Commission will meet on Thursday, Oct. 19, at 6:30 p.m. in the boardroom at the Bradford Count\ Courthouse, located on U.S. 301 in Starke. A workshop ill precede the meeting at 4 p.m. . For -more information, 'call (904) 966-6280. It's time to enter VFW scholarship competition Veterans of Foreign Wars (VFW) Post 1016 and its Ladies Auxiliary are accepting entries for this year's Patriot's Pen Essay Contest and the Voice of Democracy Scholarship Competition. ' .Patriot's Pen gives si \th- seventh- and eighth-grade students (and home-schooled counterparts) the opportunity to express an opinion on a patriotic theme while competing for awards and prizes.: This \ear's theme is, "Cilizenshio in Am rri.' - Patriot's Pen gives si\th- seventh- :and eighth-grade students (and home-schooled counterparts) the opportunity to express an opinion on a patriotic - theme while competing for awards and prizes. This year's theme is, "Citizenship in America." _Post 1016uill award a $50 U.S. Savings Bond to its local winner, whose entry will be forwarded -for-- competition at-- the district level. - District winners will -be forwarded to department level. Department w winners \ill compete for $75,000 in LU.S. Savings Bonds at the national level, with the % inner receiving a $10,000 U.S. Savings Bond during a'ceremony in. Washington, D.C., The Voice of Democracy Competition "provides ninth- thtough 12-grade students (and hpome-schooled counterparts) the opportunity. to .rite and record a broadcast script on a patriotic theme. This \ear's theme is, "Freedom's Challenge." Post 1016 will award its winner a $100 U.S. Savings bond, and forward the %%inning entry for competition at the district level. Winners advance as the) do for Patriot's Pen. Department winners are brought to Washington, D.C., to6 compete for $146,000 in scholarships, with the first place winner receiving a $30,000 scholarship. \Entries for both programs are due to the Post chairperson, Christine Peace, by Wednesday, Nov. 1. For rules and applications, call Peace at (904) 368-0447, or visit the VFW Web site,. -(From the homepage,' go to:. Programs and Services, then select VFW Scholarship Programs. Choose the specific scholarship program from the drop-down list on the left of the page). place by appointment only. SHINE is a statewide program sponsored by the Department of Elder Affairs. To make an appointment, or if you cannot travel to the counseling session site, call the elder helpline at (800) 262- 2243. 'I kySndyBm m p ]O ti I ,do 6a 4.,- 1 A F, L77 ~i G S..Section B: Thursday, Oct. 12, 2006 RegTonhNNe-ws News from BradfordCounty,UrionCounty and the Lake Region area ARC seeks participants for Disability Mentoring Day BY CLIFF SMELLEY In both shadow ing and it is the same when an on the skills required. The job two employees tor one." Mentoring Day may call TelegraphStaffWriter group tour opportunities. Arc employer actually hires a coach is always available to Mosley said. Mosley at 1904) 964-7699. For elegrap riter personnel v.ill be present to person %with a disability. A job follow up on the employee's Anyone who is interested in general information on Florida Employers, are you looking assist so as not to place a coach works with the progress. giving someone an opportunity Disability Mentoring Day, log for dependable employees who burden on employers. In fact, employee to train him or her "'Actually, they're getting on Florida Disability onto. have a desire to work and do - their best? Then you. might YFIR want to consider participating I -, I , in Florida Disability I, Mentoring Day on Wednesday, W -I The program, v.hiche takes r I f place during National' ,, = i ih i Disability Employment A11 Awareness Month, is part of a national, broad-basedeffort toTHE KEY TO ANYTHE KEY TO QUALITY - promote career development. KEY1ANYTKEYT A The" ARC (AssoQiation for Retarded Citizens) of Bradford Contalasoher 1998 PNI RIXPRE-OWNED CAR. PRE-OWNED CAR T programs throughout the state,. are participating. "We're hoping to get Gold Check opens the door to value when you're looking for a Wemploer hopi the ets LD CHECK Cpre-owned vehicle. Buy with confidence when you see the employers to see thebenefits Gold Check symbol. It's your key to getting more. for your of hiring a person with money and mile after mile of carefree driving. disabilities," said Johnniemar Mosley, community -1 The Gold Check Certification Plan covers such key employment specialist ". ih the components as engine, brakes, transmission, drive axle, Bradford ARC. steering and electrical, and offers these important Mosley said from herr features:' experience, employers who 70-Point Quality Assurance Inspection hire people with disabilities are It 12-Month Unlimited Mileage Roadside Assistance Plan hiring people who have three ...- 0 Major Component Limited Warranty qualities: they are dependable,, they show up for work- every Eligible for Extended Protection up to 100,000 Miles day and they aim to please.Tr Bradford County serves do not DRIVEOUT TODAY FOR AS LOW AS499 know what kinds of jobs are out there for them. 1998 CHEVY PRIZM 2000 CHEVY LUI INA 1997 GMC SONOMA X-CAB 1998 NISSAN SENTRA Hopefully, Disability Stk#13548 Stk#13523" Stk#13688 Stk#13653 Mentoring Day will change that. "M' st of our individuals:. have never worked, so they . don't know what's available to them;" Mosley- said, "This is " our way of exposing them to, community and exposing the employers to the excellence of these (potential) employees." The program is set up so that it really is no hardship for a participating employer It costs . nothing to participate and the time devoted to either :200011A SPORTAGE 1997 MERCURY t. MARQUIS 2001PONTIAC GRAND AM 19909 CHEVY ASTRO VAN" shadowing or touring Stk #13664 Stk #13503 Stk #13460 Stk #13435 opportunities depends upon ho%% much time the employer "It can be for a couple of .hours," Mosley said, though ,'',":, , she. added it would bN preferable if job shadows wei allowed to spend four-hours a the work site. New BC -branch office 1998 PONTIAC GR.PRIXGT 1998 TOYOTACAMRY LE 2000 CADILLAC CATEHA. 2000 CHEVY IMPALA Stk #13679 Stk #13484 Stk #13282 Stk #13662 -. to pen . The Bradford County ,,, *...,,- Courthouse officials' branch office at the Santa Fe Community College Watson . Center will open this Monday. Oct. 16, at 9 a.m. Operating hours will be 9 a.m-4 p.m. Monday through Friday. , Services provided by the prerk an tax, colr willerty 2000 FORD RANGER XC-AB 2001 CHEVY BLAZER IT 1999 DODGE DURANGO 2001 ISUZi RODEO IS bb made available, while a Stk #13724 Stk #13552 Stk #13468 Stk #13640 deputy with the Bradford County ,Sheriff's Office will also make use of the space. provide as many services there as we feasibly can (to the citizens of the southern portion of Bradford County)," Property Appraiser Jimmyl z Terry Vaughan,. the - supervisor of elections, said .. *. I - his office would not have as much of a presence as the *r other offices since people can register to vote when they obtain or renew their driver's Customer Satisfaction Has Been Our Top.Priority Since 1947" licenses-which they will be able to do at the Watson Center. However, he did anticipate having voter registration drives there from: .,.l,,,.L,,,... time to time. . The phone number of the "6, branch office is (352) 473- 5339. phfc bIf4,' AUTO SALES The most effective way to cope with change is to help create it. - -L.W Lynett Cherish all your happy moments: they make a fine cushion for old age. -Christopher Morley Page 2B TELEGRAPH, TIMES & MONITOR-B-SECTION. Oct. 12, 2006 Carpentry class helps students find better future BY MARCIA MILLER Telegraph Staff Writer Most teenagers with a high' school diploma cannot expect to earn $14 an hour upon graduation, but the students working in the carpentry class at the Bradford-Union Area Career and Technical Center in Starke can expect just that'. Tyler Moore is in the class for his. second year and is working on completing his final certification. There are . four certifications available in the program and if a student earns all of them, instructor Mike Beville said a graduate' could expect to start out at about $14 per hour.- "If they do a good job in the apprenticeship program and gain about two to three years of experience, they can expect a salary between $18 and. $20 per hour," Beville said. Two or three years of experience-$18 to $20 per hour ... sounds pretty good, doesn't it? Moore said he thinks so. The apprenticeship program is a work-study program. After graduating from the technical center program with the certification, a student would work in the industry-at about $14 per hour- \ while completing additional training the higher the wages earned. The carpentry program started out as a new program at the technical center last year. Moore started in the class at that time. If he completes the course, he Will be its first graduate. High school students from Bradford and Union counties can take the course free of charge as a part of their high school curriculum. Adults canw also take the course as a part of the technical center program, but the) ill have, to pay $2,100 in tuition for the full course. A lab fee of $25 per semester is also charged. The class trains students -ho work toward various skifl le els. Each skill level carries its own certification. The first level is carpenter helper. It takes about 300 course hours to reach that certification. The second level is trim/finish carpenter and industry) carpenter. The third is frame/rough carpentry. The final level is full carpenter. A -. ...A- -- _- L .. .. Measure twice and cut once ... (1-r) Jon Leonard, Chris Knowles and Calvin Lane make measurements while working on a project. -Sc' -. '" *' .* ^ *. *^'i"'L ^ .EI.uio ..M.... .V ....Ll..... .... ..... .. .... sponsored by nis or .er A student can exitmthe course w Lane about the proper way to use this saw as Lane employer. The more training makes a dry run--before the saw is turned on. and experience a student gets, See CASS, p. 9B 4 ; L,- Holiday Open House'. Parents receive education onMySpace oa O -,"P parents r e o ; 'r 'L* 1 "r e qt . BY TERESA posting diaries (known, as pull up his profile page, view Keystone Heights Jr. Sr High '- A n .--.- STONE-IRWIN blogs), photo albums, gossip, pictures. and read all about has 228. -'.j I l:bi e. l .as Telegraph Staff Writer .A recent workshop was held by Patrick Maxwell, .Lake Butler Middle School's 21st .Century Learning Center Coordinator, to educate parents about MySpace.com and its potential dangers. 7 MySpace is the latest online hot spot for young people to 'socialize. Free to users, the ;Web site is paid for. by advertisers who have also caught on to the craze as a way to reach a younger- audience, Sthe most profitable market today. In 1998, MySpace.com was launched as an online storage :and file sharing site. The idea did not catch on and it was shut down in 2001. Reopened in 2003, theta currently used. MySpace.com %as started by a then University of California student, Tom Anderson. Currently the third most popular website in the United States, and the sixth most popular in the nation, as of Sept. 8, 2006, MySpace.com reported 106 million user ,accounts, averaging' 230,000 new users per day. SUp until about four months ago, Patrick Maxwell, also pastor at Victory Christian. Center in Lake Butler, was not familiar with the phenomenon ,taking place at MySpace.com. Young people at his church, !where he has been the pastor for 8 1/2 years, began to encouraging him to create a MySpace account. He found that setting up a MySpace account is relatively easy. In fact, millions of young people that create profiles can hook up. with their friends, get to know new friends, and make 'contact with students in other area schools. All that one needs to create a MySpace profile is a valid e-mail address. The age requirement for opening an account is 14 years of age, but many just simply bypass this and falsify their ages. Young people are readily their likes and dislikes, and sometimes e'en phone numbers and home addresses. Maxwell said, "It's a lot easier for a shy person to make contact with others using the SInternet. This way, they do not have to fear being rejected in public. Kids who may not speak to each other in a classroom setting where their peers are watching, will communicate freely using MySpace. The downside to this is that face to face communication is now being replaced with online socialization." One of Maxwell's most surprising finds was that young people have no problem at all sitting in front of a computer and revealing personal information about themselves to millions of people who they do not even know. "These kids wouldn't dream of letting their parents see some of this stuff. This is not only crazy, it's dangerous. I don't think that they are aware that what they' are putting on their profiles can be seen by Internet predators who will likely try to make contact with them," said Maxwell. To demonstrate how easy it is to find a user's profile, Maxwell performed a MySpace search on one of his male students. By simply typing in the student's name, within 30 seconds, Maxwell was able to him. By pulling up, that one person's profile, a user can now connect with numerous profiles of other students that are added to his "friends list." and each of them will link to even more students, and so on. Potential sexual predators are able to do the very same thing. ,. Many teens will oftentimes have provocative or otherwise. inappropriate photos posted with their profiles. "I've seen underaged students from area schools displaying pictures of them and their'friends drinking beer,. smoking or engaging in drug use. I have to deny adding that person to my friends list because of their -photos or some otherwise appropriatee content oh their profiles," Maxwell said. .' .a, And just why do ,young people feel the need to post pictures like this to an Internet audience? Maxwell feels that it's just another form of a popularity contest. Everyone wants to feel attractive. Children as young as 8 years of age have caught on to the MySpace phenomenon and are finding it as a means to become popular. According to an online 'search, Bradford High School has 487 youths registered as current students, Union County High School has 288, and Florida Twin Theatre 11 Seal,s $5.00 ttfore 6 p.m. 9-64-5451 Cl OSFD MON & TIES ') Cvisit us on-line at) &103wI==I Starts Fri., Oct. 13 Aiber l'lainibli', in PICTURESIll 'Fri. 7:05, 9:00 ,Sat. 5:05, 7:05, 9:00 Sun. 5:05, 7:05 Wed. Thurs. 7:30 Now Showing Martin Lawireince in } -v rF ,,v-717 '0i CO OLUGIA" RptCURI Fri. 7:00 Sat. 5:00, 7:00 Sun. 5:00 Now Showing Kevin Cosiner in GUARDIAN Fri. 8:45 Sat.,8:45 Sun. 7:00 Wed. Thurs. 7:15 River of Life, Church of God Fall Bazaar and Craft Show October 20 & 21 Fri 8am to 6pm Sat B. latlX$l WE'LL HAVE MINI MUFFINS & A HOT CUP /: OF COFFEE FOR YOU TO SIT & ENJOY. Located across from the Fairgrounds in Starke on US .301 North. For more information call 904-964-8835 Additionally, 'there are numerous groups within MySpace that users can join. Within each group, members can begin and participate in forum discussions. Along with class alumni. area teens have set up groups for JROTC, Christian youths, high school bands and sports teams, to name a few. Users in these groups should be aware that one does not need to be a member of the JROTC' n .. ..hn b d JiK gr :are dri i fer ph ye m( S Decoratve Pati o SOclober. 19th 21st 10 a.m.' 4 p.m. SI oI) early lior vOti I Iolida Decor . 2()",,- Iliscoun fldurinHY OpenI House * * Orrinwinimls C.iiidles & \ccessoneit v .u I. UI tLiI Uo IIU L U viv ew 1-, ;+1 n Il(--n tiil ed uec- I I oup's page and forums. hlt e r One group belonging to an 'Coirinmet Foods & (lCocolates ea high school band has the awing, of a nude male ahd "d s male for the band's profile 322-A ili St.. across from Auto Zone oto. The profile lists a, 37- , ar-old female as the group's oderqior. MYS C .*. See MYSPACE, p:-' *`66 : .. & *^ .^ i. ..' - r J 1 r I II I I I I I I II ~ ~~~ ~ ~ ~ ~ -- -~~~~ ~ ~ ~-- ~ - Inatnirtnr Mika Raville talks to adult student Calvin Oct. 12,2006 TELEGRAPH, TIMES & MONITOR-B-SECTION Page 3B '5 --- $5-"Si Dalton Cassell (left) and Justin Long draw diagrams of their cookies before they begin attempting to remove the raisins. Bradford Middle science students 'dig cookies BY CLIFF SMELLEY Telegraph Staff Writer He outran, a giant boulder that was barreling down on him, ready to crush him if he took a wrong step. He overcame his -fear of -snakes and outwitted Nazis. It was hard %work, to say the least, but Indiana Jones finally) made it to the prize he was seeking-a cookie with raisins in it; A cookie? OK,so maybe no archaeologist, real or fictional, would consider a cookie much of .a treasure, but Bradford Middle School. students recently, participated in' a classroom exercise in which they acted as archaeologists and cookies were "hat they were probing "ith their instruments. Students in the science classes of Roger Chilson and John Tinsler %kere each given a cookie with raisins in it. The cookie represented a piece of. earth. The raisins represented artifacts buried in the earth. Since students couldn't visit a real archaeological Tinsler said the goal of exercise was to bring the" to them. Tinsler distribu instruments to students they were to use to "'exca' the raisins from their coo The cookies, however, c not be picked up manipulated in any way. A all, a real archaeologist c pick up a large piece of e and look underneath it i attempt to see what arti are there. "(The cookie) must right side up, and you ha dig in and find all of artifacts." Tinsler told students. Students first had to me; their cookies, then dra See COOKIES, p. Pumpkin Escape offers candy, games and more BY MARCIA MILLER Telegraph Staff Writer This yeai's Great Pumpkin Escape promises to draw thousands of children and parents to dom ntown Starke on Saturday, Oct. 28, from 5-9 p.m. Pumpkin Escape is sponsored by the",Downtown Business Communit) Association and will be spread out in the do%% ntown area on Call, Walnut and Thompson I streets. SThe free cand\ will be giken out from 6-8 p.m., but the carnival-style games, entertainment, contests and fun %%ill last until 9 p.m. S Games are run by nonprofit 0 / groups. Some are free and some are run as fund-raisers for the various groups. On those, the prices.to pla3 range from small change to $1. "It should be a lot of fun for site, everyone," said organizer the Norma Donn. Site" Steel Country will be the featured band. The band will uted perform on a stage set up in that the cith parking lot adjacent to ate" city hill. Dancing contests will kies. be run throughout the evening esould on the stage. or The city parking lot will also ofter play host to a spooky haunted can't house. Admission for the earth haunted house is $3. in an Proceeds from booth rental facts go to fund next year's Pumpkin Escape, but the proceeds from the haunted Sta) house are earmarked to fund a tve business scholarship being set his up in memory of one of the members of the DBCA, Naomi Sasure Herres, %w ho passed a ay. 1, a Herres owned the Merle Norman store in downtown Starke and was very active in the various events sponsored in 9B downtown. The scholarship will be awarded to a Bradford High School student who is. interested in pursuing a career in business. For the competitive among us, there are a.few contests available. A costume contest will take place on'the stage at cit3 hall at 6:30 p.m. Judging will occur at 7 p.m. - Of course, what's a Halloween etent without a jack-o-lantern? A pumpkin carving contest will take place at 5 p.m. on the corner of Call The only kind of dignity which is genuine is that which is not diminished by the indifference of others. -Dag Hammarskjold and Thompson streets. Pumpkin entries must be turned in by 1 p.m. A variety of foods %ill also be for sale by different vendors. Photos with live tigers and, live alligators will be a' ailable during the event. There are still a few spaces le-ft for vendors, so if sour group is interested in participating, contact Donn at (904~ 964-1--20. Children aren't happy with nothing to ignore, And that's what parents were created for. -Ogden Nash * Work Injuries * Headaches Dr. Virgil A. Berry CHIROPRACTIC Neck and Back Pain PHYSICIAN 601 E. Call St. Hwy. 230, Starke 964-8018 Melissa Clark digs into her cookie using a couple of tools. ,' . LARNThe Mu H Th MI Ms 16 Grammn8 & Dove.'Awards...and millions of people world-Wide say AMEN!" Madison Street Baptist Church Preaent' In Concert "Larnelle Harris" Sunday, October 1Sth @ 6:00 pam. "Come and join us for an evening of worship." 900 W. Madison Street Starke, Fl 32091 Dr. Chad Everson, Sr. Pastor I I I ~i~i~ - ill Edi torial/Opinion bn Thursday, Oct. 12, 2006 Page 4B ni I The Senate got it right this time Let's cut to the chase immediately. When the Senate refused (by one vote) to approve an amendment that would outlaw the burning of an American 'flag, its head overruled its heart, and it did the right thing by the slimmest of margins, Don't get me wrong. I abhor the burning of an American flag as much as anyone, and I hope no one ever attempts to do so in my presence. But there is an.overriding issue here that is even more importanttoevery American found in the First Amendment to the Constitution, commonly referred to as freedom of speech. The U.S. Supreme Court has interpreted the burning of an American flag as being a freedom of speech issue, but I see the act as being a defiant act --of-hostility--fostered --by ignorance, ingratitude and ignorance, because America, in spite of its imperfections, is still the greatest government ever conceived by the mind of man. The country operates within a Constitution that contains a Bill of Rights. By desecrating the American flag, individuals exhibit their lack of appreciation for the founding fathers and every serviceman or woman who- _served. in-the-miitary-irwgr Fopeace since 1776. The Senate, in its vote, sent two messages to the world; as individuals senators dislike flag burners, but, sitting as protectors of the Constitution, they believe freedom of speech is the overriding issue and must be protected, even at the cost of being misunderstood by many voters. The Bill of Rights contains 14' individual rights, five of which are contained in the Firstt Aipendment. Among these rights are thgfreeddm.tp worship, freedom of speech, freedom of the press, the right to peaceful assembly and the right to petition the government. ] LETTERS TO' BC children and parents say thanks to Fair Assoc. n The city of Starke Recreation Board and staff would like to express our most heartfelt appreciation to Chub Johnson, fair coordinator, and the Fair Association for use of the fairgrounds buildings and midway area to house the 2006 _summerday-camp progra.m-- Without your concern, 270 Bradford County families would have been left without summer child care. We would like to extend to you, the many, many thanks expressed by the parents of the clnildren who attended the 2006 r I' A story in the sports section of the Gainesville Sun (Tuesday, July 4, 2006) related an incident of April 25, 1976, that warmed my heart. Rick Monday, playing center field for the Chicago Cubs, came to bat in the' fourth inning. Ken Crosby. pitching for the Dodgers, had thrown the first pitch when Monday realized that two men coming on the field were planning on burning an American flag. Announcer Vin Scully said, "Wait a minute, there's an animal loose. TwO of them! I'm not sure what he is doing out, there. It looks like he's going to burn a flag. And Rick Monday runs' and takes.it away from him!" The two men, father and son, stopped in left center field, put the flag down, and began putting lighter fluid on it. Monday flew down the third base line as fast as his feet would carry him. snatched the flag from off the ground and continued to outrun the two would-be flag burners. Dodgers coach Tommy Lasorda came off the bench and began running toward the men, and assisted security in apprehending the two. The crowd of 25,167 rose to its collective feet and began singing "'God Bless America." The same flag returned to Dodger Stadium this past July 4 for the first- time in 30 years and will be featured in a pre-game ceremony. Freedom of speech. It is too precious to be denied, even in part. Monday is a hero for saving the flag on that day 30 years ago, but he errs in his support for an amendment to suppress flag burning. The U.S. Supreme Court is wrong in classifying the issue as freedom 'of speech FlRag bujiing should ,.be. prohibited,as an act of hostility. with appropriate punishment. By Buster Rahn, Telegraph Editorialist THE EDITOR summer day camp. We feel .this was our most organized summer to date, with - a record number of participants which was afforded by the additional space at the fairgrounds. Thanks again from the Recreation Department staff, Recreation Board members and, most of all, from the Bradford County children who had a blast this summer. Pat Welch Recreation Board Chairman Alica McMillian Director of Recreation Thanks from NRVFR 'Dear Editor: The members of the New -Medical C STARKE 319 W. Call St. Suite B 7 (9041966-0000 Call us ntow to sekedule your aA Medicaid Blue Cross Blue Shield Health Most Major Insurance Companies and HI Come visit us at our current locations: Hawthorne, 6005 S,E. U.S. Hwy 1 Lake Butler, 395 (352)481-5221 (386) 496. Lake City Live Oak Macclenny Glen St, Mary Alachua Callahan Ga Accepting applications for all positions Fax: (386) 755-2518 River Volunteer Fire Rescue (NRVFR) would like to thank the public for its support of our recent bake sale. The turnout \\as much greater than we expected and the generosity of our neighbors will make a sizable addition to our building fund. We invite everyone to stop by and see the improvements, that are being made to both the station and the meeting area. Once again, thank you all very much for your support Joseph W.Gangi Chief An investment in .knowledge always pays the best interest. -Benjamin Franklin L ent enter ointment . y Kids - MOs W. Main St. -1655 ainesville Branford Newberry Srn U U OBITUARIES Carl Carter KEYSTONE HEIGHTS-- Carl Carter I, 81, of Keystone Heights died Wednesday, Oct. 4, 2006, at Shands Alachua General Hospital. Born in Providence, R.I., Mr. Carter was raised in Jacksonville, moving to .Keystone Heights in 1979. He was a merchant marine, retiring in 1985 and a member of MEBA. He was a member of Masonic A&FM Park Place Lodge 1172 and Melrose Lodge. He also was a member of the Order of Eastern Star, Waldo Chapter 120. He.was a member: of the Gethsemane Lutheran Church in Gainesville. Mr. Carter is survived by: his wife, Pauline Carter of Keystone' Heights; five daughters. Donna Robinson of Rockdale. Texas, Paula Camp of Houston, Texas, Carla Orth of West Palm Beach, Lisa Seymour .of .Keystone Heights and, Teresa Reid of Smith, Ala.; two sons, Bobby,. Carter of Louisville. Tenn., and Carl Carter II of Keystone .Heights: 13 grandchildren and eight great-grandchildren. Memorial services for Mr. Carter will be conducted at 10 a.m. on Saturday, Oct. 14. 2006; at Gethsemane Lutheran Church in Gainesville %kith the Re%. SRonald Will officiating and the Rev. Michael Lozano assisting. Arrangements are under the care of Archie Tanner Funeral HotH6e of Starke. - Memorial contributions may be made to HaHen Hospice. 4200 N WV. 90th Bl.td.. Gainesville. Fla or American Lung Association of Florida, 136 S. Main St., Belle Glade, FL 33430. Richard Dekle FAYETTEVILLE, GA. Richard Nelson Dekle. 71, of ,FaNette\ille. Ga., died Tuesda\. Oct. 3, 2006. at his home following an extended illness. Born on Sept. 10, 1935. the son o late N onand Rub-- DeklefvrTr-Dekle served in the United States Air Force and \as retired from the city of Jacksonville where he was computer administration e super% isor. Following his retirement he moved to Lake City. in .1991, where he lived until moving to Fayetteville in 2005. He was a member of the Church of Christ. - M Mr. Dekle is survived by: his 'wife of '52 years, Evonda Bielling Dekle of Fayetteville; two daughters. Susan Dekle Skaf. and Robin Dekle Clark, both o, Faetteville; .' three.,' isiStmors, Pairiciai Johns: of' ,Like,:Bbitler, ir Donna -Coleman' and' "Ma4ry Frances Lewis, both of SMcAlpine; a brother. Billy Dekle of Lake City; and fi\e grandchildren. He was preceded in death by a brother; Robert Dekle, and a sister, Betty Gainey. Funeral services for Mr. Dekle were Oct. 7, 2006, in Lake Butler Church of Christ with Brother. Daryl Townsend officiating. Burial followed in Dekle Cemetery in Lake Butler under the care of Archer Funeral Home of Lake Butler. Roland Finley LAWTEY Roland John Finlev, 72, of Lawtey died Thursday, Sept. 28, 2006, 'at( Lake City Veterans Hospital following a brief illness. Born on June 1, 1934, in, Jacksonville, Nir Finley. was a Navy veteran of the Korean War Mr. Firile) is survived by. his wife of many years, Claudette Finley of Lawtey; a son, Roland J. Finley Jr. a daughter. Rebecca 'Lynn Gooding; and three grandchildren A memorial service for'Mr. Finley was-Oct. 10, 2006, in .Floria National Cemetery in Bushnell Burial will follow under the care of Veterans Funeral Care of Clearwater. Jane Hammock; LAKE CITY .Jane Ann Hammock, 50, of Lake. City died Wednesday. Oct. 4, 2006, at her residence. . Born in Samannah. Ga., Mrs. Hammock lived most of her life in Live Oak She was a teacher's :aide with the Union County School Board. She was a member of Pro idence Village Baptist Church.-L. .:, Mrs. Hammock is survived by: a daughter. April R. Tomlinson of Providence. a stepdaughter, Deonna Willis of Lake City; a son. Michael Me\er of' Lake Cit.; three brothers,, David Smith of Dallas, Keith Smith of Lite Oak and James Smith of Georgia. and three grandchildren SShe %%as preceded in death b, her parents, James 0. Smith and Jill Smith. and a brother, Richard Smith Funeral services for Mirs Hammock were Oct. 8, 2006, in Providence. Village Baptist' Church. with pastor Percy Cunningham officiating. Burial followed in Live Oak Cemetery under the care of Archer Funeral Home of Lake Butler. . James Kessler STARKE James 'Thomas Kessler, 57, of Starke died Tuesday, Oct. 3, 2006, at his residence in Starke following an extended illness. Born in Jacksonville on Oct. 2, 1949, Mr. Kessler was of the Protestant faith. He was a veteran of the \ ietnam War. serving -in the U.S. Army. He worked as a bartender. Mr. Kessler is sun ived by: his .stepfather, Ray Ragsdale of Starke:, a son, Dale E. Kessler of Harvey, La.; three brothers. Lawrence E. Kessler of Palm Coast, Robert D. Kessler of Alber ille. Ala., and Mic'hael Ragsale of Gaminesville: and one grandchild. :' Graveside services for Mr. Kessler were Oct. 6, 2006, in Kingsley Lake Cemetery %%ith the Re\ Larrm Finle. conducting the sert ices. Interment followed under the care of Jones Funeral Home of Starke. In .v(emory ; In Loving. Memory n of Michelle Lee,, Oct. 13, 2001 It's hard to believe that you wre taken awa ith'e years ago. With. evero passing day the memories of You are ititli me Your presence made an impact on in- lite. . I miss vonl more than words could ever express. Memories ofyou wit-ill be with me for an eternirty. lYou will neter be forgotten. I loie you. SForeve Rhonda Johlns EVERYONE APPROVED! i OOK NO CREDIT CHECK PORTABLE WAREHOUSES' OF WALDO, FLORIDA ; ". ; 'o "' , -i ,,-''^ -, .t .' ,,!' ,,l^ -- S-. LifetimeWarranty SPifessure Treated Wood Serving All of North and North Central -Ilordai Building Vtartfing at.... S 0/m O1l0o Come See Usi U.S. Hwy 301 Waldo Flea Markets OPEN ALL'-WEEK Sathrd4a & Sinday 352485-2533 MAKE A PIT STOP AT THE, CHECKERED FLAG SALE! 0% FINANCING! ONLY $5,999!t n ,., 1 * r* 19-hp Kawasaki gas engine & 9-mph speed JOHN DEERE * 48".7-Iron UTM mower deck * E One-piece 7-gauge stamped steel a engine THE Z-TRAK ADVANTAGE S9-mph transport speed 54'" 7-ron IIM mower SAVE MONEY Sdeck GreenSouth is offering the lowest price of the year Zero-turning radius for with 0% Financng. ..excellent SAVE TIME maneuverability Z.Tracks are quicker than your average mower, with larger decks that cover more ground. MAXIMUM SPEED, COMFOriT nd MANUVERABLUTY 0% FINANCING! ONLY $7,299! Z-TrMksfeaturZ-Turncpabiit whichlets the driver turA around ay obstacle they may fawe. GET TO VICTORY LANE AT GREENSOUTH EQUIPMENT TODAY! =n.......>"u GREENSOUTH Equipment, Inc. STORE HOURS: M-F: 7:30am-6:00pm Sat: 7:30am-4:00pm Sun: Ciosed preeusouthequipment com HASTINGS, FL 100 SOUTH DANCY STREET ...................... (904) 692-1538 GAINESVILLE, FL 9120 NW 13TH STREET ............................. (352) 367-2632 NEWBERRY, FL 633 NW 250TH STREET (352) 472-2112 CNIEFLAND, R 107 SOUTHWEST 4TH AVENUE ................... (352) 493-4121 OCALA, F If D.., & C.P.rrv D7481)600802 cG5000l10t2RcT .00151562 am rma I I I SOct. 12, 2006 TELEGRAPH, TIMES &MONITOR--B-SECTION Page 5B OBITUARIES Julia Lazzaro MELROSE Julia A. Lazzaro, 90, of Melrose died Wednesday, Oct. 4, 2006, at Bradford Terrace in Starke following an extended illness. Born in Canastota,; N.Y., on Oct. 6, 1915, Mrs. Lazzaro was a homemaker and member of St. William Catholic Church, . Mrs. Lazzaro is survived by: three children, Nicholas, James and Gut, nine grandchildren.- 11 -great-grandchildren and five great-great-grandchildren. Memorial services for Mrs. Lazzaro were Oct. 11,--2006, in- St. William Catholic Church %with Father Mike Williams conducting the services. Interment followed in Keystone Heights Cemetery under the care of Jones Funeral Home of Keystone Heights. Shane Martin MACCLENNY Michael "Shane" Martin, 36, of Macclenny died suddenly on Tuesday, Oct. 3, .2006, in a motorcycle accident. Born Dec. 7, 1969, in Okeechobee, Mr.. Martin was raised in Starke and has lived in Baker County for the last four years..'He was a member of. the Free and Accepted Masons in Starke He worked for Union Correctional Institution for 18s years prior to becoming an EMT Mr. Martin is sun ived by: his wi fe. Tammy Walker Martin; his mother, Glenda Martin-Moore; his father, Donald W. Martin; his children. Joshua Martin, Wesley Craw ford, Alyssa Crawford. Cassie Martin and Julie Ann Martin; maternal grandmother. Vera Suggs; maternal grandfather, Ottis Adams; and paternal grandfather, Donald J. Martin. He was preceded in death by a brother, Donald Martin. Funeral ser ices for Mr. Martin were Oct. 7, 2006, at Christian Felloswship Temple with pastors Timmy Thomas and David Thomas-officiating with thd Department of Corrections Honor Guard serving -as pallbearers. Arrangements were under the care and direction of V. Todd Ferreira Funeral Services of Macclenn). James Mayben ORLANDO James Edward "'Jimmy" Mayben, 64. of Orlando died Saturday. Sept. 30, 2006., at his residence following a sudden illness ', 'Born- in'3Gadston, Ala'.; Mr. SMayberi lied in Brooker before moving to Orlando. He was the son of the late Melhes Mayben and Wilma Mayben. He was an electrician. . Mr. NMayben is survived by, several nieces and nephews. He was preceded in death by his brother, Richard Mayben. Memorial services for Mr. Mafben were Oct. 6, 2006, in the chapel of Archer Funeral Home of Lake Butler with the Rev. Jason Reed officiating. Cremation and burial will follow at a later date. Ramona Price Ramona Price KEYSTONE. HEIGHTS. - Ramona' Elaine Price, .38, of Keystone Heights died Monday, Oct. 9, 2006. at Shands Starke. Born in Palatka. Ms. Price moved to Keystone Heights from Palatka. She w.as a member of Church of Our Lord Jesus Christ Ms. Price is survived b.: her mother, Betty Sue. Price' of Palarka; si\ sisters, Linda Hardee of Belden. Miss. Janet Duncan of Jackonille. Karen Kise of Palm Bay. Vanres-a Smith of Orange Park. Teresa Smith of Keystone Heights and MNlichele Hill of Madisonmille, Ky.: a brother, Michael Price of ,Palatka. She was preceded in ' death by her father, William Thomas Price. a sister. Shirley .,Wager. her paternal grandparents, Thomas and Ruth Price, and her maternal grandparents. James Arthur and - Florie Hall . Graveside services for Ms., -Price will be Thuisday, Oct 12, 2006, at Palaika Memorial Gardens %with Brother Tod Hill officiating. Burial %will follow under the care of Masters Funeral Home of Palatka. Memorial contributions may be made to the American Cancer Society, Putnam Unit. 60 Zeagler Dr., Palatka, FL 32177 Joyce Phillips JACKSONVILLE Joyce Lucille Phillips. 60. :of, Jacksonville died Saturday. Oct. 7. 2006, at Shands at University of Florida. Born in Grenada, Miss.. Mrs. Phillips hlied in Lawtey' lef6re moving to Jacksonlille 35 years. ago She 'as a retired waitress. Mrs Phillips is survived by: her husband, Leslie Phillips of Jacksonville; a son, Paul Terrell of Jacksonville; a daughter, Angelique "Angel". Karna .of Atlanta; her mother, Lucille Bloodworth of Jacksonville;: a stepson, Byron Phillips of Jacksonville; two sisters, Becky Green of Palm Coast and Jan Elliott of Greenm ille, S.C.; and two grandchildren. Memorial services for Mrs. Phillips were Oct. 10, 2006, in the chapel of Archie Tanner Ranked One of The Best Restaurants in' Florida by Flo irida Trend ,lligct:inc 2003, 2004, 2005 & 2006 HE YEARLING RESTAU RANT EST. 19 2.. ; CROSS CREEK, FLORIDA Funeral Home of Starke with Brother Ralph Wise officiating. Frank Rieselman - KEYSTONE HEIGHTS -Frank: Joseph Rieselman, 81, of Keystone Heights died Friday, Sept. 20. 2006, at Shands AGH in Gaines ille following an e\iended illness. Born in; Covington, Ky on Oct 23. 1924, Mr. Rieselman moted to Keystone Heights in 1982 from Clear\water He was a retired truck driver and was of the Catholic faith. Mr Rieselman is survived bN:" his wife. Karen Rieselman; children. Terri Sunderman, Barry Rieselman, Frank Rieselman Jr., John Rieselman. all of Cincinnati; a brother, Robert Rieseiman of Las Cruces, N.M a sister, Catherin Mullikan of Cincinnati. lour stepchildren, Pamela Cascanet and Terry Brock, both of Kevsione Heights, Ronald Biock of Stevens, Pa and Kenneth Brock. of Harinsburg. Ky;- 14 grandchildren and five.' great grandchildren. Memorial contributions may be made to the American Heart Association. 3801 N.W. 40th Terrace. Suite B, Gainesville,FL 32606, Ruth E. Scott Ruth Scott SATSUMA Ruth E Scottn 76. of Satsuma died Tuesday. Oct. 3, 2006, at her residence lollowking an extended illness. Born in Starke, Mrs Scott lived in Satsuma for the past 20 years. She was a member of First Baptist Church of Welaka and %was a cosmetologist ' Mrs. Scott is survived' by: a daughter. Sherl%,n Sanders of Satsuma; a son, Wayne Scott; four sisters, Dorothy Cruthirds of, California, Eunice Gilliard of Hawthorne, Reba ,Ketter. of Satsuma' and J.vlrna Dockery of Ocala; three grandchildren and five great-grandchildren She. was preceded in death by her husband, Glenn Scott, and a brother. Joe Griffis Jr. Funeral sen ices for Mrs. Stott were Oct. 6, 2006, at the Johnson-O'erturf Funeral Home in Palatka %ith pastor Tom Miller officiating. Burial followed in Oak Hill West - Cemetery. Carolton Smith KEYSTONE HEIGHTS Carolton Aaron Smith, 30, of Keystone Heights died suddenly on Wednesday. Oct. 4. 2006, at his residence Born Apiil 21. 1976,. in Gainesville, Mr Smith mo'ed to Keystone Heights in 2004 from ' Georgia He %worked for Countr. Caterers. Mr Smith is survived by, his mother. CandN Sulli'an of Keystone Heights. three sisters, Kimberl% Le\asaque ol Oklahoma. Carla Mauldin of Orlando and Roseanna Valherde pf Keystone Heights. and hi, maternal grandmother. \ irginia Donahue of Keystone Heights Memorial services for Mr. Smith were Oct S. 2006, at the home of Virginia Donahue vith family and friends conducting the services. Interment will be at a later date under the care of Jones Funeral Home of Ke\ stone Heights. Memorial contributions ma', be made to Jones Funeral Home. in memory of Aaron Smith. P.O Bo\ 127. Keystone Heights. FL 32656. Asher Sullivan GAINESVILLE Asher Gerard "Jerr\" Sullivan Jr., 46, of Gainesville died Sunday. Oct. 8,, 2006 Born in Live Oak. Mr Sullivan lied in Starke and Lake City before mo'. ing to Gainestille in 1995 He attended Christ Central Ministries and was an entrepreneur Mr. Sullivan is survived by- his wife. Carlene Sullivan -of Gainesville: two sons, Asher G Sullivan III and Dalyn "Colb\" Sulli'an, both of Gainesille. two daughters, Ciji Sullitan and KaLeigh Sullivan, both of Gainesville; his mother and' stepfather, Loretta: and. Bill I Marchant "of Lake Cits', three brothers, Ricky Sullivan and Todd Sullivan, both of. Gainesville, and Bret Marchani of Apachee Junction, Ariz.; arid: three sisters. Tara. Marchant- Krieghliuser of Lake City,' Misty. Waters and MonIa Pooser, both of Gaines',ille He %as preceded in,, death by his father, Asher G., Sulli .an ' Funeral serve ices *for Mr. Sullitan kill be conducted on Thurdav. Oct 12, 2006. at 3 p.m.. at Christ Central Ministries with Pastor Lonnie Johns officiating and Chris Doering and Dennis O'Neill assisting Interment will follow at Crawford Lake Cemetery in Suwannee County. SVisitation \ith the family ill be held from 6-8 p.m,- on Wednesday. Oct. 11, 2006, at Gateway-Forest Lawn Funeral Home. 3596 Hwy. 441, in Lake City. A guest book is available at \% %ww .gatewayforestlawn.com. Paul Williams CLAY HILL Paul Winston Williams, 64. of Cla, Hill died Saturdayv, Oct. 7, 2006. at St. \incent's Medical Center in Jacksonville. Born in Dupline County. N.C., Mr. Williams liked in ClaN Hill for 29 sears He owned and operated Williams Roofing of Jacksonuille and was a member of First Baptist Church of Highland. where tie was chairman of the building committee. He was also a member of the "Mountain Gang." Mr. Williams is survived bN: his 'wife, Ruth Williams of Clay Hill. a son. John Williams of Middleburg; a daughter. Anne Slater of Clay Hill; a brother, Dick Williams of Kenansville. N.C.. two sisters. Bobbie Piglord of Kenans'ille and Kay Cahoon of Surf Cit\. N.C.. and II grandchildren He was preceded in death by a daughter. Paula Williams Miller. Memorial services for Mr. "When You gay It With Flowers IT's Beautifully Said" Since lm3 Florist $ 0 14964-77i ,, 218N: Temple " Starke Williams will be held at 7 p.m., on Wednesday, Oct. 11, 2006, at' 'First Baptist Church of Highland with the Rev. Bill Clayton officidtine Archie .Tanner Funeral Home of Statke is in charge of arrangements Memorial contributions may be made to First Baptist Church of Highland Building Fund. 1409 U.S 301 N Lawiey. FL 32058.- eatd S. Virginia Lamb lit' 11 /,I i o / tii o dirank evercrr, lor Ih/.ir khi 'iii '" a i'd hiwi /iii'i, . tlie ard lo',,,'t and i o is aid the/ i o oi aidl prot ers i ioar time of .sorrOn /oa ,,i0 1, lo lo ed ni 'e Ti i.caLib family ,': '' '' "** '* - A cathedral, a wave of a storm, a dancer's leap, never turn out to be as high as we had hoped. <" -Marcel Proust STARKE i LUTHERAN MISSION "i (LC-MS) . Sunday Worship at 10:00 A.M. in the Banquet Hall of the KOA Campground, ... S 39 1,.8 .. , S(904) 964-8855 \\e Speak Chris Cricified - Personnel Qn site from 8AM day of Auction "Auction at 10:OOAM ON SITE AT: 76 10 SW CR18, Hampton, FL (Between Gainesville & Starke.' I mile West of US Hwy 301 on CR I8) SERVING THE FINEST IN CRACKER CUISINE... SEAFOOD AND USDA PRIME BEEF. --Ttl~fosl +.,lVAl I ERem W[Piero] OPEN THURS-FRI 5-1OPM, SAT. NOON-10PM SUN. NOON-8:30PM 2 PHONE (352) 466-3 999 "1 Pre-School a JMinisatf ofp A dide S3ap3idt efu"c SiWime, (C"iwe of S- 16 & eC 225) (904) 966-0444 OPENINGS AJ AVAILABLE i for 1 and 3 yr olds L 4 at the Pre-School... Call Today! A few limited openings in select grades are still available at the Christian Academy... Call 964-7124 for more details. O Saturday, Oct 14th 2006 .,5 Feet of Lake Front Property on Hampton Lake For More Information, Please Visit: 0w.Campe1 uetions.com For More Information, Please Visit: g Page 6B TELEGRAPH, TIMES & MONITOR-B-SECTION Oct. 12, 2006 MYSPACE Continued from p. 2B Other groups Wvere found to: use explicit: words to describe. their schools or areas of town. MySpace, has received a large : volume :of media attention lately, warning young people, of the dangers of using the site. Maxwell believes that is like.' somebody: putting up -a "No Trespassing" sign to kids,. peaking their curiosity to see just what it is people' are trying to keep them away from. He said he doesn't want to. advise young people to stay away from MySpace, but ,wants parents and children . alike to realize that any information contained in their profiles is open to public view across the World Wide Web. . According to the safety features posted by MySpace.com, they claim to' not allow any pornographic' images or obscene language on Patrick -' , Maxwell, . .Coordinator of Lake Butler -: .Middle School's 21st.Century . Learning Center and - pastor of .- Victory Christian , Center, ata a - MySpace workshop held on Sept. 25 their site. In reality it is ever) here. Maxwell believes that with the millions of MySpace users out there, it is virtually impossible to properly\ staff site moderators to investigate and re-investigate user profiles all day long. Instead, MySpace.com opts to asking users to report abuse of this nature to the Web site. "Get serious," said Ma\wel.. "That's a nice try, but no one is going to do that. Young people need to be smart and: think about what they are doing when they are online. M3 Space does have built-in safety features, and the .kids need to use them." Advertising on MySpace is yet another issue. The site is littered with banner ads that are nothing short of soft porn advertisements for things like dating services, enticing young people to go to their WeO site to find "the one." Another problem .is' that Upon opening a MySpace. account, users agree that' their email'address may be given to their third party advertisers. Unsolicited e-mails are sent to users with the a subject 'line: like "come view my webcam and see me perform .'" -"We are talking about pressure sensitive 14 and' 15-. year-olds receiving these messages," said Maxwell. "There are obvious concerns' that many young people are` becoming desensitized to some of the things they view on the net." Various experts have. reported that the average teen is now spending less time on their school work and instead spending one to three hours a day on MySpace. Thirteen-vear-old Destiny Young stated that the first thing she thinks about when she gets home from school each day is logging on to NMlSpace and checking for new friend requests comments or added pictures. She thinks that it's fun sending messages back and forth with her friends, putting different backgrounds on her profile page, and reading other people's profiles. When asked whether or not she ever thought about millions of online viewers, including sexual predators, seeing her profile, she stated that if anyone like that ever tried to make contact with her, she would block the user from being able to reach her. Interestingly, more and more employers are doing Internet searches or hiring firms to do background checks on potential as well as current employees. Students may not realize that by listing their school, using their full name or their e-mail address, they are allowing anyone to search and find their, page, What's more is that anything placed on that page . can come back to haunt users some. day,' as Web pages can be archived with some search engines and archival programs. Maxwell's advice? As, a general rule, never post any photos or words that you wouldn't want your mom or dad to. see. Any material contained on the profiles of those in your friend's list also reflects on Nou. Keep in mind that just 'as many young people are posing as. being 18-year-olds 'when they are actually only 14, sexual predators, too, make up profiles posing as a young person, add a fake picture, pretend to like in the same area and send out friend requests. As these predators make friends with other users, they will gradually work towards a meeting in person. Even w-hen meeting in a public place, such as a football game, this is a very dangerous situation to be in. Maxwell feels that most kids have what he likes to call:a fire. drill mentality. When there's a fire drill at school, kids go through the motions, thinking this will never really happen, but when it does, they ask, how could this happen to me? Common sense and'good Curiosity is one of the most nature will do a lot to make permanent and certain the pilgrimage of life not characteristics of a too difficult,. vigorous intellect. -Somerset Maugham -Samuel Johnson +1 S- SYITE PREP1' SLand Clearing Ponds Grading , 1-800-871-7525 office/Fax 386-496-4740 .. ,, aI' Ci lin l .iiedJ -YUESDAY THRU NOW OPEN SATURDAY "Smitkwille" 4 miles Eacst of Lake Butler on SR 100 Hardware Furniture Plumbing Antiques Electrical Collectibles Tools Appliances Paint Fishing Gear Knives I BVit'. ,it, NEW & USED ~BUy &SELL: Crash victim remains hospitalized . the embankment. As the vehicle exited the ditch, it rotated counterclockwise back onto the roadway and partially ejected Moore, Cpl. England said. Moore was transported to Shands Gainesville. Moore, was not wearing a seatbelt. Charges are pending alcohol' results, Cpl. England said. U ~ . Beck Chrysler Dodge Jeep of Starke Welcomes Bob Asa : as Sales Consultant Bob lives in Melrose & recently moved here from Central Florida. Bob has worked in automotive business for nine years. Stop 'by and let Bob show you our complete line of New & Used vehicles. . (904) 964-3200 15160 US 301 South CHRYSLER FL ---- 0 aRI Starke, FL COSTUME PARTY SATURDAY OCT. 28 8 PM til closing Come Join The Fun! 1st place ~ $100 0 =,. 2nd place ~ $75 3rd place ~ $25 THURS KAROAKE 8-11PI SATs DJ or Live Band 904-966-22241 LIVE BAND on Oct. 14 "Centerline" 9pm Closing S 17420 Hwy. 301 N, Starke (Across from the Bradford Fairgrounds) Tree stand to be given away at LCS festival t- .4 Terry Bradley of Terry's Huntin' and Fishin' has donated a Viper tree stand to the Lawtey Community School fall festival. A drawing for the tree stand wilI.,be held at the festival, which is scheduled for this Saturday. Oct. 14, beginning at 5 p.m. Bradley (center) is pictured with Tina Wilkerson, vice president of the Lawtey Community School PTO, and Victory Wilkerson. 5.1 ,)1 153 %Am ] I.. m - %a" I _ I ~--I P I LL_ -C I Oct. 12, 2006 TELEGRAPH TIMES & MONITOR--B-SECTION Page 7B CRIME Union teen charged with attempted murder- A 19-year-old Lake Butler man was charged with -attempted murder last week aftfe-ra stabbing. Deputies were called to Lake Butler Hospital at 6 a.m. on Oct. 3 where the stabbing victim was, being treated, according to Deputy Mindy Goodwin. The victim stated he had been with a while male by the name of Dustin and that he, had been stabbed numerous' times, Deputy Goodwin said. The victim stated that he arid Dustin had. ridden around, snorting .-cocaine. He stated they pulled into a wooded area near the cemetery, where they engaged in sexual activity. The victim stated Dustin then started stabbing him. The victim ran from Dustin,, enteredhis vehicle and went home. His father then drove, him to the hospital. The investigation into the' stabbing led deputies -to question Dustin Mitchell McSpadden. McSpadden admitted to the stabbing and was placed under arrest for attempted murder- and' aggravated battery with a deadly weapon, Deputy Goodwin said. The weapon was located. Deputy Goodwiln said. 'Guest tensed and atterip 'pull away from the ' Once inside the patrol Guest started, kicking vehicle. It was necessary the Taser to make comply with orders, Pati Brown said. Guest was charged' disorderly conduct, poss of drug paraphernalia resisting an officer w violence. Bond was $10.000.. He was-additionally c as a fugitive from ustici South Carolina, assault o enforcement officer, tr after warning and grand I without bond. Children he their father comm it burglary A 33-Near-old Ke Heights man was arres burglarizing a home on Trail Road He use children to gain entry in residence. Elmer Gene William charged Oct. 6 with burglary and grand th Deputy A. Graft. On Aug. 25, Williams his three children, went back of the Ridge Trai residence. A son and d, entered through a hole all, .here an air-condi unit had been. The c unlocked the back 'c Four charged Williams. Deputy Graff Inside the home, With attack removed items. inclt stereo, a. camera,. ni on mailbox posters/puzzles and' On Oct. 3. Union deputies collectable, swords and responded to a complaint of a before fleeing the area. mailbox being knocked off the Graft said. post on .Southwet 126th Some of the stolen Court. "as recovered "here \ The %'ictim stated she heard a as staying, Deput' banging sound and saw a car said. : drive off from her mailbox. The children, who are according to Deputy James 12-)ears old, admitted Goodwin. She grabbed her cell involved in the t phone and followed the car Deputy Graff said. until she could report a tag Williams remains in number. The car was occupied of the ClaN County J by two males and two females, a 5300.006 bond. Deputy Goodwin said. . : During the investigation into. 1 lay the mischief, deputies charged -Surner Ra ne Hamilton. 1,-. S.- -eS , and Jonnifer NI. Blackweler, . 22. b6oh" f;fft"-'Wdrthinrg o-'f'V Olaeh' Springs, and Bo James i law Dampier. 18. and a 16-year- liquor law -old, both from Lake Butler, Clay County-deputii Deputy Goodw in said. They 11 stores were -n admitted to bashing the compliance when mailbox with a wrench while conducted alcohol ch ,drinking beer and smoking marijuana.- Hamilton was charged with criminal mischief, disorderly intoxication and possession of . drug paraphernalia. She was placed under arrest Oct. 4. She , was released from custody by " Judge David Reiman. .' Sworn complaints were filed on Dampier. Blackwelder and . the juvenile on the count of criminal mischief. . do ff I. Wit to )U I I il .5 es ne hec )ted to establishments licensed to sell officer. beverages in the county. )l car, Forty-five stores were visited g the during the check. Businesses in t t use violation of beverage laws Guest included two Kangaroo Food rolman Marts in, Keystone Heights. They failed to check for with identification. Sunoco Food sessionn Mart on S.R. 16 at Kingsley and Lake checked for identification. without but still sold alcohol, to: a set at minor. Arrested were Samantha Ann charged Taylor, 20, of Keystone e from Heights, Penny Marie Smith, on law 40, of. Starke 'and Teshome espass Hailermaniam. 35. .of Starke. arcenv The were charged with selling alcohol to a minor and were released on a notice to appear. '1p Recent arrests in Bradford. stonee . ed for, Clay or Union Ridge The following individuals d his were arrested recently by local nto the Ila\ enforcement officers in Bradford. Clay (KeN stone is was Heights area or Union armed Count: , eft by . with Gilbert D. Daughtry, 42, of Swith Live Oak wvas arrested Oct. 4 to the ,, by Starke Parrolman P.A. I Road King for possession of daughter cannabis. During a traffic stop. in the the officer found two baggies tioning of marijuana in DaughtrN's children underwear. A $1.000 sure\ or for bond %Nas posted for his release said. from custody. they' ling a Wesley G. Dunaway' II, 32. onerous of Fort White w\as arrested Oct. several 5 by Patrolman King for knives possession of drug Deputy paraphernalia. During a traffic stop for faulty equipment, the ropert\ officer found'a marijuana pipe illiams with residue in Dunawa\'s G Graff pocket. A $1.000 surety bond S. was posted for his release. I 1- and o being Elizabeth McHale. 47, of irglary. Gulf Port was arrested Oct. 6 'by Starke Patrolman Shawn -ustody Brown for possession of drug 1 under paraphernalia. A chrome crack pipe was found in the floorboard of McHale's vehiclee during a traffic stop. Bond on the charge was set at $1,000. \ .-_, 1,1. 1, t i l-nathan. .Scott,. ,Armstrong. of liawtey was arrested Oct. 4 by Starke Sgt. Richard Crews for possession 'of s found cannabis. Armstrong's vehicle ot in was stopped on U.S. 301 for they unlawful speed. The K-9 cks of alerted on the vehicle, where Carolina man arrested in Starke A 27-year-old South Carolina man was arrested Oct. 6 for creating a disturbance at Murphy Qil. Travis Lamont Guest of Santee, S. C,, caused a crowd to gather at the business on Commercial Drive, according to Patrolman Shawn Brown. During Guest's arrest, the officer found a brass crack pipe in his possession. As he was being placed in the patrol car, Join us for The Honda Open House October 21st, lOa-4p for Food, Door Prizes and Savings on all In-Stock Models! Streit's Motorsports WHOTDA. 4820 NW 13th Street HOUSE352-376-2637 HOUSE 7 lnh~od[oIO ot'oei~dno~ fForoI4iC Lid (6,05) . the officer found a bag containing marijuana under the front,seat, Sgt.. Crews said. Joanna Mariea Clance, 33, of Keystone Heights was arrested Oct. 7 by Clay Deputy Lester. Ricks for possession of cannabis. possession of drug' ' paraphernalia and possession of a controlled substance without a valid prescription. During a search of Clance's purse, the' deputy found pills identified as Loritab, marijuana and "a marijuana pipe. Clance -was a passenger in a vehicle that was traffic stopped at 12:59 a.m. for faulty equipment. Deputy Ricks said. Dariel T. Fowler, 18, of Starke was arrested Oct. 6 by' Starke Patrolman J.W. Hooper for retail theft. Fowler is charged with concealing new. bab) clothing in a baby bag while inside Family Dollar." She was released from custody after a $1,000 surety bond %was posted. Clinton Russell Helmer, 22, of Keystone Heights was arrested Oct. 5 by Starke Patrolman Michelle Davis for loitering and prowling. Helmer %\as charged with being in the parking lot of a closed business, Patrolman Davis -. said. A $500 surety bond was posted for his release from custody. Debra Segars. 47, of Keystone Heights was arrested Oct. 2 by Patrolman Hooper for possession of prescription drugs .without a prescription. She was released from custody after a $15.000 surety bond was posted. Ronnie Baker, 25, of Starke was arrested Oct. 4 by Starke Sgt. Kevin Mueller for possession of marijuana and possession of a controlled substance. Baker was released on his own recognizance by Judge Hobbs. Devon Deisha Rogers, 26, of Starke was arrested Oct. 5 by Bradford Deputy Thomas Sapp for possession of cannabis. During a traffic stop the officer found approximately two .. grams, of cannabis in the i r, i. i Why wait ui your ballot General Ele o. E Bring your ; office comp County Sup Office. Located in the courthouse. EARL Monday through October vehicle. $1,000 posted. He was released after a surety bond was Malcolm Jamal Newby, 21, of Starke was arrested Oct. 2 by Patrolman King for possession ,if crack cocaine and sale of crack cocaine within a federal housing facility. Newbv sold cocaine to a confidential source on Aug. 1. Bond was set at $50.000. Michael, Wolf, 21, of Melrose was arrested Oct:. 9 by .Clay deputies for,. fraudulent use of credit card, , Ethel n Itina McNeil, 23, of Starke was arrested Oct. 5 b\ Starke Patrolman Michelle Davis on warrants for three counts possession and sale of controlled substance, crack cocaine within a. federal housing. facility. McNeil 'is charged 'with selling crac cocaine to undercover sources on Aug. 1 and 15. Bond was set at $150,000. Charlie Lee Jonas, 19. ol Starke was arrested Oct. 5 by ~Le FY until Electi( for the Nc action ? I )hoto ID t lex of the ervisor of North park f VOTING S h Saturday 8 Br 23 through For more information, questions or comments please contact... 4' on Day to cast member 7th o the extended k Bradford Elections ing lot of the SCHEDULE :30 a.m. to 4:30 p.m. November 4 Terry Vaughan SSupervisor of Elections Bradford County, Florida P.O. Box 58 - Starke, FL 32091-0058 "Freedom Rings With Every Vote" Starke Patrolman Stephen Murphy on .,warrants for possession and sale of controlled substance and trespass after warning. Jonas was charged as a co-defendant w ith McNeil in the Aug. 15 sale. He had been ordered to stay avway 'from the T.H.E. Apartments, where the crack was sold to the underco er source, Parrolman Murphy said. Jonas remains in custody under a $51,000 bond . Michael Cam, 47, of Hampton was arrested Oct.k 3 by Deputy Moore for violation of probation. A $15,000 surely bond was posted for his release from custody. Edward 0. Smith, 54, of Starke was arrested Oct. 5 by Patrolman King on a warrant for possession and sale of a l controlled substance within 1.000 feet of a school. Bond Swas set at $50,000. S John Kuykendall, 56. of Keystone Heights was arrested f Oct. 3 by Clay deputies on warrants for worthless checks. mmmma I- I WVTV .. .I FL I ViV VI 1 T Page 8B TELEGRAPH, TIMES & MONITOR--B-SECTION Oct. 12, 2006 CRIME Recent arrests in Bradford, Clay or Union The following individuals were arrested recently by local law enforcement officers in Bradford, Clay (Keystone Heights area) or Union County:. Carolyn Padgett, 51, of Starke was arrested Oct. 4 by Patrolman Davis on warrants for violation of probation drug, paraphernalia and possession of a controlled substance with no bond. Daniel Micah Morgan, 26, of Starke was arrested Oct. 4 by Patrolman Murphy on warrants for failure to appear domestic' battery and driving while license suspended :or revoked (DWIS). William Henry Ivey. 26, of Keystone Heights was arrested Oct. 9 by Cla Deputy Trent Cecrle for failure to appear possession of undersize black bass with no bond.'... David Bishop, 45, of Interlachen was arrested Oct. 5 by Bradford Sgt. M.L. McKenzie for failure to appear with bond set at $3.500. Anthony Parker, 45, of Myrtle Beach, S.C., was arrested Oct. .5 by Bradford Deputy C.M. Williams as a fugitive from justice from Virginia. Parker was picked up at Florida State Prison. James Frederick Harper, 70, of Starke was arrested Oct. 7 by Starke Patrolman David A. Bukowski for opposing a police officer. Harper appeared to be intoxicated or disoriented, Patrolman Buko%\ski said. While patting him down for a weapon, Harper tried to pull- away from the officer. He then acted as if he was going to strike the officer, .Patrolman Bukowski said. Harper ?was taken into custody with bond set at $1,000. David McBride, 22, of Starke was arrested Oct. 2 by Starke Patrolman Jason Crosby for- retail theft. He was.released on, his own recognizance by Judge- Johnny Hobbs. Dale Robertson, 41, of Sarasota was arrested Oct. 4 by Starke :. Patrolman Mark Lowery for loitering and prowling. He. was released on' his o%\ n recognizance by Judge Hobbs. Tina Louise Wells, 36, of Starke was arrested Oct. 4 by Hampton Sgt. A.J. Gibson for permitting unauthorized person to drive A $500 surety bond was posted for her release from .custody. Wells was arrested again on Oct. 5 b. probation officers for violation of ; probation battery on. a law enforcement officer. She was released Oct. 6 after a $5.000 surety bond was posted. Brian Patrick O'Reilly. 20, of Waldo was arrested Oct. 6 . by Alachua deputies on a Bradford warrant for grand theft and credit card theft. Bond was set at $35.000. John William Albertson, 42, of North Fort Myers was arrested Oct. 6 by Lee County deputies on a Bradford warrant for failure to appear possession of marijuana. Bond was set at $ 1.000. Clarence Rassoola Green. 19, of Lawtey was arrested Oct. 3 by Starke Patrolman Shawn Brown for violation of probation forgery, uttering a forged instrument with no bond. Christina Jones, 25, of Melrose. was arrested Oct. 1 in Polk County on a warrant from Bradford for battery on a person 65 years or older. Bond was set at $15,000. David Lambert, 39, of St.. Petersburg was arrested Oct. 6 by Bradford Deputy Sherri Mann for violation of probation grand theft auto with no bond. Johnny Everert George, 42, of Lake Butler was arrested Oct. 3 by Union Deputy .Mindy Goodw.in for failure to. appear trespass in an occupied structure and resisting arrest without violence. Bond was set at $50,000. Andrew Cottom, 23, of Melrose was arrested Oct. 4 by Clay deputies on a warrant for lewd battery. Tina Tannehill, 34. of Gainesville was arrested Oct. 6 by Bradford Deputy Scott Konkel for violation of drug offender probation and forgery with no bond. Ted Tbanning. 40, of Starke was arrested Oct. 6 by Deputy Moore for violation of probation domestic battery. A $5,000 surety bond w.as posted for his release. Richard Bedard. 52, of Lake Butler was arrested Oct. 5 by Deputy Mann on a warrant for escape. Sarah Johnson. 29, of Keystone Heights was arrested Oct. 3 by Clay deputies on a warrant for violation of probation false police report. Patricia A. Clark, 46, of Lake Butler was arrested Sept. 29 by Union Captain' Garry Seay on warrants for aggravated assault and criminal mischief. Bond was set at $10,000. * Garner Daniels,, 48, of Gainesville was arrested Oct. 2 by" Union Deputy James. Goodwin. for violation: of probation. , Joseph. Mandel Hilliard,. 36, of Starke was arrested Oct. 2 by probation officers for violation of probation. His. arrest Oct. I for domestic battery violated his probation. Ennis Lariscey. 30, 'of Hampton was arrested Oct. 2' by Deputy Mann on a warrant for uttering a forged instrument and grand theft. Lariscey was:_ released after a $20,000 surety bond was posted. Ricky Gainey, 44, of Starke was. arrested Oct. .2 for, violation of probation worthless check. Traffic .' Robert Lee Chastain. 34, of Hampton was arrested Oct. 7 by Sgt Gibson for driving under the influence tDUI). Chastain's blood-alcohol le\el was .14 percent when his 1993 Cheirolet was stopped at 4:50 a.m. on C.R. 18, Sgt. Gibson said. A $1,000 suretr bond was.posted for his release from custody. Johnnie Benjamin Holton Ill. of Callahan was arrested Oct. 6 by Bradford Deputy Robbie Watkins for DUI and possession of cannabis Responding to a report of a suspicious vehiclee on S.R. 100 at 2 a.m., the deputies found Holton passed out behind the \\heel of his 1995 Dodge truck. Further investigation revealed Holton was under the influence of alcohol, Deputy Watkins said. During a search at the time of arrest, the deputy found marijuana in Holton's pocket. He. refused .a breath 'test. Holton was released after a $1,000 surety bond was posted. Allen William Jones, 25, of Gainesville was arrested Oct. 7 'by Bradford .Sgt. George Konkel for DUI. Jones' blood- alcohol level was ..15. percent when'his 2003 Dodge pickup was stopped at 2:12 a.m'. for' weaVifig on S'R. 16, Sgt. Konkel said. He was released after a $1,000 surety bond was .posted. Christy Renee Jones, 28, of Starke was arrested Oct. 7 by Bradford Deputy Drew Moore for DUI. Jones' blood-alcohol level was. 18 percent when her 1994 Ford pickup was stopped at 2:26 a.m. on S.R. 16, Deputy Moore said. A $2,000 surety bond was posted for her release from custody. Roger Kyle Barnet. 21, of Raiford was arrested Oct. 8 by Deputy Moore for DUI. Bamett's blood-alcohol level was .18 percent when his 1993 Chevrolet was stopped on S.R. 16 at 3:13 a.m. He was released from custody after a $2,000 surety bond was posted. Joseph Hayward Rowe Jr., 25, of Gainesville was arrested Oct. 7 by Sgt. Gibson for DUI. The.charge is pending lab results, Sgt. Gibson said. Rowe's 1998 Ford pickup was stopped on C.R. 18 at 11:20 p.m. A $1,000 surety bond was posted for his release from custody. I Cutting the ribbon recently at Capital City Bank in Keystone Heights: Doug Reddish, Katheirine Parks, Kim Oxley, Janel Triest, Sam Midgett, Jeff Oody and Melissa Griffin. CHAMBER OF COMMERCE Chamber can help find employees, Li Fl.riWa\Vork, andJ"le" North Florida Regional Chamber of Commerce help sou find your next employee. Our professionally iruincd staft can assist \our company wLith advertising positiins. pre-screening applicants, col- lecting applications, recruit- ment and assess'menls to include: typing tesi, TABE. career scope and skills check to determine MS Word and Excel proficiency. There.are no fees for these ser. ices, so call Susan or Pam and let us assist you. (90-1) 964- WORK. Care of siness MAIN OFFICE Lake Butler 100 E. Call St., Starke 904-964-5278' Keystone Heights Melrose I 1 EfMARK YOUI >CALENDAR 4 A/ |MEETING BRADFORD TOURIST SI BEST PLACES TO WORK AWARDS DINT Thursday, Oct. 26 6-9 p.m. Conference Center STARKE When: Time: Where: NJER I I , I ~L _I 4t I Gary Parrish, 42, of Melrose-' was arrested Oct. 6 by Clay:' deputies for DWLS. Parrisih was in\olhed in an accident with injuries near the Lil . Champ Gizmo at 7:30 p.m. 'K Larry Watson Tew, 53, of Lawtey was arrested Oct. 5 by Starke Sgt. M.D. Watson for DWLS. A $500 surety bond was posted for his release. Kevin John Ogburn, 31, of-. Lake Butler was arrested Oct. 5"-K by Union Deputy Brett Handle for DWLS. Harvey Sluder, 47, of_- Hilliard was arrested Oct. 4 by- Sgt. Gibson for DWLS. He was released after a $15,000 surety bond was posted. Aquarious Jefferson, 36, ofL Middleburg was arrested Oct. 82 by Patrolman- Lowery for DWLS. Jefferson was releasecd- after a $500 surety bond was posted. . Albert Jackson, 35, of Lake- Butler was arrested Oct. 9 by Deputy Moore for DWLS-: habitual. Bryan Gentry, 48, of Lake Butler "as arrested Oct. 8 by.,- Florida Highway Patrol -. troopers in Clay County fofW DWLS. Walter. Jewell, 22,; of lMiddleburg was arrested Oct. 9, by Patrolman Hooper for DWLS from Clay. Teddy Blevins. 18, of Keystone Heights was arrested- Oct. 7 by Deputy Moore for failure to appear no valid driver's license and failure to appear violation of probation DWLS from Putnam County. Bond was set at $5.000. I Oc- r-LEGRAHM, tfMES & MOi'I OR--B-SECTION Page 9B h n e o a money1 rak-e. -A L e t CLASS Continued from at any of those levels job, but. the salary w be' less than $14 per hour. However, a student could work at one of the lesser levels while p. 2B attending class and working toward one of the higher and get a levels. vill likely The total course takes 1,200 hours, or about two, years to complete. Calvin Lane is an adult student in the class, He is, in his. first year of the class, He works at a local restaurant at night and attends the class in the daytime. "He's looking to move up the pay scale and improve his earnings," said Beville. Students in the class, both adults and teenagers, learn how to operate a %ariet) of building equipment and tools, how to plan a project and figure out how much material will be needed, safety measures and much more. Reading and using blueprints, measuring accurately and learning how to determine the proper tools and materials for each job are also taught in the class. In order to be eligible to enter the course, students must pass the Test of Adult Basic Education (TABE) and score , out at the ninth-grade level on reading, language and math. The class is very hands-on. Students are currently working on a project to build information kiosks for Pumpkin Hill State Park. The kiosks have to be %weather- resistant and sturdy. They also have to provide the ability for park rangers to change the information offered from time to time. The class has planned a design and is now building the kiosks. Individual students also have additional projects theN are working on. One is building bat habitats. Last Near, the class built a mini one-room house %with a shingle roof so that theN could practice the various carpentry skills needed for building larger projects. Beville said another project is being planned for this year, but said he has not settled on the exact plans to use. The class is also building sturdy picnic tables to sell as a fund-raiser for $200 each. The money raised w ill be used for special class projects. Call (904) 966-676-1 for more- information about the tables or the class. Chad Burchfield (left) holds a spacer that will help maintain the proper distances as Tyler Moore uses a hydraulic nail gun. Chris Knowles (left) holds a piece of lumber in place while Tyler Moore (right) drills a hole to hold a bolt. OOKI ES' Continued from p. 3B dagram of their cookies. They. ten measured the distance frbm the edge of their cookies t4 two raisins. I'-What you're doing is ypu're documenting where veur artifacts were found,"' Tlnsler said. 'Then it was time to dig, but stlents were warned to be as careful as possible. "Try not to break your cookie," Tinsler said. "Once you've destroyed your archaeological site in the real %world, it's gone." The' students seemed to enjoy the exercise, but they were disappointed that they could not eat the cookies when they were done. As Tinsler pointed out, he touched the cookies and the instruments the students were using were not sterile. Oh well. That's the way the cookie crumbles. Jon Leonard makes measurements before putting on his safety . glasses in' order to use . a saw. Bradford County PONY CLUB S has arrived! Call for information. EUPHORIA STABLES - BOARDING TRAINING LEASING ,.,/ *FL PERI66845-TIPS( 8477) PAID FOR BY THE FLORID4A ATTORNEY GENERAL'S OFFICE CRIME STOPPERS TRUST FUND. I jf~n & Pest Control, Inc. I I I Pest Control Services I Licensed & Insured I I Martin Seay, Owner I i 904-964-PEST*904-814-7324 L cE(Q7J7Q -CL J L- _. E---- --- A Full-Service Repair Shop Alignments Exhaust Brakes turn rotors work/mufflers Shocks Pipe bending Struts Duals Tires-balance & rotate, Oil changes Tune-ups Batteries SDiagnostics computers E Certified Mechanics Owner: Richard Manager: Head Me Gina Richard (fort Mecha 3861431 185 12 * Alternators * Starters * Got gasp Barrick chaiic: Kenny Richard merh at Mosley Tire) anic Robert Harvey i70 NE SR-121, Raiford 1 mile S of Raiford P.O. I MileSouh n32ampt Assisted Living's is 45 minutes from Jacksonville; 25 minutes from Gainesville Just 1 mile South on CR 325, Hampton, Florida. "Not A Nursing Home" - No Religious AffiliationI Opeate b SUELTT WLKE (352) 468-2619 (L-R) Chad Burchfield pushes a pie6e of lumber through the table saw while instructor Mike Beville helps guide it. Chris Knowles and Tyler Moore catch the piece as it exits the saw. 7 '-lx np Ir s61 I r. I I ! / 4 : -Page lOB TELEGRAPH, TIMES & luNITOn-o-cU i dH i, z006 V. ~ -, sCouNTR.,. I,' ,- ,*. -i ' , Av k E I ll WI Iju; I 11 ,pr '1 I,'P N I .,I 4Nin'iJ II I 1442 II mm - i1 II iN ',a,.-",' '.,,w ,,,,' '** ... , ;; :,., ... . Il I 'IMlIM :HI El ~II 1111 U I Iki ii. / A l~.II WEEKLY DRAWING FOR I I' 1 1 '" II' Ir A~IA'Ill I Iri REGISTER AT STORE OR ON-LINE AT uSs& ounB FOR, .jf Let an answer your Internet questions. WINNER WILL BE ANNOUNCED MONDAY AT 12 NOON *Must be 18 or older to win. *Town and Country Ford will pay half your payments for the first 3 monthly payments with approved credit on any new or used vehicle purchased from Town and Country Ford during this event. **$35.00 down plus tax, title, and $375.00 dealer fee with approved credit. **w.a.c. with FMCC on select new Ford models. ****Half nric.e navment sale not nood with anv other offers or discounts OWN & COUNTRY FORD CREDIT RE-ESTABLISHING SUPER STORE NO HASSLE ,NO IN THE COMFORT OF YOUR OWN HOME TOLL FREE OPEN 24 HOURS 1-8 ~~XiX~ / I II~ , . I Im ' IUIII TOLL FREE ),224-2413 acrrfi 11 IN mmlmrk~e ~a~a~ WHEN. I- -- 11 ,1 --AI, 7 i' ..! = :" .." -1 Persona OPEN MOND, Susan Fitz-William N ARNP NO... Not here in Paris Look...' Dr. Natalia IMMEDIA p. ... ,. .. r CARE CENTER OF STARKE li Family Healthcare AY thru FRIDAY 8:30 AM to 5:30 PM i'ilt !t'l x t.... ,,.ll ''il "l i''i"iK"' i latalia Shiriaeva MD Charles Franson D.O. David D.C. u* Wor Ii Ias .. , OWN^L affni *^ - Dr. Natalia NO... Not in Moscow either She's Rght Here!! Dr. Natalia... Pain Management Specialist and imary Care Medicine ediate Care Center of Starke Specialist ^^^Referral^^ TE CARE CENTERS STARKE 34$ W. Madison St.' (904) 964-5455 KEYSTONE HGTS 100 S. Lawrence Blvd. (352) 473-9373 2 Locations to better serve you! IExperienced Physicians -7M- I~~ Oct. 12, 2008 TELEGRAPH, TIMES & MONITOR-D-SECTION Page 2D Churches play an important role in history Ne' Rittr Baptisl is oldest church in Bradford Countyv There are about 100 churches in Bradford County today, but the New River Baptist Church is the oldest, dating back to the days of the Seminole Indian Wars..Bradford County did not exist when the New River church was founded on July 17, 1833. A group of 14 pioneer settlers got together on that day and unanimously agreed to form themselves "into a constituted body near New River, independent of any church or churches, presbytery, or synod." The group petitioned Pigeon Creek Church, which had been established in 1821 in Nassau County, for "letters of dismission" so the New River group could form a new church congregatioti. Members of this original founding group included Isaac Carter, Thomas Prevatt, Levy Pullum, Sarah Prevatt, Kisiah Jones, Margret Ann Carter, Mary Tucker' and Elizabeth Prevatt. John Tucker, Fleming Bates and Paul B. Colson were listed as 'members of the first "presbytery." Tucker was also the first pastor. w Indians still held sway over the entire region when the New River church was founded. Minutes from a church meeting held in 1835 said, "The church and congregation were thrown into confusion at Indian alarm and meeting broke up." The rites of communion and "foot washing" were postponed until February 1836. At the time, when an "Indian alarm"' was raised by ringing bells or firing warning shots at the sight of a raiding party in the area, sellers often packed up their. entire families and camped in the vicinity of one-of the many forts which dolted the, Florida -interior. They would d remain camped near the fort for se eriil days,' or even longer, until it was deemed safe to return to their homes. Churches in those early days usually did not meet e\ ery Sunday. One preacher usually had a "circuit'" consisting of several churches where he -held services on a roialional basis. With no lawk enforcement in'the area. it was the church congregation that exercised punishment for w wrongdoing. The church was judge and jury and the minutes throughout this time rct'lect ihe judgments 'that xere handed down. In New River's minutes from the 1830s and 1840s can be found notations like, "Sister Snowden up for dishonesty, but exonerated... Buril Jones up for falsehood and excluded... Elizabeth Townsend excluded for dancing..." :Being "excluded" was the same as being shunned. No one would have anything to do with the miscreant until' such time as the congregation deemed the person had been sufficiently humbled. One enlrv in" the minutes read "a certain William Jeffries, who called himself a Baptist preacher, was proved by Brother McDonald to have acted dishonestly in a horse-swapping deal." Jeffries defended himself in the hearing by invoking "caveat emptor" (let the buyer beware) and "claiming it was not dishonest to swap a blind horse to a man if said man had examined the horse and had not found him to be blind." The minutes of the New River Baptist Church say that Pastor Tucker was "missionary" for the Home Board of New York for all of Florida and received a salary of'$200 per year. He %was described as being "rough when occasion demanded it" and was know n in the area as "the sledgehammer preacher." On Irips around his circuit, he sometimes had to travel at nighl. He was olien shot al b\ Indians and it was said he carried the marks of their bullets in his body to the grave. He was also said io ha\e "funeralized" more people killed bN Indians than any other preacher in Florida. Starke First United Melhodist The'First Meihodi.,t Church founded in Starke in 1863 is believed to he the oldesi church in Ihe cil\. It began when a group ot people met in a one-room log building on Church Sircel near the present location of the St. Mark's Episcopal Church. The site for the church was donated to the congregation by Capt. John C. Richard, a prominent local merchant and a former officer in the Civil War. The building was the only church building in the entire town at the time and was also used bvy other congregations for their meetings. In 1886 the Methodists moed to another location on Palmello Street in the north section of,Slarkej.,Simon J. cmple, an early hfumber man. donaie3 the properly) and the I.umber iur'lhi, building. lt was later moved to a new location at the corner of Walnut and Jefferson streets. The present church, built in 1950-51 still stands in this location. A new fellowship hall was constructed in 1978 after the church purchased a lot north of its 1950 site. This fellowship hall continues to be a meeting place for local civic organizations. A number of renovation projects have been carried out at the ,church since it was first buill, including refurbishing the sanctuary and Ihe cupola under the spire, adding new decorative. solid wood doors and laying out a memory garden in one courtyard area. Starke First Baplist Church The second oldest church in the cil\ is the Starke First Baptist. It was founded when a group of citizens mel 10 establish --a fellowship with one accord in one place." The result was a Baptist group with 14 members: George W. Adams, Sarah L. Adams, Re%. S.S. Brom n. Rachel Brow. n. Robert Keith, Mrs. E.A. Keith, J.F. Tallialerro. Anna M. Talliaferro, Robert Talliaferro. W.R." Glisson, RacheI GlI,,-,n. Mrs. S.G.. Sanders, Joseph Thomas and Mary, Thomas. The first ser' ices -,wer held in a public school building locacied where hlic. Starke \\Women's Club now islands. lJudge . Keith, a rciired Baplisi minmNer liing in Starke. served as supplN patlor. On Jan. 6, 1870, a deed tor Ihe initial plo tit land at the churches current sie was recorded from James D. Jones.and his wife, All), to the deacons of the "First Baptist." A building fund was started and in 1884 plans for a building 'were drawn by George Thomas, a northern architect who had come to Starke! to visit his father, one ot the deacons of Ihe church.. Thomas also super\ isd con.slruelion of Ihe w while Irame building w hlich t:r\ ed as" 'the church's first pernianinl home. II was dedicated in July of 1884. . The church grew steadily and in 1944 a building dri\c w.as sliared for a larger building to accommodate the church's growing membership. The first service was held in this new church auditorium on Feb. 12, 1950. Several expansion and renovation projects have been carried out over the ensuing years, so that the church is now exclusively red brick with a large education building and office space in 'addition to the sanctuary. The largest a gin, but it was moved to the Church" Street site and became the meeting hall for the congregation. Richard also late donated some additional property.which A : adjoined the church propcrly donated by. When the Big Freeze killed the orange groves, the entire area had to work Si through an economic disaster. The town ,Urlq of Fairbanks'(now a residential area O.l i becctween Wald )and Gainesville) ne rly at d became a ghost, town and could nc r ou longer support its Epi opal Church. When the church building fell inte disuse, the wealthy founder (itIhe toWn (whose family name was Fairbanks, oi, Scoursec) ga\e the Fairbanks building tc the Starke congregation. William Kalch, a carpenter from- Hampton, took the church apart piece by piece and rebuilt it in Starke for a total fee of $480. Thai building is still in use today, although several additions have been madeovei the years. P Sltarke Presbyterian Church The First Presbyterian, Church. ol Starke celebrated its 1001)th anni\ersar --ain October of i 1984. It owmes itl beginnings to a small group of raell-to- do northern families att came here in [ he 1880s seeking a armtr climate anc. an opportunity to invest in orange grove -- i-- and other activities. They met on Dec. F-2 i 15, 1884, to organize a Presbyterian group since there,was none in Starke at ..the.time, . Three members of the group, head. project was the construction of a new by. J.M. Truby. donated property neai and larger sanciluari ta which was ju.t their hdmes on North Cherry Street as a compleicd recently. site for the nea church..Work began Starke Firsti Chrisian Church immediately y and before the end of thc The third congregation to be organized, year, the "carpenter gothic styled in Starke %as that of the Firs, Christian church S\as completed using the fines Church. I \as chatered in 18. but had long-leaf ellovw pine lumber. ThE held ser ices, prior t ihut time. Professor interior" woodUork was all done by hand. G.P. young a teacher, and his brother In July of 1978 the historic structure organized a 'School in Starke called was mounted on a "cradle" and move Orange College. Th.ey alko brought a to its present location on East Call Streel group together to found the First so that an expansion project could be Christian Church. The group met in the completed. An additIon provided needed building used as the school. When the room for a groI rsing congregai mn. building late hburnd. he congregation Hope Baptist Church built a new one on West Call Street in Hope Baptist Church in the 1887. Sevcr:,l Ncars lIl'r lhi group built community of Theressa \%as organized a- building tin the si ne of the present tin Jan. 15. 1876. in a pre-sb!iery called church on the cirn:r of Call and together bi Elder L.W. Kicklighler anc Christian strccts. A new sanctuary was Silas Weeks. The organizational meeting also completed recently by this %%as held in the log house belonging tc congregation. ,Mr. and Mrs. John Philips. The 'St. Mark's Episcopal Churchi congregation continued to meet there While the first mention it a Starke until a new church was built.about 1( Episcopal Church was found in the years later on property donated by tht Diocesan Journal in 1890, it-is likely that same family. Kicklighter came to ih " a group of people had been meeting in Kingsley Lake area from Georgia ir Starke as an Episcopalian congregation 1893. He joined the Baptist faith there ir foir several years by that time. Stake had 1870 and was ordained 'iin 1871. H been a ..priachine siz'iiin." served hb sered 27 different churches in Bradfore %. ip i I i n gpyje yFi ve -ra ,to-,iand he dining counties, d.ripg-.his ;Imili,1, had bitgjn 'meeting in-pri aile It.nure. He as also.a member,Q- the- -homes~'In'the'--l6i) aind la'er-hqb.n ImII Beadl'rd Cobniv School BoardT''i"a menl in the tup.slairs rottn ,it a building number tiol years and s*ried in thb statt near the railroad tracks. In May II- legislature as a member 'from Clay. the congregation, had no name and County. consisted of 10 families totaling about 40 In the early days, services were held people. By May 1981 the congregation one weekend each month, beginning.or had officially been named St. Mark's. In Saturday and lasting through Sunday. Nq 1891, the Diocesc acquired the church's evening services were held on Sunday, present site on Church Street :from because the pastor was a circuitj George E. Pace, a local store owner. preacher" who served several towns anq Pace and his partner, Capt. John C. would have to leave Hope Baptist t' Richard donated a frame building to the return home by horse and buggy. congregation. It had served as a cotton Classified Ads "4' ~./'\I~ ~ Read our Classifieds on the World Wide Web Where one call I does it all! 964-6305 473-2210 '496-2261 Tri-County Classifieds Bradford Union Clay Reach over 20,500 O Readers Every Week! INDEX 40 Notice 41. Vehicle Parts & Accessories 42 Motor Vehicles 43 RV's & Campers 44 Boats 45 Land for Sale 46 Real Estate Out of Area 47 Commercial Property Rent, Lease, Sale 48 Homes or Sale 49 Mobile Homes for Sale 50 For Rent 4F USE YOUR PHONE 964-6305 473-2210 496-2261 N 0 T.I C E Oi ,^fid Ad- -tirsld ao d ula -J.1 hu 6,mdy -n blikd w th0. ( p A S W3 W0 p, c t will b "dd o ll billion lo over p .(e ,nd hndlni. All id piced by pho.. a. d te k I t he dvcni-. .I 11 lim of pl.c1 1-ow-ver. Ih l duafied -tff n= hld rep, on.,ible f., m k in tmifi, d dvetlm ken by ph Th newspaper Iht ih lo co tly cwi:y and dit all py o l or ancel any adverteignt atany tere Only wwwBCTelegraph.,com- a FORDco Since 1879 131 West Call Street Starke, Forida32091l 904-964-6305 Fax: 904-964-8628 editor@bctelegraph.com. Call 386-496-1215 before 9 pin please lion or dscrimnaiion. FOR SALE Get ready for Hunting Season! I have several used Cobra 29 CB Radios for sale that arc priced riglit. Have a few antennas, coax, other Iisc. items. 386-496-1215 before 9 p/t please For Sale 1999 Grand Manor DWMH Fully Furnished, 4 BR/2 BA Living rm, Family rm w/Fireplace, Dining rm, Large Kitchen, Utility rm, Front & Back Decks Lot 100'x 100' For additional in 66;1 904-964-7488 or 90 164-600OO unity basis Tc complain Sol discrimination, cdll HUD toll-free at 1-800- 669-9777, the toll-free telephone number for the hearing impaired is 1- 800-927-9275. For fur- ther information call Florida Commissionr $8.00 for the first 20 words, then 20 cents per word thereafter. 41 Auctions B & F AUCTION Will open Oct. 5th, 2006. Every- body is welcome. Vendor spots will be for bid. All 153/AB1542. 6551 NW CR 225. ABSOLUTE AUCTION - Highest Bidders Buyl Beautiful lake lot on Hampton Lake, old coins, stamps, collec- tions, fine English Bone China, furniture and much more. Saturday, October 14, 2006 at 10am. Between Gainesville and Starke, 1 mile West of Hwy 301 on CR18. Ben Campen Auctioneers, www. Campe5Auctions.com. 352-375-4152, AU#201, AB#2118. 10% Buyers Premium. 42 Motor Vehicles 1988 DODGE DAKOTA, $975. MAZ;A B2300, 5sp, cold ac, dings, runs qooa. now reduced to 11500. '94 4X4 GMC YUKON - 5SPP TRANS, 5.7L 350; A/C, cruise, seats 5. Rear seat folds down flat. Tom, 904-964-7285 or cell 352-262-0762.. MOTORCYCLE 2006 SUZUKI BOULEVARD C50, like new. Asking $5995, excellent condi- tion. Call 904-964-5019. Must sell or trade due to health reasons. '43 RV's and Campers 30' REVCON MOTOR HOME in Starke, $4,000 or trade for 20' class C motor home. Call 352- 327-2753. 45 Land for Sale 2.5 ACRES CLEARED with new driveway on N.W. 180th Street in Starke. $57,900. Call 904-964- 6708 leave message. 47 Commercial Property Rent, Lease, Sale 1/3 ACRE LOT mostly level, on a paved road, 5 minutes from downtown Keystone Heights. Ask- ing $22,000; owner fi- nancing possible with $5,000 down, wac. Call 904-553-3301. FOR LEASE OR sale. Ideal location 2 parcels! 2800 SQFT building with of- fice, barn, mini storage, 5 acres, off of South 301. Also 8 acres, partially cleared. Both lots 3/10th of a mile from new *Walmart. Call 904-964- 382". 48 Homes for Sale MORTGAGES TAILORED TO YOUR NEEDS. First, time home buyer, no." money down, refi-: nanced. Slow credit,' bankruptcy ok. Call for approval, 904-742-2942.: BRADFORD COUNTY 11, . ACRES. New home with" 3/2. Contractor special,.. custom throughout,;. metal roof, granite.- counters, safe room.. Beautiful property with- stocked pond. Very pri< vate. $390,000. Serious- inquiries only, 904-964-,. 7002. 7145 KING ST, KEY-.. STONE. 4/2.5,2400 SF,' tri-level. Lake Brooklynh home. New windows,.: roof, siding, decks and. more. $289K. View att gatorfsbo.com/60901 Call 352-473-8847. 6522 TREIST AVE, KEY-. STONE, on large lot;" guaranteed financing.- iqrV/2BA, garage, 1500. -"me, like new. Rent I ol 11 Page 3D TELEGRAPH, TIMES & MONITOR-D-SECTION Oct. 12, 2008 Classified Ads - l~k~SI, Read our Classifieds on the World Wide Web - Whr one cal M Where one call does it a/l! 964-6305 473-2210 *496-2261 Sor rent to own, 5K mini- mum down. $189K, $1,100 per month. Call 904-276-6446. GENIEVA LAKE ESTATES -' between Keystone and Melrose on paved street. 3BR/2BA, 1837 sq ft. Just remodeled, includes fans, appliances, 'hed, :screened porch, 2 "car garage, $199,900. Day 352-475-1800 or eve- nings 352-475-6255. 49 Mobile Homes for Sale BILLIARD/ NEW Jacobsen: 32 x 48: 3BR/2BA, set up on 2 acres with well, sep- ..tic & power pole in- bluded, $734 per month. Call 1-888-546-4707 or 1-904-424-7345. - NEWJACOBSEN 3AND 4 'BR HOMES on our land, or yours with little or no money down, easy quali- -tying loans. Call 1-888- 546-4707 or 904,-424- 7345. 1983 MH1BR/1BA14X52 .on lot in Highridge Es- tates, Keystone Heights. S$28,000, call 904-966- S0765. SPECIAL FINANCE PRO. GRAM Guaranteed ap- Sprovals: Call Bruce at 904-259-0945. COUNTRY LOTS, 1-3 acres Mobile homes & complete package. We finance. Call Bruce 904. 259-0945 LAND HOME PACKAGE - SNew 1560 sq h, 4/2 on , 1/2 acre in Baker County, $110,000. Call 904.259- ' 8 0 2 8 : .' BAKER COUNTY 1 1/2 Solos. North Macclenny on ; St. Marys River Well. Sseptic, power pole $60,000 Call 904-259. 8028 50 For Rent 6522 TREIST AVE, KEY- STONE, on large lot, guaranteed financing. 3BR/2BA, garage, 1500 sqft.home, like new. Rent or rent to own, 5K mini- mum down.' $189K, $1,100 per month. Call 904-276-6446. FURNISHED ROOMS FOR RENT! COM- PLETE with CH/A, cable provided, all utilities paid! Central' location. 10% cOscouni r on lIrsi m..nins reni lor serinor cilzeris Rooms war pnrivale oam. $110 -$120./wk. Room without bath, $95. Laun- dry. facilities available. Close to, churches, stores, downtown shop- ping, theatre, and more! See Manager at the Magnolia Hotel across Irom ihe Slarke Post Of-' fice. 904-964-4303. WE HAVE 2OR 3 bedroom MH. clean close lo prison. Call 352-468- 1323. SOUTHERN VILLAS OF Starke Apts. 2BR HC & non HC apartments. Central ac/heat, on site laundry, playground, pri-' vate and quiet atmo- sphere. Located on SR16 1001 Souitern Villas Drive. Stai e. FI or call 904-9-64 7295. TDD, I BUY HOUSES CASH! Stop Foreclosure Double Payments No' Commission/Fees 352-692-4963 SABBOT HOME IMPROVEMENT CO. j ~ Handy Man ~ Carpentry Painting i Plumbing Drywall and more! Call David 352-473-9075 Cell 904-769-2627 Bill ,t I,, caii aiid .lcl. Pic , Phone: 904-964-7399 Cell: 904-591-9377 or 904-219-4648 308S. SE 113"1 Way Starke, FL 32091 "' i wenLi & lncijred BANANA BAY LANDSCAPE INC. Specializing.in PALMS and TROPICAL Residential ~ Commercial landscape with Sophistication & Attitude ady owned & operated by Charlie Revay 352-214-1320 352-475-2885 T.H.E. Apartments 922 E. Brownlee St.* Starke, Florida Newly Remodeled 2 & 3 Bedrooms Available Rent is based on Income ,Water, Sewer On-Site Lhundry Facility & Play Areas Office Open: Monday Friday 8:00 to'4:30 |1 Call (904) 964-7133 Voice TTY Access 1-800-545 1833. Ext 381 WANTED' Small or Large Parcels With or Without SHomes Call Glen Lourcey S352-485-1818 CALL TODAY! 904-964-4000 866-964-4207 1107 S. Walnut St Starke, Florida (Locatedi Behind riadord " County Eyes Cenreri II MORTGAGE BANKERS ASSOCIATION Inms.. ni om I Jenny W. Mann ranch Managier' Mortg.i>r., Constltanit TTY 711. Equal Housing Opportunity. 4- SPECIAL-RENT 2 & 3BR homes, newly renovated. Deposit required. No pets. First month free. Call' 678-438-6828 or 678-438-2865, for more information. 2BR/1BA FOR RENT, CH/ A, $550 per month, good, condition, no pets, first & last plus deposit, lease. Call 904-964-4111, leave message. WORT-H I N G TON SPRINGS- DOUBLE- WIDE MH 311, heating and air, stove and refrig- erator fur risned Call 386-496-3253 2BR SW in Union County. $600 per month plus a $600 security deposit . Call 904-966-0765 3BR'2BA ON A PRIVATE lot paved road, CH,,A,' $650 per month., irsi, last and $350 security de- posil References re- quired and $25 applica- lion fee Pels okay Call 904.553-3301. BEAUTIFUL 2BR tBAApt 1000 sq It. nardwood Iloors, screened porch. refrigerator, electric range, washer/dryer FOR SALE 2 Parcels 13f Acres in all 500 ft frontage on 301 South Only 3110 mile from Super Walmart. Office 2800 sq ft Building Mini-storage and Barn *Ideal Location* Call (904) 964.3827 ROOMS FOR RENT Economy Inn Lawtey, FL Daily $35 & up Wkly $169 & up Daily Rm Service Microwave Cable Refrigerator Local Phone (904) 782-3332 hookups. In Starke, close. to schools. $550 per month, first, last, security deposit, and references required. No pets. Call 904-966-1334. LAKE SANTA FE COT- TAGE 2/1 washer/ dryer, furnished or unfur- nished, sandy beach. Lawn service included. $950/mth, call 352-468- 2386.' ROOMMATE WANTED TO SHARE HOUSE Starke area 2 looms available, $400/mln negolia. 'ie and partial utilities. First month's rent plus de- posit Small:pet .wel- come. Call 904 769- 3529. . MOBILE HOME FOR RENT 2/1, RAIFORD. $400 mih Cail386-.431- 1197 TRAILER RENTAL 2/2. SINGLEWIDE SE Wil- son Rd Very clean $600/min, $600/security - deposit References re- qurea,. no pets Call 904-964-8425, leave message We ~mCart it Management, Inc. Call 352-473-1025. MELROSE 3/2 GARAGE, FIREPLACE, tile, appli- ances, washer/dryer, large fenced back yard. ,Water and lawn service. provided, $950/mth. Call 352-475-9609. 3/2 DWMH RECENTLY REMODELED. Central heat air. washer, dryer on private lot and pavea road. $650/mth, $650/ security. Call 904-553- 3301. 51 Lost/Found LOST DOG .- REWARD. Female black Chow mix win wnile chestI, short na.r Answers to Mindy. Lost 10/6 around Spnng Lake Animal Hospital. Purple collar with rabies tags. Skilttish around people, but oinerwise very inendly. Family pet. very missed Call 352- 478-2100 52 Animals & Pets OPEN 24/7 .i ,i Bltdv Bloh l.er 19563NWe.SR 16 Starke. FL We Haul Redi-Mixed Concrete in our 1-Yard Mixing Trailer from ^ 1 4 our plant to your redi-forms. S$149 per yd + tax... deliveredto vou! I :I -N.iid = 0 sq. It. .11 4" deep LEWIS WALKER ROOFING INC. "AFFORDABLE QUALITY" ROOF RE-ROOFS METAL SINGLES FLAT ROOF LOW SLOPED GRAVEL *FHI BEST PO'SIIll I PO Box 82 Ft. White, FL 32038 FREE REPAIRS EXTENDED MOBILE HOMES WARRANTY NEW ROOFS LICENSED TILE WOOD SHINGLES & MAINTENANCE INSURED STORM DAMAGE ROOF \f ,HE ir- PrO'(.SIILL PRICE" Office: 386-497-1419 Toll Free 1-866-9LW-ROOF Fax: 386-497-1452 "FOR EXPERT WATER WELL SERVICE" 3601 S.E. 35th Avenue Gainesville FL 32641 (352) 378-1910 ', ,,.,I.I I',I ( ,, II | I.* J i ,,,,, S ..1r i l ;I IUGrr.. -Lowest*Bids! I I-I. 2/1 HOME, EXTRA CLEAN, CH/A. $500/ mth, in Theressa. Call 352-473-3073 or 352- 745-4039. SMALL BUT NICE trailer in country, very clean, 2BR/ 1BA, A/C, mini blinds,' wood deck. SE 49th Ave, Starke. $375/mth plus deposit. Call 352- 468-1093 or cell 9Q4- 571-6561. MOBILE HOME 2/2 OFF S301,.HAMPTON AREA $500/mth, first ano last Call 352-473-8981.: BRAND. NEW HOME NEAR HOSPITAL 109 Parker SI. Starte. FL 3.' 2/2. 1500 sq II $950/ min Call904.317-.4511. NEATLY NESTLED LOCA- TION: Weil-kept Sdoublewide mobile nome 3BR. galley KiIchen,. replace Must , see! Keystone Heighis No pels $800.,mth, first monlh rent, lasi monin rent, $500/securnty de. posit. 1 year lease, credit report and reference re- quired Carroll Rentals & Smith & Smith Realty HOMETOWN "Where You Come First" Homes 3/2 Home on 1 acre lot. 1 block from Country Club. $214,000 3/2 1200 SF frame home on SR16, just outside city limits. $75,000 3/2 home built in 1999. Like new condition on over an acre. Bayless Hwy. $219,000, 3/2 home on 5 acres. Lots of extras. $345,000 Land 1 Acre Dead end street. Zoned for mobile homes $29,000 Union County 6 Acres with 24 x 60. barr,14 horse stalls. Can be divided. $149,000 5 Acres near Providence. Union county. Fenced for horses. $95,000 25 Acres. 5 Minutes'from town. $250,000 ww.Hmlonirs el Io 90-94-33 /Fa : 0496 -77 Ce E Refinance & Purchases ge -FHA- VA ~ Conventional New Construction Home Equity Loans ~ No Income Verification Loans w^ ... Suzanne Gordon MoI lgage Cornslthant RESIDENTIAL REAL ESTATE (904) 964-9222 BUSINESS (904) (904) Commercial Lot 1/2 ac.I Adjacent to Courthouse Georgia St. -AMPTON $67fT0J0 Nesiaential Acreage 49.87 ac. Wooded Fronts CR 18.&SE 49th Ave. Residential Acreage 3.73 ac. Wooded SE 49th Avenue Sheila Daugherty Realtor STARE I AMPTN HAPTON SdeTARK Acreage Street -iANIS S Residential Residential 3/2 Frame 3/2 Acreage Acreage House Frame 6.08 ac. 10 ac. 1276 sq. ft. House Wooded Wooded Great 1200 sq. ft. County Rd S.E. Starter or Move-In 18 49th Investment Lafayette I 'Avenue Lafa ett St. Street 1r Each Office is independently Owned and Operated. .0nShr - itle & Escrow "A Full Service Title Company" * Title insurance * Title searches * Over 13 years in the title industry * Real estate closings - purchases, refinances ~ cash transactions ~ loan packages AS OWr priorityf Larny aKelly Office Manager Jan Jackson 107-F Edwards Rd., Starke, FL (904) 964 -2363 ARCHERY BOWS PSE NOVA. Never shot, $180. Bear white-tail 2, has case, sites, detach- able quiver and arrows $150. Call 904-966- 0631 FRIDAY AND SATURDAY - SW CR225 off CR227, 1 mile down on right. 5pc living room set, din- ,irig room set, 2 TV's, treadmill and exercise bike and many other items. FRIDAYAND SATURDAY, 9AM-2PM. Lots of differ- ent things. Country Club area, follow pink signs. TREE SALE T-ULIP POPULAR, Red Maple, Peach and Apple, Corkscrew, Weeping anaoPu-i W.,I. Iows $t12 each ,or more "10 each.:r Ca 904-796-0118: 2 FAMILIES LARGEAS- SORTMEfT Saturday, October 14, 8am-5pm and Sunday, October 15, CHIHUAHUAS -2 MALES, 2 FEMALES. Parents on premises, $200 each. Call 352-473-3709. PURE BRED BOXER PUPPIES FOR SALE - Fawn and while. $350 Call 904-964 6335 GOLDEN RETREIVER PUPPIES, $300. Call 352-258-3040. 53A Yard Sales American SDream RENTALS 311 Large Apt $525 mth 1 Bdm Apts $350 mth 312 Large House $850 mth 412 Lake Front Fish & Ski $1,250 mth Large House 2 bdrms $1,200 mth (904) 964-7227 American SDream of Northeast Florida,Inc. R EA L TOF- RS@ 205 N. Temple Ave. Starke [(904)964-5424 HUGE OPEN HOUSE EXTRAVAGANZA This Saturday, Oct. 14, 10 a.m.-2 p.m. 10 houses to see. Refreshments, free gift, prizes. Come by the office to pick up your map. ViSA 904-964-8111 TOLL FREE 866-964-8111 S105 Edwards Rd., Starke w w?.TrinilMorlgaL.FL.(um 964-6708 DAYTIME 964-7802 EVENING "Come &tra!Yj 6[o tt~e Sourt .1VA N II();E NM U;R"'CAGE V-O A Division of Central Pacific Mortga , / A . 3 L ' -;r r' 'a :I .-; --I--- ---; -~ I'I1C r'l I HERITAGE VILLAS APARTMENTS Bedrooms 607 Bradford CI. Starke. FL For more info call 964-6216 6% TDD# 1-800-840-2408 LIF I ---- `~~""~ mim I ., I, r -1 rma "m an --- --- -- - khow. I ,1., ,,, ,, 1l.l f- Oct. '2, ZU08 TELEGRAPH, TIMES & :NITOR--D- '*u Classified Ad Read our Classifieds on the s World Wide Web I'. Where one call does it all! 964-6305 473-2210 .496-2261 8am-5pm. 1502 Dodd St, Starke. From 301, Weston 16, left on Gene Straight on Dodd St. MULTI FAMILY YARD SALE SATURDAY, 8am-4pm, Griffis Loop. Name brand clothes, shoes, ,novelties, kitchenware, movies, DVD's, plants and more. YARD ,SALE FRIDAY, -8AM-3PM. 230 E, left on '17th (Flume Rd), right on 161st. Size 0 and 1 de- signer jeans, rainbow, vacuum, much more. 3 BOWL SS SINK 6X2'. SPots, pans, small appli- ances, electric heaters, misc.-hand and power tools, tables, small furni- ture, wicker cabinet, ;large mirror, gun cabinet,' 6' display case, white truck topper 5'x6'x3". Lots of stuff Friday and Saturday, 8aan-3pm. Hwy 16W to NW 211th St. Go one mile to sign. BIG YARD SALE GAS RANGE, CONSOLE TV. rocking chairs, old but- tons, lots of this and that. Follow SR16 East to SR225, turn left, go about 2 miles to 219th St, turn right, about one mide 9079NW219mnSt BIG YARD SALE FRI- DAY, OCTOBER 15TH, 8am-? Go 5 miles on 16W to 216th St tCrawlord Rd,'tumrn on 2161n SI, one-mile on" ri g h t. -- "' - 53B Keystone Yard Sales ESTATE SALE 4426 Lorn 093rentuy' *Preswa-el'asihrg *OdJotas *YardWork !Gardtten Roto-lffltir - Lkwsmua& Inmnled Loop, off Trawick, off of 315C. near McRae El- ementary School. Oct 13.14. and 15 8am til? Household items, an- uiques. 6 acres, DWMH, secluded, mostly woods. SAT 8AMTIL 2PM. 7.692 Kaibab Ave, in Big Tree Lakes. YARD SALE FRIDAY,. 9AM-4PM AND SATUR- DAY, 9AM-12PM. 280 Berea Ave. SATURDAY, OCTOBER 14, 9AM-? ,221 SW Grove St. Family mov- ing sale. A lot of misc. items. Everything must go YARD SALE ON BROOK- LYN BAY ROAD Furni- ture,, household items and toddler clothing. Saturday, 8am-2pm. SATURDAY, 8AM-1PM. More antiques, more tools, more kilchenware. .os of new stuff I'msrnil unpacking. Come back If you were here stop by if not See what I found in my closets. 6489 Brooklyn Bay Rd. SATURDAY AND SUN- DAY, 8AM "' HeskettLn. Take 214 by White El- ephant, 7.5 miles, follow signs. Lots of items un- der$5. - YARD \ SALE KEY- STONE. Saturday only. Bed frames, mower, crib. lotsosiutff 5630Cnero- kee Sl Big Tree 214, to Monongahela to Cherokee.,. : I BIG SALE FRIDAY AND SATURDAY 6356 CR214S. 9am-3pm LoIs of furniture. 2 sets ol Dunk beds. wedding *Bwush og Nlowing *TheTrbinasing&Remosul *Site~leantp *llaiRanoval *-PhweBaric &pimsMukh "*Famo'nod For Sa- " Free Estinbes Ovner- Kerrn WhitfitrJ HOUSECLEANING e 'w Bl-V / I1-Time Clean ' NEED YOUR HOUSE ORGANIZED? i k. -A ' accessories, books, household items, new gifts. Think Chrirmas! 53C Lake Butler Yard Sales SATURDAY, OCTOBER 14, 8AM-2PM. 1/2 mile down VFW road. THREE FAMILIES: FUR- NITURE, HOUSE- HOLD, clothes (ladies 8-' 10, mens S), etc: Thurs- day, Friday and Satur- day 1 5 mile- SW of, Lake Burier off SR121 on 92nd St, follow signs. 55 Wanted D/S/W/M Disabled Vet, 56 years old. Wanting effi- ciency or cottage for rent for self, under $350. Larry Fore 352-390- 5104, call anytime I BUY, COIN collechons Morgan & Peace silver dollars, silver quarters & dimes, Buffalo nickels, Inadan head pennies, gold coins. prool & mini sets eic Call 904-964- 33211 57 For Sale JIM'S CATFISH FARM ANDU-FISH Open Sal- urday and Sunday, 7am- 7pm Free admission Baby Koi available Lo- cated onn n of Lawley Fill din aiso available Cail 904-782-1694 KENMORE WASHER and dryer, new type $100 and up each. electric stove, wnnen guarantee, delivery available For appointments, call 904- 964-8801 BED KING SIZE Pillowtop manress and Doxspnng with manufac- lureswarranni Brand new'still. MATTRESS TWIN sets $89, full sets $129, Oueen sets $159. King. sets$189 Matress Fac- tory. 441 EasI Brownlee Si Carpels also large . room size pieces Save a lot. Cash and carry.. Call Sonia at 352-473- 7173 or 904-964-3888. BED-QUEEN orthopedic Pillowtop mattress and box Name brand, new in plastic. withn warranty Can deliver Sacrifice $100. Call 352-372- 8588 LAWNMOWERS AND TRAILER, lool boxes and Bed liners Honda moped and golf cart Call 904-964-4118 WASHER AND DRYER, $100 Sola bed. $100 Stand-up freezer, $100. Call Mike at 904-364 7026 7 INCH WET PORTABLE TILE SAW,$60 Elecinc chain saw sharpener. $50. Both new in origi- nal box Electric range. $50 12" JBL sub woof- ers in a box $t00 Brand new ladies size 5 welsuil, $60 Call 386- 878-3240 before 4pm. 1QQQ HARI FYV PORT - STER 1200. Call 904- 964-5257.. RASCAL SCOOTER 600 - Little over 2 years old,, $800 OBO. Cail 904- 964-2220. SALE ON END TABLES, LAMPS, SEWING MA- CHINES and cabinets. Priced to sell atKey- stone Heights Pack Rat, 352-473-2183. BALDWIN ELECTRIC ORGAN, model 56A Two sets of 44-key key- ooards, everything ,works. $450. OBO. Key- stone Heights Pack Rat, 352-473-2183. 59 Personal Services BRADFORD LIMEROCK SALES Limerock. crusn creie. asphalt killings. Duilding sanas. gravels. Iraclor work We haul. we spread Business 904-.782-3172. mobile 904-509-9126 Monday Ihrough Sarur- day DIVORCE/CHILD SUP- PORT! CUSTODY Y FORMS PREPARED $125-$150. We come to you Call904.964-5019 CONCEALED WEAPONS PERMIT, $50 One nour, call 904-964-5019 Classes second Satur- day of the monln. oy ap- pointment Call for res- ervaion. Bruce 'orman's5 rr nation "Good Quality, Good Service, Great Price" _' EDDIE NORMAN irrigation JANIES YONN (904) 61.3-9793 Systems (352) 745-6090, -- ---. & lafid packages. 1-800-284-1144. CUSTOM CUTS Lawn & Landscape, customized ,lawn care, sod, trim- ming, landscape-design. Reasonable rates, free estimates Commerciai & residential Licensed and insured Call 386- 496-2820, if no answer please leave message SECRETARIAL SER- VICES Typesetting, re- sumes, elc Call Melissa al 904-364-6463. CALL REESE BUILDERS FOR ALL YOUR home and business remodel- ing needs Ceramic ile hardwood floors and vi- nyl installation. Call for free estimate, 386-336- 3929. HOUSEKEEPING PLUS - Honest, dependable, hard-worKing, lop to bot- tom house keeping, fall clean up lor yards or put up holiday decorations All at reasonable rales lo boot. Keystone and sur. rounding areas. Call 352-478-4210. R J s Hours: Tues-Fri 10-5:30 Sat 10-3 Cabinets Doors Windows Sinks We Buy & Sell'New & Used Building Materials 352-379-4600 622 S.E. 2nd St.* Gaine,- ille. FL Driveways Sidewalks Slabs Footings, *Decorative Concrete Coaling in many colors Pumping & Finishing FREE ESTIMATES Bus: (904) 964-3827 Mobile: (904) 364-7153 IA) jusj 71Days... 'or Independent Educaiton Out of Area Classifieds Bobby Campbell Roofing, Inc. L licensed & Insured (904) 964-8304 FREE ESTIMATES! Li. #CCC-I.2672 Emnplroment opportunities available. Callfor more information. WE SELL HOMES FOR LESS! WE GIVE Quality.Selection-Service.Stability MORE HOME MORELAND All credit applications accepted! ScotBilt TownHomes General e tay Too 0 VVisit Us Before You Bty! ( Jerry's Quality Homes (352) 473-9005 6969 SR 21 N Keystone Heights, FL Jerry Ted JoAnn p he r ic r I' li, ro vi 1 |i ...... .. , I i r. i I' ic .. 1 cherish , financial v 1 I.. risine aiind I,. 1, "" 0924-. SI1 I N. r (Lperalrpii 18 H..,. ..ii C 'i ii 's e a n d i , iDeveloped I,.. iili.,1i.il, AUCTIION 2.500. Acres 'l'imberland laden &V ,,,, .... (',., ,.;.. N C . 32 'iacus I'iron 2 ito 2i00 acres. 'MerchanIlinble timhcr'; Call 1 iir info. 4i -* 1 763 N i' \i ', 1I(/ buyer's prerliulllr John DixIo & Assoc. Aucliorn- Hisloric Springfield Homes. ()ctober 21. II l:00am. 9th & Main. resial'rant & litheatre. View all properties. h 's I C 11 ,Good Atl:3285 AB-2- 1'.1, I SEI.1.IN(; 182+/- A.'\C RS AND HOME at Auctlion. (SCHI.1I:Y CO. (;A. NOV. 4) Offered ini I' rcels.. I d. 'i v Two Creeks. 'Timber. Pastuire l.nd. Wildlife :and Iquipnmetnil (8I6 1010- 7653 WWV.I.AN32AILICTIO N.COM. AlISO.L.UTE AUCTION. IEstates of C('ades Co've ,,,,, ,, ,, mii iikv' i.,, i .. ,, .,,.1 T N . Satuiirday. October 21. I 0 : 3 0 AM: WWWI'URROW.COM. 1-800-4-I1:LURROW. TN I.ic. 62. pt,, ,, ,. * i, i I ', Ii i 1 11 i. ,,,.I All Si/..es (rea '.l iipill n .'l ( 'caili S ipj'iii,. i'i ancinii A .a1bl he wit i S5 luown. Toim: IS77)843- 8726 AIN ll11()2002-()37. Al.l. CASH CANI)Y ROUTI DI)o \Mi earn S800/daIlv' 31) Machinei . 'rce C ....I \11 fr' 59.995, ').9-996 11B2000()33. CAI.I. US: We wviii 1nol he iillderoild! Help Wanted DATA ENTRY! .'. .., C I 1.. 1.'1 Hour Ir', ...nil .n I piI ..r 1 C ireer I rpt iiii i Serioust ,,y, (, 800)344 EIarn Up ito $550 WEEKLY. Working i'i N I 'pclieinc .l11 .\ or Departnent, SIi Irl'STED IN A 1,'si L IOB Earning S Xv ,r \v Minimtum) 'ay'? Our services can thep you prepare for the Postal Battery Exam Find Out How! Call lToday For More Information'.,. (800)584- 1775 Ref Code #P5799. Car hauling career. l xceptionat pay! GREAT HOME 11IME! Outstanding Comlpany Paid Benefits! Paid Trailing! Minimum I vear OfR experience ietquired. Call anytime (9 2)571-9668 OR (866)41,3-3074. AMERICA'S DRIVING ACADEMY Start your driving career today! Offering courses itl CDL S I n,', tniinn l'eel .. r,,,, i 1, : 1 1, i i , ademy.con). Driver-HIRING QUAIIFIED DRIVERS lor Central Florida Local & National OTR positions. Food grade tanker. no hazinat. no pumps. real benelreils. compctilive pay & new equipment. Need 2 years experience. Call Bynum Transport for your t portunity Iodaiy. (80)741-7950. ARE YOU TOUGH ENOUGH TO HAUL FLOW[FRS? Class A lTearms or Solos wanting ito team. Home Weekly. 'lp P; & Benefits. CaTll (8())428-0343.. DRIVER: YOU WANT IT. WE HAVE IT! Solo. learms. owner operators., cormIIpant drivers. students. recent grads. regional. dedica le, l ihong liaul. Van. flaihed. MIrus he 21. CRST Career C'eiicr. 8(00)94()-2778. veln'rsl.coitn. Driver- ACT' NOW...Hiring 'OTR & Local i )ricrs I'an rn $4.00011 in houses oiur I s car N c \v lu;Iipicnl 'Premiunr I t PICklgck Noi HazMat Required -Call . ."- 2..'. 7-Oakley I ,,,r,*-- i '.%,. care about , .,.i. i e a We have drivers i... i..id i, c .1 .i $56.000 ii,, ,. i H .. Iuch xwill 'V.d ei., H. w munch will 'i t .i earn? Home weekly! HEARTLAND ,lyPRFl"SS 0trto4.11 Y, ," he.0 l, l r, I -, .. ,, m.1 Homes For Sale PAL.M HARBOR I,', L i..dation Sale. i -'", ftl.i, Must Go! Modular. Mobile & Stilt Homes. 0% DOWN When You Own Your Own Land!! Call, our Factory for. FREE Color 3Irochure. (800)622- 2832. $0 I.'(Aj\' N HOMES Gov't & I! aink Foreclosures! Low or no down! No credit OK!. Call Now! (800)749- 29015. FOR SALE BY OWNER -- _2.1lR,...ondo. --St.. I'elersbhirg. I nile from (utill' of Mexico/Doni Cesar. On Isia Del Sol Nolf course. Completely furnished,. $370.00(. Call (859)608-2213. Instruction HEAVY EQUIPMENT OPERATOR TRAINING FOR EMPLOYMENT: Bulldozers. Backhoes. Loaders, Dtunp Trucks. GCraders. Scriupers. Excavators: Nationial Cerific.ation. Jobl Ilaceimeit Assistance: Associated Trainin, Services (8001251-327&. comn. Heavy liquipmenlt Operator CERTIFIED. Hands on Training. Job Saceinent -Assistance. Call Toll Free (866)933- 1575. ASSOCIATED TRAINING SERVICES. 5177 Homosassa Trail. Lecanto. Florida. 34461. land For Sale 20 acres with pond near State & Nati I parks. Camp. Fish. Hunt. $89.900 owner fin. $4995 down (90())352- 5263 Florida Woodland Group. Inc. l.ic RE Broker. MedienllSuppllies IRI-- D IIA CETIC SU LPPI.IES! MEDICARE PATIENTS! Call Us 'Toll Free (866)294-3476 and receive a FREE METER! Anil-Med Q iality Diabelic Supplies. Miscellaneous ATTEND COII.EGE ()NINE from Home. 'Medical. Biinex- PParalegal,. C ...iiiii.. 'Criminal ii i... h'i-h Iacement I.e i' r.Iii. computer i". ,,I Fi nancial ', i jualiftied. Call (866)858- wxvw.online'ridewater'lr ch.conm. PIyVRCF$'275. tI i-ll) I" S signature \ 'equired! _*.xcludes govt. fees! Call weekdays (800)462- 2000. exti.600. (8am- 6pm) Alta Divorce. LLC. Established 1977. DISH NETWORK FREE 4 Rooms! Over 2J4u Ci,,r,,el FREE II.... siiiii FREE Movie i.i, ,.ircl.' FREE DVR! IRI-'f HD I ., ,J L. a ll' N Now! I i i, I JI i , AIRLINE MECHANIC - ,Rapid train ing for high sayingg Aviation Career, I'AA predicts severe shorlage. Financial aid if' qualify Joh pltcement -assistance. CALL AIM. (888)349-5387. ' Mountain Property Mountain Waterli'ont Sale. La.kefront hoinesites & condos w/boat slips on beautiful Lake Chatuge in Western NC. Call now I.' N.., 4 reservation. .4- 8850 x.102. Pools/Miscellaneous 2006 MODE1. BLOWOUT!!! Warehouse Clearance Sale on'the New Kayak I'ool. SAVE $ thousands oni. selected models limited supply! FREE, ESTIMATES Easy Finance Fast Installation. Call (866)348-7560 ww w.kiayakkpoolsfllorida. corn., Real Estate Wit Ih Tennessee's Beautiful Lakes & Mountains. you are sure to find the perfect spot to call home. Call Nancy Giaines. Gables & Gates (865)388-7703. (865)777-9191 Gull' 1rol lois $595k. Homes starting midd $300k. New master planned ocean i'rontl comU nnity on beautiful Mustang "Island. near Corpus Chrisli. TX. W ww.ciniiimonslhore.co in. (866)891-5163. LAKEFRONT I.AND SAI.E I.AKEFRONTS FROM $29.9()0!I TENNESSEE MOUNTAINS! GRAND OPENING! TWO DAYS ONI.Y! OCTOBER 28- 29 lake Access Parcel with 2.000 sf Lor Cabilh Package Only $M9.9001 C a ll N o v .' ... '-, 5263 Ext. 'i, BEAUTIFUL N CAROLINA. L-,C *",'L THE HEAT 'IrN itHL BEAUTIFUL PEACEFUL MOUNTAINS OF1 WESTERN NC Homes. Cabins. Acreage & INVESTMENTS, CHEROKEE MOUNTAIN GMAC REAL' ESTATE. ,. 1 .i ll .. < , ..:1 .I I, l lf l 4 1 ', - HOT! HOT! HOT! Sparta'. .TN., Land. magnificent views. only 5 tracts left. Call immediately! (888)485-* 3141. .lane or Rutby (V Century 21 The. Wright Choice. hlewriglh choice.net, NORTH GEORGIA .Lovely 7-acre relreatl. located on 'the Chirifkee/Plickens County Line. Has 600 ft. Irout stream, frontage in rear. 513/4BA house. pool.'hot tub. pasture & woodlands. .Listed for $575:000. Ron Zalkind, MetroBrokers/GMAC. (706)273-0459. East Tennessee- Norris Lake 5.6 acre wooded LAKEFRONT lot - $66.5(00 5.1 ACRli WOODED view lot- $28.900 Call lakeside Really @ (423)626-5820 O r Visit- in.colr.. LIQUIDATION LAND SAL.E. 5 to 138 Acres. A limited number of spectacular parcels are being sold at 3017 below appraised value. Located in Central: F.. w/ good access., utils. survey. recent appraisal & exc fin. Call today (866)352- 2249 x 847. VA MOUNTAIN ILOG CABIN iinfinished inside. view. Irees. private, large creek and river nearby. $139.500 owner (866)789-8535 VA94.com. GEORGIA/ NORTH CAROLINA Captivating 11mounain views, lakes. rivers. waterfalls. H. ', ;, a ic starlin a @ ''. i i I.,uand/Lo homenre kits packages (Vi $99.900. Limited availability, Call (888)389-3504 X 701. I.AKEFRONT PREDEVVELOPMIENT' OPPORTUNITY! fo All water- access homesites direct from the 63 Love Lines WIDOWED W/M, 70, LOVES LIFE. Do you? Seeks S/W/F. Letter about yourself plus phone number. Mail to c/o Owner, 6137 Hunter Ave., Keystone Heights, FL 32656. 65 Help Wanted' IMMEDIATE OPENINGS FOR SECURITY OF- FICERS in Palaika area. class "D" security license ana valid FL divers i,. cense required Hiring bonus to quaiilied appli- canls Call 386-325- 2001x4351 lor appoint- ment. EOE M/F/DN IMMEDIATE OPENINGS FOR FULL AND PART TIME EMT certified Se- curity Officers In PaialKa area EMT Cerlillcanon. and valid FL drivers li- cense required. Class D" Secunly License pre- lerred, training assis- lance available. Hirinng bonus for qualified appli- canis Call 386-325- 2001 ext 4351 or 904- 281-0070 ext 206 for appointment . Palalka arnm@bellsouthneL EOE M/F/DN RESIDENTIAL FRAMING CARPENTERS NEEDED in Gainesville area Cal 386-623-7064 or 386-623-7063 developer. Beautiful East Tennesse Lake Li in,.. ...I .iii.chities i. I.i, i I I ..... o- nl ', .. i 18 mn N1, I ,'rl ENrI', Cal N.,,,' ," "'l \KES t.i .iJ ... I i nc Broker. MOUNTAIN (GOLF RESORT LIVING Beautiful Bine ; id. I. ,,hie. N. h1, e, i J ut I v 1 .1 . Plrec6on.sruction evenIt (,1 ..r.--. :- ". 29 during i.:,I .c ...... so call now i, ..'IL..I ...d 'to iror information. (888)743- 2975 and v. Vision Rock LLS. Broker. New. Pre-Constructior Golf Cominntuinitv- Coastal Georgia. .largc lots w/ deepw;ater Imarsh. olf. lnaturit views. Galed. Goll'. Fitness Center. Tennis Trails. Oak Park. Docks $70k's $300 K (877)266-7376 www,cooperspoint.com. Western New Mexier Private 36 Acre Ranel $52.990 Mt. views. trees. rolling hills. pastureland. close to BLM. Horseback riding iiking. hunting. l'erfeel 0for vacation. diversifying viont .,. .I,.i;,. retired ent, . I II,...I 1 0 0 ( , I i ..... Addition parcels available. (66)365-2825. WATERFRONT RESORT 1.1 V IN WILMINGTON. NC Historic ortn City Coastal Developrlleti The Bluffs on lthe Cape Fear. Fastest Growing County in NC. Public Grand Opening Oct 21 Direct Ocean Access Pre-construction incentives to call now. (866)725-8337 Cape Fear Bluffs. I.LC Broker. A IAND BARGAIN - WYOMING 35 acres - $49.900: 50 acres - $59.900. Located 990 minutes east of Still Lake in lthe foothills ol Ithe Uinta Mountains. Snow-capped iouniiltai views. Surrounded iby gov't land. Recrealionmi paradise. EZ Terms. Cal Ulah Ranches. LLC' (888)541-5263. Steel lBuildings STEEL BUILD)INGSL Factory Deals. Save $$$ 40 x 60' to 100 x 200' Ex: 50 x 100 x 12' = q ,, i f t. (8(00)658.. borers, Class A CDL drivers- valid Drivers lII- cense a Must! Fax re- sume to 904-275-3292 or call 904-275-4960, EOE. Drug Free Work- place. IAiI CITY CINNIIITY COLLEIt o .. B- i I ~" I Ilil I I LANDSCAPE LAWN SERVICES Commercial Residential MOWING, EDGING LINE TRIMMING AND MORE! LI Z- 30+ yearsexperience- - -'IL --icensed & Certified Call Bruce Kenworthy Florahome: 386-659-2888 Cell Phone: 386-916-9805 Keystone Hauling & Handyman Service, LLC I , EXPERIENCED BACK HOE OPERATOR with CDLClassA. F/T, M-F. Apply in person, Dampier Septic Tank, 7030 NW 23rd Way, Gainesville, 352-378- 2659. DFWP, EOE. HELPER NEEDED for nome repair work Call 352.475.1596. leave a message. SHOP HELP NEEDED. fi- Derglass manufacturing and Irimming will train-' Full time 40 hour week. Apply in person at U S Body Source 1 5 miles South of Hampton on CR 325. CARE GIVER 2 years experience working wiin elderly or aoisaoled cli- ents 2 or 3 days per week SuEl's Retire- menl Home. Hamplon Phone 352-468-2619 NURSERY HELP NEEDED, weed pulling, lertilzing etc. Full time 40 hour week. Apply in person at.U S Body Source. 1 5 miles Sourn of Hampion on CR 325. COMPANY SPECIALIZ- ING in Erosion control now hiring the following posiltons Crewleaders equipment oDeralors. Ia- LA"CECITY INMIHlIt COLLiE InstrucIors Needed For Spring Term 2007 ANATOMY' & PHISIOLOG\ II: (Online Course) Requirei lMasier degree w h 16 graduate hours in discipline or MD. COMPUTER SCIENCE: Computer Applicallons and CISCO Nerworking Requues cMasier' degree i\th 18 grduaLe hoars in computer science MATHEMATICS: College Letel Math I .i t uor,, for ila; ,in Trenion Requires Master'i Degree vh IS gtiduie hours in discipline Da 'rtghi instIicior needed Preparatory Level Math Instructors Requires Minimrrim of Bachelor's degree. Day and nighl inmsructors needed for main campus and class in Bell EARTH SCIENCE (Night) Requires Masier'~sIldth IS graduate hocus in Earth Science or Physical Science PHYSICAL SCIENCE (Night) Requirei Master's with S 18 graduate hours in Physical Science ConraLi Paula Cifruenies at 3861 754-4t1260 or cifuentesp@Ilakecir)cc edu ART & MUSIC ENGLISH HISTORY PHILOSOPHY. & RELIGION PSI CHOLOGi / *SPEECH Requires MNi ter'.. degree : with minimiaro" 18 graduate hours in discipline Contact Holly Smith at (386) 754-41369 or emall snithholly(ilakechycc.edu Persons mitere';ied in adjunct pori1ons must ,ubmji a College application and provide photocopies of transcripts. All foreign uansaripstidegrees must be subnminted ith an official n-.rLl.uion and e% 3luation . CUSTODIAN FLOOR CARE SPECIALIST Night shift, 10 p.m.-6 a.m. Tuesday -. Saturday RE-.D0 ERTISED Manual work in routine housekeeping; cleaning and caring for arnpua burldings luir be able rohifl and carry 44 pounds. Must read and ar e English. Salan: $16,127 annually. plus benefits. Deadline to apply: October 20. 2006 College application required PcsiIion deraimkand jppl.canion a.i lable onr, he rsebal '',. lakecnicc edu Inquiries: Human Resource De'. Lake Cil) Com. College 149 SE College Place Lake City, FL 32025 Phone:(386 754-4314 Fa: 1386 754-4594 E-mail: btenchtrg,''lakeilycc.edu LCCC i jccred.red inhe Southern A- cilaiOn o01Colleges and Schcols V' VP/AD A/EOO College ;n Eucrii.:,ri,& Employment LAK1eCITY CINNIIIir CILLEIF Initrucio rs Needed For Spring lerm 2007 Nursing Skills Lab Insqrecior Full rimnne Ins days: Salar' based on education and exprnence tGrani Funded i Assist iith learning experience in the nursing skill lab. assiri students u ih learning the skills taught. assist iaculry w ih hliuralory preparairon.n for class ResponsibIhl kfor general lab ofganzx3rion. and inaenlor). Nluwi hae ASN degree. FL license cor be FL eligible T.o ea', RN experience in acute rnd'or skIted care fliclaes Eu'cellen clinical skill.. knov, ledge of computers and computer literacy required. BSN and leprching experience perten-ed Rejisiered Nursing Program: Acute Care Clinical faculty for 16lhc.urc/eek(16 weeks) Lake Cmn positions a ailible. Music haie BSN. FL- RN license and 2 ears recent acute/sliled cjare experience. MSN and teaching eipcnence preferred (4 Pos.rionsi Registered Nursing Program; Clinical faculty for 16 hours/ reek 116 eeksg Thursday, Fnda) OR Sani'daiy positions a-ailable Gainesdilte only Must have BSN. FL RN license and 2 years recent matemal/infant or pediatric nursing espenence MSN and leaching expenence preferred (4 pcsiuorinsi Hatnf-Tire Clinical Instructor Positions: Mnusi h4ie BSN, FL RN .license and 2 years recent acute care experience. MSN and leaching esperierce preferred Salarn depends on degree and experience. Grant Funded, Renewable annually. Position 1 Gainesville, 20 hours per week including one 12 hour clinical on Saturday for 16 weeks. Position 2 20 hours (three days) per week. Some classroom teaching required. Patient Care Assistant Course: Part-time position. 18 hourrwek or 1 eekfsI beginning I / 2i07 aind ending 4/i 31)7 NlMu hai.e FL RN license and experience in acute or Iciong lermr care nursing. S. position) Practical Nursing. Program: Clinical Insruuctor three da-vs per week between 1/29107 and 4/5/07 Must be RN iith FLtRN license mand 2 sears recent experience in acute or long term care. BSN and teaching experience preferred. (3 positions). Contact Robbie Carson at (386) 754-4304 or email carsonr@lakecitycc.edu Human Diseases (HSC 2524) Master's degree with 18 graduate hours in related field (health sciences, biological sciences, health careers) Contact Patty Smith at (386) 754-4239 or email smithp@lakecitycc.edu Emergency Medical Services Programs Teach EMT Basic courses in College's five county service area. Must be instructor certified at EMT-B or Paramedic level. Associate degree required. Teaching experience preferred. Must have BLS,ACLS, PALS certification; instructor certification preferred. I Contact Dr. Abraham Pallas at (386)754-4487 or email at pallasa@lakecitycc.edu. Persons interested in adjunct positions must submit a College application and provide photocopies of transcripts. All foreign transcripts/degrees must be submitted with an official translation and evaluation. Page 5D TELEGRAPH, TIMES & MONITOR-D-SECTION Oct. 12, 2008 -Classified Ads - I Read our Classifieds on the World Wide Web S> Where one call 4 1 does it at! 964-6305 413-2210 *496-2261 ARE YOU A WRITER? We are looking for S-omeone to cover local meetings, vhrile leaiures and cover community events in Bradforad --Union and Clay Coun-, Sties.Musthae a knack for writing, be experi- enced on computers. Hours are varied, ir, , cludes occasional week- ends. Mail or email re- .sume to PO Drawer A, Starke, FL 32091, 9 editor@bctelegraph.com. ,HE STARKE POLICE Department is searching for a responsible indi- vidual who is committed to serving the commu- nity as a Communication Officer. Must be able to handle themselves in stressful situations, com- municate ideas, and give directions. Must be able to work nights and/or weekends and be able to cover many different shifts. This position pays $8.00 an hour, plus ben- efits. You must have a High School Diploma or . GED, type 40 correct wpm, good interpersonal -skills and some com- puter knowledge On Ihe job training and CJIS certification will oe pro- vided. Pick up an appli- cation at the Job Career Center at the Vo-Tech or at the Starke Police Dept, 904-964-5400 TELLER/CLERK mmeai- ate opening in credit union for mature indi- vidual Attenhive to detaiL good communication skills, basic computer I knowledge and expen- ence.working with cash. Will train. Fax resume to 386-431-2027 or call 386-431-2017. NOW HIRING FT/PT re- ceptionist at Lazenby Equipment. Drug free work place. Monday thru Friday, 9am to 5pm. Sat 9am til 2pm. Call 904- 964-4238. JThe Bradford County Community Develop- ment office is seeking a part-time Home Owner- ship Counselor. Appli- cant will work closely with individuals and families wanting to pur- chase a home through the Bradford County State Housing Initiative, Partnership PrOgram.) Good communication skills and computer skills are required. Applica- tions may be obtained at the Bradford County Community Develop- ment Office, Bradford County Courthouse An- nex, 925-E North Temple Avenue, Starke, Florida. Applications must be re- turned to the Community Development Office by 3:00 p.m., October 19, 2006. DRIVER- ARE YOU get- ting a 2006 pay in- crease? Roehl drivers are paid more with prac- tical route mileage pay plus top 10 pay raie. 53' van/48' FB Students welcome. $3000 sign on oonus ClassArequired Roehl, "The lake home niore, De home more camera Call 7days/week $$$ 888-356-1140 $55 COUNTY PLANNER - BRADFORD COUNTY WHITEHEAD BROS.,INC. Bradford County is ac- cepting applications fora arid infrastructure sys- tems, urban design, so- cial issues, land devel- opmeni code inierprela- lion and revision and Site plan review Tne mini- mum qualifications in- clude a Bachelor's De. gree in Urban Planning. Public Administration. Geography or a related degree in business Ex- perience in planning is prelerrea, but not re- quired. Applicaltons may, be lumed in or mailed to CierK of the Court, P 0 Drawer B, 945 N. Temple Avenue; Starke, FL 32091. The deadline tor accepting applica- lions is Fnday, OctoDer 27, 2006 at 4-00 p m Applications anad ob de- scnplion storms are avail- able at the County Man- ager Office located in the Bradford County Court- house. North Wing. The North Florida Regional Cnamber of Commerce, 100 East Call Street, Starke, FL 32091 or via the county website at- fla.org. The county re' serves the right to reject any and all applications. Equal Opportunity Em- ployer. SALES MANAGER NEEDED for flooring company. :Salary plus commission. Call 352- 473-6610 or fax resume Sto352-473-6416. TELLER FT. FLORIDA' CREDIT UNION has a FT teller position avail- able at our Starke branch. Experience with high volume cash han- dling maintaining cash alawer, balancing, cross-sellng ability, and customer service exper- tise is required. Prior credit union/bank expe- rence is a plus We of- ler competitive salary, incentives, and excellent benelils. Slop by our branch at 1371 Soutn Walnut to complete an application or send re-. sume to Florida Credit Union, Attn: HR/TLR, PO Box : 5549, Gainesville;, FL 32627. Fax:' 352-264-2661. E- mail kioss@flcu org. M/ F/DN EOE Drug Free Workplace. ARMED SECURITY OF- FICER/D-G. Gainesville, FL. Full-time, $10/hr.' Call 904-399-1813. Training provided. EOE, M/F/D/N. REAL ESTATE ASSOCI- ATES is money impor- lant to you? Earn up to 70% of the commissions you bring Ihrougn the door. For a confidential LAKE CITY LOGISTICS I l*~A'I1F1~I~IJV1 Over-The-Road Drivers Needed! New trucks with TernoKiing AlU's. 1800 watt inverters, top of the line leather seats. walk-in condo sleepers. and new air- ride ti.'ii upci.ioh, i';i ,'i.moother ride than you have ever experienced: Home several nights mosi week's as we have ai good .... nsir. ,it '.,i..I .1i ,, over the road: Home inost weekends. Personalized dispatching that comes Ifrom only dispatching 25 trucks locally. Earn up to 30% of revenue immediately. NO WAITING(!!! New increased layover pay. Up to $100.00 per day.12 week vacation y12( per year Safety Bonus. Driver of the Year bonus. Driver ecruitment bonus. IMeJ_,.il i'-d c d i. il i ,ri.rJ Need 2 years experience , CALL JIM OR DEBBIE LAWRENCE 904-368-0777 or 888-919-8898 JENNINGS PAINTERS INC ^ \ is seeking a TOP QUALITY PAINTER * ..Experie.n.ced Professionals Oniyp a l-" i t Full Time Position - Pay based on experience Driver License & Transportation Necessary Must be at least 18 yrs of age Quality Control Starting Pay $13.30 Start 3 months 6 months 12 months 18 months 24 months 30 months $13.30 $13.80 $14.30 $14.80 $15.30 $15.80 $16.30 PLUS...... $0.351hour 2nd/3rd shift differential $1.351hour weekend shift differential $0.75/hour quarterly bonus potential G e lI 360.ak., i aity, F I,25 appointment, call Dean Weaver at 352-473- 6201, Watson Realty Corp. GILMAN BUILDING PRODUCTS COM- PANY is'accepting appli- cations for Security Guard at the Sawmill lo- cated in Lake Butler. A high school diploma or equivalent is required. Computer knowledge is required. We have com- petitive rates and 401K, dental and health insur- ance, paid vacation and holidays and promo- tional opportunities. In- terested applicants should apply in person Monday through Fnday from 8am-3:30pm at the front office Applicants must Dring SS card, pic- lure ID and diploma. DIRECTOR OF MAINTE- NANCE A truck carter in Lake Buller. FL with 335 company trucks and 550 trailers is accepting applications for its Direc- 'tor of Maintenance position. This individual * will manage the mainte- nance of all company fleet assets and assist an owner-operator fleet of 75 trucks in their main- - tenande requirements. This includes regular preventative programs and procedures; evalua- tion and purchase of equipment and parts; development and super- vision of maintenance stafl, development of professional vendor rela- tionships; and develop- ment. expenditure and administration of an an- nual maintenance bud. get This position re- ports to the company's Vice President. The ideal candidate will have minimum of 5 years in a leadership role as the maintenance director of Driver Dedicated Regional Av\g. $825 $1025/wk 65% preloaded/pretarped Jacksonville, .FL Terminal .CDL-A req'd 877-428-5627 ww w.ctdri vers.com Employment tOpportunity For 2 yrs experience min. Paid vacation 401 k Major medical ins. Competitive wages SAWYER GAS YOUR LOCAL FULL-SERVICE PROPANE DEALER 9449,US Hwy 301 South Hampton, FL (352) 468-1500 1-800-683-1005 a medium-sized or larger trucking company: Com- petency In MicrosoftEx- cel and Word is essen- tial. Salary based on experience and educa- tion. Company benefits Include matching 401K, group health, vacation and sick leave. Call 800- 808-3052. MECHANIC NEEDED. Call 904-964-7535. UTILITY WORKER NEEDED for EEO and Drug Free established company. We offer 401K, health/dental In- surance, paid holidays and vacations. $1 raise after 6 months Apply in person at Gilman Build-. ing Products, CR218 in Maxville, FL. DENTAL ASSISTANT - MONDAY'S ONLY Ex- perience with pedlalric patlenls. Fax resume to Acorn Clinic, Brooker, FL: 352-485-1961. Great working environment Experience required Call Kim at (386) 496-8224 Shatto Heating & Air Inc. CRYSTAL 582 N. Temple Avenue I Hwy 301 I Starke, FL NOW HIRING:, Full & Part Time Positions AT PREMIUM PAY- Must work flexible hours Apply in peron at our Starke location 1:30 4:00 pm MONDAY THROUGH FRIDAY NO PHONE CALLS PLEASE f ipm ovin' if -McDonald's of Alachua is looking for new ENERGETIC TEAM MEMBERS! * Flexible Scheouling * Vacation Benefits * Food Discounts * Premium Pay **Apply Anytime ** On the spot interviews will be held on Friday, Oct. 6 and Tuesday, Oct. 10 from9AMto 11PM .Happy Fall Southern PofessionCJl I itle ePvices, Inc. SIf you are 12 yrs old or under, color the picture below and have your parent bring you by our Starke or Lake Butler office for a FREE BAG OF CANDY! Limit bag per child "Have A Safe and Happy Fall" 704 North Lake St* Starke, FL 235 SW 4th Ave. Lake Butler, FL 904-964-6872 386-496-0089 Look for the Red Door! #C\ Ftt*K^^ 7ttr1^ tr^*** Tlt^'So^6*^e?^ tk^^ tl^*** ? I I .~~.... ~_c. ~I.. _ 7- -ff I , I.., Drainage, jail issues in 1910 Aug. 26, 1910 (Drainage was a muclh discussed topic in 1910. with many ofthe lower-lying areas of the county' being limited in land use due to the. potential for flooding. A number of plans for diverting excess water were proposed, some which would have been costly and difficult. Others, like the one below, which proposed to enhance natural drainage outlets at a minimum of cost and effort. Of course, as we are still reminded today, no plan can totally alleviate the. danger of flooding in Bradford County, or anywhere else in Florida for that matter) The proposed drainage district Mr. Peek gives interesting figures regarding the enterprise What will itcost? Ask also what it is costing us to. do without it? What our losses are this season alone for want of it? What they may be many. seasons to come? With all this alluvial soil of Alligator Creek and its tributaries drained, thereby draining also for safecultivation the thousands of acres of fertile lands adjacent whence the water floV's into said creek and its branches, we would have one of the most attractive and profit producing sections in all Florida. The undulating flatwood pine lands, the deep loam top soil and clay subsoil, are proving out as the best class in the state. Some of our farmers have already reached 50 to 65 bushels of corns per acre, 1,000 to 1.300 pounds Sea Island cotton per acre, 100 to 130 bushels strawberries per acre, and splendid crops of oats, ha). potatoes, and a great variety of vegetables. Our best soil, however, is that which requires the most drainage. By ditching the fertile lowlands we are at the same time making safe the undulating upper lands and thus more than double the value of the whole. S.Here is the approximate estimate: Commencing at Rowell Lake and following up Alligator Creek and its several branches as far east as the Clay County line. the drainage area would be about 20.480 acres. Four miles canal 40 feet wide, five feet deep, 70 per cubic yard $10,500 three miles canal 20 feet wide, five feet deep, 70 per cubic yard $3.960 *. four miles lateral ditches 10 feet wide. five feet deep, 7I per cubic yard $2,500 Total: $17,080 , Allow ,for other ditches that may, be found necessary and make it an even $20,000. We would have six years to pay this by special drainage tax. payable one-sixth annually. ,This would be only $3.333 and interest annually, which, assessed on all realty in the drainage district, based on present ,assessments, would, maker individual annual pa menis small indeed %when compared with the 'benefits arising from the drainage. When engineers estimate the cost scrip could be issued for the whole amount, payable in six years at six percent interest. This scrip could be sold for cash to dig the canals and ditches at once. The 40-foot and 20-foot canals would require a steam dredge. This dredge outfit would cost whoever bid in the contract about $2,000. It would dig and pull out stumps in the right of way and" dump them out on shore. The 10-foot lateral ditches would have to be dug by hand. As the great benefit to town and county would d exceed the cost so many times over, the drainage would simply prove a wise and conservative business proposition for the good and gain of all concerned. , The gain in land values alone wouldd be at least $200.000. The gain on city property values would be correspondingly great. The greatest benefit to SOur town would be .the sewerage outlet the canal would furnish. The canal from the lake up to the railroad could be dug so that the Rowell Lake water would tide up opposite the town, and give us boat communication to Sampson Junction as well as +sewerage outlet. We can do this drainage right now. No use to wait. The quicker it is done the easier we can pay the cost. The increase and safety of crops annually would easily pay the whole cost in possibly one crop year. I would suggest that a few citizens who are most interested in securing this drainage, meet in Starke Saturday, 27th, at 3 o'clock p.m., organize" for work and go to work, get ip maps and descriptions of drainage district, present assessed values of all realty therein, approximate location of canals and ditches proposed and probable cost of same. Have some good lawyer prepare the petitions strictly in accordance with the statute relating to drainage districts. Then solicit the signature of every property owner in the drainage territory and present the petition before the board of county commissioners at their regular meeting on Monday, Sept. 5. Should the commissioners entertain it favorably, they will advertise, etc., as set forth in my first article on this subject of drainage. It is a great move for the good of all. If you want to carry it through, give enough of your time and energy and do what the law requires in the premises. C.L. Peek (Although it took longer than Peek expected, the petitions were duly drawn up and began to circulate in late September of 1910. Unfortunately, this is the last that is heard of the issue that year, with said petitions seemingly never being presented to the county commission. The Telegraph did its part to motivate the county, however In the same issue as Peek's ambitious plan were two items, apparently selected to influence by example and through humor.) Plunged into deep water E.A. Bowers had exciting experience in crossing creek Those who work for the creation of a drainage district of this section can now present tangible proof that beats columns of arguments to show that they are right in their assertions. When an episode like that related belch can happen on the most traveled road out of Starke, almost within the town limits. it is time that something should be done i E.A. Bowers. who lives on, the Peek Road, had been to Gainesville to buy a mule and wagon. and Wednesday evening about 8 o'clock he reached Alligator Creek on the return .. journey He crossed the first bridge safely. ,then plunged into girt- deep water He thought he was off the road and in the ditch and pulled the mule to the right This was a bad move. for now both mule and wagon went into the ditch. Mr. Bowers got out when the \wagon box began to float and found the water above his head. He swam along till he reached the north bridge, and finding that he could do nothing alone in the inky darkness, hurried to Phillips and Crews' stables and told his trouble. Jeff Johns and Jesse ,. . Strickland %%ere there and they procured . lanterns and went with Mr. Bowers. This is the jail built i They found the mule located on Pratt Stri standing in the ditch Center, this was an i with eyes and nose This "old" jail was t just out of the water, still fast to the wagon. After some heroic work they managed to unhitch the mule and get him up on the bridge, then they got the running gear of the wagon up and next .'". located and rescued the wagon box. which had floated across the road The only part of the outfit lost was the seat. but it will probably be found when the watej rK ede.. .......: .:b; .. '. . Hunting for the road An instance of resourcefulness that borders on the sublime has come to ,/ the reporter's know ledge. . The other day a farmer living out on the Wall Road, and his 12-year-old son. were kept in town until after ,. dark on account of some . heavy rain. When they had started and %were opposite the power house the old man, who' was driving, .'. : '. looked down Call Street and .; :' could see nothing but water - where the street crosses the swamp. OH Lord!'" he Prohibition was complained, 'How will i be Prhbstinw able to steer so as to, get interesting peri across the bridges?" Bradfo "I know, paw," said the boy. "Keep in line with the electric lights and you can't miss it.". The farmer did as directed, but as'he went down the slope the lights formed themselves into a vertical line. "Consarn your smartness," said he to the boy, "See what a mess you have got me into! Where are your lights now?" I "Never mind, paw," replies the young hopeful, whose prospects of becoming a good lawyer or book agent are excellent, "I know. While we were a-gwine straight by the lights I noticed that that 'gator in there bellered on the right hand side and that bullfrog grunted on the left. You steer right twixtt the 'gator and the frog and you can't miss it." The boy was right. After slushing knee-deep in water for some distance the horse stumbled when he struck the bridge and fell. This frightened a cow that had been lying on the bridge and she made a bee-line for the next bridge. "Foller the cow, paw, and you can't miss the next bridge," was the boy's sound advice. Sept. 2, 1910 (A humorous commentary on the city jail, known as the "jug" makes light of the poor condition of the building. The need for a new jail is expressed, and was indeed realized later in the year) The little gray jug Municipal hostelry is a marvel of ingenuity Wednesday morning Marshal Austin had a general fall house-cleaning at the "jug," as the municipal jail is called. The name is not farfetched, for the little square structure with the pyramidical roof looks just like a Schiedam Schnapps bottle, and if the place had a stove with a piece of pipe outside, it would very much resemble a jug. To the casual observer the interior presents only four bare walls and a bunk but there are many n 1910. While the building that most Bradford Countians refer to as the "old" jail was eet and recently torn down to make way for the Santa Fe Community College Stump even older "old" jail. It was located behind the old courthouse, and was built in 1910. :orn down in 1985 when the renovations to the 1902 courthouse began for the SFCC Andrews Center. . ^, .- ,. ", *** *'4. ', -" not as dangerous to Bradford lawmen as the period between 1885 and 1912. It was an od, however. Sheriff Will Epperson, son and.brother to the Eppersons who had died as rd lawmen, and Deputy Will Baisden pose with a confiscated moonshine still. traditions associated with the place to make it interesting, and if the walls could speak they could tell some startling tales. The first to be remarked is the total absence of writing on, the walls and defacing of any kind; but the guests are not anxious to write their names 'on the wall and carving is made impossible because they have to leave their pocket knives outside. Just under the north window is a large burned spot showing how a prisoner tried to burn himself out. Once a couple of stout farmers were incarcerated but'nearly set themselves at liberty by overthrowing the jug (pushing over the building itself). A new and stronger jail was proposed, but the Solomons who then decided the weal or woe of the town saved expenses in a way worthy of the "wise men of Gotham," They filled the space between the ceiling and the shingles with sand to weight the structure down. This way of placing ballast, while contrary to the mode used aboard ship, is, .nevertheless, effective, and quite in keeping with the condition of the guests, who are troubled with top-heaviness. It serves also another purpose. The sand sifting down through the cracks falls into the eyes of those sleeping on the bunk, and they must therefore get under the bunk to sleep, whereby the bedclothes are kept clean. Until a few days ago the jug has been provided with a padlock and hasp, but the modern spirit of improvement has struck even here. As the unwilling prisoner must be shoved in with the left hand while the marshal quickly closes the door with. the right, the old arrangement was awkward and often a failure, for the prisoner would get hold of the hasp first and hold it so that the door could not be shut, and the club had to come into play. A new lightning spring lock has done away with all trouble on this score. The shingles are pretty rotten and the birds soon drop seeds through the cracks upon the ballast. Wonder how the jug would look when surmounted by some vigorous Jerusalem oaks? The jug is so well preserved by the fumes of alcohol that it will last forever. (Bradford County persisted in offering a wide variety of opportunities for social gatherings, many of which were connected with one of the areas many churches.. As always, humor and a sense of fun characterized these events, showing the persistent tendency and ability of the residents of the area to be able to laugh at themselves.) Endeavorers give supper The Christian Endeavor Society of, the Presbyterian Church gave. another of their piquant entertainments at the. Sternburg residence last Thursday evening. The guests, who numbered 60, were first treated to good music by Misses Ethel Sternburg and Mabel Wills and Messrs. Herman Crook and Cosmo Alvarez. Then came the "cold" supper. The long dining table was covered with sheets reaching to the floor. Benches, which allowed the guests to sit close together, were used instead of chairs. Mr. Rufus Hodges sat at the head of the table and had a pan full of such things as a bunch of chicken feathers, a bunch of chickens' feet, another of chickens' heads, a glove full of salt, some gherkins and an oyster shell with a piece of raw beef in it. These articles were, one by one, passed by Mr. Hodges to the guest nearest him, and thence from one to the other. Each guest was told to keep his or her eyes closed when the item was put in their hands. The objects had been kept on ice and felt so cold and clammy and uncanny that they were sometimes dropped by the lady guests, who for each offense had to pay a fine of 25 cents. Others wanted to see what was handed them and were fined a dime for each look. The exclamations from those who felt "creepy" provoked mirth, which, the doors being open, was heard outside, and as laughter is contagious, soon the whole neighborhood was laughing. Refreshments were served, consisting of different kinds of sandwiches and cake, chicken salad, pickles and coffee. The out of town guests were, Mrs. W.H. Porter and niece, Miss Olie Porter and Mr. Charles Strickland, of Waldo, Mr. and Mrs. J.C. Bailey, of I --- Same thing only different?: Animal control and zoning also issues in 1910 Aug. 12, 1910 ; (Civic animal control had a whole different meaning in 1910. While the occasional mention of a stray dog or two may be found in the pages of the Telegraph over the years, stray cows are unique to the 1800s and the early days of the century, but presented a serious and, messy problem in 1910 nonetheless.) Cows or no cows Citizens are becoming restless about the bovine nuisance Cows, or no cows, on our streets and sidewalks .+- that is the question. Some years back our city council passed arn ordinance, on plea of nuisance, requiring cattle to be penned at night. Our population then did not reach the number fixed by law that would authorize absolute "prohibition" of the cow. It was hoped that all cattle owners in the town, from love of neatness and decency, would pen their cows on or before 8 o'clock each evening. Of late years this is utterly neglected, and droves of cattle, owned in and out of town, roam our streets and roost on the sidewalks all through the stilly night." The nuisance is becoming so unbearable, that some of the ladies of the town have requested help to abate the nuisance. TheI point is to ask cattle owners not to allow their stock out at night 6n the streets. Also to alk the council to appoint enough scavengers to clean the sidewalks each morning, if they cannot enforce said ordinance. And. if nothing else will avail, they believe the present census will give the necessary population to prohibit the town cow, and they will insist upon it. C.L. Peek . (Temperance and prohibition was a frequent topic in the Telegraph, especially in 1910 as statewide prohibition of the manufacture and sale of alcoholic beverages in the state was being considered by the legislature. In addition to numerous articles about the activities of members of the temperance movement, a near-weekly column, called .'the. WCTU (Womens Christian Temperace Union) Department, edited by Mrs. D.E. Knight, frequently graced the front page. While the Telegraph gave ample space to the temperance movement, and sometimes, by editorial comment, seemed in favor of it, it should be noted that the'publication continued to run advertisements for liquor and spirits, although never on the same page as temperance issues.) Temperance . entertainment Able addresses and fine music made enjoyable program The entertainment which was given for the temperance.cause at the Baptist Church last Friday evening was well attended and a success in every respect. The program as given in last week's Telegraph (no copy of which still exists, ed.) was carried out, with the exception of Dr. Freeman's address on "the effect of temperance on the morale of the community," which was not delivered as the doctor was unavoidably absent. The Rev. W.T. Morgan greeted the Dr audience'with an address which was not on gr the program, and thus no number was missed. The singers were a mixed choir from the Baptist, Methodist and Presbyterian churches, and their singing was faultless, as was also the instrumental music. The difficult subject, "the political and business phase of prohibition," was handled by D.E. Knight, esq., in a manner that evinced a thorough study of the theme and it was well received. (Progress is often fraught with problems and when the old meets the new a clash is very often the result. The coming of, the automobile distressed many people, what with the noise and smell these rtew-fangled machines produced. As can be seen below, people were not the only ones who objected to what many referred to as an "infernal machine.") Ice mule got excited Pratt Street is a very quiet neighborhood and has an excitement only once in every 12 years. The last took place Tuesday morning and was caused by a mule whose occupation should make him too cool-headed for such carryings-on. Tuesday, as. the ice man was making his second matutinal round and was on north Walnut Street, near Pratt, delivering ice at a residence, the .large mule that draws the wagon became frightened at an automobile that approached from behind, and (the mule) ran down Pratt Street as fast as he was able to pull the heavy vehicle, looking to the right Th and to the left and uttering brays of distress. The wagon in its headlong flight resembled a tug boat in a choppy sea and the cakes of ice it contained were scattered over the street, breaking into bits. At last two of the wheels broke and there was a stop to the proceedings. A perceptible coolness, like that between two men, each of whom suspects the other of having killed his dog, pervaded Pratt Street until the ice melted. (Bradford C "- as s .. -owing in 1910, although not as .,ckly as in the late 1800s. New business openings were not as frequent and seem to have been based on existing need rather then the creation of it through availability.) New grist mill I have put up a grist mill on my place just south of Starke, and will. grind your corn into meal or hominy at any time during the weekdays. I grind to suit you and will give you satisfaction. I also keep a wood yard and will furnish any size stove wood on short notice. G.M. Bennett (While the city and county were developing, much of Bradford Counmn was still v'ery much a wild area. The clash benr'een man and wild nature went on much as iti does today, with wild animals competing for the space needed to carry on with their lives. While sightings of catamountss," also known as panthers, are very rare today in the .county, this was not always ;so and it must have been a frightening experience indeed to meet one of these large cats face to face.) Wildcat sighted at Dowling's Mill A few nights ago Lee Lamb, night watchman at the Dowling Mill. heard something growl at him from behind a pile of lumber. Mr. Lamb paid no attention, thinking it was someone who wanted to scare him. but the growls continued. He then thought he would fire a shot in the air to scare the growler, but just then an animal sprang out in the open, which' looked like a catamount. M. N.Lamb fired upon it. but the shot did not take effect. Next morning on inspection numerous large catamount tracks were seen, leading to and from a can of tallow that had been used for greasing the t.. ,, ^ -'- 3 -. -, -" ...^: -:^. '5 Free range was the law of the day in early Starke. Cattlemen did not have to fence their livestock. It was up to the people in town, or the people who owned a tasty- looking garden, to fence the cows out. At one time, the entire city of Starke had a fence around it, but the cows still got through on occasion. Here you can see the wrought-iron fence around the courthouse which was meant to keep the cows - out, not the people in. dressing up and having a picnic on the banks of one of the many creeks and rivers in the area was a favorite weekend activity. This oup was picnicking on the banks of Alligator Creek in 1894. They area (back row, I-r) Julius Adams, a local milliner whose name is now unknown, Eddie Duncan, Kate Burroughs Duncan, Annie Matthews, Orrin Matthews, Ida Witkovski, (front row, I-r) Julia Wall Hoffman, Will Hoffman, Alice Wall, Orville Wall, Eugene S. Matthews and Felix Witkovski. e Women's Christian Temperance Union held parades and lobbied for years before Prohibition finally came into play. This parade Swas held in Starke in the early 1900s. pulleys in heavy iron blocks. It is supposed that the animal had been driven from the swamps by high water and had wandered to the mill in quest of something to eat. Sept. 9, 1910 (Too much of a good thing is never a good thing and nature's contribution to the power plant in Starke was less than appreciated one dark and stormy night.) Lightning strikes generator Engineer Bessent knocked down but not injured Saturday evening at 6:45, during a thunderstorm, lightning struck an electric wire and the town was suddenly thrown into darkness. At 7 o'clock the lights again thrown out. At the power house, when the lightning struck, a sheet of dazzling light shott out of Ihe large generator and Engineer Lawrence Bessent, who was standing near by, was knocked down, but was soon on his feet again, having suffered no injury. He lighted a lantern, put the belts on the small generators and set them running and the welcome lights again peered through the darkness. The armature of the large generator had been destroyed by the lightning and it took several days before a new one could be put on. Those who do not remember the past are doomed to repeat it. rk*************************** **** AMERICAN OWNED AMERICAN OPERATED *********************** | 6 bIaaU DIBEL Centers For Hearing Excellence * The Secret-s--Ot '. .. . . . .Mickey Rooney Ernest Borgnine Kay Ballard Hugh O'Brian ' S -' ... ActOr .. Actor : Actress : .:. Actor ' : i WearsAudibel Wears Audibel t WearsAudibel ; : WearsAudibel ' IThese Individuals Demiand The Very Best. T .That's Why They Choose Audibel. > Shouldn't You? Don't Buy A Hearing Aid.. -- Until you see what we have to offer. Fact You have many choices in North Florida for hearing help', = UBFact Many competitors are advertising special offers and promotions. -_Fact Many of you are confused, where do I go? Who do I trust? Z1 Hl Fact We want you to consider and trust us, and here are 7 facts why you should.*. #1. We are the oldest hearing clinic in the Tri-County area. #2. We will beat ANY competitors price, "advertised or not", on a comparable hearing aid by at least 25%. #3. We are part of the largest American Owned and American Operated : <, ^^ B^ ~#4. Most of our competitors sell hearing aids that are owned by -Ac A foreign companies. S#5. Our Network has donated over 150,000 hearing aids to underrivileged children, each purchase here supports that. K I#6. We have endorsements fromhundreds of actors, congressmen : I^ B: ^ ^ ^presidents and dignitaries supporting our products (no one else can say that). 6 S#7. We arehereto help you, not just sell you something. a U D IBEL #8. -+ We make house calls if you cannot get to us. . Authorized Center for HearingExcellence : w, ww .audibel.com FRE Ear Canal and HUGE HEARING Sind out what you're hearing and what you're notA wnI - SWe can quickly and easily determine the exact natureof your hearing a ven save ou up to < difficulty There is absolutely no cost or obligation for this service. I n e s. t ns Wetll look directly into your ear -+ M .* # Wdetehmine whether your hearing 1 Whol-es hern aids With voice* #Aentire procedure for yourself on llnYnomei ano bo un d #3. fulWcreoarvoftelretmicnO ed.,nA management systems. -K~~~C foein omanes SI AUDIBEL HEARING CENTER on.-Wed., Limited Time An Audibel Center for Hearing Excellence O -.Starke- STomd uinllot E.. S a Gainesville z Board Cetified 345 W. Madison Street NW 37th Place, Ste 200 Specialist, 4210WPlace, Member FSHHP (Inside immediate Care Center) (In Wachovia Bank courtyard) (9041364-7705 (352)377-4111 CaaUDIBEL ******r**-k********** -k-k**k*k** AMERICAN OWNED AMERICAN OPERATED -**--*-**********-***AA* Features aort Section C: Thursday, Oct. 12, 2006 *.Telegraph Times Monitor SFCC Starke FaIl Festival takes place this weekend BY'TERESA onWalnutStreet. making At 11 am.; the parade will Walnut Street, head north and scheduled to take placed STONE-IRWIN Ongoing activities include The Shriner's Parade will commence w-est down Call end at the Woman's Club simultaneous on the indoor. Telegraph Staff .Writer face painting, drawing and begin lining up by ,Shand's Street to Thompson Street. located at the corner of and outdoor stages at the" collage, mask and shield Hospital on Call Street at 10 continuing south to South Jefferson and Walnut. Womans Club. See page 3 This.weekend, Oct. 14and making, painting, and doll am. Street, then turn west onto Several performances are forascheduleofesents. 15, Santa Fe Community . College presents their annual " Starke Fall Festival. The festivities, featuring -oyer 50 talented artists from the stite;-will take place from . 9 a.m. to 5 p.m. on Saturday and again from noon until 5 p.m on Sunday. On hand will be a variety of arts this year, including categories of 3D mixed media, ceramics, jewelry, fiber, glass, computer generated graphics, mixed media, photograph., painting, watercolor and wood. Local artists include Jane Honn, Martha Swift, Nillard Griffis, Howard Ashcraft and , Dexter Gillingham, all from Starke. Keystone Heighl s artists include Alice Arp, Karin Holloran and Bob Bird. This year's festival will also include the Children's Creative Corner, which will be located just outside the Woman's Club Enjoy the :arts- at 1st UMIC: First United Methodist Church will be open to the public this weekend during the Santa Fe Community College Fall Festival in Starke. .With the church pictured on the festival poster, members of United Methodist Women decided it was time to welcome visitors to the community. Tours of the beautiful sanctuary will be ongoing all day Saturday and Sunday afte rnoon. --31.!':: : Fellowship Hall will become-"v..- .. an Emporium, a store carrying a great variety of articles. Many members are providing unique _..1 s-th-sat will be for sale SOION B "'00 JEEP IBERTY SPORT C VY E . d u rin g th e w e e k e n d 6d o o r, A ut o m ati c , Holiday/seasonal crafts, Automatic, PW, PL, Top of the Linel V6, Automatic, PW,- PL,CD, Tilt, Cruise door, Automat c, Low Mileage/Low Pymt flags, note paper, ornaments, SAVE BIG ON GASI gourds, glass cubes, wreaths.4 pillows, lap robes, wall hangings and aprons are just a few of the items on display. Kwanzaa dolls, Egyptian amuletes and thumb drums will offer a glimpse of Africa.. The "Methodist" knives, cookbooks and "Holy" bears will also be featured. Nancy Roberts will have a large selection of stain glass.. .. . from the old church windows and other glass. (She will be on4985 165 10995 hand to repair pieces purchased oce, 1 0 5 O5 10 through the years.) 64, 1 9 51 P9 The 2006 ornament. crafted by Laurie Mullins with Ruth Johns and Eugenia Whitehead, '05 PONTIAC GRAND AM '04 SATURN ION -'06 DODGE 1500 QUAD CAB is a replica of the church. They will be on sale in the Sporty, Automatic, PW, PL, CD, Low Mileage Automatic, Low Milpage, Low Payment Low Mileage, Plenty of Factory Warranty SEmporium. Special desserts in the bakery area will please everyone. There '" will be cakes, pies, cookies and candy.'. Also an area of Homemade .jams, jellies, Spickles, etc. will be displayed along with prepared mixes. Lunch will be served both days for a $4 donation. There will be a choice of chicken salad on a croissant, french onion soup or southwestern salad with chicken strips and The hrh w bes pen 4 *12 995 04 11,430 d p199905 during the hours of the festival I !I V, '05 JEEP GRAND CHEROKEE '01 SUZUKI VITARA 414 '06 DODGE STRATUS Kiwa nis Vp, Auto, PW, PL, CD, Remainder of Warranty Auto, Low, Low Mileage, Low, Low Payment Automatic, PW, PL, CD, Tilt, Cruise, SAVE BIGII Kiwanis poker ", ,... tournament is Oct. 20 The Kiwanis Club of Starke ", '.\, ... will be hosting a Texas Hold 'Em tournament on Friday, Oct. 20, at 6:30 p.m. at the Starke Golf and Country Club. Registration begins at 6 p.m. .. and the entry fee is $50 (half of the total collected on the entry fee will be returned to the winners). $7.995 d SPizza and drinks will be 15,9957,99512,995 served. .1 4 . For more information, or tb reserve a spot, please call Steve Denmark at (904) 964- WMART 5827. SUPER We can often do more for A S us 30o N other men by correcting our 15000 LIS 301 SOLITH in STARKE, FL own faults than by trying to correct theirs. -Francois Fenelon Page 2C TELEGRAPH, TIMES & MONITOR--C-SECTION Oct. 12, 2006 3 counties hold joint breast cancer luncheon BY LINDSEY KIRK LA ND Times Editor Each. county, Bradford, Union and Alachua. had some form of' breast cancer Sylvia Tatum awareness event, but nine talks to more Union County women wanted than 150 people to raise more money for breast about her,. cancer after the 'death of a struggle with friend. breast cancer. Jill Hayes Tetstone died of She said at breast cancer at the age of 4 I, some point, she leaving behind two children just got a little after a five-year battle with crazy insisting breast cancer. to every person "It changed our lies and in the grocery .their lives," said her cousin. store they get a Parm Woodington, a Union mammogram. County resident. "(Jill) made us promise to take caie of' ourselves," she said. "That's a promise %we don't take lightly " Woodington said she and the other eight %%omen, friends and family of Jill, %ere tired of '" being sad and decided to put their promise into action. The group included Nannette Starling and Paula Hawkins TI:,1. (JiW.Jll's cousins). Stace, Haves' SJill.'s sister), Belinda S. .'' i MNanukian, Denise Dukes, Debbie Dolski, Mel Howard i and Courtnie Douglas till's -.j friends), .B They held their first eent on Aug..Q, ,and raised more than $20,00. S"'This %%as the group of nine '., I who didn't take no for an Answerr" Woodington said. Partnering with the American Cancer Society in 2005. they participated in a S i cancer walk under the team name of "Jill'. Crawbabies." They had 56 walkers. R AAt the luncheon Wednesday. Woodington said their goal for I the upcoming walk was 100 people. "It takes money for t Pam Woodington speaks about her cousin, Jill, who died after a five-year battle with breast cancer. vAt Bradford County residents (1-r) Joella Hardy, Faye Andrews, breast cancer survivor Sylvia Reddish, Barbara Reddish and Linda Hicks dine at Carrabba's during the event. research," Woodington said "It takes money for education." More money could come through a bigger event, they decided, and with the help of partners in Bradford and Alachua County, "Hold "Em for Hope" was created. The event was a luncheon held at Carrabba's Italian Grill in Gainesville on Oct. 4. It was combined with a silent auction,. many drawings, a Vera Bradley sale and guest speakers. More than 150 tickets were sold for the event, news of which was spread through word-of-mouth and on the 850 AMI radio station. The event drew area celebrities, such as Shelly Meyer, wife of Gators coach Urban Meyer, but most importantly were area breast cancer survivors. Sylvia Tatum, who contributed time and financial See CANCER, p. 9C I Social Security ^^^^^^^^^T'N:^^ * Retired Social Secunty Executives * We do ALL negotiations and personally represent you during hearings * NO FEE UNLESS WE COLLECT Even if you've been turned down before, call now * Full representation from start to finish on any Social Security claims. WE KNOW HOW TO DO IT! M to] ,4 11M04IIA' 2 area golfers make it out of District 4 tourney BY CLIFF SMELLEY Telegraph Staff Writer Bradford and Union County high schools each had one golfer advance out of their respective District 4-A tournaments, which were played on Oct. 9. Heather Alvarez, a member of the Bradford girls team, earned a berth in the Region 2 tournament with a score of 96. Alvarez also earned a rip to last year's regional round as Bradford qualified as a team. I The top three individuals not bn qualifying teams earn region berths, which is how Alvarez and Union County boys golfer Devin Osborne .ach qualified. SOsborne shot a 41'and a 43 o finish with an overall score bf 84 at the district * -ournament. SUnion coach Duke Emerson believes it has been quite a while since a golfer from I.'. INTENSE SPEED Nexiel connects you in an instant i670 $4999 After $50 mall-in rebate. > Built.in Nextel Walde-Talkie > Bulit-in Speakerphone > GPS enabled > Web and emaill enabled Fair & Flexible'" Plans tartng at $2999/ . Heather Alvarez Union County has moved on to regionals and he couldn't be more proud of Osborne, who See GOLF, p. 8C NEXTEL I only from Sprint I 966-CELL Stalke (Next to Grannies Restaurant) ' :::". ."":.~... C-". ...o.': ",:. .,.:::::. ... ._ ,': : '2 .? :', ._. , C I , NETATNRZDWERS TT I CELLBITE 301 North & Pratt St. STAKE (Next to Grannles Rest, 2 blits. south I OHS) ORANGEPARK ALACHUA 904-216-6161 386-462-2164 i' -g Oct. 12, 2006 TELEGRAPH, TIMES & MONITOR-C-SECTION .Page 3C SCHEDULE OF PERFORMING ARTISTS AT THE WOMAN'S CLUB Saturday, Oct. 14 Indoor Stage Noon 12:30 p.m. 1:15 p.m. 2:00 p.m. 3:00 p.m. 4:00 p.m. Outdoor Stage 10:00 a.m. 10:45 a.m. 11:00 a.m. 11:30 a.m. Noon 1:00 p.m. 2:00 p.m. 3:00 p.m. 3:30 p.m. Pianist Benjamin Carter Vocal duet of Tiffany Johns and Bethany Osborn Violinist Amanda Spires Gainesville Youth Choir Kuniko Yamamoto Pianist and composer Samuel Smith U.S.A. Gymnastics Branford High Dance Team Salsa queen Maria Stephenson Bass Country Cloggers Islands steel drum duo of Bahama Pan Dance with Next Generation African drumming ensemble of Lost Safari Celtic traditional music with Kanapaha Bluegrass & gospel with Lonesome Highway Shriner's Parade-Saturday, Oct. 14, at 11 a.m. Sunday, Oct. 15 Indoor Stage 1:30 p.m. Starke Dance Academy 2:00 p.m. Tammerlin 3:00 p.m. Bluegrass with Megarh and Racheal S Outdoor Stage Noon Guitar and vocals of Edy Richman 1:00 p.m. Florida folk songs by Emmett Carlisle 3:00 p.m. Blues by the Reeves Brothers 4:00 p.m. weat Southern gospel & contemporary Christian music with Camela Hodsdon Local artist returns home Japanese storyteller uses music, origami and magic BY TERESA r STONE-IRWIN Telegraph Staff Writer 4.; TRl A 1 downtown Starke BY TERESA support media, such 'as drawing, painting and sculpture STONE-IRWIN watercolor paper, canvas and for 30 years, Sheila retired from Telegraph Staff Writer fine art paper. the Flagler County Public If you get fooled by a pitct For almost 20 years Sheila Each image is produced as an School System in 2005. with less than two strikes, Crawford was a painter, one original limited edition print of Crawford was a painter, one 50or less. She now devotes her time to take it. who specialized in a style she Sheila grew up in Lawtey. the art show circuit. Says -Ted Williams describes as "photo-realistic where she attended Bradford Crawford, "I still have family in collage," where she uses High School. She also attended Lawtey, and I am very excited acrylics and an airbrush to the Uni'ersirty of Florida, and about returning home and To his dog, every man is complete the paintings. went on to rece, e her having the opportunity to Napoleon, hence the7 Today she is using the same bachelor's degree in art display my work at the popularity of dogs. style that she once used in her education from Bethup e- festyivAl," -Aldous Huxley -paintings and is apolfying it to:, .oo ani .9 .j .. o .' I., u Hu ey ... digital photography... , Japanese storyteller Kuniko Yamamoto will enchant younger audiences using myths and fables from ancient Japan to both educate and am use. .. : I r In her show, "Origami Tales." Yamamoto uses her' .owhn handcrafted masks,, puppets and origami-the Japanese art of folded paper-as she makes flowers, animals, and even a 6-foot- long dragon come alive. A native of Osaka. Japan, Yamamoto studied traditional dance and music at the renowned Konishi School in Japan. She received national exposure performing Japanese storytelling at the Silk Road International Exposition and on Kansai National Television. Since her arrival in America in 1986, Yamamoto has performed in \enues such as the Leland Faulkner Light Theater, the Kennedy Center in Washington D.C., and the Epcot Japanese Pavilion, as well as hundreds of schools, colleges and theaters, all to rave reviews. With the help of her husband, the world-renowned magician Jon LeClair, Yamamoto has been able to add subtle magic and mystery to her special performance. Origami Tales Artist: Kuniko Yamamoto Time: Saturday, 3 p.m. Where: Woman's Club, 201 N. Walnut Street in, x' Butler Seafood House & Grille 386-496-3700 This Week's "Lunch Specials" $7.95 S I / I / II "i .' pi ',/ -'Id Lunch Specials include leltuce, tomato orn , pickles & Frencn fries served on a corn dusled Kaiser roll i our choice of bet erage included' 1 TUES Grilled or Blackened Chicken Breast WED io/. certilied Black Angus Hickori Burger glazed u/TBlQ Sauce & Nlehed Cheddar THURS Chopped Smoked Pork or Turke3... slon cooked in our in- house open pit! FRI Grilled or Blackened Mahi SMahi SAT Our Famous Lighily Breaded Fish Sandich **Trii Bad Bo3 gnl ,a Hoagie Roll" photographs, scans; them onto her computer, and uses Adobe Photoshop to manipulate and enhance them. When desired, she. adds photographic effects such 'as cyanotypes, where chemicals are absorbed by the material or object it is being processed on; solarization, the exposing of a photograph to different light sources while it is still in the developing stage; or selective colorization, putting partial color into selected areas of black and white photos. Crawford's unique style is further enhanced with the added touch of three-dimensional objects. By implementing a technique referred to as "camera-less photography," an image can be produced from objects that are, placed on photo-sensitive paper and exposed to light Once they are complete, Crawford's images are printed with a large format printer using archival inks on a variety of Hope Christian Academy "Helping children Achieve open from 6:30 a.m. to 6:00 p.m. 2 year old through 12th grade .. IMMEDA TE Traditionalclasses I M M E'DIA T E, 0 A R& kB ,Tn .tIi OPENINGS! Call today or stop by for a tour! Coming Soon! Hope Athletic League! Sports program beginning in November For more information call 904-966-0112 eWA j:a o Link. t Literac IJuso in K2-K4 SA Beka used in K5-8th grade * Alpha Omega used in 9th-l2th * Providers of Episcopal, VPK, CTC & McKay 1irrr: b :t. Scholarships * Active PTF Mention this ad and receive S' off registration! ' 3900 SE State Road 1oo Starke, FL.32091 352-473-4040 A ministry of Hope Baptist Church SCOOPER & ADAMEC Zfttor~neps: & oune~tor~ at JIt~at 904-964-4701 LOCAL ATTORNEYS REPRESENTING THE INJURED IN NORTHEAST FLORIDA PERSONA I NJURY SL&FL LW I loo West CallStreet, Starke, Tlorida 32091 The hiring of a lawyer is an important decision that should not be based solely upon advertisements. Before you decide, ask us about our qualifications and experience. j Racing for Jesus 1 Want to do something exciting for Jesus? * Come join our Teens For Christ Youth Group, and build a dragster for Jesus. Teens from 13 to 19 years of age are invited, boys and girls, to join us in Racing For Jesus. All members will have a hands on experience in building the car. Let's go Racing For Jesus. For more information call Pastor Leon at 964-3189 Full Gospel Assembly f1111111111 liuilitmfliMuO^ 1111 I f . I I I ... , I , Kuniko Yamamoto uses music, origami and a touch of magic in her show "Origami Tales." 7 f 411010. Ao r 1 i $ ri Page 4C TELEGRAPH, TIMES & MONITOR--C-SECTION Oct. 12, 2006 .Goat Ranch tournament is a huge success BY BUSTER RAHN Special to the Telegraph The first-ever Goat Ranch Golf and Poker Invita~tonal;, which is being planned as an y annual event, was held at.the Starke Golf and Country Club on Sept. 28, restricted to former "High Rollers"' who played golf Wednesdays, and poker that night. There was unconfirmed talk the group played for high stakes, but the amount of money that changed hands was a closely guarded secret, and 'rank-and-file golfers could never know for sure. ": M High Rollers were composed largely of community leaders who obtained the land and built the golf' course, and contributed 'to the local economy through; volunteer r S efforts and/or their business and professional lives. While they loved to play golf. the majority of them '%ere to be found in church on Sunda\ mornings. Their reign began .\ith the building of the golf course in the late 1950s and continued into the 1980s, when Dwight Eder lineup old age and death began to a.putt. invade their close-knit family Buford "Blue" McKinney cones close to the hole in the Goat Ranch Golf Tournament. of associates,, The group that met and played golf on .S-ept. 28-approx\imately "'.30 strong-didn't resemble the golfers they once were, but 'what they lacked in finesse on the course was offset by the camaraderie of the past. While hnam-es of absent members M. won't be mentioned for fear of leaving someone out, the ghost of Dr. Herlong Adams was present on the course in the minds of many, along with Jim Brown Godwin, who was a commanding figure in 'any group. Those two, and many others, left their footprints on the fairways and greens of the Starke 'golf -course and, contributed to its remaining 'open during some difficult times. .By one count, 25 of the 27, invited to the, tournament were able 'to attend. It was determined, after the 18-hole round of golf was played, that some players shot lower scores than others, but everyone was declared a winner, and the group planned to return for an encore. The golf game, however, was just one of the three main attractions. Sir Byron Terwillegar (note the title), owner of. the acclaimed Blue, Water Bay restaurant in Melrose, catered. .dinner for members of the Goat Ranch Club named years ago by Tombo Smith), consisting of a laige prime rib steak cooked to perfection. with all the accompanying fine. =wIn M.4. In' win 1. Anyone. e\cepl TtRlh riqap employees and their immediate family members. ivs welcome to, enter. One entry per person pcr \\eck please. Persons winning one week are not eligible lio win again for at least three weeks. 2. When picking up winning,, the vLinner will ha\e his or her photograph taken for the papcr. 3. Entry must he on an ollicial form from the Telegraph and 'submitted to one of our offices:- 131 W. Call St., Starke, 125 E. RULES OF THE GAME Main SI.. Lake Builer or 73.S2 SR-21 N; kesNtone Hecihisg h-l'ore 4pm each Fria\ lor ihatl \\ck's g.mnli. Fill in all ihi: blanks %\ ilh the name 'It ihi icam 'iou think '.ill '.in. The person % ho picks ihe imo',I gamncs corrccils % ill % in % Itll cuah. 4. In c se ol a lie. ihe i 'tal points scorcj d n ihi GATOR game each week is the tie breaker. Please fill in the points you think will be scored by the GATORS and their opponent, combined. in ihe tie breaker hlank. ( For instance, it ihe score ti ihe GATORS game %\as G ATORS I), opponent 7. the correct scort \\ill be 26 points ) 5. Decision of ihe judges is final. A second tie hreaker \\ ill he used. if necessary. Results \ ll bhe lubulatcd .on Tue-,daN -. and % inner nocilied hy telephone. Don't target to list a phone number where you can be reached. Your Dodge Truck Headqus r art SPORTIN ; NNINGSINSATION SIBradford C H ANCE o6. 33 0 A and'PAINTERS, Inc. S- at HA NCE 207 Orange St. 964"43300 ak dourdt ric bil lighter (your home brighter " E Keystone Florida at AuburnVanderbilt at Georgia (877)2294180 (352)373-744 904-964-3200 15000 U.S. 301 South LARGE PEPPERONI PIZZA FSU at Duke 1-800-788-3001 Starke 211 S. ORANGE ST., STARKE 964-7434 1 All Day Every Day Locally Owned & Operated ow O Spires "Hometown Cathyke BradVordPre-Schoo[ OFFICE MANAGER 386-496-3361 Proud" Or a nOSh owner Linda Bryant t 97 386-496-3361 Jari Jackson . Michigan at Penn St. OFFICE ASSISTANT r Prio ity Child care for ages I & up Florida International at Miami%. 2 miles south of Starke on US-301 Florida International at Mia Ohio St. at Michigan St. A904-964-7200 610 SW 1 St St., Lake Butler Ole Miss at Alabama c,.. IL L- , ad 4-wG4-/uo Visit and contact us at: spiresiga.com 107-F Edwards Rd., 904-964-2363 407W. Washington St., Starke ... Sweb address: ww.GetYourFord.comisitan ntactus sprega.com Starke, FL (next o Brdord igh School) ,.., 9644361 SAWYER GAS (OF STARKE PROPANE SINCE 1961> 1Wendell Davis, District Manager Kentucky at LSU US-301 S, Hampton Just 1/2 Mile South of the Gate Station At 301 8 18 (352) 468-1500 1-800-683-1005 SCapital City Bank 350 N. Tem Starke, FL (904) 964 Syracuse at West Virginia iple Ave. 500 Green Way S.R. I1OOE .32091 Keystone Heights, FL 32656 -7050 (352) 473-4952 KIRBY LASER AND NEEDLE EMBROIDERY -'ENGRAVING SCREEN PRINTING Arizona St. at USC OW rlnid~ OiPRlATy OWNER and OPERATOR . 50 E. Main St., Suite A Lake Butler, FL 32054 Phone: 386-496-3792 Fax: 386-496-3796 Whispering aks "BRAND NEW" COMMUNITY APARTMENTS Houston at Dallas 900Wae" 904-368-0007 starke AL MI -IXXItaP#AX I! INSURANCE D Sabrina L. Roberts 737 S. Walnut St. AGENT Starke Cincinnati at Tampa Bay (904) 964-3375 = .t:1 1 i:1 M^I K v D ]!]l,[t :11:1[ 1'1"v.' , US 301 S, STARKE, FL GREAT-STEAKS AT A GREAT PRICE! Kansas City at Pittsburgh 964-8061 Ballet* Tap* Jazz* "- / Lyrical 'Hip-Hop. S'ARKE ACADEMY OF Modem I Ages 21 and older f Seattle at St. Louis ,904) 964-5277 417-E West Edwards Rd. 904)64-5277 Starke Jones Funeral Home HOSPITAL EQUIPMENT MONUMENTS PRE-NEED'PLANS Dedicated Service For Over 88 years STA RKE KEYSTONE HElGHTS 964-6200 473-3176 Steve & Cindy futch Maryland at Virginia OWNERS Serving A.fFYaitus; ,_'r.'"s Io I Miami at N.Y. 230SN. TempFleAve. 96 You're a Winner with Sonny's Jets 4-8840 ' / Philadelphia at New Orleans /-ECHEVROLET OF STARKE (904) 964-7500 US-301 North J 1 .RRL-.1 .CHFVV Jackson S Building Supply Proudly seria our community for over 48 years! Starke US 301 South 964-6078 Oakland at Denver John3,1 Lake Butler 145 SW 6th Ave. 496-3079 Handi-House Portable Buildings , Over 65 buildings in stock! ',wII'd,,i."nIIItI'I-mSut lriaa ..... "* "' South Florida at FINANCING AVAILABLE! North Carolina 904-964-3330 US-301 S in Starke i*. Community Established in 1957 State Bank No cut-off time on deposits N.Y. Giants at Atlanta STARKE LAKE BUTLER 811 S. Walnut St. = 255 SE Sixth St.- [904-964-7830] MER. (386-496-3333] Southern Professional Title Services, Inc. "Cwk forthte Zdwr" Carolina at Baltimore Lake Butler 235 SW 4th Ave., Ste. s 386-496<-0099o Starke 704 N. Lake St. OftAIOAI C72 SwRptw iness Center Bradfprd '"om 's Premdietrleakh (Jab f7' Experience The Difference! San Diego at San Francisco *. Bring in ihis ad for a free week membership! 418 West Call 904-368-8101 HAYES ELECTRIC AND AIR CONDITIONING Corner of S.R. 16 & 301 N (904) 964-8744 -. Wake Forest at RESIDENTIAL N.C. State aste r L I rnsed S#li. ER-0003575 RA.0033644 Insured Jackson Building Supply Hayes Electric Jones Funeral Home Capital City Bank Sawyer Gas Sonshine Title Jennings Insulation Mr. Auto Little Caesars Sporting Chance Bradford Pre-School Town and Country Ford Results Fitiless Center Community State Bank Kirby Laser 6 Needle Siarke Academy of Dance Spires Grocery Beck of Starke Sonny's Restaurant Chevrolet of Starke Western Steer Whispering Oaks Southern Professional Title Service Handi-House TIEBREAKER SCORE: Name: Address: Phne.- a Sam urn, Van Dubolsky of Starke Nissed 2, won w/tiebreaker F L YU4-Y04-00 / L mum;lh cuisine one can en% ision for a memorable meal. The group, after dinner and chit-chat' of a social hour, retired to the game room for a round of poker, reminiscent of the old days when the game was played frequently, but the stakes were not reported. It was reported, however, that one individual garnered most of the chips, but his name will remain anonymous in deference to his creditors. It was a great day for the Goat Ranchers, and also for. those of us who knew them as friends, even as we played in other groups. The joy in seeing each member was tempered by the memory of those \%ho haxe' gone before us. They were our friends, also. Those who participated in the tournament were: Jim Biggs, Richard Gaines. David Elder, Richard Burton, Buford McKinney, Joey Bridges,) James Womack, Greg Nichols, John Riggs, Bob King. Bill Adams; David Tew, Tom Smith, Jimm. Epps. George Fish, Jack Hazen.. Clyde Terwillegar, Scott Roberts,. Terry Gaines, D' eight Elder,; Mac Williams, George Roberts. Larry Mercer, Hal Seymour. John Fry, Charley FI nn and Wiley Clark. ' I i Oct. 12, 2006 TELEGRAPH, TIMES & MOIlTOR-C-SECTION Page 50 BIRTHS Pictured (1-r): first row, Wei Lin, Raeann Roberts, Rachel Latham; second row, Kimberly Tate, Rebecca Corbitt, Jessica McKinney, Deborah Cilley, Jabreena Jackson, Amy Morton, Patricia Corbitt; third row, Sheryl Meng, Emily Sellers, Brandi Donahue, Mindy Fulton, Sara Stills, Vanessa Warren, Claudia Edwards RN, Core instructor. In the program, but not pictured is Sharon Moncrief. CNA class ongoing at B-U Tech Center The Bradford-Union Area Career Technical , Center started its CNA class on Aug. 15 The Core class is a 90-hour course that meets tor four-hour sessions on Tuesday .and Thursday nights. Claudia Edwards, RN, is the Core. icacher. Bobick and Schr Jerry and Pani Bobick of Keystone Heights and Michael and Hollie Schrader of' Hamden. Conn.. announce the engagement of their children. Nicole Kristin Bobick and Ke.\in R\an Schrader. Nicole is a 2001 graduate of Keystone Heights High School. She is presently employed by the Greater New Hasen OB G n Group. Ke in graduated from Hamden High School and is employed by the U.S. Postal Ser,. ice. The wedding %.ill lake place on Saturday. Aug. 4, 2007, in Gaines, ille. Clinical is taught on Monday and WLdnc.daJ night. which started oul in the class rom seating. and ihcn hands-on Iraining thal is dJnic on all shifts, at Windsor Mannr Nursing Hmme in Starke. Clinical is instructed by Raihin Garland. RN. BSN. ader are engaged McClellan and Hall to wed Oct. 14 - IL '- Kevin Ryan Schrader and Nicole Kristin Bobick BHS Class of |WORTH NOTING Shands at Starke Auxiliary has 76 is having available several volunteer opportunities including gift shop, a reunion reception desk, \X-ray, medical rreords. nlatient services and filino meeting The Bradford HigliSchpol. Class of 1976 is having a meeting to plan its 30-year reunion. The meeting will begin at 7 p.m. on Tuesday, Oct. 17, at Western Steer Steak House in Starke. Classmates who hase not received an invitation should call,(904) 964-8923 or e-mail ,bhsreunion 1976@v ahoo .com. The deadline has been extended until Saturday. Sept. 30 The Lawtey Recreation Board meets on the second Tuesdayt of the .month at 7 p.m. For information call Helen LeN.angie.0 352'i 47'3-8580. Dolores Morgan, (9041 96,4-5748KX4,.,r . McKinle., (904) 964-72,4. or Sharon Gaines, 1904) 964-6009. THREE GREAT CHOICES. YEAR-LONG SAVINGS. Get DIRECTV and lock in the best price on the best programming for 12 months. WITH DIRECTVYOU S100 mail-in rebate. Programming and DVR Service commitments required I i t, ., ., ,. ,M EMO Bobbie H. McClellan and Hubert A. Hall, both of Starke. announce their upcoming marriage. The bride-elect is the daughter of Richard and Juanita Norman of Raiford and the late Bobby S. Hardin. She is a graduate of Uniori County High School. She works ,at Joli Cheveux Salon and Spa and is a member of Pine Grove Congregational Methodist Church. - The groom-elect is the son of Rodger and Cordella Hall of Brooker. He %works for CMC Joist and is a member of Pine Grove Congregational Methodist Church. The wedding will take place on Saturday, Oct. 14, 2006, at the Conference Center in Starke. A reception will immediately follow the ceremony. , Family and friends -re.; invited. *. * Ocer 155 ol our Fsaorite Channels * LcalI Channels Includeo| Choose 0 ortar * Over 185 Channels * Get 9 Channels of SHOWTIMEUNLIMITED or 12 Channels of Starz Super Pack * Local Channels Includedi SAVE Gei::s" and/ x4z Choose HD package or DVR Service. * Over 185 Channels * Get 9 SHOWTIME UNLIMITED and 12 Starz Super Pack Movie Channels * Local Channels Includedl * Get Incredible Programming with the DIRECTV HD package or Choose Our Fantastic DVR Service Call today. Offers end soon. Western Auto of Starke "3tawme .mned wA (90e4 40 -1at" YReae", t. 312 W. Call St., Starke (904) 964-6841 tgepe An Authorized DIRECTV Dealer DIRECT .- i-~~,Ii .. ..... ,..... ........,.,,,,,,e,.. .,a4a ....dva.rM~iraa~tiatA.iahl .OIO i, Kaeleigh Johnson ' EJ and Rhiannon Johnson of Gainesville announce the birth of their daughter, Kaeleigh Anne Helen Johnson, on Sept. 25, 2006, at North Florida Regional Medical Center in Gainesville. Kaeleigh weighed 6 pounds, 10 ounces and measured 19 inches in length. Rhiannon is a graduate of Bradford High School. EJ is a graduate of Gainesville High School. Maternal grandparents are Gail Hiller of Alachua and the late Daniel Townsend of Clark Lake, Mich. Paternal grandparents are Eddie and Joeann Johnson of Gainesville. Alexis Lane Mr. and Mrs. Thomas E. Lane of Alachua announce the birth of their daughter, Alexis Nicole Lane, on Sept. 20. 2006. in Gainesville. Maternal grandparents are Mr. and Mrs. Patrick B. Welch of Starke. Maternal great-grandparents are Mr. and Mrs. Thomas O'Brian of Starke. Paternal grandmother is Diane Lane of Alachua. Three Wishes Inc. makes availabki power (electric) wheelchairs to senior citizens and the permanently disabled at no cost to the recipient, if they qualify. The power wheelchairs are pro% ided to those who cannot walk and cannot self- propel a manual wheelchair in their home, and who meet the additional guidelines of the program. No deposit is required. Call toll free, (800) 817-1871, to see if you qualify. "Fighting Inflation" WALK-INS WELCOME ,vl I a.I b, ,. ,.I ,l .;,,I;i , ton S. WaVlnu Si. Sl.;Fke. FL 904-964-3338 Muon-Sat 10-5 a~ I '1.' a*. 1- 'I I WORTH NOTING Health Start or North Central Florida Coalition is seeking a volunteer board member. Healthy Start provides services for high-risk women and children up to 3 years . old. The coalition is seeking a volunteer to serve on the board wvho either has been pregnant and accessed prenatal care or who has small children and has accessed health care for his or her children. The member will attend once-a- month boaid meetings in Gaines.ille. Contact Celia Panier. (352) 313-6500, ext. 118 for additional information. Starke Lions Club meets on the second and fourth Tuesdays.of the month, 7 p.m, at Western Steer Steak House in Starke. For information call Angel Hill, (904) 364-6215 A meditation and stress control workshop is held ever Thursda, at -6 30 p.m at the Senior Health Care Center. Call to register (904) 782- 1069 Bradford Lodge No. 35 F&.AM, at the corer of Orange and Call streets, in Starke has slated communication, on the second and fourth Monday of the month at 7-30 p.m and a covered dish dinner on the second Monday at 6:30 p.m. The Alachua County Organization for Rural Needs (ACORN) Clinic offer's free mammograms and annual pap smears to omenn 50 and older who ha\e little or no health insurance. Hours Mon.-Thurs., 8-30 a.m -5 p.m.; Tuesda. night clinic. 7-9 p.m; Friday, 8:30 -11 a.m ACORN is located in Brooker Call (352) 485- 1133. DR Power Equipment * DR Trimmers :*, & Mowers DR Field& \ Brush Mower & 42" Mower Deck Accessory DR Power Wagon DR Chipper DR Wood Splitter Neuton Cordless Battery Mower Neuton Cordless Battery Garden Car, Come in & see our Showroom Display... Ask for Bob Paine Bryan's LAWN & GARDEN B ry an s A ti- STORE 352-473-4 01ni Oper, Tues Sai am n-r. 101 Commercial Dr 352-473-4001 Closed Sunday & Monrday Keystone Heights. FL a .-. , ....^ .'' '' '""''v'-: d, ;i +: : 0 O Ch lId I' plcyy / "..1- . *' .' If you live in Starke, that's how simple it is to find healthcare services for your children. The Shands Starke Medical Group includes board-certified pediatricians and a pediatric nurse practitioner who provide care for newborns to teenagers. including: School Physicals I Well Child Check-ups Treatment of Childhood Illnesses Immunizations 1550 S Waters St Starke. FL 32091 904.368.2480 Shands.org ShandsStarke MedicalGroup , ,~rn.,.,,.... .. 1'.u.aen..., n~..,. m .- rr..,ne n,,.-,.,.m..s.r-.-wnrv.r.a..dr. r J &ROverhead METAL SALE 36 inch wide metal in various colors. CUT TO LENGTH. 352-473-7417 I i I I I,, __+_ ': , 0 . 01 111 A&D I Page 6C TELEGRAPH, TIMES & MONITOR-C-SECTION Oct. 12, 2006 Late score lifts Indians to 14-7 homecoming win BY ARNIE HARRIS LRM Staff Writer, . Keystone Heights football fans were treated to a nailbiter of a game on Homecoming as the Indians took a 14-7 lead- with just two minutes left in the game and held onto it for a victory on Oct. 6. The Indians (5-1) struggled with continuity on offense,.but two big plays-including Josh Mangus' game-winning 42- yard touchdown. reception-were all the team would need. The defense kept Newberry out of the. end zone after the Panthers scored approximately six minutes into the game. Newberry running back Antwan Ivey got his yards--151 on 18 carries-but he was held in check for the most part as far as big-play runs were concerned. Keystone head coach Chuck Dickinson said his. defense, after Ivey's 37-yard touchdown run, adjusted to the running back's speed and". altered its pursuit angles. "Thel defense played extremely well," Dickinson said. "If they hadn't played as well as they did, we probably wouldn't have won the game."' Newberry (4-2) drew blood on its second drive of the game after a Keystone -fumble. Starting at their own 49, the Panthers let Tvey 'carry the ball" four consecutive times, .with. the back-after a spectacular cutback to the right after finding no running room in the planned direction-dashing into the end zone on the fourth carry. That put Newberry up 7-0, and the Panthers began what looked like another promising drive- after forcing the Indians to punt on their next series. Newberry advanced the ball. from its own .15 to the Keystone 45, but a fumble was Cameron Yarbrough (shown making a catch in last week's game against West Nassau) came up big on defense for the Indians in their win over Newberry, intercepting a pass in the third quarter. Keystone's first touchdown of the game followed two plays later. re'coered by Keystone linebacker Jack Taylor. It only took one play from scrimmage, however, for the Indians to return the favor as running .back Matt Story .:oughed up the ball to Newberry. Through 'the remainder of the half, neither team was. able * to sustain a productive drive as the game became more or less a punting contest. Keystone's offense ran just 16 plays from scrimmage in the first half. Dickinson said mistakes b3 the Indians were a reason for .that, but also credited Newberry for its game plan on defense. "'Nevberrm played tough," he said. "They've got a good. football team." The Indians steadily moved the ball from their own 29 to Newberry's 22 on the first drive of the second half, but Keystone turned the ball oler on downs as quarterback Blake Lott had no success connecting' with his receivers on the last t6.o plays. Newberry took over and, moved the ball steadily downfield to the Keystone 42 before quarterback. Guy Brown attempted to hit receiver Matt Robinson inside the 20-yard line. The perfectly thrown pass landed not only in Robinson's hands, but also into those of Keystone defensive back Cameron ;Yarbrough. The two wrestled fiercely for the prize for a second or- two before Yarbrough emerged with the pigskin and raced 35 yards up the sideline to the NewberrN 45 Two plays later, on second- and-2, Greg Tailor took a handoff from Lott and dashed -16 'ards to knot the game-after Michael NlcLeod's PAT-at 7-all with 3:03 remaining in the third quarter. Taylor finished the game with 87 yards on 13 carries. ; Keystone's defense stopped another Newberry drive on downs after the Panthers advanced the ball 39 yards Into Keystone territory.. thwarted. As the final minutes of the ,game ticked away, Keystone began a drive on its own L1. The running of Story and Taylor, along with an 18-yard reception by Yarbrough, advanced the ball to the Newberry 42. Lott then dropped back in the pocket and uncorked a long pass to NMangus, \ ho %%as racing deep up the right side. Mangus snagged the pass over his left shoulder at about Newberry's 25 and outran his defender to. the end zone.' Mangus finished the game .with 66 yards on three receptions. Thanks... Dickinson wished to express his thanks to Ke %stone Building Center, Tru-Value and Lee Crane Insurance for sponsoring the pre-game meal and the Kiwanis Club of the Lake Region for manning the concession stands. Score by Quarter NHS: 7 0 0 KHHS: 0O 0 7 0-7 7-14 Scoring Summary N: Ivey 37 run (Warner kick) K: Taylor 46 run (McLeod- kick) K: Mangus42 pass from Lott (McLeod kick) Team Statistics K First Downs 10 Rushes/Yds. 28-133 , Passing Yds.. 104 Passes' 6-16-0 Punts. 5-35 Fumbles-Lost 3-2 'Penalties 4-25 Knowledge-full, unfettered knowledge of its own heritage, of freedom's enemies, of the whole world of men and ideas-this knowledge is a free people's surest strength. -Dwight D. Eisenhower Alan is a gregarious animal, and much more so in his mind than in-his body. He may like to go alone for a walk, but he hates to stand alone in his opinions. -George Santayana SAN ATrFO SrAFOOQD ?re'sh iried -in KH volleyball team drops 2 straight BY CLIFF SMELLEY Telegraph Staff Writer Keystone Heights defeated Inierijchen on., Oct.- -3 to complete a sweep of its fellow District 6-3A volleyball opponents, but the. Indians have since dropped two straight matches, bringing their record to 14-10. The Indians have lost four of their last five matches, but all )bt one of those losses have '- come against bigger schools. On Oct. 4, Keystone lost to .isitine Bishop Kenny in four games. Mallory Wasik had 17 kills for the Indians, while Katie Taylor had eight., Wasik also had 12 digs. Michelle Houser led the 'team in digs with 15, while Russell contributed 11... Russell and Lori Albritton had 15 and 13 assists, respectively. Keystone traveled to Nease on Oct. 9, with the host Panthers recording a 3-0 (25- 12, 25-15, 25-20) win. Wasik had 11 kills and 14 digs, while Russell had 12 assists. 'S. Count on it. FREE DELIVERY N.E., FL.. House and Taylor had nine and eight digs, respectively. Tysee Williams led the team , in serve ice aces with.three. ..Key stone wraps up the' regular season tonight, Oct. 12, against St. Johns Country Day at 6 p.m. in Keystone. The team's seniors will be '20% OFF MSRP FINANCING AS LOW AS 0% TORO SPECIALS Z500 52" 25hp MSRP $8,797 SALE $6,800 . Z593 52" DIESEL MSRP $12,858 SALE $9,800 Z557 72" 27 hp MSRP $11,682 SALE $8,700 recognized. The D)istrict 6-3A tournament., which h will be hosted by Inlerlichen High 'Scool, 'begin s Monda,' Oct. 16; The Indians, as the top seed. will not play until the semifinals on Tuesday, Oct. 17, at 6:30 p.m. Starke SGolf & Country Club -. Banquet Facilities Clubhouse .- ,Driving Range Gift VISIT OUR PRO SHOP GOFAi[STOASIRTSI c G MEMBERSHIPS AVAILABLE SNO INITIATION FEE. t FAMILY-SENIOR- SEASONAL OR 904-964-544 I STUDENT AVAILABLE 9 LSR-230 E (2 miles east of US-301) Starke B.I.G. 11L--L3,J~ PARTS & SERVICE If KeN stone ins that match, it will, plaN for the championship on Thursday,, ,Oci 19, at 7 .p m. I .; : < '.r :1 t^' .*' A r 480 S. US HWY.17, Conveniently located at SFCC Andrews Center Starke Earn your Bachelor's Degree iri:, * Criminal Justice * Elementary Education * Psychology * Human Services * Business Administration Management Continue your education by earning ydur degree from a highly respected academic program that prepares you for a successful career in Criminal Justice, Elementary Education, Psychology, Human Services or Business Administration Management at SFCC Andrews Center at Starke. Call to speak with your personal admission counselor. H ~ A H A A A A A A A A A A A A A A A A A A A A 'I IjI .1. HUSTLER SPECIALS * FASTRAK 17hp 42"......................... $3,700 * MINI Z 19hp 42"............................... $4,700 * MINI Z 19hp 52" ......... ................. $5,900 * HUSTLER Z 23hp 60"...................... $6,900 * SUPER Z 30hp 60".......................... $8,200 * DEMO SUPER Z 27hp 60" 7hrs........$7,700 A A A A A A A A A SI1i . * Classes designed for working adults * Affordable academic excellence * Financial Aid programs available * Approved for VA Benefits Personal attention ll1 SA Whol Y. O d o dI wr t,* P" 'M 901. FoundeId 889 Li I,, - For more information call: (904) 964-5382 (352) 395-5850 or (352) 395-5926 N 14 19-217 32 9-20-1 5-36 3-1 6-42 TRACTOR SUPPLY 24541 US Hwy 301 N. Lawtey, Florida 904-782-1130 Fax: 904-782-1063 FALL SALE Classes Start October 23rd! gainesville :-r-~-x-~-~-i-~-~-~-IIIlr-~~~-~~-~-~-JI ~.rXnnrxllx~a)IlrrrrrlIIrrr~~~lIIL~ ~ % Oct. 12,2006 TELEGRAPH, TIMES & MONITOR--C-SECTION Page 7C. BHS handles -V ang uard this year, wins 28-16-6 BY CLIFF SMELLEY Telegraph Staff Writer Jernard Beard scored two touchdowns and the defense turned in a solideffort as the Bradford football team- defeated visiting Ocala Vanguard 28-16 on Oct. 6. "The kids really wanted it and we got the job done," Bradford head coach Chad Bankston said. "It wasn't pretty at times, but we got the job.done." Bradford's offense misfired at times, had trouble holding onto" the ball with four fumibles-the Tornadoes recovered all but one--and gave Vanguard two points when quarterback Antwan Brown was. sacked for a safety. However, there -was little doubt the. Tornadoes (4-2) were going to win the game. Bradford, after recovering a fumble on a kickoff, got a 3-' yard touchdown run from Beard to go up 21-2 late in the second quarter. The Tornadoes would not score again until late in the fourth quarter, but they had plenty of points for the defense to work with. The Tornadoes held Vanguard to approximately 50 yards and three first downs in the first half. The starting defensive unit gave up less than 120 yards and just five first downs before some younger players were put onto the field late in. the game. That's when Vanguard scored its only two touchdowns. "Truthfully, that game could've easily been 28-2," Bankston said. The coach. added it .was especially gratifying to defeat the Knights after what happened in last year's game between the two teams. Bankston wouldn't comment specifically bn the matter, but the Torandoes were penalized 19 times in last year's :18-13. loss, which,included two dead- ball penalties after one play that- put Vanguard at Bradford's 5-\ard line with 20 *seconds left to play. That set the Knights up to score the winning touchdown. There were no such issues this year as the Tornadoes were penalized only five times. "We still made a ton of mistakes,at times, but for the most part, the kids played hard," Bankston said. The Tornadoes wasted little time in scoring. Jawan Jamison, who led all rushers with 183 yards on 15 carries, scampered 44 yards into the end zone to cap a seven-play, 80-yard drive that put Bradford-with ,Glen Velasquez' PAT-up 7-0 just three minutes into the game. Vanguard (2-4) made its one serious threat against. the Bradford starting defense on its first possession. ,Quarterback Marquee Williams completed a 12-yard pass that moved the Knights to the Bradford 39, but the drive stalled as Vanguard turned the See BHS, p. 8C Indians, Tornadoes set to meet in key district game BY CLIFF SMELLEY Telegraph Staf '11 ritet Four teams are currently tied *for second place in District 3- 2A, but that field will be narro\\ed after games on Friday, Oct. 13. Bradford and Keystone Heights are two of those teams v\ho are vying for a playoff berth behind district leader Bolles and they will face each other tomorrow in Ke' stone at 7:30 p.m. The i%.%o teams, along with Ribauli and West Nassau. each have a 1-1 district record (Ribault plays Bolles tomorrow and West Nassauj plays Interlachen). Bolles sits .atop the district with a 2-0 mark. "Bol1e| is thEiTnl earn al .'- has handed Keystone a loss this season. The Indians (5-1) ate coming off of a 14-7 homecoming: win over Newberry. , Keystone's offense has generated 1,044 rushing yards this season (174 per game). Junior running back. Greg Taylor leads the way both rushing and scoring. He has seven rushing touchdowns, three of which have gone for better than 30 yards. He had a 46-yard touchdown run and rushed for 87 yards on 13 carries in the win over Newberry. Taylor also has four touchdown receptions on the season. Senior quarterback Blake Lott has completed 48-of-99 passes for 709 yards, nine touchdowns and just one interception. Senior wide receiver Josh Nlangus has three, touchdown receptions, including the game-vwinner-a 42- yarder-against Newberry. ::Sophomore Cameron Yarbrough has two touchdown. receptions and has scored three' overall as a member of the defensive unit.; . Yaibrough also has a touchdown on defense-a 103- yard interception return in a 35-6 win over Fort White. He has three interceptions total this season. In all, Keystone's defense has forced 12 turnovers. The Indians have allowed 135- rushing yards per game and 129 passing yards per game. As for Bradford, which is coming off of a 28-1i, win over XVanguar'd, its defense is y'.iadingm -2q.rus.hngNar s perF game and .73 passing yards per game. The Tornadoes (4-2) have forced" opponents into committing 14 turnovers. Junior defensive lineman Chuckie Covington has caused two fumbles this season and has recovered three fumbles, including two in the win over Vanguard. Covington is the team leader with 67 total tackles and nine tackles for loss. Sophomore defensive back Eugene t Blye has two interceptions, while freshman defensive back James Jamison has returned one pick for a' score. Offensively, Bradford is averaging 277 rushing yards per game, with four backs, for the most part, splitting carries. Jamison has 515 yards on 60 carries, junior Rob Harris has 427 on 54 carries, junior 4PPOLRRIS MREjwICOMPfAt S---A--1 L S- K f K v 6 ~ 6 Jernard Beard has 285 yards on 42 carries and junior Dejor Hill has ,260 yards on 47 carries. , Beard leads the team with five rushing touchdowns - (Harris and Jamison each have four) and also leads the team with eight overall touchdowns. He has been senior quarterback Antwan Brown's favorite receiver, catching .three touchdown passes. . Brown has five touchdown .passes overall *and has completed 21-of-52 passes for 321 yards with four interceptions in- five games, (Blye had to play quarterback for Brown in a 22-8 loss to Baker County). Brown has seven touch,downis overall, having,,, rushed4 for twvo. . Th. Tornadoes are averaging 67 passing yards per game. See KEY, p. 8C Bradford running back Rob Harris (center) looks for a hole to run through in the Tornadoes' win over Vangauard. Harris rushed for 61 yards on 12 carries. LYCEUM SERIES 2006-C presents )7 IRISH TIMES October 24 7:30 p.m. Levy Performring Arts Center Enjoy Dinner in the Lobo Cafe at 6 pr. Baked chicken or corned beef and.cabbage. ,reo pilaf, yeast rolls, salad bar, cherry pic, choice of any fountain dnnk, tea oc coffee, I$B Including tax A, Individulu Itick Qt s an a at the o uffice thet day of Ohv perfort)aneo, .*b LAUCEC 'E tOse ITcn a FIND THE CA$H IN YOURHOME Florida Credit Union 8(tweoiw as6.7V1 l One Low Payment M 125% Loans Available Debt Consolidation 0 Automatic Payment Options Polaris of Gainesville 386-418-4244 1-888-567-1650 ',. .1" ,, -.. -, -. -, 't' 1,'" r.o b s'.'. d o. Starke 1371 S. Walnut (904) 964-1427 Florida Credit Union tSIJAj8tcia p olaPnsumo~ a mqvobtintheloap, 1ourAPRl lorenyonrad0 mio will tdemind hon putcmMlha o~ iium~rim ONOI An ayncho coosh. Elieraw dCkil og OStivorloaos bet"A $,lhaOl k $9,9998m IxtettvoM$318ad $151o. 1K% UV, sdolcmdttacrw lanI. LENDE -- Page 8C TELEGRAPH, TIMES & MONITOR-C-SECTION Oct. 12,2006 Things start well, then go bad for Tigers in 42-6 loss BY LINDSEY KIRKLAND Times Editor The opening kickoff of the Oct. 6 match-up between the Union County Tigers and the Baker County Wildcats seemed like the one to turn the Tigers' losing season around. Hotvever, the Tigers couldn't keep the momentum going in a 42-6 loss. e Aaron Dukes scored the Tigers' only touchdown of the night when he returned a fumble by Baker's Jamar' Farmer on the opening kickoff. On their first offensive possession, the Tigers t( -6) tried to punt, with the ball flying over the head of Austen Roberts. After he recovered the ball, Roberts' .pass fell incomplete, turning the ball over to Baker at the Union 26- yard line. The Wildcats scored just a few plays later, changing the direction of the game. :-. Within the first quarter, Baker (4-3) had scored three more touchdowns, with two 2- point conversions. Farmer BHS Continued from p. 7C ball over on downs at the 35. That one pass play - notwithstanding, the Bradford defense demonstrated on that drive what kind of night it was going to be for the Vanguard offense. Defensive linemen Chuckie Coington and Corian Garrison dropped running back J.J. Smith for a 1-yard loss on the first' play of the drive, and Garrison delivered a vicious hit on Akai Milson on second down, holding him to just a 1- yard gain. Covington finished the game with nine tackles, two sacks and two fumble recoveries. Two of Vanguard's next three possessions went three- and-out, while the third was stopped by an interception by Bradford's Eugene Blye. Still, the Knights made it a five-point game when Brown was tackled in the end zone for agafetai:'l Ml4'r44 mari6-of the second quarter. ' That's as close as the game would get. Jamison, after fumbling the ball and losing 9 yards, ripped off a 65-yard run on third-and-10 to the Vanguard 18. A 6-yard carry by Rob Harris, along with a: personal foul penalty on LEGALS. ADVERTISEMENT FOR BIDS BRADFORD COUNTY - SURPLUS PARCELS OF LAND Bids will be received by Bradford County Commission at thie Office of the County Clerk, 945 N. Temple Avenue. P.O. Drawer B, Starke, Florida until October 24, 2006 at 4:00 p.m. for the following described property: Two parcels of land located in the North one-half of the Northeast quarter (NE 1/4) of Section 24. Township 8 South, Range 22 East, Bradford County, Florida, locally referred to as lots 17 and 18 of an unrecorded plat of Paradise Lake Acres Complete legal descnptions and map are %aflable upon request at the CoI',.y Manager's Ofttice, located at 945 N Temple Ave, Starke, Florida 904-966-6339. Bids must be SEALED and clearly marked with the words "Bids for Surplus Parcels" and must be received by the Qffice of the County Clerk no later than 4:00 p.m. on October 24, 2006. Bids will be opened in the County Commission Meeting Room located in the North Annex of the County Courthouse at 945 N. Temple Avenue. Starke, Florida. Bradford County reserves the right to reject any and all bids. 1/52tchg.10/12 '(S. '7 -Y. S.. '7 3. 5- '7 5~ 3. I,. '7 3. 5- 'iT 5~ 3. made up for his fumble at the start of the game, scoring two of those first-quarter. touchdowns and finishing the game with three overall. The Tigers, despite a hard- fought game, were never able to get the game going back in their favored. Union head coach Buddy Nobles said, "I thought coach (Bobby) Johns and them did a good job preparing for the game, obviously better than I did our players." Nobles said the 'Tiger -players work hard during practice, and that the loss could not be attributed to lack 'of talent or work ethic, but 'rather lack of experience. "We had a bunch of mental mistakes' that a young .-. team" makes," he said. Leading in rushing and passing for the Tigers was Roberts.. He rushed for 4,1 yards oh 10 carries. while completing 6-of-25 passes for 57 yards and two interceptions. Brodie Ellis led in receiving with 29 yards on three receptions. Next, the Tigers get a week off before taking on District 4- 2B opponent P.K. Yonge on 'Friday, Oct. 20, at 7:30 p.m. in Lake Butler. Score by Quarter UCHS: 6 0 0 16-6 BCHS: 28 8 0 '6-42 Scoring Summary U: Dukes 10 fumble return (pass failed) . B: Lee 28 run (Holton run) B: Johns 4 run (pass failed) B: Farmer 28 pass from Holton (Moore run) B: Farmer 35 run (pass failed) B: Farmer 18 pass from Holton (Johns run) B: Ruise 30 run (run failed) Team Statistics U First Downs, Rushes/Yds. Passing Yds. Passes(C-A-l) Fumbles-Lost Vanguard, gave the Tornadoes Bradford a first-and-goal at the 4. ensuing ons Covington would eventuallN drove 50 yai cross the goal line from 3 score-a 5-y yards out, putting the reception by Tornadoes up 13-2 with 5:25 seconds remain remaining in the half after a failed two-point conversion. Bradford recovered a fumble on the ensuing kickoff and Score by Qua went on to increase its lead to VHS: 2 C 21-2. Beard, who had a 16- BHS: 7 14 yard reception on the drive, scored on a 3-yard run. Brown Scoring Sumi then hooked up with Michael B: Jamison 4 Kiser on the two-point (Velasquez kic conversion to send the V: Brown tac Tornadoes into the locker zone for safety room up by 19 points. B: Covington Vanguard drove past the 50 failed) on its first two possessions of B: Beard 3 r the second half. However, both from Brown) drives amounted to nothing, V: Milson 24 and Covington played a part in Williams (Smit that. He recorded a tackle for a B: Beard 5 p loss on the first drive after the Brown (Velasc Knights had given themselves V: McChristc a first down at the Bradford from Williams 25, then recovered a fumble on the second drive on the Team Statisti Bradford 41 I-yard line. T eiliighis' offense finally -.First Downs scored' on, a- 24 -yard, 'RushesYds. touchdown reception by' Passing Yds. Milson with 3:19 left in the "Passes game, with Smith's run on the Punts two-point conversion making Fumbles-Lost the score 21-10. Penalties 12 33-115 69 8-28-2 4-0 B .. , 19 37-297 69 5-11-0 2-1 recovered the ide kick, then rds for its final 'ard touchdown. Beard with 36 ning. rter 0 16-16 0 7-28 mary 44 run :k) ' ;kled in end 3 run (run un (Kiser pass pass from h run) ass from luez kick) on 64 pass (no attempt) cs B 20 3.2.'.;;, 53-2'90 .. 45 4-7-0 1 1-15 4-1 :, , 5-30 OPENING OCTOBER 16, in Starke 'After Hours Care See the Doctors at your c convenience after 6 p.m. Walk-ins Welcome 1 Se Hab/a Espano:i All major insurances accepted. S(904) 966-2400 Dr. E. Madan 319 W. Call St. Starke, FL .U U ' U U W U U V 11. 20-89' 1-24-1 3-41) 3-2 9-45 The New GRAND J 00/nfnwn O I V vw'vli S -.*... atd get SFinancing Sfor 3 Years Bi(, enough to do it RI(HL Snial/ ,uigh it)l i(.-1Rl!. LOW RATE FINANCING CI 9 C' CI I / 4502 NW 13th Street Gainesville c .' 352-376-4506 for up to ) OPEN: Monday. Friday: 8am. 5pm & Saturday: 8am -12noon 8 YEARS W.A.C composed of several golfers who didn't play last year. The Tigers capped the regular season by defeating Chiefland twice and !osing to Williston. .Against -Chiefland, Union outshot the Indians 165-220 and 174-213. Osborne was the leader for the Tigers in each Devin Osborne GOLF Continued from p. 2C exhibits a-calm demeanor on . the course. "He plays such consistent golf," Emerson said of Osborne, who finished with the lowest score for the Tigers in all but two of their 15, regular season matches. "He doesn't get rattled." . The Region 2 boys and girls tournaments will be played Monday, Oct. 16, at Turkey Creek Golf (Santa Fe is the- host school). The boys tournament begins at 8 a.m. and the girls tournament begins at I I a.m. Only the top two teams and top two individuals (regardless of whether or not they're members of the top two teams) advance to the Florida High School Athletic Association Finals, which will be held Tuesday-Wednesday, Oct. 24- 25, in Vero Beach. Tigers place fifth in team standings The Union County boys team wrapped up its season with a fifth-place finish at the District 4-A tournament. That left the Tigers out of the regional picture, but Emerson was more than pleased with the season the team had. The Tigers finished the regular season with a 17-4 record. "I really thought it was going to be a rebuilding, year" Emerson said, alluding to the fact that the team was .' KEY Continued from p. '7C A win tomorrow night will .certainly be huge for either team, but as last year showed, the loser still has.a chance to. finish as district ruriner-up with two more district games remaining. Bradford defeated Keystone 6-3 last year, but the Tornadoes would go on to lose their next two district games, while the Indians won their next two. Consequently, it was Keystone that took second place and advanced 10to the playoffs. That game between the Indians and the Tornadoes last year ended in bizarre fashion after it appeared Keystone was going to get the win. Keystone's offense had the ball and drove to the Bradford 30-yard line. but fumbled the ball away with less than two minutes remaining. Bradford match .with scores of 38 anF- 42. Kris Bracewell and Tylsr Osteen each shot a 41 in thel. first match and a 43 in the second match. The Tigers then lost' to Williston by 20 strokes, 164- 184. 'Osborne led the way with a 42, while T.J. Good shot :A-' 45. - recovered and graduate James Jamison returned the ball. ti the Keystone 32. : Bradford, trailing 3-0, was. forced to attempt a last-second" field goal, 'which Keystone. graduate Nick Salsbery: blocked. It is a little confusing' as to what happened afterward,' but the end result was that-' lineman Kyle Mercer, a senior on this year's team, wound up' o\ith the ball and crossed the'. goal line f6r a game-winning'- touchdown. Mercer said a Keystone- pla.er picked up the ball aftet! the blocked field goal attempt and tossed it toward him. Chc Keystone head coach Chuck Dickinson said the player in'- question told him he did picl.k' the ball up, but he then took A- knee. Afterward, the played , supposedly tried to hand the- ball to an official, who simply let the ball fall to the ground. - "I've never seen anything like that," Bradford head coach Chad Bankston said after the ' game. "It was unbelievable." J Quality Timely & Friendly Service Low Prices * Alterations wi'edbyMon i.A.:p Allmajor credit thisac cads a ceuried for 10% off C9s 3 oi n L und rys 904-368-i-99 32 1 ,:.....;.,.Y.:aL_ . A The Starke Fall Festival is held in the historic district of downtown Starke on Walnut Street October 14-15,2006 Saturday 9 a.m.-5 p.m. Sunday noon-5 p.m. ' ".'* .** '" *-, ,' -" 1' ):'" .if -* 'Sy',: :.. ;'. -,, t ?..,'. ",*, .. -...,'.s *. : "/* .".'*"'.*''- ' Broadcasting LIVE' from the event! Listen to win. All prizes awarded in connection with this event, including the grand prize, will be distributed from 10 a.m,-2 p.m. Saturday. October 14 at the WEAG broadcast location on the porch of the Woman's Club in Starke. SANTA FE S COMMUNITY COLLEGE 352.395.5355 Bring your family to enjoy this fun-filled festival, where more than 75 artists from across Florida showcase their fine arts and crafts. Children will especially love the Creative Comer, a free arts and crafts area and, new this year, professional children's theater perfor- mances. The Shriners lead the parade at 11 a.m. Sat- urday and there's great Southern cuisine all weekend, including sweet potato pie and ribs. Don't miss it! i .-. ..-. ... .. -..... ~= -q~B1~I~C1P~b~- r -- ri 11 ww I ? / Oct. TELEGRAPH, TIMES & MONITOR-C-SECTION Page 9C ARTIST Continued from p. 3C -Sheila Crawford has been in numerous professional artist competitions since 1981. CANCER Continued from p. 2C sIpport to the event. also Helped. with an., awareness lIncheon held in Bradford, county in February ,,The e eni combined lunch Sapd Vera Bradlec produce., spld locally by Dimple SOverstreect of A&G Custom Framing and Gifts. Twenlyv pirccnl of Overstreet's sales. I 'm the prior event and this year's event, goes to breast, cancer research. ,"Breast cancer is the most- cpmmon type of cancer among women in the U.S.," Tatum said. "If one person makes an appointment (for & Some of her most recent meritorious juried competitions were Images: A Festival of the Arts, 2006 George E. Musson Award, Winter Park Sidewalk Art Festival, 2006 Award o,f Merit, Tarpon Spring Art on the Bayou, 2006 Award of Excellence, Melbourne Arts. mammogram) after today, it's worth it." Tatum said it was nice to have October as Breast Cancer Awareness Month, but it wasn't enough. "We appreciate that, but there are 11 other months in the year, and we're not going to forget it," she said. Another guest speaker was Dr. Sheryl Hayes, who %was Tatum's radiologist during her bout with breast cancer. Hayes said 220,000 women will be diagnosed with breast cancer this year, and 40,000 will die. Self exams and early detection can help lower these numbers, she said. Research. funded by events like the luncheon, will also bring about change. . Festival 2006, ,Second Place; College, Central Florida Ohio. display this Saturday and Other Media. Community College, and the You can meet and see Sheila 'SSunday at the SFCC Starke Fall Dayton Art Institute, in Dayton, Cra'.ford's photography on Festival, Booth # 9. Various collections by Sheila Crawford include the Deland Museum of Art, the Polk a- Museum of Art in Lakeland, the Harn Museum in Gainesville," Daytona Beach Community L.#I. Other speakers included Bryn Warner from the American Cancer Society and ROCK 104 of Gainesville. The cancer walk will start this Saturday, Oct. 14, in Gaines% ille at Northeast Park and continue through the duck pond area. *Woodington said area residents should get involved. She has even sparked the interest of the Union County High School cheerleading squads of which she is a coach. The majority of the JV and varsity cheerleading squads. will be at the walk, she said. "'They're a very active group df young ladies." To be.a walker or for more information on how you can help, call Woodington at (386) 496-4950. ;Jhe nine women who got the breast cancer awareness event started in Union :County were (1-r) Belinda Manukian, Nannette Starling, Paula Hawkins, Stacey ' Hayes, Denise Dukes. Pam W.oodiqgtan,.Debbie DoSkij; Mel Howard and -Tkneeltng)Cournie DouglasT -- Together with her background as a painter and her love for photography, Sheila Crawford, owner of Digitouch, endeavors to take photography beyond its traditional boundaries. Feel good about yourself again..; $ LOSE by ""a 'E R -"- UP 3 0 Christmas! TO wou TOPOUNDS Lose 2-5 pounds per week! No Pre-Packaged Mealsl Doctor Developed Program! No Strenuous Exercise! No Calorie Counting! kbdl ..No Drugs ,. -_ Dramatically Increace Your Fat-Burning Metabolism! Al Metabolic Research Center of Fleming Island Starke Annex 407 W. Georgia Street Starke, FL: (North side of courthouse complex) Every Wednesday 9 AM- 7 PM Contact Chrissie Enright for details. 4904) 2(904)215-3493 iH L- ---.,-.,1.~ LAKE AREA PROFESSIONALS ~- Betsy Jo Minor R.Iu, h,r Dave Outten Jr. Replinr AJuc. George Leath Renmll~ A, v.' Cindy Teske R,,ill..r A .. 6674 Brooklyn Bay Rd. BROOKLYN BAY HOME COMPLETELY REMODELED IN 2004 Tile, hardwood, and carpet. New granite countertops. new SS kitchen appliances, new maple cabinets, imported Italian natural stone behind slo.elop and under sitting counter. 158 ft on waterfrontt \ /concrete bulkhead. inground sprinkler sys. security sys. in home and garage. S615,000 V. .1., 000 John Wick Reaiilnr As . r I Jeanne Goodson R,.,11.-, A'-C Unda Parker ReallorAssoc. 7018 Ridge Trail PEAR LAKE PRICE REDUCED 1.74 acres perfect for your new% home or mobile home. Quiet location, close to end of cul-de-,.ac. PROPERTY HAS BEEN SURVEYED. Robin Jones Visit our Web Liz Dunn Renltor A. Mf. Rosario Orozco RenciorAssoc. page Se Habla Espan61l 977 c~ - ~i~~w" ~I~~ Ir CHEVROLET OF STARKE -wwps ~PgsJ OiB4ms Will ifStk Stk #T62015 4 door sedan, Automatic, Cruise Control, Rearl Spoiler; Stk #C61004 Od Stk #S63001 010 OIFF il l AT, Trailer Package, Power Windows, XM Radio, Stk #T64002 H PW, PL, Cruise Control, Keyless Entry, IStk #17201 ALI Stk #9726 214 .. or2,5 2!4M. or 2517 *l Stk #S62001 A 1149;., or,6 190 * High Output 345 hp 6.0, Loaded, Stk #S73002A p24,889* 8,000 Miles, Stk #9729 A17,888 AWD, Capt. Chairs, Navigation, Stk #S72014A' I ^-m AT, 4.3 V6, Stk #9732 '175;,. or 9,995* '03 GMC SIERRA X-CAB Low Miles! " Stk #9731 1 CAS4 SPECIAL $5,995** Leather, Loaded, Stk #S72016A 116,998-* Dually, Stk #T62068A 116,990* 'EUSHEP.Y UPET E OU CEUT 0DIII uaiUIiiu i onm uams Owner General Manager - AN Am MAN REVOuLION Ric R jII Bll emal TmDrrigr Je Hito hals res Stv Broze Business Ma nager Sae rfesoa-alsPoesinlSls rfsina"ae rofssonl v' Pat Drcto P" b 'n2J 't@ AtxO i lcne 3 r p e utx1 n e~r ri f ', ,, utmr a hos eae nIe o %,AHpie pu a tte'ces 395 ele evcefeA rbtsasindtodae I 9F -It k t I CALL TODAY! "You're Never Too Far From A Great Deal!' Baldwin A cksonville 0(904) 964.7500 kea. 1 Ausi "' Lake Butlae rl' i rngsley Ukm - I-" F "888-4-1 -CWaldo STARKE KiystoneHeights S' 'US Hwy 301 North Strk ";,, US Hwy 301 North *.Starke, FL IN i I ... . . .... "i . --- -- ---- --- 12 1 1 I Ii I "I I It oto d ~i~I~li~sPlliO ~Yr)tl yy, MgBB~l~rm~B I JaEm 4:Y, '144, I BUY WITH COMPLETE CONFIDENCE, wtsELECTION OF PRE-OWNED VEHICLES IN NORTH CENTRAL FLORI DAI 6.Ml CERTIFIED BUMPER TO BUMPER., 0:1101 POINT 3mos/31000'mi- _buakrantep INSPECTION- 1.2mos/12,000 MtLE" POWERTRAINGuAkANTEE ICIAIRIFIAIr ON EVF-RY;:, v f H I c 1. FrmTrm VEHICILIE. IN STOCK! ' -L. IA .c.. 4 wy ii~BlliBJi~V: . I ~P~D~ ~e~a~Ro I Contact Us | Permissions | Preferences | Technical Aspects | Statistics | Internal | Privacy Policy © 2004 - 2011 University of Florida George A. Smathers Libraries.All rights reserved. Acceptable Use, Copyright, and Disclaimer Statement Powered by SobekCM | http://ufdc.ufl.edu/UF00027795/00090 | CC-MAIN-2017-26 | refinedweb | 53,681 | 76.01 |
When pulling time series with multiple RICs, often there may not be data for some periods requested. Eikon raises the warning:
Error with 'RIC NAME': No data available for the requested date range
For some requests, I'm comfortable with there being no data available and I would like to suppress the warning (albeit possibly not best practice). Is there a way please?
To suppress these warnings you can set the logging level for Eikon Data APIs library logger to CRITICAL:
import logging logger = logging.getLogger('pyeikon') logger.setLevel(logging.CRITICAL)
Hi @gthompson6
You can put the API call in a try block.
Thanks @chavalit.jintamalit for your suggestion. It's not so much suppressing the error, more the warning marked in red. While the code still executes, as you can imagine with many rics and multiple API calls, a Juypter notebook becomes a sea of red! Thanks
Thanks Alex!
What other parameters can be used with the statement pertaining to Corporate Actions data such as Stock Splits?
Trying to fetch Close Bid Price for CMO tranche from Python
How to get all investors for a list of stocks, historically with the python API
Company trees don't match in Eikon online tool and the Eikon Proxy API
Retrieve Commodity Flows data using Python API | https://community.developers.refinitiv.com/questions/59828/suppress-warning-for-no-data-available-for-request.html | CC-MAIN-2021-39 | refinedweb | 215 | 60.95 |
Superseded by:
Sentry is unifying the API across all SDKs. With that, a new .NET SDK was created.
This SDK is still recommended for .NET Framework 3.5 to 4.6.0.
For .NET Framework 4.6.1, .NET Core 2.0, Mono 5.4 or higher please use the new SDK.
| | Stable | Pre-release |
| -------------------: | :----------------------------: | :------------------: |
| GitHub |
| - |
| SharpRaven |
|
|
| SharpRaven.Nancy |
|
|
| Travis Build |
|
|
| AppVeyor Build |
|
|
Instantiate the client with your 'Data Source Name' (DSN):
var ravenClient = new RavenClient("https://[email protected]/project-id");
Call out to the client in your catch block:
try { int i2 = 0; int i = 10 / i2; } catch (Exception exception) { ravenClient.Capture(new SentryEvent(exception)); }
You can capture a message without being bound by an exception:
ravenClient.Capture(new SentryEvent("Hello World!"));
You can add additional data to the
Exception.Dataproperty on exceptions thrown about in your solution:
try { // ... } catch (Exception exception) { exception.Data.Add("SomeKey", "SomeValue"); throw; }
The data
SomeKeyand
SomeValuewill be captured and presented in the
extraproperty on Sentry.
Additionally, the
SentryEventclass allow you to provide extra data to be sent with your request, such as
ErrorLevel,
Fingerprint, a custom
Messageand
In the .NET 4.5 or later build of SharpRaven, there's an
asyncversion of the
Capturemethod as well:
async Task CaptureAsync(SentryEvent @event);
You can install the SharpRaven.Nancy package to capture the HTTP context in Nancy applications. It will auto-register on the
IPipelines.OnErrorevent, so all unhandled exceptions will be sent to Sentry.
The only thing you have to do is provide a DSN, either by registering an instance of the
Dsnclass in your container:
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines) { container.Register(new Dsn("https://[email protected]/project-id")); }
or through configuration:
The DSN will be picked up by the auto-registered
IRavenClientinstance, so if you want to send events to Sentry, all you have to do is add a requirement on
IRavenClientin your classes:
public class LoggingModule : NancyModule { private readonly IRavenClient ravenClient;
public LoggingModule(IRavenClient ravenClient) { this.ravenClient = ravenClient; }
}
If an exception is raised internally to
RavenClientit is logged to the
Console. To extend this behaviour use the property
ErrorOnCapture:
ravenClient.ErrorOnCapture = exception => { // Custom code here };
You can also hook into the
BeforeSendfunction to inspect or manipulate the data being sent to Sentry before it is sent:
ravenClient.BeforeSend = requester => { // Here you can log data from the requester // or replace it entirely if you want. return requester; };
You can clone and build SharpRaven yourself, but for those of us who are happy with prebuilt binaries, there's NuGet packages of both SharpRaven and SharpRaven.Nancy.
#sentryon
irc.freenode.net) | https://xscode.com/getsentry/raven-csharp | CC-MAIN-2021-17 | refinedweb | 430 | 50.02 |
being recruited out of high school. This little project will look at the height and weight of top recruited offensive tackles and how these values are associated with that player's rank.
from bs4 import BeautifulSoup import urllib2 import pandas as pd from pandas import DataFrame, Series %matplotlib inline from __future__ import division from matplotlib import pyplot as plt import seaborn as sns sns.set(style='ticks', palette='Set2') import statsmodels.api as sm
Lets get the data from ESPN.
html = urllib2.urlopen('') text = html.read() soup = BeautifulSoup(text.replace('ISO-8859-1', 'utf-8'))
ht_wgt = [] for tr in soup.findAll('tr')[1:]: tds = tr.findAll('td') height = tds[4].text weight = tds[5].text grade = tds[7].text ht_wgt.append([height, weight, grade])
A quick sanity check to make sure we got 100 players
#should have 100 len(ht_wgt)
100
Now lets drop our data into a Pandas data frame and take a look.
data = DataFrame(ht_wgt, columns=['height', 'weight', 'grade']) data.head()
Lets clean up the data to get the values as integers and convert the height to inches. I also created a mean zero grade just to bring the grades closer to zero.
data['weight'] = data.weight.astype(int) data['grade'] = data.grade.astype(int) hgt_str = data.height.values hgt_str = [x.split("'") for x in hgt_str] hgt_in = [(int(x[0]) * 12) + int(x[1]) for x in hgt_str] data['height_inches'] = hgt_in data['grade_meanzero'] = data.grade - data.grade.mean() data.head()
fig, ax = plt.subplots(3,1) fig.set_size_inches(8.5, 11) fig.suptitle('2015 ESPN Top 100 High School Offensive tackles', fontsize=16, fontweight='bold') ax[0].hist(data.height_inches, bins = range(73,83), align='left') ax[0].set_xlabel('Height') ax[0].set_ylabel('Number of Players') ax[0].annotate('Average Height: {}'.format(data.height_inches.mean()), xy=(.5, .5), xytext=(.70, .7), xycoords='axes fraction', textcoords='axes fraction') ax[0].plot([75, 75], [0,40]) ax[0].set_xlim([72,82]) ax[0].set_xticks(range(73,83)) ax[0].annotate('My Brother', xy=(75, 20), xytext=(73, 25)) ax[1].hist(data.weight) ax[1].set_xlabel('Weight in Pounds') ax[1].set_ylabel('Number of Players') ax[1].annotate('Average Weight: {}'.format(data.weight.mean()), xy=(.5, .5), xytext=(.70, .7), xycoords='axes fraction', textcoords='axes fraction') ax[1].plot([280, 280], [0,30]) ax[1].annotate('My Brother', xy=(250, 15), xytext=(236, 20)) ax[2].scatter(data.height_inches, data.weight, s=data.grade_meanzero*15, alpha=.6) ax[2].set_title('Bigger Circle Means Better Rank') ax[2].set_xlabel('Height in Inches') ax[2].set_ylabel('Weight in Pounds') ax[2].set_xlim([72,82]) ax[2].set_xticks(range(73,83)) ax[2].scatter([75],[280], alpha=1, s=50, c=sns.color_palette("Set2", 2)[1]) ax[2].annotate('My Brother', xy=(75, 280), xytext=(73.5, 255)) fig.tight_layout() plt.subplots_adjust(top=0.92) sns.despine() plt.savefig('Top100_OT.png')
It looks like the sweet spot for height is between 76 and 78 inches. And it looks like taller players are getting a better rank; at least up to 78 inches. This makes some sense because you probably don't expect your players to grow much taller; you can more easily affect their weight gain if needed.
This is a very simple and somewhat silly example of data analysis, but I like it. Using data I was able to gain a better understanding of an area in which I previously had no experience. Also, I was able to give my brother some sound advice that is grounded in data - grow taller! | https://nbviewer.ipython.org/github/tfolkman/learningwithdata/blob/master/Top_Offensive_Tackles.ipynb | CC-MAIN-2021-43 | refinedweb | 590 | 54.08 |
NAME
Write one aspect of thread state.
SYNOPSIS
#include <zircon/syscalls.h> zx_status_t zx_thread_write_state(zx_handle_t handle, uint32_t kind, const void* buffer, size_t buffer_size);
DESCRIPTION
zx_thread_write_state() writes one aspect of state of the thread. The thread
state may only be written when the thread is halted for an exception or the
thread is suspended.
The thread state is highly processor specific. See the structures in zircon/syscalls/debug.h for the contents of the structures on each platform.
STATES
See
zx_thread_read_state() for the list of available states
and their corresponding values.
ZX_THREAD_STATE_DEBUG_REGS
ARM
ARM has a variable amount of debug breakpoints and watchpoints. For this
architecture,
zx_thread_state_debug_regs_t is big enough to hold the maximum
amount of breakpoints possible. But in most cases a given CPU implementation
holds a lesser amount, meaning that the upper values beyond the limit are not
used.
The kernel will write all the available registers in the hardware independent of the given breakpoint/watchpoint count value. This means that all the correct state must be set for the call.
You can get the current state of the registers by calling
zx_thread_read_state().
ARM Debug Hardware Debug Registers
ARM debug registers are highly configurable via their DBGBCR
Because of this, all the values within DBGBCR will be ignored except for the E bit, which is used to determine whether that particular breakpoint is activated or not. Said in another way, in order to activate a HW breakpoint, all that is needed is to set the correct address in DBGBVR and write 1 to DBGBCR.
RIGHTS
handle must be of type ZX_OBJ_TYPE_THREAD and have ZX_RIGHT_WRITE.
RETURN VALUE
zx_thread_write_state() returns ZX_OK on success.
In the event of failure, a negative error value is returned.
ERRORS
ZX_ERR_BAD_HANDLE handle is not a valid handle.
ZX_ERR_WRONG_TYPE handle is not that of a thread.
ZX_ERR_ACCESS_DENIED handle lacks ZX_RIGHT_WRITE.
ZX_ERR_INVALID_ARGS kind is not valid, buffer is an invalid pointer, buffer_size doesn't match the size of the structure expected for kind or the given values to set are not valid.
ZX_ERR_NO_MEMORY Failure due to lack of memory. There is no good way for userspace to handle this (unlikely) error. In a future build this error will no longer occur.
ZX_ERR_BAD_STATE The thread is not stopped at a point where state is available. The thread state may only be read when the thread is stopped due to an exception.
ZX_ERR_NOT_SUPPORTED kind is not supported. This can happen, for example, when trying to read a register set that is not supported by the hardware the program is currently running on.
ARM
ZX_ERR_INVALID_ARGS If the address provided to a DBGBVR register is not valid (ie. not addressable from userspace). Also if any value is set for a HW breakpoint beyond the number provided by the platform (see above for information about retrieving that number). | https://fuchsia.dev/fuchsia-src/reference/syscalls/thread_write_state | CC-MAIN-2020-24 | refinedweb | 465 | 65.93 |
Data.Vinyl.Tutorial.Overview
Description
Vinyl is a general solution to the records problem in Haskell using type level strings and other modern GHC features, featuring static structural typing (with a subtyping relation), and automatic row-polymorphic lenses. All this is possible without Template Haskell.
Let's work through a quick example. We'll need to enable some language extensions first:
>>>
:set -XDataKinds
>>>
:set -XPolyKinds
>>>
:set -XTypeApplications
>>>
:set -XTypeOperators
>>>
:set -XTypeFamilies
>>>
:set -XFlexibleContexts
>>>
:set -XFlexibleInstances
>>>
:set -XNoMonomorphismRestriction
>>>
:set -XGADTs
>>>
:set -XTypeSynonymInstances
>>>
:set -XTemplateHaskell
>>>
:set -XStandaloneDeriving
>>>
import Data.Vinyl
>>>
import Data.Vinyl.Functor
>>>
import Control.Applicative
>>>
import Control.Lens hiding (Identity)
>>>
import Control.Lens.TH
>>>
import Data.Char
>>>
import Test.DocTest
>>>
import Data.Singletons.TH (genSingletons)
>>>
import Data.Maybe
Let's define a universe of fields which we want to use.
First of all, we need a data type defining the field labels:
>>>
data Fields = Name | Age | Sleeping | Master deriving Show
Any record can be now described by a type-level list of these labels.
The
DataKinds extension must be enabled to autmatically turn all the
constructors of the
Field type into types.
>>>
type LifeForm = [Name, Age, Sleeping]
Now, we need a way to map our labels to concrete types. We use a type
family for this purpose. Unfortunately, type families aren't first class in Haskell. That's
why we also need a data type, with which we will parametrise
Rec.
We also generate the necessary singletons for each field label using
Template Haskell.
>>>
:{type family ElF (f :: Fields) :: * where ElF Name = String ElF Age = Int ElF Sleeping = Bool ElF Master = Rec Attr LifeForm newtype Attr f = Attr { _unAttr :: ElF f } makeLenses ''Attr genSingletons [ ''Fields ] instance Show (Attr Name) where show (Attr x) = "name: " ++ show x instance Show (Attr Age) where show (Attr x) = "age: " ++ show x instance Show (Attr Sleeping) where show (Attr x) = "sleeping: " ++ show x instance Show (Attr Master) where show (Attr x) = "master: " ++ show x :}
To make field construction easier, we define an operator. The first
argument of this operator is a singleton - a constructor bringing the
data-kinded field label type into the data level. It's needed because
there can be multiple labels with the same field type, so by just
supplying a value of type
ElF f there would be no way to deduce the
correct "f".
>>>
:{let (=::) :: sing f -> ElF f -> Attr f _ =:: x = Attr x :}
Now, let's try to make an entity that represents a human:
>>>
:{let jon = (SName =:: "jon") :& (SAge =:: 23) :& (SSleeping =:: False) :& RNil :}
Automatically, we can show the record:
>>>
print jon{name: "jon", age: 23, sleeping: False}
And its types are all inferred with no problem. Now, make a dog! Dogs are life-forms, but unlike humans, they have masters. So, let’s build my dog:
>>>
:{let tucker = (SName =:: "tucker") :& (SAge =:: 9) :& (SSleeping =:: True) :& (SMaster =:: jon) :& RNil :}
Now, if we want to wake entities up, we don't want to have to write a separate wake-up function for both dogs and humans (even though they are of different type). Luckily, we can use the built-in lenses to focus on a particular field in the record for access and update, without losing additional information:
>>>
:{let wakeUp :: (Sleeping ∈ fields) => Rec Attr fields -> Rec Attr fields wakeUp = rput $ SSleeping =:: False :}
Now, the type annotation on
wakeUp was not necessary; I just wanted
to show how intuitive the type is. Basically, it takes as an input
any record that has a
Bool field labelled
sleeping, and modifies
that specific field in the record accordingly.
>>>
let tucker' = wakeUp tucker
>>>
let jon' = wakeUp jon
>>>
tucker' ^. rlens @Sleepingsleeping: False
>>>
tucker ^. rlens @Sleepingsleeping: True
>>>
jon' ^. rlens @Sleepingsleeping: False
We can also access the entire lens for a field using the rLens function; since lenses are composable, it’s super easy to do deep update on a record:
>>>
let masterSleeping = rlens @Master . unAttr . rlens @Sleeping
>>>
let tucker'' = masterSleeping .~ (SSleeping =:: True) $ tucker'
>>>
tucker'' ^. masterSleepingsleeping: True
A record
Rec f xs is a subtype of a record
Rec f:
>>>
:{let upcastedTucker :: Rec Attr LifeForm upcastedTucker = rcast tucker :}
The subtyping relationship between record types is expressed with the
<: constraint; so,
rcast is of the following type:
rcast :: r1 <: r2 => Rec f r1 -> Rec f r2
Also provided is a "≅" constraint which indicates record congruence (that is, two record types differ only in the order of their fields).
In fact,
rcast is actually given as a special case of the lens
rsubset,
which lets you modify entire (possibly non-contiguous) slices of a record!
Consider the following declaration:
data Rec :: (u -> *) -> [u] -> * where RNil :: Rec f '[] (:&) :: f r -> Rec f rs -> Rec f (r ': rs)
Records are implicitly parameterized over a kind
u, which stands for the
"universe" or key space. Keys (inhabitants of
u) are then interpreted into
the types of their values by the first parameter to
Rec,
f. An extremely
powerful aspect of Vinyl records is that you can construct natural
transformations between different interpretation functors
f,g, or postcompose
some other functor onto the stack. This can be used to immerse each field of a
record in some particular effect modality, and then the library functions can
be used to traverse and accumulate these effects.
Let's imagine that we want to do validation on a record that represents a name and an age:
>>>
type Person = [Name, Age]
We've decided that names must be alphabetic, and ages must be positive. For
validation, we'll use
Maybe for now, though you should use a
left-accumulating
Validation type (the module
Data.Either.Validation
from the
either package provides such a type, though we do not
cover it here).
>>>
:{let goodPerson :: Rec Attr Person goodPerson = (SName =:: "Jon") :& (SAge =:: 20) :& RNil :}
>>>
:{let badPerson = (SName =:: "J#@#$on") :& (SAge =:: 20) :& RNil :}
We'll give validation a (rather poor) shot.
>>>
:{let validatePerson :: Rec Attr Person -> Maybe (Rec Attr Person) validatePerson p = (\n a -> (SName =:: n) :& (SAge =:: a) :& RNil) <$> vName <*> vAge where vName = validateName $ p ^. rlens @Name . unAttr vAge = validateAge $ p ^. rlens @Age . unAttr validateName str | all isAlpha str = Just str validateName _ = Nothing validateAge i | i >= 0 = Just i validateAge _ = Nothing :}
Let's try it out:
>>>
isJust $ validatePerson goodPersonTrue
>>>
isJust $ validatePerson badPersonFalse
The results are as expected (
Just for
goodPerson, and a
Nothing.
>>>
type Validator f = Lift (->) f (Maybe :. f)
Let's parameterize a record by it: when we do, then an element of type
a should be a function
Identity a -> Result e a:
>>>
:{let lift f = Lift $ Compose . f validateName (Attr str) | all isAlpha str = Just (Attr str) validateName _ = Nothing validateAge (Attr i) | i >= 0 = Just (Attr i) validateAge _ = Nothing vperson :: Rec (Validator Attr) Person vperson = lift validateName :& lift validateAge :& RNil :}
And we can use the special application operator
<<*>> (which is
analogous to
<*>, but generalized a bit) to use this to validate a
record:
>>>
let goodPersonResult = vperson <<*>> goodPerson
>>>
let badPersonResult = vperson <<*>> badPerson
>>>
isJust . getCompose $ goodPersonResult ^. rlens @NameTrue
>>>
isJust . getCompose $ goodPersonResult ^. rlens @AgeTrue
>>>
isJust . getCompose $ badPersonResult ^. rlens @NameFalse
>>>
isJust . getCompose $ badPersonResult ^. rlens @AgeTrue
So now we have a partial record, and we can still do stuff with its contents.
Next, we can even recover the original behavior of the validator (that is, to
give us a value of type
Maybe (Rec Attr Person)) using
rtraverse:
>>>
:{let mgoodPerson :: Maybe (Rec Attr Person) mgoodPerson = rtraverse getCompose goodPersonResult :}
>>>
let mbadPerson = rtraverse getCompose badPersonResult
>>>
isJust mgoodPersonTrue
>>>
isJust mbadPersonFalse | https://hackage.haskell.org/package/vinyl-0.9.3/docs/Data-Vinyl-Tutorial-Overview.html | CC-MAIN-2020-16 | refinedweb | 1,219 | 50.16 |
Trying to create a simple script with UI Designer
Greetings,
I'm brand new to Pythonista and I want to use UI Designer to create a form.
Within UI Designer, I have added a LABEL box to the file 'My UI.pyui', and have changed the LABEL box's 'Name' attribute to 'Connect_label'.
All I want to do is to change the LABEL box's TEXT attribute to "Fred", but I get an error:
"name 'Connect_label' is not defined'
I would have thought that by loading the "My UI" form (and that works) that I could have access to and modify the LABEL box's attributes. Do I need to add something else in the code?
Here's the code:
import ui
ui.load_view('My UI').present('sheet')
Connect_button.text = 'Fred'
- lukaskollmer
You can access a views ui elements using the subscript syntax:
view = ui.load_view() view["connect_label"].text = "text" view.present("sheet")
LK,
That causes even more errors.
If, just after:
ui.load_view('My UI').present('sheet')
I add:
view = ui.load_view()
I get this error:
[Errno 2] No such file or directory...
Bob
- lukaskollmer
- you have to replace the ui.load_view().present() line with my code
- your
pyuifile needs to have the same file name as the script you're calling
load_viewin
Lukas,
I got it. That works! Thanks.
May you live to be one-thousand years old, sir.
Bob | https://forum.omz-software.com/topic/3481/trying-to-create-a-simple-script-with-ui-designer/? | CC-MAIN-2021-49 | refinedweb | 232 | 74.39 |
Str
Introduction to Struts 2
Introduction to Struts 2
This section provides you a quick introduction to
Struts 2 framework. This section we are discussing the new features, struts 2
basics and architecture
Integration
Integration How to integrate struts with spring in MyEeclipse in layer independent manner.
Please send the screen shots.
How to integrate struts with EJB in MyEeclipse in layer independent manner.
Please send the screen shots Training
Struts 2 Training
The Struts 2 Training for developing enterprise applications with Struts 2 framework.
Course Code: STRUS-2
Duration: 5.0 day(s)
Apply for Struts 2 Training
Lectures
struts hibernate integration application
also use annotation
as mapping metadata.
About struts hibernate integration... of the struts hibernate integration
application example.
Description...Struts2 hibernate integration application.
In this tutorial we are going
Struts 2.0.1
Struts 2.0.1
Now the new release of Struts 2 framework is available with new features and
enhancements. Now... of enhancements and new features
Following are improvements made to Struts 2
Struts 2 in Agile Development Environment
Struts 2 in Agile Development Environment
This article explains you how Struts 2 can be used in Agile Development
environment. Struts 2 fully supports Agile... between the cross-functional teams to ensure efficiency and effectiveness.
Struts 2
Struts 2 + Hibernate
Struts 2 + Hibernate From where can i get good tutorial from integrating struts 2 with hibernate , which explains step by step procedure in integration and to build web
What is Struts 2 framework
What is Struts 2 framework Hi,
I am new to the Java web programming. I have completed JSP, Servlet and HTML. Now I want to learn Struts 2.
Tell me what is Struts 2?
Thanks
Why Struts 2
Why Struts 2
The new version Struts... handling per action, if
desired.
Easy Spring
integration - Struts 2... of design problem of struts1 framework that has
been resolved in
session maintain in struts 2
session maintain in struts 2 hi i am new to Struts 2.....
in Action class i wrote
**HttpSession session = request.getSession();
session.setAttribute("name", name1);**
but in jsp class
String session_name=(String
struts
) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4...) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4...) {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4 2
Struts 2 we can extend DispatchAction class to implement a common session validation in struts 1.x. how to do the same in the struts2
Struts 2 - Validation - Struts
Struts 2 - Validation annotations digging for a simple struts 2 validation annotations example
Struts - Hibernate Integration
link:
Struts Hibernate Integration
Thanks...Struts - Hibernate Integration Hi,
I need to integrate the struts with hibernate..
can u pls tell me the process of configuring etc etc WITHOUT
Struts 2
Struts 2 I am getting the following error.pls help me out.
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has and hibernate integration
struts and hibernate integration i want entire for this application using struts and hibernate integration
here we have to use 4 tables i.e... the following link:
Struts Hibernate Integration
struts 2 tabbedpanel - Struts
struts 2 tabbedpanel Hi Friend
do I change the background color of a tab?
bye bye
Struts - Struts
used in a struts aplication.
these are the conditions
1. when u entered into this page the NEXT BUTTON must disabled
2. if u enter any text....
..............here is the program..............
New Member Personal
Problem in integration struts+ spring - Framework
Problem in integration struts+ spring Problem in integration struts+ spring hi, i am facing problem in integration struts+ spring. I am also using...-INF-Hibernate-Integration - Hibernate
Struts-Hibernate-Integration Hi,
I was executing struts hibernate intgeration code the following error has occured.
Anyone can give me... the following link:
Hope
Struts Tutorials
v5.0.2.2.
Adding Spice to Struts - Part 2
This time, we started looking at how... is the init() method in the ActionServlet class.
2. The Struts framework supports... - Part 2
StrutsTestCase (STC) is a framework for testing Struts Action classes
struts
struts what are the 4 methods of struts framework
Struts 2 Tutorial 2 Tutorial
Struts 2 Tutorial
RoseIndia Struts 2 Tutorial and Online free training helps you learn new
elegant... 2
The new version Struts 2.0 is a combination of the Sturts action framework
Struts
Setter methods of form bean class in Struts applications who calls the setter methods of form bean class in struts applications 2 Downloads
2.0.1
Now the new release of Struts 2 framework is available with new...
Struts 2 Downloads
Struts is one of the best framework for developing
enterprise web applications. Now Struts Articles
rendering.
Developing JSR168 Struts portlets: Part 2. Enhancing... portlets. If you are new to either Struts or portlet technology, then please take... mapping definitions in the struts-config file.
2. Servlet creates
new 2
new 2 <%@page import="java.util.ArrayList"%>
<%@page...;
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@2
sevelet
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@2
import java.io.IOException;
import java.io.PrintWriter; Hi i am new to struts. I don't know how to create struts please in eclipse help me online tutorial
Struts 2 online tutorial Where to learn struts 2 online tutorial? Is there any good tutorials on roseindia.net for learning struts 2 online tutorial?
Yes,
We have many tutorials for learning Struts 2 online... with features including a plugin framework, a new API, Ajax tags etc. So the Struts
Struts 1 Tutorial and example programs
.
Struts Hibernate Integration Tutorial NEW... Integration with EJB
Struts integration with EJB in JBOSS 3.2
Struts integration
with EJB in WEBLOGIC7
Struts Alternative
Struts Alternative
Struts is very robust and widely used framework, but there exists the alternative to the struts framework... to the struts framework.
Struts Alternatives:
Cocoon 1)Have you used struts tag libraries in your application?
2)What are the various types of tag libraries in struts? Elaborate each of them?
3)How can you implement custom tag libraries in your application Login Form Example
: Create a new dynamic project.
Step 2: Add the struts 2 library in the lib...Struts 2 Login Form Example tutorial - Learn how to develop Login form in Struts 2 though this video tutorial
In this video tutorial I will explain you project samples
struts 2 project samples please forward struts 2 sample projects like hotel management system.
i've done with general login application and all.
Ur answers are appreciated.
Thanks in advance
Raneesh
Time Picker in struts 2 - Struts
Time Picker in struts 2 How to create Time Picker in Struts 2 ? ...;head> <title>Struts 2 Time Picker Example!</title>...;</ul>2. struts.xml (Add the following code)<action name=" MySQL
Struts 2 MySQL
In this section, You will learn to connect the MySQL
database with the struts 2 application...;/struts-tags" %>
<html>
<head>
<title>Struts 2
Sr. Java Developer with EJB Experience
Sr. Java Developer with EJB Experience
Position Vacant: Sr. Java Developer with EJB... (UNIT testing)
Integration Tetsting
Implementation
Java Struts 2 Programmer
Java Struts 2 Programmer
Position Vacant: Java Struts 2 Programmer
Job...;
MCA
Having good experience in Hibern
Value Retain in struts 2 - Struts
Value Retain in struts 2 Hi,
I am trying to retain values in .jsp pages using struts2 tag.Can anyone help with the solution.
Thanks in advance! hi
You go the following url. Get your solution
and getter methods for those checkboxes in ActionForm.finally we get those... the checkbox.i want code in struts
Struts 2 Application
Struts 2 Application
Developing user registration application based on
Struts 2 Framework
This Struts 2 Application is a simple user registration
application...
of Struts 2. Struts 2 Framework makes it easy to develop enterprise web
applications
Struts 2 Actions
Struts 2 Actions
In this section we will learn about Struts 2 Actions, which is a fundamental
concept in most of the web application frameworks. Struts 2 Action are the
important concept in Struts 2
struts 2 mysql
struts 2 mysql In the example :
how is the username and password(in insertdata.jsp) which is entered by the user is transferred to the { ("INSERT employee VALUES
Access data from mysql through struts-hibernate integration
through struts-hibernate integration. My search command is working properly but my...Access data from mysql through struts-hibernate integration Hi... {
ActionErrors errors = new ActionErrors();
InsertDataForm
Struts 2.2.1 - Struts 2.2.1 Tutorial
Struts 2 hello world application using annotation
Running...
Implementing Actions in Struts
2
Chaining Actions in Struts...
Struts 2 Interceptor Example
Struts Online Test
Struts 2 Features
Struts 2 Features
The strut-2... of the general features of the current Apache Strut 2 framework are given below. ... of the browser in HTML, PDF, images or any other.
Tags - Tags in Strut 2
Advertisements
If you enjoyed this post then why not add us on Google+? Add us to your Circles | http://roseindia.net/tutorialhelp/comment/80141 | CC-MAIN-2015-40 | refinedweb | 1,484 | 58.69 |
Schema Declaration¶
There are 3 ways to declare your database schema to be used with GINO. Because
GINO is built on top of SQLAlchemy core, either way you are actually declaring
SQLAlchemy
Table.
GINO Engine¶
This is the minimized way to use GINO - using only
GinoEngine (and
GinoConnection
too), everything else are vanilla SQLAlchemy core. This is useful when you have
legacy code written in SQLAlchemy core, in need of porting to asyncio. For new
code please use the other two.
For example, the table declaration is the same as SQLAlchemy core tutorial:) )
Note
When using GINO Engine only, it is usually your own business to create the
tables with either
create_all() on a
normal non-async SQLAlchemy engine, or using Alembic. However it is still
possible to be done with GINO if it had to:
import gino from gino.schema import GinoSchemaVisitor async def main(): engine = await gino.create_engine('postgresql://...') await GinoSchemaVisitor(metadata).create_all(engine)
Then, construct queries, in SQLAlchemy core too:
ins = users.insert().values(name='jack', fullname='Jack Jones')
So far, everything is still in SQLAlchemy. Now let’s get connected and execute the insert:
async def main(): engine = await gino.create_engine('postgresql://localhost/gino') conn = await engine.acquire() await conn.status(ins) print(await conn.all(users.select())) # Outputs: [(1, 'jack', 'Jack Jones')]
Here
create_engine() creates a
GinoEngine,
then
acquire() checks out a
GinoConnection, and
status() executes the insert and returns the
status text. This works similarly as SQLAlchemy
execute() - they take the same parameters
but return a bit differently. There are also other similar query APIs:
all()returns a list of
RowProxy
first()returns one
RowProxy, or
None
scalar()returns a single value, or
None
iterate()returns an asynchronous iterator which yields
RowProxy
Please go to their API for more information.
GINO Core¶
In previous scenario,
GinoEngine must not be set to
metadata.bind because it is not a
regular SQLAlchemy Engine thus it won’t work correctly. For this, GINO provides
a subclass of
MetaData as
Gino,
usually instantiated globally under the name of
db. It can be used as a
normal
MetaData still offering some conveniences:
- It delegates most public types you can access on
sqlalchemy
- It works with both normal SQLAlchemy engine and asynchronous GINO engine
- It exposes all query APIs on
GinoConnectionlevel
- It injects two
ginoextensions on SQLAlchemy query clauses and schema items, allowing short inline execution like
users.select().gino.all()
- It is also the entry for the third scenario, see later
Then we can achieve previous scenario with less code like this:
from gino import Gino db = Gino() users = db.Table( 'users', db, db.Column('id', db.Integer, primary_key=True), db.Column('name', db.String), db.Column('fullname', db.String), ) addresses = db.Table( 'addresses', db, db.Column('id', db.Integer, primary_key=True), db.Column('user_id', None, db.ForeignKey('users.id')), db.Column('email_address', db.String, nullable=False) ) async def main(): async with db.with_bind('postgresql://localhost/gino'): await db.gino.create_all() await users.insert().values( name='jack', fullname='Jack Jones', ).gino.status() print(await users.select().gino.all()) # Outputs: [(1, 'jack', 'Jack Jones')]
Similar to SQLAlchemy core and ORM, this is GINO core. All tables and queries
are still made of SQLAlchemy whose rules still apply, but
sqlalchemy seems
never imported. This is useful when ORM is unwanted.
Tip
asyncpgsa does the same thing, but in a conceptually reversed way - instead of having asyncpg work for SQLAlchemy, it made SQLAlchemy work for asyncpg (GINO used to be in that way too because GINO is inspired by asyncpgsa). Either way works fine, it’s just a matter of taste of whose API style to use, SQLAlchemy or asyncpg.
GINO ORM¶
If you want to further reduce the length of code, and taking a bit risk of implicity, welcome to the ORM world. Even though GINO made itself not quite a traditional ORM by being simple and explict to safely work with asyncio, common ORM concepts are still valid - a table is a model class, a row is a model instance. Still the same example rewritten in GINO ORM:
from gino import Gino db = Gino() class User(db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String) fullname = db.Column(db.String) class Address(db.Model): __tablename__ = 'addresses' id = db.Column(db.Integer, primary_key=True) user_id = db.Column(None, db.ForeignKey('users.id')) email_address = db.Column(db.String, nullable=False) async def main(): async with db.with_bind('postgresql://localhost/gino'): await db.gino.create_all() await User.create(name='jack', fullname='Jack Jones') print(await User.query.gino.all()) # Outputs: [<User object at 0x10a8ba860>]
Important
The
__tablename__ is a mandatory field to define a concrete model.
As you can see, the declaration is pretty much the same as before. Underlying
they are identical, declaring two tables in
db. The
class style is just
more declarative. Instead of
users.c.name, you can now access the column by
User.name. The implicitly created
Table is
available at
User.__table__ and
Address.__table__. You can use anything
that works in GINO core here.
Note
Column names can be different as a class property and database column.
For example, name can be declared as
nickname = db.Column('name', db.Unicode(), default='noname'). In this
example,
User.nickname is used to access the column, while in database,
the column name is
name.
What’s worth mentioning is where raw SQL statements are used, or
TableClause is involved, like
User.insert(), the original name is
required to be used, because in this case, GINO has no knowledge about the
mappings.
Tip
db.Model is a dynamically created parent class for your models. It is
associated with the
db on initialization, therefore the table is put in
the very
db when you declare your model class.
Things become different when it comes to CRUD. You can use model level methods
to directly
create() a model instance, instead of
inserting a new row. Or
delete() a model instance
without needing to specify the where clause manually. Query returns model
instances instead of
RowProxy, and row values are
directly available as attributes on model instances. See also: CRUD.
After all,
GinoEngine is always in use. Next let’s dig
more into it. | http://gino.fantix.pro/en/latest/schema.html | CC-MAIN-2019-13 | refinedweb | 1,038 | 59.3 |
- Fund Type: Unit Trust
- Objective: Growth Small Cap
- Asset Class: Equity
- Geographic Focus: Australia
BT Investment Funds - Smaller Companies Fund+ Add to Watchlist
ROTHSMC:AU1.87 AUD 0.02 1.31%
As of 00:59:30 ET on 02/25/2015.
Snapshot for BT Investment Funds - Smaller Companies Fund (ROTHSMC)
Mutual Fund Chart for ROTHSMC
- ROTHSMC:AU 1.86
Previous Close
- 1W
- 1M
- YTD
- 1Y
- 3Y
- 5Y
Fund Profile & Information for ROTHSMC
BT Investment Funds - BT Smaller Companies Fund is a unit trust incorporated in Australia. The Fund aims to provide a return (before fees and taxes) that exceed the S&P/ASX Small Ordinaries Acc Index. The Fund invests in smaller companies that are believed to be trading below their assessed valuation that are expected to grow their profits quickly.
Fundamentals for ROTHSMC
Dividends for ROTHSMC
Fees & Expenses for ROTHSMC
Top Fund Holdings for ROTHSMCFiling Date: 09/30/2014
Quotes delayed, except where indicated otherwise. Mutual fund NAVs include dividends. All prices in local currency. Time is ET.
- 1
- 2
- 3
- 4
- 5 | http://www.bloomberg.com/quote/ROTHSMC:AU | CC-MAIN-2015-11 | refinedweb | 174 | 57.98 |
I need to store and then operate (add new nodes, search through, etc) a tree where every node is a pair of x,y coordinates. I found ete2 module to work with trees, but I can't catch how to save a node as a tuple or list of coordinates. Is it possible with ete2?
Edit:
I followed the tutorial here
To create a simple tree:
t1 = Tree("(A:1,(B:1,(E:1,D:1):0.5):0.5);" )
t2 = Tree( "(A,B,(C,D));" )
t3 = Tree("([12.01, 10.98], [15.65, 12.10],([21.32, 6.31], [14.53, 10.86]));")
You can annotate ete trees using any type of data. Just give a name to every node, create a tree structure using such names, and annotate the tree with the coordinates.
from ete2 import Tree name2coord = { 'a': [1, 1], 'b': [1, 1], 'c': [1, 0], 'd': [0, 1], } # Use format 1 to read node names of all internal nodes from the newick string t = Tree('((a:1.1, b:1.2)c:0.9, d:0.8);', format=1) for n in t.get_descendants(): n.add_features(coord = name2coord[n.name]) # Now you can operate with the tree and node coordinates in a very easy way: for leaf in t.iter_leaves(): print leaf.name, leaf.coord # a [1, 1] # b [1, 1] # d [0, 1] print t.search_nodes(coord=[1,0]) # [Tree node 'c' (0x2ea635)]
You can copy, save and restore annotated trees using pickle:
t.copy('cpickle') # or import cPickle cPickle.dump(t, open('mytree.pkl', 'w')) tree = cPickle.load(open('mytree.pkl')) | https://codedump.io/share/5YllnhjxiaIF/1/ete2-how-to-operate-if-a-node-is-a-pair-of-coordinates | CC-MAIN-2018-22 | refinedweb | 267 | 74.39 |
16 September 2010 06:14 [Source: ICIS news]
By Helen Yan
?xml:namespace>
SINGAPORE
Spot prices of SBR spiked in recent months, largely tracking the surge in values of natural rubber - a substitute material for tyre production. The price direction in last three months of the year was largely uncertain, they said.
“Some tyre makers do not wish to lock in on a quarterly basis due to uncertainty over the fourth-quarter market outlook. They wish to settle October contracts first and then talk about November and December contract settlements later,” said an SBR producer.
Some October contracts for SBR non-oil grade 1502 had been settled at $2,150-2,200/tonne (€1,656-1,694/tonne) CFR (cost and freight) Southeast (SE)
Spot cargoes of SBR non-oil grade 1502 were being sold at $2,200-2,250/tonne CFR SE Asia this week, up $200/tonne from early August, according to data from ICIS.
Some expectations that natural rubber prices may come off in the fourth quarter after spiralling upward in the past month prompted a number of tyre producers to rush settling October SBR contracts, market sources said.
“It will not be surprising that some Chinese tyre producers would also go for monthly contracts as the natural rubber and SBR prices have gone up too sharply in recent weeks and there are obviously risks involved if they lock in on a quarterly basis,” said a major tyre producer in China.
Chinese domestic non-oil grade 1502 prices have soared more than yuan (CNY) 2,500/tonne ($371/tonne) since late July to hit CNY 18,500/tonne ex-warehouse (EXWH) earlier this month.
“Chinese tyre makers are uncertain what will happen in November and are only purchasing enough to cover October requirements,” a Chinese SBR producer said.
Meanwhile, SBR producers welcomed this break in the traditional quarterly contract settlement, expecting prices to move up further in November, market sources said.
SBR producers were seeking higher prices for November contracts in a bid to recover margins they lost in the third quarter, industry sources said.
The margins of SBR producers were severely eroded by escalating costs of feedstock butadiene (BD) in the third quarter. BD prices surged by about 10% or $200/tonne since late March to more than $2,200/tonne CFR NE (northeast) Asia in May, wiping out the margins of the SBR producers.
“We plan to recover our margins in the fourth as the third quarter was very weak and we lost our margins,” said an SBR producer.
The major regional SBR producers include LG Chem, Korea Kumho Petrochemical Co (KKPC), BST Elastomers and Shen Hua Chemicals, while the key tyre producers include Goodyear, Bridgestone, Toyo Tires, Continental Tires and Michelin.
($1 = €0.77 ; $1 = CNY. | http://www.icis.com/Articles/2010/09/16/9393679/tyre-makers-prefer-monthly-asia-sbr-contracts-shun-q4-talks.html | CC-MAIN-2013-20 | refinedweb | 462 | 54.05 |
I am working through the python for everyone section and along side this doing the graded assignments on instructors website py4e.com. I was able to complete the Extracting Data from XML problem. my code:
import urllib.parse, urllib.request, urllib.error import xml.etree.ElementTree as ET import ssl url = '' ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE uh = urllib.request.urlopen(url, context = ctx) data = uh.read() tree = ET.fromstring(data) results = tree.findall('.//count') ->print(sum([int (x.text) for x in results]))
Pointed at is what I have a question about. When the instructor mentioned that we can do something like this, at the end of the tuples section, I didn’t understand how it worked. I still don’t. I know the the [brackets ] is telling sum that its taking a list. I assume that the inital x.text is being used as an assignment before the for statement? I would like to understand how this works, thank you in advance. | https://forum.freecodecamp.org/t/python-code-not-sure-how-this-works/454288 | CC-MAIN-2022-33 | refinedweb | 168 | 63.36 |
targetNamespace and XSL
Discussion in 'XML' started by CB, Jun 27, 2003.
Want to reply to this thread or ask your own question?It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
- Similar Threads
targetnamespace - what is it?!?!kevin bailey, Jun 24, 2003, in forum: XML
- Replies:
- 1
- Views:
- 17,483
- kevin bailey
- Jun 25, 2003
Re: transforming to an XML Schema - targetNamespaceC. M. Sperberg-McQueen, Jul 29, 2003, in forum: XML
- Replies:
- 0
- Views:
- 540
- C. M. Sperberg-McQueen
- Jul 29, 2003
targetNamespace/import conflictCharles Fineman, Jan 21, 2004, in forum: XML
- Replies:
- 2
- Views:
- 4,276
- Charles Fineman
- Feb 9, 2004
Help: targetNamespace value on my machine...Gianni Rubagotti, Feb 4, 2004, in forum: XML
- Replies:
- 1
- Views:
- 559
- Patrick TJ McPhee
- Feb 5, 2004
xsd:schema targetNamespace="nondomainstring" possible ?Markus Meckler, Jun 27, 2004, in forum: XML
- Replies:
- 3
- Views:
- 716
- Priya Lakshminarayanan [MSFT]
- Jun 29, 2004 | http://www.thecodingforums.com/threads/targetnamespace-and-xsl.164984/ | CC-MAIN-2014-42 | refinedweb | 174 | 71.85 |
ZS: If your application is really bad, then you're going to have a lot of events and saving them will take a lot of time. But typically, when you have an application that doesn't generate too many events, the overhead is pretty negligible – it's close to 1 or 2 per cent. But that depends on the number of events generated.
LXF: Would you say that Zend is edging into a space that's traditionally been dominated by Java application servers?
ZS: I think so, to some degree. And in some ways it's already happened. PHP can be found in a lot of business-critical applications and a lot of very large deployments – Wikipedia, YouTube and Flickr all come to mind, but there are tons of others. It's definitely a trend that's growing. We think it makes perfect sense and we do want to support it with Zend Server.
LXF: At the other end of the scale, as Zend Server takes PHP more towards the enterprise, would you say that PHP is perhaps losing touch with its original community?
ZS: I don't think it's losing touch, but I would say that PHP is between 12 and 13 years old, so it's not the cool new kid on the block. That said, I think the community that's been working on PHP is still developing it and is still very much in touch with the community that uses it. The PHP community is very healthy – it's strong and still growing rapidly.
The key strength of PHP is that it's a mature solution, it's been proven. There's a lot less knowledge about how to deploy websites using Ruby or Python – they're good solutions, and I have nothing bad to say about either of them, it's just that the communities are smaller. There's room in the web server industry for more than one player – I don't expect PHP to be used on 100% of websites at one time.
LXF: Would you say that the community's open source work is influencing what goes into the freeware version of Zend Server? For example, I believe PHP 6 is going to include an op-code cache as standard. So has your response to that been, "Well, we'll give away our version too"?
ZS: Well, definitely it's one of the things that went into the decision, but I don't think it's the only thing. We went into this business back in 2001, and we thought that in this day and age it makes sense for us to provide a free – both cost-free and hassle-free – solution for acceleration.
APC is going to become a standard part of the PHP distribution, but the inclusion of it isn't such a huge difference from the status quo. It's already in PECL and you can install it very easily, and if you look at PHP 6, the plan isn't to have it enabled by default. If people really like APC, they can disable the Zend Optimizer Plus and use APC, and it'll work the same except for a few small UI parts that are Zend-specific.
LXF: PHP 6 seems to be spending an awfully long time under construction. Is that some sort of Curse of the Number 6, as with Perl 6, or is it all part of the plan?
ZS: It could be, but I think we'll have PHP 6 before Python 6, though! PHP 6 is a much more difficult project than both PHP 4 and 5 were, for two main reasons. One is the amount of PHP code that's already out there... it's so huge. [The other is] every tiny compatibility breakage you introduce becomes a horrible headache for a lot of people. And combined with the main thing we want to do with PHP 6, which is the introduction of native Unicode support, actually it's pretty much impossible to obtain without introducing a significant amount of compatibility breakage into the language. I don't know how it's going to turn out – I'm being completely honest about that.
LXF: How easy will it be to move from PHP 5 to 6, as compared with moving from PHP 4 to 5?
ZS: The migration from 4 to 5 was fairly successful. It took a few years, but today PHP 5 is already more popular than 4 ever was. We've decided not to rush [the transition], so we're concentrating on PHP 5.3 at this point.
We made the decisions to add some of the features that originally were planned for PHP 6 – such as namespaces – into PHP 5.3, so that we don't have to rush PHP 6. It's probably going to take quite some time until PHP 6 is out. | http://www.techradar.com/news/software/zend-server-talks-java-says-no-rush-for-php-6-607616/2 | CC-MAIN-2017-13 | refinedweb | 819 | 69.21 |
See sklearn trees with D3
Sunday November 29, 2015
The decision trees from scikit-learn are very easy to train and predict with, but it's not easy to see the rules they learn. The code below makes it easier to see inside
sklearn classification trees, enabling visualizations that look like this:
This shows, for example, that all the irises with
petal length (cm) less than 2.45 were
setosa.
The ability to interpret the rules of a decision tree is often considered a strength of the algorithm, and in R you can usually
summary() and
plot() a tree fit to see the rules. In Python with
sklearn, there is
export_graphviz, but it isn't terribly convenient. It shouldn't be so hard to see what's going on inside a tree.
The following JSON format is simple and works with common D3 tree graphing code, so let's target this format:
{name: "container thing", children: [{name: "leaf thing one"}, {name: "leaf thing two"}]}
Each
name will describe a true/false decision rule for an inner node or the distribution of training example labels for a leaf node. The first of a pair of
children is where the rule is true, and the second is where the rule is false. (These are binary trees.)
The way
sklearn trees store their rules internally is described in
_tree.pyc. The
rules function here examines a fit
sklearn decision tree to generate a Python dictionary (with structure like the above) representing the decision tree's rules:
def rules(clf, features, labels, node_index=0): """Structure of rules in a fit decision tree classifier Parameters ---------- clf : DecisionTreeClassifier A tree that has already been fit. features, labels : lists of str The names of the features and labels, respectively. """ node = {} if clf.tree_.children_left[node_index] == -1: # indicates leaf count_labels = zip(clf.tree_.value[node_index, 0], labels) node['name'] = ', '.join(('{} of {}'.format(int(count), label) for count, label in count_labels)) else: feature = features[clf.tree_.feature[node_index]] threshold = clf.tree_.threshold[node_index] node['name'] = '{} > {}'.format(feature, threshold) left_index = clf.tree_.children_left[node_index] right_index = clf.tree_.children_right[node_index] node['children'] = [rules(clf, features, labels, right_index), rules(clf, features, labels, left_index)] return node
How is this used? Let's get a quick example decision tree and take a look:
from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier data = load_iris() clf = DecisionTreeClassifier(max_depth=3) clf.fit(data.data, data.target) rules(clf, data.feature_names, data.target_names)
The
rules function returns the following Python dictionary, formatted for readability here:
{'name': 'petal length (cm) > 2.45000004768', 'children': [ {'name': 'petal width (cm) > 1.75', 'children': [ {'name': 'petal length (cm) > 4.85000038147', 'children': [ {'name': '0 of setosa, 0 of versicolor, 43 of virginica'}, {'name': '0 of setosa, 1 of versicolor, 2 of virginica'}]}, {'name': 'petal length (cm) > 4.94999980927', 'children': [ {'name': '0 of setosa, 2 of versicolor, 4 of virginica'}, {'name': '0 of setosa, 47 of versicolor, 1 of virginica'}]}]}, {'name': '50 of setosa, 0 of versicolor, 0 of virginica'}]}
This is pretty readable, but now we can also write the result out to a file and visualize it with D3:
import json r = rules(clf, data.feature_names, data.target_names) with open('rules.json', 'w') as f: f.write(json.dumps(r))
Check out the interactive view! Once again, a partially expanded view looks like this:
| https://planspace.org/20151129-see_sklearn_trees_with_d3/ | CC-MAIN-2021-04 | refinedweb | 553 | 56.45 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.