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
01 February 2011 04:36 [Source: ICIS news] TORONTO (ICIS)--Methanex has temporarily closed its office in ?xml:namespace> Methanex CEO Bruce Aitken said the move was prompted by safety and security concerns due to Commissioning activities at the company’s new 1.3m tonne/year joint venture EMethanex methanol plant at Damietta had been curtailed and the site was currently staffed at “minimal levels," Aitken said. “Over the next few days we will be developing plans to re-initiate the commissioning and star-up of the plant as and when conditions allow,” he added. According to a report earlier this month, Methanex was expected to start shipping methanol from EMethanex before the end of the first quarter. Meanwhile, shipping activities along the Suez Canal were operating normally despite the political protests in Cairo, shipping agents said on Tuesday. For more on Methan
http://www.icis.com/Articles/2011/02/01/9431013/methanex-closes-cairo-office-evacuates-international.html
CC-MAIN-2014-49
refinedweb
143
60.35
Blog Map Every now and then, I need to have a source of data for an example or proof of concept that I’m building. In my focus on LINQ to XML, Open XML, and now SharePoint, it’s pretty rare that I have to directly use a SQL database. I only do so maybe once or twice a year, and each time it comes up, I can’t remember where to get the database, and the easiest way to get started. This post is a cheat-sheet for the future - posting this just so that the next time it comes up, I can get going faster. Add the following two Using statements: using System.Data.Linq;using System.Data.Linq.Mapping; Add the following code to Main: DataContext db = new DataContext(@"C:\Users\ericwhit\Documents\NorthwindDatabase\Northwnd.mdf");Table<Customer> Customers = db.GetTable<Customer>();var query = from cust in Customers where cust.City == "London" select cust;foreach (var cust in query) Console.WriteLine("id = {0}, City = {1}", cust.CustomerID, cust.City); To install adventure works database, Download it here. Install it in a sub folder of my Documents directory. Add a data connection in Server Explorer. Zeyad presented this morning on the Open XML SDK at PDC. You can view the video of the talk here – it’s Thank you ! Finally I use linq on databese. People need algorithm of doing something that is all !
http://blogs.msdn.com/b/ericwhite/archive/2008/10/16/fastest-start-for-linq-to-sql.aspx
CC-MAIN-2014-23
refinedweb
236
67.55
I've had several instances where the application of a stylesheet in an orchestration generates the following error: "Failed to transform XML, error was: javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 1 error detected". However, there is never any error detail provided. Are there logs on the appliance that would give me more information on what's causing the error in the stylesheet? In the particular case I'm seeing right now, the stylesheet is working ok in the external tool I use to test stylesheets (EditiX 2009); so it'd be nice if I could get information from the appliance that would provide a further clue to what it didn't like about the stylesheet. Thanks. -Mark Topic Pinned topic troubleshooting stylesheets 2010-01-29T13:58:49Z | Updated on 2010-01-29T18:34:05Z at 2010-01-29T18:34:05Z by SystemAdmin Re: troubleshooting stylesheets2010-01-29T14:26:10Z This is the accepted answer. This is the accepted answer.Here's one way I troubleshot it. In Studio, on the Apply XSLT activity where I'm using this stylesheet, I used the "Test" button to apply the stylesheet to sample xml. I still got the generic error listed above. However, out in the directory where Studio is installed, I looked at the error0.log file, and it contained the complete exception that generated the error; from which I was able to figure out what caused the error. Thanks, -Mark So what was the problem?2010-01-29T18:34:05Z This is the accepted answer. This is the accepted answer.I use OxygenXML for development of custom stylesheets, with the XSLT parser set to Saxon 9B (Saxon being the underlying XSLT processor in the Cast Iron runtime). I have never had a situation where a stylesheet developed and compiled in Oxygen does not work in the runtime (unless the actual instance document is in the wrong namespace), and if there are errors in the stylesheet, it never fails to pick it up and warn me. Can you give us some insight as to what your error was so that we can possibly provide you some guidance for your future development work using custom XSLT with Cast Iron? Regards, Alan Director of Solutions Engineering and Cast Iron guru.
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014631120
CC-MAIN-2016-30
refinedweb
378
62.48
CustomValidator with RPC Hej Guys, I need some help/thought/ideas. I have my user registration form with necessary account data. My problem is to implement some custom validation of the username field (it is a unique attribute), so i need to check if this username is already uses or not. To create a custom validator class which is implementing the validate() method of the Validator interface. I know that i cant add there any return inside the RPC call for the validate method, as well i can not also create just a variable, because it has to be final. Any idea how to implement this? Code: public class UsernameValidator implements Validator<String, Field<String>> { public String validate(Field<String> field, String value) { UserServiceRemoteAsync userService = Registry.get("userService"); userService.isUsernameValid(new AsyncCallback<Boolean>(){ public void onSuccess(Boolean arg0) { } }); return null; } } I know thats why it is asynchronous. One solution would be to not validate the field and later on submit() call just popup a Box that this username is used and avoid sending the RPC call to save the object. But it would be really nice to directly (or some seconds because RPC is asynchronous) see after typing and filling the field, (maybe using the setValidationDelay() of the TextField??) some validation error. Iam running out of ideas. Maybe iam just blind. kind regards just set the field.forceInvalid(java.lang.String msg) to whatever in the onSuccess returnGXT JavaDocs: GXT FAQ & Wiki: Buy the Book on GXT: Follow me on Twitter: The RPC works like a charm. I just have next problem. When iam setting a valid username everything works fine RPC call etc. when changing the field value to another valid username the new RPC call is invoked. The problem have been that this method disable the invoking of any validation. I do not get the sense here. It is just more to implement to get it working. Here my code if somebody will face same problem: Code: public class UsernameValidator implements Validator<String, Field<String>> { public String validate(final Field<String> field, String value) { UserServiceRemoteAsync userService = Registry.get("userService"); userService.isUsernameValid(value, new AsyncCallback<Boolean>(){ public void onSuccess(Boolean result) { if(!result) field.forceInvalid("Username already exists!"); } public void onFailure(Throwable arg0) { GWT.log(arg0.getMessage(),null); } }); return null; } } For this you need a Listener on the Change Event. Code: login.setFieldLabel(Main.constants.label_username()); login.setName("login"); login.setAllowBlank(false); login.setTabIndex(1); login.setValidator(new UsernameValidator()); login.addListener(Events.Change, new Listener<FieldEvent>(){ public void handleEvent(FieldEvent be) { if(!be.field.isValid()){ be.field.clearInvalid(); be.field.validate(); } } }); It works so far ... just some form bug i guess when one time bad name, than a good one ... than a bad... there is appearing some scrollbar I dont know if it is a field/form bug. I hate that u are solving some problem and next appears same problem... rssss I will test you code example.. look
https://www.sencha.com/forum/showthread.php?55682-CustomValidator-with-RPC
CC-MAIN-2015-32
refinedweb
490
58.58
[Alpha Delta Victor] prefix considered harmfull Discussion in 'Ruby' started by Josef 'Jupp' Schugt, Dec 23,,756 - Darryl L. Pierce - Dec 10, 2004 Karl Heinz Buchegger, Victor Bazarov, socketd, Nils Petter Vaskinn: The Owners of C++.perseus, Aug 12, 2003, in forum: C++ - Replies: - 20 - Views: - 1,060 - Mike Wahler - Aug 13, 2003 subprocess considered harmfull?Uri Nix, Sep 25, 2005, in forum: Python - Replies: - 6 - Views: - 2,071 - Roger Upole - Sep 27, 2005 removing a namespace prefix and removing all attributes not in that same prefixChris Chiasson, Nov 12, 2006, in forum: XML - Replies: - 6 - Views: - 758 - Richard Tobin - Nov 14, 2006 delta cycle?? (delta delay)srikanth.padava, Feb 28, 2008, in forum: VHDL - Replies: - 0 - Views: - 1,300 - srikanth.padava - Feb 28, 2008
http://www.thecodingforums.com/threads/alpha-delta-victor-prefix-considered-harmfull.818653/
CC-MAIN-2015-48
refinedweb
125
68.81
import caffe class My_Custom_Layer(caffe.Layer): def setup(self, bottom, top): pass def forward(self, bottom, top): pass def reshape(self, bottom, top): pass def backward(self, bottom, top): pass So important things to remember: The Setup method is called once during the lifetime of the execution, when Caffe is instantiating all layers. This is where you will read parameters, instantiate fixed-size buffers. Use the reshape method for initialization/setup that depends on the bottom blob (layer input) size. It is called once when the network is instantiated. The Forward method is called for each input batch and is where most of your logic will be. The Backward method is called during the backward pass of the network. For example, in a convolution-like layer, this would be where you would calculate the gradients. This is optional (a layer can be forward-only).
https://riptutorial.com/caffe/example/31618/layer-template
CC-MAIN-2022-21
refinedweb
144
56.35
Background After Friedemann has given an initial introduction about Qt’s Windows Runtime port, I would like to give some further insight about technical aspects and our ways of working on the port. When reading about Windows Runtime development (Windows 8 store applications and Windows runtime components) in connection with C++ you will find C++/CX again and again. Windows C++/CX are C++ language extensions which were developed by Microsoft to make software development for Windows Runtime easier by bringing it “as close as possible to modern C++” (Visual C++ Language Reference (C++/CX)). In some cases, these extensions look similar to C++/CLI constructs, but they might have other meanings or slightly different grammar. The first thing that catches someone’s eye when one has a look at C++/CX documentation or an example/application are lines like Foo ^foo = ref new Foo(); The ^ is basically a pointer, but gives the additional information that it is used on a ref-counted COM object so that memory management happens “automagically”. The “ref new” keyword means that the user wants to create a new “Ref class” (see Ref classes and structs in Type System (C++/CX)), which means that it is copied by reference and memory management happens by reference count. So there isn’t much magic involved in that line; it only tells the compiler that the object’s memory can be managed by reference count and the user does not have to delete it himself. Basically C++/CX is just what its name tells us it is – extensions to the C++ language. Everything ends up as native unmanaged code quite similar to the way Qt works. Some people might argue whether it is necessary to reinvent the wheel for the n-th time where a lot of the “problems” are actually solved in C++11 (by the way, auto foo also works in the example above), but that is what was decided for Windows Runtime development. Use of C++/CX inside Qt’s WinRT port Microsoft has said on different occasions (among others during the Build conference 2012) that everything that can be done using C++/CX can also be done without the extensions, as everything ends up as native code in either case. So we had to decide whether we want to use the new fancy stuff or take the cumbersome road of manual memory management etc. Theoretically there is nothing that keeps us from using C++/CX in Qt’s WinRT port, but there are some reasons why we try to avoid them. For one, these extensions might prevent developers who are willing to help with the Windows Runtime port from having a deeper look at the code. If you do not have any previous experience with this development environment, having new constructs and keywords (in addition to new code) might be enough for you to close the editor right away. While WinRT code which doesn’t use CX might not be especially beautiful, there are no non-default things which might obscure it even more. Another issue is that Qt Creator’s code model cannot handle these extensions (yet). You don’t get any auto completion for ^-pointers, for example. This can of course be fixed in Qt Creator and time will tell whether it will be, but at the moment the port and basic Qt Creator integration (building, debugging & deployment) are our first priorities. Due to these facts, we decided that we do not want to use the extensions. Though, if someone wants to help out with the port and is eager to use CX he/she might be able to persuade us to get the code in (after proper review of course 😉 ). Problems and challenges of not using C++/CX The main problem when it comes to development of Windows Runtime code without using C++/CX is the severe lack of documentation. While the MSDN documentation generally can be improved in certain areas, it almost completely lacks anything about this topic. But thanks to Andrew Knight, who gave me an initial overview how things are to be used and was always helpful whenever I had additional questions, I think I am getting the grip on things. In order to help others who want to join the efforts (and have all the things written down), I will cover some basic areas below. Namespaces The namespaces given in the documentation are always the same for the CX usage of the classes, just with “ABI” added as the root namespace. So for StreamSocket, Windows::Networking::Sockets becomes ABI::Windows::Networking::Sockets. Additionally, you probably need Microsoft::WRL (and also Microsoft::WRL::Wrappers). WRL stands for “Windows Runtime C++ Template Library” and is used for direct COM access in Windows Runtime applications – but you will also need its functionality when omitting CX (for creating instances for example). Creating instances When not using CX, most of the classes cannot be accessed directly. Instead, there are interface classes which need to be used. These interfaces are marked by an ‘I’ in front of the class name so that StreamSocket becomes IStreamSocket. As these interfaces are abstract classes, they cannot be instantiated directly. First of all, you have to create a string which represents the class’s classId. HStringReference classId(RuntimeClass_Windows_Networking_Sockets_StreamSockets); These RuntimeClass_Windows… constructs are defined in the related header files and expand to strings like “Windows.Networking.Sockets.StreamSocket” for example. The way objects can be instantiated depends on whether the class is default constructable or not. If it is, ActivateInstance can be used to obtain an object of the type you are after. IStreamSocket *streamSocket = 0; if (FAILED(ActivateInstance(classId.Get(), &streamSocket)) { // handle error } Unfortunately, the ActivateInstance convenience function fails for StreamSocket in that case as it expects a ComPtr as parameter. In order to avoid that failure one has to take the long way using RoActivateInstance IInspectable *inspectable = 0; if (FAILED(RoActivateInstance(classId.Get(), &inspectable)) { // handle error } if (FAILED(inspectable->QueryInterface(IID_PPV_ARGS(&streamSocket)))) { // handle error } If the class is not default constructable, it has to use a factory in order to create instances. These factories can be obtained by calling GetActivationFactory with the appropriate class Id. One example of a class like that would be HostName: IHostNameFactory *hostnameFactory; HStringReference classId(RuntimeClass_Windows_Networking_HostName); if (FAILED(GetActivationFactory(classId.Get(), &hostnameFactory))) { // handle error } IHostName *host; HStringReference hostNameRef(L""); hostnameFactory->CreateHostName(hostNameRef.Get(), &host); hostnameFactory->Release(); People who are used to Windows development probably have already noticed that all this is COM based. That means that all this has been around for ages and is loved everywhere. Calling static functions For classes which have static functions there is an extra interface for these functions. These interfaces are marked by “Statics” at the end of the “basic” interface name and can also be obtained by using GetActivationFactory. One example would be IDatagramSocketStatics which contains GetEndpointPairsAsync for example. IDatagramSocketStatics *datagramSocketStatics; GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics); IAsyncOperation<IVectorView *> *endpointpairoperation; HSTRING service; WindowsCreateString(L"0", 1, &service); datagramSocketStatics->GetEndpointPairsAsync(host, service, &endpointpairoperation); datagramSocketStatics->Release(); host->Release(); The endpointpairoperation defines the callback(s) for this asynchronous function, but that topic could be covered in another post. The interesting parts here are how the datagramSocketStatics pointer is filled by calling GetActivationFactory and the actual call to the static function by datagramSocketStatics->GetEndpointPairsAsync(...). ComPtr There is a way to use reference counted memory management even without using CX. It can be achieved by using the Microsoft-provided smart pointer ComPtr. So IStreamSocket *streamSocket would become ComPtr<IStreamSocket> streamSocket. When using these, we had some memory access errors we could not explain (but did not investigate much further). In addition to that, Qt Creator does not support code completion with “streamSocket->” but one would have to call “streamSocket.Get()->”. Thus we decided not to use ComPtr but keep using “normal” pointers. All you have to do is to remember to call “Release” as soon as you are done with the pointer. All in all, we try to avoid these extensions even though it might not make the code beautiful. If you want to contribute though and feel at home using these, feel free to create a patch containing CX code. If you have any further questions or advice, feel free to add them in the comments or join us in #qt-winrt on freenode. OMG, what have they done to C/C++ ?!?! I believe if I am ever going to return to Windows programming I will stick with Win32 C APIs. I once tried to port a small GUI app from Win32 to a more modern .NET UI and started looking into C++/CLI. I was totally horrified of the syntax and the new paradigms. So thanks Qt for giving me a clean and elegant C++ wrapper for Windows programming and hiding all these “improved” extensions from me. I’ve just felt the same. I was surprised at first by how many Windows-only applications are written in Qt. Now I know why. I think not using the C++/CX was a good decision. On the other hand, not using RAII/smart pointers/ComPtr is two steps backwards. The first thing you will forget is to call Release() in every code path. It is exactly the same problem what we have with new and delete. I agree. I’m assuming the reason code completion doesn’t work on the ComPtr class is the overloaded -> operator returning a hacked pointer cast to hide AddRef/Release, Qt could just roll their own that doesn’t do that. +1 Very, very, +1 Agreed. Not using ComPtr is just as silly as not using other C++ pointer types, such as QScopedPointer etc. Why not std::unique_ptr / std::shared_ptr with a custom deleter that calls Object::Release() on destruction? Just std::bind() the instance to the Release() member, store it in a std::function and wrap the whole thing in a nice qt::make_com() wrapper. That way you can have all the benefits of reference counting with non of the silly language extensions. That would be slow, and memory hungry, but yes, one can create a QComPtr easily if she/he has problems with ComPtr. “That would be slow, and memory hungry” Why? This isn’t garbage collection. The only cost is the reference count which is negligible next to the guarantee that resources are properly cleaned up. The std::bind creates an unnecessary object on the heap, the std::function will create another one. It’s at least two new, and two indirection. Totally fine when we need one quick solution for one place, not so good when we want to use it million times. Also the COM objects have an internal reference count mechanism (AddRef()/Release()) so no need to use another one. If we want reference counting/ComPtr/all that modern garbage (collection) we might as well use Java/.NET and be done (with Qt). Java/.NET don’t use reference counting, and reference counting is not garbage collection. It’s a deterministic lifetime model. Qt already uses reference counting, a prime example is the QSharedPointer class. And QVector, QString… That’s implicit sharing, not quite the same thing. It’s reference counting with Copy-On-Write semantics. C++ is complex enough without yet another proprietary extension to the language. And how someone at MS thought ‘^’ would naturally mean ‘reference counted pointer’ is beyond me! We’ve had reference counting in C and C++ for decades and it didn’t require extensions to the base language. Instead of ‘^’ they should have used ‘EEE’ for Embrace, Extend, Extinguish; C++/CX needs to die. It’s just as “natural” as “*” meaning “a pointer”. It’s a matter of convention. ^ should be familiar to those who dealt with Pascal, ref rings a bell to Algolites. Speaking many languages sometimes widens your horizons and makes you less surprised at stuff “… has been around for ages and is loved everywhere…” You almost made me spill coffee on my Retina keyboard with that sentence Your C++ notation sucks btw… the variable is a pointer to IStreamSocket, so you should write IStreamSocket* streamSocket = 0; instead of IStreamSocket *streamSocket = 0; even though the compiler accepts both. Read on “Coding Conventions” for C++. As a first start, here is for Qt: If you have two things on one line, the placement of the * can have a big impact on readability: IStreamSocket* foo, bar; looks like foo and bar will be the same type at a glance. But, the * only applies to foo. So, a lot of people consider it good practice to always put the * with the name instead of the type. Or don’t declare multiple variables on the same line. Then it’s a non-issue. LOL no. Thus we decided not to use ComPtr but keep using “normal” pointers. It’s better to write QComPtr for Qt. Step backward Please, don’t use raw pointers in 2013 (C++11 is already here)! Especially with COM/OLE (I personally like to use “Compiler COM Support Classes” with MSVC: _com_ptr_t, _bstr_t, etc). Wrapped those raw pointer by unique_ptr or just design a lightweight wrapper for them, it should not be too hard.But even in 2013, you could find c++ programmers with years experience refuse to rely on RAII, they keep telling me RAII is expensive blahblahblah, even after you show them the truth RAII is not as expensive as they though, that depend on what kind of smart pointer you are using, they keep telling you “abstraction will bite you one day, if you want safe codes, you should write bare bone codes, they are faster, safer, and easier to debug”. No way to change them, even c++11 is out, I still feel pessimistic about c++. Wrapped those raw pointer by unique_ptr or just design a lightweight wrapper for them, it should not be too hard. Of course, I’ll do so. But it’s better to Qt provides them in its code/interfaces/classes/etc by default. Ms keeps inventing new totally useless things to earn money on it and to discontinue after several releases and start some new totally useless thing. So you need to keep learning technologies that will be discontinued soon instead of adding up to your knowledge and doing something real with it. Now they started to play with C/C++. There is no need to use raw pointers if you don’t want to. There is: QSharedPointer, QScopedPointer… shared_ptr… And now in C++14: make_unique and make_shared Why don’t we just create bindings of Qt for C#? Creating .NET bindings for a heavily C++ API is hard. Also, WinRT is natively C++ and some stuff can’t be done entirely in C# yet so why would Qt go there? Yep, seems like Windows 8 really backs away from MSFT’s commitment to .NET. So we shouldn’t complain about C++/CX too much I don’t think. Actually there already are free and open source (LGPL) C#-bindings for Qt, check them out at. They wrap just Qt 4 for now but I’ve been already working for a week now on Qt 5 support, it will be complete in a month at most. Please have a look at an old library called comet () It wraps COM into a very nice set of c++ classes allowing you to use plain c++ to access COM object. Much nicer and easier to use than any Microsoft implementation. COM errors are automatically translated to exptions, and vice versa. Just to mention one of the nice features. A more comprehensive feature list at: @Mikael I don’t know too much about COM, but that comet library looks nice. It’s also liberally licensed. Could this help the WinRT Qt port? I believe so. You run a utility called tlb2h on any COM type library, and get a header file with all COM classes and interfaces wrapped into a set of easy to use c++ classes I don’t think this will work. WinRT comes with “newer version” of COM which differs from the old COM in several areas. For example component activation is different – you don’t registry your component in registry anymore. There is now COM inheritance and static function members (emulated by normal members in object factories). If comet didn’t get significant update there is a small chance it will just work. Just say no to MSFT proprietary bullshit. On the other hand, WinRT is a proprietary Windows platform. What’s wrong with using that platform’s native (and proprietary) tooling to create the Qt port? Seems odd _not_ to do that. Great decison not to embrace this new (and totally unnecessary) C++/CX that Microsoft invented for some obscure reasons… Great decision not to embrace this new (and totally unnecessary) C++/CX that Microsoft invented for some obscure reasons… ÇHonestly, and I think I speak for the majority of users: we’re not interestered in Win8 and WinRT is a total fiasco. Better use your time in other things. Indeed, if the rumor is true that Win8.1 a.k.a. Blue (to be released this summer) will allow booting into a classic desktop, that will be the first nail in WinRT’s coffin, I believe. Please note that a WinRT does have to a very large extent the same codebase to enable Windows Phone support. Meaning with the Qt/WinRT version we are aiming at both those distribution platforms. Keep up the very good work. Ironic really how many comments there are here complaining about non standard extensions to c++. Qt signals and slots anyone? This is why I don;t use either C++/CX or Qt. Neither of them are c++ Many people do not complain about the signal and slot of Qt because it is very easy to use and learn, clean and concise, they make the codes become easier to manage(The only draw back for me is unable to work with template). Extension of the langauges are not a bad thing, but something extremely awkward like microsoft did is another story, I would drop back to C API rather than using those unfriendly API designed by microsoft. Except Qt signals and slots are NOT an extension of the language itself – they’re macros that are picked up by the MOC compiler that then spits out standard C++ in a accompanying header. Qt signals and slots filled a major hole in C++98: the inability to easily bind arbitrarily member function callbacks to signals. Any conforming C++ compiler can build Qt and Qt apps but only Visual Studio can build C++/cx. This ‘^’ bullshit is just Microsoft’s latest attempt to lock developers into it’s platform.
http://blog.qt.io/blog/2013/04/19/qts-winrt-port-and-its-ccx-usage/
CC-MAIN-2016-18
refinedweb
3,121
61.77
import "golang.org/x/crypto/openpgp/armor" Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is very similar to PEM except that it has an additional CRC checksum. var ArmorCorrupt error = errors.StructuralError("armor invalid") func Encode(out io.Writer, blockType string, headers map[string]string) (w io.WriteCloser, err error) Encode returns a WriteCloser which will encode the data written to it in OpenPGP armor. type Block struct { Type string // The type, taken from the preamble (i.e. "PGP SIGNATURE"). Header map[string]string // Optional headers. Body io.Reader // A Reader from which the contents can be read // contains filtered or unexported fields } A Block represents an OpenPGP armored structure. The encoded form is: -----BEGIN Type----- Headers base64-encoded Bytes '=' base64 encoded checksum -----END Type----- where Headers is a possibly empty sequence of Key: Value lines. Since the armored data can be very large, this package presents a streaming interface. Decode reads a PGP armored block from the given Reader. It will ignore leading garbage. If it doesn't find a block, it will return nil, io.EOF. The given Reader is not usable after calling this function: an arbitrary amount of data may have been read past the end of the block. Package armor imports 5 packages (graph) and is imported by 88 packages. Updated 2017-11-29. Refresh now. Tools for package owners.
https://godoc.org/golang.org/x/crypto/openpgp/armor
CC-MAIN-2017-51
refinedweb
229
59.09
Inside Visual Studio 2010 Microsoft is released Visual Studio 2010 Beta 2. Find out key features of Microsoft's next-generation development environment, and learn key features of the Framework, Visual Basic, and C#. In October 2009, Microsoft released Visual Studio 2010 Beta 2. It also announced that the official release of its flagship development tool will follow in the first half of 2010. The latest version of Visual Studio sports a wide-ranging assortment of new features. If you haven't begun to look at all it offers yet, you have a lot to look forward to—and just as much to learn! This article will help you get under way by providing a short summary of key features of Microsoft's next-generation development environment, walking you through key features of the Framework, Visual Basic, and C#. Each new feature cited also includes a link that allows you to find more information about that feature. What's new in .NET Framework 4 At the heart of the language features in Visual Studio is the latest version of the .NET Framework, version 4. Among the most touted new features is a change to how .NET handles writing code for parallel computing-relating tasks. Specifically, .NET Framework 4 promises a simplified programming model for writing multithreaded and asynchronous code. This is especially important in today's computing environment, where new machines that feature less than dual processors (apart from netbooks) are becoming increasingly rare. Other features new to .NET Framework 4 include a new garbage collection engine; a new System.Diagnostics.Contracts namespace that enables you to express coding assumptions in a language-neutral way; a new dynamic language runtime (DLR) environment that adds a set of services for working with dynamic languages in the CLR; support for memory-mapped files and 64-bit operating systems and processes; an enhanced security model; and many more related to networking, data, client and Web development, communications and workflow, and more. The languages You can also find many new language features in the core set of languages that make up Visual Studio, especially in C# and VB, as well as a brand new language created explicitly to facilitate functional programming in .NET, F#. As with the .NET Framework, these languages include far more features and capabilities than can be touched on in this short introductory piece. However, you will find a list of new features that highlight some of the more interesting new features, as well as links to where you can more about these languages. What's new in VB 2010 Let's drill down on the .NET language that Microsoft calls its most widely used first. The latest version of Visual Basic introduces (at last!) multiline lambda statements (This feature was introduced in C# in VS 2008, and many VB developers lamented its exclusion in that version. Another interesting feature: implicit line continuation. This feature enables you to omit the underscore line continuation character in many circumstances when your lines spill over their preferred or preset limits. Note that you do face limitations on this ability; you can learn more about statements in VB 2010 here. Other features build on the historic ease-of-use of the language, reducing the amount of code you must create. For example, collection initializers let you create a collection and populate it with an initial set of values using abbreviated syntax; while auto-implemented properties let you specify a class property without writing a Get and Set property (Be sure to check out other new features in VS 2010). What's new in C# 2010 C# also gets a slew of new features. Among the more controversial features: C# 2010 introduces dynamic support, which provides support for late binding to dynamic types. This feature promises simplified access to COM and dynamic APIs, among other uses. Other features introduced in C# include the ability to access Office Automation APIs; new command-line options, such as the ability to specify that you want to use particular to a specific version of C# (VB 2010 has a similar feature); and a new IDE feature called Call Hierarchy feature that enables you to jump to particular sections of your code more easily. C# and Visual Basic both feature type equivalence support and support for contravariance and covariance. What's next This article provides a quick and dirty summary of the new features in VS 2010, including new features in the .NET Framework and in its core languages, VB and C#. Of course, there is much more to Microsoft's development story. This article only brushes on C++ and F#; doesn't address the new computing paradigm presented by the cloud and Azure computing; doesn't cover the various SKUs of the next version of VS 2010; nor does it touch on Web development specifically, whether in the form of ASP.NET, Ajax, or Silverlight. Look for more information on all the topics and more in the near future on. Start the conversation
https://searchwindevelopment.techtarget.com/news/1375440/Inside-Visual-Studio-2010
CC-MAIN-2020-45
refinedweb
833
52.49
removecommand This info manual describes how to use and administer CVS version 1.11.23.. suite. Previous: What is CVS not?, Up: Overview [Contents][Index]’.. Next: Cleaning up, Previous: Getting the source, Up: A sample session [Contents][Index] ‘-m’ flag instead, like this: $ cvs commit -m "Added an optimization pass" backend.c Next: Viewing differences, Previous: Committing your changes, Up: A sample session [Contents][Index] ‘-d’ flag with release, it also removes your working copy. In the example above, the release command wrote a couple of lines of output. ‘?. ‘M. Previous: Cleaning up, Up: A sample session [Contents][Index] Next: Starting a new project, Previous: Overview, Up: Top [Contents][Index] ‘/’, then :local: is assumed. If it does not start with ‘/’. Next: Repository storage, Up: Repository [Contents][Index]. Next: Working directory storage, Previous: Specifying a repository, Up: Repository [Contents][Index]. Next: File permissions, Up: Repository storage [Contents][Index] ‘. Next: Windows permissions, Previous: Repository files, Up: Repository storage [Contents][Index]). Next: Attic, Previous: File permissions, Up: Repository storage [Contents][Index]. Next: CVS in repository, Previous: Windows permissions, Up: Repository storage [Contents][Index]. Next: Locks, Previous: Attic, Up: Repository storage [Contents][Index]]. Previous: Locks, Up: Repository storage [Contents][Index] The . Next: Intro administrative files, Previous: Repository storage, Up: Repository [Contents][Index]. This file contains the current CVS root, as described in Specifying/revision/timestamp[+conflict]/options/tagdate where ‘[’ and ‘]’ are not part of the entry, but instead indicate that the ‘+’ and conflict marker are optional. name is the name of the file within the directory. revision’. This is a temporary file. Recommended usage is to write a new entries file to Entries.Backup, and then to rename it (atomically, where possible) to Entries. The only relevant thing about this file is whether it exists or not. If it exists, then it means that only part of a directory was gotten and CVS will not create additional files in that directory. To clear it, use the update command with the ‘-d’ option, which will get the additional files and remove Entries.Static.. This file stores notifications (for example, for edit or unedit) which have not yet been sent to the server. Its format is not yet documented here. This file is to Notify as Entries.Backup is to Entries. That is, to write Notify, first write the new contents to Notify.tmp and then (atomically where possible), rename it to Notify. If watches are in use, then an edit command stores the original copy of the file in the Base directory. This allows the unedit command to operate even if it is unable to communicate with the server. The file lists the revision for each of the files in the Base directory. The format is: Bname/rev/expansion where expansion should be ignored, to allow for future expansion. This file is to Baserev as Entries.Backup is to Entries. That is, to write Baserev, first write the new contents to Baserev.tmp and then (atomically where possible), rename it to Baserev. This file contains the template specified by the rcsinfo file (see rcsinfo). It is only used by the client; the non-client/server CVS consults rcsinfo directly. Next: Multiple repositories, Previous: Working directory storage, Up: Repository [Contents][Index] modules, for a full explanation of all the available features.. Next: Creating a repository, Previous: Intro administrative files, Up: Repository [Contents][Index]. Next: Backing up, Previous: Multiple repositories, Up: Repository [Contents][Index]. Next: Moving a repository, Previous: Creating a repository, Up: Repository [Contents][Index]. Next: Remote repositories, Previous: Backing up, Up: Repository [Contents][Index]. Next: Read-only access, Previous: Moving a repository, Up: Repository [Contents][Index]. If method is not specified, and the repository name contains ‘:’, then the default is ext or server, depending on your platform; both are described in Connecting via rsh. Next: Connecting via rsh, Up: Remote repositories [Contents][Index]. Next: Password authenticated, Previous: Server requirements, Up: Remote repositories [Contents][Index] CVS may use the ‘ssh’ protocol to perform these operations, so the remote user host needs to have a either an agent like ssh-agent to hold credentials or a .shosts file which grants access to the local user. Note that the program that CVS uses for this purpose may be specified using the --with-ssh flag to configure. 'echo $PATH' To test that ‘ssh’ is working use ssh three access methods that you use in CVSROOT for rsh or ssh. :server: specifies an internal rsh client, which is supported only by some CVS ports. :extssh: specifies an external ssh program. By default this is ssh (unless otherwise specified by the --with-ssh flag to configure) but you may set the CVS_SSH environment variable to invoke another program or wrapper script. ‘.) Next: GSSAPI authenticated, Previous: Connecting via rsh, Up: Remote repositories [Contents][Index]. Next: Password authentication client, Up: Password authenticated [Contents][Index]: #! /bin/sh exec /usr/local/bin/cvs -f \ --allow-root=/repo1 \ --allow-root=/repo2 \ ... --allow-root=/repoN \ pserver). Be aware, however, that falling back to system authentication might be a security risk: CVS operations would then be authenticated with that user’s regular login password, and the password flies across the network in plaintext. See Password authentication security. Next: Password authentication security, Previous: Password authentication server, Up: Password authenticated [Contents][Index] ‘. Previous: Password authentication client, Up: Password authenticated [Contents][Index]. Next: Kerberos authenticated, Previous: Password authenticated, Up: Remote repositories [Contents][Index].example.org:/usr/local/cvsroot checkout foo Next: Connecting via fork, Previous: GSSAPI authenticated, Up: Remote repositories [Contents][Index] Remote repositories) or the CVS_CLIENT_PORT environment variable (see Environment variables) on the client.. Previous: Kerberos authenticated, Up: Remote repositories [Contents][Index]. Next: Server temporary directory, Previous: Remote repositories, Up: Repository [Contents][Index]. Previous: Read-only access, Up: Repository [Contents][Index] While running, the CVS server creates temporary directories. They are named cvs-servpid where pid is the process identification number of the server. They are located in the directory specified by the ‘. Next: Revisions, Previous: Repository, Up: Top [Contents][Index]. Next: Defining the module, Up: Starting a new project [Contents][Index] The first step is to create the files inside the repository. This can be done in a couple of different ways. Next: From other version control systems, Up: Setting up the files [Contents][Index]. Next: From scratch, Previous: From files, Up: Setting up the files [Contents][Index] If you have a project which you are maintaining with another version control system, such as RCS, you may wish to put the files from that project into CVS, and preserve the revision history of the files.. Previous: From other version control systems, Up: Setting up the files [Contents]:. Next: Tags, Previous: Versions revisions releases, Up: Revisions [Contents][Index] (see Branching and merging). Next: by date/tag, Previous: Tags, Up: Revisions [Contents][Index]! Next: Modifying tags, Previous: Tagging the working directory, Up: Revisions [Contents][Index] Next: Tagging add/remove, Previous: Tagging by date/tag, Up: Revisions [Contents][Index] ‘-j’ option to update; for further discussion see Merging two revisions. Next: Recursive behavior, Previous: Revisions, Up: Top [Contents][Index]. Next: Creating a branch, Up: Branching and merging [Contents][Index]. Next: Accessing branches, Previous: Branches motivation, Up: Branching and merging [Contents][Index]’. ‘ $ ‘. There is, however, one major caveat with using ‘-kk’ on merges. Namely, it overrides whatever keyword expansion mode CVS would normally have used. In particular, this is a problem if the mode had been ‘-kb’ for a binary file. Therefore, if your repository contains binary files, you will need to deal with the conflicts rather than using ‘-kk’. As a result of using ‘-kk’ during the merge, each file examined by the update will have ‘. Next: Adding and removing, Previous: Branching and merging, Up: Top [Contents][Index] ~/.cvsrc (see ~/.cvsrc). $ cvs update -l # Don’t update files in subdirectories Next: History browsing, Previous: Recursive behavior, Up: Top [Contents][Index]. Next: Removing files, Up: Adding and removing [Contents][Index] To add a new file to a directory, follow these steps.). Next: Removing directories, Previous: Adding files, Up: Adding and removing [Contents][Index] ‘-r’ and ‘ ‘). Next: Moving files, Previous: Removing files, Up: Adding and removing [Contents][Index] .keepme) in it to prevent ‘-P’ from removing it. Note that ‘-P’ is implied by the ‘-r’ or ‘-D’ options of CVS will be able to correctly create the directory or not depending on whether the particular version you are checking out contains any files in that directory. Next: Moving directories, Previous: Removing directories, Up: Adding and removing [Contents][Index]. Next: Inside, Up: Moving files [Contents][Index]] loginfo). To log tags, use the taginfo file (see taginfo). To log checkouts, exports, and tags, respectively, you can also use the ‘-o’, ‘-e’, and ‘. Next: Multiple developers, Previous: History browsing, Up: Top [Contents][Index]. Next: Binary howto, Up: Binary files [Contents][Index] ‘update . Previous: Binary why, Up: Binary files [Contents][Index]. Next: Revision management, Previous: Binary files, Up: Top [Contents][Index]. Next: Updating a file, Up: Multiple developers [Contents][Index] Based on what operations you have performed on a checked out file, and what operations others have performed to that file in the repository, one can classify a file in a number of states. The states, as reported by the status command, are: The file is identical with the latest revision in the repository for the branch in use. You have edited the file, and not yet committed your changes. You have added the file with add, and not yet committed your changes. You have removed the file with remove, and not yet committed your changes. Someone else has committed a newer revision to the repository. The name is slightly misleading; you will ordinarily use update rather than Like Needs Checkout, but the CVS server will send a patch rather than the entire file. Sending a patch or sending an entire file accomplishes the same thing. Someone else has committed a newer revision to the repository, and you have also made modifications to the file. A file with the same name as this new file has been added to the repository from a second workspace. This file will need to be moved out of the way to allow an update to complete. This is like Locally Modified, except that a previous update command gave a conflict. If you have not already done so, you need to resolve the conflict as described in Conflicts example. Invoking CVS. For information on its Sticky tag and Sticky date output, see Sticky tags. For information on its Sticky options output, see the ‘ Invoking CVS. Next: Conflicts example, Previous: File status, Up: Multiple developers [Contents][Index]. ‘<<<<<<<’, ‘=======’ and ‘>>>>>>>’. ‘>>>>>>> ’. Next: Concurrency, Previous: Conflicts example, Up: Multiple developers [Contents][Index] It is often useful to inform others when you commit a new revision of a file. The loginfo file can be used to automate this process.]: cvs uneditcommand (described below) to the file cvs releasecommand (see release) to the file’s parent directory (or recursively to a directory more than one level up) cvs updateto ‘. Next: Watch information, Previous: Getting Notified, Up: Watches [Contents][Index] commands.. Next: Watches Compatibility, Previous: Editing files, Up: Watches [Contents][Index] . Previous: Watch information, Up: Watches [Contents][Index]. Previous: Watches, Up: Multiple developers [Contents][Index]. Next: Keyword substitution, Previous: Multiple developers, Up: Top [Contents][Index]. Up: Revision management [Contents][Index]. Next: Tracking sources, Previous: Revision management, Up: Top [Contents][Index] As long as you edit source files inside a working directory you can always find out the state of your files via ‘cvs status’ and ‘c. Next: Using keywords, Up: Keyword substitution [Contents][Index] This is a list of the keywords: $Author$ The login name of the user who checked in the revision. ‘Name::…$. Each new line is prefixed with the same string which precedes the $Log keyword. ‘ * ’. Unlike previous versions of CVS and RCS, the comment leader from the RCS file is not used. The $Log keyword is useful for accumulating a complete change log in a source file, but for several reasons it can be problematic. See. Next: Avoiding substitution, Previous: Keyword list, Up: Keyword substitution [Contents][Index] $"; Next: Substitution modes, Previous: Using keywords, Up: Keyword substitution [Contents][Index] Keyword substitution has its disadvantages. Sometimes you might want the literal text string ‘$Author$’ to appear inside a file without CVS interpreting it as a keyword and expanding it into something like ‘$Author: ceder $’. There is unfortunately no way to selectively turn off keyword substitution. You can use ‘-ko’ (see Substitution modes) to turn off keyword substitution entirely. In many cases you can avoid using keywords in the source, even though they appear in the final product. For example, the source for this manual contains ‘$@asis{}Author$’ whenever the text ‘$Author$’ should appear. In nroff and troff you can embed the null-character \& inside the keyword for a similar effect. Next: Log keyword, Previous: Avoiding substitution, Up: Keyword substitution [Contents][Index] Binary files, and Merging and keywords. The modes available are: Generate keyword strings using the default form, e.g. $Revision: 5.7 $ for the Revision keyword. Like ‘-kkv’, except that a locker’s name is always inserted if the given revision is currently locked. The locker’s name is only relevant if cvs admin -l is in use. Generate only keyword names in keyword strings; omit their values. For example, for the Revision keyword, generate the string $Revision$ instead of $Revision: 5.7 $. This option is useful to ignore differences due to keyword substitution when comparing different revisions of a file (see Merging and keywords). Generate the old keyword string, present in the working file just before it was checked in. For example, for the Revision keyword, generate the string $Revision: 1.1 $ instead of $Revision: 5.7 $ if that is how the string appeared when the file was checked in. Binary files. export. But be aware that doesn’t handle an export containing binary files correctly. Previous: Substitution modes, Up: Keyword substitution [Contents][Index]. Next: Builds, Previous: Keyword substitution, Up: Top [Contents][Index]] ‘checkout -j’ to do so: $ cvs checkout -jFSF_DIST:yesterday -jFSF_DIST wdiff The above command will check out the latest revision of ‘wdiff’, merging the changes made on the vendor branch ‘FSF. Next: Binary files in imports, Previous: Update imports, Up: Tracking sources [Contents][Index] You can also revert local changes completely and return to the latest vendor release by changing the ‘head’. Next: Special Files, Previous: Tracking sources, Up: Top [Contents][Index]).]. Next: Global options, Previous: Exit status, Up: CVS commands [Contents][Index] ‘diff’ Specify legal CVSROOT directory. See Password authentication server. -a Authenticate all communication between the client and the server. Only has an effect on the CVS client. As of this writing, this is only implemented when using a GSSAPI connection (seeDIR environment environment variable. See Repository. -e editor Use editor to enter revision log information. Overrides the setting of the $CVSEDITOR and $EDITOR environment variables. For more information, see Committing your changes. -f Do not read the ~/ (see Environment variables). The default is to make working files writable, unless watches are on (see Watches). -s variable=value Set a user variable (see Variables). ).. Next: add,, rdiff, rtag, and update commands. (The history command uses this option in a slightly different way; see: 24 Sep 1972 20:05 24 Sep; ‘1/4/96’ is January 4, not April 1. Alter the default processing of keywords. See ‘-k’ option is available with the add, diff, rdiff, import and update commands. (see modules); this option bypasses it). This is not the same as the ‘c. or rtag command, two special tags are always available: ‘HEAD’ refers to the most recent version available in the repository, and ‘BASE’ a command expects a specific revision, the name of a branch is interpreted as the most recent revision on that branch. Specifying the ‘-q’ global option along with the ‘-r’ command option is often useful, to suppress the warning messages when the RCS file does not contain the specified tag. This is not the same as the overall ‘cvs -r’ option, which you can specify to the left of a CVS command! ‘-r’ is available with the annotate, commit, diff, history,. Next: admin, Previous: Common options, Up: CVS commands [Contents][Index] The add command is used to present new files and directories for addition into the CVS repository. When add is used on a directory, a new directory is created in the repository immediately. When used on a file, only the working directory is updated. Changes to the repository are not made until the commit command is used on the newly added file. The add command also resurrects files that have been previously removed. This can be done before or after the commit command is used to finalize the removal of files. Resurrected files are restored into the working directory at the time the add command is executed. Next: add examples, Up: add [Contents][Index] These standard options are supported by add (see Common options, for a complete description of them): -k kflag Process keywords according to kflag. See Keyword substitution. This option is sticky; future updates of this file in this working directory will use the same kflag. The status command can be viewed to see the sticky options. For more information on the status command, See Invoking CVS. -m message Use message as the log message, instead of invoking an editor. Previous: add options, Up: add [Contents][Index] $ mkdir doc $ cvs add doc Directory /path/to/repository/doc added to the repository $ >TODO $ cvs add TODO cvs add: scheduling file `TODO' for addition cvs add: use 'cvs commit' to add this file permanently removecommand $ rm -f makefile $ cvs remove makefile cvs remove: scheduling `makefile' for removal cvs remove: use 'cvs commit' to remove this file permanently $ cvs add makefile U makefile cvs add: makefile, version 1.2, resurrected Next: annotate, Previous: add, (see Adding files). -ksubst Set the default keyword substitution to subst. See Keyword substitution. Giving an explicit ‘-k’ option to cvs update, cvs export, or cvs -l[rev] Lock the revision with number rev. If a branch is given, lock the latest revision on that branch. If rev is omitted, lock the latest revision on the default branch. There can be no space between (see. Next: annotate example, Up: annotate [Contents][Index] These standard options are supported by annotate (see Common. Previous: annotate options, Up: annotate [Contents][Index]. Next: commit, Previous: annotate, Up: CVS commands [Contents][Index] ‘modules’ Use revision tag. This option is sticky, and implies ‘-P’. See Sticky tags, for more information on sticky tags/dates. In addition to those, you can use these special command options with -A Reset any sticky tags, dates, or ‘-k’ options. Does not reset sticky ‘ ‘-m message’ option, and thus avoid the editor invocation, or use the ‘-F file’ option to specify that the argument file contains the log message. Next: commit examples, Up: commit [Contents][Index] These standard options are supported by commit (see Common Assigning revisions). You cannot commit to a specific revision on a branch. commit also supports these Next: export, Previous: commit, Up: CVS commands [Contents][Index]. Compare with revision tag. Line formats. Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower). Output RCS-format diffs; like ‘ Line group formats. Use format to output a line common to both files in if-then-else format. See. Next: Line formats, Up: diff options [Contents][Index]. These line groups are hunks containing only lines from the first file. The default old group format is the same as the changed group format if it is specified; otherwise it is a format that outputs the line group as-is. These line groups are hunks containing only lines from the second file. The default new group format is same as the changed group format if it is specified; otherwise it is a format that outputs the line group as-is. These line groups are hunks containing lines from both files. The default changed group format is the concatenation of the old and new group formats. These line groups contain lines common to both files. The default unchanged group format is a format that outputs the line group as-is. In a line group format, ordinary characters represent themselves; conversion specifications start with%c'\0'’ stands for a null character. where F is a printf conversion specification and n is one of the following letters, stands for n’s value formatted with F. The line number of the line just before the group in the old file. The line number of the first line in the group in the old file; equals e + 1. The line number of the last line in the group in the old file. The line number of the line just after the group in the old file; equals l + 1. The number of lines in the group in the old file; equals l - f + 1. Likewise, for lines in the new file. printf format "%5d".. Previous: Line group formats, Up: diff options [Contents][Index]. formats lines just from the first file. formats lines just from the second file. formats lines common to both files. formats all lines; in effect, it sets all three above options simultaneously. In a line format, ordinary characters represent themselves; conversion specifications start with ‘%’ "% Previous: diff options, Up: diff [Contents][Index] The following line produces a Unidiff (‘-u’ flag) between revision 1.14 and 1.19 of backend Next:’. These standard options are supported by export (see Common file that tracks each use of the commit, rtag, update, and release commands. You can use history to display this information in various formats. Logging must be enabled by creating the file $CVSROOT/CVSROOT/history. history uses ‘-f’, ‘-l’, ‘-n’, and ‘-p’ in ways that conflict with the normal use inside CVS (see Common options). Several options (shown above as ‘ One of five record types may result from an update:). One of three record types results from commit:. Next:: import output, Up: import [Contents][Index] This standard option is supported by import (see Common options for a complete description): -m message Use message as log information, instead of invoking an editor. There are the following additional special options. -b branch See Multiple vendor branches. -d Use each file’s modification time as the time of import rather than the current time. -k subst Indicate the keyword expansion mode desired. This setting will apply to all files created during the import, but not to any files that previously existed in the repository. See Substitution modes for a list of valid. Next: import examples, Previous: import options, Up: import [Contents][Index] cvsignore). L file The file is a symbolic link; cvs import ignores symbolic links. People periodically suggest that this behavior should be changed, but if there is a consensus on what it should be changed to, it doesn’t seem to be apparent. (Various options in the modules file can be used to recreate symbolic links on checkout, update, etc.; see modules.) Previous: import output, Up: import [Contents][Index] See Tracking sources, and From files. Next: rdiff, Previous: import, Up: CVS commands [Contents][Index]). log uses ‘-R’ in a way that conflicts with the normal use inside CVS (see Common options). Next: log examples, Up: log [Contents][Index] By default, log prints all information that is available. All other options restrict the output. Note that the revision selection options ( -b, -d, -r, -s, and -w) have no effect, other than possibly causing a search for files in Attic directories, when used in conjunction with the options that restrict the output to only log header fields ( -h, -R, and -t) unless the -S option is also specified. ‘-D’ option to many other CVS commands (see Common ‘>’ or ‘<’ characters may be followed by ‘=’. -n Print the list of tags for this file. This option can be very useful when your .cvsrc file has a ‘log -N’ entry as a way to get a full list of all of the tags. ‘-r’ with no revisions means the latest revision on the default branch, normally the trunk. There can be no space between the ‘] Contributed examples are gratefully accepted. Next: release, Previous: log, options for a complete description of them): -D date: remove, Previous: rdiff, Up: CVS commands [Contents][Index]. Next: release output, Up: release [Contents][Index] The release command supports one command option: -d Delete your working copy of the file if the release succeeds. If this flag is not given your files will remain in your working directory. WARNING: The release command deletes all directories and files recursively. This has the very serious side-effect that any directory created inside checked-out sources, and not added to the repository (using the add command; see Adding files) will be silently deleted—even if it is non-empty! Next: release examples, Previous: release options, Up: release [Contents][Index] commit.: update, Previous: release, Up: CVS commands [Contents][Index] The remove command is used to remove unwanted files from active use. The user normally deletes the files from the working directory prior to invocation of the remove command. Only the working directory is updated. Changes to the repository are not made until the commit command is run. The remove command does not delete files from from the repository. CVS keeps all historical data in the repository so that it is possible to reconstruct previous states of the projects under revision control. To undo CVS remove or to resurrect files that were previously removed, See add. Next: remove examples, Up: remove [Contents][Index] These standard options are supported by remove (see Common options for a complete description of them): -l Local; run only in current working directory. See Recursive behavior. -R Process directories recursively. See Recursive behavior. In addition, these options are also supported: -f Note that this is not the standard behavior of the ‘-f’ option as defined in Common options. Delete files before removing them. Entire directory hierarchies are easily removed using ‘-f’, but take note that it is not as easy to resurrect directory hierarchies as it is to remove them. Previous: remove options, Up: remove [Contents][Index] $ cvs remove remove.me cvs remove: file `remove.me' still in working directory cvs remove: 1 file exists; remove it first $ rm -f remove.me $ cvs remove remove.me cvs remove: scheduling `remove.me' for removal cvs remove: use 'cvs commit' to remove this file permanently $ ls remove.it remove.it $ cvs remove -f remove.it cvs remove: scheduling `remove.it' for removal cvs remove: use 'cvs commit' to remove this file permanently $ tree -d a a |-- CVS `-- b `-- CVS 3 directories $ cvs remove -f a cvs remove: Removing a cvs remove: Removing a/b cvs remove: scheduling `a/b/c' for removal cvs remove: use 'cvs commit' to remove this file permanently Previous: remove, Up: CVS commands [Contents][Index]. Next: update output, Up: update [Contents][Index] These standard options are available with update . See Recursive behavior. -P Prune empty directories. See Moving directories. -p Pipe files to the standard output. -R Update directories recursively (default). See Wrappers. Merging adds and removals for more information.. Previous: update options, Up: update [Contents][Index] ‘U’, but the CVS server sends a patch instead of an entire file. This accomplishes the same thing as ‘U’. ‘M’ file ‘-I’ option, and see cvsignore). Next: Administrative files, Previous: CVS commands, Up: Top [Contents][Index]. -H Print a help message. See Global options. -n Do not change any files. See Global options. -Q Be really quiet. See Global options. -q Be somewhat quiet. See Global options. -r Make new working files read-only. See Global options. -s variable=value Set a user variable. See Variables. -T tempdir Put temporary files in tempdir. See Global options. -t Trace CVS execution. See Global options. -v --version Display version and copyright information for CVS. -w Make new working files read-write. See Global options. -x Encrypt all communication (client only). See Global options. -z gzip-level Set the compression level (client only). See Global options.…] Add a new file/directory. See Adding files. -k kflag Set keyword expansion. -m msg Set file description. admin [options] [files…] Administration of history files in the repository. See admin. -b[rev] Set default branch. See Reverting local changes. -cstring Set comment leader. -ksubst Set keyword substitution. See Keyword substitution. -l[rev] Lock revision rev, or latest revision. -mrev:msg Replace the log message of revision rev with msg. -orange Delete revisions from the repository. See admin options. -q Run quietly; do not print diagnostics. -sstate[:rev] Set the state. See admin options for more information on possible states. -t Set file description from standard input. -tfile Set file description from file. -t-string Set file description to string. -u[rev] Unlock revision rev, or latest revision. annotate [options] rev Merge in changes. See checkout -s Like -c, but include module status. See checkout options. commit [options] [files…] Check changes into the repository. See commit. -F file Read log message from file. See commit options. -f Force the file to be committed; disables recursion. See commit options. -l Local; run only in current working directory. See Recursive behavior. -m msg Use msg as log message. See commit options. -n Do not run module program (if any). See commit options. -R Operate recursively (default). See Recursive behavior. -r rev Commit to rev. See commit options. diff [options] [files…] Show differences between revisions. See diff. In addition to the options shown below, accepts a wide variety of options to control output style, for example ‘-c’ for context diffs. -D date1 Diff revision for date against working file. See diff options. -D date2 Diff rev1/date1 against date2. See diff options. -l Local; run only in current working directory. See Recursive behavior. -N Include diffs for added and removed files. See diff options. -R Operate recursively (default). See Recursive behavior. -r rev1 Diff revision for rev1 against working file. See diff options. -r rev2 Diff rev1/date1 against rev2. See diff options. edit [options] [files…] Get ready to edit a watched file. See Editing files. -a actions Specify actions for temporary watch, where actions is edit, unedit, commit, all, or none. See Editing files. history [options] [files…] Show repository access history. See history. -a All users (default is self). See history options. -b str Back to record with str in module/file/repos field. See history options. -c Report on committed (modified) files. See history options. -D date Since date. See history options. -e Report on all record types. See history options. -l Last modified (committed or modified report). See history options. -m module Report on module (repeatable). See history options. -n module In module. See history options. -o Report on checked out modules. See history options. -p repository In repository. See history options. -r rev Since revision rev. See history options. -T Produce report on all TAGs. See history options. -t tag Since tag record placed in history file (by anyone). See history options. -u user For user user (repeatable). See history options. -w Working directory must match. See history options. -x types Report on types, one or more of TOEFWUPCGMAR. See history options. -z zone Output for time zone zone. See history options. import [options] repository vendor-tag release-tags… Import files into CVS, using vendor branches. See import. -b bra Import to vendor branch bra. See Multiple vendor branches. -d Use the file’s modification time as the time of import. See import options. -k kflag Set default keyword substitution mode. See import options. -m msg Use msg for log message. See import options. -I ign More files to ignore (! to reset). See import options. -W spec More wrappers. See import options. init Create a CVS repository if it doesn’t exist. See Creating a repository. kserver Kerberos authenticated server. See Kerberos authenticated. log [options] [files…] Print out history information for files.. Prompt for password for authenticating server. See Password authentication client. Remove stored password for authenticating server. See Password authentication client. pserver Password authenticated server. See Password authentication server. rannotate [options] [modules…]. rev Select revisions based on rev. See Common options. -s Short patch - one liner per file. See rdiff options. -t Top two diffs - last change made to the file. See diff options. -u Unidiff output format. See rdiff options. -V vers Use RCS Version vers for keyword expansion (obsolete). See rdiff options. release [options] directory Indicate that a directory is no longer in use. See release. .. rtag [options] tag modules… Add a symbolic tag to a module. See Revisions and Branching and merging. -a Clear tag from removed files that would not otherwise be tagged. See Tagging rev Tag existing tag rev. See Tagging by date/tag. rev Tag existing tag rev. See Tagging by date/tag. rev Merge in changes.], creates Next: Ampersand modules, Previous: Alias modules, Up: modules [Contents][Index] mname [ options ] dir [ files… ] In the simplest case, this form of module definition reduces to ‘m $ Next: Excluding directories, Previous: Regular modules, Up: modules [Contents][Index]. is executed. Generally you will find that the taginfo file is a better solution (see taginfo). You should also see see Module program options about how the “program options” programs are run. Previous: Module options, Up: modules [Contents][Index]. Next: Trigger Scripts, Previous: modules, Up: Administrative files [Contents][Index] Wrappers refers to a CVS feature which lets you control certain settings based on the name of the file which is being operated on. The settings are ‘-k’ for binary files, and ‘-m’ for nonmergeable text files. The ‘ ‘-kb’ (but if the file is specified as binary, there is no need to specify ‘ ‘ ‘.exe’ as binary: cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag Next: commit files, Previous: Wrappers, Up: Administrative files [Contents][Index] Several of the administrative files support triggers, or the launching external scripts or programs at specific times before or after particular events. The individual files are discussed in the later sections, commit. Next:. Previous:. Next: rcsinfo, Previous: Trigger Scripts, Up: Administrative files [Contents][Index] There are three kinds of trigger scripts (see Trigger Scripts) that can be run at various times during a commit. They are specified in files in the repository, as described below. The following table summarizes the file names and the purpose of the corresponding programs. (see rcsinfo). The specified program is used to edit the log message, and possibly verify that it contains all required fields. This is most useful in combination with the rcsinfo file, which can hold a log message template (see! Next:: loginfo, Previous: verifymsg, Up: commit files [Contents][Index] The editinfo feature has been rendered obsolete. To set a default editor for log messages use the CVSEDITOR, EDITOR environment variables (see Environment variables) or the ‘-e’ global option (see Global options). See verifymsg, ‘DEFAULT’ line is used, if it is specified. If the edit script exits with a non-zero exit status, the commit is aborted. Note: when CVS is accessing a remote repository, or when the ‘-m’ or ‘ Previous: editinfo, Up: commit files [Contents][Index] The log commit files, for a description of the syntax of the log: file name old version number (pre-check, reguardless three files (ChangeLog, Makefile, foo.c) were modified, the output might be: "yoyodyne/tc ChangeLog,1.1,1.2 Makefile,1.3,1.4 foo.c,1.12,1.13" As another example, ‘%{}’ means that only the name of the repository will be generated. Note: when CVS is accessing a remote repository, loginfo will be run on the remote (i.e., server) side, not the client side (see Remote repositories). Next: Keeping a checked out copy, Up: loginfo [Contents][Index] Previous: loginfo example, Up: loginfo [Contents][Index]. Next: taginfo, Previous: commit files, Up: Administrative files [Contents][Index] log message template will be used as a default log message. If you specify a log message with ‘cvs commit -m message’ or ‘cvs commit -f file’ that log message will override the template. See verifymsg,. Next: cvsignore, Previous: rcsinfo, Up: Administrative files [Contents][Index] The taginfo file defines programs to execute when someone executes a tag or rtag command. The taginfo file has the standard form for trigger scripts (see Trigger Scripts), where each line is a regular expression followed by a command to execute (see syntax). the taginfo file Next: checkoutlist, Previous: taginfo, Up: Administrative files [Contents][Index] There are certain file names that frequently occur inside your working copy, but that you don’t want to put under CVS control. Examples are all the object files that you get while you compile your sources. Normally, when you run ‘c (‘!’) clears the ignore list. This can be used if you want to store any file which normally is ignored by CVS. Specifying ‘ ‘-I !’ is specified. The only workaround is to remove the .cvsignore files in order to do the import. Because this is awkward, in the future ‘. Next: history file, Previous: cvsignore, Up: Administrative files [Contents][Index]. Next: Variables, Previous: checkoutlist, Up: Administrative files [Contents][Index] The file $CVSROOT/CVSROOT/history is used to log information for the history command (see history). This file must be created to turn on logging. This is done automatically if the cvs init command is used to set up the repository (see Creating a repository).). and USER may. Previous: Variables, Up: Administrative files [Contents][Index] The administrative file config contains various miscellaneous settings which affect the behavior of CVS. The syntax is slightly different from the other administrative files. Variables are not expanded. Lines which start with ‘#’ are considered comments. Other lines consist of a keyword, ‘=’, and a value. Note that this syntax is very strict. Extraneous spaces or tabs are not permitted. Currently defined keywords are:.. TopLevelAdmin=value Modify the ‘checkout’ command to create a ‘CVS’ directory at the top level of the new working directory, in addition to ‘CVS’ directories created within checked-out directories. The default value is ‘no’.. IgnoreUnknownConfigKeys=value If value is ‘yes’, then CVS should ignore any keywords in CVSROOT/config which it does not recognize. This option is intended primarily for transitions between versions of CVS which support more configuration options in an environment where a read-only mirror of the current CVS server may be maintained by someone else who is not yet ready to upgrade to the same version. It is recommended that this option be used only for a short time so that problems with the CVSROOT/config file will be found quickly. The default is ‘no’. Next: Compatibility, Previous: Administrative files, Up: Top [Contents][Index] This is a complete list of all environment variables that affect CVS. $CVSIGNORE A whitespace-separated list of file name patterns that CVS should ignore. See cvsignore. $CVSWRAPPERS A whitespace-separated list of file name patterns that CVS should treat as wrappers. See Wrappers. $CVSREAD If this is set, update will try hard to make the files in your working directory read-only. When this is not set, the default behavior is to permit modification of your working files. $CVSUMASK Controls permissions of files in the repository. See File permissions. : ‘cvs -d cvsroot cvs_command…’ Once you have checked out a working directory, CVS stores the appropriate root (in the file CVS/Root), so normally you only need to worry about this when initially checking out a working directory. $CVSEDITOR $EDITOR $VISUAL Specifies the program to use for recording log messages during commit. $CVSEDITOR overrides $EDITOR, which overrides $VISUAL. See Committing your changes for more or Global options for alternative ways of specifying a log editor. $PATH If $RCSBIN is not set, and no path is compiled into CVS, it will use $PATH to ‘d:’ and HOMEPATH, for example to \joe. On Windows 95, you’ll probably need to set HOMEDRIVE and HOMEPATH yourself. $CVS_RSH Specifies the external program which CVS connects with, when :ext: access method is specified. see Connecting via rsh. $CVS_SSH Specifies the external program which CVS connects with, when :extssh: access method is specified. see Connecting via ‘-d’ global option is specified. Later versions of CVS do not rewrite CVS/Root, so CVS_IGNORE_REMOTE_ROOT has no effect. $COMSPEC Used under OS/2 only. It specifies the name of the command interpreter and defaults to CMD.EXE. $TMPDIR $TMP $TEMP Directory in which temporary files are located. The CVS server uses TMPDIR. See Global options, for a description of how to specify this. Some parts of CVS will always use /tmp (via the tmpnam function provided by the system). On Windows NT, TMP is used (via the _tempnam function provided by the system). The patch program program. Next: Troubleshooting, Previous: Environment variables, Up: Top [Contents][Index]. Next: Credits, Previous: Compatibility, Up: Top [Contents][Index]. Next: Connection, Up: Troubleshooting [Contents] BUGS. cvs command: authorization failed: server host rejected access This is a generic response when trying to connect to a pserver server which chooses not to provide a specific reason for denying authorization. Check that the username and password specified are correct and that the CVSROOT specified is allowed by ‘--allow-root’ in inetd.conf. See Password authenticated. in Environment variables, BUGS). Connection. BUGS. co program This means that you need to set the environment variables that CVS uses to locate your home directory. See the discussion of HOMEDRIVE, and HOMEPATH in Environment variables. cvs update: could not merge revision rev of file: No such file or directory CVS 1.9 and older will print this message if there was a problem finding the rcsmerge program. Make sure that it is in your PATH, or upgrade to a current version of CVS, which does not require an external rcsmerge program. cvs [update aborted]: could not patch file: No such file or directory This means that there was a problem finding the patch program. BUGS. end of file from server (consult above messages if any) The most common cause for this message is if you are using an external rsh or ssh program and it exited with an error. In this case the rsh program BUGS). ‘-f’ to not require tag matches does not override this check; see Common options. cvs [command aborted]: out of memory There is insufficient (virtual) memory available to continue. In client/server mode, the problem is almost certainly on the server rather than the client; see Server requirements for memory estimates. Many systems have limits on the amount of virtual memory that a single process can use, so a process can run out of virtual memory long before the system itself has run out. The method of increasing the per-process limits varies depending on the operating system. BUGS). BUGS. option ‘-f’ option. Of course, if you don’t need log.pl you can just comment it out of loginfo. cvs [update aborted]: unexpected EOF reading file,v See ‘E Connection, and Password authentication server. cvs commit: Up-to-date check failed for `file' This means that someone else has committed a change to that file since the last time that you did a cvs update. So before proceeding with your cvs commit Concurrency,EDITOR environment. Next: Other problems, Previous: Error messages, Up: Troubleshooting [Contents][Index] ‘pserver’ ‘pserver’ ‘pserver’ ‘ ‘.) Previous: Connection, Up: Troubleshooting [Contents][Index]. Next: BUGS, Previous: Troubleshooting, Up: Top [Contents][Index] LLC Suite 230 200 Diversion St. Rochester Hills, MI 48307-6636 USA Email: info@ximbiot.com Phone: (248) 835-1260 Fax: (248) 835-1263.
http://www.gnu.org/software/trans-coord/manual/web-trans/cvs.html
CC-MAIN-2016-26
refinedweb
7,211
59.4
On Fri, Oct 03, 2008 at 07:13:58PM +0100, Daniel P. Berrange wrote: > On Fri, Oct 03, 2008 at 09:31:52PM +0530, Balbir Singh wrote: > > > > > > 1. Fix any issues you see or point them to us > > 2. Add new API or request for new API that can help us integrate better with libvirt > > To expand on what I said in my other mail about providing value-add over > the representation exposed by the kernel, here's some thoughts on the API > exposed. > > Consider the following high level use case of libvirt > > - A set of groups, in a 3 level hierarchy <APPNAME>/<DRIVER>/<DOMAIN> > - Control the ACL for block/char devices > - Control memory limits > > This translates into an underling implementation, that I need to create 3 > levels of cgroups in the filesystem, attach my PIDs at the 3rd level > use the memory and device controllers and attach PIDs at the 3rd, and > set values for attributes exposed by the controllers. Notice I'm not > actually setting any config parms at the 1st & 2nd levels, but they > do need to still exist to ensure namespace uniqueness amongst different > applications using cgroups. > > The current cgroups API provides APIs that directly map to individual > actions wrt the kernel filesystem exposed. So as an application developer > I have to explicitly create the 3 levels of hierarchy, tell it I want > to use memory & device controllers, format config values into the syntax > required for each attribute, and remeber the attribute names. > > // Create the hierachy <APPNAME>/<DRIVER>/<DOMAIN> > c1 = cgroup_new_cgroup("libvirt") > c2 = cgroup_new_cgroup_parent(c1, "lxc") > c3 = cgroup_new_cgroup_parent(c2, domain.name) > > // Setup the controllers I want to use > cgroup_add_controler(c3, "devices") > cgroup_add_controller(c3, "memory") > > // Add my domain's PID to the cgroup > cgroup_attach_task(c3, domain.pid) > > // Set the device ACL limits > cgroup_set_value_string(c2, "devices.deny", "a"); > > char buf[1024]; > sprintf(buf, "%c %d:%d", 'c', 1, 3); > cgroup_set_value_stirng(c2, "devices.allow", buf); > > // Set memory limit > cgroup_set_value_uint64(c2, "memory.limit_in_bytes", domain.memory * 1024); > > This really isn't providing any semantically useful abstraction over > the direct filesytem manipulation. Just a bunch of wrappers for mkdir(), > mount() and read()/write() calls. My application still has to know far > too much information about the details of cgroups as exposed by the > kernel. > Good point! Let's see how we can improve upon this issue faced by applications. > I do not care that there is a concept of 'controllers' at all, I just > want to set device ACLs and memory limits. I do not care what the attributes > in the filesystem are called, again I just want to set device ACLs and memory > limits. I do not care what the data format for them must be for device/memory > settings. Memory settings could be stored in base-2, base-10 or base-16 I > should not have to know this information. > > With this style of API, the library provide no real value-add or compelling > reason to use it. > > What might a more useful API look like? At least from my point of view, > I'd like to be able to say: > > // Tell it I want $PID placed in <APPNAME>/<DRIVER>/<DOMAIN> > char *path[] = { "libvirt", "lxc", domain.name}; > cg = cgroup_new_path(path, domain.pid) > > // I want to deny all devices > cgroup_deny_all_devices(cg); > > // Allow /dev/null - either by node/major/minor > cgroup_allow_device_node(cg, 'c', 1, 3); > > // Or more conviently just give it a node to copy info from > cgroup_allow_device_node(cg, "/dev/null") > > // Set memory in KB > cgroup_set_memory_limit_kb(cg, domain.memory) > > Notice how with such a style of API, I don't need to know anything about > the low level implementation details - I'm working entirely in terms of > semantically meaningful concepts. > OK. This is something Balbir and I have been discussing , on how to push libcgroup forward. I do have a patch which started looking at controller specific stuff, but now that we are quite clear on what would be good, its much clearer in what direction it should proceed (and that I should throw away what I wrote, and look to design it in this fashion). I am on vacation for the next two weeks, but I shall look at pushing this forward, very soon. > Now, comes the hard bit - you have to figure out what semantic concepts > you want to expose to applications. The example here would be suitable > for libvirt, but not neccessarily for other applications. Picking the > right APIs is very much much harder than just exposing the kernel > capabilities directly as libcgroup.h does now, but the trade off is > that the resulting API would be much more useful and interesting to > app developers. > I hope we can utilize your experience here to help us with libcgroup as well. thanks, -- regards, Dhaval
https://www.redhat.com/archives/libvir-list/2008-October/msg00108.html
CC-MAIN-2015-11
refinedweb
784
59.43
Note: This method is not supported for GateIn 3.2. Please referr to for information on managing GateIn and Export/Import support. Export / Import Gadget An export/import gadget will allow the ability to export and import site layouts, pages, and navigation while inside the GateIn portal. The portal container which is used for export/import is the portal container the gadget is being used in. For example if you want to export/import data for a portal container 'myportal' you must be using the gadget under the /myportal context. Note: Dashboard's are not supported for export/import. Export: The export feature of the gadget list the sites available for export. Choose a site from the tree navigation and select export to download a zip file containing the data for that site. The three types of data included in an export are: - Site layout - The layout of the site. Represented by the portal.xml file in the zip. - Pages - All pages for the site. Represented by the pages.xml file in the zip. - Navigation - All navigation for the site. Represented by the navigation.xml in the zip. Import: The import feature of the gadget will accept a zip file previously created via an export either by the gadget itself, or the command line tool mentioned below. To import the zip file through the gadget, click the import link which will prompt for file upload. Choose the zip file from your system, and upload the file to import the data. Note: The site you are exporting from must exist on the destination portal you are importing to. Installation procedure To install the gadget, follow the instructions below : - Download the attached ear archive (gatein-management.ear) - Deploy the ear to GateIn (JBoss AS) server (ie $JBOSS_HOME/server/default/deploy) - Start your server (if it was already started you need to restart), and log into the portal as an admin (ie root/gtn) - Go to the application registry, select the Gadgets tab, you will see the gadget "Export/Import Tool" has been registered. - Click the "Click here to add into categories" link and add the gadget to the 'Gadget' category( or another category). - Once done, the gadget is ready to be used. fig. 1: gatein management gadget - export fig.2 : gatein management gadget - import Export / Import Command Line Tool An export/import command line tool will allow the ability to export and import site layout, pages, and navigation for each site in GateIn. There is one executable jar that can be used to either export or import. Note: The export/import command line tool requires jdk/jre 6 or above. Export Usage: $ java -jar portalobjects-cli.jar export --help --basedirectory (-basedir) : Sets base directory for export --config (-c) : Sets custom configuration file to be used for export. --datatype (-d) : Data type (ie site, page, navigation). Use * for all data types. --host (-h) : Host of the server the portal is running on. --log4j (-l) : Sets custom log4j config file to be used for logging. --loglevel : Sets log level of root log4j logger (ie debug, info). --name (-n) : Name of page name or navigation path or * for all pages/navigations. --ownerid (-o) : Owner id (ie classic, /platform/administrators, root). Use * for all ownerId's. --password (-p) : Password to connect to portal with. --port : Port of the server the portal is running on. --portalcontainer (-pc) : Portal container name (ie portal) --scope (-s) : Scope of data (ie portal, group, user). Use * for all scopes. --username (-u) : Username to connect to portal with. Each option can be configured by passing in a properties file via the command line option --config (-c). This properties file can contain any preconfigured option you want to specify when running the tool. The tool uses a preconfigured property file which will export all data from the portal container 'portal' running at localhost:8080 and with default admin credentials root/gtn. The default properties file used for the exporter is the following: ## Default export client configuration ## ## auth details ## arg.username=root arg.password=gtn ## this can be an IP address too arg.host=localhost arg.port=8080 ## The following properties are typically entered as input to the program, but can be configured statically ## arg.portalcontainer=portal arg.scope=* arg.ownerid=* arg.datatype=* arg.name=* This is exactly how a custom property file would look like to preconfigure any command line option in a properties file. The naming convention is arg.<option-name>. So to configure the base directory for exports you would add arg.basedirectory=/tmp. Do not use aliases when defining arguments in the properties file. For example arg.basedir=/tmp will not work. Note: All options passed in via command line will take priority over anything define in property files. Some examples Export all data for portal container sample-portal $ java -jar portalobjects-cli.jar export -pc sample-portal Export only navigation for user mary $ java -jar portalobjects-cli.jar export --scope user --ownerid mary --datatype navigation Export only the home page $ java -jar portalobjects-cli.jar export --scope portal --ownerid classic --datatype page --name homepage Export only the application registry navigation node $ java -jar portalobjects-cli.jar export --scope group --ownerid /platform/administrators --datatype navigation --name administration/registry Import Usage: $ java -jar portalobjects-cli.jar import --help import file : Path to import file --config (-c) : Sets custom configuration file to be used for import. --force (-f) : Force all options without confirmation. --host (-h) : Host of the server the portal is running on. --log4j (-l) : Sets custom log4j config file to be used for logging. --loglevel : Sets log level of root log4j logger (ie debug, info). --overwrite (-o) : Indicates that the contents of each file should overwrite everything on the destination server. This also means that anything not included will be deleted. --password (-p) : Password to connect to portal with. --port : Port of the server the portal is running on. --portalcontainer (-pc) : Portal container name (ie portal). --username (-u) : Username to connect to portal with. Import file located in /tmp $ java -jar portalobjects-cli.jar import /tmp/portal_export.zip Other resources Staging to production feature set: Portal object client and REST API:
https://community.jboss.org/wiki/GateIn-ExportImport
CC-MAIN-2014-10
refinedweb
1,021
58.69
This wiki article is an extension on the documentation of Azure BizTalk Services (formerly called Windows Azure BizTalk Services or WABS): BizTalk Services: Provisioning Using Microsoft Azure Management Portal. This new service in Microsoft Azure offers B2B in the Cloud supporting EDI, Integration with SaaS solutions and create bridges between Line-Of-Business(LOB) systems and the Cloud through various protocols. To be able to do so you will to provision a BizTalk Service in Microsoft Azure first. Provisioning of a BizTalk Services requires you to perform a few steps by means of using the Microsoft Azure Management Portal. Azure BizTalk Service is offered in four tiers: Note: More specific details of the tiers can be found at BizTalk Services: Developer, Basic, Standard and Premium Editions Chart. Depending on the scenario you face within an enterprise (customer) and implementing a solution based upon BizTalk Services you will choose between basic, standard or premium. This comes with a different price tag depending if you choose pay-as-you-go or 6-12 month plan. See the pricing details. Interesting on this page is also that if you scroll down further you will find the FAQ. To provision an Azure BizTalk Service you will of course need a Microsoft Azure Subscription. You have different options to setup one by: As soon as you have a subscription with Azure you can make use of the services it offers like Azure SQL Database, Azure Access Control Service (ACS), and Azure Storage, which you will need for provisioning of the BizTalk Service. You will need to create an Azure SQL database, a ACS namespace account and storage account: The Azure BizTalk Service is currently in preview. To work with the service you will to go to the preview features: and click Try it out. In the BizTalk Service Name you can specify an unique name that will added to default DNS .biztalk.windows.net. This will form a URL that can be used to access your BizTalk Service. By default the domain url is the name you give your BizTalk Service Name. You can specify a custom domain if you want. With the edition property you can choose the edition you want depending on your scenario (see Introduction). In case you are in the testing/development phase then you should choose Developer. With the region you can choose where to host your BizTalk Service depending on the geographic region your in. With the tracking database you can choose between two options: Note: Both allow you to set maximum size, and both are billed on an amortized schedule, where your capacity is evaluated daily. Here you can also specify the collation you desire. . Now everything is specified you can click mark and provisioning of the BizTalk Service will start. After the provisioned of the BizTalk Service you can register it in the BizTalk Service management portal, which is a Silverlight portal that will be there during the preview. By clicking on the Manage button you will be taken to the Silverlight portal. On this portal, you have will have to specify three settings: For documentation on BizTalk Services see Azure BizTalk Services documentation. In case you want to start creating BizTalk Services applications then you need to install BizTalk Services SDK (See Installing the Azure BizTalk Services SDK - June 2013 Preview) on your machine. Another important place to find a huge amount of Azure BizTalk Services related articles is the TechNet Wiki itself. The best entry point is Azure BizTalk Services resources on the TechNet Wiki. If you are also looking for BizTalk Server related articles, the best entry point is BizTalk Server Resources on the TechNet Wiki.
http://social.technet.microsoft.com/wiki/contents/articles/18745.provisioning-biztalk-services-using-the-microsoft-azure-management-portal.aspx
CC-MAIN-2014-52
refinedweb
612
59.53
getpgrp - get the process group ID of the calling process #include <unistd.h> pid_t getpgrp(void); The getpgrp() function shall return the process group ID of the calling process. The getpgrp() function shall always be successful and no return value is reserved to indicate an error. No errors are defined. None. None. 4.3 BSD provides a getpgrp() function that returns the process group ID for a specified process. Although this function supports job control, all known job control shells always specify the calling process with this function. Thus, the simpler System V getpgrp() suffices, and the added complexity of the 4.3 BSD getpgrp() is provided by the XSI extension getpgid(). None. exec(), fork(), getpgid(), getpid(), getppid(),.
http://pubs.opengroup.org/onlinepubs/007904975/functions/getpgrp.html
CC-MAIN-2017-22
refinedweb
118
67.04
* Program Review Canh Ly Greenhorn Joined: Jun 22, 2012 Posts: 7 posted Jun 25, 2012 19:19:51 0 Hi guys, I had a question before on a code that I had problem with. Heres my finished project, I only have one small problem still, Ive tested every part and every part compiles and runs up until the last few lines and I cant seem to figure out why. The errors I get are below. The process Im trying to do is use a string to print out the else if statements in my code. I attached my full code below and was wondering if I could get a quick check just to make sure the way Im trying to call my final calculation is correct. It would be much appreciated. This is indeed a homework assignment, but Its already past the due date so I just want to find out the answer for myself thanks! GradesProgram6a.java:124: ';' expected char getGrade(double finalScore){ ^ GradesProgram6a.java:124: ';' expected char getGrade(double finalScore){ ^ 2 errors Canhs-MacBook-Pro:public canhly$ javac GradesProgram6a.java GradesProgram6a.java:124: ';' expected char getGrade(double finalScore){ ^ GradesProgram6a.java:124: ';' expected char getGrade(double finalScore){ ^ 2 errors import java.util.Scanner; public class GradesProgram6a { public static void main(String[] args) { //Section: Variables Scanner keyboard = new Scanner(System.in); String name; double assigns = 0.0; double inclass = 0.0; double labs = 0.0; double midterm1 = 0.0; double mindterm2 = 0.0; double finalexam = 0.0; double finalScore = 0.0; char grade; double ascore = 0.0; doIntro(); String message; message = "Input 8 Assignments (maximum 10):"; //change back to 8 later ascore = getGrades(keyboard, message, 8, 10, 24.0); assigns = ascore; System.out.println("Assignment score is: " + ascore); //inclass participation out of 8 marks message = "Input in-class participation marks (maximum 1):"; ascore = getGrades(keyboard, message, 8, 1, 6.0); inclass = ascore; System.out.println("Assignment score is: " + ascore); //lab makrs message = "Input lab marks (maximum 1):"; ascore = getGrades(keyboard, message, 10, 1, 10.0); System.out.println("Assignment score is: " + ascore); //for midterm1 message = "Input midterm 1 marks (maximum 100):"; ascore = getGrades(keyboard, message, 1, 100, 10.0); System.out.println("Midterm 1 score is: " + ascore); //for midterm 2 message = "Input midterm 2 marks (maximum 100):"; ascore = getGrades(keyboard, message, 1, 100, 10.0); System.out.println("Midterm 2 score is: " + ascore); //for final message = "Input final exam mark (maximum 100):"; ascore = getGrades(keyboard, message, 1, 100, 40.0); System.out.println("Final exam score is: " + ascore); }//end main public static void doIntro(){ System.out.println("This program will help calculate your grade "); System.out.println("in CSC110. "); System.out.println("Enter the grades at the prompt. "); } public static double getGrades(Scanner keyboard, String message, int numscores, int worth, double outof){ int mark; double total = 0.0; System.out.println(message); for(int i=1; i<=numscores; i++){ System.out.print("#" + i + " ===> "); mark = keyboard.nextInt(); if (mark > worth) { System.out.println("Mark is out of range, maximum value is " + worth); i--; } else total += mark; System.out.println(); } return (total/ (numscores * worth)) * outof; } //Method: Calculate Score public static double calculateScore(double assigns, double inclass){ double tass = (assigns/80*.24); double finalScore = tass; return finalScore; } //method: get letter grade public static char getGrade(double finalScore){ char getGrade(double finalScore){ String grade; if (score >=96.5) { grade = "A+"; System.out.println(" Grade = A+"); } else if (score >=92.5) { grade = "A"; System.out.println(" Grade = A"); } else if (score >=87.5) { grade = "A-"; System.out.println(" Grade = A-"); } else if (score >=82.5) { grade = "B+"; System.out.println(" Grade = B+"); } else if (score >=77.5) { grade = "B"; System.out.println(" Grade = B"); } else if (score >=71.5) { grade = "B-"; System.out.println(" Grade = B-"); } else if (score >=65.5) { grade = "C+"; System.out.println(" Grade = C+"); } else if (score >=59.5) { grade = "C"; System.out.println(" Grade = C"); } else if (score >=49.5) { grade = "D"; System.out.println(" Grade = D"); } else { // score < 49.4 grade = "F"; System.out.println(" Grade = F"); } } } } Canh Ly Greenhorn Joined: Jun 22, 2012 Posts: 7 posted Jun 25, 2012 19:25:20 0 Also quick note, in line 111 I just realized It wasn't finished. At the moment it is in a public static double, but should I use a "public static double calculateScore(double assigns, double inclass, double labs, double midterm1, double midterm2, double finalexam){" instead to pass the variables for calculation, or have it a public static double? Tina Smith Ranch Hand Joined: Jul 21, 2011 Posts: 177 6 I like... posted Jun 25, 2012 21:41:36 0 You can't define functions inside of other functions/methods. Take a look at line 124; if you want the code to compile you should move the "inner" function you're declaring there to stand as a function by itself. Everything is theoretically impossible, until it is done. ~Robert A. Heinlein Greg Ferguson Ranch Hand Joined: Jun 04, 2012 Posts: 34 posted Jun 26, 2012 15:48:13 0 Starting with line 129, it looks like you have redundant code. If you're going to assign a value to grade , you should use it like this: System.out.println("Your grade is " + grade); otherwise the grade variable is not necessary. I agree. Here's the link: subject: Program Review Similar Threads trying to make ths work Whats wrong with my code Averaging Grades Assignment Grade Calculator Alot of Errors While Compiling grade program All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter JForum | Paul Wheaton
http://www.coderanch.com/t/585114/java/java/Program-Review
CC-MAIN-2014-52
refinedweb
924
59.6
I Start by installing Vue, open up terminal and type this: npm i -g @vue/cli Now that Vue is installed we are going to use it’s CLI to create our project vue create eos-login When prompted choose “Manually select features” then, use the space bar to select Babel, Router and Vuex feature. For the rest of the questions you can just choose the defaults. Once the Vue CLI have created our project, we can change directory into it and add plugins. We are going to add the Vuetify plugin for helping us with the design. cd eos-login vue add vuetify You will be asked a series of questions, just follow my answers like bellow: Ok lastly we will need to install EOS official javascript library so that we can easily make calls to the EOS blockchain. npm i [email protected] NOTE: The npm package [email protected] is the latest compared to just eosjs By now you will have a perfect project setup to start coding. npm run serve Follow the link on your browser and you should see the default Vue template up and running! Deploy our Smart Contract Before we start coding the front end let’s deploy our latest smart contract to the EOS blockchain. I have written a simple smart contract that has a ‘users’ table and a login method that accepts an EOS account as it’s input. The login method will store the account in the users table if no records already exist for that name. However if there is already a record, it will increment the reward_points by 1 instead. The login also ensures that only valid EOS account can enter. Let’s go ahead and deploy this contract . I have previously written a step by step guide on how to accomplish this, please click here. Coding the Front End part Now that we have our hello contract deployed, we can resume our work on the front end. Open the eos-login project folder in VSCode (or you favourite IDE), we will be adding 4 files to our project: - AppTopBar.vue under the components folder - EosService.js under the eosio folder (create this folder) - Login.vue under the views folder - .env under the project root folder Add this files to your project. Your project structure should now look like bellow. Let’s start by coding the AppTopBar component. In Vue, components can be easily added to pages making it very re-usable. The AppTopBar component is simply a header bar with a title of our application. Now open App.vue under the src folder to import our component. Notice that AppTopBar has been format as For our application we will have 2 main page which is the Login page and the Home page. On the App.vue we are using the Vue Router to link to both pages with the //router.js import Vue from 'vue'; import Router from 'vue-router'; import Login from './views/Login.vue'; Vue.use(Router); export default new Router({ mode: 'history', base: process.env.BASE_URL, routes: [ { path: '/', name: 'login', component: Login }, { path: '/home', name: 'home', component: () => import('./views/Home.vue') } ] }); Edit our Home.vue Create our Login.vue The Login.vue page calls the login function on EosService and passes the inputs for account name and private key. If the login function returns success it simply redirects to the Home.vue page. Now before I dive into the EosService login function, let’s edit our .env file with the correct values. Open the .env file under the project root directory. VUE_APP_SMART_CONTRACT_NAME="youraccname1" VUE_APP_NODE_ENDPOINT="" Set the value for VUE_APP_SMART_CONTRACT_NAME to the account name you created earlier on the Testnet to deploy the hello contract. The value for VUE_APP_NODE_ENDPOINT should be then set to a Testnet endpoint, in this case I am using the CryptoKylin Testnet. Subsequently if you have deployed your smart contract on the Mainnet then you should set the value of the endpoint to any of the 21 main block-producers. EosService Finally let’s look into the code for the EosService.js library I created. This is where the bulk of action is happening. //EosService.js import { Api, JsonRpc } from 'eosjs'; import JsSignatureProvider from 'eosjs/dist/eosjs-jssig'; async function invokeAction(action, dataValue) { const rpc = new JsonRpc(process.env.VUE_APP_NODE_ENDPOINT); const privateKey = localStorage.getItem('private_key'); const signatureProvider = new JsSignatureProvider([privateKey]); const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() }); try { const resultWithConfig = await api.transact( { actions: [ { account: process.env.VUE_APP_SMART_CONTRACT_NAME, name: action, authorization: [ { actor: localStorage.getItem('name_account'), permission: 'active' } ], data: dataValue } ] }, { blocksBehind: 3, expireSeconds: 30 } ); return resultWithConfig; } catch (err) { throw err; } } class EosService { static login(acc, key) { return new Promise((resolve, reject) => { localStorage.setItem('name_account', acc); localStorage.setItem('private_key', key); invokeAction('login', { user: acc }) .then(() => { resolve(); }) .catch(err => { localStorage.removeItem('name_account'); localStorage.removeItem('private_key'); reject(err); }); }); } } export default EosService; Basically what we are doing here is creating an API transaction by passing in the parameters of the .env file earlier. For this to work we need to create a signature provider with an EOS account private-key to access the smart contract. Since this is meant to be a simple tutorial we are directly dealing with the private-key here, however in a real world application it is best to integrate with a 3rd party wallet to handle the creation of the signature provider. That way you do not have to ask your users for their private-key directly which is insecure. NOTE: Scatter is a good example of a 3rd party wallet out there. They have established them-self as one of the trusted wallet solution through out the EOS community. Interestingly they already have an existing API for you to integrate with your applications. Ok we are done with all the front end code. If you have reached to this point, give yourself a big pat on the back for following through. I believe we have completed a bare minimum front end for any EOS smart contract. All the work you will be doing in the future will most probably be built upon this base. I have posted this project files on GitHub: . Now will be a good time for you to compare your code and mine to make sure everything is the same before we continue. Run our Code Go ahead, get into our project directory and run the code: npm run serve Follow the link on your browser:, your screen should look like this: Enter your account name along with the private key that you have created previously on the Testnet. Click on Login. If you have entered everything properly you will be directed to our Home page after a few seconds. Congratulations! you have just built your first Dapp. Before we end this series, let us just check to see if our smart contract have registered this login into our users table. As you can see the return that your record has been added to the users table. Now let’s test to see if the reward_points is incremented if we login again. Refresh your browser and try to login again. After login, let’s check again: Fantastic! Our smart contract is doing what it was programmed to do. Don’t you just love the Blockchain, it is just so reliable. Summary You have learned how to: - Create an empty Vue project - Add a Vue plugin - Install the EOS official javascript library - Write an EOS smart contract that can store data in tables - Connect a front end to EOS I hope you enjoyed this guide, please leave your comments bellow. I am thinking about writing on Scatter wallet integration next. I would love to hear your thoughts. read original article here
https://coinerblog.com/how-to-build-a-simple-front-end-for-your-eos-smart-contract-3f9289e8146c/
CC-MAIN-2019-26
refinedweb
1,286
65.12
You can create a "SQL query" recipe with the public API using the `SQLQueryRecipeCreator` object. However, there isn't an equivalent object for a "SQL script" recipe. How can I create a SQL script recipe using the public API? There is no specific API to create an SQL Script recipe, but you can use the generic SingleOutputRecipeCreator to do it. Here is an example to create such a recipe: from dataikuapi.dss.recipe import SingleOutputRecipeCreator # Create an SQL script recipe builder = SingleOutputRecipeCreator('sql_script', "my_sql_script_recipe_name", project) builder = builder.with_input("my_input_ds") builder = builder.with_output("my_output_ds") recipe = builder.build() # Update the SQL script recipe to set its script recipe_def = recipe.get_definition_and_payload() recipe_def.set_payload('CREATE TABLE ...') recipe.set_definition_and_payload(recipe_def)
https://community.dataiku.com/t5/Using-Dataiku-DSS/Create-a-SQL-script-using-the-public-API/m-p/2825/create-a-sql-script-using-the-public-api?show=3902
CC-MAIN-2020-24
refinedweb
115
51.65
Hi All, I am looking for a way to change an existing mesh into a single vertex mesh. The goal here is to reduce memory usage when my script discards a mesh that is no longer needed. It seems that 2.5 API has the same limitation as 2.49. You can not actually delete a mesh from memory. So my goal is to at least reduce the vertex count of a discarded mesh to 1 as a way to hold off memory overflow and eventual crashes. Here is my code so far: import bpy # Get the default cube mesh. ob = bpy.data.objects["Cube"] me = ob.data # Try to make the existing mesh a single vertex mesh. me.name = "zz_garbage" me.from_pydata([(0,0,0)],[(0)],[(0)]) me.update(True) This actually crashes Blender. I know you can remove vertices from a mesh via editing in the GUI, but I am wondering how do I do this via code?
https://blenderartists.org/t/changing-an-existing-mesh-to-a-single-vertex-mesh-2-56/500330
CC-MAIN-2021-10
refinedweb
160
76.11
Precondition and Postconditionsuggest change One use case for assertion is precondition and postcondition. This can be very useful to maintain invariant and design by contract. For a example a length is always zero or positive so this function must return a zero or positive value. #include <stdio.h> /* Uncomment to disable `assert()` */ /* #define NDEBUG */ #include <assert.h> int length2 (int *a, int count) { int i, result = 0; /* Precondition: */ /* NULL is an invalid vector */ assert (a != NULL); /* Number of dimensions can not be negative.*/ assert (count >= 0); /* Calculation */ for (i = 0; i < count; ++i) { result = result + (a[i] * a[i]); } /* Postcondition: */ /* Resulting length can not be negative. */ assert (result >= 0); return result; } #define COUNT 3 int main (void) { int a[COUNT] = {1, 2, 3}; int *b = NULL; int r; r = length2 (a, COUNT); printf ("r = %i\n", r); r = length2 (b, COUNT); printf ("r = %i\n", r); return 0; } Found a mistake? Have a question or improvement idea? Let me know. Table Of Contents
https://essential-c.programming-books.io/precondition-and-postcondition-b55e7f66cd924fc2ab260e4fbc710691
CC-MAIN-2021-25
refinedweb
163
65.52
cat scripts/hello-world.py !python scripts/hello-world.py !python scripts/hello-world-in-swedish.py. Most of the functionality in Python is provided by modules. The Python Standard Library is a large collection of modules that provides cross-platform implementations of common facilities such as access to the operating system, file I/O, string management, network communication, and much more. To use a module in a Python program it first has to be imported. A module can be imported using the import statement. For example, to import the module math, which contains many standard mathematical functions, we can do: import math This includes the whole module and makes it available for use later in the program. For example, we can do: import math x = math.cos(2 * math.pi) print(x) Alternatively, we can chose to import all symbols (functions and variables) in a module to the current namespace (so that we don't need to use the prefix " math." every time we use something from the math module: from math import * x = cos(2 * pi) print(x)) log(10) log(10, 2)) If we assign a new value to a variable, its type can change. x = 1 type(x)) # float x = 1.0 type(x) # boolean b1 = True b2 = False type(b1) # complex numbers: note the use of `j` to specify the imaginary part x = 1.0 - 1.0j type(x) print(x) print(x.real, x.imag) The module types contains a number of type name definitions that can be used to test if variables are of certain types: import types # print all types defined in the `types` module print(dir(types)) x = 1.0 # check if the variable x is a float type(x) is float # check if the variable x is an int type(x) is int We can also use the isinstance method for testing types of variables: isinstance(x, float) x = 1.5 print(x, type(x)) x = int(x) print(x, type(x)) z = complex(x) print(z, type(z)))) Most operators and comparisons in Python work as one would expect: +, -, *, /, //(integer division), '**' power 1 + 2, 1 - 2, 1 * 2, 1 / 2 1.0 + 2.0, 1.0 - 2.0, 1.0 * 2.0, 1.0 / 2.0 # Integer division of float numbers 3.0 // 2.0 # Note! The power operators in python isn't ^, but ** 2 ** 2 Note: The / operator always performs a floating point division in Python 3.x. This is not true in Python 2.x, where the result of / is always an integer if the operands are integers. to be more specific, 1/2 = 0.5 ( float) in Python 3.x, and 1/2 = 0 ( int) in Python 2.x (but 1.0/2 = 0.5 in Python 2.x). and, not, or. True and False not False True or False >, <, >=(greater or equal), <=(less or equal), ==equality, isidentical. 2 > 1, 2 < 1 2 > 2, 2 < 2 2 >= 2, 2 <= 2 # equality [1,2] == [1,2] # objects identical? l1 = l2 = [1,2] l1 is l2 Strings are the variable type that is used for storing text messages. s = "Hello world" type(s) # length of the string: the number of characters len(s) # replace a substring in a string with something else s2 = s.replace("world", "test") print(s2):] s[:]. print("str1", "str2", "str3") # The print statement concatenates strings with a space print("str1", 1.0, False, -1j) # The print statements converts all arguments to strings print("str1" + "str2" + "str3") # strings added with + are concatenated without space print("value = %f" % 1.0) # we can use C-style string formatting # this formatting creates a string s2 = "value1 = %.2f. value2 = %d" % (3.1415, 1.5) print(s2) # alternative, more intuitive way of formatting a string s3 = 'value1 = {0}, value2 = {1}'.format(3.1415, 1.5) print(s3)]) Heads up MATLAB users: Indexing starts at 0! l[0] Elements in a list do not all have to be of the same type: l = [1, 'a', 1.0, 1-1j] print(l) Python lists can be inhomogeneous and arbitrarily nested: nested_list = [1, [2, [3, [4, [5]]]]] nested_list) # in python 3 range generates an interator, which can be converted to a list using 'list(...)'. # It has no effect in python 2 list(range(start, stop, step)) list(range(-10, 10)) s # convert a string to a list by type casting: s2 = list(s) s2 # sorting lists s2.sort() print(s2) # create a new empty list l = [] # add an elements using `append` l.append("A") l.append("d") l.append("d") print(l) We can modify lists by assigning new values to elements in the list. In technical jargon, lists are mutable. l[1] = "p" l[2] = "p" print(l) l[1:3] = ["d", "d"] print(l) Insert an element at an specific index using insert l.insert(0, "i") l.insert(1, "n") l.insert(2, "s") l.insert(3, "e") l.insert(4, "r") l.insert(5, "t") print(l) Remove first element with specific value using 'remove' l.remove("A") print(l) Remove an element at a specific location using del: del l[7] del l[6] print(l) See help(list) for more details, or read the online documentation Tuples are like lists, except that they cannot be modified once created, that is they are immutable. In Python, tuples are created using the syntax (..., ..., ...), or even ..., ...: point = (10, 20) print(point, type"])) The Python syntax for conditional execution of code uses the keywords if, elif (else if), else: statement1 = False statement2 = False if statement1: print("statement1 is True") elif statement2: print("statement2 is True") else: print("statement1 and statement2 are False") For the first time, here we encounted a peculiar and unusual aspect of the Python programming language: Program blocks are defined by their indentation level. Compare to the equivalent C code: if (statement1) { printf("statement1 is True\n"); } else if (statement2) { printf("statement2 is True\n"); } else { printf("statement1 and statement2 are False\n"); } In C blocks are defined by the enclosing curly brakets { and }. And the level of indentation (white space before the code statements) does not matter (completely optional). But in Python, the extent of a code block is defined by the indentation level (usually a tab or say four white spaces). This means that we have to be careful to indent our code correctly, or else we will get syntax errors. statement1 = statement2 = True if statement1: if statement2: print(") In Python, loops can be programmed in a number of different ways. The most common is the for loop, which is used together with iterable objects, such as lists. The basic syntax is: forloops:: for key, value in params.items(): print(key + " = " + str(value)) Sometimes it is useful to have access to the indices of the values when iterating over a list. We can use the enumerate function for this: for idx, x in enumerate(range(-3,3)): print(idx, x) forloops: A convenient and compact way to initialize lists: l1 = [x**2 for x in range(0,5)] print(l1) whileloops: i = 0 while i < 5: print(i) i = i + 1 print(() Optionally, but highly recommended, we can define a so called "docstring", which is a description of the functions purpose and behaivor. The docstring should follow directly after the function definition, before the code in the function body. def func1(s): """ Print a string 's' and tell how many characters it has """ print(s + " has " + str(len(s)) + " characters") help(func) In a definition of a function, we can give default values to the arguments the function takes: def myfunc(x, p=2, debug=False): if debug: print("evaluating myfunc for x = " + str(x) + " using exponent p = " + str(p)) return x**p If we don't provide a value of the debug argument when calling the the function myfunc it defaults to the value provided in the function definition: myfunc(5) myfunc(5, debug=True) If we explicitly list the name of the arguments in the function calls, they do not need to come in the same order as in the function definition. This is called keyword arguments, and is often very useful in functions that takes a lot of optional arguments. myfunc(p=3, debug=True, x=7) In Python we can also create unnamed functions, using the lambda keyword: f1 = lambda x: x**2 # is equivalent to def f2(x): return x**2 f1(2), f2(2) This technique is useful for example when we want to pass a simple function as an argument to another function, like this: # map is a built-in python function map(lambda x: x**2, range(-3,4)) # in python 3 we can use `list(...)` to convert the iterator to an explicit list list(map(lambda x: x**2, range(-3,4))) Classes are the key features of object-oriented programming. A class is a structure for representing an object and the operations that can be performed on the object. In Python a class can contain attributes (variables) and methods (functions). A class is defined almost like a function, but using the class keyword, and the class definition usually contains a number of class method definitions (a function in a class). Each class method should have an argument self as its first argument. This object is a self-reference. Some class method names have special meaning, for example: __init__: The name of the method that is invoked when the object is first created. __str__: A method that is invoked when a simple string representation of the class is needed, as for example when printed. class Point: """ Simple class for representing a point in a Cartesian coordinate system. """ def __init__(self, x, y): """ Create a new Point at x, y. """ self.x = x self.y = y def translate(self, dx, dy): """ Translate the point by dx and dy in the x and y direction. """ self.x += dx self.y += dy def __str__(self): return("Point at [%f, %f]" % (self.x, self.y)) To create a new instance of a class: p1 = Point(0, 0) # this will invoke the __init__ method in the Point class print(p1) # this will invoke the __str__ method To invoke a class method in the class instance p: p2 = Point(1, 1) p1.translate(0.25, 1.5) print(p1) print(p2) Note that calling class methods can modifiy the state of that particular class instance, but does not effect other class instances or any global variables. That is one of the nice things about object-oriented design: code such as functions and related variables are grouped in separate and independent entities. We can import the module mymodule into our Python program using import: import mymodule Use help(module) to get a summary of what the module provides: help(mymodule) mymodule.my_variable mymodule.my_function() my_class = mymodule.MyClass() my_class.set_variable(10) my_class.get_variable() If we make changes to the code in mymodule.py, we need to reload it using reload: reload(mymodule) # works only in python 2 In Python errors are managed with a special language construct called "Exceptions". When errors occur exceptions can be raised, which interrupts the normal program flow and fallback to somewhere else in the code where the closest try-except statement is defined. To generate an exception we can use the raise statement, which takes an argument that must be an instance of the class BaseException or a class derived from it. raise Exception("description of the error") --------------------------------------------------------------------------- Exception Traceback (most recent call last) <ipython-input-128-8f47ba831d5a> in <module>() ----> 1 raise Exception("description of the error") Exception: description of the error A typical use of exceptions is to abort functions when some error condition occurs, for example: def my_function(arguments): if not verify(arguments): raise Exception("Invalid arguments") # rest of the code goes here To gracefully catch errors that are generated by functions and class methods, or by the Python interpreter itself, use the try and except statements: try: # normal code goes here except: # code for error handling goes here # this code is not executed unless the code # above generated an error For example: try: print("test") # generate an error: the variable test is not defined print(test) except: print()) %load_ext version_information %version_information
https://share.cocalc.com/share/d8d2faccf6f6373d5e0a57a2849cbf76273d673e/scientific-python-lectures/Lecture-1-Introduction-to-Python-Programming.ipynb?viewer=share
CC-MAIN-2020-16
refinedweb
2,034
59.23
When compiling libiptcdata on Windows, using MSYS+MinGW, I get 2 undefined references because of link() and chown() in main.c (respectively lines 835 and 850) Instead of link(), we can use CreateHardLink() which is more or less the same thing, with 2 limitations : it works only with Windows 2000 or above, and only with NTFS. Instead of if (link (filename, bakfile) < 0) we can do if (CreateHardLink(bakfile, filename, NULL)) guarded by _WIN32, or alternatively: #ifdef _WIN32 static int link(const char *oldpath, const char *newpath) { if (CreateHardLink(newpath, oldpath, NULL)) return -1; else return 0; } #endif so that the code is not modified, and windows.h should be included like that: #ifdef _WIN32 #define _WIN32_WINNT 0x0500 #define WIN32_LEAN_AND_MEAN #include <windows.h> #undef WIN32_LEAN_AND_MEAN #endif about chown, maybe the following link can be of some help : Vincent TORRI 2010-02-18 I completely forgot : Windows does not have langinfo.h, but iconv can be installed. I didn't find any clean way to disable the use of iconv in the configure options and my installed iconv library is always found. Maybe the option --disable-iconv should be added. Currently, i edit config.h...
http://sourceforge.net/p/libiptcdata/bugs/6/
CC-MAIN-2015-48
refinedweb
194
59.53
From: Brian Hassink (bhassink_at_[hidden]) Date: 2006-12-30 10:22:06 I have a latest cygwin installation (1-5-23-2) with the latest boost package (1.33.1-2). With the following test case... #include <boost/filesystem/operations.hpp> int main(int argc, char** argv) { boost::filesystem::path path1("/etc"); // ok boost::filesystem::path path2("/tmp"); // boom! } ...I'm seeing a crash when the second path object is created... 6 [sig] test 1652 C:\cygwin\home\admin\test.exe: *** fatal error - called with threadlist_ix -1 Hangup This problem didn't crop up until recently, but after rolling back to an earlier version of cygwin the problem persisted. To further confuse things, the problem does not occur on a different machine running the same cygwin version. I have run cygwin diagnostics (cygcheck), and everything reports OK. At this point I'm not sure if this is a cygwin issue or a boost issue or a machine specific issue, so I am posting to both groups in an effort to try and isolate the problem. What additional information should I be trying to gather? Thanks, Brian Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk
http://lists.boost.org/Archives/boost/2006/12/115101.php
crawl-001
refinedweb
213
59.6
. In blk.h, a mechanism for timing out when hardware doesn't respond is provided. If the foo device has not responded to a request after 5 seconds have passed, there is very clearly something wrong. We will update blk.h again: #elif (MAJOR_NR == FOO_MAJOR) #define DEVICE_NAME "foobar" #define DEVICE_REQUEST do_foo_request #define DEVICE_INTR do_foo #define DEVICE_TIMEOUT FOO_TIMER #define TIMEOUT_VALUE 500 /* 500 == 5 seconds */ #define DEVICE_NR(device) (MINOR(device) > 6) #define DEVICE_ON(device) #define DEVICE_OFF(device) #endif This is where using SET_INTR() and CLEAR_INTR becomes helpful. Simply by defining DEVICE_TIMEOUT, SET_INTR is changed to automatically set a “watchdog timer” that goes off if the foo device has not responded after 5 seconds, SET_TIMER is provided to set the watchdog timer manually, and a CLEAR_TIMER macro is provided to turn off the watchdog timer. The only three other things that need to be done are to: Add a timer, FOO_TIMER, to linux/timer.h. This must be a #define'd value that is not already used and must be less than 32 (there are only 32 static timers). In the foo_init() function called at boot time to detect and initialize the hardware, a line must be added: timer_table[FOO_TIMER].fn = foo_times_out; And (as you may have guessed from step 2) a function foo_times_out() must be written to try restarting requests, or otherwise handling the time out condition. The foo_times_out() function should probably reset the device, try to restart the request if appropriate, and should use the CURRENT->errors variable to keep track of how many errors have occurred on that request. It should also check to see if too many errors have occurred, and if so, call end_request(0) and go on to the next request. Exactly what steps are required depend on how the hardware device behaves, but both the hd and the floppy drivers provide this functionality, and by comparing and contrasting them, you should be able to determine how to write such a function for your device. Here is a sample, loosely based on the hd_times_out() function in hd.c: static void hd_times_out(void) { unsigned int dev; SET_INTR(NULL); if (!CURRENT) /* completely spurious interrupt- pretend it didn't happen. */ return; dev = DEVICE_NR(CURRENT->dev); #ifdef DEBUG printk("foo%c: timeout\n", dev+'a'); #endif if (++CURRENT->errors >= FOO_MAX_ERRORS) { #ifdef DEBUG printk("foo%c: too many errors\n", dev+'a'); #endif /* Tell buffer cache: couldn't fulfill request */ end_request(0); INIT_REQUEST; } /* Now try the request again */ foo_initialize_io(); } SET_INTR(NULL) keeps this function from being called recursively. The next two lines ignore interrupts that occur when no requests have been issued. Then we check for excessive errors, and if there have been too many errors on this request, we abort it and go on to the next request, if any; if there are no requests, we return. (Remember that the INIT_REQUEST macro causes a return if there are no requests left.) At the end, we are either retrying the current request or have given up and gone on to the next request, and in either case, we need to re-start the request. We could reset the foo device right before calling foo_initialize_io(), if the device maintains some state and needs a reset. Again, this depends on the details of the device for which you are writing the driver. Next month, we will discuss optimizing block device drivers. Michael K. Johnson is the editor of Linux Journal, and is also the author of the Linux Kernel Hackers' Guide (the KHG). He is using this column to develop and expand on the KHG.
https://www.linuxjournal.com/article/2885?page=0,2
CC-MAIN-2018-17
refinedweb
591
57.3
What’s New v0.9.0 (02.03.2022) Version 0.9.0 contains some exiting improvements: overlapping regions and unstructured grids can now be masked correctly. Further, Regions can now be round-tripped to geopandas.GeoDataFrame objects. The new version also adds PRUDENCE regions and a more stable handling of naturalearth regions. Many thanks to the contributors to the v0.9.0 release: Aaron Spring, Mathias Hauser, and Ruth Lorenz! Breaking Changes Removed support for Python 3.6 (PR288). The xarray.DataArraymask returned by all masking functions (e.g. Regions.mask()) was renamed from region to mask. The former was ambiguous with respect to the region dimension of 3D masks (PR318). The minimum versions of some dependencies were changed (PR311, PR312): regionmask.defined_regions.natural_earthis deprecated. defined_regions.natural_earthused cartopy to download natural_earth data and it was unclear which version of the regions is available. This is problematic because some regions change between the versions. Please use defined_regions.natural_earth_v4_1_0or defined_regions.natural_earth_v5_0_0instead (GH306, PR311). Passing coordinates with different type to Regions.mask()and Regions.mask_3D()is no longer supported, i.e. can no longer pass lon as numpy array and lat as DataArray (PR294). The mask no longer has dimension coordinates when 2D numpy arrays are passed as lat and lon coords (PR294). Enhancements regionmask does now correctly treat overlapping regions if overlap=Trueis set in the constructor (GH228, PR318). Per default regionmask assumes non-overlapping regions. In this case grid points of overlapping polygons will silently be assigned to the region with the higher number. This may change in a future version. Regions.mask()and Regions.mask_3D()now work with unstructured 1D grids such as: with 1-dimensional coordinates of the form lon(cell)and lat(cell). Note that only xarray arrays can be detected as unstructured grids. (GH278, PR280). By Aaron Spring. Add methods to convert Regionsto (geo)pandas objects, namely Regions.to_geodataframe(), Regions.to_geoseries(), Regions.to_dataframe()). The geopandas.GeoDataFrame can be converted back (round-tripped) using Regions.from_geodataframe()(GH50, PR298). The plotting methods ( Regions.plot()and Regions.plot_regions()) now use a more sophisticated logic to subsample lines on GeoAxes plots. The new method is based on the euclidean distance of each segment. Per default the maximum distance of each segment is 1 for lat/ lon coords - see the tolerancekeyword of the plotting methods. The subsamplekeyword is deprecated (GH109, PR292). The download of the natural_earth regions is now done in regionmask (using pooch) and no longer relies on cartopy (GH306, PR311). Deprecations New regions Added prudenceregions for Europe from Christensen and Christensen, 2007, (PR283). By Ruth Lorenz. Bug Fixes The name of lon and lat coordinates when passed as single elements is now respected when creating masks i.e. for region.mask(ds.longitude, ds.longitude)(GH129, PR294). Ensure Regions.plot()uses the current axes ( plt.gca()) if possible and error if a non-cartopy GeoAxes is passed (GH316, PR321). Docs Internal Changes Fix compatibility with shapely 1.8 (PR291). Fix downloading naturalearth regions part 2 (see PR261): Monkeypatch the correct download URL and catch all URLError, not only timeouts (PR289). Rewrote the function to create the mask DataArray (GH168, PR294). Follow up to PR294 - fix wrong dimension order for certain conditions (GH295). Refactor test_mask - make use of xr.testing.assert_equaland simplify some elements (PR297). Add packaging as a dependency (GH324, PR328). Add python 3.10 to list of supported versions (PR330). v0.8.0 (08.09.2021) Version 0.8.0 contains an important bugfix, improves the handling of wrapped longitudes, can create masks for coordinates and regions that do not have a lat/ lon coordinate reference system and masks for irregular and 2D grids are created faster if the optional dependency pygeos is installed. Breaking Changes Points at exactly -180°E (or 0°E) and -90°N are no longer special cased if wrap_lon=Falsewhen creating a mask - see methods for details (GH151). Updates to Regions.plot()and Regions.plot_regions()(PR246): Deprecated all positional arguments (keyword arguments only). The regionskeyword was deprecated. Subset regions before plotting, i.e. use r[regions].plot()instead of r.plot(regions=regions). This will allow to remove a argument from the methods. Updates to Regions.plot()(PR246): Added lw=0to the default ocean_kwsand land_kwsto avoid overlap with the coastlines. Renamed the projkeyword to projectionfor consistency with cartopy. Renamed the coastlineskeyword to add_coastlinesfor consistency with other keywords (e.g. add_land). Enhancements Creating masks for irregular and 2D grids can be speed up considerably by installing pygeos. pygeos is an optional dependency (GH123). Can now create masks for regions with arbitrary coordinates e.g. for coordinate reference systems that are not lat/ lon based by setting wrap_lon=False(GH151). The extent of the longitude coordinates is no longer checked to determine the wrap, now only the extent of the mask is considered (GH249). This should allow to infer wrap_loncorrectly for more cases (GH213). Bug Fixes Fixed a bug that could silently lead to a wrong mask in certain cases. Three conditions are required: The longitude coordinates are not ordered (note that wrapping the longitudes can also lead to unordered coordinates). Rearranging the coordinates makes them equally spaced. The split point is not in the middle of the array. Thus, the issue would happen for the following example longitude coordinates: [3, 4, 5, 1, 2](but not for [3, 4, 1, 2]). Before the bugfix the mask would incorrectly be rearranged in the following order [4, 5, 1, 2, 3](GH266). Regions.mask()(and all other maskmethods and functions) no longer raise an error for regions that exceed 360° latitude if wrap_lon=False. This was most likely a regression from PR48 (GH151). Raise a ValueError if the input coordinates (lat and lon) have wrong number of dimensions or shape (PR245, GH242). Docs Updated the plotting tutorial (PR246). Install regionmask via ci/requirements/docs.yml on RTD using pip and update the packages: don’t require jupyter (but ipykernel, which leads to a smaller environment), use new versions of sphinx and sphinx_rtd_theme (PR248). Pin cartopy to version 0.19 and matplotlib to version 3.4 and use a (temporary) fix for GH165. This allows to make use of conda-forge/cartopy-feedstock#116 such that natural_earth shapefiles can be downloaded again. Also added some other minor doc updates (PR269). Internal Changes Updated setup configuration and automated version numbering: Refactor test_defined_regionand test_mask_equal_defined_regions- globally define a list of all available defined_regions (GH256). In the tests: downloading naturalearth regions could run forever. Make sure this does not happen and turn the timeout Error into a warning (PR261). Set regex=Truein pd.Series.str.replacedue to an upcoming change in pandas (PR262). v0.7.0 (28.07.2021) Version 0.7.0 is mostly a maintenance version. It drops python 2.7 support, accompanies the move of the repo to the regionmask organisation (regionmask/regionmask), finalizes a number of deprecations, and restores compatibility with xarray 0.19. Breaking Changes Removed support for Python 2. This is the first version of regionmask that is Python 3 only! The minimum versions of some dependencies were changed (PR220): Moved regionmask to its own organisation on github. It can now be found under regionmask/regionmask (GH204 and PR224). matpoltlib and cartopy are now optional dependencies. Note that cartopy is also required to download and access the natural earth shapefiles (GH169). Deprecations Removed Regions_clsand Region_cls(deprecated in v0.5.0). Use Regionsinstead (PR182). Removed the create_mask_containsfunction (deprecated in v0.5.0). Use regionmask.Regions(coords).mask(lon, lat)instead (PR181). Removed the xarraykeyword to all maskfunctions. This was deprecated in version 0.5.0. To obtain a numpy mask use mask.values(GH179). Removed the "legacy"-masking deprecated in v0.5.0 (GH69, PR183). Enhancements Regions.plot()and Regions.plot_regions()now take the label_multipolygonkeyword to add text labels to all Polygons of MultiPolygons (GH185). Regions.plot()and Regions.plot_regions()now warn on unused arguments, e.g. plot(add_land=False, land_kws=dict(color="g"))(GH192). New regions Added natural_earth.land_10and natural_earth.land_50regions from natural earth (PR195) by Martin van Driel. Bug Fixes Text labels outside of the map area should now be correctly clipped in most cases (GH157). Move _flatten_polygonsto utilsand raise an error when something else than a Polygonor MultiPolygonis passed (PR211). Fix incompatibility with xarray >=0.19.0 (PR234). By Julius Busecke. Docs Internal Changes Moved the CI from azure to github actions (after moving to the regionmask organisation) (PR232). Update the CI: use mamba for faster installation, merge code coverage from all runs, don’t check the coverage of the tests (PR197). Fix doc creation for newest version of jupyter nbconvert( templateis now template-file). Update ci/min_deps_check.pyto the newest version on xarray (PR218). Add a test environment for python 3.9 (GH215). Enforce minimum versions in requirements.txt and clean up required dependencies (GH199 and PR219). v0.6.2 (19.01.2021) This is a minor bugfix release that corrects a problem occurring only in python 2.7 which could lead to wrong coordinates of 3D masks derived with Regions.mask_3D() and mask_3D_geopandas(). Bug Fixes Make sure Regionsis sorted by the number of the individual regions. This was previously not always the case. Either when creating regions with unsorted numbers in python 3.6 and higher (e.g. Regions([poly2, poly1], [2, 1])) or when indexing regions in python 2.7 (e.g. regionmask.defined_regions.ar6.land[[30, 31, 32]]sorts the regions as 32, 30, 31). This can lead to problems for Regions.mask_3D()and mask_3D_geopandas()(GH200). v0.6.1 (19.08.2020) There were some last updates to the AR6 regions ( regionmask.defined_regions.ar6). If you use the AR6 regions please update the package. There were no functional changes. v0.6.0 (30.07.2020) Warning This is the last release of regionmask that will support Python 2.7. Future releases will be Python 3 only, but older versions of regionmask will always be available for Python 2.7 users. For the more details, see: Version 0.6.0 offers better support for shapefiles (via geopandas) and can directly create 3D boolean masks which play nicely with xarray’s weighted.mean(...) function. It also includes a number of optimizations and bug fixes. Breaking Changes Points at exactly -180°E (or 0°E) and -90°N are now treated separately; such that a global mask includes all gridpoints - see methods for details (GH159). Regions.plot()no longer colors the ocean per default. Use Regions.plot(add_ocean=True)to restore the previous behavior (GH58). Changed the default style of the coastlines in Regions.plot(). To restore the previous behavior use Regions.plot(coastline_kws=dict())(PR146). Enhancements Create 3D boolean masks using Regions.mask_3D()and mask_3D_geopandas()- see the tutorial on 3D masks (GH4, GH73). Create regions from geopandas/ shapefiles from_geopandas(PR101 by Aaron Spring). Directly mask geopandas GeoDataFrame and GeoSeries mask_geopandas(PR103). Added a convenience function to plot flattened 3D masks: plot_3D_mask()(GH161). Regions.plotand Regions.plot_regionsnow also displays region interiors. All lines are now added at once using a LineCollectionwhich is faster than a loop and plt.plot(GH56 and GH107). Regions.plotcan now fill land areas with add_land. Further, there is more control over the appearance over the land and ocean features as well as the coastlines using the coastline_kws, ocean_kws, and land_kwsarguments (GH140). Split longitude if this leads to two equally-spaced parts. This can considerably speed up creating a mask. See GH127 for details. Added test to ensure Polygonswith z-coordinates work correctly (GH36). Better repr for Regions(GH108). Towards enabling the download of region definitions using pooch (PR61). New regions Added the AR6 reference regions described in Iturbide et al., (2000) (PR61). New marine regions from natural earth added as natural_earth.ocean_basins_50(PR91 by Julius Busecke). Bug Fixes Internal Changes Decouple _maybe_get_columnfrom its usage for naturalearth - so it can be used to read columns from geodataframes (GH117). Switch to azure pipelines for testing (PR110). Enable codecov on azure (PR115). Install matplotlib-basefor testing instead of matplotlibfor tests, seems a bit faster (GH112). Replaced all assertionwith if ...: ValueErroroutside of tests (GH142). Raise consistent warnings on empty mask (GH141). Use a context manager for the plotting tests (GH145). Docs Combine the masking tutorials (xarray, numpy, and multidimensional coordinates) into one (GH120). Use sphinx.ext.napoleonwhich fixes the look of the API docs. Also some small adjustments to the docs (PR125). Set mpl.rcParams["savefig.bbox"] = "tight"in docs/defined_*.rstto avoid spurious borders in the map plots (GH112). v0.5.0 (19.12.2019) Version 0.5.0 offers a better performance, a consistent point-on-border behavior, and also unmasks region interiors (holes). It also introduces a number of deprecations. Please check the notebook on methods and the details below. Breaking Changes - New behavior for ‘point-on-border’ and region interiors: - New ‘edge behaviour’: points that fall on the border of a region are now treated consistently (PR63). Previously the edge behaviour was not well defined and depended on the orientation of the outline (clockwise vs. counter clockwise; GH69 and matplotlib/matplotlib#9704). - Holes in regions are now excluded from the mask; previously they were included. For the defined_regions, this is relevant for the Caspian Sea in the naturalearth.land110region and also for some countries in naturalearth.countries_50(closes GH22). - Renamed Regions_clsto Regionsand changed its call signature. This allows to make all arguments except outlinesoptional. - Renamed Region_clsto _OneRegionfor clarity. - Deprecated the centroidskeyword for Regions(GH51). - xarray is now a hard dependency (GH64). - The function regionmask.create_mask_contains()is deprecated and will be removed in a future version. Use regionmask.Regions(coords).mask(lon, lat)instead. Enhancements - New faster and consistent methods to rasterize regions: - New algorithm to rasterize regions for equally-spaced longitude/ latitude grids. Uses rasterio.features.rasterize: this offers a 50x to 100x speedup compared to the old method, and also has consistent edge behavior (closes GH22 and GH24). - New algorithm to rasterize regions for grids that are not equally-spaced. Uses shapely.vectorized.contains: this offers a 2x to 50x speedup compared to the old method. To achieve the same edge-behavior a tiny (10 ** -9) offset is subtracted from lon and lat (closes GH22 and GH62). - Added a methods page to the documentation, illustrating the algorithms, the edge behavior and treatment of holes (closes GH16). - Added a test to ensure that the two new algorithms (“rasterize”, “shapely”) yield the same result. Currently for 1° and 2° grid spacing (GH74). - Automatically detect whether the longitude of the grid needs to be wrapped, depending on the extent of the grid and the regions (closes GH34). - Make all arguments to Regionsoptional (except outlines) this should make it easier to create your own region definitions (closes GH37). - Allow to pass arbitrary iterables to Regions- previously these had to be of type dict(closes GH43). - Added a Regions.plot_regions()method that only plots the region borders and not a map, as Regions.plot(). The Regions.plot_regions()method can be used to plot the regions on a existing cartopymap or a regular axes (closes GH31). - Added Regions.boundsand Regions.bounds_globalindicating the minimum bounding region of each and all regions, respectively. Added _OneRegion.bounds(closes GH33). - Add possibility to create an example dataset containing lon, lat and their bounds (closes GH66). - Added code coverage with pytest-cov and codecov. Bug Fixes - Regions were missing a line when the coords were not closed and subsample=False(GH46). - Fix a regression introduced by PR47: when plotting regions containing multipolygons _draw_polyclosed the region again and introduced a spurious line (closes GH54). - For a region defined via MultiPolygon: use the centroid of the largest Polygonto add the label on a map. Previously the label could be placed outside of the region (closes GH59). - Fix regression: the offset was subtracted in mask.lonand mask.lat; test np.all(np.equal(mask.lon, lon)), instead of np.allclose(closes GH78). - Rasterizing with "rasterize"and "shapely"was not equal when gridpoints exactly fall on a 45° border outline (GH80). - Conda channel mixing breaks travis tests. Only use conda-forge, add strict channel priority (GH27). - Fix documentation compilation on readthedocs (aborted, did not display figures). - Fix wrong figure in docs: countries showed landmask (GH39). v0.4.0 (02.03.2018) Enhancements Add landmask/ land 110m from Natural Earth (GH21). Moved some imports to functions, so import regionmaskis faster. Adapted docs for python 3.6. Bug Fixes v0.3.1 (4 October 2016) This is a bugfix/ cleanup release. Bug Fixes travis was configured wrong - it always tested on python 2.7, thus some python3 issues went unnoticed (GH14). natural_earth was not properly imported (GH10). A numpy scalar of dtype integer is not int- i.e. isinstance(np.int32, int)is False (GH11). In python 3 zipis an iterator (and not a list), thus it failed on mask(GH15). Removed unnecessary files (ne_downloader.py and naturalearth.py). Resolved conflicting region outlines in the Giorgi regions (GH17). v0.3.0 (20 September 2016) v0.2.0 (5 September 2016) v0.1.0 (15 August 2016) first release on pypi
https://regionmask.readthedocs.io/en/stable/whats_new.html
CC-MAIN-2022-33
refinedweb
2,827
52.46
This mini-package provides a simple class, Block, that can serve as a fixed-size container (in the STL sense) and that can also serve as a replacement for a native C++ array. module provides a fixed-size C++ container class that fully supports all operations needed to cooperate smoothly with the standard C++ library algorithms, yet supplies all the operations and benefits of a fixed-size native C++ array. To use the Block facilities, a user simply includes the header file: #include "ZMtools/Block.h" Subsequently, the user may instantiate and employ one or more Blocks, as in the following simple example: Block< int, 20 > a; ... a[0] = 16; ... std::cout << a.size(); A test program that validates the behavior of the Block<> template is available in the program zmtBlockTest.cc, furnished as part of this module. The sole header file needed by the user is ZMtools/Block.h. This file contains the complete implementation in the form of a template class, Block<>, together with a specialization of this template that handles the case of a zero-sized container. This class was adapted from Matthew Austern's block class as published in Generic Programming and the STL, ISBN 0-201-30956-4, and a similar class, c_array, published by Bjarne Stroustrup in The C++ Programming Language, 3rd Edition, ISBN 0-201-88954-4. The specialization for the case of a zero-length container was provided by Marc Paterno. Walter Brown edited the result for conformance to Zoom standards.
http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/ZMtools/doc/html/0Block.html
CC-MAIN-2014-35
refinedweb
249
50.46
Redux Saga is famous for being easy to test but what if it could be even more comfortable. redux-saga-test-plan by Jeremy Fairbank was designed precisely for this purpose. Test Double. We believe that software is broken, and we're here to fix it. Our mission is to improve how the world builds software.I'm a software engineer and consultant with I've been doing front-end development for almost ten years now and enjoy the paradigms that React and Redux helped introduce to the front-end world. I've created a few open source projects that work well with the React and Redux ecosystem such as revalidate, redux-saga-router, and, the topic of this interview, redux-saga-test-plan. I'm a huge fan of functional programming and Elm. In fact, I'm currently writing a book on Elm with The Pragmatic Programmers called Programming Elm: Build Safe and Maintainable Front-End Applications. The book is over halfway complete and should be available sometime in Spring 2018. redux-saga-test-plan is a library for easily testing redux-saga. If you're unfamiliar with redux-saga, check out the redux-saga interview with creator Yassine Elouafi. redux-saga-test-plan removes the headache of manually testing saga generator functions that couple your tests to their implementations. It offers a declarative, chainable API for testing that your saga yields certain effects without worrying about other effects or the order effects were yielded. It also runs your saga with redux-saga's runtime so that you can write integration tests, or you can use redux-saga-test-plan's built-in effect mocking to write unit tests too. Let's look at some example sagas to see how redux-saga-test-plan makes it easy to test them. Given this simple saga for fetching an array of users: import { call, put } from "redux-saga/effects"; function* fetchUsersSaga(api) { const users = yield call(api.getUsers); yield put({ type: "FETCH_USERS_SUCCESS", payload: users }); } You can test it with redux-saga-test-plan like this: import { expectSaga } from "redux-saga-test-plan"; it("fetches users", () => { const users = ["Jeremy", "Tucker"]; const api = { getUsers: () => users, }; return expectSaga(fetchUsersSaga, api) .put({ type: "FETCH_USERS_SUCCESS", payload: users }) .run(); }); The expectSaga function accepts a saga as an argument as well as any additional arguments for the saga itself. Here, we pass in the fetchUsersSaga and inject a mock api to fake the API response. expectSaga returns a chainable API with lots of useful methods. The put method is an assertion that the saga will eventually yield a put effect with the given FETCH_USERS_SUCCESS action. The run method starts the saga. redux-saga-test-plan uses redux-saga's runSaga function to run the saga like it would be run in your application. expectSaga tracks any effects your saga yields, so you can assert them like we do with put here. Sagas are inherently asynchronous, so redux-saga-test-plan returns a promise from the run method. You need that promise to know when the test is complete. In this example, we're using Jest so that we can return the promise directly to it. Because redux-saga-test-plan runs asynchronously, it times out your saga after a set amount of time. You can configure the timeout length. If you don't inject dependencies like the api object, you can use expectSaga's built-in mocking mechanism called providers. Let's say you import api from another file and use it like this instead: import { call, put } from "redux-saga/effects"; import api from "./api"; function* fetchUsersSaga() { const users = yield call(api.getUsers); yield put({ type: "FETCH_USERS_SUCCESS", payload: users }); } You can mock it with the provide method like this: import { expectSaga } from "redux-saga-test-plan"; import api from "./api"; it("fetches users", () => { const users = ["Jeremy", "Tucker"]; return expectSaga(fetchUsersSaga) .provide([[call(api.getUsers), users]]) .put({ type: "FETCH_USERS_SUCCESS", payload: users }) .run(); }); The provide method takes an array of matcher-value pairs. Each matcher-value pair is an array with an effect to match and a fake value to return. redux-saga-test-plan will intercept effects that match and return the fake value instead of letting redux-saga handle the effect. In this example, we match any call effects to api.getUsers and return a fake array of users instead. redux-saga-test-plan can handle more complex saga relationships like this: import { call, put, takeLatest } from "redux-saga/effects"; import api from "./api"; function* fetchUserSaga(action) { const id = action.payload; const user = yield call(api.getUser, id); yield put({ type: "FETCH_USER_SUCCESS", payload: user }); } function* watchFetchUserSaga() { yield takeLatest("FETCH_USER_REQUEST", fetchUserSaga); } In this example, watchFetchUserSaga uses takeLatest to handle the latest FETCH_USER_REQUEST action. If something dispatches FETCH_USER_REQUEST, then redux-saga forks fetchUserSaga to handle the action and fetch a user by id from the action's payload. You can test these sagas with redux-saga-test-plan like this: import { expectSaga } from "redux-saga-test-plan"; import api from "./api"; it("fetches a user", () => { const id = 42; const user = { id, name: "Jeremy" }; return expectSaga(watchFetchUserSaga) .provide([[call(api.getUser, id), user]]) .put({ type: "FETCH_USER_SUCCESS", payload: user }) .dispatch({ type: "FETCH_USER_REQUEST", payload: id }) .silentRun(); }); redux-saga-test-plan captures effects from forked sagas too. Notice that we call expectSaga with watchFetchUserSaga but still test the behavior of fetchUserSaga with the put assertion. We use the dispatch method to dispatch a FETCH_USER_REQUEST action with a payload id of 42 to watchFetchUserSaga. redux-saga then forks and runs fetchUserSaga. takeLatest runs in a loop so that redux-saga-test-plan will time out the saga with a warning message. You can safely silence the warning with the alternative silentRun method since we expect a timeout here. You can use providers to test your saga's error handling too. Take this new version of fetchUsersSaga that uses a try-catch block: function* fetchUsersSaga() { try { const users = yield call(api.getUsers); yield put({ type: "FETCH_USERS_SUCCESS", payload: users }); } catch (e) { yield put({ type: "FETCH_USERS_FAIL", payload: e }); } } You can import throwError from redux-saga-test-plan/providers to simulate an error in the provide method: import { expectSaga } from "redux-saga-test-plan"; import { throwError } from "redux-saga-test-plan/providers"; it("handles errors", () => { const error = new Error("Whoops"); return expectSaga(fetchUsersSaga) .provide([[call(api.getUsers), throwError(error)]]) .put({ type: "FETCH_USERS_FAIL", payload: error }) .run(); }); You can also test your Redux reducers alongside your sagas. Take this reducer for updating the array of users in the store state: const INITIAL_STATE = { users: [] }; function reducer(state = INITIAL_STATE, action) { switch (action.type) { case "FETCH_USERS_SUCCESS": return { ...state, users: action.payload }; default: return state; } } You can use the withReducer method to hook up your reducer and then assert the final state with hasFinalState: import { expectSaga } from "redux-saga-test-plan"; it("fetches the users into the store state", () => { const users = ["Jeremy", "Tucker"]; return expectSaga(fetchUsersSaga) .withReducer(reducer) .provide([[call(api.getUsers), users]]) .hasFinalState({ users }) .run(); }); Here are the other effect assertions available for testing. take(pattern) take.maybe(pattern) put(action) put.resolve(action) call(fn, ...args) call([context, fn], ...args) apply(context, fn, args) cps(fn, ...args) cps([context, fn], ...args) fork(fn, ...args) fork([context, fn], ...args) spawn(fn, ...args) spawn([context, fn], ...args) join(task) select(selector, ...args) actionChannel(pattern, [buffer]) race(effects) expectSaga. You don't have to manually iterate through your saga's yielded effects, which decouples your test from the implementation. puta particular typeof action without worrying about the action payload. I grew tired of manually testing sagas by iterating through yielded effects like this: function* fetchUsersSaga() { const users = yield call(api.getUsers); yield put({ type: "FETCH_USERS_SUCCESS", payload: users }); } it("fetches users", () => { const users = ["Jeremy", "Tucker"]; const iter = fetchUsersSaga(); expect(iter.next().value).toEqual(call(api.getUsers)); expect(iter.next(users).value).toEqual( put({ type: "FETCH_USERS_SUCCESS", payload: users }) ); }); These tests took long to write and coupled the test to the implementation. One small change in the order of effects would break a test even if the change didn't change the saga's overall behavior. Ironically, I created a testSaga API that took some of that boilerplate away but still coupled tests to their implementation. I finally set out to create a more user-friendly API that removed most of the boilerplate and let you focus on testing the behavior you were most interested, and this is how expectSaga was born. Writing my Elm book is currently consuming a lot of my time, so I've had to take a short break from redux-saga-test-plan. However, the next big plan is to support redux-saga v1, which adds support for effect middlewares. Effect middlewares let you intercept effects to return a mock value. I hope to simplify expectSaga's implementation of providers with effect middlewares. There's a nice backlog of issues for other cool features like new helpful assertions and integrating with a full Redux store too. Contributors are welcome! I'm not entirely sure because it depends on the life of redux-saga. Mateusz Burzyński and all the contributors have been doing a great job maintaining it. It's a great sign that they're working toward v1. But front-end development can move and change so fast. For example, we've seen a massive rise in the popularity of RxJS and redux-observable. As long as there is broad support for redux-saga in front-end applications, I think redux-saga-test-plan will stick around and fill a much-needed testing niche. Testing saga generators is hard, so redux-saga-test-plan will hopefully continue to make it easy. That being said, I don't always get to use redux-saga with my client projects, so I could use the support of other contributors to make redux-saga-test-plan the best it can be for testing. As far as trends, I think front-end development is heading toward better maintainability and safety with static typing. Elm, TypeScript, and Flow are making it easier to build robust front-end applications. Static types can catch so many simple bugs and mistakes to help you refactor code more confidently. You don't need to keep up with every new library and framework coming out. Focus on a stack that you like and build fantastic software. Don't let others make you feel like you're not a real developer because you're not up-to-date with the latest JavaScript framework. What's most important is understanding the language you're working with and how to stick to good software engineering practices. Find a mentor that's empathetic and eager to help you. Also, ask to speak at a meetup or submit to a conference. You'd be surprised how many people sometimes aren't experts on the topics they share (I've been there for sure). You can share the pain points you experienced learning a technology and offer your unique perspective on what you love about it. Then, you can inspire and empower other newcomers. I might be a little biased because I work for Test Double, but you should interview Justin Searls. He speaks a lot about testing, and his insight is something the JavaScript world would greatly benefit from. He maintains our awesome test double library testdouble.js, which has transformed how I think about mocking in tests. Thanks for the interview Jeremy! redux-saga-test-plan seems to complement redux-saga well. You can learn more from the redux-saga-test-plan site and redux-saga-test-plan GitHub page.
https://survivejs.com/blog/redux-saga-test-plan-interview/
CC-MAIN-2018-30
refinedweb
1,922
56.76
January build now available to the Windows Insider Program Hi everyone, I hope that you were able to watch our live stream on Wednesday, where we shared more details on the Windows 10 experience. If you missed it, you can watch the video on demand anytime and read Terry Myerson’s blog post that recaps the latest Windows 10 news. As Terry mentioned, we continue to be humbled by the amount of feedback and excitement we’re seeing from the Windows Insider community. Some of the new features that Joe demoed on Wednesday will be available for our Windows Insiders starting today with our newest build – 9926.. If you’re unfamiliar with the Windows Insider Program, this is our community who is helping us build Windows 10. If you’re not a Windows Insider yet, we’d love to have you join – see below. Also make sure you read the list of known issues at the end of this post before getting started. We’re pushing Build 9926 out widely, flighting simultaneously to both “Fast” and “Slow” rings simultaneously as well as available on ISOs since it has been a while since we’ve released a new build out to you.. Getting started: - If you haven’t yet signed up for the Windows Insider program, start here. - If you’re currently configured for the Fast or Slow rings,. With this build we further converge our preview build distribution with Windows Update, and the new Settings app (which I’ll talk about below) introduces a different way for configuring how you receive new builds from us (whether you’re on the Slow ring or Fast ring) as a Windows Insider. To configure the way you receive builds from us in Build 9926, open the Settings app and go to Update & recovery > Windows Update > Advanced options. You’ll notice that there is not a separate “Check Now” button here. This is because the button to check for WU updates now also checks for new builds. Here’s what’s new: This video from Joe shows off a lot of what’s new in this build: Cortana on the desktop: We’re excited to include Cortana as an integrated part of the desktop in Windows 10. Cortana is one click away on the taskbar, helping you find the things you need while proactively bringing you information you care about. Cortana can help you search in Windows 10 for apps, settings, and files as well as searching the web. You can access Cortana with your voice by clicking the microphone icon, then speaking to set reminders or ask about weather, sports, finance and other content from Bing. If you’re really adventurous, go into Cortana Settings, enable hands free use to say “Hey Cortana,” and you won’t need to click on the microphone icon. Cortana can learn your preferences and provide smarter recommendations over time. You can manage Cortana’s Notebook to add interests from Bing like news, sports, finance and weather so Cortana can proactively offer recommendations and information for you. Keep in mind, Cortana is new to the desktop – things might not work as expected. Also, for this build, Cortana is available for U.S. and English only. Search will work in all languages. But don’t worry, we’ll be making improvements in future builds, adding new capabilities and more languages. New Start menu: You’ll see some big changes to the Start menu in this build, including the ability to expand to a full-screen experience. This really shines on 2-in-1 PCs when switching into Tablet Mode. You can also customize the color of your Start screen. A big change that you won’t see is that we actually rebuilt Start in XAML, which is one type of code developers can use to build apps for Windows 10. The work on Start isn’t done yet, and we’ll have more changes that will show up in future builds including more personalization (and transparency!), drag and drop, Jump Lists, and the ability to resize the Start menu. Continuum: Back in September, we showed a video of how Continuum allows Windows to dynamically adapt across different device types. On Wednesday, Joe demoed Continuum on a Surface Pro 3 as well as how it shines on a traditional tablet. Only Windows 10 lets you seamlessly transition between the familiar desktop and a tablet experience optimized for touch. You are always in control of the transition whether explicitly from Action Center or when Windows suggests a change based on how you are using the device. Best of all, each experience supports both desktop and Store apps in a consistent way. This means that Store apps are windowed on the desktop and yes, even desktop apps in Tablet Mode can now be closed with a simple swipe from the top! New Settings app: We’re working hard to evolve the Settings experience in Windows and in this build, you will see a lot of this work come together. This is where you will go to manage your device and things like your display, network, and account settings. As I noted above, the new Settings app introduces a different way for configuring how you receive new builds from us too. Even better – the Settings experience will be consistent across all your Windows devices. We’ve made the homepage easier to scan and reminiscent of Control Panel, which many of you were familiar with. It’s icon-based and we re-organized the categories to be more familiar. You can also use search within the app to find the setting you want. Search will even find Control Panel pages that aren’t in the Settings app. Connect to wireless audio and video: We’ve made it much easier for you to find and connect to wireless audio and video devices that support technologies like Bluetooth and Miracast. You can access the experience either by clicking on the “Connect” button in the new Action Center, or by using the Windows + P keyboard shortcut from anywhere. In the Connect panel, Windows will discover nearby Miracast devices and Bluetooth speakers, allowing you to simply touch or click to connect. Pairing to devices happens right inline, so you never have to navigate away to settings. When connecting to wired and wireless screens, you can also control their projection style, choosing to either “Duplicate” or “Extend” their desktop. New Photos and Maps apps: In Joe’s demo on Wednesday, he showed off many of the new and updated apps that are coming with Windows 10. And in this build, you can give the new Photos and Maps apps a try for yourself. The Photos apps will show your photos stored locally on your PC, as well as in OneDrive, and make them look great. You can also edit your photos too. Some features like the ability to create albums are not enabled just yet. Windows Store Beta: In this build, you will see the first look at the Windows Store Beta. It’s important to note that the NEW Windows Store Beta is a *grey* tile in the Start menu or on the taskbar and the current Windows Store remains available in the build as a *green* tile. Sorry it’s confusing to have two, but we wanted to give you an early preview of the new Windows Store. It includes a new visual design which will be common across PCs, tablets, phones and the web. It works well within a window and can be updated independently from the OS (this matters because it allows for more frequent updates). Keep in mind this is a preview. You can expect both the app selection and markets where the Store Beta is available to be limited and you will find that only basic functionality is available in this release. You can browse and search, as well as download apps. You can pay for those apps and games with options such as international credit card, gift cards and PayPal. In-app purchase is not available for apps downloaded through the Store Beta, though apps you already own with in-app purchase can be used. The ability to purchase additional in-app content is currently disabled. Finally, you can purchase apps on a device running Windows 8.1 and use those apps in this build of Windows 10 but not vice versa. We’ll have a lot more information about the new Windows Store in Windows 10 to share later and more functionality will light up in future builds. UPDATE 1/28: We recommend that you purchase for-pay apps from the Windows 8.1 Store (green store). When you purchase apps from the Windows 8.1 Store (green store), January Technical Preview and all your other Windows devices will recognize that you own them. Purchases from the Windows Store Beta (grey store) only work on January Technical Preview for now. If you’ve already purchased for-pay apps from the Windows Store Beta, don’t worry – purchases made in either Store will be honored in the long-term. Xbox app: You can give the new Xbox app a try in this build. For details on the functionality the Xbox app has in this build – check out this blog post on Xbox Wire. These are just some of the new things in this build. I’m sure many of you will discover others! Here are some changes based on your feedback: We love highlighting specific features we’ve changed based on your feedback. We’ve implemented some top feedback requests in this build. As with previous builds it’s impossible to list them all, and many things are invisible – like the crashes & hangs that your problem reports helped us track down. Here’s a sample of a few things you told us you wanted that we’ve addressed: - You’ve asked us to support more languages so we’re bringing you more). - The new Windows Update UX in the Settings app provides a progress bar for preview build downloads which was a top request for Insiders. When you navigate away after starting the download/install, it will know that the download and install is still in progress when you return (instead of looking like a blank slate. And progress is now determinate, instead of just a spinning circle. - We received feedback that ALT+TAB was too jarring (everything on screen changed) and that some people found it confusingly similar to Task View. Some people wondered why Virtual Desktops were not accessible from ALT+TAB. So, we merged the previous ALT+TAB design with the Task View to produce an approach that retained the large thumbnails that people like, but with an overlay that is familiar. Now, it feels far less jarring and while it looks like it belongs to the family of Task View and Snap Assist, it retains its unique strength of being a great keyboard switcher. Finally, this change makes the work we’ve done with precision touchpads feel better too. Now when you quickly three finger swipe left/right, ALT+TAB feels lighter-weight. - We also heard that folks wanted Persian calendars support and you’ll find that in this build. The Persian calendar format will appear on your Lock screen, your taskbar clock, and on timestamps on files in File Explorer. - Another top request from you was to have the option to pick the default folder when opening File Explorer, and the team responded and added this feature. - We saw feedback from Insiders that it was hard to find how to make apps full-screen in the “hamburger-style” menu seen in previous builds so we’ve added a full-screen button in the title bar. We’ve also made the title bars for both desktop and modern apps title bars feel more harmonious. - Finally, I know that a TON of Insiders were unhappy about the bug where keyboard lights weren’t working when Caps lock/Num lock/Scroll lock is toggled. I’m super happy to report that we’ve fixed that issue in this build. Thank you for being patient with us on that one. Some known problems: Here is a list of a few issues with Build 9926. As with the last builds, we may release updates to fix some of the most prevalent issues and others may be fixed in subsequent builds. -. In closing:. As always please continue to give us feedback, suggestions, and problem reports via the Feedback app on the build as you use it, use the Community forum to connect with other Insiders for help and tips on problems you hit. Thanks, g Updated January 29, 2015 1:27 pm
https://blogs.windows.com/windowsexperience/2015/01/23/january-build-now-available-to-the-windows-insider-program/
CC-MAIN-2018-09
refinedweb
2,119
68.7
Contents Abstract Given that it is useful and common to specify version numbers for Python modules, and given that different ways of doing this have grown organically within the Python community, it is useful to establish standard conventions for module authors to adhere to and reference. This informational PEP describes best practices for Python module authors who want to define the version number of their Python module. Conformance with this PEP is optional, however other Python tools (such as distutils2 [1]) may be adapted to use the conventions defined here. PEP Deferral Further exploration of the concepts covered in this PEP has been deferred for lack of a current champion interested in promoting the goals of the PEP and collecting and incorporating feedback, and with sufficient available time to do so effectively. User Stories Alice is writing a new module, called alice, which she wants to share with other Python developers. alice is a simple module and lives in one file, alice.py. Alice wants to specify a version number so that her users can tell which version they are using. Because her module lives entirely in one file, she wants to add the version number to that file. Bob has written a module called bob which he has shared with many users. bob.py contains a version number for the convenience of his users. Bob learns about the Cheeseshop [2], and adds some simple packaging using classic distutils so that he can upload The Bob Bundle to the Cheeseshop. Because bob.py already specifies a version number which his users can access programmatically, he wants the same API to continue to work even though his users now get it from the Cheeseshop. Carol maintains several namespace packages, each of which are independently developed and distributed. In order for her users to properly specify dependencies on the right versions of her packages, she specifies the version numbers in the namespace package's setup.py file. Because Carol wants to have to update one version number per package, she specifies the version number in her module and has the setup.py extract the module version number when she builds the sdist archive. David maintains a package in the standard library, and also produces standalone versions for other versions of Python. The standard library copy defines the version number in the module, and this same version number is used for the standalone distributions as well. Rationale Python modules, both in the standard library and available from third parties, have long included version numbers. There are established de-facto standards for describing version numbers, and many ad-hoc ways have grown organically over the years. Often, version numbers can be retrieved from a module programmatically, by importing the module and inspecting an attribute. Classic Python distutils setup() functions [3] describe a version argument where the release's version number can be specified. PEP 8 [4]. Another example of version information is the sqlite3 [5] module with its sqlite_version_info, version, and version_info attributes. It may not be immediately obvious which attribute contains a version number for the module, and which contains a version number for the underlying SQLite3 library. This informational PEP codifies established practice, and recommends standard ways of describing module version numbers, along with some use cases for when -- and when not -- to include them. Its adoption by module authors is purely voluntary; packaging tools in the standard library will provide optional support for the standards defined herein, and other tools in the Python universe may comply as well. Specification - In general, modules in the standard library SHOULD NOT have version numbers. They implicitly carry the version number of the Python release they are included in. - On a case-by-case basis, standard library modules which are also released in standalone form for other Python versions MAY include a module version number when included in the standard library, and SHOULD include a version number when packaged separately. - When a module (or package) includes a version number, the version SHOULD be available in the __version__ attribute. - For modules which live inside a namespace package, the module SHOULD include the __version__ attribute. The namespace package itself SHOULD NOT include its own __version__ attribute. - The __version__ attribute's value SHOULD be a string. - Module version numbers SHOULD conform to the normalized version format specified in PEP 386 [6]. - Module version numbers SHOULD NOT contain version control system supplied revision numbers, or any other semantically different version numbers (e.g. underlying library version number). - The version attribute in a classic distutils setup.py file, or the PEP 345 [7] Version metadata field SHOULD be derived from the __version__ field, or vice versa. Examples Retrieving the version number from a third party package: >>> import bzrlib >>> bzrlib.__version__ '2.3.0' Retrieving the version number from a standard library package that is also distributed as a standalone module: >>> import email >>> email.__version__ '5.1.0' Version numbers for namespace packages: >>> import flufl.i18n >>> import flufl.enum >>> import flufl.lock >>> print flufl.i18n.__version__ 1.0.4 >>> print flufl.enum.__version__ 3.1 >>> print flufl.lock.__version__ 2.1 >>> import flufl >>> flufl.__version__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute '__version__' >>> Deriving Module version numbers can appear in at least two places, and sometimes more. For example, in accordance with this PEP, they are available programmatically on the module's __version__ attribute. In a classic distutils setup.py file, the setup() function takes a version argument, while the distutils2 setup.cfg file has a version key. The version number must also get into the PEP 345 metadata, preferably when the sdist archive is built. It's desirable for module authors to only have to specify the version number once, and have all the other uses derive from this single definition. This could be done in any number of ways, a few of which are outlined below. These are included for illustrative purposes only and are not intended to be definitive, complete, or all-encompassing. Other approaches are possible, and some included below may have limitations that prevent their use in some situations. Let's say Elle adds this attribute to her module file elle.py: __version__ = '3.1.1' Classic distutils In classic distutils, the simplest way to add the version string to the setup() function in setup.py is to do something like this: from elle import __version__ setup(name='elle', version=__version__) In the PEP author's experience however, this can fail in some cases, such as when the module uses automatic Python 3 conversion via the 2to3 program (because setup.py is executed by Python 3 before the elle module has been converted). In that case, it's not much more difficult to write a little code to parse the __version__ from the file rather than importing it. Without providing too much detail, it's likely that modules such as distutils2 will provide a way to parse version strings from files. E.g.: from distutils2 import get_version setup(name='elle', version=get_version('elle.py')) Distutils2 Because the distutils2 style setup.cfg is declarative, we can't run any code to extract the __version__ attribute, either via import or via parsing. In consultation with the distutils-sig [9], two options are proposed. Both entail containing the version number in a file, and declaring that file in the setup.cfg. When the entire contents of the file contains the version number, the version-file key will be used: [metadata] version-file: version.txt When the version number is contained within a larger file, e.g. of Python code, such that the file must be parsed to extract the version, the key version-from-file will be used: [metadata] version-from-file: elle.py A parsing method similar to that described above will be performed on the file named after the colon. The exact recipe for doing this will be discussed in the appropriate distutils2 development forum. An alternative is to only define the version number in setup.cfg and use the pkgutil module [8] to make it available programmatically. E.g. in elle.py: from distutils2._backport import pkgutil __version__ = pkgutil.get_distribution('elle').metadata['version'] PEP 376 metadata PEP 376 [10] defines a standard for static metadata, but doesn't describe the process by which this metadata gets created. It is highly desirable for the derived version information to be placed into the PEP 376 .dist-info metadata at build-time rather than install-time. This way, the metadata will be available for introspection even when the code is not installed.
http://legacy.python.org/dev/peps/pep-0396/
CC-MAIN-2016-26
refinedweb
1,433
54.93
Installing the SQLite The first thing you want to do is install the package.You can do this from within Visual Studio itself in all editions. From the Tools menu, choose Extensions and Updates and then choose the Online section (on the left of the dialog) and search for ‘sqlite’ in the search term. This will show you the SQLite for Windows Runtime package. Using the new package in your C# Now that you have the SQLite for Windows Runtime package installed in your Visual Studio environment, you want to use it. In a managed (.NET) app you would do the following steps. First, create your app (e.g., a Blank XAML app is fine). Once within your app, use the Add Reference mechanism to get to the next step. Now you will not be browsing for any DLL directly like you would in a traditional .NET. What we are adding here is a reference to the Extension SDK…not the library itself, a small but important distinction. Once in the Add Reference dialog choose the Windows\Extensions view (see on left) and you’ll see SQLite for Windows Runtime. To correctly use this in a managed app you’ll need to select that *and* the C++ runtime as seen below: Now with this involved you can grab a managed wrapper to call the SQLite APIs. I personally recommend the sqlite-net library (available via NuGet) to make this easier for you. Using the sqlite-net library you can perform tasks using a model similar to LINQ2SQL where you can have types represent database entities: SQLite; namespace App1 { public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "person.sqlite"); using (var db = new SQLite.SQLiteConnection(dbPath)) { db.CreateTable<Person>(); db.RunInTransaction(() => { db.Insert(new Person() { Name = "vivek", Surname = "ps" }); }); } } } public class Person { [PrimaryKey, AutoIncrement] public int Id { get; set; } [MaxLength(30)] public string Name { get; set; } [MaxLength(30)] public string Surname { get; set; } } } Now you just need to specify your architecture for your app (x86, x64, ARM) and when you build, the appropriate sqlite3.dll will be packaged in your app automatically. This also happens during the packaging step for the store so the right item is included for each architecture-specific package.
http://vivekcek.wordpress.com/category/windows-8/
CC-MAIN-2014-42
refinedweb
384
62.68
Saiba mais sobre a Assinatura do Scribd Descubra tudo o que o Scribd tem a oferecer, incluindo livros e audiolivros de grandes editoras. Building Bare-Metal ARM Systems with GNU Miro Samek Quantum Leaps, LLC Article Published online at July/August 2007 Part 1 What’s Needed in a Bare-Metal ARM Project? 1-1 1.1 What’s Needed in a Real-Life Bare-Metal ARM Project? 1.2 Support for ARM Vectors Remapping 1.3 Low-level Initialization in C/C++ 1-2 1.4 Executing Code from RAM 1.5 Mixing ARM and THUMB Instruction Sets 1.6 Separate Stack Section 1.7 Debug and Release Configurations 1.8 Support for C++ 1.9 Minimizing the Impact of C++ 1-3 1.10 ARM Exceptions and Interrupt Handling 1.11 References Part 2 Startup Code and the Low-level Initialization 2-1 2.1 The Startup Code 2.2 Low-Level Initialization 2-5 2.3 2-8 Part 3 The Linker Script 3-1 3.1 Linker Script 3.2 3-5 Part 4 C/C++ Compiler Options and Minimizing the Overhead of C++ 4-1 4.1 Compiler Options for C 4.2 C++ 4-2 4.3 Reducing the Overhead of C++ 4.4 4-3 Part 5 Fine-tuning the Application 5-1 5.1 ARM/THUMB compilation 5.2 Placing the Code in RAM 5.3 Part 6 General Description of Interrupt Handling 6-1 6.1 Problem Description 6.2 Interrupt Handling Strategy 6.3 FIQ Handling 6-3 6.4 No Auto-Vectoring 6-4 6.5 Part 7 Interrupt Locking and Unlocking 7-1 7.1 Problem Description 7.2 The Policy of Saving and Restoring Interrupt Status 7.3 Critical Section Implementation with GNU gcc 7-2 7.4 Discussion of the Critical Section Implementation 7-3 7.5 7-4 Part 8 Low-level Interrupt Wrapper Functions 8-1 8.1 The IRQ Interrupt Wrapper ARM_irq 8.2 The FIQ Interrupt Wrapper ARM_fiq 8-4 8.3 8-5 Part 9 C-Level ISRs and Other ARM Exceptions 9-1 9.1 The BSP_irq Handler Function 9.2 The BSP_fiq Handler Function 9-2 9.3 Interrupt Service Routines 9-3 9.4 Initialization of the Vector Table and the Interrupt Controller 9-4 9.5 Other ARM Exception Handlers 9-5 9.6 9-6 Part 10 Example Application and Testing Strategies 10-1 10.1 The Blinky Example Application 10.2 Manual Testing of Interrupt Preemptions Scenario 10-4 10.3 Summary 10-5 10.4 Part 11 Contact Information 11-1 ii Building Bare Metal ARM Systems with GNU The ubiquitous ARM processor family is very well supported by the GNU C/C++ toolchain. While many online and printed resources [1-1, 1-2] focus on building and installing the GNU toolchain, it is quite hard to find a comprehensive example of using the GNU C/C++ toolchain for a bare-metal ARM system that would have all the essential features needed in a real-life project. And even if you do find such an example, you most likely won’t know WHY things are done the particular way. In this multi-part article I cover interrupt handling for ARM projects in the simple foreground/background software architecture. I describe interrupt locking policy, interrupt handling in the presence of a prioritized interrupt controller, IRQ and FIQ assembly “wrapper” functions as well as other ARM exception handlers. I conclude with the description of testing strategy for various interrupt preemption scenarios. To focus the discussion, this article is based on the latest CodeSourcery G++ GNU toolchain for ARM [1 [1-4, 1-5] for ARM and other ARM7- or ARM9- based microcontrollers. I present separate projects in C and C++ to illuminate the C++-specific issues. 1.1. 1.2 Support for ARM Vectors Remapping The first 32 bytes of memory at address 0x0 contain the ARM processor exception vectors, in par-ticular,. None-theless, a real-life project typically needs to use the ARM vector remapping. This article addresses the issue and presents a fairly general solution. Building Bare-Metal ARM Systems with GNU 1.3 article allows performing the low-level initialization either from C/C++ or from assembly. 1.4 article provides support for executing code from RAM, which includes copying the RAM-based code from ROM to RAM at boot time, long jumps between ROM- and RAM-based code, as well as the linker script that allows very fine-granularity control over the functions placed in RAM. 1.5. 1.6 Separate Stack Section Most standard GNU linker scripts simply supply a symbol at the top of RAM to initialize the stack pointer. The stack typically grows towards the heap and it’s hard to determine when the stack overflow occurs. This article. 1.7 Debug and Release Configurations The Makefile described in this article supports building the separate debug and release configurations, each with different compiler and linker options. 1.8 article provides a universal startup code and linker script that works for C++ as well as C applications. 1.9, the impact of C++ can be negligible. This article shows how to reduce the C++ overhead with the GNU toolchain below 300 bytes of additional code compared to pure C implementation. 1.10 assembly programming is required. All this makes the handling of interrupts and exceptions quite complicated. This article. attribute ((interrupt ("IRQ"))) cannot handle nested interrupts, so Coming Up Next: In the next part I’ll describe the generic startup code for the GNU toolchain as well as the low- level initialization for a bare-metal ARM system. Stay tuned. 1.11 References [1-1] Lewin A.R.W. Edwards, “Embedded System Design on a Shoestring”, Elsevier 2003. [1-2] ARM Projects, [1-3] GNU Toolchain for ARM, CodeSourcery, [1-4] GNU ARM toolchain, [1-5] GNU X-Tools™, Microcross, [1-6] Sloss, Andrew, Dominic Symes, and Chris Wright, “ARM System Developer's Guide: Designing and Optimizing System Software”, Morgan Kaufmann, 2004 In this part I start digging into the code that is available online at <provide embedded.com link to [2-1]. In this part, I describe the generic startup code for the GNU toolchain as well as the low-level initialization for a bare-metal ARM system. The recommended reading for this part includes the “IAR Compiler Reference Guide” [2- 2], specifically sections “System startup and termination” as well as “Customizing system initialization”. 2.1. /***************************************************************************** * The startup code must be linked at the start of ROM, which is NOT necessarily address zero. */ (1) .text (2) .code 32 (3) .global _start (4) .func _start _start: /* Vector table * NOTE: used only very briefly until RAM is remapped to address zero (5) B _reset /* Reset: relative branch allows remap */ (6) . /* Undefined Instruction */ /* Software Interrupt /* Prefetch Abort /* Data Abort /* Reserved /* IRQ /* FIQ (7) /* The copyright notice embedded prominently at the beginning of ROM */ .string "Copyright (c) YOUR COMPANY. All Rights Reserved." (8) .align 4 /* re-align to the word boundary */ * _reset (9) _reset: /* Call the platform-specific low-level initialization routine NOTE: The ROM is typically NOT at its linked address before the remap, so the branch to low_level_init() must be relative (position independent code). The low_level_init() function must continue to execute in ARM state. Also, the function low_level_init() cannot rely on uninitialized data being cleared and cannot use any initialized data, because the .bss and .data sections have not been initialized yet. (10) LDR r0,=_reset /* pass the reset address as the 1st argument */ (11) r1,=_cstartup /* pass the return address as the 2nd argument */ (12) MOV lr,r1 /* set the return address after the remap */ (13) sp,= stack_end /* set the temporary stack pointer */ (14) low_level_init /* relative branch enables remap */ /* NOTE: after the return from low_level_init() the ROM is remapped to its linked address so the rest of the code executes at its linked address. (15) _cstartup: /* Relocate .fastcode section (copy from ROM to RAM) */ (16) r0,= fastcode_load LDR r1,= fastcode_start LDR r2,= fastcode_end 1: CMP r1,r2 LDMLTIA r0!,{r3} STMLTIA r1!,{r3} BLT 1b /* Relocate the .data section (copy from ROM to RAM) */ (17) r0,= data_load LDR r1,= data_start LDR r2,=_edata LDMLTIA r0!,{r3} STMLTIA r1!,{r3} /* Clear the .bss section (zero init) */ (18) r1,= bss_start LDR r2,= bss_end r3,#0 (19) /* Fill the .stack section */ LDR r1,= stack_start LDR r2,= stack_end LDR r3,=STACK_FILL 2-2 r2,r2 (20) /* Initialize stack pointers for all ARM modes */ MSR CPSR_c,#(IRQ_MODE | I_BIT | F_BIT) irq_stack_top /* set the IRQ stack pointer */ CPSR_c,#(FIQ_MODE | I_BIT | F_BIT) fiq_stack_top /* set the FIQ stack pointer */ CPSR_c,#(SVC_MODE | I_BIT | F_BIT) svc_stack_top /* set the SVC stack pointer */ CPSR_c,#(ABT_MODE | I_BIT | F_BIT) abt_stack_top /* set the ABT stack pointer */ CPSR_c,#(UND_MODE | I_BIT | F_BIT) und_stack_top /* set the UND stack pointer */ (21) CPSR_c,#(SYS_MODE | I_BIT | F_BIT) c_stack_top /* set the C stack pointer */ /* Invoke all static constructors */ (22) r12,= libc_init_array lr,pc /* set the return address */ BX r12 /* the target code can be ARM or THUMB */ /* Enter the C/C++ code */ (23) r12,=main (24) SWI 0xFFFFFF /* cause exception if main() ever returns */ .size _start, . - _start .endfunc .end Listing 2-1 Startup code in GNU assembly (startup.s) Listing 2-1 2-3). 2-4 . libc_init_array invokes all C++ static constructors (see also the linker script). This 2.2. (1) #include <stdint.h> /* C-99 standard exact-width integer types */ (2) void low_level_init(void (*reset_addr)(), void (*return_addr)()) { extern uint8_t ram_start; static uint32_t const LDR_PC_PC = 0xE59FF000U; static uint32_t const MAGIC = 0xDEADBEEFU; AT91PS_PMC pPMC; /* Set flash wait sate FWS and FMCN */ AT91C_BASE_MC->MC_FMR = ((AT91C_MC_FMCN) & ((MCK + 500000)/1000000 << 16)) | AT91C_MC_FWS_1FWS; AT91C_BASE_WDTC->WDTC_WDMR = AT91C_WDTC_WDDIS; /* Disable the watchdog */ /* Enable the Main Oscillator */ /* Set the PLL and Divider and wait for PLL stabilization /* Select Master Clock and CPU Clock select the PLL clock / 2 /* Setup the exception vectors in RAM. NOTE: the exception vectors must be in RAM *before* the remap in order to guarantee that the ARM core is provided with valid vectors during the remap operation. /* setup the primary vector table in RAM */ (9) *(uint32_t volatile *)(& ram_start + 0x00) = (LDR_PC_PC | 0x18); + 0x04) = (LDR_PC_PC | 0x18); + 0x08) = (LDR_PC_PC | 0x18); + 0x0C) = (LDR_PC_PC | 0x18); + 0x10) = (LDR_PC_PC | 0x18); + 0x14) = MAGIC; + 0x18) = (LDR_PC_PC | 0x18); + 0x1C) = (LDR_PC_PC | 0x18); /* setup the secondary vector table in RAM */ + 0x20) = (uint32_t)reset_addr; + 0x24) = 0x04U; + 0x28) = 0x08U; + 0x2C) = 0x0CU; + 0x30) = 0x10U; + 0x34) = 0x14U; + 0x38) = 0x18U; + 0x3C) = 0x1CU; /* check if the Memory Controller has been remapped already */ if (MAGIC != (*(uint32_t volatile *)0x14)) { AT91C_BASE_MC->MC_RCR = 1; /* perform Memory Controller remapping */ } (14) } Listing 2-2 Low-level initialization for AT91SAM7S microcontroller. Listing 2-2 shows the low-level initialization of the AT91SAM7S microcontroller in C. Note this address, so the symbol linker script). (4) The constant LDR_PC_PC contains the opcode of the ARM instruction LDR pc,[pc,: denotes the linked address of RAM. In AT91SAM7S the RAM is always available at denotes also the RAM location before the remap operation (see the ], which is used to 0x00: LDR pc,[pc,#0x18] /* Reset 0x04: 0x08: 0x0C: 2-6 0x10: 0x14: 0x18: /* IRQ vector 0x1C: /* FIQ vector. Coming Up Next: In the next part I’ll describe the linker script for the GNU toolchain. Stay tuned. 2-7 [2-1] GNU Assembler (as) HTML documentation included in the CodeSourcery Toolchain for ARM,. [2-2] IAR Systems, “ARM® IAR C/C++ Compiler Reference Guide for Advanced RISC Machines Ltd’s ARM Cores”, Part number: CARM-13, Thirteenth edition: June 2006. Included in the free EWARM KickStart edition [2-3] [2-4] In this part I move on to describe the GNU linker script for a bare-metal ARM project. The code accompanying this article is available online at <provide embedded.com link to code>. The recommended reading for this part includes “Embedded System Design on a Shoestring” by Lewin Edwards [3-1], specifically section “Ld—GNU Linker” in Chapter 3. 3.1. (1) OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") (2) OUTPUT_ARCH(arm) (3) ENTRY(_start) (4) MEMORY { /* memory map of AT91SAM7S64 */ ROM (rx) : ORIGIN = 0x00100000, LENGTH = 64k RAM (rwx) : ORIGIN = 0x00200000, LENGTH = 16k /* The size of the single stack used by the application */ (7) C_STACK_SIZE = 512; IRQ_STACK_SIZE = 0; FIQ_STACK_SIZE = 0; SVC_STACK_SIZE = 0; ABT_STACK_SIZE = 0; UND_STACK_SIZE = 0; (8) SECTIONS { .reset : { *startup.o (.text) /* startup code (ARM vectors and reset handler) */ = ALIGN(0x4); } >ROM .ramvect : { /* used for vectors remapped to RAM */ = .; . = 0x40; (15) } >RAM .fastcode : { /* used for code executed from RAM and copied from ROM */ fastcode_load fastcode_start = LOADADDR (.fastcode); *(.glue_7t) *(.glue_7) /* functions with *(.text.fastcode) ((section (".text.fastcode")))*/ *(.text.Blinky_shift) /* add other modules here /* explicitly place Blinky_shift() function */ */ = ALIGN (4); fastcode_end } >RAM AT>ROM .text : {/* used for code and read-only data executed from ROM in place */ CREATE_OBJECT_SYMBOLS *(.text .text.* .gnu.linkonce.t.*) *(.plt) *(.gnu.warning) (25) /* NOTE: placed already in .fastcode */ (26) /* These are for static constructors and destructors under ELF */ KEEP (*crtbegin.o(.ctors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*crtend.o(.ctors)) KEEP (*crtbegin.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*crtend.o(.dtors)) (27) *(.rodata .rodata.* .gnu.linkonce.r.*) *(.init) *(.fini) (28) (29) /* .ARM.exidx is sorted, so has to go in its own output section. .ARM.exidx : { exidx_start *(.ARM.exidx* .gnu.linkonce.armexidx.*) exidx_end } >ROM _etext = .; (30) .data : { data_load data_start = LOADADDR (.data); = .; /* used for initialized data */ KEEP(*(.jcr)) *(.got.plt) *(.got) *(.shdata) *(.data .data.* .gnu.linkonce.d.*) (31) _edata = .; } >RAM AT>ROM (32) .bss : { bss_start *(.shbss) *(.bss .bss.* .gnu.linkonce.b.*) *(COMMON) = ; . = ALIGN (4); 3-2 bss_end (33) (34) .stack : { stack_start += IRQ_STACK_SIZE; = ALIGN (4); irq_stack_top += FIQ_STACK_SIZE; = ALIGN (4); fiq_stack_top += SVC_STACK_SIZE; = ALIGN (4); svc_stack_top += ABT_STACK_SIZE; = ALIGN (4); abt_stack_top += UND_STACK_SIZE; = ALIGN (4); und_stack_top += C_STACK_SIZE; (35) = ALIGN (4); c_stack_top (36) (37) _end = .; end = _end; PROVIDE(end = .); (38) .stab 0 (NOLOAD) : { *(.stab) .stabstr 0 (NOLOAD) : { *(.stabstr) /* DWARF debug sections. * Symbols in the DWARF debugging sections are relative to the beginning * of the section so we begin them at 0. */ /* DWARF 1 */ .debug .line 0 : { *(.debug) } 0 : { *(.line) } Listing 3-1 Linker script for the Blinky example application (AT91SAM7S64 MCU). 3-3 Listing 3-1 section from ROM to RAM. (18) corresponds to the LMA in ROM and is needed by the startup code to copy the symbol corresponds to the VMA of the .fastcode section and is needed by the (. 3-4, (38) The following sections are for the debugger only and are never loaded to the target. end, and end are used to set up the beginning of the heap, if the heap is used. Coming Up Next: In the next part I’ll describe the C and C++ compiler options as well as how to minimize the overhead of C++ using the GNU toolchain. Stay tuned. [3-1] [3-2] GNU Linker (ld) HTML documentation included in the CodeSourcery Toolchain for ARM,. [3-3] In this part I describe the C and C++ compiler options that allow freely mixing ARM and Thumb code, as well as supporting fine-granularity code sections for functions. The code accompanying this article is available online at. 4.1 Compiler Options for C The compiler options for C are defined in the Makefile located in the c_blinky subdirectory. The Makefile specifies different options for building debug and release configurations and allows compiling to ARM or Thumb on the module-by-module basis. ARM_CPU = arm7tdmi CCFLAGS = -gdwarf-2 -c \ (1a) -mcpu=$(ARM_CPU) \ (2a) -mthumb-interwork \ (3a) -mlong-calls \ (4a) -ffunction-sections \ (5a) -O \ -Wall CCFLAGS = -c \ (1b) -mcpu=$(ARM_CPU) \ (2b) -mthumb-interwork \ (3b) -mlong-calls \ (4b) -ffunction-sections \ (5b) -O3 \ (6b) -DNDEBUG \ Listing 4-1 Compiler options used for C project, debug configuration (a) and release configuration (b). Listing 4-1 (see also Listing 3-1(21)). (5) –O chooses the optimization level. Release configuration has a higher optimization level (5b). (6) the release configuration defines the macro NDEBUG. 4.2. CPPFLAGS = -g -gdwarf-2 -c -mcpu=$(ARM_CPU) -mthumb-interwork \ -mlong-calls -ffunction-sections -O \ -fno-rtti \ -fno-exceptions \ -Wall Listing 4-2 Compiler options used for C++ project.). 4.3. #include <stdlib.h> // // for prototypes of malloc() and free() (1) void *operator new(size_t size) throw() { return malloc(size); } // (2) void operator delete(void *p) throw() { free(p); } // (3) extern "C" int aeabi_atexit(void *object, void (*destructor)(void *), void *dso_handle) { return 0; Listing 4-3 The mini_cpp.cpp module with non-throwing new and delete as well as dummy version of aeabi_atexit(). Listing 4-3(): aeabi_atexit() handles the static destructors. In a bare-metal system this function can be #include <stdlib.h> // extern "C" void *malloc(size_t) { return (void *)0; // extern "C" void free(void *) { Coming Up Next: In the next part I’ll describe the options for fine-tuning the application by selective ARM/Thumb compilation and by placing hot-spot parts of the code in RAM. Stay tuned. [4-1] [4-2] GNU Toolchain for ARM, CodeSourcery,. [4-3] [4-4] GNU X-Tools™, Microcross,. [4-5] In this part I describe the options for fine-tuning the application by selective ARM/Thumb compilation and by placing hot-spot parts of the code in RAM. I also mention the 5.1 ARM/THUMB compilation The compiler options discussed in the previous part of this article (the CCFLAGS symbol) specifically do not include the instruction set option (-marm for ARM, and –mthumb for THUMB). This option is selected individually for every module in the Makefile. For example, in the following example the module low_level_init.c is compiled to THUMB and module blinky.c is compiled to THUMB: $(BINDIR)\low_level_init.o: $(BLDDIR)\low_level_init.c $(APP_DEP) $(CC) -marm $(CCFLAGS) $(CCINC) $< $(BINDIR)\blinky.o: $(BLDDIR)\blinky.c $(APP_DEP) $(CC) -mthumb $(CCFLAGS) $(CCINC) $< 5.2 Placing the Code in RAM As mentioned in part 1 of this article, placing strategic parts of the hot-spot code in RAM can significantly improve performance and reduce power dissipation of most ARM-based MCUs. The startup code and the linker script discussed in parts 2 and 3 of this article (".text.fastcode"))) directive. The module blinky.c provides an example for the Blinky_flash() function. ((section ((section (".text.fastcode"))) void Blinky_flash(Blinky *me, uint8_t n) { Coming Up Next: The provided code examples and the discussion should provide you with a head-start on any bare-metal ARM-based project with the GNU toolchain. The second part of this article will describe ARM exceptions and interrupt handling. 5.3 References [5-1] [5-2] [5-3] [5-4] [5-5] 5-2 In this part of the article” [6-1], Philips Application Note AN10381 ”Nesting of Interrupts in the LPC2000” [6-2], and Atmel Application Note “Interrupt Management: Auto-vectoring and Prioritization” [6-3]. 6.1 function is an IRQ handler (similarly the However, these attributes are only designed for “simple” (non-nesting) interrupt handlers. This is because functions designated as interrupts do not store all of the context information (e.g., the SPSR is not saved), which is necessary for fully re-entrant interrupts [6-1]. At the same time, most ARM-based MCUs contain a prioritized interrupt controller that specifically supports nesting and prioritization of multiple interrupt sources. This powerful hardware feature cannot be used, however, unless the software is actually capable of handling nested interrupts. ((interrupt ("IRQ"))) to indicate that the specified C/C++ ((interrupt ("FIQ"))) is provided for FIQ handlers). 6.2 [6-1, 6-2, 6-3, 6 [6 6-1 General interrupt handling strategy with the interrupt controller Figure 6-1 article ( article 6-1,. 6-2 In the presence of an interrupt controller, the sequence is a bit more involved (see again Figure 6 6-1. 6-1). The ARM_irq() assembler “wrapper” restores the context from the SYSTEM stack, performs the mode switch back to IRQ and performs the standard return from exception via the MOVS pc,lr instruction. 6.3 6-2. is safe to use in the FIQ C-level handler function. The accompanying code for this article includes the example of the FIQ coded directly in BSP_fiq() handler function. 6.4 No Auto-Vectoring It’s perhaps important to note that the interrupt handling strategy presented here does not use the auto-vectoring feature described in the application notes [6-2 and 6 the next part of this article I’ll describe the interrupt locking policy for ARM that would be safe for both IRQ and FIQ interrupts as well as the task level code (the code called from main()). I’ll explain the details of the low-level interrupt handlers in Part 8. Stay tuned. 6.5 References [6-1] [6-2] Philips Application Note AN10381 “Nesting of Interrupts in the LPC2000” available online at [6-3] Atmel Application Note “Interrupt Management: Auto-vectoring and Prioritization” available online at?” [7-1], and Atmel Application Note “Disabling Interrupts at Processor Level” [7-2]. 7 article),. 7.2¬exp/glast/flight/sw/vxdocs/vxworks/ref/- intArchLib.html#intLock ) The following code snippet shows how you use this type of critical section: void your_function() { ARM_INT_KEY_TYPE int_lock_key; . ARM_INT_LOCK(int_lock_key); /* enter the critical section */ . ARM_INT_UNLOCK(int_lock_key); /* leave the critical section */ /* access the shared resource */ . .. 7.3 Critical Section Implementation with GNU gcc The macros ARM_INT_KEY_TYPE, ARM_INT_LOCK(), and ARM_INT_UNLOCK() are defined in the arm_exc.h header file provided in the code accompanying this article and shown in Listing 7-1 (1) #define ARM_INT_KEY_TYPE (2) #ifdef thumb int #define ARM_INT_LOCK(key_) ((key_) = ARM_int_lock_SYS()) #define ARM_INT_UNLOCK(key_) (ARM_int_unlock_SYS(key_)) ARM_INT_KEY_TYPE ARM_int_lock_SYS(void); void ARM_int_unlock_SYS(ARM_INT_KEY_TYPE key); (7) #else do { \ asm("MRS %0,cpsr" : "=r" (key_)); \ asm("MSR cpsr_c,#(0x1F | 0x80 | 0x40)"); \ } while (0) #define ARM_INT_UNLOCK(key_) asm("MSR cpsr_c,%0" : : "r" (key_)) #endif Listing 7-1 Implementation of the critical for ARM with GNU gcc). when it is invoked with the -mthumb compiler option to 7. while (0) compound statement to guarantee article). (12) The macro ARM_INT_UNLOCK() restores the CPSR from the interrupt lock key argument (key_) passed to the macro. Again, the most efficient store-immediate version of the MRS instruction is used, which does not clobber any additional registers. 7.4 Discussion of the Critical Section Implementation Various application notes available online (e.g., [7-1, 7-2]) provide more elaborate implementations of interrupt locking and unlocking for ARM. In particular they use read-modify-write to the CPSR rather than load-immediate to CPSR. In this section I discuss how the simple critical section implementation shown in Listing 7-1 [7-3]): • R14_irq • SPSR_irq = CPSR • CPSR[4:0] = 0b10010 (enter IRQ mode) • CPSR[7] • = address of next instruction to be executed + 4 = 1, NOTE: CPSR[6] is unchanged PC = 0x00000018 The ARM Technical Note “What happens if an interrupt occurs as it is being disabled?” [7 [7-1] is more applicable to this article and relates to the situation when both IRQ and FIQ are disabled simultaneously, which is actually the case in the implementation of the critical section (see Listing 7 (part 8) of this article. For completeness, this discussion should mention the Atmel Application Note “Disabling Interrupts at Processor Level” [7-2], which describes another potential problem that might occur when the IRQ or FIQ interrupt is recognized exactly at the time that it is being disabled. The problem addressed in the Atmel Application Note [7 [7-2]. Coming Up Next: In the next part of this article I’ll describe the interrupt “wrapper” functions ARM_irq and ARM_fiq in assembly (the ARM_irq and ARM_fiq functions have been introduced in Part 6). Stay tuned. [7-1] ARM Technical Support Note “What happens if an interrupt occurs as it is being disabled?”, available online at [7-2] Atmel Application Note “Disabling Interrupts at Processor Level”, available online at [7-3] Seal, David, editor, “ARM Architecture Reference Manual Second Edition”, Addison Wesley, 2000. In this part I describe the low-level interrupt wrapper functions ARM_irq() and ARM_fiq(). These functions have been introduced in part 6 of this article series, and their purpose is to allow handling of nested interrupts in the ARM architecture, which the GNU gcc Perhaps the most interesting aspect of the implementation that I present here is its close compatibility with the new ARM v7-M architecture (e.g., Cortex-M3) [8) [8-4]. In fact, the interrupt wrapper functions generate in software the exact same interrupt stack frame (SPSR, PC, LR, R12, R3, R2, R1, R0) as the ARM v7-M processors generate in hardware [8-4]. I should perhaps note right away that the ARM interrupt handling implementation described here goes off the beaten path established by the traditional approaches [8-1, 8-2, 8-3, 8-5]. Most published implementations recommend initializing the ARM vector table to use the “auto-vectoring” feature of the interrupt controller (see part 6 of this article series). Consequently the ISRs that you hook to the interrupt controller require very special entry and exit sequences, so they cannot be regular C-functions. Also, the interrupt handlers execute in IRQ or FIQ mode and use the IRQ and FIQ stacks (at least for some portion of the saved context). Consequently the stack frames as well as stack usage in the traditional implementations are quite different compared to ARM v7-M. ((interrupt ("IRQ"))) cannot do. 8.1 The IRQ Interrupt Wrapper ARM_irq The interrupt “wrapper” function ARM_irq() for handling the IRQ-type interrupts is provided in the file arm_exc.s included in the code accompanying this article series. Listing 8-1 shows the entire function. .equ NO_IRQ, 0x80 /* mask to disable IRQ */ NO_FIQ, 0x40 /* mask to disable FIQ */ NO_INT, (NO_IRQ | NO_FIQ) /*mask to disable IRQ and FIQ */ FIQ_MODE, 0x11 IRQ_MODE, 0x12 SYS_MODE, 0x1F (1) .code 32 (2) .section .text.fastcode ARM_irq: /* IRQ entry {{{ */ r13,r0 /* save r0 in r13_IRQ */ SUB r0,lr,#4 /* put return address in r0_SYS */ /* save r1 in r14_IRQ (lr) */ MRS r1,spsr /* put the SPSR in r1_SYS */ cpsr_c,#(SYS_MODE | NO_IRQ) /* SYSTEM mode, no IRQ/FIQ enabled! */ STMFD sp!,{r0,r1} /* save SPSR and PC on SYS stack */ sp!,{r2-r3,r12,lr} /* save AAPCS-clobbered regs on SYS stack */ r0,sp /* make the sp_SYS visible to IRQ mode */ sp,sp,#(2*4) /* make room for stacking (r0_SYS, r1_SYS) */ cpsr_c,#(IRQ_MODE | NO_IRQ) /* IRQ mode, IRQ/FIQ disabled */ r0!,{r13,r14} /* finish saving the context (r0_SYS,r1_SYS)*/ cpsr_c,#(SYS_MODE | NO_IRQ) /* SYSTEM mode, IRQ disabled */ /* IRQ entry }}} */ /* NOTE: BSP_irq might re-enable IRQ interrupts (the FIQ is enabled * already), if IRQs are prioritized by an interrupt controller. */ r12,=BSP_irq /* copy the return address to link register */ /* call the C IRQ-handler (ARM/THUMB) */ /* IRQ exit {{{ */ cpsr_c,#(SYS_MODE | NO_INT) /* SYSTEM mode, IRQ/FIQ disabled */ /* make sp_SYS visible to IRQ mode */ ADD sp,sp,#(8*4) /* fake unstacking 8 registers from sp_SYS */ cpsr_c,#(IRQ_MODE | NO_INT) /* IRQ mode, both IRQ/FIQ disabled */ sp,r0 /* copy sp_SYS to sp_IRQ */ r0,[sp,#(7*4)] /* load the saved SPSR from the stack */ Muito mais do que documentos Descubra tudo o que o Scribd tem a oferecer, incluindo livros e audiolivros de grandes editoras.Cancele quando quiser.
https://pt.scribd.com/document/37173859/Building-Bare-metal-ARM-With-GNU
CC-MAIN-2020-05
refinedweb
4,477
54.63
if you want your left column a fixed width, why are you using paneLayout then? if you want two columns side by side use a formLayout or evan a simple rowLayout… :nathaN if you want your left column a fixed width, why are you using paneLayout then? if you want two columns side by side use a formLayout or evan a simple rowLayout… :nathaN I was using a paneLayout because it was the only layout type that I could successfully attach the texture editor to (a scriptedPanel with the pane layout as parent). I’m trying now with the rowLayout but it just will not show. Edit: Not having any luck with formLayout either. What am I doing wrong? First I detach any existing texture editors, before creating the UI elements. [b] uvTextureViews = cmds.getPanel(scriptType=‘polyTexturePlacementPanel’) if len(uvTextureViews):cmds.scriptedPanel(uvTextureViews[0], e=True, unParent=True) [/b]form = cmds.formLayout(nd=2) texturePanel = mc.scriptedPanel(uvTextureViews[0]) column = cmds.columnLayout (‘MainColumn’, columnWidth=220) #A bunch of UI stuff loaded into this column# cmds.setParent(’…’) [b]cmds.formLayout(form,edit=True, attachForm=[(column,‘left’,0),(texturePanel,‘left’,220)]) [/b]But all I get is: I am a real newbie when it comes to mel and stuff. What I want is to attach a custom toolbar to uv texture editor window’s bottom. How can I do that? For that matter, I can’t figure out how to attach anything to anything. This is how I would do it. If anyone else has more advice or a better way to do it, I'd love to know! But this should at least get you started in the right direction: // With Texture editor open, this captures the main frame layout into a variable $texFrame = `frameLayout -q -p textureEditorToolbarFrameLayout`; // That variable will contain a long name separated by pipes, "|" // We need to extract the right layout from that long name, so we'll 'tokenize' it, // which means separating it based on a certain string // We need to made make string array to put the separated $texFrame into string $buffer[]; // In case you run this more than once, we'll clear that array clear($buffer); // Tokenize it. The first intput in tokenize is the input string, // the second is what we'll separate it with. the pipe '|' is a special character, // so we need to escape it with '\'. Look up regular expressions to learn more on that. // The third is the array that we put the separated strings into. // Tokenize returns an int number of items that were separated, so we capture that with $numT $numT = tokenize($texFrame, "\|", $buffer); // So now we want to get the children from the formLayout that we separated // Since the string we want (which is the formLayout) is the last in the array, we get it with: // [$numT - 1]. Since $numT is the number of items separated, we subtract one since it's 0 based $texChildren = `formLayout -query -childArray $buffer[$numT - 1]`; // We'll make a button and attach it to the form layout $testButton = `button -p $buffer[$numT - 1] testBtn`; // Now we need to edit the formLayout to attach the button // Look up formLayout to learn more on how you can attach it in different ways. formLayout -e -attachForm $testButton "left" 0 -attachForm $testButton "right" 0 -attachControl $testButton "top" 0 $texChildren[1] -attachForm $testButton "bottom" 0 -attachForm $texChildren[1] "left" 0 -attachForm $texChildren[1] "right" 0 -attachControl $texChildren[1] "top" 0 $texChildren[0] -attachPosition $texChildren[1] "bottom" 0 90 $buffer[$numT - 1]; Obviously you’d eventually want to attach some layout instead of just a button, but that should hopefully give you some ideas. Attempting to change basic maya UI again. We are now starting to use Maya 2012 in our department as a standard. Since I can't stand the color scheme OR much any of the other ones I know about I use a command to change the color of the main UI. window -e -bgc .79 .79 .79 $gMainWindow; But..... This never sticks… it always resets on the next start. Where can I modify this color as the default? There is no setting for it in the plain color preferences, though there should be, and I can’t seem to find its entry anywhere. Is there a MEL file I can edit to get this color to stay? I mean, how does the "E:\Program Files\Autodesk\Maya2012\bin\maya.exe" -style windowsxp command specific “-style whatever” get its information from? I want to edit that. Mainly because I want also to get rid of the HORRIBLE contrast they have in any of the UI choices. The default is too dark with no contrast and the other options have these glaring white boxes which need to be fixed. As well as the timeline slider. default using above style. yuck… just like every other option. A little better then the dark UI. But those damn bright white boxes… ARG! Seriously. Who ever put these UI color schemes together needs to go back to design school and learn basic color theory. Using gmainwindow command with photoshop to get desired look. AH… easy like sunday mornin on the mind. Seriously though, money might exchange hands if you can give me the solution. Because I am lamenting using the new QT daily due to these horrible color schemes. Since I am being forced I am trying to save what is left of my eyes as a last ditch effort. The grey allows both black and white to be read easily. Its a mid tone grey so it wont leave white blocks in your eyes OR like the dark UI leave much to be desired with no contrast for reading the text easily, especially in the outliner, script editor, etc. May not be to others liking but my eyes would thank you… right click VIEW IMAGE to see full size. if you want window -e -bgc .79 .79 .79 $gMainWindow; to be executed on each Maya start put it into a userSetup.mel located in the userScriptDir internalVar -usd; He’s also wondering about how to change the background color in the outliner if I understood him and I’m also curious about that. Thanks for the tip. Gah, sometimes the easiest solution is overlooked. At the moment. I have found a few more commands to force change colors. Adrian Graham sits next to me at DD. He is one of the original UI developers/programmers from the Alias days. You may have watched a tutorial DVD of his at one time or another on particle fx and dynamics and what not. He is looking at a way to tweak it. But, it (outliner bg color and other misc) may very well need to be tweaked in QT designer. He’s checking it out now. How can one parent a hudButton with a global procedure? It seems I have to make all my strings global for it to work otherwise it cannot find it. quick question about keeping windows open when loading a new file. I apologise in advance if this question has already been asked, Ive spent so long searching for an answer. I’ve created a window that I want to remain open when I load in a new scene, The window that I’ve created has a button that runs a command whereby it saves the current scene as a new version, runs a fix cache script then re-opens the scene. yet on re-open all my windows disappear. what seems to confuse me the most is I’ve been using this tool for a few days now and it wasnt deleting any windows on re-open yet now it does. I’ve considered including in my command the addition of a scriptNode so it re-loads the window yet I’m sure there is an easier answer any suggestions are greatly appreciated Hmm, well I figured out that if your window -e -bgc .x .x .x $gMainWindow; ....is .5 .5 .5 or lower the bg color will be the dark gray. If its .51 .51 .51 or higher it will be pure white. I suppose the color at .5 .5 .5 is a little better but the outliner and script editor still need tweaking with being too dark or too bright. I made the hidden text back to the old blue but slightly brighter because the dark grey is just ridiculous, couldn't tell what was hidden or not in some cases. Also the gold icons are strange. I was trying to figure out how to edit the mesh icons back to the old blue colors. Plus... some of the hypershade icons are worse too. The spot info node took me a bit to spot. I tried to do 2012 today at work.... but after I noticed my face getting closer and closer to the screen slowly over the course of 20 minutes I pulled back and just exported the scene to 2009 again. In Linux flavor ... as ugly as the old 2009 interface is to some people I prefer the mid range gray look and view ports. Maybe in 2013 they will give us better control over it all. :arteest: Don't meant to be bitchy, but as soon as I went back to 2009 the speed was there, the eye strain was gone and little things like switching between the channelbox and attribute editor wasn't weird /buggy everytime. Marking menus were instant.. etc etc. I love maya the best out of all the apps. Oh does everyone else have to resize the hypershade everytime they open it? The area with the shader choices is taking up too much space. I always have to size up the work area and size down the shader list. —edit---- Just realized that Softimage is probably the other big factor here. Since I had used that for a long time I was used to its midrange gray UI. Which is really great all around. Black and white texts are easily readable. Oh yeah. Feature request… IF Maya has an unchangable UI color theme make it so its closer to Softimage’s colors. Which is without a doubt the best one so far of any app. Right now I am using .5 .5 .5 and its not a bad compromise… might make due. Hello, I’d like to know, if anyone has found any way to build custom UI-controls. Basically all I need is a canvas-control where I can draw with c++ API. Also is there any way to query/get the top and left coordinates of ui-controls placed on formLayout and -attachPosition command in MEL? -Pauli So I’ve been battling with this UI last night and couldn’t get it to look as I want. I want the radio button to keep it’s position centered in the columnlayout which is then parented to a formlayout. I obviusly got the label flag to behave correctly, but not the radiobutton itself. I just can’t seem to get it under control. The idea is to have 8 radio buttons in a row and be able to scale the window and have the radiobuttons follow. This is what I have now This is what I want and this is the global proc newWin(){ if (`window -q -ex autoRigWin`) { deleteUI autoRigWin; } window -w 230 -h 60 -t "New Win" autoRigWin; string $Form = `formLayout`; string $formBtm = `formLayout`; setParent $Form; string $formTop = `formLayout`; string $form1 = `formLayout`; string $col = `columnLayout -adj 1`; string $btn1 = `radioButtonGrp -adj 1 -cw 1 20 -cal 1 "center" -numberOfRadioButtons 1 -label "cm "`; //string $btn1 = `button -l "1"`; setParent $col; setParent $form1; setParent $formTop; string $form2 = `formLayout`; string $btn2 = `button -l "2"`; setParent $form2; setParent $formTop; setParent $Form; string $tab = `tabLayout`; //TAB1 SPINE string $masterForm = `formLayout`; string $topForm = `formLayout`; setParent $masterForm; setParent $tab; //TAB2 ARM string $masterForm2 = `formLayout`; string $topForm2 = `formLayout`; setParent $masterForm2; setParent $tab; //TAB3 LEG string $masterForm3 = `formLayout`; string $topForm3 = `formLayout`; setParent $masterForm3; setParent $tab; //TAB4 TENTACLE/TAIL string $masterForm4 = `formLayout`; string $topForm4 = `formLayout`; setParent $masterForm4; setParent $tab; //TAB5 EXTRAS string $masterForm5 = `formLayout`; string $topForm5 = `formLayout`; setParent $masterForm5; setParent $tab; //TAB6 SAVE/LOAD LAYOUTS string $masterForm6 = `formLayout`; string $topForm6 = `formLayout`; setParent $masterForm6; setParent $tab; //TAB HELP string $helpForm = `formLayout`; string $helpField = `scrollField -text "some help text.. or whatever"`; setParent $helpForm; setParent $tab; tabLayout -e -tli 1 "Spine/Neck" -tli 2 "Arm" -tli 3 "Leg" -tli 4 "Tail/Tentacle" -tli 5 "Extras" -tli 6 "Save/Load Layout" -tli 7 "Help" $tab; int $rowHeight = 25; int $border = 5; setParent $Form; string $b1dBtn = `button -l ("Build") -bgc 0 0.9 0 -c "build"`; setParent $Form; formLayout -e //-ac $tab "top" 10 $topCol -ap $tab "top" 0 20 -af $tab "left" 0 -af $tab "right" 0 -ap $tab "bottom" 0 90 $Form; //FORMLAYOUT formLayout -e -ac $b1dBtn "top" 0 $tab -af $b1dBtn "left" 0 -af $b1dBtn "right" 0 -af $b1dBtn "bottom" 0 $Form; //FORMLAYOUT formLayout -e -af $formBtm "top" 0 -af $formBtm "left" 0 -af $formBtm "right" 0 -ap $formBtm "bottom" 0 95 $Form; //FORMLAYOUT formLayout -e -ap $formTop "top" 0 10 -af $formTop "left" 0 -af $formTop "right" 0 -ac $formTop "bottom" 0 $tab $Form; //FORMLAYOUT formLayout -e -af $form1 "top" 0 -af $form1 "left" 0 -ap $form1 "right" 0 50 -af $form1 "bottom" 0 $formTop; //FORMLAYOUT formLayout -e -af $form2 "top" 0 -ap $form2 "left" 0 50 -af $form2 "right" 0 -af $form2 "bottom" 0 $formTop; //Button1 formLayout -e -af $col "top" 0 -af $col "left" 0 -af $col "right" 0 -af $col "bottom" 0 $form1; //Button2 formLayout -e -af $btn2 "top" 0 -af $btn2 "left" 0 -af $btn2 "right" 0 -af $btn2 "bottom" 0 $form2; //SPINE TAB LAYOUT formLayout -e -af $topForm "top" 0 -af $topForm "left" 0 -af $topForm "right" 0 $masterForm; //ARM TAB LAYOUT formLayout -e -af $topForm2 "top" 0 -af $topForm2 "left" 0 -af $topForm2 "right" 0 $masterForm2; //LEG TAB LAYOUT formLayout -e -af $topForm3 "top" 0 -af $topForm3 "left" 0 -af $topForm3 "right" 0 $masterForm3; //TAIL TAB LAYOUT formLayout -e -af $topForm4 "top" 0 -af $topForm4 "left" 0 -af $topForm4 "right" 0 $masterForm4; //EXTRAS TAB LAYOUT formLayout -e -af $topForm5 "top" 0 -af $topForm5 "left" 0 -af $topForm5 "right" 0 $masterForm5; //LAYOUT TAB formLayout -e -af $topForm6 "top" 0 -af $topForm6 "left" 0 -af $topForm6 "right" 0 $masterForm6; //HELP TAB formLayout -e -af $helpField "top" 0 -af $helpField "left" 0 -af $helpField "right" 0 -af $helpField "bottom" 0 $helpForm; window -e -w 585 -h 175 -topEdge -80 -leftEdge 10 autoRigWin; showWindow autoRigWin; } I have a problem with the command projFileViewer.I don’t Know if it’s a maya 2012 bug but the example of maya help doesn’t work, anybody else has the same problem? this is the example of maya help: import maya.cmds as cmds cmds.window( ‘ProjWindow’, rtf=0, wh=(150, 150) ) cmds.paneLayout( ‘ProjPanes’ ) cmds.projFileViewer( ‘ProjFileView’, dm=0 ) cmds.paneLayout( ‘ProjPanes’, e=True, cn=‘single’, sp=(‘ProjFileView’, 1) ) cmds.projFileViewer( ‘ProjFileView’, e=True, fr=True ) cmds.showWindow() thanks in advance I have a very old question about Maya UI Is there anyway to insert a background picture into Maya Window? Anything would help. Thanks Hey Dude! Of course, but then you must use a form layout and put it in. In prior versions of maya like up to 8 or so(please correct me if I’m wrong) html was implemented so you could create more dynamic and nicer looking UI:s, but it was scrapped before I had time to try it out(Don’t understand why either) However as per the implementation of QT the feature is back. This is what I’ve understood anyway, haven’t tested it yet myself. Is this info correct? Anyway. here’s some links to mel UI:s using formlayouts to add a background image @Geuse I also think there is no direct way to insert a BG pic into an UI window Thanks for the information What do you mean? In a MEL UI you can attach it to a formlayout following the links I posted. It’s the most simple and direct way =) Perhaps I threw you off rambling on about QT and html implementation hence that’s a way to create nicer looking UI:s, but using MEL with the formlayout would be what you’re looking for. Good luck! @Geuse: Sorry man, i’m new to MEL script so maybe my post not make any sense. However your post very useful and it gave me the result i want. Thanks again Edit: I have one more question. I try to create FacialGUI. Like this The Area box in the middle look like a slider but i can’t find any command to create it.
http://forums.cgsociety.org/t/mel-maya-ui-building/664014?page=17
CC-MAIN-2022-40
refinedweb
2,793
68.81
Versions used - Rails(5.2+) - Google Maps API (v3) In this tutorial, I’ll be teaching you how to strictly integrate a static google map into your rails project. I will also show you how to change the color of the marker and how to add more if need be. This tutorial will assume you have some previous background information on rails. Don’t worry, this is still a very basic beginner level tutorial and not complicated at all. Examples used in this tutorial will be from my mod 2 project at Flatiron School that uses Ruby 2.6.1 and Rails 6.0 (a basic setup that wasn't generated with scaffold). Step 1: Set up You will need to create a rails project. To get started, In your terminal, you will input: rails new “your_project_name" After creating your new rails project you now will need to generate some models, controllers, and views. This part is all up to you on how those files will be generated. I personally used: rails g resource ExampleName again this is solely dependent on you. Make sure you have these columns in your table: t.float “latitude” t.float “longitude” t.string “address” Step 2: Geocode Gem We will not explicitly define what latitude and longitude is (unless you want to) because the geocode gem will do that for us. Geocode will take your address and turn it into latitude and longitude coordinates and google will take that information and display a map of those coordinates. In your terminal run: gem install 'geocoder’ or in your gem file include: gem ‘geocoder’ now you will need to: bundle install After successfully installing the geocode gem you will then need to go to your model that has the address/latitude/longitude columns and insert: geocoded_by :address after_validation :geocode, if: :address_changed? - (the if conditional will run the geocode if the address has changed as there is no point in running the gem if the address is the same.) Step 4: Obtaining Google API You will now need to obtain your own Google API key to be able to use the map. This is not as hard as it may seem. Please read on how to do so here! A couple of tips while doing this: - Make sure to add an active billing account (don't worry unless you get 25,000+ visits to your website you will not be charged. Google also gives you credit towards your account.) - Only request Static Maps API as you won't need anything else. - Restrict your API to only be used on a certain website page. If someone gets ahold of your API they will not be able to use it on any other website. Step 5: Custome Credentials(optional but not really) The reason this is “optional but not really” is because you don't have to hide/secure your API key to run a map but if you don't anyone can inspect your website HTML and see/copy your Google API. Skip this step if you don't want to make a custom credential for your Google API. In your terminal inside your rails project insert: rails credentials:edit Quick note: If your text editor is not set to default or you just want to open this up into a specific text editor you will need to run: EDITOR="name_of_editor --wait" rails credentials:edit This line of code will tell your editor to wait before closing the file you need to add your credentials to. If you run the first code that doesn't include the wait command and the file that opens up is blank, you will need to run the wait command. You should see that a “credentials.yml.enc” file and a “master.key” file should have generated if you didn't have one already and the file you will need to edit. Insert the master key into your “.gitignore” file so you don’t push your master.key to GitHub(rails does this automatically but to be safe). Like I said before, if this file is blank then you need to tell your editor to wait. Delete the “credentials.yml.enc” and “master.key” file and start this step over. Now we will add our Google API by inserting name_you_choose: "your_api_key" Make sure to save and close this file after inserting your credentials. To see if this worked you can run this command in your rails console(rails c). Rails.application.credentials.name_you_chose This should return your API key. If you get nil then either the file your edited wasn't saved/closed or you edited the blank page(maybe other issues as well). Vist this rails doc for more information on custom credentials. Step 6: Methods Assuming you’ve done everything correctly we will now need to add our method to our model file(or anywhere you want that its ability to be called on appropriately). Insert this code: def google_map(center)"{center}&size=500x500&zoom=17&key=#{Rails.application.credentials.name_you_chose}"end - Notice, the end of the code is interpolating your API key. Do not forget to insert the name you made for your API key inside of your custom credential. The above code snippet assumes you followed the custom credential step but if you did not; insert this code instead: def google_map(center)"{center}&size=500x500&zoom=17&key=[YOUR_API_KEY]"end - You can manipulate the size of the Map itself or the zoom inside of the map as well by changing those factors inside of the URL. With this done, you will now go to the view file that you’d like the Static Google Map to appear and insert: image_tag google(center: model_name.address) or image_tag google(center: [model_name.latitude, model_name.longitude].join(',')) You should now see your static map appear in your browser! Step 7: Markers In the google_map(center) method you will want to add a marker directly into the Google Map URL. - “size:” manipulates the size of the marker. - “color:” manipulates the color of the marker. - “label:” manipulates the label of the marker. - “%7C” Pipe symbol: separates each property from one another. markers=size:small%7Ccolor:red%7Clabel:C%7C You will add this snippet after the “/staticmap?” and before “center=”. "?--><--center=#{center}&size=500x500&zoom=17&key=[YOUR_API_KEY]" - arrows inside URL represent where to add the markers snippet; do not include arrows. Conclusion: Integrating a Google Map API to your rails project is not as hard as it seemed before actually doing so. I tried to be as transparent as possible so you can avoid making the same simple mistakes I made; the internet lacks simple direct solutions to most of the issues I ran into. Below will be linked to other articles and videos that helped me through my issues.
https://brodrick-george.medium.com/how-to-integrate-a-google-static-map-api-in-your-rails-project-80be28b99e0c?source=post_internal_links---------7----------------------------
CC-MAIN-2021-21
refinedweb
1,136
63.59
@Embeddable questionMihai Anescu May 21, 2007 9:16 AM Hi, We're trying to use an @Embeddable class in our project. It's a seam generated project, but we keep our entities and modify the views as needed. So, we have a ABC @Embeddable class which has one field private String name; And this class is embedded into another, XYZ. On the interface i have a field: <s:decorate <ui:define<h:outputText</ui:define> <h:inputText <a:support </h:inputText> </s:decorate> The page renders ok, but when i try to edit/add an entity and put some value into this field I get a validation error: value could not be converted to the expected type No error shows up in the log, even on debug mode. I browsed the forum and found somewhere something about needing a converter for this entity. I also found some examples on how to build a custom JSF converter. So, my questions are: 1) is there a doc on how to do custom converters on seam (what needs to be configured and so on) 2) If my ABC class has 5 fields, all rendered on the page of the owing entity (XYZ) as separate fields, do I need 5 converters, one for each field???? Tnx, I wait for your reply... 1. Re: @Embeddable questionFernando Montaño May 21, 2007 9:30 AM (in response to Mihai Anescu) Have you declared the ABC as follows?: public class XYZ { ... private ABC abc = new ABC(); ... getters/setters } In this case "abc" should be referenced in the view, not ABC. HTH. 2. Re: @Embeddable questionMihai Anescu May 21, 2007 9:39 AM (in response to Mihai Anescu) Yes, I just tried and the same problem. i also tried this one: I manually inserted the value into the DB (in xyz_abc_name field), so this one works like this, after that i deleted the value from the field and updated, all works ok. Is possible I need to set not null value on the field in the constructor??? 3. Re: @Embeddable questionMihai Anescu May 21, 2007 9:51 AM (in response to Mihai Anescu) Correction: It works to insert a new entity XYZ. But i have a script which inserts some rows into xyz tables without the xyz_abc_name field. If i select one of these entities and want to update the abc.name field to something then i get a validation error. Anybody any idea how to solve this one? 4. Re: @Embeddable questionFernando Montaño May 21, 2007 9:52 AM (in response to Mihai Anescu) I make a mistake in my last post, the code shoul be: public class XYZ { ... @Embedded private ABC abc = new ABC(); ... getters/setters } And your ABC must have @Embeddable at type level. do you have it in this way? 5. Re: @Embeddable questionMihai Anescu May 21, 2007 9:58 AM (in response to Mihai Anescu) Yes, i have them both. Earlier i had only the @Embeddable on class ABC, but i saw the @Embedded annotation in another post and used it. So the insert works, but the update of some already inserted entities does not.
https://developer.jboss.org/thread/136131
CC-MAIN-2018-13
refinedweb
521
69.62
#ifndef _calendar_all_ #define _calendar_all_ #include "/usr/share/calendar/calendar.world" #include "/usr/share/calendar/calendar.usholiday" #endif /* !_calendar_all_ */ calendar -l 0 -w 0 -f calendar.all --- -Bob --------------------- I tend to think of [Mac] OS X as Linux with QA and Taste. -James Gosling, Java Architect [ Reply to This | # ] The problem with this method is that it assumes you want to look forward the same amount in every calendar. This is not true (for me). I like to look two weeks ahead in the file that has birthdays. Then I look 7 days ahead in several other personal calendars. In the canned files I only look at today. So your solution, while cool, isn't the one I prefer. --- --Chip Visit other IDG sites:
http://hints.macworld.com/comment.php?mode=view&cid=74775
CC-MAIN-2014-42
refinedweb
123
61.02
Using Firebug for scraping¶ Note Google Directory, the example website used in this guide is no longer available as it has been shut down by Google. The concepts in this guide are still valid though. If you want to update this guide to use a new (working) site, your contribution will be more than welcome!. See Contributing to Scrapy for information on how to do so. Introduction¶ This document explains how to use Firebug (a Firefox add-on) to make the scraping process easier and more fun. For other useful Firefox add-ons see Useful Firefox add-ons for scraping. There are some caveats with using Firefox add-ons to inspect pages, see Caveats with inspecting the live browser DOM. In this example, we’ll show how to use Firebug to scrape data from the Google Directory, which contains the same data as the Open Directory Project used in the tutorial but with a different face. Firebug comes with a very useful feature called Inspect Element which allows you to inspect the HTML code of the different page elements just by hovering your mouse over them. Otherwise you would have to search for the tags manually through the HTML body which can be a very tedious task. In the following screenshot you can see the Inspect Element tool in action. At first sight, we can see that the directory is divided in categories, which are also divided in subcategories. However, it seems that there are more subcategories than the ones being shown in this page, so we’ll keep looking: As expected, the subcategories contain links to other subcategories, and also links to actual websites, which is the purpose of the directory. Getting links to follow¶ By looking at the category URLs we can see they share a pattern: Once we know that, we are able to construct a regular expression to follow those links. For example, the following one: directory\.google\.com/[A-Z][a-zA-Z_/]+$ So, based on that regular expression we can create the first crawling rule: Rule(LinkExtractor(allow='directory.google.com/[A-Z][a-zA-Z_/]+$', ), 'parse_category', follow=True, ), The Rule object instructs CrawlSpider based spiders how to follow the category links. parse_category will be a method of the spider which will process and extract data from those pages. This is how the spider would look so far: from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule class GoogleDirectorySpider(CrawlSpider): name = 'directory.google.com' allowed_domains = ['directory.google.com'] start_urls = [''] rules = ( Rule(LinkExtractor(allow='directory\.google\.com/[A-Z][a-zA-Z_/]+$'), 'parse_category', follow=True, ), ) def parse_category(self, response): # write the category page data extraction code here pass Extracting the data¶ Now we’re going to write the code to extract data from those pages. With the help of Firebug, we’ll take a look at some page containing links to websites (say) and find out how we can extract those links using Selectors. We’ll also use the Scrapy shell to test those XPath’s and make sure they work as we expect. As you can see, the page markup is not very descriptive: the elements don’t contain id, class or any attribute that clearly identifies them, so we’ll use the ranking bars as a reference point to select the data to extract when we construct our XPaths. After using FireBug, we can see that each link is inside a td tag, which is itself inside a tr tag that also contains the link’s ranking bar (in another td). So we can select the ranking bar, then find its parent (the tr), and then finally, the link’s td (which contains the data we want to scrape). This results in the following XPath: //td[descendant::a[contains(@href, "#pagerank")]]/following-sibling::td//a It’s important to use the Scrapy shell to test these complex XPath expressions and make sure they work as expected. Basically, that expression will look for the ranking bar’s td element, and then select any td element who has a descendant a element whose href attribute contains the string #pagerank“ Of course, this is not the only XPath, and maybe not the simpler one to select that data. Another approach could be, for example, to find any font tags that have that grey colour of the links, Finally, we can write our parse_category() method: def parse_category(self, response): # The path to website links in directory page links = response.xpath('//td[descendant::a[contains(@href, "#pagerank")]]/following-sibling::td/font') for link in links: item = DirectoryItem() item['name'] = link.xpath('a/text()').extract() item['url'] = link.xpath('a/@href').extract() item['description'] = link.xpath('font[2]/text()').extract() yield item Be aware that you may find some elements which appear in Firebug but not in the original HTML, such as the typical case of <tbody> elements. or tags which Therefer in page HTML sources may on Firebug inspects the live DOM
http://doc.scrapy.org/en/1.2/topics/firebug.html
CC-MAIN-2019-39
refinedweb
826
51.28
Theme fragments for plone.app.theming Project description Diazo Rules may operate on content that is fetched from somewhere other than the current page being rendered by Plone, by using the href attribute to specify a path of a resource relative to the root of the Plone site: <!-- Pull in extra navigation from a browser view on the Plone site root --> <after css: modules Fragment modules are Restricted Python Script modules bundled with your themes. Availability of methods is limited to specific fragment by naming the module after the fragment base name (with .py extension). Each module could contain any number Python function definitions, which are then made available as instance methods of the fragment view. For example, you could create a file fragments/customnav.py in your theme directory, containing: def getnav(self):> Fragment methods Note Fragment methods preceded fragment modules and support for them may be removed in the future.). Fragments as views Fragments can also be used as content views, by setting the layout-attribute of a content object to ++themefragent++name where name is the name of the fragment. Currently fragments cannot be configured to be visible in the display menu. Note: Fragments are only available for the currently active theme. When using fragments in your content this way, make sure the theme is enabled!.11.1 (2017-10-30) - Fix issue where themefragment tile was unable to render head tiles with &_mode=head query parameter as expected [datakurre] 2.11 (2017-10-18) - Add ‘macros’ accessor for fragment view to make fragment view template macros accessible and usable e.g. in classic portlets [datakurre] 2.10.2 (2017-09-24) - Fix issue where theming was disabled for frament views [datakurre] 2.10.1 (2017-09-13) - Fix issue where tile id and url were not accessible from tile fragment templates [datakurre] 2.10.0 (2017-08-28) - Add ++themefragment++name -traverser to allow direct use of themefragments as views [datakurre] - Add fragment Python module support for fragment tile [datakurre] 2.9.0 (2017-08-28) - Add support for fragment Python modules (as PEP8 compatible single file replacement for fragment methods support in previous versions) [datakurre] - Change to make templates owned by their creator instead to inherit owner from their rendered context [datakurre] 2.8.0 (2017-08-21) - Add traversable @@output_relative_to helper for RichTextValue object to support rendering rich text field values in restricted templates [datakurre] 2.7.1 (2017-06-13) - Fix issue where fragment tile URL did not include selected fragment itself [datakurre] 2.7.0 (2017-06-09) - Fix issue where add form was unable to use fragment name from request [datakurre] - Fix to filter comments beginning with ‘#’ when reading tile titles [datakurre] - Remove incomplete support for persistent annotation storage for theme fragment tiles [datakurre] 2.6.1 (2017-04-19) - Fix to read fragment name from tile data before selecting cache rule [datakurre] 2.6.0 (2017-04-19) - Change fragment tile to prefer persistent configuratio over query string configuration when choosing the configured fragment [datakurre]. 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/collective.themefragments/
CC-MAIN-2019-04
refinedweb
532
52.09
Some aspects of Java that work perfectly well are misconstrued by some contributors to this list. Having every Object synchronizable is not a bad thing. For example, if you need to synchronize access to a particular ArrayList, it makes a lot of sense to make _it_ the Object we synchonize on. Anyone who doesn't like this doen't need to use it: use a global object for instance...yes, Java has global objects, they are public static fields: public class SyncKeeper { public static Object s_objSync = new Object(); } // ... synchronize (SyncKeeper.s_objSync) { // ... } Or, for the loonies: public class SyncKeeper { private static Object s_objSync = new Object (); public static Object sync() { return s_objSync; } } synchronize (SyncKeeper.sync()) { // ... } What is important: - class path, class path, class path: as someone else pointed out, a system-wide registry would be helpful. Generally, the class path issue is thorny but with directed effort, e.g. a JSR, a good solution could be found (anyone who thinks that the class path is not a problem, hasn't done much Java development). - make Java more accessible by providing 'cushioned environments' for development. Customers that use my software tool find the mechanics of Java difficult so in version 2 I moved the entire tool to Eclipse and I take care of issues such as the class path by calling into the Eclipse API in the background, result: the tool is much easier to use. - Don't waste time with trivia..
http://archive.oreilly.com/cs/user/view/cs_msg/23336
CC-MAIN-2018-13
refinedweb
239
60.45
Using .NET 4.x in Unity C# and .NET, the technologies underlying Unity scripting, have continued to receive updates since Microsoft originally released them in 2002. But Unity developers may not be aware of the steady stream of new features added to the C# language and .NET Framework. That's because before Unity 2017.1, Unity has been using a .NET 3.5 equivalent scripting runtime, missing years of updates. With the release of Unity 2017.1, Unity introduced an experimental version of its scripting runtime upgraded to a .NET 4.6, C# 6 compatible version. In Unity 2018.1, the .NET 4.x equivalent runtime is no longer considered experimental, while the older .NET 3.5 equivalent runtime is now considered to be the legacy version. And with the release of Unity 2018.3, Unity is projecting to make the upgraded scripting runtime the default selection, and to update even further to C# 7. For more information and the latest updates on this roadmap, read Unity's blog post or visit their Experimental Scripting Previews forum. In the meantime, check out the sections below to learn more about the new features available now with the .NET 4.x scripting runtime. Prerequisites - Unity 2017.1 or above (2018.2 recommended) - Visual Studio 2017 Enabling the .NET 4.x scripting runtime in Unity To enable the .NET 4.x scripting runtime, take the following steps: Open PlayerSettings in the Unity Inspector by selecting Edit > Project Settings > Player. Under the Configuration heading, click the Scripting Runtime Version dropdown and select .NET 4.x Equivalent. You will be prompted to restart Unity. Choosing between .NET 4.x and .NET Standard 2.0 profiles Once you've switched to the .NET 4.x equivalent scripting runtime, you can specify the Api Compatibility Level using the dropdown menu in the PlayerSettings (Edit > Project Settings > Player). There are two options: .NET Standard 2.0. This profile matches the .NET Standard 2.0 profile published by the .NET Foundation. Unity recommends .NET Standard 2.0 for new projects. It's smaller than .NET 4.x, which is advantageous for size-constrained platforms. Additionally, Unity has committed to supporting this profile across all platforms that Unity supports. .NET 4.x. This profile provides access to the latest .NET 4 API. It includes all of the code available in the .NET Framework class libraries and supports .NET Standard 2.0 profiles as well. Use the .NET 4.x profile if your project requires part of the API not included in the .NET Standard 2.0 profile. However, some parts of this API may not be supported on all of Unity's platforms. You can read more about these options in Unity's blog post. Adding assembly references when using the .NET 4.x Api Compatibility Level When using the .NET Standard 2.0 setting in the Api Compatibility Level dropdown, all assemblies in the API profile are referenced and usable. However, when using the larger .NET 4.x profile, some of the assemblies that Unity ships with aren't referenced by default. To use these APIs, you must manually add an assembly reference. You can view the assemblies Unity ships with in the MonoBleedingEdge/lib/mono directory of your Unity editor installation: For example, if you're using the .NET 4.x profile and want to use HttpClient, you must add an assembly reference for System.Net.Http.dll. Without it, the compiler will complain that you're missing an assembly reference: Visual Studio regenerates .csproj and .sln files for Unity projects each time they're opened. As a result, you cannot add assembly references directly in Visual Studio because they'll be lost upon reopening the project. Instead, a special text file named mcs.rsp must be used: Create a new text file named mcs.rsp in your Unity project's root Assets directory. On the first line in the empty text file, enter: -r:System.Net.Http.dlland then save the file. You can replace "System.Net.Http.dll" with any included assembly that might be missing a reference. Restart the Unity editor. Taking advantage of .NET compatibility In addition to new C# syntax and language features, the .NET 4.x scripting runtime gives Unity users access to a huge library of .NET packages that are incompatible with the legacy .NET 3.5 scripting runtime. Add packages from NuGet to a Unity project NuGet is the package manager for .NET. NuGet is integrated into Visual Studio. However, Unity projects require a special process to add NuGet packages. This is because when you open a project in Unity, its Visual Studio project files are regenerated, undoing necessary configurations. To add a package from NuGet to your Unity project do the following: Browse NuGet to locate a compatible package you'd like to add (.NET Standard 2.0 or .NET 4.x). This example will demonstrate adding Json.NET, a popular package for working with JSON, to a .NET Standard 2.0 project. Click the Download button: Locate the downloaded file and change the extension from .nupkg to .zip. Within the zip file, navigate to the lib/netstandard2.0 directory and copy the Newtonsoft.Json.dll file. In your Unity project's root Assets folder, create a new folder named Plugins. Plugins is a special folder name in Unity. See the Unity documentation for more information. Paste the Newtonsoft.Json.dll file into your Unity project's Plugins directory. Create a file named link.xml in your Unity project's Assets directory and add the following XML. This will ensure Unity's bytecode stripping process does not remove necessary data when exporting to an IL2CPP platform. While this step is specific to this library, you may run into problems with other libraries that use Reflection in similar ways. For more information, please see Unity's docs on this topic. <linker> <assembly fullname="System.Core"> <type fullname="System.Linq.Expressions.Interpreter.LightLambda" preserve="all" /> </assembly> </linker> With everything in place, you can now use the Json.NET package. using Newtonsoft.Json; using UnityEngine; public class JSONTest : MonoBehaviour { class Enemy { public string Name { get; set; } public int AttackDamage { get; set; } public int MaxHealth { get; set; } } private void Start() { string json = @"{ 'Name': 'Ninja', 'AttackDamage': '40' }"; var enemy = JsonConvert.DeserializeObject<Enemy>(json); Debug.Log($"{enemy.Name} deals {enemy.AttackDamage} damage."); // Output: // Ninja deals 40 damage. } } This is a simple example of using a library which has no dependencies. When NuGet packages rely on other NuGet packages, you would need to download these dependencies manually and add them to the project in the same way. New syntax and language features Using the updated scripting runtime gives Unity developers access to C# 6 and a host of new language features and syntax. Auto-property initializers In Unity's .NET 3.5 scripting runtime, the auto-property syntax makes it easy to quickly define uninitialized properties, but initialization has to happen elsewhere in your script. Now with the .NET 4.x runtime, it's possible to initialize auto-properties in the same line: // .NET 3.5 public int Health { get; set; } // Health has to be initialized somewhere else, like Start() // .NET 4.x public int Health { get; set; } = 100; String interpolation With the older .NET 3.5 runtime, string concatenation required awkward syntax. Now with the .NET 4.x runtime, the $ string interpolation feature allows expressions to be inserted into strings in a more direct and readable syntax: // .NET 3.5 Debug.Log(String.Format("Player health: {0}", Health)); // or Debug.Log("Player health: " + Health); // .NET 4.x Debug.Log($"Player health: {Health}"); Expression-bodied members With the newer C# syntax available in the .NET 4.x runtime, lambda expressions can replace the body of functions to make them more succinct: // .NET 3.5 private int TakeDamage(int amount) { return Health -= amount; } // .NET 4.x private int TakeDamage(int amount) => Health -= amount; You can also use expression-bodied members in read-only properties: // .NET 4.x public string PlayerHealthUiText => $"Player health: {Health}"; Task-based Asynchronous Pattern (TAP) Asynchronous programming allows time consuming operations to take place without causing your application to become unresponsive. This functionality also allows your code to wait for time consuming operations to finish before continuing with code that depends on the results of these operations. For example, you could wait for a file to load or a network operation to complete. In Unity, asynchronous programming is typically accomplished with coroutines. However, since C# 5, the preferred method of asynchronous programming in .NET development has been the Task-based Asynchronous Pattern (TAP) using the async and await keywords with System.Threading.Task. In summary, in an async function you can await a task's completion without blocking the rest of your application from updating: // Unity coroutine using UnityEngine; public class UnityCoroutineExample : MonoBehaviour { private void Start() { StartCoroutine(WaitOneSecond()); DoMoreStuff(); // This executes without waiting for WaitOneSecond } private IEnumerator WaitOneSecond() { yield return new WaitForSeconds(1.0f); Debug.Log("Finished waiting."); } } // .NET 4.x async-await using UnityEngine; using System.Threading.Tasks; public class AsyncAwaitExample : MonoBehaviour { private async void Start() { Debug.Log("Wait."); await WaitOneSecondAsync(); DoMoreStuff(); // Will not execute until WaitOneSecond has completed } private async Task WaitOneSecondAsync() { await Task.Delay(TimeSpan.FromSeconds(1)); Debug.Log("Finished waiting."); } } TAP is a complex subject, with Unity-specific nuances developers should consider. As a result, TAP isn't a universal replacement for coroutines in Unity; however, it is another tool to leverage. The scope of this feature is beyond this article, but some general best practices and tips are provided below. Getting started reference for TAP with Unity These tips can help you get started with TAP in Unity: - Asynchronous functions intended to be awaited should have the return type Taskor Task<TResult>. - Asynchronous functions that return a task should have the suffix "Async" appended to their names. The "Async" suffix helps indicate that a function should always be awaited. - Only use the async voidreturn type for functions that fire off async functions from traditional synchronous code. Such functions cannot themselves be awaited and shouldn't have the "Async" suffix in their names. - Unity uses the UnitySynchronizationContext to ensure async functions run on the main thread by default. The Unity API isn't accessible outside of the main thread. - It's possible to run tasks on background threads with methods like Task.Runand Task.ConfigureAwait(false). This technique is useful for offloading expensive operations from the main thread to enhance performance. However, using background threads can lead to problems that are difficult to debug, such as race conditions. - The Unity API isn't accessible outside the main thread. - Tasks that use threads aren't supported on Unity WebGL builds. Differences between coroutines and TAP There are some important differences between coroutines and TAP / async-await: - Coroutines cannot return values, but Task<TResult>can. - You cannot put a yieldin a try-catch statement, making error handling difficult with coroutines. However, try-catch works with TAP. - Unity's coroutine feature isn't available in classes that don't derive from MonoBehaviour. TAP is great for asynchronous programming in such classes. - At this point, Unity doesn't suggest TAP as a wholesale replacement of coroutines. Profiling is the only way to know the specific results of one approach versus the other for any given project. Note As of Unity 2018.2, debugging async methods with break points isn't fully supported; however, this functionality is expected in Unity 2018.3. nameof operator The nameof operator gets the string name of a variable, type, or member. Some cases where nameof comes in handy are logging errors, and getting the string name of an enum: // Get the string name of an enum: enum Difficulty {Easy, Medium, Hard}; private void Start() { Debug.Log(nameof(Difficulty.Easy)); RecordHighScore("John"); // Output: // Easy // playerName } // Validate parameter: private void RecordHighScore(string playerName) { Debug.Log(nameof(playerName)); if (playerName == null) throw new ArgumentNullException(nameof(playerName)); } Caller info attributes Caller info attributes provide information about the caller of a method. You must provide a default value for each parameter you want to use with a Caller Info attribute: private void Start () { ShowCallerInfo("Something happened."); } public void ShowCallerInfo(string message, [System.Runtime.CompilerServices.CallerMemberName] string memberName = "", [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0) { Debug.Log($"message: {message}"); Debug.Log($"member name: {memberName}"); Debug.Log($"source file path: {sourceFilePath}"); Debug.Log($"source line number: {sourceLineNumber}"); } // Output: // Something happened // member name: Start // source file path: D:\Documents\unity-scripting-upgrade\Unity Project\Assets\CallerInfoTest.cs // source line number: 10 Using static Using static allows you to use static functions without typing its class name. With using static, you can save space and time if you need to use several static functions from the same class: // .NET 3.5 using UnityEngine; public class Example : MonoBehaviour { private void Start () { Debug.Log(Mathf.RoundToInt(Mathf.PI)); // Output: // 3 } } // .NET 4.x using UnityEngine; using static UnityEngine.Mathf; public class UsingStaticExample: MonoBehaviour { private void Start () { Debug.Log(RoundToInt(PI)); // Output: // 3 } } IL2CPP Considerations When exporting your game to platforms like iOS, Unity will use its IL2CPP engine to "transpile" IL to C++ code which is then compiled using the native compiler of the target platform. In this scenario, there are several .NET features which are not supported, such as parts of Reflection, and usage of the dynamic keyword. While you can control using these features in your own code, you may run into problems using 3rd party DLLs and SDKs which were not written with Unity and IL2CPP in mind. For more information on this topic, please see the Scripting Restrictions docs on Unity's site. Additionally, as mentioned in the Json.NET example above, Unity will attempt to strip out unused code during the IL2CPP export process. While this typically isn't an issue, with libraries that use Reflection, it can accidentally strip out properties or methods that will be called at runtime that can't be determined at export time. To fix these issues, add a link.xml file to your project which contains a list of assemblies and namespaces to not run the stripping process against. For full details, please see Unity's docs on bytecode stripping. .NET 4.x Sample Unity Project The sample contains examples of several .NET 4.x features. You can download the project or view the source code on GitHub. Additional resources Feedback Send feedback about:
https://docs.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017
CC-MAIN-2019-18
refinedweb
2,401
51.04
Template talk:KeyDescription Contents - 1 Proposed reuse for Machine-readable Map Feature list - 2 Proposed new arguments - 3 Proposed changed arguments - 4 Proposed expansion of the template - 5 Transition - 6 Add a Proposal link - 7 Proposal - parameter - replaces - 8 Proposal - value interpretation - 9 Clean-up/Translation out of Sync - 10 Overpass Turbo link - 11 Stale links - 12 Proposed seeAlso - 13 Proposed removal of onRelation - 14 Is the group still useful? - 15 native_value and native_key parameters - 16 Reimplementation of KeyDescription and ValueDescription templates - 17 Website and URL pattern - 18 Redirect undone - 19 How about 'pattern' or 'regex_pattern' ? - 20 Proposal "appliesTo" - 21 Documented values - 22 Deprecation of parameter "seeAlso" - 23 Implemented "requires" section - 24 Removing parameter "lang=" - 25 Edits since January 2015, consider reversion - 26 "May Be Used On Areas" + "Should Not Be Used On Relations" -> What About Multipolygons? - 27 Has any real progress been made toward normalising the tag system? - 28 Wikidata Proposed reuse for Machine-readable Map Feature list There is a group working on a Machine-readable Map Feature list. In order to automatically harvest information about keys (which we call tag-defs) from the Wiki, this template should be slightly modified. —Preceding unsigned comment added by Gubaer (talk • contribs) 19:23, 21 December 2008 Proposed new arguments - displayName (optional): a display name for the key in the language given by lang. Will be used by interactive applications for drop-down lists, menu entries, etc. - onRelation (optional): whether this key can be used on relations either yes (default) or no - status (optional): the status of this key in it's life-cycle (similar to status in the template Template:ValueDescription). Either proposed, rejected, accepted (default) or deprecated. —Preceding unsigned comment added by Gubaer (talk • contribs) 19:32, 21 December 2008 - Apparently onRelation is already present. I would also like to see a status argument, and would add it to the template, if nobody opposes. MHohmann (talk) 08:43, 16 February 2014 (UTC) Proposed changed arguments - groups (optional): a comma separated list of groups this key belongs to. Groups should be declared with a new template Template:GroupRef. Example: groups={{GroupRef|name=naming|lang=en}}, {{GroupRef|name=non-physical|lang=en}}—Preceding unsigned comment added by Gubaer (talk • contribs) 19:29, 21 December 2008 - Google definition: Perhaps use Wikipedia, instead of Google? —Preceding unsigned comment added by Acrosscanadatrails (talk • contribs) 13:12, 3 February 2009 Proposed expansion of the template The expansion of the template should include a reference to the category <lang>:Category:Keys. Example: [[Category:en:Keys]]—Preceding unsigned comment added by Gubaer (talk • contribs) 19:40, 21 December 2008 Transition New and changed arguments are optional. They shouldn't brake existing uses of the template. Neither does the declaration of a category. We therefore suggest - update the template - adjust wiki pages (add arguments for the new parameters) step by step —Preceding unsigned comment added by Gubaer (talk • contribs) 19:40, 21 December 2008 Add a Proposal link Hi, would it be a good idea to add a backlink to the proposal of a feature? Sometimes it is a very detailed help and gives further informations for usage, even on start of the feature --!i! 10:44, 17 August 2010 (BST) Proposal - parameter - replaces It might be useful to include a parameter which inidicates whether a key replaces another key; this would decrease the incidence of using "obsolete" keys. Example, see Key:power_output, which refers to Key:power_rating . . . which in turn redirects to Key:generator:output. --Ceyockey 13:17, 24 November 2010 (UTC) - well, i saw your comment by chance (actually by using "What links here") when reorganising some power keys ... sorry for destroying your example ;-) (I won't change the links here, though) -- Schusch 23:38, 24 November 2010 (UTC) Proposal - value interpretation I think it would be really useful if the description also included information about the scale type and the default unit of the value. This would simplify automatic conversion of values (e.g. for people who prefer inches and feet instead of cm and m). Examples (I think that's the easiest to explain what I suggest): Therefore valid scales could be 'number', 'count', 'link', 'text' (maybe we should distinguish between texts which "can" be translated like "name" and those which can't? are there any?), 'list' (for keys like highway, amenity, landuse, ...), 'date', etc. What do you think? -- Skunk 15:36, 17 October 2011 (BST) Clean-up/Translation out of Sync - the templates in the different languages are different, e.g. english, german, netherlands, portuguese - the "available languages" show different languages dependent on the language one choses, e.g.: - english template shows 13 languages but no German one (polish template similar) - french template shows 5 languages and exists a second time with no other languages: french - netherlands template shows no other languages (german template similar) As a Newbie (at least regarding templates) I don't feel able doing anything to make these things clear and homogeneous --Rennhenn 15:13, 23 December 2012 (UTC) - By putting the template in those categories, you put all pages that use the template in those categories too. Since only the template itself needs cleanup, that's obviously not right. --Cartinus 18:32, 23 December 2012 (UTC) - All pages should have a working language bar now. German shows up as untranslated, because the language bar expects "DE" (like all the key pages themselves have), but the template has "De". If you rename the template, you have to edit all the key pages too, so I'll leave that for someone in Germany. --Cartinus 18:32, 23 December 2012 (UTC) Overpass Turbo link I don't think the recent addition of the Overpass Turbo link to the template is a good decision. Even though that site is a lot more accessible than the plain Overpass API, it is still suited for advanced users only - for others, any Overpass query IDE is necessarily confusing. But perhaps more importantly, its inclusion here is redundant because there is already a link to overpass turbo on all Taginfo pages, along with links to XAPI, JOSM, and many other statistics that are not directly linked from the infobox. So I don't see a reason to give special prominence to the Overpass Turbo link when Taginfo already neatly collects all the relevant resources. --Tordanik 18:23, 26 February 2013 (UTC) - This was initially suggested by Zuse at Talk:Overpass_turbo and added shortly after. I can see that this link shouldn't get as much prominence as taginfo for example. But, I still think there should be some room for this, too. (The wiki is not for beginners only and the link on taginfo may not be known by everyone; the way via taginfo also adds one unnecessary page load.) - After the few layout iterations, I think we have found a good solution for this now: the new "tools" section. - --Tyr (talk) 23:48, 2 March 2013 (UTC) Stale links Combinations worldwide (tagstat.hypercube.telascience.org/tagdetails.php) seems to be dead. Is this a permanent situation? If so, should we remove the link? Mmd (talk) 13:14, 23 March 2013 (UTC) - I guess it's really dead, but I'm not sure. The Tagstat page doesn't say anything about the current situation. Maybe we should simply email User:Petschge and ask. --Tordanik 20:49, 23 March 2013 (UTC) - TagStat still seem to be dead. I've removed it now. Also Tagwatch is discontinued, see[1]. I've commented out both links and added one to taginfo. The Tagwatch page does list some other useful pages. Not sure if any of those should be linked.--Salix alba (talk) 05:40, 8 March 2014 (UTC) - Good call on removing the inactive services. However, the new Taginfo link doesn't add any value because it's the same one already available in the Taginfo box. It might be more helpful to link to some of the regional versions of Taginfo instead, thus compensating for the removed regional tagwatch links. I'm not sure which ones to pick, though. --Tordanik 06:56, 8 March 2014 (UTC) Proposed seeAlso Hi, I would like to add seeAlso to this template, same as seeAlso in ValueDescription. Sometimes it could be handy. Any objections? Chrabros (talk) 03:34, 9 March 2014 (UTC) Proposed removal of onRelation Hi, I would like to propose the removal of onRelation= As it seems this icon has not really clear definition and causes a confusion. See the discussion here Talk:Key:building#onRelation.3F. The short summary of views is: - if the tag is used on Area then it could be used on relation:multipolygon and therefore it is onRelation=yes - onRelation=yes should be used ONLY for tags suitable/designed for relations (boundary=*,route=*,..). It should not be set just because of relation:multipolygon. Which is odd as just below is a taginfo window indicating that the tag is used on relation in many cases. - there are really no tags which can be used only on relation. Therefore the icon onRelation is useless anyway. See relation:multilinestring. So I am proposing to remove it. Or maybe if someone know the definition then please write it here so we have one clear definition to use. Chrabros (talk) 04:46, 9 March 2014 (UTC) - No matter whether we go with your opinion or mine, there are still cases where onRelation would be set to yes. So I don't see why we would want to remove it. Providing a clear definition is a good idea, but because of the recent discussion I fear the two of us will not be able to agree on one. I would be interested in other people's opinions on the topic, though. - For those who didn't follow the discussion: My point of view is that: - onArea=yes means that the tag can be used on areas, modelled with a single closed way or as a multipolygon - if a tag can only be used on areas, then use - onWay=no, to distinguish it from tags that can also be used on linear ways - onRelation=no, to distinguish it from tags that can also be used on other relations than multipolygons - --Tordanik 17:01, 9 March 2014 (UTC) - I do not see why we could not reach an agreement. The previous debate might be little bit too hot but this was partly to my mistakes while not keeping up with two separate threads. Sorry for that. I have learned that you are nice person since then. ;-) - Anyway. We could change the popup "Used on areas" to either "Used on areas (incl. multipolygon)" and similarly "Used on relations (excl. multipolygon)". And document it somewhere clearly as well. Chrabros (talk) 02:45, 10 March 2014 (UTC) - Thanks for the compliment. ;-) I fully support your suggested change. At the same time, I would suggest to point the link behind the area icon to Area. The current link target section no longer exists, and the Area page fits the icon's meaning well. --Tordanik 16:49, 13 March 2014 (UTC) - I have added links to Template:ValueDescription just now. They lead to Node,Way,Way#Closed Way,Way#Area and Relation. It seems to me more consistent than to point to Elements for Node, Way and relation and then to Area.What do you think? Chrabros (talk) 02:53, 14 March 2014 (UTC) - I would have linked area to Area, which is called the "main article" even at your link target and is consistent with Node, Way and Relation. I also think the closed way icon is pointless, but it was not you who added it, so that's a topic for a separate discussion. --Tordanik 16:39, 15 March 2014 (UTC) - PS: Due to unrelated reasons, I've just edited ValueDescription, and as a small additional change in the same edit I've changed the area link to Area. But I want to make it clear to you that you can still give objections and change it back, I didn't intend to work around this discussion. --Tordanik 17:25, 15 March 2014 (UTC) Is the group still useful? Now Tagwatch has gone, can the group parameter go with it or is there someone else who uses it? --Andrew (talk) 14:22, 9 March 2014 (UTC) - I like Group. And I think we can make it better by adding a clickable link to the wiki page of the Group. Something like Up in the wiki structure. Clicking Group Annotation would lead do Annotations etc. What do you think? Chrabros (talk) 02:45, 10 March 2014 (UTC) - No one is protesting. I will try to change it. Maybe you will like it. Chrabros (talk) 03:49, 14 March 2014 (UTC) - I'm not necessarily opposed to this, but I think that distributing documentation across too many different pages increases the risk of duplication, contradictions and outdated pages, and also makes it hard to find what you are looking for. There are some cases where a page about a larger concept in addition to the individual Key/Tag pages makes sense, but the "Annotations" example shows that not all groups of tags are that way. Deleting the Annotations page and changing all links to Map features#Annotation wouldn't lose one bit of useful information. --Tordanik 16:31, 15 March 2014 (UTC) I think,would be better to link group name to category. --Władysław Komorek (talk) 09:15, 14 March 2014 (UTC) - That is a nice idea. What I do not like about it tough is that category lists all tags translations as well. Don't you think that it is a little bit mess there? Also the Feature page I am linking usually has some additional explanatory text which might be handy. Chrabros (talk) 07:10, 15 March 2014 (UTC) - Category is the "gold mine" when looking for additional information. This link is better than the "See also". Category also includes the Feature page. - All translation pages should be grouped separately, as I did with "Pl" --Władysław Komorek (talk) 19:31, 15 March 2014 (UTC) - Yep, I like your categories. I am trying to do the same in Czech Documentation category. But I am a lone Czech translator so it is slooooow. - But the other translators do not care so the English categories pages are in mess. - Also there are many tags falling in two or more categories, whereas Group is just one. So it makes sense to me to have link to a Group in the box where is just one space. Links to Categories are at the bottom after all. No? Chrabros (talk) 02:36, 16 March 2014 (UTC) native_value and native_key parameters Transferred to Template talk:ValueDescription#native_value and native_key parameters --Władysław Komorek (talk) 15:52, 16 March 2014 (UTC) Reimplementation of KeyDescription and ValueDescription templates I have substantially overhauled the {{KeyDescription}} and {{ValueDescription}} templates, with the new versions at User:Moresby/KeyDescription and User:Moresby/ValueDescription. I am looking for comments on this discussion page and would value any constructive contributions. Thanks. Moresby (talk) 18:57, 30 March 2014 (UTC) Website and URL pattern I've just added two parameters, |website= and |url_pattern=, for keys which relate to a specific website. You can see them in use on Key:openplaques_plaque, but the labels are not displaying properly. Can someone help, please? Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 13:29, 1 April 2014 (UTC) - I've fixed what you were trying to do - there's a really painful interaction between template parsing and whitespace, which is where {{If}}comes in, and additional entries were needed in {{DescriptionLang}}- but I have a feeling that there's going to be some different views as to whether it's a good change. On one hand, there's not going to be many keys which have a website/database dedicated to them, I guess, which suggests the information should go on the description page, rather than the description box. Thereagain, it's a pattern which could be applied to other keys, giving a standard way to capture the way of tying a value to a URL. I'll leave it to others to comment. Moresby (talk) 17:25, 1 April 2014 (UTC) - You asked for a comment. My thought process went as such: (1) Neat idea, (2) but this would only be needed for a few keys so perhaps just put it in the page's general text, (3) on second thoughts having it in the template allows data users to get at the data more easily. In conclusion, I'm in support of Andy's changes. For a bit more context see this mailing list post: Btw thanks Moresby for all your recent work on the template. --RobJN (talk) 19:20, 1 April 2014 (UTC) - Putting it into a separate template would still allow automatic extraction, though? In the main infobox, it feels like too much of a niche entry to me, since all the other entries are really core facts. After all, URL patterns are probably not really interesting for most readers. --Tordanik 15:24, 2 April 2014 (UTC) - Providing general readers with the originating website (surely a core fact) and URL pattern helps them to source the data. That's a good thing, right? Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 16:01, 2 April 2014 (UTC) - From the perspective of a general reader, the originating website is already clearly visible from the introduction text, typically in the first sentence. As for the URL patterns, I think a textual "how to map" description is more helpful than some regular expression. Also note that for some tags, e.g. wikipedia and wikidata, the value is obtained more easily by copying the page title rather than manipulating the URL. - In the spirit of compromise, though, how about stating "External reference" somewhere in the infobox (perhaps in the Group Section? it is definitely a tag classifiction), with a "show details" like the current tools list? --Tordanik 19:18, 2 April 2014 (UTC) - I do not like adding these parameters as they are too specific to be included here. Chrabros (talk) 00:36, 3 April 2014 (UTC) - Agree with above. --Władysław Komorek (talk) 07:14, 3 April 2014 (UTC) - Thank you for fixing the template(s). This information definitely needs to be in a template, so that it is machine parsable. I favour putting it in the infobox, not least so that people can see whether or not a key includes a value that is intended to be looked up online. It could perhaps go nearer the bottom of the infobox, if the current position is too prominent. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 15:52, 2 April 2014 (UTC) Redirect undone I've undone the recent redirect if this template to a user-space version, since that did not seem to have been kept in sync with recent developments here, such as the URL and URL pattern attributes and tracking category. See above section. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 23:04, 17 April 2014 (UTC) - These additional attributes appear to be controversial, however, and there has been no new input for the past two weeks. Allowing for this template standardization to happen is another reason to bring that discussion to a conclusion. --Tordanik 00:56, 18 April 2014 (UTC) - I prefer Moresby's template (for English tags) over URL and URL pattern. So I believe that it would be better to keep Moresby's template and try to convince him to add these to his templates instead of reverting. Chrabros (talk) 06:45, 18 April 2014 (UTC) - Thanks Andy, Tordanik and Chrabros. I don't really want to take one side or the other in the "should these elements go into the description box" discussion, so I've put the functionality into the new boxes simply to match the current template. If there's a consensus to leave it in or take it out, I or someone else can make any necessary changes. That done, I've put the redirect back again. Moresby (talk) 15:41, 18 April 2014 (UTC) - That's great, thank you. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 16:30, 18 April 2014 (UTC) - I don't think you can avoid taking sides by effectively adding these fields to dozens of templates that didn't have them before. Regardless, it appears we need to have that discussion again at User_talk:Moresby/Description#Website_and_URL_pattern. --Tordanik 20:13, 18 April 2014 (UTC) - You're right - there's no way to take neither side completely, if I'm going to continue to take this work forwards. Given the options, this looked like the path of least resistance: this affects only two pages at this point, Key:openplaques_plaque and Key:openplaques:id, and the remaining hundreds of pages look just the same as they would have been without this addition. I've said that if there's a consensus, I'll happily implement it; also, if anyone wants to have an edit war, go ahead, just please don't break the templates in the process. I just don't want an as-yet-unsettled difference of views to stall a bigger task. Moresby (talk) 20:43, 18 April 2014 (UTC) Website & url_pattern, redux What are the substantive objections to these parameters? A prose description as suggested above, will not be machine readable. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 21:20, 18 April 2014 (UTC) - Machine readability can be achieved even if this is not included in the infobox, and I never meanted to argue against a machine-readable solution either. Therefore, the focus on the discussion should be on whether and how to present this information to a human audience. - Keeping this in mind, I think that including these facts in the infobox is just not helpful enough to the typical reader to justify four more lines. Furthermore, such rarely used parameters would cause the infoboxes on different pages to look very different, reducing visual consistency. Finally, I believe that people without technical background might not easily understand the "url pattern", so even leaving space concerns aside, the inclusion could create confusion rather than being helpful. - One way to address these problems would be to reduce the space this information takes up, e.g. by using my suggestion above (integration into group section) to limit the additional number of lines to 1, and keep the more technical data somewhat hidden. If we cannot agree on a solution along these lines, then I don't see a good alternative to an entirely separate template displayed towards the bottom of the page. --Tordanik 22:46, 18 April 2014 (UTC) - I agree with Tordanik. Chrabros (talk) 03:42, 19 April 2014 (UTC) - I also agree with Tordanik. This feature is too rarely used to justify adding complexity to this template (which is used pretty much everywhere). Creating another template for url_pattern and related features would not only keep it machine readable, it would make it even more flexible. --Jgpacker (talk) 01:03, 24 April 2014 (UTC) - There are not four new lines, but two (one for each parameter). If desired, they could be moved lower in the infobox. Infoboxes using them would not look "very different" to those not; the difference is relatively minor. We can link the "URL Pattern" label to an explanatory page. I'm not sure what you mean by "integration into group section" (please explain), but hiding data is not a good idea; it leads to people failing to enter or update it. that said, I'd like to see more people's views on this; do we have somewhere to flag up such discussions? Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 11:20, 19 April 2014 (UTC) - In your openplaques example, there are even 5 new lines (in the visual output, not the source code): "Website", the URL, "URL Pattern", the pattern (2 lines). With shorter patterns, there would still be 4 lines. - What I meant with Group integration: There is a "Group" heading in the infobox, for your openplaques example this currently contains the "Historic" classification. My suggestion would be to additionally display an "External reference" (or similar) classification if the website and/or url_pattern parameters are filled in. The url pattern and website should not be displayed normally, but should be revealed by interacting with the "external reference" label, e.g. by hovering over it or clicking on it. - If you want to get more people involved, you could try the "Wiki Team" subforum on forum.osm.org. Not many people are active there either, but it could still get a few more eyeballs onto your suggestion. --Tordanik 10:26, 20 April 2014 (UTC) - I've posted neutrally-worded pointers there and in a couple of other places. I'm going to be mostly offline for a week; let's wait and see what others think, and pick this up when I return. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 16:24, 21 April 2014 (UTC) How about 'pattern' or 'regex_pattern' ? We could add a generic pattern key, which would not be shown to normal users (because it's only useful to programs or advanced users) and would contain a regular expression to find typos and/or errors (the regular expression would be able to validate every possible good value this key could have, and trying to avoid false negatives). For example: - the key layer=* would have as patternthe regular expression ^(0|-?[1-5])$(number from -5 to 5). - The key contact:website=* would have ^(https?://)?([a-z0-9-]+\.)+[a-z]{2,4}(/.*)?$(a valid URL) (note: this regular expression doesn't support IP numbers). - The key population=* would have ^[0-9]{,10}$(integer number from zero to 9 billion). - The key width=* would have ^([0-9]*(.[0-9]+)?( ?([ck]?m|mi|ft))?|[0-9]+'([0-9]+\")?)$(quite permissive regular expression, you can test it here). - The key name=* would have [^\s]+(has a sequence of one or more non-whitespace characters). - Etc. The flavor of regular expression would be POSIX extended, which is the one used by the Overpass API (I should note that there are some small differences between in regular expressions between the Overpass XML Flavor and OverpassQL Flavor, and the one used should be the Overpass XML Flavor because it reduces some unnecessary character escaping)--Jgpacker (talk) 14:52, 3 May 2014 (UTC) - Good idea! It is right place to put in documentation (i.e. this wiki) instead of some program code. OSM data used by many users, sometimes not really involved in full stack of OSM technologies. Xxzme (talk) 03:23, 22 July 2014 (UTC) - I think we have discussed this idea previously. As long as it isn't visible in the infobox by default for normal users, I'm fine with it. I have some questions and ideas, though: - Which mechanism you would use for hiding this from normal users? Not show it at all and only have it visible in the source, or would there be some option to make it visible? - There are some value types which are used with multiple keys, e.g. length, width, and height (which are documented here. Would it be possible to prevent duplicating the regular expressions for these? - --Tordanik 16:33, 22 July 2014 (UTC) - Hi Tordanik, - I think either it wouldn't be displayed (only documented and visible in code), or a link would be added besides the overpass turbo link, adding something like <a href="overpass turbo with regexp">(with regexp)</a>. - I'm afraid it wouldn't be possible to avoid duplicating the regular expression for these keys. - --Jgpacker (talk) 14:17, 23 July 2014 (UTC) Proposal "appliesTo" Every key applies to some features. I propose to add a new parameter "appliesTo" analog "seeAlso". --Rudolf (talk) 08:06, 3 June 2014 (UTC) - AFAIK the parameter "combination" is used in a similar way. Could you elaborate further on how this parameter would work? For example, how would this parameter look on the template in the page Key:capacity ? Would it be used on pages like Tag:highway=steps ? --Jgpacker (talk) 19:08, 3 June 2014 (UTC) Documented values Hi, the new feature "Documented values" seems not to work very good. Please see leaf_type=*. When introduced this tag had 4 documented values which was OK. Then I have translated it to Czech and it reports 8 documented values now. This is little bit odd. I do not think that translations should be counted as a new values. Are you able to fix this? Chrabros (talk) 07:32, 11 June 2014 (UTC) - I also noticed this problem. I agree it can be a little confusing. --Jgpacker (talk) 20:34, 11 July 2014 (UTC) Deprecation of parameter "seeAlso" Usually the wiki page already has a "See Also" section, which tends to be more informative than what the content of the parameter "seeAlso=" could be (because it has more space to explain why other pages/tags are related). Tools like taginfo derive related tags from the tags linked on the page's content, so as far as I can see, this parameter isn't being used, and doesn't really seem useful by itself. That's why I propose we mark this parameter as deprecated on this template, so no one feels obligated to add it, unnecessarily duplicating information already shown in the page. Oh, and I only am proposing this after using this a couple of times, and seeing no benefit on this parameter. --Jgpacker (talk) 20:31, 11 July 2014 (UTC) - I quite like seeAlso section. It seems to me very easy to read and sometimes useful. I wouldn't deprecate it. Chrabros (talk) 06:58, 14 July 2014 (UTC) - I prefer the traditional "See also" section. As an infobox parameter, this can get quite large and inflates the size of the box, pushing images and similar content too far towards the bottom of the page. The "See also" section also allows adding a description to the link, which is not possible in the infobox. It's ok if people want to keep it around, but I'm not a fan. --Tordanik 19:49, 15 July 2014 (UTC) - Small section in infobox is good place to link page with other tags. Use bigger section if you need to post external links. Don't move tags is infobox. Xxzme (talk) 19:58, 15 July 2014 (UTC) - So what do we do now? Users are starting to simply copy all tags from the "See also" section on the bottom of the page into the infobox, without any explanatory text. I still believe that the seeAlso parameter shouldn't have been added. The infobox needs to be used sparingly, only showing the most important information. --Tordanik 20:21, 26 March 2015 (UTC) Implemented "requires" section Example 1: | key = crossing | required=*{{Tag|highway|crossing}} or * {{Tag|railway|crossing}} Example 2: {{KeyDescription |key=grassland |required=* {{tag|natural|grassland}} }} Xxzme (talk) 16:52, 27 July 2014 (UTC) yes, please. I'm here for this exact reason. What is the usual route for changes of this template?--Jojo4u (talk) 23:19, 24 January 2015 (UTC) would be helpful. --Tordanik 12:42, 28 January 2015 (UTC) - See also Request for namespace with machine-readable definitions Xxzme (talk) 04:16, 23 February 2015 (UTC) Implemented as 'requires=', 3 Jan 2016 Removing parameter "lang=" As far as I can understand, the parameter "lang" from this template and {{ValueDescription}} are completely unnecessary right now. The language is already automatically inferred from the page's prefix, so it doesn't need to be manually specified. Anyone against removing it from the documentation, and perhaps updating the code to simply pass the value of {{Langcode}} to {{Description}} ?--Jgpacker (talk) 19:58, 29 August 2014 (UTC) - OK, The language bar is unnecessary on the template itself due to internationalization; In this case is it technically possible to make it disappear from the top of the page "Template" without harming the internationalization function? I do not know how to do it! --Gnrc69 (talk) 15:40, 26 November 2016 (UTC) - No the language pbar is necessary and part of the generated content, because key description pages are themselves translated, and need this bar ! - This is not related at all to the internationlisation of the template itself: it just shows that a language bar will be displayed (nont autotranslated templates should place their navbar across template version in their doc page), not above the example display (which is used as a "safety" test for edits when previewing any changes in templates: we should avoid "includeonly" sections for templates, except for the generated autocategorization of pages including the template, or if the current code still has no safe mode for previewing, and tests are fully integrated in the doc page). — Verdy_p (talk) 18:36, 26 November 2016 (UTC) Edits since January 2015, consider reversion I’m proposing rolling back this and some other pages to the beginning of this year at Template talk:Description#Edits_since_January_2015.2C_consider_reversion.--Andrew (talk) 06:35, 21 May 2015 (UTC) "May Be Used On Areas" + "Should Not Be Used On Relations" -> What About Multipolygons? Considering a multipolygon relation is meant to be a stand-in for a closed way for any area-feature, I suggest modifying this template slightly. If onArea=yes but onRelation=no, currently the key description box says "should not be used on relations"; perhaps it should say "should not be used on relations (except multipolygon relations)" or "may be used on multipolygon relations". Vid the Kid (talk) 20:54, 27 February 2015 (UTC) - I'm not sure. I think this would add to the confusion. The idea is that multipolygon relations are areas. We don't say "should be used on ways (except on closed ways)" when we have the attributes onArea=no and onWay=yes. --Jgpacker (talk) 21:36, 27 February 2015 (UTC) - Perhaps it would be less confusing to change the mouseover description of the area icon to "may be used on areas (i.e. closed ways and multipolygons)"? --Tordanik 09:49, 28 February 2015 (UTC) Or maybe it should be like this: - onNode= - onWay=Yes (as in an open way) - onClosedWay= - onArea=Yes - onRelation=No - onMultilinestring= - onMultipolygon= - onParent= (also known as a Super-Relation). --EzekielT, 10:35, 17 July 2017 (UTC) Some things can only be mapped as a closed way as opposed to an open way; e.g. circular barriers. Maybe there are such examples in which a key or tag may be used on multipolygons; but not normal relations? --EzekielT, 13:14, 18 July 2017 (UTC) Has any real progress been made toward normalising the tag system? I'm having a lot of trouble trying to edit just the North American part of planet.osm. As far as I can tell, the keys seem to have been selected in an ad-hoc way. There are more than 9000 unique-ish keys, which is far more than there should be even in the worst case. A lot of the information tagged shouldn't be in a mapping database because it's (a) ephemeral or (b) irrelevant to the purpose of a vanilla map. I'm not even completely sure whether "amenity" is meant to be the key, and "restaurant" the value, or "restaurant" is the key and "amenity" is just a grouping that wasn't meant to appear in the database. They're both used as keys! And that's one of the most rational bits of adhockery. There are more than 2G lines in the chunk I'm working with, and that's clearly far more than any human being can edit by hand unless they want to make it their life's work, which I don't. But to filter it under computer control, the one who writes the filter has to understand what to keep, what to modify to make it conformant, and what to discard as irrelevant. I don't understand that yet, although Goddess knows I've tried. --Niemand (talk) 20:39, 19 July 2017 (UTC) - You will generally get more people answearing your question if you ask on the mailing lists, forum or help forum. In general bear in mind that you can discard any tag that you are not interested in if you are processing the data set for your own use and not editing OpenStreetMap.--Andrew (talk) 22:13, 19 July 2017 (UTC) - No, there isn't really any serious effort to change old tags like amenity=restaurant at the moment. It would mean quite a lot of breaking changes to data consumers, plus changing the habits of thousands of mappers. I actually agree with you that the tagging system is unnecessarily messy, but there isn't really the kind of process or mentality in place that would allow for such a far-reaching change to be adopted. For better or worse, changes to tagging conventions happen in small, incremental steps. - When writing an application consuming OSM data, the way to deal with this is to adopt a whitelist approach: Only use correctly tagged features that are relevant to your use case, ignore everything else. So don't look at all the keys in the database and try to figure out what to do with each one. Instead, learn how the objects you need are supposed to be tagged (the wiki should usually tell you that), and only ever consume that handful of keys. - And yeah, there are more people active on the lists and forums. Asking there most likely won't give you a more satisfying answer to this particular question, but it's something to keep in mind for future questions. :) --Tordanik 14:18, 21 July 2017 (UTC) Wikidata Wikidata-Links with a prefixed "P" e.g. P137 for operator=* do not lead to the desired page (P137).--geozeisig (talk) 10:48, 11 September 2017 (UTC)
https://wiki.openstreetmap.org/wiki/Template_talk:KeyDescription
CC-MAIN-2017-43
refinedweb
6,349
60.35
OpenGL Wiki - User contributions [en] 2022-06-25T10:18:39Z User contributions MediaWiki 1.35.6 OpenGL Loading Library 2015-08-31T18:08:30Z <p>Dav1d: Added glad section</p> <hr /> <div.<br /> <br /> [[Load OpenGL Functions|perform this manually]], but you are encouraged to use one of these libraries yourself.<br /> <br /> == GLEW (OpenGL Extension Wrangler) ==<br /> <br /> The [ OpenGL Extension Wrangler] library provides access to all GL entrypoints. It supports Windows, MacOS X, Linux, and FreeBSD.<br /> <br /> GLEW has a problem with core contexts. It calls {{apifunc|glGetString|(GL_EXTENSIONS)}}, which causes {{enum|GL_INVALID_ENUM}} on GL 3.2+ core context as soon as {{code|glewInit()}} is called. It also doesn't fetch the function pointers. The solution is for GLEW to use {{apifunc|glGetString|i}} instead. The current version of GLEW is 1.10.0 but they still haven't corrected it. The only fix is to use {{code|glewExperimental}} for now:<br /> <br /> <source lang="cpp"><br /> glewExperimental=TRUE;<br /> GLenum err=glewInit();<br /> if(err!=GLEW_OK)<br /> {<br /> //Problem: glewInit failed, something is seriously wrong.<br /> cout<<"glewInit failed, aborting."<<endl;<br /> }<br /> </source><br /> <br /> {{code|glewExperimental}} is a variable that is already defined by GLEW. You must set it to GL_TRUE before calling {{code|glewInit()}}.<br /> <br /> You might still get GL_INVALID_ENUM (depending on the version of GLEW you use), but at least GLEW ignores {{apifunc|glGetString|(GL_EXTENSIONS)}} and gets all function pointers.<br /> <br /> If you are creating a GL context the old way or if you are creating a backward compatible context for GL 3.2+, then you don't need glewExperimental.<br /> <br /> As with most other loaders, you should not include {{code|gl.h}}, {{code|glext.h}}, or any other gl related header file before {{code|glew.h}}, otherwise you'll get an error message that you have included {{code|gl.h}} before {{code|glew.h}}. In fact, you shouldn't be including {{code|gl.h}} at all; {{code|glew.h}} replaces it.<br /> <br /> GLEW also provides {{code|wglew.h}} which provides Windows specific GL functions (wgl functions). If you include {{code|wglext.h}} before {{code|wglew.h}}, GLEW will complain. GLEW also provides {{code|glxew.h}} for X windows systems. If you include {{code|glxext.h}} before {{code|glxew.h}}, GLEW will complain.<br /> <br /> == GL3W ==<br /> <br /> The [ GL3W] library focuses on the core profile of OpenGL 3 and 4. It only loads the core entrypoints for these OpenGL versions. It supports Windows, Mac OS X, Linux, and FreeBSD.<br /> <br /> {{note|GL3W does ''not'' load extension functions. It is for core OpenGL ''only''; you have to manually load extension functions.}}<br /> <br /> GL3W relies on Python 2.6 for its code generation. Unlike other extension loaders, GL3W actually does the code generation on your machine. This is based on downloading and parsing the {{code|glcorearb.h}} file from the OpenGL Registry website.<br /> <br /> On the one hand, this means that it is always up-to-date, more or less. On the other hand, this also makes it beholden to the format of {{code|glcorearb.h}} (which has no true format), as well as requiring that the user of GL3W have a Python 2.6 installation.<br /> <br /> GL3W is used like this:<br /> <br /> <source lang="cpp"><br /> //****Create a GL 3.x or GL 4.x core context<br /> //****Make the context current (for example, on Windows you need to call wglMakeCurrent())<br /> //****Now let's have GL3W get the GL function pointers<br /> GLint GLMajorVer, GLMinorVer;<br /> if(gl3wInit())<br /> {<br /> cout<<"GL3W failed to get GL function pointers."<<endl;<br /> return;<br /> }<br /> glGetIntegerv(GL_MAJOR_VERSION, &GLMajorVer);<br /> glGetIntegerv(GL_MINOR_VERSION, &GLMinorVer);<br /> cout<<GLMajorVer<<"."<<GLMinorVer<<endl;<br /> </source><br /> <br /> == glLoadGen (OpenGL Loader Generator) ==<br /> <br /> [ The OpenGL Loader Generator] This tool is similar to [[#GL3W {{current version}}).<br /> <br /> The GL Loader Generator is much more generalized. You can generate a header/source pair for ''any version'' of OpenGL, from 1.1 to {{current version}}..<br /> <br /> Also, unlike GL3W, it works for WGL and GLX extensions too. So you can generate headers for the platform-specific APIs.<br /> <br /> Like GL3W, the loader generator is built in a scripting language. Unlike GL3W, this tool is written in Lua, which is downloadable for a variety of platforms (and has a ''much'' smaller install package than Python, if you care about that sort of thing).<br /> <br /> The tool is fairly simple to use, and its use is specified in some detail [ on the website], with several examples.<br /> <br /> == glad (Multi-Language GL/GLES/EGL/GLX/WGL Loader-Generator) ==<br /> <br /> [ Glad] is pretty similiar to [[#glLoadGen).<br /> <br />.<br /> <br /> Glad gives you the option to also generate a very basic loader (similiar to gl3w or glxw), but it is recommended to use the loading function provided by your context creation framework, like ''glfwGetProcAddress''. Here is how it looks:<br /> <br /> <source lang="cpp"><br /> // glad, include glad *before* glfw<br /> #include <glad/glad.h><br /> // GLFW<br /> #include <GLFW/glfw3.h><br /> <br /> // ... <snip> ...<br /> <br /> int main()<br /> {<br /> // Init GLFW<br /> glfwInit();<br /> // ... <snip> ... setup a window and a context<br /> <br /> // Load all OpenGL functions using the glfw loader function<br /> // If you use SDL you can use:<br /> if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress)) {<br /> std::cout << "Failed to initialize OpenGL context" << std::endl;<br /> return -1;<br /> }<br /> // Alternative use the builtin loader, e.g. if no other loader function is available<br /> /*<br /> if (!gladLoadGL()) {<br /> std::cout << "Failed to initialize OpenGL context" << std::endl;<br /> return -1;<br /> }<br /> */<br /> <br /> // glad populates global constants after loading to indicate,<br /> // if a certain extension/version is available.<br /> printf("OpenGL %d.%d\n", GLVersion.major, GLVersion.minor);<br /> <br /> if(GLAD_GL_EXT_framebuffer_multisample) {<br /> /* GL_EXT_framebuffer_multisample is supported */ <br /> }<br /> if(GLAD_GL_VERSION_3_0) {<br /> /* We support at least OpenGL version 3 */<br /> }<br /> <br /> // ... <snip> ... more code<br /> }<br /> </source><br /> <br /> Glad is able to generate a debugging header, which allows you to hook into your OpenGL calls really easily using ''glad_set_pre_callback'' and ''glad_set_post_callback'', you can find a more detailed guide on the [ github repository].<br /> <br /> == glsdk (Unofficial OpenGL SDK) ==<br /> <br />.<br /> <br /> Here is a code example:<br /> <br /> <source lang="cpp"><br /> #include <glload/gl_3_3.h> //OpenGL version 3.3, core profile. C-style functions.<br /> #include <glload/gll.h> //The C-style loading interface.<br /> <br /> //Include headers for FreeGLUT/GLFW/other GL tools.<br /> <br /> int main(int argc, char *argv[])<br /> {<br /> //Initialize OpenGL and bind the context<br /> <br /> if(LoadFunctions() == LS_LOAD_FAILED)<br /> //exit in some way<br /> <br /> //Loading succeeded. Now use OpenGL functions.<br /> <br /> //Do OpenGL stuff.<br /> GLuint vertShader = glCreateShader(GL_VERTEX_SHADER);<br /> GLuint fragShader = glCreateShader(GL_FRAGMENT_SHADER);<br /> ...<br /> }<br /> </source><br /> <br /> GL Load even offers special headers for C++ code, that moves as much of OpenGL as possible into a namespace. The equivalent code in the C++ interface is as follows:<br /> <br /> <source lang="cpp"><br /> #include <glload/gl_3_3.hpp> //OpenGL version 3.3, core profile. C++-style functions.<br /> #include <glload/gll.hpp> //The C-style loading interface.<br /> <br /> //Include headers for FreeGLUT/GLFW/other GL tools.<br /> <br /> int main(int argc, char *argv[])<br /> {<br /> //Initialize OpenGL and bind the context<br /> <br /> if(glload::LoadFunctions() == glload::LS_LOAD_FAILED)<br /> //exit in some way<br /> <br /> //Loading succeeded. Now use OpenGL functions.<br /> <br /> //Do OpenGL stuff.<br /> GLuint vertShader = gl::CreateShader(gl::GL_VERTEX_SHADER);<br /> GLuint fragShader = gl::CreateShader(gl::GL_FRAGMENT_SHADER);<br /> ...<br /> }<br /> </source><br /> <br /> == glbinding (C++) ==<br /> <br /> [ '.<br /> <br /> Current gl code, written with a typical C binding for OpenGL is fully compatible for the use with glbinding:<br /> <br /> <source lang="cpp"><br /> #include <glbinding/gl/gl.h><br /> #include <glbinding/Binding.h><br /> <br /> using namespace gl;<br /> <br /> int main()<br /> {<br /> // create context, e.g. using GLFW, Qt, SDL, GLUT, ...<br /> <br /> glbinding::Binding::initialize();<br /> <br /> glBegin(GL_TRIANGLES);<br /> // ...<br /> glEnd();<br /> }<br /> </source><br /> <br /> ''glbinding'' also supports OpenGL feature (version) specific symbols for functions, enums, and bitfields. For example: <br /> * functions32.h provides all OpenGL commands available up to 3.2 in namespace gl32.<br /> * functions32core.h provides all non-deprecated OpenGL commands available up to 3.2 in namespace gl32core.<br /> * functions32ext.h provides all OpenGL commands specified either in 3.3 and above, or by extension in gl32ext.<br /> <br /> More details and examples can be found on the [ github project page] and [ examples wiki] respectively.<br /> <br /> == libepoxy ==<br /> <br /> [ libepoxy] requires no initialization code. The only thing you have to do is:<br /> <br /> <source lang="c"><br /> #include <epoxy/gl.h><br /> #include <epoxy/glx.h><br /> </source><br /> <br /> == GLee ==<br /> <br /> The project seems more or less defunct.<br /> <br /> While there is activity in [ the Git repository on Sourceforge], there has not been a new ''official'' version and distribution in years. The recent activity could represent a project coming back, but currently you would be better advised to look elsewhere for an OpenGL loader.<br /> <br /> [[Category:Related Toolkits & APIs]]<br /> [[Category:Tools]]</div> Dav1d Related toolkits and APIs 2015-08-31T17:03:58Z <p>Dav1d: /* OpenGL loading libraries */ added glad</p> <hr /> <div>== Beginner frameworks ==<br /> <br /> One-shot downloads that contain multiple tools, so as to make it easier for the user to get started with OpenGL.<br /> <br /> ; [ Unofficial OpenGL SDK]: A collection of several cross-platform libraries, using a common build system to simplify OpenGL development. It distributes several easy-to-use libraries for GL initialization. It also has a library for OpenGL loading, image loading, and more.<br /> ; [ Graphics And Physics Framework]: German OpenGL based graphics And physics framework.<br /> <br /> == OpenGL initialization ==<br /> <br /> Creating an OpenGL context usually requires writing platform-specific code to create a window. It also requires loading OpenGL functions manually from that context. These tools simplify these tasks greatly, in most cases providing cross-platform solutions.<br /> <br /> === Context/Window Toolkits ===<br /> <br /> The creation of a window to render stuff in is not covered in the OpenGL specification. This is handled by platform-specific APIs. These APIs have been abstracted in many toolkits.<br /> {| class="wikitable" <br /> |- valign="top"<br /> | style="width: 33%;" |<br /> These toolkits are designed specifically around creating and managing OpenGL windows. They also manage input, but little beyond that.<br /> <br /> ; [ freeglut]<br /> : A crossplatform windowing and keyboard/mouse handler. Its API is a superset of the GLUT API, and it is more stable and up to date than GLUT. It supports creating a core OpenGL context.<br /> ; [ GLFW]<br /> : A crossplatform windowing and keyboard/mouse/joystick handler. Is more aimed for creating games. Supports Windows, Mac OS X and *nix systems. Supports creating a core OpenGL context.<br /> ; [ GLUT]<br /> : Very old, '''do not use'''.<br /> | style="width: 33%;" |<br /> Several "multimedia libraries" can create OpenGL windows, in addition to input, sound and other tasks useful for game-like applications.<br /> <br /> ; [ Allegro version 5]<br /> : A cross-platform multimedia library with a C API focused on game development. Supports core OpenGL context creation.<br /> ; [ SDL]<br /> : A cross-platform multimedia library with a C API. Supports creating a core OpenGL context.<br /> ; [ SFML]<br /> : A cross-platform multimedia library with a C++ API. Supports creating a core OpenGL context.<br /> | style="width: 33%;" |<br /> Many [ widget toolkits] have the ability to create OpenGL windows, but their primary focus is on being widget toolkits.<br /> <br /> ; [ FLTK]<br /> : A small C-based widget library.<br /> ; [ Qt]<br /> : A C++ toolkit which abstracts the Linux, MacOS X and Windows away. It provides a number of OpenGL helper objects, which even abstract away the difference between desktop GL and OpenGL ES.<br /> ; [ wxWidgets]<br /> : A C++ cross-platform widget toolkit.<br /> ; [ Game GUI]<br /> : An OpenGL based C++ widget toolkit with skin support and integrated window manager for games.<br /> |}<br /> <br /> === OpenGL loading libraries ===<br /> {{main|OpenGL Loading Library}}<br /> <br /> OpenGL loading libraries handle the loading of OpenGL functions.<br /> <br /> ; [ GLEW]<br /> : An OpenGL loading library for Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris.<br /> ; [ gl3w]<br /> : An OpenGL loading library, focusing on OpenGL3/4 Core context loading for Windows, Linux, Mac OS X and FreeBSD.<br /> ; [ libepoxy]<br /> : An OpenGL loading library which crashes with an error message instead of segfaulting if you do something wrong.<br /> ; [ OpenGL Loader Generator]<br /> : A tool for generating OpenGL loaders that include the exact version/extensions you want, and ''only'' them.<br /> ; [ glad - Multi-Language GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.]<br /> : A tool for generating OpenGL, OpenGL ES, EGL, GLX and WGL header (and loader) based on the official XML specifications.<br /> <br /> == Utilities ==<br /> <br /> There are many utilities that, while they don't rely on OpenGL very much, are useful in making OpenGL applications.<br /> <br /> === Image and Texture Libraries ===<br /> {{main|Image Libraries}}<br /> * [ DevIL]: DevIL stands for Developers Image Library. It supports many image formats for reading and writing, it supports several compilers and OS (Win, Linux, Mac OSX). The library has a OpenGL-like syntax. It has not been updated recently.<br /> * [ FreeImage]: FreeImage is an cross-platform image-loading library, with very wide support for image formats (including some HDR formats like OpenEXR).<br /> * [ SOIL]: SOIL ( Simple OpenGL Image Loader ) is a public-domain cross-platform image loader that's extremely small. <br /> * [ GLI]: GLI( OpenGL Image ) is a small cross-platform C++ image library able to load DDS textures (DDS9 and DDS10), compressed or uncompressed. It is licensed under the MIT license.<br /> * [ glraw]: glraw provides a command-line tool that converts image files into raw files, directly containing plain OpenGL texture data (also allows for customizable file header). Thus, it allows for fast texture loading. It is licensed under the MIT license. <br /> <br /> * /> === Math Libraries ===<br /> * [.<br /> * [ TVMet]: The '''T'''iny '''V'''ector '''M'''atrix library using '''E'''xpression '''T'''emplates..<br /> <br /> === 3D File Libraries ===<br /> * [ Open Asset Import]: The Open Asset Import Library can read a variety of 3D file formats such as COLLADA (often .dae), Blender3D native files (.blend), 3DS (.3ds), Wavefront Obj (.obj), and many more.<br /> * [ lib3ds]: The lib3ds library is for reading 3ds files.<br /> <br /> == Toolkits that are Layered on top of OpenGL ==<br /> <br /> Many programming interfaces are layered on top of OpenGL, providing rich and varied functionality. Not all can interoperate.<br /> <br /> {| class="wikitable"<br /> ! width="33%" | [ Scene Graphs]<br /> ! width="33%" | Graphics Engines<br /> ! width="33%" | Game Engines/Toolkits<br /> |- valign="top"<br /> |<br /> ; [ Gizmo3D]: This scene graph works on all Windows platforms, OSX, GNU/Linux, iOS, Android and IRIX.<br /> ; [ Open Scene Graph]: This scene graph works on all Windows platforms, OSX, GNU/Linux, IRIX, Solaris and FreeBSD.<br /> ; [ OpenSG]: It's a scene graph which works on IRIX, Windows and Linux.<br /> ; [ Open Inventor - by VSG]: Object-oriented scene graph API. Commercial implementation. Supports Windows, Linux, OSX.<br /> |<br /> ; [ Crystal Space]<br /> ; [ Irrlicht]<br /> ; [ Ogre3D]<br /> |<br /> ; [ ClanLib]: A cross platform C++ toolkit library with a BSD style license. Essentially the library offers a series of different functionality under a streamlined API.<br /> ; [ Delta3D]: Game engine based on Open Scene Graph and ODE.<br /> ; [ Panda3D]: A C++ 3D game engine with Python bindings.<br /> |}<br /> <br /> ==Other==<br /> <br /> ; [ Equalizer]: A crossplatform framework for the development and deployment of parallel OpenGL applications for large scale graphics clusters and multi-GPU workstations.<br /> ; [ PixelLight]: An open-source cross-platform framework using OpenGL.<br /> ; [ OGLplus]: An open-source header-only library which implements a thin object-oriented facade over the OpenGL (version 3 and higher) C-language API. It provides wrappers which automate resource management and make the use of OpenGL in C++ safer and easier.<br /> <br /> === Sound or Audio Libraries ===<br /> ; [.<br /> ; [ OpenAL Soft]: OpenAL Software Renderer.<br /> ; [ OpenAL Audio Framework]: OpenAL based Audio Framework.<br /> <br /> [[Category:Related Toolkits & APIs]]</div> Dav1d
https://www.khronos.org/opengl/wiki_opengl/api.php?action=feedcontributions&user=Dav1d&feedformat=atom
CC-MAIN-2022-27
refinedweb
2,698
59.9
I thought I should give this it’s own specific post – this is the chatbot that I’ve used in my Raspbinator and Nvidinator projects. The GitHub linked below will be updated over time as I make improvements to it. I’ve decided on the name Chatbot 8 – as before I used GitHub I had it on my Google Drive and each iteration I increased the number; the first one I was happy to use in the Raspbinator was iteration 8 and now, the name has kind of stuck. Key Goals: - To make a bot that can respond to human input, learn and return more organic responses over time. - To be able to be trained from large text files such as scripts for movies and transcripts of conversations. - Have it able to be integrated easily into other projects. So here’s the code on my GitHub. I’ve made these chatbots to work with Raspberry Pi projects – thus everything will be based on Pi’s and the Raspbian OS. There are a few of dependencies: - fuzzywuzzy - MongoDB - PyMongo (will need to use the version 3.4.0) Everything else should be included with the Python packages on Raspbian. At a high level the logic of the system is as follows: Bot says initial “Hello”. Human responds. Bot stores the response to “Hello” and searches its database for anything its said before that closely matches what the human input was, then brings up a result from a prior interaction.. It will first search with a reasonably high accuracy for known inputs, then if that fails it will reduce to a medium accuracy and then finally a low accuracy. I am currently using this library for comparing strings: The levels of accuracy are: - fuzz.ratio(Str1.lower(),Str2.lower()) - fuzz.partial_ratio(Str1.lower(),Str2.lower()) - fuzz.token_set_ratio(Str1,Str2) You can see on the site I’ve linked above how these functions work – but generally the accuracy needed degrades as it goes through the functions. The threshold for each can also be adjusted. So if the top returned ratio for the input string/stored strings is below the threshold it will drop to the second for a partial match and do the same and finally if that fails; it will move onto the set ratio match. The final one is good for strings of different sizes that have matching words in. Now what happens if there are no matches on the above? Before the bot responds it stores the input its received into the database, its also splitting up every input and storing all the individual words. So when it can’t find a previous reply to your input it has a 40% chance of generating a random sentence from these words and a 60% chance of picking a totally random complete sentence it knows. It’s also capable of maintaining conversations with multiple people – creating a new class for each person it talks to and recording their last responses along with the bots. So that when you switch people using the ‘change_name’ command or by inputting a different name into the conversation function from an external program, it can carry on the conversation with a person it’s already talked with in that session.Modular. Recently I’ve added the ability for the chatbot to be imported into other programs and be able to get text input and receive outputs from the bot – with an easy interface that only requires an input string with a name. The bot itself then handles the previous replies and bot responses; along with the conversation switching and returns a response. It can also be run independently for testing, making it easy to train and test even when as a component of another project – such as the integration with the STT/TTS and ML parts of The Nvidianator. To use it simply put the bot .py file in the same folder as the program it will be used with and use: import bot_8 as chatbot Once imported into the Python program it can be interacted with with the command: reply = chatbot.conversation(inputWords, humanid) The input words are of course what the input is, so this can be taken from a speech to text function such as wit.ai or some other text input. The humanid is the name of the person currently interacting with it. With both of these inputs put into the function it will return the reply as a string – which can then be used for further processing in the program that has imported the chatbot.Training. I’ve also added in a training module – this can be handy for loading in large text files such as film scripts or conversation transcripts, so the bot can be trained up on existing data – I have tried it with the script for Metal Gear Solid and it works pretty well. It works by scanning each line and putting the data into the bot – as each new line goes in the bot code assigns it as a response to the prior line. It has been programmed to filter out blank lines and sentences that begin with none-alpha characters, as well as splitting lines with “:” in; so that a script with names denoting who is talking and with various notes in should have these lines skipped and names removed. This is a bit messy at the moment though and could do with some work, but it basically means you can chuck in a script and it (should) get through it neatly, picking only the relevant speech text. With the bot trained on a script you can type in inputs from the game/movie/conversation and it will pretty reliably return the correct responses – in terms of the Metal Gear Solid script above you can get all sorts of cool quotes out of it by typing in things the characters say. For example, with the above MGS training data: - If I type “Are you a rookie?” - The bot responds with a quote from Meryl: “Careful, I’m no rookie!!” And so on. The training module can be called with the switch “-fresh” which will erase the database and train from scratch, without this switch it will further train the existing database. The training data needs to be in the same folder as the bot and be called "learning.txt". There is also a deleteDB module that, when run, does what it says and clears the database. In theory if it was trained on a huge amount of normal human conversation it would come back with a great deal of organic responses; also depending on what training inputs they receive each bot could have its own distinct personality.Ongoing. I’m going to keep improving upon this to make it better over time. So keep checking back on my GitHub for updates. I am also working on getting the chatbot to be packaged up with Docker – so that it can be easily deployed with all dependencies and also have separate persistent bots on the same machine without even having to have MongoDB installed on the OS itself. Do you have any ideas to improve the bot? Let me know. Also feel free to download it and try yourself – just be aware that starting from blank it will take a lot of training data/talking to it before it starts to make any sense. See you all in the next project.
https://www.raspberrypi.hackster.io/314reactor/chatbot-8-3f2e4a
CC-MAIN-2020-45
refinedweb
1,242
64.54
I need to do a pretty standard dining philosophers setup for my class. (I assume most people on here know what this problem is... if not look here:) We need to have a variable number of philosophers between 2 and 8, and avoid deadlock and starvation. In my design, each philosopher thread asks a Monitor class whether it can eat. The monitor class knows which chopsticks are to the left and right of the requesting philosopher, so it checks whether the left chopstick is free. If not, it waits three seconds, puts it down, and tries again. If it is free, it tries to pick up the right chopstick. If it's free, great! The philosopher eats. If it's not free, the philosopher puts down the left chopstick. Then he tries all over again. Each philosopher is supposed to go through the cycle five times. But my code is freezing really early. There seems to be some kind of deadlock, because the last printed output is "Philosopher #i is hungry and looking for chopsticks." Like this: Philosopher #1 is thinking deep thoughts. Philosopher #2 is thinking deep thoughts. Philosopher #3 is thinking deep thoughts. Philosopher #2 is hungry and looking for chopsticks. Philosopher #2 is eating. Philosopher #3 is hungry and looking for chopsticks. Philosopher #1 is hungry and looking for chopsticks. Please help!! My code is below. public class Philosopher implements Runnable { public final int EATS = 5; private int philNum; private int timesEaten; private Monitor m; private int state; // 0=thinking, 1=hungry, 2=eating, 3=stuffed Philosopher(int num, Monitor mon) { philNum = num; m=mon; state=0; } public int getPhilNum() { return philNum; } public void run () { try { // Do I need to put this in a while loop? for (int i=0; i<EATS; i++) { System.out.println("Philosopher #"+philNum+" is thinking deep thoughts."); Thread.sleep((long)Math.random()*3000); // The philosopher is thinking state=1; // The philosopher gets hungry // The philosopher tells the view to change his state System.out.println("Philosopher #"+philNum+" is hungry and looking for chopsticks."); m.requestEat(philNum); // The philosopher asks the monitor if he can eat System.out.println("Philosopher #"+philNum+" is eating."); state=2; Thread.sleep((long)Math.random()*2000); // The philosopher is eating m.stopEating(philNum); state=3; System.out.println("Philosopher #"+philNum+" is stuffed and putting down his chopsticks."); Thread.sleep((long)Math.random()*2000); // The philosopher is stuffed state=0; timesEaten++; if (timesEaten==5) System.out.println("PHILOSOPHER #"+philNum+" HAS EATEN "+timesEaten+" TIMES."); else System.out.println("Philosopher #"+philNum+" has eaten "+timesEaten+" times."); } } catch (InterruptedException e) { } } } import java.util.concurrent.locks.*; import java.util.concurrent.*; public class Chopstick { private boolean inUse=false; private int stickNum; private ReentrantLock lock = new ReentrantLock(); private Condition chopstickAvailableCondition = lock.newCondition(); Chopstick(int num) { stickNum=num; } synchronized boolean isInUse() { return inUse; } synchronized void putDown() { inUse=false; chopstickAvailableCondition.signal(); lock.unlock(); } synchronized boolean pickUp() { try { lock.lock(); if (inUse) { if (chopstickAvailableCondition.await(3, TimeUnit.SECONDS)) { inUse=true; return true; } else { lock.unlock(); return false; } } else { inUse=true; return true; } } catch (InterruptedException e) { return false; } } } import java.util.*; public class Monitor { LinkedList<Philosopher> philQueue; private int numPhils; Chopstick[] chopsticks; Monitor(int numOfPhils) { numPhils=numOfPhils; chopsticks = new Chopstick[numPhils]; for (int i=0; i<numPhils; i++) { chopsticks[i]=new Chopstick(i+1); } philQueue = new LinkedList<Philosopher>(); } synchronized boolean requestEat(int pNum) { int currentPhil=pNum; int left = pNum-1; // The INDEX position of the chopstick with the same number, so subtract 1 int right; if (pNum==numPhils) right = 0; else right = pNum; // The INDEX position of the chopstick with (the philosopher's number + 1) boolean success=false; if (chopsticks[left].pickUp()) { if (chopsticks[right].pickUp()) { success=true; } else chopsticks[left].putDown(); } return success; } synchronized void stopEating(int pNum) { int left = pNum-1; int right; if (pNum==numPhils) right = 0; else right = pNum; chopsticks[left].putDown(); chopsticks[right].putDown(); } synchronized boolean checkChopsticks(int pNum) { int left = pNum-1; int right; if (pNum==numPhils) right = 0; else right = pNum; if (!chopsticks[left].isInUse() && !chopsticks[right].isInUse()) return true; else return false; } } public class DinnerMain { public static void main (String[] args) { try { int numPhils = Integer.parseInt(args[0]); Monitor m; if (numPhils >= 2 && numPhils <= 8) { m = new Monitor(numPhils); Philosopher[] philosophers = new Philosopher[numPhils]; for (int i=0; i<numPhils; i++) { philosophers[i]=new Philosopher(i+1, m); } for (int i=0; i<numPhils; i++) { new Thread(philosophers[i]).start(); } } else { System.out.println("Your argument was not an integer between 2 and 8." + "Please try again with a valid command line argument."); } } catch (NumberFormatException e) { System.out.println("Your argument was not an integer between 2 and 8." + "Please try again with a valid command line argument."); } } }
https://www.daniweb.com/programming/software-development/threads/301508/trouble-with-multithreading-dining-philosophers
CC-MAIN-2018-13
refinedweb
776
59.6
MLOCKALL(3) Library Functions Manual MLOCKALL(3) NAME mlockall, munlockall - lock (or unlock) address space SYNOPSIS #include <<sys/mman.h>> int mlockall(flags) int flags; int munlockall() DESCRIPTION mlockall() locks all pages mapped by an address space in memory. The value of flags determines whether the pages to be locked are simply those currently mapped by the address space, those that will be mapped in the future, or both. flags is built from the options defined in <<sys/mman.h>> as: #define MCL_CURRENT 0x1 /* lock current mappings */ #define MCL_FUTURE 0x2 /* lock future mappings */ If MCL_FUTURE is specified to mlockall() , then as mappings are added to the address space (or existing mappings are replaced) they will also be locked, provided sufficient memory is available. Mappings locked via mlockall() with any option may be explicitly unlocked with a munlock() call. munlockall() removes address space locks and locks on mappings in the address space. All conditions and constraints on the use of locked memory as exist for mlock() apply to mlockall() . RETURN VALUES mlockall() and munlockall() return: 0 on success. -1 on failure and set errno to indicate the error. ERRORS EAGAIN (mlockall() only.) Some or all of the memory in the address space could not be locked due to sufficient resources. EINVAL flags contains values other than MCL_CURRENT and MCL_FUTURE. EPERM The process's effective user ID is not super-user. SEE ALSO mctl(2), mlock(3), mmap(2) 21 January 1990 MLOCKALL(3)
http://modman.unixdev.net/?sektion=3&page=munlockall&manpath=SunOS-4.1.3
CC-MAIN-2017-30
refinedweb
242
64.41
. SPAIN More related titles 'Any book that shows how to have a sun-kissed retirement and get someone else to pay for your holidays in Spain ...has got to be worth getting hold of.' - Living Spain 'Tips on how to get the most out of this vibrant country so that you can enjoy your new life to the full.' - Sunday Telegraph Gone to Spain You too can realise your dream of a better lifestyle SPAINThe complete guide to finding your ideal propertyH A R R Y howtobooks K I N GPublished Harry A. King to be identified as the author of this work has been asserted by him inaccordance with the Copyright, Designs and Patents Act 1988. NOTE: The material contained in this book is set out in good faith for general guidance and no liabilitycan be accepted for loss or expense incurred as a result of relying in particular circumstances onstatements made in the book. The laws and regulations are complex and liable to change, and readersshould check the current position with the relevant authorities before making personal arrangements. Contents Acknowledgements xi Preface xiii1 Hola y Bienvenido! 1 A dream that can come true 2 A picture of Spain 5 Perceptions 8 Pros and cons of living in Spain 10 Spain's new foreign residents 182 Deciding Where to Go 21 Seasons 22 Major coastal areas 23 Cosmopolitan cities 28 Other interesting places 34 Developing a hot coast 383 Making a Start 40 Reading newspapers 41 Going to property exhibitions 42 Viewing alternatives 43 International company 45 Estate agents 45 Spanish based agents - inmobiliaria 46 Viewing over the web 47 Understanding Spanish advertisements 47 Case study - an inspection flight 49vi HOW TO BUY A HOME IN SPAIN 4 Thinking Ahead 51 Learning the language 52 Case study - Como te llamas? 53 Take your pets too 54 Letting the house back home 56 Moving your furniture 57 Organising your travel 58 Annual running costs of a Spanish home 59 Opening a Spanish bank account 595 What Property, Which Location? 61 Property descriptions 62 Urbanisations and communities 63 Living by the sea, inland or in the country 65 Selecting the right location 66 Pros and cons of each house type 68 Which direction? 72 Magical housing ingredients 73 What do people really buy? 746 Finding the Money 76 Mortgages and loans 77 Case study - purchasing with a mortgage 79 Non-residents' certificate 80 Transferring money 80 Spanish banking 857 Meeting the People Involved 89 Builder 90 Agent 95 Abogado 97 Notario 99 Asesor fiscal 101 Gestor 101 Overlapping roles 102 Avoiding problems 102 CONTENTS vii Appendices1 A purchase contract issued by a builder for a new property 2272 Community rules 2333 Escritura 2414 A purchase contract drawn up by an abogado 2505 An option contract signed on behalf of a client by an agent 2546 Communities of Spain and their Provinces 2567 Public holidays 2608 English language publications 2619 Common questions 26210 Useful phrases 26511 Useful web addresses 27112 Further reading 274 Index 277 I wish to thank two people for helping me prepare this second edition. Firstly my wife, Joan King, who has lived and worked in Spain for 16years and has been exposed to the problems of trying to settle people ina country with a different culture. She spent hours translating theAppendices of this book from obtuse Spanish legal wording intocommon-sense English. XIThis page intentionally left blank Preface Tourism has changed the face of Spain for ever. Fishing villages havebeen replaced with skyscraper hotel blocks. Artificial flamenco, stagedbullfights and tacky souvenirs are entertainment for visitors. Yet only afew kilometres inland, villages, towns and cities lie untouched and retaintheir own distinctive way of life. xiiixiv HOW TO BUY A HOME IN SPAIN the choice is great. White houses in distinctive styles are built on estatesor scattered on hillsides for use as holiday homes, investment potential,or permanent residence. Buying procedures are very, very different from those in the UK. Forgetthe traditional approach of putting in an 'offer', arranging a mortgage andasking a solicitor to sort things out. Prospective buyers must carry outresearch and ask questions themselves, rather than assuming a solicitorwill deal with these matters. Learn about the abogado, the notario, thegestor, the contract and the escritura. It will make things so much easier.It is necessary to understand the Spanish conveyance system from startto finish. It can trap the unwary in a country where there are manyproperty horror stories. This book is a balance. It is not for the tourist. A legal expert would wishfor more detail. An estate agent would not like exposure to theircommercial terms. It is, however, a step by step guide to buying aproperty in Spain, introducing the reader to the country, where and howto buy a property, the maze of documentation, the legal process and howto enjoy life to the full. The book complements but is not a substitute forgood legal advice which should always be sought and taken. PREFACE xv Ho/a y Bienvenido! The Spanish are open, passionate, warm and fun loving. The Spanish go out late, drink a lot and eat simply. They talk in the streets, sleep in the middle of the afternoon and dance till dawn. They're laid back about life. 12 HOW TO BUY A HOME IN SPAIN Sitting on the porch in the evening, holding a glass of wine, watching thesun setting over the sea, soon to be followed by a visit to the local tapas barfor some food and drinks. Hello and welcome to Spain! A holiday home ora retirement home in the sun is a dream, but one that can come true. The first decision is of course - what country? Why not nearby France, thelaid back rural lifestyle of Tuscany, the beautiful clear blue waterssurrounding a Greek island, the Englishness of Cyprus or Malta, or even thecheap properties of Florida? Why not! People follow all of thesealternatives but for many it is a simple choice between Spain and France.In the last few years, Spain has overtaken France in popularity for bothholidays and new permanent residents. Why? Partly of course it's the sun. Cross the Pyrenees and you're in the bakingdeep south of Europe and the lure of lovely weather is always going tomake the sunniest part of Europe attractive. A house in wet and windyBrittany is just too close to England. But it's much more than that. Franceis a peculiarly old fashioned country. Spain is fresh, new and vibrant.Who wants to spend hours considering the merits of French history orlooking in a musty Left Bank bookshop when in Spain you're more likelyto spend your time in a noisy bar with a cross-section of society debating 1 HO LA Y BIENVENIDO! 3 the merits of anything that is loud, or where to go to that night for somegood food and wine? Look at Spain's advantages. The Spanish are open, passionate warm andfun loving. The Spanish go out late, drink a lot and eat simply. They talk inthe streets, sleep in the middle of the afternoon and dance till dawn. They'relaid back about life. Everyone knows by now that Barcelona is cool andelegant with the amazing Ramblas, Madrid is vibrant and cultured withfantastic art galleries, Seville is ravishing with romantic squares andflamenco hanging in the citrus-scented air. Bilbao is no longer just a portbut now has the Guggenheim. Valencia has its new science museum. But care is required, in Spain the price of homes more than doubledbetween 1984 and 1990 largely because the supply of property could notkeep pace with demand. From 1990 to 1997 price increases broadlymatched inflation, but since then dramatically increased yet again. Theyare linked to the economies of other European countries, such as theUnited Kingdom and Germany, where in times of recession a propertyabroad may be one of the first things to be sacrificed. Equally a buoyanteconomy causes excess demand with an 18-month waiting time for newproperties.4 HOW TO BUY A HOME IN SPAIN Spanish house prices may be low, but they are also volatile, appearing toappreciate in four to six year cycles with 2004 showing a slowdown and2005 a drop. Looking to the long term however, Spanish property priceshave the highest rate of inflation in the world. It may be due to a lowstarting point, but 18% per annum over the last 20 years is good inanyone's money. Eighty per cent of foreigners buying a Spanish home are British. Fifty percent of properties are bought off-plan, which is by looking at a plan orshow house before the property is built. The majority of propertiespurchased are holiday homes, near the coast. It is not only northern Europeans who buy homes on the coast. Spain'sgrowing wealth and fast growing economy have started to be reflected inSpaniards themselves buying holiday homes, although 'Madrid-on-Sea'tends to feature large family sized apartments, in shared complexes, withpredominantly noisy Spanish neighbours. 1 HOLA Y BIENVENIDO! 5 A PICTURE OF SPAINBrief history This did not last. The next 300 years saw a succession of wars, the lossof its Empire, and increasing instability in government with a consequentslow decline in economic wealth and influence. An increasingly wearynation saw nationalist generals, led by Franco, rise against the6 HOW TO BUY A HOME IN SPAIN government in 1936 and the start of the Spanish Civil War. Supported byHitler and Mussolini, Spain was an international outcast. In the aftermathof the Civil War a dictatorship was established, with an often brutal rule.A slow, painful reconstruction of the country began. The economystrengthened and started to boom in the 1960s as northern Europe'swealth enabled its peoples to visit sunny of Spain for the first time. Theinflux of different cultures and international pressures brought socialliberalisation long before Franco's death and the arrival of democracy in1975. Today's Spain Spain has transformed itself into a tolerant, democratic society but onestill trying to shake off the shackles of the era when heavyweightbureaucracy ruled the day. The political scene is stable, pacifist, proud ofits role in Europe concentrating on improving Spain's public finances.The country has benefited greatly from the EU programme of special 1 HOLA Y BIENVENIDO! 7 Modern Spain as we know it now has been established for 30 years. Theeconomy has boomed. Traditional agriculture has declined. Theimportance of manufacturing and tourism has increased. A motorwaynetwork has opened up the country. Building is taking place everywhere.The pace of change is dramatic, purposeful and peaceful. Its people, solong oppressed, are now vibrant, confident, open, tolerant and justifiablyproud of their achievements. Some facts PERCEPTIONS Holidays The first perception was probably gained during a holiday on the Costasor on the Islands of Spain. It is a very positive perception with lots of sun,excellent wine and food, new friends, together with a very differentculture. The formula is so good that repeat prescriptions are oftenrequired and taken. Life at home Practical thoughts The last perception is a complex summary of the previous three. One thatsays that the purchase of a property in Spain, either as a holiday home or10 HOW TO BUY A HOME IN SPAIN Spain isn't all sun, sea and sand. Living in Spain for long periods is verydifferent from a fortnight's package holiday. The country may be thesame, but the exposure to its people, customs, culture and attitudes isradically different. As with all countries there are a few downsides whicharen't mentioned in the holiday brochures and are only apparent whenyou live there. Nothing alarming, you understand, but forewarned isforearmed. Climate Climate should be a balance. Not too hot, not too cold, a little bit of rainto grow the crops, but not too much to deter people. Some snow in themountains for recreational purposes but not enough to affectcommunications. The influence of the Atlantic, the Mediterranean and 1 - HOI AY BIFNVENIDO! / 1 1 Africa produces a varying climate. Northern Spain has its lush green pastures. The Costas offer sun and sand coupled with the clear blue waters of the Mediterranean. The southern rolling hills of Andalusia attract little movement in a blistering summer heat. The Balearic and Canary Islands are always pleasant, the latter very mild in winter. Madrid, the capital, is either freezing or roasting. Cordoba in the south is noted as the 'frying pan' of Europe. Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Max 14 14 16 17 20 23 27 26 25 21 16 15Costa Brava Min 6 6 8 9 12 16 18 21 17 13 9 7Costa Max 13 14 16 18 21 25 28 28 25 21 16 13Dorado Min 6 7 9 11 14 18 21 21 19 15 11 8Costa del Max 15 16 18 20 23 26 29 29 27 23 19 16Azahar Min 6 6 8 10 13 16 19 20 18 15 10 7 Max 16 18 20 22 26 29 32 32 30 25 21 17Costa Blanca Min 7 6 8 10 13 15 19 20 18 15 10 7 Max 15 16 18 19 23 25 29 29 27 24 20 17Pocta palida Min 5 5 8 9 13 17 20 20 18 14 10 7 Max 17 17 19 21 23 27 29 30 29 23 20 17Pncta Hoi ^nl Min 9 9 11 13 15 19 21 22 20 16 12 9Costa de la Max 15 14 18 21 23 27 29 30 29 23 20 17Luz Min 8 7 11 12 15 18 20 20 19 15 12 9 Max 12 12 15 15 17 19 22 22 21 18 15 12Santander Min 7 7 8 10 11 14 16 18 15 12 10 8 Max 14 15 16 18 20 24 25 26 24 20 16 14Gfalacia Min 3 4 7 12 12 5 10 13 13 9 6 5 Max 15 17 21 23 26 32 35 36 32 26 20 16C/awj||fl Min 6 6 9 11 13 17 21 20 18 14 10 7Balearic Max 14 15 17 19 22 26 29 29 27 23 18 15Islands Min 6 6 8 10 13 17 19 20 18 14 11 8Canary Max 21 21 22 23 23 24 25 26 26 27 24 22Islands East Min 16 16 16 17 18 19 21 22 22 21 18 17Canary Max 20 21 22 23 24 26 28 29 28 26 24 21Islands West Min 14 14 15 16 17 19 20 21 21 19 17 16 Max 9 11 15 18 21 27 31 30 25 19 13 9Madrid Min 1 2 5 12 10 14 17 17 14 10 5 2 While northern Europe is being deluged with rain, battered by wind, itsroads closed by snow and ice, you can almost guarantee that Alicante andMalaga will be bathed in sunshine. But not all of Spain enjoys aMediterranean climate. Here are some less attractive statistics: San Sebastian - 41 inches of rain per year Madrid - average lowest winter temperature minus 5°C Extremadura - average highest summer temperature 41°C. While there may be other reasons for coming to Spain, climate is the big,big number one. It is healthy; makes one feel good and equally importantkeeps the heating bills low. Cost of living Spain is no longer the cheap and cheerful country it once was. The costof living has increased considerably over the last decade. However, withthe exception of large cities, the cost of living is still lower in coastal andrural areas than it is in the United Kingdom, Ireland, Germany andFrance. It is significantly lower than the cost of living in the 1 HOLA Y BIENVENIDO! 13 Spain's sunny geographical location too affects the cost of living. Thereis an abundance of locally produced food and wine, not only fresh fromthe market garden of Europe, but also cheap and plentiful. The beneficialeffect of sunshine on day-to-day living costs is truly amazing. Utility billunit charges for electric and gas may be slightly high, but low demandmore than compensates. There is more to life in Spain than the sun, sea and sand of the Costas.Only a few miles inland, traditional Spain opens up. The transformationis remarkable as high rise modern buildings, set in clean cities, arequickly left behind to be replaced by small white-walled villages andthen, even further inland, by individual white houses scattered overhillsides. One such example is typified on the Costa del Sol where, a fewmiles from the city of Malaga, the white village of Competa iscompletely surrounded by thousands of individual white propertiesnestling on hillsides or sheltering in valleys. Some beer and sandwich resorts, which in the past have receivednegative publicity, recognise their prime source of income is fromtourism. They have now embarked on programmes to attract familygroups. Spain, once only home of the package holiday, now hasinternational standard entertainment, theme parks and top classrestaurants. And the Costas, home to tourists and house hunters, nowhave competition from excellent inland offerings. The people Anyone who has spent even a short time in Spain will know that itspeople are friendly. If you are polite, smile, and offer locals a greeting intheir own language it will go a long way to establishing and maintainingrelationships. Polite, welcoming and eager to please is an accuratedescription of the average Senor and Senora. As one might expect, there is a contrast between the older and youngergenerations. More elderly Spaniards will have endured the repression ofthe Franco years, may be illiterate and have worked in agriculture. Incontrast their offspring will be vibrant, computer literate, with a city 1 HOLA Y BIENVENIDO! 15 Today, social customs are changing. People are much less formal butfamiliarity is still a hallmark of Spanish life. Handshaking and kissing onthe cheek is the usual form of greeting. Old fashioned courtesy andformality are still the custom in rural areas. Great store is set by personalloyalty and friendship, but it is also very important to take account of aSpaniard's personal sense of honour and pride, which is easily offended.The extended family is the main social unit with family ties strong. Medical facilities Medical and dental facilities are among the best in Europe. There aremany new hospitals staffed by highly qualified doctors and nurses. Ahigh percentage of the cost of this service is provided from privateresources. In addition to the doctor's surgery, the chemist occupies aunique position in the medical hierarchy by providing remedies forsimple ailments. Crime Spain does have a high petty crime rate. Homes have to be protected bysecurity grilles on doors and windows. Cash, passports and electricalgoods are the main targets. The theft of motor scooters is so high thatinsurance companies do not accept this risk. The police seem unable toreduce these incidents, so homeowners need to ensure protection of theirproperty. Red tape First, there is a queue for the application form. Then a queue to hand itin, only to find the application is not valid unless accompanied by twoother documents which can only be obtained from other departments indifferent parts of town. Once obtained, queue again only to discover thatthe application will not take effect until stamped by the head ofdepartment and he has gone home for the day. The whole process is made more difficult by the opening hours of thelittle grilles behind which Spanish bureaucrats confront their public. Notonly can the opening hours vary from department to department, but theyare always as short as possible. Then there are fiestas, local and nationalholidays and ...! It is very difficult to deal with, and most people opt out of the cycle byemploying their own personal 'red-tape-cutter' known as a gestor. 1 HOLA Y BIENVENIDO! 17 Culture Festivals, cultural events and sports events crowd the Spanish calendar.Even small villages have at least one traditional fiesta, lasting a week ormore, when parades, bull running and fireworks replace work. Rural andcoastal towns celebrate their harvest or fishing catch with a gastronomicfeast where local produce can be sampled with liberal quantities of wine.Music, dance and drama festivals are held in the major cities throughoutthe year. It is called Spanish culture. If however fireworks go off atmidnight, a band is playing at four o'clock in the morning and all shopsare unexpectedly closed due to a local holiday then patience, amongother things, is required. Manana The last major downside of Spain is the feature called manana - neverdo something today if it can be put off to tomorrow, or the day after, orperhaps never to be done at all. To live successfully in Spain it isnecessary to come to terms with its culture. Coping with manana is anecessary skill that just has to be acquired. It is best seen with builders,repairmen, or when a car breaks down or indeed any occurrencerequiring a commitment to a time or date. A shrug of the shoulders, anupturned hand, a slight bow of the head, a moment of silence is mananain progress. It is argued that in a large city manana does not exist. They work as hardas their European brothers and sisters. Builders work hard, for long hourswith full order books. Supermarkets have extended opening hours. Theold Spanish proverb 'It is good to do nothing and rest afterwards' (esbueno descansar y no hacer nada despues) is no longer applicable. Allthis is true, but somewhere, under the surface lurks ...18 HOW TO BUY A HOME IN SPAIN Brits also have a growing appetite for overseas holidays with Spain astheir number one destination. This has increased their exposure to newexperiences. People are becoming more dissatisfied with their lives anda trend for television programmes such as A Place in the Sun and NoTurning Back emphasises the point. The TV experience is aimed atdespondent Brits who want to make a new life, with a new challenge, inanother country. They are also preparing the ground for later retirementabroad. The concerns and biggest worries Brits have about moving and livingoverseas are: 59% said they would probably miss their family 47% said the logistics of moving home 45% said that healthcare would be a concern 37% said language was an issue.20 HOW TO BUY A HOME IN SPAIN As Europe has easy border controls for entry and travel is becomingcheaper, opportunities will increase for Britons moving abroad, thusallowing more people to fulfil their dream for a new experience. Theresearch also shows substantial differences of opinion betweenprofessions, with senior managers citing Spain and France as jointfavourites, whereas finance workers, manual staff and middle managersname Spain as their favourite. 2 Deciding Where to Go 2122 HOW TO BUY A HOME IN SPAIN Before reaching for a passport, a credit card, an air ticket, bikini or shorts;pause. Where do you want to go? When do you want to go, for theseasons magnify or hide some of Spain's more interestingcharacteristics? SEASONS Life in Spain moves outdoors with the arrival of spring. Cafes fill withpeople. The countryside is at its best as wild flowers bloom before theonset of the summer heat. Water flows to crops, giving a green look to asometimes barren landscape. This is a good time to look at property.Everything is fresh and clean. Summer crowds are absent. July and August, even June and September, is Spain's big holiday season.Big cities empty as Spaniards flock to the coast or to mountains to escapethe searing heat of the interior. Their numbers are swelled by millions offoreign tourists. Entertainment and eating only take place in the cool ofthe evening. In the late summer fiestas are everywhere. It is hot, stiflingand there are too many people about. Some do go to look at property, butit is an exhausting business. During autumn, after the heat of summer and before the rainy seasonarrives, Spain's countryside, roads and properties have a dirty, unwashed,unattractive appearance. A thin film of dust covers everything. Towardsthe end of this period rain arrives, sometimes heavy torrential rain. Thenorthern tourist resorts practically close down but the harvesting of cropscontinues, with grape and wine production taking over as the maincultural and agricultural activity. It is always said that winter is a good time to view property. Another sideof Spain is seen as urbanisations (estates) empty; many restaurants closeand coastal resorts appear quite desolate. In the high mountains snowfall 2 2-DECIDING WHERE TO GO 23 brings skiers to the slopes, while at lower altitudes olives, oranges andlemons are being gathered. The cold of Madrid contrasts with the warmthof the Canaries' high tourist season. The first rays of spring are eagerlyawaited. Costa Blanca Close to the sea there are several scenic nature reserves - the freshwaterlagoons of L'Albufera, the saltpans of Torrevieja and the limestone cragof the Penya d'Ifach. Inland the mountains around Alcoi await discovery,but the green Jalon Valley is now a magnet for over-development. Having warmer winters than the Costa Brava, cheaper and lessfashionable than the Costa del Sol, the Costa Blanca occupies a primestretch of Mediterranean coastline with Alicante's airport and main linerailway station a major communication hub. Long sandy beaches, in24 HOW TO BUY A HOME IN SPAIN places lined with hotels and apartment blocks, are a feature of the area. There are two parts to the Costa Blanca. The northern Costa Blanca is theprettiest part with rocky coves backed by rugged green mountains aroundits main towns of Denia, Javea, Calpe and Altea. Benidorm dominates thecentral Costa Blanca. Europe's largest single resort has an imageproblem. Build on success they say ... and they do, bigger, higher, eachhotel more luxurious than the last. There is of course more to Andalusia than just the Costa del Sol. TheCosta de la Luz sits on the Atlantic side of the region and the CostaTropical has sprung up as the coastal area of Granada province. But it is the Costa del Sol that holds our attention. It may be one the mostover-developed strips of coastline in the world, but thanks to 300 days ofsunshine per year this area of Spain is home to many. It hosts the jet setsophistication of Marbella, and over 30 golf courses lying just inland.There are many resorts aimed at the mass tourist market, but some of theolder developments, just south of Malaga, have a tired, well-worn look,with planners now facing the difficult task of renovation in this nowseedy area. There are other towns but it is best to give them a miss. A home to high-rise holiday hotels, perhaps less brash than it was, and now run down,adequately describes Torremolinos and Fuengirola. A few miles inland from the coast at Malaga a different Spain opens up.It is the Alpujarras with lots of greenery and many thousands of classicalwhite houses covering the slopes of its rounded hills. Even small townsblend into the contours of the landscape. For a person looking forsomething different, and wishing to blend into the lifestyle of Andalusia,26 HOW TO BUY A HOME IN SPAIN then this is the place to be. This is the land of the finca, a country housesurrounded by olive trees, possibly lacking in all mod cons, but wellaway from other humans. It is rural life... where time is not important. The Balearics Often associated with mass inexpensive tourism, for those turning theirback on the bustle of coastal resorts, these islands have their attractions.The countryside and entire old towns lie relatively undisturbed. TheBalearics have white villages, wooded hills and caves. Mallorca, aculturally rich island, has mountains to go with its sea and shore. Each ofthe islands has its own character and climate. Away from the big resortsand foreign-owned enclaves there are towns, untouched stretches ofcountryside and even shoreline. These islands have more hotel beds than some countries. They havetowns where properties are 75% foreign-owned. But 40 years of tourismhas now given rise to a need for change. The locals feel dominance oftourism over local life has become too great. They wish to appeal to amore up-market tourist and move away from the cheap package holidayimage. So enter the regional government's tourist tax to get tourists topay more towards local conservation projects and amenities togetherwith a series of local measures aimed at halting the cycle of uncontrolledbuilding development. Mallorca is a good choice for living. Access is usually by air, but thereare also excellent ferry services from Barcelona, Valencia, or Denia. Thewest coast, from Andratx to Pollenca and the Gallic influence of Soller, 2 DECIDING WHERE TO GO 27 Further south than the other islands lies Ibiza. The 24-hour club scenebrings tourists here each year. It is a beautiful island with distinctive flatroof architecture and a profusion of flowers in spring. Canary Islands Poised on the edge of the tropics west of Morocco, the Canaries enjoyplentiful sunshine, pleasantly cooled by the trade winds. The Canarieshave extraordinary volcanic landscapes unlike any other part of Spainand contain no fewer than four national parks. There are seven islands.Tenerife, Gran Canaria and Lanzarote are the largest. Housing can befound on all the islands. resort of Playa de las Americas. Los Cristianios, an old fishing port, liesclose by and has developed into a pleasant town along the foothills of abarren landscape. Perhaps a better location is on the north coast near theolder resort of Puerto de la Cruz. It is wetter, greener and away from themaddening crowds. The capital of Gran Canada, yet another fine city, is Las Palmas. Playadel Ingles is a holiday area of high-rise hotel and apartment blocks bestavoided. Puerto Rico and Puerto del Morgan on the other hand areattractive, unique, pretty places, quite the opposite to the brash concreteholiday resorts. COSMOPOLITAN CITIES Alicante Alicante is a city with a long history and has for centuries been one ofSpain's most important ports. It is the regional capital of the CostaBlanca and its main service centre. The city boasts several importantmonuments, including Santa Barbara castle and the nationally famous,palm tree-lined marble promenade known as the Explanada. The old 2 DECIDING WHERE TO GO 29 quarter, known as Santa Cruz, is one of the city's most attractive areas,with its narrow, pedestrianised streets. Along with the rest of the Costa Blanca, Alicante has a mild, pleasantclimate for much of the year, although it can be very hot in the summer. Barcelona Looking for premier city living? Then this is unquestionably the place.One of the Mediterranean's busiest ports, it is much more than the capitalof Catalonia. Culturally, commercially and in sport it not only rivalsMadrid, but also rightfully considers itself on a par with the greatestEuropean cities. The success of the Olympic Games confirmed this to theworld. It is always open to outside influences because of its location onthe coast and proximity to the French border. Granada Malaga Malaga is Spain's fifth largest city. It is the capital of the Costa del Soland a major Mediterranean port. It's one of the most cosmopolitan cities 2 DECIDING WHERE TO GO 31 in Spain and for centuries has been a popular destination for foreigners,as the names of many of the city's districts and streets testify. During the19th century, Malaga was a thriving winter resort for wealthy Europeans. Madrid Situated in the centre of the country the capital, Madrid is a city of overthree million people and a crossroads for rail, road and air travel befittinga modern capital. Its altitude of 660 metres gives rise to a temperatureprofile of cold winters and hot summers, making spring and autumn thebest times to visit. Those who can escape from Madrid during Augustmake for the cooler north or south to the Mediterranean. Despite the climate the capital city has developed its own uniquepersonality. It boasts the Parque del Retiro, a world famous area of leafy32 HOW TO BUY A HOME IN SPAIN paths and avenues, a royal palace and grand public squares. Its museumsare filled with Spain's historic treasures. The Museo del Prado containsthe world's greatest assembly of Spanish painting, particularly the worksof Velazquez and Goya. It also houses impressive foreign collections. Madrid is a city that offers the best in shopping facilities. The latestdesigner clothes sold in elegant up-market stores. There are food marketsthroughout the city. The centuries-old Rastro, open every Sunday, is oneof the world's greatest flea markets. There is a good choice of music; classical, jazz and rock competing withMadrid's own comic style opera known as zarzuela. Saturday night startsin the cafes, moves to the tapas bars, restaurants or clubs, revellingthroughout the night and adding to the city's clamouring traffic noise. Seville Valencia This attractive, historic city has the advantage of being a few miles inlandfrom the sea. Here it is possible to enjoy beaches as the Spanish enjoythem, as they have never been developed for mass tourism. Valencia isvery much a Mediterranean city famous as the birthplace of the rice dish,paella. It is also renowned for its oranges. The annual festival Las Fallasdraws people from all over world when monster sized effigies, whichhave taken a year to build, are burnt in a glorious night of pyrotechnics. With its large car manufacturing plants and modern port, Valencia is anindustrialised city. Is there more to Spain than coastal resorts and large cities? Yes! Otherplaces exist, some old and tired, some less popular Costas, or more ruralareas wet and green, waiting for development to arrive. This is the name given to the coast of Valencia and it means OrangeBlossom Coast, which is highly appropriate since orange groves coverthe large fertile plain. To the south lies Albufera, a huge area offreshwater wetlands celebrated for its bird life. The rice used in paellaand other local dishes is grown here. It is a playground for Spaniards.Spanish families from Valencia or Madrid, rather than foreigners, buyproperty here. Gandia, Cullera and Peniscola are all historic old towns,popular as Spanish family resorts, busy in summer, but empty the rest ofthe year. Costa Brava In the 1960s the rugged Costa Brava (Wild Coast) became one ofEurope's first mass package holiday destinations. Communications aregood, the motorway from France enters Eastern Spain continuingthrough the region on its long way south to Gibraltar. The area is alsowell served by train and bus services. The small towns along the coast north of Barcelona are becoming part ofa commuter belt to the city. The coastal strip is very narrow because asteep mountain ridge rises up behind it, and most of the towns have alower, beach half and an upper part at the top of the hill. 2 DECIDING WHERE TO GO 35 It is perhaps better to miss the mass tourist resorts of Loret del Mar, Tossadel Mar, La Platja d'Aro, and Salou. On the coast some smaller towns arewell worth a visit together with the inland town of Girona set on theRiver Onyar. Costa Calida It may be bleak, barren and dusty. It certainly is hot, but this is the laststrip of Mediterranean coast to be developed ... and it will be. Costa Dorada remained trendy, with a thriving artist's colony. Salou is the tourist hubof the area but has nothing to really commend it. Costa de la Luz The Coast of Light is situated to the west of Gibraltar facing the Atlantic.Spain's southernmost tip is an unspoilt, windswept stretch of coastcharacterised by strong pure light - hence its name. Other than Cadiz,which is almost entirely surrounded by water, Jerez the capital of sherryproduction, and the Donana National Park, an area of wetlands, sanddunes and marshland, the region has little to commend it. Central Spain The vast central plateau of Spain is covered in dry, dusty plains and large,rolling fields. Given the attractions of the Costas and the Islands it is notan area where many Northern Europeans settle. Long straight roads, vastfields devoted to wheat, sunflowers and the grape, dominate the region.It is remote, of stunning beauty, suitable for those engaged in agricultureor for those who want to get off the beaten track and go back to nature. It is easy to find remote, cheap houses for sale, all requiring considerablework for those who wish to avoid human contact and live life in thecrawler lane dreaming of the adventures of Don Quixote for he iscaricatured in metal figures everywhere. 2 DECIDING WHERE TO GC 37 37 Gibraltar Green Spain Is there an area of Spain which within the next ten years will be rapidlydeveloped? Yes is the answer. It is called the Costa Calida, in Murcia andtouched on earlier. Pick up an English language property magazine, aweekend newspaper, or even watch television adverts for this heavilypromoted area offering new off-plan properties. The centrepiece of the area is the natural harbour of Cartagena which wasconstructed in 223 BC by the Carthaginians who called it Quart Hadas(New City). After conquering the city the Romans renamed it CarthagoNova (New Carthage). Although the city declined in importance in theMiddle Ages, its prestige increased in the 18th century when it became amajor naval base. It is possible to get an overview of the city from thepark which surrounds the ruins of Cartagena's castle, the Castilio de laConcepcion. The port was Hannibal's Iberian stronghold and the landingplace for his expeditionary elephants, and he was followed by theRomans and the Moors, whose legacy can be seen in the winding narrowstreets. Excavations in the city include a Roman street and the MurallaBizantina (Byzantine Wall) built between 589 and 590. The most popular resorts of Murcia's 'Hot Coast' are around the MarMenor. A few small beaches are dwarfed by cliffs and headlands. Theresorts of the southern part of this coast are relatively quiet for Spain.There are several fine beaches at Puerto de Mazarron. The growing resort 2 DECIDING WHERE TO GO 39 There are plans to raise the region's profile and the Murcia governmentis going about it in a sound, logical way. New airports and two newprojects for the marinas at Aguilas and at Mazarron are planned. Severalsea-front golf courses are proposed and 25,000 more hotel beds. Betweenthe coast and the capital Murcia, near the small country town of FuenteAlamo, a grand vision is being realised. On a 600-hectare expanse ofgently sloping brown earth, formerly given over to market gardening,two 18-hole golf courses and more than 2,800 homes are planned. It is atranquil setting, surrounded by largely empty motorways with theHacienda del Alamo aiming to rival the La Manga Club in popularity. If you want a hot coast and a property hot spot too, look to the CostaCalida. 3 Making a Start 40 3 MAKING A START 41 READING NEWSPAPERS Each week the popular daily press and the Sunday press carry dozens ofadverts for Spanish properties. They often have a drawing or photographemphasising a low cost, high specification property in a sunny location.There are English language newspapers published in Spain too. As youwould expect they too have large property sections. Living elsewhere inEurope, it is sometimes difficult to get hold of these newspapers butcontacting the publishers should result in one being sent by post. Fromthese you will get a real feel of style, price and location. Objectives The exhibition It is a colourful, noisy affair. Orange and yellow are dominant colours, notonly representing the Spanish flag, but lemon and orange crops too. Thebabble of noise is people talking, with much verbal fencing, displays ofknowledge or lack of it, or locations being visited or revisited. Salespeopleare anxious to 'close'. Visitors are still wary, asking questions, gettingfacts. Sangria, that mass Spanish anti-depressant, is usually available. VIEWING ALTERNATIVES Inspection flights While giving more potential viewing time than an inspection flight, itsuse is less focused. When on a family holiday the emphasis is onenjoyment, the area itself and its facilities. Usually, it is only when theseare satisfied that specific house hunting can begin. Simply the best method! It gives all the necessary time to consider theoptions. It is no longer a snapshot in time. Property and location can beconsidered at leisure. But it can take a good few months, leaving thisoption open only to those retiring or with time available. 3 MAKING A START 45 INTERNATIONAL COMPANY ESTATE AGENTS Few lay claim to the label 'estate agent'. Preference is given to namessuch as 'International Property Consultant', or perhaps 'Blue SkyProperty' or even a more focused 'Torrecasa Property Company'.Whatever the title of the company, it is designed to reflect an image,removed as far as possible from that of an old fashioned estate agency. And quite right too! No one will buy a new, white, house in sunny Spain,close to the Med, if it is marketed in a dull, boring way. These companieshave one or two European offices, but additionally have an office inSpain, or work closely with a Spanish associate. The selling process isagain to visit Spain, probably on an inspection flight. Time is moreflexible, but the consumer's choice may be slightly more limited.46 HOW TO BUY A HOME IN SPAIN A word of warning! With such good value for money a Spanish propertyis a bargain, but it is no bargain if the dream home has been built onsomeone else's land, or in a protected area, or is being sold by someonewho is not the rightful owner. In 1973 the Federation of OverseasProperty Developers, Agents and Consultants was formed and is now theUK's primary overseas property organisation. Similar professionalorganisations exist in other European countries. A trouble-freetransaction starts here. There are always stories in Spain of people losing their life savingsbecause they have dealt with an unscrupulous estate agent. They mayhave bought a house only to discover the person selling it did not own itin the first place. One way to avoid this is to deal with a registered agentwhose number should be on a sign outside the office, or on a windowdisplay, or on the exterior of the building. Grandiose marketing namesmean nothing; it's the number that counts. 3 MAKING A START 47 Using the internet to find a property will save time and money. There arenow plenty of websites advertising Spanish properties which can beviewed from the comfort of home. Many agents maintain sites which canbe found through internet search engines, and more are signing ontoproperty portals for advertising. UNDERSTANDING SPANISHADVERTISEMENTS CASE STUDY An inspection flight Mr and Mrs P. were folly aware that an inspection trip was in fact a code name for a buying trip. They felt under pressure to buy, but equally in control of the situation, having previously done considerable homework on the area. They were impressed with what they saw, were delighted at some of the properties and paid a 10% non-^tiimable deposit for a new corner duplex to be completed in 18 months* time. 4 Thinking Ahead 5152 HOW TO BUY A HOME IN SPAIN How do you learn the language? Home study courses by book andaudiotape are heavily advertised. They are an excellent, intensivemedium for learning at a time best suited to the individual. Manyintensive language schools operate in Spain with prospectuses aimed at avariety of levels in many European languages. One of the best learning methods by far, before leaving home, is an oldfashioned adult evening class at a local school or college. A bit of fun, acommon purpose, this together with some effort for 20 to 25 evenings,will get the average person to a decent linguistic standard. 4 THINKING AHEAD CASE STUDY Como te llamas? 'Mary.' The class progresses with repetition being the order of ttie day. Nota word of English is spoken. In fact the learning process decreesthat speaking English is forbidden. The welcome coffe0e break isextended from ten to 20 minutes with one nervous class membersaying, 'I knew the answer until she pointed at me and then mymind went bla0nk.' Fortunately future lessons get easier as key words and phrase are assimilated. The 'food and drink' lesson is learnt wMi «gse>'-ikw cafe's con kche, una tapa dejamon y una tap® d0qae$o, ,p&r/av&r.- (Two coffees with milk, one tapa of ham^ one ^o of cheese, please.)'•;-: There is absolutely no reason why a pet cannot enter Spain, or for thatmatter travel through an intermediate country such as France. The United 4 THINKING AHEAD 55 The Pet Travel Scheme allows cats and dogs resident in the UK to visitcertain other countries and return to the UK, without quarantine,provided that certain conditions are met thus eliminating the transmissionof disease from country to country. Spain is one of the countries thatpartake three months old and be already fitted with a microchip before they can be vaccinated. Be blood tested about 30 days after vaccination. Wait at least six months after a successful blood test result before being allowed entry or re-entry into the UK. Spain also requires an Export Health Certificate to allow a pet to enter the country. It is different from the PETS scheme. When in Spain have the pet fitted with a microchip which gives its new address. Spain has the normal catteries and kennels. It has many fully qualifiedveterinary surgeons. Some urbanisations, towns and cities have codes ofbehaviour for dogs which result in them being banned from beaches andother public places. It makes sense to put the letting of a property in the hands of experts. TheAssociation of Residential Agents, formed in 1981, regulates lettingagents and seeks to promote the provision of high standards of service toboth landlords and tenants. Membership is restricted to those lettingagents who can demonstrate good financial practices and whose staff hasa good working knowledge of all the legal issues involved. There are three main types of letting service; letting only, letting and rentcollection, letting and full management. Cost and risk should determinethe service selected. The greater the service, the greater the cost and theless risk of unsavoury tenants or damage to the property and its fittings.A letting company will charge around 15% of the rental income for a fullservice, together with additional charges for introducing tenants anddrawing up agreements. Taxation and letting charges can thereforereduce gross letting income by 30 to 40%. If the owner is classed as an overseas resident for tax purposes, the lettingcompany is responsible for deducting income tax at base rate on therental income, unless the Inland Revenue provides a tax exemptioncertificate. It is wise to leave TV sets at home as the Spanish sound system and thereceiving frequency differ from other European countries. Washingmachines work successfully but the plumbing of a Spanish home doesnot allow for a hot water fill. Computers, vacuum cleaners and otherdomestic items all operate successfully on Spanish voltages. It makes sense to pre-book car hire at the same time as booking airtickets. It avoids delay on arrival, as the car will be ready. All theinternational car hire companies operate in Spain together with manySpanish national and regional operators. It is a fiercely competitivemarket. 4 THINKING AHEAD 59 'Wephone/aitefaet &00Euf©s Electricity_'70D.&IQS 700 Euros Gas 200BEfos 200 Euros Water 200 Euros Hottie^poperty insurance ISO Euros Local taxes (JBQ 200 Emm National taxfysopety-taly) 800 Euros CotBfiiiisity-charge 250 Euros Total 3,300 Euros per year One of the very first things necessary in the house buying process is to opena bank account. Spanish banks have improved dramatically over the last fewyears, becoming very European in their outlook. They are very modern,open between 8.30 and 14.30 Monday to Friday and between October toApril on a Saturday morning. The staff are friendly and multilingual.60 HOW TO BUY A HOME IN SPAIN 6162 HOW TO BUY A HOME IN SPAIN PROPERTY DESCRIPTIONS Community property This is a pleasant experience with cool afternoon breezes taking the stingout of the searing summer heat. But nearly all Mediterranean towns aretourist areas. In July and August, with temperatures always in excess of30°, people pour in on package holidays. Spaniards too have theirsummer holiday then, as they rush to the coast in their thousands from thetorrid heat of the big cities. For two frustrating months beaches arepacked, roads jammed, car parks full and tempers frayed. In the country Living in the country has many attractions. It is living in the real Spain.Large plots of land give peace with privacy assured. Neighbours,although far apart, are normally friendly. Some of these properties haveno electricity, no water, no sewage disposal, no gas and no telephone. Allcan be compensated for by other means. Electricity can be supplied by agenerator, or by solar panels. Water can be delivered by tanker or from awell. A septic tank takes care of sewage. Bottles supply gas.Communications can be by mobile or radio telephone and by internet. Many country properties are large and set in beautiful locations - often66 HOW TO BUY A HOME IN SPAIN at the end of a pot-holed dirt track. When it rains the dirt track turns intomud and a 4x4 is necessary just to reach the house. Is it possible to copewith absolute peace and tranquility after city life ... and the frustrationsof driving all the way to the nearest supermarket to find on returning thatan important item has been forgotten? Inland Age comes into it too! A spectacular mountain track that provides theonly access to a restored farmhouse may seem an attraction when in fullhealth, but is not so good when driving up and down it 20 years later.Access to public transport and medical services will become moreimportant too, and the closeness of other ex-pats, who were avoided inearlier years, may become more comforting. 5 WHAT PROPERTY, WHICH LOCATION? 67 Linked, terraced and town houses Fig. 3. Plan of aterraced property. 5 WHAT PROPERTY, WHICH LOCATION? 69 Corner properties Detached Traditional homes Older Spanish properties exist. In most cases they have been modernisedor rebuilt and called a reformed house. In the country they are called 5 WHAT PROPERTY, WHICH LOCATION?71 71 New or resale? Most people prefer to buy a new property. It can be good value. In someparts of Spain, an off-plan property is the only type available (see Figure6 for an example of an off-plan apartment). It is rather like buying a car.Why buy secondhand if you can buy new? A resale property is slightlymore expensive, after all the drives have been laid, gardens are matureand it often comes with furniture and fittings. A resale property builtwithin the last ten years will still carry a guarantee. Mention should be made at this stage of Spain's peculiar debt laws wherethe debt is on a property and not a person. Any outstanding property debtoccurred by the previous owner is automatically carried over to a newowner. The complexities of this are explained later.72 HOW TO BUY A HOME IN SPAIN WHICH DIRECTION? There is a bay at Calpe with a hilly headland jutting out eastwards to sea.Houses built on this hill face north. They are cold as they get little directsun. Individual houses, a terraced row, or apartments facing north allsuffer from the same fate - little sun in the winter months and 5 WHAT PROPERTY, WHICH LOCATION?73 73 a pine filled ravine! At the edge of purple hills! Next to a marina! Moresimply it can be exotic gardens or a house that has obviously been wellloved and cared for. Location is that little bit extra which makes aproperty highly desirable - and probably that little bit more expensive. Itis no good buying a large detached property surrounded by cheap flats. Itwill just lose value. A property at the end of a street, facing a commercialcentre will suffer the same fate. A property in the middle of a row ofsimilar houses has nothing to commend it. Future resale values aredependent on the general ambience of the area. People moving to Spain for the first time often purchase a new propertynear the coast, sold by an international property company of some repute,giving a sense of security in a country where the customs and laws areunfamiliar to the purchaser. There may well be an 18-month wait for theproperty, which can be built to standard or individual design and isusually located on an urbanisation. This type of purchase is simple, withno debt issues to worry about. The property company is on hand to dealwith any outstanding problems. coastal hustle and bustle. People have in mind life in a rural town, or onan individual plot avoiding the disadvantages of an urbanisation. Theyseek to blend into Spain. 76 6 FINDING THE MONEY 77 CASE STUDY Purchasing with a mortgage Answer In order for the bank to issue a mortgage loan, they have to have the property valued and for this purpose they use a valuation company. It is normal for a valuation company to undervalue using a 'worst case scenario' instead of the current market value. It is unlikely that the bank will increase their percentage offer and equally unlikely that the valuation company will alter their assessment. Obviously the matter can be discussed with the agent and vendor but it is definitely a 'sticky wicket*. A compromise solution with a refund of half the deposit, giving some compensation to the vendors, would seem a good idea. 6 FINDING THE MONEY81 81 NON-RESIDENTS' CERTIFICATE TRANSFERRING MONEYRegular transfers The use of two accounts, one in a home country and one in Spain,should be enough for the transfer (transferencid) of money, pensionsand day to day living expenses. The transfer of money between twoaccounts is straightforward irrespective of the currency involved butcharges can vary and conversion from Sterling or Dollars into Euros isexpensive. Offshore banking has some advantages for investments and tax freesavings. Since Gibraltar, an offshore centre is so close to the Costa delSol, it is still possible to bank offshore and live in Spain. Many offshore82 HOW TO BUY A HOME IN SPAIN A fixed monthly Euro requirement will vary as the exchange rate varies,so it is not possible to be exactly sure how much Sterling will be requiredto cover an overseas payment. Overseas payment plans allow the fixingof an exchange rate between Sterling and Euros for one year at a time.The monthly payments are collected from a UK bank by direct debit andtransferred abroad on a set date each month. The costs of this service arean annual £50 fee and £7.50 per month, less than normal bankingcharges. Large transfers For example let us assume that you are UK resident buying a new villain Spain. The developer will require a deposit in Euros immediately, thenfurther stage payments during construction over the next 18 months andlarge payment upon completion. The price of the property is in Euros andthis will not increase unless the specification is upgraded.84 HOW TO BUY A HOME IN SPAIN One transfer strategy would be to buy all the Euros now, thus fixing thecost at the outset. This is called buying currency for 'spot'. Deposit thebought currency to earn some interest and make payments to thedeveloper as requested. Another transfer strategy would be to buy theEuros each time they are required to be sent to the developer. This meansthe purchaser has no idea what the final cost of the property may be. SPANISH BANKING In selecting a Spanish bank it makes sense that some staff should speakEnglish and have access to services such as mortgages and investments.It should be a main branch thus preventing delays in foreign transactions. Free banking Al Portador Bank statements Anyone with a Spanish bank account will come across the practice ofsmall, frequent statements. Monthly statements are not issued. After oneor two transactions a statement is issued detailing any cash withdrawal,standing order or direct debit. A person with 12 normal transactions permonth can expect four letters and probably ten to 14 slips of paper. Aspecial account, for say a monthly mortgage payment, can expect twoslips transferring money in and another two making the payment out. Donot be tempted to throw these slips away; in fact it is advisable to keepthem all for at least two or three years as they often are the only receiptfrom a service provider. They are proof of payment for items such as cartax and are required for completion of an annual tax return (mortgagepayments, bank fiscal statement and the payment of local taxes - IBI). Letras to the purchasers' bank where it will be taken direct from the nominatedaccount. Once signed, a letra is effectively cash. If the goods are faultyor if the letras are made out to the wrong person too bad! If a bank holdsa letra then payment is expected irrespective of the circumstances. Domiciling a payment 8990 HOW TO BUY A HOME IN SPAIN BUILDER In cities and along coastal strips hotels, apartments and houses continueto be built. Construction is big business. It is highly skilled. There is ashortage of skilled tradesmen, many travelling from the more remoteparts of Spain to work on coastal developments. Bankruptcy policy Reinforced foundations. Internal cabling for telephone and television. Optional extrasSecurity Similar precautions for the Costa Blanca apply equally to the Costa delSol, the Canaries and the Balearic Islands.94 HOW TO BUY A HOME IN SPAIN Moving north and inland a heating system is necessary. The centre of thecountry, including inland Andalusia, needs all the aids for comfortableliving that can be mustered, with heating and air conditioning a necessity. Swimming pool Garden A garden completes a home. Residents should have a full garden laid outwith palm trees and colourful hibiscus shrubs. Non-residents require amaintenance-free environment, laying out a garden to paving stones,chippings and the occasional water-thrifty shrub. Green lawns are rarelyseen, such is the expense and difficulty of upkeep. Additional charges It may be necessary to purchase additional items for a new home such as: AGENT By virtue of their daily contacts, estate agents know who is buying andselling. Top agents keep files of buyers, sellers and properties. It is notunusual for a good agent, when they learn of a new listing, to sell itwithin 24 hours to a buyer they know will buy that type of property. Anagent, given time and a detailed specification, will always find a propertyfor a determined buyer. They may have to be chased occasionally, butthat is part of the process of being determined. The quality and integrity of estate agents has vastly improved in the lastfew years. Selling houses attracts some of the finest people. But thebusiness still attracts some unscrupulous characters too, probablybecause it is possible to earn a handsome income without working toohard. Due to its financial structure the estate agency business opens doorsto all types of people some of whom are not completely honest. Howevermost agents aren't thieves and swindlers, if anything they're more honestthan the average person because they have their reputations to protect. Charges In the small, very popular town of Javea there are over 120 estate agents.96 HOW TO BUY A HOME IN SPAIN Why? With some house prices at 400,000 Euros plus, an agent only hasto sell around ten properties a year to make an extremely comfortableliving. It is often the case, in the final stages of house price negotiation,that the agent's commission itself may well be reviewed downwards.Very few agents in Spain operate on an exclusive basis and rarely expectto do so. It is quite common to find several agents selling the sameproperty. Since their commissions may differ, so ironically may the houseprice. ABOGADO Use a Spanish lawyer to help buy a Spanish property. Do not use a legalexpert in your own country to check out the legal documents in anothercountry. Would you use a German lawyer to check a British conveyanceor vice versa? No. Why should it be different in Spain? The relationship between an abogado and a notary (see later) needs someexplanation. A notary will register a document provided it meets all thenecessary legal criteria. They may even give some advice to the abogadoon, for example, drawing up wills. But it is the abogado who willconsider all the legal options for the client, draw up the documents to beregistered and explain the legal 'ins and outs'. Power of attorney A Special Power of Attorney can only deal with the buying or selling ofproperty. A General Power of Attorney can deal with almost anything butis likely to embrace loans and mortgages. 7 MEETING THE PEOPLE INVOLVED 99 NOTARIO A notary's main task is to make sure that documents are legalised, suchas for a Power of Attorney, wills, certifying copies of passports,registering company charters, stamping the official minutes of acommunity of property owners, notarising a letter and most commonly,approving the deed of a property known as the escritura. Most people meet the notary for the first time when concluding thepurchase of a property. The escritura is signed and witnessed by thenotario in the presence of the seller(s) and the purchaser(s) unless any100 HOW TO BUY A HOME IN SPAIN party has utilised a Power of Attorney to excuse their own presence. Thenotario's duty is to: Check the name of the title holder and whether there are any charges or encumbrances against the property. Check the contents of the escritura and ensure it is read to the purchaser(s) prior to signing. Check that both parties have been advised of their legal obligations. Certify the escritura has been signed and the money paid. Warn parties if they knowingly undervalue the purchase price of a property by more than 20%, and ensure 5% of the purchase price is withheld and paid to the hacienda if a property is sold by a non- resident. A meeting at the notary's office to sign an escritura can last about twohours. Just about everyone involved with the sale and purchase attends.The notary's office can on occasions get very crowded with manytransactions taking place simultaneously. In some busy offices, dealingwith a conveyor belt of new properties, the task is concluded simply withthe builder's clerk (the seller), the abogado with a power of attorney andthe notary themselves. A maximum of four people! But it is not alwayslike this. With a resale property an agent, an abogado, a bank manager togive a mortgage and another to redeem a mortgage, joint sellers and jointbuyers, the notary and their assistant can bring the total to ten people.Hopefully, someone can be a translator. 7 - MEETING THE PEOPLE INVOLVED 101 ASESOR FISCAL GESTOR They are competent, highly qualified administrators but what do they do?For the Spanish they simply deal with the complicated mass ofpaperwork. For foreigners they do the same, in a country where thelanguage barrier, a new culture and complicated procedures causeadditional problems. Some of the tasks covered by a gestor are: Application for NIE and residency. Gaining entry into the Spanish health system. Dealing with the payment of car tax, car transfer tax and other car related matters. Help in setting up new businesses. but they do it for a number of people who have paid to have it doneefficiently. Some people say, rather sheepishly, that a gestor is employedby people who have more money than time! But they know the ins andouts of the system and get the job done. State officials like a gestor too,as they know all the forms will be completed correctly. OVERLAPPING ROLES The role of an abogado, asesor fiscal and gestor can overlap. All canobtain an NIE and residencia (details in Chapter 11). In fact the first onevisited will need an NIE. Whose door is knocked on first? Usually anabogado, as they are part of the property buying process. Like any goodbusinessman, the abogado will seek to retain a future relationship withtheir clients after a property conveyance has been completed. There aretaxes to be dealt with. Wills to be prepared and possibly a driving licenceto be obtained. Entry into the medical system ... AVOIDING PROBLEMS Poor agents. A badly written contract. Properties bought without legal title. Issues surrounding developers and builders, lack of planning permission, companies going bankrupt, undischarged loans. An undischarged mortgage from the previous owner. An escritura which describes a property which has been altered to a degree bearing no resemblance to that described. Who are the people who give rise to these horror stories? It is the Britishwho trick the British, the Germans who trick the Germans and theScandinavians who trick the Scandinavians and so on. Why? It is thelanguage issue once again. Someone talking to you in your own languagewill sound more plausible, particularly someone who has already gainedyour confidence and understanding. It is unlikely that you would betricked by someone of another nationality. Do not sign anything, or pay a deposit, until you have sought legaladvice. Once the advice is given - take it. Do not assume it is someonedotting Is and crossing the Ts. One of the most common phrases heard inSpain is about property buyers 'leaving their brains behind at the airport'.It is true! The rush to buy a dream home, or a pressurised selling trip, oreven the euphoria of the moment often make people do incredibly stupidthings, literally handing over cash deposits to agents or owners with little104 HOW TO BUY A HOME IN SPAIN or no security. 105106 HOW TO BUY A HOME IN SPAIN PROPERTY PRICES Property prices will vary according to supply and demand, location, sizeand position. It is therefore not possible to give an authoritative priceguide for all Spanish property. That is best obtained by referring toproperty magazines or specialist books on this subject. In all three examples IVA is included in the price and paid at the variousstages. The Spanish developer uses the peculiarly Spanish system ofletras.108 HOW TO BUY A HOME IN SPAIN Of course it is the seller who should pay this tax. They have gained thebenefit of the increase in land value. The law of the country supports thisview. In practice however this tax has often fallen on the purchaser sinceit a more secure method of collection. After all, a vendor may flee thecountry leaving this tax unpaid. Notary fees Property registry Again there is a fee to have the property registered. It is wise to allow 0.5%. Naturally this fee will depend on the amount of work done. If the basicpaperwork has been handled to a straightforward conclusion then thecharge will be low. If on the other hand there have been complications orthe need to draw up multilingual contracts then the charges will behigher. Allow 1% for this charge. Who pays? The buyer and seller can agree between themselves who pays taxes, feesand charges. This can be incorporated into the contract and is notoverridden by Spanish law. In practice however the buyer pays eitherdirectly, or on occasions indirectly when the agent incorporates thesecharges into an overall selling price. Todos los gastos is the Spanishphrase meaning all expenses arising. One last twist in the tail. If a property is bought from a non-resident, then5% of the purchase price declared in the escritura must be deposited with112 HOW TO BUY A HOME IN SPAIN the tax office in the vendor's name. In other words only 95% is paiddirect to the vendor. Why? This deposit is designed to cover a non-resident's liability for capital gains tax. BLACK MONEY Many people are now seeing the folly of this practice but once started itis difficult to stop. The saving of, say, 1.4% in initial taxes on purchasingcan easily be outweighed by a greater loss in capital gains on any profitAlmond blosso.2 HOW TO BUY A HOME IN SPAIN Cordoba. Quenca. Segovia.4 HOW TO BUY A HOME IN SPAIN Rice fields. PHOTO GALLERY 5 Street in Estellens.6 HOW TO BUY A HOME IN SPAIN Murcia cathedral. PHOTO GALLERY 7 Mallorca. 8 MORE MONEY MATTERS 113 Spanish tax officers do not sit idly by. Renowned for being sharp butpragmatic, they maintain their own table of property values and areempowered to set a higher value which can result in an additional tax billshould they feel excessive tax avoidance has taken place. This scrutiny ismainly, but not exclusively, applied to a purchaser's tax liability. If theydiscover that the sale has been under-declared by more than 20% theycan apply heavy penalties under the terms of Spain's Ley de Tasas whichwas enacted to prevent this practice. 'Black' is the term used to describe the difference between the actualprice paid and the value declared in the escritura. 'Black money'describes a cash payment representing the difference in values.Incidentally the payment of 'black money' can also occur at the start ofthe buying process with an initial deposit paid as cash to the agent whichin turn becomes their black money commission. Joint ownership This is the normal way of proceeding. Two people buying together willbuy in both names. It gives a level of security. Upon death the other halfpasses to the fellow owner (UK inheritance law) and is taxed accordingto the relationship by Spanish inheritance laws. It is normal for theownership split to be 50/50 but in the case of a second marriage withthree children on one side and one child on the other the split can be75/25, which would give a fairer distribution of inheritance. 8 MORE MONEY MATTERS 115 In the example above, with two adults and four children, there is nothingwrong with having all six names on the deed in equal or unequal parts. Ifone person dies their share of the property passes equally to the otherfive. Spanish inheritance tax will be small, if anything. And thedisadvantage - if the children fall out with the surviving spouse theycould insist on a sale of the property unless an arrangement wasconstructed with the spouse retaining a life interest. In this case a property is in the names of the children only, with a lifeinterest held by the named parents who paid for it in the first place. Theproperty is the children's in whatever parts so defined. A life interest(usufructo) is the right to use the property for a lifetime. On the death ofone person, the remaining spouse or partner who has a life interest wouldstill be able to use it. On death there will be little or no inheritance tax. Adisadvantage - the property is no longer owned by the purchaser and iffamilies fall out, get divorced or children suddenly die it becomescomplicated. As this is a peculiarly Spanish practice there is plenty of'civil code' for guidance. Off-shore company Spanish taxes are charged. But the company has a new owner. Understanding Legal Documents 117118 HOW TO BUY A HOME IN SPAIN PRE-PURCHASE CHECKSAn architect's drawing Plan Parcial It also makes sense when buying land or a new property yet to be built,to have a line drawing locating the plot. This is called Plan Parcial, aSpanish term meaning a plan of parcels, or plots of land, which isregistered with the planning department at the local town hall. It ensuresland or property for sale is approved and registered with the town halland secondly it shows other adjacent developments or roads plannedclose by. While a line drawing, supplied by the builder's architect willsuffice on most occasions, a Plan Parcial, from the urbanismo at theayuntamiento (town hall) is the only approved legal source. Prospectivepurchasers should also be aware of developments close to the sea whichrequire to be approved by the Jefatura de Costas as well as the town hall. Nota Simple While the Nota Simple will give ownership details of an existing title, itmakes sense that further documents are requested to establish the personselling has the right to do so. Details in the escritura, passport orresidencia number and Certificado de Empadronamiento should all agreewith the facts in the Nota Simple. If not there is something wrong. Anexamination of property dimensions recorded in the escritura should alsobe the same as the actual property - if not an illegal alteration has takenplace. Debts Spain's laws carry any debt on a property over to the new owner. Prior tosigning the contract a check has to be made to ensure there are noencumbrances such as mortgages, or outstanding debts such as localtaxes or community charges, and all service bills have been paid in full.A mortgage or loan is repaid at the notary. The following is a process forchecking this: A copy of the Nota Simple will tell if there are any mortgages or loans against the property. A seller is not trusted to pay off a mortgage on their own accord, so it must be paid at the time of signing the escritura. Enquire at the town hall to check any unpaid local taxes: Impuesto Sobre Bienes Inmuebles (IBI). Enquire through the Community of Owners, or their management122 HOW TO BUY A HOME IN SPAIN An IBI receipt is not available for a new property, but is available fromthe town hall for a resale property. The IBI receipt will show theproperty's catastral reference number and the valor catastral, the officialassessed value used in calculating IBI. The assessed value is usuallysubstantially less than the real market value. Purchase contract On new developments the initial supply of water from external pipes andelectricity without meters is often obtained from a builder's supply point.The reason for this is simple. The completion and occupation of propertyis faster than the ability of utility companies to connect their supplies.126 HOW TO BUY A HOME IN SPAIN Building insurance There are three versions of the escritura. The Copia Simple (not to beconfused with Nota Simple) is a copy of the escritura, less the signatureswhich is sufficient to prove ownership. It is available on the day ofsigning at the notary and is recognised as suitable for most legalpurposes. It is normal for the purchaser to hold a copy of this document. Registro de la Propiedad This is the last piece of paper in the buying cycle. Strangely it is not theEscritura Publica that is the final step, as it is registered with the propertyregister being over-stamped Registro de la Propiedad. This simple one-page document simply closes the loop to the Nota Simple which wasconsidered at the start of the buying cycle. What does all this mean? Theregistro de la propiedad registers the property in a public place givingdetails of who has the title, which notary was responsible for theescritura and lists details of any mortgage or loan.128 HOW TO BUY A HOME IN SPAIN Licencia de obras FAST-TRACK CONVEYANCE CASE STUDY Don't get mugged New owner I expect there will be long queues at the bank? Firma hem,firma there, that sort of thing?Agent Probably Senor, probably. Are you aware that 7% of the total payment is cash for the builder? New owner No.Agent You are now! New owner Let me understand this. This house cost 100,00 Euros. Today's final payment of 25% is 25,0 Euros of which 7,000 Euros are cash and 18,00 Euros are a banker's draft.Agent Yes, that's how things are done here. By the way the house costs 93,000 Euros. Do you understand? This will benefit you too. Less tax pay! (He taps his nose twice with the ind finger of the right hand.)New owner Presumably this transaction is known to t appropriate authorities?Agent Si, Senor, everyone knows. (The money is collected and placed i0n a black briefcase.)Agent Let us go Senor, to pay the builder. We do not want to get mugged! Clerk N&p0mmiimtfmm®). The task is completed and she smiles again, Akey M m-a word processor and& document is produced wrMali HfMilated states that the fill price for tie property te been piid. Ambiguity par excellence! Clerk Here are your keys and receipt Buena suerte(goodltick)» She smiles for the thkd time in a kindly way. AUTHOR'S NOTE Readers may wish to turn to the first five Appendices of this book detailed below 1. A purchase 1,a-lttiMer contract for -a.new- issued by a builder for a new property property. 2. Community rules 3. Escritura 4. A purchase contract drawn up by an abogado 5. An option contract signed on behalf od a client by an a The first three appendices are for the same property. further examples of contracts are highlihted in Appendices 4 and 5. The first is extremely well written by an abogado for an unusal property. The other, for a resale property, is designedonly to benefit the agent's receipt of black money132 HOW TO BUY A HOME IN SPAIN fact no signed document existed between the agent and seller. Theagent could have taken the deposit and simply vanished. He didnot have the right to sell the property. Doing It Yourself 134 IT YOURSELF 10 - DOING IT YOURSELF /135 135 RENOVATED HOUSES Many people like the idea of returning a derelict ruin to its former glory.Restoration is less popular than building new, because it is usually moreexpensive and there are limited opportunities to acquire a cheap, suitable136 HOW TO BUY A HOME IN SPAIN Whatever the condition of the building, the process starts with the purchaseof a resale property. It may be run down. It may even be a ruin. It isprobably in the country but can be a terraced house in a Spanish town. In the country do not assume anything is possible. In fact the height, sizeand number of properties per 1,000 or 10,000 or 30,000 square metres isregulated by a town hall planning department and it may only be possibleto extend the footprint of a property by a small amount. Ten thousandsquare metres of land is a normal requirement for rustica properties(country land with no building designation and a water supply) and30,000 square metres for land without a water supply. Check utility supplies. If none, how much will it cost to install them?Important questions need answering about supply of electric, supply ofwater and sewerage disposal, TV reception, telephone andcommunication systems. survey to cover all structural elements, such as the roof, walls, doors,windows, floors, outbuildings, and garden walls, external and internaldecorative state. Damp tests will be carried out by an electronic dampmeter to each room in the house, and comments made on general servicessuch as water, electricity, gas supply and drainage. Assuming all these checks are satisfactory it is now safe to purchase theproperty and proceed to the next step of obtaining a licencia de obra(building licence) from the local town hall. PURCHASING LAND Look for a town plan called the Plan General de Ordenacion Urbana(PGOU), the municipal building plan. Drawing it up involves both localand regional government, with the latter not always approving theusually overambitious plans of the former. It involves political, social and138 HOW TO BUY A HOME IN SPAIN The purchase of rural land has further complications. Where are theboundaries? Are there any rights over the land? What can it be used for? Allthese factors have to be checked before proceeding. While the boundariesmay be marked by paint on rocks, numbers, or metal stakes in the ground,this is useless if a defining piece of paper contradicts these markers. Lastly where crops and trees are growing, or land is used for agriculturalpurposes, check the water rights. Check the road access for winter rain.Are there any tracks or rights of way across the land? Are there anybuilding developments or roads planned close by? Will the property beoverlooked by any high development obstructing the line of sight? Doadjoining neighbours have any prior purchasing rights? Buying land is much the same as buying a house. It needs a contract andan escritura and a visit to the notary. It requires the payment of IVAwhich in the case of land is 16% (remember it is only 7% for a property).It also requires pre-purchase checks and the one check that nearly alwaysends in some discussion is boundaries of rural land since they are oftendescribed in vague terms. If problems exist with boundaries an officialsurveyor can survey and measure the land thus identifying its boundariesand size. The findings form part of a new escritura. Thereafter the wayto proceed is to compare the escritura (assuming one exists) with thecatastro certificate (a map with boundaries). There is a need to haveofficially recognised boundaries and a statement of the exact squaremetres in both documents. While they may not agree initially, this can becorrected upon purchase when a new escritura and a new catastrodescription are brought in line. 10 DOING IT YOURSELF 139 All done and correct? It is now safe to purchase the land and proceed tothe next step of obtaining a licencia de obra (building licence) from thelocal town hall. Previous checks at the town hall will have given an assurance that thereis no objection in principle to being issued with a building licence, whichis the equivalent of planning permission. When discussions take place theissue of local building codes will arise. The distance between theboundary and any other building? The distance between a wall and aroad? The number of storeys? What about already establishedurbanisation approval? If it goes wrong Builders often say 'you can build anything you want here. If it goeswrong we will pay the fine.' Don't believe it! The statement may beaccurate, it may be made with the best of intentions, but it is not corrector contractually binding. Some people deliberately build withoutpermission. If the town hall does not object within seven years it isapproved. If permission has not been granted, or an alteration hasbreached planning rules, a fine of 5% of the alteration value is imposed,provided the modification is deemed satisfactory and can be legalised.Blatant breeches incur a fine of 20% and demolition of the building. Development deals MEMOFtIA Many people think they can take shortcuts. Never mind the rules. Whodo they meet? A cowboy: someone who offers services in return for asum of cash, then either disappears, or carries out such horrendous workthat the client ends up spending more to rectify the damage. In a lot of cases, people prefer to put the experience down to bad luckrather than pursue the matter through the courts. In some cases theyrealise they have appointed a builder without due care and attention. Veryfew pursue the matter through the courts, partly through their ownembarrassment and the possibility of throwing good money after bad. sheet to the contract. And lastly, at no time pay large sums of cash upfront. FINAL STEPS Building costs A good specification for construction work (a reformed property) - 750€ per square metre. 10 DOING IT YOURSELF 145 Payments to a builder20% on signing the contract20% on completion of walls and roof20% on completion of inside10% for outside work - walls, patio, pool10% retained for up to one year to cover defectsIVA - paid on completion or in stages 11 Settling In 146 11 -SETTLING IN 147 MOVING IN After the waiting and, if new build, some inevitable delays, it is time tomove in. There is a lot of work to be done. Moving house at the best oftimes is stressful, moving to Spain - either to a holiday home orpermanent one - is both exciting and hard work. Having probably seen a show house, some brochures, a plan and locationdiagram, the viewing of your own completely new house for the firsttime is approached with considerable enthusiasm. It is there where itshould be. White walls with ochre coloured window frames are setagainst a clear blue sky. Inside the walls too are white, contrasting withthe dark orange bathroom tiles. A bidet too! The bedrooms are large,spacious with fitted wardrobes. Yes, it's exactly what you specified. On the other hand roads may not be finished, water and electricity arestill to be supplied by the builder through outside pipes and cables, thegarden is non-existent and the house needs a good clean. The emotion and pleasure of seeing a new home for the first time need tobe quickly replaced with a more measured approach. In a new home,148 HOW TO BUY A HOME IN SPAIN If any major faults exist, immediately stop the purchasing process untilthey are rectified. Go back home if need be, but on no account make thefinal payment. This of course is an unlikely scenario, after all thebuilding has been inspected by the architect, but to be realistic majorfaults can and do happen. Time for talking it may be, but this is time foraction too and is best achieved by the purchaser refusing to complete thetransaction. EQUIPPING A HOUSE Price and service is the key when purchasing these packages. Is thesupplier recommended? Are the goods in stock? Can they be delivered ina few days? It is easy to give and take an order, but with so many itemsin a package it is important to have a guaranteed delivery time for themall. 11 SETTLING IN 149 Telephone Electricity Gas When you purchase a resale property you should inherit gas bottles onwhich a legal deposit has already been made. Supply of gas is by a doorto door delivery service, exchanging an empty bottle for a newly filledone. Alternatively take the bottle to the nearest depot for exchange. Water Insurance Spain has a reputation for red tape and bureaucracy which has its originsin duplicated decentralised government. At local level, small 'standalone' administrative offices deal with everyday aspects of Spanish life.Little co-ordination takes place. During this settling in period a numberof administrative tasks need to be undertaken. The best way toaccomplish these is to assemble all the necessary pieces of paper anddecide who is going to do it - you personally, or a gestor. Tourist or resident? It is well known that British people, and for that matter foreigners fromNorthern Europe living in various Mediterranean locations, are notclearly defined by their own social perception of tourist, seasonalresident, temporary resident or permanent resident. The law is quite clear,irrespective of property ownership and taxation. Up to six months' stay, a person is a non-resident. Over six months' stay a person is a resident. Perhaps the answer lies in a reluctance to grapple with red tape in changingstatus, or perhaps they are reluctant to break the ties from home. Are theyseeking to vanish from various authorities or hoping to escape taxation?Are they ignorant of the facts? There are no benefits in maintaining atourist status if resident more than 183 days in Spain - only the risk of afine. A person who lives in Spain more than 183 days, whether or notholding a residencia, becomes liable to pay Spanish income tax.152 HOW TO BUY A HOME IN SPAIN In fact the Spanish tax system is geared to provide greater tax relief toresidents rather than non-residents by reducing capital gains tax, nothaving 5% of the price withheld when selling a property pending areview of capital gains liabilities, and a reduction in inheritance tax, rentatax and income tax. Tourist status The EU allows free movement in its member states for all its citizens,provided they have a national identity card or a passport. The UK is oneof the few countries in Europe which does not issue an ID card but thismay change. Until it does, a valid passport is required for UK citizens toenter Spain and for internal identification purposes thereafter. A tourist may own a home, and many do, but anyone who stays morethan six months must apply for a residencia. Figure 8 shows the steps atourist must take in Spain when purchasing a home. Intending to live permanently or to spend more than six months each yearin Spain? Then no later than 90 days after arriving, begin the process of154 HOW TO BUY A HOME IN SPAIN At the police station finger prints are taken. In about six months a plasticresidencia card is issued. It's a new identity in Spain, renewable everyfive years. The passport goes into the file at home to be used for Visit the town hall with a passport and evidence of residing in the town (copia simple or escritura or residencia). Complete some details. Provided more than six months each year is156 HOW TO BUY A HOME IN SPAIN Not everyone wishes to vote. Who are the candidates? What do they standfor? An EU citizen signing on the padron is entitled to vote in localelections and can be elected to office. They can also vote for their localEuropean parliamentary representative or again stand for office. One percent of foreigners in coastal regions have been elected to the well paid jobof local councillor. The only additional qualification is to speak Spanish. The more people registered on the padron, the greater amount of fundsreceived from regional government. One role of the town hall is to collect local taxes. This operational roledetracts from its political and management role and as a consequencecollection has been subcontracted in some provinces to a third party.Gestion Tributaria Diputacion de Alicante, known as SUMA, undertakesthis for the province of Alicante. SUMA manages local taxes authorisedby town halls, provincial councils and other public organisations frommost of the 140 municipalities that form Alicante province. They areresponsible for collecting IBI (Impuesto Sobre Bienes Inmuebles - a localtax based on property value), IVTM (motor vehicle tax), a tax for rubbishcollection and any other local taxes. IBI is a local tax, rather like rates/poll tax/council tax in the UK but at a 11 SETTLING IN 157 Medical treatment Public health benefits, under the Spanish state health scheme calledINSALUD (Instituto Nacional de la Salud), include general and specialistmedical care, hospitalisation, laboratory services, medicines, maternityand some dental care. Anyone who pays regular social securitycontributions to INSALUD by virtue of their employment is entitled, forthemselves and family, to free medical treatment. Obtain form El21 from the Social Security office back home. A tourist visiting Spain and driving either their own car or a Spanishrental car can do so with a licence issued in their home country. Aninternational licence also issued in their home country would be better asthe standard format can be more easily identified by authorities. However the licence has an old address and for a new resident of Spainit is better to exchange it for a Spanish driving licence. If anything goeswrong it makes life just that little bit easier. It can reduce problems atroadside checks. Since 2004 holders of EU photo card driving licences can drive legallyin Spain without the need to register or exchange that licence. If thelicence bears a previous UK address, drivers should always carry proofof their residence in Spain when they have lived in the country for morethan six months. 12 Understanding Personal Taxation 161162 HOW TO BUY A HOME IN SPAIN INTRODUCTION Spain is no longer the tax haven it once was when taxes were low and taxevasion a way of life. Today it is more difficult to avoid paying taxes andpenalties are severe. However, despite the efforts of the authorities tocurb tax dodgers, tax evasion is still widespread. Many non-residenthomeowners and foreign residents think they should be exempt fromSpanish taxes. Some inhabit a twilight world and are not officiallyresident in any country. Yet tax evasion is illegal. It is a criminal offencewith offenders heavily fined or even imprisoned. On the other hand, taxavoidance, paying as little tax as possible and finding loopholes in the taxlaws, is common. It is not so much the level of taxes, but the number ofdifferent taxes, sometimes for small amounts, which makes taxationcomplex. Personal taxation Income tax (impuesto sobre la renta de las personas fisicas) is payable by residents on world-wide income and by non-residents on income arising in Spain. Non-residents and residents with more than one property must pay a property income tax (rentimientos del capital inmobiliario), which is usually referred to as renta. Wealth tax (impuesto sobre el patrimonio) is payable by residents and non-residents on high-value capital assets, including property. Capital gains tax (impuesto sobre incremento de patrimonio de la renta de un bien inmeuble) is payable by both residents and non- residents on the profits made on the sale of property and other assets located in Spain. Inheritance and gift tax (impuesto sobre sucesiones y donaciones) is 12 UNDERSTANDING PERSONAL TAXATION 163 Other taxes Property tax (impuesto sobre bienes inmeubles - IBI) is paid by all property owners to the town hall, whether resident or non-resident. Taxes concerned with buying a property, including transfer tax (derechos reales} and land tax (plus valid}. Offshore company tax (impuesto especial) is an annual tax on offshore companies that does not declare an individual owner of the property, or a source of investment. Waste collection (basurd) is an annual tax payable in some areas, whether resident or non-resident. Motor vehicle tax (impuesto de circulacion) is paid annually by all those owning a Spanish registered vehicle together with a one-off registration tax upon purchase. PRINCIPAL FACTS Since we have difficulties with tax at the best of times, a new resident ornon-resident grappling with the language of tax authorities has littlechance of getting a declaration correct. Enter the asesor fiscal who willnot only perform these administrative tasks but may even suggestlegitimate methods of tax avoidance. It is not necessary to have a fiscalrepresentative but fiscal representation is cheap, about 70€ per year forone person. For the relatively small cost involved, most people areusually better off employing a fiscal representative to handle their taxaffairs rather than doing it themselves. For anyone owning more than oneproperty, or a commercial property, or a foreign company owning aproperty in Spain it is legally necessary to have a fiscal representative. It is possible to obtain free tax advice from the information section at thelocal tax office where staff will answer queries and assist in completinga tax declaration via their PADRE computer system. Some offices havestaff who speak English and other foreign languages. An alternative is topresent details direct to a bank that in many cases has PADRE forms onits computer. Most asesor fiscals use the PADRE program as well. A non-resident spends less than six months per year in Spain. A Spanishresident is one who spends more than six months per year in the country,who has a residencia and has notified the tax authorities back home oftheir departure on form P85. This triggers entry into the Spanish tax 12 UNDERSTANDING PERSONAL TAXATION 165 INCOME TAX It is not necessary to file a tax return if income is less then 8,000€ a year.This applies to married couples and retired people too. The onlycondition - no more than 1,600€ of this income is from investments. Asalaried worker earning less than 22,000€ probably does not need tomake a tax declaration. This does not mean non-payment of income tax.It means that their withholding tax, taken out of their salary during theyear, has been carefully calculated to match their liability. The tax officerecalculates their final tax bill and makes any refund. Deducting allowances All social security payments. A personal allowance. A deduction from income - a wage earner allowance. An allowance if unemployed and accepting a job in different locality. A disability allowance. A dependant's allowance. Professional and trade union fees. Spanish company pension contributions. A percentage of an annuity. Child-support payments made as a result of a court decision. Maintenance payments as the result of a court order. Legal expenses. Sixty per cent of any dividends. Up to 4,000 15 600 Over 45,000 45 Example Let's focus on a retired couple now resident in Spain. They have ownedtheir property for a few years and have carried out no alterations duringthe current tax year. She has a state pension from the UK. He hasearnings of 29,200€ from various sources but mainly occupationalpension schemes and investments. Income tax liability is simple tocalculate. She pays no tax at all and is not required to make a declaration as herearnings are under 8,000€ per year. RENTA In the case of residents there is no deduction, but residents who own morethan one property will be subject to tax on their second home. In this casethe renta is added as income for income tax purposes. In the exampleabove 1,100€ is added as income as if it were more earnings. This meansthey pay tax on this at their normal income tax rate. At the lowest tax rateof 15% the bill is 165€ which can be split in two if the second propertyis jointly owned. WEALTH TAX After the allowance has been deducted (or not in the case of non- 12 UNDERSTANDING PERSONAL TAXATION 171 Property tax Many people view renta tax and wealth tax as one item, calling it rentaand patrimonio, or even calling them a property tax. In the case of a non-resident, taking the example of a property with a market value of200,000€, renta tax is 275€ and patrimonio tax is 436€, i.e. a total of701€ per year for having a property in Spain (plus of course IBI and anycommunity charges). Exemptions Residents aged over 65 are exempt from the profit made from the sale of their principal home, irrespective of how long they have owned it. Tax rates Examples A resident will have the gain added to earnings for income tax. Taxed at a lower rate of 15% the total liability is 8,300€. 13 175176 HOW TO BUY A HOME IN SPAIN MAKING A WILLWhich country? A person with British nationality at birth will find that Spanish authoritiespermit an estate to be bequeathed to whomever they choose, so long asthis is allowed by their own national law. However a Spanish estate issubject to Spanish inheritance tax. Anyone with assets in Spain shouldmake a Spanish will disposing of their Spanish assets in order to avoidtime-consuming and expensive legal problems for heirs. A separate willshould be made for disposing of assets located in the UK. Make sure aUK will states clearly that it disposes only of assets in that country andmake sure a Spanish will disposes only of assets in Spain. UK laws Spanish laws This is not quite as brutal for the surviving spouse as it may seeminitially, as he or she keeps all assets acquired before the marriage, halfof the assets acquired during marriage, and all inheritances which havecome directly to the spouse. In effect this means that half of the assets donot really form part of the deceased person's estate. Half the propertycontinues to belong to the surviving spouse. Example Let us say the eldest son retains one third, in this case 25,OOQ€» with a controlling interest, called an usojructo, held by the spouse. Spanish inheritance laws are inflexible. They aim to preserve the familyunit by ensuring a property is handed down from generation togeneration. In this example the property now has three owners and allthree have to agree before it can be sold. An extremely unlikely scenario!More likely would be one child buying out the other child's share uponthe death of the other parent. The laws of both the UK and Spain state that the inheritance laws of thecountry will apply where the property or asset is situated, but Spainchooses not to apply this provided inheritance tax is paid to them. Sowhat happens when a British citizen leaves a Spanish property to a dog'shome, which is perfectly possible under English law, but children contestthe will, stating they are entitled to two thirds of the asset under Spanishlaw? After all, the Spanish authorities are choosing not to apply their ownlaws. Answer - the children would not win the case. It is better toeliminate grounds for contesting a will if a controversial one is to bewritten. 13 WILLS AND INHERITANCE TAX 179 Dying intestate INHERITANCE TAXDomicile There are many issues that can affect liability for inheritance tax,including the country of domicile. purposes. This will usually be the place where a person has the closestconnection - normally a country of birth rather than a country ofresidence. Guidelines is not payable if the asset is outside Spain and the recipient is not aresident in Spain. Inheritance tax is the liability of each beneficiary and not of the deceased'sestate. Surprisingly the actual tax payable is based on four factors: the amount bequeathed tax exemptions and allowances the relationship of the recipient to the deceased wealth of the recipient. Property is valued either at market value, a value in the IBI statement, thevalue in the escritura or a value set by the Hacienda, whichever isgreater. Stocks and shares, cars and bank accounts are valued at the date182 HOW TO BUY A HOME IN SPAIN The law provides an individual exemption from tax of the first 16,000€bequeathed where an estate is passed to a spouse, parents, children,brothers and sisters. This exemption applies to each inheritor, not to thetotal estate. For uncles, cousins and nephews, the exemption is cut byhalf to 8,000€. For more distant relatives, people not related andcommon law couples, there is no exemption. Conversely children aged13 to 21 years of age attract higher exemptions. This applies to residentsand non-residents. The tax table on the next page is a rounded abbreviated extract from a fulltable. It is for guidance only. To use this table take the amount inherited,less any allowances highlighted in the previous section, subtract anydebts owed by the deceased such as an unpaid mortgage and funeralexpenses. This is the taxable amount with corresponding tax payable. 13 WILLS AND INHERITANCE TAX 183 2.4 depending on the wealth of the recipient and their relationship to thedeceased. In fact Table 1 only applies to children, adopted grandchildren,grandchildren, spouses, parents and grandchildren who have a personalwealth less than 400,000€. All other benefactors, including those with highpersonal wealth and unmarried couples, pay more. Regional variations These regional variations now recognise and come to terms with some ofthe old fashioned principals of Spanish inheritance tax. Examples held in joint ownership. One person dies and bequeaths the other half ofthe property to the surviving spouse. They have two children. Theexamples look at different combinations of resident, non-resident,married and non-married. For the benefit of simplicity the figures arerounded and the location is not one with regional tax variations. In the first example the total inheritance tax bill would be halved if theproperty was left in equal parts to the children and surviving spouse. Inthe third example the tax bill would be 1,300€ if the couple married orlived in Andalusia. Over the years many methods have been used to lessen the impact of thistax. Some of these have been illegal, and lead to greater problems andhigher taxation at a later date. These methods have included the non-declaration of death, under-declaring the value of assets and using apower of attorney after death. With the introduction of new European taxlaws on disclosure these practices will become a thing of the past. Noprofessional advisor will risk high fiscal penalties for the sake ofassisting clients in evading taxation. Trusts One such method is to create a trust, in which assets pass into the handsof a company, with each family member becoming a share holder. Whenone member dies, the shares are transferred to other family members.This attracts little tax. The location of this company may be offshore.Making a trust is best left to experts. It attracts annual charges andtherefore is best suited to large financial holdings. The only realalternative to a will is to set up a trust structure during a lifetime. Withcareful planning this can eradicate delays, administration costs and taxes,as well as giving other benefits. For these reasons the use of trusts can bequite dramatic. A trust is not dissimilar to a will except that assets aretransferred to trustees during a lifetime, rather than assets being 13- WILLS AND INHERITANCE TAX 187 You can transfer the property to a chosen heir while still alive andmaintain a usufructo over it, retaining a right of use while living. Theownership has formally passed to another person. This legal move, whichis viewed by the tax authorities as a gift, still attracts some inheritancetax, albeit at a reduced level, depending on the age of the peopleinvolved. Equity release To avoid inheritance tax in this way all the normal rules must befollowed. For a Spanish tax resident, the mortgage will reduce net assetsin Spain. Of course, the loan proceeds must be invested outside Spain,either via a trust for beneficiaries or in a will to non-Spanish residents. Ifnot a Spanish tax resident, the mortgage proceeds must be investedoutside Spain and should not pass to any Spanish residents on death. These equity release schemes only aim to reduce Spanish inheritance tax;if domiciled in the UK at death these schemes will not reduce any UKinheritance tax liability. Give it away Maintaining a loan Inheritance tax is only payable after debts have been deducted. If it waspossible to have a 100% interest only mortgage or loan then this is aguarantee of no inheritance tax. This is not possible as a mortgage but is190 HOW TO BUY A HOME IN SPAIN Ten Euros for a menu del dia, or for three tapas and somewine, is excellent value for money. Glass in hand, soaking up the warmth of the sun and watching the world go by, putsone very close to the seven heavens of the cosmos depicted at the Alhambra, Granada. 191192 HOW TO BUY A HOME IN SPAIN Why do we say the Germans are boring, the Italians hot-headed, Swisssecretive, French awkward and the Dutch rather nice? This is adescription of people but not the culture of a nation, which can be definedas civilisation, customs, lifestyle and society. Spaniards have a zest for living and commonly put as much energy intoenjoying their lives as they do into their work. Time is flexible, manypeople organise their work to fit the demands of their social life, ratherthan let themselves be ruled by work or the clock. All big cities have abuzz and all rural areas have their tractors and carts, but two undisputedfacts support the view that a slower pace of life prevails in Spain. One isthe intense midday summer heat which makes even small movementimpossible. The other is manana, a deeply rooted Spanish attitude whichfrustrates the British and does permanent damage to Germanrelationships. It causes difficulties, but in truth it is a way of life that saystime is not important, tomorrow will do. FAMILY GROUP offspring in the new millennium. Mother and father will be proud parentswith a deep sense of honour. Grandparents will be friendly, courteous,generous, not fully comprehending the staggering changes which havetaken place since their childhood. The young macho male will study in the evening for personaladvancement, watch football and own a fast scooter. The beautiful darkhaired senorita will be slim, wear flared trousers, and somehow be onefoot taller and one foot narrower than her mother. Traditionally the manexpects his wife to be the provider of love and affection and keep a cleanhome worthy of her husband. But this is changing fast, with Spanishwomen seeking more freedom and equality alongside their more worldlysisters. At the weekend the family group will come together along with anassortment of aunts and uncles. With military precision, in a long line,they will make their way to the edge of the sea, each carrying an essentialitem for the day's outing. Parents will be first, loaded down with food,grandparents next with deck chairs, uncles with umbrellas, aunts andchildren with buckets, spades and balls. They will have a great time witha babble of excited conversation, interspersed with a shout, a wave of thehand, a shake of the shoulder, or a kiss in greeting or farewell. TRADITIONAL SPAIN dead and the living. Some fiestas appease the forces of nature. Othersdrive out evil spirits. Often they are based on historical events or includemedieval or ancient customs. There is always a fiesta somewhere. Theycan last for a day, a week or a fortnight. Perhaps the best known fiesta is the one celebrating the reconquest of theMoors by the Christians, held at Alcoy near Alicante but also replicatedin many other Spanish towns in that region. Throughout the world thereare many colourful processions but few can compare with the medievalpageantry which is accompanied by the music of brass instruments andloud kettle drums, as the marchers slowly sway rhythmically in the earlydarkness of a summer's evening. Spanish towns, offers the bull better odds. In this case the young machomale is the one in danger. The bulls are let loose in the streets of a town.Aspiring men run to avoid their horns. A few are injured and some die. Despite the rich heritage of traditional Spain, football and even morefootball has now taken over as a main leisure pursuit. Sunday night is forwatching football on large screen television in bars and restaurants. Religion EATING OUT Food is important. Spaniards enjoy cafe life. Like the French they live toeat, not eat to live. Lunch takes place between 2 pm and 4 pm and outside the home willconsist of tapas or alternatively a light three-course meal with wine andbread. The choices for the menu del dia are chalked up on a blackboardoutside the restaurant. The starter (primero) is soup, salad or pasta, the196 HOW TO BUY A HOME IN SPAIN main course (segundo) is meat or fish and the sweet (postre) is fruit, icecream or flan. It is a good example of simple food, at a fixed price, to beenjoyed with some wine. This meal would be served at a cafe, bar orrestaurant. It would be eaten by workmen, office staff, tourists andresidents alike. The tapas bar is unique to Spain. Rows of dishes are arranged in a chilledcabinet in front of the customer. A choice is made, with bread and coffeeor wine, to be eaten at the counter, at an adjacent table or at a table on thepavement or street. The offerings are made by the proprietor or by a localfood preparation unit. They comprise tortilla, spicy meat balls, big plumpolives, sausages, fried aubergines, egg salad, courgettes, spicy potatoes,liver, cheese, serrano ham, sardines, prawns in garlic, anchovies, mussels,fried squid, calamares, sepia (cuttlefish) and small fish in olive oil. Ten Euros for a menu del dia, or for three tapas and some wine, isexcellent value for money. Glass in hand, soaking up the warmth of thesun and watching the world go by, puts one very close to the sevenheavens of the cosmos depicted at the Alhambra, Granada. Outside the restaurant, in the main square or along the promenade theevening paseo commences with young girls and boys, parents andgrandparents strolling in a leisurely manner. For some it is gentleexercise in the cool of the evening, for others a prelude to a good nightout, for spectators it is an entertainment. In villages chairs are placed inits narrow streets, oblivious to passing traffic, as occupants emerge from 14 LEARNING ABOUT CULTURE AND CUSTOMS 197 197 Streets are clean and free of litter. Housewives sweep the street outsidetheir home. Houses when occupied are kept well painted on the outsideand owners fill their balconies and window boxes with brightly colouredflowers. Towns have ample and elegant street lighting and an almost totalabsence of graffiti! This is civic pride. All three police forces carry truncheons. The Guardia Civil and PoliciaNacional carry guns. They are tolerant and polite except when dealingwith major crime.198 HOW TO BUY A HOME IN SPAIN SHOPPING EXPERIENCE Jlendas The smaller tiendas (shops) are cheerful, friendly, helpful places wherethe owners and assistants are anxious to please. This is also where theannoying Spanish characteristic of 'not forming queues' is seen at itsworst. People push and shove to the front to be served. This is best dealtwith by patience as the perpetrators of this behaviour are often elderlywho seem to think that their advanced years entitle them to non-queuingprivileges. Alternatively say perdone and address the sales assistant, whousually knows what is happening. Opening hours for tiendas vary between summer and winter, but normallyare 9.30 am to 1.30 pm and 4.30 pm to 7.30 pm Monday to Friday, plus aSaturday morning. The afternoon siesta seems inappropriate in winter butessential in summer, when the shops open later, as no one wishes to goshopping during the intense heat. There is, however, pressure frombusinesses and other Europeans to change this custom. Banks and someorganisations open at 8 am and close at 2.30 pm. Holiday resorts,restaurants and hypermarkets which open seven days a week, 12 hours aday, have already squeezed the siesta out of existence. Hypermarkets The fish counter is laden down with salmon, trout, mussels, skate,mackerel and a whole range of unrecognisable species. The wine, spirits,soft drinks and bottled water section stretches for miles. Thesehypermarkets have 40 to 60 checkouts. Staff are equipped with rollerskates to get from point to point. Franchised within the same building arerestaurants, banks, jewellers, newsagents and the National Lottery. Clothing European chain stores, like European banks, have only a few outlets inmajor cities. The marketplace may be penetrated by individual foreignbrands but not by foreign retailers. Where they do exist they tend to be apoor relation of their national parents. Mercado central A central market is run by the local council. Most towns have one. Theyare efficient, clean, hygienic purveyors of fish, meat, pastries, fruit andvegetables, a traditional alternative to supermarket shopping. LittleEnglish is spoken but a smile accompanies each purchase. Tabac Best buys in Spain, apart from tobacco, colourful ceramics and leatherproducts, are undoubtedly wine and olive oil, both agricultural productsfrom tightly regulated industries. The Mediterranean countries of Italy, France and Spain all produce goodquality wine under various climatic conditions. Spain produces excellentwines but their product marketing has been poor, leaving France holdingthe premium market and Spain operating at the bottom end. Tightergovernment regulations have seen a continuous rise in wine quality butnot in their marketing strategy. There are broadly three main wine-producing areas: the north, of whichRioja is by far the best known; the central area best known for LaMancha wines, and the southern area, which produces aperitif wines andsherry. Rioja is a strong red wine comparable to any French product butconsiderably cheaper. In the best tradition of wine regions its annualvintage is classified as poor, normal, good, very good or excellent. There are 400 million olive trees in Spain with 80% growing inAndalusia. Driving around Cordoba and Granada you can see fields andfields, acres and acres of olive trees set on the undulating landscape. Theexperts in Brussels say there are too many; olive oil production is toohigh. Aceite de Oliva (olive oil) is used in cooking, in salad dressing andas a substitute for butter and margarine. Some people say it is olive oil,together with fresh fruit, vegetables, and fish which makes the Spanishdiet so healthy. automatically sent air mail. Delivery of mail in Spain can be slow. Thepost office offers a range of services. Registered or express mail, parcelpost, redirection, private boxes and banking are all available. Spanish post offices can be small and dark with long, slow movingqueues. Go to the tabac for stamps. One price covers all EU countries: Ten stamps for Europe, please. Diez sellos para Europa, por favor. Competition exists for the Spanish postal system. Mail Boxes Etc., anAmerican company, has a number of offices in Spain. Although stilldependent on the services of Correos it operates independently forovernight international parcel delivery through companies such as UPSand FedEx. It also offers a mail box service, shipping and packing, faxprinting and photocopying. It sells office supplies and stamps. Thisenlightened company is refreshing to deal with but its activities arerestricted by protectionism offered to the state postal system. Senor Don John Frederick Smith King is simply Mr John Smith with amiddle name Frederick and a mother's maiden name King. He is married 14 LEARNING ABOUT CULTURE AND CUSTOMS 205 205 to Senora Dona Maria Dolores Sanchez Vicario. Got it? Who is ConchitaSmith Sanchez? Yes, correct, their daughter Conchita. Telephone bookscan be fun! Sr Smith Calle Madrid 27, 2 03189 Orihuela Costa Alicante Name Mr Smith Number/Street/Floor 27 Madrid St. 2nd Floor Post code town 03189 Orihuela Costa Province Alicante The zip code 03189 is made up of 03 as the province number and 189,the post office number. COMMUNICATIONSTelevision This medium is now dominated by digital TV. Most ex-pats want to tuneinto English language programmes. These can be found on Sky digitalsystems via a satellite dish. To enjoy the marvels of this technology youneed to have a set top box installed together with the appropriate multi-sized satellite receiving dish to have access to hundreds of channels oftelevision and radio. Television companies who supply the smart cards,such as Sky, cannot legally send cards direct to an address abroad since206 HOW TO BUY A HOME IN SPAIN Radio Telephoning Telefonica (the Spanish telephone company) charges for calls, line rentaland telephone rental. The tariffs are for local, national and internationalcalls. Time tariffs exist for peak, normal and night time. Peak times are8 am to 8 pm Monday to Friday, and 8 am to 2 pm on Saturday.Emergency telephone numbers are published in the white pages of thetelephone directory and also in English language weekly newspapers. Telefonica has competition for its landline service from cheap call 14 LEARNING ABOUT CULTURE AND CUSTOMS 207 operators but, like many major companies, it meets this competition headon with price reductions and special offers. MoviStar is the mobile phonecompany of Telefonica which has far greater competition from Vodafoneand other companies. Computers Newspapers All the European daily newspapers are available. They are printed inSpain but cost three times more than the national edition. Weekendnewspapers also have some sections missing. The best reads for the ex-pat are the locally printed English language weekly newspapers. They area good blend of national and local news, lots of gossip, information and208 HOW TO BUY A HOME IN SPAIN adverts. Indeed some of the small ads are reminiscent of standing insidea central London telephone box! Popular English language books are more difficult to find but large andsmall English bookshops do exist. Specialist titles are best purchasedthrough e-commerce. 15 209210 HOW TO BUY A HOME IN SPAIN Of course there is the sun worshiping and the cerveza drinking but thenovelty of that soon wears off since it can only lead to boredom oralcoholism. This will hopefully be replaced with a more positive attitudeto life: getting out, learning about the country, developing new interestsand meeting new people. The real way to learn about a country is to travel. There are othermethods, such as reading books and tourist guides, which are colourfuland informative. Watching travel films too has its place, but it is only bygoing to see a place that true its ambience can be experienced. There areplaces where you can enjoy the sun, the sea and the mountains. There are 15 ENJOYING A NEW LIFESTYLE 211 211 places where you can benefit from the climate and keep in shape withyour favourite all year round sport, where you can discover local historyand monuments, travel down hidden byways and forest tracks,participate in local fiestas, meet local people ... and much more. Jump into a car and go! On minor country roads the traffic is amazinglylight, even in the height of the holiday season. Go 20 kilometres inlandand there is virtually no traffic on roads throughout the year. Gettingaround is a pleasure but avoid autopistas and autovias for at rush hourthey can be no better than the M25. No! It is time to put the more active stuff on the back burner. Slow down.Remember, this is Spain - where time is not important. Consider the lessathletic pursuits where skill, knowledge and abilities can be honed toperfection with practice, practice and more practice. Golf and bowlsperhaps! Tennis or maybe hiking! Tone up at a gym. Take up fishing.212 HOW TO BUY A HOME IN SPAIN Golf A hundred years ago the screaming, jumping and beating of clubs on theground was called witchcraft. Today it is called golf. Golf in Spain isbooming, driven by tourism and the climate. The worldwide success ofBallesteros, Olazabal, Jimenez and Garcia has contributed to thissuccess. Ballesteros is a star in Spain, an icon in Britain and if he hadbeen Italian would by now have been painted on the ceiling of the SistineChapel. The Costa del Sol is often referred to as Costa del Golf; such is theprofusion of new courses. They are carved out of barren landscapes,pampered and watered to produce lush green fairways. Consequentlygolf is not cheap: 60€ for a round is common! In Scotland, the home ofgolf, it is a game for the working man. In Spain it is a game for touristsand wealthy residents. Hiking Walking or hiking clubs exist in all the main areas. For the adventurous,the best places to go are the Picos de Europe in Northern Spain, thePyrenees near the French border, the Costa Blanca inland from Benidormand around the Sierra Nevada near Granada. Strangely, hiking is not toopopular with Spaniards but is hugely popular with new foreign residents. Many holiday companies offer Spanish walking tours. This has given riseto some excellent English language publications describing good detailedroutes with clear concise maps. Trails are way-marked and the onlyhazards encountered are dogs and the unhygienic nature of some refugehuts. It is important not to underestimate some of these rugged trails withsnow on high ground, rapidly changing weather and steep paths. 15 ENJOYING A NEW LIFESTYLE 213 213 Bowling Sailing Fishing Tennis Running It is not too hot to run! Spain, like all countries, has its runners andjoggers. It has superstars too. It has often been host to internationalathletics meetings. Each town has its own sports ground complete with arunning track. Marathons and half marathons are commonplace - but notin summer. Gyms While France accepted nudism, it was not until the early 70s that toplesssunbathing appeared in Spain, even though the patrolling Guardia Civiladvised people to cover up. Today it has changed with the practicecommon and nudism allowed in certain designated areas. The first nudist resort appeared in 1979 near Estepona on the Costa delSol but other beaches, about 60 officially designated and other unofficialones, are widely accepted as locations for naturism. Skiing Ever heard of the Costa Blanca Ski Club? It sounds unreal. The CostaBlanca is sun, sea and sand! Literally hundreds of skiers travel from theCosta Blanca and all parts of Spain to the Sierra Nevada each year. It hasseveral unique features as it is the southernmost ski centre in mainlandEurope and is also one of the highest, giving a long season with goodsunshine, lasting until May. It is only 150 kilometres from the Costa delSol and 400 kilometres from the Costa Blanca. Just outside Granada the resort is well developed with hotels, parking for216 HOW TO BUY A HOME IN SPAIN Sports federations There are many other sports available - squash, skiing, beach and watersports, horse riding, mountaineering, gliding, cycling, and of coursefootball, football and more football. Each sport has its own federation,which is always a good starting point for information. MIXING SOCIALLY Foreigners seek their own wherever they go, but perhaps the English-speaking do so with more enthusiasm than other nationalities. Somepursue intensely social lives within the community while somedeliberately shun the company of their compatriots. In the early stages ofvisiting Spain the support received from other expatriates is oftenimportant in cementing friendships and forming social networks. Thenewcomer is typically ascribed a subordinate or dependent role, seniorityamong expatriates being mainly determined by their length of residence.A second influence is the degree of permanence versus seasonality ofresidence, as long-term residents tend to look down on tourists, eventhose of their own nationality. In 1992 the BBC filmed an ill-fated soap drama near Mijas, creating animage that the British expatriate community on the Costa del Sol lived inan artificial world. The programme was based on a conceived stereotype 15 ENJOYING A NEW LIFESTYLE 217 217 RELAXING Spain's manana attitude can help people to relax and become morephilosophical. Does it really matter if there is a delay so long asemergencies are dealt with as they happen? Does it matter if there arequeues, it does not seem to bother the locals and what's the point ofgetting upset?218 HOW TO BUY A HOME IN SPAIN Driving a few miles inland, the buzz of the coast disappears. Park the carand just walk in the countryside and you are immediately struck by howcalm everything is. Of course you hear the sounds of nature, birdssinging, strange rustlings in the long grass made by some unseencreatures, noise of the breeze in the trees overhead, but at other timesthere is almost complete silence. Go higher into the mountains, stop fora few minutes and just listen to ... nothing. Avoiding Failure 219220 HOW TO BUY A HOME IN SPAIN A NEED TO LEARN A true explanation for people going back home probably lies elsewhere. CASE STUDY Employment live but after three years had not been able to obtain suitable employment Neither could speak Spanish. ON THE DOWNSIDEHoliday homes Female residents Sahara rain In Southern Spain the phenomenon of Sahara rain occurs once or twice peryear. Rain clouds moving north from the Sahara desert deposit a thick, reddust on new, clean, white houses. This disconcerting act of naturenecessitates a major clean up with brushes, water and power hoses. Retirement At the end of a long working life retirement is a goal richly deserved, butit can be hard to stand back and relax. The cut and thrust of business canbe missed, particularly when entrepreneurial opportunities in Spain areclearly obvious. People may have been married to each other for 40 years, but living ineach other's company for 24 hours per day, seven days per week is a newexperience. Tensions can develop. Nothing to do Boredom can be a killer. After the house is sorted, the car running smoothlyand the garden done, what happens next? It is important to keep an activemind and body, for the soporific heat of the Spanish sun will soon slowsenses. Sun worshipping, a daily gin and tonic or serious cerveza (beer)drinking can make for an easy life, but only in the short term. A free holiday A move to the sun and suddenly it is amazing how many 'friends' areacquired. Of course it is wonderful to have visitors, but if you are not 16 AVODING FAILURE 223 Over-development Spain has the climate, the laid-back lifestyle and also a booming propertymarket whereby the whole of the Mediterranean coastline betweenFrance and Gibraltar is almost covered in concrete; so developers arenow moving inland. The Mediterranean coast is now for the developmentof hotels, apartment blocks and townhouses. Very few villas are underconstruction since a piece of land that could support one villa couldprobably support an apartment block instead. Villas built along the coastseveral years ago are now having their line of sight affected by over-development. sites. Builders drive heavy trucks over existing pavements and drains andin the process damage them. They drive lorries full of earth throughresidential areas, scattering mud or dust over existing roads. Tolerance A more complex reason exists for people returning home. It has nothingto do with bricks and mortar, nothing to do with the physical aspects ofchange, nothing to do with Spain. It is about human relationships. Backhome, people have spent 40 or so years achieving their position in aclass-divided society, represented on one level by their place ofresidence. The detached house in Oslo, the apartment in Dublin, theblock in Frankfurt, the cottage in Antwerp, the terraced row in Burnleyare all forgotten and replaced by a single-status society of what you arenow and not what you were. Since equality on the urbanisation is thename of the game, it is hardly surprising tensions occur. Primary groups form: the golf fanatics, the night owls, the heavydrinkers, the restaurant dwellers, or simply those who wish to gossip.Others may want to keep to themselves. Either way they may get on witheach other, or they may not. Tolerance is needed: tolerance to acceptdifferent lifestyles, different needs and different backgrounds. of sunshine, the high mountains, the vast plains, the nightlife, theevenings, the magnificent cuisine, the restaurants ... Too many hours or too many pages are necessary to say what Spain hasto offer. There is only one way to be sure; come and see it for yourself.Spain for a holiday home, for work, for a long-term stay, or for retirementcan be a step into the unknown. But if some simple preparation isundertaken it can be a step into sunshine and happiness. Place Date Parties Both parties consider each other to have sufficient legal power to enterinto this purchase and sale contract by mutual agreement. StatementsOne: 227228 HOW TO BUY A HOME IN SPAIN Two:On the above mentioned area will be built 458 bungalows as per plansand drawings prepared by Master Architectliving at The builder is living at whoreserves the right to modify the number of bungalows or apartments orthe project itself, if necessary, due to architectural or town planningreasons. Three:That among the bungalows or apartments is numberin the urbanisation of with a usable surface ofapproximately 64 square metres, a built one of 76 square metres and aplot size of approximately 100 square metres consisting of thefollowing elements: Four:The Vendor is interested in selling thedescribed property and the Purchaser inbuying it, according to the following clauses: APPENDIX 1 229 Clauses FIRST sellstowho buys the property described in the third statement of this contract. The selling is carried out with all rights, facilities and services whichare inherent in the sold property, the results of the building project andthe development rules including the proportionate part, correspondingto the communal element zones of the urbanisation. In the sale are included all the communal rights of the urbanisationcalled The maintenance of the communalarea is paid by the owners for the present and future phases. FIFTH In the event the Purchaser is not able to pay the amount of oneor more of the payments on the established date, which is indicated inthe second clause of the contract, and notifies the Vendor in writing, thePurchaser can pay the balance with corresponding interest. SIXTH Upon the agreed price being paid in full, plus cost of theapplicable taxes and other agreed obligations, the Vendor will grant tothe Purchaser the Escritura to be issued before the Notary nominatedby the former, in the city of within a period of15 days from the date of payment. TENTH For any legal matter between the Vendor and Purchaser asnotified at the heading of this contract, where the Purchaser is a non-resident, it will be submitted to their legal address. TWELFTH In the event of any dispute arising from this contract, theparties submit themselves expressly to the Courts and Tribunals of and their superiors, or by default the Courtsand Tribunals of renouncing any others towhich they might otherwise be entitled, as this document shall begoverned according to the Laws in Spain. COMMUNITY RULES All those deeds which have not been included in the STATUTES OFTHE COMMUNITY OWNERS are to be resolved according to theHORIZONTAL PROPERTY LAW 49/1960 AND POSTERIORREFORM BY LAW 8/1.999, published on 8 April 1999. The Property 2. The owners or occupants of the property are not allowed to carry outactivities which are forbidden in these statutes, harm the building, orinfringe general laws with bothersome, unhealthy, dangerous or illegalactivities. 233234 HOW TO BUY A HOME IN SPAIN d. The grills, walls, awnings and all the external elements must follow a model approved by the Community. h. To keep silent during the rest time, from 14.00 to 16.00 hours in the afternoon and after 24.00 hours. APPENDIX 2 235 Community Board All the managerial posts are elected for one year. All those designated can be removed from their post before the expiration of the period by agreement at an Extraordinary Meeting of Property Owners.236 HOW TO BUY A HOME IN SPAIN 5.3 All those works, repairs or improvements which exceed the amount allocated to the President to be agreed by the General Meeting, from at least three different estimates. Communal Areas 10. No owner can claim the right to a parking space in their garden, since in no title deed is it stated the garden should have access for vehicles or inside parking. If the property has vehicle entries in the garden it will depend on the goodwill of the neighbours to keep this access clear. Bulky vehicles, trucks, big vans and machinery cannot be parked in the private streets of the Urbanisation. The vehicles parked in private streets must be moved to the other side of the street every 15 days, in order to clean the streets. All those vehicles parked in the private streets for more than two months are to be removed to a nearby place. In this case the crane hired to remove the vehicle is to be paid by the owner. 11. All owners must observe the Statutes, informing the President of any infringement, in order to take any necessary measures according to the seriousness of the infringement or damage caused.238 HOW TO BUY A HOME IN SPAIN 12. The swimming pools, as communal areas, are at the disposal of all owners, who must respect them at all times. 17. During the months of July and August two caretakers are to be hired, one for each swimming pool. The caretakers are to have the following tasks: APPENDIX 2 239 19. The use of flippers, playing with balls, and swimming without clothes, is not allowed.240 HOW TO BUY A HOME IN SPAIN 21. Chairs, parasols, air mattresses and floats for adults are not allowed in the pool. 22. Solar creams must be eliminated before going into the water by means of a shower. 23. Everyone, without exception, must have a shower before going into the water. Appendix 3 ESCRITURAA deed of purchase and sale Protocal Number APPEARS 241242 HOW TO BUY A HOME IN SPAIN quoted but does not accredit his NIE and he is advised by me, theNotary, that according to R.D. of 2nd February 1996 in Article 61, it isobligatory for foreigners in Spain to have a Foreigners' IdentityNumber. REPRESENTATION (Full name) in representation with Power ofAttorney for (Building company full name)formed for an indefinite time on the (Date)before the Notario of (Name of City) (Name of Notario) with the number of hisProtocol with official CIF, number and office address THEY STATE Description Community Quota Inscription Title (Name) number ofhis Protocol. The new work and horizontal division is declared, before the Notary of (Town) (Name) theday (Date). Origin The house described forms part of the second phase of the group 'AlAndalus' comprising two phases; the first phase comprising 274dwellings and the second phase 184 dwellings. The second phase of the group urbanisation called 'Al Andalus', in theboundaries of Orihuela, in the urbanisation Partial Plan 'Las Piscinas' iscomposed of this residential group of 184 dwellings, of which 62 areground floor, 62 are first floor denominated bungalows and 60individual, denominated chalets. It is free of charges, except for any fiscal obligation of the tenants andlessees and the current payment of the quotas to the communitydeclared by the sellers. The buyer accepts the Certificate sent by theSecretary, previously approved by the President. The plot on which the properties are located is liable to the costs of APPENDIX 3 245 Information Registry The notary makes known that the description of the property, itsownership and the charges, in the form previously referred to, are of thestatements of the sellers, of the title of property shown to me and of theNota Simple of the registration of the property, obtained by me, which Ihave seen. Common Elements and the Law of Horizontal Property are the resultsof the application of Article 396 of the Civil Code and Law 49/1.960 of21 July with the following: 4. The apartments, no matter how many times the owners requests it, will not be the subject of regrouping, aggregation, segregation, division or subdivision, and in general any other modification, except for reasonable access as appropriate for opening new holes to common elements. 6. The walls that separate the different elements of the group will be built following the pattern approved by the constructor with the object of uniformity within the urbanisation. No modifications or the use of ornamental materials can be undertaken without the constructor's previous consent. 7. The owners of the dwellings cannot cover the existing air vents located under the dwelling for ventilation. 8. The owners of the dwellings on the top floor, who enjoy the use of their terraces, are responsible for the cleaning of the existing drains, APPENDIX 3 247 it being their responsibility and not that of the constructor for smells and dampness. THEY GRANT Fourth The seller to receive from the buyer the Value Added Tax (IVA),that is to say 7% on the conventional price as entered in the Treasurypublication.248 HOW TO BUY A HOME IN SPAIN Fifth The buyer agrees to accept the norms of the community and tohave received a letter with a recommendation on maintenance from (Name of the community administrator ofproperties). Sixth The buyer recognises that, by virtue of this sale, they assumeresponsibility for the payment of light and water, and any other billsrelevant to the house as well as carrying out any appropriatemaintenance. Seventh It is understood that the seller of the dwelling has given to thebuyer a multi risk building insurance policy taken out with for one year. I give them advice, legal and fiscal warnings, especially those withregard to the 30 working days for the authorisation of this deed, toliquidate the same, and to affect the Tax on Patrimonia Transmissionsand Documented Juridical Acts, as well as being affected by theconsequence of this Tax and the present document. I read this deedwhich is verbally translated into English for the convenience of thebuyer, the translator being known by me, by name of with residence inand with residence card number I give again the warning made previously by me, the Notary, that thebuyer had the right to an official translator but this was not required andfinding that the document is satisfactory they sign, in the presence ofthe translator, with me the Notary, and that I publish the deed in nine APPENDIX 3 249 I GIVE FAITH (Notary) (Translator) Appendix 4 At (Address) on(Date) GATHERED All present are in their own names and rights and are recognised to 250 APPENDIX 4 251 251 have the capacity to complete the private contract of sale and purchase. TITLE CLAUSES B) The remaining sum of the total price of the sale and purchase Euros will be paid by the buyers at the moment of the signing of the corresponding escritura. THIRD The expenses that are derived from completing the escriturawill be to the account of the buyer with the exception of the plus valia APPENDIX 4 253 253 which will be to the account of the seller. Also to the account of theseller will be all the charges derived from the cancellation of themortgages as well as those for the work of amplification of theescritura. SIXTH Both parties designate the address given at the heading of thisdocument in order to effect notifications, requirements, and citations. The sellers and the buyers sign this present contract in duplicate inthe place and date established in the heading. Signature Sellers Signature Buyers Appendix 5 Number ResidentialUrbanisation 254 APPENDIX 5 255 255 Third The Buyers accept to pay the remaining part of the total price Euros at the signing of the Title Deed, whichwill take place no later than Fourth The Seller has the obligation to pay and cancel any debts,encumbrances, limitations or prohibitions that the property may haveinscribed or not at the Land Registry. Fifth All fees and taxes related to this agreement and to the Title Deeduntil its inscription at the Land Registry are included in the above price,except the Plus Valia tax which is the obligation of the Seller. Sixth Any discrepancies that may arise between the parties with regardto the present agreement shall be resolved at the Law Courts of according to Spanish Law. Signed in on The Buyers Northern Spain 256 APPENDIX 6 257 Eastern Spain Southern Spain Islands PUBLIC HOLIDAYS The central government allows 14 days paid public holidays per year.Twelve national holiday days are highlighted above. Each region alsocelebrates its own holiday with additionally most towns and villageshaving their own carnival and fiesta days. If a holiday falls on aTuesday or Thursday, shops and offices may be closed on theintervening Monday or Friday making it a long weekend. 260 Appendix 8 261 Appendix 9 COMMON QUESTIONS Spain offers an excellent climate, low cost of living, good healthy foodand drink and a relaxed lifestyle. Some disadvantages include a highpetty crime rate on new urbanisations and lots of 'red tape'. Initially, someone who can offer a wide range of properties in the areaof choice and secondly someone who will help in the difficult settlingin process. A good agent will be a member of a professionalorganisation. 262 APPENDIX 9 263 Sporting facilities? The countryside and sea provide a natural backdrop for all sportingactivities of which golf, bowling, tennis and walking are the mostpopular for northern Europeans. For people not interested in sport,264 HOW TO BUY A HOME IN SPAIN Any myths? Yes, one seems to constantly crop up. Upon death the Spanishgovernment does not reclaim your property. Just do the normal thing;make out a Spanish will for Spanish assets. Appendix 10 USEFUL PHRASES Greetings Hello HolaGood morning Buenos diasGood afternoon/evening Buenas tardesGood evening/night Buenas nochesHow are you? Que tal?Fine, how are you? Muy bien, y usted?See you later Hasta luegoSee you tomorrow Hasta mananaGoodbye Adios Useful words Sorry PerdonPlease For favorThank you Gracias 265266 HOW TO BUY A HOME IN SPAIN Questions Again Pardon? Como?I do not understand No comprendoI do not know No seHow do you write it? Como se escribe? People Time The home bathroom el banobed una comabedroom el dormitoriochair una silla268 HOW TO BUY A HOME IN SPAIN curtain cortinahouse in the country fincadining room el comedorflat el pisohouse with internal stairs duplexhouse la casakitchen la cocinaliving room el salonold farmhouse cortijoroom la habitationsofa un sofatable una mesa Colours black negroblue azulbrown marrongreen verdeorange naranjared rojowhite biancoyellow amarillo APPENDIX 10 269 Numbers 0 cero 30 treinta1 un/una/uno 40 cuarenta2 dos 50 cincuenta3 tres 60 sesenta4 cuatro 70 setenta5 cinco 80 ochenta6 sets 90 noventa7 siete 100 den8 ocho 101 ciento uno9 nueve 110 ciento diez10 diez 200 doscientos11 once 300 trescientos12 doce 400 quatrocientos13 trece 500 quinientos14 catorce 600 seiscientos15 quince 700 setecientos16 dieciseis 800 ochocientos17 diecisiete 900 novecientos18 dieciocho 1.000 mil19 diecinueve 2.000 dos mil20 viente 3.000 tres mil21 vientiuno 1.000.000 una million22 vientidos23 vientitres24 vienticuatro25 vienticinco26 vientiseis27 vientisiete28 vientiocho29 vientinueve270 HOW TO BUY A HOME IN SPAIN Days Monday lunesTuesday martesWednesday miercolesThursday juevesFriday viernesSaturday sabado Sunday domingotoday hoy Months Seasons Interpreting Financial planning 271272 HOW TO BUY A HOME IN SPAIN Pets Department of Environment(export of dogs and cats) APPENDIX 11 273 Taxation Miscellaneous FURTHER READINGSpanish history Spanish culture 274 APPENDIX 12 275 Going to Spain Best Places to Buy a Home in Spain: Joanna Styles (Survival). All thefacts.Foreigners in Spain: Graeme Chesters (Survival). Triumphs anddisasters.Going to Spain: Harry King (How To Books). Another straightforwardguide.Retire Abroad: Roger Jones ( How To Books). Happy retirementabroad. Travel Tapas and more great dishes from Spain: Janet Mendal (Santana).Spain's bar food. Humour 277278 HOW TO BUY A HOME IN SP.
https://it.scribd.com/document/419527309/Harry-King-How-to-Buy-a-Home-in-Spain-the-Complete-Guide-to-Finding-Your-Ideal-Property-2007-How-to-Content
CC-MAIN-2019-51
refinedweb
23,911
62.58
IK 7Courses Plus Student 881 Points what if I wanted to remove multiple items in one code? my_list = [1, 6, 9] let's remove 6 & 9, how would you do it? in one Code? solution ? 3 Answers Jon Mirow9,851 Points Hi there! Short answer: filtered_List = [ x for x in my_list if (x != 6 and x != 9)] if there were many things you wanted removing: things_to_remove = [3, 9, "Neighbours cat"] filtered_list = [x for x in my_list if x not in things_to_remove] Explaination below if desired :) I think what we're talking about is really filtering a list right? Probably the most common way to build a new list in this kind of way is with list comprehension (we're usually building a new list, even if it's just a clone with [:], because we never want to iterate through the thing we're changing) So ,say I wanted to make a list of 10 random numbers between 1 and 10: from random import randrange random_List = [ randrange(1, 11) for x in range(10)] Okay, if you've not seen list comprehension before that looks pretty complicated right? Basically all we're doing is a normal for loop: random_List = [] for x in range(10): random_List.append(randrange(1, 11) But we condense it all into one line, by wrapping it in the list brackets "[ ... ]" and putting what we want python to do before the for loop. It might look a bit weird, but this is actually closer to the english language way of describing what's happening - this is basically saying "give me a random number between 1 and 10 for every element in ...." Just like for loops, we can add conditionals to this syntax. So to build a list comprehension that would filter out 6 and 9: filtered_List = [ x for x in random_List if (x != 6 and x != 9)] This one is actually a little more readable right? build a new list of each element from the old list only if that element is not 6 or 9. List comprehension is the most common way to be honest. However you can also use filter: even_List = list(filter( lambda x: x % 2 == 0, random_List)) Here we get a list only containing the even elements of the original random_List. Of course you could pop in the logic from the previous example to filter by 6 and 9, I'm just showing how you could use it. The way filter works is to take a function as the first argument, an iterable as the second, and go through the iterable applying the lambda function, just like a for loop. It returns a filter object, so we have to wrap it in the list() constructor to get a list back Obviously I can't fully explain all the code here, but I hope it helps :) MIK 7Courses Plus Student 881 Points thank you Keith Ostertag16,619 Points I'm a beginner as well, but I think another way would be to use a slice (which hasn't yet been introduced in the video series at this point). >>> my_list = [1, 6, 9] >>> new_list = my_list[:1] >>> print(new_list) [1] That gives the first member of your list. Using slice sequences can be tricky and of course this is just a very simple example.
https://teamtreehouse.com/community/what-if-i-wanted-to-remove-multiple-items-in-one-code
CC-MAIN-2021-43
refinedweb
547
66.27
When using Autolev to solve dynamics problems, you can use it to produce C code that will run the numerical analysis in order to solve the ODE's. The typical process is to compile the resulting C code in whatever compiler you have handy and then run the compiled version. By using Ch you can not only skip the compile step, but you can also get output in the form of plots as you run the code instead of having to postprocess some output files with Excel or some other plotting utility. Running a C program created by Autolev in Ch is the same as running any other program. You simply start Ch and type the file name, given that you're in the same directory. Therefore the majority of this web page will describe the steps necessary to use the plotting capabilities of Ch to get immediate output instead of going throught the post processing procedures. It is assumed that, if you're looking to use the code shown on this page, you have a basic working knowledge of both C and Ch. Any questions on specific code that was used can be directed to me via email. The example code that's used here is some that I wrote while taking Multibody Dynamics, MAE 223. Therefore a lot of the specific variable names that I used can be changed depending on what you would like them to be. Also, several of the variable need to be placed in certain spots in the C file. I will try to point out where and show some of the Autolev created code to help with this, but it would probably be helpful to have your c file open to compare with pieces of code I'll show. Here is a list of the necessary steps to create output plots directly in the Autolev C file. Here are several suggestions that can make life easier before you begin modifying your code. These are not necessay, but I found them useful. First is to make a separate file that has your additional code so that it can be pasted into the program instead of typed in as you go. This is handy in case you discover a small error in your Autolev program and need to create a new C file. If the changes you've made aren't saved some where, you will have to rewrite them because Autolev will overwrite the old program if you didn't move it. This also makes it easier to modify subsequent programs. Second is to put all of your addtional code together in blocks labeled with comments before and after. If you have errors when running program or if you need to make small changes to your code, this makes it much easier to wade through the large Autolev program and isolate your code from the Autolev created portion. Third, save plots to external files. When running the program it would be fairly common to run it several times with different initial conditions or time frames. If the plots are saved externally, then it becomes very easy to move all of the output to a separate folder and rerun the program thereby saving both sets of data. To add plotting and numerical arrays to your program you only need to add the chplot and array header files #include <ctype.h> #include <math.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* Header Files Added */ #include <array.h> #include <chplot.h> /* Header Files Added */ For creating the array used in plotting, you have to define the array size. This can be done directly in the declartion statement for the array, but if you want to run the program over a different time span or change the time step, the array sizes will have to change. By using a macro to define the array size, you'll only have to change the size in one place. Add a #define statements to set the number of points in the arrays. #define _NAN 9.99999999999999E+305 /* Constant Definitions Added */ #define POINTS 51 // Number of data points /* Constant Definitions Added */ There are two types of variables needed to do the plotting, objects of the plot class and computational arrays. The exact number of each one will depend on how many plots you'd like to create. Obviously you'll need one plot object for each plot. Don't forget that you can put more than one data set on a plot and even create subplots if you like. As for the arrays, you need one for time and one additional one for each data set. In this code, there are four plots being created, one each for θ, ω, α, and torque. Notice that for each plot there are actually four sets of data. Each variable is a [4] × [something] array. This makes it extremely simple to plot all four set on one graph as I'll show in the plotting seciton. Also note the count variable. This will become necessary when entering data into your arrays in the output section as a way of indexing through the elements of the arrays. You can see here how the number of data points for each one was set with the maro POINTS. double Pi,DEGtoRAD,RADtoDEG,z[189],... /* variables added */ class CPlot plot1; class CPlot plot2; class CPlot plot3; class CPlot plot4; int count = 0; double time[POINTS]; double angles[4][POINTS]; double angvel[4][POINTS]; double alpha[4][POINTS]; double torques[4][POINTS]; /* variables added */ In order to create the plots with Ch, the output files that Autolev writes to need to be closed. It is important to do this in the correct place of you will mess up the program. Whereas all the previous code was added before any function definitions, this code is added to the main function. The last thing the program does is write several messages to the screen to telling you about the various files. Then there's the return 0; statement. Close the files after the program writes these messages to the screen. This is done with the fclose statement as show below. Autolev uses the array Fptr[] to point to all the output files. The number of files you have will depend on the number of output statements in your Autolev code. You can also look for the comment /* Open input and output files */. The for loop just after this will show how many files are being opened. Just add the necessary number of close statements. /*... /* Added to Close file and plot results */ return 0; } Where the etc... just means to add the number you need. Note that I didn't close the Fptr[0] file. This is the input file and I found closing it to be unecessary, but at this point the program doesn't need the file any more so closing it shouldn't hurt. After you close the output files you can create the plots. I set up the program to save the plots as files and to output them directly to the screen for immediate feedback. Below are the commands used for one plot. They can be repeated as many times as necessary. /*... plotxy(time, angles, "Angles", "t", "angle"); plotxy(time, angles, "Angles", "t (s)", "Angle (deg)", &plot1); plot1.legend("tang ", 0); plot1.legend("lang1", 1); plot1.legend("fang ", 2); plot1.legend("lang2", 3); plot1.legendLocation(0.2,240); plot1.outputType(PLOT_OUTPUTTYPE_FILE, "png color", "plot_1.png"); plot1.plotting(); /* Added to Close file and plot results */ return 0; } The first plotxy will give you the quick sceen output without using the CPlot object. The rest of the commands are for creating the plot with the CPlot object and then saving to the file. The nice part about using the plotting object is it allows you to do more with the layout. In this program, the plots are saved as .png files. I've found that the plots look nicer if saved as .eps files, but you will need a program that reads them. To get the data into the arrays you need to go to the output function in program. This is where the program writes to its output files. At the end of the fuction, there is at least one writef statement. After this, assign the output to the arrays that you defined. This is where the count variable gets used. Having initialized count to 0 previously, count will be the index for the array element that the data is saved to. Autolev uses the T variable for time. The rest of the variables are the ones that you defined in Autolev. Don't forget at the end of the assignment statements to increment the count variable to continue throught the arrays. /* Write output to screen and to output file(s) */ writef(stdout, " %- 14.6E", T,... writef(Fptr[1]," %- 14.6E", T,... /* Added arrays for plotting */ time[count] = T; angles[0][count] = (TANG*RADtoDEG); angles[1][count] = (LANG1*RADtoDEG); angles[2][count] = (FANG*RADtoDEG); angles[3][count] = (LANG2*RADtoDEG); angvel[0][count] = U1; angvel[1][count] = U2; angvel[2][count] = U3; angvel[3][count] = U4; alpha[0][count] = U1p; alpha[1][count] = U2p; alpha[2][count] = U3p; alpha[3][count] = U4p; torques[0][count] = TA; torques[1][count] = TH; torques[2][count] = TK1; torques[3][count] = TK2; count++; /* Added arrays for plotting */ Here I've data being saved to all the arrays that I set up in the variables section. With this you should be able to get plots for all your significant data from within your Autolev created C program. If your just trying out your program for the first time and are not sure if you need to make corrections, you might want to look at the output plots without having to define new variables inside the program. Here is a quick way to use the plotting capabilities of Ch without making as many changes. You can modify the output files that the program writes so that Ch will read them and use a separate Ch program to plot the data from the files. The main disadvantage to this method is that Ch won't plot more than one curve this way. If your output file has multiple columns of data Ch will use the first for the X values, the second for the Y, and ignore the rest. Still, it can be useful for simpler models. First in main, locate section commented /* Write heading(s) to output file(s) */. The fprintf statements must be modifies so that Ch will see these headings as comments. This can be done by placing a pound sign " #" where the beginning of each line will be in the resulting output file. Then these files can be plotted with another program such as the one below. Notice the inputs to the plots are the modified data files. Here, I had run the program twice with different initial conditions and renamed the output file after each run. That allowed me to plot two curves simultaneously, but each file has only two columns. The modified code from the Autolev C program. /* Write heading(s) to output file(s) */ fprintf(stdout, " FILE: p-13-10.1\n\n *** %s\n\n", string); fprintf(stdout, " T Q2\n" " (UNITS) (DEG)\n\n" ); fprintf(Fptr[1], "# FILE: p-13-10.1\n#\n# *** %s#\n#\n", string); fprintf(Fptr[1], "# T Q2\n" "# (UNITS) (DEG)\n#\n" ); /* # at each line of heading */ The program used to plot the files. /* p-13-10-plotab.ch */ /* Plotting the output of p-13-10.ch for Dynamics */ /* Initial values: q1(0) = 45 & q2(0) = 1, 0.5 */ #include <stdio.h> #include <chplot.h> int main() { class CPlot plot; char *title = "q2 vs. t w/ q1(0) = 45"; char *xlabel = "time (s)"; char *ylabel = "q2 (deg)"; plot.dataFile("p-13-10.1(a)"); /* input file */ plot.dataFile("p-13-10.1(b)"); /* input file */ plot.legend("q2(0) = 1.0", 0); plot.legend("q2(0) = 0.5", 1); plot.legendLocation(9,1.5); plot.title(title); plot.label(PLOT_AXIS_X, xlabel); plot.label(PLOT_AXIS_Y, ylabel); plot.plotting(); plot.outputType(PLOT_OUTPUTTYPE_FILE, "png color", "plot.png"); plot.plotting(); return 0; } If you'd like to down load the code fragments that I included on the page, but can not get them directly from the page, here is a text file with all the code included. Get the Code fragments in this text file On this page, there's an example problem that with the code from Autolev, the original Autolev C program, the modified C program, and all the associated output. It is a fairly simple problem that you should be able to work through easily Hopefully this information has been helpful. If you have any questions or comments they can be directed to Matt Campbell whose email can be found on the MAE Grauduate Student Directory Autolev™ is the property of OnLine Dynamics, Inc.
http://iel.ucdavis.edu/projects/autolev/
crawl-002
refinedweb
2,166
72.56
I need some help getting my code to compile. The short version: I'm using Atmel Studio 7 and an ATmega324PB. Unfortunately it seems support for the device isn't (fully?) in the toolchain yet. What do I have to update/do in order to support it? The longer version: I have a small project using the ATmega324PB, and have just got a board assembled with the device on board. I've starting writing some simple test code to make sure the hardware works, but have just discovered the toolchain doesn't support(?) the ATmega324PB yet. My test code is: #define F_CPU 20000000UL #define UART_BAUD_RATE 250000UL #define MAX_PARMS 4 #include <stdlib.h> #include <avr/io.h> #include <avr/interrupt.h> #include <avr/power.h> volatile uint8_t timer1CompAFlag = 0; uint8_t loopCount = 0, stageCount = 0; int main(void) { // Port A is wired to J9 DDRA = 0xFF; PORTA = 0x00; // Current clock internal 8 MHz oscillator, with /8 divider -> 1 MHz // Timer 1 setup for CTC mode, 25 ms tick (40 Hz) OCR1A = 0xF423; // At 20 MHz clk, 25 ms tick / 1 MHz -> 500 ms TCCR1A = 0x00; // Outputs off, Mode 4: CTC TCCR1B = 0x0A; // Mode 4: CTC, /8 prescale TIMSK1 = 0x02; // Enable Timer 1 output compare match A interrupt // Enable interrupts sei(); /* Replace with your application code */ while (1) { if (timer1CompAFlag == 1) { timer1CompAFlag = 0; PINA = 0xFF; if ((stageCount == 0) && (loopCount == 8) ) { loopCount = 0; stageCount = 1; clock_prescale_set(clock_div_1); } else if (loopCount == 8) { loopCount = 0; } } } } ISR(TIMER1_COMPA_vect) { timer1CompAFlag = 1; } The first problem I had is the warning/error messages: implicit declaration of function 'clock_prescale_set' [-Wimplicit-function-declaration] 'clock_div_1' undeclared (first use in this function) which led me to examining power.h in 'C:\Program Files\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr'. As far as I can tell, it lacks an "if defined" statement for __AVR_ATmega324PB__, so the first issue I have is that the power.h header, and likely everything else, isn't updated with support for the 324PB. Digging a little more, I can't find out where __AVR_ATmega324PB__ *should* be defined. I initially thought it would be defined in 'iom324pb.h', but that file doesn't exist. I now can't understand why the compiler *does* recognise macros such as TCCR1A. If I comment out #include <avr/io.h> the compiler doesn't recognise the macros, but I all I can tell is that io.h should call an include to iom324pb.h and it doesn't. So where are those macros being defined? Also, io.h already expects __AVR_ATmega324PB__ to be defined, so I'm at a loss to where to find that. I did some more digging, and I appear to have toolchain v3.6.1.1750, and found v3.6.2.1759 on the Microchip website. I downloaded and unziped it, and still no iom324pb.h. That said, I don't know exactly what I need to do to update the toolchain anyway. But note that for a while now the compilers have been structured so it's easier to add new models of AVR after the compiler has been built (saves reissuing the compiler every time new devices are launched!) and this is done with "device packs" (and they are introduced to avr-cc using the -B option. So support for "newish" chips like 324PB probably comes from a device pack. So if your device packs are out of date you may not have everything required. Tools-Device Pack Manager... can be used to make sure your packs are up to date. Having said that my packs are (I believe) up to date and yet when I try to build your code for 324PB I get the same error. To be honest I don't know how the "packs" thing is supposed to handle a "shared" header like power.h. I'm guessing that instead of using C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\power.h when a "pack" is involved it should be using an updated copy of the file from the pack location. Perhaps Morten from Atmel who does this stuff will be along in a while to explain more?? BTW when it compiles I see: I need to check if there's an updated power.h somewhere close by. EDIT: OK so I went back uyp a few directory levels and in the region of "packs" there's no sign of power.h. This all seems to be an oversight in the whole pack support thing. If power.h contains stuff like: it IS going to need updating/over-riding from time to time Top - Log in or register to post comments Hrm, so the point is that power.h should be using the __AVR_HAVE_ defines (if you look at the top 2/3s of the power.h file) to define features. These __AVR_HAVE_ comes from the Pack. But... I don't know why there's a big list of devices here... I'm guessing that the 324 works similar to the 328, so just to get you going you could do this; I'll have to loop the compiler guys in here to check what the intention was... Might be as simple as 'we forgot to upstream this device', as it was one of the last 'classic' ATmegas.... (DEVXML-2133) :: Morten (yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs) Top - Log in or register to post comments Presumably there should be a __AVR_HAVE_CLKPR and then that should be used ? Only thing is that all the __AVR_HAVE_ in iom324pb.h all concern PRR registers, nothing else. Top - Log in or register to post comments Exactly, so not sure why this happened... The clock_div_t enum, clock_prescaler_set and clock_prescaler_get is not handled in this way... I've pinged the toolchain guys and asked them :) :: Morten (yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs) Top - Log in or register to post comments OK, so checking my project properties in Atmel Studio, it uses the compiler options: Effectively the same -I and -B flags as yours. (Took me a while to find what they do). So if I have this correct: When I start project with AS and select my device, it sets '-mmcu=atmega324pb' as a complier option for the project, which defines __AVR_ATmega324PB__. I include <avr/io.h> which is located in: And that includes the iom324pb.h file (found it!) in: So the first is the toolchain and the second is the in the ATmega device pack? I'm curious as to what happens if I were using say for example a mega88, and the two locations have differing iom88.h files. Which one would get included? I did a search of the device pack directory, and there's no power.h (or io.h) in there. Thanks. I was actually thinking of making a copy of power.h, adding in my own in the correct block and including this modified header, but that is a more elegant solution. I will have to do a comparison to make sure the clock module, or rather the clock registers, are the same I guess. Some other minor things: Looking at the 324PB datasheet, on page 24 section 8.6, it says: And on page 135: I have datasheet version DS40001908A dated Jan 2017, which is also what's currently available on the web site. I also have an older Atmel datasheet for the 1284P and it's unambiguous (as far as I know) about writing the high byte first for a 16-bit write operation. I wouldn't have expected it to be, but is the 324PB actually different in this regard? Granted, I'll just treat the register as a uint16_t, but I'm then trusting that the complier gets it right. Also, I didn't see mention of the 328PB in power.h either. I suspect it may suffer the same library support issues. Top - Log in or register to post comments Yes, tread carefully when defining that define. I haven't checked if it makes sense for this device... :: Morten (yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs) Top - Log in or register to post comments Well, sometime MC/Atmel Datasheets.....are....., I dont know what is the right word ? crap Great, now ping also the documentation and datasheet guys and tell them to stop copy/paste specially for Tiny1 and Tiny0 series and do a little bit more effort. Top - Log in or register to post comments
https://www.avrfreaks.net/comment/2657761
CC-MAIN-2019-43
refinedweb
1,443
72.76
Last update: 23 February,1998 97 #005 _____________________________________________________________________________ Topic: pthread.h/time.h namespace Relevant Sections: time.h Spec: XSH Issue 5 Resolution Request: ------------------- There appears to be an oversight in time.h. pthread.h states that symbols from sched.h and time.h may be present. In time.h, the function timer_create() includes a struct sigevent as an argument. The VSTH (Threads) test suite identifies the sigevent structure as namespace pollution. time.h should have statement added of the form "The sigevent structure is defined as described in header file <signal.h>." Resolution Response ---------------------------- POSIX should allow inclusion of the symbols in the <signal.h> header when <time.h> included. A POSIX Interpretation request will be filed. Rationale ------------- Circulated for review: Jul 2nd 1997 Proposal re-circulated: 25th Sept 1997 Approved: Feb 1998
http://www.opengroup.org/platform/resolutions/bwg97-005.html
CC-MAIN-2014-52
refinedweb
134
70.6
At 01:51 AM 12/8/04 -0500, Bob Ippolito wrote: ']. [Disclaimer: the rest of this post discusses possible solutions for the versioning problem, but please let's not get into solving that problem right now; it's not really a distutils issue, except insofar as the distutils needs to provide the metadata to allow the problem to be solved. I really don't want to get into detailed design of an actual implementation, and am just sharing these ideas to show that solutions are *possible*.] One possible solution is to place each plugin under a prefix name, like making the protocols package in PyProtocols show up as "PyProtocols_0_9_3.protocols". Then, the rest can be accomplished with standard PEP 302 import hooks. Let's say that another plugin, "PEAK_0_5a4", wants to import the protocols module. The way that imports currently work, the local package is tried before the global non-package namespace. So, if the module 'PEAK_0_5a4.peak.core' tries to import 'protocols', the import machinery first looks for 'PEAK_0_5a4.peak.protocols' -- which the PEP 302 import hook plugin will be called for, since it's the loader that would be responsible if that module or package really existed. However, when it sees the package doesn't exist, it simply checks its dependency resolution info in order to see that it should import 'PyProtocols_0_9_3.protocols', and then stick an extra reference to it in sys.modules under 'PEAK_0_5a4.peak.protocols'. It's messy, but it would work. There are a few sticky points, however: * "Relative-then-absolute" importing is considered bad and is ultimately supposed to go away in some future Python version * Absolute imports done dynamically will not be trapped (e.g. PEAK's "lazy import" facility) unless there's an __import__ hook also used * Modules that do things with '__name__' may act strangely (Of course, a more sophisticated version of this technique could only prefix packages that have more than one version installed and required, and so reduce the reach of these issues quite a bit.) Another possible solution is to use the Python multi-interpreter API, wrapped via ctypes or Pyrex or some such, and using an interpreter per plugin. Each interpreter has its own builtins, sys.modules and sys.path, so each plugin sees the universe exactly as it wants to. And, there are probably other solutions as well. I bring these up only to point out that it's possible to get quite close to a solution with only PEP 302 import hooks, without even trapping __import__. IMO, as long as we provide adequate metadata to allow a conflict resolver to know who wants what and who's got what, we have what we need for the first round of design and implementation: the binary format. Once a binary format exists, it becomes possible for lots of people to experiment with creating installers, registries, conflict resolvers, signature checkers, autoupdaters, etc. But until we have a binary format, it's all just hot air.
https://mail.python.org/pipermail/distutils-sig/2004-December/004333.html
CC-MAIN-2017-17
refinedweb
498
52.49
Extensible Markup Language (XML) To say that XML has been popular with the industry press is an understatement. At the moment, every major vendor has announced support for XML in one form or another, and innovative uses for XML are emerging almost daily. But what is exactly is XML? It is not a programming language like Java, C++, or C#; that is, it cannot be used to write applications per se. Rather, it is a meta-language that can be used to create self-describing, modular documents (data), programs, and even other languages, commonly referred to as XML grammars.1 These documents are often used for data exchange between otherwise incompatible systems. XML is incredibly diverse and includes a host of other technologies including XPointer, XLink, and Resource Description Framework (RDF). Our intent here is not to give an in-depth discussion of XML, but to provide enough background information to help you understand the implications of how XML is being used in the context of other technologies such as SOAP, WSDL, and UDDIthe foundation of Web Services. Strictly speaking, Web Services can be implemented by using only XML, but for the purposes of our discussion, we are defining Web Services to be built on XML, SOAP, WSDL, and UDDI over a transport protocol such as HTTP. This definition will become clearer as our discussions progress. The Worldwide Web Consortium (W3C), an international standards body, began working on XML in mid-1996 and released XML 1.0 in 1998. XML was heavily inspired by the Standard Generalized Markup Language (SGML), but, in many ways, XML is more readable and simpler. The real value of XML is not in its innovativeness as much as its industry acceptance as a common way of describing and exchanging data (and, as we will see later with WSDL and SOAP, XML can also be used to describe applications and invoke them as well). XML Syntax As a markup language, XML uses tags to describe information (the tags are highlighted in bold in the following example). <?xml version="1.0" encoding="UTF-8"?> <Order> <Customer> <name>John Doe</name> <street>1111 AnyStreet</street> <city>AnyTown</city> <state>GA</state> <zip>10000</zip> /Customer> </Order> A tag, enclosed in brackets (<>), is a label or a description (e.g., street in our example) of the data that follows, which is called an element (the element for street in our example is 1111 AnyStreet). The element is delimited by a similar tag preceded by a slash (/), to indicate the end of the element. In our example, the element 1111 AnyStreet is terminated by the closing tag </street>. The first line in our example is a convention used to signal the XML parser (the program that has to parse the XML document) that the incoming document is an XML document. Also, the Customer element has several child elements: - John Doe - 1111 AnyStreet - AnyTown - GA - 10000 You may have already noticed one advantage of XMLsince it is a text-based language, XML is fairly verbose and therefore human readable. However, this advantage can also be a disadvantage: because they are verbose, XML documents can quickly become very large for complex data sets. There are other points worth noting about XML: XML is extensible. Unlike HTML, which has a fixed number of tags, XML allows the developer to define any number of tagswhatever is necessary to solve the problem. In our example, the document represents an abstraction of a customer and includes fields to describe the customer. XML is hierarchical. Elements can have subordinate elements under them. In the example, the Customer element contains several child elements. XML is modular. By allowing documents to reference other documents, XML provides for modular designs and promotes reuse. XML does not include built-in typing. This data enforcement and validation is provided through document type definitions (DTDs) and XML schemas, two concepts that will be discussed in further detail later. XML does not make any assumptions about the presentation mechanism. This is unlike HTML, which does make these assumptions. In fact, XML has to be coupled with another technology (such as XSLT or Cascading Style Sheets) to be displayed. This separation stems from one of XML's primary goals of being a way of exchanging data; oftentimes data is exchanged between systems and hence may not need to be displayed at all. XML is programming language independent. Since XML is not a programming language per se, it can be used as a common mechanism for data exchange between programming languages and, as we will see later, a common way of connecting applications as well (via SOAP). XML provides validation mechanisms. Through the use of DTDs and XML schema, XML documents can be validated to determine whether the elements are correct (i.e., whether the values are within a specified range). Some of the main XML concepts that are especially relevant to Web Services include parsers, namespaces, DTDs, and XML schemas. XML Parsers Processing an XML document requires the use of an XML parser, a program that can decompose the XML document into its individual elements. There are two major categories of XML parsers: Document Object Model (DOM) and Simple API for XML (SAX). DOM is a language-neutral API for accessing and modifying tree-based representations of documents such as HTML or XML documents. Developers can use language-specific DOM parsers to programmatically build and process XML documents. DOM parsers have two major shortcomings: The entire XML document is represented in memory; this can lead to performance issues if the XML document is exceedingly large. Since the API is language independent, it is quite generic; therefore more steps are often required to process an XML document than would be the case if it were optimized for a particular implementation language. This has led to language-specific variants such as the JDOM parser, which is tuned for the Java language. The SAX parser is an event-based parser and can be used only for reading an XML document. A SAX parser works from event registration. The developer registers event handlers, which are then invoked as the XML document is processed. Each event handler is a small block of code that performs a specific task. The main advantage of a SAX parser over a DOM parser is that the former does not require the entire document to be in memorythe XML document is processed as a stream of data, and the event handlers are invoked. While SAX is easier to work with than DOM, there are some disadvantages: Once the XML document has been read, there is no internal representation of the document in memory. Thus, any additional processing requires the document to be parsed again. A SAX parser cannot modify the XML document. Thus it is important to understand the needs of the application before selecting an XML parser. Well-Formed and Valid XMLs XML documents must conform to a certain set of guidelines before they can be processed. This leads to two terms that are used to describe the state of a document: well formed and valid. A well-formed XML document is one that follows the syntax of XML and that can be completely processed by an XML parser. If there are syntax errors in the document, then the parser rejects the entire document. As far as an XML parser is concerned, there is no such thing as a partially well-formed XML document. A valid XML document is a well-formed document that can also be verified against a DTD, which defines constraints for the individual elementsthe order of the elements, the range of the values, and so on. A validating XML parser is one that can validate an XML document against a DTD or XML schema, which are described next. DTDs and Schemas XML offers two mechanisms for verifying whether or not a document is valid. A DTD is an external document that acts as a template against which an XML document is compared. The XML document references this DTD in its declaration, and the XML parser (assuming it is a validating parser) then validates the elements of the XML document with the DTD. A DTD can specify the order of the elements, the frequency at which elements can occur (for example, an order can contain 0n line items), etc. While a powerful concept, DTDs have many shortcomings. The concept of a DTD predates that of XML (it originated from SGML) and does not conform to XML syntax. This increases the learning curve and can lead to some confusion. A DTD does not support data types; this means it is impossible to specify that a given element must be bound to a type. Using the order example under "XML Syntax" earlier in this chapter, there is no way to specify that the line item count needs to be a positive integer. An XML document can reference only one DTD; this limits how much validation can occur. A DTD cannot enforce data formats; i.e., there is no way to specify that a date must be of the mm/dd/yyyy format. DTDs were invented before the standardization of namespaces and consequently do not support namespaces, which can lead to many element name collisions. For more on namespaces, see the next section. Because of these limitations, applications that have to process XML documents include a lot of error checking functionality. Additionally, SOAP, one of the cornerstone technologies of Web Services, prohibits the use of DTDs in the document declarations. To address the shortcoming of DTDs, the W3C produced the XML schema specifications. XML schemas provide the following advantages: The XML schema grammar supports namespaces. XML schemas include a predefine set of types including string, base64 binary, integer, positive integer, negative integer, date, and time, along with acceptable ranges and data formats. XML schemas also allow for the creation of new types (simple and complex) by following a well-established set of rules. XML Namespaces An enterprise system consists of dozens if not hundreds of XML documents. As these XML documents are merged from other sources, inevitably there will be duplicate element names. This can cause problems because each element must have a unique name. XML resolves this name collision issue through the use of namespaces (Java provides a similar feature through packages). Each element is prefixed with a namespace and therefore has to be unique only for that given namespace rather than globally. In practice, the prefix is usually the name of the company, although any Uniform Resource Locator (URL) will do.2 Thus, an element name is composed of two parts: the namespace and the name of the element. By qualifying the name of each element with a qualifier, the likelihood of a name collision is greatly reduced. Consider the file system, for example. For a given directory, a filename must be unique. However, there can be multiple identical filenames as long as each exists in a different directory. In a sense, the directory provides the namespace and qualifies the filename to resolve filename conflicts. Service-Oriented Access Protocol (SOAP) One of the challenges of performing integration using traditional middleware is the lack of a universal protocol. By being XML based and not tied to any particular language, SOAP has evolved to become the primary de facto standard protocol for performing integration between multiple platforms and languages. SOAP originally meant Simple Object Access Protocol, but the term has been unofficially redefined to mean Service-Oriented Access Protocol because SOAP is not simple and certainly not object oriented; the latter point is important because not all languages are object oriented. This flexibility in the protocol allows a program that is written in one language and running on one operating system to communicate with a program written in another language running on a different operating system (i.e., a program written in perl running on Solaris can communicate with another program written in Java running on Windows 2000). There is at least one SOAP implementation for each of the popular programming languages including perl, Java, C++, C#, and Visual Basic. Advantages of SOAP Before discussing the characteristics of SOAP, let's examine why it has become so popular. SOAP is a fairly lightweight protocol. Some of the earlier distributed computing protocols (CORBA, RMI, DCOM, etc.) contain fairly advanced features such as registering and locating objects. At its core, SOAP defines only how to connect systems and relies on additional technologies to provide registration features (UDDI) and location features (WSDL). SOAP is language and operating system independent. In this respect, SOAP is unlike many other middleware technologies l (such as RMI, which works only with Java, and DCOM, which works only on Microsoft Windows and NT). SOAP is XML based. Instead of relying on proprietary binary protocols (as is the case with CORBA and DCOM), SOAP is based on XML, a ubiquitous standard. As previously noted, XML is fairly readable. SOAP can be used with multiple transport protocols. These include HTTP, Simple Mail Transfer Protocol (SMTP), file transfer protocol (FTP), and Java Message Service (JMS). Most of the examples in this book will focus on HTTP since it is the most commonly used protocol with SOAP-based systems. SOAP can traverse firewalls. SOAP needs no additional modifications to do this. Contrast this with CORBA- or DCOM-based systems, which require that a port be opened on the firewall. This is a key requirement for building distributed systems that have to interact with external systems beyond the firewall. (This is also a disadvantage, as we will see later.) SOAP is supported by many vendors. All major vendors including IBM, Microsoft, BEA, and Apache provide support for SOAP in the form of SOAP toolkits (the IBM and Apache SOAP toolkits are two of the most popular). SOAP is extensible. The header values (specified in the Header element) in the XML document can be used to provide additional features such as authentication, versioning, and optimization. These features are discussed further in the next chapter. Disadvantages of SOAP On the down side, SOAP does have some disadvantages. There are interoperability issues between the SOAP toolkits. It seems ironic that there would be interoperability issues with a technology that promotes interoperability, but this is mostly attributable to the infancy of the SOAP specifications. These have been identified and documented, and the various vendors have been quite cooperative in resolving these differences. SOAP lacks many advanced features. Much has been written about the advantages of SOAP as a lightweight protocol, but there are a host of missing features such as guaranteed messaging and security policies. Many of these issues can be addressed through third-party technologies such as Web Services networks, which are discussed in further detail in later chapters. SOAP Basics SOAP is built on a messaging concept of passing XML documents from a sender to a receiver (also called the endpoint). The XML document becomes known as a SOAP document and is composed of three sections: Envelope, Header, and Body. Figure 22 illustrates the structure of a SOAP document. Figure 22 The structure of a SOAP document. The SOAP standards define three major parameters: Envelope body structure. The envelope contains information such as which methods to invoke, optional parameters, return values, and, where something did not execute successfully, optional exceptions (known as SOAP faults). Data encoding rules. Since SOAP has to support multiple languages and operating systems, it has to define a universally accepted representation for different data types such as float, integer, and arrays. More complex data types (such as Customer) require custom coding, although some toolkits, such as GLUE, inherently provide this mapping. Usage conventions. SOAP can be used in a multitude of ways, but they are all variations of the same actions: a sender sends an XML document, and the receiver, optionally, returns a response in the form of an XML document (this is the case of a two-way message exchange). As mentioned previously, the XML document may contains faults if errors occurred during processing. By allowing receivers to be chained together, SOAP-based architectures can be quite sophisticated. Figure 23 shows five common architectures that are used with SOAP-based systemsFire and Forget, Request Response, Notification, Broadcast, and Workflow/Orchestration. Figure 23 Common SOAP architectures. Any link in the processing chain that is not the endpoint is referred to as an intermediary. The SOAP specifications allow an intermediary to process a SOAP message partially before passing it to the next link in the processing chain (which can be another intermediary or the endpoint). You will see an example of this in the discussion of the SOAP header later in the chapter. Migrating from XML to SOAP Migrating from XML to SOAP is a fairly straightforward procedure. The migration includes these steps: Adding optional Header elements Wrapping the body of the XML document in the SOAP body, which in turn is included in the SOAP envelope Declaring the appropriate SOAP namespaces Adding optional exception handling Specifying the protocol that should be used For example, converting our earlier XML document to SOAP involves adding the following parts (highlighted in bold; for the sake of simplicity, the HTTP fragment has been stripped away): <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmnls: <SOAP-ENV:Header> . . . [optional header information] </SOAP-ENV:Header> <SOAP-ENV:Body> <Order> <Customer> <name>John Doe</name> <street>1111 AnyStreet<street> <city>AnyTown</city> <state>GA<state> <zip>10000</zip> </Customer> </Order> <SOAP-ENV:Body> <SOAP-ENV:Envelope> The next sections describe these additional parts. SOAP Envelope The SOAP envelope is the container for the other elements in the SOAP message. A server-side process called a SOAP handler can use the availability of the SOAP envelope (along with the namespace declaration) to determine whether the incoming XML document is a SOAP message or not. The handler can be part of the application server, or it can be an external product such as Cape Clear CapeConnect. SOAP handlers are explained in more detail later in the section on adding SOAP support. SOAP Header As part of their extensibility design goal, the architects of SOAP provided the Header element to allow SOAP messages to be extended generically while still conforming to the SOAP specifications. If a SOAP Header element is present (and there can be more than one Header element present), it has to be the first child of the Envelope element. Each Header element can in turn have child elements. Two examples of using header information to provide extensibility include embedding authentication information specifying an account number for use with a pay-per-use SOAP service /A SOAP intermediary can use this header information to determine whether the incoming message is properly authorized before forwarding it (to either another intermediary or the endpoint). Exception Handling In cases where a SOAP handler cannot decipher a message, a SOAP fault is generated, identified by the Fault element. Its child element, faultcode, identifies the category of errors that can happen. SOAP 1.1 defines four values for the faultcode element: VersionMismatch. The recipient of the message found an invalid namespace for the SOAP envelope element. MustUnderstand. The recipient encountered a mandatory Header element it could not understand. Remember, header elements are optional. Client. The fault was in the message being received. Possible causes: missing elements, malformed elements, and the like. Server. The fault occurred on the recipient side, i.e., a server error. Note that an application is free to extend these values using a (.) notation. For example, a value of Client.Login can be used to specify that there was a problem with a client login. In addition to the faultcode element, there are two other elements that can be used to provide further clarification on the fault: faultstring. This element provides a readable explanation on why the fault occurred. detail. The value of the detail element indicates that the problem occurred while processing the body element. If the detail element is not present, then the fault occurred outside of the body of the message. Adding SOAP Support One of the advantages of adopting SOAP is that the support can be built on top of existing technologies. Figure 24 shows a typical J2EE Web-based architecture without support for SOAP.3 Adding SOAP support to such a system typically requires the addition of a SOAP handler (if the application server cannot support SOAP requests), which parses incoming SOAP requests and then calls the appropriate native method in the implementation language. Recall that SOAP is a protocol, not a programming language; hence, the request must be mapped to an entry point in an executing application. The entry point can be a method in a class (for object-oriented systems such as Java, C++, or C#) or a function name (for systems such as perl, which are not object oriented). Figure 24 Typical J2EE deployment. Common SOAP handlers include CapeConnect from Cape Clear, Iona's XMLBus (see Appendix D for a more detailed discussion), and Apache Axis. In summary, a system is said to be SOAP compliant if it can take an incoming SOAP request, forward it to the appropriate endpoint, and package the result back in a SOAP response. Figure 25 illustrates the addition of a SOAP handler to the J2EE environment shown in Figure 24.4 Figure 25 Adding SOAP support to J2EE environment. While SOAP provides many useful features, it is still incomplete because it does not address this issue: how does an endpoint unambiguously describe its services? Likewise, another outstanding issue: how does a requester locate the endpoint? These two features are provided by two other key technologiesWSDL and UDDI. Web Services Definition Language (WSDL) To enable a client to use a Web Service effectively, there first has to be a mechanism for describing that Web Service. At first glance, this may seem difficult, but the challenges are many. We can provide a description in prose format (such as a README file), but it would not be practical to describe all the different ways a Web Service can be used in prose. We can also list some examples of how the Web Service can be used effectively, but, again, that may not adequately describe all the combinations for which a Web Service can be invoked. The problem of succinctly and unambiguously describing a Web Serv-ice is similar to the challenge faced by compiler writersthe conventional solution is to use a grammar tree to describe the syntax of a language. While quite effective, a grammar tree is rarely decipherable for those without a strong background in compiler theory. WSDL was created in response to the need for unambiguously describing the various characteristics of a Web Service. As an XML grammar, WSDL is not easy to learn, but it is considerably less intimidating than a programming language (such as C or C++). A WSDL document is a well-formed XML document that lists the following characteristics for one or more Web Services. Publicly accessible functions.5 A WSDL lists all the operations a client can expect a Web Service to support. Input and output parameters along with associated types. In order to invoke each operation, the client needs to know the expected parameters for each input operation and the expected output of each operation. Again, this is identical to a normal function declaration. In order to support portability between languages and operating systems, all data types are defined in XML schema format. Binding and address information for each Web Service. To allow loose coupling between a requester and a Web Service, WSDL specifies where the service can be found (usually a URL) and the transport protocol that should be used to invoke the service (remember that a Web Service can be used with multiple protocols). In essence, WSDL defines a contract that a provider is committed to supporting, and, in the spirit of separating implementation from interface, WSDL does not specify how each Web Service is implemented. As a point of comparison, WSDL can best be likened to CORBA's IDL. Most of the existing toolkits (GLUE, IBM Web Services Toolkit [WSTK], BEA Web Services Workshop, Cape Clear CapeStudio, etc.) have built-in functionality to automatically parse and generate WSDL files (although, due to the immaturity of the tools, the generated files still require some manual tweaking). Even so, it is still worthwhile to understand the structure of a WSDL document. WSDL Syntax The WSDL specifications list six major elements: The definitions element is the root element containing the five remaining elements; it defines the name of the service and declares the namespaces used throughout the document. The message element represents a single piece of data moving between the requester and the provider (or vice versa). It declares the name of the message along with zero or more part elements, each of which represents either a single parameter (if this is a request) or a single return value (if it is a response). If there is no part, then the request requires no parameter or there is no return value, depending on whether the message represents a request or a response. Note that each message element declares only the name (which is used by the operation element below), value(s), and the type of each value; it does not specify whether the message is for input or outputthat is the role of the next element. The portType element represents a collection of one or more operations, each of which has an operation element. Each operation element has a name value and specifies which message (from the message element) is the input and which is the output. If an operation represents a request/response interaction (a method invocation with a return value), then the operation would include two messages. If an operation represents only a request with no response or a response with no request (e.g., an automatic notification from the provider with no request from the requester), it would include only a single message. In Java terms, a portType can best be thought of as an interface; an operation can best be thought of as a single method declaration; a message can best be thought of as a individual piece of an operation, with each message representing (if the operation is an input) a parameter name and the associated type or (if the operation is an output) return value name and the associated type. The types element is used to declare all the types that are used between the requester and the provider for all the services declared in the WSDL document. The binding element represents a particular portType implemented using a specific protocol such as SOAP. If a service supports more than one protocol (SOAP, CORBA, etc.), the WSDL document includes a listing for each. The service element represents a collection of port elements, each of which represents the availability of a particular binding at a specified endpoint, usually specified as a URL where the service can be invoked. Invoking Existing Web Services: A Sample To invoke a Web Service, we can either write a SOAP client or use an existing generic one. The site provides a Web interface that allows us to enter the WSDL file and invoke the service. Before we can launch the service, we need to find the WSDL file. In this case, we can find some sample WSDL files at, a public repository of Web Services. For our example, we will invoke a Web Service that can print the traffic conditions of a specified California highway. Use the following instructions: Visit the site. Type in the WSDL address field. Select HTML instead of XML for the output. Click Retrieve, which loads the WSDL file from across the Internet. In the textfield, type 101 (for Highway 101) and click Invoke to invoke the service. The resulting screen should print text that explains the current conditions for Highway 101. This example illustrates how straightforward it is to invoke a Web Service from a browser. The user, in most cases, will not even be aware that Web Services are being used to return the values. Of course, the user can just as easily be a program, in which case the program would programmatically pass the appropriate parameters.
https://www.informit.com/articles/article.aspx?p=31076&seqNum=2
CC-MAIN-2022-27
refinedweb
4,708
52.29
t_bind - bind an address to a transport endpoint #include <xti.h> int t_bind( int fd, const struct t_bind *req, struct t_bind *ret) ret->addr.buf (the pointer itself, not the buffer it points to) is also unchanged. CAVEATS below. On return, the qlen field in ret will contain the negotiated value. If fd refers to a connection-mode service, this function allows more than one transport endpoint to be bound to the same protocol address (however, the transport provider must also support this capability), but it is not possible to bind more than one protocol address to the same transport endpoint.() or t_close().
http://pubs.opengroup.org/onlinepubs/7990989775/xns/t_bind.html
CC-MAIN-2014-15
refinedweb
103
59.84
Editor's Note: This article is community contributed. Learn why and how you can contribute too. This article is a brief introduction to the databasedotcom gem. The article demonstrates how to install and configure the gem, and begin using it to access Salesforce objects from within Ruby code. While this article uses a simple Rails application to demonstrate key topics, please realize that most of this works fine in Ruby outside of Rails as well. As a bonus, the last part of the article briefly discusses how to work with the Salesforce Bulk API using the salesforce_bulk gem. Note: This article explains various gems as of late January 2012. The community is very active in improving these gems, so you should follow changes made after this date. The databasedotcom gem takes a clever approach to creating models for your Salesforce objects: materializing them. What does this mean? Essentially, it means that your app specifies any required Salesforce object and the gem — under the covers — introspects the object on the Salesforce side and then dynamically creates a class that models it with the appropriate properties. You'll see more details below, but here's a quick example to show how easy it is: client.materialize("User") This seemingly simple statement creates a model at run-time called User that represents the object of the same name in Salesforce. It's not much different from the way that ActiveRecord models represent an object in a local database, except that the model is materialized at run-time. The materialized model has all of the expected properties available that you can get/set, and you can do a save to persist changes just as you normally would with Ruby. If you're working in Rails, you can make things even easier by using the little databasedotcom-rails gem. This gem automagically takes care of materializing models inside your controllers — however, the databasedotcom-rails gem doesn't support namespacing into modules (see below for details). The databasedotcom gem is quite new, and as such doesn't do everything that a more mature solution might do such as ActiveRecord. One of the most important gem limitations is a lack of support for relationships — no belongs_to, has_many, and so forth. Handling relationships yourself isn't as much of a burden as you might expect because relationships between Salesforce objects are typically much simpler than you're used to in traditional RDBMS schemas. The Salesforce query language, SOQL, is designed to solve a well-defined and restricted set of problems, and to keep things running smoothly in Salesforce's shared cloud. The following sections teach you how to set up your environment and configure a few things so that you can start accessing Salesforce data. Hopefully, you already use rvm to manage your Ruby environment, and Bundler to manage your gems. If not, now is an excellent time to start. This article isn't a tutorial on using these utilities, so the article assumes that you have them up and running, or else you're ready to somehow survive without them. From this point forward, the article also assumes that you have a Ruby installed and that you have a gemset created. Considering you'll be making a simple Rails application, I'll also assume that you've also created an empty Rails app. Edit your app's Gemfile and add: gem 'databasedotcom' gem 'databasedotcom-rails' Then run the following to install these gems: bundle install Before your Ruby code can get at your Salesforce data, you need to enable remote access for your application. Log in to your Salesforce account, navigate to Setup, and click through to Develop, where you'll see a link to the Remote Access page. You can find good information on remote access configuration at the "Configuring OAuth 2.0 Access for your Application" section of this article. For this example, keep things simple — create a new remote application called databasedotcomtest with a fake callback URL (callback URLs are important with OAuth authentication, but not with username/password authentication). Note: OAuth configuration is not in the scope of this article, but for a production application you will want to use it. OmniAuth is a useful gem to explore, as it has a native Saleforce provider that you can use to facilitate OAuth authentication. See the databasedotcom gem's README for some details on the configuration in that case. Once you save the new remote access configuration, take note of the Consumer Key and Consumer Secret. You'll see below that these can be put into a configuration file that your Ruby code provides to the databasedotcom client object. By default, the databasedotcom client object uses login.salesforce.com as the host. This is fine when you're using a Force.com Developer Edition account. If you are using another type of org and working in a sandbox (as you should be!), make sure to change the authentication host to test.salesforce.com. See the example below. The databasedotcom gem talks to your org using an instance of the client object, which relies on the ID and Secret from the remote access configuration in your Salesforce account. There are two simple ways to provide these credentials along with other configuration information: as arguments to the client.new method, or as parameter values in a configuration file. The configuration file approach makes your code much cleaner, so that's the approach this article demonstrates. The databasedotcom gem configuration file is config/databasedotcom.yml and is somewhat similar to the Rails database.yml configuration file. Create and edit that file in your Rails app, following this example: host: login.salesforce.com # Use test.salesforce.com for sandbox client_secret: 1234567890 # This is the Consumer Secret from Salesforce client_id: somebigidthinghere # This is the Consumer Key from Salesforce sobject_module: SFDC_Models # See below for details on using modules debugging: true # Can be useful while developing username: me@mycompany.com password: mypasswordplusmysecuritytoken Naturally, you should substitute the values specific to your org for the client_secret, client_id, username, and password parameters. Don't forget to use your security token as part of your password. Also, note the first line, which specifies login.salesforce.com. If you're using a sandbox rather than a Developer Edition account, change this to test.salesforce.com. I once spent several minutes trying to figure out why I couldn't get authentication to work against a new Developer Edition account. On a hunch, I removed the special characters (ampersand and a slash) from my password. Voila, everything started working. So if you're going to be authenticating with username and password, I recommend ensuring that your password contains only letters and digits to save yourself some debugging. Hopefully this problem will be fixed in the future, but consider this a helpful warning — and another reason to use OAuth in a production environment. It's not uncommon to have a local model, such as User or Account, that exists in your application database (PostgreSQL, MySQL, etc.) with the same name as your Salesforce objects. But having two models called Account won't work well, and distinguishing between models with names such as Account and SalesforceAccount just doesn't feel right. Instead, it's better to modularize things. To do this, create a SFDC_Models module, and namespace all of your materialized Salesforce models inside it by setting the sobject_module property of the client before materializing, like so: client.sobject_module = "SFDC_Models" client.materialize("Account") This type of configuration materializes the model SFDC_Models::Account, and makes it very clear to anyone reading your code which object is which. Even better, you can specify the sobject_module in your configuration file, as you did in the example databasedotcom.yml file shown earlier. For my Rails application, I like to define the module somewhere out of the way, so I use the file lib/sfdc_models.rb: # Container into which you will materialize the Salesforce objects. module SFDC_Models end Note: You may need to add the lib directory to the autoload_path in your config/application.rb to ensure that the module gets loaded when you start Rails. Something like: config.autoload_paths += %W(#{config.root}/lib) As noted earlier, the databasedotcom-rails gem doesn't support namespacing. However, because of the way it enables access to the Salesforce objects, using a module is less important — it's pretty clear to anyone reading your controller code which objects are in Salesforce and which are in your database. You'll see an example of this below. Before enjoying the convenience of the databasedotcom-rails gem, you should try things manually. It's a good way to make sure that you understand what's going on before the inevitable debugging sessions to come. Now that you have your empty Rails app, installed the gems, and created your databasedotcom.yml configuration file, try a smoke test to make sure it's all working: $ cd <root directory of your Rails app> $ rvm use <ruby version and gemset> $ rails console Once you are in the console, instantiate a new client, authenticate it, and then use it to materialize a standard object such as User. > client = Databasedotcom::Client.new("config/databasedotcom.yml") '''=> #<Databasedotcom::Client:0x00000104131078 ...etc...''' > client.authenticate :username => 'me@mycompany.com', :password => 'mypasswordplusmysecuritytoken' '''=> "00DV000andabunchmoregibberish"''' > client.materialize("User") '''=> SFDC_Models::User < Databasedotcom::Sobject::Sobject''' > SFDC_Models::User.count ***** REQUEST: ***** RESPONSE: Net::HTTPOK -> {"totalSize":3,"done":true,"records":[]} => 3 If you see responses similar to those above, then things are going well with your configuration. Of course, instead of seeing "3," you'll see a count of the number of users in your org. You may note that the username and password are already in the configuration file, so in theory you shouldn't have to do explicit authentication. At the moment, however, you will have to do that, or you'll receive an error when you try to do the materialize. This is a good opportunity to look at a useful convenience method. One of the tricky things about working with Salesforce objects, particularly custom objects, is knowing the name of each field. For example, custom fields have "__c" appended to the name you would expect to see. Because of this, it's extremely useful to have the attributes method. Use it to get a list of the fields and their names so that you know what's available and how to get at them: > SFDC_Models::User.attributes => ["Id", "Username", "LastName", "FirstName", ...etc...] From this output, you know about the FirstName attribute and can now dig deeper into the model: > u = SFDC_Models::User.first => #<SFDC_Models::User:0x00000101315108 @Id="00540000000o2dhEFG", @Username="someone@mycompany.com", @LastName="Smith", @FirstName="Fred", ...etc > u.FirstName => "Fred" Notice how a Salesforce model acts like a standard model, with each attribute available, similar to traditional ActiveRecord models. It's important to note, however, that while attributes gives you a list, you can't tell from it what the data types are for the fields. We'll look into this issue in more detail in subsequent section. Now it's time to start building your Rails application making use of the databasedotcom-rails gem. Important Note: Using namespacing in conjunction with the databasedotcom-rails gem can lead to some confusing behavior with regard to routes, so before you continue, comment out the sobject_module line in the config/databasedotcom.yml file. First, create a Users controller with two actions: index retrieves a list of the first 20 users, and show retrieves a single user. Here's what your app/controllers/users_controller.rb should look like: class UsersController < ApplicationController include Databasedotcom::Rails::Controller def index @users = User.all()[0..19] end def show @user = User.find(params[:id]) end end Next, add the following line to config/routes.rb to configure the standard routes for the new Users controller: resources :users Now create corresponding views for each action. Here's app/views/users/index.html.erb: <h1>Users</h1> <% @users.each do |u| %> <%= link_to "#{u.Name}", u %><br/> <% end %> Note: You can see that the attribute u.Name has an upper-case 'N'. This is a small but important thing. Salesforce fields are case-sensitive, thus the Salesforce models care about the capitalization. If you try this with "u.name" instead, you'll get an error. And here's app/views/users/show.html.erb: <h1>User <%= @user.Name %></h1> <% @user.attributes.each do |a| %> <%= a[0] %>: <%= a[1] %><br/> <% end %> So what do you have here and how does it all function? The controller is key, but there's not much to it, is there? It includes Databasedotcom::Rails::Controller and as such inherits its magic such as catching the lack of a User model and materializing it from Salesforce. After that, you are good to proceed as you normally would. For example, in the index action, there's a typical User.all method call to get the first twenty users. The app/views/users/index.html.erb view iterates over the users and creates a link for each one, displaying the user name as the link text. Clicking on a link calls the show action in the Users controller that does exactly what you'd expect: it retrieves a specific user by id. Note, though, that the id in this case is a Salesforce Id. Start up your Rails server, load, and click on a user. Notice that the URL looks something similar to — that long id is the REST URL with the Salesforce object Id of that user. And you now see the output of the app/views/users/show.html.erb view, which displays all of the attributes of the user. One thing you might be wondering is why the index controller action retrieves all of the users but only uses the first twenty via an Array operator. It's not good practice to retrieve all those records and use only a few. Why not just use LIMIT to cut down on the amount of data sent from Salesforce? As it turns out, the all method doesn't support LIMIT, or any other options for that matter. Instead, however, you can use the query method. Replace the line: @users = User.all()[0..19] with @users = User.query("Id != NULL LIMIT 20") That's more efficient, isn't it? Well, sort of. It's great that you have the LIMIT now, so the app is operating more efficiently. But what's with the Id != NULL? Well, the query method takes the required parameter your app sends and uses it as the WHERE clause for a query. So your app has to send a complete condition. Because Id can't be null, Id != NULL is a nice safe condition to get the job done. Remember, the databasedotcom gem is relatively immature, so you can expect improvements to idiosyncrasies like this one. In fact, if you want to add support for LIMIT, I'm sure a pull request would be happily accepted! The query method can also do more complex queries than a simple find. For example, if you want to get all of the users whose last names begin with 'W', just use this: @users = User.query("LastName LIKE 'W%'") Use your imagination from here and learn more about SOQL queries while you're at it. The SOQL documentation is a fine place to start. You can now display data from Salesforce, but what about adding or changing data? In general, it's done the same way as you would using ActiveRecord in a basic Rails app. Add the standard edit and update actions to app/controllers/users_controller.rb: def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) @user.update_attributes(params[:user]) render "show" end Then create the app/views/users/edit.html.erb file for the view: <h1>Editing user <%= @user.Name %> </h1> <%= form_for @user do |f| %> <div class="field"> <%= f.label :CompanyName %><br /> <%= f.text_field :CompanyName %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> <br/> <%= link_to 'Show', @user %> | <%= link_to 'Back', users_path %> Also, add this to app/views/users/show.html.erb just after the header: <%= link_to 'Edit', edit_user_path(@user) %> | <%= link_to 'Back', users_path %> <br/> <br/> Now you'll have a navigation link to the Edit view from the Show view. In the running app, click that link to display the Edit view for a record and modify the user's Company Name. When you submit the form, the app updates the user in Salesforce and then renders the Show view for the same record where you can see the change. The Edit view form is quite simple, but feel free to add other fields. Note, however, that some fields such as Name may be protected fields that you can't modify. As an experiment, if you're using a standard Developer Edition account, try adding the Name field and submitting the form. You will receive an error warning that your security settings won't allow you to change that field. As you've seen, the databasedotcom gem makes accessing Salesforce data very similar to a standard ActiveRecord/Rails app, so you shouldn't be surprised to find that creating an object looks familiar too. To demonstrate, we won't continue with the User object because, if you're using a Developer Edition account, you won't be able to create a User. Instead, switch focus to the Task object. As an exercise, make a new controller, app/controllers/tasks_controller.rb, with the index and show actions. To do this quickly, copy and modify app/controllers/users_controller.rb. Also, don't forget to add the Tasks route definition in config/routes.rb. Next, add the new and create actions to app/controllers/tasks_controller.rb: def new @task = Task.new end def create task = Task.new(params[:task]) task.IsRecurrence = false task.IsReminderSet = false task.Priority = "Normal" user = User.first task.OwnerId = user.Id if (task.save) redirect_to(task, :notice => 'Task was successfully created.') end end You also need the app/views/tasks/new.html.erb view: <h1>Create task</h1> <%= form_for @task do |f| %> <div class="field"> <%= f.label :Subject %><br /> <%= f.text_field :Subject %> </div> <div class="field"> <%= f.label "Status" %> <%= f.select :Status, options_for_select([['Not Started', 'Not Started'], ['In Progress', 'In Progress'], ['Completed','Completed']]) %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> <br/> <%= link_to 'Back', tasks_path %> Update app/views/tasks/index.html.erb and add the following to provide a navigation link to the New view. <%= link_to 'New', new_task_path(@task) %> | <%= link_to 'Back', tasks_path %> <br/> <br/> To keep the view simple, there's only two fields, with defaults for other required fields in the controller's create action. There's nothing special about the form: there's a text field for the task's Subject, and a select list for the Status. There are a couple of other possible values for a task's Status, but these three options are enough to demonstrate the concept. Looking at the controller, the new action is standard Rails. The create action does the normal instantiation of a Task object using the form parameters, and then sets three more fields to default values. The only non-standard bit, perhaps, is that one of the required fields is the task's OwnerId, which has to contain the Salesforce Id of a User. To keep it simple, the controller just grabs the Id of the first User and assigns it to the new task's OwnerId. Of course, in a real application, you'd do something more appropriate, perhaps letting the user select someone from a list. As an exercise, try building that into the Task creation form. For completeness, add the destroy action to app/controllers/tasks_controller.rb: def destroy task = Task.find(params[:id]) task.delete redirect_to(tasks_path, :notice => "Task '#{task.Subject}' was successfully deleted.") end Assuming you already created app/views/tasks/show.html.erb based on app/views/users/show.html.erb and then updated it to work with Tasks, append a link to delete the Task you're viewing. For example: <%= link_to 'Back', tasks_path %> | <%= link_to 'Delete', @task, :confirm => 'Are You Sure?', :method => :delete %> So far, so good. Now add these lines to app/views/tasks/index.html.erb under the header: <% if flash[:notice] %> <%= flash[:notice] %><br/><br/> <% end %> After you delete a task and load the Index view, in standard Rails fashion, the Task list displays with a nice status message. As you've seen so far, the databasedotcom gem makes most everything work like a basic Rails app. You'll always have to keep in mind some unique characteristics of Salesforce when it comes to querying, field names, and dealing with required fields. But with the gem, you can easily write a Rails application or Ruby script to integrate with your Salesforce organization. The databasedotcom gem provides many useful methods. Here are a few noteworthy ones. The field_type method is a handy method to display a given field's datatype: > client.materialize('Task') > SFDC_Models::Task.field_type('Status') => "picklist" When a field is a picklist, it's extremely useful to be able to get the values for it. For example, when you build a view around a Salesforce object, you can provide a convenient select list and populate it with values using the picklist_values method. > SFDC_Models::Task.picklist_values('Status') => [{"value"=>"Not Started", "active"=>true, "label"=>"Not Started", "defaultValue"=>true, "validFor"=>nil}, {"value"=>"In Progress", "active"=>true, "label"=>"In Progress", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"Completed", "active"=>true, "label"=>"Completed", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"Waiting on someone else", "active"=>true, "label"=>"Waiting on someone else", "defaultValue"=>false, "validFor"=>nil}, {"value"=>"Deferred", "active"=>true, "label"=>"Deferred", "defaultValue"=>false, "validFor"=>nil}] Also convenient for views is the label_for method that lets you to get the label metadata for a given attribute: > SFDC_Models::Task.label_for('Who') => "Contact/Lead ID" Considering that the attribute name and label for a field in Salesforce are often very different, using the label_for method helps you keep the Salesforce view and your custom application view in sync and avoid user confusion. Note: I recommend looking over the gem's rubydocs to see what other methods are available, particularly focusing on the Databasedotcom::Sobject::Sobject class. If you try to do something like creating an object without all of the required fields, you'll get an error, which will be an exception: Databasedotcom::SalesForceError. As an example, update app/controllers/tasks_controller.rb so the create method is as follows: def create task = Task.new(params[:task]) task.IsRecurrence = false task.IsReminderSet = false task.Priority = "Normal" user = User.first #task.OwnerId = user.Id begin if (task.save) redirect_to(task, :notice => 'Task was successfully created.') end rescue Databasedotcom::SalesForceError => e redirect_to(tasks_path, :notice => "Error creating task: #{e.message}") end end The action now catches the exception if there's an error when saving a new Task. The line assigning OwnerId is commented out, so an error will occur. Try creating a new Task now, and you'll see the Task list with the error message: "Error creating task: Assigned To ID: owner cannot be blank". (Don't forget to uncomment the missing line after testing!) When manipulating lots of data, consider using another gem that provides a simple interface to the Salesforce Bulk API. This API can be very efficient when dealing with significant updates or object creation, so it's worth a quick review in this article. You can find more information about the Bulk API on Github. To test drive the Bulk API, add the gem to your app's Gemfile with: gem 'salesforce_bulk' Then: bundle install Fire up a Rails console and create the bulk client, as described in the gem's README: > require 'salesforce_bulk' > client = SalesforceBulk::Api.new("me@mycompany.com", "mypasswordplusmysecuritytoken") => #<SalesforceBulk::Api:0x00000100e96370 @connection=#<SalesforceBulk::Connection:0x00000100e96348 @username="me@mycompany.com", @password="...etc. If the authentication fails, you won't get a very friendly error as of this writing (remember that this gem is quite new); the code will fail to parse the response and you'll see "NoMethodError: undefined method `[]' for nil:NilClass". Warnings: You can use the Bulk API to query, just as you can using the databasedotcom gem, though with a slightly different syntax. As an example, create a couple of Tasks in your account, and fetch the list: tasks = client.query("Task","select id,whoid,activitydate,status,subject from Task limit 3") => [["00TG000000cM0ZUMA0", "", "2011-12-05", "Not Started", "Test 1"], ["00TG000000cM0bXMAS", "", "2011-12-05", "Not Started", "Test 2"]] That's not such an interesting use of the Bulk API, though. Instead, create a bunch of tasks. The create method is simple: it wants an array of records, each of which is a Hash containing the fields for the record. So you can create 100 tasks very efficiently: new_tasks = Array.new 100.times do |i| new_tasks << {'activitydate' => '2011-12-05', 'status' => 'Not Started', 'subject' => "more to do #{i}"} end result = client.create("Task", new_tasks) => [["00TG000000cM0gmMAC", "true", "true", ""], ...] Now when you browse to your home page in your account and look at your tasks, you'll feel very bad because you have so much to do. So delete a bunch of them. The results from the create method call are an array of arrays, and the first element of the inner array is the Salesforce Id of the Task. Thus, you can create a new array of elements to delete, because the delete method wants an array of Hashes, each containing the Id of a record to delete: to_delete = Array.new result[0..50].each do |r| # delete half of them to_delete << {'id' => r[0]} end del_result = client.delete('Task', to_delete) => [["00TG000000cM0gmMAC", "true", "false", ""], ...] That's better. Now you only have half as much work to do. The salesforce_bulk gem also supports updating and upserting, which operate exactly as you would guess. Take a look at the examples on the salesforce_bulk gem's Github page and you'll be in good shape. This article showed you how to get started integrating your Ruby code with Salesforce. As noted throughout, this is all pretty new and will doubtless evolve significantly in the future. You'll likely want to add these gems to your Github "watch" list. There's also a Google Group to follow, which is a valuable source of information and assistance. Mason Jones is Chief Architect, Information Products at RPX Corporation in San Francisco. He's worked at many startups over the years, from video advertising to peer-to-peer business process automation. After years spent developing in C and then Java, for the past several years he's found Ruby on Rails to be an enjoyable platform. Follow @masonoise on Twitter and read his technical blog.
https://developer.salesforce.com/page/Accessing_Salesforce_Data_From_Ruby
CC-MAIN-2016-44
refinedweb
4,438
56.55
Example 2 Dijk. Example 1 Example 2 2n2 + 4<=3 *n2 4<=n2 n=2 and n=-2,negative value is neglected. Example 3 Example 4 The various big 0 complexities are given in Fig 2 and Fig 3. Before The amount of computer memory required to solve the given problem of particular size is called as space complexity.The space complexity depends on two components The time required to analyze the given problem of particular size is known as the time complexity.It depends on two components: It is the minimum time required to solve the given problem of particular size.For e.g.in linear search if element is found at first location then it will be the best case scenario and complexity will be O(1) as the running time is minimum. It is average cost and time required for a given problem of particular size.For e.g. in linear search if there are n elements and item is found at n/2 location,then it will be a average case scenario and complexity will be O(n/2). The maximum time required to solve a given problem of particular size.For e.g in linear search the worst case will either be item is present at last location or it is not present.The complexity will be O(n). In this operation,the element is inserted at the top of stack(Fig 4).In order to insert element we need to check whether TOP = MAX-1.If yes,then insertion is not possible.If element is still tried for insertion , OVERFLOW message will be printed on screen as the stack do not have extra space to handle new element.If space is present and element is inserted,then the value of top will be incremented by 1 . For example Program 1 #include<stdio.h> int main() { int stack[10]; int max; int num; int top = -1; int i; int item; //printf("Enter the maximum size of stack"); scanf("%d",&max); //printf("Enter the no of elements in stack"); scanf("%d",&num); //printf("Enter the elements of stack"); for(i=0;i<num;i++)//Fig 7 { scanf("%d\n",&stack[i]); top++; } if(top == max -1)//Fig 8 { printf("Overflow"); } else { //printf("Enter the item you want to insert\n"); scanf("%d",&item); top = top + 1;//Fig 6 stack[top] = item; printf("The stack after push operation is \n"); for(i=0;i<=num;i++) { printf("%d\n",stack[i]); top++; } } return 0; } Illustration of Program 1 The binary search technique works only on sorted array.It works by comparing the input element to the middle element of array.The comparison determines whether the element is less than.greater than or equal to middle element.Subsequent steps to be followed are written and explained by the following program. #include <stdio.h> int main() { int val[10] = {10,20,30,40,50,55,68,77,89,90};//Fig 3 int beg = 0; //first index of array int end = 9; //end(last index of array) = n-1 where n is the size of array and is 10 in this case. int mid = (beg+end)/2; // finds middle index of array. int i; int element; //printf("enter the element you want search for"); scanf("%d",&element); for(i=0;i<10;i++) //Fig 4 { if(val[mid] == element) { break; } else if(val[mid] < element) { beg = mid +1; mid = (beg +end)/2; } else{ end =mid -1; mid = (beg +end)/2; } } printf("Location of element is %d",mid); return 0; } Queues are the data structure that stores data in an ordered way.The first element entered is the first one to be removed.It is a FIFO(First In First Out) data structure.The elements are added at one end called REAR end and removed from other end called as FRONT end. In Fig 2.FRONT =0 and REAR =4 Queues can be represented by linear arrays.It has FRONT and REAR variables.FRONT points to the position from where deletion occurs and REAR points to the position where insertion occurs. Before insertion,check whether the queue has the space to accommodate the new element .If the queue is full is and still insertion in tried then “OVERFLOW” condition arises and element does not get into queue.It is checked by condition if (REAR = MAX -1) where MAX is the maximum number of elements that a queue can hold.If yes,then OVERFLOW condition arises. Program 1 #include <stdio.h> int main( ) { int queue[10]; int max,num,i,item; int front,rear; //printf("Enter the size of queue"); scanf("%d",&max); //printf("Enter the no of elements in queue"); scanf("%d",&num); //printf("Enter the elements of queue"); printf("Queue before insertion : "); //Fig3 for(i=0;i<num;i++) { scanf("%d",&queue[i]); printf(" %d\t",queue[i]); } printf("\n"); front = 0; rear = num -1 ; printf("Front end : %d\n",front); printf("Rear end : %d\n",rear); if (rear == max-1) { printf("Overflow"); } else { //printf("Enter the item you want to insert \n"); scanf("%d",&item); rear = rear + 1; front = 0; queue[rear] = item; printf("Queue after insertion :");//Fig 4 for(i=0;i<=rear;i++) { printf(" %d\t",queue[i]); } printf("\n"); printf("Front end : %d\n",front); printf("Rear end : %d\n",rear); } return 0; } Say we want to insert 15 in Queue of Fig 3. REAR would get incremented by 1(as insertions are done at REAR end) and 15 is stored at value of 5th index(Fig 4). Before deleting an element check for “UNDERFLOW” condition.It occurs when we try to delete the element from an already empty queue. If FRONT =-1 and REAR = -1 ,it means that there is no element in the queue and it is empty since index starts from 0. If we want to delete element from the queue,then value of FRONT is incremented(Fig 6).Deletions are done at FRONT end only. Program 2 #include <stdio.h> int main( ) { int queue[10]; int max,num,i; int front=0,rear; //printf("Enter the size of queue"); scanf("%d",&max); //printf("Enter the no of elements in queue"); scanf("%d",&num); //printf("Enter the elements of queue"); printf("Queue before deletion : "); for(i=0;i<num;i++) { scanf("%d",&queue[i]); printf(" %d\t",queue[i]); } printf("\n"); front = 0; rear = num -1 ; printf("Front end : %d\n",front); printf("Rear end : %d\n",rear); if (front == -1 && rear == -1) { printf("Underflow"); } else { front = front +1; } printf("Queue after deletion :"); for(i=front;i<=rear;i++) { printf(" %d\t",queue[i]); } printf("\n"); printf("Front end : %d\n",front); printf("Rear end : %d\n",rear); return 0; } Say we want to delete 25 from the queue(Fig 5) The value of FRONT in incremented t0 1 and 25 is deleted from the queue(Fig 6)
http://letslearncs.com/category/algorithms/
CC-MAIN-2017-30
refinedweb
1,145
60.14
The <xsl:for-each P:<xsl:value-of </xsl:for-each> I hope this walkthrough helps people configure and use the Content Query Web Part. I'd be interested to hear and see examples of how people are using the web part, as well as field questions. So, post your comments! --George Perantatos, Program Manager If you would like to receive an email when updates are made to this post, please register here RSS I was just getting set to write this up for a client. You are lifesavers! Thanks!!!!! Michael Great article, but I have a few queries: 1) How does one know that the body field needs to be referenced as "Body_x0020_content" in the .webpart file (as opposed to "Body_x0000_content", for example)? How would one find the required reference for another metadata field? Additionally, this field name appears to be composed of three parts - can any one of these be altered individually to achieve some other result, or do all three relate directly to each other and should only be considered as one? 2) In the XSLT "Body_x0020_content" becomes "Body_x005F_x0020_content" - where did the "x005F" part come from, what does it represent, and what is its effect? Thanks! :) I'm just as confused as you Marcus, the hex value seems to be plucked from the air. How do I know the x005F bit is the description? How do I find out what other objects in this are named/hex valued??? Nice concept, but seriously lacking in any explainations as to how this actually works and how it can be utilized elsewhere. Ian Hi Marcus, to answer your questions: 1) When you tell the Content Query web part to ask for a set of fields, via CommonViewFields as above, you need to use the internal name of the fields. SharePoint's UI shows you the display name of the fields, but stores the internal name in the DB. Usually the internal name and the display name match, but certain characters (like spaces) are encoded. An easy way to sneak a peek at what the internal name of a field is: when you visit the Site Column page for a particular column, the URL displays the internal name of the field. In this case it's "field=Body%5Fx0020%5Fcontent", which is just an encoded way of saying "Body_x0020_content". 2) This is one of the quirks of XML/XSL, namely certain characters getting encoded differently when getting passed as XML to the XSL to render. One easy way to see exactly what the XML looks like that the XSL has to render is to insert the markup I have in the example above into your Item Style, and that will render out the field names: <xsl:for-each P:<xsl:value-of </xsl:for-each> This will yield all the fields you can render by their name, including in this case "Body_x005F_x0020_content". Ian, if you have questions about how you can utilize the web part for your scenarios, feel free to post a comment describing what you're trying to do, and I can give you some pointers. To get the field names, I create a simple web part page and use the Data View web part to render the information from the _vti_bin/lists.asmx web service. Example You've been kicked (a good thing) - Trackback from SharePointKicks.com Hi George, This is a great post, and just what I needed. Now I've been able to add a group style for a links list, thus enabling targeting of single links in a list. It only required that I added URL to CommonViewFields. A small question. It´s quite easy to add a Content by Query WP to a site definition. Just set up an existing CQWP, export the XML and copy/paste to onet.xml. But the last piece of the puzzle in provisioning a page with the CQWP, to point to a specific list is not so obvious. It seems that the CQWP does not understand current page (.) / parent page (..) notations. I cannot set up CQWP with a links list name and a weburl, say the relative address of the page, e.g. "/./Linkslist". In practice this means, that after provisioning a page with CQWP, you'd have to manually set up the webpart to point to the proper list. Do you know if there is a way to do this? Kind regards, Lasse Hi i was wondering how you can set up this content query webpart using images. On the pages i want to display i have an image control. When i set the query on image on left i don't see any image. How come? First i had only a rich text editor control on my page which can't display an image. So i changed this to an image control. But it's still isn't there. I hope you can help me Hi Joost, out of the box, the Content Query Web Part requests the "Rollup Image" field as part of its queries, and displays it as the image in the out-of-box styles that display images, such as "image on left". You can see this in action with a default site by creating an Article page. There, using the out-of-box page layouts, you should see a Rollup Image field control when you edit the page. Specifying this image will cause the image to appear in the Content Query web part. If you want a different image to appear, I would recommend you use the CommonViewFields property to request the field, and then the DataColumnRenames property to map it to the Rollup Image that the XSLT renders. That way, the web part requests your custom image field, but then changes the name of it to match what the XSLT expects to render. You can avoid the DataColumnRenames step if you're willing to modify your XSLT to render out your custom field by name. However, that effectively "hardcodes" your XSLT to a particular field name. The DataColumnRenames property helps keep your XSLT styles somewhat agnostic of the underlying fields that it is rendering. Do you have any idea why the Content Query web part would not be available for me to add to a site? Running TR... Thanks, Mindy Kelly Hi Bisbjerg, If you're trying to setup the CQWP to point to one and only one list/library or sub-site, that should be possible through specifying properties via the onet. However, there's not a great way to expand a "relative" path, including . and .., to a server-relative path to a list, library, or site, when the part is added to a page. I'm assuming you're trying to configure the CQWP such that when the user adds it to a page, it points to the "right" list or library that lives somewhere in the site (say, a site-local document library). One option, as you describe, is to have someone customize the part after it'd added to the page. Another option is to have a bit of code that, when the part is added to the page, goes in and sets the property to the correct server-relative path to the list/library that makes sense. Hi Mindy, what site template did you use to create your site? The CQWP is only available in sites that have the Publishing feature enabled. If you started with a team site, that feature is disabled. Sites like Publishing Site have it enabled. You can enable it via Site Settings -> Site Features. Part 1 :: Part 2 This is part 2 of an ongoing series of posts about my experience building a custom site Hi, I found a similar article ere Continuing from last month’s list of recommended reading, here’s my short list of favorite blog entries Great post! I am running into one issue though... I am trying to use this method for the News site... display latest news on home page from the News section. I can get description, titles, IDs, etc all to show in the style, but not body. When I include body it renders nothing... no errors, just no content. Any ideas? Hi Heather, can you tell us how you're configuring the web part to show Body? Here is my custom template in ItemStyles.xsl: <xsl:template <xsl:for-each P:<xsl:value-of </xsl:for-each> <xsl:variable <xsl:call-template <xsl:with-param </xsl:call-template> </xsl:variable> <xsl:variable <xsl:call-template <xsl:with-param <xsl:variable <xsl:call-template <xsl:with-param <xsl:variable <xsl:if_blank</xsl:if> <div id="linkitem" class="item"> <xsl:if <div class="image-area-left"> <a href="{$SafeLinkUrl}" target="{$LinkTarget}"> <img class="image-fixed-width" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}"/> </a> </div> </xsl:if> <div class="link-item"> <xsl:call-template <a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}"> <xsl:value-of </a> <div class="description"> <xsl:value-of </div> </div> </div> </xsl:template> I stopped mid way through step 4 since I couldn't get body to show. I followed the previous steps to a tee. The Content Query Web Part is querying /News. Hi Heather, what happens if you remove the following lines from your XSLT template? <xsl:for-each P:<xsl:value-of The resulting display only shows the News title. Hi Heather, things to check: - Are you sure the web part is using the style above (S2Style)? - Is the web part you're referring to asking for the Body content field? Can you confirm by exporting the web part and checking the CommonViewFields property? - Did you confirm that the field is indeed coming back in the web part, with my value-of select="name()" trick above? - Does the body content field of the page in question contain any content? Yes, I confirmed all of those potential issues. One thought, do the various content types have different field names for common content? For Step 3, I used your example (<property name="CommonViewFields" type="string">Body_x0020_content, RichHTML</property>). Does News use a different field for the Body? Could the problem be that I am just not calling anything that exists for News (my News is the default News site that uses the Article Page content type)? If so, how do you go about pulling fields for any given source where you are aggregating content in the CQW? Ah, that must be it. I _added_ a "Body content" field to my Product Page content type above. This field does not exist out of box. For your case, if you're using the out of box article page content type, you can ask for something like "Page content" or the like to come back instead (the exact name of the column escapes me currently, but you can inspect the Article Page content type to see them all). OK, there has to be a trick to this filters thing. I added a custom field to my content type and, for some reason, it does not appear in the filter's drop down. Why? Does anyone know why? Is there a trick? donna.sullivan@rotary.org Hi Donna, what type of field did you add to your content type? I'm facing the same difficulty here as Heather. I want the pages from the Press Release to be displayed on my homepage in the CQWP using xslt. But nothing i try does affect the display. All i see is the title. For the pages i use the default article pages templates. First i customized the CQWP like below: <property name="CommonViewFields" type="string">Page_x0020_content, RichHTML</property> As you can see i have changed Body_x0020_content to Page_x0020_content. (btw i have also tried changing RichHTML to Publishing html (while thats the column type) Then i customized the ItemStyle as follows: ="@Page_x005F_x0020_content" /> </div> </div> </xsl:template> I know it's a bit of a mess due to copy - paste. But i think you know where to look. I really hope you can help me! I have also asked Heather if might know a solution many tnx, Joost Is it possible for the CQWP to query pages based on data in a field control? What I am trying to do is generate a related content section for my articles page. In the editpanel, the author will enter keywords for the article. Now the CQWP should read the keywords and execute the query on other pages that have these keywords too? Kinda like tags... So I define the site, the Content Type, Field Control and Filter and then I want the filter value to be picked up run time based on the page that this web part is sited on. Any ideas how to do this? thanks, anabhra Hi Anabhra, if I understand your scenario, you want to have the web part query for other pages that are tagged with keywords that match the current page, and you want this to dynamically change based on what the current page tags are. If so, I'd recommend you write some code (say, as a control) that lives on the page, inspects the page's tag, and then sets the Content Query web part to filter on that tag. For example, if the current page's topic is "Hiking", your control can read that, and then programmatically set the CQWP's filter to be Topic is equal to Hiking. This would be done during the page lifecycle. You could put this control on certain page layout to ensure it runs on the right pages (e.g. article pages). Hope this helps, --George Hi Joost, looks like internal names got you :) Go to Site Settings -> Site Content Types -> Article Page, and then click on "Page Content". That's the display name, but that's not the internal name. One way to find the internal name is to check the query string parameter on the field page. For this out of box field, the internal name is PublishingPageContent. Try replacing your instances of Page Content above (in both common view fields and the xslt) with this and see if it works. For fields that you create, the internal name will be more predictable. Very likely, it will match the display name, and will have characters like spaces encoded. Thanks for all of the support! I got my customized Item Style up and working, thanks to you guys. I have put together an article covering the stuff I learned in the process and basically embellished on some things from this post: Good to hear - and great post! Excellent Post!! Good indepth sample. Thanks Liam George, Thanks for the response. You understand my problem perfectly. However, one thing that I am struggling with is that since we do all configuration with the sharepoint designer now (page layouts reside in the database and do not allow me to do any code behind), how do I associate or hook into the page life cycle events. Ie; if I build a web part that reads the field control value and then sets the CQWP filter attribute, how do I know that the CQWP will execute the search after I set the attribute? Also, which in which life cycle event of the web part will I be able to read the field control value and set the CQWP filter? many thanks, Tnx for the help. It works like a charm now. Tnx to you and Heather. Thumbs up Many tnx, Joost Really usefull... Have you tried to also use your own CAML query to have advanced control over the returned data? I have tried to do this using the QueryOverride property in order to create a list of the current user's tasks including the tasks assigned to a group of the current user, because the "User Tasks" web part does not return these tasks. I couldn't make it to work correctly. It shows the tasks on "Edit Page" mode but not in normal mode... Really dissapointing and I couldn't find anyone talking about the QueryOverride property... thanks anyway... Does anyone know how to grab the Content Query Web Part's properties rather than those of the source data? I seek to control the output appearance more closely by retrieving the web part's default "ItemLimit" and "DisplayColumns" properties as well as custom properties which the web designer can modify. Adding, for example, attributes to be appended to the MORE link's URL (IE:). For my purposes each web part would need unique values for this argument. Any suggestions? Uma das web parts mais flexíveis fornecidas pelo SharePoint 2007 é a Content Query Web Part . Alguns Could you help me, please? The Pages Library option isn't showed in field List Type. I have a News Site. Sincerely, Ana. Well I am currently working on a project that has a great need to use the Content Query Web Part for... Hi Jason, a web part in the end is very similar to a server control. You can write another control that looks at the control tree, finds the CQWP, and examines its properties, for example. For your example, you can imagine a control reading the qs parameter and changing the CQWP parameters to filter on the fly. Does this webpart only available in MOSS2007? How about WSS3? I have the CQWP running a the top-level team site and it is successfully crawling the discussion boards in the sub-sites. The only problem is that when I click on the discussion within the web part I am directed to an /_layouts page(therefore failing) rather than the site directory/*site*/lists/.....? Any suggestions on ensuring the links point the the right location? Great article. However, instead of using the removeMarkup() function to disable escaping, try: <xsl:value-of Works like a charm.... Hi Richard, while that function does work, a potential unintended consequence is that, by disabling output escaping, you "run" any of the markup in the Body content field. That's fine for things like <div> and <span>, but what about <script>? It's true that SharePoint strips out script before it goes into HTML fields. However, one can configure a Content Query web part to map a field with script in it to a field that the web part doesn't output escape (like Body content in your example above). The result would be that someone with rights to update that field and put script in it could run the script on your site. The out of box Content Query web part and the XSLTs provide safeguards for this, by checking the source field type and making sure that you don't map it to something that disables output escaping. But that's for our out of box XSLT styles. If you do the above, you have to ensure that consumers of your web part don't try to sneak in markup that shouldn't be there. Hi Jason, the Content Query web part is available in MOSS. WSS does provide the underlying cross-site query (SPSiteDataQuery) if you want to use it directly. briand, can you give me an example of the URL that's failing, when you click on a discussion board item? Hi George, great post! I saw on one picture that your Additional Filters you had a custom field, "Product Line". I am dying to know how to add the custom columns I create for a Document Library to the Content Query filters like you did with "Product Line". Could you point me in the right directions, please? Thanks a lot! :) Great article! You should use disable-output-escaping="yes" instead of your own tag filter. It will render the html! still a great post though! Hey Vintage, the Content Query web part will enumerate custom site columns that you have added, letting you filter on them. Note that if you choose to filter on a content type, we will only enumerate site columns from that content type. Are you having trouble seeing your custom column appear in the CQWP? This is a great article and will save a lot of time for alot of people. One question: Is there a reason the CQWP limits the additional filters to three filters? Suppose I have a content type with many columns and I'd like to filter on more than three columns. The behavior I would like would be something similar to creating a view in the document library. Any recommendations or guidance on how to filter the CQWP on more than three filters would be very helpful. Hey Robert, you can configure the CQWP to use more than three filters by modifying the "QueryOverride" property to use your custom CAML query for filtering. The CAML query can have any number of filter fields and values I have configured the CQWP to use a custom style ( modified the ItemStyle.xsl file ). Would it be possible to set the XSL of the web part at run time. The behavior I would like to see, would allow the administrator to configure the web part by entering the XSL code at run time, in a text area in the tool pane. Is this possible? Hi! Thanks for your answer, but I've managed to find out how to add the custom columns to the CQWP using the AdditionalFiltersField! Thank you for sharing all this information with us! Take care! Hey George, I have to customise the cqwp. I have the following queries: 1. Is it possible to populate the content query web part from database( sql server 2005.....if the content data resides in sql server database). ?? if it is possible, Do u have any examples for this ?? What are the possible sources from which i can populate the content query web part ?? 2. I have a cqwp in which I am displaying the news items related to a category (ex: Tax). I want to display the news for the previous week on the click of a link button << on my web part? How can I do this? do u have any examples ?? any help would be highly appreciated. alex Hi Ian, I think what you did here is terrific! But I'm a beginner and don't understand at all how you set this up, would you be willing to elaborate? Mindy Geaorge, Great Link!! I have made a content query web part comprising of news items filtered on news category. In the CQWP I am able to display the news items for the current month using filters. I have the following requirement- I need to add a button called previous << on click of which it should fetch me the news items for the previous month. Can you help me out how do I achive this? Ny code u have sample? Any help would be highly appreciated !!!! Hi George, thanks for a great article! QuestionL: how can I pass the listname to the CQWP XSL stylesheet? For example I want to add a View All button at the bottom of the rendered content that links to the /listname/AllItems.aspx page, but I can't find a way to pass or query the listname. At present I've got it working by grabbing the first row returned and stripping out the string but that does not work when 0 rows are returned....The listID is passed but not the listname. Thanks! I am trying to use the CQWP to query on two lists residing on two different subsites. Now while configuring the query part of CQWP i have three options to set as source.I cannot use either "Show item from following list" or "Show item from the following site" since the lista lie in two different subsites. So i set the source as "Show items from all sites".Further i have List Type = Custom List Content Type Group = List Content Types Content Type = Items. However on doing this i am getting a large number of items from lists other than the above two lists which is not acceptable for me. How do i configure the CQWP to show items from just the two Lists. Can i somehow mention the GUID's for the list in order to restrict my query to just the two specified lists? Hi, I'm trying the same as Robert: use more than 3 filters. I'm doing like that: protected override void OnInit(EventArgs e) { base.OnInit(e); this.QueryOverride = @"<Where><Eq><FieldRef Name=""isFull"" /><Value Type=""Boolean"">0</Value></Eq></Where>"; } What could be wrong? It doesn't filter anything. Thanks! Hello I would like to add small image to entries which emphasize new articles. e.g. Like the "new"-image in list for new list entries. Is this possible with the cqwp and xsl? Mike I am trying to schedule announcements for display on the front page using a CQWP. I can get it to work using QueryOverride and <Today/>, but I want to specify specific times, too. Can this be done? I tried using <Now/> to no avail. Please help! Sample: <Where> <And> <Leq> <FieldRef Name="PublishingStartDate" /> <Value Type="DateTime"><Now /></Value> </Leq> <Geq> <FieldRef Name="Expires" /> </Geq> </And> </Where> ~Jeremy Hi, seems some of you have got the QueryOverride property working. I am trying to use the property to retrieve documents from one of the document library using a simple CAML query as below, <Query> <Where> <Eq> <FieldRef Name="ContentType" /> <Value Type="Choice">Test</Value> </Eq> </Where> </Query> However, I get the error "There is a problem with the query that this Web Part is issuing. Check the configuration of this Web Part and try again.". Tried changing some configurations but the error persists. I have also set values in the DataColumnRenames and CommonViewFields properties. Would that affect in anyway? Is there anything else that needs to be configured? I have tested the query successfully using the U2U CAML Query builder. Any help or advice is greatly appreaciated. Thanks! Hi ArtiK, chances are you have some malformed XML, or you have some additional spaces somewhere in the markup, or you have an invalid CAML query. Have you tried some of the examples from here?: Hi MikeD, it depends on what your logic is. One approach would be to get the created date for each item in the CQWP result set, and then do some conditional logic in the XSLT that compares that with today's date and renders the "New" if it's within some set window of time. Provided you have the items' created date and today's date in hand by the time the XSL is running, you should be able to do this. Hi Pablo, do you get the same effect if you specify the QueryOverride property in the .webpart XML, instead of programmatically? Hi Somesh, you can configure the web part's ListsOverride property to pull from specific lists, based on list ID. You can find more information about the property here: Hi Karthik, you can set the XSLs that the web part loads at runtime. You could write another control, for example, that sits on the page that sets the CQWP's item, header, and/or main XSL files at some point before the render method is called. Each of the three XSL files are represented as separate properties in the web part. They're also expressed as .webpart properties in the XML. Hi George Karkalis, You are only seeing your items in edit mode because the caching infrastructure of the CQWP does not cache checked-out items of individual users and we disable cache in edit mode. You can disable caching on your webpart by setting the "UseCache" property to false. Hi Jason Becker, You should look into extending the ContentByQueryWebPart class, from there you can add additional properties to the web part and also pass new arguments down to the XSLT. Adri Verlaan Hi briand, You can fix this by modifying the following line in ContentQueryMain.xslt from <xsl:if <xsl:value-of </xsl:if> to (added $SiteUrl) Adri Verlaan [MSFT] Hi alex, 1. Yes, it is possible to use data from other sources but will require some coding. First retrieve the data from your source and convert it to a DataTable. Then set your resulting DataTable into the "Data" property of the CQWP. From there the CQWP will use the data provided instead. 2. You can achieve this by extending the CQWP. You could use a querystring parameter to identify the month and then have your extended CQWP change the CAML based on the month. Hi Adam, You can achieve your scenario by extending the CQWP and overriding the "ModifyXsltArgumentList" function to pass a new parameters (List Name) down to the XSLT engine. protected override void ModifyXsltArgumentList(ArgumentClassWrapper argList) argList.AddParameter(columnName, namespace, value); Hi Jeremy W, For time comparisons you need to include the following CAML attribute: IncludeTimeValue="TRUE" <Value Type="DateTime" IncludeTimeValue="TRUE"><Today /></Value> Hi Ana, The CQWP will show list types that are present on the root web. If it is only present in a sub-web then you can use the ListsOverride property to set the correct value. Out of the Box, the Pages Library server template is 850, hence you might set the ListsOverride property to the following: <Lists ServerTemplate="850"></Lists> Hi, thanks for the quick reply. I have tried the example from msdn sdk as well and it gives the same error. I tried creating a CQWP to display items from one of the document libraries, this works fine. Then exported it to add in the query in the QueryOverride property. One the query is entered, it gives the error "There is a problem with the query that this Web Part is issuing. Check the configuration of this Web Part and try again.". Is there any specific configuration or authentication required to be set somewhere? I have tested my queries using the U2U CAML Query Builder and they are retrieving the correct data. Really lost figuring out what is wrong. Appreciate your reply. Thanks. Hi, I have managed to get the CQWP webpart to work using the queryoverride property, there was some problem with the query format. Thanks for the help. In ItemStyle.xsl, I see this for every template: <xsl:variable When I use the CQWP to display links from a Links list, I want the links to open in a new browser window. The above looks like it should do it, but I don't see an "Open in new window" field when I create a link in a Links list. Can I add a field that will take advantage of this?. Hi JoeD, Yes you can take advantage of this. Create a new column to your list called "OpenInNewWindow". Then add "OpenInNewWindow" to the CQWP CommonViewFields property. Hi BeckyB, You should look into what the ListsOverride property can offer you. I have been working in a MOSS 2007 environment and cannot find the Content Query Web Part in the web part Gallery. Where can I obtain it/download it? Thank-you very much, Rod rkeinc@rke-inc.com rodney.erb@us.army.mil My SharePoint 2007/MOSS 2007 environment has NOT had the Content Query Web Part installed because the system administrator indicated if it relies on MOSS 2007 search/indexing there are problems with our server in this area. My question to the guru's out there is does the Content Query Web Part rely on searn/indexing? If it does NOT my system administrator indicated he would install it now. Thanks to anyone who might know the answer. Hi Rod, The Content Query Web Part [CQWP] does not rely on MOSS search/indexing. At Step 4 (see below) the article assumes the reader knows how to edit the web part. How do you edit the web part? In the picture, I see STYLE LIBRARY "This System List was created by the Publishing Resources feature to..." I'm lost... can someone help me? Specifically, I am trying to add a "column" (Publish) to the Content Query Web Part so that I can render/select it in my Query ." Thank-you. Perhaps this is a basic question - but where do the values for the filter portion come from? For instance, if I choose to filter my Content Query web part under Additional Filters, I get a drop-down list box (Show items when:). Where does this list of fields come from? how can I add fields to this list? Zandy My installation of MOSS 2007 is missing the Content Query Web Part, along with the Summary Summary Link Web Part and Table of Contents Web Part. How do I install these? Ed, The Content Query Web Part is part of the “Web Content Management” features of Microsoft Office SharePoint Server 2007 and in order to use it you need to turn on the Publishing feature on a site. It is not available in a default Windows SharePoint Services v3 installation. The following article which is based on the beta may be useful in how to use it once you get it installed... I hope this helps. Good Luck, Hi Zandy, The list of fields is derived from the Site Columns. You can add new columns following this path: Site Actions->Site Settings->Modify All Site Settings->Site columns->Create. Great article (and thanks to Heather Solomon for her additional information). I've been able to really tweak the CQWP results but I'm stuck with a list of results where I'd like to display the results as a grid with multiple columns. I've figured out how to create a new column for each group (<property name="DisplayColumns" type="int">2</property> within .webpart), but I'd really like to have a display more similar to what's available with a photo library. Any help? Mike. Hi Mike, You can achieve your scenario, using at least two different methods: 1. You can modify ItemStyle.xsl and create <div> with specific CSS attributes to create your columns. has some good example of how to do this. 2. You can modify ContentQueryMain.xsl and add a <table>/<thead>/<th> tag before the call-template to each items and a closing </table> tag afterwards. Then Modify the ItemStyle.xsl to generate a single row using <tr> and <td>/<th> Will it be possible to assign the filter value dynamically..for eg getting site name and assinging to filter value ? Hi vamsi, You can do this by extending the Content Query Web Part and assigning the filter values during OnLoad() of the web part. Hi George Perantatos, I have created a Column with type of lookup from a My List and I add to Page content type. When i used Content Query Webpart to filter information but that column disappear to manipulate I tried to create a new column with type of Choice, new column always appear in filter property of Content Query Web part Please help me. Pham Tuan Anh Hi Pham Tuan Anh, The Content Query Web Part [CQWP] shows only site columns. You can add site columns by going to: Site Actions->Site Settings->Modify All Site Settings->Site columns Also the Cross List Query [XLQ], which is the data source of the CQWP does not support choice or lookup fields that have multi-choice enabled. Has anybody else encountered a problem using lookup columns with the Content Query Web Part? I have a site column called Portfolio which is a lookup from a list on my top level site. This column has been added to a content type. I have instances of this content type on several subsites. I am trying to roll up all instances of this content type onto my top level site. I have edited the CommonViewFields property of the .webpart file to include Portfolio,Lookup however I get the following message when I upload this web part 'There was an error retrieving data to display in this Web Part' I have other custom columns in this content type which work fine but aren't lookup columns. Any help would be greatly appreciated. Follow up to above... I have just found that by grouping the items by another lookup column on that content type, the Portfolio lookup is displayed. As soon as I take this grouping off I get the error message as above. How strange. Does anybody have any ideas why this should be so? Hi Sam, Most likely the error is caused because the lookup column allows multi choices. Multi choices is not supported by the Cross List Query [XLQ] which is the data source of the Content Query Web Part [CQWP]. Is it possible to configure a CQWP to return a list of documents that have the edit drop down (check in/out, send to, etc.)? Hi Adri, Thanks for your reply. However, the lookup column does not allow multiple choices. As I mentioned, when grouping the items by another column then the lookup value is returned, but when there is no grouping then the error message is displayed. It sounds a bit like a bug. Can anybody else reproduce it? Hi there, wondering if anyone else has experienced this behavior. I have a list with a couple of custom fields on it (the list is derived from the 'Site List' type from the Site Directory site template). I am able to get the fields that were initially part of the list template (Region, Division, URL) to show up in the filter drop-downs using the AdditionalFilterFields property. I can also get my custom fields to show up (for example, I added 'Site Type'). The problem - when I enter a value to query for Region, the expected results are returned. However, if I enter a value for 'Site Type', expected results are NOT returned. Is there some problem with using custom fields added to a list template for filtering? Thanks in advance - James hi, I have one problem. I use side navigation and content query webpart. When I change side navigtation configuration. query source is changed in webpart automatically. for example) /MDocuments -> /defalut.aspx/MDocumets It means that /defalut.aspx is created automatically. Hi folks, Sometimes, when I changed navigation configuration, the query soruce is changed automatically. /document -> /defalut.aspx/document/ Any idea how to fix this? Thank you. I have the CQWP on my site, but it only shows the image rollup or description on a publishing page. if I query a task list or calendar, not even the description appears. Hello, I am trying to pull up the list of attachments attached to specific item at the list in order to display them on the page. I'm using CQWP to query the list, but i can't get done. Do anybody have an idea how it could be accomplished? Shimon yes, it works, but only under system user(eg. 'browse in explorer' under sharepoind designer ), after configure my site to anonymous access, only title field is displayed when access in anonymous user, am i missed any configuration step? <xsl:value-of ... at <xsl:value-of O'Clock </span> <div> <xsl:value-of <a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="read more"> ...(more)</a> </div> </div> i also add the following lines in the .webpart-file: <property name="CommonViewFields" type="string">ExternalUrl,URL;PublishingPageImage,Image;PublishingPageContent,Note;</property> I am appreciate for any hints. Tim (hope i english isn't too bad) You are the bomb ... this is quite useful. I knew it was possible, you have saved me several hours of digging. Thanks for the useful post. I've been able to use information in this post and others to create a 'task rollup' view using the CQWP. The query had to be customized to return the Due Date, Assigned To, fields etc. The task lists being queried exist on the root site and a number of sub-sites within a site collection. This worked wonderfully until I logged in as a user that is not a Site Collection Administrator - this user does not see any of the custom-queried fields, only the task title. If I make the user a site collection admin, it works. Anyone else seen this? Coult there be a bug in the implementation of the CQWP where it is not executing the query to get the additional fields with elevated privilege? Thanks! Hello to all, All the thanks to everybody to share this valuable information... I have a case and I do not know if it face any of you. When I use the CQWP to query do so? Any help would be greatly appreciated... What a shame that its all so "black box". Would be nice to ba able to see the XML I'm supposedly working against. Does my extra "CommonViewField" come through? who knows, it could be ropy XSL, but I've no way of knowing. Talk about overcomplicating something simple. Would you please give me some suggestions on how to retrieve the results data from the Content Query WEbPart? Firstly, I setup the WebPart to retrieve List data from all sites' tasks Lists. Those Listitems are return to the WebPart and I can see the results on the screen. Now I would like to get those results data from the Webpart and passing them to another web applicaiton. How can realize this function? #Problem getting outer div around all the items Hi , I want to add a div tag,and want to open it in header and close that div in footer in ItemStyle.xsl.I have found both header and footer. I tried implementing the Mike's way() but it does not seems to be working.Whenever i add and open a simple div tag in header and close it in footer,it gives an error.When i prefixed <![CDATA[ before div,it just printed the div as simple string. Is it possible to install this Content Query Web Part on WSS 3.0? All I have found on this web part assumes that you already have it on your Sharepoint server, and I know it comes with out of the box MOSS. I have WSS 3.0 and need a web part that will do what the CQWP will. Any suggestions? Thanks! I've read a few blogs on how to use Content Query Web Part to rollup information from multiple sharepoint lists. I could still not successfully get it to work. I basically just want to use CQWP to rollup the two task list we have on two separate Sites (Parent & child sites). I was successfully get the title of tasks from both lists to show up, but I would like to also display additional fields from the task list in this rollup web part, I couldn't get it to work. Please help I, i would to use Content by query in a user control with url in parameters and costum field. My problem is i dont want import and export my cbq in a web part zone.. I want use the cbq control and use its properties. I find in a web and i just find the solution in this article... Do you know how i can display my custom field with xslt but not with the import export way? thanks I'm getting the hang of CQWP and all.. but I got stuck at the Additional-Field part. Now I have a field which can either be filled with multiple values or no values (null/blank). Is it possible to filter these out? I've tried several possibilities with 'is equal to' and 'is not equal to' and the AND and NOT operator. But the results are either Show All or None :S Kwok-Ho Hi, I had copied the "Image on Right" item template to "MyItemTemplate" in the itemstyle.xsl. The newly added item can be selected in the tool plane. However, no changes in layout even thou' I updated the itemstyle.xsl. Do we need to restart anything (e.g. iis / wss) in order to take effect? we have a Custom list on the home page which we must display on several other web sites. I tried to do that with the content query Web Part, but i want to display _all_ Columns from the list. Is it not possible to display that without manually select the columns via export webpart/edit xml ? Hi guys, somebody knows how to retrieve the Display Name of a column?. Actually, the name() funtion gets the internal column name only. Thks. Go to and good luck! I'd like to leverage the Content Query Web Part to display a Summary link part created on my main page, to display the Summary Link web part throughout all other pages. I've been succesful in doing this with my announcements but don't see Summary Link web part as a option in the List Types, only links. I receive the following error message when creating any CQWP. Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator. The funny thing is that with my admin account, the CQWP works fine. Every other user, receives the above error message on his screen. Any help would be highly appreciated! I want the CQWP to show items from multiple list types. The Page library, a document library and a custom list. I tried this by using the list override property but: When I use de GUID from a custom list or a link list in combination with a guid from a document library and the page library it doesn't show the items from the custom list only from the libraries. When I just use the (custom) list GUID it works fine for that one. Code example: <property name="ListsOverride" type="string"> <![CDATA[ <Lists> <List ID="16b74d46-b2ta-4896-a61a-02b3f08d55zb"/> <List ID="135F445F-4457-413F-AABE-D3CF00C29A03"/> <List ID="D84ED59A-1922-45FF-B275-C10448794A5F"/> </Lists>]]> Could anyone help me out, please? Greetz What about those of us with WSS 3? This is exactly what I need for a site, but I don't have MOSS 2007. Any ideas how we can get the same functionality - is it possible to install the web part or import one in to do this? Greetings, This worked like a champ! Thanks for the code. One question. I am rolling up announcements from other departmetns into a single announcement on my "root home page". therefore in my query section I have selected: * show items from all sites in this site collection I would much rather pick and choose the annoucement lists if possible. Is there a way? Also, I only want to show the 2 most recent announcements from each department annoucement list in my roll-up but I have not found a way to do that. Your example above does not quite fit, since, I believe I am querying the whole site collection. Thanks for your help bsieloff@gmail.com Hello, I have to share contents between diffetent Sites Collection. I mean, I need to show a content information from SiteCollection1 in SiteCollection2. Is there a way to do this? After reading this, Heather's and a couple of other posts, my main objective was to 'wrap' all items from a list in a DIV tag, with minimal impact to ContentQueryMain.xml I've found something not posted in any of these blogs/posts/comments that may well indicate further developments on this area. Both Header and ItemStyle have a 'mode' 'CallFooterTemplate' template: <xsl:apply-templates </xsl:apply-templates> Then inside Header.xsl, you can create two GroupStyle templates using both modes 'header' and 'footer', where the tags for open/close tables, divs, and everything else can be placed. Works very good, with minimal changes to ContentQueryMain.xml, and using the same architecture that MS is using for Header and Item. Regards, Lucas Persona I am trying to configure the CQWP for our team site. We want to roll up tasks assigned to a given user from multiple child sites and display them all on the parent site. When I run the query and select the "assigned to" filter, I get the error, "There was an error retrieving data to display in this web part," even though the user's tasks should have been displayed. Oddly, when I change the filter selection to "created by" and run the query, it works. I've been searching for a solution and haven't been able to find one. Has anyone else encountered this? Jen I am trying to follow the example above and it all works great except I can't get it to return the fields from my custom content type attached to the list. I have added the following code to the styles. <xsl:for-each P:<xsl:value-of The items from the list are returned as expected and the query is set to filter out those items which are not created with my custom content type but none of the fields from my custom content type attached to the list are returned from the <xsl:for-each> Does the select="@*" filter these out? Any ideas??? Pete Pete, Are you adding these additional fields to the CommonViewFields tag in the XML (after you Export the webpart)? Lucas Hi Lucas, No I haven't... I guess my understanding was that this would show me all fields associated with this list. If I have to add the fields to the CommonViewFields tag in the xml then I already know what these fields are and surely this code is redundant? Am I missing the point of this code? I was hoping that this code would show me what fields are associated to the list so I knew what to put in the CommonViewFields tag? More questions on the need for more than three filters within the CQWP and it is a two parter: 1. I need a way to have the author specify more than three filters but I can not find anything that shows how to get the CQWP to display more than three sets. Using the QueryOverride does just that, it disables the UI area for the filters at runtime. 2. Is there a way to do an "AdditionalQuery" in that it takes what is entered by the author in the filter fields and add whatever additional params to the query - like a QueryOverride but not override the whole query. Need for global date filtering so that the authors don't have to specify it every time. Or, to do any of the above, need to make a custom CQWP? Hi ron, Yes it is possible to modify the XSLT to show an edit drop down menu. Hi James, The AdditionalFilterFields takes internal names, and not their display names. The space in "Site Type" gets converted by SharePoint, check the URL when modifying your site column the internal should be in it. Hi Marvin, Navigation should not affect the CQWP. Do you have custom code, what navigation setting are you changing? Hi Mark, You need to figure out where calendar/task list description are stored and follow the article instruction. Hi nxliu, Have you published and approvel your XSLT? Hi Tim, FormatDateTime passes the specified string to the toString of a DateTime, the doc bellow should help you figure out what format you want: Check DataColumnRename and try to rename the column you want to show as title to "Title" Since you are getting the first 200 character, there might be malformed tags or missing tags, which causes the browser not to render your content where you expect it to be. Also make sure that this is indeed the internal name of the column where your data reside. Hi Sanjeev, This is most likely because your XSLT are in draft mode, hence only visible to the Site Collection Administrator from which you modified those files. You need to publish and approve your changes. Hi Sahal, The CQWP does not support specifying a folder, please select a list. You can use one of your filter tripplet to reduce the result to a specified folder. Hi LL, You can extend the CQWP, from there you can do what you want with the data. There are also some API that you can call to retrieve the data (and cached), without the need to use the CQWP for your third party web applications. Hi tutejaamit5, Try to print your value as text by putting quotes in your select attribute, otherwise you might need to modify the ContentQueryMain.xslt to do what you want. Hi JWM, This is a MOSS only feature. Hi Vicky, What step are you having a problem with? Hi icemx, You can use SharePoint Designer and drag and drop the web part and modify the property from a toolpane. Hi Kwok-Ho, Unfortunatly the data source that the CQWP uses does not support Mutli-Valued Lookups or Multi-Choice columns. Hi Andy, Check your first line, and verify that the match attribute is correctly set. Hi Thomas, Not to my knowledge but you might have more luck looking up SPSiteDataQuery documentation. Hi eddietec, To get the display name you will need to extend the CQWP and write code to pass down as an arguments the display name of your columns. Hi David, To achieve this scenario you will need to write a new DataSource that retrieve the data from your summary link web part. What I would suggest is creating a custom list and placing your items there, and then have all your CQWP point to that list. Hi Yannis, Most likely the Site administrator is seing a draft version of the xslts that are valid, while users are still seeing the published xslts version. Publish and approve your xslts. Hi bartski, Check the SPSiteDataQuery documentation to see if having stream and non-stream items in a single request is supported. Hi Lellie, The CQWP is a MOSS only feature, but you can upgrade WSS to MOSS. Hi Bob, You can set your query to a list and specify the maximum number of items to return using the toolpane. Hi Dario, This is currently not supported without custom code. Hi Jen, Most likely your assigned to column is a multi-value lookup or multi-choice column which is not supported by our data source (SPSiteDataQuery) Hi Pete, The code snippet you specified only returns the column name once those column have been requested, you will need to first specify the CommonViewFields so that those column are returned with the data. You can get the list of columns of a list by looking at it's settings. Hi Shanon, Yes, you will need to extend the CQWP to be able to implement your scenarios. I used this example to pull content from an announcements list and display the body contents in the CQWP. However, I'm having problems displaying double quotes from the body of the announcement. They show up as '"' in the CQWP, and looking behind it seems that it translates the '&' from the '"' to '&' and then adds the rest 'quot;' so what I see when I view the source is '&quot;'. Anyways, I tried to fix the problem by using a simple XPath replace function on the $bodyContent in the ItemStyle.xsl, but it fails the web part. What I've written is this: <xsl:value-of I have tested the function by replacing a with b and it still fails with the message Unable to display this Web Part.. etc. Any suggestions? Is my syntax incorrect? Any other way to solve this problem? Funny thing is that double quotes from the announcements' titles are displaying correctly. Thanks for any suggestion.. - Harlan I have the same problem as Yannis: Unable to display webpart... Pages are not publishing pages. Admin can see CQWP info, but others can't, but sometimes the others can. This problem has just arisen in the last week. Previously, no problem with anyone seeing anything. Sites are provisioned from a template, but then changes are made to the provisioned site and the error arises. The topic of making the Content Query web part display custom fields has been a hot topic on this blog I don't normally do this, but there are a few things I've noticed in my feeds the last week or Ein Visual HowTo zum Thema Displaying Custom Fields in Content Query Web Parts in Office SharePoint Server The Content Query Web Part (or CQWP) in MOSS 2007 is one of the most often used components on SharePoint-based The Content Query Web Part (or CQWP) in MOSS 2007 is one of the most often used components on SharePoint Reading this post a few months ago I found this great tip. If you want to know what are the fields that Aujourd'hui, je vais profiter de vous donner quelques informations sur la customization de la content Hi everyone, I need some help.I have just created a publishing portal. I have problem with my anonymous access. Somehow member of the public cant view my custom list item without being prompt for a username and password. I have set the anonymous access to "view entire websites". I do not have the same problem with other theme sites. I think the problem lies in the lock down mode (limited access) in publishing portal. Can anyone teach me how i can handle anonymous access to allow them to view custom list item?.. Any help is appreciated Chia Weng Yan Excellent blog! I have one question, I want to group by weeks, how do I accomplish that? Great article. It works great here. I have one question, when user click the (more) link, I want to just show the entire annountment on the web page without Title, Body, Expires, ... in the left hand side and announcement details on the right hand site. In other word, I just want to display announcement details on the page without showing all announcement attributes in a table format How can I do it? Thanks, Peter Hi ECM-Team, is it possible to query the Wiki content field with the Content Query Webpart? There is a field called "WikiField", but if I integrate it in the CommonViewFields nothing will be displayed. Anybody any ideas?? Is it possible to add paging to the CQWP? e.g. A CQWP is querying a links list that contains 20 items and the CQWP displays 1-10 initially and has a next option to display 11-20 with a previous option? Dustin Does anybody know how to get file size internal name and type for a document library. When I checked all field names, I saw '_x0020_ows_File_x005F_x0020_Size'. but when I used the name in xslt, I didn't get any value Hello, all. I have such problem as in great article. In page I uses discussion board. And task: News page must to display information about latest discussion board messages. What do you advice to me? (May be I have to use query conten web part or rss viewer.) Desde que conozco SharePoint siempre he percibido una gran limitación: la imposibilidad de tener Desde que conozco SharePoint siempre he percibido una gran limitaci&#xF3;n: la imposibilidad de tener I have a similar question as Somash. I followed the link you provided, but I cannot see how to use this for multiple lists. I want to have 1 COntent Query Web Part, and I want it to get data from 2 seperate lists (List 1 and List 2). Is this possible? If so, how? Please help I have been on this problem for weeks now... Steve How do you change the UseCopyUtil parameter? For some reason if we make any edits to the Query Web Part it will default the part so that UseCopyUtil will equal true hence displaying a link to the Item List rather than the link address. This is an upgraded site so the List object being used is the Listings list. I have even exported the web part manually changed the UseCopyUtil to false but if anyone makes even the slightest change to the web part it over writes it back to true. Hi Harlan, Your content is being encoded by the xsl engine. This is to stop Cross-Site Scripting vulnerabilities, where a malicious user could create an announcement containing javascript. -If you trust the content of your announcement, then look into the xsl property disable-output-escaping. -If you don't trust the content, then the OuterTemplate.GetColumnDataForUnescapedOutput function allows you to verify that the data is indeed from a column that validates agaisn't OSafe (e.g. Html). (Osafe strip out JavaScript from HTML) Hi Nancy, Check the ULS logs, they will have information as to why the web part can't display. Hi Daniel, You will need to inherit from the ContentByQueryWebPart class and use the ProcessData delegate. From there you can modify your date column, place the same value for the ones you want in the same group. Then you can use the AdditionalGroupAndSorting Hi Chia, Yes, it is a conflict with the Lock Down Feature, try disabling the feature then deactivate and reactivating anonymous access for changes to take effect. Hi Peter, You can achieve your scenario using JavaScript and DHTML. First start by storing your data into a javascript array and then create a function that populate the right hand side based on the array. Hi Christof, Make sure that your items are returned first, otherwise you might have to change settings like Content Type and List Template you are requesting. Then add to the CommonViewFields 'WikiField,Note'. Hi Dustin, The Data Source that the CQWP uses does not handle paging. You could request the top 50 items, display initially 10 and create paging on the client using DHTML & JS. Hi james, Try File_x0020_Size or File_Size and it should be of type Lookup. Hi Steve, Look at bartski post above, it has an example of one can achieve this. Everything is/was working fine until I decided to "Group" the results by DatePublished (custom field). It is grouping them just fine, but I can't customize the style of the group headers, We have a dark green background and the text is black (hardly readible). I tracked the style down to Header.xsl and div class="groupheader item medium", however when i try to put a custom div class there it doesn't work, and I can't seem tof ind where this div is located, I tried throwing it in my stylesheet and even calling my stylesheet inside header.xsl and nothing has worked, any help would be great! Hi, Today I receive several questions about debugging CQWP XSLT. Although I love writing them in Notepad I have created a Links list with a content type called FormLink. I'm trying to use a CQWP to display specific links from that links list. It displays them ok, but when you click the link, it takes you into the View Item screen from the list instead of taking you to the URL designated for that item. Ideas on what I've done wrong? I have read this and several other articles/blogs regarding the CQWP. Thanks for all of your help so far and your promptness in answering questions. My question is simple, I have a "custom list" with a custom column that is a "link" field (linking to content not on my site). When I use the CQWP with this custom list the clickable results of my query always direct me to the actual item on my site not the target of the link in my custom list. How can I make the result of my query a custom list's link field, so that users can click on the item returned from the CQWP and go directly to the external site for which the item's link field represents. -Todd hi..I need to use the CQWP in a team site. I created the Style Library at the top level site and populated it with content from a publishing site. I can add the web part to the page but it freezes the browser when I try to browse to a list in the web part properties pane.. Can u please tell me what does it take to make it functional in a team site? Thanks in advance.. How can I dispaly a Work flow status column in a list using content query web part. I've got a list of "course" that i want to dispaly in my welcome page. 1. I added a CQWP to my welcome page with the following properties --> I've taken the items for a specific list, and the list type is calender. 2. I exported the file and added description to it (i know that in some cases this data is already included, so i tried both ways) 3. opend the file in the designer and edited it : <xsl:template <div class="image-area-left"> <img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" /> <xsl:call-template <div class="description"> <xsl:value-of </div> </xsl:template> 4. Its seems that something is not working properly since the view hasnt change could you help me please Hi Matthew, It is indeed in the Header.xsl, modify the template that correspond to the group style that is selected in the CQWP Toolpane. Hi Bonnie & Todd, The url by default for list items are it's view item screen. You will need to modify the xslt and change the value of the url to the value of your column containing your links. Hi Raja, You can always type the list you want to retrieve. Hi Anil, You need to request the work flow status column using the CommonViewFields property of the web part and then use the DataColumnRename property and/or modify the xslt to show the column data. Hi itay4x4, Verify that the Item Style in the Toolpane is now on "MyView". i have a content query webpart on my portal. i want to filter the data via an url-filter webpart. but the cqwp seems not to use webpart connections. is there any way i can do this ? Thomas I want to use the CQWP to link to a calendar list that has a Single-value lookup field. And I want it to display this field as a link to a PDF file that this lookup is referencing. I can pull the field a but the best I can get is a link to the calendar item, not to the PDf link in the calendar item. Dave when I have double quotes inside my RichHTML field, when rolling up inslide cqwp i receive " instead of " solved with disable-output-escaping="yes" Thx for this sample great walkthrou. Is it possible to setup the CQWP to display Items according to the users rights? I'd like to display the latest sites within a websitecollection. All these pages have an expire date and disappear after this date. But special groups like the content editors and administrators should be able to see these entries plus the expired entries of the last 10 days. Can you tell me how to set it up? thx in advance In addition to my previous post. I was working on a way to give the announcementslist a better look through George, Great post on this subject!!! I am doing a rollup based on the Posts list of a Blog site in the same collection, but I can't seem to get the body to display. Doing the adjustments that you mention above, I was able to get it very VERY close. Example of what is rendering: BLOG UPDATES 2008/01/23 08:55:00 <Title> Author: <USER> Created: 2008/01/22 <BODY>...more But the BODY part mentioned above, I can't get no matter what I do. I add this to the ItemStyle.xsl: <xsl:value-ofMore...</a><? Can you advise what I'm doing wrong? Is it because I'm not specifying something like @Body_x005F_x0020_content? (and how can I easily find what field this is for the Posts list if that is the case?) Best Regards, Alan I have a lookup field in my content type. I have edited the CustomView propoerty. Ex: CommonViewFields="Title,Text;Comments,Text;Author,User;BookCategory,Lookup;". But it is not displaying the values of the Lookup field. All the other field values are dispalyed in my result. can any one help me??? I have added a CQWP to the my Intranet home page and want to show all announcements from all sites by selecting 'Show items from all sites in this site collection', select announcements for 'List Type:' select List content type and Announcement under 'Content Type:' and have grouped by Site. If I select a 'Show items from the following site and all subsites:' eg. /Corporate it works fine but if I select 'Show items from all sites in this site collection' it doesn't return any announcements and shows 'There is a problem with the query that this Web Part is issuing. Check the configuration of this Web Part and try again.' message. Any ideas would be much appreciated. Martin My problem here is that I have a Hyperlink field in my list, but it displays in the CQWP as text, saying,. (I assume it is displaying twice because its showing the URL and the description from the list field the CQWP is drawing from) It is not displayed as a link though. How can I make the field display properly in the CQWP as a link? Thanks in Adavance!! - Peter Hack From Webpart: <property name="CommonViewFields" type="string">Market;Column11;Column13;Column14;Column15;Column16;Website2,url;Column7;Column2;Column9;Column10</property> From XSL: - <div class="description"> - <h3> <FONT COLOR="000080">Market:</FONT> <xsl:value-of <br /> <FONT COLOR="000080">Address:</FONT> <xsl:value-of <xsl:value-of , <xsl:value-of <xsl:value-of <FONT COLOR="000080">Website:</FONT> <xsl:value-of <FONT COLOR="000080">Phone:</FONT> <xsl:value-of <FONT COLOR="000080">Affiliation:</FONT> <xsl:value-of <FONT COLOR="000080">DMA Rank:</FONT> <xsl:value-of <FONT COLOR="000080">Channels:</FONT> <xsl:value-of <FONT COLOR="000080">Coverage:</FONT> <xsl:value-of </h3> Hi Folks, How to get the Image displayed on the Left in the "image on Left" item style? Chander This won't mean too much for those of you who aren't attending the AcademyLive courses, but here are I have created a custom content query web part to show and image and the body od announcement. The body is showing but my image is unfortunately not. I have change the commonviewfileds property to: <property name="CommonViewFields" type="string">Body, RichHTML;AnnouncementImageURL, URL;</property> And also made the adjustments in the ItemStlye.xsl file but image is still not showing in the web part. The image link is working though, I can see image when I test it. Please help. Body: I've been poking around an existing web part and have been having real troubles in pulling Web Part connections is not supported out of the box. You'll need to create a new class that inherits the Content Query Web Part [CQWP]. Hi Dave, Your almost there, place the value that you are pulling into the A link href of your XSL. Hi Dragan, Only items that users have rights to see will show up in the CQWP. Hi Alan, Most likely Posts list put their content in a site column that is a different name. Check your list settings -> site content type -> site columns to find out what the internal name is for the HTML Content. Hi Senthil, Check that your column name or the type is correct (is it a Choice column?) Attachment data is located in a seperate database table, to get your data, you will need to inherit the CQWP and then for each row that has attachment make a call to sharepoint to retrieve the list of attachment for that item. Hi Martin, Most likely you've hit the MaxListlimit. Check the OuterTemplate.FormatColumnIntoUrl and OuterTemplate.FormatValueIntoUrl XSL function provided out of the box. Hi Chander, Out of the box it is mapped to the PublishingRollupImage site column. Hi Charlene, The Out of the box image is mapped to the PublishingRollupImage. Check that you either used the DataColumnRename web part property to remap AnnoucementImageUrl to ImageUrl. Or modified the XSL and replaced occurences of ImageUrl to AnnoucementImageURL. I've got an issue regarding the content query webpart. I'm developing a webpart which shows newsitems filtered by audience; so users see only their local office news items. (e.g. users from our office in Amsterdam only see news articles regarding that office) Here's the issue: When I apply a rowfilter the following happens: e.g. when I set the rowfilter to 5 items, the Content Query Webpart selects the 5 items from the ENTIRE newsitem list. After that, the audience filter is applied. So, e.g. if the top 5 newsitems are targeted to the Londen audience, a user in Amsterdam won't see any newsitem at all! I've tried to apply a rowfilter on the itemstyle.xsl xsl template with no success... Does anyone have a suggestion how to solve this? Thanks a million! Maarten trivial Qs: In step 4, you change the XSLT itemstyle. Is this XSLT bound to any instance of CQWP? I want to use CQWP multiple times in several pages doing different things. Can i have multiple "itemstylexx.XSL" files in <styles library>?Can i use Folders in styles library?? I really wouldn't want a BIG itemstyle.xslt Thanks ChristosK My custom CQWP is working fine and the body is showing up as well. Thanks for the great tip. Now, for my problem: My custom CQWP is connecting to an Announcements list on anther site in my portal. The data comeup fine and when I click on the title or '(more)' links, the DispForm.aspx for the particular announcement is displayed. However, when I click on the 'Close' button on the DispForm.aspx page, I get redirected to the actual Announcement list in 'AllItems' view. What I want is to be redirected back to the page where I came from, ie. the one conataining the custom CQWP. Do you know how I can do this? Kris I have same problem as Peter Hack has, tried both OuterTemplate.FormatColumnIntoUrl and OuterTemplate.FormatValueIntoUrl the result is same Hey, First, I'd like to say great post! Lots of great info here. I'm currently workin on project and was able to add all the necessary fields into the CQWP. The issue i'm having is now with formatting the PublishingStartDate field. As is, the field displays as (2008-03-28 07:00:00). What i would like to do is reformat this to a more user friendly format, like (March 3, 2008) eliminating the time all together. I tried creating a template to reformat and calling the template but i'm not sure i'm doin it right. Here is my code for the templates: { <xsl:template <xsl:call-template <xsl:with-param <xsl:with-param </xsl:call-template> </xsl:variable> <xsl:variable <xsl:if_blank</xsl:if> </xsl:variable> <xsl:element <xsl:variable <xsl:call-template <xsl:with-param </xsl:call-template> </xsl:variable> </xsl:element> <div id="linkitem" class="item" > <div class=""> <xsl:call-template <table> <tr> <td> <a> <xsl:attribute <xsl:value-of </xsl:value-of> </xsl:attribute> <xsl:attribute <xsl:value-of <xsl:value-of </xsl:value-of> </a> </td> <td align="right"> <xsl:value-of </td> </tr> </table> </div> </div> </xsl:template> <!-- Convert CAML Date/Time to Standard Date --> <xsl:template <!-- expected date format 1/20/2007 10:22:28 PM [OR] 01/20/2007 10:22:28 PM --> <xsl:param <!-- new date format January 20, 2007 --> <xsl:variable <xsl:value-of </xsl:variable> <xsl:variable <xsl:value-of <xsl:variable <xsl:value-of <xsl:variable <xsl:value-of <xsl:variable <xsl:value-of :choose> <xsl:value-of <xsl:if <xsl:value-of </xsl:if> <xsl:value-of <xsl:value-of <xsl:value-of </xsl:template> } Any thoughts? Ernie B. I am creating a CQWP from a calendar list. I need to show not only the name of the meeting but the link to the Workspace (which shows as a check box that you click when you create the meeting). The only thing I know about the workspace in the calendar is that the type is called a Cross Project Link. When I am in the webpart code changing the CommonViewFields, I don’t know what the hex code for that field is and I don’t know how to refer to the type=”” in the property line. "CommonViewFields" type="string">Body_x0020_content,RichHTML</property> Please help!! Related to that, is there anyway I can change the type of workspace related to a calendar? Instead of being a Meeting Workspace to be a Document Workspace for example? So you want the Content Query Web Part but you're running into issues implementing it... First let Hi Maarten, You will need to remove the item limit from the Toolpane, and then use XSLT to limit to showing only the first 5 results. Hi ChristosK, The out of the box Content Query Web Part [CQWP] use the three XSLT that we install. You can modify any CQWP instances to use a different XSLT by changing one of the HeaderXslLink, ItemXslLink and MainXslLink web part property. Hi Kris, You can do so by modifying the ContentQueryMain xslt and modify the CopyUtil line to pass a Source query string parameter. This Source query string will be where the user will be returned after clicking Close. Hi SIQ Max, You can write your own XSLT function that will strip out the description from your URL. Hi Ernie B, Have you tried to use the runtime function FormatDateTime: <xsl:value-of Hi Lola, Go to Site Settings -> Site Columns -> Click on your column Then check the URL of the current page, and find the field=ColumnName This is the value you want to put inside your CommonViewFields. Usually this will be the same as the column name. hi to get the name of list inside the Item style.xslt can we use <xsl:value-of</xsl:value-of> Hi, great post...thanks to you I was able to display an additional Status field in a Content Query Web Part. I'm having an issue with the additional filters though. I'm trying to roll-up task lists from sub-sites onto a main Project site. When I do this with no additional fields, all items are displayed. I need to filter out the Completed tasks though. I've tried setting the additional filters to Status is not equal to Completed, but when I do that I get "This query has returned no items. To configure the query for this Web Part, open the tool pane." in the web part results panel. Any ideas for me? I'm at a loss after trying every combination I can think of. Thanks in advance for any assistance. To Adam (post from Wednesday, March 07, 2007 1:34 AM) and who it might concern. There is a way to retrieve the name of the list (and the name of the site) when using CQWP. I have digged deep and found a way to do this. You need to set the ViewFieldsOverride property on the webpart and add <ListProperty Name="Title" /> and <ProjectProperty Name="Title" />. You must however also add all default fields (like Title and so on) since CQWP does not add them when ViewFieldsOverride is set. I have a (hopefully) more clear instruction on my blog: I have only had luck with the CQWP when querying data that is associated with a content type. I can't seem to get the CQWP to work or return any results when I am just trying to query list data from a site and all of its subsites without having a content type associated. Any ideas? I am running out... All- I am using MOSS 2007 and don't have the CQWP. Is there something I have to do to enable that web part in the list? Hello EveryOne........I am using MOSS 2007......i have created a Top Level Site and created a WebPart Page in that ..... and then i Edit that WebPart Page.......but when i click on Add Web Part a window pops up but there is not option for Adding Content Query WebPart....... plz help me out........where i m wrong.....?? Content Query Web Part (CQWP) is a powerful feature in SharePoint, where users can create custom view currently i am able to display custom columns using CQWP, i wanted to add more... at the bottom of content query webpart, but i am getting more.... for each row items, i just need to add a more... going to separate page (this could be any page for eg) how to achieve this in itemstyle.xsl some thing like this, any body had similar requirements please help title1 description1 title2 description2 more... Great information! I would like to be able to show a count in my web part of how many items are returned - how do I get that? thanks! 在OfficeSharePointServer2007中的内容查询WebPart默认为标题列,如何以名称列显示,方法如下: 1. Hi! Could you elaborate on this: "Hi Tim, Attachment data is located in a seperate database table, to get your data, you will need to inherit the CQWP and then for each row that has attachment make a call to sharepoint to retrieve the list of attachment for that item." or give some pointers Thank you! Do you know where you would make specifications for the width of a webpart? by default they are way to wide for my design, and i can't seem to find the style to overwite it. Any pointers? Home computer work. Work from home. Envelope stuffing work from home. Work at home. Work home time tracking software. 在Office SharePoint Server 2007中的内容查询Web Part默认为标题列,如何以名称列显示,方法如下: Hi .. Is there any way to access the ItemLimit property of the CQWP in the Itemstyle.xsl so that i can display the More link depending on the number of items that are specified in this property? you told Alex he can do this how i can do? I want to retrieve data from 7 list and they in different site, and they not child for one Hani Qasem Displaying a presence icon in the Content Query Web Part Very helpful post indeed. Have u ever tried customizing the date format in CQWP......?? When I query the Created field in a document libary the date is displayed as : 2008-07-15 14:21:01 Is there any way to change this to mm/dd/yy hh:mm format???? Many thanx in advance I just want to find out if the source list name can als be dispalyed along with the items ie., if I have my CQWP crawls data from 3 document libraries in a site, is it possible to indicate which data is from which doclib as shown below . Document 1 - doclib a Document 2- doclib x Document 3 - doclib p .....and so on????? Hi all, I was wondering - I have a custom column type is Person or Group. I am having trouble getting anything to show in my CQWP. I've tried setting the field type in the CommonViewFields as Text, User, Person - but nothing seems to work. Any ideas? It is possible to page the results of a Content Query Web Part query. Some time ago already I have wrote an article about it, plus I have published an extended version of the CQWP which supports paging. You can find more information on my blog @ I'd like to create a Related Documents web part (as mentioned above) which will allow people to add links (with Summary Links WP or using CQWP) and display the following: DocIcon Filename FileSize Unfortunately, desptigin having gone to great lengths to discover these column names, they do not appear to be usable in this way. Any suggestions on how to grab this most useful data for file lists?? Thanks for the great post. I have one additional requirement. i.e. I have list with one column containing "multiple select" enabled. Column is choice type and selection is check box. With this user will be able to select multiple etnires for the row. Now requirement is we need to extract rows which contains specific data and display the same in Content Query Web Part. For example I have one row with Sharepoint 2003 & other row with sharepoint 2003 and MOSS 2007 selected. Data query filter should be set to only extract sites wilth 2003 only. Please advice. Thanks in advance. Cheap zolpidem. Zolpidem ambien. Lipitor and anxiety. Lipitor and its bad effects. Lipitor. Lipitor pricing. Nicain and lipitor. Hello to all, a big big thanks to George for this great article.... but i have an issue...... in the list that CQWP display i have enable the Audiences. So when i login like Admin the CQWP working fine (with my custom field everything that i was added in ItemStyle.xsl) but when i login with another account then the CQWP display the default value (only the title and not the custom field) any ideas???? OK i solve the issue..... the problem was with the permissions in Style Library. I don't know what exactly i done and if this the correct way.... my steps was in Style Library : Settings --> Document Library Settings --> Permissions for this document library --> select all groups --> Actions --> Inherit permissions Now i think i have a permissions issue!!! I'' do some tests and i'll inform the blog. I'd like to know your opinion about this issue...... I would like to add the CQWP to my site definition based on the comments from Bisbjerg on Nov. 4 2006. I am assuming that the XML should be pasted into the Modules section of the onet.xml file. Does it need to be placed inside a CDATA section? Do I only need to grab the content starting and ending with the <webpart> tag? Or is the <webparts> tag also required? We are using MOSS 2007, if that makes any difference. Thanks in advance for your help. Just as a follow-up to my message on Sept 14. I tried adding the webpart both ways and get an error. Web Part Error: The file format is not valid. Try importing a Web Part file (.WebPart). The trouble is that I don't want to import it. I want the page to be pre-built so the no manual intervention is required. Is this possible? I am not finding any helpful information on the internet in this regard. I have a CQWP that displays the current day's events from a calendar. Is there anyway to display the attachment icon for those events that do have attachements?? Hi , I would like to configure CQWP in such a way that it should allow me to select the products I want to display rather than displaying latest 5 products.. Is there any way to achieve that? Hello Hardik, You can add a new sitecolumn to your library (eg showonpage as a boolean). Export the cqwp and add the new sitecolumn to the AdditionalGroupAndSortFields like this: <property name="AdditionalGroupAndSortFields" type="string">showonpage </property> after importing you can use showonpage as a filter hope it helps. I have modified my CQWP to receive @Body. I have removed the content within < >. However, I still have " with body content. This is from users entering blogs from Word - ie. the fancy " ". Every method I have tried to replace or truncate the " from the @Body, basically breaks the webpart, as it is removing actual quotes etc from the XML stream. #1 <!-- <xsl:template <xsl:param <xsl:choose> <xsl:when <xsl:value-of </xsl:when> <xsl:otherwise> <xsl:value-of </xsl:otherwise> </xsl:choose> --> #2 <xsl:call-template <xsl:with-param <xsl:with-param <xsl:with-param </xsl:call-template> Over the last few months I have had to configure various Content Query Web Parts (CQWP) to provide portal When you add a choice or lookup to the CommonViewField for a ContentQueryWebPart, if you had ticked the SharePoint :: Master Page Customize Reference I am helping work on a proof of concept for a customer, and one of the requirements is to display data MOSS2007 comes with the Content Query Web Part to group and sort content as you need. This works like a charm in most situations, but sometimes I find most common things missing. Lately I was working on a news archive for a company who posts a lot of I've had several conversations with customers lately about creating some type of gadget gallery for their
http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx
crawl-002
refinedweb
14,877
71.85
Components Link This component is styled to resemble a hyperlink and semantically renders an anchor or button. Under the hood, Link is an extension of the Text component. By default it will inherit its font size from its parent unless a size is set with the fontSize prop. import { Link } from '@sproutsocial/racine' Properties Recipes External link Link as a button In some cases, you may want the styling of a link but the ability to use a click handler. Passing a value for the onClick prop will cause the link to render as a button element. Link inline with text Did you know that links can live inline with text? Link next to button
https://seeds.sproutsocial.com/components/link/
CC-MAIN-2020-45
refinedweb
115
71.85
Feedback Getting Started Discussions Site operation discussions Recent Posts (new topic) Departments Courses Research Papers Design Docs Quotations Genealogical Diagrams Archives Ralf Hinze and Andres Löh. Generic Programming, Now!. In Roland Backhouse, Jeremy Gibbons, Ralf Hinze and Johan Jeuring, editors, Spring School on Generic Programming, Lecture Notes in Computer Science. Springer-Verlag, 2006. Tired of writing boilerplate code? Tired of repeating essentially the same function definition for lots of different data types? data types and open data types. We hope to convince you that generic programming is useful and that you can use generic programming techniques today! Yes, more functional generic programming... Open data types and open functions are discussed here, but I think this paper wasn't featured on the homepage before. I wonder if it would be possible to make typing completely implicit, i.e. the programmer would not have to write down type declarations or data constructors, just functions. The compiler's job would be to infer if a particular function can be called with a particular value. Compile-time polymorphism would work by a best-fit approach. For example, let's say we have a type Vector2 with (x, y) members and a type Vector3 with (x, y, z) members. For both types, a function length is defined that computes the length of the hypotenuse: let Vector2 xval yval = [ let x = xval let y = yval ] let length v = sqrt v.x*v.x + v.y*v.y let Vector3 xval yval zval = [ let x = xval let y = yval let z = zval ] let length v = sqrt v.x*v.x + v.y*v.y + v.z*v.z If we had the following program: let v1 = Vector2 20 10 let v2 = Vector3 20 10 5 let l1 = length v1 let l2 = length v2 Then perhaps a compiler could choose the appropriate function to call based on how much of a function's requirements is covered. In the above example, since 'v2' is of the form '(x, y, z)', the compiler would have to choose the 2nd version of 'length'. data Vector2 = Vector2 Double Double class Vector a where len :: a -> Double instance Vector Vector2 where len (Vector2 x y) = sqrt (x*x + y*y) data Vector3 = Vector3 Double Double Double instance Vector Vector3 where len (Vector3 x y z) = sqrt (x*x + y*y + z*z) main = do let v1 = Vector2 20 10 let v2 = Vector3 20 10 5 let l1 = len v1 let l2 = len v2 print (l1,l2) Not exactly the same...In Haskell, the programmer has to know about 'data', 'class' and 'instance'. import Prelude hiding ((.),length) (.) = flip ($) x = (!! 0) y = (!! 1) z = (!! 2) vector2 xval yval = [ let x = xval in x, let y = yval in y ] vector3 xval yval zval = [ let x = xval in x, let y = yval in y, let z = zval in z ] length v@[_,_] = sqrt (v.x*v.x + v.y*v.y) length v@[_,_,_] = sqrt (v.x*v.x + v.y*v.y + v.z*v.z) main = do let v1 = vector2 20 10 let v2 = vector3 20 10 5 let l1 = length v1 let l2 = length v2 print (l1,l2) Can't quite put my finger on which language you are using, so I'll cheat and give an answer in Standard ML that bypasses the whole question of types and solves the immediate problem: fun vector2 (x, y) = [x, y] fun vector3 (x, y, z) = [x, y, z] fun square x:real = x * x fun vectorLength v = Math.sqrt(foldr op+ 0.0 (map square v)) val v1 = vector2(20.0, 10.0) val v2 = vector3(20.0, 10.0, 5.0) val l1 = vectorLength v1 val l2 = vectorLength v2 Or if you want to declare a type for vectors, we could have: datatype Vector = Vector2 of real * real | Vector3 of real * real * real fun vectorLength (Vector2(x, y)) = Math.sqrt(x*x + y*y) | vectorLength (Vector3(x, y, z)) = Math.sqrt(x*x + y*y + z*z) val v1 = Vector2(20.0, 10.0) val v2 = Vector3(20.0, 10.0, 5.0) val l1 = vectorLength v1 val l2 = vectorLength v2 ...I think that the question of dispatch based on function overloading points to ad hoc polymorphism. Instead of figuring out how two distinct length functions might be appropriately called, the idea in Generic Programming is that there should be one length function that can handle the different types of vectors you throw at it. So although type classes can be used to get the effect as Greg has shown above, the question comes back of why we need two different length functions in the first place?
http://lambda-the-ultimate.org/node/2017
CC-MAIN-2018-30
refinedweb
777
68.3
0 hi im told to make a program where the user enters a large number like 13195 and the prgrams gives it the highest prime factor, which i 29. now i have to do this using recursion in basic c, without using loops of any kind, so noo for, while etc. prof showed a way to call the funtion again by it self but dont really get him so thats why need a bit of help.. #include<stdio.h> #include <math.h> int main() { long int num; long int prime(long int num); long int primefactor(long int num); printf("Enter the number whose prime factors are to be calculated:"); scanf("%ld", &num); primefactor(num); } //The following is the function that detects a Prime number. long int prime(long int num) { long int i, ifprime; i = 2; if (i <= num ) { if (num % i == 0) { ifprime = 0; } else ifprime = 1; i++; } return (ifprime); } //The following function prints the prime factors of a number. long int primefactor(long int num) { long int factor, ifprime = 0; factor = 2; if (factor <= num) { prime(num); //so that the factors are only prime and nothing else. if (ifprime) { if (num % factor == 0) //diving by all the prime numbers less than the number itself. { printf("%ld ", factor); num = num / factor; } else { factor++; //this cannot be made a part of the for loop } } } if (factor<=num){ primefactor(); else{ break; } return (0); }
https://www.daniweb.com/programming/software-development/threads/409101/recursion-prime-factors-no-loops-of-anykind
CC-MAIN-2016-30
refinedweb
233
63.63
Characteristics of the JSS code-first import process Important things to know about the JSS code-first/disconnected import process The JSS import process, used for code-first development, allows you to rapidly design and define the structure of an application while disconnected from Sitecore and then publish it to Sitecore, creating appropriate Sitecore artifacts as needed, such as templates, placeholder settings, datasource items, route items, and rendering items. If you plan on using the App Import capabilities with your JSS apps, you must keep in mind the following: The import process is idempotent You can run the import process multiple times on the same application to the same Sitecore instance without repercussions, with some limitations. Any fields on an item that are not explicitly defined in the manifest are left untouched. For example, if a Sitecore developer inputs a source for an imported field, the next import does not reset the source unless the manifest also defines a value for the source. There are also special considerations that define how import works with content items and content editors. The import process is not a substitute for Sitecore Serialization The import format is designed to be simple as opposed to full-featured. It is quite capable but does not represent the full fidelity of Sitecore items or handle every situation when updating items. Headless Import is not meant as a replacement for tools such as Unicorn or TDS that serialize Sitecore items. The import process primarily allows the design of rendering apps by front-end developers who might not have an available Sitecore instance, or want to begin working on their application when Sitecore is not yet set up. Eventually, in the development process, we recommend the import process is supplemented by or replaced by purpose-built Sitecore item serialization tools to maintain the state of a JSS app, with the possible exception of rapidly developed simple campaign-style apps. Sitecore item serialization tools can serialize items created or updated by JSS import; they are like any other Sitecore item. The import process uses strings as IDs by default The import process maps string names onto Sitecore items that have GUIDs. This makes the import files easier to write, but it does mean that care must be taken when moving or renaming imported items. Note Imported Sitecore item IDs are deterministic: importing the same app on different Sitecore instances results in the creation of items with the same IDs in Sitecore. Renaming imported Items Because they are matched by string name, renaming an item in your manifest (or in Sitecore) after it has already been imported results in the creation of a duplicate item if the import is re-run. There are several options to deal with this: Explicitly set the manifest ID to the existing imported item ID in Sitecore, then rename it in the manifest. It is renamed on import. Set the display name and leave the name alone, which visually alters the name in Sitecore. Moving imported items Because they are matched by name, moving an imported item causes a duplicate of it to be created on the next import. If you must move an imported item, set an explicit ID in the manifest for the item equal to the already imported Sitecore item ID. This causes the item to be looked up by ID instead of a name, and therefore it survives the moving operation still known by the manifest. The import process does not purge unknown items If a template or route is removed from the manifest, it is not deleted from Sitecore on the next import. The import process sets values only for explicitly defined manifest data For example, if a template is imported that does not define an icon, and a Sitecore developer sets an icon on the Sitecore item, future imports do not overwrite the icon value. Explicit manifest data overwrites values set in Sitecore, however - for example, if the manifest did define an icon for a template it would overwrite any value set in Sitecore on import. Handling of item IDs in the import process Sitecore items have unique GUID IDs. By default, App Import uses the name defined in the manifest to derive a deterministic GUID so that the imported item always has a predictable ID. This GUID is namespaced, so that names must only be unique within a section of the app, instead of across the entire JSS app. For example, it is legal to have both a route and a template named Home (or two routes at different levels) but it is not legal to have two templates called Home. The namespace also contains the JSS application name, so multiple JSS apps can have items with the same name. Important Renaming a JSS application causes all of the expected GUIDs of its items to change. It is also possible to specify an explicit ID for all of the items in the import manifest. This takes the form of adding an id property to the manifest definition. The id can be one of two types: A GUID value - this value is used literally and is the exact item ID used in Sitecore A string value - this is used as the source for a deterministic GUID. Unlike name-based deterministic GUIDs, explicit string IDs are namespaced only by JSS app name. This means that they must be globally unique within a JSS app. Note App Import never changes an existing imported item GUID to avoid losing data. If setting an ID value on an already imported item, that new ID does not take effect in Sitecore unless you delete that item and re-run the import or you run the import in full wipe mode. The sample applications have examples of setting explicit IDs in their content reuse Style guide examples. Note that when adding components to the manifest, there are two id properties: renderingId and templateId - this is necessary because a JSS component definition results in adding two Sitecore items. Important When specifying explicit IDs on route data in a multilingual import environment, ensure that the same ID value is set on all language values.
https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/characteristics-of-the-jss-code-first-import-process.html
CC-MAIN-2022-21
refinedweb
1,026
54.15
Hello all! Help me somebody to understand why my code returns “None” in this challenge: def append_size(lst): new_lst = lst.append(len(lst)) return new_lst print(append_size([23, 42, 108])) Hello all! Help me somebody to understand why my code returns “None” in this challenge: def append_size(lst): new_lst = lst.append(len(lst)) return new_lst print(append_size([23, 42, 108])) Look at where you got it from. if you do a = 2 + 3 print(a) then you’d get 5 written to screen. where does 5 come from? you’d look at the definition of a, which is obtained by giving the values 2 and 3 to +, and the result you got back is what you assigned a to same deal with your code. you have some series of operations where you can trace what the involved values are, all you need to do is observe This could be because of the variable (new_list). Get rid of the variable. See below: def append_size(lst): lst.append(len(lst)) return lst print(append_size([23, 42, 108])) It will return: [23, 42, 108, 3] You understand now? the variable itself isn’t doing anything though, the problem comes from the operations carried out - paying heed to what inputs are fed in and what outputs are obtained for the operations removing the variable while otherwise keeping it equivalent (same operations) would be: def append_size(lst): return lst.append(len(lst)) print(append_size([23, 42, 108])) which would have the same result as the original code, a return value of None In your case a variable “a” will return 5. But I still can’t get why it didn’t in my case. I assigned a result of calculation to a new variable and trying to return it, but returns None. I know if I just remove variable the code will work, but I am trying to understand the language here. Removing the variable makes no difference. You’re probably making another change as well. If you look at where you take the result from, you’ll find where None comes from. And if you wonder why you are getting None from that operation, then, what does that operation promise to do, does it promise to return something other than None? It has some particular behaviour and you can leverage that, but if you use that operation while ignoring how it communicates then you’re pretty likely to misinterpret it. So there are two parts to this. One is looking at where you got it from, it doesn’t appear out of nowhere, you are getting it from some operation and all you need to do is to follow the assignments backwards to the source. The other is considering how that operation communicates its result. I expect it to append the length of a list to a “new_lst”, then return that new_lst. If I just remove the variable “new_lst” and return “lst” I will get the expected result, it just doesn’t make any sense. So I guess I can’t save that operation to a variable. It makes no difference whether you use a variable. However, which value is it that you’re supposed to return? def five(): a = 7 # makes no difference whether this exists b = 5 return b Variables don’t DO anything, it’s your actions you need to pay attention to, not whether or not you use variables. In particular, using a variable does not cause any value to change into something else. You’ve got multiple values and you’re returning the wrong one. You have to consider which of the available values you use. And if you expect some operation to behave a particular way, but it doesn’t, then you would probably want to find out what that operation promises to do. Or, rather, for any operation that you don’t know what it does, you’d want to find out before using. They have some particular behaviour, and you’ll have to adapt how you use them to how they behave. They won’t adapt to how you mean they should behave. It started making sense. Thank you for you patience!
https://discuss.codecademy.com/t/list-challenge/500942
CC-MAIN-2020-40
refinedweb
696
71.44
Modules are a powerful Swift feature, yet existing tooling makes modulizing your projects so tedious that most people don’t bother. A modular app gains: - Encapsulation. Internal scope is a criminally under-utilized Swift feature that makes encapsulation significantly more achievable. - Namespacing. Modules have an implicit namespace; fear not about reusing names, modulize instead. - Hierarchy. Once you start creating modules you automatically arrange them so that some have more importance than others. This naturally leads to a structured codebase where new files nestle into their logical, encapsulated homes, effortlessly. - Organization. You no longer have to cram everything concerning an area of responsibility into a single file to gain from file-private. Instead separate all that code out into multiple files in its own module and use internalaccess control. - Testability. Making a piece of functionality its own module means you can make more of that module internal scope rather than private and this means more of the module can be imported @testablemaking the functionality easier to test without adopting practices that make your code less readable for the sake of testing (like injection). Cake makes working with Swift modules a breeze. Xcode 10.2-beta Required Supporting Swift tools-version-5 and tools-version-4 is not our thing. Cake requires at least Xcode 10.2 to function. Support Cake’s development Hey there, I’m Max Howell,. How it works “The secret of getting ahead is getting started. The secret of getting started is breaking your complex overwhelming tasks into small, manageable tasks, and then starting on the first one.” —Mark Twain Cake is an app that runs in your menu bar and watches your Xcode projects. If you chose to integrate Cake into your App’s xcodeproj it will automatically generate your module hierarchy based on your directory structure. For example: . └ Sources └ Model ├ Module1 │ ├ a.swift │ └ b.swift └ Module2 ├ c.swift └ d.swift Now ⌘B and you’ll be able to import: import Module1 import Module2 FAQ: What is a cake project? A Cake project has a Cakefile.swiftfile in its root. Delicious: All your modules are built statically so there’s no launch-time consequences. Curious? Cake is made with Cake, so is Workbench, check out the sources to see more about what a cake‐project looks like. Details: Cake generates a sub-project (Cake.xcodeproj), you lightly integrate this into your app’s project. Module hierarchies “You’ve got to think about the big things while you’re doing small things, so that all the small things go in the right direction.” —Alvin Toffler Before long you will need some modules to depend on others. This is an important step since you are starting to acknowledge the relationships between components in your codebase. Cake makes declaring dependencies as easy as nesting directories. . └ Sources └ Model └ Base ├ a.swift ├ b.swift └ Foo ├ c.swift └ d.swift Here Foo depends on Base and thus, Foo can now import Base. All other tools require you to specify relationships cryptically, either textually or with a confounding GUI. With Cake, use the filesystem, relationships are not only easy to read, but also, trivial to refactor (just move the directory). Further Reading: Advanced module hierarchies FAQ: What should go in your Basemodule? Cake’s Basemodule contains extensions on the standard library. Dependencies “You can do anything, but not everything.” —David Allen Cake makes using Swift packages in Xcode easy. Write out your Cakefile, ⌘B, Cake fetches your deps and integrates them: no muss, no fuss. import Cakefile dependencies = [ .github("mxcl/Path.swift" ~> 0.8), .github("Weebly/OrderedSet" ~> 3), ] // ^^ naturally, using Cake to manage your deps is entirely optional We figure out your deployment targets, we make your deps available to all your targets and we generate a stub module that imports all your deps in one line ( import Dependencies). We check out your dependencies tidily, for example the above Cakefile gives you: . └ Dependencies ├ mxcl/Path.swift-0.8.0 │ ├ Path.swift │ └ … └ Weebly∕OrderedSet-3.1.0.swift Which generates this in your Cake.xcodeproj: Which you can then commit, or not commit: that’s up to you. Though we suggest you do. Delicious: All dependency modules are built statically so there are no launch-time consequences. Delicious: A fresh clone of a Cake project builds with vanilla Xcode, no other tools (even Cake) are required. Distribute away without worry! Delicious: Cake finally makes it possible to use SwiftPM packages for iOS development! FAQ: Should I commit my deps? Caveat: We only support SwiftPM dependencies at this time. Further Reading: Cakefile Reference Carthage & CocoaPods If your app uses Carthage or CocoaPods we detect that and integrate them so your cake modules (the Batter) can use these dependencies. Note, this only applies to cake modules (the Batter); for your App target follow the instructions provided by CocoaPods and Carthage themselves; nothing is different. Op‐Ed—an era for Swift µ-frameworks? CocoaPods and Carthage libraries tend to be on the large side, and this is at least partly because being modular has been historically hard and tedious when developing for Apple platforms and Swift. SwiftPM encourages smaller, tighter frameworks and using Cake means making apps with Swift packages is now possible. Choose small, modular, single‐responsibility libraries with 100% code coverage that take semantic-versioning seriously. Reject bloated libraries that don’t know how to say no to feature requests. Constructing frameworks/dylibs Since everything Cake builds is a static archive, you can simply link whichever parts you like into whatever Frameworks or dylibs you need for your final binaries. This is a purely optional step, statically linking Cake.a into your App (which Cake sets up by default for you) is perfectly fine. This more advanced option is available to make apps with extensions more optimal in terms of disk usage and memory consumption. Installation - Run it. Check your menu bar: Open a project and integrate Cake; or Create a new Cake. FAQ: What does integration do? Delicious: We auto-update! Bonus Features Extracting your app’s version from Git Cake determines your App’s version from your git tags, to use them simply set each target’s “Version” to: $(SEMANTIC_PROJECT_VERSION) and if you like the “Build” number to: $(CURRENT_PROJECT_VERSION). Delicious! We even append -debugto debug builds. Xcode Remote Control Caveats Due to some Xcode bugs Cake is not a complete Cake‐walk in use. Please see our troubleshooting guide for details. Documentation - Handbook - Reference Icons credit Icons made by Google and Freepik from licensed by CC 3.0 BY. Github Help us keep the lights on Dependencies Releases 1.0.3 - Mar 10, 2019 - You can now use CocoaPods from your Batter thanks to @abbasmousavi 1.0.2 - Mar 7, 2019 - Carthage support for the Batter
https://swiftpack.co/package/mxcl/Cake
CC-MAIN-2019-22
refinedweb
1,122
57.47
On 1/20/2009 3:14 PM, Axel Simon wrote: > > On Jan 20, 2009, at 17:10, Peter Gavin wrote: > [..] > So, under these consideration, your patch > > hunk ./mk/common.mk 201 > -.chs.hs: [_$_] > - $(strip if test -x $(C2HS); then :; else \ > - $(MAKE) $(AM_MAKEFLAGS) $(C2HS); fi;) > - $(strip if test -f $($(PKG)_PRECOMP); then :; else \ > - $(MAKE) $(AM_MAKEFLAGS) $($(PKG)_PRECOMP); fi;) > +.chs.hs: $(C2HS) > > > that removed the recursive call to make breaks this hack since now the > dependencies are part of the main make file. I think it breaks because > make first re-invokes itself to build c2hsLocal, then it re-invokes > itself to build c2hsLocal.deps. Right, some of the subtle build problems we have and hear about on the lists are from this recursive make stuff happening, and the fact that the outer make is using what amounts to a different Makefile than the inner make. I'm pretty sure the makefile would work the way we want if make would re-read everything every time any of the included files are built. But it wants to try and build as much as possible in one pass, before re-reading the included files, so it causes an error while building c2hs. > > Sincere apologies for leaving you in the dark about this hackery. > Another point I should raise is that the lines > > ifeq (,$(findstring clean,$(MAKECMDGOALS))) > -include tools/c2hs/c2hsLocal.deps > endif > > have a similar evilness: The space before the endif exploits a bug in > automake that fails to recognize the ifeq .. endif clause which it > would otherwise translate into something else. Right, I knew about that :) > > There might be more subtleties in our glorious makefile, but for now, > I can't remember any more. The $(PKG) variable is pretty evil, if you ask me. Definitely not something I'd expect from Haskell programmers :) In any case, I found a solution that gets around these problems, but you might not like it. I added a rule to the makefile dep: $(EARLY_DEPS) where EARLY_DEPS contains tools/c2hs/c2hsLocal.deps and additionally any dep files generated with chsDepend. I also made it so make won't try to include the libHS*_a.deps files when building the dep target. Now, make dep will build these dependency files without any errors happening. After make dep is done, make can be run from start to finish without errors. I also added a line to the configure script making it run make dep at the end of config.status, so no build processes will need to be changed. I figure everything should still work ok for partially complete builds and rebuilds for developers etc. If you think this is ok, I'll go ahead and push it. Pete View entire thread
http://sourceforge.net/p/gtk2hs/mailman/message/21389474/
CC-MAIN-2015-32
refinedweb
455
71.85
/* * @ * * readline.h */ #ifndef _READLINE_H_ #define _READLINE_H_ 1 #include <Security/cssmtype.h> // For CSSM_DATA #ifdef __cplusplus extern "C" { #endif /* Read a line from stdin into buffer as a null terminated string. If buffer is non NULL use at most buffer_size bytes and return a pointer to buffer. Otherwise return a newly malloced buffer. if EOF is read this function returns NULL. */ extern char *readline(char *buffer, int buffer_size); /* Read the file name into buffer. On return outData.Data contains a newly malloced buffer of outData.Length bytes. Return 0 on success and -1 on failure. */ extern int read_file(const char *name, CSSM_DATA *outData); #ifdef __cplusplus } #endif #endif /* _READLINE_H_ */
http://opensource.apple.com/source/security_systemkeychain/security_systemkeychain-39457/src/readline.h
CC-MAIN-2014-10
refinedweb
107
52.87
Solang Test Suite¶ Solang has a few test suites. These are all run on each pull request via github actions. Solidity parser and semantics tests¶ In the tests directory, there are a lot of tests which call fn parse_and_resolve(). This function parses Solidity, and returns the namespace: all the resolved contracts, types, functions, etc (as much as could be resolved), and all the compiler diagnositics, i.e. compiler warnings and errors. These tests check that the compiler parser and semantic analysis work correctly. Note that Solidity can import other soldity files using the import statement. There are further tests which create a file cache with filenames and and their contents, to ensure that imports work as expected. Codegen tests¶ The stage after semantic analysis is codegen. Codegen generates an IR which is a CFG, so it is simply called CFG. The codegen tests ensure that the CFG matches what should be created. These tests are inspired by LLVM lit tests. The tests can found in codegen_testcases. These tests do the following: - Look for a comment // RUN:and then run the compiler with the given arguments and the filename itself - After that the output is compared against special comments: - // CHECK:means that following output must be present - // BEGIN-CHECK:means check for the following output but scan the output from the beginning - // FAIL:will check that the command will fail (non-zero exit code) with the following output Mock contract virtual machine¶ For Substrate, ewasm, and Solana there is a mock virtual machine which should work exactly like the real on-chain virtual machine. For ewasm and Substrate, this uses the wasmi crate and for Solana it uses the Solana RBPF crate. These tests consist of calling a function call fn build_solidity() which compiles the given solidity source code and then returns a VM. This VM can be used to deploy one of the contract, and test various functions like contract storage, accessing builtins such as block height, or creating/calling other contracts. Since the functionality is mocked, the test can do targeted introspection to see if the correct function was called, or walk the heap of the contract working memory to ensure there are no corruptions. Deploy contract on dev chain¶ There are some tests in integration which are written in node. These tests start an actual real chain via containers, and then deploying some tests contracts to them and interacting with them.
https://solang.readthedocs.io/en/v0.1.8/testing.html
CC-MAIN-2021-43
refinedweb
403
59.94
Here’s how Caliburn finds the view for your view model: it removes the word Model from the FullName of your view model. So - Caliburn.Micro.Hello.ShellViewModel becomes Caliburn.Micro.Hello.ShellView - Caliburn.Micro.ViewModels.ShellView becomes Caliburn.Micro.Views.ShellView However, it’s important to understand that it removes every instance of the word model from the FullName. So - Caliburn.Micro.Models.ShellViewModel becomes Caliburn.Micro.s.ShellView Since it’s highly unlikely you created a namespace called “s”, it follows that the convention is going to fail to find the view. More generally, this is a classic case of under-reporting in errors. The error tells you that it couldn’t find the view, but what it doesn’t tell you is where it looked. This being an open source application, it’s relatively easy to find out once you’ve determined that you need to be looking at the ViewLocator code. But still, the error could be better, and it would save people who had made a mistake some time.
https://colourcoding.net/2011/05/07/gotcha-dont-call-a-namespaces-quotmodelsquot-in-caliburn-micro/
CC-MAIN-2019-04
refinedweb
174
56.45
WITH XMLNAMESPACES (Transact-SQL) Declares one or more XML namespaces. Transact-SQL Syntax Conventions When you use the WITH XMLNAMESPACES clause in a statement that also includes a common table expression, the WITH XMLNAMESPACES clause must precede the common table expression in the statement. The following are general syntax rules that apply when you use the WITH XMLNAMESPACES clause: Each XML namespace declaration must contain at least one XML default namespace declaration item. Each XML namespace prefix used must be a non-colonized name (NCName) in which the colon character (:) is not part of the name. You cannot define a namespace prefix two times. XML namespace prefixes and URIs are case-sensitive. The XML namespace prefix xmlns cannot be declared. The XML namespace prefix xml cannot be overridden with a namespace, other than the namespaces URI '', and this URI that cannot be assigned a different prefix. The XML namespace prefix xsi cannot be redeclared when the ELEMENTS XSINIL directive is being used on the query. URI string values are encoded according to the current database collation code page and are internally translated to Unicode. The XML namespace URI will be white-space collapsed following the XSD white-space collapse rules that are used for xs:anyURI. Also, note that no entitization or deentitization are performed on XML namespace URI values. The XML namespace URI will be checked for XML 1.0 characters that are not valid, and an error will be raised if one is found (such as, U+0007). The XML namespace URI (after all white space is collapsed) cannot be a zero-length string or an "invalid empty namespace URI" error occurs. The XMLNAMESPACES keyword is reserved in the context of the WITH clause. For examples, see Adding Namespaces Using WITH XMLNAMESPACES.
https://msdn.microsoft.com/en-us/library/ms177607(v=sql.100).aspx
CC-MAIN-2017-09
refinedweb
294
62.98
Contents CONTENTS 06 10 12 16 20 28 Africa & The emerging markets 30 33 RETIREMENT CHANGES What you need to know SUBSCRIPTIONS More than just another Bric in the wall Head to Head Investment Solutions / Investec Asset Management ETFs, the challenge for unit trust funds Fund profiles Profile David Green, Chief Investment Officer: PPS Investments HOW THE CONSUMER PROTECTION ACT WILL AFFECTS FSPs 12 months for only R450 06 Alternatively send this completed form together with proof of payment to: COSA Communications (Pty) Ltd Subscription Department PO Box 60320, Table View, 7439 or fax to 021 555 3569. 16 For any queries, contact Bonnie on 0861 555 267 or e-mail subscriptions@comms.co.za. VAT and postage included addresses only | standard postage FREE to RSA company: VAT no: title: initial: surname: 34 gift subscription April 2011 yes no 3 Letter from the editor letter from the EDITORIAL Editor: Shaun Harris investsa@comms.co.za editor Features writers: Maya Fisher French Miles Donohoe Publisher - Andy Mark Managing editor - Nicky Mark Design - Gareth Grey | Dries vd Westhuizen | Robyn Schaffner Editorial head offices Ground floor | Manhattan Towers Esplanade Road Century City 7441 phone: 0861 555 267 or fax to 021 555 3569 Magazine subscriptions Bonnie den Otter | bonnie@comms.co.za Advertising & sales Matthew Macris | Matthew@comms.co.za Michael Kaufmann | michaelk@comms.co.za Editorial enquiries Miles Donohoe | miles@comms.co.za investsa, published by COSA Media, a division of COSA Communications (Pty) Ltd. Copyright COSA Communications Pty (Ltd) 2011, M ay you live in interesting times is a Chinese proverb that seems increasingly apt in the current climate. Interesting often means very tricky for a financial adviser. Where do you put clients’ money: onshore, offshore, equities, fixed interest or a combination of all? And the post-Budget retirement funding options are becoming increasingly complex. This month, Maya Fisher-French tackles what advisers need to know following Finance Minister Pravin Gordhan’s changes to retirement funding as well as proposals in the Budget. Many advisers will find that clients’ retirement strategies need to change and the feature provides a guide as to what the changes could be. It’s a hugely important topic, with retirement funding still tipping on the wrong side of the scale in South Africa. The round-up by Miles Donohoe on industry news and products has the often outspoken Leon Campher, CEO of ASISA, making a comparison, using the value of the Rand to invest offshore as “akin to gambling”. It also looks at offshore property as a viable investment. Speaking of gambling, I dip into exchange-traded funds (and notes) as a means for advisers to construct a well-diversified core investment portfolio for clients at reasonably low cost. The gambling odds are roughly three-to-one of a more expensive actively managed unit trust fund beating the market. I know which way I would tilt in a casino. But this isn’t a casino. Once again, advisers could face some difficult calls. April 2011 Head-to-Head has Glenn Silverman, global chief investment officer of Investment Solutions, and Gail Daniel of Investec Asset Management, looking at the merits of investing in emerging or developed markets. Their arguments tend towards developed markets as offering more value and, while not writing off emerging markets, Daniel has concerns about the high rates of inflation in many of these countries. It’s a question that’s vexing the investment minds of asset managers in South Africa and around the world. Decisions now will have longer-term consequences for advisers deciding where the bulk of clients’ money should be. On a related note, I take a look at South Africa’s invitation to join BRIC, among the four fastest-growing economies in the world. It’s an honour but is it deserved? As part of the new BRICS, South African investors are offered many possible opportunities, but there are dangers as well; yet another decision to stretch the skills of advisers. In another new addition to the magazine, this month we have also launched a new Fund Profile section through which you, the adviser, can learn more about the funds available to your clients and how well they are performing. Here’s hoping you find the contents useful to get you through these interesting times. All the best till next time. Africa & the emerging markets Investing in Africa Windall Bekker | Head: Investment Consulting, OMAC Actuaries AND Consultants management regimes that are applied in most of these countries. L ate in 2009, the Ministry of Finance relaxed some of its Exchange Controls pertaining to investing abroad, allowing retirement funds to increase their offshore exposure to 25% with an additional 5% of their assets to be invested in Africa (excluding SA) Not many, if any, institutional investors have exploited this new investment avenue since it came into effect. The reluctance to take up this opportunity is generally due to the following reasons; market, which was bolstered by a stronger Rand. Local equities were relatively cheaper after the downward rerating of 2008, but a strong recovery in equity prices in 2009 saw local equities reaching their fair values in 2010. 1. Size counts Many retirement funds perceive 5% too little a quantum to make a difference in their investment portfolios hence they have not bothered to consider this option. While this argument is valid for some small funds such as those below R500 million, for any fund above this threshold size, the 5% is a significant quantum to make some valuable contribution to a portfolio. 1. Growth prospects Many African economies have enormous potential for growth driven by; i) Lower levels of debt on both fiscal and consumer levels ii) Growing middle class population making Africa a consumer rather than a resource story iii) Increased investments into education, health and public infrastructure 2. We are already in Africa Some South African institutional investors think that since the bulk of their investments is invested here in South Africa, there is no need to seek alpha in the rest of Africa. This is far from reality. Africa (excl. SA) –is a unique asset class with widely different opportunities from those found in South Africa. South Africa is classified among the emerging market countries and this is evidenced by a high correlation between the local market and emerging markets of 0.9. Africa ex-SA is largely a frontier market and its correlations with emerging and developed markets are below 0.5, making them a good diversifier away from these markets. 2. Flow of long-term capital Africa is currently a net recipient of capital as developed market companies are expanding their businesses into the lucrative African markets through green field investments, acquisitions and partnerships. A good example is the increasing number of SA companies moving into Africa. This will open up African markets, improving resource exploitation, which should translate into higher growth and attractive return on investments. 3. Local is lekker Many investors found the local market very attractive in 2010, justifiably so given the returns that we saw coming from local equity 6 Factors to look at when investing in Africa The following are identified as some of the key factors that investors need to look at when considering allocating a portion of their assets to Africa; 3. Currency stability Investing in Africa can mean exposure to a multi layer of currencies for a SA Based investor. Therefore, currency risk becomes one of the key factors in determining the suitability of this asset class. Most African currencies however, are relatively stable against both the Rand and the Dollar due to currency April 2011 4. Liquidity Some African markets are still shallow and under strict controls –making them very difficult to exit once one has invested. Another related problem is the lower levels of free float in some stocks due to the closely-held nature of the businesses. This will make it difficult for investors to have large enough exposure to some preferred stocks that they may strongly desire. Due to liquidity constraints that one may come across, it is recommended that investors should have a private equity mindset when approaching Africa. Due to liquidity constraints, it may take relatively long periods of time to unlock value in some stocks. However, liquidity should not be a huge impediment for investors willing to invest in Africa for two main reasons; i) The maximum that could be invested in Africa is only 5% of the Fund and this should make liquidity management much easier. Funds can utilise other more liquid assets classes to meet their short term liquidity needs. ii) Managers managing money in Africa have factored liquidity as one of the key factors in their portfolio construction methodologies. In most cases, they play in the upper end of the liquidity spectrum in their universe construction. 5. Manager skill and capacity This is an essential consideration to make when going into Africa. One would want to invest through a manager who has considerable years of managing money in this space, has enough capacity in terms of research team and who is always on the ground to appreciate the realities and intricacies of these economies. Due to these additional requirements needed for managers who manage money in Africa, fees are also similar to other international funds, which range from 1% to 2% per annum. For this kind of fee, it becomes vital to have a manager who adds value to a portfolio rather than just pick up fees on assets that could earn better elsewhere. AFRICA & THE EMERGING MARKETS In Search of alpha in emerging markets Lonwabo Dambuza | Fund Specialist Africa Funds, RMB Asset Management I nvesting in emerging markets and so-called frontier markets may seem to be the flavour of the moment as investors chase better returns than those expected in developed markets. Institutional investors are increasingly making strategic allocations to emerging markets rather than tactical views, and there is evidence that this appetite will continue as long as prospective returns in emerging markets exceed those in developed markets. Indeed investors have been rewarded as emerging markets continued to outperform developed markets in 2010, which saw the MSCI EM Index and the MSCI EFM Africa Index outperform the MSCI World Index by seven per cent and two per cent in US Dollar terms, respectively. The current political turmoil in Tunisia, Egypt and Libya brought to the fore the realities of investing in emerging markets, where liquidity can quickly dry up and emotional panic can easily overshoot on the downward. However, for those investors who have done their homework and understand the economic and political risks that emerging markets pose, current events could provide opportunities to pick up bargains in the market rather than justification for liquidating positions. While an investor may be aware of the risks inherent in emerging markets, undiversifiable risks exist and are higher than in developed markets. Investors that seek to participate in these markets should ask themselves three key questions: 1) What is their risk tolerance?; 2) What is their time horizon?; and importantly, 3) How do I access this growing market? RMB Asset Management Africa Funds are one of the ways in which investors can efficiently access potential growth opportunities in Africa. Although liquidity and investment opportunities can at times be sparse in emerging markets, a well-constructed stock selection process and an efficient investment vehicle should be able to minimise these shortfalls. It should, however, be remembered that prudent investment thinking is necessary to ensure alignment to long-term goals. April 2011 7 CHRIS HART Lessons and implications of the Middle East usually the most attractive ‘benefits’ that the despot offers in exchange for denying the freedom of its citizens. The Achilles heel of this arrangement is food. Poverty and oppression are uncomfortable bedfellows. Add food inflation or food shortages and the situation destabilises. This is observed time and time again and it is no surprise that despots frequently resort to food price subsidies. Just last year, Mozambique experienced serious unrest over food inflation where the government had to restore subsidies before calm returned. Chris Hart | Chief Strategist: Investment Solutions T he authoritarian regimes in the Middle East have sustained themselves through draconian measures for decades. No democratic traditions have been developed throughout the Arab world. Oppositions are not tolerated and, where elections have been held, credibility levels are low and in some case (such as Algeria), inconvenient results cancelled. However, leadership ranges from the benign to the truly despotic. In countries with abundant oil wealth, standards of living are generally high but this was not the case for Egypt or Tunisia, where there is a considerable degree of poverty. Poor people do not have significant personal resources and hence are relatively easy to oppress. The edifice of regime authority generally proves to be apparently impregnable. This is especially pertinent when resistance is only at an unco-ordinated individual level. There are also redeeming features about an authoritarian regime. It cannot survive if everything about is intolerable. Stability, order and security are 8 Food inflation has become a problem around the world, particularly in emerging markets, including China and India. South Africa managed to avoid the worst of global food inflation due to the strength of the Rand in 2009 and 2010. It is food inflation that was the foundation of the Middle East destabilisation. The middle class grumble over high food prices, the poor riot. The key difference for South Africa is that while there is much poverty, the contrast is that the country is a democracy. On a socio-political level there is minimal oppression. While poor communities are vulnerable to unrest (which has already been manifesting in service delivery protests), it is unlikely that the system will be destabilised. The political system is relatively secure. However, a distinction must be made between economic freedom and political freedom. It is quite instructive that the downfall of the strongmen in both Tunisia and Egypt was sparked by street hawker protests. Lack of economic freedom gave rise to increasing frustration and anger. The elite had restricted the economy with rules that favoured themselves. Opportunities were only really available to the rulers. Mubarak had amassed a great deal of wealth through vested interests and his family and the favoured few inner circle. The masses faced poor employment prospects and their own efforts were subjected to daily harassment by police. Ditto for Tunisia and too many other poor countries around the world. The same parallels in the Middle Ages, where a April 2011 connected elite (the nobility) subjugated the masses (the serfs). The peasant revolt was also to establish greater economic freedom. The big concern is that in South Africa there are uncomfortable economic comparisons. While South Africans enjoy one of the highest degrees of political freedom in the world, economic oppression has been on the rise. Government obstruction in an economy that has a high degree of unemployment is on the rise. Business faces hostile labour and regulatory conditions. But at the same time, there is an elite gaining ground and setting rules favouring their own interests. Unemployment is blamed on the economy but is probably more a function of regulatory failure. Much of the regulatory initiatives of the past 10 years have been very well intentioned but have sub-optimal outcomes. The danger South Africa faces is not so much a widening rich-poor divide but rather the lack and obstruction of opportunity faced by the poor. Street hawkers are also harassed rather than protected. Poor people just do not enjoy the same economic rights as the rich and South Africa is at risk as a consequence. April 2011 9 shaun Harris than ore M just another l l a w e h t n i Bric The surprise full of possibilities is invitation There’s an incredible amount of esteem for South Africa in being formally invited to join Bric, the acronym comprising Brazil, Russia, India and China that will now become Brics, as we join four of the fastest-growing emerging countries in the world. Overall it should be positive for investment markets in South Africa. Already the recipient of significant foreign investment inflows, being part of the Brics club will attract more attention to the country. It’s a step in the right direction. For private retail investors and financial advisers, increased foreign interest in financial markets could be good, more buoyant trading tends to raise share prices, but there are dangers as well. That was at least partly the case last year as foreign investment drove the JSE to dangerously high levels, much higher than historical averages. There’s the ‘it’s different this time’ argument and perhaps it’s right. Maybe ratings on the JSE indices deserve to be permanently raised. The downside is 10 April 2011 a stock market, and bond yields, that could overheat. Advisers will face some difficult calls on when to get clients’ money in and out of the market. The fundamental question, though, is should South Africa be part of Bric? In terms of economic growth, actual and forecast, South Africa is way behind the other countries; also in manufacturing output. The only percentage where we score the highest is unemployment, which is not good. Then again, in recent years, the JSE has outperformed the major markets in the Bric countries, something underlined by Marcel Bradshaw, MD of Glacier International, that economic growth does not necessarily translate into stock market performance. South Africa’s population is also much smaller than the other Bric countries and so is the economy, less than a quarter the size of Russia, which has the smallest economy in the Bric club, according to the World Bank. So is membership of Brics justified? Jim O’Neill, chairman of Goldman Sachs who coined the Bric acronym in 2001, thinks not and told the recent Reuters Investment Summit that he was surprised that South Africa had been officially invited to join the Brics. He reportedly added that South Africa’s economy was just too small to join the Bric ranks. The potential of the original Bric countries, seen as leading the swing of economic power from developed countries to emerging markets, is huge. At present, the four countries occupy more than a quarter of the world’s land mass and more than 40 per cent of the world’s population. Goldman Sachs believes that with the economies growing so rapidly, they will pass the combined economies of the present richest nations in the world by 2050. Africa could “punch above its weight” in Brics because of its close connections to the continent. He went on to remind the audience that “the African continent is the next great economic story”. in a country like Spain, where he feels stocks are underpriced and not factoring in the anticipated recovery. So should South African asset managers start launching new Brics funds? “I think it will make sense to start looking at it. It may be a bit late in the cycle for private investors, but over the longer term, South African asset managers should start launching Brics funds,” advised Bradshaw. This raises the question being debated in many investment houses at the moment. Is the strong run in emerging markets over and is better value being offered in developed markets? “It’s the biggest question on our minds now. After the run in emerging markets, what now?” Bradshaw asked. According to the International Monetary Fund, the Bric countries will account for 61 per cent of global growth in 2014. That’s the rather exclusive club South Africa is joining, so it’s not surprising that its role in the new Brics is being questioned. “It’s a masquerade, there are many other countries that could be part of Bric, like Mexico and South Korea,” said Adrian Saville, chief investment officer of Cannon Asset Managers. He believes that South Africa has been invited only because of its place in Africa. And that could be precisely the reason. On the point of Mexico and South Korea, surely Bric contenders, both countries apparently had been considered but were excluded because it was felt their economies were already more developed. There’s little doubt, though, that South Africa’s invitation to Brics was because of its position as the gateway to the rest of Africa. There are the conspiracy theories. The formal invitation to join Brics came from China, currently the rotating chair of Bric. China’s hunger for Africa’s resources is well known. One cynical view is that China extended the invitation as part of its economic colonisation of Africa. “I think one’s initial response to South Africa being invited to form Brics is somewhat skeptical because it’s such a smaller member than the others,” said Bradshaw. “But looking into the bigger Africa, the growth rates in many of the countries, the South African companies operating throughout Africa, it starts to add up and make more sense. There are more possibilities.” This is similar to the view of Rob Davies, Minister of Trade and Industry, who told the audience at the recent Davos meeting that South Africa’s invitation was not “Africa tokenism” but allowed access to the hundreds of millions of consumers in Africa. That’s what you would expect the Minister of Trade and Industry to say, but he added that South “When people make investment decisions, it will be, ‘Do I want exposure to the rest of Africa?’, which in turn will mean exposure to Brics,” said Bradshaw. “But private investors need to be aware that exposure to economic growth and stock markets are different things,” he cautioned. Glacier International already has quite a few funds covering Bric countries, including Bric funds. It seems just a matter of time before more are launched. And for investors, the possible advantages of joining Brics far outweigh the potential downside. “There’s an incredible amount of esteem for South Africa in being formally invited to join Bric, the acronym comprising Brazil, Russia, India and China that will now become Brics, as we join four of the fastestgrowing emerging countries in the world.” This was ably demonstrated in China last year when, despite GDP growth of around 10 per cent, the Shanghai Composite index declined. Saville said it’s simply because Chinese stocks are already priced for strong economic growth. He points to possible opportunities April 2011 11 HEAD TO HEAD | INVESTMENT SOLUTIONS Investment Solutions G lenn S i l ver m a n Global Chief Investment Officer at Investment Solutions 1. Developed markets have easily outperformed emerging markets so far in 2011. Why is this? Emerging markets (EM) have outperformed developed markets (DM) for some 10 years now, so some profit taking and a reversal was ‘overdue’. DM equities are now arguably cheaper, with certain lower risks, than those in EMs. The events in North Africa and the Middle East have highlighted some of these risks. The reversal is thus not unexpected, but may not necessarily be maintained. 2. Do you think this is a trend that will continue this year and beyond? The economics within the EM countries typically look better than those in the DMs, especially the West, periphery of Europe and Japan – primarily into lower debt levels, both private (consumer) and public (government). Their economies suffered far less from the global financial crisis and recovered far quicker and more strongly. In terms of economics, one might see more upside to EM outperformance. Against that, valuations tend to support a case for 12 developed equities over emerging. A 10+ year outperformance is a long one and it’s hard to see EMs giving up, without a fight. Nevertheless, the level of EM outperformance should, at minimum, start reducing or maybe even turning. 3. Is it game over for emerging markets – at least for the foreseeable future – and if so, why? As above, it’s a hard call, with pros and cons supporting either argument. From a valuation and risk perspective, we feel that DMs are the safer route to take. Once events in the Middle East, along with the inflation issues, are behind us, it is possible that EMs could resume their ascent. In addition, the US ‘QE2’ ends in June this year, and the implication of such, part of which has been to drive money into EM, remains to be seen. We don’t feel that it’s necessarily game over for EMs, there may just be better ways to gain access to the EM consumer. 4. Has the South African equity market run its course for now, or is there still value to be had? April 2011 On an historic basis, SA is expensive, both on price/earnings and dividend yield basis. This implies some vulnerability and less than average value in the local equity market. It thus implies that strong EPS growth is expected from our local companies, but that this is already priced in. If EPS were to disappoint, then downside is inevitable. Companies would need to deliver EPS at least in line with, but preferably ahead of expectations, to reduce this vulnerability. While the China story holds, and while floods of money continue to be created in the West and Japan, SA’s financial markets should attract some of this. But the storm clouds are gathering. 5. There is talk that Europe could see further strikes/riots as more austere measures are introduced. Do these developed markets potentially offer more risk than some emerging economies? All markets have risks. They alter through time and differ in terms of timing and quantum. Further austerity measures within the periphery of Europe could indeed lead to riots, but EMs, especially those in HEAD TO HEAD | Investec Asset Management Investec G ail D a n i e l Portfolio Manager at Investec Asset Management 1. Developed markets have easily outperformed emerging markets so far in 2011. Why is this? Emerging markets have been running negative real interest rates and are now perceived to be behind the curve in terms of controlling inflation. Inflation is above the target in China and Brazil and is running at nine per cent in Russia and more than eight per cent in India. Inflation has been influenced by global food prices, but capacity usage is also very high in emerging markets. In addition, earnings revisions are negative in emerging markets. The markets have performed well and they are coming off a high base, but companies are struggling to grow revenue in excess of costs. In developed markets, on the other hand, there is no inflation problem and earnings revisions are improving. 2. Do you think this is a trend that will continue this year and beyond? Yes, I think emerging markets will have to tighten interest rates a lot for that perception to change, but in the face of high food prices and social instability, it is unlikely that monetary authorities will take draconian action. 3. Is it game over for emerging markets – at least for the foreseeable future – and if so, why? It’s not game over, but it’s certainly time out, although the developed world is also far from perfect. Until inflation is brought under control or the stock markets get substantially cheaper, emerging markets are unlikely to outperform. The one caveat is the oil price. Those markets that benefit substantially from a rising oil price (like Russia and Brazil) will fare much better than those markets that are net oil importers (like Turkey and South Africa). 4. Has the South African equity market run its course for now or is there still value to be had? Obviously, there are opportunities for good stock pickers, but the local South African shares are looking vulnerable. In April 2011 the fixed investment sector, for example, there are very few new contracts being awarded and there is excess capacity after ten boom years and the World Cup. Retailers too are facing gross margin pressure due to rising cotton prices and operating prices (on the back of rising electricity and rental costs). For the first time in a very long time, retailers are in a situation where costs threaten to rise faster than revenues. However, we do see opportunity in oil shares, selected miners and companies that have offshore exposure like Richemont, SABMiller and BAT. 5. There is talk that Europe could see further strikes/riots as more austere measures are introduced. Do these developed markets potentially offer more risk than some emerging economies? Firstly, one shouldn’t read too much into strikes in Europe. It is a common occurrence that we see every year as they exert their democratic right to strike, mostly peacefully. Some of the best performing markets in the world so far this 13 INVESTMENT SOLUTIONS Investec Asset Management the Middle East, face their own risks. It largely comes down to valuations. The lower the valuation, the more protection – even in the face of negative events. This often comes down to stock specific, rather than regional calls, i.e. our preference would be for a regional position, which is a result of picking the most attractive stocks globally. year have been European, such as Italy and Greece. Yes, they are risky, but it is a risk with which the market has had three years to come to terms and which is fairly well understood. The key difference is that European markets are perceived to be risky, while the risk in emerging economies is underplayed. A prime example is the recent unrest in Egypt, which saw the stock market closed for nearly two months. 6. How different is the investment case for the US and Europe? 6. How different is the investment case for the US and Europe? The responses adopted by each to the financial crisis and its aftermath, have differed materially. The US is trying to solve its debt problem by taking on more debt (stimulation, QE2), whereas the Europeans have favoured more austerity. It seems to us that the latter is the more sensible long-term solution, notwithstanding the obvious negative short-term implications. But again, this talks little to valuations and US corporates could easily be the most attractive globally, even if the US region is not. 7. Investors are still being told to diversify by going offshore. Is this right and if so, where should they be looking? The US will keep interest rates lower for longer, while Europe may hike sooner given that the bulk of Europe is growing well. Germany, for example, is growing at the fastest rate since 1981. Given that Europe doesn’t have consolidated fiscal management, the tail risk of the emerging European economies will increase with rising interest rates. 7. Investors are still being told to diversify by going offshore. Is this right and if so, where should they be looking? At R7 to the Dollar, we do believe investors should go offshore, as the Rand is expensive on a purchasing power parity basis. However, investors should remember it’s a two-way trade and just because you’re taking your money offshore doesn’t mean you shouldn’t bring it back at some stage. Your money should work hard for you wherever it is invested. We believe that both the Rand and the SA equity market are on the expensive side of fair value. As such, investors should indeed look to take advantage of both, by moving money out of SA (Rand and local equities) and into offshore, developed market equities. 8. South African investors have been badly burnt in the past by investing in developed markets? Is this time really different? Predicting the future is always tricky. The evidence of the past 10 years has unequivocally shown, with the obvious benefits of hindsight, that investors should have kept their money at home. However, the past does not predict the future and at some point this will change. That time is approaching and may be sooner than is thought. Our instincts are to be six month early, rather than “one week” late, in terms of this position. It makes sense for South African investors to look at developed markets from a diversification perspective. Not only do they offer exposure to sectors that are not readily available in South Africa such as technology, pharmaceuticals and good consumer staples, but South Africa is also classified as an emerging market, and therefore vulnerable to the same vagaries as other emerging markets. 8. South African investors have been badly burnt in the past by investing in developed markets – is this time really different? In 2000, after ten years of good returns from US equities, everybody wanted US equities; conversely, after a poor decade, nobody wants US equities. However, with the Rand looking expensive, this is where the opportunity lies. Valuations are attractive and we expect the economy to surprise on the upside as corporate profitability will drive job growth. 14 April 2011 April 2011 15 Shaun Harris ETFs the challenge for unit trust funds Buying beta at a better price 16 April 2011 S ince the first exchange traded fund (ETF) was launched in South Africa a little more than ten years ago, it has proved to be a popular investment vehicle. Trade, both by volume and value, has been brisk. There are now 27 ETFs listed on the JSE as well as five exchange traded notes (ETN). The real question though is why ETFs have not been even more popular with retail investors. In most cases, total costs are lower than unit trust funds, especially actively managed unit trusts, and with the variety of ETFs and ETNs now available on the market, a well diversified portfolio can be built up just using these funds. There are a few possible answers to this question. But first as background to the growing appeal of ETFs, consider these global trends, which in general, apply to South Africa. More than one third of the daily trade on some stock markets around the world is listed ETFs. This marks the main distinction between unit trusts and ETFs. A unit trust investor is buying units or parts of a fund produced by an asset management company and run by an asset manager. An ETF is a basket of shares, which is why the funds are listed on the JSE. This makes the funds very liquid, allowing investors to easily get in and out of ETFs. Globally, at least two thirds of actively managed equity funds underperform the overall market. Much the same is true in South Africa. So unless an investor can consistently choose one of the top third of actively managed funds, he or she can buy the market as represented by shares that make up an index at far lower cost. The investor is ensured of getting the market beta, or even more if it’s a fundamental indexation ETF, instead of paying more for alpha that may not be delivered. That makes the case for ETFs making up a large proportion, perhaps even the core, of a retail investment portfolio. But here’s where one potential problem with ETFs comes in. The funds are bought without any advice or ongoing management reports. The investor has to be sure which index he wants tracked and understand the ETF that is being bought. Here’s where the financial adviser should enter the picture, being able to tell the client, based on risk profile and investment targets, which ETFs would be best. But that doesn’t seem to be happening much and one reason, believes Mike Brown, MD of ETF trading platform etfSA.co.za, is because many advisers don’t fully understand the products. “We’re trying to do a lot to improve education on ETFs. We have IFAs registered on our platform, but I think many IFAs are still trying to understand ETFs. We’re trying to teach the market that a core portfolio should be beta,” said Brown. Another reason he feels that advisers might not be putting clients into ETFs is because they tend to use the products of people they have a relationship with, typically one of the large asset managers. That, in turn, raises the question of commissions earned by advisers. They will earn a lot more from an actively managed unit trust fund than from an ETF. “Globally, at least two thirds of actively managed equity funds underperform the overall market … That makes the case for ETFs making up a large proportion, perhaps even the core, of a retail investment portfolio.” Brown said eftSA.co.za pays a maximum commission of one per cent to advisers. Typically it’s lower, in the region of 0,8 per cent. And while asset management fees have been forced down through the financial crises, often at around one to two per cent, the adviser can still earn up to five per cent commission from an actively managed fund. It’s therefore not hard to see why many advisers favour actively managed unit trust funds. To overcome this, shouldn’t the ETF product providers – mainly large banks like Absa Capital, Nedbank Capital, Investec and Deutsche Bank – pay a higher commission to advisers? “The problem with that is it’s the client who pays the commission in the end. Paying more for an ETF erodes the main attraction of the funds, the low-cost structure. And if the client is going to have to pay more, he might just question the thinking behind using an adviser as opposed to buying an ETF directly through a stockbroker.” exposure to a number of equity indices at reasonable cost, but questions the market capitalisation structure of these indices. Kulcsar added that passive index investing doesn’t necessary reduce risk, as the most important investment decision, asset allocation, is made by an active manager. Market capitalisation indices do present some problems, mainly that the index will be weighted towards the large stocks and rising share prices (and therefore more expensive shares), while underweighting smaller cap companies and lower share prices (often the value stocks). But many ETFs have overcome this by using fundamental indexation, the Research Affiliates fundamental index (Rafi) that ignores market capitalisation and rather ranks shares in an index based on fundamental metrics like turnover, earnings, cash flow and dividends. These are almost like actively managed ETFs and under certain market conditions will perform better than the index. ETNs are a welcome addition to the investment set, though retail investors should be wary of investing directly in commodity funds unless they have a specialist view. Once again, this is the knowledge a good adviser should acquire to be able to properly advise clients. Standard Bank has launched four commoditylinked ETNs, respectively tracking the price of gold, silver, platinum and palladium. More recently, RMB launched an oil ETN that directly tracks the price of oil. The range of ETFs and ETNs is wide enough to allow an investor or adviser to construct a fully diversified, low cost portfolio. Offshore exposure is also catered for through Deutsche Bank’s funds that cover the major indices globally, as was well as in Europe, the UK, Japan and the US. ETF sales are likely to be boosted through a new concept Brown is working on for retirement fund portfolios. These will incorporate ETFs in a retirement fund wrapper. Brown said the new product will be launched shortly. But while buying an index might be the most sensible route for many investors, having the ‘right’ active fund manager will create more wealth. “Odds are that investing in a passive index fund is unlikely to get you as financially healthy as proponents of the strategy would have you believe. For investors to gain and maintain true financial health – that’s wealth – an investment portfolio needs to be actively managed,” said Tamás Kulcsár, an investment analyst at Sanlam’s Glacier. He acknowledged the Satrix ETFs provide April 2011 17 NERINA VISSER Exchange traded funds and mining companies operating in Africa A powerful combination to reverse some of the impact of colonialism that equities as an aggregate asset class, over you have to look much further afield to the stock the long term and on average, will outperform markets of London, Toronto and Australia to find all other major asset classes such as bonds, listings of the companies that are involved in property and cash. Contrary to popular belief, mining operations on the African continent. this is not because of compensation for risk taken on, but rather because of the ability of The reason for this is quite simple – the equity investments to generate wealth, or growth complexity and capital intensity of mining in assets. One of the surest ways for investors to and exploration activities limit the range of share in this is through direct participation in the financing partners available to these companies. growth in wealth through ownership of equities. They have to turn to the capital markets that understand mining and know how to value and Nerina Visser | Head of Beta and ETFs at Nedbank Capital T “Mining and exploration is assess it. The markets of London, Toronto and a capital intensive industry provide both the skill and financial depth that Australia, in addition to that of South Africa, and one that requires highly these operations require from investors. But skilled resources, including form of colonisation of the continent, again to unfortunately, this has resulted in a secondary financial and investment the detriment of its residents. skills. The JSE Securities Investors in Africa do not have ready access Exchange has a long history to investments in a large part of its own GDP associated with mining.” the opportunity to participate in this aspect basket. As a result, they largely miss out on of wealth creation. It is extremely difficult to houghts of Africa conjure many Mining and exploration is a capital intensive roll back this process by convincing individual images in one’s mind, not all of industry and one that requires highly skilled companies with mining operations on the them necessarily positive. But resources, including financial and investment African continent to come and list their equity mention the continent in the same skills. The JSE Securities Exchange has a long on African stock exchanges. However, one breath as gold, platinum, diamonds history associated with mining, as it was in fact key to unlocking the access to these wealth- and even oil, and a very different association founded on gold mining companies, and traces generating assets lies in Exchange Traded Funds is created. For centuries, the ‘dark continent’ its roots back to Barberton and the early days (ETF). Nedbank Capital has compiled a series has represented a destination for those seeking of the gold rush. To this day, the equity market of indices of mining and commodity stocks their fortunes, some doing so using less than in South Africa continues to be dominated by a engaged on the African continent, irrespective honourable methods. The colonisation of Africa few mining giants, such as Anglo American and of the stock market on which it is listed. By is an emotive topic, and to this day causes strife BHP Billiton. creating ETFs on these African mining stocks between some of the former colonies and their and making them directly available to investors erstwhile masters. To add insult to injury, there However, when one takes a further look north across the continent’s stock exchanges, it will is a modern-day version of plundering that and scrutinises the listed companies on the stock provide the opportunity for the entire spectrum continues, albeit in a less obvious form. exchanges of the rest of the African continent, it of investors – from pension funds to retail is with surprise that very few metals and mining, investors – to participate in the benefits and There are but few ways to grow wealth, and if resources or commodities companies are listed. wealth created by its natural resources. you aren’t born with a silver spoon in the mouth, This is despite the fact that Africa is recognised you need to accumulate ownership of wealth- as one of the richest sources of minerals, generating assets. It is a well documented fact precious metals and gems in the world. In fact, 18 April 2011 FUND PROFILES FUND PROFILES Ashburton Chindia Equity Fund Please outline your investment strategy and philosophy for the fund. fantastic growth opportunities in the world’s most dynamic region. To state our key message: “We don’t blindly follow benchmarks. We don’t follow the crowd. We take a common sense approach and invest in the best companies run by the best people.” Please provide some information around the team responsible for managing the fund? This is a fund investing in the emerging giants of China and India, with a benchmark that is 50 per cent MSCI Golden Dragon Index (Greater China) and 50 per cent MSCI India. It is important to note that we have no market-cap bias, and happily invest in the largest to smallest companies as long as they meet our investment selection criteria. Who is the fund appropriate for? Coronation Africa Frontiers Fund is an institutional fund. It is suitable for investors who are genuinely long term and are willing to accept investment risk. These are volatile markets offering 20 The Asia team consists of three people whose sole focus is on the equity markets of Asia. Jonathan Schiessl is head of Asian equities and has been at Ashburton in this role for nearly 12 years. Prior to Ashburton, Jonathan worked in London for a number of years and is one of a few Asian Investment managers with experience of these markets prior to the Asian crash of 1997. The team also consists of Craig Farley, investment manager, who has been working with the team for over five years and more recently Simon Finch, who joined the team a couple of years ago. Please provide performance of the fund over one and three years. The fund’s benchmark is the MSCI World TR and the fund is USD denominated. Name 01/12/06 31/12/10 (Since Launch) One year Three years Ashburton Chindia Equity 27.57 16.68 -18.29 MSCI World TR USD -1.82 12.34 -12.33 Why would investors choose this fund above others? The fund is a unique offering in South Africa, catering to investors who want exposure to the re-emerging giants of China and India. Having both countries in one fund is advantageous as they are remarkably complementary markets and economies. Investors can get the best of both markets, while at the same time reducing risks associated with overly high sector and individual stock exposures that are inherent in single country indices in these markets. April 2011 “We don’t blindly follow benchmarks. We don’t follow the crowd. We take a common sense approach and invest in the best companies run by the best people.” Coronation Africa Frontiers Fund (Institutional) Please outline your investment strategy and philosophy for the fund. we are for the most part invested in the same companies now as we were two years ago. The Coronation Africa Frontiers Fund is an institutional fund which follows a valuation-driven investment philosophy, with a strong focus on potential downside risk for each investment made. The portfolio is constructed from the bottom up, with a focus on holding those shares which offer the most attractive fair value relative to current market prices. In calculating fair values through our proprietary research, we place the emphasis on normalised earnings and/ or free cash flows rather than current earnings, using a long-term time horizon rather than focusing on current news flow and price momentum. Please provide some information around the individual/team responsible for managing the fund. Who is the fund appropriate for? Launched in October 2008, the fund’s benchmark is USD Libor + 3% and it is USD denominated. The fund is suitable for: • Investors seeking exposure to growth and expansion in Africa. • Investors looking to increase capital over a three to five-year period • Investors who are able to withstand short-term market fluctuations in pursuit of maximum total returns over the long term. Have you made any major portfolio changes recently? No. Since inception, the fund has had a significant weighting in consumer companies. By and large, our positions in this sector have delivered very good returns for investors. Brewing companies, for example, constituted 17 per cent of the fund as at the end of 2010 and while the position sizes have evolved, 870-1_INVEST_SA_hlf_pg_final_artwork.indd 2 The fund is managed by portfolio managers Peter Leger and Peter Townshend who tap into the collective insights of the 49-member investment team. Please provide performance of the fund over one, three and five years. Coronation Africa Frontiers Fund* FTSE/JSE Africa Top 30 Ex SA Index* USD Libor + 3%* One-year return 18.2% 4.7% 3.4% Two-years return (annualised) 29.6% 24.0% 3.5% Since Inception return (annualised) 20.1% -9.5% 3.7% *Returns are quoted as at 31 January 2011 April 2011 04/03/2011 16:03 21 “The fund is built on a bottom-up basis with each individual holding being selected on its own investment merits. Coronation Global Emerging Markets [USD] Generally speaking, the fund has large Please outline your investment strategy and philosophy for the fund. The Coronation Global Emerging Markets (USD) fund follows the same long-term focused, valuation-driven investment philosophy that we employ across the entire Coronation fund range. The fund predominantly invests in our top stock picks from companies providing exposure to emerging markets and will remain fully invested in equities at all times. Who is the fund appropriate for? The fund is suitable for investors: • Looking for exposure to emerging markets equities who are in their wealth build-up phase and require little income yield in the short term. • Seeking a diversification of returns within a total investment solution. • Able to withstand shortterm market fluctuations in pursuit of maximum total returns over the long term. 22 Have you made any major portfolio changes recently? We have been adding to the fund’s Indian holdings, notably the Indian state banks which now trade on six to seven times this year’s earnings. The banks have been declining due to fears over inflation (and hence interest rate increases). At the same time, we have been reducing the fund’s holdings in Chinese Internet companies, which have appreciated by 30-40 per cent over the past few months and as such make valuations less attractive. How have you positioned the fund for 2011? The fund is built on a bottomup basis with each individual holding being selected on its own investment merits. Generally speaking, the fund has large exposure to consumer businesses in emerging markets and very little exposure to commodity companies (which we think are expensive or fairly valued at best). Within commodities, the fund does have exposure to a number of oil and gas stocks where we can still find good value. Please provide some information around the individual/team responsible for managing the fund. The fund is jointly managed by portfolio manager Gavin Joubert (head of the Coronation Global Emerging Markets unit) who has 14 years' investment experience as an analyst; portfolio manager, Mark Butler; and Suhail Suleman. exposure to consumer businesses in emerging markets and very little exposure to commodity companies (which we think are expensive or fairly valued at best).” Please provide performance of the fund over one, three and five years. Launched in July 2008, the fund’s benchmark is the MSCI Emerging Markets Index and it is USD denominated. Coronation GEM (USD)* MSCI Emerging Markets Index* Alpha Since inception (annualised) 11.72% 4.91% 6.81% Two-year return (annualised) 58.74% 52.62% 6.12% One-year return 22.20% 21.23% 0.96% *Returns to end February 2011 April 2011 Investec Africa Fund Please outline your investment strategy and philosophy for the fund. The Investec Africa Fund offers access to investment opportunities in African markets, excluding South Africa. In recent years, far-reaching and pervasive changes in sovereign governance on the African continent have changed the way many of these economies operate. The continent now offers a growing range of highquality and attractively valued companies. With the rapid growth in demand for goods and services, companies often gain considerable pricing power and volume growth, which can lead to investment opportunities with robust earnings growth and high margins. Have you made any major portfolio changes recently? We have a high level of cash in the portfolio, because we believe there could be very good buying opportunities should there be sharp drops in markets as a result of the political events in North Africa. In particular, we believe that Egypt may very soon offer excellent buying opportunities. Please provide some information around the individual/team responsible for managing the fund. The Investec Africa Fund is managed by Roelof Horne, supported by a team of investment analysts based in South Africa, Namibia, Botswana and London. Roelof joined Investec Asset Management in February 1996 and was previously head of life products at Investec Asset Management from 2002 to 2007. Please provide performance of the fund over one, three and five years. The benchmark is one month USD LIBOR +4% One year % Three years (ann %) Since launch (ann%) Investec Africa Fund 18.1 -9.8 10.9 One month USD LIBOR 4.3 5.0 6.9 13.8 -14.8 4.0 Please outline fee structure of the fund. The fund has an annual management fee of one per cent per annum and a performance fee, which is charged annually as 20 per cent of performance in excess of one month USD LIBOR plus four per cent on a two-year rolling basis. Why would investors choose this fund above others? We view the African continent as a compelling long-term investment destination, and have committed substantial resources to facilitating international portfolio flows into Africa over a long period. Investec Asset Management was one of the pioneers of frontier market investment, growing assets in Africa excluding SA to about $4 billion in listed and private equity investments today (excluding SA). +4% Relative Performance * Performance in USD ALTERNATIVE ASSET MANAGERS CONTACT MURRAY WINCKLER or GAVIN VORWERG +27 11 263 7700 Laurium Capital (Pty) Ltd is an authorized financial services provider April 2011 23 Fund Profile - Murray Winckler Laurium Capital alternative asset manager Laurium Capital (Pty) Ltd is an authorized financial services provider SA All Share Index in 2011. The long/short fund has a net equity exposure of around 50 per cent. The preferred sectors are banks and mining. We have implemented some derivative overlays to protect the downside. The market-neutral fund does not take directional views and currently has about 10 intra sector pair trades. Please provide some information around the individual/team responsible for managing the fund. Murray Winckler | former CEO of Deutsche Bank in SA Laurium Capital was formed three years ago by Gavin Vorwerg and Murray Winckler, two former investment bankers. Winckler was CEO of Deutsche Bank in SA and Vorwerg spent his last three years with Deutsche Bank in London having responsibility for equity structuring in the Middle East and Africa. Please provide performance of the fund. Please outline your investment strategy and philosophy for the fund. Laurium Capital is an alternative asset manager that manages or advises on a long/ short fund, a market-neutral fund and a long only Zimbabwe fund. The long/short fund’s objective is to deliver at least a seven per cent per annum return above inflation on a rolling three-year basis with low volatility and a low risk of capital loss. What are your top five holdings at present? The long/short fund’s top holdings are Billiton, First Rand, Steinhoff, Nedcor and Naspers. A couple of the larger shorts are Bidvest and Vodacom. Have you made any major portfolio changes recently? Inception Return Return p.a. Benchmark – Cash p.a. Laurium Capital Long /Short 1 Aug 2008 42.8% 14.8% 8.6% Market Neutral 1 Jan 2009 36.5% 15.4% 7.8% Inception Return Return p.a. ZSE p.a. 1 Dec 2009 38.8% 30.0% 4.0% Zambezi Fund Please outline fee structure of the fund. The hedge funds charge a one per cent management fee and a 20 per cent performance fee subject to the investor at least receiving a cash return annually. The Zimbabwe fund charges a 1.5 per cent management fee and 15 per cent performance fee. We have increased our exposure to the banks sector and reduced holdings in general industrials, particularly retailers. How have you positioned the fund for 2011? We expect a 15 per cent return from the 24 April 2011 Nedbank Ltd Reg No 1951/000009/06,1002 BettaBeta Equally Weighted Top 40 ETF – introduce balance to your portfolio The best performing Top 40-based exchange-traded fund on the market* If you’d like to add some balance to your investment portfolio while getting similar returns with less risk, why not consider investing in the Nedbank Capital BettaBeta Equally Weighted Top 40 Exchange-Traded Fund (BBET40)? By balancing all of the top 40 stocks on JSE Limited into proportions of 2,5%, the BBET40 outperformed similar exchange-traded fund (ETF) options available on the market* and offers you greater stability. So, choose a cost-effective and balanced ETF by contacting your stockbroker, calling etfSA on 0861 383 721 or visiting today. For more information visit or email BetaSolutions@nedbank.co.za. For contracts for difference and derivative trading call 011 535 4043. * Based on the comparative performance of the risk-adjusted net asset values of all the top 40-based ETFs since the inception of the BBET40 on 25 March 2010. jean pierre verster How well has your fund manager performed? Jean Pierre Verster | Analyst at 36ONE Asset Management T he sharp sell-off in equities experienced during March 2011 is a timely reminder that investors (and their advisers) need to be careful in selecting which unit trusts to invest in. According to the Association for Savings and Investment SA (ASISA), there were 943 unit trusts registered as at the end of 2010. The challenge for investors is to pick the future winners out of this overwhelming universe. Short-term outperformance is not the best indicator of future returns. A longer performance period, over a full market-cycle, is a more appropriate timeframe to use in comparing performance and assessing the risks taken by a fund manager. With the FTSE/JSE All-Share Index recently having touched its pre-crisis highs, investors should be looking to see how their fund manager 26 has fared during the turbulence of the last five years. It is interesting to note that the top performing unit trusts over the past five years include a number of funds managed by smaller, independent fund managers. flexible in our positioning. Our research function is integrated with the trading function, which allows us to get immediate feedback from market moves, and see the impact of important events as they occur.” Jean Pierre Verster, an analyst at 36ONE Asset Management, said that independent fund managers have taken market share away from the investment management divisions of the life assurers over the past decade. “Independent fund managers do not employ a large agency sales force, and therefore can compete effectively with the life assurers only on the basis of performance. Since the independent fund managers have returned better returns, on average, than the life assurers, they have attracted the lion’s share of the flows in the market.” He said constant monitoring is not the same as short-termism, however, which is an increasing problem in the fund management industry. The socalled ‘beauty parade’ of quarterly fund manager performance league tables puts pressure on fund managers to perform well over a rolling three-month period, which could lead to investing decisions that are at odds with the long-term objective of outperformance. Investors might question whether the smaller, independent fund managers have the required risk management processes in place to mitigate against their perceived higher risk. “Successful firms need to put risk management at the centre of managing funds,” according to Verster. The incentive structures of independent fund managers (most are substantial coinvestors in their own funds) should also give investors comfort in the way that the funds are managed, since the manager has his own skin in the game. “At 36ONE, we actively monitor our fund positions intra-day and remain “A company’s share price does not efficiently reflect the operating and financial characteristics of the underlying business at all times, and this could lead to a disconnect between the business performance and the share price performance over the short term,” said Verster. However, Verster added that investors should not be overly concerned by this phenomenon: “It is this disconnect that creates the opportunity for an astute fund manager to buy shares below intrinsic value or sell shares above intrinsic value.” etfSA.co.za INDEX TRACKING ETF UNIT TRUST PERFORMANCE SURVEY Mike Brown | Managing Director, etfSA.co.za Best Performing Index Tracker Funds – February 2011 The latest Performance Survey highlights the following: (Total Return %)* Fund Name Type 5 Years (per annum) Satrix INDI 25 ETF 16,19 Prudential Property Enhanced Unit Trust 13,65 Satrix Top 40 ETF 13,60 3 Years (per annum) Satrix DIVI Plus ETF 15,42 Satix INDI 25 ETF 12,94 Prudential Property Enhanced Unit Trust 12,65 Satrix INDI 25 ETF 26,30 Satrix RESI 20 ETF 26,26 NewFunds eRAFI INDI 25 ETF 25,29 1 Year 3 Months DBX Tracker EuroStoxx 50 ETF 12,05 NewFund eRafi Resources 20 ETF 9,84 Satrix RESI 20 ETF 9,31 • In the short-term, one to three months, resource-based tracker funds – such as the Satrix RESI 20, the eRAFI Resources 20 and the NewFunds Shari’ah Top 40 (which has a strong weighting in resources) – feature strongly, indicating that sector rotation towards commodities and the recent weakening of the Rand are paramount issues in the current investment market. • The BIPS Inflation-X ETF, which holds a portfolio of inflation-linked bonds has, for the first time in the survey, outperformed the Investec zGOVI ETF, which holds a portfolio of normal government bonds. This suggests that in an environment where interest rates are rising, inflation-linked bonds, where the capital value rises with inflation, might be more attractive than traditional bonds, whose capital value falls as interest rates rise. 1 Month Satrix RESI 20 ETF 5,89 NewFund eRafi Resources 20 ETF 5,30 NewFunds Shari’ah Top 40 ETF 4,73 Source: Profile Media FundsData (01/02/2011) * Includes reinvestment of dividends. • The total return performance of ETF funds continues to exceed that of unit trusts, tracking similar indices, which signifies that the lower total expense ratios (TER) of ETF funds have a positive impact on performance. One-year returns The Satrix INDI 25 ETF was the best performer over one year, with the NewFunds eRAFI Industrial 25 ETF not far behind. Industrial portfolios have performed well over the past 12 months in response to the recovery in the local economy. The Satrix RESI 20 ETF has crept into the top three, reflecting the upsurge in the resource sector in late-2010. Three- to five-year returns The Satrix INDI 25 ETF has the best five-year performance and second best three-year total return performance of all the index tracker funds. The relative lack of awareness of this fund is puzzling given its consistently good performance and its exposure to a blue chip portfolio of South Africa’s leading domestic shares. PROFILE | CIO: PPS Investments D a v i d G reen DG C hief I nvestment O fficer : P P S I nvestments David Green has been the chief investment officer of PPS Investments since its launch four years ago. Before that he spent several years consulting to, and directing the research and investment management efforts of other prominent asset management businesses. INVESTSA caught up with him to find out his views for the year ahead. 28 April 2011 “One of the biggest challenges for investors in the year ahead is having to stick to their long-term financial plan in a world dominated by one dramatic incident after another. We need to remember that the world, G politically and economically, always has and will continue to be, turbulent.” What do you think are the biggest challenges facing investors in the year ahead? One of the biggest challenges for investors in the year ahead is having to stick to their longterm financial plan in a world dominated by one dramatic incident after another. We need to remember that the world, politically and economically, always has and will continue to be, turbulent. When it comes to investing, you need to ignore these events and stick to what you have set out to achieve. Fluctuations in the gold and oil prices, an earthquake in Japan or the insurgence in Libya, should not sway an investor. It is important to note there are currently not a host of attractively priced asset classes in the market, with the possible exception of global developed market equities. Yet there is a challenge in gaining access to this offshore asset class as exposure is limited in terms of regulation. What can financial intermediaries do to assist their clients through this period? Intermediaries have the responsibility of focusing their clients back to the long-term goal and plan they have developed together. Keep in mind that markets are always uncertain; periods of uncertainty are not unique, so sticking to the plan and ensuring that clients have a suitably diversified portfolio is a good safety net. No-one should try to time the market; this is a risky bet to place with your clients’ hard-won retirement savings and it hardly ever pays out. Many asset managers are advocating investors should look offshore. Do you agree? Yes, I do. It must be noted, however, that investing offshore has caused some pain in recent years, as the Rand has strengthened, so there may be a disinclination by many clients. In principle, investors should always look across all asset classes and markets. An investor should not wake up one day and think about investing offshore simply because they have heard that this is a good idea. However, if suitable for the individual and in accordance with their long-term plan, we do believe there is a real investment case in favour of investing offshore. PPS Investments uses the multi-manager model. Do you think this is the appropriate approach in the current environment? A multi-manager approach is always appropriate. As already mentioned, the current environment is one of uncertainty and this is a perpetual state for markets. We cannot precisely predict the returns that asset managers and/ or the markets will deliver. Only real diversification ensures that a balance of returns is achieved. This is what multimanagement does. An intermediary who wonders whether they should use a multi-manager approach for their clients’ portfolios should ask themselves: - Am I able to correctly allocate assets across various asset classes to help my clients achieve their goals? - Do I have the qualitative insight to adequately differentiate between the asset managers, their funds and the markets? - Can I successfully choose the most appropriate mix of funds and asset classes to achieve my clients’ goals? If there is any doubt about any of these answers, outsourcing to a skilled multi-manager may be worthwhile. What do you think are the biggest contributors to being a successful fund manager? - You need emotional fortitude. A fund manager must be the master of his own emotions; otherwise he may drive decisions to the detriment of clients. - You need to have a long-term view and a April 2011 patient disposition. Markets produce uncertain and unpredictable results in the short term. - You need to be widely read but not necessarily frequently read. You don’t need to read the daily newspapers every morning, it is more important to be able to sift out what adds value and what doesn’t. - You need to be good at managing stress in order to avoid burn out. The long-term survivors are those who keep their balance. How do you wind down from the pressures of your position? I read voraciously, both fiction and non-fiction. I’ve just finished the non-fiction titles: Enough: True measures of money, business and life by John Bogle and Simple but not easy, an autobiographical and heavily biased book about investing by Richard Oldfield. As a break from these intense choices, I’ve started reading Night Train to Lisbon by Pascal Mercier. My greatest passion is mountaineering and I try to indulge this as often as I can. Most weekends and every vacation opportunity I get. How do you define success? I would quote Kathy Kolbe – a theorist and strategist – who has a very apt view on this: “Success is the freedom to be yourself.” Finally, if you had R100 000 to invest, where would you put it? If I had to choose a single place to invest R100 000, it would be a well-diversified portfolio with a strong bias towards global developed market equities. My advice to consumers, in this environment, would be to also pay down debt. This makes particular sense if interest rates are likely to start increasing during the year as has been predicted. While debt servicing costs might seem manageable now, once rates start rising, the cost can strangle consumers. 29 retirement changes - Maya Fisher-French What you need to know by Maya Fisher-French In this year’s budget, Finance Minister Pravin Gordhan announced changes to retirement funding as well as proposals that will have an impact on your clients’ retirement strategies. C hanges to tax-free deductions From March 2012, all employees will be allowed to deduct up to 22.5 per cent of their taxable income for contribution to retirement funds up to a maximum of R200 000. At the same time employer’s contribution will now be treated as a fringe benefit encouraging the move to employee contributions which will simplify the structure of salary packages. The tax deduction will be levied against taxable income as opposed to pensionable income, which will further simplify the calculation and 30 effectively increase the portion of one’s salary that you can use for the tax calculation as it would include bonuses and fringe benefits such as car allowance. Clients can also include capital gains in the taxable income calculation. What this means: The reality is that most people will not take advantage of this as most salaried employees try to get as much cash at the end of the month as possible. However, those clients who want to improve their retirement funding, can now do so with before-tax income. Retirement annuities have always been sold as a top-up for non- April 2011 pensionable income (bonus and fringe benefits) to ensure that the client is saving 15 per cent of their total income. Theoretically the move to taxable income would remove the need for a retirement annuity. Rowan Burger, head of retirement reform at Liberty, says most companies are unlikely to increase their pension contributions due to the increase in their payroll and the variability in some components of remuneration such as commissions. Therefore, individuals would still need to use an RA to maximise the benefit. “People will use their company fund for regular ongoing contributions and their RA for top-ups to save for bonuses for example,” said Burger. The future of provident funds This tax change also makes it more effective for the tax deduction to be in the hands of the employee and matches the provident fund contributions allowed by companies. This is part of the government’s strategy to bring provident funds in line with pension funds and retirement annuities. mandatory preservation is therefore critical and National Treasury plans to extensively consult all relevant stakeholders”. It is likely that proposals will make preservation a default when changing jobs, with the individual needing to demonstrate hardship in order to access their funds. Burger says Liberty would like to see a situation where the retirement benefits are paid out over a protracted period, say 60 months, so that the member is not tempted to buy a car or go on holiday with the funds. Once the person has found a new position, they can transfer the remaining balance into the new fund. What this means: There will initially be concerns by clients that they cannot access their money and it may result in individuals wanting to cash in their retirement savings. Advisers will need to work with them to demonstrate the importance of preservation and to ensure that they have additional discretionary savings which are accessible. “There will initially be concerns by clients that they cannot As part of this move, National Treasury is considering applying the one-third lump sum limit applicable to pension and retirement annuity funds to provident funds. access their money and it may What this means: National Treasury has made it clear that it will not apply retrospectively to employees in existing provident fund structures, so it should not affect clients who are already invested in provident funds. Advisers will need to work result in individuals wanting to cash in their retirement savings. with them to demonstrate the importance of preservation.” Review of annuities However, it will affect financial planning for people entering new funds. If the client requires a large lump sum on retirement to start a business for example, they would now need to supplement this with discretionary funds. These discretionary savings will become even more important if government implements mandatory preservation when changing jobs. Mandatory preservation National Treasury is concerned that people who are not going through financial hardship can easily withdraw their savings because the current system does not compel preservation of retirement savings. In the National Treasury document A safer financial sector to serve South Africa better, it states that “taxation clearly does not serve as a strong disincentive since people are willing to pay it and withdraw their savings and that the introduction of As we enter a low-return environment, costs will continue to come under the spotlight. National Treasury would like to see increased competition for living annuities by reviewing the need for a collective investment scheme (CIS) to obtain a long-term insurance license. According to National Treasury, “enabling collective investment scheme companies to offer living annuities without the need for a long-term insurance license could open the market and foster competition”. At the same time there will be review of fees and commissions on annuities as there are concerns that CIS companies are not subject to commission regulations and are permitted to charge an additional trail fee for ongoing advice to clients. Currently the fee structure creates a perverse incentive to invest clients’ funds into unit trust living annuities rather than life insurance living April 2011 annuities even if they are more cost efficient. What this means: In terms of CIS living annuities, Burger said there is a concern in the industry that if living annuities are perceived to be ‘less expensive’ we may see inappropriate use of these vehicles which do not protect pensioners from living longer than their money lasts. Advisers who rely on trailer fees from living annuities will need to start rethinking their business models. Review of pension fund costs National Treasury will also be looking into the fees charged by pension funds and will work with the industry to draft a code of ethics and address concerns over high fees. Treasury believes pension funds need to improve their level of disclosure to clients and a lack of transparency prevents customers from being able to compare products across funds which results in excessive charges. Members will take an active interest in costs as these will be deducted from their contributions before being invested for their retirement. What this means: There will need to be a review of the legislation by government. Currently, the contribution reconciliation and death benefit distribution provisions for example contribute to the cost of running retirement schemes. There may be the establishment of a central contribution collection agency to streamline administration for example. Distribution costs will also come under the spotlight with possibly a move to DIY pension funds for smaller companies. Regulation 28 Treasury has confirmed that changes to Regulation 28, which will see prudential guidelines implemented at member level, will not affect existing policies. There is also recognition of new asset classes such as hedge funds and private equity. What this means: This creates an advantage for clients with existing retirement annuities who may have non-prudential portfolios such as high overseas exposure or 100 per cent equities as they will be allowed to continue to hold these portfolios. Pension funds and retirement annuities now have access to more exotic investments that unit trusts do not. 31 Retirement Investing - Roger Birt Life-stage investing should take individual member needs into account Roger Birt | Head: Guaranteed Investment, Old Mutual Corporate Funds O ver the last few years, an increasing number of retirement funds have elected to offer their members a life-stage investment option, whereby each individual’s savings are invested in a portfolio according to their age and time to retirement. Roger Birt, head of guaranteed investment portfolios at Old Mutual Corporate believes that a well-designed life-staging model should take into account the risk appetite of members during different phases of their working life, as well as the financial needs of members after they have retired. “A proper life-staging model will appropriately cater for both young and old members by providing suitable portfolios for both accumulation in the years before retirement and preservation after-retirement, and ensuring a smooth transition between these phases,” he said. Before retirement, younger retirement fund members will tend to look for higher returns from riskier investments, and most life-stage models cater for this. Most life-stage models also cater for members nearing retirement by shifting their focus towards maintaining their investment in lower risk assets to ensure a comfortable monthly income in retirement. What tends to be given little focus is what risk profile a member is likely to be comfortable with after retirement, determined based on their choice of postretirement vehicle. 32 Birt further explained that people who desire cash at retirement are likely to be best suited to avoiding losses on capital from risky investments, like the stock market, as retirement approaches. In this case, cash may be a good option. Alternatively, people who opt for a life annuity will want protection from interest rate movements as retirement approaches. “A life annuity pays a Birt believes that life-staging should be a priority for defined contribution funds. “In contrast to a defined benefit fund, where the employer carries the risk; under a defined contribution structure, the member carries the full investment risk. Members of defined contribution funds therefore need to place significant importance on investment management and ensure that their guaranteed income until death, and the price paid for a life annuity depends heavily on interest rates. As such, any drastic interest rate changes close to retirement could significantly impact on the level of income secured for life,” said Birt. trustees provide them with a range of solutions to cater for a wide spectrum of needs.” “A well-designed life-staging model should take into account the risk appetite of members during different phases of their working life, as well as the financial needs of members after they have retired.” At the other extreme, there are those members who opt for a living annuity at retirement. “With a living annuity, the individual decides on the level of income they need to draw down every year from an investment fund chosen based on their risk appetite. In contrast to life annuities, these members take on the risk of potentially running out of their savings pool before death. As such, taking on some investment risk to increase the likelihood of favourable returns on those investments is a consideration. As a result, these members will probably place less value on completely avoiding stock market losses, as recoveries in losses after retirement are fairly likely for them. Riskier investments are likely to be considered, although these members are still likely to desire their return each year to at least meet the minimum living annuity drawdown rate of 2.5 per cent,” he added. April 2011 According to Birt, a good example of a portfolio that caters for individual risk appetites is the Old Mutual Absolute Growth Portfolio, which invests a significant proportion (80 per cent) of its underlying portfolio in ‘growth’ assets, including equities, direct property and private equity. However, the portfolio gradually distributes returns to members over time, thereby removing 80 per cent of the volatility in returns associated with such a risky underlying portfolio. In addition, the portfolio is flexible in terms of whether a guarantee is provided, and at what level, depending on a member’s risk appetite. With such a portfolio design, younger members benefit from an aggressive underlying portfolio with low volatility risk, but would probably opt for a very low guarantee while it is not required. Members closer to retirement can simply ratchet up the guarantee to as much as 100 per cent of capital and returns to fully protect accumulated savings, while retaining the same growth focus of the underlying portfolio. This should promote savings at return levels above cash when equity markets perform. Regulatory Developments - Patrick Bracher HOW THE CONSUMER PROTECTION ACT WILL AFFECT FSPs Patrick Bracher | director: Deneys Reitz T he Consumer Protection Act does not apply to advice that is subject to regulation in terms of the FAIS Act. While this will be a relief to financial services providers who are already heavily regulated under the FAIS Act, the limitations of this exemption must be appreciated because FSPs do not escape the attention of the Consumer Protection Act entirely. consumer. Every ad and all promotional material will have to be examined for fairness, honesty and accuracy. No potential clients may be discriminated against unfairly and irrational redlining or unfair selectivity of clients will not be allowed. Two fundamental things must be borne in mind. The CPA protects only individuals (all individuals) and small businesses with assets or annual turnover of less than R3 million and applies only to a transaction occurring within South Africa for a consideration (virtually any quid pro quo) in the course of a business continually carried on. Secondly, limitations will be narrowly construed and the consumer gets the greatest possible protection. services will find that if they There are many things that FSPs do that is not exempted advice subject to the FAIS Act. Advice is just one of the services provided by FSPs. In addition to advice, FSPs provide intermediary services that relate to entering into policies, dealing in financial products, collecting or accounting for premiums and dealing with claims. The binder obligations under the new binder regulations will relate to entering into policies, determining policy limits and conditions, and settling claims. There will also be administrative services performed which do not fall within the concept of advice under the FAIS Act. There are major limitations on direct marketing. Initially these will be limited to a prohibition on junk mail or electronic, voice or other communications to consumers at their homes after hours in the week and for most of the weekend. Eventually there will be a register where consumers can register their wish not to be bothered by specified direct marketing and that direct marketing cannot be made to those consumers. If there is a direct marketing approach to a consumer that results in a sale, the consumer will have a five-day cooling-off period to cancel the transaction. All these services will be subject to the Consumer Protection Act. Protection is given to the consumer from the first promotion of any transaction (for example advertising, or promoting a product or services on a website) down to the finalisation of the transaction. Services may be marketed in a way which is not misleading, unfair or deceptive to the “Suppliers of goods and carry out their business carefully and with integrity, they will not fall into the jaws of non-compliance and end up before the commissioner.” Negative option marketing where a transaction comes into being if the consumer does not say no will be prohibited. Promotional competitions will be severely limited so that they cannot be profit-making schemes. When the regulations are finalised there will be a list of over 30 contractual terms that may not be in a consumer contract. Some of these are familiar terms regarding pre-contractual April 2011 representations, shifting of risk or responsibility, and rights of assignment. All contracts with individual consumers and small businesses will have to be checked to see that there are no void provisions in the documents. A contract may not be unfair to the consumer and even the price of a service is subject to the ultimate testing in a court as to its reasonableness. The consumer is entitled to demand quality service. This means that the services must be performed on time unless notice is given of any unavoidable delay. Services must be performed in a manner and quality that persons are “generally entitled to expect”. This is not a stringent test but it does mean that below par services may have to be performed aagain or the consumer may have to be refunded where there is poor performance by the FSP. Intermediary and administrative services will be subject to consumer protection in this regard. There are many other ways in which the CPA affects all of us. If you arrange an end-of-year party and the people are expected to pay, the act will govern the event. Goods include information, data and software which will therefore be distributed with implied warranties of quality. The simplest disclaimer in your parking lot (Enter at your own risk) will be subject to the CPA. All disclaimers have to be clear, in plain language and with details of the nature and effect of the risk being assumed. The Consumer Protection Act has many provisions that affect every one of us on a daily basis as suppliers and consumers. Everyone needs to take the legislation seriously and to ensure that their business practices are compliant. In many respects, suppliers of goods and services will find that if they carry out their business carefully and with integrity, they will not fall into the jaws of non-compliance and end up before the commissioner. 33 ASSET MANAGEMENT a gamble for investors? 34 April 2011 R ecent months have seen both investors and investment publications advocating the benefits of investing offshore. According to Leon Campher, CEO of the Association for Savings and Investment South Africa (ASISA), the reason most often mentioned for wanting to invest offshore is the Rand/Dollar exchange rate. “When the Rand is strong, there is usually a lot of noise about offshore diversification and when the Rand is weak, the appetite for offshore investing wanes.” “On 1 March this year, one Dollar was worth around R6.69. On 14 February, one Dollar was worth R7.31. And back in 2001, one Dollar was worth a whopping R13.84. My point is that it is impossible to call the exchange rate. Therefore, taking a far-reaching investment decision based on future views of the value of the Rand is akin to gambling,” said Campher. He advised that if clients decide to invest offshore, it needs to be done for the right reasons, not only because the Rand is strong. “You need to make sure that it is part of a long-term diversification strategy and that you are likely to benefit from this investment even if the currency does not weaken.” “Equally, the appropriate level of offshore exposure, as well as the markets that you pick, should be guided by your long-term investment objectives ... you need to consider your investment goals and all the risks involved when compiling your offshore portfolio. But most importantly, you need to commit to the chosen strategy irrespective of short-term market and currency fluctuations.” Campher said that in 2010, many investors felt compelled to invest offshore simply because the Rand was strong, not taking into consideration that most of the offshore markets took exceptional strain. This year developing markets experienced increased volatility, and combined with the strong Rand, many investors saw this as their cue to go offshore. He believes that for the majority of South African investors, the domestic market continues to offer plenty of opportunities. “I maintain that for most investors going offshore has not made sense for the past five years. This has not changed. South Africa continues to offers investors a stable and well-regulated investment environment with plenty of opportunity for good capital returns over the long term.” “When picking a destination for your money, you should consider a wellregulated market that is drawing interest from beyond its own borders. This is certainly true for South Africa,” said Campher. One company that does believe it is a good idea to take advantage of the Rand strength is Stonehage Property Partners, which says the currency level, combined with historically low international property prices and relaxed exchange controls, make this a good time for South African investors to look overseas to diversify their property portfolios. That is the view of Eric Fisher, director of Stonehage Property Partners in London, who said that there are good opportunities to invest in various classes of property abroad. “With prices significantly down from their highs and property markets in many countries at an inflection point, foreign property purchases continue to be an effective hedge against currency risks.” According to Stonehage, South African residents are permitted to invest in a holiday home or farm in any country that is part of the SADC, or to acquire any other investment property abroad without having to make sure of their foreign investment allowance. Since Finance Minister Pravin Gordhan announced a relaxation in foreign exchange controls to allow investors to invest up to R4 million a year offshore, however, this allowance is perhaps no longer as attractive as it once was. “South African residents are permitted to invest in a holiday home or farm in any country that is part of the SADC, or to acquire any other investment property abroad without having to make sure of their foreign investment allowance.” Herberg noted, however, that certain of the SADC countries like Mauritius and Seychelles have an added attraction for South African investors as residence is offered where property is acquired through certain approved projects. Jamie Boyes, analyst at listed property fund manager, Catalyst Fund Managers, said investing in physical offshore property can be difficult for South Africans to do unless they can get some scale behind them as they will often not be first in the queue when the good deals come up. “In fact, there is a risk, especially in the current environment that an investor could end up buying assets that no-one else wants. Offshore listed property is still a reasonable investment; however, the easy money has already been made.” Boyes added that the important thing for South African investors wanting to diversify into property to remember is that listed property is highly liquid. “People are now beginning to understand the importance of liquidity in an investment class. Historically, they haven’t done this; but when investors couldn’t get cash out during the recent crisis, people finally understood the importance of liquidity. “Offshore listed property can also provide a great way to bring diversification into a portfolio. You can gain exposure to the US, Europe, Asia, as well as all sectors (industrial, office, retail, etc). It also provides a hedge against currency fluctuations.” April 2011 35 ECONOMICS Rand weakens but focus remains on unrest in EMEA region Adenaan Hardien | Chief Economist: Cadiz Asset Management T he strength of the Rand, and the successive cuts in the repo rate that followed in consequence, were the key features on the local economic front in 2010. The Rand gained 12.0 per cent on a trade-weighted basis, 11.3 per cent against the Dollar, 20.2 per cent against the Euro and 16.0 per cent against the Pound. The local currency started 2011 on the back foot however, losing more than nine per cent on a trade-weighted basis by the first week of February. The weakness was driven by a number of factors, including some flight to quality, certain local financial institutions increasing their offshore exposure and Reserve Bank accumulation of reserves. The initial flight to quality was driven by geopolitical events in the Middle East. By the end of February, the Rand had made up some of its earlier losses, closing down 6.3 per cent on a trade weighted basis compared with its level at the end of 2010. The gains over the latter part of February were driven by Euro strength following political uncertainty in the US, and a flight out of the Turkish Lira into the Rand. The Turkish currency was traditionally seen as relatively safe, but its proximity to the Middle East has made some investors nervous. On the policy front, things started off on a quiet note, with the Reserve Bank Monetary Policy Committee leaving the repo rate unchanged at 5.5 per cent at the end of its first meeting of the year on 20 January. The decision was expected. 36 The Reserve Bank has cut the repo rate by a cumulative 6.5 per cent since the rate cutting cycle started in December 2008. While the bank expects inflation to remain within its target band, it highlighted a number of upside risks including higher commodity prices more generally, and oil and food prices specifically, sticky administered prices and high wage settlements. The bank forecasts consumer inflation averaging 4.6 per cent in 2011 (revised from 4.3 per cent) and 5.3 per cent in 2012 (revised from 4.8 per cent). A higher oil price was the key reason for the upward adjustment. The Rand’s weakness (compared with the end of last year) and increased volatility and record global commodity prices have sparked renewed inflation fears, despite low published inflation figures. “The Rand’s weakness (compared with the end of last year) and increased volatility and record global commodity prices have sparked renewed inflation fears, despite low published inflation figures.” We expect consumer inflation to average above five per cent from the third quarter. This forecast does not incorporate the most recent spikes in oil prices. If sustained, recent increases in the oil price may be enough to push consumer inflation above the three to six per cent target range by year-end. Other data releases over the first two months of 2011 generally showed production and sales stronger in the final quarter of 2010 and the first month of 2011. Stats SA’s publication of supplyside GDP figures for the fourth quarter showed that economic activity picked up pace over the fourth quarter, as the dampening impact of strike activity in the third quarter dissipated and tertiary April 2011 sectors continued to benefit from recovering demand. Real GDP expanded at an annualised rate of 4.4 per cent over the quarter, following growth of 2.7 per cent over the third quarter. While all sectors posted positive performances over the final quarter of 2010, the swing in manufacturing output and stronger performances from tertiary sectors lay behind the improvement in overall growth. Given increasing concerns about the inflationary impact of high commodity prices and some signs of overheating in certain emerging economies, we maintain that their central banks will continue to lead the process of monetary policy normalisation. From a global perspective, we expect businesses to gradually expand their payrolls during 2011, reducing unemployment and boosting household incomes, which will encourage consumer spending. Even though authorities in some advanced economies will implement additional reflationary measures to boost growth, their impact will be limited. First, policymakers have largely exhausted their reflationary ammunition. Second, financial markets are sceptical about the value of further measures. Nevertheless, the global economy’s recent difficulties are temporary and are unlikely to derail the expansion. Unfolding events in the Middle East and North Africa (MENA) region do, however, complicate the outlook. These events represent nothing short of a reshaping of the region, with major mediumto long-term consequences. Over the short term, these events pose significant risks to global inflation and growth, with oil prices already some 20 per cent up on their levels at the end of 2010. How monetary policy responds to these conflicting challenges is not immediately clear but will be a key factor to watch in the months ahead. ALTERNATIVE INVESTMENTS Hedge funds outperform in the long term D espite perceptions that hedge funds are a risky investment, the latest Blue Ink All South African Hedge Fund Composite (BIC) published by the hedge fund of fund manager, has shown that in fact hedge funds outperformed the All Share Index (ALSI) by almost 10 per cent over a three-year period between 1 January 2008 and 31 December 2010. The composite, which tracks the performance of around 100 hedge funds in South Africa, found that investors who stuck with hedge funds earned total returns of 30.28 per cent versus 20.60 per cent from equities. “The three-year total return from hedge funds illustrates the protection these funds offer during periods of stock market turmoil,” said Eben Karsten, portfolio manager at Blue Ink Investments. “This is largely because hedge fund managers have more room to manoeuvre than their long-only peers.” The ALSI three-year return was weighed down by a 23.23 per cent decline in local equities in 2008. “It’s exactly this kind of downside risk investors avoid by going the hedge fund route,” he said. Returns from hedge funds, JSE All Share Index and cash to 31 December 2010 Hedge funds JSE All Share Index Cash Three months total return to 31 December 2010 2.25% 9.47% 1.56% One year total return to 31 December 2010 9.79% (1.86%) 18.98% (17.66%) 6.92% (0.12%) Three year total return to 31 December 2010 30.28% (3.44%) 20.69 (22.30%) 30.34% (0.59%) * Volatility in brackets The fixed income category topped the 2010 hedge fund performance tables, with an average per-fund return of 21.10 per cent (with volatility of just 3.20 per cent) for the year. “Fixed interest strategies benefited from monetary accommodation – particularly the second round of quantitative easing – through 2010,” added Karsten. He said managers in the fixed income space took full advantage of the fragile global economic recovery and low interest rates in the US. Karsten explained: “The large differential between interest rates in G10 countries versus those in emerging markets triggered a flood of foreign capital inflows to South Africa’s bond market – benefiting funds with fixed interest strategies.” The BIC showed that local hedge funds returned 9.79 per cent for 2010, compared to the 18.98 per cent produced by the All Share Index (ALSI). The ALSI return was achieved with a volatility of 17.66 per cent versus the 1.86 per cent hedge fund average. Private equity firm upbeat on Africa A frica has plenty of growth ahead, according to one international private equity firm. In an interview with Reuters, Washington-based Emerging Capital Partners (ECP) said the continent offers plenty of scope for private equity investments. The group said it expects at least another decade of strong growth expected from consumer goods, broadband Internet and financial services. “I can assure you there’s no bubble in Africa at the moment. Every guy in the elevator’s not pitching a deal here yet,” said ECP co-chief executive Hurley Doddy. Doddy also noted that the return of rising food prices has turned attention back to Africa’s agriculture industry with a big uptake in people looking at the investment potential of agri-businesses on the continent. This was backed up late last year by Agri-Vie, the private equity fund focused on food and agribusiness investments in sub-Saharan Africa, which announced the final close of its first fund after attracting investments of $110 million (approximately R770 million), 10 per cent higher than originally anticipated. Herman Marais, chief executive at Agri-Vie, said the oversubscription in the current economic climate demonstrates the appetite for such investments, resulting in the group already planning a follow-up fund in the future. “We anticipate launching a followon private equity fund with the same mandate to invest in food and agribusiness in Africa. Given the success we have seen, we would expect this fund to be larger in size and to venture into central parts of Africa, as well as South and Eastern Africa.” The fund was initiated by SP-aktif and Sanlam Private Equity, to capitalise on the growing markets for processed food in the major cities of Africa as well as export opportunities. April 2011 37 BLUE INK INVESTMENTS Blue Ink Investments honoured at hedge fund L industry awards eading South African manager of fund of hedge funds, Blue Ink Investments (Blue Ink) – part of Sanlam Investments’ hedge fund cluster – walked away with the only two awards for Hedge Fund of Funds at this year’s annual HedgeNews Africa Awards. The awards are based on the best risk-adjusted returns generated during 2010 by signature role-players in the South African and African-based hedge fund industry across 10 distinct categories. The company was awarded in the categories Best Fund of Funds Award for the Blue Ink Fixed Income Arbitrage Fund and Long-term Performance Fund of Funds Award for the Blue Ink-ubator Diversified Fund. This is second consecutive year that the Blue Ink-ubator Diversified Fund has been honoured at the awards. “The Blue Ink Fixed Income Arbitrage Fund consists of the top fixed income hedge fund managers in South Africa. The award is testament to our belief that fixed income hedge fund managers can achieve success in either an interest rate hiking or cutting period, as they have proved in the past,” said Thomas Schlebusch, CEO of Blue Ink Investments. The Blue Ink Fixed Income Arbitrage Fund, which is aimed at high-net worth individuals or institutions with a risk appetite in the region of cash plus three per cent, posted a total gain of 24.23 per cent (after all fees). Schlebusch said that the fund is most suitable for investors that have an allocation to fixed income as an asset class and need to add some diversification to their portfolio. “According to our research, the average South African single strategy hedge fund posted gains of 9.79 per cent last year.” Schlebusch added that the Blue Ink- 38 Eben Karsten, Portfolio Manager and Thomas Schlebusch, CEO at Blue Ink Investments ubator Diversified Fund, which is aimed at investing in high-calibre early stage managers with varying strategies, posted a total gain of 13.74 per cent (after all fees) in 2010. “The fund was launched in September 2007, just as the financial crisis began to impact on equity markets. The award recognises the successful investment strategies employed by the early stage fund managers in which we invested.” He explained that the Blue Ink-ubator Diversified Fund aimed to pioneer a new investment strategy in the South African hedge fund space by identifying new fund manager talent, particularly those pursuing alternative strategies. “Research has shown that most funds typically have the best returns in the early years, while the ideas are still new and the capital being managed is small. This fund is proving to April 2011 be increasingly popular among investors, particularly institutional investors.” Schlebusch expects another strong year for the hedge fund industry in 2011, “We are particularly positive with regard to the proposed new Regulation 28. The draft release of the regulation states that hedge funds will be allowed an allocation from pension funds up to ten per cent. This is a vast improvement on the 2.5 per cent allowed previously. “We believe that if the final regulation is this favourable, we will see a great deal more appetite from institutions. The history of the hedge fund industry in South Africa shows that the product is well suited for long-term stable investment with decent growth.” INDUSTRY NEWS PRODUCTS Standard Bank flexes muscle with commodity ETNs Standard Bank has said that its Commodity Linked Exchange Traded Notes, which the company launched in August last year, have shown strong growth with its precious metals suite of platinum, palladium, gold and silver linkers delivering growth rates of between 12 per cent and 72 per cent since the launch in August. The company says the new commodity linkers have provided an excellent vehicle for customers to diversify their portfolios and grow their capital wealth, by providing investors with access to an investable form of direct commodity exposure in a liquid and cost-effective manner. “Commodities have the highest positive correlation with inflation when compared with that of equities and bonds. In order to take advantage of the benefits that commodities offer, investors need an investment vehicle that is cost-effective, liquid and transparent. Standard Bank Commodity-Linkers fill this gap,” said the company. Glacier by Sanlam launches new structured product Glacier has launched a new structured product, the Secure Equity Note (SEN) sinking fund policy, underwritten by Channel Life Limited. The SEN offers the investor capital preservation, together with participation in the growth of the index. The minimum investment amount is R500 000 Standard Bank’s palladium linkers have given and the product has a minimum term of five investor returns of just over 70 per cent in the years. last six months, with its silver linkers returning more than 60 per cent in the last six months. Duane Littler, a product manager at Glacier, Platinum linkers yielded returns of just over 18 said that the product is targeted at the slightly per cent and gold just over 12 per cent since more conservative equity investor requiring August 2010. capital preservation. A5 Ad.FH11 Tue Mar 01 11:50:28 2011 Page 3 C ����������������� ���������� Composite M Y CM MY Renaissance Capital moves into iSpace Emerging market investment bank Renaissance Capital has launched RenCapApp, the company’s research application, which gives Apple’s iPad and iPhone users full access to Renaissance’s research. Developed with worldflow Research, the RenCapApp makes Renaissance’s entire research library available through the iPad and iPhone and delivers daily updates from Renaissance’s analysts and economists. “As an emerging market research leader, we are proud to lead in technology as well,” said David Nangle, head of equity research at Renaissance Capital. “The delivery of our award-winning research to our clients and other subscribers on the iPad and iPhone will make it easier to access our in-depth, on-the-ground research practically anywhere.” CY CMY K INDUSTRY NEWS Appointments Novare, the specialist emerging markets financial services company, has announced the appointment of Marius Kilian as chief executive of Novare Investments with effect from 1 March 2011. Kilian succeeds Derrick Roper, who has been appointed chief executive of Novare Equity Partners, focusing on the group’s businesses outside of South Africa. Maitland, the wealth manager and fund administrator, has appointed Thomas Linklater as a wealth manager from 1 March 2011. Linklater has 25 years’ experience within portfolio and wealth management and joins the company’s Johannesburg team offering legal, fiduciary, wealth management and fund services to private and corporate clients. Standard Bank’s stockbroking division, SBG Securities, is concentrating on growing its research and sales arms with several key appointments including Ross Elliot, who has joined from JP Morgan to head up equity sales and assume responsibility for marketing local products to a broader European investor base. Two BEE property funds to launch in 2011 South Africa’s investment fraternity will soon have two new BEE property funds to choose from with the launch of two new property funds run by black-owned management companies in 2011, both of which will be backed by Old Mutual Investment Group Property Investments (OMIGPI). Firstly, Neo Africa Properties (Pty) Ltd is developing a fund of commercial properties leased to the government that will meet the Department of Public Works’ broad-based black economic empowerment (BBBEE) policy for ownership. 40 Secondly, the Urban Growth Fund will comprise property investments that incorporate the core principles of responsible investment. Fund investments will include urban regeneration, township developments, investments in health and education facilities and green buildings. According to managing director Ben Kodisang, OMIGPI, which is rated as a level 2 BBBEE contributor, will have a minority interest in both management companies. April 2011 “OMIGPI views this as the ideal way to transfer skills to the property industry in line with the requirements of the Property Charter,” said Kodisang. “By collaborating with these select partners to set up these initiatives, we are pioneers in promoting the expansion of asset management capability that will ultimately benefit the broader industry.” actis wins top African award again Actis, a leading private equity investor in emerging markets, was named African Private Equity Firm of the Year for the fourth consecutive year by Private Equity International (PEI) magazine. The award is voted for by investors, advisers, investee companies and other stakeholders. During 2010, Actis consolidated its leading position on the African continent: Actis’s pan- African payments processing platform EMPH invested in Egyptian company MSCC; and Actis made an US$151 million investment in the Vlisco Group, a producer of designer wax fashion fabrics for the West African market. role in Actis’s emerging market story, and the fact that our work has been publicly recognised by investors, advisers and portfolio company management teams is deeply humbling.” “To receive this award for the fourth consecutive year is an immense honour for the whole Africa team,” said Peter Schmid, Actis’s head of Africa. “Africa plays a crucial Actis was also awarded Latin American Private Equity Firm of the Year 2010 by PEI, reflecting a trio of deals executed in Brazil last year. PSG elbows into corporate market with new division PSG Konsult, the financial services company that has been busy pushing into new markets over the last year with the launch of PSG Online and other ventures, has announced another new initiative, this time with the aim of marching into the corporate market. The company, PSG Konsult Corporate, specialises in the employee health insurance and employee benefits space and also has an institutional stockbroking desk, with plans for a commercial short-term insurance business also currently in a development phase. Willem Theron, CEO at PSG Konsult, said the shaping of PSG Konsult Corporate began just over two years ago. “Since then, membership in our comprehensive range of employee benefits and healthcare benefits has increased significantly from around 14 000 to 100 000 families.” Winner of FLPI Competition announced At the end of 2010, INVESTSA ran a competition for one reader to win a year’s free subscription (worth R15 000) to the South African Financial Life Planning Institute (FLPI). The South African FLPI was launched as part of an initiative to assist financial planners and advisers, many of whose practices have been hard hit by the recession and tighter legislation governing the industry. Kim Potgieter, Managing Director of the FLPI, says the purpose of Financial Life Planning is the belief that advisers should first discover a client’s core life goals before devising a financial plan so that the plan is created to support these goals. “The best financial advisers have always looked at the bigger picture when it comes to developing financial plans for their clients by delving into a client’s relationships, life stage, health and anticipated life transitions.” We are pleased to announce that Lisa Griffiths of En Avant Financial Services in Cape Town won the draw. She wins full access to all of the institute’s computer programmes, tools and support. Kim Potgieter | Managing Director of the FLPI The SA FLPI offers various tools for an unlimited number of clients. Financial advisors can customise and brand all the tools with their practice name and details, providing advisers with the tools they need to develop stronger client relationships. For more information on the FLPI contact Kim Potgieter at info@flpi.co.za or visit. April 2011 41 we make over 2 536 beds daily we manage 26 proper ties we're 2 years old but this year . . . . . w e a r e g o i n g B I G ! 24 Hour Reservations: 0861 238 252 42 April 2011 BAROMETER South Africa rating upgraded While many developed countries struggle with their sovereign debt crises, Roland Cooper, Africa director of ratings agency Fitch, said South Africa’s sovereign rating, which was revised upwards to stable from negative in January, could improve even further over the long term. “South Africa is currently on a positive outlook and we’re very happy with it.” FNB Wealth is rated top class The 2011 Euromoney Private Banking Survey ranked FNB Wealth as the best private banking services provider overall for South Africa and Africa. The survey is conducted annually and provides a qualitative and quantitative review of the best services in private banking for Africa by region and by areas of service. R20-billion pension win for Numsa The National Union of Metalworkers of SA has won a 10-year struggle with the Steel and Engineering Industry Federation of SA to receive up to R20 billion in pension surplus funds for workers and retired workers in the metal and engineering sector. The Financial Services Board stated this is believed to be the largest pension fund surplus ever distributed. set cord h e r s ort iou prev ion in N the s n g e n t i of ass ack surp he b 11, t 0 n 2 o y ruar cked f Feb backtra o 4 x he 1 e inde pe. on t h Euro nd t ints a o n i , p r s isi long 334.55 howeve bt cr for 33 ng, n de not f g o i l t o e t u r b high idn’t las sove high ord the d out cord ed a rec timent b e r a s n hits e se cern each hare Index r 008. Th ing con S l l FirstRand latest to fall foul of JSE rules o e ar sA n2 ng JSE’ E All Sh rs ago i nd o a After a similar bungle by Absa last year, fellow n S a J pa e ye The in Ja thre e banking stock FirstRand also fell foul of the JSE’s k y l a r qu nea , the rules when its interim financial results appeared a c i r Af on its website a day earlier than planned. Reuters, who published a summary of the results, said the information was accessed via a circular sent out by FirstRand. South Africa set to blow up like Libya UK hedge fund Toscafund has warned that South Africa is flawed and set to “blow up” within the next 15 years with more serious consequences than Libya. The group’s chief economist and partner, Savvas Savouri, cited emigration of professional workers, and a lack of centralised leadership when dealing with problems such as the Aids epidemic. Shaik returned to prison after alleged assaults Convicted fraudster Schabir Shaik was briefly returned to prison after he made the headlines twice following two alleged assaults. The first, involving a Sunday Tribune journalist, occurred on a Durban golf course, and two weeks later, Shaik was reported to have attacked a man at a Durban mosque. April 2011 43 Snippets | THE WORLD US urges banks to defer bonuses Top executives at financial companies with $50 billion or more in assets, including Bank of America, JPMorgan Chase, Goldman Sachs Group and Morgan Stanley, have been asked to defer half their bonuses for the next three years. The request, intended to curb risk, comes from the Federal Deposit Insurance Corporation. a US Government agency that ensures the safety of deposits in members’ banks. UN Security Council bans Gaddafi United Nations Security Council voted 15-0 to freeze Libyan leader Muammar Gaddafi’s assets and ban travel in an effort to stop his attacks on protesters. An arms embargo has also been placed on Libya and an investigation into crimes against humanity has been opened. International Monetary Fund before Europe’s debt crisis is agreed at a summit. Pension fund changes afoot in EU The European Court of Justice is set to rule on whether pension schemes may be exempted from paying VAT on some fund manager fees after a case was brought by the National Association of Pension Funds (NAPF). A favourable decision could see costs cut by as much as £100 million a year for pension funds. UK financial services job vacancies jump by 11 per cent Job vacancies in financial services in the UK have increased by 11 per cent after employees left their previous roles to seek positions at alternate companies after this year’s bonus round, according to UK recruitment agency Astbury Marsden. This follows the European Union’s approval of new laws to restrict guaranteed bonuses and up-front cash payments for bank’s propriety traders. Credit Suisse banker refuses to co-operate Emanuel Agustoni, one of four bankers from Credit Suisse who is accused of conspiracy to help American tax cheats, has said he will not assist US authorities. He has refused to name any of his clients involved in hiding up to $3 billion (R21 billion) from the International Revenue Service. Barclays bonuses down seven per cent; CEO gets £10 million The UK’s third largest bank, Barclays, owner of Absa, reduced the bonuses of staff by seven per cent compared with 2009 following a government-brokered deal to clamp down on excessive pay. However, the bank gave its CEO Robert Diamond as much as £10.1 million in salary, bonuses and stock, making him the highest paid bank CEO in the UK. 44 Japanese earthquake shifts Earth on its axis Japan was devastated by a massive earthquake measuring 9 on the Richter Scale in March, causing a tsunami that resulted in devastation for the country. As many as 10 000 people were feared dead in the days following the quake and a risk analysis firm estimated the economic impact could be as much as $35 billion. Earthquake has not broken New Zealand spirit New Zealand was devastated by a massive tremor in Christchurch in February that was said to be the worst tragedy to hit the country in 80 years. Over 160 victims have so far been identified with more than 100 people still listed as missing. New leaders to save Ireland from debt Ireland’s recently appointed leader Enda Kenny is faced with the challenge of renegotiating the terms of the country’s €85 billion bail-out with European partners or risk the collapse of the Irish economy. Kenny has just four weeks from his instatement to resolve the issue with the European Union and April 2011 Canadians forced to carry on working Most Canadians now expect to retire much later than originally planned as a result of the recent recession and a fragile recovering economy. A study by the Canadian Association of Retired Persons has shown that most Canadians expect to retire at 68. A year ago, the same study showed that most Canadians expected to retire at 65. AND NOW FOR SOMETHING COMPLETELY DIFFERENT How did the recession affect pro sports teams globally? Many sporting teams have suffered downturns in revenue and valuation in the past couple of years. In the wake of the financial crisis, however, for the richest franchises life still appears to be good. We take you through the list of some of the most valuable sports teams in the world. Manchester United Football Club – $1.87 billion Manchester United, the English Premier League soccer powerhouse, which boasts a worldwide fan base, is the most valuable football club in the world. This is probably due to the team’s 18 league titles, four Football League Cups and 11 Football Association Challenge Cups, as well as the skills of legendary players like Sir Bobby Charlton, Cristiano Ronaldo and Wayne Rooney. Man-U’s valuation grew four per cent to $1.87 billion between April 2008 and April 2009 on a nine per cent increase in revenue. Dallas Cowboys – $1.8 Most Valuable Player Awards (MVP) Chuck Howley, Troy Aikman and Emmitt Smith. Washington Redskins – $1.55 billion According to Forbes, the Redskins have lost 55 per cent of their games and made the playoffs only three times since Dan Snyder bought the team in 1999. But this hasn’t stopped fans from flocking to FedEx Field and making the Redskins the NFL’s most profitable team in recent years. Two-time Super Bowl winner, Mike Shanahan, is the seventh Redskins coach since Snyder bought the team. He signed a five-year deal worth $7 million annually in January 2010. New York Yankees – $1.6 billion In baseball, only the New York Yankees reside in the billionaire’s club.The team has a long and storied history as a team that produces legendary players. According to the first Annual Review of Global Sports Salaries, written for sportsintelligence.com, the average Yankees player made £89 897 a week in 2009, or £4.7 million annually. The Yankees were paid so much that they had to pay $23 million luxury tax to Major League Baseball. April 2011 45 THEY SAID... A selection of some of the best homegrown and and international quotes that we have found over the last four weeks. “All my people love me.” Muammar Gaddafi, Libyan leader on the state of the Libyan nation during the anti-Gaddafi uprising which began on 15 February 2011. “Taking a far-reaching investment decision based on future views of the value of the Rand is akin to gambling.” Leon Campher, CEO at the Association for Savings and Investment South Africa (ASISA). “If the matric results are bad, this is taken as proof that this government of darkies is incapable. If the pass rate goes up, it means the results have been manipulated by these darkies.” Blade Nzimande, Higher Education and Training Minister during the debate of the State of the Nation address in the National Assembly which prompted the Democratic Alliance to insist on his resignation. “We’ve had two years of the best inflows ever. The odds are stacked against it from here ... [it] could depreciate a lot further.” John Biccard, portfolio manager at Investec Asset Management warns against the effect of the reversal of foreign inflows as developing economies lose their price advantage over US and European markets. 46 “Short memories are very dangerous. Have we forgotten that two years ago we were in a crisis?” Finance Minister Pravin Gordhan, speaking in Johannesburg on why South Africans need to take a longer-term view of economic policy that focuses on growth rather than a short-term view of markets. “After a poor decade, nobody wants US equities. However, with the Rand looking expensive, this is where the opportunity lies. Valuations are attractive and we expect the economy to surprise on the upside as corporate profitability will drive job growth,” said Gail Daniel, portfolio manager at Investec Asset Management. “What Anglo does with the other 40 per cent is their business.” ANC Youth League president Julius Malema at a gala dinner in Nelspruit, after announcing he wants 60 per cent of Anglo American to be nationalised. He also predicted that the nationalisation of mines would “happen in my lifetime”. “We have an older generation of political leaders who don’t have the tools to deal with what is going on. There is no new generation of leaders.” William Gumede, associate professor of the Graduate School of Public Development at Wits University, who said many political initiatives on the continent are in disarray. ‘Following recent declines, we do not view emerging market equity markets as expensive. But given the large sums of money that has chased the asset class in the past year, coupled with lofty returns expectations ... now is not the time to be aggressively overweight emerging markets.” Tristan Hanson, head of Asset Allocation at Ashburton. Japanese Prime Minister Nauto Kan described the country’s earthquake, tsunami and nuclear situation as the ”biggest crisis Japan has encountered in the 65 years since the end of World War II.” 1 5 0 2 / LI FT/ B PF MEET THE FUTURE YOU. HE SAYS, “SMART MOvE FOR INvESTING YOUR MONEY WITH CORONATION.” Top Top Top Top Performing Performing Performing Performing Equity Fund. Balanced Fund. Retirement Income Fund. Immediate Income Fund. Over 3 years, 5 years and since launch. Coronation Top 20, Balanced Plus, Capital Plus and Strategic Income Funds 1st Quartile over 3 years, 5 years and since launch in their respective ASISA fund categories to 28 February 2011. Source: Morningstar. Coronation Asset Management (Pty) Ltd is an authorised financial services provider. Unit trusts are generally medium to long-term investments. The value of units may go up as well as down. Past performance is not necessarily an indication of the future. Unit trusts are traded at ruling prices and can engage in borrowing and scrip lending. Fund valuations take place at approximately 15H00 each business day and forward pricing is used. Performance is measured on NAV prices with income distribution reinvested & quoted after deduction of all costs incurred within the fund. Coronation is a full member of the Association of Savings & Investments SA.
https://issuu.com/cosa/docs/april_2011
CC-MAIN-2017-04
refinedweb
21,091
50.06
Hi deeee Ho again! ^_^ I was bugging you guys with my questions about creatin a class for handling files (to update my webpages). Well, I managed to create the class (class tiedosto), and implement most of the functions I needed in it Now I'm building main to actually utilize the class, and to actually update the files... In order to do that, I should create new tiedosto class object, corresponding to every single file of my pages. Constructor of my tiedosto-class takes paths and filenames as arguments. So I thought I'll do a txt file, containing paths and names of my files on separate lines, and then just make the program to read the paths and names from the file. Well, I tried to create new objects in a for loop... But I have problems in understanding how pointers work.. My goal was to have an array which each cell holds one object (or pointer to object..), so I could use the array[i] when I refer to a certain file. Am I making myself clear? Well, as I told, I have problems in understanding how pointers work in such cases.. So all help would be appreciated I'll post the code I have managed to produce this far below...I'll post the code I have managed to produce this far below... Code:#include <iostream> #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string.h> #include "tiedosto.h" using namespace::std; main(){ char *pagenames[250]; //arrays for filenames char *paths[250]; //arrays for paths int i=0,number_of_pages=0,lkm=0; FILE *readindex; // stream to read pagenames and paths from indexfile readindex=fopen("kotisivindex.txt","r"); //opens indexfile for reading while(feof(readindex)==0){ if(fgetc(readindex)=='\n'){ number_of_pages++; //if character that was read is '\n', increases number_of_pages. } } number_of_pages=number_of_pages/2; //because theres path in 1st. line, and name of the file in 2nd line. fclose(readindex); readindex=fopen("kotisivindex.txt","r"); for(i=0;i<number_of_pages;i++){ fgets(*paths[i],500,readindex); //stores paths in arrays fgets(*pagenames[i],500,readindex); //stores filenames in arrays tiedosto *pagefiles[i] = new tiedosto(pagenames[i],paths[i]); /*creates new object. constructor is "tiedosto(char filename[],char path[]); So pagenames and paths should be given as char arrays.*/ //ignore the rest, it I can make working on my own, and if I cant, then I'll ask again :p cout << "kasittelyssa " << (*pagefiles[i]).kokonimi << endl; lkm=*pagefiles[i].lisaa_loppuun("</LI>","\n"); cout << "</LI> " << lkm << " kappaletta" << endl; lkm=*pagefiles[i].lisaa_loppuun("</UL>","\n"); cout << "</UL> " << lkm << " kappaletta" << endl; lkm=*pagefiles[i].lisaa_loppuun("-->","\n"); cout << "--> " <<("<TABLE>","\n"); cout << "<TABLE> " << lkm << " kappaletta" << endl; lkm=*pagefiles[i].lisaa_loppuun("</TABLE>","\n"); cout << "</TABLE> " << lkm << " kappaletta" << endl; } }
http://cboard.cprogramming.com/cplusplus-programming/63952-pointers-arrays-declaring-objects-loop.html
CC-MAIN-2015-40
refinedweb
455
59.19
How to add support for SAM D51/Cortex M4? - Karl-Heinz K last edited by Hello, my name is Karl-Heinz and I discovered MySensor a few days ago. I am very impressed and would like to use it for all my sensors. I have 8bit and 32bit MCUs. My latest MCU is an SAM D51 (Adafruit Itsybitsy M4). I can use it when I make a minor modification to MySensors/hal/architecture/SAMD/MyHwSAMD.cpp. When I try to compile Arduino IDE throws an error, that ADC is not defined in this context -> uint16_t hwCPUVoltage() I have not much experience with programming. Therefore I commented all code lines in uint16_t hwCPUVoltage() and added hardcoded "return 3.3;" Then I can compile at least what I tested so far for the SAM D51. Of course this is not a solution. Therefore I would like to ask what is the proper way to modify MySensors for use with the Cortex M4 processors. Thanks a lot and keep the good work going!! Sincerely Karl-Heinz A (still incomplete but) less inelegant solution is to return FUNCTION_NOT_SUPPORTED; As is done for esp32 for example: - Karl-Heinz K last edited by Hallo Mikael, thank you for your hint. I modified the hwCPUVoltage() part of MyHwSAMD.cpp like this. It works for me. Maybe it is not the best solution, however. Sincerely Karl-Heinz uint16_t hwCPUVoltage() { #ifdef __SAMD51__ return FUNCTION_NOT_SUPPORTED; #else // disable ADC while (ADC->STATUS.bit.SYNCBUSY); ADC->CTRLA.bit.ENABLE = 0x00; // internal 1V reference (default) analogReference(AR_INTERNAL1V0); // 12 bit resolution (default) analogWriteResolution(12); // MUXp 0x1B = SCALEDIOVCC/4 => connected to Vcc ADC->INPUTCTRL.bit.MUXPOS = 0x1B ; // enable ADC while (ADC->STATUS.bit.SYNCBUSY); ADC->CTRLA.bit.ENABLE = 0x01; // start conversion while (ADC->STATUS.bit.SYNCBUSY); ADC->SWTRIG.bit.START = 1; // clear the Data Ready flag ADC->INTFLAG.bit.RESRDY = 1; // start conversion again, since The first conversion after the reference is changed must not be used. while (ADC->STATUS.bit.SYNCBUSY); ADC->SWTRIG.bit.START = 1; // waiting for conversion to complete while (!ADC->INTFLAG.bit.RESRDY); const uint32_t valueRead = ADC->RESULT.reg; // disable ADC while (ADC->STATUS.bit.SYNCBUSY); ADC->CTRLA.bit.ENABLE = 0x00; return valueRead * 4; #endif }
https://forum.mysensors.org/topic/9708/how-to-add-support-for-sam-d51-cortex-m4
CC-MAIN-2018-47
refinedweb
364
51.44
Summary This article outlines troubleshooting advice for using serial communications in Microsoft QuickBasic versions 4.0, 4.0b, and 4.5, in Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS and MS OS/2, and in Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1. This article gives a sample OPEN COM statement that should work correctly. Additional communications troubleshooting hints are also given. For a related article, see the following article in the Microsoft Knowledge Base: This article gives a sample OPEN COM statement that should work correctly. Additional communications troubleshooting hints are also given. For a related article, see the following article in the Microsoft Knowledge Base: More Information If you have problems using "COM1:" or "COM2:", try the following OPEN statement, which makes Basic as tolerant as possible of hardware-related problems: The following are additional important hints for troubleshooting communications problems: Many commercial communications programs use sophisticated techniques not found in Microsoft Basic and may give better performance.: The following book gives an excellent technical, hardware-level description of serial communications for the IBM PC: OPEN "COM1:300,N,8,1,BIN,CD0,CS0,DS0,OP0,RS,TB2048,RB2048" AS #1(This OPEN is FOR RANDOM access.) The following is an explanation of each recommended parameter used in this OPEN statement: - The higher the baud rate, the greater the chances for problems; thus, 300 baud is unlikely to give you problems. 2400 baud is the highest speed possible over most telephone lines, due to their limited high-frequency capability. 19,200 baud, which requires a direct wire connection, is most likely to cause problems. (Possible baud rates for QuickBasic are 75, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, and 19,200.) - Parity usually does not help you significantly; because of this, you should try No parity (N). For those devices that require parity, you should use the PE option (Parity Enable) in the OPEN COM statement, which is required to turn on parity checking. When the PE option turns on parity checking, a "Device I/O error" occurs if the two communicating programs have two different parities. (Parity can be Even, Odd, None, Space, or Mark). For example, a "Device I/O error" occurs when two programs try to talk to each other across a serial line using the following two different OPEN COM statements:and OPEN "COM1:1200,O,7,2,PE" FOR RANDOM AS #1If the PE option is removed from the OPEN COM statements above, no error message displays. OPEN "COM2:1200,E,7,2,PE" FOR RANDOM AS #2 - The above example uses 8 data bits and 1 stop bit. Eight data bits requires No parity (N), because of the size limit for Basic's communications data frame (10 bits). - The BIN (binary mode) is the default. Note: The ASC option does NOT support XON/XOFF protocol, and the XON and XOFF characters are passed without special handling. - Ignoring hardware handshaking often corrects many problems. Thus, if your application does not require handshaking, you should try turning off the following hardware line-checking:CD0 = Turns off time-out for Data Carrier Detect (DCD) line CS0 = Turns off time-out for Clear To Send (CTS) line DS0 = Turns off time-out for Data Set Ready (DSR) line OP0 = Turns off time-out for a successful OPEN - RS suppresses detection of Request To Send (RTS). - For buffer-related problems, try increasing the transmit and receive buffer sizes above the 512-byte default:TB2048 = Increases the transmit buffer size to 2048 bytesA larger receive buffer can help you work around Basic delays caused by statements like PAINT, which use the processor intensively. RB2048 = Increases the receive buffer size to 2048 bytes - You should use the INPUT$(x) function in conjunction with the LOC(n) function to receive all input from the communications device (where "x" is the number of characters returned by LOC(n), which is the number of characters in the input queue waiting to be read. "n" is the file number that you OPENed for "COM1:" or "COM2:"). Avoid using the INPUT#n statement to input from the communications port because INPUT#n waits for a carriage return (ASCII 13) character. Avoid using the GET#n statement for communications because GET#n waits for the buffer to fill (and buffer overrun could then occur). Also, avoid using the PUT#n statement for communications, and use the PRINT#n statement instead. For example, in QuickBasic 4.0b and 4.5, in Basic Compiler 6.0 and 6.0b, and in Basic PDS 7.0 and 7.1, using the PUT#n,,x$ syntax for sending a variable-length string variable as the third argument of the PUT#n statement sends an extra 2 bytes containing the string length before the actual string. These 2 length bytes sent to the communications port may confuse your receiving program if it is not designed to handle them. No length bytes are sent with PUT#n,,x$ in QuickBasic 4.0. (QuickBasic versions earlier than 4.0 don't offer the feature to use a variable as the third argument of the PUT#n statement.) - For an example of data communications, please refer to the TERMINAL.BAS sample program that comes on the release disk for QuickBasic versions 4.0, 4.0b, and 4.5, for Microsoft Basic Compiler versions 6.0 and 6.0b, and for Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1. Many communications problems may actually be due to inappropriate source code design and flow of control. - Many communications problems can only be shown on certain hardware configurations and are difficult to resolve or duplicate on other computers. We recommend experimenting with a direct connection (with a short null-modem cable) instead of with a phone/modem link between sender and receiver to isolate problems on a given configuration. - The wiring schemes for cables vary widely. Check the pin wiring on your cable. For direct cable connections, a long or high-resistance cable is more likely to give problems than a short, low-resistance cable. - If both "COM1:" and "COM2:" are open, "COM2:" will be serviced first. At high baud rates, "COM1:" can lose characters when competing for processor time with "COM2:". - Using the ON COM GOSUB statement instead of polling the LOC(n) function to detect communications input can sometimes work around timing or buffering problems caused by delays in Basic. Delays in Basic can be caused by string-space garbage collection, PAINT statements, or other operations that heavily use the processor. - Make certain that the appropriate hardware handshaking lines (i.e. CS, DS, CD, etc) are being checked by Basic. Although disabling these timeouts (setting the corresponding value in the Basic OPEN statement to zero) is useful for determining what lines your hardware uses, it should not be considered a general purpose method for establishing serial communications, since ignoring hardware handshaking may increase the possibility of a timing problem that could lead to a hang.: "C Programmer's Guide to Serial Communications" by Joe Campbell, published by Howard W. Sams & Company.QuickBasic 3.0, 4.0, 4.0b, and 4.5 implement communications by direct interrupts to the IRQ3 and IRQ4 input lines on the 8259 controller chip (instead of invoking ROM BIOS interrupts). The following book gives an excellent technical, hardware-level description of serial communications for the IBM PC: "8088 Assembler Language Programming: The IBM PC" Second Edition by Willen & Krantz, published by Howard W. Sams & Co. (1983, 1984). Pages 92-93, and Chapter 7 (Pages 166 to 188). Svojstva ID članka: 39342 - posljednja izmjena: 16. kol 2005. - verzija: 1
https://support.microsoft.com/hr-hr/help/39342/how-to-solve-common-quickbasic-communications-port-problems
CC-MAIN-2017-43
refinedweb
1,283
54.32
Public hangout and chat for load('data.csv', format='csv',validate=False), set_type("station", type ="string"), set_type("date",type="date",format="%m/%d/%Y"), set_type("time",type="time",format="%H:%M"), data: # cruise station date time lat lon cast pump_serial_num (string) (string) (date) (time) (number) (number) (string) (string) --- ---------- ---------- ---------- -------- ---------- ---------- ---------- ----------------- 1 FK160115 4 2016-01-19 20:00:00 10 204 MP01 12665-01 2 FK160115 4 2016-01-19 20:00:00 10 204 MP01 12665-02 @ZviBaratz Ultimately I believe the data is being stored on AWS in some S3 storage buckets. A single data package can contain many different resources. If it is a tabular data package, containing tabular data resources, those resources can contain references to each other (primary/foreign key relationships as in a database). If you're using a basic data package (not the more specialized tabular data package) which can contain arbitrary kinds of data resources, I guess one of those resources could itself be a data package. But I don't think this is the intended arrangement. That’s right @zaneselvans :smile: @zaneselvans If I have many tens of thousands of files, wouldn't that become a problem to manage using JSON? I am working with MRI data, which in its raw format is delivered as DICOM files. Each subject may have a few thousands of those created at a full scanning session. @ZviBaratz that should be fine. One question: are all these files different resources in one package or ... There is the NIfTI format, which is often used to share MRI data (there's a whole specification just for that called BIDS). The problem is that I am looking for a way to not only publish the data but also maintain a database of references, so that the querying, extraction, and piping of data is facilitated. This is a really interesting use case - please tell us more. When you say a database of references what exactly do you mean? @rufuspollock I mean a database that keeps references to that actual files. Some fields from the header that might be relevant to data aggregation in analyses etc. can also be saved for easy querying, but once you want the data itself (pixel data or a header field that's not included in the database schema), you have to read it from the DICOM file. Sorry for the slow reply @ZviBaratz! To answer your question I think you could a) pull out metadata and save into datapackage.json b) i’m understanding that you want to do specific post-processing on the data e.g. to generate all of the info for a particular scan. I’d be doing that with a separate workflow after storing the basic packages. @akariv , I have been looking through the dataflow tutorials that use custom functions and nested flows trying to figure out how I can use custom functions for one resource when there are many. For example, I have a row processor: def mycustomfcn(row): What I want to do is this in a flow specifying one resource: mycustomfcn(resouces='mclane_log') and be able to specify whether it is a package, row, or rows processor somehow. I can also do stuff directly in the flow like this but again, I can't figure out how to specify one resource if there are many. lambda row: dict(row, val=row['val']/5), def mycustomfcn(package): yield package.pkg resources = iter(package) for resource in resources: if resource.name == 'my-resource-name': # do stuff here Eg: yield filter(lambda row: (row['x'] in [1,2,3,4,5]), resource) else: # Deque others yield resource
https://gitter.im/datahubio/chat?at=5bf7f59c958fc53895d8a29f
CC-MAIN-2021-49
refinedweb
604
60.95
AK - Now this is a useful thing. Note that the documentation about directory notification [1 CL has a still-too-vague memory that much of this is possible in Windows, also. More on this, in time.Darren New I can't help too much, but the place to start with this on Windows is here: TWAPI has the begin_filesystem_monitor/cancel_filesystem_monitor functions to allow you to monitor file system changes by registering a callback. Like the rest of TWAPI, WIndoes NT 4.0 and later only. See [2] for an example. CmCc The idea for tclhttpd is to use directory notification to maintain a cache. .tml files can be transformed on-the-fly to .html by inspection at fetch-time by tclhttpd. However, I would like to experiment with something like Linux's kernel httpd, which doesn't transfer control to tclhttpd if the URL can be satisfied by static inspection of the directory tree. One possible solution, then, is to have tclhttpd monitor a directory for changes, and simply delete more-derived files. Thus kernel httpd would provoke tclhttpd to regenerate content.Another idea is for look-aside (if that's the right word) caching for tclhttpd, where several directories could contain variant caches of a single source directory (perhaps specialised for different browsers?) Such a facility needs to be able to invalidate the caches on changes to the source - I think it would be more effective to maintain records of the relationship of source-to-cache in the source directory than the cached directories, and propagate changes (by simply removing the derived/cached content.) It finally dawned on CL that there's a better way to handle all the people who ask for directory-change events, tail-write events, and so on. Until now, we've gravely responded: "thou must [poll], with certain platform-dependent exceptions."Here's what questioners really want to hear: "use XXX; it synthesizes a virtual event that perfectly matches your description." Now all that's left is to write up the XXX implementations. With me traveling, and a weekend approaching, will RS or someone else beat me to it? Bah! It's all trivial until you start looking at NFS, and then at NFS mounts under NFS mounts... then it get's too scary.Dangers I have known... I think libfam handles NFS mounts. Not sure about NFS mounts under NFS mounts though. RS contributes this little poller, that works ok for local files, but changes in directories are only visible (on Win2k) when a new file is created (or renamed)... Needs more work, but it's a starting point: proc watchfile {name body {interval 1000}} { set t [file mtime $name] if [catch {expr {$t - [set watchfile::$name]}} dt] { namespace eval watchfile [list variable $name $t] } elseif $dt { eval $body set watchfile::$name $t } after $interval [info level 0] }Usage example: watchfile t.txt {puts "Now we have it!"} "Filemon" [3] is freeware for WinNT (and so on) and Linux that will interest many of the same people. See also here: Matthias Hoffmann - Tcl-Code-Snippets [Is there also something called "famd", perhaps available only for Unix, that's pertinent in this discussion?] AMG: Check out inotify, an important feature of Linux 2.6. Here's a README explaining its advantages over dnotify: [4] . "Rumor is that the 'd' in 'dnotify' does not stand for 'directory' but for 'suck.'" A Tcl interface to the inotify kernel facility can be found here tcl-inotify.
http://wiki.tcl.tk/3643
CC-MAIN-2016-50
refinedweb
579
63.8
in reply to Re: [DBIX::Class] problem with Arbitrary SQL through a custom ResultSourcein thread [DBIX::Class] problem with Arbitrary SQL through a custom ResultSource I have a version of this example for those who create their models with Catalyst and DBIC::Schema. The idea is the same as in the original Cookbook example quoted by dreel, as well as in semifor's version: you need to give your query's result the appearance of a database table. The problem with these examples is that you can't use them verbatim. Different transformations may be necessary, depending on how the rest of your code is arranged. It took me a wee whiley to figure out how to make it work with DBIC::Schema, in which case it simply meant throwing a few things away. I used this command to create my model and schema: script/stat_create.pl model DB DBIC::Schema DB::Schema create=static + dbi:Pg:dbname=stat '' '' '{AutoCommit => 0}' [download] Here, DB is the name of my model, DB::Schema is the name of the generated schema class serving as the interface to the model's data; stat is the name of my application (so the script is named stat_create.pl), and the postgres database containing the data for the model is also named stat, which is just a co-incidence — it doesn't have to be. These are the things that vary, and how you name them is totally up to you. There is no magic in names. With things named as they are, running this command results in the following directory structure: |-- lib | |-- DB | | |-- Schema | | | |-- Class1.pm | | | |-- Class2.pm | | | |-- ... | | | `-- ClassN.pm | | `-- Schema.pm [download] Class1 .. ClassN is my depiction of the myriad of classes that the Catalyst helper script creates after it examines the existing database. Each class corresponds to a table. If, instead of building your Catalyst application around the existing database, you choose to create it with Catalyst, you will have arrived here by a different route, but this example will still be valid, as long as your custom query module is in the same parental namespace and is kept with the rest of the schema classes. Creation of schema classes — automatic or manual — is adequately explained in the Catalyst Tutorial. Now, suppose you want to run a query that is neither a simple select on a table, nor can be expressed in terms of relationships supported by DBIx::Class. I need this kind of thing, for example, to calculate an aggregate over a complicated cascade of joins with non-trivial join conditions. As in semifor's example, let's say you want the database to add two numbers for you. Create the module lib/DB/Schema/Add.pm with the following in it: package DB::Schema::Add; use strict; use warnings; use base 'DBIx::Class::Core'; __PACKAGE__->table("NONE"); __PACKAGE__->add_columns(qw/number/); __PACKAGE__->result_source_instance ->name(\'(select 10*10 as number)'); 1; [download] Done. If you have created the new class in the same directory with other table classes for this model's schema, it will be registered automatically. Use it anywhere in Catalyst (controllers, models, &c.), as: my ($res) = $c->model('Add')->all; my $number = $res->number; [download] That's all. Note once again that in this example, "DB", "DB::Schema", "Add", "number", and "NONE" are just arbitrary names. None of them has a special meaning to Catalyst or DBIx::Class, so you can use any names that make sense to you; just make sure that if you have previously created your model's schema as DB::Schema, your custom query container is named DB::Schema::CustomQuery, or something like that. For completeness, and to make the example more interesting, here's one way to pass parameters into the query (it will be prepared/executed inside DBIx): In your model: package DB::Schema::Add; use strict; use warnings; use base 'DBIx::Class::Core'; __PACKAGE__->table("NONE"); __PACKAGE__->add_columns(qw/number/); __PACKAGE__->result_source_instance ->name(\'(select ?::integer * ?::integer as number)'); 1; [download] In the caller: my ($res) = $c->model('Add')->search({}, {bind => [5, 7]}); my $body = $res->number; [download] What if i simply want to exec a stored procedure, per dreel? Am I not understanding something? Deep frier Frying pan on the stove Oven Microwave Halogen oven Solar cooker Campfire Air fryer Other None Results (322 votes). Check out past polls.
http://www.perlmonks.org/?node_id=658193
CC-MAIN-2016-26
refinedweb
727
58.52
Related Tutorial React Snapshot. Snapshot testing is particularly useful in testing React components. Let’s see how it’s done. react-test-renderer You need to render your React components before you serialize them. Be sure to install react-test-renderer so you can do so. - yarn add --dev react-test-renderer Creating a Snapshot for a Component Let’s say you have a component that pages a person when you click a button // Pager.js import React from 'react'; export default function Pager({ name }) { const onClickCallback = () => alert(`Paging ${name}!`); return ( <div> <h1>{name}</h1> <button onClick={onClickCallback}>Page</button> </div> ); } Your test should look something like // Pager.test.js import React from 'react'; import renderer from 'react-test-renderer'; import Pager from './Pager'; it('looks okay.', () => { const name = 'John'; // Render the component with the props. const tree = renderer.create(<Pager name={name}/>) // Convert it to JSON. .toJSON(); // And compare it to the snapshot. expect(tree).toMatchSnapshot(); }); The snapshot goes to the __snapshots__ folder and all subsequent test runs will compare to that. From there you can edit Pager as you please; so long as the same props give the same result, the snapshot will match. But that’s also a problem. Snapshots Are Not a Magic Bullet It’s important to note that, while objects are serializable, functions (and therefore callbacks) are not. If you open up Pager.test.js.snap, you’ll see that onClickCallback is being represented as [Function]. // Jest Snapshot v1, exports[`properly writes name. 1`] = ` <div> <h1> John </h1> <button onClick={[Function]} > Page </button> </div> `; If Pager is rewritten so that onClickCallback does something else, the snapshot will still pass. export default function Pager({ name }) { // Not what you want it to do, but it will still pass. const onClickCallback = () => alert(`Paging {name}!`); return ( <div> <h1>{name}</h1> <button onClick={onClickCallback}>Page</button> </div> ); }
https://www.digitalocean.com/community/tutorials/react-react-snapshot-testing
CC-MAIN-2020-34
refinedweb
308
60.61
I tried the following code on Rasppi to connect to NTP server and get the time. But I get OSError [Errorno 101] Network is unreachable. Code: Select all import ntplib from datetime import datetime, timezone c = ntplib.NTPClient() # Provide the respective ntp server ip in below function response = c.request('uk.pool.ntp.org', version=3) response.offset # UTC timezone used here, for working with different timezones you can use [pytz library][1] print (datetime.fromtimestamp(response.tx_time, timezone.utc)) Does anyone know why I get this? I tried it on a Windows PC and it works fine. Windows PC has got python 3.7 and Rasppi has python 3.5. Is it because of the python version? I am trying to connect to the NTP server for synchronization between multiple python files on different Rasppis, by the way. Thanks.
https://www.raspberrypi.org/forums/viewtopic.php?p=1495414
CC-MAIN-2020-34
refinedweb
140
60.92
Objective This tutorial uses the popular LM35 temperature sensor to enable temperature measurement with the PIC16F18855. The LM35 is a cheap and easy-to-use part that can be useful in applications that may be harmed from excessive heat or even as a fun thermometer side project. The Project Uses: Useful Pre- Knowledge: - Analog Read Serial Write using the Analog-to-Digital with Computation (ADCC) peripheral - Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) Basics on Xpress Materials Hardware Tools (Optional) Software Tools Procedure 1 Task 1 Create a new project in MPLAB® Xpress for a PIC16F1855 using the MPLAB Xpress Development Board called "analogReadSerialWrite." If this is your first project, follow the instructions given below. 3 Task 3 Because the LM35 temperature sensor is an analog sensor, we must first translate the analog signal to a digital signal before we can read the signal accurately with our microcontroller. The ADCC module is perfect for this translation. Therefore, once you have opened MCC online, choose the ADCC module from under the Device Resources tab: 4 Task 4 Double-clicking ADCC will open a window similar to the one below: The only changes necessary to make are those described here. First, the clock source FRC allows the ADCC clock to run independently of the system clock. This demonstrates the clock flexibility on the PIC16F18855 chip which can create multiple clock signals for different modules. Second, change the Result Alignment to right so that the bits are aligned in the correct order. This will become important in the written section of our program. 6 Task 6 Choosing this module will open a window similar to the one below: The changes made to the default window are shown above. Check the box labeled Enable Transmit to allow the EUSART to send out information. This module enables your chip to send words and numbers to the terminal window. While you do not need to change the baud rate, it is highlighted here because it is important to note. This is the speed at which information is exchanged and is necessary to know when setting up your computer terminal. Otherwise, the bytes you send to the computer will show up as gibberish. Lastly, check the Redirect STDIO to USART box to simplify the lines of code you need to write by enabling the STDIO software library. 7 Task 7 Next, we must update our Pin Configurator so that the microcontroller knows which pin is the input to the ADCC (i.e., which pin is connected to the temperature sensor). Choose RC7 as the ADCC input by clicking the Lock icon so that it turns green. Second, choose RC0 as the EUSART output so that it properly sends the signal to the computer terminal via the serial connection. These changes are seen below: Finally, we will also change the ADCC input channel name to make it easier to type and understand in our written code section. Open the Pin Module under Project Resources and rename the ADCC input pin name to "tempsense": Once you have set up this page, choose Generate to populate the initialization files in your Online IDE window shown below: 8 Task 8 In order to take the raw data coming from the temperature sensor and translate it into something meaningful, we must write a couple of lines of code. The temperature sensor sends out a voltage signal directly proportional to the temperature that it senses. Looking at the datasheet for the LM35, we can see that this is 10.0 mV/°C: However, if the ambient temperature is around 23.8°C, the ADCC sends out a value of 74. So, where did this number come from? The ADCC populates a 10-bit register, and therefore it has 2^10 or 1024 options for values that it can send out. Next, it has some kind of a Positive Reference and a Negative Reference which defines the range of voltages it will send/receive. In our program, we left Positive Reference defined as VDD (or 3.3 V) and Negative Reference defined as VSS (or 0 V) in the ADCC module window: Therefore, the step size that it can register is (3.3 V / 1024 steps) = 0.00322 V/step . Now, if the ambient temperature is 23.8°C, it will register as a voltage of 23.8°C *0.010 V/C = 0.238 V. Taking 0.00322 V/step * 0.238 V with rounding equals ~74 steps. Therefore, the integer the ADCC sends to the microcontroller is 74. This is the number given by calling the function adc_result_t ADCC_GetConversionResult(void) which can be found in the adcc.h header file under Project : We will use this function in our code, seen below. In this tutorial, we combine it with conversion functions to convert from the integer value back to Celsius, then from Celsius to Fahrenheit. Write or copy and paste the following code into the main.c file under Project: #include "mcc_generated_files/mcc.h" /* Use LM35 temperature sensor to send temperature data to a computer terminal window*/ /* conversion from integer to Celsius equivalent, Vref is 3.3 V, data comes in as a mV value, must be scaled by 100, 1024 is the 10 bit ADCC value */ #define conversionrawtoc (3.3 * 100) / 1024 // /* Main application */ void main(void) { // initialize the device SYSTEM_Initialize(); uint16_t raw; while (1) { /*delivers a number of 0 to 1023, defined by (Vref / 1024) = step size in volts */ raw = ADCC_GetSingleConversion(tempsense); //converts the ADCC value to degrees celcius using scale equation float temp = raw * conversionrawtoc; //converts the Celsius value to Fahrenheit float ftemp = (temp * (1.8)) + 32; //prints a string to the computer terminal printf("ADCC reads: %i Celsius Value: %2.2f Fahrenheit Value: %2.2f \r", raw, temp, ftemp); } } /** End of File */ Once this is complete, it is time to program the microcontroller. 9 Task 9 Click on the Make and Program Device icon: to download the HEX file of your code and then drag it into the Xpress board icon under My Computer: Once the microcontroller is programmed, open up a terminal emulator window such as Tera Term or Coolterm. You should see a screen similar to the following: Results If you see gibberish, make sure that the baud rate of your terminal agrees with that set up in your MCC window. If some is gibberish, you may need to slow the baud rate down to reduce the error margin.
https://microchip.wikidot.com/xpress:how-to:external-temperature-sensor-with-the-mplab-xpr
CC-MAIN-2021-04
refinedweb
1,073
60.55
Odoo Help Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc. To change the function field to editable? I have a function field. The function of the field is def _wage(self, cr, uid, ids, fieldnames, args, context=None): res = {} for obj in self.browse(cr, uid, ids, context=context): s = ( """select sum(wage) from hr_attendance where employee_id=%s and name >= date_trunc('month', current_date - interval '1' month)and name < date_trunc('month', current_date)""" % ( obj.employee_id.id)) cr.execute(s) l = cr.fetchone() value = l[0] res[obj.id] = value return res This field calculate the wage using the query. Sometime I need to type and save the wage not based on the calculation. So I want that filed as editable. I tried inverse function. This the field 'wage': fields.function( string='Per Month Salary', fnct=_wage, fnct_inv=_set_wage, store=True, type='float'), I give the inverse function as def _set_wage(self, cr, uid, id, field_name, field_value, args=None, context=None): obj = self.browse(cr, uid, id) for record in obj: if record.wage != field_value: cr.execute( 'UPDATE hr_contract ' 'SET wage=%s ' 'WHERE id=%s', (field_value, id) ) return True When I give this function the field becomes editable but when I type and save the value it again changes to the computed value. I also tried another method def _set_wage(self, cr, uid, id, field_name, field_value, args=None, context=None): obj = self.browse(cr, uid, id) for record in obj: if record.wage != field_value: record.wage=self.write(cr, uid, id, {'wage': field_value}) return True It shows error as RuntimeError: maximum recursion depth exceeded in cmp How can I store the value of the function field after it is edited? Help me with an example. Thanks... Computational/Functional Fields, as the name indicates that the values will be computed either while saving the record or while accessing the record depending on the store attribute , so ideally one should not enter any data to it, and let the system to evaluate value for the same. Well accordingly to your requirement, i.e sometimes you want the system to compute while other cases you would like to manually enter the data into it. If that is the case then instead of creating it as a functional/computational fields, create it as a normal physical field, & write Onchange method to calculate the value, upon calculation either you can retain or change the value and save the record. By this way it will satisfy both computation & manual data-entry. change self to record in your code, def _set_wage(self, cr, uid, id, field_name, field_value, args=None, context=None): obj = self.browse(cr, uid, id) for record in obj: if record.wage != field_value: record.wage=record.write( {'wage': field_value}) return True Thanks for your answer. I tried this code but it shows error as TypeError: write() takes exactly 2 arguments (5 given) @Uppili, I might be a tad late, but this TypeError means you did a write on odoo7 code. The answer provided by kirubanidhi is written in odoo8. If you are still in odoo7 use: self.write(cr, uid, id, {'wage': field_value}), but do not assign it to the record's attribute. The max recursion you are getting is because 'record.wage= ' calls a write on the object, but your assignment record.write() also calls a write on the object. Meaning you are in an endless loop of writing your field, thus resulting in a max recursion depth error. About This Community Odoo Training Center Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
https://www.odoo.com/forum/help-1/question/to-change-the-function-field-to-editable-104666
CC-MAIN-2018-13
refinedweb
617
65.22
Development of large web online mapping project required intensive processing of web requests and geographical data. To simplify and accelerate calculations, the author decided to develop specialized data types. One of type need to improve the code was new integral type named SmartInt that was equivalent to int. Designing and implementing of this type is explained in this brief article. Many other types can be created in a similar manner. SmartInt int This article describes: Nullable This article should not be considered as improvements or replacement of .NET components nor trial to find weakness or disadvantages in standard .NET. .NET is a global framework that was developed for universal use. This means it is compact, has reasonable number of functions/methods, fast enough and resource consuming enough for many use cases. SSTypes in its turn is specialized to be used in several cases (the main purpose was string parsing and input sanitation). Such limitation of usage allows to optimize it for performance. SSTypesLT project is under development and I hope that published information will be useful. Besides all, it can be used as an example of creating of custom types. SSTypes string SSTypesLT Intensive data transformations and calculations require quick and easy to use code. Required improvements include: Parse NoValue BadValue Nullable<int> System.Int32 Int32 The main idea of improvement is based on the fact that class derived from another class keeps features of parent and specializes it. This means that it will only constrict functionality if no new members or methods are added. So, there is an ability to accelerate existing functionality and keep occupied space intact. Another fact is the ability of modern compilers to optimize the code. This give us the possibility to add semantics that will not add additional burden to final native code. There are two main groups of types in C# - reference types and value types. All classes are reference types. Create net type on base of class will add support of OOP as an unnecessary burden. Value types do not add such additional things. Source codes of Int32 are the excellent starting point and they are available now (for example, by Googling “System.Int32 source code”). These codes show usage of relation named in COM world “Containment” (as is described in old book “Programming Visual C++”, Microsoft Press, 1998). Containment is one way how inheritance can be implemented for binary COM objects. This technique is a way to inherit parent’s features and create new type that can be used whenever parent type uses (see chapter Nonconventional OOP below). Let’s consider this technique in detail. The simplest code for SmartInt structure will be as follows: public struct SmartInt { private System.Int32 m_v; public static readonly SmartInt BadValue = System.Int32.MinValue; public static readonly SmartInt MaxValue = System.Int32.MaxValue; public static readonly SmartInt MinValue = System.Int32.MinValue + 1; // Constructs from int value public SmartInt(System.Int32 value) { m_v = value; } // Constructs from int? value public SmartInt(System.Int32? value) { if (value.HasValue) m_v = value.Value; else m_v = BadValue.m_v; } // Checks validity of the value public bool isBad() { return m_v == BadValue.m_v; } public static implicit operator SmartInt(System.Int32 value) { return new SmartInt(value); } public static implicit operator System.Int32(SmartInt value) { return value.m_v; } } The full cope for SmartInt is available at. Specific features of the code example include: m_v Containment int? SmartInt(System.Int32 value) System.Int32(SmartInt value) As result, the following code can compile and run: SmartInt a = 35; int b = a; int c = b * 2; a = c; a = 3; string h = "Hello, World !"; char ch = h[a]; // Use SmartInt as an array index JIT will optimize of this code in a way SmartInt works fully similar to int. No performance loss or size overhead observed (this is confirmed by the tests for .NET Framework 4.0 and higher). Producing new structure SmartInt from existing Int32 can be considered in terms of OOP. Let’s review the main features. SmartInt encapsulates fields and methods, including public/protected levels of access. There is no difference with encapsulation for classes. public protected SmartInt has features of its parent type Int32. You can see the overloaded functions such as ToString, Equals, GetHashCode and exposed Int32 functions such as GetType, formatted ToString. ToString Equals GetHashCode GetType Polymorphism is presented as on value level, where SmartInt can be used whenever its parent Int32 is used, for example: int a = SmartInt.Parse("38405"); // Parsed SmartInt value is assigned to int SmartInt ind = 7; SmartInt len = 5; String hw = "Hello, World !"; Console.WriteLine(hw[ind]); // SmartInt value is used as index String ww = hw.Substring(ind, len); // SmartInt values are used as function’s arguments SmartInt reduces abstraction level of Int32, but not big enough. Type Age that is mentioned in chapter “Semantics” below shows more deep specialization and reducing of abstraction. Age Creating another structure based on Int32 can introduce type with another meaning. public struct Age { private System.Int32 m_v; public static readonly SmartInt MaxValue = 150; public static readonly SmartInt MinValue = 0; public static implicit operator Age(System.Int32 value) { return new SmartInt(value); } public static implicit operator System.Int32(Age value) { return value.m_v; } } Although SmartInt and Age types are binary similar (because are based on the same Int32 type), on level of C# language, they are incompatible. The following code will not compile: Age a = 7; // Ok – int can be converted to Age // Compilation error – no operator for conversion from Age to SmartInt SmartInt s1 = a; // Ok – value will be assigned through conversion Age->int and int->SmartInt SmartInt s2 = (int)a; For all compiled code, JIT optimization will remove the burden. Nullable types are very convenient to use in case where NoValue should be used. But making value type Nullable increases its size because requires extra storage for the status. In general, size of this extra space equals to the alignment (32 bits for many platforms). This increases total size of Int32? twice comparing to Int32. Int32? This size increasing has two drawbacks: SmartInt has features similar to Nullable<Int32>, but keep its original size equals to size of Int32. In other words, functionality of Nullable<Int32> was added to Int32 without any burden. Nullable<Int32> Adding the following methods to SmartInt makes it compatible with Int32? (Nullable<Int32>): //Converts the value of System.Int32? to SmartInt. public static implicit operator SmartInt(System.Int32? value) { if (!value.HasValue) return SmartInt.BadValue; return new SmartInt(value.Value); } // Converts the value of SmartInt to System.Int32?. public static implicit operator System.Int32?(SmartInt value) { if (value.isBad()) return null; return new System.Int32?(value.m_v); } public bool HasValue { get { return !isBad(); } } public SmartInt Value { get { if (!HasValue) throw new System.InvalidOperationException("Must have a value."); else return this; } } public SmartInt GetValueOrDefault() { return HasValue ? this : default(SmartInt); } These improvements allow to use SmartInt similar to Int32? in many cases. For example: // Assign null to structure SmartInt si = null; // Checks if structure is null if (si == null) return 0; Unfortunately, the following code C# will not be compiled: SmartInt x = null;int y = x ?? -1; But a bit corrected code will be compiled successfully: SmartInt x = null; int y = (int?)x ?? -1; Parse is the most improved method in SmartInt. Improvements include specialization for for parsing only Int32 value types with input sanitation. Input sanitation allowed many input data types and value ranges where values that cannot be parsed do not throw and set output value to BadValue. While test shows significant performance improvement, the development, testing, and documenting of the method is not stopped. Int32.Parse Method ToString was improved to provide output to StringBuilder. This technique does not create temporary strings in case of composing complex textual structures such as XML or JSON. StringBuilder SmartInt is useful in input sanitation. For example, extracting of web request values can be coded in three lines: // Try parse value for parameter "id" without throwing // Context.Request is not null, but QueryString can return any value SmartInt id = SmartInt.Parse(context.Request.QueryString["id"]); // Return if value did not extracted or less than 0 if (id.isBadOrNegative()) return; Another method SmartInt.isBad() can be used to check is value not bad (is negative, 0, or positive). SmartInt.isBad() Throwing can significantly reduce performance and resistance to DDOS attacks. SmartInt.Parse does not throw exceptions and quickly parses many types of input values. SmartInt.Parse Unit Testing is the important component of SDLC and is used to ensure correct behavior of changing code. SmartInt is a small and simple type and should be as intensively as possible tested before use. The type that is described here was intensively tested and its correctness is proven by use in production environment. For instance, one of used test cases is brute force cycled parsing random string values by SmartInt.Parse and Int32.Parse, and comparing the outputs. The following procedure tests common, negative, and signed by plus values: [TestMethod] public void Test_SmartInt_Parse_BruteForce() { int test_count = 10000000; Random rnd = new Random(); for (int i = 0; i < test_count; i++) { int v = rnd.Next(); string s = v.ToString(); string sp = "+" + s; string sn = "-" + s; SmartInt siv = SmartInt.Parse(s); SmartInt sipv = SmartInt.Parse(sp); SmartInt sinv = SmartInt.Parse(sn); Assert.IsTrue( (siv == v) && (sipv == v) && (sinv == -v), "Parsing " + v.ToString()); } } There are other tests ensuring quality of code. Author increases number of tests to ensure in reliability of code. Performance tests were implemented by technique using BenchmarkDotNet (). The tests show performance improvement more than in 4 times. Development is not stopped and continues to assure that the code is bug-free. Test environment: BenchmarkDotNet=v0.9.1.0 OS=Microsoft Windows NT 6.1.7601 Service Pack 1 Processor=Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz, ProcessorCount=4 Frequency=2241298 ticks, Resolution=446.1700 ns HostCLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] Type=SmartIntBM_Parse_IntSmartInt_9_Digit Mode=Throughput ----------------------------------------------------------------------------------------------- Method Median StdDev Parse_Int_9_Digit 16.1033 ms 0.3239 ms Parse_SmartInt_9_Digit 3.4312 ms 0.0584 ms There are many other observed performance improvements. Positive difference is observed for modern versions of .NET Framework. Versions prior to 4.0 should not be used because optimization in these versions is not effective enough. Although observed results show advantage in performance, work on improvement of code and testing continue. Simple size test shows that SmartInt uses the same memory size as int uses. Int32? uses two time bigger size. Observed outcomes are equal to expected. public static void ArraySize() { int objects_count = 1000; long memory1 = GC.GetTotalMemory(true); int[] ai = new int[objects_count]; long memory2 = GC.GetTotalMemory(true); int?[] ani = new int?[objects_count]; long memory3 = GC.GetTotalMemory(true); SmartInt[] asi = new SmartInt[objects_count]; long memory4 = GC.GetTotalMemory(true); // Compiler can optimize and do not allocate arrays if they are not used // So we write their lengths Console.WriteLine("Array sizes {0}, {1}, {2}", ai.Length, ani.Length, asi.Length); Console.WriteLine("Memory for int \t {0}", memory2 - memory1); Console.WriteLine("Memory for int? \t {0}", memory3 - memory2); Console.WriteLine("Memory for SmartInt \t {0}", memory4 - memory3); } Output: Array sizes 1000, 1000, 1000 Memory for int 4024 Memory for int? 8024 Memory for SmartInt 4024 Press any key to exit. There is a small C# project created in Microsoft Visual Studio Community 2015. Before running the examples, you need to install SSTypesLT NuGet package (as described here for example). The project contains just a small portion of code for quick start. Additional examples are available on the project site by the link. Techniques that were touched by this article are interesting and require further studying. Abilities to improve code should not be ignored by developers, especially the following: Practical use of described technique can include: This article, along with any associated source code and files, is licensed under The MIT License SmartInt s = SmartInt.MinValue; if (s==Int32.MinValue) { ... } public bool IsInRange(SmartInt min, SmartInt max) { return (m_v != BadValue) && m_v >= min && m_v <= max; } Quote:The simpliest code for SmartInt structure will be as the follows: [Benchmark] public void Parse_SmartInt_9_Digit() { for (var i = 0; i < 100000; i++) ina[i] = SSTypes.SmartInt.Parse(sna[i]); } [Benchmark] public void Parse_Int_9_Digit() { for (var i = 0; i < 100000; i++) ina[i] = System.Int32.Parse(sna[i]); } 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://codeproject.freetls.fastly.net/Articles/1088174/Accelerated-NET-Types?msg=5222534#xx5222534xx
CC-MAIN-2021-49
refinedweb
2,064
51.44
Retrieve the current value of the specified buffer property of type long long integer. #include <screen/screen.h> int screen_get_buffer_property_llv(screen_buffer_t buf, int pname, long long *param) The handle of the buffer whose property is being queried. The name of the property whose value is being queried. The properties available for query are of type Screen property types. The buffer where the retrieved value(s) will be stored. This buffer must be of type long long. Function Type: Immediate Execution This function stores the current value of a buffer property in a user-provided buffer. 0 if a query was successful and the value(s) of the property are stored in param, or -1 if an error occurred (errno is set).
http://www.qnx.com/developers/docs/qnxcar2/topic/com.qnx.doc.qnxcar2.screen/topic/screen_get_buffer_property_llv.html
CC-MAIN-2022-05
refinedweb
121
65.32
Feedback Getting Started Discussions Site operation discussions Recent Posts (new topic) Departments Courses Research Papers Design Docs Quotations Genealogical Diagrams Archives. The subject of type inference for dynamically-checked languages came up in the Buried Treasure thread. A question was raised in that thread having to do with why static type inference in these languages is difficult. Since there's a nascent body of literature which addresses that question, here are a few links to articles and papers about type inference for Python. A nice overview can be found in Localized Type Inference of Atomic Types in Python, a Master's thesis by Brett Cannon. The whole thesis is relevant, but for an overview of the issues, see Chapter 3, "Challenges of Inferring Types in Python". Chapter 4 summarizes previous attempts involving static inference in Python, including Psyco (previously on LtU) and Starkiller. The limitations of these attempts are briefly addressed. Type inference solutions for Python invariably involve restrictions to make the problem tractable. The above paper focuses on "inferring atomic types in the local namespace". Another approach is described in Aggressive Type Inference, by John Aycock. Aycock makes an important observation: Giving people a dynamically-typed language does not mean that they write dynamically-typed programs. The article offers a type inference approach which exploits this observation. (If the meaning of the above quote isn't clear, I recommend reviewing our mammoth three-part thread on the subject, "Why type systems are interesting", part I, part II, and part III.) The PyPy implementation of Python in Python (previously on LtU) uses a restricted subset of Python, called RPython, to implement parts of the language. RPython is sufficiently static to be able to support full-program type inference. It is not a "soft" inference approach, and is not designed to be used with ordinary Python programs. The paper Compiling dynamic language implementations covers the approach used for static analysis of RPython. The PyPy Coding Guide, starting at section 1.4 may also be useful. (It may be interesting to note that the PyPy approach is very similar to that used previously for Scheme 48. The core of Scheme 48 is implemented in PreScheme, a subset of Scheme that supports full-program type inference.) Finally, Guido van Rossum has a number of blog entries on the subject of adding optional static typing to Python: If anyone knows of any other good treatments of type inference in Python or similar languages, please post links here.. Guido resisted the few calling for class decorators, because there wasn't a clear use case that wasn't more readable done another way... [but] Guido has conceded, class decorators will make it into some future version of Python. More + links: here.. (via Daily Python-URL). MyHDL is an open-source package for using Python as a hardware description and verification language. A Verilog converter is also included. EE Times provides some background on MyHDL in this article..
http://lambda-the-ultimate.org/taxonomy/term/26?from=10
CC-MAIN-2018-22
refinedweb
491
55.34
Are you wondering how to restart your Python program from within itself? Well, it is quite simple. You only need to add one line to your program. Let’s do this using an example. Suppose we have a program that takes a score from the user and tells the remarks. For example, if the score is 90, then the remark would be outstanding. If the user enters the score correctly, then the program will run properly. Moreover, for a score to be correct, it must be a number and in the range of 0-100. Now, if the user enters an invalid score, we want the program to display the error message and then restart again. We can easily do so using the following line of code. subprocess.call([sys.executable, os.path.realpath(__file__)] + sys.argv[1:]) Make sure to import sys, os, and subprocess before using the above line. The complete code is given below. import os import sys import subprocess def calculateGrade(): try: val = float(input("Enter your marks: ")) if val >= 90 and val <= 100: print("Outstanding") elif val >= 80 and val < 90: print("Excellent") elif val >= 70 and val < 80: print("Very Good") elif val>= 60 and val < 70: print("Needs Improvement") elif val>=30 and val <60: print("Work hard") elif val>=0 and val<30: print("Poor") else: raise ValueError("Enter a valid score, i.e., between 0 and 100") except Exception as err: print("ERROR:", err) print("Restarting the program") print("------------------------") subprocess.call([sys.executable, os.path.realpath(__file__)] + sys.argv[1:]) #restart the program calculateGrade() Output Python Restart a program output In the above example, when the user enters an incorrect input, an exception gets raised. It gets handled in the except block, where we display the error message and restart the!
https://maschituts.com/how-to-restart-a-program-in-python-explained/
CC-MAIN-2021-10
refinedweb
300
62.98
Nov 16, 2011 12:23 PM|ismailae|LINK Hello all, Please am new in this terrain.Am developing an intranet Application for my company but i want to User to be Automatically once the user successfully logs into he/her system. I want the application to get the user's details from Active Directory once he/she enters the Intranet Url. Please i need this Guys. Thanks Contributor 5533 Points Nov 16, 2011 02:51 PM|N_EvilScott|LINK If you are using .NET 3.5 or higher then your job will be an easy one. You can use the PrincipalContext in the System.DirectoryServices.AccountManagement namespace, to work your way around have a look at this tutorial that shows you how to search for Groups, Users, and other objects such as Security Groups etc... Member 280 Points Nov 17, 2011 04:12 AM|kushal.dwivedi|LINK Use Windows authentication in IIS to authenticate intranet users. To get user information from AD, you can either use System.DirectoryServices or System.DirectoryServices.AccountManagement namespace. Nov 17, 2011 07:37 PM|gww|LINK In your global.asax file you can setup your WindowsAuthentication_Authenticate if you want to use windows authentication or WindowsAuthentication_Authenticate if you want to use Forms Authentication. I prefer to use forms authentication. In IIS you will want to enable windows authentication and disable annonmous access. This will expose the currently logged on user to the application Identity that you can then use to search active directory. If you use forms authentication you can setup roles in two ways. Either create a custom role in the database and add users to them or you can use Active Directory groups and check the user membership in those, to add users to roles for acces to pages and features. 3 replies Last post Nov 17, 2011 07:37 PM by gww
https://forums.asp.net/t/1740270.aspx?I+Need+Help+on+Active+Directory+
CC-MAIN-2017-47
refinedweb
308
57.06
A pytest plugin to help with testing shell scripts / black box commands Project description A plugin for testing shell scripts and line-based processes with pytest. You could use it to test shell scripts, or other commands that can be run through the shell that you want to test the usage of. Not especially feature-complete or even well-tested, but works for what I wanted it for. If you use it please feel free to file bug reports or feature requests. This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template. Features - Easy access to a bash shell through a pytest fixture. - Set and check environment variables through Python code. - Automatically fail test on nonzero return codes by default. - Helpers for running shell scripts. - Mostly, all the great stuff pytest gives you with a few helpers to make it work for bash. Usage You can use a fixture called ‘bash’ to get a shell process you can interact with. Test a bash function: def test_something(bash): assert bash.run_function('test') == 'expected output' Set environment variables, run a .sh file and check results: def test_something(bash): with bash(envvars={'SOMEDIR': '/home/blah'}) as s: s.run_script('dostuff.sh', ['arg1', 'arg2']) assert s.path_exists('/home/blah/newdir') assert s.file_contents('/home/blah/newdir/test.txt') == 'test text' Run some inline script, check an environment variable was set: def test_something(bash): bash.run_script_inline(['touch /tmp/blah.txt', './another_script.sh']) assert bash.envvars.get('AVAR') == 'success' Use context manager to set environment variables: def test_something(bash): with bash(envvars={'BLAH2': 'something'}): assert bash.envvars['BLAH2'] == 'something' You can run things other than bash (ssh for example), but there aren’t specific fixtures and the communication with the process is very bash-specific. Creating file and directory structures pytest_shell.fs.create_files() is a helper to assemble a structure of files and directories. It is best used with the tmpdir pytest fixture so you don’t have to clean up. It is used like so: structure = ['/a/directory', {'/a/directory/and/a/file.txt': {'content': 'blah'}}, {'/a/directory/and': {'mode': 0o600}] create_files(structure) which should create something like this: | + a \ + directory \ + and # mode 600 \ + a \ file.txt # content equal to 'blah' TODO - Helpers for piping, streaming. - Fixtures and helpers for docker and ssh. - Support for non-bash shells. - Shell instance in setup for e.g. basepath. Refactoring TODO - Make Connection class just handle bytes, move line-based stuff into an intermediary. - Make pattern stuff work line-based or on multiline streams (in a more obvious way than just crafting the right regexes). - Make pattern stuff work on part of line if desired, leaving the rest. Project details Release history Release notifications | RSS feed 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/pytest-shell/
CC-MAIN-2022-21
refinedweb
474
67.55
A library to capture sys.stdout and -err Project description StdGet StdGet is a small python 2 and 3 compatible library that doesn't require any modules to work. What does it do? StdGet's purpose is to be a way to capture the StdOut (Standard Output) and StdErr (Standard Error Output). Sounds great! How does it work and how do I use it? How to use it: First, let's import StdGet: import stdgetThen, let's say we want to capture the StdOut: stdget.startstdoutcapture()And you're done! "But how do I get the information it captures?" stdget.stdouthookwill give you a list. You can just do stdget.stdouthook=[]to empty it. How it works: What it does is it adds a layer on top of the original 'sys.stdout.write' that actually 'takes' the data and copies it into the 'stdget.stdouthook' list. It works outside of the module's layer because the sys.stdout / -in and -err are global all across the session. That's also why you can just do import stdgetand you don't have to do from stdget import *(it doesn't matter). Project details Release history Release notifications | RSS feed 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/stdget/1.1.2/
CC-MAIN-2021-43
refinedweb
219
68.67
0 Hi. I just got started using wxPython and I was wondering how to create a button which transferred the user from one screen to another. To kind of illustrate what I mean, I created two files, 'main.py' and 'newgame.py'. I've made a button called 'New Game' in the main.py file, and I'm trying to create a scenario where clicking this button will bring you to the 'newgame.py' screen. What I've got for the 'main.py' file so far is: import wx class velvet(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Example', size = (800, 640)) panel = wx.Panel(self) ngbutton = wx.Button(panel, label = "New Game", pos = (50, 50), size = (120, 120)) self.Bind(wx.EVT_BUTTON, self.newgamebutton, ngbutton) exitbutton = wx.Button(panel, label = "Exit", pos = (50, 250), size = (120, 120)) self.Bind(wx.EVT_BUTTON, self.closebutton, exitbutton) self.Bind(wx.EVT_CLOSE, self.closewindow) def newgamebutton(self, event): def closebutton(self, event): self.Close(True) def closewindow(self, event): self.Destroy() if __name__ == '__main__': app = wx.PySimpleApp() frame = velvet(parent = None, id = -1) frame.Show() app.MainLoop() I was thinking that entering a self.event command for newgamebutton would solve the problem, but I'm not sure which event I could use or how I'd even get it to recognise that it should display the newgame.py file. I've probably went about this in entirely the wrong way, but any help will be very much appreciated!
https://www.daniweb.com/programming/software-development/threads/198727/newbie-wxpython-question
CC-MAIN-2017-04
refinedweb
251
61.63
Edit Article How to Create Your Own Mini Project on wikiHow Do you have a topic that you want to address? Maybe one that doesn't really need involvement from others (not that you would reject it). What you can do is create your own 'mini-project'. Steps - 1Go to your user page. This is the location you need to be in to create your own mini-project. - 2Click on the address bar in your browser at the end of the user page URL. Type in /Mini Project Name. For example: - 3After typing in the project name, you will be redirected to a page where it will say that there is no article found. Click edit. - 4Start your project by writing what you need to write on the textbox. - 5Click publish to finish off the project. Community Q&A Unanswered Questions - How can I get project ideas for my third year of studying for a B.E. degree? Ask a Question If this question (or a similar one) is answered twice in this section, please click here to let us know. Tips - Personal projects need to be placed in your namespace. That is where you can add pages that apply to you or your interests. You type in the name of whatever it is, after your user page URL. Article Info Categories: User Pages Thanks to all authors for creating a page that has been read 13,749 times. Did this article help you? About this wikiHow
http://www.wikihow.com/Create-Your-Own-Mini-Project-on-wikiHow
CC-MAIN-2016-40
refinedweb
247
83.25
Download presentation Presentation is loading. Please wait. Published byBraulio Grass Modified about 1 year ago 1 The B2 Buzz The Buzz About Buffer Pools 1 2 A Few Words about the Speaker Tom Bascom; Progress 4gl coder & roaming DBA since 1987 President, DBAppraise, LLC – Remote database management service for OpenEdge. – Simplifying the job of managing and monitoring the world’s best business applications. – VP, White Star Software, LLC – Expert consulting services related to all aspects of Progress and OpenEdge. – 2 3 What is a “Buffer”? A database “block” that is in memory. Buffers (blocks) come in several flavors: – Type 1 Data Blocks – Type 2 Data Blocks – Index Blocks – Master Blocks 3 4 Block Layout Block’s DBKEYTypeChainBackup Ctr Next DBKEY in ChainBlock Update Counter TopReserved Free Space …….... Compressed Index Entries... BotIndex No. Num EntriesBytes Used... Compressed Index Entries... Dummy Entry... Block’s DBKEYTypeChainBackup Ctr Next DBKEY in ChainBlock Update Counter Free Space Free Dirs. Rec 0 OffsetRec 1 Offset Rec 2 OffsetRec n Offset Num Dirs. Free Space Used Data Space row 0 row 2 row 1 Data Block Index Block 4 5 Type 1 Storage Area (Data) 5 Block 1 1Lift ToursBurlington 3669/239/28Standard Mail Shipped Shipped Block Shipped Shipped Shipped Shipped Block 3 14CologneGermany 2Upton FrisbeeOslo 1KoberleinKelly 1531/261/31FlyByNight Block 4 BBBBrawn, Bubba B.1,600 DKPPitt, Dirk K.1,800 4Go Fishing LtdHarrow 16Thundering Surf Inc.Coffee City 6 Type 2 Storage Area (Data) 6 Block 1 1Lift ToursBurlington 2Upton FrisbeeOslo 3HoopsAtlanta 4Go Fishing LtdHarrow Block 2 5Match Point TennisBoston 6Fanatical AthletesMontgomery 7AerobicsTikkurila 8Game Set MatchDeatsville Block 3 9Pihtiputaan PyoraPihtipudas 10Just Joggers LimitedRamsbottom 11Keilailu ja BiljardiHelsinki 12Surf LautaveikkosetSalo Block 4 13Biljardi ja tennisMantsala 14Paris St GermainParis 15Hoopla BasketballEgg Harbor 16Thundering Surf Inc.Coffee City 7 Tangent… If you are an obsessively neat and orderly sort of person the preceding slides should be all you need to see in order to be convinced that type 2 areas are a much better place to be putting data. The schema area is always a type 1 area. Should it have data, indexes or LOBs in it? 7 8 What is a “Buffer Pool”? A Collection of Buffers in memory that are managed together. A storage object (table, index or LOB) is associated with exactly one buffer pool. Each buffer pool has its own control structures that are protected by “latches”. Each buffer pool can have its own management policies. 8 9 9 Why are Buffer Pools Important? 10 Locality of Reference When data is referenced there is a high probability that it will be referenced again soon. (“Temporal”) If data is referenced there is a high probability that “nearby” data will be referenced soon. (“Spatial”) Locality of reference is why caching exists at all levels of computing. 10 11 Which Cache is Best? 11 LayerTime # of Recs# of Ops Cost per OpRelative Progress 4GL to –B ,000203, B to FS Cache ,00026, FS Cache to SAN ,00026, B to SAN Cache ,00026, SAN Cache to Disk ,00026, B to Disk ,00026, 12 What is the “Hit Ratio”? The percentage of the time that a data block that you access is already in the buffer pool.* To read a single record you probably access 1 or more index blocks as well as the data block. If you read 100 records and it takes 250 accesses to data & index blocks and 25 disk reads then your hit ratio is 10:1 – or 90%. * Astute readers may notice that a percentage is not actually a “ratio”. 12 13 )) * lr = _Buffer-LogicRds osr = _Buffer-OSRds. return ( if hr > 0.0 then hr else 0.0 ). end. 13. return. 14 15 Isn’t “Hit Ratio” the Goal? No. The goal is to make money*. But when we’re talking about improving db performance a common sub-goal is to minimize IO operations. Hit Ratio is an indirect measure of IO operations and it is often misleading as performance indicator. “The Goal” Goldratt, 1984; chapter 5 15 16 Sources of Misleading Hit Ratios Startup. Backups. Very short samples. Overly long samples. Low intensity workloads. Pointless churn. 16 17 Big B, Hit Ratio Disk IO and Performance MissPct = 100 * ( 1 – ( LogRd – OSRd ) / LogRd )) m2 = m1 * exp(( b1 / b2 ), 0.5 ) 95% 98% 98.5% 90.0% 95% = plenty of room for improvement 17 OSRd HR -B 18 Hit Ratio Summary The performance improvement from improving HR comes from reducing disk IO. Thus, “Hit Ratio” is not the metric to tune. In order to reduce IO operations to one half the current value –B needs to increase 4x. If you must have a “rule of thumb” for HR: 90% terrible – be ashamed. 95% plenty of room for improvement. 98% “not bad” (but could be better). 18 19 19 So, just set –B really high and we’re done? 20 What is a “Latch”? Only one process at a time can make certain changes. These operations must be atomic. Bad things can happen if these operations are interrupted. Therefore access to shared memory is governed by “latches”. If there is high activity and very little disk IO a bottleneck can form – this is “latch contention”. 20 21 What is a “Latch”? Ask Rich Banville! OE 1108: What are you waiting for? Reasons for waiting around! Tuesday, September 20 th 1pm OPS-28 A New Spin on Some Old Latches PCA2011 Session 105: What are you waiting for? Reasons for waiting around! 21 22 Disease? Or Symptom? 22 23 Latch Contention 05/12/11 Activity: Performance Indicators 10:29:37 (10 sec) Total Per Min Per Sec Per Tx Commits Undos Index operations Record operations Total o/s i/o Total o/s reads Total o/s writes Background o/s writes Partial log writes Database extends Total waits Lock waits Resource waits Latch timeouts Buffer pool hit rate: 99% 23 24 What Causes All This Activity? Tbl# Table Name Create Read Update Delete customer sr-trans-d prod-exp-loc-q loc-group bank-rec-doc ap-trans so-pack Idx# Index Name Create Read Split Del BlkD customer.customer PU sr-trans-d.sr-trans-d PU prod-exp-loc-q.prod-exp-loc-q PU _Field._Field-Name U loc-group.loc-group PU im-trans.link-recno ap-trans.ap-trans-doc 25 Which Latch? Id Latch Type Holder QHolder Requests Waits Lock% MTL_LRU Spin % 20 MTL_BHT Spin % 28 MTL_BF4 Spin % 26 MTL_BF2 Spin % 25 MTL_BF1 Spin % 27 MTL_BF3 Spin % 18 MTL_LKF Spin % 12 MTL_LHT3 Spin % 13 MTL_LHT4 Spin % 10 MTL_LHT Spin % 2 MTL_MTX Spin % 11 MTL_LHT2 Spin % 5 MTL_BIB Spin % 15 MTL_AIB Spin % 16 MTL_TXQ Spin % 9 MTL_TXT Spin % 25 26 How Do I Tune Latches? -spin, -nap, -napmax None of which has much of an impact except in extreme cases. 26 function tuneSpin returns integer ( YOB as integer ): return integer( yob * ). end. 27 What is an “LRU”? Least Recently Used When Progress needs room for a buffer the oldest buffer in the buffer pool is discarded. In order to accomplish this Progress needs to know which buffer is the oldest. And Progress must be able to make that determination quickly! A “linked list” is used to accomplish this. Updates to the LRU chain are protected by the LRU latch. 27 28 My LRU is too busy, now what? When there are a great many block references the LRU latch becomes very busy. Even if all you are doing is reading data with no locks! Only one process can hold it – no matter how many CPUs you have. The old solution: Multiple Databases. 2-phase commit More pieces to manage Difficult to modify 28 29 29 The Buzz 30 The Alternate Buffer Pool 10.2B supports a new feature called “Alternate Buffer Pool.” This can be used to isolate specified database objects (tables and/or indexes). The alternate buffer pool has its own distinct –B2. If the database objects are smaller than –B2, there is no need for the LRU algorithm. This can result in major performance improvements for small, but very active, objects. proutil dbname –C enableB2 areaname Table and Index level selection is for Type 2 only! 30 31 Readprobe – with and without B2 31 32 Finding Active Tables & Indexes You need historical RUNTIME data! _TableStat, _IndexStat -tablerangesize, -indexrangesize You can NOT get this data from PROMON or proutil. OE Management, ProMonitor, ProTop Or roll your own VST based report. 32 33 Finding Active Tables & Indexes 15:18:35 ProTop xx -- Progress Database Monitor 05/30/11 Table Statistics Tbl# Table Name Create Read Update Delete so-manifest-d 0 62, im-trans 1 34, customer 0 31, loc-group 0 19, so-pack 0 8, Index Statistics Idx# Index Name Create Read so-manifest-d.so-manifest-d PU 0 57, customer.customer PU 0 40, im-trans.link-recno 1 31, loc-group.loc-group PU 0 22,309 3 _Field._Field-Name U 0 16,152 Surprising! 33 34 Finding Small Tables & Indexes $ grep "^PUB.customer " dbanalys.out PUB.customer M PUB.customer 43.7M M M 1.0 _proutil dbname –C dbanalys > dbanalys.out 50MB = ~12,500 4K db blocks If RPB = 16 then 103,472 records = ~6,500 blocks Set –B2 to 15,000 (to be safe). 34 35 Designating Objects for B2 Entire Storage Areas (type 1 or type 2) can be designated via PROUTIL: Or individual objects that are in Type 2 areas can be designated via the data dictionary. – (The dictionary interface is “uniquely challenging”.) proutil db-name -C enableB2 area-name 35 36 37 Verifying B2 File-Name Index-Name ──────────────────────────────── customer entity loc-group oper-param supplier s_param unit customer customer city customer postal-code customer search-name customer telephone entity entity control-ent entity entity-name loc-group 37 38 Making Sure They DO Fit 05/30/11 OpenEdge Release 10 Monitor (R&D) 14:50:51 Activity Displays Menu 1. Summary 2. Servers ==> 3. Buffer Cache <== 4. Page Writers 5. BI Log 6. AI Log 7. Lock Table 8. I/O Operations by Type 9. I/O Operations by File 10. Space Allocation 11. Index 12. Record 13. Other Enter a number,, P, T, or X (? for help): 38 39 Making Sure They DO Fit 14:56:53 05/30/11 07:02 to 05/30/11 14:46 (7 hrs 44 min) Database Buffer Pool Logical reads K Logical writes O/S reads O/S writes Checkpoints Marked to checkpoint Flushed at checkpoint Writes deferred LRU skips LRU writes APW enqueues Database buffer pool hit ratio: 99 % … 39 40. 40 41. 41 42 Making Sure They DO Fit 05/30/11 OpenEdge Release 10 Monitor (R&D) 14:50:51 1. Database 2. Backup 3. Servers 4. Processes/Clients Files 6. Lock Table ==> 7. Buffer Cache <== 8. Logging Summary Shared Memory Segments 15. AI Extents 16. Database Service Manager 17. Servers By Broker 18. Client Database-Request Statement Cache... Enter a number,, P, T, or X (? for help): 42 43 Making Sure They DO Fit 05/31/11 Status: Buffer Cache 14:19:47 Total buffers: Hash table size: Used buffers: Empty buffers: On lru chain: On lru2 chain: On apw queue: 0 On ckp queue: Modified buffers: Marked for ckp: Last checkpoint number: 46 43 44 Making Sure They DO Fit find _latch no-lock where _latch-id = 24. display _latch with side-labels 1 column. _Latch-Name: MTL_LRU2 _Latch-Hold: 171 _Latch-Qhold: -1 _Latch-Type: MT_LT_SPIN _Latch-Wait: 0 _Latch-Lock: _Latch-Spin: 0 _Latch-Busy: 0 _Latch-Locked-Ti: 0 _Latch-Lock-Time: 0 _Latch-Wait-Time: 0 44 45 The Best Laid Plans… $ grep "LRU on alternate buffer pool" dbname.lg … ABL 93: (-----) LRU on alternate buffer pool now established. 45 46 Caveats Online backup can result in LRU2 being enabled Use “probkup online … –Bp 100” to prevent Might be fixed in 10.2B05 -B2 is silently ignored for OE Replication targets. “It’s on the list…” 46 47 47 Case Study 48 Case Study A customer with 1,500+ users. Average record reads 110,000/sec. -B is already quite large (40GB), IO rate is very low. 48 CPUs, very low utilization. Significant complaints about poor performance. Latch timeouts average > 2,000/sec with peaks much worse. Lots of “other vendor” speculation that “Progress can’t handle blah, blah, blah…” 48 49 Baseline Logical Reads Latch Timeouts “The Wall” 49 Ouch! 50 Case Study Two tables, one with just 16 records in it, the other with less than 100,000 were being read 1.25 billion times per day – 20% of read activity. 50 51 Case Study Two tables, one with just 16 records in it, the other with less than 100,000 were being read 1.25 billion times per day – 20% of read activity. Fixing the code is not a viable option. A few other (much less egregious) candidates for B2 were also identified. 51 52 Implement B2 52 Presto! 53 Baseline Logical Reads Latch Timeouts 53 54 Baseline With -B2 Logical Reads Latch Timeouts 54 55 Post Mortem Peak throughput doubled. Average throughput improved +50%. Latch Waits vanished. System Time as % of CPU time was greatly reduced. The company has been able to continue to grow! 55 56 Summary The improvement from increasing –B is proportional to the square root of the size of the increase. Increase –B by 4x, reduce IO ops to ½. -B2 can be a powerful tool in the tuning toolbox IF you have a latch contention problem. But -B2 is not a cure-all. 56 57 Questions? 57 Me: Slides: 58 Thank-you! Don’t forget your surveys! 58 Similar presentations © 2016 SlidePlayer.com Inc.
http://slideplayer.com/slide/3396979/
CC-MAIN-2016-50
refinedweb
2,280
67.15
Details - Type: Bug - Status: Resolved - Priority: Major - Resolution: Not A Bug - Affects Version/s: JRuby 1.7.0.pre1 - Fix Version/s: JRuby 1.7.0.pre1 - Component/s: Miscellaneous - Labels:None - Environment:Mac OSX 10.6.8, Ruby 1.9.3 preview 1, gem 1.8.10, rake 0.9.2.1, - Number of attachments : Description When drying to run the ant dist build task, there is a failure for the spec task. This is how I'm running the build task: ant -Djruby.default.ruby.version=1.9 dist The following error is displayed: [echo] Running rake install_dist_gems [echo] compile=OFF, threshold=20, objectspace=true threadpool=false reflection=false [java] (in /Users/chriswhite/github/jruby) [java] rake aborted! ------------------------------------------------------------------------ [java] undefined method `full_gem_path' for nil:NilClass [java] /Users/chriswhite/github/jruby/rakelib/spec.rake:157:in `(root)' ------------------------------------------------------------------------ [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:1874:in `in_namespace' [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:908:in `namespace' [java] /Users/chriswhite/github/jruby/rakelib/spec.rake:16:in `(root)' [java] org/jruby/RubyKernel.java:996:in `load' [java] /Users/chriswhite/github/jruby/rakelib/spec.rake:1612:in `load' [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:2430:in `load_imports' [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:2380:in `raw_load_rakefile' [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:2007:in `load_rakefile' [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:2058:in `standard_exception_handling' [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:2006:in `load_rakefile' [java] /Users/chriswhite/github/jruby/lib/ruby/1.9/rake.rb:1991:in `run' [java] /Users/chriswhite/Ruby/ruby-1.9.3/bin/rake:32:in `(root)' The particular line indicated by spec.rake:157 is: rake_location = File.join(Gem.loaded_specs['rake'].full_gem_path, "lib") A quick look at an irb session shows that Gem.loaded_specs is an empty hash, which would explain the issue. Unfortunately I'm not yet able to pinpoint why it's empty. Activity The build was set to 1.9 mode so it would be enabled by default upon running the jruby command line executable. This is mainly due to the fact that I do a lot more 1.9 work. As a test I ran the build as just `ant build && ant dist` and didn't get this error, but another error instead ( ). However since the error is in an unrelated location this should probably be reported as a separate bug if it doesn't exist. Unfortunately I'm about to head to sleep so I don't have the time to check up on that at the moment. I'm going to mark this as "Not a Bug" in the absence of more evidence. Why are you using the 1.9 mode in the dist target? I'm not sure if it gives you anything special. Also, we've had problems with the dist target recently, so this could very well be a variation of that problem. As of this writing (b9d59b0), the above command succeeds on my machine: Please try again. If confirmed, I'll resolve this as "Fixed".
http://jira.codehaus.org/browse/JRUBY-6068
CC-MAIN-2014-35
refinedweb
532
54.18
CSS page-break-after not working cross browser I tested page-break-after: always; with ie10 and firefox 22 - it works in both; in Chrome 30 it does not work. So its difficult to tell why it does not work for you in firefox 22. If your user base is mostly IE and firefox (like in our company). This will work: .pagebreak { page-break-after: always; } Apparently the support for css pagebreak is not ideal: pagebreak does not work in chrome or pagebreak not working in all browsers A search for chrome issues lead me to issue 99124 - Printed table content does not respect page-break CSS properties; reported on Oct 4, 2011 and still untriaged: Confirmed, not reviewed for priority and assignment. It seems that printing is just not important. Adding this css did not help either: @medi this may be help u out <div id="printpage"> //blah blah </div> <a href="#" onclick="printdiv()">Print</a> function printdiv() { //your print div data //alert(document.getElementById("printpage").innerHTML); var newstr=document.getElementById("printpage").innerHTML; var header='<header><div align="center"><h3 style="color:#EB5005"> Your HEader </h3></div><br></header><hr><br>' var footer ="Your Footer"; //You can set height width over here var popupWin = window.open('', '_blank', 'width=1100,height=600'); popupWin.document.open(); popupWin.document.write('<html> <body onload="window.print()">'+ newstr + '</html>' + footer); popupWin.document.clos Try this: .divTag p { page-break-before: always; } 'auto' only inserts a printing page break if determined necessary by the browser. Also, you may want to wrap that css like this: @media print { .divTag p { page-break-before: always; } } Or you can use this css: @media print { .page-break { display: block; page-break-before: always; } } And put the .page-break class on the element where you wish to have the break. Add an extra stylesheet to your page, and make use of the media element: <link rel='stylesheet' media='screen,print' href='css/standardstylesheet.css'> <!-- print stylesheet --> <link rel='stylesheet' media='print' href='css/printStyles.css'> In your print style sheet add selectors for elements you don't want to print, and set them to display:none: #myMenu, #myNavBar, #someOtherElement { display:none; /* Opacity:0; might work too. */ } You might have to adjust the CSS to ensure that elements don't move around when your selected no-printing elements have disappeared. I am most certain you are experiencing this issue because you have a video element on your page - most probably an MP4. If you disable this video / or have an OGV video instead, the printing should work fine. It is a bug in chrome itself due to limitations of Chrome's video implementation. It is also important to note that if the user prints manually with ctrl-p / cmd-p, print functions correctly Hope this helps :) I ran into the same problem today. One solution is a structure like this: <body> <div id="background" style="position: relative;"> <img src="bkgnd.png" style="position: absolute; z-index: -1;"> <div class="container" ...> ... </div> </div> </body> The basic idea is to take the image out of the flow but position it relative to its containing <div>. The z-index pushes it behind other elements. So this can be used as any kind of column header. One upside to this is that the background image will print even if the "background images" option isn't set in the print dialog. I'd like to see a proper solution as well though. Edit 2013/07/23: It looks like the CSS3 property will be box-decoration-break. This isn't going to help One posible solution, perhaps not the best option: 1. Open a new window with JS 2. Copy the whole table into the new window (with jQuery for example) 3. Print the new window 4. Close the window Sure it has a blink effect but It will work. I'm gonna suggest that you try using a CSS reset. Resets are supposed to help different browsers display the website in the same way. You could try the one at but I have never used it so I can't really say how it will work. You could also try googling for a CSS reset specifically for print styles... In your html, you need to put this somewhere in the body tag: <div id="footer"> page <span id="pagenumber"></span> of <span id="pagecount"></span> </div> And this should be your css/style: #footer { position: running(footer); text-align: right; } @page { @bottom-right { content: element(footer); } } #pagenumber:before { content: counter(page); } #pagecount:before { content: counter(pages); } You can learn more about that @bottom-right option here. Did you try and search for the answer first? This should help you... Link to your question that has already been answered I'm guessing that for, you've got the document root pointed to /domain1.com/, which means it will never be able to access files outside of the document root. You'll need to move the comingsoon.php file to the /domain1.com/ folder and include the same ErrorDocument. Another option is to include the full hostname in the original error document: ErrorDocument 403 But this will change the location in the browser's address bar. The necessary calls can be made to some of the underlying ODF objects which the SpreadsheetDocument provides access to. First, we need to get the proper document properties reference (for all examples, "spreadsheet" is a reference to a created SpreadsheetDocument): StyleMasterPageElement defaultPage = spreadsheet.getOfficeMasterStyles().getMasterPage("Default"); String pageLayoutName = defaultPage.getStylePageLayoutNameAttribute(); OdfStylePageLayout pageLayoutStyle = defaultPage.getAutomaticStyles().getPageLayout(pageLayoutName); PageLayoutProperties pageLayoutProps = PageLayoutProperties.getOrCreatePageLayoutProperties(pageLayoutStyle); Then, we can set the various properties, such as margins, orientation, and height/width. Note that the height and width values seem to Why don't you just use urllib2 + BeautifulSoup: import urllib2 from bs4 import BeautifulSoup url = "" # change to whatever your url is page = urllib2.urlopen(url).read() soup = BeautifulSoup(page) for i in soup.find_all('input'): print i FYI, I couldn't access the page you've provided due to ssl error, that's why the example is using another URL. Note, in case you need to fill the form or make some actions with inputs, you will need mechanize or similar tools. But, anyway, you may continue to use BeautifulSoup for parsing the html. Also, take a look at Selenium project. Since PDF is usually controlled by a plugin, you'd have to hook into the plugin to make it print properly. You might be able to force this to work using Mozilla's PDF.js on your site. It's built into Firefox, but you may be able to have it work with your site. You could dynamically change the print CSS based upon which button is clicked with something like this: Add an id to your stylesheet reference: <link rel="stylesheet" href="print1.css" id="printCss" media="print"> Add an on click event to your button: <input type="button" onclick="swapCss();"/> Dynamically swap the css file: function swapCss() { document.getElementById('printCss').href = 'print2.css'; } This is what works for me: <style type="text/css"> @media print { .printOnly { display: block !important; page-break-after: always; } #original_content { page-break-after: always; } } </style> <body> <div id="original_content"> ...(your original content)... </div> <div class="printOnly" style="display:none"> ...(basically a copy of original content, you can repeat this div multiple times if you need more than one copy)... </div> </body> I remember when I needed to do this. These 2 links are what got me through it very quickly and simply: You have to use CSS properties page-break-inside and/or page-break-after and/or page-break-before: and I guess for your needs it's fine to use page-break-inside only: HTML: <div class="dont-break-me"></div> CSS: div.dont-break-me{ page-break-inside: avoid; } This is quite a stretch, I'm not sure if this is possible but just to give you an idea on how it could be done you can add a global variable in the footer and put it in a textbox. Then set the visibility to be dependent on the textbox value. For example =IIF (footertextbox1.value = 2 Or 4 OR 6 Or 8, True,False) I don't have a general solution but I did manage to get page breaks working after some fiddling. Seems like UIWebView is a little finicky with where page-break-before/page-break-after can be applied. Taking a hint from this question I decided to try adding my page break styles to the h1 elements instead of divs and to my surprise the pagebreaks appeared. Here's what it looks like now: <style type="text/css"> @media print { .pagebreak-before:first-child { display: block; page-break-before: avoid; } .pagebreak-before { display: block; page-break-before: always; } } </style> ... <body> <h1 class="pagebreak-before">Page 1</h1> <p>Lorem ipsum dolor sit amet...</p> <h1 class="pagebreak-before">Page 2</h1> <p>. I'm not sure I understand your question entirely, but if I do, when you put them into the textarea they are shown one per line, but on printing them with PHP, they're all on the same line? If this is the case, it's because textareas use newline characters to create a line break. Browsers will interpret this as any other whitespace, so will print it just as a space. You can fix this in your php but using nl2br, e.g. nl2br($endwallPanels), which converts newline characters to HTML <br> characters. My answer is based on my helper class of printing textbox text. I have tweaked that sample for supporting listbox. Check out the below code. XAML <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <Canvas x: <StackPanel Margin="100"> <ListBox Height="500" Width="400" x: <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock FontSize="20"> <Run Text="Item name : "/> <Run Text="{Binding ItemName}" /> </TextBlock> <TextBlock FontSize="20"> <Run Text="Item code : "/> <Run Text="{Bi I am not quite sure how your HTML works, but a simpler way of doing this would be to add a separate media to your CSS. Then you would only need your original page, no need for opening a pop-up and moving data around: @media print { /*Put the way you want to format your page on printing here*/ } See the W3C reference here. Here's a good tutorial that walks through what I was talking about in my comment: you can reference css on difference mode(screen/print),then display:none on print's css <link type="text/css" media="screen" rel="stylesheet" href="normal.css"/> <link type="text/css" media="print" rel="stylesheet" href="print.css"/> If your button is outside of iframe, then the click action would set focus to parent window instead of the iframe that has content to get printed. refer this post if this is the case: Setting focus to iframe contents Either of these should work. <?php $logs = "PATH_TO_SERVER_LOGS/server.log"; $fh = fopen($logs, 'r'); $theData = fread($fh, filesize($logs)); fclose($fh); echo $theData; header("refresh: 5"); ?> <?php //Replace ./server.log with the path to your server logs and make sure apache has the proper //permissions to read the file. $file = file_get_contents('./server.log', true); echo $file; header("refresh: 5"); ?> The working of printDocument is like this: First the program reaches the printPage function, reads all the code and at the end of the function, if there exists a line e.hasMorePages = true; , then the program re-enters the function from the begining and read again the codes to print it to the next page and continues until it reads a line e.hasMorepages = false .. So u dont have to put a loop inside the function. What you have to do is to make variables inside the class, and incre or decrement the variables to make a condition that satisfies e.hasMorePages = false after your printing job has finished.. public void PD_PrintPage(object sender, PrintPageEventArgs e) { float W = e.MarginBounds.Width; // if you are calculating the whole page margin, then split it to carry 2 images I think the most ideal solution would be to change the style so that it was more printer friendly rather than making it into a pdf. If it really does have to be a pdf created with Javascript, there's a library jsPDF out there for creating pdfs with Javascript. You would have to write something on your own to parse the page to create a matching pdf. If you can use php, I recommend using dompdf, which was written specifically to translate webpages into pdfs, so there would be much less work involved there. I've actually used this library, and it seems decent, though it doesn't support all css styling. I don't know in what lenguage you want the code, and what varibles are using, but it's a way in java: int lines=3; int i = 0,aux=lines; lines=lines*2; do { if(lines>aux){System.out.print(i);if(i==4){lines--;System.out.println("");}if(lines>aux && i==4){i=-1;}} i++; if(lines!=0 && lines<=aux){System.out.print(i);if(i==9){lines--;i=4;System.out.println("");}} } while (lines>0); change the int lines to change the number of double lines you want in HTML the only way is using JavaScript, I hope this can help you! Here is an example showing this code working in a jsFiddle. I included jQuery just to make the event bind on the click a little easier. When you comment out the print() & close() - its a lot easier to check what happens. In that example, I appear to get exactly what you want. New window, correct content, link tag with the right href attribute. If you are having trouble with the css file, double check the file path. To be easier, you should probably just specify the full url for the css file:. it is just xml. All you have to do is curl that page or: $feed = file_get_contents(''); And after that to say: $rss = simplexml_load_string($feed); and then say foreach($rss as $r){ //in your case echo $r->title; echo $r->content; } Just use: save_and_open_page Capybara Reference For that to work you'll have to add the gem launchy to your Gemfile inside the test group: group :test do ... gem 'capybara' gem 'launchy' end I think you can do this in 2 ways: 1) you can use css styles for media screen print to hide those links while in print mode: @media print { .your-class { visibility: none; } } 2) you can use a gem like wicked_pdf () and generate your own views for pdf using a link on your page that will say like: "Print version" class ThingsController < ApplicationController def show respond_to do |format| format.html format.pdf do render :pdf => "file_name" end end end end Try first-child and last-child. For Instance, p {font-size: 20px;} p:first-child {...} /* Add your desired style here */ p:last-child {...} /* Add your desired style here */ You have to use .html instead of .append..... socket.onmessage = function(msg) { if(JSON.stringify(msg)!=null) $('#log').html('<p>'+JSON.stringify(msg[data])+'</p>') };
http://www.w3hello.com/questions/-ASP-NET-page-cutoff-occuring-when-I-try-to-print-a-page-
CC-MAIN-2018-17
refinedweb
2,518
64
You can subscribe to this list here. Showing 1 results of 1 Hi, I have a problem. I need to find specific date in datetime.datetime vector. Fox example, I've created a vector of dates and I want to find the positions with february month. In Matlab the code is: date1 = datenum([1981 1 1 0 0 0]); %date start date2 = datenum([2010 12 31 0 0 0]); %date end delta = datenum([2010 1 1 6 0 0]) - datenum([2010 1 1 0 0 0]); %interval - 6h dates = date1:delta:date2; %creating vector of dates dates = datevec(dates); %converting date to matrix my_positions = find(dates(:,2)==2); %searching the positions with month=2 (february) How is in numpy? How I search a specific date? The beginning of code is: import datetime date1 =datetime.datetime( 1981, 1, 1, 0, 0, 0); #date start date2 = datetime.datetime( 2010, 12, 31, 0, 0, 0); #date end delta = datetime.timedelta(hours=6); #interval - 6h dates = drange(date1, date2, delta); #creating vector of dates Thank's and best regards. Helvio P. Gregório
http://sourceforge.net/p/matplotlib/mailman/matplotlib-devel/?viewmonth=201105&viewday=24
CC-MAIN-2014-15
refinedweb
178
72.36
COBRA ADDER LAGARTO SUNCOB SUNBAKER SUNLAG LIZARD PORTOLIZARD STARLING SUNDOG SUNABLE2 PREFACE In mid-2007 - when doing field research in the Viqueque area of central Timor-Leste, my wife and I were approached by Timorese elders seeking assistance with a long-outstanding compensation claim for a Timorese WWII veteran of the Australian Army’s “ZSpecial Unit”. Subsequent correspondence with Australian officials in Canberra indicatedthat very little was known of that facet of Timorese assistance to Australia during WWII. Understandably, the exploits against the Japanese of the several hundred membersof the two Australian “Independent Companies” dominate Australian writing on Timor inWWII. This includes several works and memoirs written by participants. Very little hasbeen written on the operations in Portuguese Timor of the Services ReconnaissanceDepartment (SRD)/Z Special Unit that involved only a few score Australian militarypersonnel. In particular, this monograph attempts to relate the story of the Portuguesesubjects – principally Timorese, involved with SRD’s ill-fated “Special Operations”.1 When relating Timorese assistance to Australian troops, writers have tended tohighlight the role of the young Timorese criados (“personal assistants”), who - with anaverage age of about 13, provided invaluable and loyal service acting as guides, porters,sources of information and gatherers of food. However, more substantively, whole tribesand clans were trained and armed by the Australians to fight against the Japanese. About100 of the Portuguese and Timorese who were evacuated to Australia also served with theServices Reconnaissance Department. Many received formal commando and parachutetraining as SRD “operatives”. A number of these – wearing Australian uniforms, carryingAustralian weapons and under Australian command, returned to Portuguese Timor to fightthe Japanese – and few survived. Unrecognised and seemingly forgotten, this modest102,000-word monograph seeks to acknowledge and record their service. Over 600 Portuguese and Timorese were evacuated to Australia from PortugueseTimor during WWII. 28 of these evacuees were unjustly interned in Australia – many ofwhom had fought the Japanese alongside the Australian troops.2 The monograph alsorelates the story of these evacuees and internees. To provide context, the “native uprisings”and “native wars” of 1942 and 1943 – and their impact on Australian operations, areoutlined in the main text and also treated in more detail in a discrete annex. For ease of reference, Annex A to this work comprises “pen pictures” of Portugueseand Timorese associated with SRD/Z Special Unit.3 The monograph is also extensivelyfootnoted to facilitate access to the primary source material – particularly that held in theNational Archives of Australia and the Australian War Memorial. An index has also beenprovided. 1 Special Operations encompass intelligence gathering, sabotage, partisan and guerrilla warfare. The“Services Reconnaissance Department” (SRD) was the cover-name for the “Special Operations Australia”(SOA) organisation.2 These included Francisco Horta – the father of Timor-Leste President Jose Ramos Horta. Francisco Hortaalso briefly served with SRD in 1945 in preparation for Operation Starling into western Portuguese Timor.3. 3 Ernie Chamberlain26 January 2010 This monograph is copyright. Apart from any fair dealing for the purposes of private study,research, criticism or review as permitted under the Copyright Act, no part may bereproduced by any process, stored in a retrieval system, or transmitted in any form or byany means, electronic, mechanical photocopying or otherwise, without the prior writtenpermission of the author. Inquiries should be made to the publisher. Bibliography; Index. ISBN 978-0-9805623-2-3. Every effort has been made by the publisher/author to contact holders of copyright toobtain permission to reproduce copyright material. However, if any permissions have beeninadvertently overlooked, apologies are offered, and should the rightful party contact thepublisher, all due credit and necessary and reasonable arrangements will be made at theearliest opportunity FORGOTTEN MEN - TIMORESE IN SPECIALOPERATIONS DURING WORLD WAR II CONTENTS Page WORLD WAR II ADDER: 21 to 22 Aug 44 29 SUNBAKER: 17 May 45 332 THE EVACUEES 1942 37 Transfer to Africa ? 42 Operational Personnel 50 Casualties 51 Recruitment 52 Enlistment 54 Training Courses 61 Parachute Training 62 Morale 63 Stores (unusual) 64 Currency 64 Propaganda Leaflets 67 Deportados 70 Internment 71 DEPARTING AUSTRALIA 78 EPILOGUE 79 Redeeming “Surats” 83 Emigration to Australia 84 Forgotten or Ignored ? 87 Annexes Bibliography Index FORGOTTEN MEN - TIMORESE IN SPECIAL OPERATIONS DURING WORLD WAR II 4 Until World War II, Australia's status as a “Dominion” of the British Empire meant that its foreign relationswere mostly defined by the United Kingdom. In 1940, Australia had only four overseas missions. Relevantdiplomatic reporting of interest – including from Batavia, was provided by the UK to Australia (eg seeNational Archives of Australia - NAA: A981, TIM P 20).5 From 1933, Japan’s interest in Portuguese Timor – ie in its political, military and economic resources, iswell-described in Goto, K., “Japan and Portuguese Timor in the 1930s and early 1940s”, Tensions of Empire– Japan and Southeast Asia in the Colonial and Post-Colonial World, Ohio University Press, Athens, 2003.The “gaining of a foothold” by the Japanese Navy was to be implemented secretly through the activities of acommercial company – the Nanyo Kohatsu Kaisya (South Seas Development Company).6 British Consulate-General, No.125, Batavia, 30 August 1937 (NAA: A518, EX112/1, pp.46-47). GovernorFontoura attempted to “check the expansion” of Japanese interests, - and was subsequently appointed anhonorary Commander of the Order of the British Empire (CBE) by the British “in recognition of hisconsistently friendly and helpful attitude to the United Kingdom and Australian interests in PortugueseTimor.” (NAA: A981, TIM D 1, pp.333-336 and p.309).7 Lambert, E.T. (British Consul, Batavia), Report on Portuguese Timor, Batavia, 18 December 1937 (NAA:A981, TIM P 4 Part 2, pp.103-126; and A1838, 376/1/1, pp.288-358). Consul Lambert visited PortugueseTimor from 26 November to 7 December 1937.8 Bryant was born in Melbourne in 1882 and had worked in Portuguese Timor for at least 28 years. A letter(18 May 1939) to Acting Consul-General Lambert on Japanese and commercial activity is at NAA: A981,TIM P 20, pp.149-151. Although ill, Bryant survived the War in Dili – for a photograph of him boardingHMAS Warrnambool in September 1945 see NAA: A1838, TS377/3/3/2 Part 1, p.31. See also footnotes 9,18, 23 and 35.2 Intelligence Organisation”.9 However, the officer was withdrawn from Portuguese Timorin December 1939. The Lisbon Government resisted Japanese attempts to gain oil concessions inPortuguese Timor but welcomed Australian and UK efforts in 1939 and promoted anAnglo-Dutch arrangement to take over an unexploited Australian oil concession on thesouth coast. In 1939, the Japanese pressed for air flights to Portuguese Timor from theirmandated territory of Palau, and the Dai Nippon airline was granted six trial flights to beconducted in the period December 1940 and June 1941.10 In late December 1940, an Australian team from the Department of Civil Aviation(DCA) visited Dili to discuss an Australian air service to Portuguese Timor11 - and theparty’s other “important purpose” was “to secure intelligence information about thisterritory particularly as regards Japanese activities”. Subsequently, a DCA technicalofficer visited Dili in early 1941, and his “Intelligence Report on Portuguese Timor”included a listing of local personnel “who could be of use”.12 The managing director ofQantas Empire Airways - Hudson Fysh, visited Dili in January13 - and in mid-January1941, Australia established a direct Qantas service from Darwin to Dili. Mr D.D. Lauriewas appointed the Qantas station superintendent at Dili at the beginning of February 1941and given a “special duty to watch and report on Japanese activities in general” byHudson Fysh.14 Laurie handed over his Qantas duties to the incoming DCA technical representative- David Ross, who arrived on 13 April 1941 and acted in both capacities. The AustralianCabinet had instituted Ross’ appointment “ostensibly as the Civil Aviation representative” -but in addition he was “to report to the Australian Government on Intelligence questionsand on the commercial opportunities offering in that area.”15 Australia had wished toappoint Ross as an official representative of the Commonwealth, but the Portugueseresponded on 19 March 1941 that they preferred that the official appointed should “pass fora technical expert connected with the air service in order not to arouse the suspicions of theJapanese.”16 In mid-April 1941, the Director of Naval Intelligence proposed appointing anofficer to Dili ostensibly in the role of a Civil Aviation clerical officer – citing aAustralian War Cabinet agendum (No.109/1941 – February 1941) that directed theirmilitary intelligence services should arrange “for special watch to be kept by them on thepeaceful penetration by Japanese into Portuguese Timor … .”17 The Australian NavalBoard concurred and coordinated with DCA for a naval intelligence officer – Paymaster9 Navy Office, Memorandum 018820 43/85, Melbourne, 28 April 1941 (NAA: A981, TIM P 6, pp.56-57;NAA: B6121, 114G). Envisaged since 1934, similar Royal Navy (RN) appointments were made in 1939 toAmbon, Ende and Dobo – with the officers nominally civilian staff of the British Consul-General in Batavia.A report of 20 December 1939 from the RN officer in Dili is at NAA: A981, TIM P 20, p.128.10 However, the Portugal-Japan Air Agreement allowing regular bi-monthly flying boat flights was not signedin Lisbon until 23 October 1941 (NAA: A816, 6/301/333, pp.2-3).11 The 63-page report of the visit is at NAA: A816, 19/301/778 – the DCA party included D. Ross.12 Hodder, I.R., Intelligence Report on Portuguese Timor, Melbourne, 19 February 1941 – covering the visitperiod: 19 January – 4 February (NAA: A981, TIM P 11, pp.174-192). Hodder noted that George Bryant, anAustralian, was “thoroughly trustworthy”, “a true patriot” - and “had provided the British Consul General atBatavia with intelligence information” (p.190).13 Hudson Fysh, W., “Report on Japanese Penetration into Portuguese Timor”, Sydney, 24 January 1941(NAA: A981, TIM D 1 Part 2, pp.90-96; to the Australian Prime Minister – NAA: A1608, J41/1/9 Part 1,pp.320-332; NAA: A981, AUS 248, pp.155-161).14 Archer, C.H. (British Consul-General, Taiwan), Report on Portuguese Timor, Canberra, 3 May 1941, p.1(NAA: TIM D 1 Part 2, p.37).15 War Cabinet Minute 782, Sydney, 12 February 1941 (NAA: A2676, 782, p.3).16 Cabinet Agendum 561, 25 January 1941 (NAA: A981 TIM P 4 Part 2, p.74). 3 David Ross soon made useful contacts in Dili and noted in his first formal reportthat: “The senior radio operator at the Post Office speaks English and is pro-British andallows me to peruse all messages sent or received that day. I was therefore aware of thecancellation of the Japanese flight before the Governor, and possibly before the Japaneseaddressee. … there is some risk attached, especially to the radio operator, who no doubtwould be imprisoned if it were known … However he seems quite happy and very muchappreciates the small gifts which are given by me to keep him on the right side. …Strictly speaking, only messages concerning flying boat operations should be sent ((ie on17 Directorate of Naval Intelligence, Minute 43/85 – Portuguese Timor, Melbourne, 18 April 1941- the Minutedescribed the “great strategic importance to Japan” of Portuguese Timor, the “grave menace to shipping inthe East Indies area”, and noted that: “the Japanese have made determined efforts to effect peacefulpenetration and have established themselves in the fields of Banking, Commerce, Air and Sea Transport,Agriculture, Minerals including oil.” (NAA: B6121, 114G).18 Navy Office, Memorandum 018820 - 43/85, Melbourne, 28 April 1941 (NAA: 981 TIM P 6, p.57; NAA:B6121, 114G). The Memorandum noted: “it is not proposed that the Governor of Portuguese Timor be madecognisant of it ((ie “Mr” Whittaker’s tasks)), at least at this state, as, while his attitude is known to be pro-British, and however much he might welcome the appointment, he would probably feel himself under thenecessity of informing Lisbon, and it is desired to avoid this complication.”19 Archer, C.H. (British Consul-General, Taiwan), Report on Portuguese Timor, Canberra, 3 May 1941(NAA: A3300, 179, pp.1-53 including covering letter and errata; or Koepang draft of 29 April 1941 at NAA:A981, TIM P 9, pp.3-55 and pp.83-132. A printed copy of the report can also be found at NAA: A981, TIMD 1 Part 2, pp.37-76 and pp.78-88). His visit covered the period 26 March – 29 April 1941. Archer’s visit is amajor source for the comprehensive article - Lee, R., “Crisis in a Backwater – 1941 in Portuguese Timor”,Lusotopie 2000, September 2000, pp. 175-189. Archer noted that oil concessions were yet to be exploited and that current production was only eight tins ofkerosene per day.21 Bryant – see footnotes 5 and 9, continued as a useful informant for the British, advising the British Consul-General in Batavia in late May 1941 of Japanese flights to Dili and the activities of their air service’s “guard”vessel, Nicha [sic] Maru (NAA: A981 TRAD 105, p.83).22 In 1941, there were 90-100 Portuguese “political and social” deportados in Portuguese Timor – mostly“democrats”, communists and anarchists. Their numbers had peaked in late 1931 at more than 550 – but largenumbers returned to Portugal after an amnesty in December 1932 - see Cardoso, A.M., Timor na 2ª GuerraMundial – O Diario do Tenente Pires, CEHCP ISCTE, Lisboa, 2007.23 Archer, C.H., Report …, 3 May 1941, op.cit., p.9 (NAA: A981, TIM D 1 Part 2, p.45).4 the Qantas-provided A.S.9 radio operated by the Post Office)) and then only inrecognised form, but owing to the abovementioned good services of the operator I cansend or receive anything. Apart from the value of this contact, there is no charge made …”.24 In May, Ross noted the continuing “good offices of the operator Luz”, and that hecontinued to allow Ross to “read all messages”. As a personal gift, Ross bought Luz a“wristlet watch that he ((Luz)) had seen in an Australian catalogue” – “in view of thevalue he has been and will continue to be.”25 The senior radio operator referred to above -who assisted Ross, was Patrício da Luz. More formally, Ross proposed employing the expatriate Australian, George A.Bryant, as an interpreter – “and as a general intelligence reporter on all matters of interestto the Commonwealth.”26 This was approved in May at a salary of 32 patacas per week(2 pounds sterling). Bryant had been employed by the Staughton concession until 1938and - in 1941, was “in rather indigent circumstances”27 To address the naval intelligence tasks, Navy Office had appointed LieutenantF.J.A. Whittaker (RAN Volunteer Reserve) as its “Naval Intelligence Officer forPortuguese Timor”, and he “left Melbourne under the guise of ‘Mr Whittaker’, of theCivil Aviation Department” – and was due to arrive “via Koepang” on 10 June 1941. TheDirector of Naval Intelligence (DNI) noted that Lieutenant Whittaker “has had a numberof years practical experience in the Netherlands East Indies.”28 He was also “well-versedin the Malay tongue as spoken in the coastal areas in the Netherlands East Indies andTimor (both Dutch and Portuguese Timor).”29 Lieutenant Whittaker was tasked by DNIon 25 April 194130 and arrived in Dili via Koepang on 10 June 1941. Although Portugal had declared itself neutral31 in WWII, the British andAustralian Governments were concerned that Portugal might be occupied by theEuropean Axis powers – and Portuguese Timor could become an enemy-controlledterritory. The increasing threat of war with Japan also focussed Australian attention onPortuguese Timor.32 Acting as the “DCA and Qantas technical representative”, DavidRoss had lunch in early June with the Administrator of the Circunscrição of SãoDomingos (modern-day Baucau and Viqueque), Manuel de Jesus Pires – a “great friend”of George Bryant. Ross reported33 that Pires – a retired lieutenant and WWI veteran, was“an ardent supporter of anything British”, and added: “Although it is not generally knownof course, he is against the present Govt. in Portugal and, if internal trouble everdeveloped here, he would be the obvious leader. … if it became necessary for Australia,24 Ross, D., Report 1/701/213, Timor Dilli, 28 April 1941, pp.3-4 (NAA: A981, TIM P 6, pp.62-63).25 Ross, D., Report, Dilli, 23 May 1941 (NAA: A981 TIM P 11, p.142). Ross was later advised by DCA todefray the cost of the wristwatch against his entertainment allowance (NAA: A981, TIM P 11, p.140).26 Ross, D., letter to the Department of the Interior, Dilli, 17 April 1941 (NAA: P 11, p.159). Ross provided abrief biography of Bryant noting his “knowledge of the country and the high esteem in which he is held bythe native population.”27 NAA: A981, TIM P 6, p.12 and p.45.28 Director of Naval Intelligence, Memo – Portuguese Timor, Melbourne, June 1941 (NAA: A981, TIM P 6,p.23).29 Navy Office, Memorandum 43/85, Paymaster-Lieutenant F.J. Whittaker …, Melbourne, 28 April 1941(NAA: A981, TIM P 6, pp.56-57; B6121, 114G).30 Lieutenant Whittaker’s equipment included a Minox camera (NAA: B6121, 114G).31 For Portugal’s policy of “collaborative neutrality” from 1942 see Wylie, N. (ed), European Neutrals andNon-Belligerents during the Second World War, Cambridge University Press, Cambridge, 2002, pp.278-282;and Teixeira, L., Collaborating Neutrality, SNI, Lisbon, 1945.32 From mid-August, the Australian War Cabinet had proposed to the British that Portuguese Timor beoccupied if Portugal was invaded or occupied – “or in the event of war with Japan without invasion ofPortugal by Germany” - Australian War Cabinet Agendum 270/41, Occupation of Portuguese Timor,Canberra, 15 October 1941 (NAA: A6779, 19, p.45).33 Ross, D., Report, Dili, 8 June 1941 (NAA: A981, TIM P 11, pp.136-137). 5 or the Netherlands East Indies, to take over control of Portuguese Timor, Pires would bethe first and strongest man in the territory to act on our behalf. … Perhaps the authoritiesin Australia would be interested to learn that a man of his calibre is in Timor, and couldbe relied upon to act, in an emergency, for British interests. In addition to Pires, there areseveral other competent men who were deported by the Salazar Govt. in 1926. These mencould also be relied upon to act against the present regime and if necessary I can obtainthe names of these men for information.” In the report, Ross also noted the utility of hisongoing relationship with Patrício da Luz ie: “I am so friendly with the operator, that hewould give me copies of any messages which might be of value. He did so a few nightsago when I could not be present at the station … .”.34 In a following report, Ross namedPatrício da Luz as the “operator” ie “On 11 June the radio operator Luz showed me aradio message from Japan addressed to Segawa, who is the chief Japanese atSociedade.”35 In July 1941, the Director of Naval Intelligence in Melbourne begandisseminating extracts of reports from Lieutenant Whittaker to other Departments.36Whittaker “had obtained contact with a Portuguese lawyer who promises to become auseful source of information on all political matters pertaining to the Colony; this is MrMoreira Jnr. … deported from Angola … bitterly opposed to the Salazar Government …only one meeting with Moreira - arranged by Mr Bryant, it being necessary to visit hishouse by a devious route late at night and as infrequently as possible, as it would beunfortunate should our association become known. … Moreira and a number ofPortuguese in Timor, the majority of whom are stationed in Dili, have formed a groupwhose object, in the event of the Axis powers occupying Portugal, would be to seizepower here and declare the colony independent of Portugal. I have the names of thoseimplicated in this scheme and the list is detailed hereunder. At the head of this list are thenames of two men ((ie Dr Carlos Cal Brandão; Lieutenant Manuel de Jesus Pires)) who,in conjunction with Morreira Jnr., would automatically assume the leadership over theirfellow group members should such an eventuality as visualized by them ever arise.Moreira declares that it would be a comparatively simple matter to put their plan intoexecution, that the Non-Commissioned officers here, and in Baucau, are solidly behindPires and Dr. Brandao, and that the troops themselves could be set aside as indifferentand useless in the matter of defending the existing Government in Timor. I have only hada few minutes conversation with Dr. Brandan ((sic - ie Brandão)) who impresses me asbeing the most virile of all Dilli Portuguese that I have met up to date. I have not yet hadthe opportunity of meeting Pires, as he is stationed in Baucau, but according to Mr. Rosshe is probably the best type of Portuguese in Timor, very honest and healthily opposed tothe existing administration. … Moreira … is bitterly anti-fascists and opposed toanything Japanese … . The leading members of this group are37: -34 Ibid, p.133. In a subsequent report of 10 November 1941, Ross again referred to his access – throughPatrício da Luz, to Japanese messages on the movements of their flying boats (pp.24-25).35 Ross, D., Report, Dili, 21 June 1941 (NAA: A981, TIM P 11, p.116). By 1941, Japan was the majorinvestor in the plantation company Sociedade Agrícola Pátria e Trabalho (SAPT), owning 40 percent.36 Director of Naval Intelligence, N.I.D. 485/IIB – Internal Political Conditions in Portuguese Timor,Melbourne, 11 July 1941 (NAA: A981, TIM P 11, pp.106-108). Only pages 2 and 3 of Whittaker’s report toNaval Intelligence were apparently provided to the Department of External Affairs.37 Ibid, pp.107-108. This list was later included as “Appendix V – Pro-British Organisation in Dilli” in a NavyOffice multi-appendix report that outlined the “strategic importance” of Portuguese Timor and the currentsituation – noting that the “Pro-British Organisation” reported by Whittaker planned “to seize power ifGermany occupies Portugal - while there is a sufficient number of unreliable personalities in the communityto suspect a pro-Japanese group equally determined to attain power.”- Secretary - Navy Office, 037703 -Portuguese Timor, Melbourne, 14 August 1941 (NAA: A816, 19/301/803, pp.6-20). The commander ofSparrow Force in Kupang – Lieutenant Colonel W. Leggatt also reported to Australia that the “pro-British6 Whittaker’s report went on to list 16 Portuguese who – “in the opinion of Moreira and hisfriends, are Pro-Fascist and, in the case of some of them, very intimate with theJapanese.” A further listing comprised personnel whose “official status is important”, but“whose views are not definitely known to Moreira and his friends”. In mid-July, Whittaker travelled eastwards to Baucau and Lautem and reported indetail on the terrain and infrastructure. In Baucau, he met with the Administrator –Lieutenant Pires, who – following a visit to the Vila Salazar plateau 16km west of thetown, commented that the area “would make a most suitable aerodrome” for theAustralians and offered to “arrange for any necessary clearing”.38 In late July, Whittaker reported on the “Arab Population of Dilli”39 as follows:“As near as possible I estimate this at 34 male adults, I have a list of names covering 32,all of whom I consider to be pro-British. Some of these have been sounded out by myfriend Abdullah40, and some I personally have talked to re progress of the war andpolitical matters. One Arab is quite outstanding in the matter of education and politicalknowledge, rather a fine type, this is Abdullah Bin Umar Alcatirij ; he would appear tohave some influence with the other members of the community.” Whittaker also reported Portuguese in Dili could form a Government” - Wigmore, L., The Japanese Thrust, Australian War Memorial,Canberra, 1968, pp.470-471.38 Director of Naval Intelligence, N.I.D. 458/IIB, Melbourne, 5 August 1941 (NAA: A981, TIM P 11, pp.95-99). Ross and Bryant also participated in the visits to Baucau and Lautem. In Ross’ report of 20 July 1941,Ross related the assistance of Lieutenant Pires and Pires’ offer to clear a landing ground at Vila Salazar –reporting: “Pires is ready to prepare an area under my direction, to mark it for use by aircraft, and to saynothing about it to the Government here.” (NAA: A981, TIM P 11, p.101).39 Director of Naval Intelligence, N.I.D. 458/IIB, Melbourne, 18 August 1941 (NAA: A981, TIM P 11, pp.81-82).40 Whittaker is noted as paying £10 to Abdullah. At the time, £1 Australian was reportedly valued at 12.8patacas (NAA: B6121, 114G). Subsequently, in late December 1941/early 1942, the commander of theAustralian 2/2 Independent Company made an arrangement with the Governor of Portuguese Timor toestablish an exchange rate of one pataca = Australian 1/8d ie one shilling and eight pence (AWM54,571/2/3). This rate was applied by SRD finance officers in Australia - including to 1945. 7 on the activities of the Chinese – including the secret “Kwee Ming Tong” intelligenceservice, and nationals of other countries including Dutch and French nationals.41 In early April 1941, Japan had formally requested that Portugal agree to theestablishment of a Japanese Consul in Dili. Lisbon adopted “delaying tactics” andadvised that, when forced to submit, they would also concur to the establishment of aBritish Consul. A Japanese Consul was eventually appointed on 10 October 1941. DavidRoss was appointed the British and Commonwealth representative in late October 1941.42 In a press interview in early November 1941, Governor Carvalho was dismissiveof any “infiltration of any Japanese in Portuguese Timor” – noting that Japanese residentstotalled only 15. “While not expecting an attack”, he declared that “we will defendourselves with all the means at our disposal … Timor will never be easy prey for theaggressor.”43 In November 1941, Ross sought “some tangible recognition for Luz for hisassistance, and as recompense for the dangerous risk he takes in acting for us. If he werediscovered, a term of imprisonment would be certain, in addition to the loss of hisposition.” Ross was initially informed that he could claim £10 against his expenseaccount and “make a present to Luz of this amount as he thinks fit” – but difficultiesunder the “Audit Act” were raised.44 Subsequently, Ross sought to provide Luz with agift of a Melbourne-made morse “automatic transmitting key” – “Simplex Auto”.45 Areport by Ross in late November also related that he (Ross) had provided timing andfrequency data on Japanese coded messages to/from Dili – presumably obtained fromPatrício da Luz, to enable intercept in Darwin and forwarding to Naval Intelligence inMelbourne for decoding.46 WORLD WAR II 41 Director of Naval Intelligence, N.I.D. 458/IIB, Melbourne, 5 November 1941 (NAA: A981, TIM P 11,pp.32-33). In late October, Whittaker met with a “Kwee Ming Tong” (ie Kuomintang – Nationalist Chinese)agent in Dili and advised that intelligence collected by the “Kwee Ming Tong” in the Netherlands East Indiesand Portuguese Timor was forwarded to Chungking.42 Ross was appointed by London as “His Majesty’s Consul – Dilli” – “under the orders of theCommonwealth of Australia.” – Foreign Office, London, 23 October 1941 (NAA: A2937, 266, p.4). On 10December 1941, Lisbon advised the Governor of Portuguese to accept Ross as Consul. For backgroundpapers on the appointment see also NAA: A816, 19/301/822 File II.43 “Java Bode”, Batavia, 5 November 1941 (NAA: A816, 6/301/332, pp.3-4). In late October/earlyNovember, the Governor had told a visiting Dutch journalist that “Dilly could prevent an enemy landing for 3days, and within 3 days there would be help from the Netherlands or Australia.” – Navy Office, 064959,Melbourne, 19 December 1941 (NAA: A981, TIM P 4 Part 2, p.7)44 Department of External Affairs, Intelligence Service Timor, Canberra, 14 October 1941 (NAA: A981, TIMP 11, p.31). The Department of External Affairs advised that it “cannot be concerned in a transaction of thenature proposed”, but suggested that Ross claim reimbursement of up to £12.10.0 in official expenditureprovided he obtained a simple receipt from Luz.45 Ross, D., Report, Dili, 10 November 1941 (NAA: A981, TIM P 11, p.22).46 Ross, D., Report, Dili, 23 November 1941 (NAA: A981, TIM P 11, p.18). Whittaker also provided “exactcopies” of Japanese cables to the Director of Naval Intelligence – Director of Naval Intelligence, N.I.D.458/11B, Melbourne, 25 October 1941 (NAA: A981, TIM P 11, pp.34-35).8 Koepang disabled the Japanese vessel Nanyei Maru anchored off Dili.47 On 14December, an Australian force – “Sparrow Force” based on the 2/40th Infantry Battalionand including the 2/2 Independent Company, disembarked at Koepang. On 17December1941, in a “pre-emptive” operation – as a “strategical exigency” (the Britishterm), a combined force of 260 Dutch and 155 Australian troops landed in PortugueseTimor at Dili.48 The Governor refused to accept the landing as legitimate “as noaggression had taken place” – and Lisbon had required that any such Allied assistancewas only acceptable after a Japanese attack.49 In protest, almost all Portuguese officialsand military personnel50 in Dili were withdrawn south to the towns of Aileu andMaubisse. Whittaker became the liaison officer for the combined Dutch-Australian force -“which was entirely dependent on Ross and myself for intelligence information”.51During this period, the Australians associated with many Portuguese in the town and47 The Nanyei Maru – with a crew of 14, supported the Japanese civil air service Palau-Dili as the “guard”ship. Following the RAAF attack, the vessel ran aground on Kambing Island (Ataúro). Patrício da Luzreportedly provided communication support to facilitate the attack – see Australian War Memorialphotograph 121402 (taken in late 1945) of Luz with the Nanyei Maru in the background. Including the crewof the Nanyei Maru, the adult male Japanese population of Portuguese Timor in early December 1941 was 29– Director of Naval Intelligence, N.I.D. 458/11B, Melbourne, 24 December 1941 (NAA: A981, TIM P 11,pp.12-13).48 See Department of Defence, MS650 - “Report on Occupation of Dilli – Portuguese Timor”, Melbourne, 12January 1942 – including copies of the Allied force memorandum and the Governor’s note in response, bothdated 17 December 1941 (NAA: A816, 19/301/820A, pp.36-41; A981, TIM P 3 Part 1, pp.220-225). For theofficial Australian commentary on the “protective occupation” operation and the preceding fear of Japaneseinfluence, see Conference of Australian and New Zealand Ministers on Pacific Affairs, Pacific ConferencePapers, Section 1 – No.3, “Portuguese Timor”, Canberra, January 1944 (NAA: M2319, 4). For a summary ofcables, see “Portuguese Timor”, 20 February 1942 (NAA: A981, TIM P 3 Part 2, pp.13-18). See also Frei,H.P., “Japan’s reluctant decision to occupy Portuguese Timor: 1 January 1942 – 20 February 1942”,Australian Historical Studies, Vol 27 Issue 107, Melbourne, October 1996, pp.281-302. Frei and Goto, K.,“Japan …”, 2003, op,cit., - note that the Japanese occupation of Portuguese Timor was not decided in Tokyountil 20 January 1942 – ie five weeks after the Allied landing in Dili, and only included in the Japanesemilitary Battle Order 597 on 7 February 1942. The landing is described in Wray, C.C.H., Timor 1942,Hutchinson Australia, 1987, pp.22-29 and “first hand” in the report by Consul David Ross - Ross, D.,Portuguese Timor – December 1941 to June 1942, Melbourne, 29 July 1942 (NAA: A1067, PI46/2/9/1,pp.110-116).49 Governor Carvalho’s protest cablegram to the Australian Prime Minister is at NAA: A1196, 15/501/220,p.44. In mid-December – before the landing in Dili, officers of the Australian Department of External Affairssaw the Dutch/Australian landings as “dangerous politically” and had suggested that the Governor ofPortuguese Timor be pressed to “issue a contemplated invitation in view of the apprehended emergency.” –Brief to Minister, Department of External Affairs, Canberra, 15 December 1941 (NAA: A981, TIM P 3 Part1, pp.2-4). For a summary of Australia’s disquiet with the United Kingdom over the operation, see PrimeMinister’s Department, Cable 551, 23 December 1941 (NAA: A816, 19/301/820A, pp.137-138); and PrimeMinister Curtin’s terse cable to London - ie Cablegram 831, 26 December 1941 (NAA: A816, 19/301/820A,pp.118-120). Subsequently, in a cable to London almost at the War’s end, Australia cited Portugal as an“acquiescent spectator in the Pacific War” and for its “vacillation and timidity in the face of Japaneseaggression”- and also noted that Australia had borne the opprobrium for the UK’s request that Australianforces be committed to Portuguese Timor in mid-December 1941 “to help you in Europe”, and raised thepossibility of Portuguese Timor becoming a UN trust territory post-War - Australian Government, TelegramNo.269, Canberra, 3 September 1945 (NAA: A2937, 268, pp.87-88).50 Portuguese military strength in the Colony was reportedly 300 - including 15 Portuguese personnel, 10 agedartillery pieces, 10 machine guns and 570 rifles (mostly obsolescent) – External Affairs, Canberra, 27December 1941 (NAA: A816, 19/301/820A, p.111). The force comprised an Indigenous Light InfantryCompany (with an effective field strength of 170 privates), an Oekussi Detachment (15-strong), and aFrontier Cavalry Platoon (69-strong) – see History of the Portuguese Army: 1910-1945, Vol III.51 Directorate of Naval Intelligence, N.I.D. 458/11B, Melbourne, 7 January 1942 (NAA: A981, TIM P 11,pp.3-5). Whittaker’s report of 22 December 1941 also noted that Ross “entirely concurs with my activitiesbetween, and association with, ((Lieutenant Colonel)) Van Straaten and ((Major)) Spence.” 9 At the end of December 1941, the Australian Prime Minister advised London that:“Governor obstructing by all means within his power short of force … Ross recommendsthat if Governor Dilli does not cooperate Government be formed from pro-BritishPortuguese at Dilli and be supported by military forces”.56 On 30 December 1941, leavinga detachment at the Dili airfield, the Australian force in Portuguese Timor – 2/2Independent Company, moved to positions several kilometres west of the town; and laterto the Three Spurs area northwest of Dili. The Dutch force - mostly Netherlands EastIndies indigenous personnel, defended the Dili town area. According to an Australian war correspondent, “When the Australian troopsarrived in Dilli, the deportees were lined up told that if they assisted the Australiansagainst the Japanese, they would be shot. Despite this they attached themselves secretlyto the Australian forces. One of their best jobs was to save the life of an Australianofficial who had been invited to a dinner being given by the Japanese Consul. … ThreeJapanese armed with knives and pistols were found hidden along the track. They weredisarmed.”57 In early January 1942, Ross reported58 that “the policy of non-cooperation by theGovernor continues … and neither he or his officers appear in Dili … The Governor hasissued written instructions59 to all officers, both local and district, forbidding assistance ofany kind to our forces.” Ross’ report concluded: “It must not be forgotten that there are 52 David Ross later declared – “Moreira was scrupulously honest in all his dealings when supplying fresh foodsupplies &c for Australian & Dutch troops during the occupation of Dili” – and this was supported by aDutch Army officer, Captain Schreuder (NAA: MP742/1, 1/1/737 – see letter dated 19 August 1943).53 Directorate of Naval Intelligence, N.I.D. 458/11B, Melbourne, 7 January 1942 (NAA: A981, TIM P 11,pp.3-5).54 Ross, D., Cablegram, Timor Dilli, 26 January 1942 (NAA: A816, 19/301/820A, p.7).55 Carvalho, M. de Abreu, Relatório dos acontecimentos de Timor, Ministério das Colónias, Lisboa, 1947,p.83. For the official use of “race descriptors” by Portuguese officials eg as “Portuguese, Mestiço (mixedrace), Indígena Timorense, Diversos (eg to include Chinese) see footnote 495.56 Curtin, J. Prime Minister, Cable 844 – to London, Canberra, 30 December 1941 (NAA: A816 19/301/820A,p.93). For Ross’ report dated 28 December, see NAA: A1196, 15/501/220, pp.16-18.57 Sunday Telegraph, “Japs may get Timor Consulate”, Sydney, 19 November 1944 (NAA: A1838, 376/1/1,p.281). The article cited Tom Fairhall – a “war correspondent in Dilli before the Japanese occupation”.58 Ross, D., Report, Timor Dilli, 6 January 1942 (NAA: A981, TIM P 11, pp.9-11).59 The Governor’s instructions were also later issued in his Circular No.5 of 27 August 1943 regarding foreigninvading forces – and repeated in September 1943. The Portuguese military commander - Captain AntónioMaria Freire da Costa, similarly demanded “strict neutrality” by Portuguese military personnel: Callinan,B.J., Independent Company, William Heinemann Ltd, Melbourne, 1953, p.128.10 here in Timor a number of political deportees who are violently hostile to the Salazarregime in Portugal and who are just waiting for an opportunity to revolt. An internalrevolution can be started here at almost any time, and our forces could then take fullmilitary control to preserve order. In such event, which could be taken only as a lastresort to guard effectively against Japanese occupation, a guarantee of safety would haveto be given to the deportees who would start internal trouble, and they would also have tobe protected against the Portuguese Government so long as Salazar is in control.” Ross also became concerned that - since the Allied landing, Whittaker’s supportto the combined Allied force, had “completely compromised” Whittaker’s secretintelligence reporting role. Further, “his general activities over the past five or six monthshave shown to intelligent Portuguese that he was not a Civil Aviation officer, pure andsimple, but now it is known everywhere that he is directly connected with the militaryforces. … Whittaker must assume uniformed status or be posted elsewhere. … he isnothing but a known spy in a neutral country … If the Japanese should land … Whittakerwould receive short shrift if he were not in uniform.”61 Following negotiations beginning in the last week of December 1941, on 22January, an agreement was reached with the Portuguese Government that the Dutch-Australian force would withdraw to Dutch Timor62 when replaced by a 700-strongPortuguese force from Mozambique aboard the transport vessel MV João Belo – escorted 60 A poor photograph enlarged from a very small contact print – left to right: Lieutenant Colonel N.L.W. vanStraaten, Whittaker – back to camera, Ross – facing camera, Major Athol J. Wilson (Sparrow Force,Koepang). The photograph was taken by Lieutenant E.H. Medlin (Sparrow Force – Kupang) and provided tothe author by R. Wesley-Smith.61 Ross, D., Report, Dili, 7 January 1942 (NAA: A981, TIM P 11, p.8; A981, AUS 248, p.49).62 The Australian Sparrow Force commander had planned to employ the 2/2 Independent Company in DutchTimor as “a mobile reserve to safeguard the Koepang-Champlong line of communication.” - Wigmore, L.,The Japanese Thrust, Australian War Memorial, Canberra, 1968, p.475. 11 by the sloop Gonçalves Zarco (F 476), and expected to arrive in Dili on about 19February ie a 25-day passage.63 Japanese aircraft began attacks on Koepang on 26 January 1942. Such raidscontinued in the following weeks; and Dili was attacked by two Japanese aircraft on 8February – the “first authentic report of deliberate violation of Portuguese neutrality.”64 Afew days earlier, DNI had agreed that Whittaker should return to Melbourne, and Rossresponded that “Whittaker will return as soon as possible but there is no means oftransport now.”65 Japanese forces landed in both Dutch Timor and at Dili in the very early hours of20 February 1942.66 The Dutch force in Dili withdrew from the town and – in lateFebruary, the Australian 2/2 Independent Company withdrew westward from the Railacoarea to Vila Maria and Hatolia further inland. The Australian forces in Dutch Timor surrendered on 23 February 1942 - butremnants moved eastward to Portuguese Timor. The Sparrow Force commander fromKoepang - Brigadier Veale, established a headquarters in Portuguese Timor at Mape tocommand the remaining Australian troops from Koepang (about 200), the Dutch troops(about 200)67, and the 2/2 Independent Company (about 250-strong). During this phase,the force was assisted by several Portuguese administrators including Sr. Pereira of63 Secretary of State for Dominion Affairs, Cablegram 423/I.2970, London, 24 January 1942. Secret notes onthe agreed arrangements were exchanged between London and Lisbon on 22 January 1942 (NAA: A1608,J41/1/9 Part 2, p.57). The British had discussed the proposal in London in the last days of December 1941 –initially the Portuguese force from Mozambique was ready to depart on 30 December but did not leave until26 January 1942. The detail of the Allied withdrawal was later agreed at a conference at General Wavell’sABDA headquarters at Lembang (Bandung – Java) on 16 February - General Headquarters, Cablegram OPX-1860, Java, 17 February 1942 (NAA: A981, TIM P 3 Part 2, p.21). Detail of the Portuguese “expeditionaryforce” and the João Belo’s manifest is at British Consul-General, Cable, Lourenço Marques, 3 February 1942(NAA: A981, TIM P 3, Part 2, pp.3-6). Subsequently, the estimated date of arrival in Dili for the João Belowas reported as “the second week in March” – Dominion Office, 196, London, 14 February 1942 (NAA:A5954, 564/1, p.2). Following the Japanese landing on 19/20 February – and without assurances of safepassage from the Japanese, the João Belo and its escorting sloop were ordered by Lisbon to “heave to” on 2March and sailed instead for Colombo (NAA: A2937, 267, pp.9-16). On 26 March, the Portuguese pressreported that the mission had not been accomplished, and the vessels were in Mormugão (Portuguese Goa).After repairs and dry-docking in Bombay, the João Belo returned to Portuguese East Africa – The Argus,Melbourne, 8 May 1942, p.1. Post-War, the Portuguese Government stated that as “the expeditionary force… was nearing its destination … the attitude of the Japanese Government …varied from consent to thedisembarkation to a demand, based on grave dangers, for its postponement. … the Government was obligedto divert them to India to await another opportunity which was never to arise, of going to Timor.” - Presidentof the Council, Timor: Semi-Official Statement, Lisbon, 29 September 1945 (NAA: A981, TIM D 1 Part 2,pp.2-3). See also Sherlock, K., The Portuguese Expeditionary Force to Portuguese Timor, Darwin, 2005.64 Prime Minister’s Department, Cablegram 109, Canberra, 8 February 1942 (NAA: A1608, J41/1/9 Part 2,p.22).65 Ross, D., Cablegram, Timor Dilli, 3 February 1942 (NAA: A816, 19/301/821 Part 2, p.131).66 As noted earlier at footnote 45, according to a Japanese historian, Japan had not intended to attackPortuguese Timor – but the Allied stationing of forces there from 17 December 1941- in breach of Portugueseneutrality, precipitated Japan’s action. The attack on Dili was reportedly approved in Tokyo on 20 January1942 – Goto, K., “Japan …”, 2003 op.cit. See also Frei, H.P., “Japan’s reluctant decision to occupyPortuguese Timor: 1 January 1942 – 20 February 1942”, Australian Historical Studies, Vol 27 Issue 107,Melbourne, October 1996, pp.281-302; and Scott, D., Last Flight out of Dili, Pluto Press, North Melbourne,2005.67 Van Straaten, N.L.W. Lieutenant Colonel, Appreciation of the situation at Timor at the end of May 1942,Melbourne, June 1942 (NAA: B6121, 114C) provides detail on the Dutch (ie Netherlands East Indies - NEI)troops – ie 40 percent indigenous troops.12 Hatolia, Lieutenant Lopes of Lebos, Sr. Sousa Santos – the Administrator of the FronteiraCircumscription, Julio Madeira of Taco-Lulic [sic] 68 and Sergeant José FranciscoArranhado – Chefe de Posto, Letefoho.69 A small group of Portuguese – almost alldeportados and dubbed “The International Brigade” by the Australians, also foughtagainst the Japanese in the western area.70 Lieutenant H.J. Garnett of Sparrow Force ledthis mixed force – and the Australian force commander later commented that the Brigademembers were: “armed, equipped and treated as Australian soldiers in that they sharedthe risks, duties and food (and its lack on many occasions) of the Australians; and at thesame time rendered valuable service to the force.”71 68 See Wray, C.C.H., Timor 1942, op.cit., pp.74-91.69 Ibid, p.109.70 Ibid, p.97, 98, 105, 128. The group - six or seven strong, reportedly included Pedro Guia de Oliveira,Corporal João Vieira, Corporal José (Zeca) Rebelo, Alfredo dos Santos, Arsénio Filipe and Casimiro Paiva.Pedro “Guerre” (ie Guia) – with other deportados, smuggled a Qantas wireless set out of Dili for SparrowForce. Pedro Guia was evacuated to Darwin on 8/9 December 1942.71 Major B.J. Callinan (Commander Lancer Force), 9 March 1943 (NAA: MP742/1, 1/1/737). See alsoCallinan, B.J., Independent Company, William Heinemann Ltd, Melbourne, 1953, pp.131-132.72 Callinan, B.J., Independent Company, 1953, op.cit., pp.69-71.73 Ross described his approach to the Governor of Portuguese Timor on the surrender proposal andsubsequent discussions with the Japanese Consul in Ross, D., Portuguese Timor – December 1941 to June1942, Melbourne, 29 July 1942 (NAA: A1067, PI46/2/9/1, pp.110-116). See also Secretary of State forDominion Affairs, Cablegram No.455, London, 9 June 1942 (NAA: A1608, J41/1/9 Part 2, pp.50-51 - andalso A981, WAR 72, pp.41-45; A5954, 564/2, p.117, p.123). Governor Carvalho received Ross’ letter on 23May 1942 – see Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.262-287.74 Externally, the approach was initially made to the British Ambassador in Lisbon by the PortugueseSecretary General – Dr Sampayo, who stated that the initiative had come from Consul Ross, in writing, to theGovernor of Timor on 23 May. The Portuguese Ambassador in London also presented the proposal – seeSecretary of State for Dominion Affairs, Cablegram, No.457, London, 11 June (NAA: A1608, J41/1/9 Part 2,p.47).75 The Australian Government rejected the surrender proposal and advised such to Lisbon – see PrimeMinister, 5465, Canberra, 18 June 1942 (NAA: A1608, J41/1/9 Part 2, pp.41-43.) For precedingcorrespondence with General MacArthur that includes a summary of cables see NAA: A5954, 564/2, pp.105-109. The subsequent Advisory War Council Minute 968 of 17 June 1942 is at NAA: A5954 814/1, pp.76-77;A5954, 564/2, pp.103-104. 13 In mid-June 1942, the Japanese Consul provided Ross with a written surrenderoffer to Sparrow Force.76 Leaving Dili on 20 June, Ross travelled via Aileu, Maubisseand Ainaro to the Australian headquarters at Mape where the proposal was again rejected.Ross did not return to Dili, but was evacuated to Australia from the south coast on 8 July1942. 76 A copy of the Japanese surrender offer is at Callinan, B.J., Independent Company, 1953, op.cit., p.134.77 For the establishment and development of the Allied Intelligence Bureau (AIB), Special OperationsAustralia (SOA), Inter-Allied Services Department (ISD) - and its successor, the Services ReconnaissanceDepartment (SRD), see The Official History of the Operations and Administration of ‘Special OperationsAustralia’ (SOA) under the cover-name of ‘Services Reconnaissance Department’, Volume I – Organisation,Melbourne, 8 March 1946 (NAA: A3269, O7/A). For a very readable exposition, see also Powell, A., War byStealth – Australians and the Allied Intelligence Bureau 1942-1945, Melbourne University Press, Melbourne,1996 – particularly pp.66-75. ISD and its successor SRD operated “as a component part of A.I.B”, and itsoperations were approved by AIB (NAA: A3269, V5, p.7).78 As SRD, the headquarters was moved to “Harbury” in Acland Street, South Yarra. In December 1944,SRD’s “Group D” was established in Darwin (LMS) to control operations in Timor. In April 1945,responsibility for all SRD operations was transferred from the Melbourne headquarters to SRD AdvanceHeadquarters in Morotai.79 H.B. Manderson, aged 56, was a former journalist and cartographer “who had visited Portuguese Timor onnumerous occasions during the period 1919-1927” – a brief biography is at Annex F.80 Uniquely, Z Special Unit had no War Establishment nor Equipment Table – it was a “carte blanche”organization: “controlled, run and paid by ISD, it held a unique position in the Australian Army.” The Unitwas “the Holding Unit for AMF personnel employed in the cosmopolitan SRD.” – see The Official History… ,Vol I – Organisation, 1946, op.cit., p.8, p.23 (NAA: A3269, O7/A, p.21, p.36). Accordingly, it can beargued technically that Portuguese and Timorese personnel were not formally members of Z Special Unit –but rather employed by SRD.81.82 H.B. Manderson’s Timor Section Reports also covered “Reproduction” activities - including the productionof documents and counterfeit currency (see footnote 413), until mid-1944.14 Operatives also trained at the Army’s Guerrilla Warfare School at Tidal River(Wilson’s Promontory, VIC) until July 1942 (ie until the opening of ZES Cairns); at afacility at Cowan Creek (Hawkesbury River – NSW); at the Army’s Parachute TrainingSchool at RAAF base, Richmond (NSW) - and later at RAAF base, Leyburn (QLD). Aconsiderable number of Portuguese and Timorese ISD/SRD personnel were also attachedto the FELO86 unit at Camp Tasman (Indooroopilly, Brisbane) – principally duringtransits from Darwin to FCS or during leave periods. In May 1944, SRD operations were re-organised and thereafter managed by twodivisions: Nordops and Westops. In early July 1944, “Captain D. Dexter assumed dutiesof D/A ((ie Timor Section)) vice Mr H.B. Manderson. However, Manderson remained asadvisor on D/A’s area in addition to his present duties under D/Tech.”87 From August1944, Timor was placed under Nordops commanded by Major A.E.B. Trappes-Lomax.88From December 1944, with the re-organisation of SRD into area groups, “Group D” wascreated in Darwin to manage operations in Timor, Java89, Flores and the Banda Sea –83 SRD’s Leanyer communications station – approximately 19km by road from Darwin, commencedoperations in January 1945. Prior to that date, SRD communications from Timor were received at the Dutchcommunications station “DJF” at Batchelor, 80km south of Darwin – The Official History of the Operationsand Administration of ‘Special Operations Australia’ (SOA) under the cover-name of ‘ServicesReconnaissance Department’, Volume III – Communications, Melbourne, 8 March 1946, pp.6-11 (NAA:A3269, O9, pp.11-16).84 FCS comprised several camps including the “Lake Camp”, “Malay Camp”, “Filipino Camp” and the“Urangan Camp” (on the mainland opposite Fraser Island) – see NAA: A3269 Q10.85 The extensive limestone caves throughout islands of the Lesser Sundas were proposed as hideouts andstorage sites – see NAA: A3269, R20 for maps of limestone caves in Timor. In Portuguese Timor, theprincipal area of caves was in the far southeast of the island – in the Mount Paixão region of Lautem. Themap data also indicates limestone caves at Ossu, Quelicai, Matebian, Uatolari, from Baucau south to Venilale,around Viqueque town, and a few areas in Cova Lima and Bobonaro.86 The primary functions of the Far Eastern Liaison Office (FELO) were “propaganda against Japaneseforces” and “the mobilization of native opinion in the occupied areas.” – Department of External Affairs,Memo to Minister, Canberra, 25 June 1943 (NAA: A1066, PI45/1/1/23, pp.1-13). 2,500 propaganda leafletswere dropped on Dili in April 1943 – p.13. See also footnote 424.87 SRD, 265/D/15, Melbourne, 3 July 1944 (NAA: A3269, H4/B).88 See The Official History …, Vol I - Organisation, 1946, op.cit., p.17 (NAA: A3269, O7/A, p.30). In June1944, H.B. Manderson was moved to head the Reproduction Section in SRD’s Technical Directorate. MajorTrappes-Lomax reportedly had been critical of Manderson – Powell, A., War by Stealth, 1996, op.cit., p.134(citing PRO Kew, HS 7/99).89 For the inclusion of Java, see Officer Commanding Group D, Darwin, 25 February 1945 (NAA: A3269,D27/A, p.137). For coordination with the Netherland Forces Intelligence Service (NEFIS) on operations in 15 “subject to general direction from SRD HQ.”90 There were two “Country Sections”within Group D: “Portuguese Affairs” headed by Major T. Wigan (a British officer) and“Malay Affairs”.91 Java, see also DU, Java Memo, 22 March 1945 (NAA: A3269, D27/A, pp.105-107).90 Group D was initially under Major S. Bingham, and under Lieutenant Colonel Holland from June 1945.Lieutenant – later Captain, A. D. Stevenson was appointed D/A in charge of Timor operations. In early-mid1945, Java was added to the Group D area of operations.91 Group D Establishment, Darwin, 21 May 1945 (NAA: A3269, H4/B). The Country Sections wereresponsible for “advice, liaison and native personnel”. Major Wigan moved to Darwin in mid-April 1945from his position as D/Brisbane.92 Primary references are The Official History of the Operations and Administration of ‘Special OperationsAustralia’ (SOA) under the cover-name of ‘Services Reconnaissance Department’, Volume II – Operations,Melbourne, 8 March 1946 (NAA: A3269, O8/A) – and the individual files on each operation.93 For Captain I.S. Wylie’s (151) Report No.2, 26 July 1942, (ie the Commander until evacuated on 26 July1942 - see NAA: A3269, D6/A, pp. 78-80; and also his later report - ie “Extracts”, at pp.37-40. For acomprehensive report of OP LIZARD II and III, see Captain D.K. Broadhurst’s report of 8 March 1943 atpp.81-110. This report includes a listing of “Some Chiefs Used or Contacted …” – Appendix 9, pp.108-109.94 Sousa Santos advised Lieutenant Colonel A. Spence of Sparrow Force (in writing) that he desired hisfamily be evacuated to Australia if Portugal “goes to war against the Allies” and, if such occurred, he assuredSpence that he “and the people of this Circunscrição will in no way turn against you or your force, and wewill continue to assist you.” – Bobonaro, 29 June 1942 (NAA: A1067, PI46/2/9/1, p.117).95 See detail at Annex G.96 NAA: A981, TIM P 16, pp.60-66. However, in late October 1942 - through Sparrow Force, Sousa Santossent a message to Lisbon reporting the killing of Portuguese by the Japanese military and noting “Portuguesewish to be evacuated to Australia, but would remain willingly if wives and children were evacuated”. Themessage added that “Senhor Santos has elected to remain in Timor and attempt to safeguard Portugueseinterests” – Department of External Affairs, S.L.68, 29 October 1942 (NAA: A816, 19/301/821 Part 2, p.53).Sousa Santos and his family were not evacuated until 19 November 1942.16 Timorese “black column” (“colunas negras”) elements98 – incited and directed by theJapanese, massacred Portuguese officials – including the military commander, at Aileu(about 45km south of Dili) – and this seriously eroded Portuguese morale further.99 With the Japanese and their Timorese auxiliaries dominating in the western areasand pressuring Sparrow Force to move eastward, ISD assessed that: “The easternprovinces of Manatuto, São Domingos and Lautem were relatively clear of enemyintrusion. It was in the east that ISD looked for opportunities to counter Japaneseexpansion. … Near the eastern extremity of the island however, was the plain of Fuiloro,which had possibilities as an aerodrome site and required observation.”100 As LIZARD II101, an ISD party was inserted by a RAN vessel at Beaço on thesouthern coast of the São Domingos Circumscription on 2 September 1942 andestablished a temporary headquarters at Loihunu north of Viqueque Town. Theycontacted Lieutenant Manuel de Jesus Pires – the Circumscription Administrator of SãoDomingos, on 5 September in Baucau Town (“a most friendly reception”) and met againwith Pires near Venilale on 30 September.102 “Staunchly pro-Ally”, Lieutenant Piresassisted the party, providing “secret information services”. In early September 1942, H.B. Manderson, head of ISD’s Timor Section wrote anencouraging paper on prospects for “guerrilla operations” in São Domingos.103ISD signalled LIZARD in late September to use Lieutenant Pires to “stimulate anti-Japanese natives … especially in São Domingos and Lautem” and to “imbue Pires … 97 Wray, C.C.H., Timor 1942, 1987, op.cit., p.132 and Sparrow Force SITREP 1-11 September 1942(AWM54, 571/4/15) – for detail, see also Annex G.98.99 The killings were reportedly planned and directed by the Japanese civilian intelligence agency Otori Kikan– Takahashi, S., “The Japanese Intelligence Organization in Portuguese Timor”, Dili, 3 July 2009. Australiareported the killings at Aileu to London on 22 November 1942 (for advice to Lisbon) – Department ofExternal Affairs, Cablegram No.375, Canberra, 22 November 1942 (NAA: A981, TIM P 16, p.47).Portuguese Sergeant António Lourenço Martins had been detained by the Japanese at Aileu after the massacreand taken to Dili, but escaped. He provided the Australians with a comprehensive report on the situation inDili covering the period 3-16 October that precipitated successful RAAF B-24 bombing raids (The OfficialHistory … , Vol II – Operations, 1946, op.cit., p.20 - NAA: A3269, O8/A, p.33; D6/A, pp.41-42). Martinsdescribed his activities in Timor before an Aliens Tribunal in Adelaide on 29 February 1944 (NAA: A373,3685C, pp.58-61).100 The Official History … , Vol II – Operations, 1946, op.cit., p.12 (NAA: A3269, O8/A, p.25).101 For a comprehensive report on OP LIZARD II and III, see Captain D.K. Broadhurst’s (152) report of 8March 1943 (NAA: A3269, D6/A, pp.81-110) that included profiles of Lieutenant Pires and five Timoreseevacuated in February 1943 at p.98. Broadhurst’s earlier report of December 1942 (pp.27-33 – also at pp.114-123) also profiles “The Good Men” ie Lieutenant Pires, Dom Paulo da Silva (Chief of Ossu Rua),Sergeant Lourenço Martins, Matos e Silva – and “The Trash” (including Sousa Santos). Broadhurst alsostated: “not send Santos … has neither the respect nor love which the natives have for ABC ((ie Pires)) … tooexcitable … not known in this area … too free with feudal methods of keeping the natives subdued” – seealso p.29 and p.117 for Broadhurst’s criticism of Sousa Santos during the evacuation from Baucau to thesouth coast in early December. Lieutenant F. Holland’s report on LIZARD III operations in the MatebianMountain area – including support from Matos e Silva and the training of native groups in excess of 300, is atpp.124-131.102 LIZARD party member Lieutenant G.H. Greaves (451) had lived in Portuguese Timor for 10-15 years, had“a large number of Portuguese and Native friends” – including Lieutenant Pires and chiefs in the Ossu area,and “knew the native Tetum dialect and some Portuguese” - (The Official History … , Vol II – Operations,1946, op.cit., p.12 (NAA: A3269, O8/A, p.25; and A3269, D6/A, p.12 and p.38 for discussions with Pires).103 Manderson, H.B., Some Aspects of the Portuguese and Native Offer of Anti-Japanese Co-operation inEastern Timor, Melbourne, October/November 1942 (NAA: A3269, D6/A, pp.8-9 – repeated at pp.16-18).See also Manderson’s partial paper at pp.6-7. 17 assure him of all possible backing …” and queried “is it possible to get Pires out for aconference ?” Pires became the “principal Portuguese agent for LIZARD in Timor.”104 On 23 September, Sparrow Force was reinforced with the arrival from Darwin ofthe 2/4 Independent Company – and the Force (to be renamed “Lancer Force” from 18November 1942) became increasingly harassed by large groups of hostile Timoreseincited by the Japanese: “parties of fifty or sixty natives, urged on from the rear by two orthree Japanese, carried out raids against units at Mindelo and Turiscai. Almost daily,Australian patrols fought actions against these parties resulting in the deaths of ten,twenty or thirty natives – but only one or two Japanese.”105 In early October 1942, an operational plan for ISD/Z Special Unit’s LIZARDoperations in the eastern half of Portuguese Timor was approved that included the armingof Portuguese and “natives”.106 On 13 October 1942, ISD provided about 100 rifles toTimor, and the LIZARD party commenced the training of locals under the chief of Ossu,Dom Paulo da Silva. On 25 October – pressured by the Japanese-initiated native rebellions, theGovernor of Portuguese Timor accepted a Japanese ultimatum and directed that allPortuguese concentrate in camps west of Dili at Liquiçá, Maubara and Bazar Tete.107 104 NAA: A3269, D6/A, p.98.105 Wray, C.C.H., Timor 1942, 1987, op.cit., p.144.106 Z Special Unit, Melbourne, 7 October 1942 (NAA: A3269, D6/A, pp.13-17) in response to SRD,Melbourne, 5 October 1942 (NAA: A3269, D6/A, pp.10-12). Interestingly, the SRD plan noted that: “as faras possible, the whole scheme should be sponsored by the Portuguese themselves with our support behind thescenes. This will avoid any diplomatic complications and is likely to be much more affective [sic] than if wetake a direct hand.”107 For detail, see the following footnote 246. Earlier, at the end of June 1942, the Japanese had first proposed“tres zonas neutras” - Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.300-305.18 108 Fontoura, Á. da, O Trabalho dos Indígenas de Timor, Agência Geral das Colónias, Lisboa, 1942.109 In late October 1942, following killings in the western area, six Portuguese from Hatolia and Talorequested evacuation to Australia – “Portuguese … willing to join us if women and children evacuated” –Sparrow Force, Timor, 22 October 1942 (NAA: A981, WAR 72, p.5). The first evacuees departed PortugueseTimor on 7 November - ie: Ademar Rodrigues dos Santos (and family) – the Portuguese chefe de posto ofAinaro; and José da Silva Marques – the Portuguese chefe de posto of Hato-Udo - both in the western area(NAA: A981, TIM P 16, pp. 44-70). Ademar Santos – see Annex E, was later reportedly accused by SousaSantos of betraying the presence of HMAS Voyager at Betano to the Japanese (NAA: A367, C18000/861;A373, 3685B).110 Callinan, B.J. Major, Report on Situation: Western Portuguese Timor, Timor, 3 November 1942 (NAA:A1067, PI46/2/9/1, pp.20-23). His report summarised Japanese success in mobilising “natives”, detailing thekillings of Portuguese – including at Aileu, and recommended the arming of Portuguese. Callinan had earliermet with a group of 106 Portuguese at the Talo plantation (Hatolia) on 30 October 1942 - see Callinan, B.J.,Independent Company, 1953, op.cit., p.177.111 The appeal to General MacArthur was duly transmitted on 26 November (NAA: A3269, D6/A, pp. 44-45)and acknowledged.112 In their “efforts to build up a resistance movement”, ISD/SRD “had accounted for the introduction ofapproximately 750 rifles and a few Brens into the hands of native trainees or secret caches in the hills ofcentral São Domingos province.” - H.B. Manderson (SRD), Melbourne, 3 October 1945 (NAA: A1838,TS377/3/3/2 Part 1, p.63). Almost all rifles were .303” SMLE Lee Enfield bolt-action rifles. For single-shot“Congo” pistols later supplied to LAGARTO for issue to village heads, see footnote 380.113 NAA: A3269, D6/A, p.98.114 See Wray, C.C.H., Timor 1942, 1987, op.cit., pp.166-167 – describing the provision of arms and trainingby Lancer Force to “friendly natives” in the Fatu-Berliu area of southwestern Manatuto. 19 and Matebian areas south and south-east of Baucau Town. On 17 November, a group –including Administrator Sousa Santos (who had moved from Fronteira), were evacuatedfrom the south coast to Darwin aboard an RAN destroyer. From the Baucau countryside,Lieutenant Pires sent a letter to ISD citing the Japanese pressure and requesting “at least athousand men to stem the avalanche.”115 In late November, the LIZARD commander sought additional forces fromAustralia for offensive operations against the Japanese that would also involve a majormobilisation of pro-Australian Timorese auxiliaries. ISD Headquarters admonishedLIZARD ie: “You are not a fighting force and such action at present will ruin our plansof building up a secret resistance within the territory. Do you understand object of yourmission ?”116 On 8-9 December 1942, the Dutch destroyer Tjerk Hiddes evacuated a portion ofSparrow/Lancer Force and a large number of Portuguese and Timorese – includingdependants, associated with LIZARD.117 The Z Special Force LIZARD commander –Captain Broadhurst, provided three separate lists of the Portuguese and Timoreseevacuees, together with comments on individuals.118 In particular, he reported positivelyon: “Baltazar – Capt. ‘Okussi’ ((vessel)). Our man”; “Alexandré – Seaman, Our man”((ie Alexandré da Silva Tilman)); “João Fernandes (alias Lisboa) – very good man, youshould retain him … - of special service to us”; and João Gomes “Moreira Jr who hascare of the child of M. da Silva, Chief of Post, Calucai (sic – Quelicai), one of our bestmen.” 119 Portuguese and loyal natives impossible; food position hopeless; force too large forsafety; health bad and rapidly becoming worse; please treat as urgent.”122 On 10February, the 16 S Force personnel, the six Australian members of the LIZARD party –together with Lieutenant Pires123, Dom Paulo da Silva, Francisco da Silva, Cosme Soares,Domingos Freitas Soares, and Sancho da Silva (total 28) – were evacuated from the southcoast on the USS submarine Gudgeon (SS 211) to Fremantle (arriving 18 February)124.Regarding Lieutenant Pires and the Timorese, the SRD Official History later noted: “Allthese men were subsequently employed by SRD.”125 After the withdrawal of the Australian Lancer force and LIZARD/Pires parties, a60-strong group126 of Portuguese and Timorese – designated PORTOLIZARD, and led bySergeant António Lourenço Martins127 and Augusto Leal Matos e Silva128, continued tooperate and report from the Dilor River area on the south coast. PORTOLIZARD facedincreasing Japanese pressure - including attacks by “western natives” and “friendlynatives being turned against” them.129 However, despite the difficulties,PORTOLIZARD sent patrols to Dili in May - and also to Ainaro, and provided reports toSRD.130 On 29 May, they reported “natives sulky” and “fifty of us want to be evacuatedwhen the coast is clear.”131 On 9 June, the group was “pretty desperate” and requested“send over corvette.”132 On the night 1/2 July, the group received the incomingLAGARTO party led by Lieutenant Pires.133 Matos e Silva, five other prominentmembers of PORTOLIZARD and a number of porters elected to join LAGARTO.Subsequently, on 4-5 August 1943, several of the PORTOLIZARD personnel –including its co-commander (Sergeant António Lourenço Martins), together with a 122 ISD, 129 T14, Melbourne, 8 February 1943 (NAA: A3269, D6/A, p.60).123 Lieutenant Pires’ activities in the period 26 December 1942 - 18 February 1943 (his arrival in Fremantle)are covered in his diary ie pp.139-160 in Cardoso, A.M., Timor na 2ª Guerra Mundial…, 2007.124 The USS Gudgeon was returning from her patrol area in the Philippines and diverted to Timor on 9February for the extraction mission. “The Natives were allotted the battery room at the rear end of the suband they were very frightened’ – Lambert, G.E., Commando …, 1997,op.cit., p.234.125 The Official History … , Vol II – Operations, 1946, op.cit., p.19 (NAA: A3269, O8/A, p.32).126 For its composition, see Captain D.K. Broadhurst’s report of 8 March 1943 (NAA: A3269, D/6A, p.97) –PORTOLIZARD included eight armed Timorese radio operators trained by LIZARD and “five half-castePortuguese who were permanently attached to LIZARD as interpreters and first aid men”. Initially, SRDoften referred to the group as the “Porto W/T ((wireless telegraphy)) Section.” PORTOLIZARD was “armedwith 3 Brens (one left by Lancer), about 60 rifles, 8 Stens, one Thomson [sic] sub-machine gun … grenades… a few pistols … two ATR4 ((radio)) sets.” PORTOLIZARD also cared for an Australian soldier - PrivateD. Fitness, who had been too ill with malaria to be evacuated with S Force and LIZARD in early February1943 – but Private Fitness died on 21 May 1943.127 The “heroic” Sergeant António Lourenço da Costa Martins (H.45) had formed an armed “band”, joinedwith Lancer Force and “was held in high esteem by the LIZARD party”. For Sergeant Martins’ earlier reportson Japanese activity and dispositions in Dili, see footnote 96.128 Augusto Leal Matos e Silva - the chefe de posto at Laga and Quelicai, had been given the code-name“GPO” – ie “General Post Office”, by LIZARD in recognition of his encyclopaedic local knowledge andever-ready assistance.129 See folios on NAA: A3269, D4/G, pp.344-458 and reports on D6/A, pp.69-71 (12 February - 10 March1943), p.73, p.75, p.77; and summaries on D27/A, pp.66-77. Many of the group had earlier operated againstthe Japanese, including with LIZARD – and also included a small number of Cantonese Chinese and an illAustralian soldier who had not been evacuated earlier (ie Private D. Fitness).130 NAA: A3269, D4/G, p.376, p.380, and p.333 (Ainaro).131 NAA: A3269, D4/G, p.457.132 NAA: A3269, D4/G, p.416.133 See NAA: A3269, D4/G, pp. 338-346 for messages on the LAGARTO insertion. 21 number of civilian refugees134, were evacuated from Barique to Darwin by RAN FairmileMLs135 814, 815. SRD planned to send two new parties back into Portuguese Timor – one to be ledby Sousa Santos142 in the west, the other to be led by Lieutenant Pires in the east. ThePires group in Australia comprised Portuguese Sergeant José Francisco Arranhado,Portuguese Corporal Casimiro Augusto Paiva and Patrício da Luz (who – since hisevacuation, had been employed in Melbourne as a morse trainer at DCA, Essendon). On19 May 1943, the group left Melbourne and undertook Z Special Unit training in“Sydney” (probably at Cowan Creek, Hawkesbury River). Later in May, LieutenantPires, Sergeant Arranhado and Corporal Paiva – and possibly also Patrício da Luz,undertook “special training” – probably intelligence-related, at SRD’s Z ExperimentalStation in Cairns. Patrício da Luz reportedly remained at SRD headquarters at Airlie inMelbourne. In June 1943, the LAGARTO party assembled in Melbourne for four days ofbriefings on their tasks and practice in “ciphery”. On 12 June, SRD issued a six-pageoperational directive143 to Lieutenant Pires with the principal objective of creating andoperating “a secret network covering the eastern part of the country” – from Manatutoeastward to inclusive of Lautem. He was also enjoined to reconnoitre the western regionto prepare for the insertion of a similar group to be led by Sousa Santos.144 Pires wasdirected to select 50 people for evacuation to Australia. He “was informed that theLagarto party was under the operational control of Allied HQ Geographical Section.”145 Soon after in mid-June, the party146 travelled to Fremantle147 and embarked on theUS submarine USS-206 Gar148 on 18 June. The Gar arrived off the landing site on 28June, but could not contact the PORTOLIZARD shore party. When Sergeant Arranhadoand Corporal Paiva argued with Lieutenant Pires on the viability of the operation andrefused to disembark, Lieutenant Pires wanted to go ashore alone. SRD sent a message tothe submarine commander: “if others still refuse, ABC ((Pires)) to proceed alone. Theymust realize return here will involve segregation for duration.”149 Subsequently, the fullLAGARTO party (four) disembarked from the Gar at a colião (beachside lagoon)between the Luca and Dilor rivers very late on the night of 1 Jul 43 and were met bypersonnel from PORTOLIZARD.150 On landing, as planned, Pires recruited severalmembers of the PORTOLIZARD group for LAGARTO151 - including Augusto LealMatos e Silva (former chefe de posto at Laga and Quelicai), José Tinoco (former chefe deposto at Lacluta), João Rebelo (nephew of the “King of Manatuto”), Corporal JoãoVieira, Corporal Cipriano Vieira, Seraphim Joaquim Pinto (medical orderly), Procópio doRego (João Vieira’s radio operator), Domingos Amaral, Domingos Dilor, and RuiFernandes.152 146 Alexandré da Silva Tilman (a Timorese boatman/pilot on SRD’s LMS staff) is noted in two sources as amember of LAGARTO – see Cardoso, A.M., Timor na 2ª Guerra Mundial…, 2007, op.cit., p.94 and also inthe publication: Memorial de Dare, 2009 – but in these references he appears to have been confused with JoséArranhado (who was a LAGARTO member but is not recorded as such in those two references). The authorinterviewed Alexandré da Silva Tilman in Dili on 5 July 2009, and also viewed Captain J.L. Chipper’s(Commanding Officer, LMS) 1989 letter declaring Alexandré’s SRD service which did not includeparticipation in the LAGARTO insertion – see also footnote 145 below.147 Joined by SRD’s Captain I.R. Wylie (151) who did not accompany them to Timor.148 This was USS Gar’s (SS-206) eighth war patrol - ie departed Fremantle on 18 June 1943 and returned on23 July 1943 (34 days; 1,349 miles). Before landing LAGARTO, USS Gar reconnoitered Soembawa andKoepang. Following the landing, Gar undertook operations off Lautem, Dili and in the Makassar area.Accordingly, it seems highly unlikely that Alexandré da Silva Tilman was onboard during such a long patrol.Alexandré is not mentioned in the “Landing” report by the commander of USS Gar – see the followingfootnote.149 SRD (through US Navy), Melbourne, late June 1943 – NAA: A3269, D4/G, p.346. See also Powell, A.,War by Stealth …, 1996, op.cit., p.133. The Gar commander’s report cited LAGARTO as a “very poorlyorganised party” and described Pires as “almost completely blind and quite aged”. The Gar providedLAGARTO with a 16-ft boat, medicines and some food supplies – Quirk, P.D., USS Gar, SS206/A4-3,“Landing of Commandos on Timor”, 23 July 1942. Subsequently, General Headquarters South West PacificArea admonished the Director of SRD for the LAGARTO inadequacies.150 A Japanese document had reported on 21 July 1943: “A Portuguese 1st Lt Pirisu who is an espionage agent,landed on the south coast of Timor on 5 July by an Australian submarine.” – Captured Document Report, 18July 1944 (NAA: A3269, D4/B, p.26).151 On 11 July 1943, Pires advised that the LAGARTO group totaled about 52, and 70 people were ready forevacuation to Australia (NAA: A3269, D4/G, p.317).152 Matos e Silva, José Tinoco and Seraphim Pinto were included in Group D personnel lists in 1944-1945 and- together with Lieutenant Pires, in the Operation Groper Operation Order No. 25 “SRD Personnel Missing inTimor” of 30 August 1945 (NAA: A3269, D26/A, p.15).24 153 See NAA: A3269, D27/A, p.2 – the list is not dated, and author is not stated. However, Procópio do Regois noted as having stayed “with Lt. Pires” – indicating a document date after the LAGARTO insertion on 1July 1943.154 SRD, No.11, Melbourne, 19 July 1943 (NAA: A3269, D4/G, p.265).155 SRD, T73, Melbourne, 26 July 1943 (NAA: A3269, D4/G, p.235). Personnel were also mooted forintelligence training at Cairns.156 Comprising 47 male Portuguese, 18 male Timorese, 4 male Chinese, 12 females and six children. At theend of August 1943, 47 (including all women and children) were moved south from Darwin – “leaving about30 at LMS who were taken on strength by SRD” - The Official History …, Vol II – Operations, 1946, op.cit.,p.22 (NAA: A3269, O8/A, p.35).157 SRD saw these evacuations as a “tailor-made method of clearing landscape for ABC ((Pires)) of unwantedpersonnel greatly improving his security.” (NAA: A3269, D4/G, p.435).158 Alexandré da Silva Tilman (Timorese boatman/pilot) accompanied the RAN MLs - see request at: LMS,No.8, Darwin, 16 July 1943; and concurrence: SRD, T7, 17 July 1943 (NAA: A3269, D4/G, p.280 andp.279).159 SRD, No.T86, Melbourne, 14 September 1943 (NAA: A3269, D4/G, p.58).160 Including the brothers Câncio and Bernadino [sic] Noronha as radio operators (NAA: A3269, D4/G,p.200). At LMS, of the “86” - 18 were retained for training (four radio operators and 14 observers). 50 wereinitially scheduled for movement to Bob’s Farm, but some of the men were retained for support tasks at LMS– LMS, No.50, Darwin, 9 August 1943 (NAA: A3269, D4/G, p.185).161 LAGARTO message, Timor, 6 August 1943 (NAA: A3269, D4/G, p.201) – the text is quite garbled inparts.162 The signal stated “Soares” – this was most likely to have been the deportado Paulo Soares, but PorfírioCarlos Soares was subsequently interned, apparently mistakenly – see footnotes 444 and 478.163 “Paiva” was probably intended to be the deportado Domingos Paiva. However, SRD appears to haveassumed that Pires had meant Corporal Casimiro Paiva who had been included earlier on Pires’ list.Domingos Paiva was never interned in Australia.164 SRD, T99, Melbourne, 6 August 1943 (NAA: A3269, D4/G, p.193). 25 advised SRD Melbourne of the “blacklist 13 including Martins” and their “isolation”.165Following a query from Melbourne on the reasons for the black-listing, LMS replied:“Can get nothing concrete from CAL ((ie Carlos Cal Brandão)) or any other sources here.Pointers are that they threatened ABC ((ie Lieutenant Pires)) with evacuation or else.Nothing against Martins except perhaps jealous gossip. No good word for the two fromCairns ((ie Sergeant José Arranhado, Corporal Casimiro Paiva)) – they all know toomuch and it would seem that ABC ((Lieutenant Pires)) was frightened they would talk ifcaught and would do so at Newcastle ((ie Bob’s Farm)).”166 Following a series of tribulations167, on 29 September 1943 the LAGARTO groupwas attacked by a Japanese and native force near Cape Bigono on the north coast. Pires,Ellwood and several Timorese were captured – of those embarked from Australia, onlyPatrício da Luz escaped. Under Japanese control, Ellwood was forced to continuewireless communication with SRD. Lieutenant Pires died in captivity – probably in lateJanuary 1944.168 In February 1944, SRD proposed sending the two Noronha brothers (Bernardinoand Câncio) and Zeca Rebelo to join LAGARTO169 and, in May, to man a LAGARTOobservation point (OP) at Kuri or Isuum Mountain in the Manatuto area.170 Only in mid-March 1945 – ie 18 months after their capture, did SRD suspect thatthe LAGARTO team had been compromised171 – confirmed when Lieutenant Stevenson(OP SUNLAG) sighted Ellwood under Japanese control on 1 July 1945 (see footnote 165 It appears that LMS had removed the deportado António de Almeida Albuquerque - for reasons unknown,from Pires’ list of 14 “very bad men” and, on 9 August, inserted Sergeant António Lourenço Martins (NAA:A3269, D4/G, p.185). SRD also appears to have assumed that “Paiva” had been a second reference toCasimiro Paiva – see footnote 160 above (NAA: A3269, D4/G, p.185). The 12 (ie less Sergeant Martins whoremained in Darwin for some further weeks) were moved south from Darwin and, on arrival in Brisbane on10 September, were formally interned by the Australian authorities at the Gaythorne Internment Camp.António Albuquerque moved to Bob’s Farm. Those interned at Gaythorne were soon moved to the LiverpoolInternment Camp (Sydney) – where they were later joined in internment by several other deportados fromBob’s Farm on 23 September 1943.166 LMS, No.78, Darwin, 16 August 1943 (NAA: A3269, D4/G, p.140).167 An OP group led by Corporal Vieira departed for Dili on 12 August – and sent their first report on 14August (NAA: A3269, D4/G, p.149). He returned to the LAGARTO base via Remexio/Laclo on 24September but lost many of his party enroute (NAA: A3269, D4/G, pp.28-29). Vieira’s (ie JVP) party wasalso termed the “NEWT” party by LMS (ie NEWT as a small lizard – ie of LAGARTO meaning LIZARD) -see NAA: A3269, L2. Lieutenant Pires - harassed by the Japanese and hostile Timorese, desperately signalledan “invasion plan” on 12 August that urged a “Blamey landing between Tualo and Irabere” on the south coast(NAA: A3269, D4/G, p.164). On 15 August, SRD replied: “not this moment. Must fit in with wider scheme… remain underground” (p.145). The LAGARTO party became too large (34) and unmanageable – a“bloody farce”, “too big, clumsy” and a “circus” according to Ellwood in early September – see NAA:A3269, D4/C, p.157, p.162. In frustration, H.B. Manderson signalled Lieutenant Pires – SRD, No.31, 7September 1943: “Caramba Manuel, how do you expect to be able to hide so many ? Not a secret party but asmall army.” (NAA: A3269, D4/G, p.81). On 25 September, Ellwood (promoted Lieutenant from 15September) advised SRD: “Quite impossible for us to stay any longer” – and sought extraction of the groupby Catalina flying boat or submarine (NAA: A3269, D4/G, pp.30-31). On 27 September 1943, SRD replied“Regret RAAF state flying boat out of the question. Only alternative is evacuation from South Coast.” (NAA:A3269, D4/G, p.33).168 On 2 February 1944, the Japanese (ie acting as LAGARTO) signalled SRD that Lieutenant Pires had fallenill on 12 January and was “growing more and more weak” (A3269, D4/C, p.95). Soon after - on 5 February1944, the Japanese (as LAGARTO) signalled that “ABC died on 4 Feb 44” from malaria (NAA: A3269,D4/C, p.94 and D4/A, p.427 of 15 February 1944). See also detail at Annex A.169 SRD, No.40, 26 February 1944 (NAA: 3269, D4/C, p.252).170 See NAA: A3269, D4/C, p.252, p.228 - and the positive reply from LAGARTO (under Japanese control)at p.59.171 Only on 24 April 1945 did SRD finally suspect that LAGARTO and COBRA had been compromised andamended plans to relieve the two parties (NAA: A3269, D27/A, p.19, p.32).26 228). Of the LAGARTO party, only Ellwood (a prisoner of war) and Patrício da Luz(who escaped capture) survived the War.172 172 The demise of the LAGARTO operation is summarized in The Official History …, Vol II – Operations,1946, op.cit., pp.24-34 (NAA: A3269, O8/A, pp.37-48); and a personal account of the operation is inEllwood, A.J., Operational Report on Lagarto, October 1945 (NAA: A3269, V17, pp.144-165) – see alsonotes on LAGARTO personnel at Annex A. Detail and discussion can also be found in Powell, A., War byStealth …, 1996, op.cit., pp.132-138. In its continuing communication with the Japanese-controlledLAGARTO, on 24 December 1943 SRD advised LAGARTO of the organisation’s “need for more trainees”(A3269, D4/C, p.272). In March 1945, SRD proposed extracting both Ellwood of LAGARTO and Cashmanof COBRA to Australia for “relief” (NAA: A3269, D27/A, p.78).173 Department of the Interior, Canberra, 30 August 1943 – Paulo da Silva was described as “a rather fine type… worrying concerning his absence from his own people” (NAA: A3269, D3/G, p.34).174 After extraction to Australia, Paulo had been in Melbourne for several weeks with Lieutenant Pires. SRDnoted that Lieutenant Pires was critical of Paulo – claiming that Paulo had “no prestige or importance inMatabia or Baucau area”, preferring his brother Manuel. SRD however was skeptical of Pires’ views (NAA:A3269, D3/G, pp.30-31).175 “We suggest you might use them as advanced recce in eastern Sao Domingos say at Matabea. Our opiniontheir offer warrants serious consideration and not be lightly discarded in view your difficult situation” –NAA: A3269, D4/C, p.311.176 The “Paulo group” comprised: Paulo da Silva (chief of Ossu Rua), Francisco Freitas da Silva (his youngerbrother), Cosme Freitas Soares (chief of Leti Mumu, Paulo da Silva’s cousin), Domingos Freitas Soares(brother of Cosme), and Sancho da Silva (of Ossu Rua).177 Domingos Freitas Soares had initially volunteered – but “for family reasons” elected to remain at Bob’sFarm. Speaking several languages and educated in Macau, Domingos Freitas Soares was hoped to be “anacquisition” for SRD “in many ways”. (NAA: A3269, D3/G, pp.29).178 Although Francisco da Silva was also with the group at the Fraser Island Commando School, he was notincluded in the proposal (NAA: A3269, D3/G, pp.28-32).179 Cobra Operation – Directive, Melbourne, 22 December 1943 (NAA: A3269, D3/G, pp.22-23). LieutenantCashman was enjoined by SRD to “avoid irrevocable enmeshment in any of the local political tribulations.”The group’s training schedule at Fraser Island is outlined at pp.2-3; and it was noted that Domingos FreitasSoares was hoped to arrive at Fraser Island “after Xmas” 1943 from Bob’s Farm. 27 accompany the Fairmile to assist the surf landing and the subsequent burial ofsupplies.”180 The COBRA party was landed on 27 January 1944 at Darabei from RAN FairmileML 814. However, the group had been compromised181 and was ambushed within hoursof landing by a waiting Japanese party. The two Australians (Cashman and Liversidge)and Cosme Soares were captured – and Paulo da Silva and Sancho da Silva werecaptured 12-14 days later.182 Unaware that the COBRA party had been captured, SRD stressed in messages tothem the importance of “our need for more trainees. Make your selection over wide areaas possible covering key postos. Am asking Lagarto and Tinoco do same.”183 On 18 February 1944, the Allied signals intelligence service had intercepted aJapanese message to the “Vice Minister of War” in Tokyo “giving an account of thequestioning of LT. Cashman (Aust. Army) on Timor Island.”184 Several SRD staff wereroutinely provided with such “Top Secret Ultra” intelligence by the Central Bureau, andon 28 February H.B. Manderson – the head of SRD’s Timor Section, signaled COBRAseeking to elicit a response with the agreed authentication word “slender”. As noimmediate reply was received from COBRA, SRD 27ignalle LAGARTO in the period 2-7 March – referring to a “Jap intercept” and requesting that Matos e Silva contactCOBRA and directing Cashman to respond using the agreed authentication “slender”.185Cashman responded belatedly186 on 6 March with the “slender” authentication to whichManderson replied on 7 March: “big relief. Col ((Lieutenant Colonel P.J.F. Chapman-Walker)) Maj C and all here sick at heart past week due intercept Jap cipher naming you personally and apparently claiming your capture Jan 29. You must have moved just in nick of time. Good work and congrats.”187 180 NAA: A3269, D3/G, p.18. Captain J.L. Chipper from LMS also accompanied the party for the landingphase. Detail on COBRA’s weapons, equipment and stores is at pp.9-16. The Australians were armed withAusten sub-machine guns and .32 automatic pistols. The Timorese were armed with .32 automatic pistols.181 As related earlier, after the capture of LAGARTO, the Japanese in Dili continued LAGARTO’scommunications with SRD – and were awaiting future parties ie COBRA, ADDER, and SRD reliefoperations. This Japanese deception and the Australian security failure is described in The Official History…, Vol II – Operations, 1946, op.cit., pp.30-34 (NAA: A3269, O8/A, pp.43-47).182 The COBRA operation is summarized in The Official History …, Vol II – Operations, 1946, op.cit., pp.35-41 (NAA: A3269, O8/A, pp.49-54); and a personal account is in Cashman, J.R.P., Report on Cobra Party,Melbourne, 23 October 1945 (NAA: A3269, V17, pp.139-145). See also Powell, A., War by Stealth …, 1996,op.cit., pp.132-138.183 SRD, No.6, Melbourne, 26 February 1944 (NAA: A3269, D3/D, p.207).184 Central Bureau, The Activities of Australian Secret Intelligence and Special Operations Sections, Brisbane,1 September 1945 (NAA: A6923, SI/1, p.9, p.11, p.12, p.15). The Central Bureau report cited both 18February 1944 (three times) and 18 February 1945 (once) for this intercept. As the COBRA party leader -Lieutenant Cashman, was captured on 27 January 1944, it is almost certain that the intercepted Japanesemessage to Tokyo was dated 18 February 1944. Copies of this formal summary report were passed to theController of AIB and the Director of Military Intelligence. Reporting of the individual intercepts ie as TopSecret Ultra “spot reports” was also passed far earlier to these entities ie within a few days of the interceptfollowing Central Bureau translation and analysis.185 NAA: A3269, D4/C, pp. 244-251.186 Cashman was brutally tortured by his Japanese captors to force his disclosure of the authentication.187 SRD, No.10, Melbourne, 7 March 1944 (NAA: A3269, D3/D, p.201). This message was an extremelyserious breach of security as it identified that Central Bureau was intercepting and decrypting Japanese highgrade cipher messages to Tokyo. The series of messages can be found as follows: SRD 28 February: D3/D,p.206; COBRA 6 March: D3/E, p.112 ; SRD 7 March: D3/D, p.201; COBRA 11 March: D3/E, p.110; andLAGARTO: D4/C, pp.244-251.28 ADDER: 21 to 22 Aug 44 COBRA leaders – LAGARTO replied that its copies of the questionnaire had beendestroyed; and COBRA advised that “they still held their sheets”195 Following discussionwith Central Bureau in Brisbane, SRD Brisbane advised SRD Melbourne that the“questionnaire picked up by Japs not the same as those sent Cobra and Lagarto.”196 In mid-April, the SRD Director assessed that LAGARTO and COBRA were still operational – butbelieved “our codes with these Parties will have been broken down by now, and they areprobably remaining unmolested because the Japs like to read our signals. This may be avaluable weapon in our hands …”. The SRD assessment also concluded that a partymember “was in contact with the Japanese … suspicion falls on MATSILVA in Cobra”.197 SRD elected to have LAGARTO “continue to work” and assumed that “Cobra arealso compromised”.198 However, in late May 1945, following a review of the translation ofthe intercepted Japanese message referring to the AIB questionnaire, SRD concluded “nowno doubt whatsoever that it was the document dropped to Lagarto on January 19th … partiesprobably compromised. LAGARTOUT and COBRAEXIT will have to be replanned.”199 Despite the indications that the LAGARTO and COBRA parties had been captured,were under Japanese control, security compromised and SRD deceived,200 SRD continuedto report positively on their parties and disseminate information from Portuguese Timorwithout any qualification. On 6 April 1945, in a comprehensive “Memorandum ofOperations …”201, SRD headquarters reported on Portuguese Timor: “Two partieshave been continually maintained in this area and have produced information of value tothe R.A.A.F. They also now have extensive contacts in the area and provide a nucleusfor a local guerrilla movement at any time that this may be required” - … “Vemori202 ((ie LAGARTO)) and Guruda203 ((COBRA)): These parties have regularly forwarded information regarding bombing targets. They have extensive local contacts. The party leaders are shortly to be relieved.” In June 1945, in a “Memorandum of Organisation”, the Director of SRD reported that “theparties long established in TIMOR have continued their operations. As soon as aircraft of200 Flight are available, these parties will be relieved. With the withdrawal of the Japanesefrom Timor, it is hoped to extend the influence of these parties.204 Subsequently, Captain A.D. Stevenson’s observation of Captain Ellwood underJapanese control on 1 July 1945 (see the following OP SUNLAG paragraphs) convinced Hollandia queried progress on 29 March 1945 and noted that it was in contact with Group D in Darwin on theissue – see p.82.195 NAA: A3269, D27/A, pp.36-40 – concluding with SRD, QL32, Hollandia, 9 April 1945 – p.40.196 SRD, Brisbane, BZ84, 2 April 1945 (NAA: A3269, D27/A, p.76, p.36).197 SRD Advanced HQ, No.131, Morotai, 16 April 1945 (NAA: A3269, D27/A, p.32) – ((Note: Matos e Silvawas with LAGARTO, not COBRA)).198 SRD, 460C, Melbourne, 24 April 1945 (NAA: A3269, D27/A, p.19).199 SRD, BM10, Brisbane, 24 April 1945 (NAA: A3269, D4/A, p.342).200 As noted above, the Japanese deception and the SRD security failures are described in The Official History…, Vol II - Operations, 1946 op.cit., pp.32-36 (NAA: A3269, O8/A, pp.43-47).201 SRD, Memorandum on Operations, Organisation and Personnel Requirements of Services ReconnaissanceDepartment, 6 April 1945 – p.2 and Schedule of Operations (Appendix B), p.4 (NAA: A3269, V5, pp.25-36).202 Vemori - 126° 13’ E, 08° 38’ S (A3269, M3/B).203 Guruda – in the area of the Vei Aka River, about 12km southwest of Laga ie 126° 32’ E 08° 36’ S(A3269, M3/B).204 Director SRD (to Commander-in-Chief of the A.M.F), Memorandum of Organisation, Morotai, 25 June1945, p.8 (NAA: A3269, V5, p.18; M1/A, p.68). This Memorandum also illustrates that SRD operations in1945 had moved from New Guinea and Portuguese Timor and were predominantly in the Group A, B and Careas ie respectively: Sarawak, British North Borneo and Brunei; Moluccas, Hamalheras andCelebes/Sulawesi; the Balikpapan area of Borneo (from May 1945).30 SRD that both the LAGARTO and COBRA parties had been captured. However, AIBcontinued to disseminate intelligence reports from LAGARTO.205 The STARLING operation was originally planned in 1942 for the western area ofPortuguese Timor and was to be led by António Policarpo Sousa Santos (the evacuatedAdministrator of the Fronteira Circumscription) – ie to complement Lieutenant Pires’LAGARTO operation in the east. However, with the death of the leading pro-AlliedTimorese leader in the western area – ie Dom Aleixo Corte Real, STARLING wassuspended. In August 1944, a formal plan for this operation in the western areas ofPortuguese Timor was re-developed (as a sub-set of SUNFISH – ie SUNFISH D)210. Theplan envisaged two phases – the insertion by RAN ML of a reconnaissance party of “twonatives”: Abel Manuel de Sousa and Felix da Silva Barreto; to be followed by the mainparty comprising the Portuguese: António Policarpo da Sousa Santos (leader), MartinhoJosé Robalo, Porfírio Carlos Soares and Américo Vicente Rente (previously “Portuguese205 For example: Information Report No. (AIB) 463, 15 July 1945 reporting Japanese barge movements in theManatuto and Baucau areas (NAA: A3269, D4/C, p.323). SRD passed OP COBRA reports to AIB up to 31July 1945 (NAA: A3269, H1, p.53).206 SRD Intelligence Branch, Sunfish Phase I - Information Summary No.3, 13 January 1945 – with “OOB” ieorder-of-battle (NAA: A3269, D8/A, p.32/p.119). This estimate is considered too high. Analysis provided tothe author by Takahashi Shigehito in February 2008 indicates Japanese maximum military strength in Timorin February 1944 - ie with units at full strength, was 21, 975 with about 11,300 in Portuguese Timor.207 The information in this section is derived from the intercept of Japanese communications by the Alliedforces’ Central Bureau organisation – see Japanese Relations with Portuguese Timor, Brisbane, 13 September1945 (NAA: A6923, SI/1, pp.27-29).208 The Japanese reference to the 28 May 1945 meeting was included in a message intercepted on 7 July 1945.According to the Central Bureau assessment, only the “general plan” was discussed at this meeting – with“particular problems being left till a second meeting.” Morishima Morito was Japan’s resident diplomat inLisbon. Minister Morishima’s wartime negotiations in Lisbon are covered extensively in Gunn, G.C., NewWorld Hegemony in the Malay World, Red Sea Press, Lawrenceville, 2000, pp.192-203.209 SRD, Information Report 368, 31 August 1945 (NAA: A3269, H1, p.22).210 After a landing on the south coast, the principal aim was reporting on activity in the Dili area over a twomonth period (NAA: A3269, D8/A, p.245). 31 district officers in Fronteira and Dilli provinces”). The plan was modified in September andOctober 1944, and the aim became to “establish a hideout in Fronteira Province ((iewestern border area)) from which intelligence and S.O. ((Special Operations)) activities inFronteira, Suro and Dilli provinces can be organised.”211 In early March 1945, Sousa Santosvisited LMS/Peak Hill in Darwin but “was unable to persuade any natives to join him” –presumably including Abel de Sousa and Felix Barreto.212 The commanding officer of LMSreported: “no native willing to join Santos. Reluctant to assign Australian expert signaller… also found to great surprise his own party had NO training. Therefore concentrate atBrisbane for short course at FCS. …While all ((are)) training, shall try to induce somenatives to change ((their)) mind but am not hopeful due to the loss of prestige of Santos.”213The SRD Official History notes: “disaffection among Portuguese and Timorese … inparticular their failure to volunteer to serve under Santos.”214 Sousa Santos then sought torecruit the Portuguese ex-internees: Álvaro Martins Meira, Francisco Horta, AntónioConceição Pereira, Sergeant José Arranhado – and also Luíz/Luís da Sousa. In mid-March1945, SRD advised that “Santos, Soares, Robalo, Rente, Horta, Dias being assembled …for FCS basic course less demolitions.”215 Subsequently, Santos’group comprisingFrancisco Horta, Américo Rente, Porfírio Carlos Soares and Martinho Robalo trained atFCS in March-April 1945.216 On 19 April 1945, SRD advised Sousa Santos that theoperation was cancelled.217 However, the operation was re-cast as SUNDOG218, comprisingonly Australian personnel. On 8 June 1945, the party aboard the HMAS Seasnakeapproached the coast near the Sue River (6.5km west of Betano) – but, believing theirapproach had been sighted by the enemy, the operation was abandoned. Subsequently,retitled as SUNDOG RAID – with a mission amended to “a raid to extract natives forinterrogation” and intended to last only six hours, the party landed near the Sue River fromSeasnake on the night of 21 June. Carlos Cal Brandão accompanied the party as“interpreter and advisor on native matters”.219 Unable to locate the intended native village,the party withdrew without contact a few hours later. The party’s failure was later assessedas due to “poor leadership and a lack of initiative, possibly unduely [sic] influenced byBRANDON’S [sic] advice.”220211 NAA: A3269, D23/A, pp.11-26.212 SRD Group D, Parties # 27, Darwin, 15 March 1945 (NAA: A3269, L1 and H6). The report noted that the“composition of his party will now be changed and a short course at FCS for SANTOS’ own men arranged.”213 LMS, LZ202, Darwin, 8 March 1945 (NAA: A3269, L7).214 The Official History … , Vol II – Operations, 1946, op.cit., p.55 (NAA: A3269, O8/A, p.71).215 SRD, Bell 40C, Melbourne, 14 March 1945 (NAA: A3269, D27/A, p.121). On 20 March, Sousa Santossought to meet “Rente, Damas, Dias and Miera” in Sydney (NAA: A3269, D27/A, p.98).216 Sousa Santos advised SRD (in Brisbane) that he and his party would not request any remuneration oncethey were in the field – only “pocket money” before their deployment (NAA: A3269, D27/A, p.109). On 19March, Lieutenant G.H. Greaves reported from FCS to Darwin that the “Portos” were very backward in radio… it would take six months to make even emergency radio operators of them and in the folboats ((canoes))they are hopeless, but with weapons they hold their own with most.” (NAA: A3269, D27/A, p.34). It isunclear however whether these “Portos” above included Horta, Rente, Soares and Robalo as they are noted astravelling from Brisbane to FCS on/after 26 March 1945 (NAA: A3269, D27/A, p.97).217 For views on Sousa Santos see Cardoso, A.M., Timor na 2ª Guerra Mundial…, 2007, op.cit., pp.88-89.Brandão – and others, recommended to SRD that Sousa Santos “not be allowed to return” (NAA: A3269,D27/A, p.130, p.133). For H.B. Manderson’s negative remarks of 17 April 1945 on Sousa Santos as “ahungry troublemaker” and “chops-licking” (ie in anticipation of post-War Portuguese Timor) see H.B.M.,Melbourne, 17 April 1945 (NAA: A989, 1944/731/1, p.14).218 The Official History … , Vol II – Operations, 1946, op.cit., pp.55-56 (NAA: A3269, O8/A, pp.71-72).SUNDOG was also termed Project SUNFISH D.219 The party departed Darwin on 19 June 1945 and arrived back at Darwin on 23 June 1945. The grouppatrolled inland from the landing site for 300m and were ashore for about 90 minutes – SRD, Morotai, Report245, 25 June 1945 (NAA: A3269, H1, p.171).220 LMS, LM116, Darwin, 24 June 1945 (NAA: A3269, D8/A, p.217).32 SUNBAKER: 17 May 45 PIGEON was planned in August 1944 to relieve the COBRA party who weremistakenly believed by SRD to be free and operating in the Guruda area – about 12kmsouthwest of Laga. Comprising an Australian officer, an Australian 32ignaller and “twonatives”: Henrique Afonso Pereira and João de Almeida, the PIGEON group was to belanded on the south coast by a RAN ML vessel near Beaço (south of Viqueque Town).However, the plan was not approved, but was revived in January 1945 as SUNCOB. SUNCOB was replanned in April 1945 as the two Timorese declined to volunteer.Following delays, the party – comprising Captain W. P. Wynne and Sergeant J.B.Lawrence, parachuted into the Seical River area on 1 July. Lawrence was captured on 2July, and Wynne226 on 17 July. The Japanese subsequently controlled SUNCOB’scommunications with SRD – ie as they had with LAGARTO and COBRA. 221 NAA: A3269, D10.222 The SUNFISH Project file (NAA: A3269, D8/A) contains documentation including informationsummaries.223 The Official History … , Vol II – Operations, 1946, op.cit., p.50 (NAA: A3269, O8/A, p.65). In lateMarch 1945, SRD had intended to include Felix da Silva Barreto and “one Malay speaking native from DutchTimor preferably with knowledge vicinity of OECUSSA [sic]” – SRD, LB 11, Darwin, 23 March 1945(NAA: A3269, D27/A, p.102). One factor for the lack of volunteers may have been that none of the TimoreseSRD operatives were from the Dawan-speaking Oecussi area.224 Operation Order No.6, 13 June 1945 (NAA: A3269, D9, pp.43-52) includes cover stories for the fourpersonnel.225 For the post-war debrief reports of the surviving SUNABLE personnel see NAA: A3269, V17, pp.126-132.226 For Captain W. P. Wynne’s post-war debrief report of OP SUNCOB see NAA: A3269, V17, pp.135-138. 33 In February 1944, SRD proposed to “reinforce” LAGARTO227 (ie unaware that thegroup had been captured and under Japanese control since late September 1943). The planwas amended in following months to “relieve” LAGARTO – ie to extract LieutenantEllwood from LAGARTO and to add additional personnel. SRD personnel selected for theBLACKBIRD operation were: Lieutenant A.D. Stevenson, Sergeant R.G. Dawson, and theTimorese SRD operatives Bernardino dos Reis Noronha and his brother, Câncio dos ReisNoronha.228 After several planning changes (on timings, the insertion location etc), aparachute “water jump” was scheduled for November 1944 at Fatu Uaqui about 8km eastof Manatuto. However, approval was withdrawn by General Headquarters – and theoperation was later mounted as SUNLAG. The SUNLAG party229 – comprising Captain A.D. Stevenson, Sergeant R.G.Dawson and Celestino dos Anjos (Timorese) was ready to deploy in April 1945, butshortages of suitable aircraft delayed the operation. On 29 June, the party was droppedfrom a B-24 Liberator of RAAF 200 Flight230 into the Laleia River area, about 21kmsoutheast of Manatuto. Suspicious of the LAGARTO party circumstances, SRD advisedLAGARTO that SUNLAG would be inserted on 1 July – ie a few days later. Observing thedrop zone area on 1 July, Captain Stevenson noted an awaiting Japanese force – togetherwith a westerner, whom he believed to be Captain Ellwood.231 227 With the Noronha brothers and Zeca Rebelo – see footnotes 166 and 167. SRD advised that the Noronhabrothers were ready to be “dropped now” in late May 1944 to establish an OP at Isuum or Kuri (NAA:A3269, D4/C, p.59, p.228).228 The group was ready to insert by parachute in late August – LMS, No.70, 21 August 1944 (NAA: A3269,D4/C, p.211). See also Blackbird Project (Revised), 8 November 1944 – NAA A3269, D4/A, pp.500-501.229 The “cover stories” for each of the party – eg Celestino as “António”, are at NAA: A3269, D13/B. The twoAustralian personnel were equipped with Colt .45 and Welrod 9mm pistols; Celestino dos Anjos was armedwith an Australian HAC .38 revolver.230 See a “pre-drop” photograph on the front cover and overpage. The B-24 Liberator A72-182 was piloted byFlying Officer Carson – who had flown a reconnaissance of the drop zone on 27 June. The “drop” on 29 June1945 was done from 2,000 feet at 0945Z - ie at around dusk. Carson noted the “fading light” when droppingthe stores a few minutes later - RAAF Command, Brisbane, 10 July 1945 (NAA: A3269, D8/A, pp.225-226).231 On 3 July 1945, Captain Stevenson advised Darwin – “observed XYZ ((Ellwood)) controlled by Japanese1st July but request you maintain him as if our insertion not made.” - Leanyer, DM640, Darwin, 4 July 1945(NAA: A3269, D8/A, p.176).34 including three Timorese: Celestino dos Anjos, Alexandré da Silva Tilman and FranciscoFreitas da Silva, the party departed Darwin on 7 September 1945 and sought information inboth Dutch and Portuguese Timor.241 The party – less two, returned to Darwin on 19October 1945. Captain Stevenson and Sergeant B. Dooland continued investigations in theLesser Sundas and returned to Darwin on 20 November.242 THE EVACUEES 1942 As noted above, several Portuguese officials – including António Sousa Santos (theAdministrator of the Fronteira Circumscription) and Lieutenant Manuel Pires(Administrator of the São Domingos Circumscription) had made appeals to Australian Sancho da Silva), all as “embarked from Australia” and names are also cited (p.48). A note added that“casualties to ‘other natives’ were considerably in excess of those shown in the Summary. At least 20 personsattached to Lagarto were probably killed, together with many others who at some time helped that party, butinsufficient information is available as to their numbers and relationship to SRD to include them. The samecircumstances apply generally to other parties.” Of the lists noted above, Patrício da Luz of LAGARTO wasonly recorded as a missing LAGARTO “operative” in The Official History …, Vol II – Operations, 1946,op.cit., p.74 (NAA: A3269, O8/A, p.92).241 Photographs of the party enroute to Koepang aboard HMAS Parkes are at AWM 115663, 115664.Photograph AWM 114880 depicting “Indonesian commandos” boarding HMAS Parkes in Darwin on 7September 1945 are almost certainly, from the left: Francisco da Silva, Celestino dos Anjos and Alexandré daSilva.242 The “Final Report by OC GROPER Party”, 29 November 1945 – and interim reports are at NAA: A3269,D26/A, pp.3-7.243 Left to right: Francisco Freitas da Silva, Celestino dos Anjos, Captain A.D. Stevenson, Alexandré da SilvaTilman – photograph provided by Ms D. Stevenson.36 authorities for the evacuation of civilians from Portuguese Timor.244 The first civilianevacuees – ie Consul David Ross245, together with the Dutch Consul L.E.J. Brouwer246 andhis wife, departed from the south coast aboard the HMAS Kuru247 on 8 July 1942. The firstPortuguese evacuees appear to have departed on the Kuru from the south coast on 7November 1942248 - ie: Ademar Rodrigues dos Santos (and family) – the Portuguese chefede posto of Ainaro; and José da Silva Marques – the Portuguese chefe de posto of Hato-Udo - both in the western area. These Portuguese officials were accepted as “guests ofGovernment” in Australia and accommodated at Ripponlea, Victoria. As noted earlier, in late October 1942, the Japanese directed that all Portugueseassemble in “protection zones” west of Dili at Liquiçá, Maubara (and Bazar Tete) - ie forprotection against “rebeliões de indígenas”.249 However, groups of Portuguese andTimorese – including large numbers from the Fronteira, Suro and São DomingosCircunsçrições, moved into the countryside with many concentrating in the areas south andsoutheast of Baucau Town. On 17-19 November 1942, 16 Portuguese and one Swiss national250 were evacuatedfrom the Aliambata area on south coast by corvette – including António Policarpo SousaSantos (the Administrator of Fronteira) and his family.251 On 30 November, HMAS Kuruevacuated 89 civilians – mostly women and children, from Betano. These civilians weretransferred to HMAS Castlemaine and arrived in Darwin on 2 December.252 On 3December, the Australian Prime Minister was informed that “the total may reach as manyas 300”. The Portuguese Government directed their honorary Consul in Sydney to assist the“refugees … according to their social rank. Officials are not entitled to receive their salariesas they are absent from their official residence.”253 Lacking funds, the Consul requestedfinancial support for the evacuees from the Australian Government. On 8/9 December 1942, the Dutch destroyer Tjerk Hiddes evacuated a portion ofSparrow Force and a large number of Portuguese and Timorese – including dependants ofpersonnel associated with OP LIZARD, totalling 300.254 In mid-December, 40 evacuees –244 See footnotes 91, 93, 106, and 137 – and also approaches made to the LIZARD III party in 1942.245 Ross’ service in Portuguese Timor – and a description of the Japanese landing, is included in Ross, D.,Portuguese Timor – December 1941 to June 1942, Melbourne, 29 July 1942 (NAA: A1067, PI46/2/9/1,pp.110-116).246 For Ross and Whittaker’s difficulties with Brouwer in 1941 as “anti-British”, see NAA: A981, TIM D 1Part 2, pp.13-22, p.29.247 A twenty five-metre long patrol boat with a displacement of 55 tons.248 Although, according to the records of HMAS Kuru, Kuru “returned to Darwin on 4 September carrying aPortuguese official, his wife and child, and some Army personnel”.249 For the texts of the agreements on the “protection/fixed zones” dated 24 and 25 October 1942, seeCarvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.406-412.250 Report on Interview - E.E. Keller, 1 December 1942 (NAA: A3269, D6/A, p.23). Note also Keller’scomments on treatment by Portuguese of half-castes as Portuguese.251 Cardoso, A .M., Timor na 2ª Guerra Mundial…, 2007, op.cit., p.72 shows “11 November” and notes theevacuees included Captain Borges de Oliveira, Captain (Retd) Manuel da Silva, and the Swiss topographicsurveyor E.E. Keller. Sousa Santos and family were flown to Melbourne, and the remainder of the Portuguese(3 men, 4 women, 7 children) arrived in Melbourne on 15 December (NAA: A981, TIM P 16, p.13).252 See Wray, C.C.H., Timor 1942, 1987, op.cit., pp.155-156. The group arrived at Darwin on 2 December –and travelled in a group totalling 144 Timorese and two Portuguese (19 men, 45 women, 82 children) on theM/V Islander to Townsville, then by rail to Brisbane – see NAA: TIM P 16, pp.11-12 for travel and supportarrangements. In Brisbane, 55 were accommodated at Wynnum, four in hospital, and 89 travelled by rail toSydney arriving on 23 December 1942. Individual immigration forms and a nominal list of the arrivals inSydney are at NAA: BP234/1, SB1942/6255.253 Consulate for Portugal, Sydney, 10 December 1942 (NAA: A981, TIM P 16, p.16).254 The evacuation continued over several days – see Wray, C.C.H., Timor 1942, 1987, op.cit., pp.155-164.Captain D.K. Broadhurst – the LIZARD III force commander, provide three separate list of the Portuguese 37 the “4th Group” (comprising 14 women and children, 11 nuns and 15 priests) werereportedly in transit from Darwin to Cairns.255 On 10 December, following a query from Australia seeking the PortugueseGovernment’s policy on evacuees, Lisbon advised that it was “contrary to the wishes” ofthe Portuguese Government for males to be evacuated – “particularly for officers of thearmed forces or civilian government officials … since they are expected to remain at theirposts and accept the risks involved in the execution of their duties.” On the refugeescurrently in Australia, Lisbon queried whether it would be possible to transfer them to“Portuguese India, Mozambique or to the United States” – at Portuguese expense.256Through London, Australia advised Lisbon that further evacuations had taken place beforePortugal’s policy could be made known to Australian forces in Timor. In a cable toLondon, Australia added that “the Portuguese Authorities evidently don’t realise the extentof the deterioration … policy of Portuguese Government that officials should remain attheir post … is thus, in our opinion, both impracticable and unreasonable.”257 On 19 December, the Department of the Army in Melbourne reported thatPortuguese/Timorese evacuees in Australia totalled 207.258 Apart from about 30 “firstclass” Portuguese moved to Melbourne, almost all the evacuees were accommodated atBob’s Farm – a former army camp 58km north of the city of Newcastle.259 On 31December, the Australian military reported that the Timor evacuees “landed” totalled545.260 and Timorese evacuees (NAA: A3269, D6/A, pp.49-52). List I: 43 adult males, 10 nuns, 21 wives and 62children (totaling 136); List II: “Men Staying in Timor Whose Families Are Being Evacuated” – 28 wivesand 68 children (totaling 96); and List III that comprised the families of those of principal assistance to SRDwho had elected to remain in Timor ie Lieutenant Pires (8 family members), Dom Paulo da Silva (11),Francisco da Silva (19), Domingos Freitas Soares (8) – plus two children of minor chiefs (totaling 48).However, it is not clear whether all the 300 above were evacuated.255 Department of the Army, Memorandum SM24517, Melbourne, 19 December 1942 (NAA: A981, TIM P16, p.13).256 Embassy of Portugal, No.50, London, 10 December 1942 (NAA: 265, A2937, pp.150-152) and ExternalAffairs, No.S.160, London, 13 December 1942 (NAA: A816, 19/301/821 Part 2, p.48). Interestingly, cableS.160 to Australia incorrectly stated “Portuguese Africa” instead of “Portuguese India” – but this was latercorrected.257 External Affairs, No.1, Canberra, 1 January 1943 (NAA: A816, 19/301/821 Part 2, p.47). Subsequently,the Portuguese Government advised of their desire that: “Officers who have relinquished their posts shouldseek, even though by force of arms, to return to them. In that connection, the assistance of the CommonwealthGovernment would be appreciated.” – Portuguese Embassy, No.30, London, 16 February 1943 (NAA: 265,A2937, p.118).258 Department of the Army, Memorandum SM24517, Melbourne, 19 December 1942 (NAA: A981, TIM P16, p.13).259 53 of the evacuees (including four deportados) were accommodated in the “Ingleston” boarding house atWynnum (Brisbane) - with the majority accommodated initially at the Quarantine Station at North Head(Sydney – arriving on 23 December) before moving to Bob’s Farm. The Bob’s Farm camp was managed bythe Department of the Interior. When the evacuations from Timor were first in prospect, a site at BaulkhamHills (in western Sydney) was considered. A medical officer visited the Bob’s Farm camp daily, and the camphospital was staffed by “a lady doctor and four native boys, all of whom are stated to have a good knowledgeof the native and tropical diseases.” – Security Service, 1541/253, Newcastle, 16 February 1943, p.3 (NAA:MP742/1, 115/1/245).260 Directorate of Military Intelligence, MIS3055, Melbourne, 31 December 1942 (NAA: MP742/1,115/1/245).38 stating that they comprised “481 Portuguese of all social classes including natives”.261 On19 January, Australian officials advised the Prime Minister that the total number ofevacuees was “approximately 502” of whom 400 were “natives or half-castes … beingaccommodated in a military camp in the Newcastle area.”262 Of the total, 322 “had beenreceived and place in accommodation by the Department” of the Interior - with a furthergroup of 180 enroute from Darwin. On 10 January, a party of 155 evacuees – comprising 33 men, 57 women and 65children, arrived by train in Brisbane. The majority were “natives”, but included Dr JoãoManuel Ferreira Taborda – Deputy Governor and Director of Civil Administration; ColonelJorge Castilho – head of the Portuguese Geographic Mission; José Azevedo Noura –Director of Public Works, Dr Custódio Noronha – Judge Advocate, Dili; Abílio Amaral – asenior law officer; Mário [sic] Miranda – Clerk of Courts, Dili; the wife and family ofLieutenant Pires – Administrator of São Domingos; and the wife and children of SrMendoza – the Secretary of São Domingos.263 The party also included 12 Roman Catholicpriests (including two Dutch fathers) and 20 sisters of the Daughters of Charity. Escortedby Lieutenant L.W. Ross of “Z Unit”, the group - less senior officials and their families,travelled by train to Hexham (Newcastle) and then by “lorries” to Bob’s Farm (58km northof Newcastle). As discussed earlier, on 10 February 1943, Lieutenant Manuel Pires’ party –totalling six, was evacuated to Australia by US submarine.264 Initially, this group resided inMelbourne. In January 1943, an Australian Army report described the evacuees’accommodation at Bob’s Farm as follows: 261 Edwards, A.W., Evacuation of Portuguese Nationals from Timor - Security Matters, Brisbane, 18 January1943 (NAA: A989, 1944/731/1, p.24). Sousa Santos noted that assistance from the honorary Consul inSydney had been “nil”. Sousa Santos had earlier cabled Lisbon in late November 1942 soon after his arrivalin Australia on the “grave situation” in Portuguese Timor and his intention to “return to Timor” (NAA: A981,TIM P 16, p.36).262 Ministry of the Interior - to the Prime Minister, Canberra, 19 January 1943 (NAA: A1608, J41/1/9 Part 2,p.27)263 Edwards, A.W., Evacuation of Portuguese Nationals from Timor: Appendix No.1 - Security Matters,Brisbane, 18 January 1943 (NAA: A989, 1944/731/1, p.22-26). The report noted: “Mrs Pires is a native, butis being given special consideration in view of her husband’s services”. The majority of the nuns – includingthe Mother Superior, were Italian. Of the first class officials, it appears that only Dr Custódio Noronha wasinitially accommodated at Bob’s Farm. The group included “four deportados” – vouched for by SousaSantos “as totally devoted to the Allied cause”. Short biographies of Sousa Santos, Governor Carvalho, DrTaborda, Dr Noronha, Colonel Castilho, José Noura and Father Jaime Garcia Goulart are at Appendix No.2 tothe report (pp.61-63). For negative reporting on Marie de Almeida Miranda, b. 19 November 1890 – ie as“pro-Fascist”, see NAA: MP742/1, 115/1/245.264 See footnotes 120 and 121. 39 natives. These people live and mess together, the menfolk do the work about the camp area. This class appears happy and contented.”265 The Portuguese Europeans and the priests and nuns (“Classes 1 and 2”) wereaccommodated in former Army huts with beds and reportedly had a priority for Red Crossclothing. The remaining evacuees (“Class 3”) lived in tents and slept on the floor on“gunny bags filled with straw – with one bucket, one basin and a kerosene lamp.”266 Inearly February 1943 – according to a report by an Australian official, conditions at theBob’s Farm settlement camp were “serious”.267 The evacuees reportedly “resented andrefused to co-operate in performing the necessary fatigues essential to their own health” –eg the disposal of kitchen waste etc. “Class feuds” were “the order of the day” – as “one setrefused to cook for themselves, another refused to cook for them”. “The group comprisingcivil servants and ex-Army officers insinuate that the Camp includes suspected enemyagents, ex-convicts and a released murderer.” “Affluent individuals” among the evacueeswere also reportedly visiting Newcastle – while “the less fortunate were being left in thecamp to do the work.” On 10 February 1943, the Australian manager of the Bob’s Farm camp reportedfive male evacuees268 as having caused trouble in the evacuee community and who, onvarious occasions, had refused to work. Australian security officials visited the camp on 11February and reported that the Portuguese deportados among the evacuees had declaredthat they are “now living under democratic Government and each and every person must beconsidered as an equal … and Government officials and others from Timor be consideredon the same station in life.” The visiting security officials noted the “anomalous position ofNoronha, Attorney General of Timor” who had previously sentenced “numerous of thedeportees now in camp to imprisonment and exile to Ataúro Island.” They reported that thecamp contained “two factions” – and with “Government officials and deportees …required to perform identical duties, there will be a considerable amount of friction.” “Themain cause for discontent … may be attributed to the fact that the men are being givenample good food but are not given sufficient employment of any nature outside the campand thus earn money to have a certain degree of independence.” Importantly - in respect ofthe negative report of early February (see above) which had reported camp conditions as“serious”, the investigating officials concluded that: “whilst Government officials,deportees and natives are congregated in the one community, there will be continualunpleasantness and bitterness, which will naturally militate against the efficiency andauthority at Bob’s Farm. We were unable to find any trace of reported crisis existing in thecamp.” On 17 February 1943, a party of 32 evacuees – “both half breed and Timornatives”, arrived at Bob’s Farm; and 31 men were wearing “Australian military clothingsuch as shorts, shirts, socks, boots, sweaters, webbing belts and long drill trousers andhats”.269 Three also had steel helmets. Five of the men – “Alfredo dos Santos, Arsénio J.Filipe, Francisco C. Palmeira, Casimiro A. Paiva, and Manuel M. Teodora [sic]”270 told265 Field Security Section, Newcastle, 20 January 1943 (NAA: A373, 4058B).266 Author unknown, “Report on Bob’s Farm Camp” (NAA: A373, 3685A). The writer noted that Dr CarlosCal Brandão’s family and Deolindo de Encarnação lived in tents.267 3 L of C Sub-Area, New Lambton, February 1943 (NAA: MP742/1, 115/1/245).268 Those named were Bezerra dos Santos, José da Silva, Alfredo Vaz, Manuel Teodora [sic] and JoséGordinho - Security Service, 1541/253, Newcastle, 16 February 1943, pp.4-6 (NAA: MP742/1, 115/1/245).269 3 L of C Sub-Area, New Lambton, 27 February 1945 (NAA: MP742/1, 115/1/245). One man wasreportedly dressed in a “full US uniform”.270 See individual biographical detail – ie “pen pictures”, at Annex A which includes detail of their declaredservice. “Manuel M. Feodora” is “Manuel M. Teodora”.40 investigators that they had “served some months with the Australian forces in Timor … andthey still consider themselves to be members of the Australian military forces, andexpressed the desire to have another go at the Japs.” The investigators recorded “theyimpressed the undersigned as being truthful and reliable”. On 26 February, Canberra informed London – for advice to Lisbon, that theevacuees totalled 535 - “comprising 105 men, 179 women and 252 children.Approximately 400 are natives and half-castes. The remainder comprise Governmentofficials - first and second class, and their families, and include eleven Roman Catholicfathers and twenty nuns … it is quite out of the question to return any of them. … It isimperative that the Portuguese Government face the facts.”271 In late February 1943, Australia sought advice whether Portugal would authorisethe payment of a “maintenance allowance” to first and second class officials272 who hadbeen evacuated – and suggested a scale then currently being paid to “white Britishevacuees” from the “Far East countries.” The Australian Government also advised that“Every endeavour will be made … to place first and second class officials in employmentin the Australian community … Remainder of the party (400 natives and half-castes)cannot be assimilated into the community, and the Commonwealth Government presumesthat the cost of their maintenance will also be borne by the Portuguese Government.”273 In February 1943, five evacuees at Bob’s Farm claimed service with the AustralianArmy in Portuguese Timor and sought “back-payment” of wages. Their claims of servicewere checked with the former Sparrow Force Commander – Major B. J. Callinan, whoagreed that the evacuees’ statements were “substantially correct”.274 Major Callinan notedthat “these personnel were armed, equipped and treated as Australian soldiers in that theyshared the risks duties and food (and its lack on many occasions) of the Australians; and atthe same time rendered valuable service to the force.” Subsequently, the Department of theArmy offered a legal interpretation275: “D.A.42 (a) provides that ‘every person serving as … a soldier in the Military Forces although not duly … enlisted shall while so serving …be deemed for all purposes of this Act to be … a soldier … of the rank … in which he is serving.’ The above Portuguese served as soldiers in the military forces during the periods set out in their claims and are therefore in my opinion entitled to be treated as members of the forces for all purposes, including pay, and section 42 (a) is a sufficient authority for payment.” 271 External Affairs, No.S.L.4, Canberra, 26 February 1943 (NAA: A816, 19/301/821 Part 2, p.39).272 First class officials and their families numbered about 30 and included : “Dr José Taborda (DeputyGovernor), Sousa Santos (Administrator of Fronteira), Engineer José Noura, Dr Custódio Noronha, VicenteMartins, Abílio Amaral, Mário Miranda, Captains Oliviera and Silva, First Lieutenant Cardoso.” - ExternalAffairs, No.S.L.5, Canberra, 26 February 1943 (NAA: A816, 19/301/821 Part 2, p.41).273 External Affairs, No.S.L.5, Canberra, 26 February 1943 (NAA: A816, 19/301/821 Part 2, pp.41-42).274 Callinan, B.J. Major, 120/150/43, Canungra, 9 March 1943 (MP742/1, 1/1/737).275 Department of Army, DPS AG12(b)1/P.A., 18 March 1943 (MP742/1, 1/1/737).276 Spence, A. Lieutenant Colonel, 120/150/43, Canungra, 7 April 1943 (MP742/1, 1/1/737).277 Department of the Army, 669943, Melbourne, 1 May 1943 (MP742/1, 1/1/737) – the per diem rate was 6/-per day to 13 August 1942 and 6/6 per day for the following periods. 41 Transfer to Africa ? In early March 1943, Australia advised Portugal that it was possible to transfer theevacuees to South Africa – from where they could be “trans-shipped to Portuguese EastAfrica”. Lisbon responded that the following could depart: “wives and families of officialsand Military personnel and any other white Portuguese (non-official)”. However, religiouspersonnel could not leave without authorisation - and “official and military personnelshould not be transferred”, and “natives (full blood) are not to be transferred.” “Half-castesshould remain in Australia” – unless from other Portuguese territories.278 On 23 March1943 – through London, Canberra advised Lisbon that the conditions of Portugal’s policywould “mean the separation of white Portuguese evacuees and their families. The matterhas therefore been discussed with evacuees. They offer strong objections to any proposalinvolving separation of wives and children from their husbands and fathers. The reply ofthe Portuguese Government is considered to be quite unsatisfactory and shows a lack ofappreciation of the situation. The proposal to transfer the evacuees by vessel to Africawhich left Sydney last week has been abandoned.”279 In mid-April, the PortugueseGovernment confirmed to Australia that - while military officers and officials from Timorwere not to be transferred to other Portuguese territories, their family members werepermitted to do so.280 Lisbon also agreed to the payment of allowances to the evacuees onthe scale recommended by Australia, but “as regards the persons classed as natives … theduration and amount of allowance should be determined by good sense and local needs.”The Portuguese Government agreed to the evacuees “being given such employment as theCommonwealth Government may consider them fit to undertake, not excluding militaryservice.” Lisbon also advised that refugees currently awaiting evacuation on the south coastof Portuguese Timor should remain as long as the situation was “bearable”. On 14 April1943, through London, Australia again pressed the plight of the 300 refugees in the southof Portuguese Timor who had requested evacuation - and, over six weeks later, on 28 May,Lisbon responded that “they should remain on Portuguese territory for as long aspossible.”281 By March 1943, several of the deportados had been in contact with trade unions inNewcastle and the local branch of the Communist Party – and had become politicallyactive.282 At Bob’s Farm, “three separate mess arrangements were necessary to prevent 278 External Affairs, No.S.54, London, 12 March 1943 (NAA: A816, 19/301/821 Part 2, p.32).279 External Affairs, No.62, Canberra, 23 March 1943 (NAA: 265, A2937, p.85).280 Embassy of Portugal, No.33, London, 12 April 1943 (NAA: 265, A2937, pp.76-78). In July, Lisbon agreedto the transfer of Mr Amaral and Dr Correira Teles (whose husband had been killed in Timor) and herdaughter to South Africa – Embassy of Portugal, No.68, London, 23 July 1943 (NAA: 265, A2937, p.43).Later, Captain M.B. Oliveira (Chief Pharmacist), his wife and their three children transferred to PortugueseEast Africa.281 Embassy of Portugal, No.53, London, 28 May 1943 (NAA: 265, A2937, p.59).282 “Who Blundered ? Allies Rebuffed, Not Allowed to Aid War Effort”, Tribune, No.112, 3 March 1943(NAA: A373, 3685A).42 squabbles and fights, and - as a clarion call had gone out ((from the deportados)) that ‘allare equal in Australia’, all Portuguese official control was lost and a definite hatreddeveloped, this was fostered by the deportees. … the main troublemakers were ((Arsénio))Filipe, Gordinho, Neves, José da Silva, Honorio, Pedro Guia de Oliveira, Palmeira, Bezerrados Santos and César Augusto dos Santos … The trouble culminated in a fight in thecanteen on the night of April 27 ((1943)) when Americo Rente – an acting District Officerin Timor, was attacked by Vasco Marcal, a deportee armed with a spoon … Gordinho ((adeportado)) shouted to deportees to arm with knives and kill … other participants were((Arsénio)) Filipe, Saldanha, A. Maher, Rozario and others. The outcome of this troublewas an appeal to you ((Department of the Interior)) by Monsignor Goulart283 for theimmediate removal of deportees from this camp, failing which he threatened to removepriests, nuns and certain of women from the camp. … Later action was the removal ofcertain selected officials, and of certain deportees to employment, but the troublemakers –Gordinho, ((Arsénio)) Filipe, Bezerra dos Santos and Augusto César dos Santos were stillleft in the camp.”284 recommendation by the Ministry of the Interior of 11 May that the 400 “natives” should bemoved to Western Australia and be accommodated at a Roman Catholic mission atGeraldton – at a cost of ₤18,250. However the proposal was never implemented. In June 1943, Lieutenant Pires prepared to return to Portuguese Timor leading theSRD OP LAGARTO party. His operational directive allowed him - when in Timor, toselect further team members from the PORTOLIZARD group and to also select 50personnel for evacuation to Australia.289 Lieutenant Pires and his party were landed from aUS submarine on 1-2 July. As noted above, on 4-5 August 1943, members ofPORTOLIZARD and civilian refugees - totalling 86290 were evacuated to Darwin from thearea west of the Dilor River by RAN Fairmile motor launches. The group includedSergeant António Lourenço Martins – the PORTOLIZARD co-commander, and alsoSergeant José Arranhado and Corporal Casimiro Paiva (members of LAGARTO deemedunsatisfactory by Lieutenant Pires), and Dr Carlos Brandão and at least 13 otherdeportados. The evacuees were accommodated at LMS Darwin for six weeks as most werein too poor a condition for further travel. On 23 August, the group moved south - apartfrom “about 30 who were taken on strength by SRD”291 in Darwin. From Darwin, the group- numbering 47 (including all the women and children), travelled on the S.S. Islander –changed to the S.S. Wandana at Thursday Island, and then continued to Brisbane via Cairnsand Townsville.292 On 10 September, the group disembarked at Brisbane and twelve of themen – including six deportados, were interned at Gaythorne (Enoggera) as had been earlierrecommended by Lieutenant Pires (see footnotes 159-163). The remainder departedBrisbane by train, arriving at Bob’s Farm on 11 September 1943. With this last majorarrival of evacuees, in excess of 580 refugees from Portuguese Timor were resident inAustralia. 289 Footnotes 131, 153 and 154. SRD planned that the evacuations would ensure that the LAGARTO groupwas more manageable in size and able to focus more effectively on its tasks – see NAA: A3269, D4/G, p.435.Lieutenant Pires intended that Sergeant António Lourenço Martins select 25 for evacuation and Matos e Silvaselect 25.290 Comprising 47 male Portuguese, 18 male Timorese, 4 male Chinese, 12 females and six children. Thenames of many of the evacuees are listed in Carvalho, J. dos Santos, Vide e Morte …, 1972, pp.200-202. Atthe end of August, 47 (including all the women and children) were moved south from Darwin – “leavingabout 30 at LMS who were taken on strength by SRD” – The Official History …, Vol II – Operations, 1946,op.cit., p.22 (NAA: A3269, O8/A, p.35).291.292 Ross, L.W., Escorting Officer’s Report, 20 September 1943 (NAA: MP742/1, 115/1/245). The 47comprised 29 males, 13 females – all Timorese, five male children and 1 female child.293 NAA: A373, A3685A.294 Security Service, Sydney, 15 September 1943 (NAA: MP742/1, 115/1/245).44 On 19 January 1944, the Security Service advised the Ministry of External Affairsthat the Australian Navy opposed any move of evacuees to La Perouse “due to special andsecret installations” – a “controlled minefield” in the area301, and on 26 January 1944, theSecurity Service further advised that the Second Australian Army had opposed any moveof the evacuees from Bob’s Farm to La Perouse. The Portuguese Consul was subsequentlyinformed that it was “impossible to put into effect” the “project” to accommodate 150evacuees at La Perouse.302 However, in January-February 1944, all of the evacuees at Bob’s Farm were re-accommodated at Narrabri West in Western NSW (520km northwest of Sydney) and at295 Previously, Mr R. Cullen Ward had been Portugal’s Honorary Consul for 24 years. An SRD officer -Lieutenant J.R.P. Cashman, contacted the Security Service requesting that Consul Laborinho not be allowedany contact with the evacuees. This request was rejected – and the Laborinho’s right of access to Portuguesesubjects was explained to the SRD Director, Lieutenant Colonel P.J.F. Chapman-Walker (NAA: MP742/1,115/1/245).296 Consulate of Portugal, 11-A1/44, Sydney, 5 January 1944 (NAA: A373, 3685C, pp.150-156; A989,1944/731/1, pp.86-89). More generally, Consul Laborinho numbered the evacuees at Bob’s Farm as “nearly300”.297 The list of the evacuees at Bob’s Farm noted their sex, age, marital status and race – comprising: sevenPortuguese (ie 3.4 percent); 119 “half-castes” (58 percent); 79 “natives” (38 percent), and one female Chineseevacuee (NAA: A373, 3685C, pp.152-156).298 Timor Section Progress Report, Melbourne, 6 October 1943 (AWM, PR91/101). The group arrived on 7October 1943 under SRD’s Lieutenant G.H. Greaves and commenced work on camp infrastructure (NAA:A3269, Q10).299 Tokyo Radio News in English, “Portuguese Refugees in Australia …”, Tokyo, 8 October 1943 (NAA:MP742/1,115/1/245).300 Foreign Office, London, 7 December 1943 (NAA: A989, 1943/731/3, p.54).301 Security Service, 7940/46, Canberra, 19 January 1944 (NAA: A989, 1944/731/1, p.79, p.144).302 Security Service, Canberra, 19 January 1944 (NAA: A989, 1944/731/1, p.80). 45 accommodated in New South Wales: 145 at Armidale, 114 at Glen Innes, 138 at Narrabri,37 at Singleton, 22 in Newcastle, and 46 in Sydney; 54 were accommodated in Victoria: 18in Melbourne and 11 men and 25 dependants at the Tatura Internment Camp (167km northof Melbourne); 20 were in Queensland: one in hospital in Brisbane and 19 with the“Department of Army” (presumably at the SRD commando training camp on FraserIsland); one evacuee (Sergeant António Lourenço Martins) was in internment in SouthAustralia (at Loveday). 14 of the evacuees had been “repatriated to Portugal” (3 men, 5women, 6 children) - ie not included in the total of “587”; and the report also noted thatthere had been two deaths (including Colonel Jorge Castilho), a number of births and twomarriages.310 In November 1944, the Portuguese Government published a list of “Portuguesesresidentes em Timor” that also included 254 persons “outside the Colony but whosewhereabouts are known.”311 In July 1945, the Portuguese Government no longer insisted that their officials inAustralia not be transferred, and Consul Laborinho sought Australia’s assistance in thetransfer of “approximately 596 souls” to Lourenço Marques (Mozambique).312 This movehowever did not eventuate – and the evacuees were repatriated to Dili in late November1945. The activities and administration of the Portuguese and Timorese who served withSRD/Z Special Unit were directed initially by ISD/SRD’s Timor Section in Melbourne -and later by SRD’s Group D in Darwin from late December 1944.313 Parties operated inPortuguese Timor, and personnel were held in the Darwin area (ie at LMS and Peak Hill) 310 Security Service, Canberra, Portuguese Evacuees from Timor, 10 August 1944 (NAA: A989, 1944/731/1,pp.34-56). There appear to be some minor errors in the report’s calculations ie the total of “587” shouldperhaps be “577”. While detailed accommodation addresses are provided in the listings, the report does notinclude any personnel in the Northern Territory ie those serving with Z Special Unit/SRD in the Darwin areaat LMS, Peak Hill or Leanyer.311 Boletim Geral das Colónias, 20 (233), November 1944, pp.97-101. The listing also appears in manuscriptat NAA: A989, 1944/731/1, pp.2-20 with comments by H.B. Manderson, Melbourne, April 1945.312 Department of the Interior, Canberra, 11 July 1945 (NAA: A989, 1944/731/1, p.21). In a manuscript noteon the file – it was recorded that “Army had determined which persons they wished to retain in Australia forsecurity reasons.”313 Group D was established in Darwin on 25 December 1944 – including “Country Sections”, with Major S.Bingham as Officer Commanding (replaced by Lieutenant Colonel C.V. Holland on 27 June 1945). With theestablishment of Group D - and the other forward operational groups, “no operations are dealt with inMelbourne” – ie only training and support activities – Director SRD, Morotai, 25 June 1945 (NAA: A3269,V5, pp.11-24). SRD Advanced Headquarters was fully operational in Morotai from mid-April 1945. Group Dsuspended operations in June 1945 – to deploy to Balikpapan (Borneo). The advanced party left Darwin on 2August, but the move was cancelled later that month. 47 and regularly sent for training to the Fraser Island and Mount Martha facilities. InNovember and December 1944, up to 15 Group D personnel from Darwin were detached toFELO’s Tasman Barracks at Indooroopilly in Brisbane. This facility – as well as one at thenearby Milton Staging Camp, were used as transit camps for personnel granted leave andthose travelling between Darwin and training courses at FCS, Mount Martha, RAAFRichmond or RAAF Leyburn. While in Brisbane, some personnel may have assistedFELO staff with the production of propaganda leaflets in Portuguese and Tetum. General Duties (GD) personnel at FCS were not managed by Group D – and theirnumbers are unclear. In mid-March 1945, an 18-strong “component” of SRD’s SpecialTask Section – commanded by a major, was placed under Group D in Darwin.314 SpecialTask Section personnel were British or Australian. Determining a definitive list of Portuguese and Timorese who served with SRD/ZSpecial Unit is quite difficult due to the incomplete Australian records: “Unfortunately, for those wishing to read ‘Z’ Special Unit personnel files, they do not exist. All that is left in Canberra is the index file page, with name rank and the two serial numbers (ordinary and AK). General Blamey had the rest destroyed after the war.”315 314 D/ST, ST/80/45, 15 March 1945 (NAA: A3269, D27/A, p.122). The role of the Special Task Sectionelements – previously termed the Special Raiding Section, was to conduct limited raiding sorties in enemy-held areas – see SRD, Special Task Section, 22 February 1945 (NAA: A3269, H4/C).315 Dunn, P., 2005, "'Z' Special Unit in Australia During WW2" (ozatwar.com) – see. “Index file page” refers to the SRD personnel indexfile cards found in the National Archives of Australia (NAA) as files A10797, A to K and L to Z (Barcodes1920019 and 1920020). Further, these cards do not include Portuguese or Timorese personnel. The authorsought access to two Army files ie: “D” Group Personnel General – A3269, L3 and “D” Group Operatives –L4, but these files have not been located (National Archives of Australia, 2009/4599, 18 August 2009).316 The Official History …, Vol I - Organisation, 1946, op.cit., p.27 (NAA: A3269, O7/A, p.42).317 Ibid, p.28 (NAA: A3269, O7/A, p.41).318 Ibid., pp.29-30 (NAA: A3269, O7/A, pp.42-43). The six operatives in Portuguese Timor would appear tohave been the COBRA and ADDER parties – ie those in LAGARTO were apparently considered “recruitedin the field in Portuguese Timor”, but both Lieutenant Pires and Patrício da Luz were clearly recruited intoSRD in Australia and paid in Australia.48 An analysis of the above – and other correspondence, suggests that the total numberof “Porto/Natives” who were employed by SRD in the period 1942-1945 was probably 71– who could be categorized as: Operational Personnel This figure of “39” includes both operatives who deployed to Timor and those whoreceived operational training in Australia, but did not deploy. The 39 does not includePortuguese or Timorese who only assisted Sparrow, Lancer or S Force – nor those whoonly assisted SRD’s OP LIZARD groups (I-III)324. Personnel who only served in OPPORTOLIZARD are also not included – although that group was directed and supplied bySRD. The 39 only includes seven people who were “operative” in OP LAGARTO (ieLieutenant Pires, Patrício da Luz – both receiving SRD pay; Matos e Silva, José Tinocoand Seraphim Pinto – unpaid and who were never evacuated to Australia, but wereincluded in Group D personnel lists); and José Arranhado and Casimiro Paiva (Portuguesenon-commissioned officers who were returned to Australia in August 1943 by LieutenantPires). The figure does not include seven other principal members of LAGARTO who werenot evacuated to Australia ie Corporal João Vieira, Corporal Cipriano Vieira, Procópio doRego, João Rebelo, Ruy Fernandes, Domingos Amaral, and Domingos Soares (of Dilor).As LAGARTO was directed and supplied by SRD, it could be argued that these latter sevenomitted principal personnel should also be included in the operational total ie increasingsuch to 46. Of the operational personnel in the total of 39 above, at least 18 were activelyoperational under SRD control in Portuguese Timor (ie LAGARTO – 7: ie Pires, da Luz,Matos e Silva, José Tinoco, Seraphim Pinto, José Arranhado, Casimiro Paiva; COBRA –3: ie Paulo da Silva, Cosme Soares, Sancho da Silva; ADDER – 3: Armindo Fernandes,Zeca Rebelo, José Carvalho; SUNDOG – 1: Carlos Brandão, SUNLAG – 1: Celestino dosAnjos; GROPER – 3: Celestino dos Anjos, Alexandré da Silva Tilman, Francisco Freitasda Silva). Additionally, Timorese from Darwin also accompanied beach landing sorties onthe south coast of Timor to assist in-shore piloting of vessels, handling stores and assistingwith the management of evacuees.325323 SRD Group D, Timorese Personnel – Group D, Darwin, mid-April 1945 (NAA: A3269, D27/A, pp.63-66).324 However, see footnote 110 – ie “half-caste” interpreters permanently with LIZARD and also eight radiooperators.325 The names of these personnel were rarely recorded. SRD, Cobra Party, late 1943, p.2 (NAA: A3269,D3/G, p.18) – “From Peak Hill camp, several extra Timorese will accompany the Fairmile to assist the surflanding and the subsequent burial of supplies.” Captain J.L. Chipper, the commander at LMS declared thatAlexandré da Silva (seaman/pilot) has assisted with the beach evacuation/insertion of the LAGARTO50 In the Darwin area, GD personnel were employed at LMS, Peak Hill and Leanyer.As noted above, some may have accompanied operational vessels to the south coast insupport roles. GDs also served at FCS – including the sons of Lieutenant Pires (seefootnote 335 ). Casualties According to its Official History, SRD’s battle casualty figures in Portuguese Timorfor personnel “embarked from Australia” show Portuguese and Timorese as “believedkilled 1, died while PW 4, PW (subsequently recovered) 1” – and 1 Portuguese “died whilePW”.326 These are subsequent identified respectively as Zeka Rebelo (August 1944), J.Carvalho (probably late 1944), A. Fernandes (probably late 1944) – all OP ADDER; Pauloda Silva (May 1944), Cosme Soares (May 1944), Sancho da Silva (27 June 1944 – PWrecovered 2 October 1945) and LT M. de J. Pires (died 4 February 1944) – all OPLAGARTO. 327 A note to the “Summary of Battle Casualties” in the SRD Official Historyadded that for Portuguese Timor “casualties to ‘other natives’ were considerably in excessof those shown in the Summary. At least 20 persons attached to Lagarto were probablykilled, together with many others who at some time helped that party, but insufficientinformation is available as to their numbers and relationship to SRD to include them. Thesame circumstances apply generally to other parties.”328 In commenting on the LAGARTO operation, the SRD Official History notes thatsecurity failures – ie principally the failure to recognise Japanese control of the capturedSRD parties, resulted in the “wretched deaths of 9 Australians, some Portuguese and scoresof fine natives of whom many were chiefs of their districts. Even the Japanese must havedespised the gross inefficiency and criminal negligence with which it was conducted.”329 Lieutenant Pires’ name – noted as “Portuguese Army”, is on the Honour Roll of theSRD Memorial at Rockingham, Western Australia (inaugurated on 6 November 1949) –together with three “civilians” of OP ADDER ie “Carvalho J.”, “Fernandes A.” and“Rebelo Zeka”. Paulo da Silva and Cosme Soares of OP COBRA are not included on themonument. Recruitment However, following increased pressure by the Japanese and their Timorese auxiliaries inlate 1942, civilian dependants of pro-Australian groups – both Portuguese and Timorese,were evacuated from the south coast to Australia.331 While almost all the menfolkremained with LIZARD, the male evacuees included at least five Portuguese and Timoresewho were noted by LIZARD as “our man” and “retain for future use” (see footnotes 115and 116). Occasionally, SRD messages referred to “impressing” useful evacuees fromPortuguese Timor ( ie impress = “to force to serve in army or navy”).332 In February 1943, the last of the Australian forces withdrew from Portuguese Timor– leaving behind the PORTOLIZARD group led by Sergeant António Lourenço Martinsand Matos e Silva. However, the evacuating US submarine on 10-11 February carriedLieutenant Pires and “a few native chiefs and key men ((who)) would be of value on asubsequent entry”.333 This was the genesis of the ISD/SRD programme to train Portugueseand Timorese in Australia for operations into Portuguese Timor – ie “All these men weresubsequently employed by SRD.”334 Lieutenant Pires would return to lead OP LAGARTO,and three of the Timorese evacuated on the USS Gudgeon would later return on the ill-fated OP COBRA. Lieutenant Pires and his LAGARTO party returned to Timor on 1 July 1943 – andon 19 July, he was enjoined by SRD to recruit and evacuate natives ie “in addition to foursignallers, can you send fifteen more men for special training as leaders, observers,instructors etc Portuguese and Indigenes.”335 Preparations for the reception of the trainees atLMS noted “preliminary instruction in weapon training, unarmed combat and demolitions”would be available from early August.336 The PORTOLIZARD group – together with“civilians”, was evacuated on 4-5 August 1943. After a period of rest at LMS, the evacueeswere moved south – apart from “about 30 who were taken on strength by SRD.”337 Thearrival of the Timorese trainees was the catalyst for the construction of the SRD camp atPeak Hill, a few kilometres to the south of LMS. In October 1943, SRD recruited men from Bob’s Farm for employment at SRDfacilities – informing Lieutenant Pires in Timor that “three ABC ((ie Lieutenant Pires))boys and other lads from Bob’s Farm gainfully employed in Army service.”338 331 Broadhurst, D.K. Captain (OP LIZARD), List of Portuguese & Timorese Evacuees – 8-9 December 1942,Portuguese Timor, received Melbourne 2 January 1943 (NAA: A3269, D6/A, pp.49-52).332 Ibid (A3269, D6/A, p.50) - eg Deolindo de Encarnação: “impress for service on ships.”333 SRD, Report on Operations of S.O.A. Party – “ Lizard”, Melbourne, February 1943 (A3269, D6/A, p.5).334 The Official History … , Vol II – Operations, 1946, op.cit., p.19 (NAA: A3269, O8/A, p.32).335 Manderson, H.B. (SRD), No. 11, Melbourne, 19 July 1943 (NAA: A3269, D4/G, p.265). Manderson alsosought a “personal, confidential Timor assistant” – and on 30 July, Pires recommended “my friend Dr CalBrandao” – p.262. Brandão was employed by SRD on 9 August 1943 - see NAA: A3269, D4/G, p.182 fortasks and D27/A, p.15 for dates of service and payments.336 SRD, T.73, Melbourne, 26 July 1943 (NAA: A3269, D4/G, p.235) – personnel were also to be selected forintelligence training at Cairns.337”.338 SRD, Melbourne, 20 October 1943 (NAA: A3269, D4/C, p.294). Lieutenant Pires’ sons serving with SRDwere: José M. de Jesus Pires (aged 19), Manuel H. de Jesus Pires (17) and Mário de Jesus Pires (16).52 After the deployment of LAGARTO and COBRA, SRD - unaware of the groups’capture and control by the Japanese, continued to urge recruitment of personnel inPortuguese Timor - eg on 14 December 1943340: “Keep in mind our need for more traineesbut not, repeat not, refugees. Require men Vieira type down here.” SRD signalled COBRAin February 1944: “next in importance to Fuiloro OP ((observation post)) is our need formore trainees. Make your selection over wide area as possible covering key postos. Amasking Lagarto and Tinoco to do the same.” 341 The Japanese – not wishing to reveal theirdeception operation, signalled SRD: “impracticable to provide native trainees.”342 SRDpersisted however, replying “as main object was to extract trainees … .”343 As late as theend of March 1945, SRD’s Group D in Darwin sought “56 … natives if procurable” for itsarea of operations.344 In late October 1944, an SRD review expressed concern at past recruiting practicesand inadequate documentation – noting the “existing virtual absence of policy.”345 H.B.Manderson – then no longer principally responsible for SRD’s Timor operations, queriedthe basis on which SRD’s Portuguese and Timorese personnel were “originally enrolled” -and rhetorically answered his own question ie: “Answer: none, other than nomination byLieut. Pires as suitable trainees prior to evacuation. Those nominees and G.D. personnelselected on a face value basis by O.C. L.M.S., were retained at Darwin when their refugeerelatives and friends were sent south to Newcastle N.S.W.” In late May 1945, SRD’sfinance officer queried the status of SRD’s Timorese personnel – including the outstandingissue of their formal enlistment, and SRD’s liability for compensation for injury or death totheir next of kin.346 339 Cunha, L., “Timor: a Guerra Esquecida”, Macau, II Serie No.45, Macau, Janeiro 96, p.38. From left toright: José Pires, Bernardino Noronha, Manuel Pires, Câncio Noronha, Mário Pires, José Rebelo – asidentified to the author by Câncio dos Reis Noronha and Manuel H. De Jesus Pires - 2009.340 SRD, No.32, Darwin, 14 December 1943 (NAA: A3269, D4/C, p.277).341 SRD, No.6, Melbourne, 26 February 1944 (NAA: A3269, D3/D, p.207).342 LAGARTO, 15 March 1944 (NAA: A3269, D4/C, p.80).343 SRD, No.47, Darwin, 16 March 1944 (NAA: A3269, D4/C, p.241).344 Group D, Darwin, 30 March 1945 (NAA: A3269, D27/A, p.85). The report noted that Group D held “10Timor native operatives”.345 SRD, “Timorese Payments”, Melbourne, 31 October 1944 (NAA: A3269, V20). The paper also suggested“for immediate consideration” an “all-embracing solution” that the Timorese “be brought under the A.I.F.There would be no objection to this on the part of Canberra or Lisbon nor, after proper explanation, from thestudents themselves.” 53 While no further personnel were recruited from Portuguese Timor, as noted earlierSRD recruited personnel from Bob’s Farm – and also recruited released internees for futureoperations eg Francisco Horta and Porfírio Carlos Soares for OP STARLING (and had alsoapproached Álvaro Martins Meira , Bernardino Dias, António Conceição Pereira andÁlvaro Damas). Several other deportados were recruited by SRD as GD personnel.347 Enlistment The status of Timorese who served as SRD/Z Special Unit operatives during WWIIis quite complex and vexed – in particular, the question of their formal enlistment into theAustralian Military Forces (AMF). Portugal was not a belligerent in WWII.348 However,based on documents in the National Archive of Australia (NAA), from 1943 the AustralianArmy sought to enlist men evacuated from Portuguese Timor and who had volunteered forAMF service. In April 1943, the Portuguese Ambassador called on the Australian HighCommission in London and presented a Memorandum that was forwarded to the AustralianPrime Minister and the Acting Minister for External Affairs – regarding the Timoreseevacuees in Australia stating: “3. Employment of Evacuees in Australia. My Government agrees to their being given such employment as the Commonwealth Government may consider them fit to undertake, not excluding military service.”349 In April 1944, following a letter from the Allied Intelligence Bureau (AIB – ie whocontrolled SRD), the Australian Army’s Adjutant-General recommended that evacueesfrom Portuguese Timor be enlisted on conditions of service at “normal AMF rates” – andnoted that “any Timorese enlisted would be required to take an oath as set out in the ThirdSchedule of the Defence Act.”350 Army consequently employed Timorese evacuees withinthe SRD structure and believed that the advice provided in April 1943 by the PortugueseGovernment (see above) was “sufficient authority to proceed with enlistment.”351Following a query from the Portuguese Consul in Sydney in May 1944352, the AustralianDepartment of External Affairs advised Lisbon (through London) that the Australian Army346 SRD, F/36/1140, 24 May 1945 (NAA: A3269, V20) – the letter expressed concern that Celestino dosAnjos was “in the field as an operative.”347 Including the deportado Augusto César dos Santos Ferreira – who had been interned; and deportados whohad not been interned: Carlos Henrique Dias, Domingos Paiva, and Hílario Gonçalves.348 “Natives” from Netherlands Timor (ie Netherlands East Indies) were formally enlisted by the AustralianArmy for service in SRD/Z Special Unit – eg THE Soen Hin (of Roti) who was enlisted on an AMF formA.A. 200 - “Attestation Form for Special Forces Raised for Service in Australia or Abroad” on 6 March 1944(NAA: B883, THE SOEN HIN).349 External Affairs – London, No.S.69, London, 13 April 1943 (NAA: A1067, PI46/2/9/1, p.7; D27/A, p.17).In August 1944, Lisbon clarified that in April 1943, the “Portuguese Government took the view thatPortuguese volunteers would probably not be required to serve abroad; at the same time their enlistmentwould be confirmed pro tanto to reduce the Portuguese Government’s financial burden in maintaining them”– External Affairs - London, Cablegram 139, London, 10 August 1944 (NAA: A816, 19/301/821 Part 2, p.2).350 Adjutant-General, ?RD/AG9/WJC - “Timorese Civilians”, Melbourne, 8 April 1944 (NAA: 729/6,16/401/125).351 Allied Land Force Headquarters, Melbourne, 15 May 1944 (NAA: A3269, D27/A, pp.153-154).352 Consul Laborinho had arrived in Australia in September 1943 and was apparently not aware of the April1943 Memorandum from the Portuguese Government (see footnote 346). He had opined that evacuees wouldlose their Portuguese citizenship if they enlisted in the AMF. The Secretary of the Army then soughtclarification from the Secretary of the Department of External Affairs – “Timorese Civilians”, Melbourne, 25May 1944 (NAA: 729/6, 16/401/125).54 desired “enlistment for special purposes of some evacuees from Portuguese Timor who areprepared to volunteer.”353 The Portuguese Ambassador in London subsequently advised theAustralian High Commissioner that: “special provisions have now been made enabling any Portuguese in Australia desiring to enlist in the Australian forces to do so without loss of citizenship.”– and Australia’s representative in London advised the Australian Prime Minister.354 A subsequent cablegram from London to Canberra on 10 August 1944 confirmedthat the Portuguese Government “assume that volunteers will in all probability be requiredto serve outside the Commonwealth. Nevertheless they are prepared to exempt volunteersfrom provisions of the penal code under which a civilian national enlisting in the armedforces of another country automatically loses his nationality, provided such volunteers areembodied individually and are not incorporated in specific Portuguese units.”355 In October 1944, SRD internal correspondence discussed SRD’s “liability” towardstheir Timorese operatives and stated: “As for the 20-odd student-operatives, and having in mind the probable conditions of their employment on the ground under Australian or Imperial officers, it is now suggested for immediate consideration by S.R.D. (as an all- embracing solution to the unknown and unpredictable ‘intangibles’ attached to S.O.E. by reason of the existing loose Timorese set-up) that they be brought under the A.I.F. There would be no objection to this on the part of Canberra or Lisbon nor, after proper explanation, from the students themselves.”356 In February 1945 - following a query to SRD in early December 1944 from thePortuguese Consul, he was provided with a list of Timorese evacuees (following a“thorough investigation”) who were “employed in semi army work” – totalling 38 maleevacuees.358 SRD added that “a number of the personnel shown have signified their desireto join the Australian Military Forces” – and requested that the Consul provide a statement,353 External Affairs, Cablegram 107, Canberra, 5 June 1944. This advice was passed to SRD – see AlliedHeadquarters, SM 8768, 17 August 1944 (NAA: A3269, D27/A, p.151).354 External Affairs – London (to the Prime Minister), London, No.110.A., 9 August 1944 (NAA: A2937, 265,p.7).355 External Affairs – London, Cablegram 139, London, 10 August 1944 (NAA: A816, 19/301/821 Part 2,p.2).356 SRD, AK450 to D/FA, Melbourne, 31 October 1944 (NAA: A3269, V20).357 SRD, AK450 to D/Nordops, Melbourne, 1 December 1944 (NAA: A3269, V20).358 SRD, 819/G/5, Melbourne, 12 February 1945 (NAA: A3269, D27/A, pp.146-148). The list provided bySRD including those personnel on the COBRA operation – but not those on the ADDER operation. Nor didthe list include Lieutenant Pires and Patrício da Luz with LAGARTO. Subsequently, in March 1945, ConsulLaborinho queried the SRD-provided list – citing 11 who had not appeared on the SRD list including: JoséRebelo, José Carvalho, Armindo Fernandes (all of ADDER) and Alexandré da Silva. The Consul also advisedSRD of Timorese personnel whom he believed had been released from Army service in recent months (NAA:A3269, D27/A, pp.110-111). 55 in English and Portuguese, that enlistment would not result in any “loss of citizenship.”Also in early February 1945, internal SRD correspondence noted that “there is areasonable prospect of getting quite a number of Timorese personnel to join the A.M.F.,which I am assured by S.C. ‘A’ ((ie Staff Captain ‘Personnel’)) will present no difficultiesonce the enlistment forms are completed … extremely anxious to finalise this matter, whichhas been pending now for some months.”359 In early March 1945, the Group D commanderin Darwin reported to SRD Headquarters on activities at the Peak Hill camp and noted the“intention to have all personnel there enlisted in the Australian Army as this is possible.”360 In March 1945, SRD informed the Portuguese Consul in Sydney: “Since all theTimorese personnel working with us now wish to join the Australian Military Forces, bydoing so they will receive greater financial benefits and allowances, we are anxious toenlist them at the earliest opportunity. We cannot do this until we have an assurance fromyourself” – ie on “no loss of citizenship”.361 In mid-March 1945, SRD’s Group D in Darwin reported that: “The Timorese question is not yet resolved due to the unexplained and disconcerting delay in procuring two documents: one proving to the Timorese that enlistment in the Aust Forces does not entail loss of Portuguese nationality; the second stating that such enlistment in the Aust Forces does not entail service outside the Aust mainland and Timor.”362 The Consul responded to SRD on 20 March querying ten evacuees known to beworking with the Army that had not been included on SRD’s earlier list to the Consul.363The Consul also confirmed Lisbon’s earlier advice “on or about August 1944” thatenlistment in the AMF would not result in loss of Portuguese citizenship. He also notedthat should he receive any queries from personnel volunteering to enlist, he would“promptly” inform them of the Portuguese Government’s earlier advice. The nature of the “bonded” service by Timorese in the Australian Army wasindicated in an April 1945 report on “Timorese Personnel – Group D” that includedpassages indicating that - although some Timorese had sought “discharge”, they were beingretained.364 One Timorese operative was noted as having been “persuaded by mother andfather to make application for discharge from Army service … his discharge would beconsidered (actually, he has been stalled pending finalization of enlistment scheme, whenhe would be given the option to remain as an Australian soldier … )”. In Darwin, in April 1945, SRD staff discussed the “pending finalization of theenlistment scheme” with a number of the Timorese operatives and trainees.365 In late May,the SRD Finance Officer detailed information on the Timorese – including “reasons fornon-enlistment in the A.I.F”. He wrote: “The question of enlistment in the A.I.F. has been going on since Oct 44 to my personal knowledge; I am extremely anxious that this should be settled … it is most desirable that we should be able to offer some protection to Timorese personnel359 SRD Finance, F/38/812, Melbourne, 15 February 1945 (NAA: A3269, V20).360 Group D, Status Report, Darwin, 5 March 1945 (AWM54, 627/1/1).361 SRD, A/PTZ/60, Melbourne, 9 March 1945 (NAA: A3269, D27/A, p.128).362 SRD Group D, Parties # 27, Darwin, 15 March 1945 (NAA: A3269, L1 & H6). Post-War, Dr C. C.Brandão summarized: “…autoridades militares fizeram a proposta de encorporação, mas garantido quenenhum de nós seria enviado a outro teatro de guerra além do de Timor Português, e comprometendo-se aarranjar a declaração de que não se perderiam os direitos de cidadão português.” (“…military authoritiesmade the proposed arrangement that guaranteed that none of us would be sent to another theatre of warbeyond Portuguese Timor, and undertook to affect a statement that we would not lose the rights of Portuguesecitizens.”) – Brandão, C. C., Funo – Guerra em Timor, Edições AOV, Porto, 1953, p.165.363 Consulate of Portugal, 11-A7/43, Sydney, 20 March 1945 (NAA: A3269, D27/A, pp.110-111).364 SRD Group D, Timorese Personnel – Group D, Darwin, April 1945 (NAA: A3269, D27/A, pp.64-66).365 SRD, Timorese Personnel – Group D, Darwin, April 1945 (NAA: A3269, D27/A, pp.64-66).56 SRD/Z Special Unit Remuneration and Wages – for Portuguese and Timorese As noted earlier, in February 1943, five evacuees at Bob’s Farm claimed servicewith the Australian Army in Portuguese Timor and were paid wages for up to 218 days – ieperiods from mid-1942 to mid-January 1943 (see footnote 274). These payments were on arate of 6/-, and later, 6/6 per day. In mid-1943, three Portuguese evacuees to Australia were confidentially employedon contracts by SRD (ie as “Allied H.Q. Geographical Section”)374 ie: Lieutenant Manuelde Jesus Pires on ₤50 per month (₤1/13/2 per day) – footnotes 133, 134; Carlos CalBrandão on ₤25 per month (16/7 per day) - footnote 371; and Patrício da Luz on ₤25 permonth (16/7 per day) - footnote 376 and Annex A. In May 1943, the two evacuatedTimorese boatmen - ie Baltazar Henriques and Alexandré da Silva, were “attached to SRD”at LMS on a monthly wage of ₤6.10.0 (ie 4/4 per day). SRD and Z Special Unit records375 indicate that in late 1944 Portuguese andTimorese personnel were paid at the following rates: General Duties (GD): from 3/6 to 6/- per day.376 Operatives, trainees – not deployed: 6/- to 8/- per day.377 Operatives – deployed: 11/6 per day for COBRA (3). 10/6 per day for ADDER (3). Pay rates for Australian Army personnel in early 1945 were: 6/6 per day forprivates and lance corporals, 10/6 for lance sergeants and corporals, and 11/6 forsergeants.378 In May 1945, SRD Darwin sought pay increases and signalled SRD inMelbourne “Depending on you agreeing to paying the Porto-Timorese personnel on areasonable basis (the Dutch here pay ₤6.10.0 a month upwards), I am sending Brandao on arecruiting mission.”379 Sancho da Silva (OP COBRA) – who had been a prisoner of war, received “backpay” of ₤150 on 19 October 1945. In July 1947, following a submission from Patrício daLuz (OP LAGARTO), he was paid a final settlement of ₤450 for his services in the periodNovember 1943 to August 1945.380 As discussed later, Portuguese officials who had been evacuated to Australiareceived a scaled allowance from the Portuguese Government – paid by the Australianauthorities. During the “partisan phase” of SRD operations in Portuguese Timor led by theLIZARD parties in 1942-1943, several hundred .303 calibre Lee Enfield bolt-action rifleswere provided to LIZARD-directed native Timorese groups.381 However, the LIZARD IIIparty leader reported: “as a personal weapon, the rifle had no place in Lizard … The stengun was generally preferred by the Party ((ie the Australians)) … the objections to theTommy-gun are its own weight and that of its ammunition. It is an awkward weapon … .Nobody quite knew the value of a pistol. There were no occasions on which Lizard wishedto appear unarmed.”382 The PORTOLIZARD group was equipped with 60 rifles, three Bren guns (thestandard .303 light machine gun), eight Sten guns (9mm submachine gun), a Thompson(.45 submachine gun), and several pistols (see footnote 123). LAGARTO was equippedwith Austen submachine guns (an Australian variant of the Sten), and in August 1943requested and was supplied with four .22 calibre rifles and several BSA air rifles (for“silent hunting meat [sic]” – ie for small game hunting). In late July 1943, LAGARTO wasalso provided with 100 “Congo” single-shot pistols and 1,000 rounds of ammunition – toassist Lieutenant Pires “build goodwill and assist sense of security among friendlynatives.”383 The two Australians in the COBRA party were equipped with Austen378 See pay tables at NAA: A3269, D27/A, p.129.379 SRD, Darwin, 16 May 1945 (NAA: A3269, D27/A, p.7).380 The settlement was based on Luz’ contract rate of ₤25 per month. He had earlier been paid ₤100 by theAustralian Consul in January 1946 (NAA: A1838, 377/3/3/6 Part 1, p.15).381 Manderson, H.B. (SRD), letter, Melbourne, 3 October 1945. SRD LIZARD parties had provided“approximately 750 rifles and a few Brens into the hands of native trainees or secret caches in the hills ofcentral São Domingos province” (NAA: A1838, TS377/3/3/2 Part 1, p.63). Sparrow and Lancer Forces alsoprovided weapons and training to Portuguese supporters and Timorese tribesmen – see footnote 111.382 Broadhurst, D.K. Captain, Report on Operation LIZARD, Appendix 6, 8 March 1943 (NAA: A3269,D6/A, p.105).383 NAA: A3269, D4/G, p.238, p.294. Director SRD advised LMS that 1,000 one-shot pistols had beenprovided to LMS (NAA: A3269, L2). “Congo” “native” pistols are not shown in SRD’s technical inventory –SRD had the more sophisticated silenced UK Welrod pistol in .32 and 9mm calibres (see footnote 226 - OPSUNLAG) – range to 30 yards (see NAA: 3269, Q9/B, pp.97-103). The “Congo” pistol may have beensimilar to the US Army FP-45 Liberator pistol – distributed in China and the Philippines beginning in 1942, acrude pistol meant for insurgents with a production cost of $US 2.40, range about 8 metres. Indeed, the 59 submachine guns – and all five in the party, including the three Timorese, were equippedwith .32 calibre semi-automatic pistols.384 All parties were equipped with hand grenades -ie Type 36M with a four-second fuze. Portuguese and Timorese operatives in Portuguese Timor were provided withwatches, and each party carried binoculars and telescopes for observation post (OP) work. Training Courses SRD training facilities have been listed previously – see page 14. The principaltraining activities undertaken by Portuguese and Timorese personnel were commando-related skills. This training was conducted mainly at the Fraser Commando School (FCS)on Fraser Island385 - with training also conducted at Peak Hill (Darwin), Mount Martha(Victoria) and Cairns (North Queensland). Training was classified as “basic, pre-operations, and special”. Detail of the training courses and syllabi are contained in SRD manuals.386 Duringtraining and employment – of both operatives and GD personnel, the Portuguese andTimorese wore Australian military uniforms – ie including slouch hats, web belts andboots. A few personnel wore rank insignia on their shirt epaulettes eg. Lieutenant Manuelde Jesus Pires and Carlos Cal Brandão.387 In early October 1943, 18 young Timorese from Bob’s Farm moved to Fraser Islandto work as GDs developing the camp’s infrastructure.388 Training at Peak Hill – originallytermed the “satellite camp”, began on 21 October 1943, and there were 18 Portuguese andTimorese for training (19, including Martins).389 On 30 November 1943, H.B. Manderson –the Head of SRD’s Timor Section, reported that “Peak Hill pupils compete to wingraduation to FCS High School. While Portuguese like Gamboa do not relish returning toTimor as observers and can be disregarded.”390 Following his visit to Darwin, Manderson described the facility to the Director ofSRD as a “sorting camp”: “Generally, you can continue to regard the Timor Section as more unsinkable than ever as these valued boys are natural operatives already possessing a sound “Congo” may have been an SRD cover-name for the FP-45 Liberator pistol.384 The complete equipment tables for Operation COBRA are at NAA: A3269, D3/G, pp.9-16.The party wasarmed with Browning and Bayard pistols. The smaller – and more easily concealed, Bayard pistol wasprobably issued to the Timorese members of the party for concealment under native dress.385 In late 1943, SRD engaged two movie photographers - F. Tate and L.A. Baillot, to produce a 16mmtraining film on the activities at FCS. The film includes footage of Timorese GDs and trainee operatives –including members of the OP ADDER party. H.B. Manderson was also present for some of the filming. Thefilm has been “remastered” and reproduced as a DVD by the Australian Bunker and Military Museum(ABMM) as “Fraser Commando School”, 2009.386 The Official History …, Vol IV - Training Syllabi, 1946, op.cit., (NAA: A3269, Q series).387 See Cardoso, A. M., Timor na 2ª Guerra Mundial…, 2007, p.11 (Pires), p.91 (Brandão). See footnote 364for Brandão described as a “Lieutenant”; and footnote 394 for Brandão as a “2LT”.388 Lieutenant G.H. Greaves arrived with 18 Timorese on 7 October 1943 – who were engaged in “formingroad from the beach to the camp, clear timber and levelling” (NAA: A3269, Q10).389 Manderson, H.B., Darwin, 30 November 1943 (NAA: A3269, L2). The Peak Hill camp was designated the“Advance Training Centre Darwin” from June 1945.390 Ibid. Formal training at Peak Hill began on 21 October 1943.60 grasp of essentials and entirely confident of their ability – and will stay solid on the ground and spread the gospel and even assuage A.I.B.”391 The training was physically demanding. The basic course at FCS lasted eight weeksand comprised guerrilla warfare, jungle fighting, weapons training, demolitions,communications and the use of collapsible canoes (“folboats”) for insertion and raidingoperations – and included four arduous field exercises. Morse training was also conductedfor Timorese at Mount Martha, and “cavern courses” were held in Rockhampton (seefootnote 82). Parachute training was undertaken at RAAF base Richmond (NSW) and laterat RAAF Leyburn (QLD). Parachute Training 391 HBM to DU, LMS No.74, Darwin, 1 December 1943 (NAA: A3269, L7).392 The Timorese include personnel who subsequently deployed on OP ADDER. The photograph was takenby H.B. Manderson and is in the Australian War Memorial (AWM) collection – PR91/101 Part, L15. Shownare (from left to right) – seated: Armindo Fernandes, João Almeida ; standing: Bernardino Noronha, CâncioNoronha, José Rebelo, Australian instructor, José Carvalho. 61 Morale Maintaining morale among the Timorese and Portuguese at Fraser Island and inDarwin was at times difficult. In late May 1944, “contretemps” arose among the Timoreseoperational students and GDs at FCS regarding leave.395 In early June 1944, Timoresetrainees at FCS were given 15 days escorted leave to Armidale (where many evacuees wereaccommodated) – for an “improvement in morale”. In Darwin, in early February 1945, there was a “crisis” when “most” of theTimorese “were offended by the unfortunate striking by an Australian officer of JoãoBublic and decided that the Army was not the most ideal way to employ their time” - andbecame “dissenters”.396 An LMS Progress Report noted however that: “2LT Brandaorestored morale – three operators who three weeks ago asked to be sent home after anincident with LT Holland, now express regret and request to be allowed to stay.”397 Atabout this time, the Portuguese manager of the Timorese GDs at Leanyer (south of Darwin)protested “with certain justification about the treatment of his GDs – and was evicted toLMS by the CO with the word ‘half caste’ ringing in his ears.”398 The disenchantment of the Timorese appears to have continued. In March 1945 -when Sousa Santos visited LMS, there were no Timorese volunteers for his OPSTARLING into western Portuguese Timor399 – and no volunteers for the subsequent ill-fated operation into Oecussi (OP SUNABLE) or for Captain Wynne’s OP SUNCOB. FromMarch 1945, several Timorese wrote to Consul Laborinho seeking release from SRDemployment.400 Leave and pay rates were also a cause for discontent. Noting the “disconcertingdelay” in resolving the question of enlistment, the Group D commander wrote in mid-March 1945: 393 As recorded on Australian Army V.3012 forms on NAA: A3269, V20 as members of “Z Special Unit” andother sources. The website “Boinas Verdes de Portugal 1955-2006” also notes 12 Timorese as havingcompleted parachute training. Baltazar D. from Dutch Timor also completed a parachutist course inNovember 1944. Eduardo Francisco da Costa also participated in parachute training at Richmond in February1945 but failed the course.394 Seven “jumps” were required for qualifying. When training was transferred to RAAF Leyburn, the coursewas reduced to 10 days – with less qualifying jumps. Lieutenant A.D. Stevenson, Sergeant R.G. Dawson(both OP SUNLAG) and Felix da Silva Barreto completed the Leyburn course in April 1945.395 Group D, Progress Report, Darwin, 21 May 1944 (NAA: A3269, L1). The youngest [sic] of the Piresbrothers (aged 16) – was reported as “returning” to Narrabri.396 Group D, Timorese Personnel Group D, Darwin, April 1945 (NAA: A3269, D27/A, p.64).397 Group D Progress Report, Darwin, 1 March 1945 (NAA: A3269, L1).398 Group D, Timorese Personnel Group D, Darwin, April 1945 (NAA: A3269, D27/A, p.65). The“Portuguese” was the former Chefe de Posto of Viqueque, João Henriques (also as Henriques João)Fernandes – ie “Lisboa”.399 The SRD Official History noted: “disaffection among Portuguese and Timorese … in particular theirfailure to volunteer to serve under Santos” - The Official History … , Vol II – Operations, 1946, op.cit., p.55(NAA: A3269, O8/A, p.71).400 Consulate of Portugal, No.278 11-A7/43, Sydney, 20 March 1945 (NAA: A3269, D27/A, pp.110-111).62 “In the meantime an old promise of leave had to be kept and the first leave party departed on 14 March. Four members of this party are on a wage scale of 30 shillings per month, which only just allows them to buy tobacco. As the delay in enlistment in the Forces is not these men’s fault – and leave without a small amount of spending money is impossible, the question of a leave bonus was again raised with Melbourne H.Q. … marked ‘IMPORTANT’. When the party left on 14 March, NO answer had been received.”401 Of the 14 granted leave from Darwin, several refused to return to Darwin in early April1945.402 Stores (unusual) Supplies and stores were delivered to SRD parties by sea-landing and by parachutedcontainers – “storpedoes”. Unusual items403 sent to the SRD teams included: Portuguese-language copies of Readers’ Digest; Penguin books; magazines – including SALT (amagazine produced by the Australian Army in Melbourne); newspapers; chemicals (“dogdope”) to thwart dog-tracking by Japanese and hostile Timorese404; vitamin B to combatberi-beri; vitamin capsules; corn cures for feet; native sarongs – special sarongs – “lepas”,were printed for the ADDER party; and replacement glasses405 sent for Lieutenant Pires. InAugust 1943, Lieutenant Pires requested “boots with heel in front and soles at back … todeceive our pursuers.”406 SRD’s Secret Stores included poisonous “L tablets” – or “L for Lozenge tablets”407.Captain Ellwood (LAGARTO) described these as his “L (kill) tablets” – ie a suicide pillintended to be taken before capture or under the duress of interrogation.408 An indicative listing of stores409 – principally foodstuffs, dropped to the LAGARTOand COBRA parties, included: tins of beef, salmon, cabbage, fruit, jam, milk; flour; tea;coffee; and sugar. To boost morale, SRD messages to LAGARTO and COBRA also routinelyincluded war news of Allied advances in Europe and the Southwest Pacific – including thebombing of Japan, the Russian advance on Berlin, the seizure of Iwo Jima etc. Currency410 401 Group D Progress Report, Darwin, 15 March 1945 (NAA: A3269, H6 and L1). 13 Timorese personnel and“Lede” (NEI) from Group D were listed as “on leave” in the “Group D Location” report of 15 March 1945(NAA: A3269, H5).402 António Pinto, Guilherme dos Santos and Apolonario at Armidale; João Bublic, Domingos da Costa andJosé Joaquim dos Santos at Narrabri West. Manuel Martires, Abel da Sousa and Manuel Ki’ic at Glen Innesmay also have refused to return (NAA: A3269, D27/A, pp.70-71).403 NAA: A3269, D4/G, p.357 – Readers’ Digests; newspapers - p.264; dog dope - pp.286-287. NAA: A3269,D4/C, p.71 – Penguins, SALT magazines, Readers’ Digests.404 NAA: A3269, D4/G, pp.286-287, p.290. SRD Secret Stores included “Drages [sic] dog” (NAA: A3269H4/C). Lieutenant F. Holland (LIZARD III) reported “Japs hunting with big dogs” – 21 January 1943 (NAA:A3269 D6/B). LAGARTO was also harried by Japanese and natives with dogs (NAA: A3269, D4/G, p.50).405 Lieutenant Pires lost his glasses, a suitcase and three radios in the surf when landing from the submarineUSS Gar on 1 July 1943 (NAA: A3269, D4/G p.341) – see also the US submarine commander’s comments atfootnote 146.406 LAGARTO, Portuguese Timor, 23 August 1943 (NAA: A3269, D4/G, p.122).407 It appears that these pills may also have been crushed and placed in baits to kill “dogs and other vermin” -SRD T.53 – for LAGARTO, 15 July 1943 (NAA: A3269, D4/G, p.286, p.287, p.290).408 Ellwood, A.J., Operational Report on Lagarto, October 45 (NAA: A3269, V17, p.161).409 SRD Darwin, D4/B, 26 November 1944 (NAA: A3269, D4/A, p.407). 63 In early 1942, Australian Sparrow Force personnel lacked currency to pay fornecessities as their payments in Timor had been in NEI guilders which were not wanted bynatives in Portuguese Timor. In mid-March, Consul David Ross visited the Sparrow Forceheadquarters and – before returning to Dili, issued the officers with notes – termed surats(“letters” – ie IOUs). These stated that “the British and Australian governments wouldappreciate any services which can be rendered” and payment would be made to “Officersof the Administration of Portuguese Timor … by draft on London in sterling, or such othermethod as may be desired.”411 “It was also seen as a way of buying the loyalty of anyresident Portuguese who dreamed of returning to his homeland – the local currency wasworthless, whereas English or Australian pounds would be extremely useful.”412 The suratsystem was also used to purchase food from the Timorese. Sparrow Force was able to “buybananas, coconuts, rice, maize and even goats … the surats were honoured before the endof the war when Australia redeemed them from bags of silver coins, sent specifically forthe purpose.”413 As noted above, Sparrow Force paid for purchases of food “in Australian silvercoins which were greatly treasured by the natives for their ornamental value…. We alsoused the local paper money … the ‘petaka’.”414 However, by August 1942, it was reportedthat: “Another difficulty is the unreliability of the natives of Portuguese Timor. This ishoped to be overcome by the use of money in the form of currency, which efforts are beingmade to obtain for dispatch to our forces in Portuguese Timor.”415 In October 1942, SRD noted: “We are at present reproducing a certain amount ofPortuguese Colonial Currency which it is the intention that the Party ((ie LIZARD)) shoulduse if and when they get into a jam. It is obvious we cannot flood the country with thiscurrency as this would be detrimental to their local finance and at the same time wouldundoubtedly be resented by Lisbon. The notes are being secretly marked so that in theevent of any international difficulties we can say that we are prepared to redeem all suchcurrency issued. … if considered necessary, a limited quantity could be supplied toSparrow, but it is not considered advisable that financing of Sparrow on a large scaleshould be done through this medium. We are also hoping to reproduce the Japanese N.E.I.currency …”.416 410 A detailed and technical explanation of pre-WWII currency is at: Allied Mining Corporation, 15 April1937 (NAA: A1067, PI46/2/9/1, pp.35-36). In 1942, the exchange rate of the pataca (comprising 100 avos)had reportedly been “standardized” as equal to one Dutch guilder or 1/12 of an Australian pound – Straaten,N.L.W. Van, Lieutenant Colonel, Comments, 8 June 1942 (NAA: A1067, PI46/2/9/1, p.51) ie a pataca wasequal to one Australian shilling and seven/eight pence – see also footnote 37. For detail on the range ofcurrencies in use, see Land Headquarters, Descriptive Report on Timor, 28 May 1942 (NAA: A1067,PI46/2/9/1, p.85).411 Callinan, B.J., Independent Company, 1953, op.cit., pp.70-71 which includes a copy of a note issued toCaptain Callinan. Australian soldiers also issued informal “surats” – particularly to criados, acknowledgingtheir service to the Australians – Callinan, B.J., 1953, op.cit., pp.202-203.412 Ayris, C., All The Bull’s Men, PK Print Pty Ltd, Hamilton Hill, 2006, pp.199-200. “Two small bundles ofPortuguese money from Ross’ safe” were also later delivered to Sparrow Force, p.361.413 Ibid, p.200. For detail on Sparrow Force’s requirements for, and use of, Australian currency, see alsoCallinan, B.J., Independent Company, op.cit., 1953, pp.152-153 and pp.188-189 ie “one hundred pounds permonth … for one platoon.”414 Lambert, G.E., Commando …, 1997, op.cit., p.120. The silver coin was probably the 20 avo piece (worthone fifth of a pataca), a Chinese coin with a hole in its centre. The local pataca currency was only availableas a paper notes – including small denomination notes of 5, 10, 25 and 50 avos.415 Secretary F.G. Shedden – Department of Defence to Minister for External Affairs, Melbourne, 27 August1942 (NAA: A5954, 564/2, p.52). In September 1942, the ill-fated HMAS Voyager brought £3,500 in silvercoins for Sparrow/Lancer Force - “metal cans brimming with two shilling pieces were loaded onto horses” –Ayris, C., All the Bull’s Men, op.cit., 2006, p.338.64 Following the withdrawal of the LIZARD party from Timor in February 1943, thecommander wrote: “To the last, Portuguese paper currency was acceptable in the areasLizard operated in. The only silver coinage used is the 20 cent Chinese piece, moreacceptable than the Portuguese paper equivalent. Lizard used some Australian notes amongchiefs, by whom it was gratefully accepted as a stable currency and in the faith of aninevitable Allied conquest of Timor. Australian silver ((ie 3d, 6d, 1/-, 2/- coins)) was usedby Lizard not for its purchasing value, but as tokens and propaganda presentations. AllAustralian silver remaining with Lizard at the end was given to the Portuguese Party ((iePORTOLIZARD)), by whom it was grasped more avidly for its purchasing power than thePortuguese currency notes given them. Gold was used sparingly by Lizard for presentationto Chiefs. Good currency, notes and silver, is recognised by all natives with whom we camein contact. Flimsy Japanese notes and feather-weight coinage will never be regarded exceptas an imposition.”417 The LIZARD party also noted: “The natives liked our Australiansilver money: the 5/- shilling pieces would go well there.”418 Quite large sums of patacas were provided to the PORTOLIZARD group in mid-1943. On 3 June 1943, Matos e Silva requested 15,000 patacas be provided from SRDMelbourne – “purpose of furnishing each person with sufficient funds to permit them tohide in smaller units”, and noted “Everything extremely dear. Maize thirty patacas a picul.Only silver, pound and new patacas accepted.” 419 On 18 June, PORTOLIZARD requested“10 patacas for each Portuguese”, and were advised by SRD that the returning LieutenantPires (LAGARTO) would bring “sufficient money for all.”420 During evacuations fromPortuguese Timor, SRD directed that no small-note denomination patacas be carried out byevacuees – eg: “Remember no notes less than five patacas.”421 This direction was probablyto ensure a supply of small notes for use by SRD parties in Portuguese Timor.422 In late 1943, SRD’s Reproduction Section broadened its currency and documentproduction activities. In October, the Section reported: “Further printing of Timoresepataca notes (including five pataca) – and also Straits currency”; and “Reproduced higherdenominations of Malay currency”.423 In March, a Section report noted: “Besides copying 416 SRD, Melbourne, 5 October 1942 (NAA: A3269, D6/A, p.13). The Reproduction Section of the SRDTechnical Directorate produced maps of Portuguese Timor and was “counterfeiting the Portuguese Timorcurrency in the form of notes of the Banco Nacional Ultramarino. The notes were reproduced for Lizard. Thenotes were marked secretly, so that they could be withdrawn from circulation in due course.” - The OfficialHistory …, Vol I - Organisation, 1946, op.cit., p.75 (NAA: A3269, O7/A, p.128).417 Broadhurst, D.K. Captain, Report on Operation LIZARD, Appendix 3, 8 March 1943 (NAA: A3269,D6/A, p.102). A photograph of Japanese currency - including a very lightweight coin - with an aluminiumsurface and a cardboard centre, can be found on the website of the Australian War Memorial as photographID 013776 – of 9 December 1942.418 Holland, F. Lieutenant (LIZARD III), Report – early 1943 (NAA: A3269, D6/A, p.131).419 PORTOLIZARD, 3 June 1943 (NAA: A3269, D4/G, p.435). The next day, H.B. Manderson replied to theDirector SRD (then visiting Darwin): “Not so startling as might appear. Had something same idea myself butrather afraid they would ask for million.” – p.433. A “picul” (100 catties) is 60.4kg ie a “standard” load for ahuman carrier in Asia.420 NAA: A3269, D4/G, p.387 and p.389.421 SRD – to LAGARTO managing evacuation, 16 July 1943 (NAA: A3269, D4/G, p.286). On the arrival ofthe evacuees in Darwin on 4 August 1943, SRD directed: “impress notes below five patacas.” – p.206. Thedirection that “no notes of lower denomination than FIVE PATACAS” supplied by SRD were to be removedfrom Portuguese Timor was included in the 12 June 1943 “Timor Mission” directive to Lieutenant Pires(NAA: A3269, D4/A, p.475).422 Before the PORTOLIZARD evacuation, Lieutenant Pires (OP LAGARTO) “confiscated” all the patacasheld by the evacuees (1,312 patacas valued at ₤109.6.8; @ 1/8d = one pataca) – presumably “to enlarge hisown operational funds” – SRD D/Nordops, Melbourne, 1 December 1944 (NAA: A3269, V20).423 Timor Section Progress Report, Melbourne, 6 October, 21 October and 10 November 1943 (AWM,PR91/101). The Reproduction Section were: “silver and paper money aging experts.” 65 jobs for SRD, a considerable quantity of Japanese paper currency and Dutch new minting‘were aged in the wood’ for NEFIS ((Netherlands Forces Intelligence Service)).”424 SRD operational personnel carried a range of currencies. For example, for OPSUNABLE in June 1945 deployed into the Oecussi enclave, each of the four teammembers carried 25 Dutch guilders and 16 patacas, and a further £15 of silver coins wereincluded in the team’s storpedoe.425 Propaganda Leaflets 424 Timor Section Progress Report, Melbourne, 27 March 1944 (AWM, PR91/101). The Reproduction Section– under the Timor Section led by H.B. Manderson, was minting metal coinage for the Netherlands IndiesForces Intelligence Service (NEFIS) and also “ageing” the coins. The Progress Report of 21 June 1944 alsonoted “silver currency has been treated for the Dutch”.425 NAA: A3269, D9, p.44.426 Holland, F. Lieutenant (LIZARD III), Report – early 1943 (NAA: A3269, D6/A, p.131): “If morepropaganda papers are to be dropped, they should be written in Portuguese or Tatum [sic]. The ones that weredropped when we were on the island were in Malay and very few natives read this language.”427 FELO, Brisbane, 1 January 1945 (AWM54, 795/3/12). Totals were: Japanese: 492,925; Malay: 580,000;Chinese: 23,000; Dutch: 9,000; Portuguese: 102,000; Native: 21,000 - ie to 30 November 1944. Malay-language leaflets were dropped in Dutch Timor. FELO leaflets in Portuguese can be seen at .428 SRD – 450 to Director SRD, 9/J, Brisbane, 19 November 1943, p.2 (NAA: A3269, D/3G, p.29).66 In December 1943, Manderson wrote to the Director of SRD on his visit to Darwinin late November and noted the “disruptive hostility” of Portuguese Sergeant AntónioLourenço Martins – and the need to “build up the spirit of the Timorese” at the Darwinfacilities. Manderson related: “To this end, by subterranean means, I had instituted before Ileft, through the students themselves, an underground movement styled “TIEIA TIMOR” orthe “Timor Network” which is hoped to be the operating section of a national resistanceorganization to be called “Filhos de Timor” (“Sons of Timor”). A fancy oath and othersecret furbishments likely to appeal to the native mind have been designed.”429 In March1944, Manderson signalled LMS on the “Peak Hill build up” and the “creation of a force tobe known as the ‘Timor Territorials’ ” - adding “Appropriate documentary fanfare inpreparation.”430 However, it does not appear that this proposal was developed further.431 There is nomention of “independence” in the document – and it may well have merely beenManderson’s intention to appeal to Timorese loyalty to Portugal. Moreover, AustralianGovernment policy at the time would probably not have supported any incitement ofindependence for Portuguese Timor – particularly in the light of the British and Australianassurances on the sovereignty of Portuguese Timor given to Portugal on 14 September1943 ie the Aide-Memoire No. 16 to Prime Minister Salazar432 that also included proposalsfor future discussion of common defence issues. Portugal’s Prime Minister Salazar told the British Government on 23 June 1943 thatPortugal wished “to participate in the operation to oust the Japanese from PortugueseTimor.”433 On 5 July 1943, Australian Prime Minister Curtin had stated that Australia was“glad to be associated” with “general assurances” of Portuguese post-war sovereignty over429 Manderson, H.B., 10 December 1943 (AWM, PR91/101).430 SRD, T19, Melbourne, 23 March 1944 (NAA: A3269, L7).431 A Timorese SRD operative (1942-1945) – Câncio dos Reis Noronha, had not heard of the proposed“Filhos do Timor” movement. While there was sometimes occasional brief mention of “independence”among Timorese operatives, the matter was apparently not taken seriously - author’s interview with Cânciodos Reis Noronha, Melbourne, 6 December 2008.432 British Embassy – Lisbon, Aide-Memoire No.16, 14 September 1943 (NAA: A6779, 19, p.39). TheAustralian High Commissioner in London informed Canberra that he had assured the Portuguese Ambassador“that he could advise his Government that they need have no misapprehensions whatsoever about PortugueseTimor. The Commonwealth Government had given certain undertakings and the Portuguese Governmentcould rest assured that we would live up to them.” – Cablegram 189, London, 21 October 1943 (NAA:A6779, 19, p.37). The “Pacific Affairs” conference in Canberra in January 1944 subsequently consideredPortuguese Timor sovereignty issues – Pacific Affairs Conference, Notebook No 1, Section 1, paras 45-50 –and included “qualifications” at paras 51-53 (NAA: M2319, 4). Paragraph 26 noted: “any claim forunconditional return of the colony of Portuguese sovereignty is inadmissible”. The Portuguese account isexpressed in “Timor: Semi-Official Statement”, Dr A. de Oliveira Salazar - President of the Council, Lisbon,29 September 1945 (NAA: A981, TIM D 1 Part 2, pp.1-10; A1838, 377/3/1 Part 1, pp.215-223). For adiscussion of plans for an Australian-based Portuguese expeditionary force (4,000-strong) to participate in there-occupation of Portuguese Timor, see also Chamberlain, E.P., The Struggle in Iliomar, Point Lonsdale.,2008, pp.36-37. 67 Portuguese Timor and noted “with satisfaction the proposal that Portuguese troops beassociated with United Nations434 forces which will ultimately undertake the liberation ofTimor.”435 In September and October 1944, a Joint Anglo-American Military Mission helddiscussions in Lisbon and developed a proposal for a 5,000-strong Portuguese “regimentalcombat team”436 for operations against the Japanese in Timor. The Portuguese proposalenvisaged that, if the Japanese were to surrender, this Portuguese force alone would re-occupy Portuguese Timor. SRD does not appear to have been apprised of these developments. The Portugueseproposal however included provision for a Portuguese officer “with long experience inTimor” to be sent to Australia to assist in “organizing an intelligence ‘net’ in PortugueseTimor, utilizing Portuguese nationals still in Timor or in Australia.”437 The Portugueseproposal also noted: “If the Allies wished to organize guerrilla warfare in Timor as apreliminary to or simultaneously with an assault, there would be no objection in principleto enlisting the co-operation of Portuguese nationals (European or native). The PortugueseGovernment would however wish the officer mentioned above to make the selection so asto exclude persons whose participation might cause trouble later to the Portugueseauthorities and to ensure that only reliable natives were issued with arms.” In late November 1944, the British Government formally agreed “to theparticipation of Portugal in such operations as may be conducted eventually to expel theJapanese from Portuguese Timor in order that the territory may be restored to fullPortuguese sovereignty. It recognizes that such participation can be effected in direct andindirect form.”438 In mid-March 1945, the British requested that Australia host aPortuguese “training cadre” and an eventual “Portuguese Expeditionary Force” of about4,000 troops for military operations to recover Portuguese Timor from the Japanese.439 TheAustralian military undertook detailed studies on the hosting of the proposed Portuguese433 Dominions Office, No.802, London, 16 October 1943 (NAA: A3317, 151/1945, p.74). This Statement onPortuguese policy during World War II - ie to collaborate in any operations with the object of “reconqueringor re-occupying Timor”, was released to the media on 7 October 1945 – Dr A. de Oliveira Salazar, Presidentof the Council, Timor: Semi-Official Statement, Lisbon, 29 September 1945 (NAA: A1838, 377/3/1 Part 1,pp.215-223) – see also The Times, London, 9 October 1945; and “Portugal Explains Why She Did NotFight”, The Sydney Morning Herald, Sydney, 8 October 1945 (NAA: A2937, 268).434 The “United Nations” resulted from a “Joint Declaration” document signed by the representatives of 26nations on 1 January 1942 - which linked to the earlier “Atlantic Charter” of 14 August 1941, and opposedthe “Tripartite Pact and its adherents”.435 Australian Prime Minister– Cable O.18024/51, Canberra, 3 July 1943 (NAA: A5954, 2253/1, p.236). Theforegoing Australian position was formally advised to the Portuguese Government vide British Embassy –Lisbon, Q.41/1/9 No.16, 14 September 1943 (NAA: A5954, 2253/1, p.214; A3317, 151/1945, p.82-85).436 Brigadier A.W. Wardell MC attended the Lisbon talks as the Australian representative (NAA: A5954,2253/1). The force, based on two infantry battalions was planned to include 400 African troops and beassembled initially in Mozambique.437 Defence Committee, Agendum No. 239/1944, 5 December 1944 (NAA: A5954, 2253/1, pp.86-87). Noaction was taken by the Defence Committee on the proposals developed by the Anglo-American Missionspending a decision by the Combined Chiefs of Staff – 20 December 1944 (NAA: A5854, 2253/1, p.84).438 Salazar, A. de Oliveira Dr, Note to the British Ambassador, Lisbon, 28 November 1944 – repeating thecontent of British Ambassador’s note of the same date, and accepting such as an agreement (NAA: A1838,377/3/3/3; A5954, 2253/1, p.84 and pp.4-6). “Direct participation” would be by “Portuguese forces”.Portugal’s “indirect form” of participation - ie the granting of “concessions” in the Azores for the use of USand British aircraft, was also noted. The United Kingdom encouraged the Australian Government to acceptaccommodation and training of the Portuguese Force in Australia – Secretary of State for Dominion Affairs,Cablegram 72, London, 15 March 1945 (NAA: A5954, 2253/1, p.77). Portugal’s interpretation of itsreadiness to engage in the liberation of Portuguese Timor is summarised in the post-War “Semi-OfficialStatement”, Lisbon, 29 September 1945, pp.2-10 (NAA: A981, TIM D 1 Part 2, pp.2-10). This statement alsonotes that “the Government naturally had to count Macao and Timor as two pieces in the same game.” – p.8.439 Secretary of State for Dominion Affairs, Cable 72, London, 13 March 1945 (NAA: A1838, 377/3/3/3).68 force – including costings, and considered two locations for the necessary training bases(Sellheim and Rockhampton in Queensland).440 However, in late May 1945 - followingconsideration of the proposal’s “practicability” by the Australian Defence Committee, theAustralian War Cabinet determined: “In regard to the proposal that 4,000 Portuguese troopsshould be received, trained and maintained in Australia to participate in the liberation ofTimor, War Cabinet was averse to undertaking a further commitment to providerequirements for this force, having regard to existing commitments on Australianresources.”441 According to a British diplomatic report: “Actually no formalcommunication” to the Portuguese proposal was made by the UK or US “until the 13thAugust ((1945)), when Japan had already collapsed, and it was clear that no full-scaleoperations would be necessary to retake Timor.”442 Deportados Large numbers of Portuguese men were deported to the Portuguese colonies in themid-1920s to the early 1930s following anarchist, communist and other left-wing activities- principally in Portugal, but also from several African colonies. 65 deportados arrived inDili aboard the Pero de Alenquer on 25 September 1927; 358 on the Pedro Gomes on 16October 1931 (connected with the “revolt” of 26 August 1931); and 30 arrived on the GilEanes on 21 October 1931. The arrival data of a further 25 deportados is unclear. Thisbrought the total of deportados in Portuguese Timor to over 500443 – far more than theresident Portuguese administrators and the very few settlers. Within a short time, thepresence of the deportados was a major contribution to the growth of the mestizopopulation. However, following an amnesty declared by Lisbon in December 1932, all buta handful of those deported aboard the Pedro Gomes in October 1931 returned to Portugalin 1933. The Governor of Portuguese Timor described the Colony’s pre-War population asfollows: "The core of the largest European group was composed of about ninety deported, social and affiliates, sent to us after the revolt in Guinea in 1927 - and others in 1931. There were about a dozen European settlers - or former military employees, pensioners, which had come to Timor and there were dedicated to agriculture and livestock. Besides these there were the employees of Sociedade 440 The Report of the Joint Administrative Planning Sub-Committee was considered by the DefenceCommittee as Agendum No.29/1945, 14 May 1945 (NAA: A5954, 2253/1, pp.61-67; A3317, 151/1945,pp.23-27). The report of the Planning Sub-Committee however also included: “Portugal has not been at warwith the Japanese and has no claim to accept or participate in acceptance of surrender. We are howeverwilling that the Governor should be present at the surrender formalities as representing Portuguese civilauthorities” - JAPSC/16/45, 14 May 1945 (NAA: A1838, 377/3/3/3).441 War Cabinet Minute 4223 – Review of the Direct War Effort, Canberra, 31 May 1945 – advised to theDominions Office, London vide Telegram 158, 16 June 1945 (NAA: A2937, 268, p.17).442 British Embassy, P45/67/1, Lisbon, 8 November 1946 (NAA: A1838, 377/3/1 Part 1, p.142). The reportadded: “The tardiness and very strange nature of this communication produced a bad impression on Dr.Salazar.”443 These arrivals of ship-loads of deportados to Portuguese Timor – with 528 deportados named, are found inCardoso, A.M., Timor na 2ª Guerra Mundial – O Diario do Tenente Pires, CEHCP ISCTE, Lisboa, 2007, pp.235-259. 69 Agrícola Pátria e Trabalho, about five or six, and two traders, and former convicts, on the brink of bankruptcy."444 As noted earlier, several deportados had been active in assisting Australian ConsulRoss and Whittaker before the Japanese landing, and many later supported Sparrow Forcetroops and SRD/Z Special Unit operations. Deportados were also prominent in thePortuguese columns that suppressed the “native uprisings” in mid-late 1942 (see Annex G). Internment Based on Lieutenant Pires’ messages from Portuguese Timor in early August 1943(as discussed earlier), SRD advised Army of their security concerns regarding 13Portuguese male evacuees (including Sergeant António Lourenço Martins).445 RegardingSergeant José Arranhado and Corporal Casimiro Paiva, SRD sought their internment “ifthis can be done without serious political complications” - as they were both Portugueseservicemen. SRD noted that Arranhado and Paiva had “undergone secret training for thisorganization for special service. Their conduct at the point of disembarkation ((ie ofLAGARTO on 1 July 1943)) seriously impeded the operation, and their conduct hasapparently since been such that the principal agent in the territory arranged for theirremoval as soon as he was able.” Army immediately advised the Director of Security ofSRD’s concerns – noting that Arranhado and Paiva had “seriously impeded the operation”,and “it is most undesirable that they should remain at large.”446 On the remaining 11, Armybelieved “their recent conduct in Timor indicated either active treachery or completeunreliability.” Accordingly, Army requested that the 11 not be accommodated at Bob’sFarm, but that the “men be split up and sent so far as possible to separate employment inthe North where they are unlikely to get into contact with other Portuguese Nationals or toreach large centres of population.” 12 of evacuees mentioned above - ie less Sergeant António Lourenço Martins whoremained at LMS for several more weeks, departed LMS on 23 August 1943 and travelledin a larger group of evacuees by sea to Brisbane. On arrival at Brisbane on 10 September1943, the 12 were taken into custody by the Security Service447 – while the other evacueestravelled south by rail to Bob’s Farm.448 444 Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.5. The 1941 report by the visiting BritishConsul-General (Taiwan) C.H. Archer stated there were “slightly under 100” deportados in a total Portuguesepopulation of about 300. The deportados were reportedly living “in liberty” in Portuguese Timor – of whom“about 60 percent were ‘democrats’, 30 percent communists and 10 percent other criminals” – see Archer,C.H., Report on Portuguese Timor, Canberra, 3 May 1941, para 29 (NAA: A981, TIM D 1 Part 2, pp.38-76,and his draft report of 29 April 1941 at A981, TIM P 9, p.7). Portugal ceased sending deportados to Timor in1949.445 SRD, Melbourne, 22 August 1943 (NAA: MP742/1, 115/1/245).446 Allied Land Forces, SM20738, Melbourne, 22 August 1943 (NAA: MP742/1, 115/1/245).447 Sergeant José Arranhado, Corporal Casimiro Augusto Paiva, Corporal Álvaro Martins Meira, CorporalPorfírio Carlos Soares, Francisco Batista Pires – and seven deportados: António da Conceição Pereira, LuísJosé de Abreu, Francisco Horta, Jacinto Estrela, José Filipe, Álvaro Damas and Pedro de Jesus.448 Ross, L.W., Escorting Officer’s Report, 20 September 1943 (NAA: MP742/1, 115/1/245).70 Francisco Horta Gaythorne September 1943 The 12 (all Portuguese - and including seven deportados ) were detained under awarrant issued pursuant to National Security Regulations, 24 August 1943 – Regulation 26and the Army Act 1903-1939. They were initially accommodated at the GaythorneInternment Camp (Enoggera, Brisbane), interviewed and allocated internee identificationnumbers in the “Q” (ie “Queensland”) series.449 On 22 September, SRD provided furtherinformation to Army on the detained evacuees in “Brisbane”– but not “detailedinformation” lest such reveal “secret operations.”450 Very soon after, the “Gaythorne group”was moved south to the Liverpool Internment Camp on Sydney’s outskirts, arriving on 25September 1943. Following the April 1943 “melee” at Bob’s Farm related earlier, several of thedeportados left the camp for outside employment – principally at a pulp-wood enterprise inMarysville, Victoria. In late August 1943, several were returned to Bob’s Farm as“undesirable” – including Carlos Saldanha, Amadeu Carlos das Neves and José da Silva.On 11 September 1943, a group of eight recently evacuated deportados arrived at thecamp.451 The leaders of the deportado group (ie José Gordinho, Arsénio Filipe, AmadeuNeves) held a meeting of deportados at Bob’s Farm on the evening of 14 September 1943,and “threats of actual violence were made” - with Gordinho reportedly stating: “Now weare together we are a majority, we will stick together and if we cannot get our way, we willfight.”452 At the direction of the Security Service, the Camp Administrator removed JoséGordinho, Arsénio Filipe and Amadeu Neves to accommodation in Newcastle on 16September – and also proposed the removal of several other deportados.453 Soon after,449 The Army camp authorities completed an Australian Military Forces “Report on Prisoner of War –A.A.Form A.111” and a complementary “Internee Service and Casualty Form – A.A. Form A.112” for eachinternee. The completed forms can be accessed in the National Archives of Australia.450 SRD, 12 A/6, South Yarra, 22 September 1943 (NAA: MP742/1, 115/1/245). SRD cited “13” being held inBrisbane – apparently in the belief that Sergeant António Martins had also been interned there.451 Paulino Soares, H.G. Granadeiro, Joaquim Carraquico, José Alves Jana, Albertino Castanheira, FranciscoPrieto, António Alberquerque and Bernardino Dias.452 Crothers, W.V., Bob’s Farm, 17 September 1943, pp.2-3 (NAA: A373, 3685A).453 Ibid - “the removal of at least the other deportees José da Silva, Saldanha, Bezerra dos Santos and César A.dos Santos is also desirable … immediate examination of the 8 newly arrived deportees with a view toarranging the removal of, if not all deportees, at least the bad element. In their favor, I must say that the 8deportees, new arrivals, have not by word or action caused any trouble other than taking part in the meeting 71 … however their histories are bad and I would not accept the responsibility for their future actions.”454 Arsénio José Filipe, José da Silva, José Gordinho, Bezerra dos Santos, Amadeu Carlos das Neves, CarlosSaldanha, Augusto César dos Santos, Paulo/Paulino Soares, Hermenegildo Gonçalves Granadeiro, JoaquimLuís Carraqueco, José Alves Jana, Albertino Castanheira, António d’Almeida Albuquerque, Bernardino Diasand Francisco Oreinha Prieto.455 Department of the Army, Minute 16/402/120, Melbourne, 25 September 1943 (NAA: MP742/1,115/1/245).456 See footnote 446 – their completed forms are available in the National Archives of Australia.457 Granadeiro, H.G., letter of complaint, Liverpool, 25 December 1943 (NAA: A373, 3685C, p.165).458 See footnotes 96, 98, 124, 131, 162, 163, 286, 288, 334, 447, 456, 461, 470, 471 and 484. Sergeant Martinshad been praised by Sparrow Force and SRD commanders in Timor – and also by Lieutenant Pires(Melbourne) in a letter dated 23 May 1943 (Cardoso, 2007, p.198). Brandão had noted “jealous gossip”against Sergeant Martins (see footnote 163). However, before the landing, Pires seems to have lost confidencein Martins – preferring to deal only Matos e Silva as the PORTOLIZARD leader; and was apparentlyannoyed that Martins did not elect to remain in Timor and join LAGARTO. See H.B. Manderson’scomments on Martins at footnote 471.459 SRD, 18/A6, South Yarra, 23 November 1943 (NAA: MP742/1, 115/1/245). Martins had not beenincluded in Pires’ “very bad men” message of 6 August, but had been seemingly added by SRD/LMS on 9August – LMS, No.50, Darwin, 9 August 1943 (NAA: A3269, D4/G, p.185). Martins was retained in Darwinin a training role. He later wrote from internment to friends at Bob’s Farm: “I think the crime I committedwas saying that I was not going ((back)) to Timor without first having obtained the permission of mygovernment.” – Camp 14 D, 14 December 1943 (NAA: A373, 3685C, p.179, p.180).460 H.B.M., Melbourne, 17 April 1945 (NAA: A989, 1944/731/1, p.6).461 The Boilermakers’ Society of Australia, Newcastle, 10 December 1943 (NAA: A373, 3685C, p.174).Since early 1943, the Security Service had received letters from members of public – requesting that the“Portuguese anti-Fascists” at Bob’s Farm be allowed “to contribute to the war effort” (NAA: A373, 4058A).72 In January 1944, a report by the Liverpool Camp authorities cited quarrels and“frayed tempers” among the internees – and noted that, of those brought from Bob’s Farm,Granadeiro, Jana, Dias, and Bezerra dos Santos were “more intelligent than the remainder”and “the authors of all the complaining letters.”462 Regarding the “Gaythorne group”, thereport added: “Naturally they are very annoyed at being interned, but their manner andattitude is much more pleasant than that of the Bob’s Farm group.” In the period 20January to 8 February 1944, appeals by the 27 internees463 at Liverpool were heard by theAdvisory Committee of NSW. The Army objected strongly to any release of 13 of theinternees – ie those initially detained at Gaythorne on the advice of Lieutenant Pires, andSergeant Lourenço Martins interned at Loveday in South Australia.464 The day beforeattending their appeal, Bernardino Dias and Bezerra dos Santos asked whether they shoulddeclare their activities in support of the Australian troops in Timor. If so, they wished togive such evidence in the absence of Portuguese Consul Laborinho as they feared theirsupport to Australia troops was in breach of Portuguese neutrality - and they might be later“answerable”.465 Army advised that the release of the internees “would be in the highestdegree inadvisable from the security point of view.” Army also considered that thecontinued internment of the “other 15” (ie from Bob’s Farm) was a “wise securityprecaution” – but “if the Security Service are prepared to accept the security risk involvedin releasing some or all ((of the 15)) …, this H.Q. would raise no objection.” On 10February, the Security Service submitted to the Advisory Committee that all 27 atLiverpool should remain in detention.466 On 11 February 1944, eight internees (MartinsMeira, Damas, Pereira, Horta, Estrela, Jesus, d’Abreu, and Paiva) sent a letter of complainton their detention to the International Committee of the Red Cross (ICRC) delegate – andrequested a visit by the ICRC to the Liverpool camp.467 On 16 February, led byHermenegildo Granadeiro, nine of the detainees at Liverpool – all who had formerly beenat Bob’s Farm468, began a hunger strike.469 They were joined on 18 February by 10 of thosewho had been detained initially at Gaythorne before being moved to the Liverpool camp.However, by 24 February, all but three (Bezerra dos Santos, Bernardino Dias and JoséGordinho) had abandoned the strike. On 17 February – having completed the appeal hearings of the 27 Liverpoolinternees (in the period 20 January-8 February), the Advisory Committee (NSW)recommended 23 remain in detention and four be released to country towns. Of the 12detained at Gaythorne following their evacuation from Timor, the Committee470 expressedconcern that the Committee was “entirely in the dark as to the reasons given by ‘X’ ((ieLieutenant Pires)) when recommending” the detentions “although we have asked more thanonce to be supplied with these reasons.” The Committee’s Report also noted that during thehearings “nothing was extracted … that showed that they were or would be dangerous. It462 Report No.60, Liverpool, January 1944 (NAA: A373, 3685C, p.143).463 The internees are generally referred to as “Portuguese” – but one: Francisco Oreinha Prieto, was a Spanishnational. Prieto made several appeals to the Spanish Consulate – see: NAA: A989 194 4/731/1, p.71, p.81;A373, 3685C, p.167 – ie his fourth letter dated 25 December 1943.464 Allied Land Forces Headquarters, SM1361, Melbourne, 7 February 1944 (NAA: A373, 3685C, pp.113-114).465 NAA: A373, 3685C, p.124.466 Security Service - NSW, G.8451/42/9, Sydney, 10 February 1944 (NAA: A373, 3685C, pp.110-112).467 NAA: A373, 3685C, p.101.468 Pedro de Jesus – an “English speaker”, wrote a letter to Commandant stating that the group wouldcommence a hunger strike – signed by the “Q” internees. A separate letter was signed by nine “N” internees.Six others from Bob’s Farm did not join the hunger strike (NAA: MP742/1, 115/1/245).469 Intelligence Report No.66, Liverpool, 20 February 1944 (NAA: A373, 3685C, p.79).470 Pike, G.H. (Chairman), Report of the Advisory Committee, Sydney, 17 February 1944 (NAA: A373,3685C, pp.83-85. 73 certainly showed they had been of little assistance to the Australian Army”. However, theCommittee concluded that the Committee was “forced into the position of recommending acontinuation of the internment of these men, which we do, on the views expressed by theArmy.” For the 15 “Bob’s Farm internees”, the Committee also recommended thecontinuing detention of eight who had been political deportees (ie: Paulo/Paulino Soares,Granadeiro, Carraqueco, Jana, Castanheira, Albuquerque, Dias and Preto). On the otherseven – also political deportees, who had been detained due to “their conduct” at Bob’sFarm (ie Arsénio Filipe, José da Silva, José Gordinho, Domingos Bezerra dos Santos,Amadeu das Neves, Carlos Saldanha and Augusto César dos Santos); three wererecommended for continued detention as they “would create serious unrest” (ArsénioFilipe, José Gordinho, and Amadeu das Neves); and four were recommended for “releaseto country towns” (José da Silva, Domingos Bezerra dos Santos, Carlos Saldanha, andAugusto César dos Santos). After the hearings, Consul Laborinho wrote to the Australian authorities noting“there is only fragile suspicion of their ((the internees)) conduct” and sought their“immediate freedom” – or a “compromise” of “some kind of controlled freedom”.471 Noting the concerns expressed in the report of the Advisory Committee in NSW, on25 February 1944, the Director General of Security sought from Army the background tothe original advice to detain the “Gaythorne” internees – noting that he did not know whythe “head of agents” in Timor referred to as “X” ((Lieutenant Pires)) had sought thedetention of the original “12” in early August 1943.472 In Adelaide, on 29 February 1944, Sergeant António Lourenço Martins’ appeal washeard before an Aliens’ Tribunal at which he gave evidence – but his “objection” to hisinternment was “disallowed”.473 SRD’s H.B. Manderson was quite critical of SergeantMartins - ie contrary to the very positive views of the uniformed officers of LIZARD whohad served with Martins in Portuguese Timor..”474 On 9 March 1944, four of the Liverpool detainees – José da Silva, Carlos Saldanha,Augusto César dos Santos and Domingos Bezerra dos Santos; were released to “restrictedresidence” at Narrabri West. On 4 March 1944, Army’s Chief of the General Staff assured the Director ofSecurity of Army’s confidence in the information on the internees provided in June 1943by “X” (ie Lieutenant Pires) – and again recommended the continued detention of the“23”.475 - ie the “27” less the four scheduled for release to Narrabri West. However –having been given classified briefings by Army intelligence, the Director General ofSecurity decided to release all internees with the exception of the “Gaythorne” 12 : ie the12 comprising - José Arranhado, Casimiro Augusto Paiva, Álvaro Martins Meira,Francisco Batista Pires, Porfírio Carlos Soares, António da Conceição Pereira, Luís Joséd’Abreu, Francisco Horta, Jacinto Estrela, José Filipe, Álvaro Damas and Pedro de Jesus.476471 Consulate of Portugal, 11-A8/43, Sydney, 8 February 1944 (NAA: A373, 3685C, p.105).472 Director General of Security, 4940/89, Canberra, 29 February 1944 (NAA: A373, 3685C, p.75, p.90).473 Security Service, 16209, Adelaide, 6 March 1944 (NAA: A373, 3685C, pp.55-61). Sergeant Martins’statement included biographical details and related his support to the Australian forces – see pp.58-61.474 H.B.M., Melbourne, 17 April 1945 (NAA: A989, 1944/731/1, pp.15-16).475 Army Headquarters, SM2410, Melbourne, 4 March 1944 (NAA: A373, 3685C, p.69).476 Director General of Security, 4940/89, Canberra, 7 March 1944 (NAA: A373, 3685C, p.66). ConsulLaborinho was advised by Director General of Security, 4940/89, 17 March 1944 (NAA: A373, 3685C, p.27).74 However, the Director General of Security also proposed to Army that - while the 12should continue to be detained, they should be re-accommodated and live with their wivesand children.477 Army concurred and offered accommodation for the 12 men, seven womenand 20 children at the Tatura Internment Camp No.2 in Victoria (167km north ofMelbourne).478 On 21 March 1944, 11 internees from Liverpool were released to reside – togetherwith their families, at Minimbah (Singleton - NSW) with restricted residence ie “not toleave the boundaries of the property”. 12 men remained interned at Liverpool (footnote473). A few weeks later, the 12 at Liverpool were moved to Tatura in Victoria – arrivingon 2-3 April 1944 – with the families arriving with them, or very soon thereafter.479 Beforethe seven family groups - ie the internees’ dependants who had been accommodated atNarrabri, moved to join their husbands at Tatura, Consul Laborinho formally sought andreceived the written consent of the wives/defacto wives of the internees.480 Porfírio CarlosSoares was the first of the Tatura internees to be released – on 13 June 1944, to fixedresidence in Melbourne – with the Director General of Security noting that he “shouldnever have been interned".481 A few months later, Consul Laborinho wrote to the Security Services seeking thetransfer from Minimbah of José Alves Jana and family and Hermenegildo Granadeiro tobetter conditions at Armidale. The Consul also requested the release of six of the Taturainternees (José Arranhado, Casimiro Paiva, Álvaro Martins Meira, Francisco Batista Pires,Arsénio José Filipe and José Filipe).482 On 10 August 1944, the Security Service noted 11 men and 25 dependants at theTatura internment camp.483 A week later, on 17 August 1944, all the Tatura internees andtheir families were released to Singleton. In mid-November 1944, the former acting Consul-General for Spain in Sydneypublicly stated that “the Fascist treatment of the deportees which had existed in Dilli wasbeing continued in Australia.”484 Consul Laborinho responded that: “These men call477 Five of the men had no wives or children ie Francisco Horta, Álvaro Damas, José Arranhado, CasimiroPaiva and Porfírio Carlos Soares. The wives and children of the other seven (ie seven wives and 20 children)are listed by age and sex at NAA: A373, 3685C, p.20.478 Allied Land Forces Headquarters, SM2928, Melbourne, 20 March 1944 (NAA: A373, 3685C, p.25). Therewere seven POW/internment camps in the Tatura area housing principally German, Italian and Japaneseprisoners and detainees.479 “Internee Service and Casualty Form – A.A. Form A.112” and “Report on an Internee – A.A. Form A.111”forms were completed for family members (see footnote 446), and they were allocated “N” seriesidentification numbers for males and “NF” numbers for females. These forms can be found in the records ofthe National Archives of Australia.480 Consulate of Portugal, 11-A8/43, Sydney, 28 March 1944 – with a listing of dependants by sex and age(NAA: A373, 3685C, pp.8-9).481 See also footnote 159 on the apparent confusion between Porfírio Carlos Soares and Paulino Soares inLieutenant Pires’ “very bad men” message of 6 August 1943. Director General of Security, 4940/89,Canberra, 8 October 1944 (A1838, 377/3/3/6 Part 1, pp.190-191). The Director General noted that SousaSantos had sought the release of Porfírio Carlos Soares – and that Consul Laborinho, when advised, hadcomplained that Sousa Santos’ “interference with the services of this Consulate is most undesirable.” TheDirector General also noted: “I have never noticed any inclination on the part of Senor Laborinho todiscriminate against any Portuguese subject who might have rendered assistance to the Allied Forces inTimor … .”482 Consulate of Portugal, 11-A8/43, Sydney, 3 July 1944 (MP742/1, 115/1/245).483 Security Service, Canberra, Portuguese Evacuees from Timor, 10 August 1944 (NAA: A989, 1944/731/1,pp.34-56).484 Sunday Telegraph, “Japs may get Timor Consulate”, Sydney, 19 November 1944 (NAA: A1838, 376/1/1,p.281). The former Spanish Consul-General also stated: “Portuguese Fascists were granted – and are stillbeing paid – handsome pensions. Some of these pensions range between ₤8 and ₤9 a week. For anti-Fascists 75 themselves political deportees and anti-Fascists, when, in fact, they were deported on socialgrounds … of 45 deportees who were evacuated to Australia, 22 were interned by theAustralian authorities. Today these men are free, subject to certain restrictions imposed tosafe-guard the security of the Commonwealth. Only eight are working in variousemployments.”485 Several of the former internees were subsequently involved with SRD. SousaSantos recruited Porfírio Carlos Soares for OP STARLING in late 1944 – and, in March1945, Sousa Santos sought to recruit the ex-internees: Álvaro Martins Meira, FranciscoHorta, António Conceição Pereira, Sergeant José Arranhado – and briefly, BernardinoDias. However, of the internees, only Francisco Horta and Porfírio Carlos Soares undertookpre-operational training at the Fraser Island Commando School in March-April 1945. On19 April 1945, OP STARLING was cancelled. Several of the deportado internees remained politically active after their release – asevidenced in a January 1945 article in the Communist Party newspaper “The Tribune”titled: “Portuguese Exiles Need Better Deal”.486 Sergeant António Lourenço Martins was moved from the Loveday InternmentCamp to Tatura in late January 1945. His release was proposed in mid-March 1945487 – andhe was released to Glen Innes on 10 June 1945. The 28 internees and their families were among about 562 evacuees who departedNewcastle for Dili aboard the SS Angola on 27 November 1945 - less Bernadino Dias, LuísJosé de Abreu and their families. not placed in the Labor Corps, the pension rate for a single man is ₤3/10/- a week, less than the Australianbasic wage.”485 Daily Telegraph, “Dilli as spy centre”, Sydney, 26 November 1944 (NAA: A1838, 376/1/1, p.283). ConsulLaborinho denied that any Portuguese had been “manpowered into the Alien Labor Corps.”486 The Tribune, “Portuguese Exiles Need Better Deal”, Sydney, 11 January 1945 (NAA: MP742/1,115/1/245).487 SRD, ZB 3, Melbourne, 19 March 1945 (NAA: A3269, D27/A, p.112). SRD noted security implications asSousa Santos’ OP STARLING group was “now in training”.488 NAA: A3269, D4/A, p.149. Captain A.J. Ellwood described Japanese Lieutenant Saiki and CorporalNakashima composing and enciphering the text of the message (NAA: AA3269, V17, p.156).489 NAA: A3269, D4/A, p.152, p.333.490 NAA: A3269, D4/A, p.266.491 Detail on their movements is in Ellwood, A.J., Operational Report on Lagarto, October 45 (NAA: A3269,V17, pp.154-155). Ellwood related that the Japanese did not intend evacuating Sancho da Silva as an AlliedPOW until Captain J.R.P. Cashman – Sancho’s COBRA party commander, intervened.76 As related earlier, the SRD OP GROPER party left Darwin with TIMFORCE on 7September 1945 aboard the HMAS Parkes for Koepang in Dutch Timor. Soon after arrivalon 11 September, the Australian commander of TIMFORCE - Brigadier L.G.H. Dyke,accepted the surrender in Koepang harbour of all Japanese forces on the island of Timor.492On 23 September, Brigadier Dyke landed at Dili and met with the Governor of PortugueseTimor – Brigadier Dyke’s party included W.D. Forsyth (Political Advisor – Department ofExternal Affairs), H.B. Manderson (Assistant to the Political Advisor – of SRD)493 andCarlos Cal Brandão (Interpreter – of SRD).494 On 22 August 1945, the Timorese employed in Darwin by SRD were released fromduty – and the “remainder of the Timorese evacuated to the south.”495 Patrício da Luz – the radio operator with LAGARTO who had escaped capture,returned to Dili from the countryside in early October 1945 and re-established contact withSRD through H.B. Manderson. Luz related his activities following the demise of theLAGARTO party and received back-pay from SRD. In July 1946, he was re-employed as aradio operator by the Government at the Dili Post Office, and subsequently emigrated toAustralia in 1956.496 DEPARTING AUSTRALIA On 11 July 1945, Consul Laborinho was instructed by Lisbon to arrange for themovement of approximately “596 souls” from Australia to Portuguese East Africa - ie toLourenço Marques, less a few individuals. However, at the end of theWar a few weekslater, it was decided to return the evacuees to Timor – with the onward movement ofseveral to Portugal. A number – almost all deportados, sought to remain in Australia.497587 evacuees were scheduled to depart Newcastle for Dili aboard the SS Angola on 27November 1945 – with the returnees classified as “Portuguese, Half-caste, Natives, andSundries”.498 However, only 562 embarked and departed on the Angola.499 Several of theTimorese who served with SRD are not included on either the passenger list or among the 492 Horton, W.B., Through the Eyes of Australians: The Timor Area in the Early Postwar Period, Journal ofAsia-Pacific Studies, No.12, Waseda University, 2009, pp.251-277 – also published as a discrete booklet.493 On his return, H. B. Manderson wrote a related report on Australian military equipment in the “undercoverpossession of Timorese natives”, and the inclusion of Portuguese Timor in Australia’s “Defensive IslandScreen” (A1838, TS377/3/3/2 Part 1, pp.60-65).494 Forsyth, W.D., Japanese Surrender, Canberra, 1 October 1945 - covering 20-27 September 45 (NAA:A1838, TS377/3/32 Part 1, pp.107-108). See also Forsyth, W.D., “Timor – II: The world of Dr. Evatt”, NewGuinea and Australia, the Pacific and South-East Asia, May/June 1975, pp.31-37 (A1838, 3038/1/1 Part 2,pp.81-87).495 In July 1945, SRD ordered further Group D operations suspended – and Group D was to be incorporated atBalikpapan (Borneo) into a reconstituted Group B. However, hostilities ceased before this plan could be fullyimplemented - The Official History … , Vol II – Operations, 1946, op.cit., p.19 (NAA: A3269, O8/A, pp.19-20).496 For detail, see Luz’ profile at Annex A.497 Including: Alfredo dos Santos*, Alfredo Pereira Vaz*, Carlos Saldanha, Bezerra dos Santos, João MoreiraJunior*, Luiz José de Abreu*, Bernardino Dias*. For their submissions, see NAA: A367, C63656, pp.39-60.Those marked “*” did not depart from Newcastle on 27 November 1945 aboard the SS Angola as scheduled.498 The passenger list for the SS Angola is at NAA: A367, C63656, pp.1-25. An exact accounting is difficult:558 names are listed – and 29 did not present for embarkation. The racial (raça) descriptors on the list are asclassified by the Portuguese officials ie “Portuguese, Mestiça, Indígena Timorense, Diversos (eg Chinese).The evacuees are listed in seven classes ie: religious, officials, retired officials, families of officials –unaccompanied, other Europeans and other half-castes, deportados, natives and their families.499 Army advised that 21 had remained illegally in Australia – but of those, seven may had left earlier asships’ crews (NAA: MP742/1, 115/1/245). 77 “missing”.500 At the departure of the SS Angola, Consul Laborinho made a speech in whichhe thanked the Australian Government and the Australian people for their assistance to the“over six hundred” who had been “brutally forced to leave their motherland.”501Subsequently, Consul Laborinho wrote to the Australian Minister for External Affairsformally thanking the Australian Government and its agencies for their assistance to thethen repatriated evacuees.502 EPILOGUE As noted previously (see footnote 56), as early as January 1942, Governor Carvalhohad forbidden Portuguese officials to assist the Allied forces in Portuguese Timor – andthese instructions were repeated in August and September 1943 in respect of both theAllied and Japanese forces.503 Following information in September 1945, that Sousa Santos faced disciplinarycharges in Lisbon for his conduct during World War II, the Australian Department ofDefence prepared a list of Portuguese subjects who had assisted the Allied Forces (seeAnnex E).504 This list was forwarded to the Australian representative in London who was“to use his discretion as to the use he makes of this information.” The list – headed bySousa Santos, principally comprised officials in Portuguese Timor who had assistedSparrow and Lancer Forces. Lieutenant Pires, Matos e Silva and José Tinoco (OPLAGARTO) were also included on the list – but either from ignorance or perhapsdisingenuously, the Department of Defence showed their “whereabouts” as “unknown”. While still in Australia in September 1945, Sousa Santos became aware unofficiallythat he would face a “Disciplinary Court” upon his return to Lisbon. Senior Australianofficials immediately sought to support him and planned that “in the national interest …representations to support Senhor Santos … be passed to the Portuguese authorities on thehighest plane.”505 In October, Australia’s representative in London was directed to mentionto Portuguese officials Australia’s gratitude for the support given to Australian forces inTimor – particularly that given by Sousa Santos and João Cândido Lopes (a planter ofMaucatar).506 On 15 February 1946, Sousa Santos arrived in Portugal, and in mid-1946became aware of the charges proposed against him. In June, the Australian Department of 500 The family of Zeca Rebelo (ADDER party – killed) was noted in the care of the Consul of Brasil inSydney. Deolindo de Encarnação – an official, remained as Secretary to the Portuguese Consul (with hisfamily). Abel Manuel de Sousa was “authorized to stay in Australia”.501 NAA: A1838, 377/3/3/4, pp.24-25.502 Consulate of Portugal, No.1051, Sydney, 5 December 1945 (NAA: A1838, 377/3/3/4, pp.19-21).503 Governor of Portuguese Timor, Dili, Circular No.5, 27 August 1943 – ie “complete neutrality” in respectof “foreign invading forces”.504 Department of Defence, Memorandum MIS 1807 – “List of Portuguese Subjects Who Assisted The AlliedForces …”, Melbourne, 3 November 1945 (NAA: A1838, 377/3/3/6 Part 1, pp.184-186) – reproduced atAnnex E.505 Secretary – Department of the Army (to Secretary – Department of External Affairs), MIS 1713,Melbourne, 24 September 1945, (NAA: A1838, 377/3/3/6 Part 1, pp.192-193).506 Department of External Affairs, No.154/45, Canberra, 24 October 1945 (NAA: A1838, 377/3/3/6 Part 1,p.188).78 the Army wrote a vigorous defence of Sousa Santos – and included statutory declarationsby senior Australian officers who had known Sousa Santos in Timor.507 While Sousa Santos was awaiting formal charges, the case against Dr João ManuelFerreira Taborda (the pre-War Director of Administrative and Civil Services of PortugueseTimor) was concluded in late August 1946 – with press coverage in Australia of “TimorGovernor Sentenced For Aiding Allies” and “Former Governor Punished – ‘CollaboratedWith Allies’.”508 Dr Taborda – who had evacuated to Australia in mid-December 1942,was charged by Lisbon’s Conselho Superior de Disciplina das Colónias with “gravenegligence”, abandoning his post, and fleeing to Australia.509 As the Governor’s “deputy”and, at times, Acting Governor, Dr Taborda had been moved to Baucau to administer thecentral and eastern regions – together with many other officials, after the arrival of theJapanese.510 Following the killing by the Japanese of the Administrator of Manatuto, he hadmet LIZARD’s Lieutenant F. Holland southeast of Baucau on 8 December 1942 and passeda letter requesting the evacuation to Australia of 300 civilians.511 Dr. Taborda was notdismissed from the service by the Conselho Superior in Lisbon - but awarded a period of18 months “inactivity” due to “extenuating circumstances”. The Conselho Superior commenced consideration of Sousa Santos’ case in earlyDecember 1946. On 7 January 1947, Óscar Ruas - the Governor of Portuguese Timor,wrote to the Australian Consul in Dili advising that “no Portuguese Government employee”would be prosecuted for saving Australian lives – and citing the “good situation” ofPatrício da Luz and others.512 On 10 January 1947, Sousa Santos was exonerated and hissuspension from Government service (imposed in March 1946) was lifted.513 507 Department of the Army, MIS 231, Melbourne, 18 June 1946 (NAA: A1838, 377/3/3/6 Part 1, pp.161-168). The letter included a listing of the expected charges – and a listing with brief rebuttals by Sousa Santosis at p.194. Statutory declarations supporting Sousa Santos were attached from Brigadier W.C.D. Veale,Lieutenant Colonel W.W. Leggatt, and Major A. Spence.508 The Canberra Times, Canberra, 22 August 1946; The Argus, Melbourne, 22 August 1946.509 The charges and decision are related in BOdT No.33, 16 August 1947, pp.295-298. An English translationis at NAA: A1838, 377/3/3/6 Part 1, pp.135-140.510 Australian Consulate – Dili, Series 86, 14 October 1946 (NAA: A1838, 377/3/3/4, p.8).511 See NAA: A3269, D6/A, p.125. As “Tenente Frank”, Lieutenant F. Holland (LIZARD III) is mentionedtwice in the Conselho’s indictment of Dr Taborda.512 NAA: A1838, 377/3/3/6 Part 1, p.61.513 Australian Consulate – Dili, Despatch No.2, Dili, 26 February 1947 (NAA: A1838, 377/3/3/6 Part 1, p.43).514 Allied Land Force Headquarters, Melbourne, 8 June 1942 (NAA: A816, 66/301/227, pp.50-51). SousaSantos was also to be credited with ₤300 and Tenente Lopes ₤200 in recompense for their expenses insupporting the Australian forces. For further detail, see their personal profiles at Annex A. 79 Timorese to receive an individual Australian World War II honour or award (see thecitation at Annex C).515 However, post-War, the Australian Consulate in Dili was reportedly unable to contact Celestino dos Anjos to arrange the presentation of theMedallion. Following a visit to Dili in October 1971 by Captain (Retd) A.D. Stevenson,Celestino dos Anjos was the presented with the Medallion by Portuguese Timor GovernorAlves Aldeia in early February 1972.516 The sterling silver Medallion – which has noribbon, was designed to be worn around the recipient’s neck on a chain. 515 Approved by General T.A. Blamey on 8 November 1945 and promulgated vide GO No.87, 30 November1945 (AWM119, 149 - Honours and Awards) – see Annex C. The number of Celestino dos Anjos’ medallionis 427. About 500 medallions were awarded – almost all for service in New Guinea. On 30 August 2009,Rufino Alves Correira – the criado of Captain T.G. Nisbet (2/2 Independent Company) was presented withthe Presidential Medal of Merit, a Democratic Republic of Timor-Leste decoration.516 See Timor News, Dili, 2 February 1972 in Lambert, G.E., Commando …, 1997, p.427. Background on thepresentation of the Loyal Service Medallion is on file NAA, B4717 ANJOS/CELESTINO.517 The War Office, HM/1645/48 AG4 (Medals), Droitwich, 12 August 1949 (NAA: A1838, 377/3/3/6 Part 1,p.18).518 provided the “Special Operations” certificateto the Department of External Affairs for on-forwarding to Luz.519 seis medalhas de honra”,Sydney, 20 September 1988, p.3. Photographs of Luz wearing Commonwealth WWII medals at Anzac Dayceremonies can be found in Turner, M., Telling – East Timor: Personal Testimonies 1942-1992, New SouthWales University Press, Kensington, 1992 – and also in several other publications including at p.41 in Cunha,L., “Timor: a Guerra Esquecida”, Macau, II Serie No.45, Macau, Janeiro 96. Luz also wore acommemorative US submarine badge, an RSL badge, and a Z Special Unit association badge.520 Correio Português, Herói da II Guerra Mundial – Luso-timorense condecorado pelo Estado português”,Sydney, 7 November 1989.80 On 18 January 1945, SRD’s Director of Intelligence was made responsible for thepreparation of the Official History of SRD’s organisation and wartime activities.523Initially, the collation of the work was managed by the Army Historian , the eminentLieutenant Colonel J.L. Treloar. However, in October 1945, VX147937 Sergeant D.J.Fennessy was appointed as SRD’s Official Historian. The Official History of SOA/ISD/SRD was published in five volumes: I – Organisation; II – Operations; III –Communications; IV – Training Syllabi; and V – Photographs. All volumes were dated 8March 1946. Squadron Leader A.L. Brierley was the editor of Volume I. An SRD officer,he had served in Darwin in several capacities (including as second-in-command of GroupD, as D/A – replacing Captain A.D. Stevenson, and earlier as the Group’s Air LiaisonOfficer). The volumes of the Official History include little mention of the Portuguese andTimorese involved in SRD operations. However, Volume II is highly critical of SRD’smajor security blunder – ie the failure to recognize that LAGARTO – and subsequentlyCOBRA and SUNCOB, had been captured and that their communications were “managed”by the Japanese ie: “It is incomprehensible that SRD HQ did not deduce that the partyleader had been captured.”524 Noting this “grave break of security”, OP LAGARTO is521 Ibid.522 Lieutenant F. Holland (LIZARD III) - and subsequently the officer commanding the SRD Peak Hill camp,was awarded an MBE (Civil Division) on 2 October 1945 for his “brave conduct and meritorious andcourageous service” in New Britain in 1942 – ie for service before he joined SRD/Z Special Unit.523 NAA: A3269, H4/B.524 The Official History … , Vol II – Operations, 1946, op.cit., p.31-32 (NAA: A3269, O8/A, p.44-45). ForJapanese documents on their communications deception operation, see Goto, Ken’ichi, Materials …, Tokyo,2008 p.47, p.57, p.73 - and reference to a 29-page article by Lieutenant K. Saiki at pp.55-56. AlthoughCaptain Wynne’s post-War report implies that he may have been forced by the Japanese to communicate with 81 described in the Official History as having “no redeeming feature … colossal waste … Tothis failure can be ascribed the wretched deaths of 9 Australians, some Portuguese andscores of fine natives … even the Japanese must have despised the gross inefficiency andcriminal negligence with which it was conducted.”525 Other authors have also been critical of the SRD headquarters staff in Melbournewho “sent them to failure in wildcat adventures … betrayed their chosen men and thepeople of Timor to save their own skins, lied to and cheated their legitimate commandersuntil even Blamey and SOE withdrew support.”526 Captain P. Wynne – the SUNCOBcommander captured on 17 July 1945, bitterly stated: “It was the end of a futile scheme,cooked up with criminal negligence by a team of Melbourne-based glamour boys, whichcost the lives of eight men.”527 Redeeming “Surats” SRD (NAA: A3269, V17, p.136), the Official History notes that “no radio communication was everestablished” with SUNCOB - The Official History … , Vol III – Communications, 1946, op.cit., p.36 (NAA:A3269, O9, p.43).525 The Official History … , Vol II – Operations, 1946, op.cit., p.34 (NAA: A3269, O8/A, p.47).526 Powell, A., War by Stealth …, 1996, op.cit., pp.344-355.527 Lambert, G.E., Commando …, op.cit., 1997, p.239 – and pp.241-242 alleging that “The blunders … werethe subject of a deliberate cover up to protect the reputations of high ranking officers, to the effect that theconduct of Lieut Ellwood and Captain Cashman remained clouded for many years.”528 Lambert, G.E., Commando …, 1997, op.cit., p.426 – post-War statement by Corporal W.A. Beattie of 2/4Independent Company. Beattie was commissioned as a RAAF Flying Officer in September 1943. However,see footnote 410 for claims that surats were redeemed with “silver coins” during the War.529 Minister for the Army – to R.S. Kirkwood, 81/1/1599, Melbourne, 29 June 1951 (NAA: MP742/181/1/1599).530 Lambert, G.E., Commando …, 1997, op.cit., pp.425-440.82 1990s.531 During the brief “transition/civil war” period in 1974-1975 and the subsequentIndonesian occupation of Portuguese Timor, several Australian veterans were active inpublicly expressing their concerns.532 Emigration to Australia Post-War, several Portuguese and Timorese associated with SRD/Z Special Unitemigrated to Australia including: Patrício José da Luz, Henrique Afonso Pereira, Cânciodos Reis Noronha, Alexandré da Silva Tilman, José Manuel de Jesus Pires, Mário de JesusPires, and Manuel H. de Jesus Pires. As noted earlier, the SRD/Z Special Unit Memorial at Garden Island (Rockingham)in Western Australia was unveiled on 6 November 1949, and the Honour Roll on thereverse of the Memorial lists the names of 113 personnel who were killed/died onoperations – see the following photograph. This includes the name of Lieutenant Pires –noted as “Portuguese Army”, together with three “civilians” of OP ADDER ie “CarvalhoJ.”, “Fernandes A.” and “Rebelo Zeka”.533 In Australia, there are several other memorials toSRD/Z Special Unit – including on Fraser Island and at South Townsville and Leyburn. In 1988, in a letter to Major (Retd) F. Holland (OP LIZARD III), Sancho da Silva(OP COBRA) sought assistance from the Australian Government. Subsequently, asubmission was made in 1993 on Sancho da Silva’s behalf which - after passing throughseveral Australian Government departments to the Department of Veterans’ Affairs (DVA),sought compensation for the families of Timorese SRD/Z Special Unit veterans. Fourteenyears later in July 2007, a response to that submission was again sought, and the Ministerfor Veterans’ Affairs advised: “although my Department has a record of representationsmade by Mr da Silva many years ago, details of what transpired at that time have not beenretained.”536 The Minister also asserted that as Sancho da Silva was a “native guide andscout” and “not formally attached to the military or under military command … neither henor his descendants are entitled to claim compensation benefits.” In a reply to the Minister,the Minister was apprised in detail of the nature of Sancho da Silva’s service with SRD/ZSpecial Unit - ie including his recruitment, training in Australia, operational service andJapanese captivity.537 Subsequently, at DVA request, a formal “Claim for Pensions for a Widow” – forSancho da Silva’s widow (Sra. Laurentina), was submitted to DVA in October 2008. Asimilar claim for Sra. Madalena - the widow of Celestino dos Anjos (OP SUNLAG, OPGROPER), was submitted on 20 February 2009. Independent of this process, in 2008, thesons of Sancho da Silva and Francisco Freitas da Silva sought compensation for the current plaque thanks “all the peoples of East Timor” for “their assistance to Australian soldiers especially themembers of the 2/2nd and 2/4th Independent Companies”. A Museum was added to the expanded memorial inearly 2009 – see the publication: Memorial de Dare, 2009.535 The memorial is located in a small park opposite Dili port - about 150m east of Hotel Timor. A photographof the inauguration of the memorial attended by Lieutenant Pires’ sons is at Cardoso, A. M., Timor na 2ªGuerra Mundial…, 2007, op.cit., p.131.536 Billson, B. MP, Canberra, 16 September 2007.537 Chamberlain, E.P. – to Griffin, A. MP, Point Lonsdale, 23 May 2008.84 Forgotten or Ignored ? Several writers have cogently argued that the “pre-emptive occupation” of Dili inmid-December 1941 by Australian and Dutch troops brought World War II to neutralPortuguese Timor – with its consequent destruction and killing. However, soon after the arrival of Australian troops, a number of citizens offeredsupport for the overthrow of the Portuguese Timor authorities – who deportados saw as“pro-Fascist”. Subsequently, following the landing of the Japanese forces on 19/20February 1942, Portuguese officials in the countryside – and a number of private citizens,provided much-needed assistance to the Australian forces despite proscriptions issued bythe Governor. The Australians – both Sparrow Force and SRD/Z Special Unit parties,provided arms and basic training to some Portuguese and to large numbers of Timorese tofight against the Japanese. However, the Japanese – with a far greater troop strength andresources, were able to mobilize larger numbers of Timorese auxiliaries and, by early 1943,drove the Australians from the Colony. Those who had supported the Australians sufferedbloody reprisals. 538 The submission was carried to Australia by the Prime Minister of Timor-Leste in June 2008 andsubsequently resubmitted (dated 23 October 2008) on 30 October 2008.539 The submissions were dated 29 April and 27 July 2009. In response to the 29 April 2009 submission, theDefence Honours and Awards Tribunal advised on 12 June 2009 that “At this time, the Tribunal is not in aposition to consider the issue.”540 MINREP 103231 – ASPSS/OUT/2009/582, Canberra, 23 September 2009.541 Bradbury, B. MP, Petition: Timor-Leste Australian Honour, Canberra, 16 September 2009.. Somewhat confusingly, thespeech in the House preceding the petition incorrectly implied that all Timorese assisting the Australiantroops were known as “creados”. 85 Over 600 Portuguese and Timorese were evacuated from the south coast to thesafety of Australia. The evacuees were well-treated – apart from a small number who wereunjustly interned. About 80 Portuguese and Timorese men were recruited in Australia bySRD for wartime service. About half were employed in administrative and supportfunctions, but 39 were trained for “special operations” in Timor. A number of theseoperatives – wearing Australian uniform, carrying Australian weapons and led byAustralian officers, returned to Timor to fight the Japanese – and only a few survived. While the story of “special operations” by Australian forces in Timor has beenrelated in an Official History and in several publications, the involvement of Portugueseand Timorese – beyond the service of the teenage criados, has received almost no attention.Regrettably, Australian Government authorities appear to have a less-than-adequateunderstanding of this aspect of military operations against the Japanese in Timor. This briefmonograph – by relating the story of those Portuguese and Timorese who served withSRD/Z Special Unit during the War, is offered as a modest contribution to a fullerunderstanding of Australian and Timorese wartime history. -------------------------------------------------- Index 1 ANNEX A Page 542 As related in the Preface, this monograph does not attempt to cover the activities of Sparrow/Lancer Forceor the 2/2 and 2/4 Independent Companies in detail. Consequently, this Annex only notes the more prominentPortuguese and Timorese associated with those forces. Further research is required to produce acomprehensive listing. For lists in primary sources, see also :- Navy Office, 037703 - “Portuguese Timor”, Melbourne, 14 August 1941 that includes as Appendix V –“Pro-British Organisation in Dilli” (NAA: A816. 19/301/803, pp.6-20). The list is also at NAA: A981, TIM P11, pp.106-108.- Beattie, W.A. Flying Officer, 9 November 1944 – for a listing of Portuguese and Timorese who assisted the2/4 Independent Company OP near Dili for three months (NAA: A3269, D27/A, pp.179-178).- Department of Defence, MIS 1807 – “List of Portuguese Subjects Who Assisted …”, Melbourne, 3November 1945 (NAA: A1838, 377/3/3/6 Part 1, pp.184-186).Broadhurst, D.K. Captain (LIZARD), Report on Operation LIZARD, 8 March 1943: Appendix 9 - “SomeChiefs Used or Contacted by Lizard or ABC” (NAA: A3269, D6/A, pp.108-109).- LIZARD (author and date unknown – late 1943 ?), “Natives – Half-cast [sic] – Portuguese” (NAA: A3269,D27/A, p.2).ANNEX A 2 João VieiraJoaquim Luís Carreqeco/Carraquico – de 39Johannes (Dutch)José Alves Jana – deJosé da Silva – de 39-40José da Silva Gordinho – deJosé de Carvalho 40-41José Eduardo de Abreu da SilvaJosé Filipe – de 41-42José Francisco Arranhado 43José Joaquim dos SantosJosé Manuel de Jesus Pires 43-44José Maria BaptistaJosé Rebelo (“Zeca”) 44-45José TinocoLau Fang – de/niLede (J.)Luís dos Reis NoronhaLuís José de Abreu – de 45-46Luíz/Luís da SousaManuelManuel de Jesus Pires, Lieutenant (Retd) 46-48Manuel dos MartiresManuel H. de Jesus PiresManuel Ki’icManuel Maria Teodoro (Feodora) de/ni– 2/2 48-49Mário de Jesus PiresMartinho José RobaloMauchicoNico Anti (“Neko”)Patrício José da Luz 49-53Paulo da Silva 53-54Paulo Soares (“O Paulino”) - dePedro de Jesus – de 55-56Porfírio Carlos Soares/SuarezProcópio Flores do Rego 56Rufino Alves CorreiraRuy FernandesSancho da Silva 56-57Sebastião de CarvalhoSeraphim Joaquim PintoVasco Marie Marçal – 2/2 57-58Veríssimo José MoratoVicente/Vincente Amaral ANNEX A 4 Ademar Rodrigues dos Santos543 – Portuguese, born on 19 April 1906. Chefe de Posto atAinaro. Evacuated to Australia with his wife and daughter. Classified as “a guest ofGovernment”, and resided at Ripponlea (VIC). He was noted as having “assisted AlliedForces – in the 3 November 1945 list (A1838, 377/3/3/6 Part 1, p.185 – see Annex E).Departed from Newcastle on the SS Angola on 27 November 1945 with his Portuguesewife and their teenage daughter. 543 See Carvalho, M de Abreu Ferreira, Relatório dos Acontecimentos de Timor, Imprensa Nacional, Lisboa,1947, p.419 and p.439. 5 ANNEX A Timor on 3 August 1943 (LAGARTO reinforcement); guided the RAN Fairmile 814 vesselthat landed the Z Special Unit’s OP COBRAparty for its landing on 29 January 1944 atDarabai; and was a member of the Z SpecialUnit’s OP GROPER party to Kupang andPortuguese Timor in September 1945. However,Alexandré da Silva Tilman was not granted ((photograph not included))permanent residence in Australia due to hisdebilitating health condition. He moved toPortugal in 1990, then to Australia in 1992 –as a tourist.545 He was granted permanent residencein 1995. Resident at 34 Lord St, Cabramatta (NSW).Occasionally visited Timor-Leste after 1999. Alexandré da Silva –Interviewed in Dili by author in July 2009. September 1945 Alfredo – “half African”. GD at Peak Hill. See SRD’s Group D report of April 1945(A3269, D27/A, p.66). Departed Newcastle on the SS Angola on 27 November 1945.Returned to civil service employment in Dili as patraodo rebocador (1949) – ie crewmanon a workboat/tug. Alfredo dos Santos - Portuguese, born in 1899. Deportado (assault and gambling). Arrivedin Dili on 25 September 1927 (Cardoso, 2007, p.237). Member of the “InternationalBrigade” that assisted the 2/2 Independent Company. He declared that he “joined theAustralian military forces in Timor on or about 10 May 1942 at Remexio” with MajorLaidlaw; patrolled “with the Australian soldiers over the mountains … was provided withAustralian military equipment … used an Australian rifle which he found in Dili … handedin his rifle, ammunition, hand grenades ((in Darwin)) … was paid ₤3 whilst in Timor and₤1 prior to embarkation by Capt. Nesbit … was with the Australians in Timor from 10 Mayto 11 Dec. 42 … injured his leg at Artudo, near Same when trying to escape from theJapanese … did not act as a guide but as a soldier and was in action against the Japanese …is willing to again fight against them”.546 Alfredo was one of five Portuguese (includingArsénio Filipe and Casimiro Paiva) noted by Major Callinan (Commander Lancer Force) as“armed, equipped and treated as Australian soldiers in that they shared the risks, duties andfood (and its lack on many occasions) of the Australians; and at the same time renderedvaluable service to the force.” (MP742/1, 1/1/737 – 9 March 1943). His “date ofenlistment” was declared as 20 May 1942 by Lieutenant Colonel Spence (MP742/1,1/1/737 – 7 April 1943). Citing the Defence Act 42.a., the Department of Army noted thatAlfredo was “deemed for all purposes of this Act to be … a soldier ...” (MP742/1, 1/1/737– 18 March 1943). Commanded the “4th Section” under Australian Lieutenant Nisbet(Cardoso, 2007, p.232). Sustained injuries/wounds to leg in combat with Japanese at Ai-tuto (Same) - see above (Cardoso, 2007, pp.231-232). He was evacuated as a casualty fromTimor, arrived in Darwin on 12 December 1942 and hospitalized. Handed-in his militaryequipment – given a receipt (see interview report – MP742/1,115/1/245 – 23 February1943). Via Cairns and Townsville, he arrived in Sydney (noted as a “painter”) on 23 545 See also “Alexandré da Silva, um ‘Heroi’ da 2 Grande Guerra que a Australia pretende ignorer”, OPortuguês na Australia, Sydney, 28 April 1993.546 Interviewed at Bob’s Farm on 24 February 1943 - 3 L of C Sub-Area, New Lambton, 25 February 1943,p.2 (NAA: MP742/1, 115/1/245). 7 ANNEX A December 1942 – and spent initial weeks at the Quarantine Station at North Head. Arrivedat Bob’s Farm on 17 February 1943 wearing items of Australian military uniform. Laterresident at Narrabri – received an allowance from the Portuguese government of ₤3.5.0 perweek (single, but had a son to a Timorese woman - born at Narrabri on 20 April 1944). InMay 1943, Alfredo was paid ₤57.15.0 by the Department of Army for his “service with theAustralian Military Forces in Timor”: 20 May 1942 – 10 January 1943 (MP742/1, 1/1/737– 4 May 1943). His service with Sparrow Force was confirmed as 20 May 1942 to 10January 1943; and he was paid ₤70.11.0.547 From 16 July 1945, he was employed as alabourer at the Crown Crystal glass company in Sydney at a weekly wage of ₤5.9.0.Applied for permanent residence in Australia. Noted as having “Assisted the Allied Forces”– 3 November 1945 list (A1838, 377/3/3/6 Part 1, p.185 – see Annex E). He did not returnto Timor as scheduled from Newcastle on the SS Angola on 27 November 1945. See also:National Archives of Australia files: SP11/2, Portuguese/dos Santos A – Sydney; andInjuries A463 1957/3288 (NYE). Alfredo Gonçalves – Employed by SRD, his rate of pay as GD in November 1944 was 1/3per day (possibly Alfredo “half African” above). Alfredo Pereira Vaz - Portuguese, born in 1905. Municipal operator. Arrested in 1925(Guinea). Deportado – anarchist. Arrived in Dili on 25 September 1927 (Cardoso, 2007,p.237). Imprisoned on Ataúro for involvement in the Aliança Libertaria de Timor.Employed as a ganger at the SAPT plantation at Talo. Imprisoned by Japanese for fourdays for assisting the Australians (MP742/1, 115/1/245). In November 1942, he reportedlyparticipated in an Australian (12)/Portuguese (5) ambush of a Japanese patrol, killing nine– including the local commandant (MP742/1, 115/1/245). Evacuated from the south coaston 11 December 1942. Resided at Bob’s Farm – with a weekly allowance from thePortuguese government of ₤4.0.0. On 10 February 1943, he was reported by the Australiancamp manager as one of five men “having caused trouble in the Bob’s Farm community”.An investigation noted that he claimed to be a member of the Communist Party – and, withother deportados, had visited the Communist Party organization in Newcastle.548 Employedat Marysville (Victoria) in the period July 1943 to February 1944 in a pulp-woodenterprise. Returned to Narrabri. From 23 April 1945, he was employed at the CrownCrystal glass gompany in Sydney at a weekly wage of ₤5.9.0. Applied for permanentresidence in Australia in November 1945. Did not depart Newcastle as scheduled on the SSAngola on 27 November 1945 – but his Timorese wife and daughter did depart on the SSAngola. See also National Archives of Australia file: SP11/2 Portuguese Vaz/A – Sydney. Álvaro Damas549 - Portuguese, born on 16 March 1903 in Lisbon. Metal worker. Single.Deportado – anarchist (assault and cobrador); arrested in Guinea. Arrived in Dili on 25September 1927 (Cardoso, 2007, p.237). Commercial dealer. Active with PORTOLIZARD(Cardoso, 2007, p.81). Evacuated from Barique on the south coast on 3 August 1943;arrived in Darwin on 5 August 1943. Lieutenant Pires (OP LAGARTO) advised SRD thatDamas was one of 14 “very bad men” and should be segregated – ie not go to Bob’s Farm(signal of 6 August 1943). Detained at Gaythorne on 10 September 1943 – as Internee“Q544”. Interned at Liverpool and Tatura. Recruited by Sousa Santos in late March 1945for a proposed operation into western Portuguese Timor (OP STARLING) – but did not 547 Department of the Army, 669943, Melbourne, 1 May 1943 (NAA: MP742/1, 1/1/737).548 Security Service, 1541/253, Newcastle, 16 February 1943, p.1, p.4. (NAA: MP742/1, 115/1/245).549 See Carvalho, M de Abreu Ferreira, Relatório …, 1947, op.cit., p.440. ANNEX A 8 Amadeu Carlos das Neves - Portuguese, born on 11 March 1900 in Lisbon. Electrician.Arrested in 1925 (Cape Verde). Deportado. Arrived in Dili on 25 September 1927(Cardoso, 2007, p.237). Evacuated to Australia in December 1942 on a “Dutch ship”(presumably Tjerk Hiddes). At Bob’s Farm (Newcastle) from January 1943 – reportedlyjoined the Communist Party in Newcastle and worked at “Lysaght’s Newcastle Works”with José Gordinho and Arsénio Filipe. Moved to work at a pulp-wood enterprise atMarysville (Victoria) – but was assessed as “no good and caused trouble” and returned toBob’s Farm where he became a leader (“ranking” number 3 ?) in the dissident deportadogroup (ie with José Gordinho and Arsénio Filipe). Following further disturbances at Bob’sFarm - ie following the return of deportados from Victoria and the arrival of eightdeportado evacuees on 11 September 1943, on 16 September – together with Filipe andGordinho, Neves was accommodated at the Salvation Army Palace in Newcastle (theywere to be found employment by the Manpower Directorate). Subsequently, he wasinterned at Liverpool on 23 September 1943 – as Internee “N1765”. Released to Minimbah,Singleton – with “restricted residence”, on 20 March 1944 (A373, 3685, p.35, p.44). Hereturned to Portugal on the SS Angola as scheduled, departing Newcastle on 27 November1945 - with his wife and son. 1943. Resided at the Club Hotel – Glen Innes, in August 1944. He was recruited by SousaSantos for the main party of OP STARLING - to be led by Sousa Santos into the westernarea of Portuguese Timor beginning in mid-1944. Timorese personnel in Darwin refusedhowever to participate in Santos’ operation. Rente trained at FCS for OP STARLING inMarch-April 1945 – ie with Francisco Horta, Robalo and Porfírio Soares, at a wage of onepound (₤1) per week. However, OP STARLING was cancelled on 19 April 1945. Rentewas noted as having “assisted Allied Forces – in the 3 November 1945 list (A1838,377/3/3/6 Part 1, p.185 – see Annex E). He departed Newcastle as scheduled on the SSAngola on 27 November 1945, aged 28 - with his 23 year-old mestiço wife. Praised in apost-war statement by Governor Carvalho. António – Employed by SRD, his rate of pay as a GD in November 1944 was 1/3 per day. António Bonfilho da Luz (ie Senior) - aged 64 in 1945. Father of Patrício da Luz.Widower (wife Ricardina - Timorese from Manatuto). Circunscrição Secretary(apresentado). Evacuated to Darwin from the south coast on 8/9 December 1942 with hisfamily – including son: António Bonfilho da Luz Junior (A3269, D6/A, p.50) – see replyfrom Câncio Noronha to author mid-July 2009. All departed Newcastle for Dili asscheduled on the SS Angola on 27 November 1945. Ana Barreto da Luz (ie sister in law ofPatrício da Luz) also departed on SS Angola together with Fernando - aged 6, and"Simões/Sicao" (?) aged 16; her husband, Arthur, had remained in Timor). António Bonfilho da Luz (Junior) - aged 28 in 1945 (brother of Patrício da Luz). Single.Evacuated from the south coast to Darwin on 8/9 Dec 42 (A3269, D6/A, p.50). Departedfrom Newcastle for Dili as scheduled on the SS Angola on 27 November 1945. Did notserve with SRD or the Australian Army – see reply to author from Câncio Noronha mid-July 2009. António Cusinheiro – Employed by SRD at Peak Hill in the period March to June 45. SeeSRD’s Group D report of 19 April 1945 (A3269, D27/A, p.66). António da Silva (“Charuto”) – Timorese. Single. Employed by SRD, his rate of pay inNovember 1944 as a GD was 1/3 per day. On 12 February 1945, was declared by SRD toPortuguese Consul Laborinho as “employed in semi-Army work”. At LMS in the periodMarch to June 1945. See SRD’s Group D report of April 1945 (A3269, D27/A, p.65). Hedeparted from Newcastle as scheduled on the SS Angola on 27 November 1945. 552 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.339.553 Liberato, A. de Oliveira., O Caso …, 1947, op.cit., p.216. ANNEX A 10 António José Álvaro Pinto – Mestiço. Gave “Good service” to 2/2 IndependentCompany. Employed by SRD at FCS in early September 1944. His rate of pay in October1944 at FCS (as an operative trainee) was 6/- per day. Completed a parachute course on 7November 1944. At FELO (Brisbane) on 21 November 1944; enroute to LMS on 7December 1944. At Peak Hill in the period January to March 1945. On 12 February 1945,he was declared by SRD to Portuguese Consul Laborinho as “employed in semi-Armywork”. See SRD’s Group D report of April 1945 (A3269, D27/A, p.64) – “one of thedissenters in the February ‘crisis’, when most were offended by the unfortunate striking byan Aust officer of João Bublic”. In Armidale on 10 April 1945, and refused to return toDarwin. Did not depart from Newcastle on the SS Angola on 27 November 1945 asscheduled. 556).557 LMS, No.78, Darwin, 16 August 1943 (NAA: A3269, D4/G, p.140).558 SRD, T.72, Melbourne, 7 November 1943 (NAA: A3269, L7).559 Martins, A.L. Sergeant, Statement, Loveday, 14 December 1944 (NAA: MP742/1, 115/1/245). Martinsstated that he was arrested in Darwin four days later. Subsequently, SRD denied that any “Colonel” hadspoken with Sergeant Martins.560 Timor Section Progress Report, Melbourne, 10 December 1943 (AWM, PR91/101).561 SRD, 18 A/6, 23 November 1943 (NAA: MP742/1, 115/1/245). ANNEX A 12 without having first obtained the permission of my government.” - (A373, 3685C, p.179).He wrote to the Portuguese Consul in January 1944 outlining his circumstances and earlierassistance to the Australian military – and sought release from internment (A373, 3685C,pp.130-132). On 18 February 1944, Consul Laborinho requested an appeal hearing forMartins – which was scheduled for 29 February 1944 by the Advisory Committee in SouthAustralia (A373, 3685C, p.94, p.97). On 29 February 1944, Sergeant António LourençoMartins’ appeal was heard before an Aliens Tribunal in Adelaide at which he gaveevidence – but his “objection” to his internment was “disallowed”.562 In February 1945,when Martins’ case was being reviewed, SRD claimed Martins had given “good servicewith Independent Companies” – but cited his “later poor showing” and “uselessness”; andalso claiming that with PORTOLIZARD: “he was not much assistance with W/T … onlyone week or two”, “left Matos” and “hid in the bush”. The SRD letter also noted thatMartins had been interned due to his “behaviour in Australia” that “came as a surprise” tothose who had known him in Timor.563 SRD’s H.B. Manderson was quite critical of Sergeant Martins - ie contrary to theviews of the uniformed officers of SRD..”564 Martins was moved from Loveday to the Tatura Internment Camp on 31January 1945. In February 1945, an SRD officer at LMS wrote a signal supportive ofMartins to SRD citing Martins’ assistance to LIZARD, evacuation of civilians, and –initially, in Darwin.565 Martins’ release from internment was proposed on 19 March 1945(A3269, D27/A p.112); and he was released to Glen Innes on 10 June 1945. He was notedas having “assisted Allied Forces – in the 3 November 1945 list (A1838, 377/3/3/6 Part 1,p.185 – see Annex E). He departed Newcastle as scheduled on the SS Angola (with hisTimorese wife, Agostinha Soares) on 27 November 1945. “goes to war against the Allies” – if that occurred, he guaranteed his continuing support andthat of the people of the Fronteira Circumscription (centred at Bobonaro) - 29 June 1942(A1067, PI46/2/9/1, p.117). In June 1942, the Commander-in-Chief of the AustralianMilitary Forces recommended that Sousa Santos “be noted for a decoration at the end ofhostilities.”568 In August 1942, Sousa Santos suppressed a minor native uprising led byrégulo Faic of Fohorem – and harshly punished the Faic clan. On the night of 11/12August, following a Japanese drive in the western border area, he “abandoned” Fronteiraand moved to Atsabe and then to Soibada - from where he wrote to the Governor on 18August, and then to the Baucau area.569 In early September 1942, the evacuation of SousaSantos and his family was proposed - and soon approved by the Australian Prime Minister(A981, TIM P 16, pp.60-66) – but Santos deferred (see TIM P 16 for his October 1942message – “will stay behind” etc). Together with his family (wife: Maria Louisa, anddaughter: nine year-old daughter Maria Lourges), Sousa Santos was evacuated from thesouth coast on 17 November 1942 by RAN corvette, arriving in Darwin on 19 November,and flown south the following day. See OP LIZARD commander - Captain D.K.Broadhurst’s negative comments on Sousa Santos made during the evacuation phase(A3269, D6/A, p.33) including: don’t “send back” and Santos’ attitude pre-embarkation.Sousa Santos arrived in Brisbane on 22 November 1942, and arrived in Sydney on 24November 1942. He cabled Lisbon in late November 1942 on the “grave situation” and hisintention to “return to Timor” (A981, TIM P 16, p.36). On 3 January 1943, he again cabledLisbon (through the Brazilian Consul) on the situation in Timor, the circumstances of theevacuees and stated his intention to return to Timor – but noted “difficulties remaining onthe south coast” (A989, 1944/731/1, p.24). In his cable, he also noted: “There is noPortuguese authority in Timor … concentrated in Liquiçá and Maubara … subjected to ill-treatment and vexations.” On 4 January 1943, Sousa Santos wrote a two-page letter to theAustralian Prime Minister. The Australian military’s Chiefs-of-Staff-Committee (COSC)considered Sousa Santos’ request to return to Portuguese Timor and rally the native chiefs,but refused to support such.570 In December 1943, Sousa Santos sent a letter of support toPortuguese internees in Australia (3685C p.149). He lived with his family in Melbourne –at Ripponlea and Windsor. Lieutenant Pires was highly critical of Sousa Santos – believingthat Sousa Santos’ repression of native uprisings in Fronteira in 1942 was excessive andprecipitated retaliation against the Portuguese. Pires referred to Sousa Santos as“Aldrabão” ie “Bullshitter” (Cardoso, 2007, pp.88-89, p.179, pp.190-191). Lieutenant Piresand Sousa Santos had “a bitter personal rivalry” (14 March 1945 – A3269, D27/A, p.124).Competition between ABC (Pires) and Sousa Santos was exploited by SRD’s H.B.Manderson (A3269, D4/G, p.60) who described Sousa Santos to Lieutenant Pires as“chatisse” (“boring”). In August 1943, Lieutenant Pires (OP LAGARTO) warned SRD thatSousa Santos’ life was “in danger if returns from Bobonaro and Atamboea natives”(A3269, D4/G, p.55). In November 1943, Sousa Santos “fell out” with Dr Taborda and“expelled” him and his wife from the Sousa Santos’ flat in Melbourne – and accusedTaborda of pro-Japanese sentiments (A373, 3685C, p.106). Consul Laborinho complainedof Sousa Santos’ interference (ie Sousa Santos dealing directly with the Australian Army –related to case of Porfírio Soares, see A1838, 377/3/3/6 Part 1, p.191). Laborinho was alsocritical of Sousa Santos’ letter of 27 January 1944 – written to a newspaper, in whichSantos encouraged Timorese to be available in Australia for return to Timor with the568 Allied Land Force Headquarters, Melbourne, 8 June 1942 (NAA: A816, 66/301/227, pp.50-51). SousaSantos was also to be credited with ₤300 in compensation for his expenses in supporting the Australianforces.569 Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.312-313. Governor Carvalho cites SousaSantos for disobeying his (the Governor’s) direction to remain at his post in Bobonaro.570 Chiefs of Staff Committee (COSC) Decision, Melbourne, 1 February 1943. (NAA: A5954, 564/5). ANNEX A 14 “United Nations” (A989,1943/731/3, p.46). From mid-1944, Sousa Santos planned to leada six-man SRD operation - OP STARLING (A3269, D23/A), into the western area ofPortuguese Timor. Departing Melbourne on 5 March 1945, Sousa Santos visited LMS andPeak Hill in Darwin but “was unable to persuade any natives to join him” for OPSTARLING.571 Brandão stated that Sousa Santos “should not be allowed to return”(A3269, D27/A, p.130). Sousa Santos was noted enroute returning from Darwin toMelbourne on 15 March 1945. Soon after, he recruited several non-SRD Portuguese(Rente, Horta, Porfírio Soares, Robalo) for OP STARLING – and the four attended a shortcourse at FCS in the period March-April 1945. Sousa Santos stated that he did not want anyremuneration while on operations in Portuguese Timor (A3269, D27/A, p.108). Mandersonbecame critical of Sousa Santos (A981,1944/731/1, p.15-16); and a HQ SRD staff officercommented that “Santos ((is)) out to play his own game” (SRD Finance, 9 April 1945 –A3269, D27/A, p.30). There was a marked difference in views of Sousa Santos betweenSparrow Force personnel (positive) and Z Force/SRD personnel (negative – see footnote 98in the main text for the views of OP LIZARD’s Captain D.K. Broadhurst) – and the SRDDirector’s view and response by the Australian Chief of the General Staff. Subsequently,OP STARLING was cancelled on 19 April 1945. The operation was later recast as a lessambitious raid - ie OP SUNDOG, with Australian personnel and Carlos Brandão. In September 1945, Sousa Santos became aware unofficially that he would face a“Disciplinary Court” on his return to Lisbon for leaving his post in Fronteira. TheAustralian Secretary of the Army wrote in support of Sousa Santos noting “Portugueseprejudice” against him – and declaring that Sousa Santos “deserves our fullestsupport”(A1838, 377/3/3/6 Part 1, p.192-193). Sousa Santos was noted as having “assistedAllied Forces – in the 3 November 1945 list (A1838, 377/3/3/6 Part 1, p.185 – see AnnexE). Sousa Santos departed Newcastle as scheduled on 27 November 1945 aboard the SSAngola (aged 41) with his wife, 12 year-old daughter and one year-old son. Santos arrivedin Lisbon on 15 February 1946 where he faced charges for leaving his post in PortugueseTimor – for the charges of 29 September 1945 and prosecution (see A1838, 377/3/3/6 Part1, p.161, p.194). Following Australian support to Santos (including an “act of grace”payment of ₤300; affidavits from Australian Army Sparrow Force officers: Major Spence,Lieutenant Colonel Leggatt, Brigadier Veale; and indirect diplomatic interventions throughLondon), Sousa Santos was exonerated by the Supreme Disciplinary Court - ie his“suspension lifted” on 10 January 1947572. In July 1946, the Australian Minister for theArmy had formally proposed Sousa Santos for the award of an honorary Order of theBritish Empire (OBE) - Civil Division, for his assistance in 1942 (citation: A. FormW.3121 at A816, 66/301/227, pp.43-44). After consultation with the Counselor of thePortuguese Embassy in London in March 1948, “it was not considered opportune toproceed with the award at that time”573 - but to be reconsidered when Consul Laborinhoceased to serve in Australia (ie due to disputes between the Laborinho and Sousa Santos).Following “clearance” by Lisbon in late 1950, the award was resubmitted, and SousaSantos was awarded the honorary OBE in March 1951.574 Post-War, Santos engaged in a 571 SRD Group D, Darwin, 15 March 1945 (NAA: A3269, L1). The report noted that the “composition of hisparty will now be changed and a short course at FCS for SANTOS’ own men arranged.”572 Australian Consulate – Dili, Despatch No.2, Dili, 26 February 1947 (NAA: A1838, 377/3/3/6 Part 1, p.43).See also the supportive deposition by Brigadier Roque de Sequeira Varejão – the commander of thePortuguese Expeditionary Force to Portuguese Timor in September 1945 (pp.90-91). On 7 January 1947,Óscar Ruas - the Governor of Portuguese Timor wrote to the Australian Consul in Dili advising that “noPortuguese Government employee” would be prosecuted for saving Australian lives – and citing the “goodsituation” of Patrício da Luz and others (NAA: A1838, 377/3/3/6 Part 1, p.61).573 Australian External Affairs – London, Memo No.251, 9 March 1948 (NAA: A816, 66/301/227, p.21). 15 ANNEX A “book feud” with Captain António de Oliveira Liberato on their respective conducts duringthe Japanese occupation of Portuguese Timor – see Bibliography. Arsénio José Filipe – Portuguese, born on 24 August 1885 in Lisbon (father: José Filipe;mother: Emericana Ramos). Military service as an engineer private – called up in 1908, andsporadic service in the period 1910-1918 (totaling two years) during which he deserted onfour occasions. Civilian occupation – painter. Deportado (anarcho-syndicalist) – “bombista– afixado cartazes com o seu cadastro”.577 Imprisoned in 1925 - deported to Cape Verdeand Portuguese Guinea in 1925 - then to Portuguese Timor, arriving in Dili on the vesselPero de Alenquer on 25 September 1927 (Cardoso, 2007, p.238).578 Initially at Aipelo westof Dili and under military control for several months. Sent (ie internally exiled) to Ataúro574 Secretary - Department of Defence, Brief to the Minister, Canberra, 9 October 1950 (NAA: A816,66/301/227, pp.5-6) and advice from the Australian Governor-General, Canberra, 1 March 1951 at p.3.575 Brandão, C. C., Funo – Guerra em Timor, Edições AOV, Porto, 1953, p.165 – “son of a European”.576 His SRD wages payments were made into an account at the Bank of Adelaide (267 Collins St, Melbourne)– from April 1944 allocated to “H.B. Manderson, Account D” (NAA: A3269, V20).577 During his appeal on 1 February 1944 against his internment at Liverpool, Filipe stated: “I used bombs in1925” – and also “I never used bombs, but I helped the Revolution with arms.” However, he insisted that hisactivities were in support of the Government (NAA: A367, C18000/861).578 Arsénio José Filipe was first deported to the Azores in 1925 - then to Cape Verde and Guinea, before beingsent to Portuguese Timor. Arsénio’s “syndicalist/anarchist” activities in Lisbon in the 1920s - eg“manufacturing bombs” etc, are related by José Ramos-Horta - see Ramos-Horta, J., Funu, Red Sea Press,Trenton, 1987, p.8. ANNEX A 16 three times – including twice for fishing with dynamite. Employed by the Government inthe “construction service” ie as a foreman in the Public Works Department. Following afight with the Governor’s driver, he was sent to Suai. Was in Dili with his family when theJapanese landed on 19/20 February 1942 – and fled, with his family, into the countryside.His house in Dili was subsequently burnt by the Japanese. His second house outside Diliwas also burnt - with his “wife inside”579, and his two daughters went to live with hisbrother. In 1942, he “enlisted with the Australian troops” against the Japanese.580 ArsénioFilipe was one of five Portuguese (including Casimiro Paiva and Alfredo dos Santos)noted by Major Callinan (Commander Lancer Force) as “armed, equipped and treated asAustralian soldiers in that they shared the risks, duties and food (and its lack on manyoccasions) of the Australians; and at the same time rendered valuable service to the force.”(MP742/1, 1/1/737 – 9 March 1943). Aged 57, Arsénio Filipe and his two daughters,Natalina and Nomeia, were among 31 Timorese (including 11 women and children)evacuated from Betano on the south coast on 10 January 1943 on an Australian navalvessel (HMAS Arunta) which withdrew Lancer Force (2/4 Independent Company – 282personnel) to Darwin. He arrived at Bob’s Farm on 17 February 1943 wearing items ofAustralian military uniform – with a steel helmet, and stated: “I still consider myself to be amember of the Australian military forces and am prepared to go into any unit to fight theJapanese” (see interview report at MP742/1,115/1/245 – 23 February 1943). Arséniodeclared that he had: “Joined Australian military forces in May, 1942 … Capt. Laidlawasked me to join … believe that I am still a member of the Army and am willing to carry onagainst the Japanese … was issued with a uniform and a rifle in addition to full equipment… being an old man, I was employed in the capacity of a cook and performing patrol duties… Later I changed to a section in charge of Lieut. Cardy (?) and went on patrol … leftTimor on 10 Jan, 43 … left my military equipment in Timor with the exception of my riflewhich I left in Darwin … I have military boots and a military steel helmet … I was paid ₤3by Capt. Nesbit. I was in combat with the Japanese on three occasions and still considermyself to be a member of the Australian military forces and am prepared to go into any unitto fight the Japanese.”581 His “date of enlistment” was declared as 7 June 1942 byLieutenant Colonel Spence (MP742/1, 1/1/737 – 7 April 1943). Citing Defence Act 42.a.,the Department of Army noted that Arsénio Filipe was “deemed for all purposes of this Actto be … a soldier ...” (MP742/1, 1/1/737 – 18 March 1943). Arsénio served in the “5thSection” (Cardoso, 2007, p.232). His service with Sparrow/Lancer Force was confirmed as7 June 1942 -10 January 1943; and he was paid ₤66.3.0.582 Initially - from January 1943,Arsénio was resident at Bob’s Farm (36 miles north of Newcastle) with his two daughters(Natalina Ramos Filipe and Nomeia Filipe) and several hundred other evacuees – includinghis sister in law (the wife of his brother José Filipe583), and five nephews. Arsénio workedat “Lysaght’s Newcastle Works” and reportedly joined the Communist Party584 inNewcastle – together with José Gordinho and Amadeu Neves. He was regarded by the579 NAA: A367, C18000/861 – see also the letter by Arsénio Filipe to the Red Cross – 10 January 1944 (NAAA373 3685C, p.125).580 Arsénio Filipe is cited as “combateu ao lado dos australianos”: Cardoso, 2007, op.cit., p.238.581 Interviewed at Bob’s Farm on 24 February 1943 - 3 L of C Sub-Area, New Lambton, 25 February 1943,pp.2-3 (NAA: MP742/1, 115/1/245).582 Department of the Army, 669943, Melbourne, 1 and 4 May 1943 (NAA: MP742/1, 1/1/737).583 His brother, José Filipe, was initially interned at Gaythorne (Brisbane) together with Francisco Horta – andboth were soon moved to the Liverpool Internment Camp – and subsequently to Tatura (Victoria), beforebeing released to “restricted residence” at Singleton (NSW). Francisco Horta later married Arsénio’s elderdaughter, Natalina, in the early 1950s. José Ramos-Horta is the son of Francisco Horta and Sra. Natalina.584 At his appeal hearing on 1 February 1944 against his internment, Arsénio Filipe declared: “I have neverbeen a member of the Communist Party” – but admitted “I was a member of the Trade Union” in Newcastle(NAA: A367, C18000/861). 17 ANNEX A Camp Administrator at Bob’s Farm as one of “the main trouble makers” – ie of nine (A373,3685A). Together with Gordinho, Filipe led a group of dissident deportados in the Bob’sFarm camp and was involved in a “melee” at the camp on 27 April 1943. Following furtherdisturbances585 at Bob’s Farm - ie after the return of several deportados from Victoria andthe arrival of eight deportado evacuees on 11 September 1943, on 16 September – togetherwith Gordinho and Neves, Filipe was accommodated at the Salvation Army Palace inNewcastle (they were to be found employment by the Manpower Directorate).Subsequently, Arsénio Filipe was moved - with eight other “troublemakers”, to theinternment camp at Liverpool on 23 Sepember 1943 and became Internee “N1762” (iedetained with 26 others at Liverpool - mostly deportados including his brother, José Filipe,and Francisco Horta).586 Arsénio’s two daughters were transferred from Bob’s Farm toNarrabri West (in northern NSW) in December 1943 or January 1944 (see Arsénio’s letterto Natalina Ramos Filipe of 21 January 1944). At the Liverpool Internment Camp, he wasemployed as a cook. On 29 December 1943, Arsénio applied unsuccessfully to the UnitedStates Consulate for employment at a US hospital in Australia – ie seeking release frominternment at Liverpool (A373, 3685C, p.163). On 10 January 1944, he wrote a letter to DrGeorge Morel (President, ICRC, Mittagong, NSW) seeking support (A373, 3685C, p.145).In January and February 1944, the 27 Portuguese/Timorese interned at Liverpool appealedunsuccessfully against their detention. Together with several other internees, Arsénioparticipated in a hunger strike at Liverpool in the period 16-29 February 1944. Hisdetention order was revoked on 21 March 1944, and he was released on “restrictedresidence” to “Minimbah” – a property of 13 fenced acres about four miles east ofSingleton, NSW (A373, 3685C, p.42) – and reunited with his two daughters. Arsénio (aged60) departed Australia for Dili from Newcastle as scheduled on 27 November 1945 withhis two daughters (ie Natalina, aged 16; and Nomeia, aged 14) on the SS Angola (hisbrother José Filipe – with his family; and Francisco Horta – single, also departed Newcastleon the SS Angola on 27 November 1945). After the War, he was cited in GovernorCarvalho’s book as an “active agent of direct service” to the Australian military.587 Augusto César dos Santos Ferreira (“Senior”) – Portuguese, born on 1 January 1887 atOerias. Involved in a construction enterprise – José Francisco Society. Deportado - toPortuguese Timor. Reportedly in Oecussi for 1 ½ years. Brickmaker. Evacuated to Darwinfrom Quiras on 10 January 1943 on a Dutch warship. At Bob’s Farm (Newcastle) fromJanuary 1943. Regarded as one of the “main troublemakers” at Bob’s Farm (A373, 3685A).Interned at Liverpool on 23 September 1943 – as Internee “N1769”. Released on 17 March1944 – to Narrabri West. On 18 October 1944, he reportedly at FCS (however this wasprobably his son ie “Junior” – see the following entry). On 12 February 1945, he (or moreprobably “Junior”) was declared by SRD to Portuguese Consul Laborinho as “employed insemi-Army work”. Reportedly employed at the SRD element in Darwin in early March1945 (A3269, D27/A, p.127). Left FCS on 9 March 1945 for Brisbane. He requestedrelease in early 1945. (Consul confirmed on 20 March 1945). Departed Newcastle on theSS Angola on 27 November 1945 – aged 48, with his family. Note: The release of ayounger “underage” “Augusto César dos Santos Ferreira” – see below, was sought by his585).586 Arsénio Filipe believed that the Portuguese Consul in Sydney - Álvaro Brilhante Laborinho (who arrivedin Australia in September 1943), was responsible for his arrest at the Lysaght factory. All the Portuguesedeportados reportedly despised Consul Laborinho who they regarded as a “fascist tool” of Portuguese PrimeMinister Salazar.587 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.83. ANNEX A 18 mother in February 1945 (A3269, D27/A, p.149). It appears probable that the AugustoCésar dos Santos Ferreira who was employed by SRD was the “Junior” (below) – ie not the“Senior”. Augusto César dos Santos Ferreira (“Junior”) - The release of a younger “underage”“Augusto César dos Santos Ferreira” was sought by his mother in February 1945 (A3269,D27/A, p.149). It is probable that “Junior” was employed by SRD as a GD – see detailunder “Senior” above. Aged 19, he departed from Newcastle as scheduled with his fatherand mother on the SS Angola on 27 November 1945. Augusto Leal Matos e Silva588 - Portuguese, born in Sardoal (Portugal). Travelled to theBelgian Congo and Paris. Reportedly a descendant of the Alentejo family (Brandão, C.C.,Funo, 1967, p.23; Brandão, C.C., Funo, 1985, p.23; Cardoso, 2007, p.52). Chefe de Postofrom 1936 at Quelicai/Laga (see BOdT No.40, 4 October 1941, p.291). Chefe de Posto atFuiloro (Lautem) in January 1939, at Laga in August 1941. Reported as a “leading memberof Pro-British organization in Dilli” - 14 August 1941. Served with SRD’s OP LIZARD:noted in OP LIZARD report – “in late November 1942 … building the organization withthe help of M. da Silva, the Civil Chief of the Post of Calicai and Laga” (A3269, D6/A,p.84). As the Chefe de Posto of Quelicai moved into the Matebian mountains (LieutenantF. Holland report - A3269, D6/A, pp.124-132) – “very capable assistance” to LIZARD “insetting up a wonderful spy organization” (p.131, also p.8). Captain D.K. Broadhurst - theLIZARD commander, reported: “first class man, ingenious … indominable … (A3269,D6/A, p.116). Matos e Silva was given the codename of “GPO” (ie “General Post Office”)by LIZARD as he “knew everything”. Following the withdrawal of Australian troops inearly 1943, Matos e Silva was the “co-commander” of the PORTOLIZARD group (ie withPortuguese Sergeant António Lourenço Martins)589. He remained in Timor, and joined OPLAGARTO under Lieutenant Pires on 1 July 1943. The LAGARTO leadership wascaptured on 29 September 1943 near Cape Bigono on the north coast – Matos e Silva wascaptured a few days later. He was reportedly seen in prison by Lieutenant António deOliveira Liberato and the deportado António Santos.590 Matos e Silva died in prison in Dili– “possibly on 9 May 1944” (SRD casualty summary). Japanese Army Lieutenant Saikitold the Australian POW Captain A.J. Ellwood that Matos e Silva had “died of malaria andberi-beri” (Ellwood, A.J., Report, Melbourne, 26 October 1945). This version of his deathwas repeated during the post-War war crimes trials in Darwin.591 Matos e Silva was alsoreported as having died in the Taibessi prison in Dili, possibly on 9 or 10 May 1944 afterhaving been injured during an Allied bombing attack (Carvalho, J. dos Santos, Vida …1972, p.130; Cardoso, 2007, p.101; Memorial de Dare, 2009). He was included on SRD“operational” personnel lists of 21 November 1944, 7 December 1944, 25 March 1945, 7April 1945, 6 June 1945 and Operation Groper Operation Order No. 25 - “SRD PersonnelMissing in Timor”, 30 August 1945 (A3269, D26/A, p.15). Matos e Silva was noted ashaving “assisted Allied Forces” – in the 3 November 1945 list (A1838, 377/3/3/6 Part 1,p.185 – see Annex E). During the War, his three year old daughter (Maria Constança Matose Silva) was provided with SRD-sourced funds through Carlos Cal Brandão of five poundsevery other month (A3269, D27/A, p.14) – and did not depart Newcastle on 27 November588 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.441-442, p.471, p.555, p.735.589). However, messages to SRD indicate that Matos e Silva’s role was atleast as co-leader of PORTOLIZARD.590 Brandão, C.C., Funo …, op.cit., 1953, p.171.591 ---, “Deaths in Prison after Beatings”, The Age, Melbourne, p.5, 6 March 1946. 19 ANNEX A 1945 on the SS Angola as scheduled (she apparently remained in Australia with family ofthe deportado João Gomes Moreira Junior). Baltazar B/D or also as Baltazar Alek. “Youth” from Atambua, Dutch Timor – ex-member of the Dutch NEI armed forces. Evacuated to Darwin on 4-5 August 1943 byFairmile MLs 814, 815. At FCS in early September 1944. His rate of pay in October 1944at FCS (as a trainee) was 6/- per day. Completed a parachute course on 7 November 1944.At FELO (Brisbane) on 21 November 1944. Enroute to LMS on 7 December 1944. AtPeak Hill in the period January-March 1945. On leave in mid-March 1945. See SRD’sGroup D report of April 1945 (A3269, D27/A, p.64). At Peak Hill in May and June 1945.Baltazar may possibly be: Baltazar Dekuana, born in Kupang – enlisted at “Hared [sic]Commando School” in Queensland as WX36792 (NAA: B883, WX36792 - NYE). Baltazar Henriques - Timorese. Seaman – captain of “Okussi” . Pilot in Dili port (BOdTNo.42, 18 October 1941, p.291). Assisted OP LIZARD II. Evacuated to Darwin on 8/9December 1942 – reported as “our man” by the commander of LIZARD II (A3269, D6/A,p.50). On 31 May 1943, SRD Darwin requested SRD’s Melbourne headquarters to“regularize” Baltazar’s employment – ie was attached to SRD from 1 May 1943 (withAlexandré da Silva) at six pounds ten shillings per month, ie 4/4 per day (A3269, D4/G,p.443). In the period 2-5 August 1943, Baltzar acted as a pilot on Fairmile ML 814 for theinsertion of Sergeant A.J. Ellwood and the evacuation of PORTOLIZARD personnel.592 Hemay also have assisted with the insertion of OP COBRA. On leave to Sydney withAlexandré da Silva from 21 September 1944 – via AGS in Brisbane, returning to Darwinon 19 October 1944. At LMS in November-December 1944. On 15 December 1944,Baltazar – with Alexandré, to Brisbane for “questioning” by AIB (probably on terrain,navigation). On 12 February 1945, he was declared by SRD to Portuguese ConsulLaborinho as “employed in semi-Army work”. He requested his release from SRD in early1945 (Consul confirmed on 20 March 1945). On leave in mid-March 1945. See SRD’sGroup D report of April 1945 (A3269, D27/A, p.66) – described as “old and worn out. Hasbeen sent on leave … indefinitely.” Not noted on Group D personnel lists for April, June1945. Departed Newcastle as scheduled on the SS Angola on 27 November 1945, aged 55. “restricted residence” (A373, 3685C, p.40). Dias was recruited by Sousa Santos in lateMarch 1945 for an operation in western Portuguese Timor – OP STARLING, butBernardino Dias did not attend the scheduled OP STARLING training at FCS in March-April 1945. OP STARLING was cancelled on 19 April 1945. He applied for permanentresidence in Australia in November 1945. Did not depart as scheduled from Newcastle withhis Timorese wife and dependants on the SS Angola on 27 November 1945. After the War,he was cited in Governor Carvalho’s book as an “active agent of direct service” to theAustralian military.593 Bernardino dos Reis Noronha – Timorese, born on 3 July 1921 at Laclo. Single. Son ofthe liurai of Laclo. Evacuated to Australia and employed by SRD. On 5 August 1943 wasrecommended by Lieutenant Pires as an “operator” – along with his brother, CâncioNoronha (see below).be available for coast watching your area if you can get the scheme started.” (A3269, D4/Cp.267). Proposed to be inserted (para-dropped) to LAGARTO (ie OP BLACKBIRD) in lateMay 1944 for Kuri or Isuum OP ie as a reinforcement/relief (A3269, D4/C, p.59) - possiblywith Zeca Rebelo, but had not yet trained for a parachute jump into water. Completedparachutist training – in either June or October 1944. Trained at Mount Martha, FraserIsland and Rockhampton – “very keen”. Undertook No.3 Cavern Course at Rockhamptonin the period 4-7 July 1944 with other BLACKBIRD personnel (Stevenson, Dawson) thenreturned to FCS (A3269 D4/A, p.372). Also undertook grenade training at Mount Marthaand morse (W/T) training at Fraser Island (Noronha, C., letter to author, 12 May 2009). Arevised operation to insert the BLACKBIRD team by Catalina sea-plane in an area offPoint Bigono was planned for mid-June 1944. However, deferred – and a water jump atFatu Uaqui planned for 31 August 1944. OP BLACKBIRD was postponed on 15September 1944 and cancelled on 1 October 1944 (later replaced by OP SUNLAG). Hisrate of pay in October 1944 at FCS (as a trainee) was 6/- per day. At Milton (Brisbane) inlate October 1944. At Mount Martha 21 November 1944 and 7 December 1944. On 12February 1945, he was declared by SRD to Portuguese Consul Laborinho as “employed insemi-Army work”. At Peak Hill and LMS in March-June 1945. He requested release fromSRD in March 1945 (Consul confirmed the request on 20 March 1945). See SRD’s GroupD report of April 1945 (A3269, D27/A, p.63). Departed Newcastle as scheduled on the SSAngola on 27 November 1945 - aged 19 [sic]. Joined the Health and Hygiene Service onreturn to Dili (BOdT). Note as an aspirante at the Dr Carvalho Hospital in Dili in 1949.Suspected to have been poisoned while working at the Hospital; died at home on 11 June1956. Câncio dos Reis Noronha – Timorese, born on 20 October 1923 at Laclo. Single. Son ofthe liurai of Laclo. Evacuated to Australia and employed by SRD. On 5 August 1943 wasrecommended by Lieutenant Pires as an “operator” – along with his brother, BernardinoNoronha (see above).593 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.83. 21 ANNEX A be available for coast watching your area if you can get the scheme started.” (A3269, D4/Cp.267). Proposed for OP BLACKBIRD in late May 1944 to reinforce/relieve LAGARTOfor an OP at Kuri or Isuum with his brother, Bernardino (A3269, D4/C, p.59) and possiblywith Zeca Rebelo. However, deferred as had not yet trained for parachute jump into water.Trained at Mount Martha, Fraser Island and Rockhampton – noted as “very keen”.Completed parachutist training in either June or October 1944. Undertook No.3 CavernCourse at Rockhampton in the period 4-7 July 1944 with other BLACKBIRD personnel(Stevenson, Dawson) - then returned to FCS (A3269, D4/A, p.372). Also undertookgrenade training at Mount Martha and morse (W/T) training at Fraser Island (Noronha, C.,letter to author, 12 May 2009). A revised operation to insert the OP BLACKBIRD team byCatalina sea-plane in an area off Point Bigono was planned for mid-June 1944. Deferred –and a water jump at Fatu Uaqui planned for 31 August 1944. OP BLACKBIRD waspostponed on 15 September 1944 and cancelled on 1 October 1944 (later replaced by OPSUNLAG). His rate of pay in October 1944 at FCS (as trainee) was 6/- per day. At Milton(Brisbane) in late October 1944. At Mount Martha on 21 November 1944, and 7 December1944. On 12 February 1945, he was declared by SRD to Portuguese Consul Laborinho as“employed in semi-Army work”. At LMS/Peak Hill in March-June 1945. He requestedrelease from SRD in March 1945 (Consul confirmed the request on 20 March 1945). SeeSRD’s Group D report of April 1945 (D27/A, p.63). At Peak Hill in mid-late May 1945.Departed Newcastle as scheduled on the SS Angola on 27 November 1945 - aged 16 [sic].Joined the Health and Hygiene Service on return to Dili – as an aspirante. Served in Dili,then posted to the Sub-Delagação at Ossu in October 1947 (BOdT No.40, 4 October 1947,p.373). He was later employed at the Overseas National Bank (BNU) in Dili – asempregado bancário and “treasurer”. Appointed as a member of the Conselho do Governoon 15 November 1959 (BOdT No.3, 16 January 1960, p.24). Member of the UDT politicalassociation/party from 1974-75 – and a member of its Central Committee. Resigned fromthe Central Committee in 1994. Following the Indonesian invasion in late 1975, he movedwith his family to West Timor in 1976, then to Portugal and Australia – arriving in 1986.Took up Australian citizenship on 7 May 1992. He is featured in Turner, M., Telling …,1992. Resident in Melbourne (Gladstone Park) in 2010. was noted as the “OC Timorese” in SRD – and as a “Portuguese assistant” (with E.Gamboa) to Lieutenant Holland at the Peak Hill “satellite camp”.At FCS (with trainees) in early September 1944.At Milton (Brisbane) in October 1944. At FELO(transit camp, Brisbane) on 21 November,7 December 1944. Arrived back at Peak Hill fromBrisbane on 15 December 1944 “to counteract thenon-cooperative attitude adopted by the newcomers– six who had come from LMS on 11 December1944. On 12 February 1945, he was declared by SRDto Portuguese Consul Laborinho as “employed in semi-Army work”. At Peak Hill in March-June 45. On 1 ((photograph not included))March 1945 – “2LT Brandão restored morale – threeoperators who three weeks ago asked to be sent homeafter an incident with LT Holland, now express regretand request to be allowed to stay.” (A3269, L1). SeeSRD’s Group D report of April 1945 (A3269, D27/A,p.63) – in Darwin: “held natives together, smoothedtroubles over … tangible recognition by his appointmentas OC Timorese, in which capacity he has been more than Carlos Cal Brandãovaluable, retrieving seemingly hopeless positions andkeeping his charges in the happiest frame of mind. Every Porto/Timorese has tremendousrespect for him, and most of them positively worship him.”597 In the Group D“Establishment” document of 21 May 1945, “Lt. Brandão” was listed as “O.C. ((OfficerCommanding)) Peak Hill”(A3269, H4/B). Brandão was a member of the SUNDOG Raidparty (also known as SUNFISH D) 21-23 June 1945 that landed briefly in the area of theSue River (4 miles west of Betano) – (A3269, H1, p.171). He served as the officialinterpreter to the Australian political adviser (W.D. Forsyth) for the Japanese surrender inTimor – 21-25 September 1945 (A1838, TS377/3/3/2 Part 1 - Brandão’s photograph is atpp.23-27; he was paid a fee of ₤10, p.123). Departed Newcastle as scheduled on the SSAngola on 27 November 1945 – aged 39 with wife, Maria Cal Brandão. Returned toPortugal in February 1946. Author: Funu – Guerra em Timor, Perspectivas & Realidas,Porto, 1953 – and several later editions. Died on 31 January 1973. Carlos Henrique/s Dias – Portuguese. Single. Deportado. To Dili (Cardoso, 2007, p.258– no date noted). Employed by SRD, his rate of pay in October 1944 at FCS (as a trainee)was 6/- per day. At Milton (Brisbane) in late October 1944. At FELO (Brisbane) 21November 1944, 7 December 1944. In mid-December 1944, SRD arranged his dischargewith a bonus of 30 days pay - “as is not of immediate or potentially of use to the Group”(A3269, V20). On 12 February 1945, he was declared by SRD to Portuguese ConsulLaborinho as “employed in semi-Army work”. Released from Army service in early 1945(Consul confirmed on 20 March 1945). He departed from Newcastle as scheduled on theSS Angola on 27 November 1945, aged 26. 596 Brandão reportedly drew ₤12 per month for his expenses – and the balance was paid into an account at theBank of Adelaide (267 Collins St, Melbourne) – under “H.B. Manderson Account B” from April 1944 (NAA:A3269, V20).597 Stevenson, A.D. Captain, Timorese Personnel – Group D, Darwin, April 1945 (NAA: A3269, D27/A,p.66). 23 ANNEX A Casimiro Augusto Paiva - Portuguese, born on 30 May 1905 at Viczeu, Portugal. ArmyCorporal (16 years military service). Assisted Sparrow Force. Casimiro was one of fivePortuguese (including Arsénio Filipe and Alfredo dos Santos) noted by Major Callinan(Commander Lancer Force) as “armed, equipped and treated as Australian soldiers in thatthey shared the risks, duties and food (and its lack on many occasions) of the Australians;and at the same time rendered valuable service to the force.” (MP742, 1/1/737 – 9 March1943). He was evacuated to Australia and arrived at Bob’s Farm on 17 February 1943wearing items of Australian military uniform. Paiva declared that he had: “joined theAustralian army on 9 July 1942 at the request of Major Laidlaw and was evacuated fromTimor on 10 January … not issued with an Australian military uniform as I was aPortuguese soldier and had my own … was issued with an Australian military rifle and stillhave a steel helmet … deserted from the Portuguese Army to join the Australian Army, ofwhich I still consider myself to be a member … was paid 10/- by Capt. Nesbit in Timor …worked for the Australian Army at Remexio, sending food and giving information …handed my rifle in at Darwin … not possess any civilian clothing.”598 His “date ofenlistment” was declared as 15 July 1942 by Lieutenant Colonel Spence (MP742/1, 1/1/737– 7 April 1943). Citing Defence Act 42.a., the Department of Army noted that CasimiroPaiva was “deemed for all purposes of this Act to be … a soldier ...” (MP742/1, 1/1/737 –18 March 1943). Evacuated to Darwin in January 1943. Moved to Bob’s Farm. In May1943, Casimiro was paid ₤57.15.0 by the Department of Army for his “service with theAustralian Military Forces in Timor” - 15 July 1942.599 In May 1943, he was recruited bySRD for OP LAGARTO to be led by Lieutenant Pires. Paiva travelled to the Sydney areafor training on 19 May 1943 with the LAGARTO party - ie including Sergeant JoséArranhado. He undertook training at the SRD Z Experimental Station in Cairns in May-June 1943 with Lieutenant Pires and Sergeant Arranhado - ie attended “Intelligence schoolat Cairns in May-June 1943 – deployed back to Timor on OP LAGARTO in June 1943”.600Inserted near the Luca River on 1 July 1943 by US submarine USS Gar – OperationLAGARTO. Casimiro disputed with Lieutenant Pires during landing phase. LieutenantPires later advised SRD that Paiva should be evacuated as he is “good for nothing” (as withSergeant José Arranhado) – signal of 6 August 1943. Evacuated from Barique withPORTOLIZARD personnel, arrived in Darwin on 5 August 1943. He was detained atGaythorne (Brisbane) on 10 September 1943 – as Internee “Q543”. Interned at Liverpooland Tatura. Released in August 1944. On 12 February 1945, he was declared by SRD toPortuguese Consul Laborinho as “employed in semi-Army work”. He departed Newcastleas scheduled on the SS Angola on 27 November 1945, aged 40, as an “active functionary”. 598 Interviewed at Bob’s Farm on 24 February 1943 - 3 L of C Sub-Area, New Lambton, 25 February 1943,p.3 (NAA: MP742/1, 115/1/245).599 Department of the Army, 669943, Melbourne, 1 May 1943 ((MP742/1, 1/1/737).600 Paiva attended intelligence and communications training at SRD’s Z Experimental Station (Cairns) in earlyJune 1943 – with Sergeant José Arranhado (and possibly Patrício da Luz). ANNEX A 24 Celestino dos Anjos – Timorese, born on 2 May 1921 at Valaruai (Viqueque area).Member of the local liurai (“noble”) family.601 He was evacuated to Darwin and employedby SRD. Reportedly in service with the Australian military from September 1943 (seeDeclaração below – and at Annex B). On 24 March 1944, Celestino signed an SRDproforma declaring that when deployed on operations: “all money to remain inAustralia.”602 At FCS in early September 1944. His rate of pay in October 1944 at FCS (asa trainee) was 6/- per day. Completed a parachutist course on 7 November 1944; at FELO(Brisbane) on 21 November 1944; enroute to LMS on 7 December 1944. Completed anenlistment “Declaração” at LMS in January 1945 (A3269, D27/A, p.159 – see Annex B).On 12 February 1945, he was declared by SRD to Portuguese Consul Laborinho as“employed in semi-Army work”. At LMS in March 1945 (also in hospital in Darwin at 107Army General Hospital - AGH). On leave in April 1945. See SRD’s Group D report ofApril 1945 (A3269, D27/A, p.63) – “good type … ready to go on ops”. At 107 AGH inApril 1945, June 1945. Participated in OP SUNLAG led by Captain A.D. Stevenson – seeCelestino’s “cover story” as “António” (A3269, D13/B). The three-man SUNLAG group(Lieutenant A.D. Stevenson, Sergeant R.G. Dawson, Celestino do Anjos) was parachutedinto the Laleia area on 29 June 1945 – see photograph on front cover.603 For detail of OPSUNLAG including Celestino’s role, see the party leader’sreport (A3269, D4/B, pp.8-15). Lambert, G.E., Commando…., 1997, p.241: “Sunlag fared better than any other party,mainly because they were accompanied by the outstandingnative Timorese Celestino …”. Participated in OP GROPERto investigate fates of missing SRD personnel – departed ((photograph not included))Darwin 7 September 1945, arrived West Timor (Koepang)on 11 September (see AWM photographs ID 115663, 115664enroute aboard HMAS Parkes). From Koepang to Dili on22 September, returned to Koepang on 2 October 1945.Returned to Darwin on 19 October 1945 with the GROPER Celestino dos Anjosparty. Subsequently, returned to Portuguese Timor. September 1945 Awarded the Australian “Loyal Service Medallion” (GO No.87, 30 November 1945) – hiscitation is at Annex C.604 In October 1971, he met with Captain (Retd) A.D. Stevenson(SUNLAG commander) in Portuguese Timor. He was belatedly presented with the LoyalService Medallion in Dili in early February 1972 by the Governor of Portuguese Timor,Lieutenant Colonel Alves Aldeia.605 In January 1975, he was reportedly employed by theBurmah Oil company – ie in charge of helicopter refueling at Viqueque. He was killed by 601 Grimshaw, Z. (Loiluar, R. – translator), Interview: Comandante Ular Rihik/Virgílio dos Anjos, Dili, 16October 2009.602 AWM, PR91/101 - folder 2.603 Celestino dos Anjos was the only Timorese SRD operative to undertake a combat parachute insertion intoPortuguese Timor - ie from a RAAF 200 Flight Liberator B-24 aircraft on 29 June 1945 (OP SUNLAG). Hewas armed with a .38 HAC Revolver - No.A105.604 The citation is on Army Form W.3121 (AWM119, 149 -Honours and Awards) see Annex C. Celestino dosAnjos was the only Timorese to be awarded an individual Australian honour or award during WW II. HisLoyal Service Medallion was number “427”.605 See Timor News, Dili, 2 February 1972 in Lambert, G.E., Commando …, 1997, p.427. Background on thepresentation of the Loyal Service Medallion is on file NAA, B4717 ANJOS/CELESTINO Barcode 9526321.The presentation of the award was also reported in Diário de Notícias, Lisbon, 18 February 1972 (NAA:A1838, 49/2/1/1 Part 2, p.233). A copy of his citation is at Annex C – ie from file AWM119, 149 - Honoursand Awards. 25 ANNEX A the Indonesian Army at Kaizu/Kaijan Laran on 22 September 1983606 (in reprisal for theinvolvement of his son Virgílio/Ular Rihik in Falintil attacks against Indonesian troops - 3Zipur, in early August 1983).607 In 2005, Celestino’s remains were exhumed by his familyand removed to the Falintil ossuary at Metinaro. In February 2009, a pension/“Act ofGrace” claim for Celestino’s widow (Sra. Magdalena) was submitted to the AustralianDepartment of Veterans Affairs (claim NX347413). Cosme Freitas Soares – Timorese. Chief of Leti Mumu (in São Domingos), and reportedlythe son of the liurai of Vemasse. Cousin of Paulo da Silva of Ossu Rua. Assisted OPLIZARD. Evacuated on 10 February 1943 with the Dom Paulo group from the mouth ofthe Dilor River on the submarine USS Gudgeon. In Melbourne with Lieutenant Pires forseveral weeks before moving to Bob’s Farm (Newcastle area) in March 1943 with other“cinco indígenas” ex-USS Gudgeon (Cardoso, 2007, p.175). Trained at FCS in October-November 1943. Member of the OP COBRA party inserted on 27 January 1944 by RANFairmile ML 814 in the Darabei area, and captured that night with the two Australianmembers of COBRA (Lieutenant J.R. Cashman, Sergeant E.L. Liversidge) – Paulo da Silvaand Sancho da Silva were captured 12-14 days later. Initially imprisoned and interrogatedin Dili. He died following an “anti-beri beri” injection by his Japanese captors at Lautem on19 May 1944 - of beri-beri (witnessed by Sancho da Silva).609 His rate of pay in November1944 was 11/6 per day (ie an Australian Army sergeant’s pay rate)610. On 12 February1945, he was declared by SRD to Portuguese Consul Laborinho as “employed in semi- 606 Grimshaw, Z., Interview: Comandante Ular Rihik …, 16 October 2009, op.cit. His daughter-in-law andseveral brothers were also killed in this massacre. Celestino’s date of death is cited in some references as 27September 1983 – including in his son’s letter of 2 March 1984, see the following footnote.607 On 2 March 1984, Ular (Virgílio dos Anjos) – a Falintil commander, wrote a letter to Captain (Retd) A.D.Stevenson relating his father Celestino’s death - Arkivu ho Muzeu, Dili (Document 05002.004.02); alsorelated in French – at “Force de creuser sa proper tombe”. On the belated receipt of Ular’s letter, Stevensonarranged for an article in The Australian – “Indonesians Execute Timor War Hero”, 18 March 1987 (Lambert,G.E., Commando …, 1997, op.cit., p.428). Celestino’s story is also related in Powell, A., War by Stealth,Melbourne University Press, 1996, pp.145-50; Turner, M., Telling – East Timor: Personal Testimonies 1942-1992,New South Wales University Press, Kensington, 1992, pp.76-79, pp.174-176, p.191; Jolliffe, J., Pasif Nius 15February 2002; and Commission for Reception, Truth and Reconciliation (CAVR), Chega ! - The FinalReport of the Commission for Reception, Truth and Reconciliation, Dili, 2005, Part 7.2, p.173, para 531 andTable 19. Killed by ABRI at Kaijan Laran on 22 September 1983 (together with Ular’s wife – Hare Care –Alda) – see also footnote 578 and HRVD Statement 06025. Celestino’s killing is also related in Jolliffe, J.,Balibo, Scribe, Melbourne, 2009, p.314. Virgílio dos Anjos (Ular Rihik) – Celestino’s son, was theCommander of Falintil Region IV in 1998-1999 and, in the period 2002-2010, was the Head of the F-FDTLPersonnel Staff (ACOS J1) – as a major. Virgílio/Ular suffered a heart attack and passed away in Dili on 6January 2010. He was posthumously promoted to the rank of F-FDTL Colonel on 8 January 2010.608 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.110, p.387, p.441, p.471, p.475, p.555,p.736.609 See AAF A.119 statement in Ellwood, A.J., Operational Report on Lagarto, October 45 (NAA: A3269,V17, p.146).610 His SRD wage payments were made into an account at the Bank of Adelaide (267 Collins St, Melbourne)– from April 1944 allocated to “H.B. Manderson, Account I” (NAA: A3269, V20). From May 1944, hiswages were to be paid to his brother, Domingos Soares (NAA: A3269, V20). ANNEX A 26 Army work”. Declared as a “Sergeant” in “AMF – enlisted in September 1943” in the AAFA119 (Casualty Report) by Captain A.J. Ellwood – 4 October 1945 (A3269, V17, p.146).Reported as having “died in prison”- Carvalho, J. dos Santos, Vida e Morte …, 1972,p.132. Domingos Amaral 612 – Timorese. Village chief of Luca. Noted as assisting LIZARD andPORTOLIZARD – cited as “good friends for us and useful to our job.”(A3269, D27A,p.2). Member of the OP LAGARTO party under Lieutenant M. de J. Pires in early July1943. Escaped from the Japanese attack on LAGARTO near Point Bigono on 29September 1943. According to the SRD Official History (A3269, O8/A, p.34A), his sub-group: “eluded the Japanese and made their way to Lagarto’s previous camp site at Cairui,near Manatuto …then to Dilor” (ie with Patrício da Luz and Domingos of Dilor).Domingos Amaral was later reported as having been killed. 611 NAA: A989, 1944/731/1, pp.123-127 including Encarnação’s report of 18 May 1943 at p.125.612 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.471, p.726.613 Security Service, 1541/253, Newcastle, 16 February 1943, p.4 (NAA: MP742/1, 115/1/245).614 Encarnação, D. de, Bob’s Farm, 18 May 1943 (NAA: A989, 1944/731/1, p.125). 27 ANNEX A in “democratic” Australia he now be treated equally with Portuguese officials – and that“preferential treatment should be eliminated”.615 The officials noted that “since his arrivalat Bob’s Farm, with others, has approached the representatives of the Communist Party inNewcastle and has suddenly embraced socialistic doctrines …”. However, the investigationconcluded that he had “never refused to do any work allotted to him, and has not been thecause of any trouble in the camp itself.” Several months later, he was interned at Liverpoolon 23 September 1943 – as Internee “N1768”. In December 1943, from internment, heexpressed his anger at the “fascist” Portuguese in letters to friends – railing against the“fascist rascal ((Consul)) Dr. Laborinho” and the “Armidale trio” (A373, 3685C, p.182) –who he saw as “responsible for our internment”. In early October 1943, Bezerra’s letter toThe Sun newspaper - titled “Make it Known”, was intercepted by the censor. His wife(Cecilia) and six children moved from Bob’s Farm to Narrabri West. Bezerra dos Santoswas noted as “a danger on account of his letter writing and as an agitator and trouble-maker… a prolific letter writer.” (MP742/1, 115/1/245). He participated in a hunger strike at theLiverpool Internment Camp in the period 20-22 January 1944 (A373, 3685C p.123). Hewas released to Narrabri West in early March 1944 with “restricted residence” (A373,3685C, p.71) – and an allowance of ₤6.6.9 per week from the Portuguese authorities(Timorese wife and seven dependant children). He worked in Sydney at the Crown Crystalglass company as a labourer in October 1945 – at a wage ₤5.6.0 per week. A securityassessment of 16 November 1945 described him as: “an agitator of a dangerous type,especially in so far as his correspondence re internment to various newspapers etc.” On 26September, Bezerra wrote to the Australian Prime Minister – seeking indemnification forhis detention and seeking to remain in Australia (A367, C63656, pp.55-60). Applied forpermanent residence in Australia in November 1945. He departed Newcastle aboard the SSAngola on 27 November 1945 with his family as scheduled. In late November 1945, theAustralian security authorities received allegations that his close associates Moreira and deAbreu “were remaining in Australia in order to obtain the help of communists to further therevolution in Timor. Bezerra dos Santos, who joined the ship, is to be the Communist agentin Timor.” 1943 - A3269, D3/G, p.29). He was later scheduled for training at FCS – “before December1943” – but was not noted as attending. He eturned to Dili from Newcastle as scheduled onthe SS Angola departing on 27 November 1945 - aged 40, with his family (wife – TeresaJorge Soares, and sons: Rui, four years; Lionel, one year-old). Domingos (Soares) of Dilor616 – Timorese. Chefe de Suco (village chief) of Tuaoli, Dilor.Noted as having assisted LIZARD and PORTOLIZARD – and cited as among “goodfriends for us and useful to our job.”(A3269, D27A, p.2). Joined OP LAGARTO underLieutenant M. de J. Pires in early July 1943. Escaped from the Japanese attack on theLAGARTO party near Point Bigono on 29 September 1943. According to the SRDOfficial History (A3269, O8/A, p.34A) his sub-group: “eluded the Japanese and made theirway to Lagarto’s previous camp site at Cairui, near Manatuto…then to Dilor” (withPatrício da Luz and Domingos Amaral). At Dilor, the group recovered the wireless setsbrought in by Captain A.J. Ellwood and which “had been hidden by Domingos Dilor.”Domingos Dilor was later reported as having been killed by the Japanese. “Dutch 4” – ie comprising: Nico Arti/Anti (20 years), Baltazar Alek (20), Johannes (20) –all from Atambua (Dutch Timor); and Lede from Savo (see A3269, D4/G, p.148 – alsop.161, p.165, p.167, p.169, p.170). All had joined the Dutch Netherlands East Indies (NEI)forces after the Japanese invasion. Evacuated on 4-5 August 1943 to Darwin by FairmileMLs 815, 815. All employed by SRD in Darwin – intended as SRD “operatives” (A3269,D4/G, p.169). Note that SRD Group D’s area of operations included the Lesser Sundas ofthe NEI – to inclusive of Bali (with Java added in mid-1945 near the end of the War). Twoother ex-NEI personnel are also noted in Group D Progress Reports ie Private Dekiana(Rotinese) and Private Adu Delas – with both noted at LMS in mid-March 1945 and alsoundertaking training at FCS. Eduardo Francisco da Costa – Mestiço. Possibly the elder brother of Fernando da Costa.Assisted the 2/4 Independent Company in 1942. Evacuated to Australia. Employed bySRD, his rate of pay in October 1944 at FCS (as a trainee) was 6/- per day. At FELO(Brisbane) on 21 November, 7 December 1944. Noted as an “Instructor”. Reportedlysuffered a “radius injury” to hand/wrist (x-rays at A3269, V20) in a gymnasium accident atRAAF Base Richmond on 17 October 1944 while on a parachute course. He departedRichmond on 13 November 1944 without qualifying as a parachutist. He requesteddischarge on 19 February 1945 while at the Parachute Training Unit, RAAF Richmond. InBrisbane, in March 1945 – in hospital. See SRD’s Group D report of April 1945 (A3269,D27/A, p.64). He requested release from SRD - confirmed by the Consul on 20 March1945). At FELO’s Camp Tasman (Brisbane) in March 1945. In Sydney in late March 1945– did “not wish to return to Timor” (A3269, D27/A, p.84, pp.94-95). He departed fromNewcastle as scheduled on the SS Angola on 27 November 1945 – with his wife and son. Felix da Silva Barreto – Evacuated to Australia. Employed by SRD, his rate of pay inOctober 1944 at FCS (as a trainee) was 6/- per day. In mid-1944, he had been intended forthe reconnaissance party of OP STARLING into the western area of Portuguese Timor(with Abel Manuel de Sousa) as he was a relative of the chief of Rai-mea. Noted as inhospital in late October 1944. At FELO (Brisbane) on 21 November, 7 December 44. Atthe Parachute Training Unit in January and February 1945 – and completed a parachutecourse in April 1945 (received a parachute allowance of 3/- per day). When Sousa Santosvisited Darwin to finalize personnel for OP STARLING, Barreto declined to volunteer –OP STARLING was cancelled on 19 April 1945. He requested release in early 1945(Consul confirmed on 20 March 1945). In Brisbane in March 1945 (hospital ?). He wasalso intended for OP SUNABLE (A3269, D27/A, p.102 – 23 March 1945) and OPSUNDOG. See SRD’s Group D report of April 1945 (A3269, D27/A, p.64) – he wasinitially willing to go on SUNDOG (ie a revised OP STARLING) with Sousa Santos, butnow “signified unwillingness to go with former ((Sousa Santos))” and “recruited forSUNABLE” – “the only useful man available for SUNABLE … although he is not awareof the area” ie Oecussi. He was included on the Group D personnel listing of 21 May 1945as a member of the SUNDOG party in Darwin – but did not deploy to Portuguese Timor onthat, or any other, SRD operation. Francisco Freitas da Silva (“Chico”) – Timorese. From Ossu Rua. Younger brother ofDom Paulo da Silva, the liurai of Ossu Rua. Department of the Interior (Australia) listedhim as an “Acting District Officer” in Portuguese Timor. Worked with OP LIZARD. Hiswife (Maria Eugenia) and 18 dependants evacuated to Australia on 8/9 December 1942(A3269, D6/A, p.52). Francisco was evacuated with Dom Paulo da Silva’s party from themouth of the Dilor River on 10 February 1943 on the submarine USS Gudgeon (toFremantle). Was in Melbourne with Lieutenant Pires for several weeks before moving toBob’s Farm (Newcastle area) in March 1943 with other “cinco indígenas” ex-USSGudgeon (Cardoso, 2007, p.175). His rate of pay in October, November 1944 at FCS (as atrainee) was 6/- per day. At Milton (Brisbane) in late October 1944. At FELO (Brisbane)on 21 November, 7 December 1944. At LMS in March-June 1945. See SRD’s Group D report of April 1945(A3269, D27/A, p.63) – “very useful for ops”. Memberof the SRD/Z Special Unit’s OP GROPER party to ((photograph not included))Kupang and Portuguese Timor in September 1945 (seeAWM photographs 115663, 115664 aboard HMAS Parkes)– departed Darwin on 7 September 1945, arrived WestTimor (Koepang) on 11 September. Returned to Darwinon 19 October 1945 with OP GROPER party. Author met Francisco da Silvawith his son - José Francisco da Silva, in Dili in October September 19452008 and June 2009. p.376). In late March 1944, Oliveira was described as the “chief Portuguese Timorassistant” at LMS. On 20 March 1944, Oliveira completed an SRD proforma that namedhis wife - Ermelinda Exposto de Oliveira, as his beneficiary in case of accident.617 On 25March 1944, SRD proposed that Oliveira – as a “secret agent”, visit Melbourne –accompanied by SRD’s Director of Intelligence, for a “morale boost”. In July 1944, he wasemployed at FCS – then “escorted” back to LMS, Darwin. Arrived at LMS on 11 August1944. In early September 1944, noted at Peak Hill. On 29 November 1944, SRD proposedinterning Oliveira, as he had “flatly refused to work” at FCS (A3269, V20). In December1944, he was employed at Peak Hill with 13 GDs. In mid-December 1944, Oliveira wasconsidered a “subversive element” and was removed from Peak Hill to Leanyer. Laternoted “in isolation” at Peak Hill on 1 January 1945. On 12 February 1945, he was declaredby SRD to Portuguese Consul Laborinho as “employed in semi-Army work”. Releasedfrom SRD employment in early 1945 (Consul confirmed on 20 Mar 45). He departed fromNewcastle as scheduled on the SS Angola on 27 November 1945, aged 29. Francisco Horta 618 – Portuguese, born on 26 August 1904 (or 1906) in Figueira da Foz(father: António Luís Horta; mother: Beatriz do Santos Leite). Single619. Ex-navycorporal620 (gunner) – served in the Portuguese military 1920-1931. He attested to takingpart in a “revolution in 1929.”621 Following leftist political action in April 1931622,Francisco Horta was deported to Timor aboard the vessel Gil Eanes – departing Lisbon on28 June 1931, arriving in Dili on 21 October 1931 (Cardoso, 2007, p.244).623 FranciscoHorta settled in the Manatuto area. He established a defacto relationship with a Timoresewoman (Sra. Rosa Soares/Gonçalves – born in Manatuto), siring two children – a son(António) and a daughter (Beatriz) and resided at Attacubal. He was employed as themaster of a small Government sailing boat (crew of six) carrying construction materials,salt and maize. At the time of the Japanese invasion (19/20 February 1942), he was inManatuto. Later, he was arrested in Dili by the Japanese but released following theintervention of the “Portuguese Administrator”. In August 1942, he was a member of thePortuguese force that suppressed the Turiscai and Maubisse “native uprisings” – the forceorganized by the Administrator of Manatuto, Mendes de Almeida (with pro-Portuguesenative arrairas mobilized from Ainaro against Maubisse).624 Francisco Horta laterreportedly assisted the Australian military in Timor against the occupying Japaneseforces.625 Subsequently, he was active in PORTOLIZARD (Cardoso, 2007, p.81).617 AWM, PR91/101 - folder 2.618 Father of the President of Timor-Leste, José Ramos-Horta. The year of birth on Francisco Horta’stombstone is “1906” – but several documents in the NAA cite “1904”. See also Carvalho, M. de AbreuFerreira, Relatório …, 1947, op.cit., p.339.619 As declared on several proforma, however Francisco Horta had a defacto wife and two children – a sonand a daughter, in Portuguese Timor.620 Several books cite his rank as a “Sergeant”, but in his appeal (27 January 1944) against his internment, hedeclared himself as a “corporal” with two year’s seniority and a total of nine year’s service. He had travelledextensively while in the Navy - including to Brazil and the Cape of Good Hope. (NAA: A367, C18000/861).621 Ibid.622 It is likely that Francisco Horta was involved in the incidents aboard the naval vessel Vasco da Gama inearly April 1931 – associated with the “Revolução de Madeira”. However Francisco Horta’s son - JoséRamos-Horta, records that his father was involved in a naval revolt on 8 September 1936 on vessels in theTagus River (Lisbon) - see Ramos-Horta, J., Funu, 1987, op.cit., p.7. Ramos-Horta also notes that his fatherrarely discussed his past.623 Cardoso, A.M., Timor na 2a Guerra Mundial – O diario do Tenente Pires, CEHCP-ISCTE, Lisbon, 2007,p.244.624 Ibid., p.244; see also Liberato, A. de Oliveira., O Caso …, 1947, op.cit., p.216.625 In several declarations while interned in Australia, Francisco Horta stated that he had assisted theAustralian military in Timor. During his appeal against his internment in January 1944, he declared that he ANNEX A 32 Evacuated from Barique on the south coast to Darwin on 4-5 August 1943 by RANFairmile MLs 814, 815 – according to Francisco Horta “at the direction of Pires” – andbecause his “health was precarious”. At LMS in Darwin for 18 days – where he left hisworn Australian uniform. Lieutenant Pires626 signaled SRD categorizing Francisco Hortaamong 14 of the evacuees as “very bad men” (A3269, D4/G p. 201, p.193). The AustralianArmy (at SRD advice) advised the Director General of Security - and Francisco Horta andseveral others nominated by Lieutenant Pires were segregated. Francisco Horta was firstregistered at Cairns (QLD) as Q12679 (description 5’5”, 130 lb). Following his arrival atBrisbane, he was interned with others at the Gaythorne Internment Camp on 10 September1943 – and designated Internee “Q540”. Francisco Horta Gaythorne – September 1943 The rationale for internment was that the 12 Portuguese/Timorese had information that wasprejudicial to the security of military operations in Portuguese Timor (most weredeportados).627 Francisco Horta was transported to the Liverpool (Sydney) InternmentCamp on 25 September 1943 with the other Gaythorne internees (see letter of 13 December1943 - A373, 3685C p.198). Francisco Horta was hospitalized in the period 27 September-13 October 1943 (with scabies) and, in the period 8 November 1943 - 2 December 1943,with “impetigo – legs” – both times at 17th Army Camp Hospital at Liverpool. In Januaryand February 1944, the 27 Portuguese/Timorese interned at Liverpool appealedunsuccessfully against their detention. Francisco Horta’s appeal was heard by the AdvisoryCommittee on 27 January 1944 as “Objection No.12” (A367, C18000/ 861). During hisappeal, he stated that he would be “glad” to return to Timor and fight the Japanese “if ableand fit”.628 Francisco participated in a hunger strike at Liverpool with 18 others in thehad been informally “enlisted” by Captain “Broad” (ie Captain D.K. Broadhurst) of OP LIZARD III and“given arms and ammunition … and a uniform” – and engaged in combat activity against the Japanese forcesincluding ambushes. He was initially equipped with a rifle and later an Austen sub-machine gun (NAA:A367, C18000/861). He stated that near Manatuto, he assisted “26 Australians for seven days” and his housewas burnt down by natives on Japanese instructions – letter dated 18 July 1944 (NAA: A367, C76071).According to his son, Francisco Horta “joined the allied forces … was deployed in the Remexio area as afighter” - Ramos-Horta, J., Funu, 1987, op.cit., p.8. Cardoso, A.M., Timor …, op.cit., p.244: “parece ser oChico Marujo, que combateu com os australianos” (“apparently as with Chico Marujo, fought alongside theAustralians”).626 Lieutenant Manuel de Jesus Pires was the Administrator of the Circunscrição of São Domingos – modern-day Baucau and Viqueque Districts, and leader of SRD’s OP LAGARTO.627 They were interned under the provisions of the National Security Act (General) Regulation 26 and theArmy Act 1903-1939. José Ramos-Horta asserts that his father, Francisco Horta, was interned in Australiaafter participating in a May Day rally - Ramos-Horta, J., Funu, 1987, op.cit., p.8. However, the dates notedabove would seem to preclude this possibility.628 At his appeal, Francisco Horta further noted that he “would like to fight the Japanese, and I am a very goodshot.” He rejected a suggestion that he might work in Australia “as a tram driver” – ie responding: “I wouldnot like that. I would like to be a soldier, but if Australia needs me on any other work, I would do the bestpossible.” (NAA: A367, C18000/861). 33 ANNEX A period 16-29 February 1944 (or 18-22 February). With others, he was moved fromLiverpool in April 1944 to the No.2 Internment Camp at Tatura (Victoria) – where he wasassessed as “quiet and inoffensive … good camp record … worked on camp projects …good type.”629 He was released to “fixed residence” at Singleton (northern NSW) on 17August 1944. In March 1945, he was released from “fixed residence” for SRD duty (SRDletter to Deputy Director of Security – QLD of 10 April 1945 - A3269, D27/A, p.69).Francisco Horta was recruited by SRD – due to his naval wireless telegraphy (ie morse)experience – ie for OP STARLING to be led into the western districts of Portuguese Timorby Sousa Santos. He attended an abbreviated commando course at the SRD’s Fraser IslandCommando School (Queensland) in late March-April 45 – with a wage of one pound (₤1)per week (A3269, D27/A, p.97). However, OP STARLING was cancelled on 19 April1945. He was noted as having “assisted Allied Forces – in the 3 November 1945 list(A1838, 377/3/3/6 Part 1, p.185 – see Annex E). Francisco Horta departed Newcastle asscheduled on the SS Angola on 27 November 1945 - aged 39630 and returned to Portugal.Subsequently, he returned to Portuguese Timor and became a civil servant wef 15September 1951. He married Natalina Ramos Filipe, the daughter of fellow interneddeportado Arsénio José Filipe. Francisco was noted as employed in March 1965 as aprimeiros escruturário in the Administrative Civil Service (BOdT); assistant (adjunto) Postoadministrator (BOdT No.28, 11 July 1970, p.659) – probably at Lacluta. He died on 15November 1970. 629 Dossier – Q540, Tatura, August 1944 (NAA: A367, C76071).630 His future father-in-law – Arsénio José Filipe (also interned at Liverpool), and his future wife – NatalinaRamos Filipe, also departed Newcastle on 27 November 1945 on the SS Angola.631 Interviewed at Bob’s Farm on 24 February 1943 - 3 L of C Sub-Area, New Lambton, 25 February 1943,p.3 (NAA: MP742/1, 115/1/245).632 Department of the Army, 669943, Melbourne, 1 May 1943 (NAA: MP742/1, 1/1/737). ANNEX A 34 Francisco Soares – Timorese. Evacuated to Australia and employed by SRD. His rate ofpay as a GD in November 1944 was 1/3 per day. Employed as a GD at Peak Hill, March-June 1945. Henrique Afonso M. Pereira – Mestiço. Served one year of national service in thePortuguese Army. Assisted Sparrow Force: “Henry Pereira helped after being wounded”(Lambert, G.E., Commando …, 1997, op.cit., p.437). Evacuated to Australia on 4-5 August1943 by RAN Fairmile MLs 814-815. Employed by SRD – and completed a parachutistcourse in 1944. Proposed for OP PIGEON (COBRA relief) in early September 1944 – withJoão Almeida. His rate of pay in October 1944 at FCS (as a trainee) was 6/- per day. Onleave in early October 1944. At Milton (Brisbane) in late October 1944. At Mount Marthaon 21 November – and again proposed for OP PIGEON (COBRA relief). On 7 December1944 trained at FCS. On 12 February 1945 was declared by SRD to Portuguese ConsulLaborinho as “employed in semi-Army work. At Peak Hill in March-June 1945. Herequested release in early 1945 (Consul confirmed on 20 March 1945). See SRD’s Group Dreport of April 1945 (A3269, D27/A, p.63): an operative – “Good type”. Reportedly “oneof the keenest in training” – Stevenson, A.D. (Turner, M., Telling …, 1992, p.58). Noted atPeak Hill in May 1945 (A3269, D27/A, p.9). He did not depart Newcastle on the SSAngola on 27 November 1945 as scheduled. Worked in Sydney for a steamship company –later transferred to India – before returning to Timor. Wounded by a mortar round in mid-1975, he was evacuated to Darwin with the assistance of Captain (Retd) A.D. Stevenson(OP SUNLAG, GROPER) as a refugee.633 Resided in Brisbane in July 1991 (see “Warveteran returns to NT”, Sunday Territorian, Darwin, 28 July 1991). Probably brother toFernando Pereira. (associated with the brother of Carlos Cal Brandão). Deportado. Arrived in Dili on 21October 1931 (Cardoso, 2007, p.244). Teacher – “spoke English”. Employed in PortugueseTimor by the Portuguese Geographical Mission. He was a member of the column led bySergeant António Joaquim Vicente that suppressed native uprisings in the FronteiraCircunscrição in late August 1942.635 Active in PORTOLIZARD (Cardoso, 2007, p.81).Evacuated from Barique by RAN ML, arrived in Darwin on 5 August 1943. Arrived atBob’s Farm (Newcastle) on 11 September 1943. He was interned at Liverpool on 23September 1943 – as Internee “N1764”. Released to Minimbah (Singleton) on 21 March1944. Transferred to Armidale. He departed from Newcastle as scheduled on the SSAngola on 27 November 1945, aged 53. João Cândido Lopes637 – Portuguese. Retired Lieutenant (ie known as Tenente Lopes).Planter at Maucatar in the south of the Fronteira Circunscrição. “Rendered valuableassistance” to Sparrow Force. “Offered to raise a sizeable ‘native’ army to assist theSparrows.”638 Lopes provided horses and labour for the unloading of vessels on the southcoast and the movement of stores.639 In June 1942, the Commander-in-Chief of theAustralian Military Forces recommended that Senhor Tenente Lopes “be noted for adecoration at the end of hostilities.”640 He was a member of Lieutenant Liberato’s column 635 Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.315. Liberato, A. de Oliveira., O Caso …,1947, op.cit., p.111.636 Liberato, A. de Oliveira., O Caso …, 1947, op.cit., p.216.637 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.200, p.318, p.325, pp.372-373, p.377,p.641, p.656, p.663, p.729, p.739.638 Manderson, H.B. (450), Report, late 1942 (NAA: A3269, D6/A, p.6).639 Callinan, B.J., Independent Company, 1953, op.cit., p.136. ANNEX A 36 that suppressed the native uprisings in the Circunscrição of Fronteira in late August1942.641 Lopes was also to be evacuated to Australia with the Fronteira AdministratorSousa Santos but did not reach the assembly point (A1838, 377/3/3/6 Part 1, p.193). Inmid-September 1945, after the Japanese surrender, Lopes was appointed as the “militaryintendente” of the Circunscrição of Fronteira. In early August 1946, when Sousa Santoswas formally proposed for an honorary OBE (Civil Division), the case of Lopes wasreviewed – but no further action appears to have been taken.642 Post-War, it was possiblethat Lopes would be prosecuted – ie together with Sousa Santos (see A1838, 377/3/3/6 Part1, p.188, 176). He was listed as having “Assisted the Allied Forces” in the 3 November1945 schedule (A1838, 377/3/3/6 Part 1, p.185 – see Annex E). noted as one of the three leaders of a “Pro-British organization in Dilli” (14 August 1941)prepared to take over the Government in Dili if Germany were to occupy Portugal. Moreiraprovided goods (fresh food and vegetables) to both the Dutch and Australian forces in Diliand was “scrupulously honest” (Consul D. Ross). Subsequently, Moreira was re-imbursed₤84.5.3 (1,011.14 patacas) in August 1943 for the goods provided to the Australian forces.(MP742/1, 1/1/737). He was evacuated to Australia on 8/9 December 1942 with his wifeand one child – and, in his care, the three-year old daughter (Maria) of Matos e Silva (OPPORTOLIZARD and OP LAGARTO) - and he was provided with funds for such by CarlosCal Brandão. In mid-February 1943, Moreira provided a report to the former Consul DavidRoss on the evacuees from Timor (A373, 4058A). Initially resident at Bob’s Farm. He latermoved to Narrabri – and received a weekly allowance from the Portuguese government of₤6.10.0. From 26 February 1945, Moreira was employed as a labourer by the CrownCrystal glass company in Sydney at a weekly wage of ₤5.9.0. Moreira was believed to haveassociated with Australian communist organizations. He applied for permanent residence inAustralia in November 1945. When refused, he sought a one year’s temporary residencyor, as a “political refugee”, permission to depart to a country of his choosing. Moreira citedas referees to his “character and loyal service”: Lieutenant (RANVR) F.J.A. Whittaker andGroup Captain David Ross. Moreira and his family did not depart Newcastle as scheduledon the SS Angola for Dili on 27 November 1945. In late November 1945, the Australiansecurity authorities received allegations that Moreira and de Abreu: “were remaining inAustralia in order to obtain the help of communists to further the revolution in Timor.Bezerra dos Santos, who joined the ship, is to be the Communist agent in Timor.” After theWar, Moreira was cited in Governor Carvalho’s book as an “active agent of direct service”to the Australian military.644 644 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.83.645 Group D, Timorese Personnel - Group D, Darwin, April 1945 (A3269, D27/A, p.65). He later reportedlyreturned to Leanyer.646 Liberato, A. de Oliveira., O Caso …, 1947, op.cit., p.216. ANNEX A 38 and chest, nursed by Luz, but died a few days later. The SRD Official History records:“killed by rifle fire during flight” (A3269, O8/A, p.34A). João Vieira647 – Portuguese (or mestiço648). From Taibessi. Corporal - infantry. Assistedthe 2/2 Independent Company – João Vierra [sic] noted as the “organizer of food supplies”in the Dili area (Lambert, G.E., Commando …, 1997, p.125). Member of the “InternationalBrigade” fighting alongside Sparrow Force: “On ni 22/23 Nov 42 John [sic] Vierra, aPortuguese attached to 4 Sec entered Dili disguised as a Timor” – highest praise andcommendation (Lambert, G.E., Commando …, 1997, p.154). In action against the Japanesewith 2/4 Independent Company at the Sumasi River (Lambert, G.E., Commando …, 1997,p.147). Assisted SRD’s OP LIZARD - his group operated in Uai Alla area between Bibileuand Mundo Perdido (Captain D.K. Broadhurst report – A3269, D6/A, p.114). Six of “JoãoVieira’s party” are listed at A3269, D27/A. p.2. In January 1943, Vieira was cited in LancerForce’s instruction to S Force: “John Vierra (Cribas area)” – particularly recommended.Operated with S Force (Lambert, G.E., Commando …, 1997, p.228). He was a principal inPORTOLIZARD after the Lancer Force/LIZARD evacuation – and led a reconnaissance toDili in mid-May 1943 (A3269, D4/G, p.376, p.380). Vieira joined the LAGARTO group onits arrival under Lieutenant M. de J. Pires on 1 July 1943. From 12 August 1943, Vieira(codename “JVP”) led an armed group and established an OP overlooking Dili – beforereturning to the Remexio/Laclo area in late August 1943 (A32369, D4/G, p.99). Vieirareturned to LAGARTO on 24 September 1943 having lost ten men and his signaler(Procópio do Rego) – (A3269, D4/G, p.28). Luís dos Reis Noronha (codename LNL) wasalso a likely member of Vieira’s group (A3269, D4/G, p.173 ) - Luís was also captured bythe Japanese and later killed. The LAGARTO group was attacked by a Japanese and nativeforce at Cape Bigono on 29 September 1943 and its leadership captured – Vieira escaped,but was captured a few days later. He was seen in prison in Dili by the deportado AntónioSantos (Cardoso, 2007, p.101). Vieira reportedly “died in prison in Dili, detail not known”-Carvalho, J. dos Santos, Vida em Morte…, 1972, op.cit., p.130. Australian veterans of 2/2and 2/4 Independent Companies established the “Francisca Vierra [sic] Fund” - ie for thewidow of John [sic] Vieira (Lambert, G.E., Commando …, 1997, op.cit., p.438). Johannes (Dutch) – Native from Atambua, Dutch Timor. Aged 20. A former soldier inDutch NEI forces. Evacuated to Darwin on 4-5 August 1943 by RAN Fairmile MLs 814,815. On 24 March 1944, Johannes completed an SRD proforma declaring that while onoperations “all money was to remain in Australia”.650 Under training at FCS in earlySeptember 1944. His rate of pay in October 1944 at FCS (as a trainee) was 6/- per day. At 647 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.441, p.471, p.555, p.736.648 Brandão, C. C., Funo …, 1953, op.cit., p.133.649 Joaquim Luís Carreqeco is cited as a principal source of information in the Adenda in Carvalho, J. dosSantos, Vida em Morte…, 1972, op.cit., pp. 195-204 – particularly on the evacuations in August 1943.650 AWM, PR91/101 - folder 2. 39 ANNEX A Milton (Brisbane) in late October 1944. In late 1944 to Casino (NSW) on leave – to visit arelative. There were attempts to re-recruit him into the NEI Army. At FELO (Brisbane) on7 December 1944. José Alves Jana – Portuguese, born on 27 September 1914 in Macau. Student. Deportado.Arrived in Dili on 21 October 1931 (Cardoso, 2007, p.245). Merchant. Reportedly a “cattlebuyer for the Japanese forces”. Claimed to have been “instrumental” in saving RAAF pilot“George Sydney”(A373, 3685C, p.103). Jana was a friend of Carlos Cal Brandão. Jana’swife was evacuated from the south coast to Darwin on 8/9 December 1942 (A3269, D6/A,p.50). Jana was active in PORTOLIZARD (Cardoso, 2007, p.81). He was evacuated fromBarique by RAN ML on 3 August 1943 and arrived in Darwin on 5 August 1943. Hearrived at Bob’s Farm (Newcastle) on 11 September 1943. Subsequently, he was internedat Liverpool in late September 1943 as Internee “N1771”. His wife moved from Bob’sFarm to Armidale. During his appeal against internment on 28 January 1944, he advisedConsul Laborinho that he suspected that Lourenço de Oliveira Aguilar – an evacuatedPortuguese Circunscrição administrator, was responsible for the charges against thePortuguese internees (A373, 3685C p.120). He was released to Minimbah ( Singleton) –with “restricted residence” on 21 March 1944 (A373, 3685C, p.37). Subsequently, hetransferred to Armidale. He departed from Newcastle as scheduled on 27 November 1945on the SS Angola, aged 31 – with his wife. After the War, he was cited in GovernorCarvalho’s book as an “active agent of direct service” to the Australian military.651 José da Silva - Portuguese, born on 5 August 1902 in Lisbon. Locksmith and motormechanic. Imprisoned on 11 June 1925. Deportado. Arrived in Dili on 25 September 1927(Cardoso, 2007, p.240). Employed as a ganger at a SAPT plantation at Fatubessi.Evacuated from Betano on a Dutch naval vessel on 15 December 1942. Resided at Bob’sFarm – reportedly spoke English. On 10 February 1943, he was reported by the Australiancamp manager as one of five men “having caused trouble in the Bob’s Farm community”.An investigation noted that “he has not performed any duty at the Bob’s Farm camp” andclaimed that he “considered himself to be a member of the Communist Party.”652 He movedto Victoria and worked at a pulp-wood enterprise in Marysville, but was assessed as “beingundesirable” and returned to Bob’s Farm in late August 1943. He was interned at Liverpoolon 23 September 1943 – as Internee “N1760”. Released on 9 March 1944 – to NarrabriWest (A373, 3685C, p.63). He departed from Newcastle as scheduled on the SS Angola on27 November 1945 with his Timorese wife and their five children. that “Gordinho is the worst type of individual present in the camp.” With Arsénio Filipeand Amadeu Neves, he reportedly worked at “Lysaght’s Newcastle Works”. Together withArsénio Filipe, Gordinho led a group of dissident deportados in the Bob’s Farm camp andwas involved in a “melee” at the camp on 27 April 1943.654 Following furtherdisturbances655 at Bob’s Farm - ie after the return of several deportados from Victoria andthe arrival of eight deportado evacuees on 11 September 1943, on 16 September – togetherwith Arsénio Filipe and Amadeu Neves, Gordinho was accommodated at the SalvationArmy Palace in Newcastle (they were to be found employment by the ManpowerDirectorate). Subsequently, he was interned at Liverpool on 23 September 1943 – asInternee “N1763”. “A portly gentleman of 13 stone”, Gordinho participated in a hungerstrike from 19-22 January 1944 (A373, 3685C p.123). His appeal against internmentcommenced on 24 January 1944. He was released to Minimbah, (Singleton) on 21 March1944 (A373, 3685C, p.43). Departed from Newcastle as scheduled on 27 November 1945on the SS Angola with his Timorese wife and their six children. He returned to Portugal onthe SS Angola on 15 February 1946 – and was arrested by the PIDE in November 1946 for“subversive activities” (Cardoso, 2007, pp.128-129). After the War, he was cited inGovernor Carvalho’s book as an “active agent of direct service” to the Australianmilitary.656 José de Carvalho – Mestiço. Son of the former liurai/régulo of Liquiçá. Educated at CasaPia - Lisbon.657 Single. Evacuated to Australia and employed by SRD. Lieutenant Piresrecommended Carvalho to SRD as an “observer” – 5 August 1943. Appears in a groupphoto on Fraser Island – November 1943. He completed parachute training in February1944. Undertook a caverning course in Rockhampton, grenade training at Mount Martha,and morse (W/T) training at Fraser Island (C. Noronha, letter to author, 12 May 2009).Member of the OP ADDER party – inserted into the Lore area (southern Lautem) on 21August 1944 by RAN Fairmile ML 429.658 His rate ofpay in November 1944 was 10/6 per day. Reportedlycaptured soon after landing at Lore. He was sighted inan Australian uniform in prison in Dili by Captain A.J.Ellwood (POW – OP LAGARTO) in September 1944(A3269, V19, p.9). Carvalho reportedly died of ((photograph not included))malnutrition or was shot and killed by the Japanese.He is also recorded as: “Shot and killed by Japanese inLautem in August 1945 [sic – ie year should be 1944]”- Carvalho, J. dos Santos, Vida e Morte…, 1972, op.cit.,p.129. “Carvalho J.” is included as a “civilian” on theHonour Roll on the SRD monument at Rockingham, José de CarvalhoWA (inaugurated on 6 November 1949). FCS – late 1943 José Eduardo de Abreu da Silva – Portuguese, born on 18 October 1920,. Chefe de Postoat Hato Udo. Evacuated to Australia - aged 22 years. As a guest of Government, resident at654 Gordinho reportedly urged other deportados to “arm with knives and kill” – Crothers, W.V., Bob’s Farm,17 September 1943 (NAA: A373, 3685A).655).656 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.83.657 Brandão, C. C., Funo …, 1953, op.cit., p.133.658 His SRD wages payments were made into an account at the Bank of Adelaide (267 Collins St, Melbourne)– from April 1944 allocated to the “H.B. Manderson, Account E” (NAA: A3269, V20). 41 ANNEX A José Filipe – Portuguese, born on 31 March 1906 in Lisbon (father: José Filipe; mother:Imerciano Ramos - José Filipe was the brother of Arsénio José Filipe). José Filipe served inthe Portuguese Army 1914-1918, and later was a civil construction operator – and a painter(member of the Painters’ Union). “Anti-fascist”, he was imprisoned on 28 July 1925(accused of planning criminal acts) – and listed as an anarchist.659 Deported to PortugueseTimor on 24 July 1927 aboard the vessel Pero de Alenquer, he arrived in Dili on 25September 1927 (Cardoso, 2007, p.240). Married to Luciana Filipe (Timorese – her motherwas Bi Lau). Activities in Portuguese Timor included working as a supervisor in a factoryin Dili – also repaired roofs and made bricks and tiles. At the time of the Japanese invasion(19/20 February 1942), José Filipe was working in a factory in Dili – he reportedly pickedup the rifle of a Dutch soldier who had been killed, and “joined the Australians” for “two orthree days”.660 He returned to Dili and was beaten by the Japanese military – but continuedto pass information to “Captain Laidlaw” (2/2 Independent Company). Three months later,denounced by the “natives” as a “spy” for the Australians, he then moved – with his family,from Dili to Lore in southern Lautem (travelling by horseback and foot).661 In November1942, he reportedly operated a timber mill at Lore (Carvalho, J., Vide e Morte …, op.cit.,p.203). In the period 1942-1943, he assisted Australian troops against the Japanese.662 Hiswife and six children were evacuated from the south coast to Australia on 8/9 December1942 (A3269, D6/A, p.50), and resided at the Bob’s Farm camp north of Newcastle. JoséFilipe “stayed behind” with the PORTOLIZARD party led by Sergeant António LourençoMartins and Matos e Silva (A3269, D6/A, p.50). He was evacuated to Darwin from thesouth coast (Barique) aboard RAN Fairmile MLs 814, 815 on 4-5 August 1943 (includingwith Francisco Horta). Lieutenant Pires (the Administrator of the Circunscrição of SãoDomingos – modern-day Baucau and Viqueque Districts, and leader of SRD’s OPLAGARTO) signaled SRD categorizing José Filipe, and several others (includingFrancisco Horta), as “very bad men” who should be segregated – ie not go to Bob’s Farm(signal of 6 August 1943). The evacuated group remained in Darwin for 18 days beforesailing to Brisbane via Cairns. José Filipe was detained at the Gaythorne Internment Camp(Brisbane) on 10 September 1943 with 11 other Portuguese (including Francisco Horta)and registered as Internee “Q542”. José Filipe was described as: height – 5’1”; weight –120 lb. The rationale for internment was that the 12 Portuguese had information that wasprejudicial to the security of Australian military operations in Portuguese Timor (most weredeportados).663 Soon after, José Filipe was hospitalized with bronchitis in 3 Army CampHospital (22 September 1943 – 6 October 1943). He was transferred to the LiverpoolInternment Camp (Sydney) on 26 October 1943 (the other 11 Portuguese internees hadarrive one month earlier from Gaythorne). José Filipe’s distinguishing features wererecorded as: “hair – grey; eyes – brown; tattoo of woman on chest – various tattoos on both 659 See Ramos-Horta, J., Funu, 1987, op.cit., p.8: José Filipe was “responsible for countless bomb explosionsin the 1920s. He actually manufactured the bombs in his small apartment in Rua do Solao, Rato”.660 As stated at Liverpool on 21 and 27 January 1944 during his appeal (Objection No.5) against hisinternment. He also declared that he fired his weapon against the Japanese (NAA: A367, C18000/861).661 He was provided with a pass to travel to Lore by “Engineer Canto” – a “Portuguese administrator” (ieArtur do Canto Resende, geographical engineer – killed by the Japanese on Alor, 23 February 1945).662 José Filipe “became a sophisticated ‘chef’ for one of the Australian units” - Ramos-Horta, J., Funu, 1987,op.cit., p.8. In November 1942, he was noted as assisting with the management of a sawmill at Loré (Lautem)– Carvalho, J. dos Santos, Vida e Morte, 1947, op.cit., p. 203.663 They were detained under a warrant issued pursuant to National Security Regulations, 24 Aug 43 –Regulation 26 and the Army Act 1903-1939. ANNEX A 42 arms”. He was a patient in 114 Army General Hospital in the period 21-31 December 1943.In January and February 1944, the 27 internees at Liverpool appealed unsuccessfullyagainst their detentions. Subsequently, José Filipe participated in a hunger strike atLiverpool - 18-29 February 1944. When his brother Arsénio Filipe was released fromLiverpool on “restricted residence” to Minimbah (Singleton - northern NSW) in late March1944, José Filipe and 11 others (including Francisco Horta – ie the Gaythorne detainees)remained interned at Liverpool. However, the 12 Liverpool detainees were moved to theTatura Internment Camp No.2 (Victoria)664 in early April 1944 where they were re-unitedwith their families (totaling seven wives and 20 children). José Filipe’s family had movedfrom the Bob’s Farm camp to the Imperial Hotel at Narrabri West - then joined him atTatura on 5 April 1944. The family group were recorded as: José Filipe – aged 37 (iehimself); Luciana Quintas Filipe (Internee “NF1797”) – aged 25/34; José Ramos Filipe(born on 15 February 1929, Internee “N1779”) – 15; Raul Filipe (born 17 April 1932,Internee “N1781”) – 13; Luiz Filipe (born 30 June 1934, Internee “N1780”) – 10; AliceFilipe (born 15 December 1936, Internee “NF1782”) – 5; Ilda Filipe (born 25 June 1942,Internee “NF1783”) – 2. José Filipe was hospitalized in the Waranga Hospital in theperiods 14-20 April 1944 and 1-5 May 1944. He was released with his family frominternment at Tatura to “restricted residence” at Minimbah (Singleton) on 19 August 44.José Filipe and all his family members departed as scheduled from Newcastle to Dili on theSS Angola on 27 November 1945 – with their newly-born child, Lorena. The family of hisbrother - Arsénio José Filipe, and Francisco Horta - as a single man, also departedNewcastle on the SS Angola on 27 November 1945. Arranhado was one of 14 “very bad men” and should be segregated – and not go to Bob’sFarm (signal of 6 August 1943). Arranhado was detained at the Gaythorne InternmentCamp (Brisbane) on 10 September 1943 – as Internee “Q537”. Soon moved to theLiverpool Internment Camp (Sydney), and from April 1944 was interned at Tatura(Victoria). He was released on 17 August 1944. In early April 1945, he was resident inSydney – and noted by SRD as a “good radio mechanic but no knowledge morse” – andrecruited by Sousa Santos for SRD’s OP STARLING planned for the western area ofPortuguese Timor (A3269, D27/A, p.75), and was paid one pound (₤1) by SRD. OperationSTARLING was cancelled on 19 April 1945. He was included on the 3 November 1945 listas having “Assisted the Allied Forces” (A1838, 377/3/3/6 Part 1, p.185 – see Annex E). Hedeparted as scheduled from Newcastle on the SS Angola on 27 November 1945. José Joaquim dos Santos – Radio carrier with OP LIZARD. Evacuated to Australia andemployed by SRD. On 5 April 1944, he signed an SRD “Declaration” that, if killed, “hismoney was to remain in Australia with his aunt – Eufrasia, at Narrabri”.668 His rate of payin October, November 1944 at FCS (as a trainee) was 6/- per day. Completed a parachutistcourse on 11 November 1944. At FELO (Brisbane) on 21 November 1944; enroute to LMSon 7 December 1944. On 12 February 1945, he was declared by SRD to Portuguese ConsulLaborinho as “employed in semi-Army work”. See also SRD’s Group D report in April1945 (A3269, D27/A, p.64). On leave in Narrabri on 10 April 1945, but refused to return toDarwin. Note: probably NOT Joaquim dos Santos aged 59 and family – who departedNewcastle on SS Angola 27 November 1945. José Manuel de Jesus Pires. Single. Born on 15 August 1924. Eldest son of LieutenantManuel de Jesus Pires. Evacuated to Australia and employed by SRD as a GD at FCS toOctober 1944. His rate of pay as a GD in October, November 1944 at FCS was 6/- per day.On 12 February 1945, he was declared by SRD to Portuguese Consul Laborinho as“employed in semi-Army work”. At LMS in March 1945; in hospital at 107 AGH in earlyApril 1945; at Peak Hill in May and June 1945 – also in hospital (at 107 AGH) in June1945. See SRD’s Group D report in April 1945 (A3269, D27/A, p.65). Appears in a groupphotograph at FCS. He departed from Newcastle as scheduled on the SS Angola on 27November 1945, aged 21. Migrated to Australia and resided in Western Australia –deceased. José (Zeca) Rebelo670 – Mestiço. Corporal, infantry. From Manatuto. Married. Member ofthe “International Brigade” (Wray, C.C.H., Timor 1942, op.cit., p.128) – and subsequentlythe PORTOLIZARD party. His wife and child were evacuated from the south coast toDarwin on 8/9 December 1942 (A3269, D6/A, p.50) – and resided at the Bob’s Farm campnorth of Newcastle. José Rebelo was evacuated from the south coast on 4-5 August 1943aboard Fairmile MLs 814, 815. Lieutenant Pires recommended him to SRD as an“observer” – 5 August 1943. On 12 September 1943, LAGARTO (then still “free” in668 AWM, PR91/101 - folder 2.669 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.83.670 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., p.260, 339, 351, 387; Brandão, C. C.,Funo …, 1953, op.cit., p.165 – as “son of a European”. ANNEX A 44 Timor) requested that Rebelo (and Domingos Soares) join LAGARTO as an operator tosupport new proposed OPs (A3269, D4/G, p.62). Moved from LMS to FCS in lateNovember 1943 – noted as “speaks some English”. At FCS in December 1943 – as “newlyarrived”. In a group photograph on Fraser Island. Completed parachutist training inFebruary 1944. In February 1944, SRD proposed sending Zeca Rebelo, the two Noronhabrothers (Bernardino and Câncio) to man an OP at Kuri or Isuum (A3269, D4/C, p.252).José Rebelo undertook caverning training in Rockhampton, grenade training at MountMartha, and morse (W/T) training at Fraser Island (C. Noronha, letter to author, 12 May2009). Member of the OP ADDER party – inserted into the Lore area (southern Lautem) on21 August 1944 by RAN Fairmile ML 429.671 Believed to have died when he fell off cliff -or was shot and killed by the Japanese. “Shot and killed by Japanese in Lautem in August1945 [sic – ie year should be 1944]” Carvalho, J. dos Santos, Vida e Morte…, 1972, op.cit.,p.129). His rate of pay in November 1944 was 10/6 per day. His family in Australia was inthe care of Brazilian Consul (Sydney) in November 1945 and were authorized to stay inAustralia (MP742/1, 115/1/245). “Rebelo Zeka” is included as a “civilian” on the HonourRoll on the SRD monument at Rockingham, WA (inaugurated on 6 November 1949). José Tinoco672– “Native”, born in Vila Real de Trás-os-Montes, Guinea. Son of a well-known former colonial civil servant.673 Travelled with his family to Macau, India – andthen to Mozambique and Timor (arriving in Portuguese Timor in 1937 – Cardoso, 2007,p.53). Chefe de Posto at Lacluta (BOdT No.18, 2 May 1941, p.122 – an aspirante from July1937). A “leading member of Pro-British organization in Dilli” - 14 August 1941. Servedin PORTOLIZARD under Sergeant António Lourenço Martins and Matos e Silva. Joinedthe LAGARTO party led by Lieutenant M. de J. Pires in early July 1943. Planned toestablish a group at Lacluta in early September 1943. Captured with Lieutenant Pires nearPoint Bigono on 29 September 1943. Included on SRD “operational” personnel lists of 21November 1944, 7 December 1944, 25 March 1945, 7 April 1945, 6 June 1945 as amember of the OP LAGARTO party - and included in the Operation Groper OperationOrder No. 25: “SRD Personnel Missing in Timor”, 30 August 1945 (A3269, D26/A, p.15).Japanese Army Lieutenant Saiki told Australian POW Captain A.J. Ellwood that Tinocohad “died of malaria and beri-beri” (Elwood, A.J., report, Melbourne, 26 October 1945).This version of his death was repeated during post-War war crimes trials in Darwin.674Reportedly “died in prison in Dili on 8 April 1944” (Carvalho, J. dos Santos, Vida eMorte…, 1972, op.cit., p.130; Cardoso, 2007, p.101). Tinoco’s death is also reported ashaving been recorded on the wall of a prison in Dili as “8 April 1944” – believed to havebeen written by Matos e Silva (Memorial de Dare, 2009). He was noted as having“Assisted Allied Forces” – in the 3 November 1945 list (A1838, 377/3/3/6 Part 1, p.185 –see Annex E). Lau Fang – Chinese. Evacuated – arrived Darwin on 19 November 1942. Noted at FCSon 18 October 1944. On 12 February 1945, he was declared by SRD to Portuguese ConsulLaborinho as “employed in semi-Army work”. He departed from Newcastle as scheduledon the SS Angola on 27 November 1945 – listed among deportados e condenados(criminals) – NAA: A367, C63656. See also file: NAA: SP11/2 CHINESE/LAU F. 671 His SRD wages payments were made into an account at the Bank of Adelaide (267 Collins St, Melbourne)– from April 1944 allocated to “H.B. Manderson, Account C” (NAA: A3269, V20).672 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.441-442, 471, 555, 724, 735. Not to beconfused with José Plinio dos Santos Tinoco – a civil servant in Oecussi throughout the War.673 Brandão, C. C., Funo …, 1953, op.cit., pp.27-28.674 ---, “Deaths in Prison after Beatings”, The Age, Melbourne, 6 March 1946, p.5. 45 ANNEX A Lede J. - from Savo, Dutch Timor – an ex-member of the Dutch NEI forces. Aged 20.Evacuated to Darwin on 4-5 August 1943 by RAN Fairmile MLs 814, 815. Employed bySRD, his rate of pay in November 1944 was 1/3 per day. At Peak Hill in May and June1945. See SRD’s Group D report in April 1945 (A3269, D27/A, p.66). Luís dos Reis Noronha675 - liurai of Laclo (elder brother of the Noronha brothers:Bernardino and Câncio). With SRD code-name “LNL”, was reportedly scheduled to go tothe Dili OP with the LAGARTO team led by Corporal Vieira and radio operator Procópiodo Rego. LAGARTO message noted: “LNL writes English and Jap Portuguese” (A3269,D4/G, pp.173-174). Luís was captured by the Japanese at Hato Conan (together withProcópio do Rego) – taken to Dili and tortured and killed by the Japanese military (Turner,M., Telling …, 1992, op.cit., pp.54-55; and C. Noronha, letter to author, 12 May 2009). On6 December 1944 – SRD sought information on Luís dos Reis Noronha and his sisters – asrequested by his two brothers serving with SRD in Australia (A3269, D4/A, p.199, p.209).In February 1945, SRD again sought to check on the status of “Luiz Noronha” – as“operational use of his brothers undesirable if Luiz is in Jap hands” (A3269, D4/A, p.191). Luís José de Abreu - Portuguese, born on 2 July 1897 in Lisbon. Civil construction -painter. Imprisoned on 2 September 1925. Deportado – arrived in Dili on 25 September1927 (Cardoso, 2007, p.241). Evacuated from Barique, and arrived in Darwin on 5 August1943. Lieutenant Pires (Operation LAGARTO) advised SRD that de Abreu was one of 14“very bad men” and should be segregated – ie not go to Bob’s Farm (signal of 6 August1943). He was detained at Gaythorne Internment Camp (Brisbane) on 10 September 1943 –as Internee “Q539”. Subsequently, he was interned at Liverpool (Sydney) and Tatura(Victoria). Joined at Tatura by his Timorese defacto wife, Madalegna de Canosa (fromNarrabri – Coleman’s Private Hotel). Released on 17 August 1944 to “restricted residence”at Minimbah (Singleton). He applied for permanent residence in Australia in November1945 – but this was refused. Neither he, nor his wife, departed as scheduled fromNewcastle on the SS Angola on 27 November 1945. In late November 1945, the Australiansecurity authorities received allegations that de Abreu and João Moreira “were remaining inAustralia in order to obtain the help of communists to further the revolution in Timor.Bezerra dos Santos, who joined the ship, is to be the Communist agent in Timor.” Luís deAbreu returned to Timor in 1947, and moved to Australia in 1974 (see the article: “LuísAbreu – aguarelas de uma vida”, O Portuguese, Sydney, 18 March 1991). Luiz/Luís da Sousa – Portuguese. Sergeant – Navy; radio operator with the PortugueseGeographic Mission in Portuguese Timor. Operated with the PORTOLIZARD group in1943. Evacuated to Australia on 3 August 1943. Lieutenant Pires commentedunfavourably on da Sousa in early August 1943. Da Sousa was living in Melbourne in1945. In March 1945, Sousa Santos tried to recruit Luiz da Sousa for an SRD operation(OP STARLING) into western Portuguese Timor – and nominated da Sousa for training atFCS (A3269, D27/A, p.125) – but Luiz da Sousa did not participate. Resided at Armidale,NSW. He was noted as having “Assisted the Allied Forces” as a radio operator at Ossu –in the 3 November 1945 list (A1838, 377/3/3/6 Part 1, p.185 – See Annex E). Aged 45, hedeparted from Newcastle as scheduled on the SS Angola on 27 November 1945 with hisTimorese wife and their one-year old son. 675 His father - Major Luís of the Segunda Linha, was awarded the Portuguese medal “Valor & MéritoMilitares” - Brandão, C. C., Funo …, 1953, op.cit., pp.133-134. ANNEX A 46 Manuel – Evacuated to Australia and employed by SRD as a GD. His rate of pay inNovember 1944 was 1/3 per day. See SRD’s Group D report in April 1945 (A3269, D27/A,p.66). Note: possibly Manuel Ali, aged 20 – who did not depart Newcastle on the SSAngola on 27 November 1945 as scheduled. 680 Ellwood, A.J., Operational Report on Lagarto, October 45 (NAA: A3269, V17, pp.160-161).681 SRD – to LMS, T22, Melbourne, 24 March 1944 (A3269, L7).682 ---, “Deaths in Prison after Beatings”, The Age, Melbourne, 6 March 1946, p.5. ANNEX A 48 D27/A, p.65). In Glen Innes on 10 April 1945. He departed from Newcastle as scheduledon the SS Angola on 27 November 1945 – aged 38. Manuel H. de Jesus Pires – single. Son of Lieutenant Manuel de Jesus Pires. Evacuated toAustralia and employed by SRD as a GD. At FCS in October 1944 as a GD with a rate ofpay of 6/- per day. In a group photograph at FCS. Reportedly returned to his family atNarrabri in mid-October 1944. He departed from Newcastle as scheduled on the SS Angolaon 27 November 1945 – aged 19. Migrated to Australia. Resident in Hinchinbrook (NSW)in 2010. Mário de Jesus Pires – single. Born on 22 December 1926. Son of Lieutenant Manuel deJesus Pires. Evacuated to Australia and employed by SRD. In a group photograph at FraserIsland in late 1943. Departed Newcastle as scheduled on the SS Angola on 27 November1945 – aged 18. Migrated to Australia. Resident in Bonnyrigg (NSW) in 2010. intended for OP SUNDOG – but did not participate when the operation was undertaken inJune 1945. Noted as having “Assisted the Allied Forces” – in the 3 November 1945 list(A1838, 377/3/3/6 Part 1, p.185 – see Annex E). He departed from Newcastle as scheduledon the SS Angola on 27 November 1945 – aged 48, with his 26 year-old Timorese wife(Assum Meo) and their six year-old son. Nico Anti/Arti (“Neko”) – From Atambua, Dutch Timor. An ex-member of the Dutch NEIforces. Aged 20. Evacuated to Darwin on 4-5 August 1943 by RAN Fairmile MLs 814,815. Employed by SRD in Darwin. Detached to Brisbane on 7 September 1944. Noted asunder training at FCS in early September 1944 to mid-October 1944. Patrício José da Luz687 – Mestiço, born on 31 July 1913 (in Manatuto). Father - AntónioBonfilho da Luz (Macanese ie Chinese Mestiço); mother – Ricardina (Timorese fromManatuto). Studied in Macau and Hong Kong. Spoke Portuguese, Tetum – and reportedlyGaloli and Makassae. Also spoke excellent English. Completed a radio/wireless telegraphycourse (RT/WT – ie including morse) in Macau in 1937 and later trained at the PanAmerican Airways radio school in Manila. He returned to Portuguese Timor and enteredthe public service on 23 December 1937 – appointed as an “assistant” on 30 April 1938(BOdT No.26, 25 June 1938, p.254). Assisted I.R. Hodder of the Australian Department ofCivil Aviation in the erection of radio facility in Dili in early 1941.688 Assisted theAustralian Consul David Ross in Dili in the period 1941-1942.689 Signaled Australia tofacilitate the sinking of Japanese vessel in Dili harbour area: “On 6 December, heintercepted a Japanese message instructing the ship Nanyei Maru, in Dili harbour, to act asa guide vessel to their aircraft. He informed Darwin and on the first day of the war, 8December, and an Australian Hudson bomber sank the ship.”690 Luz reportedly laterorganised the transfer of the Qantas portable aero-radio equipment to Sparrow Force. TheJapanese reportedly put a reward of “500 petakas [sic] … on his head and hide”.691 He wasevacuated from the south coast to Australia and, via Darwin, arrived in Brisbane by air on 8December 1942 ie ahead of the party of 146 evacuees that travelled by the SS Islander. Hisfather - António Bonfilho da Luz (a retired Circunscrição secretary) – widower, and hisbrother - António Bonfilho da Luz Junior were also evacuated to Australia. His sister-in-law and two children were evacuated also – ie Ana Barreto Luz (“half-caste”) and children:"Simões/Sicao" (?) aged 13, Fernando Barreto da Luz (aged 3) – (husband, Arthur/Artur692,remained in Timor). All – except Patrício, were initially accommodated at Bob’s Farm687 See Carvalho, M. de Abreu Ferreira, Relatório …, op.cit., 1947, p.259, p.275, p.441, p.471, p.724, p.726,p.728. Not to be confused with the evacuee “Patrocinio Luiz” who was employed as a clerk in Melbournefrom mid-1944.688 For photographs of Patrício da Luz in Dili in 1941 as an “aeradio operator” see the Northern TerritoryLibrary’s PictureNT website ie photographs PH0195/0107 (with D. Laurie) and PH0195/0108 – both takenby I.R. Hodder.689 See NAA files: A981 TIM P11, p.117, p.134; A981 TIM P6; A981 TIM P20, p.64 – watch given to Luz.);A1838, 377/3/3/6 Part 1, pp.18-30, pp.34-36, pp.41-42, pp.71-72, pp.96-99, pp.117-120, p.134, pp.153-154;AWM 121402 – photo, Patrício da Luz in Dili 9 Dec 45; AWM 125274 – photo, Jap ship sunk, 22 Jan 46;A1838, TS377/3/3/2 Part 1, p.78 - Luz and Forsyth.; A1838, 377/1/2 Part 1, p.155 case of Luz - CS124 of 30December 1946.690 Powell, A., War by Stealth, 1996, op.cit., p.133.691 DCA Monthly Circular, “Patricio Jose da Luz”, No.90, February 1948, p.20.692 Artur da Luz was noted in an Australian listing of Portuguese and Timorese who had assisted theAustralian forces as: “useful” and possibly “killed by the Japs” ( NAA: A3269, D27/A, p.2) ANNEX A 50 (north of Newcastle) – but his father, António Bonfilho da Luz, later moved to Brookstead(Armidale). On 26 February 1943, Luz was registered as a Portuguese alien living at theEssendon Hotel, Melbourne. Patrício was employed at the DCA radio workshop inEssendon (on basis of his previous association with Hodder and Ross) – and also taughtmorse code to pilots. He was employed confidentially by “Allied H.Q. GeographicalSection” (ie by SRD, as for Lieutenant M. de J. Pires and Carlos Brandão – A3269, D4/G,p.182).693 Patrício sent half of his pay of ₤25 per month to his sister – Aurea da LuzCampos, who had also been evacuated (increased to ₤20 in July 1943 when Luz returned toPortuguese Timor). Luz was recruited for SRD’s OP LAGARTO to be led by LieutenantPires. On 19 May 1943, Lieutenant Pires and the two other OP LAGARTO members(Sergeant José Arranhado, Corporal Casimiro Paiva) travelled to Sydney for Z Special Unittraining (probably at Cowan Creek, Hawkesbury River) and later at SRD’s Z ExperimentalStation (Cairns) in June 1943 – with Luz reportedly remaining at SRD Headquarters atAirlie (Melbourne). The LAGARTO party assembled in Melbourne in mid-June for fourdays to be briefed on their tasks and “ciphery”. Luz “was given a short period of training onthe B I and ATR4A ((radio)) sets, together with instruction in cipher (LMT2).”694 Hesubsequently traveled with the LAGARTO party to Fremantle where they boarded the USsubmarine USS Gudgeon. The party was landed late on 1 July 1943 at the mouth of LucaRiver – with Luz as the party’s radio operator. During difficulties between Lieutenant Piresand AIF Sergeant/Lieutenant A.J. Ellwood (who joined LAGARTO in early August), Luzsupported Ellwood. The former Consul David Ross sent encouragement and best wishes toLuz - ie to improve morale, eg: “great work … all at Essendon very proud of you” - 9September 1943 (A3269, D4/C, p.314); and “Atta Boy” – 22 September 1943 (A3269,D4/C, p.307). On 29 September 1943, the LAGARTO group was attacked by Japanese andhostile natives near Point Bigono on the north coast, but Luz escaped (having left the groupa short time beforehand with Matos e Silva) – reportedly together with João Rebelo, RuyFernandes, Domingos Amaral, and Domingos Dilor. Luz reportedly had Lieutenant Pires’cipher material and papers. On 8 October 1943, the Japanese signaled SRD (through thecaptured Lieutenant Ellwood): “ABC lost cipher book, Luz ran away” - ie falsely, in orderto “cover” the Japanese deception activities (A3269, D4/C, p.144). According to Luz, heeluded Japanese and hostile Timorese and moved first to Cairui (south of Manatuto), thento the Dilor area – where he recovered wireless setsburied by LAGARTO (but the sets were inoperabledue to battery deterioration). Luz asserted that heraised a force in the Dilor, Luca, Bibileo and Viquequeareas of “1,500 natives organized for co-operation withthe hoped-for ((Allied)) invasion force” (A3269, O8/A,p.34A – includes the account written by Luz to theAustralian Consul in Dili on 30 January 1946). ((photograph not included))According to a later article in a DCA magazine, on29 September 1943 Luz: “shot his way out with a 693 Patrício da Luz was not included on the SRD personnel lists of 21 November 1944, 7 December 1944, 25March 1945, 7 April 1945, 6 June 1945 – nor in the Operation Groper Operation Order No. 25 “SRDPersonnel Missing in Timor” of 30 August 1945 (NAA: A3269, D26/A, p.15). However, his service isincluded in the SRD Official History ie The Official History … , Vol II – Operations, 1946, op.cit., p.34A(A3269, O8/A, p.48). The probable reason for his omission from SRD personnel lists was the SRD belief(false) – ie on the basis of a Japanese-controlled message from LAGARTO, that Luz had deserted theLAGARTO party.694 The Official History of the Operations and Administration of ‘Special Operations Australia’ (SOA) underthe cover-name of ‘Services Reconnaissance Department’, Volume III – Communications, Melbourne, 8March 1946, p.27 (NAA: A3269, O9, p.32). The LMT2 cipher process is described at pp.80-83. 51 ANNEX A 695 DCA Monthly Circular, No.90, Melbourne, February 1948, op.cit., p.20.696 Powell, A., War by Stealth, 1996, op.cit., p.132 and p.135 (footnote 38) - based on Powell’s interview ofPatrício da Luz in July 1991; and Turner, M., Telling …, 1992, op.cit., pp. 40-43.697 Smith’s Weekly, “Government’s Meanness Rouses Servicemen”, 14 September 1946, p.22 (NAA: A1838,377/3/3/6 Part 1, p.134).698 Quinton, N.F. Major, Dili, 2 July 1946 (NAA: A1838, 377/3/3/6 Part 1, p.154).699 DCA Monthly Circular, No.90, Melbourne, February 1948, op.cit., p.20.700 Australian Consulate - Dili, No.87, Dili, 15 October 1946 (NAA: A1838, 377/3/3/6 Part 1, pp.117-118).Luz reportedly passed the information to Australian workmen rebuilding the Consulate in Dili – who passedthe information to the journalist Douglas Lockwood.701 Luz, P. da., Dilli, 28 December 1946 (NAA: A1838, 377/3/3/6 Part 1, pp.71-72).702 Department of Army, SM 466, Melbourne, 21 May 1946 (NAA: A1838, 377/3/3/6 Part 1, pp.41-42). Seealso pp.88-89 for the Department of Army, 77508, Melbourne, 12 November 1946.703 Australian Consulate – Dili, No.92, Dili, 14 July 1947 – with Luz’ “precis” statement dated 12 July 1947(NAA: A1838, 377/3/3/6 Part 1, pp.34-36). Luz referred to a “full report” that he had submitted in January1946. ANNEX A 52 Portuguese Timor (see photograph – Turner, M., Telling …, 1992, op.cit., p.vii). In 1946-1947, he assisted the Marconi engineer R. Marsden with the erection of several powerfultransmitters for the Government and was appointed in charge of the aero-radio station to belocated at Baucau airfield. His wife - “Linda”, joined him in Baucau. In October 1947, hiswages claim was settled when he was paid ₤450 (ie 5,625 patacas) by the AustralianGovernment.704 In mid-1949, Luz sought the award of WWII campaign medals from the BritishWar Office – but was advised: “with regret that your employment by Special OperationsExecutive is not a qualification for any British Campaign Stars or Medals instituted duringthe 1939-45 War.”705 In 1950, Luz was presented with a certificate stating that he had been“employed by the Australian Government on Special Operations.”706 He continued servicewith Post and Telegraph in Dili (BOdT No.10, 10 April 1954, p.164). Luz subsequentlyemigrated to Australia – and was the Portuguese Consul in Darwin (1956-1974), beforemoving to Canley Vale (Sydney) in the mid-1970s. According to a magazine article, he wasreportedly awarded several Commonwealth WWII medals including: “the Pacific Star,1939-1945 Star, War Medal, and the Australian Service Medal” in 1986.707 – but theAustralian Department of Defence has no record of such.708 Luz was awarded thePortuguese decoration “Medalha de Honra de Liberatação” in June 1989 by thePortuguese Government.709 He was a member of the Returned Soldiers’ League (RSL) inAustralia and attended several ANZAC Day ceremonies and Z Special Unit reunionactivities.710 His wife (Deolinda) predeceased him. Patrício da Luz died in Sydney on 12April 1998 – and was survived by his son, Patrício.711 704 Australian Consulate – Dili, Memorandum No.126, Dili, 4 October 1947 (A1838, 377/3/3/6 Part 1, p.26).He received “a grant of ₤400 from the Australian Government as an expression of appreciation for theservices rendered by him.” - DCA Monthly Circular, No.90, February 1948, op.cit., p.20.705 The War Office, HM/1645/48 AG4 (Medals), Droitwich, 12 August 1949 (NAA: A1838, 377/3/3/6 Part 1,p.18).706’s letter provided the “Special Operations”certificate to the Department of External Affairs for on-forwarding to Luz.707 ses medalhas de honra”,Sydney, 20 September 1988, p.3. Photographs of Luz wearing Commonwealth WWII medals on Anzac Daycan be found in Turner, M., Telling …, 1992, op.cit; at p.3 in Correio Português, “Herói …, 20 September 1988,op.cit; and at p.5 in O Português na Austrália, “Anzac Day”, Sydney, 1 May 1991. He is also shown wearingCommonwealth WWII medals at p.41 in Cunha, L., “Timor: a Guerra Esquida”, Macau, II Serie No.45,Macau, Janeiro 96; in Correio Português, Herói da II Guerra Mundial – Luso-timorense condecorado peloEstado português”, Sydney, 7 November 1989, p.1; and at p.3 in O Português na Austrália, Cantinho Social,Sydney, 8 August 1990.708 Department of Defence correspondence to the author – dated 4 and 5 May 2009. In response to asubmission by the author in late July 2009, the Australian Parliamentary Secretary for Defence Supportresponded that while “there is no denying the valuable contribution made by Portuguese Timorese whosupported Australian military operations during World War II, as foreign nationals they do not qualify for thesuite of campaign stars and medals that were issued to Australian veterans.” - MINREP 103231 –ASPSS/OUT/2009/582, Canberra, 23 September 2009.709 Correio Português, Herói da II Guerra Mundial – Luso-timorense condecorado pelo Estado português”,Sydney, 7 November 1989, p.1. Luz also wore Commonwealth WWII medals, a commemorative USsubmarine badge, an RSL badge, and a Z Special Unit badge.710 See Turner, M., Telling …, 1992, op.cit., p.vii. O Português na Austrália, “Anzac Day”, Sydney, 1 May1991, p.5 – and as cited in footnotes above.711 See also Turner, M., Telling …, 1992, op.cit., pp.6-7, pp.40-43, pp.57-59, and photos at p.vii. 53 ANNEX A Paulo da Silva – Timorese. Native chief of Ossu Rua – with the honorific “Dom” Paulo.Paulo was “closely affiliated with LIZARD”, and Paulo was “indispensable until the Japsoverwhelmed southern São Domingos Province in November-December” ((1942)). Pauloda Silva’s “inestimable assistance” is cited in The Official History – eg in providingtransport support, “adherents” for military training, “native OPs”, and “gainingintelligence” through his extensive “family connections”.712 However, his native followinghad reportedly become ineffective after 21 January 1943 due to the defection to theJapanese of Joachim of Ossu in December 1942. His wife (Cipriana) and ten dependantswere evacuated from the south coast to Australia on 8/9 December 1942 (A3269, D6/A,p.52). Harassed by Japanese forces and hostile natives, OP LIZARD forces disbanded on20 January 1943. Paulo was evacuated to Australia on the US submarine USS Gudgeonwith Lieutenant Pires, Paulo’s brother Francisco, his cousin Cosme Soares, DomingosSoares, Sancho da Silva - and others, on 10 February 1943 from the mouth of the DilorRiver. Paulo and his party were initially in Melbourne with Lieutenant Pires713 for severalweeks before moving to Bob’s Farm (Newcastle area) in March 1943 ie the “cincoindígenas” ex-Gudgeon (Cardoso, 2007, p.175). Paulo and his “group” (total: 5) requestedto return to Portuguese Timor to fight the Japanese (A3269, D3/G, pp.30-31). TheSecretary of the Department of the Interior wrote that Paulo wants to return “a rather finetype … worrying concerning his absence from his own people” – 30 August 1943 (A3269,D3/G, p.34). On 8 September 1943, SRD signaled LAGARTO in Portuguese Timor that“Paulo group very anxious to return”.714 Paulo trained at FCS with his group in the periodOctober-November 1943.715 Paulo – and most of his group, became part of SRD’s OPCOBRA led by Lieutenant J.R. Cashman. The OP COBRA party was landed in PortugueseTimor on 27 January 1944 by RAN Fairmile vessel ML 814 in Darabei area – but theoperation had already been compromised by LAGARTO. The two Australians (LieutenantJ.R. Cashman, Sergeant E.L. Liversidge) and Cosme Soares were captured that night in awaiting Japanese ambush – Paulo da Silva and Sancho da Silva were captured 12-14 dayslater. The group was initially imprisoned and interrogated in Dili. Paulo da Silva died ofberi-beri on 19 May 1944 at Lautem – following an “anti-beri beri” injection by hisJapanese captors (witnessed by Sancho da Silva).716 Paulo’s SRD rate of pay in November1944 was 11/6 per day (ie an Australian Sergeant’s rate). On 12 February 1945, he wasreported by SRD to Portuguese Consul Laborinho as “employed in semi-Army work”.Paulo da Silva was declared as a “Sergeant” in the “AMF” in the AAF A119 (CasualtyReport) completed by Captain A.J. Ellwood – 4 October 1945 (A3269, V17, p.147). Pauloda Silva was reported as having “died in prison” - Carvalho, J. dos Santos, Vida e Morte…, 1972, op.cit., p.132. 712 The Official History … , Vol II – Operations, 1946, op.cit., p.15 (NAA: A3269, O8/A, p.28).713 After extraction, Paulo remained in Melbourne for several weeks with Lieutenant Pires. Several monthslater, SRD noted that Lieutenant Pires (then leading LAGARTO in Timor) was critical of Paulo da Silva –claiming that Paulo had “no prestige or importance in Matabia or Baucau area”, preferring Paulo’s brotherManuel. SRD however was skeptical of Pires’ views (NAA: A3269, D3/G, pp.30-31).714 “We suggest you might use them as advanced recce in eastern Sao Domingos say at Matabea. Our opiniontheir offer warrants serious consideration and not be lightly discarded in view your difficult situation” –NAA: A3269, D4/C, p.311.715 His SRD wages payments were made into an account at the Bank of Adelaide (267 Collins St, Melbourne)– from April 1944 allocated to the “H.B. Manderson, Account16 See AAF A.119 statement in Ellwood, A.J., Operational Report on Lagarto, October 45 (NAA: A3269,V17, p.147). ANNEX A 54 Paulo Soares (“O Paulino”) – Portuguese, born on 25 December 1900 in Lisbon. Single .Stevedore/Estivador/Civil construction operator. Imprisoned on 13 June 1926. Deportado –arrived in Dili on 25 September 1927 (Cardoso, 2007, p.241). Evacuated from Barique on 3August 1943 by RAN ML, and arrived in Darwin on 5 August 1943. Claimed to haveserved with the Australian forces’ “Section I” for 10 months under Captain Ball (ie as alsoclaimed by Bernardino Dias). Lieutenant Pires (OP LAGARTO) advised SRD that“Soares” was one of 14 “very bad men” and should be segregated – ie not go to Bob’sFarm (signal of 6 August 1943), but Paulo was not interned at Gaythorne with othersnamed by Pires – rather, Porfírio Carlos Soares appears to have been interned in error ie “inlieu”. Paulo Soares arrived at Bob’s Farm (Newcastle) on 11 September 1943.Subsequently, he was interned in the Liverpool Internment Camp (Sydney) on 23September 1943 – as Internee “N1770” (MP1103/1, N1170 – but as Paolo [sic] Soares).Paulo was released to Minimbah (Singleton) on 20 March 1944 (aged 43) with “restrictedresidence” (A373, 3685C, p.34). He departed from Newcastle as scheduled on the SSAngola on 27 November 1945.717 Q545). He was then moved to Sydney in mid-September and interned at the LiverpoolInternment Camp, and later moved to the Tatura Internment camp (Victoria) in early April1944. His case however, was supported by António de Sousa Santos – the Administrator ofFronteira, who wrote directly to the Department of Army in May 1944 (to the annoyance ofConsul Laborinho at such “interference” - A1838, 377/3/3/6 Part 1, p.190). On 30 May1944, the Army wrote that Porfírio Soares had been “wrongly linked with others” and had“rendered valuable service to Australian forces.”721 Consequently, the Director General ofSecurity released Porfírio Soares on 13 June 1944 to fixed residence in Melbourne – notingthat Porfírio “should never have been interned". Porfírio Soares reportedly had a job at theMoldex enterprise in Burwood (Sydney) in mid-1944 at a weekly wage of ₤5.10.0(MP742/1, 115/1/45). From mid-1944, Porfírio Soares was intended as a member of SRD’sOP STARLING to be led by Sousa Santos into the western area of Portuguese Timor. On30 October 1944, the Victorian Department of Labour was paying living allowance toSoares. He trained for OP STARLING at FCS in the period March-April 1945 – and waspaid one pound (₤1) per week (with Francisco Horta, Robalo and Rente). However OPSTARLING was cancelled on 19 April 1945. Porfírio Soares was also intended for the“replacement” OP SUNDOG, but did not participate. He was noted as having “assistedAllied Forces” – in the 3 November 1945 list (A1838, 377/3/3/6 Part 1, p.185 – see AnnexE). Porfírio Soares departed from Newcastle as scheduled on 27 November 1945 on the SSAngola, aged 38 – single, as an “active functionary”. Rufino Alves Correira/Correia – Timorese, born in Bazar Tete in about 1934. A criadofor Lieutenant Tom Nisbet of the 2/2 Independent Company from early 1942 (Lambert,G.E., Commando …, op.cit., 1997).723 A “Rufino” is noted in a LIZARD III report as amember of “João Vieira’s party” (A3269, D27/A, p.2). For a 2005 photograph, see AWMP05096.001. Together with two other wartime criados (Armindo Monteiro, ManuelXimenes), Rufino Correira attended ANZAC Day activities in Australia in April 2006.Rufino Correira was awarded a medal by the Government of Timor-Leste in Dili on 30August 2009. Ruy Fernandes – Timorese. Joined OP LAGARTO under Lieutenant M.J. Pires in earlyJuly 1943. He reportedly escaped from the Japanese attack on LAGARTO near Point 721 CGS, MIS920, Melbourne, 30 May 1944 (NAA: MP742/1, 115/1/245).722 See Turner, M., Telling …, 1992, op.cit., pp.54-55 and Noronha, C., letter to author, 12 May 2009.723 “Recollections of a Criado” – interviews with Rufino Correira can be found on the website of Friends ofSuai ie . ANNEX A 56 Bigono on 29 September 1943. The SRD Official History states: “killed by rifle fire duringflight (NAA: A3269, O8/A, p.34A). Sancho da Silva – Timorese, born in 1923 - of Ossu Rua. Scout and guide with OPLIZARD724. Evacuated to Australia as a member of the Dom Paulo group on 10 February1943 on the US submarine USS Gudgeon (with Lieutenant M. de J. Pires) from the mouthof the Dilor River (to Fremantle – arriving 18 February). With the Dom Paulo group inMelbourne with Lieutenant Pires for several weeks before moving to Bob’s Farm(Newcastle area) in March 1943 - ie with the “cinco indígenas” ex-Gudgeon (Cardoso -2007, p.175). He trained at FCS in October-November 1943. A member of the SRD OPCOBRA group inserted on 27 January 1944 by RAN Fairmile ML 814 in Darabei area.Compromised by LAGARTO, the two Australians (Lieutenant J.R. Cashman, SergeantE.L. Liversidge) and Cosme Soares were captured that night in a Japanese ambush. Sanchoda Silva and Paulo da Silva escaped, but were captured 12-14 days later. He wasimprisoned by the Japanese military in Dili, in Lautem (August-September 1944), and atDili/Tibar. Sancho da Silva’s rate of pay in November 1944 was 11/6 per day (ie aAustralian sergeant’s pay rate).725 On 12 February 1945, he was declared by SRD toPortuguese Consul Laborinho as “employed in semi-Army work”. Sancho da Silvasurvived Japanese captivity. He was evacuated by the Japanese to Flores on 5 September1945726, to Sumbawa on 15 September 1945, to East Java (arrived 23 September 45), toBali on 24 September 45, was recovered and taken to Singapore on 3 October 1945. Hewas returned to Australia and debriefed by Captain A.J. Ellwood (OP LAGARTO) on thefates of SRD personnel in Timor - and was declared as a “Sergeant” in the attached AAFA119 (Casualty Report) of 4 October 1945.727 In Sydney on 19 October 1945, he received₤150 in “back pay” and, at Armidale on 31 October 1945, he withdrew his bank funds.Sancho da Silva returned to Portuguese Timor in 1946 and lived in his home area at OssuWagia. He gave statements to the post-War war crimes investigation (MP742/1,336/1/1724; AWM54, 1010/4/40). He married Laurentina da Costa in 1946. During theIndonesian occupation, Sancho da Silva was a member of the anti-Indonesian Resistancemovement in the period 1975-1977. In 1977, he was captured by Indonesian forces andimprisoned for three months at Ossu. In 1988, he sought compensation from the AustralianGovernment (through the retired former SRD Lieutenant Frank Holland - and subsequentcorrespondence with Warren Truss, MP and the Department of Veterans’ Affairs). Sanchoda Silva died in Viqueque on 27 March 1997 (aged 74). His apparently unresolvedcompensation case was re-raised with the Department of Veterans’ Affairs (DVA) byBrigadier (Retd) E.P. Chamberlain in July 2007. The Minister for DVA stated that daSilva’s earlier file had not been retained, and its outcome was unclear. Subsequently, aformal pension/compensation claim for Sra. Laurentina (Sancho’s da Silva’s widow) wassubmitted to DVA on 30 October 2008 (Claim NX347528). As at mid-January 2010, adecision had yet to be made on the submission. 724 Stone, P. (ed), El Tigre …, op.cit., pp.140-142 related Sancho da Silva’s activities in early February 1943 -including recovering a hidden wireless set for the SRD LIZARD III party. Sancho is mentioned as a criado -Brandão, C.C., Funo …, 1953, op.cit., p.165.725 His SRD wage payments were made into an account at the Bank of Adelaide (267 Collins St, Melbourne)– from April 1944 allocated to “H.B. Manderson, Account26 The Japanese did not intend evacuating Sancho da Silva – the only non-Australian SRD POW, as an AlliedPOW until fellow POW Captain J.R. Cashman (Sancho’s COBRA party commander) intervened.727 Ellwood, A.J., Operational Report on Lagarto, October 45 (NAA: A3269, V17, p.146-149). 57 ANNEX A Vasco Marie Marçal – Mestiço. Born on 13 October 1909 in Hankow (China). A formercriminal - sentenced in Macau for killing a girl in Shanghai, imprisoned in PortugueseTimor. Resident of Dili. Interpreted for Sparrow Force in the countryside – and reportedlyshot buffalo for the Force (MP742/1, 115/1/245). Evacuated to Australia and resident atBob’s Farm - in charge of Mess 2. He was involved in a dispute with Américo Rente andthe deportado group at Bob’s Farm on 27 April 1943 – and sought protection from theauthorities (A373, 3685A). He departed from Newcastle as scheduled on the SS Angola on27 November 1945 – included on List IV among deportados e condenados (criminals) –NAA: A367, C63656. Veríssimo José Morato – Mestiço (possibly an aspirante in the Treasury in Dili, 12 July41). Evacuated to Australia. Employed by SRD at FCS in early September 1944. His rateof pay in October 1944 at FCS (as a trainee) was 6/- per day. Reverted from operationaltrainee to GD in October 1944. At Milton (Brisbane) in late October 1944. At FELO(Brisbane) on 21 November 1944 and 7 December 1944. On 12 February 1945, he wasdeclared by SRD to Portuguese Consul Laborinho as “employed in semi-Army work”. AtPeak Hill in March-June 1945. He departed from Newcastle as scheduled on the SS Angolaon 27 November 1945 – with his wife. 728 See Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.441-442, p.471, p.735.ANNEX A 58 1 ANNEX D SummaryRecords indicate that at the beginning of WWII, there were about 90 deportados inPortuguese Timor. 45 “Deportados e Condenados” (criminals)729 appear to have beenevacuated to Australia – 44 are listed below. Of these, 22 were interned. Six internees werenot deportados ie: Sergeant António Lourenço Martins, Sergeant José FranciscoArranhado, Corporal Casimiro Augusto Paiva, Corporal Álvaro Martins Meira, FranciscoBatista Pires and Corporal Porfírio Carlos Soares. -------------------------------------------------------------- Alfredo dos Santos - Portuguese, b. 1899. Arrived in Dili on 25 September 1927 (Cardoso,2007, p.237). Fought against Japanese with 2/2 Independent Company - injured. Residentat Narrabri. Not interned in Australia. Alfredo Pereira Vaz - Portuguese, b. 1905. Arrested in 1925 (Guinea) – anarchist. Arrivedin Dili on 25 September 1927 (Cardoso, 2007, p.237). Reportedly fought the Japanese witha group of 12 Australians (together with João Gomes, Abel da Silva) - 3 L of C Report,February 1943 (NAA: MP742/1, 115/1/245). Not interned in Australia. Resided at Bob’sFarm and Narrabri. *Amadeu Carlos das Neves - Portuguese, b. 11 March 1900 in Lisbon. Arrived in Dili on25 September 1927 (Cardoso, 2007, p.237). Reportedly an electrician. Interned atLiverpool on 23 September 1943 – as N1765. On release, resided at Singleton. 729 In correspondence to the Department of External Affairs, the Director General of Security listed the 22deportados who had been interned and noted: “It is believed that a number of the large body of evacuees notinterned was also deported to Timor by the Portuguese Government for criminal offences and politicalactivities, but details are not at the moment available.” – Director General of Security, 4940/89, Canberra, 21November 1944 (NAA: A989, 1944/731/1, p.31). Portuguese Consul Laborinho stated “… of 45 deporteeswho were evacuated to Australia, 22 were interned by the Australian authorities.” - Daily Telegraph, “Dilli asspy centre”, Sydney, 26 November 1944 (NAA: A1838, 376/1/1, p.283). 45 “Deportados e Condenados”were listed as scheduled to depart Newcastle on the SS Angola on 27 November 1945 on List VI (NAA:A367, C63656, pp.19-23). The condenados on List VI are probably: Vasco Marçal, Lau Fang and Tong Tai(female).ANNEX D 2 António Augusto – Portuguese, b. 1897. Date of arrival in Dili not known (Cardoso, 2007,p.258). Not interned in Australia. Resided at Bob’s Farm and Narrabri. Departed Newcastleon the SS Angola on 27 November 1945 with his Timorese wife and young son. António G. Cachaço – Portuguese. Date of arrival in Dili not known. Not interned inAustralia. Resident at Bob’s Farm - “not considered liable to cause trouble in Camp.” – 30April 1943 (A373, 3685C). Died in Australia (Cardoso, 2007, p.258). *Augusto César dos Santos (Ferreira) – Portuguese, b. 1 January 1887 in Oerias. Date ofarrival in Dili not known (Cardoso, 2007, p.258). Interned at Liverpool – as N1769.Reportedly employed by SRD – however, this was more probably his teenage son ieAugusto César dos Santos Ferreira (Junior). Later resided at Narrabri West. Carlos Henrique/s Dias. – Portuguese. Date of arrival in Dili not known (Cardoso, 2007,p.258). Not interned in Australia. Employed by SRD. Departed Newcastle on the SSAngola on 27 November 1945, aged 26. Francisco Q. Palmeira – Portuguese, born in Lisbon. Date of arrival in Dili not known(Cardoso, 2007, p.258). Fought Japanese with 2/2 Independent Company. Resident atNarrabri. Not interned in Australia. Departed Newcastle on the SS Angola on 27 November1945 - aged 37, with his wife and young son. João Gomes – Portuguese, b.1903. Arrived in Dili on 25 September 1927 (Cardoso, 2007,p.239). Builder’s supervisor. Reportedly fought the Japanese with a group of 12 Australians(together with Alfredo Vaz, Abel Silva) - 3 L of C Report, February 1943 (NAA: MP742/1,115/1/245). Not interned in Australia. Resided at Bob’s Farm - “not considered liable tocause trouble in Camp.” – 30 April 1943 (A373, 3685C). Later at Narrabri. DepartedNewcastle on the SS Angola on 27 November 1945. João Gomes Moreira Junior - Portuguese, born 1899. Arrived in Dili on 21 October 1931(Cardoso, 2007, p.245). Not interned in Australia. Resided at Bob’s Farm - “not consideredliable to cause trouble in Camp.” – 30 April 1943 (A373, 3685C). Later, resided inNewcastle. Joaquim dos Santos – Portuguese, shoemaker. Not interned in Australia. Resided at Bob’sFarm and Armidale.730 Departed Newcastle on the SS Angola on 27 November 1945 –aged 59, with his wife and two sons. 730 Not listed in Cardoso, 2007, op.cit. - but included in “Deportees” listed in an attachment to DirectorGeneral of Security, “Portuguese Evacuees from Timor”, Canberra, 10 August 1944 (NAA: A989,1944/731/1, p.39). He is also included on List IV ie “Deportados e Condenados” scheduled to departNewcastle on the SS Angola on 27 November 1945 (NAA: A367, C63656, pp.19-23).ANNEX D 4 José Maria – Portuguese. Date of arrival in Dili not known – evacuated to Australia on 18December 1942 (Cardoso, 2007, p.259). Not interned in Australia. Not listed among the“Deportados e Condenados” scheduled to depart Newcastle on the SS Angola on 27November 1945 (NAA: A367, C63656, pp.19-23). Manuel Ferreira – Portuguese. Date of arrival in Dili not known (Cardoso, 2007, p.259).Baker (Padeiro). Not interned in Australia. Resided at Bob’s Farm - “not considered liableto cause trouble in Camp.” – 30 April 1943 (A373, 3685C). Later at Narrabri. “ManuelPereira” – a deportado, departed Newcastle on the SS Angola on 27 November 1945. Paulo Ferreira – Portuguese, b. 1890. Arrived in Dili on 21 October 1931 (Cardoso, 2007,p.246). Carpenter. Not interned in Australia. Resided at Bob’s Farm - “not consideredliable to cause trouble in Camp.” – 30 April 1943 (A373, 3685C). Later, resided atNarrabri. Departed Newcastle on the SS Angola on 27 November 1945. DAVID ROSS David Ross was born in Melbourne on 15 March 1902. He joined the RoyalAustralian Navy (RAN) in 1915, and following WWI served for several years in the UnitedKingdom (1921-1924).731 In 1925, he undertook pilot training, and in February 1927transferred to the Royal Australian Air Force (RAAF). He transferred to the Civil AviationBranch of the Department of Defence in 1931. In December 1940, David Ross visited Portuguese Timor as a member of anAustralian civil aviation team to prepare for the commencement of Qantas flying boatservices that would transit Dili – and to report on Japanese infiltration, including theirplanned Palau-Dili air service.732 On 24 January 1941, the Department of Civil Aviation(DCA) proposed Ross to the Department of External Affairs as “the Australianrepresentative in Dili”.733 In mid-February 1941, the Australian War Cabinet directed thatRoss – then DCA’s Chief Flying Inspector, be appointed as Australia’s “Civil AviationRepresentative at Dilli” – noting his appointment was “ostensibly as the Civil Aviationrepresentative” - but in addition was “to report to the Australian Government onIntelligence questions and on the commercial opportunities offering in that area.”734Australia had wished to appoint Ross as an official representative of the Commonwealth,but the Portuguese responded on 19 March 1941 that they “preferred that the officialappointed should pass for a technical expert connected with the air service in order not toarouse the suspicions of the Japanese.”735 David Ross arrived in Dili on 13 April 1941 to replace D.D. Laurie, the Qantasstation superintendent.736 He “recruited” Patrício José da Luz (radio operator at the Dili postoffice) in April 1941 who provided Ross with special access to communications, includingJapanese messages.737 Ross regularly provided reports on political and militarydevelopments to Australia – as well as covering commercial aspects such as oil, coffee,cotton and manganese. In late October 1941, Ross was appointed by London as “His Majesty’s Consul –Dilli” – “under the orders of the Commonwealth of Australia.”738 Ross facilitated the entryof Australian and Dutch troops into Portuguese Timor on 17 December 1941. On 19/20February 1942, Japanese forces landed in Dili, and Ross remained at his post. The Japaneseallowed him to travel into the countryside to meet with Australian forces in attempts tosecure their surrender.739 On a second visit to Sparrow Force in late June 1942, he elected 731 Ross’ RAN personnel file is NAA: A6769, ROSS D; his RAAF file is NAA: A9300, ROSS D.732 The 63-page report of the visit is at NAA: A816, 19/301/778.733 Department of Civil Aviation, 38/101/267, Melbourne, 24 January 1941 (NAA: A981, AUS 248, pp.169-170). DCA’s letter included a short biography and recommendation on Ross.734 War Cabinet Minute 782, Sydney, 12 February 1941 (NAA: A2676, 782, p.3). For background papers onthe appointment see also NAA: A816, 19/301/822 File II.735 Cabinet Agendum 561 of 25 January 1941 (NAA: A981 TIM P 4 Part 2, p.74).736 Ross’ first report relates his cordial acceptance by the Governor of Portuguese Timor, and Ross’ advicethat “it was abundantly clear that he was doing his utmost, and would continue to do everything in his power,to prevent any Japanese penetration.” - Ross, D., Dili, 28 April 1941 (NAA: TIM P 6, pp.60-64).737 Ibid., p.60 and subsequent reports including his report of 8 June 1941, p.2 (NAA: A981, TRAD 105,p.60).738 Foreign Office, London, 23 October 1941 (NAA: A2937, 266, p.4). Following advice from Lisbon, theGovernor accepted Ross’ appointment on 12 December 1941.ANNEX F 2 representative stationed in Dili, Portuguese Timor - in which position Whittaker would, “inthe guise of a civilian, be able to discharge the Naval Intelligence duties required of him …it is not proposed that the Governor of Portuguese Timor be made cognisant [sic] of it, atleast at this stage …”.746 In April 1941, Whittaker was appointed by Navy Office to Dili asan “Admiralty Reporting Officer under the world-wide Naval Intelligence Organisation”747– with the cover as Ross’ “civilian clerk” Navy Office noted that Whittaker “has hadmany years of experience in the Malay Archipelago and is well versed in the Malay tongueas spoken in the coastal areas in the Netherlands East Indies and Timor (both Dutch andPortuguese Timor).” Whittaker arrived in Dili on 10 June 1941. A few weeks after his arrival, Whittakerreported to Navy Office on a “pro-British organisation” in Dili – listing 19 “leaders.”748Navy reported that the group planned “to seize power if Germany occupies Portugal - whilethere is a sufficient number of unreliable personalities in the community to suspect a pro-Japanese group equally determined to attain power.” Whittaker’s principal source for suchpolitical intelligence was the deportado solicitor João Gomes Moreira Junior. He alsodeveloped sources of information in Dili’s “Arab” community. After their landing in Dili on 17 December 1941, Whittaker worked closely with theAustralian forces. However, according to Ross, Whittaker’sintelligence role was “compromised” due his association with themilitary – “nothing more than a known spy in a neutral country.”749Whittaker was evacuated from Timor in February 1942 before the Japanese landing on 19/20 February, and later served in India fromMarch 1944. He continued to serve in the RAN until November ((photograph omitted))1945. In October 1950, he re-enlisted in the RAN as a Lieutenant –and reached the rank of Lieutenant Commander in June 1953.He resigned on 14 October 1953 - ie released to the Department ofExternal Affairs to serve as the Australian Consul in Dili(1953 -1959)750. In mid-1960, he reportedly sought to visit Dili – F. Whittaker 751and also to be appointed Portuguese Vice-Consul in Darwin. Dili 1942He died on 2 July 1962. 746 Secretary of the Navy, 018820, Melbourne, 28 April 1941 (NAA: B6121, 114G).747 Ibid. Lieutenant Logan of the Royal Navy Reserve had been sent to Dili in October 1939 as the first underthe “world-wide Naval Intelligence Organisation” system in NEI and Portuguese Timor but the post wasterminated in December 1939.748 Secretary - Navy Office, 037703 - “Portuguese Timor”, Melbourne, 14 August 1941 (NAA: A816.19/301/803, pp.6-20). Navy Office had earlier informed the Department of External Affairs vide Director ofNaval Intelligence, N.I.D. 485/IIB, Melbourne, 11 July 41 (A981, TIM P 11, pp.106-108 – see also A6779,A19, pp.43-44).749 NAA: A981, AUS 248, p.49750 For Whittaker’s service as the Australian Consul in Dili, see Chamberlain, E., Faltering Steps:Independence Movements in East Timor – 1940s to the early 1970s, Point Lonsdale, 2008; and Chamberlain,E., Rebellion, Defeat and Exile – the 1959 Uprising in East Timor, Point Lonsdale, 2009.751 Australian Consulate – Dili, Saving 42, 17 August 1960 (A1838, 3038/10/6 Part 1). The Governor ofPortuguese Timor reportedly stated that Whittaker “had long demonstrated he was no friend of the Portugueseand it would be better, therefore, if he stayed away. … The Governor is particularly annoyed with Whittakerover his current efforts to get himself appointed Portuguese Vice-Consul at Darwin in the course of which itappears to have been trying to destroy the reputation of the Consul designate, one P. da Luz, a Portugueseemployee of the Department of Civil Aviation.”ANNEX F 4 “He was a man who held, and aroused in others, strong feelings.”752 Pre-WWII Employment753 In the period 1904-1911, he was employed as a newspaper reporter at The Age(Melbourne). Manderson visited London for the Coronation in 1912-1913, and thentravelled to India, Tibet and Afghanistan reporting for the London “Daily Chronicle”. InAugust 1913, he married a US citizen in New York (Fay M. Albright); and visited westcoast of South America, Columbia, Ecuador, and Peru on “publication work”. In 1914, hewas employed as the Manager/Editor of the Buenos Aires “Herald”, until returning to NewYork in 1915. In 1916, he was in Cuba. He returned to Australia in 1917 and compiled andpublished the “Anzac Memorial”.754 In May 1918, he published another WWI work:“Complete War Map of Western Europe and Australian Fighting Fronts”. In 1919,Manderson spent four months in Dili (Portuguese Timor) as the representative for theEngland-Australia Aerial Survey.755 The following year,1920, he was in Portuguese Timoras the representative of the Timor Development Company – engaged principally in thecoffee trade. In the period 1922-1926, Manderson made frequent visits to PortugueseTimor in connection with oil and coffee commerce and was an advisor for the TimorPetroleum Company.756 Returning to Australia, in the period 1927-1934 he was anadvertising contractor to Melbourne Tramways. In 1936-1937, Manderson was employedas an assistant to Professor Kerr-Grant in developing the BOTH cardiograph (in Adelaide).In 1938, he was the proprietor of the Tramways Advertising Company. WWII In July 1940, living in Hawthorn (Melbourne), Manderson sought employment withSir Keith Murdoch, the Director General of the Department of Information and theproprietor of The Herald newspaper - citing his mapping and photography experience andskills.757 In October 1941, Navy Office (Melbourne) proposed Manderson as the Consul inDili to the Secretary of the Department of External Affairs – ie rather than appoint DavidRoss. Manderson was described as a “widely travelled free-lance journalist, cartographerand agent … speaks Portuguese and Tamut [sic - ie Tetum] and has visited PortugueseTimor on numerous occasions during the period 1919-1927. … He suffers from one 752 Powell, A., War by Stealth - Australians and the Allied Intelligence Bureau 1942-1945, MelbourneUniversity Press, Melbourne, 1996, op.cit., p.134.753 Most of this early information is drawn from a brief biography attached to a Navy Office letter – seefootnote 28 below (NAA: A981, AUS 248, p.80).754 Manderson, H.B. (Editor-in-chief), The All-Australian Memorial : a historical record of national effortduring the Great War : Australia's roll of honour, 1914-1916, Melbourne, 1917.755 The Northern Territory Times and Gazette – “Darwin to be Australia’s Aerial Gateway”, 14 June 1919,cites Manderson as the 2ic of the Aerial Survey party and its “recorder”; a former journalist of The Age,special correspondent for the London Daily Chronicle in India for the Coronation Durbar, and havingtravelled in the East and extensively in North and South America. The Northern Territory Times and Gazette– “Flying to Australia”, 28 June 1919 - noted Manderson as a principal of the Aerial Survey. The NorthernTerritory Times and Gazette, 13 September 1919 - reported Manderson as having surveyed the Malay areaand as an “expert” in an article: “The Island of Timor” – Manderson was also reported as a “noted amateurconjurer”.756 The Argus, Melbourne, 9 October 1925 - reported Manderson as the representative of the Timor PetroleumCompany of Melbourne who had escorted 119 drums of oil to Melbourne.757 Manderson, H.B., Melbourne, 10 July 1940 (NAA: SP112/1, 351/1/8). 5 ANNEX F Manderson visited FCS and SRD facilities in Darwin several times. In November1943 while at FCS, he wrote a document768 suggesting the establishment of an“underground movement” in Portuguese Timor – to be termed: “Filhos do Timor” (“Sonsof Timor”). Later that month when at LMS, to “build up the spirit of the Timorese”, he“instituted” an underground movement styled “TIEIA TIMOR” or the “Timor Network”planned to be “the operating section of a national resistance organization to be called“Filhos de Timor” (“Sons of Timor”).769 However, it appears that this plan later foundered. In mid-1944, SRD was re-organised with its field operations coming under Nordops(ie Northern Operations – that included Timor from August 1944) and Westops (WesternOperations).770 In June 1944, Manderson moved from SRD’s Timor Section and “tookcharge of Reproduction Section”771 in the Technical Directorate and was involved inproducing maps and the continued counterfeiting of Portuguese Timor currency – amongother currencies. Manderson also translated and corrected Portuguese propaganda materialfor FELO. From late December 1944, following a major re-organisation of SRD, operations inTimor were directed from Group D located in Darwin. It appears that not all Timor Sectionfiles were passed to Darwin772, and Manderson appears to have continued as an advisor onoperations in Portuguese Timor.773 SRD parties were regularly supplied with trade goodsand “trinkets” to be given to Timorese villagers. In April 1945, FELO developed standard“Timor Goodwill Packs” that contained a few basic medical supplies and quinine tablets -and Manderson provided advice at a FELO-sponsored planning meeting.774 Manderson left SRD at the end of August 1945 – ie “signed off” on 31 August(NAA: A10797, A TO K). Post-War In the period 22-25 September 1945, Manderson was the assistant to the PoliticalAdvisor (W.G. Forsyth) to the Australian Force Commander TIMFORCE (BrigadierL.G.H. Dyke) for the surrender of Japanese forces in Timor. Forsyth wrote a letter ofcommendation for Manderson’s work citing “Manderson’s intimate local knowledge andresourcefulness” as an “indispensable factor in the success of the mission.”775 In October1945, Manderson wrote a brief on Australian military equipment in the “undercoverpossession of Timorese natives” and the inclusion of Portuguese Timor in Australia’s“Defensive Island Screen”.776768 SRD – 450, 9/J, Brisbane, 19 November 1943, p.2 (NAA: A3269, D/3G, p.29).769 Manderson, H.B., 10 December 1943 (AWM, PR91/101).770 The head of Nordops - Major A. Trappes-Lomex, was reportedly critical of Manderson – Powell, A., Warby Stealth …, 1996, op.cit., p.134.771 The Official History …, Vol I - Organisation, 1946, op.cit., p.75 (NAA: A3269, O7/A, p.128). “CaptainD. Dexter assumed duties of D/A ((ie Timor Section)) vice Mr Manderson. Manderson remained as advisoron D/A’s area in addition to his present duties under D/Tech.” – SRD, 265/D/15, Melbourne, 3 July 1944(NAA: A3269, H4/B).772 Powell notes that the LAGARTO and COBRA files were not passed to Darwin office – despite urgentrequests, and implies Manderson’s move from SRD’s Melbourne Timor Section was related to dissatisfactionwith his handling of operations – Powell, A., War by Stealth …, 1996, op.cit., p.140.773 SRD files contain many signals and messages post-June 1944 indicating Manderson’s continuinginvolvement with SRD field operations in Portuguese Timor ie as “HBM” and “450”. For example, in mid-August 1945, he was consulted on aspects of the recovery of SRD POWs - SRD, ZL573, Melbourne, 14August 1945 (NAA: A3269, D4/A, p.332).774 NAA: A3269, D27/A, p.25, p.31.775 Forsyth, W.G., 27 September 1945 (NAA: A1838, TS377/3/3/2 Part 1, p.124). For reimbursement ofManderson’s expenses, see pp.79-81.776 Manderson, H.B., Melbourne, 3 October 1945 - passed to the Secretary of Defence and the Secretary ofExternal Affairs. (NAA: A1838, TS377/3/3/2 Part 1, pp.60-65). 7 ANNEX F Arthur David Stevenson was born on 22 December 1921779. In civilian life, he wasemployed as a bank officer and resided in Hampton, Victoria. He enlisted in the AIF on 2May 1941 as “VX54688” and commenced duty on 10 June 1941. Stevenson served withthe 2/4 Independent Company in Darwin from 15 March 1942, and then deployed to Timorwith the Company on 21 September 1942 – until its evacuation on 10 January 1943. Hewas commissioned as a Lieutenant on 23 January 1944 and later transferred to Z SpecialUnit and qualified as an SRD “operative officer”. In early July 1944, he completed SRD’sCavern Course at Rockhampton, Queensland. In August 1944, Stevenson was selected tolead an SRD operation (OP BLACKBIRD) to Portuguese Timor to relieve the LAGARTOgroup, but - after several planning changes, the operation was cancelled at the end of 1944.He undertook parachute training in September 1944 and a parachute conversion course inApril 1945 at RAAF Leyburn. In mid-December 1944, Stevenson was appointed D/A - ieofficer in charge of operations in Timor - ie stationed at the SRD/Z Special Unit camp atLMS/Peak Hill near Darwin. Here, he was responsible for about 15 Portuguese andTimorese operational personnel - and a similar number of Timorese support personnel. In early 1945, OP BLACKBIRD was revived as OP SUNLAG with the party780comprising Lieutenant A.D. Stevenson, Sergeant R.G. Dawson and Celestino dos Anjos(Timorese). The party was ready to deploy in April 1945, but shortages of suitable aircraftdelayed the operation. On 29 June, the party was dropped from a B-24 Liberator aircraft ofRAAF 200 Flight into the Laleia River area, about 21km southeast of Manatuto. TheSUNLAG party was extracted by a RAN vessel from the south coast on 5 August 1945(Project BRIM).781 777 Chief of the General Staff, Melbourne, 15 November 1950 (NAA: A6126, 87). As noted above, an officialof the Department of External Affairs – “H”, alleged that Manderson had previously “misused information”.778 “Man Who Took Surrender Dies”, The Herald, Melbourne, 29 March 1961 - National Library of Australia:Biographical cuttings on Henry Blyth Manderson, former Journalist, Bib ID 447667. Manderson did not “takethe surrender” in Timor. The article also stated: “With Sir G. Mussen established a ferry service from PortMelbourne to Williamstown. Established the Evening News in Adelaide in the early 1920s.”779 While his date of birth on military documentation shows 22 December 1920, it appears that his actual birthdate was 22 December 1921 – Ms D. Stevenson, email to author – November 2009.780 The “cover stories” for each of the party are at NAA: A3269, D13/B.781 Stevenson’s report as the SUNLAG party leader is at NAA: A3269, D4/B, pp.8-15. See also A.D.Stevenson’s account in Lambert, G.E., Commando – From Tidal River to Tarakan, Australian MilitaryANNEX F 8 Stevenson was briefly attached to the SRD Advance Headquarters at Morotai (NEI)in the period 14-17 August 1945. After the cessation of hostilities, he led OP GROPER toTimor tasked to determine the fate of SRD/Z Special Unit’s missing operative personnel.782The party – which included three Timorese: Celestino dos Anjos, Alexandré da SilvaTilman and Francisco Freitas da Silva, departedDarwin on 7 September 1945.783 Having completedthe task in Timor, Captain Stevenson and SergeantB. Dooland continued investigations in the LesserSundas and returned to Darwin on 20 November.784 In November 1945, following a representationfrom Captain A.D. Stevenson, Celestino dos Anjos ((photograph omitted))(OP SUNLAG, GROPER) was awarded the Australianmilitary’s “Loyal Service Medallion” for his “skill andcourage” on OP SUNLAG – the only Timorese to receivean individual Australian World War II award (see thecitation at Annex C). Captain Stevenson was the only Captain A.D. Stevenson 785Australian to receive an award for his SRD service in September 1945Portuguese Timor – ie Mentioned in Despatches (MID).786He was discharged from the Army on 23 April 1946 – with a 1,271 days active serviceincluding 230 days overseas. Following a visit to Dili in October 1971 by Captain (Retd) A.D. Stevenson,Celestino dos Anjos was presented with the Loyal Service Medallion by Portuguese TimorGovernor Alves Aldeia in early February 1972.787 Stevenson returned to visit PortugueseTimor in mid-1973, and in mid-1975 when he assisted the evacuation to Australia of SRDveteran Henrique Perreira. In 1987, Captain Stevenson received a letter from Celestino dos Anjos’ son -Virgílio dos Anjos (a Falintil resistance commander), relating the killing of Celestino bythe Indonesian military. Stevenson protested against this atrocity and ensured mediacoverage788 (see also Celestino’s “profile” at Annex A). When a Timorese SRD veteran –Alexandré da Silva Tilman (see Annex A), sought entry into Australia in late 1989, CaptainStevenson wrote a letter of support on 15 September 1989 to the Australian Minister forImmigration. However, Alexandré’s entry was denied (due to his debilitating health History Publications, Loftus, 1997, p.239. The extraction of the SUNLAG party is also related in Horton, D.,Ring of Fire – Australian Guerrilla Operations Against the Japanese in World War II, Macmillan, SouthMelbourne, 1983, pp.145-148. Stevenson proposed an operation to return to Timor and recover theLAGARTO party – 10 August 1945 (A3269, D13/A).782 See Operation GROPER’s Operation Order No. 25, Project ‘Groper’, Darwin, 30 August 1945 (NAA:A3269, D26/A, pp.12-16; D26/B). SRD prisoners were removed from Timor by the Japanese on 5 September1945 and moved successively to Flores, Soembawa, Java and Bali – they were “recovered” on 2 October1945.783 Photographs of the party enroute to Koepang aboard HMAS Parkes are at AWM 115663, 115664.784 The “Final Report by OC GROPER Party”, 29 November 1945 – and interim reports, are at NAA: A3269,D26/A, pp.3-7.785 Lieutenant F. Holland – LIZARD III, and later the Officer Commanding at SRD Peak Hill, was awardedan MBE (Civil Division) on 2 October 1945 “for brave conduct and meritorious and courageous service” inNew Britain in 1942 – ie before he joined SRD/Z Special Unit.786 Awarded on 2 November 1946 - see AWM119, 151 (Part 11). Captain Stevenson was the only member ofZ Special Unit to receive an individual award for service in Portuguese Timor.787 See Timor News, Dili, 2 February 1972 in Lambert, G.E., Commando …, 1997, op.cit., p.427. Backgroundon the presentation of the Loyal Service Medallion is on file NAA, B4717 ANJOS/CELESTINO.788 On the belated receipt of Ular’s letter, Stevenson arranged for an article in The Australian – “IndonesiansExecute Timor War Hero”, 18 March 1987 (Lambert, G.E., Commando …, 1997, op.cit., p.428). 9 ANNEX F condition), and he moved to Portugal in 1990 – but was granted permanent residence inAustralia in 1995. Captain A.D. Stevenson (Retd) passed away on 17 February 1993. ANNEX G “Our whole method of operation was collapsing; we could not rely on the natives. Under the effects of thebombings and the propaganda of the Japanese, the villagers amongst whom we had lived were becomingsullen and even actively hostile.”789 Pre-WWII As with other colonizers, the Portuguese co-opted indigenous forces to support theexpansion of their occupation of Portuguese Timor and the suppression of resistance.Eastern Timor – with over 16 indigenous languages, comprised dozens of minorkingdoms790, and tensions among tribes were readily exploited by the Portuguese. In the19th and early 20th centuries, the Portuguese waged campaigns against several uprisings andrebellions – including the major “Manufahi” revolt by Dom Boaventura in 1912.791Portuguese forces were joined by mobilised auxiliaries ie arraiais (warriors) andmoradores (indigenous police) maintained by local Timorese leaders – and sometimes bymore formally organized “Segunda Linha”.792 Following defeat, some Timorese rebel groups in the western regions soughtsanctuary in Dutch West Timor. Within Portuguese Timor, these “wars” and lesserconflicts left deep animosities between tribes and clans who had been “loyal” to thePortuguese – and the dissidents who had been defeated. However, by the 1920s793, thePortuguese had consolidated their administration across the Colony, and indigenous inter-group conflicts were constrained.794 World War II Soon after occupying Dili, the Japanese forces sought the collaboration of a numberof “arabs”795 and Chinese merchants.796 Among the Timorese, the Japanese proselytized 789 Callinan, B.J., “The August Show on Timor” in Australia at Arms – Bartlett, N. (ed), Australian WarMemorial, Canberra, 1955, p.209.790 For a contemporary map (late 1930s/early 1940s) of languages, by region, produced by Governor Álvarode Fontoura (1937-1940), see Instituto de Ciências Sociais (Arquiva de História Social) da Universidade deLisboa, Colónia Portuguesa de Timor (Album Álvaro Fontoura), Repartição dos Varias Dialetos por PostosAdministrativos, Lisboa, 28 November 2002.791 These early revolts are well-covered in Pélissier, R., Timor en guerre: le Crocodile et les Portugais (1847-1913), Orgeval, France, 1996 and Gunn, G. C., Timor Loro Sae – 500 Years, Livros do Oriente, Macau,1999.792 See Oliveira, L. de, Timor na história de Portugal, Vol I-III, Agência Geral do Ultramar, Lisboa, 1949-1952. A useful history of Segunda Linha can also be found in Sales Grade, E. A., “Timor: O Corpo Militarde Segunda Linha”, Revista Militar, 26 (4-5), February 1974, Lisboa, pp.198-215.793 For the little-known “alleged revolt” in Suro in 1935 that resulted in the dismissal of the régulo of Alas -Dom Carlos Borromeu Duarte, see Cardoso, A.M., Timor na 2ª Guerra Mundial – O Diario do Tenente Pires,CEHCP ISCTE, Lisboa, 2007, pp.29-30.794 Movement of Timorese between districts was restricted – requiring a pass ie guia de transito.795 A number of Malays and “arabs” were reportedly “forced” to work for the Japanese as “soldiers,interpreters and police” – and several dozen were imprisoned by the Portuguese after the War as collaborators– see Bazher, A.B., Islam di Timor Timur, Gema Insani Press, Jakarta, 1995, pp.40-41.796 Encarnação, D. de (?), Letter - Natives (probably to F.J.A. Whittaker), Australia, 25 January 43 (NAA:A373, 4058A) – provides a listing of Chinese who collaborated with the Japanese. Encarnação notes thatANNEX G 2 their policy of a “Greater Asia Co-Prosperity Sphere”, fraternity among all Asians, and theejection of Europeans and their influence.797 These propaganda programs and associatedintelligence activities were promoted by three Japanese intelligence elements in Timor: theTomi Kikan (Army), the Matsu Kikan – and principally the Otori Kikan (civilian agency).Large numbers of Timorese were recruited in West Timor by the Japanese to support theiroperations in Portuguese Timor. when the Japanese entered Lautem in November 1942, they were welcomed by the Chinese residents. AnAustralian officer also noted that “Japs were friendly to the Chinese and use them eg in Lautem.” - McCabe,P.P. Lieutenant, Report on Portuguese Timor, 8 December 1942 (AWM54, 571/1/3).797 “The Japanese knew how to appeal to the natives; they simplified their propaganda and made it ‘anti-white-man’ which of course included the Portuguese who were theoretically neutral” - Callinan, B.J.,Independent Company …, 1953, op.cit., p.154.798 Based on a map in Fontoura, Á. da, O Trabalho dos Indígenas de Timor, Agência Geral das Colónias,Lisboa, 1942. The Portuguese enclave of Oecussi-Ambeno is inserted. 3 ANNEX G In late March 1942, unrest against the Portuguese799 arose in the Posto of Hatoliasouthwest of Ermera – and the Portuguese chefe de posto, Sergeant Mortágua, exiled fourlocal chiefs. Further to the southwest near the border with Dutch Timor, the régulo of Faic(Fohorem area of Cova Lima – about 40km west-southwest of Bobonaro) moved across theborder into Dutch Timor. The Administrator of the Fronteira Circumscription - AntónioPolicarpo de Sousa Santos, who had been supporting the Australian Sparrow Forceelements, arrested numbers of the régulo’s family and followers and exiled them to easternareas of the Colony ie to Manatuto, São Domingos and Lautem – “with orders that theywere to be liquidated.”800 Several of the Faic dissidents were brought back to Bobonaroand executed. At the end of the first week of August 1942, the Japanese forces – advancing fromboth Dili and from Dutch Timor, began a four-column offensive against the Australians inthe western districts. The “objective for the Japanese military was to eliminate both nativeTimorese and Portuguese support for the Australian and associated troops.”801 For thiscampaign, the Japanese strengthened their forces with colunas negras ie “black columns” –Timorese auxiliaries initially recruited from West Timor.802 To intimidate the Portugueseand natives in the countryside, on 9 August 1942 Japanese aircraft bombed and strafed thepostos of Mape and Beaço (in Fronteira) and Maubisse and Same (in Suro).803 On 11 August, the headquarters of Sparrow Force was forced to move, by acircuitous route, eastward from Mape to Same – and “in the process of moving, allSparrow’s long distance radio facilities had been sabotaged by unfriendly natives.”804 Inthe southwest, a Japanese-directed column of heavily-armed natives from Dutch Timoradvanced on the posto of Fatu-Lulic and killed the chefe Corporal Alfredo Baptista.805Other columns advanced to Mape, Beaço, Suai, Maucatar and Bobonaro.806 On 11 August –following the “revolt of the people of Cova Lima and Balibo”, Administrator Sousa Santos799 In a speech to the National Assembly in Lisbon on 26 November 1943, Portuguese Prime Minister Salazarclaimed: “there were revolts among the native population who had been in perfect tranquility under our rule.”– NAA: A989, 1943/731/3, p.54.800 Cardoso, A.M., Timor …, 2007, op.cit., pp.63-64. The cause and nature of the régulo’s resistance to thePortuguese is unclear. Sousa Santos also reportedly raid the lulic (ie sacred ancestral) house of the Faic clanand removed “jewels of the kingdom and other sacred objects” to his headquarters in Bobonaro “whichshocked the population.” Immediately post-War, Faic – the régulo of Fohorem and Cova Lima, presentedhimself voluntarily to the Portuguese authorities at Bobonaro – Carvalho, M. de Abreu Ferreira, Relatório …,1947, op.cit., p.658. In 1946, Sousa Santos was charged by a Portuguese Disciplinary Court with severaloffences including that he “was responsible for the rebellion at Fohorem” and for “wrongly killing somenatives at Bobonaro” - see NAA: A1838, 377/3/3/6 Part 1, p.161, p.194.801 Horton, W.B., “Ethnic Cleavage in Timorese Society: The Black Columns in Occupied PortugueseTimor”, Journal of International Development, 6 (2), Takushoku University, Tokyo, March 2007, p.43.802. For views on the origin of the term “black columns/colunas negras”, see Horton, W.B.,“Ethnic Cleavage …”, op.cit., March 2007, p.43. According to Portuguese Lieutenant António Liberato: “theblack columns were initially recruited from native populations of Dutch Timor and neighbouring islands,their numbers were soon increased by hundreds of natives from our land, mainly from the regions ofFronteira, Maubisse, Manufai and later from other areas of the colony. … they became the Australians’ worstenemy, the real adversary who forced them to leave Timor.” - Liberato, A. de Oliveira, O Caso de Timor,Invasões estrangeiras, revoltas indígenas, Portugália Editora, Lisboa, 1947.803 On 10 August, Bobonaro, Mape and Beaço were bombed; and on 11 August, Aileu, Mape and Beaço werebombed.804 The Official History … , Vol II – Operations, 1946, op.cit., p.13 (NAA: A3269, O8/A, p.26). SparrowForce used the LIZARD I radio set which was later left with Sparrow Force when the LIZARD I party wasevacuated to Australia on 17 August 1942.805 The estimated strength of the “black columns” that entered Fronteira from West Timor was “around 3,000… along with some Menadonese with experience as colonial troops.” - Horton, W.B., “Ethnic Cleavage …”,March 2007, op.cit., p.43.ANNEX G 4 abandoned his Fronteira Circumscription headquarters at Bobonaro and fled with his familyeastward to the Baucau area. On 21 August 1942, a Portuguese column led by Sergeant António Joachim Vicenteleft Dili to suppress the rebellion in the southwest – followed by a column from Aileu ledby Lieutenant António de Oliveira Liberato.807 The Portuguese forces reportedly “had akind of liassez-passer ((salvo-conduto)), a document signed by the Japanese Consul, thatidentified the reason for their operation. … Lieutenant Liberato encountered Australian andDutch troops who did not intervene. While identifying with the Portuguese, who provided aquiet and working population, the Australians remained neutral because, as Callinanadmitted: ‘One war was enough for us’.”808 Following the bombing by the Japanese of the Posto at Maubisse on 9 August 1942,Corporal Francisco Martins Coelho - the chefe de posto, while reportedly enroute to Sametook refuge with a local village head, but was brutally murdered by him. In retaliation, aPortuguese force – including large numbers of Timorese arraiais and moradores, wasmobilized by the Administrator of Manatuto to suppress the “revolt of 3,000” at Maubisseand Turiscai. The main Portuguese column led by Lieutenant António Ramalho left Aileuon 23 August – with the force including 3,100 arraiais, and the bloody campaignconcluded on 3 September.809 Massacre at Aileu 806 For detail on the Japanese border campaign, see Carvalho, M. de Abreu Ferreira, Relatório …, 1947,op.cit., pp.310-311.807 For detail on the campaign, see Liberato, A. de Oliveira, O Caso …, 1947, op.cit., pp.109-112. A map ofthe campaign by the two Portuguese columns can be found in Santos, A. P. de Sousa, Duas palvaras aocapitão Liberato a propósito de “O Caso de Timor”, Minerva Central, Lourenço Marques, 1973, p.65. Thecolumns - including the later expedition to Maubisse, included deportado volunteers, some of whom laterevacuated to Australia (see Annex A and Annex D).808 Cardoso, A.M., Timor …, 2007, op.cit., pp.64-65. Cardoso includes quotes from Callinan, B.J.,Independent Company …, 1953, op.cit., p.155.809 Takahashi, S., emails to author, 18 and 24 July 2009. Shigehito Takahashi’s field research includesdetailed Timorese accounts of the campaign. Timorese refer to the Maubisse “revolt” as the “Manetu-Manelobas War”. The Timorese arraiais were mobilized from a wide area – Manatuto (Fatu Berliu, Samoro,Fatu Maquerec, Laclubar), Aileu (Aileu, Lequidoi, Dailor), Ermera (Letefoho), and Suro (Ainaro, HatoBuilico).810 Shigehito Takahashi’s in-country research has established that the Japanese civilian intelligence agency –Otori Kikan, managed the “Aileu case”: Takahashi, S., “The Japanese Intelligence Organization inPortuguese Timor”, Understanding Timor-Leste: Research Conference, Dili, 3 July 2009.811 Cardoso, A.M., Timor …, 2007, op.cit., p.66.812 Callinan, B.J., Independent Company …, 1953, op.cit., pp.172-173. 5 ANNEX G “internment” areas on the northern coast west of Dili at Liquiçá, Maubara and the nearbyhill village of Bazar Tete – ie for protection against the “rebeliões de indígenas”.813 813 Carvalho, M. de Abreu Ferreira, Relatório …, 1947, op.cit., pp.406-412. See also Liberato, A. de Oliveira,Os Japoneses Estiveram Em Timor II – A Zona De Concentração, Empresa Nacional da Publicade, Lisboa,1951, pp.153-208.814 Callinan, B.J., Independent Company …, 1953, op.cit., p.144.815 Wray, C. C. H., Timor 1942, op.cit., 1987, pp.123-125.816 Ibid, p.132.817 Ayris, C., All The Bull’s Men, PK Print Pty Ltd, Hamilton Hill, 2006, p.300.818 Precis - Situation Reports Sparrow Force: 1-11 Sep 42, Darwin, 18 September 1942 (AWM 54, 571/4/15).819 Callinan, B. J. Major, Report on the Situation – Western Portuguese Timor, Port [sic] Timor, 3 November1942 (NAA: A1067, PI46/2/9/1, pp.20-22).ANNEX G 6 By now, “the native war was in full swing … on arriving back at Ainaro, Callinanfound a pitched battle being fought while nearby villages burned. Hostile natives fromMaubisse had advanced on Ainaro and were being driven back up the valley by Australianrifle and machine- gun fire. … skirmishes between parties of natives was constant. HostileTimorese roamed the area attacking and killing friendly natives and burning their villages.Warnings to stop from the Australians had no effect. … one section of the 2/2 IndependentCompany attacked Maubisse … ((and)) killed a number of armed hostile natives. … On 26October, a section of 2/4 Independent Company … and 200 of King Ananias’s, attackedkilling at least fifty rebels. … Two soldiers from Lieutenant Palmer’s section disguisedthemselves as Timorese and led fifty friendly natives in an attack on pro-Japanese nativesin the Same Saddle. Ten of the enemy were killed. … To reinforce the lesson, a few dayslater troops – supported by the 300 natives from Same, went down the Aituto valleyattacking rebel natives and Japanese.”820 Major Japanese activity had ceased in mid-late August, but in November 1942strong Japanese forces pushed eastward along the northern coast – killing the PortugueseAdministrator of Manatuto and the acting Administrator of Lautem.821 The Australianscame under increased pressure with engagements against hostile Timorese. In earlyNovember, “hostile natives attacked the Maubisse OP … natives attacked No.8 Sectionposition near Mindelo. … The Timorese who had been recruited by the Japanese in DutchTimor were proving very troublesome to the Australians, particularly in the Mindelo-Maubisse-Turiscai area. The Australians’ food supplies had almost dried up …”.822 TheAustralian force - now renamed “Lancer Force”, became increasingly harassed by largegroups of hostile Timorese incited by the Japanese: “parties of fifty or sixty natives, urgedon from the rear by two or three Japanese, carried out raids against units at Mindelo andTuriscai. Almost daily, Australian patrols fought actions against these parties resulting inthe deaths of ten, twenty or thirty natives – but only one or two Japanese.”823 As related above, the Australians had also recruited and armed large groups oftribesmen to fight against the Japanese and their auxiliaries.824 An Australian officer notedthe increasing threat from colunas negras, and that the Japanese “were resettling them inthe deserted villages. Our answer was to raid Mindelo. This raid was made on the advice ofthe loyal Timorese who led the patrol. The attack took place at dawn. The dead werethrown into the huts (by pro-Australian Timorese) then the village was burnt to the ground.Although it was known as a Japanese village, we did not encounter any Japanese on thisoccasion. Our local Timorese were jubilant; they had a deep hatred of the Japanese. … Thebattles raged back and forth across the country … the slaughter continued for weeks withneither side bothering to dispose of the dead.”825 “The psychological effect on our troops ofseeing natives fighting against us, after so many months of learning to trust them as onehundred per cent allies, was enormous. From then on we never knew who to trust as a 820 Wray, C.C.H., Timor 1942, op.cit., 1987, pp.146-147.821 Respectively: João Mendes de Almeida – on 17 November 1942; and Manuel Arroio E. de Barros - alsoreportedly on 17 November 1942.822 Ayris, C., All The Bull’s Men, 2006, op.cit., pp.355-356.823 Wray, C.C.H., Timor 1942, op.cit.,1987, p.144.824 See Wray, C.C.H., Timor 1942, 1987, op.cit., pp.166-167 – describing the provision of arms and trainingby Lancer Force to “friendly natives” in the Fatu-Berliu area of southwestern Manatuto. In early October1942, an operational plan for SRD’s LIZARD III operations in the eastern half of Portuguese Timor wasapproved that included the arming of Portuguese and “natives” - Z Special Unit, Melbourne, 7 October 1942(NAA: A3269, D6/A, pp.13-17) in response to SRD, Melbourne, 5 October 1942 (NAA: A3269, D6/A,pp.10-12).825 Ayris, C., All The Bull’s Men, 2006, op.cit., pp.357-359. A photograph of the Australian attack onMindello [sic] is in the collection of the Australian War Memorial – Photograph ID No. 013829. 7 ANNEX G friend or who treat as foe among the natives – that is apart from our creados who remainedconstantly loyal.”826 With the Japanese and their Timorese auxiliaries dominating in the western areasand pressuring Sparrow/Lancer Force to move further eastward, SRD sought to establish itsteams in “the eastern provinces of Manatuto, São Domingos and Lautem ((which)) wererelatively clear of enemy intrusion.”830 On 2 September 1942, SRD’s LIZARD party wasestablished in the Viqueque area with the aim of recruiting and arming Portuguese andTimorese in the São Domingos Circumscription and waging a guerrilla war against theJapanese.831 Initially, the plan was successful – with many thousands of natives reportedlywilling to support LIZARD operations.832 In the Matebian mountains for example, a “nativeforce of over 300” was raised and trained in “the care and use of the .303 rifle, Bren m/g, 826 Ibid, p.358 – quoting from an article in the post-War 2/2nd Commando Courier magazine.827 NX73234 Private P.P. McCabe had served initially as a signaler with the 2/2 Independent Company – and,as noted above, became “expert” on Timor providing “valuable assistance” to Major Callinan. Returning toAustralia, he was commissioned and employed at FELO. He later returned to Timor in September 1945 as acaptain on the staff of the TIMFORCE Commander, Brigadier L.G.H. Dyke.828 McCabe, P.P. Lieutenant, Report on Portuguese Timor, 8 December 1942 (typed, eight pages) - AWM54,571/1/3. McCabe also produced a shorter manuscript version of his report for the Lancer Force commanderentitled “Report on Portuguese and Natives in Portuguese Timor” dated 17 November 1942.829 Allied Land Forces, L.H.Q. Cartographic Company, Portuguese Timor – Cartographic Material: ShowingNative Attitude (prepared by G-Research from information supplied by Lieutenant P.P. McCabe as at 25November 1942), Bendigo, 1942 - National Library of Australia, G8117.T5 S495. Several maps wereproduced from Lieutenant McCabe’s information, including a map of “Native Dialects” in the IndependentCompanies’ areas of operation (ie west of Manatuto).830 The Official History … , Vol II – Operations, 1946, op.cit., p.12 (NAA: A3269, O8/A, p.25).831 Z Special Unit, Melbourne, 7 October 1942 (NAA: A3269, D6/A, pp.13-17).832 LIZARD Report, Part 3 – Before the Collapse, 8 March 1942 (NAA: A3269, D6/A, pp.84-85).ANNEX G 8 grenades etc, and the art of guerilla warfare.”833 However, from early November 1942, theJapanese drive south and east from Baucau seriously threatened the LIZARD force.“Hostile natives” became an increasing problem – and several tribes and clans changedtheir support to the Japanese. To the east, “all the natives in the province of Lautem were inwith the Japs, and towards the end they came and killed, burnt and stole – and led theJapanese forces after us.”834 On 2 December 1942, LIZARD headquarters reported:“Lautem natives turning against us and dissatisfaction spreading nearer.”835 On 6 February 1943, under increasing pressure from Japanese and hostile natives,LIZARD advised SRD headquarters: “evacuation urgent necessity”. On the same day,LIZARD passed a message to Australia from the “residual” Lancer Force element (ie SForce): “Unable to perform role and ask for evacuation for following reasons: access toPortuguese and loyal natives impossible; food position hopeless; force too large for safety;health bad and rapidly becoming worse; please treat as urgent.”836 Both LIZARD and the SForce elements were evacuated to Australia by a US submarine on 10 February 1943. After the withdrawal of the Australian Lancer force and LIZARD/Pires parties, a60-strong SRD-directed group of Portuguese and Timorese continued to operate near thesouth coast as PORTOLIZARD. The group was continuously harassed837 – reporting on 19February: “Our camp was attacked by natives that were Australian soldiers’ servants.”838 Inearly June, PORTOLIZARD signaled: “Our position critical by reason of attacks fromwestern natives. We fear that friendly natives are being turned against us.”839 In early July 1943, with the arrival of SRD’s LAGARTO group led by LieutenantPires, PORTOLIZARD was disbanded. LAGARTO was soon under pressure and signaledSRD on 15 July: “Four hundred Japs with 2,000 natives in five columns with mortarscontinue to seek us.”840 With villagers unwilling to support them, on 25 SeptemberLAGARTO desperately signaled: “Quite impossible for us to stay any longer … nativesfrom Ossu have been ordered to proceed here and assist with search ((for us)) … we havenowhere to go.” – and sought immediate extraction of the group by Catalina flying boat orsubmarine.841 The LAGARTO party was captured four days later near the north coast.Subsequent SRD operations into Portuguese Timor – eg COBRA, ADDER, SUNABLE,and SUNDOG failed almost immediately after insertion. A Summary 833 Report by Lieutenant. F. Holland (LIZARD III), Timor, p.3 (NAA: A3269, D6/A, p.126).834
https://ru.scribd.com/doc/29688334/Forgotten-Men-Timorese-in-Special-Operations-during-World-War-II
CC-MAIN-2021-04
refinedweb
72,393
55.44
Tuples Tuples are multiple values, comma-separated, inside a pair of parenthesis. They don’t exist as a value per se, and they don’t have a type - but they are useful for several things. Multi-return It is possible to return multiple values from a function without using an intermediary data structure. findFile: func (pattern: String) -> (Bool, File) { if (found) { return (true, file) } // Didn't find it :/ return (false, null) } Using a function that returns a tuple can be done in several ways. // get both values (found, file) := findFile("report_2013*.md") // only get the file (_, file) := findFile("report_2013*.md") // only want to know if it exists (found, _) := findFile("report_2013*.md") // this works too, takes the first value found := findFile("report_2013*.md") Multi-declaration Tuple syntax can be used to declare multiple variables on the same line: (x, y) := (3.14, 1.52) Variable swap Tuple syntax can also be used to swap two variables: (x, y) = (y, x) // equivalent to tmp := x x = y y = tmp Cover literal Tuple syntax can be used to conjure a cover out of thin air: Vec2: cover { x, y: Float } v := (3.14, 1.52) as Vec2 // v x = 3.14, v y = 1.52
https://ooc-lang.org/docs/lang/tuples/
CC-MAIN-2017-47
refinedweb
204
64.41
PyOpenGL PyOpenGL is a large Python package that wraps most (up to version 1.2) of the OpenGL API. However, it doesn't try to clean up the API and present a more Pythonic interface, so it won't save you (or, more importantly, me) from having to learn the details of OpenGL. It does abstract the API so you call glColor in place of glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, ... Here's the skeleton for a program that displays something:: import sys from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * # The display() method does all the work; it has to call the appropriate # OpenGL functions to actually display something. def display(): # Clear the color and depth buffers glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # ... render stuff in here ... # It will go to an off-screen frame buffer. # Copy the off-screen buffer to the screen. glutSwapBuffers() glutInit(sys.argv) # Create a double-buffer RGBA window. (Single-buffering is possible. # So is creating an index-mode window.) glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH) # Create a window, setting its title glutCreateWindow('interactive') # Set the display callback. You can set other callbacks for keyboard and # mouse events. glutDisplayFunc(display) # Run the GLUT main loop until the user closes the window. glutMainLoop()
https://wiki.python.org/moin/PyOpenGL?action=fullsearch&context=180&value=linkto%253A%2522PyOpenGL%2522
CC-MAIN-2016-30
refinedweb
206
60.92
You may have heard of two tools that come with the current F# distribution, fslex and fsyacc. Both of those are based famous tools which are helpful in writing compilers. In this post I’ll focus on creating a simple program which will take advantage of fslex, derived from Lex which stands for Lexical Analyser. Lex is a tool that produces a scanner or tokenizer. A scanner is something which takes some input text and breaks it down into tokens, such as code file being broken down into keywords, operators, constants, and identifiers. To keep things simple, we will create a simple app called MegaCalc which will parse basic mathematical expressions like: “1.0 / (sin pi + cos pi)” “e ^ (-1)” We expect fslex to produce a scanner which can take the string “sin(pi) + (31.0 * 2)” and convert it to its underlying tokens, which are [SIN; LPAREN; PI; RPAREN; PLUS; LPAREN; FLOAT(31.0); TIMES; INT(2); RPAREN]. For a compiler writer not having to worry about breaking a source file into its raw tokens makes parsing it and doing semantic analysis much easier. (But we will leave semantic analysis to fsyacc in a later post.) In order to create MegaCalc we will follow three simple steps: defining our token types, creating an fslex file, and finally running fslex to generate our scanner. I’m going to try to do as much hand waving as possible for the sake of clarity, but if you want a more complex example on parsing there is another sample in the F# distribution under ‘samples\parsing’ which showcases both fslex and fsyacc. In addition, there are many resources on how to use lex and yacc which are more or less compatible with fslex and fsyacc. Step One – Define our Token Type We will start by defining all of our tokens using a discriminated union. Notice how this feature of F# allows some tokens to carry along a value with them, this leads to much cleaner code. Tokens.fs type Tokens = // Numeric types | INT of int | FLOAT of float // Constants | PI | E // Trig functions | SIN | COS | TAN // Operators | PLUS | DASH | ASTERISK | SLASH | CARET // Misc | LPAREN | RPAREN | EOF Step Two – Define the Lex Specification The lexical specifically file is what Lex uses to produce a scanner. The header of the file (everything between the first { and } ) is spit directly into the output file. The rest defines the regular expression and parse method for our mini language. Whenever Lex matches a token based on a regular expression it ‘evaluates’ what is in the curly braces. Our parser will return a single token for ‘legal’ characters, simply chew through whitespace, and any unrecognizable character will cause an exception to be thrown. Lexer.fsl { (*** All code between the two curly braces will be spit directly into the generated code file. ***) open System // Open our module which defines the token types // These two modules define goo needed to use fslex open Lexing let inc_lnum bol pos = let lnum = pos.pos_lnum in {pos with pos_lnum = lnum+1; pos_bol = bol } let newline lexbuf = lexbuf_set_curr_p lexbuf ( inc_lnum (lexeme_end lexbuf) (lexeme_end_p lexbuf)) } // Base regular expressions let digit = [‘0’-‘9’] let whitespace = [‘ ‘ ‘\t’ ] let newline = (‘\n’ | ‘\r’ ‘\n’) rule parsetokens = parse // —————————- | whitespace { parsetokens lexbuf } | newline { newline lexbuf; parsetokens lexbuf } // —————————- | [‘-‘]?digit+ { INT (Int32.Parse(lexeme lexbuf)) } | [‘-‘]?digit+(‘.’digit+)?([‘e”E’]digit+)? { FLOAT (Double.Parse(lexeme lexbuf)) } // —————————- | “pi” { PI } | “e” { E } // —————————- | “sin” { SIN } | “cos” { COS } | “tan” { TAN } // —————————- | “+” { PLUS } | “-” { DASH } | “*” { ASTERISK } | “/” { SLASH } | “^” { CARET } | “(” { LPAREN } | “)” { RPAREN } // —————————- | eof { EOF } Step Three – Run fslex.exe Although you can add an F# Lex Specification file from the Visual Studio Add-In, to run fslex you will need to break to the command line. Fslex.exe is located in your F# distribution’s ‘bin’ directory. Output from fslex: C:\MegaCalc\>fslex lexer.fsl compiling to dfas (can take a while…) 154 NFA nodes 32 states writing output Putting it All Together Now that we have a generated code module, Lexer.fs, we can use our scanner/tokenizer to parse strings. Notice the use of the ‘Lexing’ namespace, which is a set of library routines to compliment fslex. Main.fs #light open System // Opens the module with our generated scanner code open Lexer // Given a lex buffer chew through the buffer returning a token list. let parse lexbuf = let mutable keepParsing = true let mutable tokenList = [] while keepParsing = true do // ‘parsetokens’ is the method generated by fslex let parsedToken = parsetokens lexbuf // Add the token to our list tokenList <- tokenList @ [parsedToken] if parsedToken = Tokens.EOF then keepParsing <- false tokenList // Attempts to parse a block of text and prints stats to STDOUT let tryParse text = let lexbuf = Lexing.from_string text try let tokens = parse lexbuf printfn “Success. %d tokens.” (List.length tokens) printfn “Tokens : %A” tokens with e -> let pos = lexbuf.EndPos printfn “Exception Message: %s\nLex error near line %d, character %d” e.Message pos.Line pos.Column // Code which actually executes let welcomeMessage = @” MegaCalc (fslex sample) ———————– Example Usage: “”cos pi * 42.0″” “”e ^ (-1 + cos (0.0))”” “”quit”” :” Console.Write(welcomeMessage) let mutable inputString = Console.ReadLine() while inputString <> “quit” do // Try to parse the string tryParse inputString // Get the next line Console.Write(“\n:”) inputString <- Console.ReadLine() Console.WriteLine(“(press any key)”) Console.ReadKey(true) Sample Output MegaCalc (fslex sample) ———————– Example Usage: “cos pi * 42.0” “e ^ (-1 + cos (0.0))” “quit” :cos pi * 42.0 Success. 5 tokens. Tokens : [COS; PI; ASTERISK; FLOAT 42.0; EOF] :e ^ (-1 – 1) Success. 8 tokens. Tokens : [E; CARET; LPAREN; INT -1; DASH; INT 1; RPAREN; EOF] :quit (press any key) Conclusion As you can see, we have constructed a simple with a minimum of work. Now imagine other types of situations where a generated parser could come in handy, such as how to break apart log files. In a future post we will cover fsyacc which will take that token stream and convert it into a syntax tree, which will then make it easier to evaluate the actual equations. Disclaimer Despite my best efforts to get the facts straight I reserve the right to be wrong. Also, the code posted is offered “as is” and offers no warranty of any kind, expressed or implied. MegaCalc-fslex-sample.zip In this post I’ll focus on creating a simple program which will take advantage of fslex, and show how The first release is a simple four function calculator, which builds off of last week’s blog post and integrates fsyacc for parsing. The net result is the ability to write simple simple expressions like "10 * 2 – 15 / 3" and get it evaluated using the Last Tuesday I gave a talk to the .NET Developers Association entitled Language Oriented Programming While I am thrilled about all the new features we’ve put into the F# CTP, perhaps the thing I’m most It’d be great if you could repost the source along with the project for the latest CTP… including the MSBuild tasks for Lex and Yacc. The 2008 CTP doesn’t syntax highlight the .fsl file Thanks for posting this. It’s a great help.
https://blogs.msdn.microsoft.com/chrsmith/2008/01/18/fslex-sample/
CC-MAIN-2016-30
refinedweb
1,179
61.46
Here’s the answer to the question raised in my previous post, Java Quiz: Iterating over Binary Tree Elements. The answer is surprisingly easy once you see it. What’s really cool is that it’s an instance of a general programming technique called continuation passing style (CPS). In the form discussed here, CPS is a general technique to convert recursion into iteration. Enough of the generalities, here’s my answer: public class TreeIterator implements Iterator<Integer> { private final Stack<Tree> mStack = new Stack<Tree>(); public TreeIterator(Tree tree) { stackLeftDaughters(tree); } public boolean hasNext() { return !mStack.isEmpty(); } public Integer next() { if (mStack.isEmpty()) throw new NoSuchElementException(); Tree t = mStack.pop(); stackLeftDaughters(t.mRight); return t.mVal; } public void remove() { throw new UnsupportedOperationException(); } private void stackLeftDaughters(Tree t) { while (t != null) { mStack.push(t); t = t.mLeft; } } } I now add the following to the main() from the last post: Iterator it = new TreeIterator(t); while (it.hasNext()) System.out.println(it.next()); and here’s what I see: Iteration Order: 1 2 3 4 5 7 8 Conceptually, the way the program works is very simple. The main idea is to keep track of the information that would be on the call stack in the recursive implementation in an explicit programmatic stack data structure. The elements in the queue represent the continuations. They essentially tell the program where to pick up processing when called next, just like the stack does in recursion. Envious Aside: Continuation passing (literally, not just in style) is what lets Python implement the super-cool yield construction. Yields in Python are a general way to turn visitors into iterators. They’re possible because continuations in Python are first-class object. You can even write completely stackless Python. Back to Java. Our code maintains a stack of the nodes whose values are left to be printed, in order of how they should be printed. Because you print the left daughters before the root, you always queue up the entire set of left daughters for a node. After initialization, the stack consists from bottom to top of the root, the root’s left daughter, the root’s left daughter’s left daughter, and so on, down to the lower “left corner” of the tree. The iterator has more elements if the stack’s not empty. The next element is always the value on the top of the stack. After returning it, you need to push it’s right daughter, as the descendants of the current node’s right daughter all have to be output before the other elements on the stack. One thing to look at is how I implemented the recursive add using iteration (I probably would’ve used a for-loop, but thought the while loop easier to undertsand). You could’ve also done this recursively: private void stackLeftDaughters(Tree t) { if (t == null) return; mStack.push(t); stackLeftDaughters(t.mLeft); } The recursive version’s clearer (at least to me), but programming languages tend to be much better at iteration than recursion (even languages designed for recursion, like Lisp and Prolog). Java has relatively small stack sizes (typically, they’re configurable), and miniscule maximum depths (usually in the thousands). Of course, if your binary tree is 1000 nodes deep, you have bigger problems than Java’s stack! Also check out the little details. I made variables final that could be final, kept the class’s privates to itself, and implemented the proper exceptions. To see that it satisfies the performance constraints, first note that the amount of memory used is never greater than the depth of the tree, because the elements of the stack always lie on a single path from the bottom of a tree up. Constant time per element is a bit tricky, and you might want to call me on it, because it requires an amortized analysis. For each element returned, its node was pushed onto the stack once and popped off the stack once. That’s all the work that happens during next(). You also do tests for every value’s returned daughters, which is still only a constant amount of work per element. Extra Credit: Use java.util.AbstractSet to implement SortedSet<Integer>. The only methods that need to be implemented are size() and iterator(), so you’re mostly there. Extra Extra Credit: Discuss the problem of concurrent modification and implement a solution for the iterator like Java’s. You might also want to note that the tree should be balanced somehow, but that seems like an orthogonal problem to me from the issue with iterators. Check out Java’s own java.util.TreeSet implementation. The code for the collections framework is very useful as a study tool. January 27, 2009 at 2:13 pm | Clojure has a cool form called “recur”. It looks like recursion, but it compiles to a simple loop. The compiler won’t allow “recur” in a position that can’t be tail-call optimized. January 27, 2009 at 2:48 pm | Nope, Clojure wasn’t a typo. It’s a clever name for a new language that compiles tot he JVM. Closures are like continuations in that they hold a function pointer and a stack for later execution. This is enough to make me want to put my compiler hat back on! The implicit connection in Stuart Sierra’s post for those of you who aren’t compiler geeks is that you usually write in continuation passing style when your compiler can’t unfold your (elegant) recursions into (efficient) iterations. For most recursion-oriented languages (like Lisp or Prolog), tail recursion optimization is built in. Specifically, if the last call in a function/method definition is recursive, the compiler avoids creating a new stack frame because it’ll never be needed. Unfortunately, tail recursion optimization is not availabe in Sun’s JDKs. It is availabe in Clojure. February 2, 2009 at 6:21 pm | Nice post. One thing worth mentioning is that a continuation is essentially a “promise” to do something (later), and there’s a connection to lazy (evaluation) languages like Haskell. Hence, you should give extra credit to people who manage implement the notion of Continuations in Java independent of the tree iteration problem (in the Scheme variant of LISP it’s already built in, of course…). February 3, 2009 at 1:02 pm | That’s a very good point. You can actually do continuations more generically in Java by passing in java.lang.Runnable implementations as the continuations. The efficient way to code with continuations is to unfold all the runnables and only store the data, with the operations implicit. There are all sorts of opportunities to exploit laziness in Java, but given its call-by-value nature, you have to do it manually, like continuations (unless the kind of laziness you want comes from static class loading). A good example in java.lang is String’s hash code computation, which isn’t done until it’s needed, and then it’s cached. There are nice discussions of both laziness and continuation passing style in the AI programming textbooks: O’Keefe’s Craft of Prolog, and Norvig’s AI Programming in Lisp. February 17, 2009 at 9:03 am | Tiny (unmeasured) performance nit: stack is a Vector which adds synchronization overhead. You might consider an ArrayList-based Stack. Anyway, clever solution. June 22, 2017 at 8:21 am | I have a similar way of addressing this problem, but my solution mimics directly the call stack. TreeIterator hosted with ❤ by GitHub I think your approach is neater, while my solution being more general. Basically, it can convert any recursive function into this style without any thinking.
https://lingpipe-blog.com/2009/01/27/quiz-answer-continuation-passing-style-for-converting-visitors-to-iterators/?shared=email&msg=fail
CC-MAIN-2021-39
refinedweb
1,281
55.13
Original article was published by Akshit Kothari on Artificial Intelligence on Medium Step 1: Import the libraries import pandas as pd import numpy as np from collections import Counter from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report, accuracy_score Step 2: Read the data and pre-processing #Read the csv in the form of a dataframe df= pd.read_csv("data.csv") df.head() #Removing the null values df.dropna(axis=0, inplace=True) #Reset the index to avoid error df.reset_index(drop=True, inplace=True) y = df['RAIN'].replace([False,True],[0,1]) #Removing Date feature and Rain because it is our label df.drop(['RAIN','DATE'],axis=1,inplace=True) #Splitting the data to train(75%) and test(25%) x_train,x_test,y_train,y_test=train_test_split(df,y,test_size=0.25) Step 3: Implementing Euclidean distance to find the nearest neighbor Let’s try to understand Fig. 5 first, we have three features in two clusters, similar to our Seattle Rainfall data. Lets assume cluster 1 to be of data points when it did not rain and cluster 2 to be of data points when it did rain. The first two clusters can be thought of as our training data. The three data point outside the two clusters are the testing data for which we have to find the label. Now, we will use Euclidean Distance to calculate the distance between the training data and the testing data. We can also use different methods to calculate distance like Manhatten Distance, Minkowski Distance etc. Euclidean Distance:- It is used to find the straight line distance between two points. Since, KNN is non-parametric i.e. it does not make any assumptions about the probability distribution of the input, we find the distance of test data points from the training data and the data points which are near to the test data are considered for classifying our test data. Let’s see this with the help of an image:- We see that in the image we have 5 data points per feature, 2 classified in one cluster, 2 classified in other cluster and 1 not yet labelled. Once we calculate the euclidean distance between these data points we can classify the cluster where this would lie. The K in KNN signifies the count which we have to consider, lets say K is provided 5, in this case it will consider top 5 shortest distances after which the class with more frequency will be considered as the class of the test data. To understand the purpose of K we have taken only one independent variable as shown in Fig. 7 with 2 labels, i.e binary classification and after calculating the distances we have marked 5 nearest neighbors as K is assigned a value of 5. Now as we can see the frequency (3 for blue and 2 for red) of label in color blue is higher than for color red, we will label the test data point as blue. Finding out the value of K is a task in K-NN as it may require multiple iterations by trying different values and evaluating the model based on those values. def KNN(x,y,k): dist = [] #Computing Euclidean distance dist_ind = np.sqrt(np.sum((x-y)**2, axis=1)) #Concatinating the label with the distance main_arr = np.column_stack((train_label,dist_ind)) #Sorting the distance in ascending order main = main_arr[main_arr[:,1].argsort()] #Calculating the frequency of the labels based on value of K count = Counter(main[0:k,0]) keys, vals = list(count.keys()), list(count.values()) if len(vals)>1: if vals[0]>vals[1]: return int(keys[0]) else: return int(keys[1]) else: return int(keys[0]) Step 4: Calculating the accuracy and classification report print(classification_report(pred,train_label)) print(classification_report(pred,test_label)) Well we have achieved 96% in training data and 94% in test data, not bad!
https://mc.ai/k-nearest-neighbors-k-nn-with-numpy/
CC-MAIN-2020-45
refinedweb
647
53.1
Introduction Have you ever wanted to run a tiny, safe web server without worrying about using a fully blown web server that could be complex to install and configure? Do you wonder how to write a program that accepts incoming messages with a network socket? Have you ever just wanted your own Web server to experiment and learn with? Further updates in 2012 to support recent web-server and browser standards and a code refresh.. The example file supplied includes the UNIX® source code in C and a precompiled one for AIX®. The source will compile with the IBM VisualAge® C compiler or the GNU C compiler, and should run unchanged on AIX, Linux®, or any other UNIX version. Compile with the following command. The program is in C and requires no additional libraries or services. The -O2 option is needed only if you want the code to be optimized: cc –O2 nweb.c –o nweb Functions within nweb There are only a few functions in the source code, explained below. log() - Logs messages to a log file. If the user requests an operation from the Web server that is not allowed or can't be completed, then nweb tries to inform the user directly. This is done by returning a fake Web page to the user that includes the error message. Since this function is only called from the child Web server process, the function can (once completed) exit and the main Web server process continues to allow further browser connection requests. If this is not a recoverable error, then the process is stopped. web() - Deals with the HTTP browser request and returns the data to the browser. This function is called in a child process -- one for each Web request. It also allows the main Web server process to continue waiting for more connections. Checks are made to ensure the request is safe and can be completed. After the checks have been made, it transmits the requested static file to the browser and exits. main() - This is the main Web server process function. After checking the command parameters, it creates a socket for incoming browser requests, sits in a loop accepting requests, and starts child processes to handle them. It should never end. Pseudo code Listing 1 below is the pseudo code for the approximate 200 lines of source code. It should help you understand the flow of the program. Listing 1. Pseudo code logger() { outputs error, sorry or log messages to the nweb.log file if a sorry message, transmit it to the browser as a fake HTML response if error or sorry message the program is stopped } web() - this function returns the request back to the browser { read from the socket the HTTP request check it’s a simple GET command check no parent directory requested to escape the web servers home directory if no file name given assume index.html check the file extension is valid and supported check the file is readable by opening it transmit the HTTP header to the browser transmit the file contents to the browser if LINUX sleep for one second to ensure the data arrives at the browser stop } main() { if option is "-?", output the hints and stop check the directory supplied is sensible and not a security risk become a daemon process ignore child programs (to avoid zombies when child processes stop) create a socket, bind it to a port number and start listening to the socket forever { wait and accept incoming socket connection fork a child process if the child process then call the web function else close new connection } } Socket system calls In case you haven't come across these network socket system calls before, they are explained below -- particularly how they all fit together. You can also look them up in the manual or on the Web -- though it can be hard to see what they do and why they make up a Web server from just the source code and manual. The socket(), bind(), listen(), and accept() network system calls all work together to create a server process. They set up a socket ready for use to communicate over a network when combined. A socket is: - An input and output stream -- regular pipes and files, for example. - Remote access to or from a server -- when used over a network. - Bidirectional -- when you read and write the same socket at both ends. - Regular read and write functions -- used to send and receive data. - A stream (no natural structure) -- you have to decide the protocol. - For HTTP -- the request message and response message are finished with a carriage return (CR or /r in C code) and a line feed (LF and /n in C code). The URL is terminated by a space character and the end of the requested file is highlighted by closing the socket. There are more complex alternatives in HTTP and many optional features, but this is the simplest way to do it. Figure 1 below explains how they fit together: Figure 1. The socket() function creates the socket and returns the file descriptor, which can be used with any function that uses file descriptors, such as read, write, and close. The arguments tell the operating system what type of socket and communication you need. On the parameters to the socket() and bind(), there are dozens of permutations and combinations. The arguments used in the program are very typical for a regular general purpose socket using IP; in my experience, other more complex options are rare. The bind() function attaches a particular port number to the socket. When a client is trying to contact your server, it will use the IP address (often found by using a DNS service to convert a hostname to an IP address) and the port number. The port number tells the operating system which service you want on the server. The details of the common port numbers on most UNIX machines are listed in the /etc/services files. These files include standard port numbers for services such as FTP (port 21), Telnet (port 23), and Web servers (usually port 80). You should check the port numbers in the /etc/services file to make sure you don't try one that is already in use. Although, if you try, you should get an error message in the log file, as it is normally impossible for two services to use the same port number. The listen() function call tells the operating system you are now ready to accept incoming requests. This is the final switch that makes the socket available to local and remote programs. The accept() function does not return to your program until there is a socket connection request to this IP address and port number. The accept() function uses the file descriptor of the socket, but a new structure for the incoming connection ( struct sockaddr_in) allows a server to check who is connecting to it. In nweb, you don't care who is connecting. Once the accept() function returns, it means that the client socket file descriptor is live. If you read bytes from the socket, you get characters from the client, and if you write bytes to the socket, they get transmitted to the client. But it is not typical to read or write the socket from the main program. Normally, you want to allow multiple clients to have access to the services of your server, and if this main program does a read or write operation, it could block until there are characters to be read or the written characters transmitted. This main program should be running the accept() function again to allow a new connection to start. The main program should start a child process that does the "talking" to the client and any work it needs performed. For the main program to close the socket, rerun the accept function and await the next client connection. When the child process is started, it inherits the parents open sockets in order to keep the socket alive. Other system calls getenv() - A simple function for returning the shell variable values. If you set a Korn shell variable $ export ABC=123, then the getenv("ABC") function would return a pointer to a null terminated string containing 123. chdir() - Changes directory. fork() - Starts a child process. In the parent, it returns the process id (PID) of the child, and in the child, it returns zero. setpgrp() - Sets the process group. The effect is for this process to break away from the other processes started by this user so it will not be affected by what happens to the users (like logging off). signal() - Decides what happens when software interrupts arrive for the process. Within the nweb.c code, the main server wants to ignore the death of a child signal. Without this, the main server process would have to run the wait system call for each child process, or they would be forever stuck in the "zombie" state waiting for the parent to call the wait()function. Eventually, there would be too many zombie processes and the user's environment would hang, as they could not create further processes. open(), read(), write()and - These are regular C library functions, but they are used for reading the sockets and files sent to the client Web browsers as the files and sockets are accessed by the file descriptor. The socket is opened with the accept()function; the open()in the code is for opening the requested file. The protocol used between the browser and the web server For complete details about the protocol, refer to the World Wide Web Consortium (W3C). Browser sends: GET URL and lots of other stuff can be ignored but some browsers or application might check it for the browser type, OS, and so on. Example: GET /index.html Example: GET /mydirector/mypicture.jpg The "/" refers to the directory at the top of the web server supported files—this is the directory specified when you started nweb as the second parameter. The web server should never send any files outside this directory. Some web servers allow specifying other directories for special file types, such as CGI scripts, but nweb does not handle such fancy services. The Mozilla Firefox 10 browser makes a request to nweb as shown in the following code: GET /index.html HTTP/1.1**Host: 192.168.0.2:8181**User-Ag ent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.5) Gecko/20100101 Firefox/10.0. 5**Accept: image/png,image/*;q=0.8,*/*;q=0.5**Accept-Language: en-us,en;q=0.5**A ccept-Encoding: gzip, deflate**DNT: 1**Connection: keep-alive**Referer: w.abcncc.uk.abc.com:8181/index.html**Cookie: UnicaNIODID=tVJWsYnAGTS-Xf5TqZJ; IB M_W3ABC_ACCESS=wwww3.abc.abc.com; IBMISP=70fdfc95d93011d783e4de784ea97766-70fdfc 95d93011d783e4de784ea97766-f67749a8b899e8ceed7e940b8c4bf189; returnURL=http%3A%2 F%2Fwww-933.abc.com%2Fsupport%2Ffixcentral%2Faix%2FdownloadOptions; PD-FROMPAGE= e%3D7.1%26function%3Drelease; PD-REFPAGE=/support/customercare/common/login%3Frt n%3Dfixcentral; PD-ERR=; PD-HOST=www-304.abc.com; PD-SGNPAGE=%2Fsupport%2Fcustom ercare%2Fcommon%2Flogin%3Frtn%3Dfixcentral; PD-REFERER=http%3A%2F%2Fwww-933.abc. com%2Fsupport%2Ffixcentral%2Faix%2FselectFixes%3Frelease%3D7.1%26function%3Drele ase; IBMISS=70fdfc95d93011d783e4de784ea97766-70fdfc95d93011d783e4de784ea97766-00 012ZSL0GV7c$TERIaw13er_zZ:15afkdghj-1340791897187-781004b2f37ec973cc8136eb5ddb53 67; rlang=en_US; ASESESSION2=EkSpHzOnrtcT90+EMdCXhRrFB3U+LxgKvOgc2ig+py0+Zq4GFgy UHQB35BGnKy4i3pb6pyO0DkVv+6S/RizqpusAst5sz+xESyBQv4dsfWVm In total, this is about 1300 bytes in size. A lot of this is in the web standard but it is largely meaningless to me! You need to read the information in The World Wide Web Consortium (W3C) for all the details. Only the first part, that is, the GET command and the file name need to be used and the remaining information can be ignored. From the HTTP/1.1, there are extra details that can be optionally used by the web server. Note that it is sending information, such as the PC operating system (here Microsoft® Windows® 7) and browser and version (here Firefox 10.0.4). This is how web servers can report details of the users who are using the site. The nweb web server checks whether: 1.This is a GET request - only GET or get is supported. 2.There are no ".." in the file name. This means that the browser or user is attempting to get a file that is not in the web server directory and is not allowed. 3.This supports file extensions such as .hmtl, .jpg, .gif and so on; only limited files types are supported. If it is a valid GET request, the nweb web server responds: HTTP/1.1 200 OK[Newline] Server: nweb/22.0[Newline] Content-Length: 12345 [Newline] Connection: close[Newline] Content-Type: text/html[Newline][Newline] Notes about this header response and the file returned: The [Newline] in the C language is \n and means two characters are send = Carriage-Return and Line-Feed. These Newline characters are not optional. HTTP/1.1 200 OK nweb does not support fancy web services, so it allows the browser know that it supports just the HTTP standard 1.1, which is the lowest used these days, and 200 is a special number informing the browser that the web server is going to respond. Server: nweb/22.0 This informs the browser about the type of web server it is connected to and the version number. In this case, the browser will do nothing as it will not have heard of nweb, but the browser can tell the user what sort of web server is at the other end, build statistics, start using web server specific features, or work around the known web server errors. It is up to the browser developer, as at least they know what is at the other end of the socket. Content-Length: 12345 Is the exact length of the file in bytes that is about to be sent. In this example, I just made up a number. The character count starts after [Newline][Newline] Connection: close This tells the browser that the web server is not going to keep the connection open for the next request, so it needs to make another socket connection for the other items of the web pages. Typically, a web page is now made up of the basic page content and hundreds of other graphics, Javascripts, and so on. Closing the link immediately is not good for performance but it makes the nmon web server code simple. Otherwise, we would have to start time out to close the sockets at some point later on. Content-Type: text/html This tells the browser about the format / content of the file that it is about to get as a response. nmon only returns text or image files and the acceptable list is in the C code in the extensions data structure. The second part is the detailed file type. In our case, based on the file extension to make life simple, I think the idea is the file might not have an extension at all or it might be wrong or meaningless. So the file extension might not tell the browser the file format. And, this gives the browser a hint about what to do with the contents. There are two,Newline characters next and this is not optional. It tells the browser that there are no more header information lines and the file content comes next. Then, the file content is sent to the browser. The browser knows when it is finished because of the length in line 3 that is counted after the two Newline characters. After the last byte of the file is sent, the nweb web server web() function stops for one second. This is to enable the file contents to be sent down the socket. If it immediately closes the socket, some operating systems do not wait for the socket to finish sending the data but drops the connection very abruptly. This would mean that some of the file content would not get to the browser, and this confuses the browser by waiting forever for the last bit of the file and often results in a blank web page being displayed. Finally, the socket is closed and the child process exits (stops). Client-side socket system calls The nweb.c code only shows you the server side of the socket. Listing 2 below illustrates the code that is required for the client side. Fortunately, the client side is much simpler, since you only need to supply the IP address and port number to make the connection to the server. In the code below, the servers IP address is assumed to be 192.168.0.42 and the server port is assumed to be 8181. In practice, hard coding these numbers in the code is not a good idea. Listing 2. Client-side socket system calls int sockfd; static struct sockaddr_in serv_addr; if((sockfd = socket(AF_INET, SOCK_STREAM,0)) <0) pexit("Network socket system call"); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = inet_addr("196.168.0.42"); serv_addr.sin_port = htons(8181); if(connect(connectfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) <0){ perror("Network connect system call"); exit(3); /* now the sockfd can be used to communicate to the server */ /* with read() and write() */ Beware: the bind() and connect() functions take a structure as the argument that must be zero filled before setting particular options. In nweb.c, the structure is made a static C variable to ensure it is zero filled when the program is started. If this structure was on the stack as a variable within the function or in the heap of the process, it could be filled with old data and so its content will not be zero filled. In such a case, you need to ensure it is zero filled; the bzero() function can be used to do this. Server source code See Listing 4 for the server source code. Listing 4 README.txt – Lots of hints and tips on how the code works in practice, compiling, running, and testing the nweb code These 200 lines of source code is offered as a sample worked example. This is all basic UNIX systems programming and most programmers would come up with something similar, so it cannot be copyrighted as original work. You are free to use it for any purpose with no limitations and no warrantee given or implied. If you do use it for some project or product, then a link to this web page or reference to it is recommended, but it is completely optional. The download includes: - nweb.c -- the source code - client.c -- sample client end source code - nweb executable files for: - AIX 6.1 TL7 for POWER - Ubuntu 12.4 for x86_64 - Fedora 17 Linux for x86_64 - OpenSUSE 12.1 for x86_64 - Debian Squeeze for ARM on Raspberry Pi - Minimum test website - index.html -- test web page - nigel.jpg -- test image file Download Resources Learn - Want more? The developerWorks AIX zone hosts hundreds of informative articles and introductory, intermediate, and advanced tutorials. - The IBM developerWorks team hosts hundreds of technical briefings around the world which you can attend at no charge. - Check out UNIX Network Programming (W. Richard Stevens -- Prentice Hall) at Amazon. Discuss - Participate in the discussion forum. - developerWorks blogs:.
http://www.ibm.com/developerworks/systems/library/es-nweb/index.html
CC-MAIN-2015-06
refinedweb
3,218
62.38
There is a lot you can do with the KendoReact Data Grid. To get an introduction into commonly used features and greet ideas about how it can be added to your projects today, read on. The KendoReact Data Grid (or Data Table, depends on what you're used to) is one of the most popular components from our React UI component library. It makes a lot of sense why this is the case, many developers are tasked with displaying data within their applications and what better way to present said data than in a tabular fashion? There's more than just displaying data in rows and columns though. This native UI component, which is a part of our native UI component library built from the ground-up for React (which means zero dependencies), has a ton of features built in to help users organize, modify, and export their data. Some highlights include: And that's not even the full list! For this blog post I wanted to take a look at some of the more popular features and how you can implement them, sticking to paging, sorting, filtering, and grouping. Overall this should give you a great foundation for how you can add the KendoReact Grid in to your applications! Before I get any further I should cover just how to prepare your project to start using the KendoReact Grid. First, we should npm install all of the packages that we may need: npm install --save @progress/kendo-react-grid @progress/kendo-data-query @progress/kendo-react-inputs @progress/kendo-react-intl @progress/kendo-react-dropdowns @progress/kendo-react-dateinputs We're installing a few packages here, but mainly we're adding in the Grid, all of the KendoReact inputs (like dropdowns and datepickers) as well as the ability to work with our internationalization and globalization packages. Next, within our component we can import our package module: // ES2015 module syntax import { Grid } from '@progress/kendo-react-grid'; Or use the CommonJS format: // CommonJS format const { Grid } = require('@progress/kendo-react-grid'); Finally, we should make sure that the component is styled in some way. We have three designs (or themes) that you can use: the Default (our home-grown theme), Bootstrap (v4), and Material themes. For this particular sample we will be using Material, based on the guidelines coming from Material Design and one of the most popular design languages today. To add in one of our themes all you have to do is another npm install like this one: npm install --save @progress/kendo-theme-material Then, to actually use this theme in our application (as in, where we need to reference our CSS) we have a couple of options. For more detail as to exactly what you can do please check out our "Styling & Themes" documentation article, but in this case I did a super simple inclusion of our theme in the header of my index.html: <link rel="stylesheet" href="" /> Not necessarily something recommended for production - we cover more real-life scenarios in the article I linked above - but certainly something that will work for this article! Now that things are installed and imported in our project, let's kick things off with the easiest scenario: Let's say we have the following array in our component's state that we want to show in our KendoReact Data Grid:" } ] }; All we really need to do is the following: <Grid data={this.state.gridData} /> That's it! We end up with a Data Table like this: As we can see the Data Table took all of our fields, automatically created columns for them and displayed them all on a single page. However, there are some things that stick out like the header not necessarily looking that great (just taking the field name), and maybe we want to display the name of our super hero first rather than last. The way that we solve this is by defining a set of columns within the table to represent our data. These columns let us also take over specifics that we may want to do on a column-by-column basis (think customization based on data) down the road. That's looking much better! Notice how the order of the columns have now changed, and the headers are looking a lot better. For paging there are a few paths we can take. Since we're going to be working with local data it means that we are responsible for slicing the data down to the proper size that we need for the pages we're dealing with. What we're going for now is fully taking over paging based on the superhero data that we mentioned above. We're taking this approach just to help step through how paging works within the KendoReact Grid on a basic level. There are many other ways, including making the Grid itself more stateful, or working with libraries like our Data Query framework and even Redux to change things. For more samples you can refer to our paging documentation section. A couple of things that I want to point out are terms that we use in the configuration of the Grid and paging: skip, take, and total. The names kind of give it away, but lets jump in to each one. skip aligns with how far in our data array we should go. This would be 0 for our initial page, but if we have a page size of 10 and want to jump to the second page we would now have a skip of 10 to start on the next "page" of data. take is pretty much our page size. If we set this to 10 it means that every page will have 10 items loaded in it. total just lets the pager know the total number of items that we are binding to. This helps around the calculation to display "X - Y of Z items" where our total is "Z." With that in mind the way that we enable paging within the KendoReact Grid is through setting the pageable property to true, and then defining the take and skip options. In our case we only have four data items, so we can make a page size of two, giving us two total pages. Nothing super exciting, but again this is to give you an idea of how paging works in the Grid. Since take and skip are dealing with our data and keeps the current state of the Grid, let's add them to our component's state, like so: class App extends React.Component { constructor(props) { super(props); this"} ], skip: 0, take: 2 } So, we skip 0, starting with my first item, and we're only setting up take to be 2 (grabbing just Superman and Batman from our array). Another piece that we have to do to implement paging is to subscribe to the onPageChange event. This event is in charge of letting us know when the page changes and in which direction (if we're paging forward or backwards). This is really just accomplished through updates to skip and take, but it also gives us a chance to modify our data tied to the Grid to the appropriate page. In our case this can be handled through a simple array.slice(), but in more advanced cases we'd do a little more with our data. Our case is super simple, all we have to do is update our state's skip and take variables to what the event gives us, which means we end up with this: this.pageChange = (event) => { this.setState({ skip: event.page.skip, take: event.page.take }) } Now we just have to configure the Grid to reflect what we've set up in our component. <Grid data={this.state.gridData.slice(this.state.skip, this.state.take + this.state.skip)} pageable={true} skip={this.state.skip} take={this.state.take} total={this.state.gridData.length} onPageChange={this.pageChange} > <Column field="heroName" title="Super Hero" /> <Column field="firstName" title="First Name" /> <Column field="lastName" title="Last Name" /> </Grid> Note what we did in the data property, as well as what we did with total. The latter is easy, we simply say that the total number of items we have is the length of our data array. What we did with data is just a workaround for us not having a "real" data connection here, rather just a local array. So, we use array.slice() and divide up the array based on the skip and take variables we have in our state. Here's the resulting Grid, with paging and all! With paging added in, let's see what it takes to work with sorting. Sorting is pretty easy to set up. First we want to add a "sort" variable to our state, just to keep track of the sorting in the Grid. While we will just sort over a single column, this should be an array since we may want to sort over multiple columns. We will just add sort: [] to our state. On the actual Grid we want to set the sortable property on the Grid, which needs a GridSortSettings object that can define if we want to sort on single or multiple columns, and if we want to give the user the ability to un-sort (remove sorting). We will keep things simple here, but if you want to dive into this more here's an advanced sample. We'll just set this to true for now ending up with sortable={true} added to our declaration Grid. Just like with paging, we have to make sure a field option is set within one of our columns binding the Grid to a field in our data. We should also define the sort property, which will give us the highlighted look of what column is currently sorted as well as the arrows that will appear next to the header text (for ascending or descending sorting). This is the field that we already defined on our state earlier, state.sort. Finally, we need to subscribe to the onSortChange event. This is just like the paging event where it gives us the opportunity to take what the user is trying to update in terms of sorting and apply it to our data. Since we're doing this locally we can just update the sort order, but if we had another data store method we would just apply the sort manually across our data. this.shortChange = (event) => { this.setState({ sort: event.sort }) } To give an idea of what this sort variable might look like, a typical sort object can look like this: sort: [ { field: "heroName", dir: "asc" } ] The above is saying that we are sorting on the heroName field, and we're doing so in an ascending fashion. We could technically set this from the start and define a sort order from the beginning, but for now we'll just leave things blank. To get the fundamentals of sorting, this is all we need to do. However, as organizing the sorting of data can be cumbersome, we can lean on the KendoReact Data Query framework to help here. This has a ton of helpful tools for us, one being orderBy which we'll use here to order our array by our sort order. Note that this is being used to help deal with the local array as a data store. For more advanced scenarios (using state management etc.) we would not really need the Data Query framework. We already added this to our project when we first did our npm install but let's import this in our component. import { orderBy } from '@progress/kendo-data-query'; We can now use orderBy() to do something like this: const data = [ { name: "Pork", category: "Food", subcategory: "Meat" }, { name: "Pepper", category: "Food", subcategory: "Vegetables" }, { name: "Beef", category: "Food", subcategory: "Meat" } ]; const result = orderBy(data, [{ field: "name", dir: "asc" }]); console.log(result); /* output [ { "name": "Beef", "category": "Food", "subcategory": "Meat" }, { "name": "Pepper", "category": "Food", "subcategory": "Vegetables" }, { "name": "Pork", "category": "Food", "subcategory": "Meat" } ] */ As we can see all that's needed is to pass in an array and then the sort object to this function. In our case this means that we need to call orderBy on our original set of data, and then pass in the sort object as well. data={orderBy(this.state.gridData, this.state.sort)} However, if we want to also have paging still we need to use array.slice again. This should be done on the result of orderBy, so we can just chain it to the end of our orderBy call. data={orderBy(this.state.gridData, this.state.sort).slice(this.state.skip, this.state.take + this.state.skip)} With all of that configured our Grid setup should look like this: If we run this code we'll see that we can sort our columns simply by clicking on the header and we get that nice indicator to showcase what direction we're sorting in. We're off to the races here! Next up is data grid filtering. This is pretty much the same setup as we have with sorting above. We need to set up a property that defines that we can offer filtering, we provide binding to our state to let us indicate what is currently being filtered (like the sort order indicator above), and finally work with an event when the filter changes. Our filters are also set up with an object that defines the filter and properties around filtering, like what kind of filter we're applying ("contains" or "starts with" etc.). We don't necessarily need to add a filter variable to our state, so we'll skip this for now. If we wanted to filter something ahead of time we could do so pretty easily by defining this object to whatever filter we want to apply. On the actual Data Grid we first set up filterable={true} that will immediately make our filter icons and the filter row appear on top of every column. Then, we set the filter property to be equal to the state variable we defined before, so filter={this.state.filter}. We then subscribe to our event, onFilterChange, and use this to update our state when a user filters. this.filterChange = (event) => { this.setState({ filter: event.filter }) } As a quick reference, the filter variable is expecting a CompositeFilterDescriptor, which really is just an array of FilterDescriptors along with a logic variable that defines if we are using "and" or an "or" filter. The actual FilterDescriptor is a bit long to go through, so I recommend looking over the documentation article I just linked to in order to see how this is built out manually. The last part that we have to do is actually modify our data. We're at a point where filtering, sorting, and paging needs to be applied to the Data Table and this can quickly become hard to track. How do we apply the sort order, filter order, and eventually even grouping on our array? Well, there's the manual way and there's the easy way: the KendoReact Data Query process function. This deserves its own mini-section here as this will save us time and effort when it comes to massaging our data for this sample. As mentioned earlier this is not a requirement to use with the Grid. In fact, many of you will have your own state management already set up. This is something that is super helpful for dealing with data in local arrays or without existing state management. Perfect for this particular sample. Also, depending on where you are in your React journey this might be something that you rely on for your first project or two while working with the KendoReact Grid or some of the other data bound components. The process() function simply takes in our initial data as its first parameter, and as the second it takes an object that contains the skip, take, sort, filter, and group (more on grouping soon) variables that come from the Grid (or are pre-defined) and applies all of these options on our data set, outputting everything into a DataResult object, which the KendoReact Grid uses to have an idea of current page, filter, sort, and group options. Since we're not using a state management library like Redux, we'll be relying on this method throughout the rest of the sample. This ultimately saves a ton of time binding to our data bound components like the Grid with a local array, just like we're doing here. Now that we know about the process function we can import this instead of our orderBy function (from the same package). import { process } from '@progress/kendo-data-query'; Then, in our data prop we just do the following: data = { process(this.state.gridData, this.state) } How easy is that? Because we already are defining all of the variables we need in our component's state, we can just pass in this.state without creating a new object! The outcome is the following, which now has us filtering, sorting, and paging across all of our data! Before we proceed any further, you may have noticed that it is quite busy in our component right now. We've got all of these settings that have been configured on the Grid, all of the fields on our state, and all of these events that are firing. Just like we used process() to simplify our data binding, could we do the same with setting up our Grid? Maybe I'm making it too easy to set this up, but the short answer is that yes, it's certainly possible to make things easier! Let's chat about onDataStateChange. The onDataStateChange event fires every time the state of the Grid changes. This means that all of our calls to onPageChange, onSortChange, onFilterChange (and soon onGroupChange when we get to grouping) can get replaced with one single onDataStateChange subscription instead. We'll want to use this event, but we may want to take a look around the rest of our code first. Right now we do a lot with setting everything right on the root of our state object. It would be a bit more structured if we define a variable to specifically hold all information relating to the Grid, so let's call this gridStateData and put our skip and take variables there. this.state = { gridStateData: { skip: 0, take: 2 } } With that, we can move to implementing onDataStateChange with the following: this.dataStateChange = (event) => { this.setState({ gridStateData: event.data }); } Next, let's make the state of the component a little bit simpler and move our data outside of the state and instead pass it in to our React component, something you'll probably be looking to do even in simpler applications. This will be outside of our component's scope and right above the ReactDOM.render function. Don't forget to add a prop and pass in the data! const appData = [ { "} ]; ReactDOM.render( <App gridData={appData} />, document.querySelector('my-app') ); This means that we will have to update the data prop on our Grid to be the following: data={process(this.props.gridData, this.state.gridStateData)} Notice how we're calling this.props.gridData here since we're now passing this into the component through a prop. Another area that we can look into, since we're using process() and onDataStateChange to update and set the state upon every sort, filter, page, and group action, is to eliminate a lot of redundant properties as well. While we technically have to use things like sort, skip, take, etc. within the Grid - why write them on the Grid when they are readily available within our state.gridStateData? We can use ES6 Spread Operator to pass the whole props object. We just need to add {...this.state.gridStateData} to our Grid's declaration. We end up with this in the end. <Grid data={process(this.props.gridData, this.state.gridStateData)} {...this.state.gridStateData} filterable={true} sortable={true} pageable={true} onDataStateChange={this.dataStateChange} > <Column field="heroName" title="Super Hero" /> <Column field="firstName" title="First Name" /> <Column field="lastName" title="Last Name" /> </Grid> Look at how clean that is in comparison! Just as a reference, here's what we have so far in our component. The last piece we should cover is data grid grouping. There are a couple more things to keep in mind when setting up a group, but starting with how the initial configuration might look ends up being similar to what we've done so far. Much like sorting and filtering, we need to set of our groupable, group, and onGroupChange configuration options. Configuring these will give us the ability to drag-and-drop a header to start grouping, or group on a field initially. There's another part of grouping that we may not initially think of, and this is the Group Header of any group. This is what lets us provide information about our group which is initially just the value of the field we're grouping on, but what about adding in additional information like aggregates here? Also, this contains the expand and collapse icons, which should be tracked somewhere in our state and consumed by the Grid. This is why there are two other configuration options we will need to set up: onExpandChange, which fires every time we collapse or expand a group, as well as expandField, which lets us define if an item is expanded or collapsed based on the value of this field. With that information fresh in our heads, let's go ahead and set up some grouping! First, let's add groupable={true} on our Data Grid. We don't need to define onGroupChange because we use onDataStateChange. Also, group will be defined once we group thanks to the spread operator {..this.state.gridStateData}. This just leaves the two additional configuration options to set up. Let's set expandField="expanded". the expandField prop is what will check if a data item is expanded or not (will only be added to our group header items) and it doesn't matter that we have not defined this elsewhere, even in our original. The Grid will simply add this if it's not available when we expand or collapse. We can get away with this since we are working with a local array, but other scenarios may call for keeping track of expanded items separately from our original data. After this we will need to set up onExpandChange to make sure we capture when an item is expanded and update the state accordingly. So, we add onExpandChange={this.expandChange} to our Grid and then set up our this.expandChange function like this: this.expandChange = (event) => { event.dataItem[event.target.props.expandField] = event.value; event.target.setState({}); } A note to be made here is that event.target.setState({}); is purely for the sake of this demo since we're dealing with local data. The KendoReact Grid (which is the event.target) does not have an internal state, which is why we are setting all of these variables in state.gridStateData. Calling setState({}) with an empty object will refresh the Grid based on the updated information around if an item is expanded or not. In a more real-world scenario this wouldn't be our setup since we probably wouldn't be dealing with local arrays like this. Looking at the first line in this function, we're accessing our expandField variable in a safe way on our data item since this might come up as undefined otherwise. Also, it gives us flexibility in case we update the expandField that we want to track expand and collapsed state in later. We set this to event.value which will be true or false depending on if we are expanding or collapsing the group. That should be all we need to add in grouping! What is left is to actually try it out by running our sample and dragging a column header to the area that appears once we set groupable on our Data Grid. Here's the source code to the finished product, which is a Data Grid that can handle paging, sorting, filtering, and grouping! For fun you can always swap out the way you load data (maybe through a JSON file somewhere) and see that this will still work since we've created a fairly generic setup with this. This blog post covered a lot so far, but we just went with a basic set of features. We covered this all through binding to a local array rather than something like Redux (which we can certainly bind to by the way). So, we really just scratched the surface and there's even more the KendoReact Data Grid can do! Just as a small teaser sample, there's editing, hierarchy, PDF export, Excel export, cell templates, column resizing, column reordering, and way more! Beyond this there are also customizations that can be done with how we display filters, more around grouping - the list goes on and on. Overall its impossible to cover everything the KendoReact Data Grid can do in one single blog post since there's so much that can be done with the component. This is really why the KendoReact Data Grid documentation exists, and there's plenty more samples showing what the Grid can do. What we tried to accomplish here, is to provide a "Grid 101" intro into the commonly used features and explore ideas about how KendoReact Grid can be used in your projects! If you're new to KendoReact, learn more about the set of UI components or feel free to jump right into a free 30 day trial..
https://www.telerik.com/blogs/introduction-to-the-kendoreact-grid
CC-MAIN-2021-21
refinedweb
4,308
67.99
On 2011-12-16 22:40, Daniel Dehennin wrote: > Niels Thykier <niels@thykier.net> writes: > >> Hi, > > Hello, > Hi, Thanks for the feedback. I am quoting your reply in full for the sake of debian-lint-maint. :) > [...] > >> I am proposing the "Vendor Data Files" as an extension to the current >> "Vendor Profiles". It is not a "Silver Bullet" (tm), but it should >> solve #648777 and #649852 just nicely. > > +1 > > [...] > >> >> The second alternative would be to implement Vendor specific checks >> (#359059). However, I think it would be a terrible solution to #649852 >> (effectively, suppress the debian tag and re-implement with an exception >> for the particular field). > > +1, I think about checks as package structure validation, each vendor > only need to supply the set of values for each "structure item" (like > possible distribution names for examples). > > >> Proposed solution: >> ------------------ >> >> Technically I suggest we create a "vendor" directory in data for this >> purpose. Each subdir maps to a vendor and inside the vendor subdir is a > > [...] > >> If a file is missing form the vendor data dir, we look for a data file >> in its "parent vendor" directory until we run out of "parent vendors". >> At this point we look for it in data/, where our default file will >> be[2]. > > +1 > > Do you think there is a possibility to have version specific under each > vendor? > "You" (i.e. the vendor) could encode the version as a part of the profile name (e.g. debian/v6_02 or ubuntu/v1110). This plus a data dir for each Lintian profile should solve that. > If I have a "build spooler", I want it to be "bleding edge", the build > machines and chroots are version specific, is it better to run lintian > on the build machine or the "build spooler"? > I would say it depends on the build guidelines for the distro in question. In Debian, generally you want "bleeding edge" Lintian for "bleeding edge" packages. We see frequent backports of Lintian to stable-backports to help developers, who have a stable system. I assume this holds for most other Debian-based distros, but that is only a guess on my part. > >> Extension: >> ---------- >> >> The above is the "simple" solution to the problem. Though I am thinking >> we could do with extending it a bit. The problem I want to address is >> that changes to the Debian file will not automatically apply to >> derivative files. Depending on the data file in question this may (or >> may not) be a good default. >> My proposal here would be to include some simple "processing" >> statements to our data files. I believe the following will do: >> >> @include-parent >> @delete <key> >> >> >> The semantics of them are: >> >> @include-parent > > [...] > >> >> @delete <key> > > [...] > >> With the extension, I believe we should be able to handle most common >> cases, avoid some copy-waste and (more importantly) "out-of-date" data >> files for derivatives. > > Why not making @include-parent the default? > > I think default include will lower the need to redefine things: > > - people who need to redefine everything get the same amount of works: > everything is included and they need to set/delete values > > - people who need few modifications will just need to define few > set/delete values > > Default include will permit to keep the "policy compliance" up to date, > when parent change something: > > - people how don't want it need to update their data to set/delete value > > - other just need to do nothing if the value is ok for them, or set it > to something else > Personally, I think an explcit "@include-parent" is better than it being default semantics. It tells the reader that there is more to the file than the lines in it. As a Lintian maintainer, either way is fine for me because I will be working with it often. But I am afraid "newcomers" may find it surprising that parent files are parsed by default. > >> Open Questions: >> --------------- >> >> Open question: Is parent vendor defined in terms of "dpkg-vendor" or in >> terms of Lintian profiles's "Extends:" relation? Which is less >> confusing/most useful? >> - I admit thinking dpkg-vendor for the first hour of writing this >> email. >> - But would the "Extends" relation be more useful? > > > Why not intersection of both? > I do not see how you could that. Do you have a proposal for how that it would work? > The dpkg-vendor origin seems not well documented[1], not the case of > lintian profiles[2]. I even doesn't know dpkg-vendor before someone > point me to it on IRC recently. > >> Open question: would it be better to have a "Data-directory" field in >> the Lintian vendor for vendors that need this? > >> How do we handle "sub-vendors" (e.g. --profile vendor/group)? >> - Trivially solved if we use "Data-directory" in the Profile (see >> above) >> - It is not unreasonable to think that if #359059 is fixed there will >> appear some "debian/pkg-$group" profiles/checks. >> - Should a sub-vendor be allowed to have its own data-files >> - obsolete-packages and deprecated-makefiles comes to mind as >> possible use cases. > > [...] > > Not sure to understand this point. > > Instead of a default value of 'LINTIAN_ROOT/data/<vendor>', let the > vendor specify the directory where its data are? > Basically yes, but ... > If we can have some collision between group names and vendor names, then > could we put the vendor data under > 'LINTIAN_ROOT/vendors/<vendor>/data/', similar to you [2] point. > > Groups data will under 'LINTIAN_ROOT/vendors/<vendor>/<group>/data/'. > now you mention it, using something like LINTIAN_ROOT/vendors/$PROFILE_NAME/data/ it probably a better idea. It would be consistent and would come with a built-in namespace. >> [2] A variant here is to only have vendor dirs and move all current data >> files into "data/debian/". > > Is that the issue? > No, it was just a suggestion to move the default data set from LINTIAN_ROOT/data/ to the "Debian vendor specific data" directory. > Regards. > > Footnotes: > [1] > > [2] > ~Niels
https://lists.debian.org/debian-derivatives/2011/12/msg00010.html
CC-MAIN-2015-18
refinedweb
978
63.59
0 Hi I'm trying to make a program that returns the number of letters in a string but it seems that the function I have is not working as it returns 0 every time. Can someone check what I'm doing wrong? Thanks in advanced. #include<iostream> #include<string> using namespace std; unsigned letters(const string a); int main(){ int i; string a; cin >> a; cout << letters(a); system("pause"); } unsigned letters(const string a){ int i; int countL = 0; for(i=0;a[i]!='\0';i++){ if (a[i] >= 'A' && a[i] <='Z' && a[i] >= 'a' && a[i] <= 'z') countL++; } return countL; }
https://www.daniweb.com/programming/software-development/threads/332370/program-that-counts-of-letters
CC-MAIN-2016-50
refinedweb
104
70.94
Prov-o draft review 2 April 2012 This page is managing the feedback from the four reviews of Changes are being reflected at Luc Luc's feedback is archived in this email.. OPEN(Stian) References to the provdm:components are not explained. It linked to nowhere. What were the colors for (beyond being the ones in dm)? RAISED(Tim) *. OPEN(Tim->Luc) Is there respec magic to pull from DM's sotd? Where is the pre-respec original source of the working drafts? 2. section 1: remove reference to OWL semantics. PENDING-REVIEW(Luc) Removed ref to OWL2-DIRECT-SEMANTICS. Did you want OWL2-RDF-BASED-SEMANTICS gone, too? 3. section 1: the prov-dm document no longer contains this example. I suggest that you make your presentation self-contained. PENDING-REVIEW(Luc) changed it to "To demonstrate the use of PROV-O classes and properties, this document uses an example provenance scenario similar to the one introduced in the PROV-Primer PROV-PRIMER." 4. When the ontology stabilizes, you need to manually layout the box with all classes and relations. Alphabetical order is not useful here. I would prefer to see a more logical ordering. RAISED(Tim->Luc) Are you referring to the ? It has: - prov:actedOnBehalfOf - prov:endedAtTime - prov:startedAtTime - prov:used - prov:wasAssociatedWith - prov:wasAttributedTo - prov:wasDerivedFrom - prov:wasGeneratedBy - prov:wasInformedBy - prov:wasStartedByActivity If I had to "logically order", I'd do: - prov:startedAtTime - prov:used - prov:wasGeneratedBy - prov:endedAtTime - prov:wasDerivedFrom - prov:wasAssociatedWith - prov:wasAttributedTo - prov:actedOnBehalfOf - prov:wasInformedBy - prov:wasStartedByActivity Would that be better? 5. provo:Trace but provdm:Traceability. We should adopt a single term. I don't mind which. PENDING-REVIEW(Tim->Luc) The other kinds of DM Derivation are nouns ( 4.3.1 Derivation 4.3.2 Revision 4.3.3 Quotation 4.3.4 Original Source) Can we change DM to Trace? (it now appears that DM uses "Trace") 6. Section 3, text following figure 1 refers to wasStartedBy instead of wasStartedByActivity PENDING-REVIEW(Luc) fixed. And added them as links. 7. section 3: a picture (in PROV style!) would be desirable to illustrate the example OPEN(Tim) 8. section 3.1: the example includes prov:Organization which is a term defined in section 3.2. OPEN(Tim) 9. Is it necessary to see both foaf:Organization and prov:Organization? foaf:Person and prov:Person? OPEN(Tim) 10. Section 3.2: example has not the correct namespace. Need to check everywhere. OPEN(Tim) need to edit 11. Section 3.3: choice of name: you have prov:qualifiedUsage, etc why not simply prov:usage? Jun:. CLOSED(Luc) "qualified" before each of these is a grouping mechanism in place of what was the prov:qualified super property. So that these properties follow the same pattern. ## Unqualified form: :res :unqual :reso . ## is qualified as: :res prov:qualifiedXX :involvement . :involvement a prov:XX; prov:entity :reso; # or prov:activity :reso; # or prov:agent :reso; # or prov:collection :reso;. OPEN(Tim) 13. section 3.3 last example: ex:usage, ex:generation, ex:activity are not defined. It would be good to see, in particular, ex:usage and ex:generation Maybe the names are not great for these instances. OPEN(Tim) add "_1" and add their descriptions. 14. section 3.4: is the rdf correct? :c1 a prov:Collection . <- prov:derivedByInsertionFrom ... Indentation is not clear either. CLOSED(Luc) all three collection examples now pass syntax check and had their indent fixed for readability. 15. section 3.4: knownMembership I don't think it's a good name for this property. It should be membership, since it may be known, inferred, or guessed. CLOSED(Tim) changed in OWL file and provrdf. 16. Generally speaking, it's quite advanced to see an example on collections so early. It seems to give importance to this kind of concept that does not reflect its real importance. It's also one of the most speculative bit in the model. RAISED(Luc) 17. Section 4 is quite arid to read from beginning to end. But I appreciate it's designed mostly for online navigation. Generally, section 4 should handle all terms systematically. - use the prov-dm definition OPEN(Tim) - illustration with an example (generally, these need to be formatted properly, otherwise they are not readable) OPEN(Tim) - further comments, OPEN(Tim) there are further comments in OWL, I just need to reconcile styling and presentation. - etc. - characteristics do not seem to be expressed for all (see below) OPEN(Tim) some terms currently have no comment. OPEN(Tim) 18. Definition of agent in section 4 is not the same as in 3.1 OPEN(Tim) section 4 is from DM, need to update 3.1. 19. Text about properties should adopt a same style. prov:wasGeneratedBy: wasGeneratedBy links Entities ... prov:used: A prov:Entity that was used by ... OPEN(Tim) 20. Account: is defined in terms of a mechanism? In any case, that's an issue to solve for PROV RAISED(Tim) that's what DM said recently. 21. traceTo is supposed to link to and from Agents, but they are not listed in domain/range. OPEN(Tim) That's what I thought it was, but then I thought it was changed to JUST entities (Per Paolo's review on the OWL draft review). 22. prov:Start/prov:End/prov:Generation ... are defined in terms of event as in part II, and not as in prov-dm part I. RAISED(Tim->Luc) - need some clarification on this. 23. Role is defined in the context of usage, generation, association, start and end, but hadRole has all involvments in its domain, including derivation and collection-derivations. CLOSED(Luc) This is a perennial complaint that can't be fixed using only RL. Also, the axioms do not support this "Derivations must have prov:hadRole" interpretation.] 23 prov:Source. Do we need to introduce a class for this? Why not just use Entity? RAISED(Luc) prov:Source is not the sourced Entity, but the qualification between the derived Entity and the sourced Entity. prov:Source is in the same neighborhood as prov:Derivation, prov:Quotation, etc.. OPEN(Tim->Luc) delete or update? Is this needed in the final version? Simon Simon's feedback is archived in this email.. PENDING-REVIEW(Simon) The 7th paragraph was removed. The 6th paragraph refers to "Classes and Properties", but this capitalisation is not used before or after. PENDING-REVIEW(Simon) lower cased this. 7th paragraph: "creation of crime statistics file" -> "creation of a crime statistics file" PENDING-REVIEW(Simon) This paragraph was removed. Section 2: 4th paragraph: "While those relations are..., these terms are..." It is unclear what "those" and "these" refer to. PENDING-REVIEW(Simon) changed to "While the relations from the previous two categories are applied as direct, binary assertions, the terms in this category are used to provide additional attributes of the binary relations." Section 3.1: The definition of Entity now needs updating to match the current DM following recent discussions, I think. OPEN(Tim) *? OPEN(Tim) While I understand the example is not meant to exactly match the primer's, you might want to update it to match the current primer in a couple of regards. Stian suggested that "Chart Generators" should be "Chart Generators Inc" to avoid it sounding like an activity. OPEN(Tim) need to update dropbox, push to hg, and pull to aqua Also, the primer now uses the less verb/noun-ambiguous "compose" rather than "aggregate". OPEN(Tim) need to update dropbox, push to hg, and pull to aqua Section 3.2: 1st paragraph: "to describe address" -> "to describe the address" PENDING-REVIEW(Simon). PENDING-REVIEW(Simon) now has prov:Plan reserved. * Why is "Responsibility" the qualified name for actedOnBehalfOf and not wasAssociatedWith, when the latter defines responsibility and the former only defines delegation? OPEN(Tim) * Why is there a discrepancy between the names of wasInformedBy and Communication? It isn't so important, but will make RDF containing both qualified and unqualified relations harder to interpret without matching names. RAISED(Simon) I totally agree, but this is a DM issue, no?. RAISED(Simon) (This is a DM issue, no?) I agree, having a Value (i.e., URI) as a key would be more flexible, but becomes heavier weight. I reconciled my identical concern by convincing myself that the literal value is implicitly contextualized by the collection containing it. Penultimate paragraph: ":c2, which content" -> ":c2, whose content" PENDING-REVIEW(Simon) changed. Section 4: * Why do most terms include definitions, but some do not? It would be good to check for consistency. OPEN(Tim) Update definition of Entity following recent discussions. RAISED(Simon) where is the authoritative "new" definition? Once it makes it to DM, I can push it to PROV-O. * Location is defined such that it "can also be a non-geographical place such as a directory, row or column". This sounds like it directly relates to collection keys and the text at the start of Section 3.4, but no connection is made explicitly. RAISED(Simon) Very good point. But is a connection made explicitly in DM? Are you proposing that prov:key is a rdfs:subPropertyOf prov:hadLocation? If so, the ranges would need to be reconciled (datatype vs. object). * Shouldn't wasRevisionOf have super-property alterateOf (as well as wasDerivedFrom)? Isn't part of its meaning that it is the both domain and range of wasRevisionOf are revisions of a common thing? OPEN(Tim) I agree that prov:wasRevisionOf should be subpropertyOf alternateOf. Your second question seems like a reasonable argument for that.. OPEN(Tim) PENDING-REVIEW(Simon) Sorry for the confusion. The end of the abstract now states "The OWL encoding of the PROV Ontology is available here." Can the document be released as a next public working draft? If no, what are the blocking issues? = Definitely Thanks, Simon Paul Paul's feedback is archived in [< this email].. CLOSED(Tim) references to DM components were removed in the cross reference section. * Would any additional comments (or attributes) help you read the cross reference list in PROV-O HTML? * I wonder if one example for each of the constructs should appear in the cross reference list. CLOSED(Tim) infrastructure added. Examples need to be populated at * A link to the prov-dm document would be good. OPEN(Tim) They are in the OWL already, just a matter of exposing it in the cross reference script. *. RAISED(Paul) * RAISED(Tim) * There should be a brief description of the changes since the last working draft. OPEN(Tim) ## Introduction ## * I think a link to the ontology itself should be very visible in the introduction. e.g. "The ontology can be downloaded from here" PENDING-REVIEW(Paul) done in the abstract. * The namespace should be more visible in the introduction. OPEN(Tim) * The following sentence is repetitive - "The PROV Ontology can be used directly in a domain application, though many domain applications may require specialization of PROV-O Classes and Properties for representing domain-specific provenance information." RAISED(Tim) * OWL-RL is just mentioned. Does this need to be motivated? PENDING-REVIEW(Paul) Rephrased to "PROV-O conforms to the OWL-RL profile and is lightweight so that it can be adopted in the widest range of applications." and introduces the paragraph on extensibility. ## PROV-O at glance ## * The classes and properties should be labelled as such in the boxes. PENDING-REVIEW(Paul) "Class: " or "Property:" appears before the qname/curie in each entry in the cross section. *" RAISED(Tim) * I wonder if collection classes and properties should become a subsection or linked from the expanded classes and properties section. In general, to me they are on par with these other notions and it seems that we both over and understate their importance with a separate section. OPEN(Tim) agreed. this fits well under the intention of "expanded" as additional / specializations of the starting points. ##The PROV-O Ontology Description## * I really like the diagram! * It would be good to put links to the definition of the properties as you introduce them. OPEN(Tim) Maybe actually drawing out these definitions as bullet points ws would be good. OPEN(Tim) * In the example, can we change the organization from "civil action group" to "external organization" or a "newspaper" OPEN(Tim) * The explanation of the example is hard to read because of the examples in orange. RAISED(Paul) what do you suggest? A picture of the example would be good here. OPEN(Tim) ##Expanded Terms## * Not all the terms are introduced. The section kind of stops with the example. I would suggest saying that either that this is just an example or introduce more of the terms OPEN(Tim) * You talk about shortcuts but what this means is not clear. This should either be dropped or expanded. OPEN(Tim) ##Qualified Term## * Great section. Really shows how to use qualification. * The Qualified Pattern is introduced but I would expect the pattern itself in its generic form to be introduced and then an example of its application given. OPEN(Satya) ##Collections## * A diagram would be especially helpful here showing how each collection is built up. OPEN(Tim) * I would emphasize that this is not to represent collections generically but to represent how collections are constructed or created. RAISED(Tim) ##Cross reference## * A very nice reference over all. * I would remove "in PROV component", it's confusing. PENDING-REVIEW(Tim) it is removed now. * The notation should be introduced (e.g op and dp) PENDING-REVIEW(Tim) added to * Some of the classes and properties are missing definitions. I assume this can be fixed by importing from prov-dm OPEN(Tim) Jun has added rdfs:comments, prov:definitions of classes are there, Tim still needs to work infrastructure to get properties to reuse definitions of their qualifiedForms (some owl annotations and pythoning). * What is a property and what is a class should be denoted more clearly. e.g. Class - prov:Activity PENDING-REVIEW(Tim) prepending "Property" or "Class" now: e.g. "Property: prov:wasAttributedTo" at *. RAISED(Tim) * There should be a link to the prov-dm definition. OPEN(Tim) #OWL Document# ##Annotations## * It would be good to define your annotations in the comments to the owl file. For example, I didn't first grasp the difference between category and component in the annotations. This could be also given in the comments of the annotation definitions. CLOSED(Tim) emailed Paul asking if he has a solution in mind. 16 Apr. Jun and Tim added rdfs:comments directly in the file. * The class hierarchy is nicely balanced. However, there are some things that stick out. For example, KeyValuePair, Membership and Location all seem to be dangling. I wonder if we can collect these somewhere. RAISED(Tim) * Is Membership an Involvement? RAISED(Tim) * In the comments of Involvement should we note that this is used for organization purposes? RAISED(Tim) * properties do not seem to have rdfs:label OPEN(Tim) * refs:label need to be defined with their language tag OPEN(Tim) * should we define the category and component with urls. Currently, we are using keywords to define our vocabulary here. It seems that being able to dereference these definitions would be good. RAISED(Paul) we could put them into the ontology as instances with comments. Oh, wait - this is a prov:Collection! *. RAISED(Paul) * It would be good to have back pointers to the ontology document itself as annotation properties. OPEN(Tim) using rdfs:isDefinedBy ? * Hmm… I wonder how in the ontology we can point people to the involved set of properties, as these are actually the core but it's not what one sees at the top-level RAISED(Tim) Sam Sam's feedback is archived in this email.. OPEN(Tim). RAISED(Sam) Section 3.4: Here, prov:Collection is defined. This section needs a motivation why prov:Collection is introduced and why no other collection representation is chosen. RAISED(Sam) Section 4.2: specializationOf Can`t this property be made transitive? If not, a motivation would clarify this. RAISED(Tim) Section 4.2: wasRevisionOf Is a revision directly related to the previous `version` of an entity? If not, this property can be made transitive. RAISED(Tim) Eric. OPEN(Tim) make sure SOTD covers this concern. Section 3.1 Direct links corresponding from PROV-O class to PROV-DM model element would make references between the two documents more intuitive. E.g. Class Description Entity is defined to be "An Entity represents an identifiable characterized thing." [1] OPEN(Tim) Ted Ted's feedback is archived in this email. - <> RAISED(Tim) 2. I would appreciate a repeat of Figure 1 at the start of section 4.1. RAISED(Tim) I would also appreciate a complete set of illustrations similar to Figure 2 at the start of section 4.2 RAISED(Tim) .) RAISED(Tim) re: 2. PROV-O at a glance <> 4. prov:wasStartedByActivity and prov:wasStartedBy should swap positions, between "Starting Point classes and properties" and "Expanded classes and properties". The former is clearly a refinement of the latter. RAISED(Tim) Further, I think there should be a new prov:wasStartedByAgent (and *possibly* prov:wasStartedByEntity, if an Entity can act...), parallel to prov:wasStartedByActivity. RAISED(Ted) This is an issue on DM, not prov-o.). RAISED(Tim) This is a clean approach, but not what DM says. Those changes will necessarily have reflections throughout the following and connected documents... re: 3.1 Starting Point Terms <> 5. The diagram (and explanatory text) lacks prov:wasStartedBy (and new sub-property/ies prov:wasStartedByActivity and prov:wasStartedByAgent). RAISED(Tim)... OPEN(Ted) "The provenance of an prov:Agent may be provided by describing the agent as a prov:Entity, either in the same provenance document or another."." OPEN(Tim) re: 3.2 Expanded Terms <> 8. "Derek detects a typo. He doesnt' want to record" I detect a typo. "doesnt' want" should be "doesn't want" CLOSED(Tim) got it. expanded to "does)." PENDING-REVIEW(Ted) agreed. I changed to your phrasing. I suggest also tweaking all matching lines in the example block, from -- prov:atLocation ex:more-crime-happens-in-cities; ##PERMALINK of the post -- to -- prov:atLocation ex:more-crime-happens-in-cities; ##PERMALINK to the (latest revision of the) post PENDING-REVIEW(Ted) Thanks, that is much clearer, especially for those that are not as familiar with blogs.". PENDING-REVIEW(Ted) You're right. Changed. Though I began this cycle at the conclusion of last week's call, I've only gotten this far to this point (the morning of this week's call) ... but it seems better to put this partial review out now, than to delay it further. Speak with you soon, Ted
http://www.w3.org/2011/prov/wiki/index.php?title=Prov-o_draft_review_2_April_2012&redirect=no
CC-MAIN-2014-41
refinedweb
3,112
50.73