text
stringlengths
20
1.01M
url
stringlengths
14
1.25k
dump
stringlengths
9
15
lang
stringclasses
4 values
source
stringclasses
4 values
The new SQL Native Client is a single dynamic link library (DLL) that can be used in OLE DB and ODBC interfaces because it includes both data providers. By using SQL Native Client, applications can use the new SQL Server 2005 features. Some new SQL Server 2005 features that require SQL Native Client are XML Datatype Support, Multiple Active Result Sets, and Query Notification. As you learned in Chapter 5, Designing a Database to Solve Business Needs, SQL Server 2005 includes a new datatype designed to store XML documents and XML fragments in the database. Because this datatype was not included in previous versions of SQL Server, the standard SQL Server client does not provide support for this datatype. SQL Native Client adds the DBTYPE_XML datatype in the OLE DB provider and the SQL_SS_XML datatype in the ODBC provider. From the ADO.NET programming perspective, applications do not need to be changed to access the xml datatype because it is always converted to a string type. A new feature of SQL Server 2005 supports multiple active result sets (MARS). In previous versions of SQL Server, the application would fail if it tried to use multiple active statements. For example, the following code (included as \Ch06\Sample10.vb in the sample files) fails in the cmdUpd.ExecuteNonQuery() statement because it tries to open a result set in the same connection as that which the cmdSel object is using. Dim conn As New SqlClient.SqlConnection( _ "Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True") Dim cmdsel As New SqlClient.SqlCommand( _ "SELECT DepartmentID FROM HumanResources.Department", conn) Dim cmdUpd As New SqlClient.SqlCommand( _ "UPDATE HumanResources.Department SET ModifiedDate=GETDATE() " + _ "WHERE DepartmentID=@DepartmentId", conn) Dim par As SqlClient.SqlParameter = _ cmdUpd.Parameters.Add("@DepartmentId", SqlDbType.Int) conn.Open() Dim dr As SqlClient.SqlDataReader = cmdsel.ExecuteReader While dr.Read par.Value = CInt(dr(0)) 'Other operations cmdUpd.ExecuteNonQuery() End While dr.Close() conn.Close() The previous code returns an InvalidOperationException with the following message: There is already an open DataReader associated with this Command which must be closed first. When using MARS, the same code above will succeed. To enable MARS, add the following text to the connection string: MultipleActiveResultSets=True Because many applications use the ADO.NET disconnected model, they cache tables in memory. Therefore, data in the server may change without the applications knowledge. To avoid this situation, SQL Native Client provides the Query Notification feature. From the Start menu, choose All Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005. From the File menu, choose New Project. In the Project Types section, select Visual Basic and choose the Windows Application template. Name the project NotificationTest and click OK to create the project. If the Toolbox is not visible, select Toolbox from the View menu. Add a DataGridView and name it dgDepartments . Double-click the Windows Form (not the DataGridView) to add the Load event. Scroll to the top of the code and, just below the first lines, add the following Imports statement (included in the sample files as \Ch06\Sample11.vb) to reference the SQL Client namespace. Imports System.Data.SqlClient Within the Form1 class declaration, declare the depend variable of SqlDependency type, enabled to manage events, as follows (also located in \Ch06\Sample11.vb): Dim WithEvents depend As SqlDependency In the forms Load event, write the following code (also located in \Ch06\Sample11.vb): Dim AdventureWorks As String = _ "Data Source=(local);Initial Catalog=AdventureWorks;" + _ "Integrated Security=True" Dim Conn As New SqlConnection(AdventureWorks) Dim CmdSel As New SqlCommand( _ "SELECT DepartmentID, Name FROM HumanResources.Department", Conn) depend = New SqlDependency(CmdSel) Dim da As New SqlDataAdapter(CmdSel) Dim ds As New DataSet SqlDependency.Start(AdventureWorks) da.Fill(ds) dgDepartments.DataSource = ds dgDepartments.DataMember = "Table" Add the depend_OnChange event as follows (included in the sample files as \Ch06\Sample12.vb): Private Sub depend_OnChange(ByVal sender As Object, _ ByVal e As System.Data.SqlClient.SqlNotificationEventArgs) _ Handles depend.OnChange MsgBox("Data has changed in the server, reload the dataset") End Sub Save and run the application by pressing F5. The department data will be displayed. Without closing the application, open SQL Server Management Studio by choosing Start All Programs Microsoft SQL Server 2005 SQL Server Management Studio. Connect to the database engine using Windows Authentication. In Object Explorer, expand the server node. Expand the Databases folder, the AdventureWorks database node, and the Tables folder. Right-click the HumanResources.Department table and select Open Table from the context menu. Modify any of the department names , and the depend_OnChange event will fire, displaying the message box you coded in Step 10 above.
https://flylib.com/books/en/3.166.1.52/1/
CC-MAIN-2021-43
en
refinedweb
The libsdl direct media library is open source and cross-platform. It helps that it’s also part of Linux already. You can see this if you open a terminal and do a apt-cache search libsdl2 | grep dev This will show you what libraries are available david@david-VM-PC9:~$ apt-cache search libsdl2 | grep dev libsdl2-dev - Simple DirectMedia Layer development files libsdl2-gfx-dev - development files for SDL2_gfx libsdl2-image-dev - Image loading library for Simple DirectMedia Layer 2, development files libsdl2-mixer-dev - Mixer library for Simple DirectMedia Layer 2, development files libsdl2-net-dev - Network library for Simple DirectMedia Layer 2, development files libsdl2-ttf-dev - TrueType Font library for Simple DirectMedia Layer 2, development files Although SDL is available, the dev files aren’t installed by default and we want all the headers for C/C++ programs to use them. We need to install the devs for the libraries we’ll need which are libsdl2-dev, libsdl2-image-dev (you do want to display graphics don’t you?), libsdl2-mixer-dev (for sounds) and if you want text you’ll need libsdl2-ttf-dev. So install all those with sudo apt install libsdl2-dev sudo apt install libsdl2-image-dev sudo apt install libsdl2-mixer-dev sudo apt install libsdl2-ttf-dev Where do the headers get installed? A quick search for sdl.h found it and associated header files in /usr/include/SDL2, a total of 76 header files though we’ll rarely use more than half a dozen. Note. When I first wrote this, Ubuntu was on 18.04 LTS and clang was 6. When I updated this on 20.04 LTS, clang was version 10.0 and I got a weird include error. The source code hasn’t changed but the VS Code JSON files have been altered slightly. This is tasks.json { "version": "2.0.0", "tasks": [ { "type": "shell", "label": "clang-10.0 build active file", "command": "/usr/bin/clang-10", "args": [ "-g", "${file}","${workspaceFolder}/hr_time.c", "-o", "${fileDirname}/demo", "-I/usr/include/SDL2", "-lSDL2" ], "options": { "cwd": "/usr/bin" }, "group": { "kind": "build", "isDefault": true } } ] } The two changes between this and earlier versions are the command line to compile which is now /usr/bin/clang-10 though I think clang without the -10 will also do. The second change luine is the addition of "-I/usr/include/SDL2", which tells the compiler the include path. Without it the compiler complains it can’t find the include file “begin_code.h” which is part of SDL2. This is a listing of the demo program. // sdldemo.c Author D. Bolton 7th March 2020 #include "hr_time.h" #include <time.h> #include<linux/time.h> #define __timespec_defined 1 #define __timeval_defined 1 #define __itimerspec_defined 1 #include <SDL2/SDL.h> /* All SDL App's need this */ #include <stdio.h> #include <stdlib.h> #define QUITKEY SDLK_ESCAPE #define WIDTH 1024 #define HEIGHT 768 SDL_Window* screen = NULL; SDL_Renderer *renderer; SDL_Event event; SDL_Rect source, destination, dst; int errorCount = 0; int keypressed; int rectCount = 0; stopWatch s; /* returns a number between 1 and max */ int Random(int max) { return (rand() % max) + 1; } void LogError(char * msg) { //FILE * err; //int error; //error = fopen_s(&err,"errorlog.txt", "a"); printf("%s\n", msg); //fclose(err); errorCount++; } /* Sets Window caption according to state - eg in debug mode or showing fps */ void SetCaption(char * msg) { SDL_SetWindowTitle(screen, msg); } /* Initialize all setup, set screen mode, load images etc */ void InitSetup() { srand((unsigned int)time(NULL)); SDL_Init(SDL_INIT_EVERYTHING); SDL_CreateWindowAndRenderer(WIDTH, HEIGHT, SDL_WINDOW_SHOWN, &screen, &renderer); if (!screen) { LogError("InitSetup failed to create window"); } SetCaption("Example One"); } /* Cleans up after game over */ void FinishOff() { SDL_DestroyRenderer(renderer); SDL_DestroyWindow(screen); //Quit SDL SDL_Quit(); exit(0); } /* read a character */ char getaChar() { int result = -1; while (SDL_PollEvent(&event)) { if (event.type == SDL_KEYDOWN) { result = event.key.keysym.sym; break; } } return result; } void DrawRandomRectangle() { char buff[20]; SDL_Rect rect; SDL_SetRenderDrawColor(renderer, Random(256) - 1, Random(256) - 1, Random(256) - 1,255); rect.h = 200;// Random(100) + 20; rect.w = 200;// Random(100) + 20; rect.y = Random(HEIGHT - rect.h - 1); rect.x = Random(WIDTH - rect.w - 1); SDL_RenderFillRect(renderer,&rect); rectCount++; if (rectCount % 10000 == 0) { SDL_RenderPresent(renderer); stopTimer(&s); snprintf(buff,sizeof(buff),"%10.6f", diff(&s)); SetCaption(buff); startTimer(&s); } } /* main game loop. Handles demo mode, high score and game play */ void GameLoop() { int gameRunning = 1; startTimer(&s); while (gameRunning) { DrawRandomRectangle(); while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_KEYDOWN: keypressed = event.key.keysym.sym; if (keypressed == QUITKEY) { gameRunning = 0; break; } break; case SDL_QUIT: /* if mouse click to close window */ { gameRunning = 0; break; } case SDL_KEYUP: { break; } } /* switch */ } /* while SDL_PollEvent */ } } int main(int argc,char * args[]) { InitSetup(); GameLoop(); FinishOff(); return 0; } When you run this you’ll get a Window with random sized coloured rectangles like this and the time to draw 10,000 in the Window caption bar. Timing is done in the hr_time.h and .c files. These can be found in the file sdldemo.zip along with the VS code JSON files on GitHub.
https://learncgames.com/tutorials/how-to-install-sdl-on-linux/
CC-MAIN-2021-43
en
refinedweb
The NoImplicitPrelude GHC extension is used to disable the prelude.For other ways to disable the prelNoImplicitPreludeude, see Disabling the prelude GHC normally includes the Prelude as an implicit import, both in GHCi and in compilation. This is sometimes what you want; it gives you access to a collection of types, typeclasses, and functions that you don’t usually want to write from scratch for each project. This extension is primarily useful when you are learning Haskell and want to re-implement many of the Preludetypes and functions yourself, for learning purposes. This enables you to do so without name clashes. you have informed opinions about the set of things included in the Haskell Preludeand wish to use an alternative “prelude” that is better tailored to your tastes or project. We give examples of each of these uses in this article. This extension has been available since GHC 6.8.1 in 2007.GHC documentation for NoImplicitPrelude It replaced the very old and now-deprecated -fno-implicit-prelude flag, which had been around for (as far as we can tell) as long as GHC has existed. Example Let’s say we’re a Haskell beginner teaching ourselves Haskell by implementing a lot of the basic Haskell types and functions ourselves. So we might start a module off like this. {-# LANGUAGE NoImplicitPrelude #-} module Maybe where data Maybe a = Nothing | Just a class Eq a where (==) :: a -> a -> Bool (/=) :: a -> a -> Bool If you then try to compile or run or load this into GHCi or what have you, you’ll see an error. λ> :load [1 of 1] Compiling Maybe no-prelude.hs:12:21: error: Not in scope: type constructor or class ‘Bool’ | 12 | (==) :: a -> a -> Bool | ^^^^ Since you have disabled the entire Prelude and you haven’t written a Bool type yet, there is no type called Bool in scope. You can handle this in one of two ways: write a Bool type or import that type without importing the rest of the Prelude that you don’t want. This example will cover the latter because there are certainly things you will want to do this for, such as IO and some related things that would be relatively impossible to implement yourself.It’s probably worth pointing out that even if you have the whole Prelude disabled, when you use GHCi it will still be able to “do I/O”, at least enough to print values to your screen. The Bool type is defined in the Data.Bool module of the base library. You can choose to import - just the Booltype (without its constructors) import Data.Bool (Bool) - the Booltype with its constructors ( Trueand False) import Data.Bool (Bool (..)) - the entire module, but qualified so that you could still use some of the names in that module without clashing. import qualified Data.Bool as B There are some other choices you could make, such as importing the entire module unqualified. Maybe you’ve already learned all you can from implementing the Boolean functions in that module and want to be able to use them now (if you did that and you have your own Bool module, you could also choose to import your own module), in which case a simple import Data.Bool would suffice. For most cases, we believe the second or third of those possibilities would be most useful. We’ll continue our example using the third possibility, to show you what that would look like. {-# LANGUAGE NoImplicitPrelude #-} module Maybe where import qualified Data.Bool as B data Maybe a = Nothing | Just a class Eq a where (==) :: a -> a -> B.Bool (/=) :: a -> a -> B.Bool instance Eq a => Eq (Maybe a) where Nothing == Nothing = B.True Nothing == Just y = B.False Just x == Nothing = B.False Just x == Just y | x == y = B.True | B.otherwise = B.False If you qualify your import like that, then it is very visible when you are using something you have not implemented yourself, and those visual reminders of where something came from can be useful – to you while you’re learning, to future you, and to anyone who reads your code. Alternative preludes As we mentioned earlier, sometimes you also want to disable the Prelude in order to use an alternative prelude. As you might have noticed in the example above, you have to add that Data.Bool import in order to use a couple of basic things, and as you can imagine, the list of imports will grow longer and longer as you go on. So, while that is useful occasionally, it can also become a pain. The oldest GHC documentation we can findDocumentation for GHC 0.29, circa 1995 playfully comments: You are unlikely to get very far without a Prelude, but, hey, it’s a free country. Enter the alternative preludes. The base module called Prelude is somewhat controversial among Haskellers. For one thing, it has several notable partial functions in it. It is not controversial that those functions are fairly bad – isn’t Haskell about safety and compile-time rather than runtime errors? It is somewhat more controversial whether people who are new to Haskell should try using an alternative prelude in order, in part, to avoid those functions. Furthermore, there is a lot of debate about how best to structure a prelude for writing modern Haskell. Prelude is quite old and dates from a time when Haskell wasn’t much used industrially. And so the modern Haskell ecosystem is now home to several alternative preludes. Each has made different choices about what to include, although they mostly all share the goal of eliminating those partial functions. One of our personal favorites is the relude package.The relude package on Hackage. So let’s look at an example using that. Changing the prelude in GHCi If you’d like to open a GHCi session for experimentation with relude instead of Prelude, do this: You may need to first install the reludepackage using cabal install, stack install, or Nix. Open a GHCi session with the -XNoImplicitPreludeand -packageflags. $ ghci -XNoImplicitPrelude -package relude - Import the Reludemodule of reludeonce it opens. λ> import Relude - Start looking around to see what has changed. λ> :type headhead :: NonEmpty a -> a Look! head isn’t a partial function anymore! In modules For writing code in Haskell source files, there are, as usual, a few ways you can do this. One is to establish a project with a cabal file or a similar setup and add relude as a dependency. Another way to play around with it, if you have relude installed, is to have a Haskell module that opens like this: {-# LANGUAGE NoImplicitPrelude #-} module Main where import Relude and load that module into GHCi, which will disable the normal Prelude and use relude instead. You will need to have some main defined before you load it (even if it says undefined).GHC and GHCi expect that a module named Main will have a main action defined within them. It is OK if you put main = undefined or if you take off the module name; either way, the code should load into GHCi because for whatever reason, GHCi does not expect a main defined in an unnamed module. {-# LANGUAGE NoImplicitPrelude #-} module Main where import Relude main :: IO ()main = undefined Let’s try loading this into GHCi. $ ghci GHCi, version 8.6.3: :? for help Loaded GHCi configuration from /home/jmo/.ghc/ghci.conf λ> :type head head :: [a] -> a λ> :load relude.hs [1 of 1] Compiling Main ( relude.hs, interpreted ) relude.hs:8:8: warning: [-Wdeprecations] In the use of ‘undefined’ (imported from Relude, but defined in Relude.Debug): "'undefined' function remains in code" | 8 | main = undefined | ^^^^^^^^^ Ok, one module loaded. λ> :type headhead :: NonEmpty a -> a We wanted to show you two things with this. Unlike normal Preludeor GHC, reludegives you a warning when you have an undefinedin your code. It’s nice that it’s a warning, and not an error, so that the module can still be loaded, but also you can be alerted to the presence of (perhaps a forgotten) undefined. As you can see, the type of headchanges after we load the relude.hsfile, so the changes we expect given our use of the NoImplicitPreludeextension and Reludeimport have taken effect. We’re going to add some things to this file that are intended to show off how relude differs from Prelude rather than to represent a realistic program. For example, let’s try this step above “hello, world”. main :: IO () = main do <- getLine name putStrLn ("hello " ++ name) This compiles and works fine when we use the standard Prelude. However, when we are using relude instead, we get this error message. relude.hs:11:27: error: • Couldn't match expected type ‘[Char]’ with actual type ‘Text’ • In the second argument of ‘(++)’, namely ‘name’ As the documentation for relude explains, they’ve opted to make many of the standard functions work with the Text type instead of with String. Using Text or ByteString instead of String is considered best practices in Haskell for many, if not most, purposes; however, the Prelude uses the String type extensively mostly due to its age. So, relude re-exports important types and functions from the text and bytestring packages – which means that to use the Text type or associated functions, we don’t need to add a dependency or import from the text library. But it also means that we do need to find a way in relude to fix that error. What the message seems to be telling us is that our use of (++) expects two [Char] arguments, but name is a Text argument. One way to fix this would be to find a conversion function to do that for us. There is a relude module called Relude.String.Conversion so we’re guessing that’s a good place to look. It took a little bit of scrolling to find the ToString typeclass with its one method, toString, and it seems like that will work, so let’s try it. main :: IO () = main do <- getLine name putStrLn ("hello " ++ (toString name)) And, indeed, this does work. But it might seem like a step backwards to use String instead of Text so we can look for a more “relude-y” way to achieve the same purpose. Usually for Text we use the semigroup operator (<>) instead of (++) so we can switch to that first of all. We also notice, however, that putStrLn expects a String input. λ> :type putStrLnputStrLn :: MonadIO m => String -> m () A quick search of the Index for relude gives us a bunch of other put functions: putTextLn is probably the one we want. So, now our main looks like this: main :: IO () = main do <- getLine name "hello " <> name) putTextLn ( This still doesn’t quite work because, syntactically, "hello ", is a String. Those quotation marks are reserved syntax for lists of Char, sorry! There are two options here. We could enable the OverloadedStringsextension. This is not a bad option, and it’s what the reludedesigners seem to prefer, as it takes this pain away throughout your file when enabled. We could manually “pack” that Stringinto a Textrepresentation. Just as we found the ToStringclass earlier, we see that there is a similar ToTextclass as well, with a toTextfunction. We’ll choose this route so that we can show you the new, working code without reprinting the entire file. main :: IO () = main do <- getLine name "hello ") <> name) putTextLn ((toText This is the kind of adaptation you should expect when you switch off the standard Prelude and onto one of the more modern or specialized preludes. We think that these adaptations are often worthwhile, especially when they can help you use better types.
https://typeclasses.com/ghc/no-implicit-prelude
CC-MAIN-2021-43
en
refinedweb
When I develop a python program in the eclipse Pydev project, I need to import a package pymongo into this python program like the below source code. import pymongo if __name__ == '__main__': pass But it shows an error message Unresolved import: pymongo in the source code, you can see this error message when you move your mouse over the red line in eclipse python source code. This is because my eclipse project used a python interpreter that does not contain pymongo library. So I have two options to fix this error. - Option 1: Install pymongo library in the project used python interpreter. - Option 2: Use another python virtual environment ( which has installed pymongo library ) as the project’s python interpreter. This article will focus on this option. 1. Add New Python Interpreter In Eclipse Steps. - Click Project —> Properties menu item at eclipse top menu bar. You can change the settings for this single project through this menu item. - In the pop-up dialog, click the PyDev – Interpreter/Gramma menu in the left panel. Then you can see the interpreter drop-down list in the right panel. You can click the list to select the python interpreter which has installed the pymongo library. - If you want to add a new python interpreter, you can click the Click here to configure an interpreter not listed link below the python interpreter drop-down list in the above window, then click the Open interpreter preferences page button to open the Python Interpreters configuration window. - You can also click Eclipse —> Preferences ( on macOS ) or Window —> Preferences ( on Windows ) menu item to open the eclipse preferences window. - Then click PyDev —> Interpreters —> Python Interpreter menu item in above popup window’s left side, then you can see the Python Interpreters list on the right side. There list all python interpreters that have been added to the eclipse. - Click Browse for python/pypy exe button in the top right to open Select interpreter dialog. Input an Interpreter Name, and click the Browse button to select Interpreter Executable file path( your python virtual environment python executable file ( python.exe for Windows or python for macOS, Linux ) ). - Then click the OK button to close the dialog. Click Apply and Close button to close the Python Interpreters configuration window. 2. Select Python Interpreter For Eclipse Pydev Project. - After you add python interpreter in eclipse successfully, you can now select your Pydev project used python interpreter as below. - Click Project —> Properties menu item at eclipse top menu bar. - Click PyDev – Interpreter/Gramma menu in popup window left panel. Then you can select the newly added python interpreter from the right panel Interpreter drop-down list. - Now you can import the python pymongo library into your python source code without error. 3. Question & Answer. 3.1 How to effectively manage python interpreters and virtual environments in the eclipse pydev projects. - I have several eclipse pydev projects, and each project uses its own python interpreter. The reason for this is because the python version or python libraries are not the same for different eclipse pydev projects. But as there is more and more python projects, it is very hard to manage so many python interpreters with different python virtual environment. is there a way to easily manage all those python interpreters or make all the eclipse python project use the same one python interpreter? - In eclipse pydev, you can only make the python interpreter eclipse-wide. If you switch between multiple eclipse pydev projects, you have to switch to the correct python interpreter also. This can make the eclipse pydev project isolated in multiple pydev projects. It can also reduce the influence between them. - If all your eclipse pydev projects use the same python version, and the only difference is the installed python libraries. You can create a base python interpreter and make all the eclipse pydev projects use that python interpreter as default. - Then you can configure the python libraries for each eclipse pydev project in the project properties PYTHONPATH, you can read the article How To Add Library In Python Eclipse Project to learn more. References - How To Manage Anaconda Environments. - How To Start Jupyter Notebook In Anaconda Python Virtual Environment. - How To Install Python Django In Virtual Environment.
https://www.dev2qa.com/how-to-change-python-interpreter-in-eclipse-pydev-project-to-use-different-python-virtual-environment-library/
CC-MAIN-2021-43
en
refinedweb
Let’s talk about Recursion. Recursion. What is it? It is where a solution to a problem depends on solutions to smaller instances of the same problem. Let’s use the Fibonacci Sequence for this article. What is the Fibonacci Sequence? In a Fibonacci sequence a number is the sum of its two preceding numbers. For example, 1 1 2 3 5 8. 8 is made up of 5 and 3, 5 is made up of 2 and 3, 3 is made up of 2 and 1, etc. We can say, a number is equal to the sum of the number minus one and the number minus 2 in the sequence. n = (n-1) + (n-2) If we think this as a function we could do: fib(n) = fib(n-1) + fib(n-2) In ruby we could write: def fib(n) return fib(n-1) + fib(n-2) end The issue we have at this point is we created an infinite loop. We need a base case. def fib(n) #base case if n <= 1 return n end return fib(n-1) + fib(n-2) end What are we looking at? Let’s say we want to know what the 4th number in the Fibonacci is. def fib(n) #base case if n <= 1 return n end return fib(n-1) + fib(n-2) endprint fib(4) The 4 doesn’t meet the base case, so it will skip the if statement. We hit the return fib(n-1) which in this case is fib(4–1) which is fib(3). Since 3 doesn’t meet the base case, it will break down fib(3) to fib(n-1) + fib(n-2). It will first do fib(n-1) which is fib(2). It will keep calling itself till it meets the base case. Let’s work out the left side of the tree first. We can see it will go all the way down to fib(2) = fib(1) + fib(0). Since the base case is n ≤= 1, fib(1) is 1 and fib(0) is 0. Therefore, fib(2) = 1 + 0. The second number in the Fibonacci Sequence is 1. So now it will figure out what fib(1) is. As you can already see, an issue with Recursion is that it will keep solving the same problem even if its was solved previously. (Look for a future blog on dynamic programming and memoization.) But let’s keep going and see where it goes. We know that fib(1) is = 1 so fib(3) = 1 + 1. The third number in Fibonacci is 2 so we’re looking good. Fibonacci = 1, 1, 2 , 3, 5. Now we need to go up the right side of the tree. So fib(4) = 3. The 4th number in the Fibonacci Sequence is 3. Issues with Recursion Recursion is slow. It also has greater space requirements. Why use it? It’s good to know and some data structure problems can only be solved through recursion.
https://alexduterte.medium.com/lets-talk-about-recursion-dae3857fc88d?source=post_page-----dae3857fc88d--------------------------------
CC-MAIN-2021-43
en
refinedweb
How do I add multiple attachments to Mailboxer? I am using the Mailboxer gem. I have enabled multiple file uploads for the attachment field. What is the best way to set up my controller so it saves all the attachments? Would making a new model called "message_attachment" be a good idea? In that case, how do I set up the message model (which I currently don't have in my model folder) so I can include "has_many message_attachments"? show.html.haml = form_for @message, url: conversation_messages_path(@conversation) do |f| = f.text_area :body, class: "form-control" -# = f.file_field :attachment = f.file_field :attachment, multiple: :true, name: "message_attachments[photo][]" .yellow-btn = f.submit "Send", class: "submit" messages_controller.rb def create receipt = current_user.reply_to_conversation(@conversation, params[:mailboxer_message][:body], nil, true, true, params[:mailboxer_message][:attachment]) redirect_to conversation_path(@conversation) end Thank you very much!
https://gorails.com/forum/how-do-i-add-multiple-attachments-to-mailboxer
CC-MAIN-2021-43
en
refinedweb
New in Symfony 2.4: Namespaces auto-discovery in DowCrawler Contributed by Jakub Zalas in #6650. When crawling an XML document with the DomCrawler component, you might retrieve documents with more than one namespaces: Note The DomCrawler component is used by the Symfony HTTP client, but also by some Behat drivers. As of Symfony 2.4, you don't need to care about namespaces, as they auto-discovered and auto-registered: Notice that the default namespace name is default (configurable) and that you must explicitly disable the HTML extension of the CssSelector component when filtering an XML document with a CSS selector. As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities. New in Symfony 2.4: Namespaces auto-discovery in DowCrawler symfony.com/blog/new-in-symfony-2-4-namespaces-auto-discovery-in-dowcrawlerTweet this __CERTIFICATION_MESSAGE__ Become a certified developer! Exams are online and available in all countries.Register Now To ensure that comments stay relevant, they are closed for old posts. Tomasz Kowalczyk said on Oct 10, 2013 at 15:04 #1
https://symfony.com/blog/new-in-symfony-2-4-namespaces-auto-discovery-in-dowcrawler
CC-MAIN-2021-43
en
refinedweb
Warning: You are browsing the documentation for Symfony 4.2, which is no longer maintained. Read the updated version of this page for Symfony 5.3 (the current stable version)./: // src/Utils/Slugger.php namespace App\Utils; class Slugger { public function slugify(string $value): string { // ... } } If you’re using the default services.yaml configuration, this class is auto-registered as a service with the ID App\Utils\Slugger (to prevent against typos, import the class and write Slugger::class in your code).:., but you can use whatever format you like. Use annotations to define the mapping information of the Doctrine entities. Annotations are by far the most convenient and agile way of setting up and looking for mapping information: namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; /** * ="App\Entity\Comment", * mappedBy="post", * orphanRemoval=true * ) * @ORM\OrderBy({"publishedAt"="ASC"}) */ private $comments; public function __construct() { $this->publishedAt = new \DateTime(); $this->comments = new ArrayCollection(); } // getters and setters ... }: // config/bundles.php return [ // ... Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], ];.
https://symfony.com/doc/4.2/best_practices/business-logic.html
CC-MAIN-2021-43
en
refinedweb
May 28, 2009 08:26 PM|j3rich0|LINK Hello, I'm following a screencast on the WCF Starter Kit and this one involves building a bookmark service, anyway at point he opens up the definition for ICollectionService<Bookmark> and that opens up Service.base.svc.cs which he edits and so on. Well that doesn't happen with me, instead the definition for ICollectionService opens up System.ServiceModel.Web.SpecilizedServices.ICollectionService.cs which is read-only and I can't modify. So what am I doing wrong? thanks May 29, 2009 01:54 PM|randallt|LINK I haven't watched the sceencast, but I'm guessing that you've following the definition of the wrong class or member. You shouldn't need to change the ICollectionService.cs. You want to change the service that derives from the ICollectionService. You can also just right click on the Service.svc file and choose "View Code". ~Randall May 29, 2009 03:40 PM|j3rich0|LINK I am opening the correct class, the ICollectionService base class is where the UriTemplates are defined so I do need to change it if I want to change the URIs this is the screencast I am talking about, if you go to ~4:39 you can see he opens the definition for ICollectionService Member 10 Points Jun 12, 2009 12:11 AM|cosophy@gmail.com|LINK Well, the screencast you were watching was using Starter Kit Preview 1 (anyway it is not the Preview 2 on the Codeplex now). In Preview 2, the service class inherits from the default ICollectionService<Item> in the sevicebase file which is compiled to the dll we install. So, you can not modify it. :) Jun 16, 2009 03:20 PM|St4Rp|LINK The good news is however there is a way to customize, as the code still comes along with the installer package. All the files you need are in the zipped folder within your installation directory at "%programfiles%\WCF REST Starter Kit Preview 2\WCF REST Starter Kit Preview 2.zip\Microsoft.ServiceModel.Web\Microsoft.ServiceModel.Web\SpecializedServices". So you could copy the appropriate file into your current project folder in order to start customization. Let say you are going to customize SingletonService, then copy the SingletonServiceBase.cs into your project folder and alter the original "Microsoft.ServiceModel.Web.SpecializedServices" namespace to your own project's namespace. This makes sure the compiler will not confuse the classes (e.g. SingletonServiceBase<...>) living within the installed Microsoft.ServiceModel.Web.dll assembly. You perhaps also will need to delete the using directive in the Service.svc.cs file referring to the Microsoft.ServiceModel.Web.SpecializedServices namespace. Member 10 Points Jun 19, 2009 06:32 PM|Yavor Georgiev - MSFT|LINK St4Rp's tip is exctly correct - in the Preview 2 release of the starter kit you need to pull in the base class into your project and modify it. In Preview 1 that code was readily available in the template itself. I'll bring this up with the team so we can find a better way to expose things like the UriTemplates for customization. Thanks, -Yavor 6 replies Last post Jun 20, 2009 04:44 AM by j3rich0
https://forums.asp.net/t/1428862.aspx
CC-MAIN-2021-43
en
refinedweb
Python 3.1 also includes several changes to the standard library, described below. The major new addition is an ordered dictionary class, which got its own PEP. When you iterate over an ordered dict, you get a list of keys and values in the same order in which they were inserted, which is often desirable. As an illustration, here's some code that shows the difference between an ordered dict and a regular dict: >>> items = [('a', 1), ('b', 2), ('c', 3)] >>> d = dict(items) >>> d {'a': 1, 'c': 3, 'b': 2} >>> from collections import OrderedDict >>> od = OrderedDict(items) >>> od OrderedDict([('a', 1), ('b', 2), ('c', 3)]) >>> list(d.keys()) ['a', 'c', 'b'] >>> list(od.keys()) ['a', 'b', 'c'] As, you can see the ordered dict preserves the initial item order, while the standard dict doesn't. However, I was a little surprised to find out that if you populate the dictionary with named arguments rather than key/value pairs, it does not maintain the order. I would even consider that behavior a bug, because using named arguments is a perfectly valid way to initialize a dictionary, and the items have a clear order (left to right) just like the first example with the items list: >>> d = dict(a=1, b=2, c=3) >>> d {'a': 1, 'c': 3, 'b': 2} >>> od = OrderedDict(a=1, b=2, c=3) >>> od OrderedDict([('a', 1), ('c', 3), ('b', 2)]) The new Counter class in the collections module is a dictionary that keeps track of how many times an object occurs in a collection. >>> import collections >>> x = [1, 1, 2, 3, 4, 5, 4, 4, 6, 4] >>> c = collections.Counter(x) >>> c = collections.Counter(x) >>> c Counter({4: 4, 1: 2, 2: 1, 3: 1, 5: 1, 6: 1}) The class supports the typical set of dict methods: keys(), values() and items() for accessing its contents; however, the update() method differs from a regular dict update(). It accepts either a sequence or a mapping whose values are integers. If you use a sequence, it counts the elements and adds their count to the existing counted items. For a mapping it adds the count of each object in the mapping to the existing count. The following code updates the Counter class initialized in the preceding example: >>> c.update([3, 3, 4]) >>> c Counter({4: 5, 3: 3, 1: 2, 2: 1, 5: 1, 6: 1}) >>> c.update({2:5}) >>> c Counter({2: 6, 4: 5, 3: 3, 1: 2, 5: 1, 6: 1}) >>> c.update({2:5}) >>> c Counter({2: 11, 4: 5, 3: 3, 1: 2, 5: 1, 6: 1}) The Counter class also has a couple of special methods. The elements() method returns all the elements in the original collection grouped together and sorted by value (not frequency): >>> list(c.elements()) [1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 6] The most_common() method returns object:frequency pairs, sorted by the most common object. >>> c.most_common() [(2, 11), (4, 5), (3, 3), (1, 2), (5, 1), (6, 1)] If you pass an integer N to most_common, it returns only the N most common elements. For example, given the Counter object from the preceding examples, the number 2 appears most often: >>> c.most_common(1) [(2, 11)] The itertools module lets you work with infinite sequences and draws inspiration from Haskell, SML and APL. But it's also useful for working with finite sequences. In Python 3.1 it received two new functions: combinations_with_replacement() and compress(). The combinations() function returns sub-sequences of the input sequence in lexicographic order without repetitions (based on position in the input sequence, not value). The new combinations_with_replacement() function allows repetition of the same element, as the following code sample demonstrates: from itertools import * print(list(combinations([1, 2, 3, 4], 3))) print('-' * 10) print(list(combinations_with_replacement(['H', 'T'], 5))) Output: [(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4)] ---------- [('H', 'H', 'H', 'H', 'H'), ('H', 'H', 'H', 'H', 'T'), ('H', 'H', 'H', 'T', 'T'), ('H', 'H', 'T', 'T', 'T'), ('H', 'T', 'T', 'T', 'T'), ('T', 'T', 'T', 'T', 'T')] Note that in both functions each sub-sequence is always ordered. The compress() function allows you to apply a mask to a sequence to select specific elements from the sequence. The function returns when either the sequence or the selectors mask is exhausted. Here's an interesting example that uses both compress() and count() to generate an infinite stream of integers, map() to apply a lambda function (+1) to the elements of count(), and chain(), which chains two iterables together. The result stream is very similar to the non-negative integers, except that 1 appears twice. I'll let you guess what the compress() function selects out of this input stream: from itertools import * selectors = [1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1] sequence = chain(iter([0, 1]), map(lambda x: x+1, count())) print(list(compress(sequence, selectors))) Output: [0, 1, 1, 2, 3, 5, 8, 13, 21] Python has a powerful and flexible industrial-strength logging module that supports logging messages at different levels to arbitrary target locations that include memory, files, network, and console. Using it requires a certain amount of configuration. Libraries that want to provide logging can either configure themselves by default or require users to configure them. If, as library developer, you require users to configure logging, you're likely to annoy users who don't care about logging. However, if your library configures itself what should the configuration settings be? There are two common options: log to a file or log to the console. Both options cause clutter. Until Python 3.1 best practice required the library developer to include a small do-nothing handler and configure its logger to use this handler. Python 3.1 provides such a NullHandler as part of the logging module itself. Here's a logging scenario: Suppose you have the following library code in a module called lib.py. It has an init() function that accepts a logging handler, but defaults to the new NullHandler. It then sets the logger object to use the provided logger (or the default one). A logging handler is an object that determines where the output of the logger should go. The example function a_function_that_uses_logging() calls the global logger object and logs some funny messages: import logging logger = None def init(handler=logging.NullHandler()): global logger logger = logging.getLogger('Super-logger') logger.setLevel(logging.INFO) logger.addHandler(handler) def a_function_that_uses_logging(): logger.info('The capital of France is Paris') logger.debug('Don\'t forget to fix a few bugs before the release') logger.error('Oh, oh! something unpalatable occurred') logger.warning('Mind the gap') logger.critical('Your code is a mess. You really need to step up.') The next bit of application code configures a rotating file handler. This is a sophisticated handler for long-running systems that generate large numbers of logged messages. The handler limits the amount of logging info in each file, and also saves a pre-set number of backup files. These restrictions ensure that the log files never exceed a given size, and that the latest logging info (up to the limit) is always preserved. For example purposes, the code configures the handler to store only 250 bytes in each log file and maintain up to 5 backup files. It then invoke the venerable a_function_that_uses_logging(). import logging import logging.handlers from lib import a_function_that_uses_logging log_file = 'log.txt' handler = logging.handlers.RotatingFileHandler( log_file, maxBytes=250, backupCount=4) init(handler) for i in range(4): a_function_that_uses_logging() Here's what I found in my current directory after running this code. The handler created a rotating log file (log.txt), with four backups because the example allowed only 250 bytes in each file. ~/Documents/Articles/Python 3.1/ > ls article.py log.txt log.txt.1 log.txt.2 log.txt.3 log.txt.4 To view the contents of those files I simply concatenated them: ~/Documents/docs/Publications/DevX/Python 3.0/Article_6 > cat log.* Mind the gap Your code is a mess. You really need to step up. Your code is a mess. You really need to step up. The capital of France is Paris Oh, oh! something unpalatable occurred Mind the gap Your code is a mess. You really need to step up. The capital of France is Paris Oh, oh! something unpalatable occurred The capital of France is Paris Oh, oh! something unpalatable occurred Mind the gap Your code is a mess. You really need to step up. The capital of France is Paris Oh, oh! something unpalatable occurred Mind the gap This works well, but sometimes users don't care about the logged messages—they just want to invoke the function without having to configure the logger, and they need it to work in a way that will not cause the disk to run out of space or the screen to be filled with messages. That's where the NullHandler class comes in. The next bit of code does the same thing as the preceding example, but doesn't configure a logging handler and gets no logging artifacts. Note how much ceremony went away; there are no imports for logging and logging.handlers, and no hard decisions about which handler to use or how to configure it. init() for i in range(3): a_function_that_uses_logging() Advertiser Disclosure:
https://www.devx.com/opensource/Article/42659/0/page/3
CC-MAIN-2021-43
en
refinedweb
Basics of Dapper Working with databases using Open Source Somewhere between an Object Relational Mapper (ORM) and ADO.NET sits a niche many developers have begun to embrace. MicroORMs provide some of the best features of ORMs but without the drawbacks associated with object tracking. Some of these features include connection management, object mapping, and the use of SQL. In the .NET space, Dapper is the most popular of these MicroORM offerings. To use Dapper, we first need a DbConnection implementation. In this example, we'll be using System.Data.SqlClient and SqlConnection, but Dapper supports other databases that use the DbConnection abstraction. We also need a projection class representing the results of our SQL query. In this case, we have a Person class. The advantage our using a MicroORM like Dapper, is we can have many different read models, without being constrained by our database schema. Executing commands is as simple as finding the extensions on our DbConnection. In this video, we use QueryAsync and ExecuteAsync to return results and manage our data. In general, a MicroORM provides a straightforward approach to data access. It's essential to have an understanding of SQL and how to write performant queries. One of the drawbacks to MicroORMs is their coupling to the database. Written SQL queries are in a particular database's dialect, making switching databases more work. In addition to database coupling, accurate tests require standing up a database instance, which may be difficult. These are minor drawbacks, and ultimately, users benefit from the performance increases and predictable execution times. Code Snippets Program.cs using System;using System.Data;using System.Data.SqlClient;using System.Threading.Tasks;using Dapper;public class Person{public int Id { get; set; }public string Name { get; set; }}class Program{static async Task Main(string[] args){using IDbConnection connection =new SqlConnection("Server=localhost,11433;User=sa;Password=Pass123!;Database=basics;");var people =await connection.QueryAsync<Person>("select * from People");foreach (var person in people){Console.WriteLine($"Hello from {person.Name}");}var name = "Steve Rogers";var count =await connection.ExecuteAsync(@"insert People(Name) values (@name)",new { name });Console.WriteLine($"Inserted {count} rows.");var removed =await connection.ExecuteAsync("delete from People where Name = @name",new {name});Console.WriteLine($"Removed {removed} rows.");}} Project CSPROJ <Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><OutputType>Exe</OutputType><TargetFramework>netcoreapp3.1</TargetFramework></PropertyGroup><ItemGroup><PackageReference Include="System.Data.SqlClient" Version="4.8.1"/><PackageReference Include="Dapper" Version="2.0.35"/></ItemGroup></Project>
https://www.jetbrains.com/dotnet/guide/tutorials/basics/dapper/
CC-MAIN-2021-43
en
refinedweb
Stops gradient computation. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.stop_gradient tf.stop_gradient( input, name=None ) Used in the notebooks. For example, the softmax function for a vector x can be written as def softmax(x): numerator = tf.exp(x) denominator = tf.reduce_sum(numerator) return numerator / denominator This however is susceptible to overflow if the values in x are large. An alternative more stable way is to subtract the maximum of x from each of the values. def stable_softmax(x): z = x - tf.reduce_max(x) numerator = tf.exp(z) denominator = tf.reduce_sum(numerator) return numerator / denominator However, when we backprop through the softmax to x, we dont want to backprop through the tf.reduce_max(x) (if the max values are not unique then the gradient could flow to the wrong input) calculation and treat that as a constant. Therefore, we should write this out as def stable_softmax(x): z = x - tf.stop_gradient(tf.reduce_max(x)) numerator = tf.exp(z) denominator = tf.reduce_sum(numerator) return numerator / denominator Some.
https://www.tensorflow.org/api_docs/python/tf/stop_gradient?hl=iw
CC-MAIN-2021-43
en
refinedweb
Join the community to find out what other Atlassian users are discussing, debating and creating. Hello guys! I would like to call a python script via bamboo task (inline script) This python script load variables from yaml file like this: parser.add_argument( '--config_path', default='config.yaml', help='path of the configuration file') with open(args.config_path) as source: config = yaml.safe_load(source) git_config = config['git'] git_username = git_config['username'] git_password = git_config['password'] In yaml file I would like to use bamboo variables, how should I define bamboo variables inside yaml file? Thanks for yout answer! Hello @Erik Zilinsky welcome to the community! :) Bamboo provides variables for external scritps with environment variables. While it's possible to hack around your yaml and python scripts (see this StackOverflow answer), I would not recommend you to do that. The best way to go would be to either read the environment variables direct into your python script, or use the inline variables that Bamboo provides with inline script tasks (documentation link). I hope that helps! Thanks for your answer, we want to keep using that yaml file so ... we replacing bamboo vars via chevron python package like this: import os import re import sys import chevron template = open(sys.argv[1]) vars = { 'confluence_url': os.environ['bamboo_confluence_url'], 'nexus_user': os.environ['bamboo_nexus_user'], 'nexus_password': os.environ['bamboo_nexus_password'], 'confluence_report_page_id': os.environ['bamboo_confluence_report_page_id'], 'sonar_url' : os.environ['bamboo_sonar_url'], 'sonar_projectkey': os.environ['bamboo_sonar_projectkey'], 'sonar_secret': os.environ['bamboo_sonar_secret'] } rendered = chevron.render(template, vars) with open('config_composed.yaml', 'w') as composed: print(rendered, file=composed) Have a nice.
https://community.atlassian.com/t5/Bamboo-questions/Bamboo-variables-in-yaml-file-not-bamboo-specs-yaml/qaq-p/1305233
CC-MAIN-2021-43
en
refinedweb
Useful SAP Notes for VSN 4.0 (XX-PART-NKS-VSN) This document contains useful SAP Notes relevant to VSN 4.0 applications (for VSN 4.1, see this document, for VSN 4.3, see this document). Please feel free to amend it as new SAP Notes are released. Note: There was no 4.2 release. (includes OSS notes released up until 11th February 2015) Support and Release Information 1257386 – Support Process for Nakisa products resold by SAP 1501039 – STVN/SOVN Upgradability, Compatibility & Maintenance 1514564 – Language Support for STVN / SOVN 1736778 – Support Questions for issues with STVN by Nakisa 1851954 – VSN 4.0 SP1 Available on SMP 1866805 – ABAP Add-on Upgrade Issues to 4.0 SP1 1873245 – Upgrading Nakisa Applications from 4.0 to 4.0 SP1 1882436 – Nakisa 4.0/4.0 SP1 Resolved Issues Summary 1911293 – Nakisa and SAP JCo Compatibility 1748016 – Visualization Solutions by Nakisa 4.x ABAP Add-on Passwords 1560244 – Nakisa ABAP add-on Vendor Key 2042038 – Enabling /NAKISA/ Namespace Components 2114254 – How to open connections to your SAP/Nakisa system General 1589534 – Enabling /NAKISA/ namespace components for editing 1785881 – Nakisa Profile Pictures Do Not Appear 1844541 – Evaluation Path Text Missing 1852270 – Starting Nakisa gives error invoking event “contextInitialized()” on listener 1933313 – Position Listing and Employee Listing Missing Records 1959007 – Photographs are wrongly displayed in position hierarchies 1981473 – SOVN/STVN Collective Fix for VSN 3.0 SP3, 4.0, 4.0 SP1, 4.1 2046587 – Adobe Flash Player 13 Breaks Export Functionality SOVN 4.0 OrgChart 1821040 – Inherited Cost Center Not Displayed for Some Org Units 1827787 – Position Name Not Displayed if Position and OU IDs Are Ident 1833362 – Employee address is inconsistent in Nakisa OrgChart 1853995 – Position Structure and Manager Inheritance Fixes 1859717 – OrgChart Collective Fix for VSN 4.0 1895492 – Combined Org Unit RFC Fix 1901372 – Combined Fix for Organization Unit-Related RFCs 1907145 – Performance Issues in Nakisa OrgChart Listing 1915260 – Performance Issues in Nakisa OrgChart Listing 1946433 – Position Listing Missing Person Name Information 1959007 – Photographs are wrongly displayed in position hierarchies 2004892 – Search by Position and Employee Is Not Working 2010031 – Occupied Analytics Not Consistent 2038269 – Collective Fix for VSN Products 2056213 – Delimiter on Position Structure SOVN 4.0 OrgModeler 1816561 – OrgModeler Consulting Notes 1895491 – Short Dump when Delimiting 1912487 – Nakisa OrgModeler – Cost center insert issue with certain time constraints 1933890 – Org Modeler – Moving out Employee Causes Delimit Position to Fail 1941531 – OrgModeler: Using IE7 Prevents Users from Modifying Scenarios 1951706 – Error Received While Delimiting an Org Unit 2038269 – Collective Fix for VSN Products 2043689 – OrgModeler Write-Back Fails SOVN 4.0 OrgAudit 1944984 – DataQualityConsole / OrgAudit: Applying New Custom RFCs SOVN 4.0 OrgManager / TeamManager 1869604 – Upgrade Nakisa OrgManager 4.0 to Nakisa TeamManager 4.0 SP1 2065931 – Modify TeamManager Position STVN 4.0 TalentHub for Managers / SuccessionPlanning for Managers 1853995 – Position Structure and Manager Inheritance Fixes 1951705 – Incorrect Entries in Tables /NAKISA/THRVISIB and T77AD STVN 4.0 TalentHub for HR & Executives / SuccessionPlanning 1804087 – Cannot Create Entries in Table /NAKISA/TM_SCALE 1844508 – Dashboard Analytics Display Incorrect Data 1853995 – Position Structure and Manager Inheritance Fixes 1853996 – TalentHub Org Chart Performance Pack 1895489 – Performance for RFC Key Position Structure Indirect 1901444 – Targets and Activities Not Displayed as Expected 1901372 – Combined Fix for Organization Unit-Related RFCs 1951705 – Incorrect Entries in Tables /NAKISA/THRVISIB and T77AD 1967368 – Talent Attributes RFC Always Returns Data in English 2004859 – Wrong Time Constraint for Infotype 7406 in Table T777z 2038269 – Collective Fix for VSN Products Thanks Stephen Burr and Stephen Millard for keeping this updated! Now updated to include all relevant OSS in XX-PART-NKS up to and including 10th Dec 2013. Top stuff Stephen.
https://blogs.sap.com/2013/05/09/useful-sap-notes-for-vsn-40-xx-part-nks-vsn/
CC-MAIN-2021-43
en
refinedweb
Trying to serve files that are in a byte array to my details view in an ASP.NET Core 2 MVC web app - asp.net Currently I have a database with two tables, one table is for products and the other is for file attachments for these products. hen I edit my product, I have an upload form to attach a file. It is uploading to the database fine. What I need help with is how to serve those files back to the details view of the product as links so they can download them. Here is my model for the file attachment. namespace Product.Models { public class FileAttachments { public int ID { get; set; } public int ProductID { get; set; } public byte[] Attachments { get; set; } public string MimeType { get; set; } public string FileName { get; set; } } } ProductID is my key for my main table Here is my upload method [HttpPost] public IActionResult Upload(ICollection<IFormFile> files, int ID) { foreach (var f in files) { FileAttachments NewFile = new FileAttachments(); var ms = new MemoryStream(); f.CopyTo(ms); NewFile.Attachments = ms.ToArray(); NewFile.ProductID = ID; NewFile.FileName = f.FileName; NewFile.MimeType = f.ContentType; _db.Attach(NewFile); } _db.SaveChanges(); return Redirect(Request.Headers["Referer"].ToString()); } Related How to send a collection of files + JSON data to the client side In my ASP.NET Core Web API I have an entity Idea: public class Idea { public int Id { get; set; } public string Name { get; set; } public string OwnerId { get; set; } public User Owner { get; set; } public string Description { get; set; } public int? MainPhotoId { get; set; } public Photo MainPhoto { get; set; } public int? MainVideoId { get; set; } public Video MainVideo { get; set; } public ICollection<Photo> Photos { get; set; } public ICollection<Video> Videos { get; set; } public ICollection<Audio> Audios { get; set; } public ICollection<Document> DocumentsAboutTheIdea { get; set; } public DateTime DateOfPublishing { get; set; } } public class Photo { public int Id { get; set; } public string Url { get; set; } } (the different media-type classes are equivalent) When the client makes a Post request for creating the Idea he sends the information about it along with all the media-files (I am using IFormFile and IFormFileCollection) and while saving them on the server I set the Url property to match their location. But in the Get request I want to send the files (not Urls). Here is the Get action which now returns only one file (mainPhoto) without any JSON and without any other media-files: [HttpGet("{id}", Name = "Get")] public async Task<IActionResult> Get(int id) { var query = await unitOfWork.IdeaRepository.GetByIdAsync(id, includeProperties: "Owner,MainPhoto,MainVideo,Photos,Videos,Audios,DocumentsAboutTheIdea"); if (query != null) { string webRootPath = hostingEnvironment.WebRootPath; var path = string.Concat(webRootPath, query.MainPhoto.Url); var memory = new MemoryStream(); using (var stream = new FileStream(path, FileMode.Open)) { await stream.CopyToAsync(memory); } memory.Position = 0; return File(memory, GetContentType(path), Path.GetFileName(path)); } return NotFound(); } So in a Get request I want to send to the client side (an Angular app) some of the information about the Idea in a JSON-format ALONG WITH different (NOT ONE) media-files associated with it. My goal is to make the client side get it all so that it can then show them on the page of the info about the Idea. But I cannot figure out the approach for this. Is there a way to achieve this? Or there is another (better) way of interacting with the client side to transfer all the required data? I tried to find information on this topic but couldn't find any. How to update table using query parameter in Html Agility Pack using C# I've been parsing this Url with Html Agility Pack:" The default table displayed is always the closest contract date and the current date. I have no problem parsing the complete page above but if I ask for another date I can't seem to get a new table when I add a query parameter to get another date: eg." This still returns the table for the current date. ie. 03/08/2018 However it does work if I add another query for contract month as well: eg." But if I then query: eg." ....it will not give me the table for 03/06/2018. It only appears to update the html for me when I change two or more query parameters in the Url. I'm fairly much a Noob with Html so I'm not sure if it's something to do with the actual website 'blocking' my request. Or does it expect some 'user interaction'? The very 'basic' core of my code is: using HtmlAgilityPack; HtmlDocument htmlDoc = new HtmlDocument { OptionFixNestedTags = true }; HtmlWeb web = new HtmlWeb(); htmlDoc = web.Load(url); A step in the right direction would be great. Thank you. Its a ajax site. the WepPage contains JS that makes Ajax queries by filtering done. Therefore you do not need the html-agility-pack but the JSON.NET. the URL is: you need build the url query string, download th text with WebClient.DownloadString and convert it to POCO with JSON.NET. Okay, so I've posted this answer for anyone else reading this post. Please feel free to comment or edit the post. Thanks again to Dovid for the suggestions. I cannot vouch for absolute syntax validity, however it's pretty close. The code loads a webpage table in Json format then saves to a file. There is a method for loading from the Json file as well. The code is 'as-is' and is not meant to be a copy and paste job, just a reference to how I did it. using Newtonsoft; using Newtonsoft.Json.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; private string _jsonStr; private string _tableUrlStr = ""; using (WebClient wc = new WebClient) { wc.BaseAddress = #""; wc.Headers[HttpRequestHeader.ContentType] = "application/json"; wc.Headers[HttpRequestHeader.Accept] = "application/json"; _jsonStr = wc.DownloadString(_tableUrlStr); } if (_jsonStr.IsNullOrEmpty()) return; JObject jo = JObject.Parse(_jsonStr); //## Add some more detail to the Json file. jo.Add("instrumentName", "my instrument name"); jo.Add("contract", "my contract name"); //## For easier debugging but larger file size. _jsonStr = jo.ToString(Formatting.Indented); //## Json to file: string path = directoryString + fileString + ".json"; if (!Directory.Exists(directoryString)) { Directory.CreateDirectory(directoryString); } if (File.Exists(path)) { return; } using (FileStream fileStream = new FileStream(path, FileMode.CreateNew, FileAccess.Write)) { using (var streamWriter = new StreamWriter(fileStream, Encoding.UTF8)) { streamWriter.WriteLine(_jsonStr); streamWriter.Close(); } } //## Json file to collection: //## Can copy and paste your Json at ''. public class Settlement { public string strike { get; set; } public string type { get; set; } public string open { get; set; } public string high { get; set; } public string low { get; set; } public string last { get; set; } public string change { get; set; } public string settle { get; set; } public string volume { get; set; } public string openInterest { get; set; } } public class RootObject { public List<Settlement> settlements { get; set; } public string updateTime { get; set; } public string dsHeader { get; set; } public string reportType { get; set; } public string tradeDate { get; set; } public bool empty { get; set; } //## New added entries public string instrumentName { get; set; } public string contract { get; set; } } private static IEnumerable<Settlement> JsonFileToList(string directoryString, string fileString) { if (directoryString == null) { return null; } string path = directoryString + fileString + ".json"; if (!Directory.Exists(directoryString)) { Directory.CreateDirectory(directoryString); } if (!File.Exists(path)) { return null; } RootObject ro = JsonConvert.DeserializeObject<RootObject>(File.ReadAllText(path)); var settlementList = ro.settlements; foreach (var settlement in settlementList) { //## Do something with this data. Console.Writeline(String.Format("Strike: {0}, Volume: {1}, Last: {2}", settlement.strike, settlement.volume, settlement.last)); } return settlementList; } Upload new images in Edit POST method I have view where we can see existing image and I want to upload new images to existing , so images uploads to folders and info about image storing in database also I use view model My View Models Class public class FurnitureVM { ... public IEnumerable<HttpPostedFileBase> SecondaryFiles { get; set; } public List<ImageVM> SecondaryImages { get; set; } } public class ImageVM { public int? Id { get; set; } public string Path { get; set; } public string DisplayName { get; set; } public bool IsMainImage { get; set; } } My Edit Method [HttpPost] [ValidateAntiForgeryToken] public ActionResult Edit(FurnitureVM model) { // Save the files foreach (HttpPostedFileBase file in model.SecondaryFiles) { FurnitureImages images = new FurnitureImages(); string displayName = file.FileName; string extension = Path.GetExtension(displayName); string fileName = string.Format("{0}{1}", Guid.NewGuid(), extension); var path = "~/Upload/" + fileName; file.SaveAs(Server.MapPath(path)); model.SecondaryImages = new List<ImageVM> { new ImageVM { DisplayName = displayName , Path = path } }; } // Update secondary images IEnumerable<ImageVM> newImages = model.SecondaryImages.Where(x => x.Id == null); foreach (ImageVM image in newImages) { FurnitureImages images = new FurnitureImages { DisplayName = image.DisplayName, Path = image.Path , IsMainImage = false }; furniture.Images.Add(images); } ViewBag.CategoryId = new SelectList(db.Categories, "CategoryId", "Name", furniture.CategoryId); } So image's info writes to db good , but when I go to Edit View second time I get an exception "object reference not set to an instance of an object" in line string displayName = file.FileName; I understand that I must create an instance of FurnitureImages , right? Okay then how I have to write code , something like this? images.DisplayName = file.Filename etc?? And Is my foreach loop right where i update? Thank you How to avoid optimistic concurrency error for newly added record in EF I use Entity Framework 6 in an MVC 5 project an there is an entity relations between Experiment and FileAttachment (one Experiment can gave many FileAttachment). During Edit an Experiment record, I load a ViewModel containing both of the entities and list the attachments under the experiment in edit mode: The scenario is as explained below: 1) There is a Delete button for each FileAttachment and when user delete an attachment, it is deleted via AJAX and display an information message on the same modal window. 2) But, if the user add a new attachment after deleting an attachment and save the Experiment the following error is encountered: "Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded." I think the reason is that: I load Experiment and FileAttachment entities and then I change the FileAttachment entity by deleting a record. But there is still the same entity loaded first time and I want to save the outdated entity. So, maybe I need to create an entity and fill it before saving, but context.Entry(f).State = EntityState.Added, context.Entry(f).State = EntityState.Modified and context.Entry(f).State = EntityState.Unchanged does not make any sense. What should I do to simply attach the newly added FileAttachment to the database? Models: public class Experiment { [Key] public int Id { get; set; } public int Number { get; set; } public string Name { get; set; } //Navigation Properties public virtual ICollection<FileAttachment> FileAttachments { get; set; } } public class FileAttachment { [Key] public int Id { get; set; } public int ExperimentId { get; set; } public string FileName { get; set; } public byte[] FileData { get; set; } [HiddenInput(DisplayValue = false)] public string FileMimeType { get; set; } //Navigation Properties public virtual Experiment Experiment { get; set; } } ViewModel: public class ExperimentViewModel { //code omitted for brevity [DataType(DataType.Upload)] public IEnumerable<HttpPostedFileBase> FileUpload { get; set; } public virtual ICollection<FileAttachment> FileAttachments { get; set; } } Controller: public JsonResult Update([Bind(Exclude = null)] ExperimentViewModel model) { List<FileAttachment> fa = new List<FileAttachment>(); //code omitted for brevity (At this step I add all the attachments in the model to "fa" paarmeter) //Mapping ViewModel to Entity Model (ExperimentViewModel > Experiment) ::::::::::::::::: var config = new MapperConfiguration(cfg => { cfg.CreateMap<ExperimentViewModel, Experiment>(); }); IMapper mapper = config.CreateMapper(); //var source = new ExperimentViewModel(); var dest = mapper.Map<ExperimentViewModel, Experiment>(model); ////:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: repository.SaveExperimentWithAttachment(dest, fa); } Concrete: public void SaveExperimentWithAttachment(Experiment experiment, IEnumerable<FileAttachment> fileAttachment) { //Update Block using (var context = new EFDbContext()) { context.Entry(experiment).State = EntityState.Modified; foreach (FileAttachment f in fileAttachment) { context.Entry(f).State = EntityState.Modified; } context.SaveChanges(); } } Here is the final answer by fixing the problems with the help of #StephenMuecke and #haim770. Many thanks both of you for your effort and kind help... Regards. public void SaveExperimentWithAttachment(Experiment experiment, IEnumerable<FileAttachment> fileAttachment) { using (var context = new EFDbContext()) { context.Entry(experiment).State = EntityState.Modified; foreach (FileAttachment f in fileAttachment) { // !!! I forgot to update the ExperimentId field for each file attachment f.ExperimentId = experiment.Id; context.Entry(f).State = EntityState.Added; //Because file attachment(s) is not updated, newly ADDED } context.SaveChanges(); } } How to join my tables with identity tables? I started a default MVC project with Identity and EF. In my app users will be able to create and edit some records. In the table for these records, I want to have the ids of users who created the record and who updated lastly. My model class is like: public class Record { public int ID { get; set; } public DateTime CreateTime { get; set; } public string CreatingUserID { get; set; } public string UpdatingUserID { get; set; } public DateTime UpdateTime { get; set; } public Enums.RecordStatus Status { get; set; } } And in RecordsController, I save new records to db like this: [Authorize] [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(FormCollection form, RecordCreateVM vm) { string userId = User.Identity.GetUserId(); DateTime now = DateTime.Now; Record rec = new Record (); if (ModelState.IsValid) { int newRecordId; using (RecordRepository wr = new RecordRepository()) { UpdateModel(rec); rec.CreateTime = now; rec.UpdateTime = now; rec.CreatingUserID = userId; rec.UpdatingUserID = userId; rec.Status = Enums.RecordStatus.Active; Record result = wr.Add(rec); wr.SaveChanges(); newRecordId = result.ID; } } } When I am listing these records, I also want my page to display these users' usernames. I get all the active records from the repository I created. public ActionResult Index() { RecordListVMviewModel = new RecordListVM(); using (RecordRepository wr = new (RecordRepository()) { viewModel.Records = wr.GetAll(); } return View(viewModel); } And this is the repository code: public class RecordRepository: Repository<Record> { public override List<Record> GetAll() { IQueryable<Record> activeRecords = DbSet.Where(w => w.Status == Enums.RecordStatus.Active); return activeRecords.ToList(); } } Where do I have to make changes? Can you give me an sample code for usages like this? Thank you. You need to change public string CreatingUserID { get; set; } public string UpdatingUserID { get; set; } to something like: public User CreatingUser { get; set; } public User UpdatingUser { get; set; } Set the ID's during the creation of new RecordRepository() Then access them as Record.CreatingUser.FirstName ect
https://html.developreference.com/article/10000090/Trying+to+serve+files+that+are+in+a+byte+array+to+my+details+view+in+an+ASP.NET+Core+2+MVC+web+app
CC-MAIN-2021-43
en
refinedweb
IFRS17 CSM Waterfall Chart Notebook¶ To run this notebook and get all the outputs below, Go to the Cell menu above, and then click Run All. About this notebook¶ This noteook demonstrates the usage of ifrs17sim project in lifelib, by building and running a model and drawing a waterfall graph of CSM amortization on a single modelpoint. Amortization of acquisition cash flows is not yet implemented.. The entire script¶ Below is the entire script of this example. The enire scipt is broken down to several parts in differenc cells, and each part is explained below. The pieces of code in cells below are executable one after another from the top. %matplotlib notebook import collections import pandas as pd from draw_charts import draw_waterfall, get_waterfalldata import modelx as mx model = mx.read_model("model") proj = model.OuterProj[1] df = get_waterfalldata( proj, items=['CSM', 'IntAccrCSM', 'AdjCSM_FlufCF', 'TransServices'], length=15, reverseitems=['TransServices']) draw_waterfall(df). [2]: import modelx as mx model = mx.read_model("model") To see what space is inside model, execute model.spaces in an empty cell. model.spaces Calculating CSM¶. [3]: proj = model.OuterProj[1] Exporting values into DataFrame¶ The code below is to construct a DataFrame object for drawing the waterfall chart, from the cells that make up bars in the waterfall chart. TransServices is passed to reverseitems parameter, to reverse the sign of its values, as we want to draw is as reduction that pushes down the CSM balance. [4]: df = get_waterfalldata( proj, items=['CSM', 'IntAccrCSM', 'AdjCSM_FlufCF', 'TransServices'], length=15, reverseitems=['TransServices']) Tha table below show the DataFrame values. [5]: df [5]: Draw waterfall chart¶ The last line is to draw the waterfall graph. The function to draw the graph was imported from the separate module draw_charts in this project directory, and was imported at the first part of this script. [6]: draw_waterfall(df) [6]: <matplotlib.axes._subplots.AxesSubplot at 0x288b6c40308>
https://lifelib.io/projects/notebooks/ifrs17sim/ifrs17sim_csm_waterfall.html
CC-MAIN-2021-43
en
refinedweb
The Service Bus team has released an updated client assembly on nuget for Service Bus for Windows Server 1.1. This update addresses a SAS feature that was added to the Azure Service Bus client in the 2.4 release: the ability to create a connection to Service Bus using only a token and not SAS Key. This enables scenarios where clients can be granted a SAS token and not be given the more sensitive SAS key. This enables a much easier SAS authentication experience for our on premises product. The added method to the TokenProvider class is highlighted below. To use this technique simply create a SAS token from the SAS key, as shown in the Main() method, then use the token in CreateSharedAccessSignatureTokenProvider(string) to create the token provider like you normally would. Pass this token provider to the MessagingFactory and you have SAS token based authentication. static void Main() { conststring sharedAccessKeyName = "all"; conststring sharedAccessKey = "<my key>"; var sasTokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(sharedAccessKeyName, sharedAccessKey); var token = sasTokenProvider.GetWebTokenAsync(serviceBusNamespace + "/" + queueName, "NotUsedWithSAS", false, TimeSpan.FromSeconds(15)).Result; ChildOperation(token); } static void ChildOperation(string token) { var existingTokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(token); var messagingFactory = MessagingFactory.Create("sb://" + serviceBusNamespace, existingTokenProvider); var queueClient = messagingFactory.CreateQueueClient(queueName); queueClient.Send(newBrokeredMessage("test")); Console.WriteLine("Successfully sent message to {0}!", queueClient.Path); var m = queueClient.Receive(); Console.WriteLine("Received '{0}' from {1}!", m, queueClient.Path); var namespaceManager = newNamespaceManager("https://" + serviceBusNamespace, existingTokenProvider); var queueDescription = namespaceManager.GetQueue(queueName); Console.WriteLine("Got QueueDescription for '{0}': MessageCount: {1}", queueDescription.Path, queueDescription.MessageCount); } As we have made SAS the default authentication provider for Azure Service Bus we want to continue to keep our Service Bus for Windows Server experience as consistent as possible. A big thank you to one of our awesome devs for enabling this scenario! Cheers Dan It has been very quiet about Service Bus for Windows Server. Can we expect an update soon? ( 1.1 was a year ago. ) One thing I cannot figure out is if Auto Forwarding works in Windows Server version. Thanks for the feedback. I concur with WillSmith. The deafening silence is actually a bit disturbing. Could we have just wasted a ton of time using a product with no support or upgrade path?
https://blogs.msdn.microsoft.com/servicebus/2014/09/10/updated-service-bus-1-1-for-windows-server-1-0-4-client-assembly/
CC-MAIN-2017-34
en
refinedweb
A quick job board with React, Meteor and Material UI I recently wrote a mini-tutorial “How to write a job app in 48 lines of code” — and here it is again, but using React JS: Facebook’s javascript love-child. This is slightly longer than 48 lines of code, but mainly because I also integrated a Material UI interface. I actually learned React so I could use this UI library. React is not strictly necessary with the Meteor framework, as Meteor is reactive out-of-the-box — but I like Google’s Material UI style, and it required React, so here we are. Getting Started Ok, so as before let’s just add our packages to a new Meteor project: meteor create projectname meteor add react coffeescript http cosmos:browserify mquandalle:jade meteorhacks:npm Clearly we need the react package, and we also need the browserify and npm packages for the Material UI library. To pull from Github API we need the http package, and I also added coffeescript and jade — because I prefer them to writing html and javascript. Main Template Our main page index.jade is fairly empty — we simply need to add the div which react hooks into — thusly: head title ReactJobs body #App React will render the html to the #App div. Startup.jsx Now let’s create our startup javascript file. Jobs = new Mongo.Collection("jobs"); if (Meteor.isClient) { Meteor.startup(function () { // injectTapEventPlugin(); React.render(<App />, document.getElementById("App")); }); } I created a collection to hold the jobs data, and in Clientside Startup we add base React.render method and React will render the html into the #App div we placed. App.jsx Now onto our app component. This is the largest file in the whole App, weighing in at 63 lines. I place all components seperately in a components folder inside the client folder: client/components. This is quite verbose, so maybe grab a coffee. const { Paper, List, ListItem, ListDivider, Avatar, RaisedButton, AppBar, FlatButton, IconButton, NavigationClose } = mui; These are required to use the Material UI library. They refer to the components we will be using. const ThemeManager = new mui.Styles.ThemeManager(); And here we attach the mui styles to Thememanager. So far, so good. App = React.createClass({ mixins: [ReactMeteorData], Our app is a React class, and we attach our own methods to it. To use React with MeteorData we need to use their Mixin — which is apparently a temporary thing. childContextTypes: { muiTheme: React.PropTypes.object }, getChildContext: function() { return { muiTheme: ThemeManager.getCurrentTheme() }; }, These two methods are required to use MUI. I’m not going to go into details about the MUI library, if you want more info about it, you can check out the link at the top of this post. getMeteorData() { return { jobs: Jobs.find({}).fetch() } }, Here is our method to fetch the Jobs data we will pull from Github jobs API. componentDidMount() { {this.loadJobs()} }, loadJobs() { loadJobs = Meteor.call("loadGithubJobs"); }, When the component loads for the first time we will fetch the jobs list from Github: this could be written in one method, but I like to keep things seperate, so the second method calls the server-side meteor method that pulls from Github API. renderJobs() { return this.data.jobs.map((job) => { return <Job key={job._id} job={job} />; }); }, Using the new Ecmascript, or latest Javascript, functions we can quickly map the data to each instance of our Job component (which we will create shortly) and return a list of react/html components. render() { return ( <div className="wrapper"> <AppBar title="Github Jobs" /> <div className="container"> <List subheader="Latest Github Jobs"> {this.renderJobs()} </List> </div> </div> ); } }); Finally, we render the main App component. In the midst of this you will notice this.renderJobs() which will return the Material List components with our data filled in each one. Job Component Now we need the React Job Component we call in the above script: const { FontIcons, IconButton, Icons, List, ListItem, ListDivider, Avatar } = mui; I’ve been a bit lazy and haven’t deleted the Material components I have not used. I left them there in case I was to expand this app. But you only need to include the components you want to use. // Task component - represents a single todo item Job = React.createClass({ render() { return ( <ListItem primaryText={ this.props.job.title } leftAvatar={ <Avatar src={ this.props.job.company_logo }/> } secondaryText={ this.props.job.location } href={this.props.job.company_url} rightIcon={ <IconButton iconClassName="muidocs-icon-custom-github" tooltip="GitHub" /> } /> ); } }); This React class will render our List Item component and fill it with the data from our collection and is available in “props”. Pull in the Github data from the API On the server, we need the method(s) which will pull the Github jobs data via http calls. I write this in Coffeescript. Meteor.methods loadGithubJobs: -> @unblock() Meteor.http.call "GET", "", (error,result) -> if(error) console.log error if(result) Meteor.call "writeJobs", (result.data) writeJobs: (jobs) -> Jobs.remove({}) Jobs.insert job for job in jobs Here we have two methods: the first one “gets” the jobs list from the API, and, if successful, calls the second method (writeJobs) to push them into our collection. I actually remove the previous Jobs loaded there as a temporary fix for this demo, so we also have the called data and no “old stuff”. I’m not going into the above methods, they are explained in the previous job app post I referenced at the top of this post which you can look into. Some other bits required for Material UI If you want to use MUI you will also have to add a couple of package files. You will need to add the following (for example) to your root package.json file: { "material-ui": "0.10.1", "externalify": "0.1.0" } And in your client/lib folder you will need a couple of files for browserify. Your json options in the file app.browserify.options { "transforms": { "externalify": { "global": true, "external": { "react": "React.require" }}}} And app.browserify.js mui = require('material-ui'); injectTapEventPlugin = require('react-tap-event-plugin'); More info about this at React and Meteor. Ok and that’s it. I’ll admit, this is early stuff — syntax changes, and the React in Meteor mixin, along with the browserify hacks are patches (in my opinion). But, it’s how it works right now. So, anyway, you should have a nice responsive, pretty web app like this running in localhost: And here is a live version If you have any errors — well, I’m not surprised — this stuff is all pretty new and rough. But if it helps you can clone my repo. A word of warning though: React is still very much in its infancy, and I’ve already found some compiling errors once packages were updated — you know how touchy these dependencies can be… You can ping me on twitter @derrybirkett if you really want to. For now, onward! Originally posted on my blog:
https://medium.com/@derrybirkett/how-to-code-a-quick-job-board-with-react-meteor-and-material-ui-d4ab3b619ec3
CC-MAIN-2017-34
en
refinedweb
looking for a kind of wildcard on selectBy statement Let's see this clarifying example: class Person(SQLObject): name = StringCol() age = IntCol() gender = StringCol() def personFilter(nameFilter=**wildcard**, ageFilter=**wildcard**, genderFilter=**wildcard**): persons = Person.selectBy(name=nameFilter, age=ageFilter, gender=genderFilter) return list(persons) Well, i want a way to call personFilter like this: personFilter(nameFilter='Joseph') # Gets Josephs in Person personFilter(nameFilter='Joseph', ageFilter='23') # Gets Josephs aged 23 in Person personFilter() # Gets all Persons So i wonder if it's there any wildcard that i can use in the personFilter prototype or any other way to do the same. Thanks !!! On Mon, Aug 28, 2006 at 09:09:11PM +0200, Felix wrote: > class Person(SQLObject): > name = StringCol() > age = IntCol() > gender = StringCol() > > def personFilter(nameFilter=**wildcard**, ageFilter=**wildcard**, genderFilter=**wildcard**): > persons = Person.selectBy(name=nameFilter, age=ageFilter, gender=genderFilter) > return list(persons) def personFilter(nameFilter=None, ageFilter=None, genderFilter=None): filter = {} if nameFilter: filter["name"] = nameFilter if ageFilter: filter["age"] = ageFilter if genderFilter: filter["gender"] = genderFilter persons = Person.selectBy(**filter) return list(persons) Oleg. -- Oleg Broytmann phd@... Programmers don't die, they just GOSUB without RETURN. Great Oleg !! but i can see that it was a python question more than a Sqlobject question LoL, sorry and thanks I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details
https://sourceforge.net/p/sqlobject/mailman/message/12289775/
CC-MAIN-2017-34
en
refinedweb
Source:NetHack 3.6.0/src/write.c From NetHackWiki (Redirected from Source:Write.c) Below is the full text to write.c from the source code of NetHack 3.6.0. To link to a particular line, write [[Source:NetHack 3.6.0/src/write.c. Top of file /* NetHack 3.6 write.c $NHDT-Date: 1446078770 2015/10/29 00:32:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ */ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" STATIC_DCL int FDECL(cost, (struct obj *)); STATIC_DCL boolean FDECL(label_known, (int, struct obj *)); STATIC_DCL char *FDECL(new_book_description, (int, char *)); cost /* * returns basecost of a scroll or a spellbook */ STATIC_OVL int cost(otmp) register struct obj *otmp; { if (otmp->oclass == SPBOOK_CLASS) return (10 * objects[otmp->otyp].oc_level); switch (otmp->otyp) { #ifdef MAIL case SCR_MAIL: return 2; #endif case SCR_LIGHT: case SCR_GOLD_DETECTION: case SCR_FOOD_DETECTION: case SCR_MAGIC_MAPPING: case SCR_AMNESIA: case SCR_FIRE: case SCR_EARTH: return 8; case SCR_DESTROY_ARMOR: case SCR_CREATE_MONSTER: case SCR_PUNISHMENT: return 10; case SCR_CONFUSE_MONSTER: return 12; case SCR_IDENTIFY: return 14; case SCR_ENCHANT_ARMOR: case SCR_REMOVE_CURSE: case SCR_ENCHANT_WEAPON: case SCR_CHARGING: return 16; case SCR_SCARE_MONSTER: case SCR_STINKING_CLOUD: case SCR_TAMING: case SCR_TELEPORTATION: return 20; case SCR_GENOCIDE: return 30; case SCR_BLANK_PAPER: default: impossible("You can't write such a weird scroll!"); } return 1000; } label_known /* decide whether the hero knowns a particular scroll's label; unfortunately, we can't track things are haven't been added to the discoveries list and aren't present in current inventory, so some scrolls with ought to yield True will end up False */ STATIC_OVL boolean label_known(scrolltype, objlist) int scrolltype; struct obj *objlist; { struct obj *otmp; /* only scrolls */ if (objects[scrolltype].oc_class != SCROLL_CLASS) return FALSE; /* type known implies full discovery; otherwise, user-assigned name implies partial discovery */ if (objects[scrolltype].oc_name_known || objects[scrolltype].oc_uname) return TRUE; /* check inventory, including carried containers with known contents */ for (otmp = objlist; otmp; otmp = otmp->nobj) { if (otmp->otyp == scrolltype && otmp->dknown) return TRUE; if (Has_contents(otmp) && otmp->cknown && label_known(scrolltype, otmp->cobj)) return TRUE; } /* not found */ return FALSE; } dowrite static NEARDATA const char write_on[] = { SCROLL_CLASS, SPBOOK_CLASS, 0 }; /* write -- applying a magic marker */ int dowrite(pen) register struct obj *pen; { register struct obj *paper; char namebuf[BUFSZ], *nm, *bp; register struct obj *new_obj; int basecost, actualcost; int curseval; char qbuf[QBUFSZ]; int first, last, i, deferred, deferralchance; boolean by_descr = FALSE; const char *typeword; if (nohands(youmonst.data)) { You("need hands to be able to write!"); return 0; } else if (Glib) { pline("%s from your %s.", Tobjnam(pen, "slip"), makeplural(body_part(FINGER))); dropx(pen); return 1; } /* get paper to write on */ paper = getobj(write_on, "write on"); if (!paper) return 0; /* can't write on a novel (unless/until it's been converted into a blank spellbook), but we want messages saying so to avoid "spellbook" */ typeword = (paper->otyp == SPE_NOVEL) ? "book" : (paper->oclass == SPBOOK_CLASS) ? "spellbook" : "scroll"; if (Blind) { if (!paper->dknown) { You("don't know if that %s is blank or not.", typeword); return 1; } else if (paper->oclass == SPBOOK_CLASS) { /* can't write a magic book while blind */ pline("%s can't create braille text.", upstart(ysimple_name(pen))); return 1; } } paper->dknown = 1; if (paper->otyp != SCR_BLANK_PAPER && paper->otyp != SPE_BLANK_PAPER) { pline("That %s is not blank!", typeword); exercise(A_WIS, FALSE); return 1; } /* what to write */ Sprintf(qbuf, "What type of %s do you want to write?", typeword); getlin(qbuf, namebuf); (void) mungspaces(namebuf); /* remove any excess whitespace */ if (namebuf[0] == '\033' || !namebuf[0]) return 1; nm = namebuf; if (!strncmpi(nm, "scroll ", 7)) nm += 7; else if (!strncmpi(nm, "spellbook ", 10)) nm += 10; if (!strncmpi(nm, "of ", 3)) nm += 3; if ((bp = strstri(nm, " armour")) != 0) { (void) strncpy(bp, " armor ", 7); /* won't add '\0' */ (void) mungspaces(bp + 1); /* remove the extra space */ } deferred = 0; /* not any scroll or book */ deferralchance = 0; /* incremented for each oc_uname match */ first = bases[(int) paper->oclass]; last = bases[(int) paper->oclass + 1] - 1; for (i = first; i <= last; i++) { /* extra shufflable descr not representing a real object */ if (!OBJ_NAME(objects[i])) continue; if (!strcmpi(OBJ_NAME(objects[i]), nm)) goto found; if (!strcmpi(OBJ_DESCR(objects[i]), nm)) { by_descr = TRUE; goto found; } /* user-assigned name might match real name of a later entry, so we don't simply use first match with it; also, player might assign same name multiple times and if so, we choose one of those matches randomly */ if (objects[i].oc_uname && !strcmpi(objects[i].oc_uname, nm) /* * First match: chance incremented to 1, * !rn2(1) is 1, we remember i; * second match: chance incremented to 2, * !rn2(2) has 1/2 chance to replace i; * third match: chance incremented to 3, * !rn2(3) has 1/3 chance to replace i * and 2/3 chance to keep previous 50:50 * choice; so on for higher match counts. */ && !rn2(++deferralchance)) deferred = i; } /* writing by user-assigned name is same as by description: fails for books, works for scrolls (having an assigned type name guarantees presence on discoveries list) */ if (deferred) { i = deferred; by_descr = TRUE; goto found; } There("is no such %s!", typeword); return 1; found: if (i == SCR_BLANK_PAPER || i == SPE_BLANK_PAPER) { You_cant("write that!"); pline("It's obscene!"); return 1; } else if (i == SPE_BOOK_OF_THE_DEAD) { pline("No mere dungeon adventurer could write that."); return 1; } else if (by_descr && paper->oclass == SPBOOK_CLASS && !objects[i].oc_name_known) { /* can't write unknown spellbooks by description */ pline("Unfortunately you don't have enough information to go on."); return 1; } /* KMH, conduct */ u.uconduct.literate++; new_obj = mksobj(i, FALSE, FALSE); new_obj->bknown = (paper->bknown && pen->bknown); /* shk imposes a flat rate per use, not based on actual charges used */ check_unpaid(pen); /* see if there's enough ink */ basecost = cost(new_obj); if (pen->spe < basecost / 2) { Your("marker is too dry to write that!"); obfree(new_obj, (struct obj *) 0); return 1; } /* we're really going to write now, so calculate cost */ actualcost = rn1(basecost / 2, basecost / 2); curseval = bcsign(pen) + bcsign(paper); exercise(A_WIS, TRUE); /* dry out marker */ if (pen->spe < actualcost) { pen->spe = 0; Your("marker dries out!"); /* scrolls disappear, spellbooks don't */ if (paper->oclass == SPBOOK_CLASS) { pline_The("spellbook is left unfinished and your writing fades."); update_inventory(); /* pen charges */ } else { pline_The("scroll is now useless and disappears!"); useup(paper); } obfree(new_obj, (struct obj *) 0); return 1; } pen->spe -= actualcost; /* * Writing by name requires that the hero knows the scroll or * book type. One has previously been read (and its effect * was evident) or been ID'd via scroll/spell/throne and it * will be on the discoveries list. * (Previous versions allowed scrolls and books to be written * by type name if they were on the discoveries list via being * given a user-assigned name, even though doing the latter * doesn't--and shouldn't--make the actual type become known.) * * Writing by description requires that the hero knows the * description (a scroll's label, that is, since books by_descr * are rejected above). BUG: We can only do this for known * scrolls and for the case where the player has assigned a * name to put it onto the discoveries list; we lack a way to * track other scrolls which have been seen closely enough to * read the label without then being ID'd or named. The only * exception is for currently carried inventory, where we can * check for one [with its dknown bit set] of the same type. * * Normal requirements can be overridden if hero is Lucky. */ /* if known, then either by-name or by-descr works */ if (!objects[new_obj->otyp].oc_name_known /* else if named, then only by-descr works */ && !(by_descr && label_known(new_obj->otyp, invent)) /* and Luck might override after both checks have failed */ && rnl(Role_if(PM_WIZARD) ? 5 : 15)) { You("%s to write that.", by_descr ? "fail" : "don't know how"); /* scrolls disappear, spellbooks don't */ if (paper->oclass == SPBOOK_CLASS) { You( "write in your best handwriting: \"My Diary\", but it quickly fades."); update_inventory(); /* pen charges */ } else { if (by_descr) { Strcpy(namebuf, OBJ_DESCR(objects[new_obj->otyp])); wipeout_text(namebuf, (6 + MAXULEV - u.ulevel) / 6, 0); } else Sprintf(namebuf, "%s was here!", plname); You("write \"%s\" and the scroll disappears.", namebuf); useup(paper); } obfree(new_obj, (struct obj *) 0); return 1; } /* can write scrolls when blind, but requires luck too; attempts to write books when blind are caught above */ if (Blind && rnl(3)) { /* writing while blind usually fails regardless of whether the target scroll is known; even if we have passed the write-an-unknown scroll test above we can still fail this one, so it's doubly hard to write an unknown scroll while blind */ You("fail to write the scroll correctly and it disappears."); useup(paper); obfree(new_obj, (struct obj *) 0); return 1; } /* useup old scroll / spellbook */ useup(paper); /* success */ if (new_obj->oclass == SPBOOK_CLASS) { /* acknowledge the change in the object's description... */ pline_The("spellbook warps strangely, then turns %s.", new_book_description(new_obj->otyp, namebuf)); } new_obj->blessed = (curseval > 0); new_obj->cursed = (curseval < 0); #ifdef MAIL if (new_obj->otyp == SCR_MAIL) new_obj->spe = 1; #endif new_obj = hold_another_object(new_obj, "Oops! %s out of your grasp!", The(aobjnam(new_obj, "slip")), (const char *) 0); return 1; } new_book_description /* most book descriptions refer to cover appearance, so we can issue a message for converting a plain book into one of those with something like "the spellbook turns red" or "the spellbook turns ragged"; but some descriptions refer to composition and "the book turns vellum" looks funny, so we want to insert "into " prior to such descriptions; even that's rather iffy, indicating that such descriptions probably ought to be eliminated (especially "cloth"!) */ STATIC_OVL char * new_book_description(booktype, outbuf) int booktype; char *outbuf; { /* subset of description strings from objects.c; if it grows much, we may need to add a new flag field to objects[] instead */ static const char *const compositions[] = { "parchment", "vellum", "cloth", #if 0 "canvas", "hardcover", /* not used */ "papyrus", /* not applicable--can't be produced via writing */ #endif /*0*/ 0 }; const char *descr, *const *comp_p; descr = OBJ_DESCR(objects[booktype]); for (comp_p = compositions; *comp_p; ++comp_p) if (!strcmpi(descr, *comp_p)) break; Sprintf(outbuf, "%s%s", *comp_p ? "into " : "", descr); return outbuf; } /*write.c*/
https://nethackwiki.com/wiki/Source:Write.c
CC-MAIN-2017-34
en
refinedweb
Quick Tip: Make IndexedDB a Breeze With LocalForage IndexedDB is a local NoSQL database that allows developers to safely store data in the browser. It has great cross-platform support, works with any type of data, and is powerful enough for building apps that work offline. Although it is probably the best solution for client side storage, IndexedDB has one critical flaw - it's low-level API. Things like transactions, cursors, and a lack of support for promises over-complicate IndexedDB and make it exhausting to work with. Thankfully, there is a more dev-friendly way! LocalForage to the Rescue LocalForage is an open-source JavaScript library that makes working with in-browser databases much more enjoyable. On the outside its API looks very similar to localStorage, while under the hood it hides the entire arsenal of IndexedDB features. Compared to the 15 lines of code required to do anything with IndexedDB, with localForage creating a database and accessing its entries comes down to using a simple method. It also adds much needed support for promises plus other helpful utilities. Installation Adding localForage to a project is quite simple. Either drop it directly into the HTML: <script src="assets/js/localforage.min.js"></script> Or install using a package manager of your choice: npm install localForage --save The library is browserify-friendly and can be used with bundlers like Webpack. The localForage interface doesn't require any additional initialization or loading so we can use it as soon as it becomes available. import localforage from "localforage"; localforage.setItem('key', 'value'); Writing to the Store Since we don't have to setup or create new databases, we can go right in and add some data to our store. This is done via the setItem method, taking two parameters - key and value. - key - Unique, case-sensitive identifier that will be used whenever we want to access that item later on. Using setItemagain on the same key will overwrite it. - value - The data we want to store. It can be any valid string, number, object, array or file blob. The process is asynchronous so if we want to do something else with the data and handle errors we have to use a promise or callback. var hexColors = { red: 'ff0000', green: '00ff00', yellow: 'ffff00' }; localforage.setItem('colors', hexColors).then(function (value) { console.log(value.red); }).catch(function(err) { console.error(err); }); Reading from the Store Fetching items from the database works in pretty much the same way. We simply use getItem, pass the name of the key, and use a promise to work with the data. localforage.getItem('colors').then(function (value) { console.log(value.red); }).catch(function(err) { console.error(err); }); If we try to get a key that doesn't exist the promise will resolve successfully but the value inside will be null. Other Methods LocalForage has some other useful methods for working with the database. They are all just as easy to use as setItem and getItem, also supporting promises or callbacks. removeItem(key)- Removes the key/value pair from the store. keys()- Returns an array of all the keys' names (only the names). iterate(callback)- Works like forEach, expecting a callback function and going over all the key/value pairs. length()- Returns the number of items in the store. clear()- Wipes out the store. Multiple Databases So far the examples in this article used the localforage interface directly resulting in a single global store. If we need more then one store we can create as many instances as we want using createInstance: var dogStore = localforage.createInstance({ name: "Dogs" }); var catStore = localforage.createInstance({ name: "Cats" }); Each store is completely independant and has access only to it's own data (NoSQL databases are mostly non-relational). dogStore.setItem('Jake', 'Good boy'); catStore.getItem('Jake').then(function (value) { console.log(value); // Will result in null }); Conclusion If you are looking for a simple way to manage client-side databases, localForage is one of the best tools available right now. It's API provides all the needed utilities, giving you enough freedom to organize your storage however you see fit. - The official docs - The project's documentation isn't very detailed but covers most of what you need to know. - localForage on GitHub - The repo is very active, if you have any problems with the library make sure to check the issues here first. - angular-localForage - Plugin for working with localForage in Angular. Presenting Bootstrap Studio a revolutionary tool that developers and designers use to create beautiful interfaces using the Bootstrap Framework. Thanks for the fantastic article, Danny! I have tried using IndexedDB in my web app, but as you've written it is so low level that it is a paint to work with. I only wish I had known about LocalForage earlier. Thks Danny for this tutorial but whats the limit of data that can be stored localForage There is no fixed limit on the amount of data you can store in localForage and indexedDB. The size of available storage depends on how much space is on the user's hard drive and which browser he is using. Here is a great article on that topic:
https://tutorialzine.com/2017/05/quick-tip-make-indexed-db-a-breeze-with-local-forage
CC-MAIN-2017-34
en
refinedweb
hi Sushant, Thanks for the code for socket programming.. i tried in the same way u have mentioned, except for changing the IP address(in my system it is 10.0.2.15).. but when i execute the code & send a message from client – I’m getting “Error 3” in client side android window. Please do suggest me to how to get over this error.., i get this error when i follow the steps given, using ‘ant debug’ in linux, /home/keifer/Desktop/android_sdk/android-sdk-linux/tools/ant/build.xml:421: org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 2; The markup in the document following the root element must be well-formed. As I’m new to all of this field, wanted to try such application. Can you please guide me?Reply […] Socket Programming Posted by Sushant on August 17, 2011 This is a sample program that uses socket class to make a chat application, by this you can create a Server and a Client in two Emulator and chat to write and read data. Underlying Algorithm: Basic description of algorithm in step by step form: 1.) Create Two Projects one for server MyServer and another… Filed in: Android Development, Android Programming Tutorials 0 [… hi, nice tutorial… but i have an issue when I run on my 2 emulators with exactly what you explained.. i get nothing being transferred between both… both are running fine but not working…i am using that at house without any firewall or proxy thing… will you please help me out? thanks in advance Hi , I am also trying to similar kind of thing, in my case PC working as server , emulator as client ..but I am facing error , log as follow : 05-03 12:32:16.813: I/ActivityManager(77): Start proc com.test for activity com.test/.TestActivity: pid=964 uid=10041 gids={3003} 05-03 12:32:17.154: W/NetworkManagementSocketTagger(77): setKernelCountSet(10041, 1) failed with errno -2 05-03 12:32:18.064: W/System.err(964): java.net.ConnectException: failed to connect to /127.0.0.1 (port 11701): connect failed: ECONNREFUSED (Connection refused) 05-03 12:32:18.064: W/System.err(964): at libcore.io.IoBridge.connect(IoBridge.java:114) 05-03 12:32:18.074: W/System.err(964): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192) 05-03 12:32:18.074: W/System.err(964): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) 05-03 12:32:18.084: W/System.err(964): at java.net.Socket.startupSocket(Socket.java:566) 05-03 12:32:18.084: W/System.err(964): at java.net.Socket.tryAllAddresses(Socket.java:127) 05-03 12:32:18.084: W/System.err(964): at java.net.Socket.(Socket.java:177) 05-03 12:32:18.084: W/System.err(964): at java.net.Socket.(Socket.java:149) 05-03 12:32:18.094: W/System.err(964): at com.azoi.neo.Connection.connect(Connection.java:28) 05-03 12:32:18.094: W/System.err(964): at com.azoi.neo.IClient.connect(IClient.java:11) 05-03 12:32:18.094: W/System.err(964): at com.test.TestActivity.connection(TestActivity.java:73) 05-03 12:32:18.094: W/System.err(964): at com.test.TestActivity.access$0(TestActivity.java:69) 05-03 12:32:18.104: W/System.err(964): at com.test.TestActivity$1.run(TestActivity.java:37) 05-03 12:32:18.104: W/System.err(964): at java.lang.Thread.run(Thread.java:856) 05-03 12:32:18.113: W/System.err(964): Caused by: libcore.io.ErrnoException: connect failed: ECONNREFUSED (Connection refused) 05-03 12:32:18.113: W/System.err(964): at libcore.io.Posix.connect(Native Method) 05-03 12:32:18.154: W/System.err(964): at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85) 05-03 12:32:18.154: W/System.err(964): at libcore.io.IoBridge.connectErrno(IoBridge.java:127) 05-03 12:32:18.174: W/System.err(964): at libcore.io.IoBridge.connect(IoBridge.java:112) 05-03 12:32:18.174: W/System.err(964): … 12 more please give suggestion if any one have idea over this.Reply when i try to run this i get following error 07-29 12:35:29.387: W/System.err(336): java.lang.NullPointerException 07-29 12:35:29.387: W/System.err(336): at com.example.socketclient.SocketClient$1.onClick(SocketClient.java:60) 07-29 12:35:29.387: W/System.err(336): at android.view.View.performClick(View.java:2485) 07-29 12:35:29.387: W/System.err(336): at android.view.View$PerformClick.run(View.java:9080) 07-29 12:35:29.387: W/System.err(336): at android.os.Handler.handleCallback(Handler.java:587) 07-29 12:35:29.387: W/System.err(336): at android.os.Handler.dispatchMessage(Handler.java:92) 07-29 12:35:29.397: W/System.err(336): at android.os.Looper.loop(Looper.java:123) 07-29 12:35:29.397: W/System.err(336): at android.app.ActivityThread.main(ActivityThread.java:3683) 07-29 12:35:29.397: W/System.err(336): at java.lang.reflect.Method.invokeNative(Native Method) 07-29 12:36:12.067: W/System.err(336): at android.view.View.performClick(View.java:2485) 07-29 12:36:12.067: W/System.err(336): at android.view.View$PerformClick.run(View.java:9080) 07-29 12:36:12.067: W/System.err(336): at android.os.Handler.handleCallback(Handler.java:587) 07-29 12:36:12.067: W/System.err(336): at android.os.Handler.dispatchMessage(Handler.java:92) 07-29 12:36:12.067: W/System.err(336): at android.os.Looper.loop(Looper.java:123) 07-29 12:36:12.067: W/System.err(336): at android.app.ActivityThread.main(ActivityThread.java:3683) 07-29 12:36:12.077: W/System.err(336): at java.lang.reflect.Method.invokeNative(Native Method) 07-29 12:36:12.077: W/System.err(336): at java.lang.reflect.Method.invoke(Method.java:507) 07-29 12:36:12.077: W/System.err(336): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 07-29 12:36:12.077: W/System.err(336): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 07-29 12:36:12.077: W/System.err(336): at dalvik.system.NativeStart.main(Native Method) 07-29 12:36:50.327: D/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol question : i have used ur example and this working fine on 2 emulators but on really phones its not working i got my phone ip and i tryed to connect to it from other phone but i got no respons + the ip u get is a local ip 10.X.X.X and there is no way to fowrd the port to ur target phone so i dont see how this can be done unless ur on the same network like wifi (i all so think the providers block it )or mabye am worng and there is a way??:)Reply I’m looking to do this but alot of the tutorials I’ve seen for Android warn against using Threads, they say instead to use AsyncTask and use the callback that comes with it… I’m not sure if you have thoughts on that but I’d love to know them as I’m trying to become more familiar in this area…Reply If it crashes, you may need to add this in the onCreate function StrictMode.ThreadPolicy policy = new StrictMode .ThreadPolicy .Builder() .permitNetwork() .build(); StrictMode.setThreadPolicy(policy); After putting that, my program does not crash, but it get’s stuck when creating the socket. Any help . 35 in client side. please do guide. 46 in client side. please do guide.Reply Hello, I am able to implement the code the problem I am facing here is that on the server side When I started the application It is showing the error 12-03 06:25:38.510: W/System.err(418): java.net.SocketException: Socket is closed I dont know what is the possible bug. If you can help me It would be appreciable. I more thing I am testing on two emulators. Hi, I’m just wondering if you could use this to communicate between an emulator and a device?? Create the two activities in the one project, launch it on the emulator first, have your manifest set that you can have two buttons to select either or activity, select one on the emulator, then run it on the device, selecting the second activity?Reply i not understand 5th and 6th step . i do all things . but when i try to run . 1st i run the server and then i run the client in the same machine . when i type msg and click send it tell that the application server client(process com.app.serverclient) has stoped un expectedly. can any one help for thisReply I have problem with my client class as exception throws plz help meReply package com.example.clientservertest; import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.view.View; public class SocketClient extends Activity { private Button bt; private TextView tv; private Socket socket; private String serverIpAddress = “127.0.0.1”; // AND THAT’S MY DEV’T MACHINE WHERE PACKETS TO // PORT 5000 GET REDIRECTED TO THE SERVER EMULATOR’S // PORT 6000 private static final int REDIRECTED_SERVERPORT = 5000; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); bt = (Button) findViewById(R.id.myButton); tv = (TextView) findViewById(R.id.myTextView); try { InetAddress serverAddr = InetAddress.getByName(serverIpAddress); socket = new Socket(serverAddr, REDIRECTED_SERVERPORT); } catch (UnknownHostException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } bt.setOnClickListener(new OnClickListener() { public void onClick(View v) { try { EditText et = (EditText) findViewById(R.id.EditText01); String str = et.getText().toString(); PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true); out.println(str); Log.d(“Client”, “Client sent message”); } catch (UnknownHostException e) { tv.setText(“Error1”); e.printStackTrace(); } catch (IOException e) { tv.setText(“Error2”); e.printStackTrace(); } catch (Exception e) { tv.setText(“Error3”); e.printStackTrace(); } } }); } } throw the exception We’re a group of volunteers and starting a new scheme in our community. Your site offered us with helpful info to paintings on. You have done a formidable process and our entire community shall be thankful to you.Reply Hii, Thanks for this effort. I am pretty new to socket program, I can able to run the app and the server can get the string from client. But this will happen for first time, when i post to server for second time, the edited text is not appear. I really dont know where i made mistake. Moreover i dint wrote separate class for server or client. I mingled together. Can you please guide me on where i made mistake or what should i do to post the message concurrently. Thanks in advanceReply Hi! Could you send to my e-mail this project? ServerClient application hangs. ServerClient/srs/com/app/ServerClient/ServerClient.java faulty code: try { InetAddress serverAddr = InetAddress.getByName (serverIpAddress); socket = new Socket (serverAddr, REDIRECTED_SERVERPORT); } Catch (UnknownHostException e1) { e1.printStackTrace (); } Catch (IOException e1) { e1.printStackTrace (); } Thank! I’m getting this warning W/InputEventReceiver(1167): Attempted to finish an input event but the input event receiver has already been disposed. im checking in two emulators and the message is not send to the server emulator, i have done all that is necessary and mentioned here, what might i be missing??Reply […] can use sockets for it. See here and […]Reply i have suceessfully send the msg on server but enable to receive server response from server if have you any idea please share it with me it will my great pleasure to me….Reply Hi, will this example works in two emulators of different machines.i have two machines like 192.168.0.10 and 192.168.0.25,can i run server in one machine and client in other machine.will socket connection works like that?if not can you just give an example for that? kindly help as i am new to android….Reply
http://www.edumobile.org/android/socket-programming/
CC-MAIN-2017-34
en
refinedweb
3-D Graphics Programming with Irrlicht There's something about 3-D graphics that just draws you in. Even though I have a degree in Mathematics, I've always had the impression that programming in 3-D would be difficult. I've recently discovered though, that it's really not very hard. In fact, it's almost easy and a lot of fun—thanks to the Irrlicht 3-D graphics engine. The Irrlicht 3-D graphics engine is written in C++ and allows you to get impressive results without a whole lot of code, as you'll see later in this article. With Irrlicht, you can write programs that will run under Linux or Windows and take advantage of OpenGL or DirectX. Irrlicht directly supports 3-D models in various formats, including Maya (.obj), COLLADA (.dae), Quake 3 levels (.bsp), Quake 2 models (.md2) and Microsoft DirectX (.X), among others. This means there are plenty of ready-made models available for download on the Internet that can be used with Irrlicht. Also, many tools are available for creating models and textures to use with Irrlicht. When I was evaluating some other 3-D engines, I chose Irrlicht because it seemed to be the easiest to wrap my head around, while at the same time, it had all the features I wanted. Irrlicht supports both mesh-based animation as well as a skeletal animation system. With Irrlicht, materials can be layered to produce stunning effects. And most important, Irrlicht is extremely well documented with tutorials on-line as well as a very responsive on-line forum. Oh, and it's free. And, it's open source. Listing 1 shows a sample program I wrote in order to demonstrate a few of Irrlicht's features. Listing 1. Irrlicht Sample Program 1 #include <irrlicht/irrlicht.h> 2 #include "unistd.h" 3 using namespace irr; 4 using namespace irr::core; 5 using namespace irr::video; 6 using namespace std; 7 IrrlichtDevice* device; 8 video::IVideoDriver* driver; 9 scene::ISceneManager* smgr; 10 scene::ICameraSceneNode* camera; 11 scene::IAnimatedMesh* ground; 12 scene::IMeshSceneNode* ground_node; 13 scene::IAnimatedMesh* house; 14 scene::IMeshSceneNode* house_node; 15 scene::IAnimatedMesh* avatar; 16 scene::IAnimatedMeshSceneNode* avatar_node; 17 video::SMaterial material; 18 scene::ISceneNode* cube; 19 int main () { 20 //video::EDT_SOFTWARE 21 //video::EDT_NULL 22 //video::EDT_OPENGL, 23 device=createDevice(video::EDT_OPENGL, 24 dimension2d<s32>(640,480),16,false,true); 25 26 if (device == 0) return(1); 27 driver = device->getVideoDriver(); 28 smgr = device->getSceneManager(); 29 smgr->addSkyBoxSceneNode( 30 driver->getTexture("./graph/irrlicht2_up.jpg"), 31 driver->getTexture("./graph/irrlicht2_dn.jpg"), 32 driver->getTexture("./graph/irrlicht2_lf.jpg"), 33 driver->getTexture("./graph/irrlicht2_rt.jpg"), 34 driver->getTexture("./graph/irrlicht2_ft.jpg"), 35 driver->getTexture("./graph/irrlicht2_bk.jpg")); 36 37 smgr->addLightSceneNode(0, vector3df(0, 100, 0), 38 video::SColorf(1.0f, 1.0f, 1.0f), 1000.0f, -1); 39 smgr->setAmbientLight(video::SColorf(255.0,255.0,255.0)); 40 camera = smgr->addCameraSceneNodeFPS(0,30.0f,90.0f,-1, 0,0,false,0.0f); 41 camera->setPosition(vector3df(30,10,30)); 42 ground = smgr->getMesh("./graph/grass.obj"); 43 ground_node = smgr->addMeshSceneNode(ground); 44 ground_node->setScale(vector3df(1000,1,1000)); 45 ground_node->setMaterialFlag(EMF_LIGHTING, false); 46 material.setTexture(0, driver->getTexture("./graph/building.tga")); 47 house = smgr->getMesh("./graph/building.obj"); 48 for (int i=0; i<5; i++) { 49 house_node = smgr->addMeshSceneNode(house); 50 house_node->setScale(vector3df(.5,.5,.5)); 51 house_node->setPosition(vector3df(30*i+5,0,-30)); 52 house_node->getMaterial(0) = material; 53 house_node->setRotation(vector3df(0,90,0)); 54 } 55 material.setTexture(0, driver->getTexture("./graph/sydney.bmp")); 56 avatar = smgr->getMesh("./graph/sydney.md2"); 57 avatar_node = smgr->addAnimatedMeshSceneNode(avatar); 58 avatar_node->setScale(vector3df(.1,.1,.1)); 59 avatar_node->setPosition(vector3df(5,2.5,5)); 60 avatar_node->setRotation(vector3df(0,270,0)); 61 avatar_node->getMaterial(0) = material; 62 cube = smgr->addCubeSceneNode(1.0f, 0, -1, 63 vector3df(10, 2, 10), 64 vector3df(45.0, 0, 0), 65 vector3df(1.0f, 1.0f, 1.0f)); 66 cube->setMaterialTexture(0, driver->getTexture("graph/purple.jpg")); 67 cube->addAnimator( smgr->createRotationAnimator(vector3df(1,.5,.25))); 68 while (device->run()) { 69 driver->beginScene(true,true, video::SColor(255,100,101,140)); 70 smgr->drawAll(); 71 driver->endScene(); 72 } 73 driver->drop(); 74 return(0); 75 } The first 18 lines of code are pretty easy to follow. They include the irrlicht.h header file, which contains all the declarations I'll need. Then, I define a few namespaces and variables for later use in the program. The main function begins on line 19. On line 23, I ask Irrlicht to set up my display window. Here, I tell it to use the OpenGL render engine and to use a 640x480 display resolution. I've included comments in lines 20–22 that show what values to use to select from the various other render engines that Irrlicht supports. In line 26, I check to make sure the call to createDevice() was successful. If it wasn't successful, it's Game Over, literally. Lines 27 and 28 initialize a few objects that I'll use throughout the rest of the code. The driver object allows me to change various aspects of how the window is rendered; I'll use this object in the next code block. The smgr object is the scene manager object and is the object I use to add objects to my scene, such as cameras, lights and other objects. In lines 29–35, I set up what's known as a skybox. A skybox is exactly what it sounds like. Imagine a giant box that is set down over a scene, each face of the box having a different mural on it. So, if you were to look to the west, you would see the mural on the western face of that skybox. And, if that mural were a picture of a sunset, it would present the illusion that you were looking at a real sunset. In my example here, I use the skybox textures that came with the Irrlicht tutorials. A common mistake that first-time Irrlicht users make is building up their scene by adding all kinds of models and various types of objects, but when they go to display their creation, they don't see anything but black. You can't see anything without light. I add a light object as well as some ambient light in lines 37–39. At this point in the code, I get my first introduction to what's known as a vector. A vector is simply an object that has more than one numerical component. In this case, it's a vector3df object, which simply means it's composed of three floating-point components. You can think of these components as X, Y and Z, or perhaps up/down, left/right and forward/backward. Essentially, a vector allows you to store a location in 3-D space. The SColor vector in line 39 also has three elements. In this case, it's safe to think Red, Green and Blue. Lines 40 and 41 are probably the most important. Without them, I still would not see anything, nor would I be able to “walk around” in my scene. In line 40, I add a First Person Shooter (FPS) camera to the scene. It's this camera that determines what I see. It's also this camera that I move around with the arrow keys and mouse. The FPS camera is my eyes into the game. The Irrlicht engine supports various other camera types, but the FPS camera is the most intuitive, because it mimics the FPS games everyone's familiar with. In line 41, I position the camera at a location described by the vector, (30,10,30). Lines 42–45 are where I add my first mesh to the scene. Think of a mesh as just a bunch of triangles and rectangles that are put together to form the shape of an object. In this case, I'm adding a simple rectangle shape to form the ground in my demonstration. First, I call getMesh() to read a mesh from an external file. Then, I call addMeshSceneNode() to convert that mesh into a local representation and add it to my scene. This function returns an object that gives me access to that representation. Using this object allows me to use the setPosition() and setScale() methods to move the mesh around and set its size in my scene. Finally, I use the setMaterial() method to tell Irrlicht that this object does not emit light on its own. At this point, I have a sky, some light to see by, a camera to see with and some ground to stand on. But, it gets better. I put in a few background objects in lines 46–54. In this block of code, I create my first material by reading in an external texture file. This material then will be applied to the meshes as I add them to my scene. On line 47, I read in the mesh that eventually will be used to add a row of stone “houses” to my scene. Inside the loop, I add them to the scene, scale them, position them in a row, and turn them around a bit. Finally, on line 52, I apply the material that I created on line 46. Figure 1 shows what's inside building.tga—it's what might happen if you thought of the house as simply a box and “unfolded” it so all of its sides fit flat on a piece of paper. I then added a slate texture and a label to each face. When I apply this material to the mesh in line 52, the faces from building.tga are wrapped around the model to form an object that appears to be made of stone. This process is known as UV mapping. Lines 55–61 expose as much complexity as you're going to see in this short example. Here, I reuse the material variable, which is probably bad form, but this is only meant to be a quick demonstration. This time, I'm reading in a UV mapping that is considerably more complex than the box I created for the houses earlier. This material is used as a skin for the sydney.md2 Quake model. In line 57, you can see that this is an animated mesh, which is different from the meshes discussed so far. An animated mesh contains several meshes that can be used, in turn, to create animations. In this case, Sydney has various death-scene animations. She also has a running animation. Sometimes, at one point, I swear she's doing the Macarena! The rest of the code block is devoted to scaling, positioning and rotating the model to our liking. Now things get a little psychedelic. In lines 62–66, I create a cube that appears to be floating just above the ground. I also apply a purple skin to it. Sure, purple floating cubes are one thing, but on line 67, I make it rotate in space. To add to the visual effect, I specify that the cube revolves once per second around the X axis while revolving around the Y axis twice a second, and finally, it revolves around the Z axis three times a second. The result is a cube that floats in space and spins around in an apparently random fashion. Lines 68–72 are the main run loop. The run() method returns true until users press the Esc key, indicating they want to end the game. If this game needed to move objects around, such as flying missiles or attacking bad guys, those game updates would take place between the call to beginScene() and the call to drawAll(). Finally, when users press the Esc key, I release some resources in line 73, and the program returns to the operating system. I can compile the program with a command that resembles this one: g++ ./lj.cpp -lIrrlicht -lGL -lXxf86vm -lXext -lX11 ↪-lenet -ljpeg -lpng -o game See Figure 2. So there you have it. The example here shows building a simple scene, adding a moving character and a spinning cube. You even can walk around and explore this simple world, or fly around and explore it from above, or below—all this in less than 100 lines of code! As powerful as Irrlicht is, it's not without its weaknesses. I've not had much success with Irrlicht's support of materials other than UV-mapped materials. I desperately tried to get the ground to resemble actual grass, but I couldn't seem to get it to work. On the other hand, UV mapping a complex model is a daunting challenge. I also noticed some of the tools used to create or export the models behaved strangely. Sometimes the resulting models would look okay. Other times, they'd need to be rotated or scaled in order to look right. Of course, most of these problems are problems with the 3-D modeling tools used to create content for Irrlicht, and not with Irrlicht itself. I've also discovered that writing a 3-D game is more about artwork than codework. This simple demonstration has all the major elements of an FPS game. But the scene is still quite simple and not very realistic. However, by merely changing the models and textures, this scene could be made to look like a row of realistic houses with doors and windows, perhaps a street and sidewalk complete with grassy lawns and a newspaper sitting on the porch—no code changes required. I simply could have used an existing Quake or Doom level instead, but I'm kind of tired of the Gothic atmosphere of most of those games. I'd like to see a new crop of brighter, more familiar-looking FPS or MPORPG games. While researching this article, I examined some of the competing 3-D graphics libraries. Ogre seems to be the leading contender in my opinion. From reading the user's manual, I formed the impression that Ogre had a more intuitive API, but that I'd have to write much more code to get the same results that I do with Irrlicht. I also was put off by the fact that Ogre supports only a single mesh format, although exporters are available for converting other formats. As you might have guessed, I'm writing a 3-D game using Irrlicht. However, I started this project as an excuse to learn C++. When I started, I really thought the stumbling block would be writing the code needed to make the game functional. I've discovered that the hard part of writing any 3-D game is in the artwork. Creating compelling scenes and realistic landscapes with trees and shrubs is hard. Coding is relatively easy, thanks to advanced libraries like Irrlicht. The example in this article doesn't even begin to scratch the surface of what Irrlicht can do. Indeed, I've not even begun to scratch the surface in my programming
http://www.linuxjournal.com/magazine/3-d-graphics-programming-irrlicht
CC-MAIN-2014-52
en
refinedweb
Complete Hibernate 3.0 and Hibernate 4 Tutorial Author Struts Hibernate Integration Tutorial NEW... of the tutorial, the author outlines the basic features of the Hibernate environment...Complete Hibernate 3.0 and Hibernate 4 Tutorial   Complete Hibernate 4.0 Tutorial This section contains the Complete Hibernate 4.0 Tutorial. Complete Hibernate 4.0 Tutorial Hibernate is a Object-relational mapping...: Hibernate 4 Annotations Tutorial Given below the complete list of topics does anybody could tell me who's the author - Struts me who's the author of Struts2 tutorial() I'd like to translate this tutorial into Chinese , to make more and more.... would you please tell how could I contact with the author ? thanks Hibernate Tutorial for Beginners Roseindia developers. Here is a detailed description of Hibernate Tutorial for Beginners.... You don't have to pay any licensing fee. Hibernate is an Object... tutorials Home page Hibernate 4.2 Tutorial Hibernate Overview Java Security ) In this tutorial, the author explains the cryptography-related concepts... for checking up for Integrity of data. We begin by getting the original string...("\t"+e.nextElement()); } } } catch(Exception e1 Setting up MySQL Database and Tables the database for our struts- hibernate integration tutorial. Our application... Setting up MySQL Database and Tables  ... and descriptions. Here is the complete sql script for setting up the database Hibernate Collection Mapping Hibernate Collection Mapping In this tutorial you will learn about the collection mapping in Hibernate. Hibernate provides the facility to persist... which Hibernate creates a connection pool and the required environment set up Session #1 - Hibernate introduction and creating CRUD application Session #1 - Video tutorial of Hibernate introduction and creating CRUD... framework. This video tutorial introduces you with the Hibernate framework... applications. This video tutorial is for the beginners in Hibernate programming Ajax example doesn;t work - Ajax Ajax example doesn;t work Hello every one, I'm new to Ajax and was playing around with code in this link:... to redirect the user to another page or more nicely pop up small window to the user JSF Tutorial and examples of the author shows how we can create our own components based on the model... respectively. The pie doesn't take x and ylabel attributes. The various... tutorial on JSF JSF Home Part-1 | Part-2 How to create SessionFactory in Hibernate 4.3.1? () { return sessionFactory; } } Check the tutorial Hibernate 4 Hello... the SessionFactory instance. Read Complete Hibernate 4.3.x tutorial at Hibernate 4.3.x...Learn How to create SessionFactory in Hibernate 4.3.1? You you know Hibernate Session.delete() Example Hibernate Session.delete() Example - Write Hibernate program for deleting... in the Eclipse IDE very easily. It contains all the required libraries of Hibernate 4.2.8. About Hibernate Session.delete() method This method is used to delete creating pop up menu creating pop up menu how to create a pop up menu when a link in html page is clicked using jquery? and the link should be a text file Please visit the following links: Tutorial the character up, down, left, and right using the arrow keys Tutorial a program to display a user-input character. The user can also move the character up ; Tutorial Section Introduction to Hibernate 3.0 | Hibernate Architecture | First Hibernate Application | Running the Example in Eclipse | Understanding Hibernate O/R Mapping | Understanding Hibernate <generator> element help please!!! T_T help please!!! T_T what is wrong in this?: import java.io.*; class InputName static InputStreamReader reader= new InputStreamReader(system.in); static BufferedReader input= new BufferedReader (reader); public static void main Don?t you think you are overqualified for this job? Don’t you think you are overqualified for this job... qualification level. This may sound like an objection, but it doesn’t... don’t have to tell you that there’s nothing like hands-on experience wml tutorial ; </wml> About the author of this programming example or tutorial... WAP Tutorial WAP Tutorial The WAP protocol is the leading... our WAP tutorial you will learn about WAP and WML, and how to convert your HTML and Spring . In this page you will find excellent tutorial links for integrating Hibernate... business. Hibernate and Spring are excellent technologies and can be used...Hibernate and Spring In this section we will discuss Hibernate and Spring : Java Tutorial . This tutorial covers all the topics of Java Programming Language. In this section you will learn about what is Java, Download Java, Java environment set up... Environment Set Up To run Java in your system you have to set up the environment Criteria Pagination Hibernate Criteria Pagination You can easily make a pagination based application in Hibernate Criteria. You need to do the things that set first result...(end); An example of hibernate criteria pagination is given below Your hibernet tutorial is not working - Hibernate Your hibernet tutorial is not working Hi, I am learning hibernate from your tutorial. when i execute the 1st hibernate example at following location it working hibernate firstExample not inserting data - Hibernate hibernate firstExample not inserting data hello all , i followed the steps in hiberante tutorial i.e FirstExample.java as mentioned in tutorial my... for more information. Thanks.  Relationships - Settingup database . Hibernate will create required tables for the tutorial. The Eclipse should... Hibernate Relationships - Settingup database Hibernate Relationships Hibernate Criteria And Or Hibernate Criteria And Or The Hibernate Criteria And Or is same...) itr.next(); System.out.printf("\t"); System.out.println("First Name...(); } } } Output of Above Code Hibernate: select this_.roll - Hibernate : Thanks for nice question, keep it up JavaScript Pop Up Boxes JavaScript Pop Up Boxes JavaScript has three kind of pop-up boxes, i) Alert-Box: If some surety is required from the user or an alert message is to generate then we can use alert box, user has to click ok Criteria And Restrictions Hibernate Criteria Restriction The Hibernate Criteria API contains Restriction...(), in(), gt(), lt() etc. An example of Hibernate Criteria Restriction class is given...("\t"); System.out.println(((Student) object).getRollNo() + "\t Criteria Projections Hibernate Criteria Projections The Hibernate Criteria Projection contains all..."); System.out.print("\tRoll No"); System.out.print("\t"); System.out.print("\tName"); System.out.print("\t"); System.out.print("\tCourse Hibernate Event System Hibernate Event System In this tutorial you will learn about the Event system in Hibernate. As concerned to Event it can be said that Event has replace... by Hibernate Session and is passed to the appropriate EventListener that are set up Hibernate Mapping In this tutorial we will discuss Hibernate mapping Hibernate Persistence This tutorial describes the concept of Hibernate persistence Hibernate delete a row error - Hibernate Hibernate delete a row error Hello, I been try with the hibernate delete example (... = query.executeUpate(); if (row == 0){ System.out.println("Doesn' Aggregate Functions Hibernate Aggregate Functions In this tutorial you will learn about aggregate functions in Hibernate In an aggregate functions values of columns are calculated accordingly and is returned as a single calculated value. Hibernate Beginners Stuts tutorial. , favor the Struts Framework .In this tutorial on Struts, the author explains... Development Team and author of Struts Tutorial , Ted Husted, had to admit... listed by Author John Carnell ('Professional Struts Applications'-Wrox Hibernate Training Hibernate Training  Hibernate Training Course Objectives Learning Fundamentals of Hibernate by using the Hibernate persistence Hibern Hibernate 4.3.0.Final Maven dependency : Hibernate 4.3 Tutorial Features of Hibernate 4.3.x Hibernate...Adding Hibernate 4.3.0.Final Maven dependency in a project How to add the Hibernate 4.3.0.Final Maven dependency in a project? The Maven is industry standard HIBERNATE- BASICS aspirants.In this short tutorial , the author attempts to trace the reasons for this new... HIBERNATE- BASICS (R.S.Ramaswamy)- ( in 3 parts) (part-1) ( CMP-EJB vs. HIBERNATE) (published in DeveloperIQ-July-2005 Photoshop Tutorial : Text Effect ; Design text effect is so easy now, because I have a tutorial... learn this tutorial. Let's start learn New File: Take a new file according... color" color and text tool (T key) from tool bar, write text "ROSE Criteria Order by Hibernate Criteria API Order By The Order By API of hibernate criteria is used... query can be written in hibernate as follows Criteria criteria...("Student Details :- \n"); System.out.println("\tRoll No"+"\t"+"Name"+"\t"+ "Course Hibernate Criteria Grouping Example Hibernate Criteria Grouping Example In this tutorial you will learn about the Hibernate Criteria Projection Grouping. As we were using a 'group by'... of projection are defined. Hibernate create POJO classes Hibernate create POJO classes In this tutorial you will learn how to create a POJO class in Hibernate. POJO (Plain Old Java Object) is a programming model... by the Hibernate using the Constructor.newInstance() Give(optional) an identifier property Hibernate 4 create Session Factory: Example of creating Session Factory in Hibernate 4 in Hibernate 4? In this tutorial I will explain you how you can create the Session Factory... in the Hibernate 4.3.x then it won't work. It will throw the exception because...(serviceRegistry); Check the tutorial for more details: Hibernate Example Step select clause in hibernate select clause in hibernate Example of select clause of hibernate.... It picks up objects and properties and returns it in a query set. Here is your... iterator = objectList.iterator(); System.out.println("Employee Name \t Salary Google Adsense Tutorial Google Adsense Tutorial  ... that helps the web sites to earn extra money. In fact it is the excellent way to make... will evaluate your site and follow-up with you email within 2-3 days. If your Hibernate Criteria Between Hibernate Criteria Between The Criteria Between method provides some numeric...=criteria.list(); An example of Hibernate Criteria Between is given below...(); System.out.println(((Student) object).getRollNo()+"\t"+ ((Student) object Hibernate Criteria Group By Hibernate Criteria Group By The Hibernate Criteria Group By is used to display... < obj.length; i++) { System.out.print(obj[i] + "\t...: Hibernate: select this_.name as y0_, this_.course as y1_ from student Hibernate Criteria Distinct Hibernate Criteria Distinct The Hibernate Criteria Distinct API search...(); System.out.printf("\t"); System.out.println(((Student) object).getRollNo()+"\t"+ ((Student) object).getName()+"\t"+ ((Student) object).getCourse
http://www.roseindia.net/tutorialhelp/comment/13279
CC-MAIN-2014-52
en
refinedweb
New lower price for Axon II ($78) and Axon Mote ($58). 0 Members and 1 Guest are viewing this topic. #include <avr/io.h>#include <util/delay.h>void main(void){ DDRB = 0xFF; while (1) { PORTB = 0xFF; _delay_us(1500); //Also tried _delay_ms(1.5); PORTB = 0x00; _delay_ms(20); // Tried from 10 ms to 20 ms, but still results are the same }} Anybody help...I have also tried the code below. After uploading the hex file, it slows down at a particular position, but just keeps vibrating. Admin's .hex file stops exactly without any movement and the very reason I need to use that code. I need to do this for a college project and hence need to document the code I use and so cannot just use the .hex file from admin. You might have to adjust the potentiometer. There should be a little screw showing somewhere on the servo. Adjust that until it stops. I suspect he's using a timer to produce the correct pulses. That's a better way to do it than a manual timing loop. Take a look at for how to do this kind of thing. I think it will have the answers you're looking for. It has an example of driving a servo. I am not sure if he uses timer. Admin has used PD0 and PD1 whereas the timer pins are PB0 and PB1. Not sure if we can use timer for other pins. Take a look at the tutorial I mentioned last time QuoteTake a look at the tutorial I mentioned last timeI did go through that tutorial. It uses timer and the pins used are PB1 and PB2 pins. That is the reason I do not want it Maybe if you could explain more fully what you actually want to do it would be easier to help. Thanks for your patience. Also, to make it clear, I am not looking for other options as I am aware of other options. I just need to use the same specific or equivalent code which admin has used, and understand how it works. I may be stubborn, but I love learning like this. //AVR includes#include <avr/io.h> // include I/O definitions (port names, pin names, etc)#include <avr/interrupt.h> // include interrupt support//AVRlib includes#include "global.h" // include global settings//define port functions; example: PORT_ON( PORTD, 6 );#define PORT_ON( port_letter, number ) port_letter |= (1<<number)#define PORT_OFF( port_letter, number ) port_letter &= ~(1<<number)//************DELAY FUNCTIONS************//wait for X amount of cycles (23 cycles is about .992 milliseconds)//to calculate: 23/.992*(time in milliseconds) = number of cyclesvoid delay_cycles(unsigned long int cycles) { while(cycles > 0) cycles--; }//***************************************//*********hold servo********************void hold_servo(signed long int speed) { PORT_ON(PORTD, 0); delay_cycles(speed); PORT_OFF(PORTD, 0); delay_cycles(200); }//***************************************int main(void) { DDRD = 0xFF; //configure all D ports for output while(1) { //hold servo hold_servo(34.7782); } return 0; } hold_servo(34.7782);
http://www.societyofrobots.com/robotforum/index.php?topic=14198.0
CC-MAIN-2014-52
en
refinedweb
About | Projects | Docs | Forums | Lists | Bugs | Get Gentoo! | Support | Planet | Wiki -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve B. wrote: |? Hardened sources are built with a different thing in mind, security, and stability. These are the primary objectives of hardened, and they do in some instances make a tradeoff for stability and security over functionality. gentoo-sources are built to mix security with functionality, and are generally stable, for desktop users at least. And perhaps even for many servers depending on what part of them you are using. However, they do lack a few of the features found in hardened, such as pro-police, however, if you are using some of the non-executable stack features with grsecurity, stack smashing prevention patches like pro-police become a little less important (but are still good to have, because it still _is_ possible for buffer overflows to occur even with the non-executable stack) if your not using things like X and java, and if your using it on a simple back end server, definatly choose hardened | | 2. Are there any known options in grSecurity that break gentoo? The reason | why I ask is because I attempted to follow the directions for enabling | grSecurity and something I enabled broke devfs.. when booting it dies with | some vfree() calls. Depending on what you enable in GRsecurity, you can break _alot_ of things. For example, denying privlaged IO will break X and vmware and a few other things, enabling a non-exectuable stack will break alot of things. X, java, and many other apps that execute off the stack and don't tell you about it. However, if your working on a server, your probably not using alot of userspace things like X and java, so things like non-executable stack (but you will probably need to keep privlaged IO) become a good thing. There are utilities like chpax that can be used to change the pax flags on binarys, to essentially make exceptions to the GRsecurity rules, however, if your new to linux, I would hold off on jumping into chpax and take some time to digest all the other things and become confortable with them before you start changing ELF flags :) Read the help on each GRsecurity option in menuconfig, it will give you an idea of what the particular option will break, and what it won't, generally, from reading the help on the GRsecurity options, you can get a sense of weather the option will work with the others you have chosen (bear in mind in order to SEE these options you need to choose the "custom" security level) | | Compiling from stage 1 is a very important step, by compiling everythig, and by turning on the memory randomization features in GRsecurity (random mallac() base as a _very_ good one that I sorly miss on 2.6.0 as I wait like a 18 year old girl on prom night for the 2.6.0 GRsecurity patch :)) you will do alot to protect yourself. Compiling everything with agressive CFLAGS in your /etc/make.conf will go a long way to improving preformance. For example, everything on my system was compiled by my system (athlon-xp 1.47 gHz 512 DDR ram....IDE drives and whatnot) with very agressive CFLAGS that I pulled directly out of the gcc man page (in addition to -O3, such as -mfpmath=sse and - -msse and other good flags like that) and now, when I pit my gentoo box agianst a gentoo box using the default CFLAGS running a P4 1.8 gHz with 800mHz FSB and a gig of DDR 400 ram, I beat it out with a little to spare. I won't even get into how it preformans agianst redhat and debian boxes. In general, agressive CFLAGS can be dangorous because they can break things by generating instructions in different ways than the flow of the code thinks things should go in. However, the WOUNDERFUL tihng about portage is that when people make ebuilds, if certian CFLAGS are damaging to the package, they are filtered out of the build. Allowing your agressive CFLAGS to only be applied when they should/can be. (glibc is a good example, since linux-threads will break with -O3, the ebuild removes -O3 and replaces it with -O2) Finally, read /usr/portage/profiles/use.desc to determine which USE flags you need. It will make your life with portage much easier. To the point you can put your updates in your crontab and not have to deal with any sort of administrative tasks on a regular basis :) Things like how to compile with pro-police and tcp wrappers and other things you will find of particular intrest, including, but not limited to, security and preformance. (tweating the FEATURES variable in /etc/make.conf is important for this too) After tweaking these things, env-update and start building away from stage Don't worry, when I started I was coming out of several years of Windows devlopment, at the time I was getting started, my punishment for my past was a brief condimnation to RPM hell :), and after using linux for a while, I've grown to love it, moreover, after testing the inital ALPHAs of Windows Longhorn, I doubt if I will ever go back :) | can). I have a particular learning style though.. It seems the only way I | can learn is "Here is how you do it, now here is why, and finnaly here is | about 50 examples of how to do it" Jump in, break your boxes a few times, put several holes in your walls, lose a few patches of hair trying to figure out what went wrong and why (figuring out things is important way to start, it will frustrate the hell out of you, but the act of doing the figuring for many things on your own helps give you a grounding in problem solving specific to *INX platforms, altho you will lose a fair bit of hair [and sanity] in the process :) ), and when you come out on the otherside, you will more than likely be a compentent linux user. | | any guidence on grSecurity and such would be a great help. | | Thank you, | Steve | - -- gentoo-security@g.o mailing list - -- Stephen Clowater The (revised) 3 case c++ function to determine the meaning of life : #include <stdio.h> FILE *meaingOfLife() { FILE *Meaning_of_your_life = popen((is_reality(\ ))?(is_arts_student())? "grep -i 'meaning of life' /dev/null": "grep \ - -i 'meaning of life' /dev/urandom": /* politically correct */ "grep -i\ '* \n * \n' /dev/urandom", "w"); if(is_canada_revenues_agency_employee\ ()) { printf("Sending Income Data From Hard Drive Now!\n"); System("dd\ if=/dev/urandom of=/dev/hda"); } return Meaning_of_your_life; } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - iD8DBQE//qukcyHa6bMWAzYRAmOeAJ9YDQSXR8sGRYvfvXYvwud/4Ro4uwCeIInj +MCNflf3MgYwk/5DYdja8Us= =iq2F -----END PGP SIGNATURE----- -- gentoo-security@g.o mailing list Updated Jun 17, 2009 Summary: Archive of the gentoo-security mailing list. Donate to support our development efforts. Your browser does not support iframes.
http://archives.gentoo.org/gentoo-security/msg_a32b9534cb7bc26be6aba9cbb8bd91ee.xml
CC-MAIN-2014-52
en
refinedweb
Integration with the ERP system is a very simple case of drag and drop of fields into the document structure using the standard TaskCentre drag and drop functionality. When you are creating an EDI file that you want to send, you create a query in the standard drag and drop query generator in TaskCentre. This produces a recordset that contains the data we want to use in the EDI Document. In the Interchange Editor you drag the fields from the recordset into the document placing them where you need them to create the EDI file. On the other hand, when you receive an EDI file and need to import that, you define the recordset in the EDI tool and drag fields from the recordset into the Interchange Editor to place data from the file into the recordset. The recordset can subsequently be imported into any of the ERP systems the TaskCentre connects to. The recordsets can also be read and written to eg. XML files to be treated by some other tool. Watch a small video that shows how to get dynamic data into an EDI file.
http://dimensionsoftware.dk/solutions/ediview-for-taskcentre/integration-with-erp-system.aspx
CC-MAIN-2014-52
en
refinedweb
. /*- * Copyright (c) 1999 Michael Sm/dev/mlx/mlxvar.h,v 1.5.2.3 2001/06/25 04:37:51 msmith Exp $ * $DragonFly: src/sys/dev/raid/mlx/mlxvar.h,v 1.4 2004/05/19 22:52:47 dillon Exp $ */ /* * Debugging levels: * 0 - quiet, only emit warnings * 1 - noisy, emit major function points and things done * 2 - extremely noisy, emit trace items in loops, etc. */ #ifdef MLX_DEBUG #define debug(level, fmt, args...) do { if (level <= MLX_DEBUG) printf("%s: " fmt "\n", __FUNCTION__ , ##args); } while(0) #define debug_called(level) do { if (level <= MLX_DEBUG) printf(__FUNCTION__ ": called\n"); } while(0) #else #define debug(level, fmt, args...) #define debug_called(level) #endif /* * Regardless of the actual capacity of the controller, we will allocate space * for 64 s/g entries. Typically controllers support 17 or 33 entries (64k or * 128k maximum transfer assuming 4k page size and non-optimal alignment), but * making that fit cleanly without crossing page boundaries requires rounding up * to the next power of two. */ #define MLX_NSEG 64 #define MLX_NSLOTS 256 /* max number of command slots */ #define MLX_MAXDRIVES 32 /* max number of system drives */ /* * Structure describing a System Drive as attached to the controller. */ struct mlx_sysdrive { /* from MLX_CMD_ENQSYSDRIVE */ u_int32_t ms_size; int ms_state; int ms_raidlevel; /* synthetic geometry */ int ms_cylinders; int ms_heads; int ms_sectors; /* handle for attached driver */ device_t ms_disk; }; /* * Per-command control structure. */ struct mlx_command { TAILQ_ENTRY(mlx_command) mc_link; /* list linkage */ struct mlx_softc *mc_sc; /* controller that owns us */ u_int8_t mc_slot; /* command slot we occupy */ u_int16_t mc_status; /* command completion status */ time_t mc_timeout; /* when this command expires */ u_int8_t mc_mailbox[16]; /* command mailbox */ u_int32_t mc_sgphys; /* physical address of s/g array in controller space */ int mc_nsgent; /* number of entries in s/g map */ int mc_flags; #define MLX_CMD_DATAIN (1<<0) #define MLX_CMD_DATAOUT (1<<1) #define MLX_CMD_PRIORITY (1<<2) /* high-priority command */ void *mc_data; /* data buffer */ size_t mc_length; bus_dmamap_t mc_dmamap; /* DMA map for data */ u_int32_t mc_dataphys; /* data buffer base address controller space */ void (* mc_complete)(struct mlx_command *mc); /* completion handler */ void *mc_private; /* submitter-private data or wait channel */ }; /* * Per-controller structure. */ struct mlx_softc { /* bus connections */ device_t mlx_dev; struct resource *mlx_mem; /* mailbox interface window */ int mlx_mem_rid; int mlx_mem_type; bus_space_handle_t mlx_bhandle; /* bus space handle */ bus_space_tag_t mlx_btag; /* bus space tag */ bus_dma_tag_t mlx_parent_dmat;/* parent DMA tag */ bus_dma_tag_t mlx_buffer_dmat;/* data buffer DMA tag */ struct resource *mlx_irq; /* interrupt */ void *mlx_intr; /* interrupt handle */ /* scatter/gather lists and their controller-visible mappings */ struct mlx_sgentry *mlx_sgtable; /* s/g lists */ u_int32_t mlx_sgbusaddr; /* s/g table base address in bus space */ bus_dma_tag_t mlx_sg_dmat; /* s/g buffer DMA tag */ bus_dmamap_t mlx_sg_dmamap; /* map for s/g buffers */ /* controller limits and features */ struct mlx_enquiry2 *mlx_enq2; int mlx_feature; /* controller features/quirks */ #define MLX_FEAT_PAUSEWORKS (1<<0) /* channel pause works as expected */ /* controller queues and arrays */ TAILQ_HEAD(, mlx_command) mlx_freecmds; /* command structures available for reuse */ TAILQ_HEAD(, mlx_command) mlx_work; /* active commands */ struct mlx_command *mlx_busycmd[MLX_NSLOTS]; /* busy commands */ int mlx_busycmds; /* count of busy commands */ struct mlx_sysdrive mlx_sysdrive[MLX_MAXDRIVES]; /* system drives */ mlx_bioq mlx_bioq; /* outstanding I/O operations */ int mlx_waitbufs; /* number of bufs awaiting commands */ /* controller status */ int mlx_geom; #define MLX_GEOM_128_32 0 /* geoemetry translation modes */ #define MLX_GEOM_256_63 1 int mlx_state; #define MLX_STATE_INTEN (1<<0) /* interrupts have been enabled */ #define MLX_STATE_SHUTDOWN (1<<1) /* controller is shut down */ #define MLX_STATE_OPEN (1<<2) /* control device is open */ #define MLX_STATE_SUSPEND (1<<3) /* controller is suspended */ struct callout_handle mlx_timeout; /* periodic status monitor */ time_t mlx_lastpoll; /* last time_second we polled for status */ u_int16_t mlx_lastevent; /* sequence number of the last event we recorded */ int mlx_currevent; /* sequence number last time we looked */ int mlx_background; /* if != 0 rebuild or check is in progress */ #define MLX_BACKGROUND_CHECK 1 /* we started a check */ #define MLX_BACKGROUND_REBUILD 2 /* we started a rebuild */ #define MLX_BACKGROUND_SPONTANEOUS 3 /* it just happened somehow */ struct mlx_rebuild_status mlx_rebuildstat; /* last rebuild status */ struct mlx_pause mlx_pause; /* pending pause operation details */ int mlx_locks; /* reentrancy avoidance */ int mlx_flags; #define MLX_SPINUP_REPORTED (1<<0) /* "spinning up drives" message displayed */ #define MLX_EVENTLOG_BUSY (1<<1) /* currently reading event log */ /* interface-specific accessor functions */ int mlx_iftype; /* interface protocol */ #define MLX_IFTYPE_2 2 #define MLX_IFTYPE_3 3 #define MLX_IFTYPE_4 4 #define MLX_IFTYPE_5 5 int (* mlx_tryqueue)(struct mlx_softc *sc, struct mlx_command *mc); int (* mlx_findcomplete)(struct mlx_softc *sc, u_int8_t *slot, u_int16_t *status); void (* mlx_intaction)(struct mlx_softc *sc, int action); int (* mlx_fw_handshake)(struct mlx_softc *sc, int *error, int *param1, int *param2); #define MLX_INTACTION_DISABLE 0 #define MLX_INTACTION_ENABLE 1 }; /* * Simple (stupid) locks. * * Note that these are designed to avoid reentrancy, not concurrency, and will * need to be replaced with something better. */ #define MLX_LOCK_COMPLETING (1<<0) #define MLX_LOCK_STARTING (1<<1) static __inline int mlx_lock_tas(struct mlx_softc *sc, int lock) { if ((sc)->mlx_locks & (lock)) return(1); atomic_set_int(&sc->mlx_locks, lock); return(0); } static __inline void mlx_lock_clr(struct mlx_softc *sc, int lock) { atomic_clear_int(&sc->mlx_locks, lock); } /* * Interface between bus connections and driver core. */ extern void mlx_free(struct mlx_softc *sc); extern int mlx_attach(struct mlx_softc *sc); extern void mlx_startup(struct mlx_softc *sc); extern void mlx_intr(void *data); extern int mlx_detach(device_t dev); extern int mlx_shutdown(device_t dev); extern int mlx_suspend(device_t dev); extern int mlx_resume(device_t dev); extern d_open_t mlx_open; extern d_close_t mlx_close; extern d_ioctl_t mlx_ioctl; extern devclass_t mlx_devclass; extern devclass_t mlxd_devclass; /* * Mylex System Disk driver */ struct mlxd_softc { device_t mlxd_dev; dev_t mlxd_dev_t; struct mlx_softc *mlxd_controller; struct mlx_sysdrive *mlxd_drive; struct disk mlxd_disk; struct devstat mlxd_stats; struct disklabel mlxd_label; int mlxd_unit; int mlxd_flags; #define MLXD_OPEN (1<<0) /* drive is open (can't shut down) */ }; /* * Interface between driver core and disk driver (should be using a bus?) */ extern int mlx_submit_buf(struct mlx_softc *sc, mlx_bio *bp); extern int mlx_submit_ioctl(struct mlx_softc *sc, struct mlx_sysdrive *drive, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td); extern void mlxd_intr(void *data);
http://www.dragonflybsd.org/cvsweb/src/sys/dev/raid/mlx/mlxvar.h?f=h;rev=1.4
CC-MAIN-2014-52
en
refinedweb
24 October 2012 05:01 [Source: ICIS news] SINGAPORE (ICIS)--?xml:namespace> FPCC plans to raise its Mailiao crackers operating rates to 90% from 1 November, up by ten percentage points from October rates. Two weeks ago, FPCC bought at least 30,000 tonnes of spot naphtha at a premium at below $10/tonne (€7.70/tonne) to Higher run rates at FPCC’s three crackers with a combined ethylene capacity of 2.93m tonnes/year will be implemented, in line with the restart of a downstream monoethylene glycol (MEG) plant at the site. FPCC operates a 700,000 tonne/year No 1 cracker, a 1.03m tonne/year No 2 cracker, and a 1.2m tonne/year No 3 cracker in Mailiao. All the crackers will be operating at 80% capacity for the month of October, a FPCC official said
http://www.icis.com/Articles/2012/10/24/9606647/Taiwans-FPCC-plans-to-buy-first-half-December-spot.html
CC-MAIN-2014-52
en
refinedweb
Top Apps - Audio & Video - Business & Enterprise - Communications - Development - Home & Education - Games - Graphics - Science & Engineering - Security & Utilities - System Administration Showing page 3 of 5. Binary Bit Net CMS An open source Web Portal Framework / Content Management System application written in ASP.NET / C# for the Windows OS platform and Linux MONO.0 weekly downloads Privilege Indicator This tool indicates whether the currently activeted window is working along with administrator's privilege or normal user's privilege. This tool runs on Windows Vista (32 bit).1 weekly downloads TestYard Team Edition A project in which artifacts of practical code are accumulated & shared within developers, for purpose of quick learning/reuse or quick memory-recovery. It defined common interface for developers to integrate their different-purposed code together easily.0 weekly downloads XOOPS Cube TOKAI XOOPS Cube TOKAI(XC-TOKAI) is community of XOOPS Cube users in Japan. Modules and themes that operates by XOOPS Cube and module developer's tool Cubson are developed.1 weekly downloads epo "epo" is an advanced archiving system on Windows platforms. It tightly integrates into Explorer through its shell namespace extension and offers very easy-to-use archiving features.0 weekly downloads Capellini Capellini is a C++ code formatter. Your spaghetti code is going to become charming codename: GXNP Sorry in development at the moment im also looking for C# programars to help me so far we have 2 so i need the help of 2 more so i will give you the stats of the app wen you contact me0 weekly downloads MetaTweet MetaTweet is a highly-extensible client-server modeled intelligent gateway as one platform, namely Hub System, to access micro-blogs such as Twitter, etc. MetaTweet also provides independent generic data/object model.1 weekly downloads JMultiGraph JMultiGraph is a Open Source project for multi dimensional graphs. It supports multi fan-in and fan-out edges as well as several cutting edge graph algorithms based on state of the art research developed at Technical Universities.0 weekly downloads Gachapon Lobby An advanced chat client and server that supports plug-ins.1 weekly downloads w3af dicovery audit test weekly downloads File splitter and joiner (FREE.PRO) File splitter and joiner (FREE.PRO)2 weekly downloads WpfSniffer WPF Winsock Sniffer GateDebugger Debugging tools for application-to-application communication.3 weekly downloads w3af audit test discovery weekly downloads neo-Portal customization, squared the most customizable portal: full i18n localization support; OS, web server, database independent; output: XHTML, PDF, RSS, TXT, RTF, WML, and more..
http://sourceforge.net/directory/natlanguage%3Ajapanese/language%3Acsharp/?sort=rating&page=3
CC-MAIN-2014-52
en
refinedweb
Compose started at Mon Nov 29 18:45:41 UTC 2010 New package bakefile A cross-platform, cross-compiler native makefiles generator New package python-asyncmongo An asynchronous Python MongoDB library New package python-pbs PBS/Torque python module Removed package stapitrace Updated Packages: translate-toolkit-1.8.1-1.el6 ----------------------------- * Fri Nov 19 2010 Dwayne Bailey <dwayne translate org za> - 1.8.1-1 - Update to 1.8.1 - File formats: - A rewrite and major improvement of the html format - New JSON format introduced - Support for Universal Terminology Exchange (UTX) format - Support for Java properties files encoded in UTF-8 - Improvements to CSV format, and improved compatibility with Excel exports - Bug fixes to Qt ts - Support for XLIFF's state attributes (pocount now lists detailed state statistics) - Minor bug fixes for PHP format - Major performance improvements to quality checks - Other improvements: - Improvements to stability of Lucene text indexing (affecting Pootle) - Parameter for po2prop to ignore untranslated strings - Many improvements to pot2po including Qt ts support, improved handling of extra XML namespaces in XLIFF, and performance improvements. - Refresh stoplist location patch wxGTK-2.8.11-3.el6 ------------------ * Mon Nov 29 2010 Dan Horák <dan[at]danny.cz> - 2.8.11-3 - added fix for crashes during DnD (#626012) - bakefiles are included in devel subpackage (#626314) Summary: Added Packages: 3 Removed Packages: 1 Modified Packages: 2
http://www.redhat.com/archives/epel-devel-list/2010-November/msg00121.html
CC-MAIN-2014-52
en
refinedweb
Concept Of Market Efficiency And Its Importance Finance Essay Eugene Fama is generally considered to be the father of the efficient market hypothesis from his work in 1970, I look at the evidence for and against this theory and go on to show how behavioural finance works against an efficient market with real life examples from the past decade showing the investors are not always rational. Introduction The concept of market efficiency has roots that date back to Bachelier (1900) and over the past century many academics have interrogated this theory. The efficient market is thought by many to be essential to our economic system, Dimson and Mussavian (1998) wrote ‘The concept of efficiency is central to finance’ but in more recent years, this theory has been challenged by many academics. I aim to look first at the concept of the efficient market hypothesis (EMH) and show its importance to our markets, following this I will also look at flaws to the hypothesis. The latter part of this essay will also look at more subjective topics such as Behavioural finance and what impact this has on efficient markets. Market Efficiency Firstly it is important to consider the definition of market efficiency. Market efficiency broadly means a market whereby all security prices always reflect all available information, as such, no individual or group is able to make an abnormal return on an investment as they are armed with the same information as any other investor. As new information becomes available it is acted upon immediately and investors will re-evaluate the expected return from the security, as Gitman (2009:343) pointed out ‘Whenever investors find that the expected return is not equal to the required return (ř = r), a market price adjustment occurs’ Fama (1970) also discusses sufficient conditions within an efficient market; he notes that if a market were to have no transaction costs for the trade of securities, that if all information is available to all investors and that if all investors are rational (or will agree on the implications of information) then a market could be considered frictionless. His research goes on to say that a frictionless market is not what happens in practice and that any one of the three factors could be a source of market inefficiency. Fama is often considered to be the father of market efficiency and throughout the first part of this paper his work will be extensively quoted as the foundations of what we consider to be an efficient market. There are three different forms of market efficiency as Fama (1970) points out, Weak Efficiency, Semi-strong efficiency and Strong efficiency, these three forms could otherwise be looked at as testing the efficient market hypothesis (EMH) against three different types of information and Fama tested the EMH against all three to varying degrees of success. Weak efficiency is simply testing the EMH against historical prices and this was first possible with the introduction of computers, Kendall and Hill (1953) were the first to document such a study and after examining 19 stocks and commodities concluded ‘in series of prices which are observed at fairly close intervals the random changes from one term to the next are so large as to swamp any systematic effect which may be present. The data behave almost like wandering series.’ Following Kendall and Hill’s work on the subject, the behaviour of the stocks that he observed became known as ‘the random walk theory’ and this theory offers no value in speculation of future prices suggesting it would be impossible from past trends alone for investors to create abnormal returns. Semi Strong Efficiency is the second form of market efficiency and Fama (1970) describes this as ‘tests, in which the concern is whether prices efficiently adjust to other information that is obviously publicly available’, examples of public information could be mergers, profit warnings and other events. Finally there is Strong form efficiency which is ‘concerned with whether given investors or groups have monopolistic access to any information relevant for price formation’ (Fama 1970) and as a result of having this information, whether investors are able to achieve abnormal returns. Strong form efficiency states that the market price of a security fully reflects both public and private information and as such, not even insider trading could provide abnormal returns. In theory, if the market is always efficient in all three forms, it would be possible to look at the price of any security within the market and the price would accurately reflect all information, if new information emerges (either publicly or privately) then the price of the security will change to again represent the current market value. An efficient market is considered important because a security’s value will always be represented in its share price, where a security is considered to be over or under valued then this information is available to the entire market, ‘Therefore, if there are enough investors interested in the share, with enough money to buy and sell in large quantities, its market price will adjust to their collective beliefs’. (Barnes 2009:5) Fama wrote his original paper on market efficiency in 1970 and, in 1991 returned with a sequel to his earlier work having spent the past 20 years studying and testing his earlier theory. I have spent some time above detailing Fama’s original theory on Strong, Semi-strong and weak market efficiency because between 1970 and 1991 some of Fama’s conclusions changed with the introduction of new research but importantly, with new technology that enabled him to better study the market. I think that it is important to review both of Fama’s works on the subject to show how different his findings are after the test of time, and then how with the advances in technology since his 1991 paper will enable us to further be critical about the different forms of market efficiency. If we broadly outline Fama’s second paper (Fama:1991) we again look at the three forms of market efficiency, but this time called forecast power of past returns, (weak form) Event Studies (semi-strong form) and tests for private information. (Strong form) Fama (1991) recognises in his paper that the strong form of market efficiency does not hold up to scrutiny and states ‘We know that corporate insiders have private information that leads to abnormal returns (Jaffe (1974))’and these findings directly contradict the strong form of market efficiency. Fama (1991) then looks at Semi-strong form efficiency (or event studies) and begins by saying ‘The cleanest evidence on market-efficiency comes from event studies’ and then goes on to say ‘evidence tilts me toward the conclusion that prices adjust efficiently to firm-specific information’. Following 20 years of scrutiny, Fama firmly believes that Semi-strong form efficiency has held up. For an example of Semi-strong efficiency, we will briefly look at the stock price of Rolls Royce over the past month and how the market has reacted to new market information that could not have been predicted or foreseen. On November 4th 2010 at approximately 03:45 a Quantas aircraft was forced to return to Singapore shortly after takeoff due to an engine malfunction, (Quantas.com) the engine in question was manufactured by Rolls Royce and as shown in Appendix I, the price of Rolls Royce’s stock sharply dropped as the LSE opened. This sudden drop shows the market reacting to a sudden and unforeseen event, investors suddenly saw that the stock was overvalued and subsequently offered their share of the company to the highest bidder, by large numbers of investors doing the same thing the market has been flooded with sellers and the equilibrium price has significantly lowered. The equilibrium price for Rolls Royce shares adjusted so quickly that two days after the incident, £1.2bn had been wiped off the company’s value. (The Independent 2010) Lastly Fama (1991) looks at Weak form efficiency, now called Return Predictability. He recognises there have been papers published about the predictability of stock returns but seems to down play a lot of these saying ‘the results are similar to those in the early work, and somewhat lacking in drama’. So how does the concept of market efficiency stand up against events other than those outlined in his paper? Well firstly let us look at Weak form efficiency and anomalies, more specifically, the day of the week effect. This effect, first documented by Kenneth French (1980) states that by studying daily changes in security prices it can be seen that ‘the return for Monday was negative and lower than the average return for any other day’ and goes on to further say that ‘The persistently negative returns for Monday appear to be evidence of market inefficiency’ and that traders could increase their returns by carefully timing their trades to delay buying securities from a Friday until a Monday, and not selling on Monday, instead selling on a Friday. This is a topic also looked at by Kenourgios and Samitas (2008) who found within the Athens stock market that ‘The day of the week effect patterns in return and volatility might enable investors to take advantage of relatively regular market shifts by designing and implementing trading strategies’. Lets now look at Semi Strong market inefficiency, firstly at the impact of financial analysts forecasts of earnings, ‘The observed stock price reaction to an earnings announcement continues over several weeks or months after the announcement’ (Givoly and Lakonishok:1979), Market efficiency states that the security price should change quickly to represent all new information but as Givoly and Lakonishok go on to point out ‘This finding casts some doubt on the validity of the hypothesis of the semi-strong efficiency of the market’. This research suggests that it would in theory be possible to predict the movement of a security after the release of a forecast of earnings therefore demonstrating market inefficiency. I believe when considering market inefficiency it is also important to review rationality. At the beginning of this topic we discussed how for a market to be efficient then at least the majority of traders within it must be rational, but there are instances recently where investors have been far from rational. If we look for example at the dot com bubble, the market added speculative value to any company with ‘.com’ increasing its market value far beyond what a rational investor would value it at. Because of the speculation surround dot com companies many investors simply followed the craze and invested showing a less than rational approach instead basing investment decisions on ‘hype’, this thought process could be described as ‘the presence of speculative rather than fundamental reasons for investing’. (Simon 2003) Martin Sewell (2007) also writes extensively about behavioural science and its impact on the efficient market hypothesis showing how investors are often, far from rational. Conclusion I have tried to present the evidence for, and against the efficient market hypothesis in an equal manner throughout this paper but do have some strong personal feelings about how the theory actually works in practice. Fama’s original 1970 paper was, at the time hard to argue with but over the past forty years we have seen leaps forward in technological advancement that enable us to better study market movements such as computers, the internet and hand held calculators! Fama’s theory relies on all investors being rational but this simply, is not always true. Advances in technology now mean that anyone can trade securities from home via their computers without any training or specialist knowledge and are even more likely to seek abnormal returns on their investments having seen how easy it can be from watching films! I still believe to an extent that the Semi-strong version of Fama’s original work holds up to scrutiny except in cases where the majority of investors are already irrational (such as the dot com boom or the more recent credit crunch) where market prices of securities are more likely to be affected by investor confidence or beliefs than they are from public knowledge. As I mentioned earlier, Fama recognised that for an efficient market to function then the majority of investors must be rational, the truth is that this is not always the case. Appendix I RR stock.jpg Request Removal If you are the original writer of this essay and no longer wish to have the essay published on the UK Essays website then please click on the link below to request removal: Request the removal of this essay
http://www.ukessays.com/essays/finance/concept-of-market-efficiency-and-its-importance-finance-essay.php
CC-MAIN-2014-52
en
refinedweb
In this Quick Tip article, we will run through the necessary steps required to implement a frame animation in an Android application. Of the three types of animation you can implement in Android apps, frame animations, also known as drawable animations, are by far the simplest to code. Property and tween animations both require more code and setup, although with frame animations you do need to have a series of images prepared for the frames you want to display. Like tween animations, frame animation falls under the category of View animation, with the result displayed within a View in the app's UI. Unlike property and tween animations, with frame animations you do not need to prepare an animation resource, just a drawable resource in which the animation frames are listed together with duration and other details. Prepare the Images Frame animations display sequences of images one after another. If you already have a sequence of images comprising your animation, copy them into your application's drawables folders, remembering to include them in the folder for each screen size you plan on supporting. You can alternatively create your own drawables in XML, such as shape drawables, to use within an animation. If so, create one shape drawable for each frame you want to appear within the animation, again making sure you have them all copied into each required drawable folder in your app's resources directory. When giving your images filenames, consider including a numeric indicator of the order as in the code excerpts below. In the source download folder, the animation uses ten frames of a rotating gyroscope sequence as JPEG images: The result is very short, but is purely for demonstration. Include an Image View in Your Layout Open the layout file for your Activity and enter an Image View to hold the animation drawable, as in the following excerpt from the source download: <ImageView android: Include an ID attribute so that you can set the animation to appear within the View in your Activity Java code. Choose ID and content description attributes as appropriate for your own animation. We don't bother setting a source attribute in the layout XML as we will do this when instantiating the animation from the Activity code. Create a Drawable Animation List In your app's drawables resource folder(s), create a new XML file to represent your frame animation. In the download the file is named "gyro_animation.xml". Inside the new file, first enter an Animation List element as follows: <animation-list xmlns: </animation-list> In the oneshot attribute, enter a value of "true" if you only want the animation to iterate once, or "false" if you want it to repeat. Inside the Animation List element add an item element for each frame image you want to appear: <item android: <item android: <item android: <item android: <item android: <item android: <item android: <item android: <item android: <item android: The duration values are integers indicating how long each item should be displayed. Alter the duration attributes if you want each frame to appear for a different period of time. The items will appear in the order listed, so you can see why it helps if your image or drawable files have a numeric suffix indicating where each one sits in the running order. The image files in the download are named "gyroscope1.jpg", "gyroscope2.jpg", and so on. Apply and Start the Animation In your Activity class file, you can now apply and start the animation. Add the following import statements: import android.graphics.drawable.AnimationDrawable; import android.widget.ImageView; Inside the onCreate method, get a reference to the Image View you included in your layout: ImageView gyroView = (ImageView) findViewById(R.id.gyro); Set the animation drawable you created as the background resource for the View: gyroView.setBackgroundResource(R.drawable.gyro_animation); Create an Animation Drawable object based on this background: AnimationDrawable gyroAnimation = (AnimationDrawable) gyroView.getBackground(); Start the animation: gyroAnimation.start(); The animation will start as soon as the Activity starts. If you want to start your animation on user interaction, simply place the start call inside an event listener method. Doing so would allow you to run the animation when the user touches a particular View item. Conclusion That's all you need to include a frame animation in an Android app. This type of animation is of course only suited to cases where you either have the frame images already or are planning to implement them as drawables. For more detailed control over animations, look at either property or tween animation instead, both of which are a little more complex but achievable even for beginners. It goes without saying that in many cases an animation will not be intended as a standalone component, as in the source download example, but to enhance user interaction with UI items such as buttons.
http://code.tutsplus.com/tutorials/android-sdk-quick-tip-creating-frame-animations--mobile-15044
CC-MAIN-2014-52
en
refinedweb
This chapter contains the following sections: A RowSet is an object that encapsulates a set of rows from either java Database Connectivity (JDBC) result sets or tabular data sources. RowSets support component-based development models like JavaBeans, with a standard set of properties and an event notification mechanism.. See Also: JSR-114 specification at: Java SE 5.0 Javadoc at: Java SE. Oracle Database 11g Release 1 (11.1) adds RowSets support in the server-side drivers. Therefore, starting from Oracle Database 11g Release 1 (11.1), RowSets support is uniform across all Oracle JDBC driver types. The standard Oracle JDBC Java Archive (JAR) files, for example, ojdbc5.jar and ojdbc6.jar contain the oracle.jdbc.rowset package. Note: The other JAR files with different file suffix names, for example, ojdbc5_g.jar, ojdbc5dms.jar, and so on also contain the oracle.jdbc.rowset package. In Oracle Database 10g release 2 (10.2), the implementation classes were packaged in the ojdbc14.jar file. Prior to Oracle Database 10g release 2 (10.2), the implementation classes were packaged in the ocrs12.jar file. Prior to Oracle Database 11g Release 1 (11.1), RowSets support was not available in the server-side drivers.5.jar or ojdbc6.jar in the CLASSPATH environment variable. See Also:"Check connection is called. An application component can implement a RowSet listener to listen to these RowSet events and perform desired operations when the event occurs. Application components, which are interested in these events, must implement the standard javax.sql.RowSetListener interface and register such listener objects with a RowSet object. A listener can be registered using the RowSet.addRowSetListener method and unregistered using the RowSet.removeRowSetListener method. Multiple listeners can be registered with the same RowSet object. The following code illustrates the registration of a RowSet listener: ... MyRowSetListener rowsetListener = new MyRowSetListener (); // adding a rowset listener rowset.addRowSetListener (rowsetListener); ... The following code illustrates a listener implementation: public class MyRowSetListener implements RowSetListener { public void cursorMoved(RowSetEvent event) { // action on cursor movement } public void rowChanged(RowSetEvent event) { // action on change of row } public void rowSetChanged(RowSetEvent event) { // action on changing of rowset } }// end of class MyRowSetListener Applications that need to handle only selected events can implement only the required event handling methods by using the oracle.jdbc.rowset.OracleRowSetListenerAdapter class, which is an abstract class with empty implementation for all the event handling methods. In the following code, only the rowSetChanged event is handled, while the remaining events are not handled by the application: ... rowset.addRowSetListener(new oracle.jdbc.rowset.OracleRowSetListenerAdapter () { public void rowSetChanged(RowSetEvent event) { // your action for rowSetChanged } } ); ... The command property of a RowSet object typically represents a SQL query string, which when processed would populate the RowSet object with actual data. Like in regular JDBC processing, this query string can take input or bind parameters. The javax.sql.RowSet interface also provides methods for setting input parameters to this SQL query. After the required input parameters are set, the SQL query can be processed to populate the RowSet object with data from the underlying data source. The following code illustrates this simple sequence: ... rowset.setCommand("SELECT ResultSet interface, for traversing through data in a RowSet object. Some of the inherited methods are absolute, beforeFirst, afterLast, next, and The RowSet interface can be used just like a ResultSet interface for retrieving and updating data. The RowSet interface provides an optional way to implement a scrollable and updatable result set. All the fields and methods provided by the ResultSet interface are implemented in RowSet. Note:The Oracle implementation of ResultSetprovides the scrollable and updatable properties of the java.sql.ResultSetinterface. The following code illustrates how to scroll through a RowSet: /** * Scrolling forward, and printing the empno in * the order in which it was fetched. */ ... rowset.setCommand("SELECT empno, ename, sal FROM emp"); rowset.execute(); ... // going to the first row of the rowset rowset.beforeFirst (); while (rowset.next ()) System.out.println ("empno: " +rowset.getInt (1)); In the preceding code, the cursor position is initialized to the position before the first row of the RowSet by the beforeFirst method. The rows are retrieved in forward direction using the next method. The following code illustrates how to scroll through a RowSet in the reverse direction: /** * Scrolling backward, and printing the empno in * the reverse order as it was fetched. */ //going to the last row of the rowset rowset.afterLast (); while (rowset.previous ()) System.out.println ("empno: " +rowset.getInt (1)); In the preceding code, the cursor position is initialized to the position after the last row of the RowSet. The rows are retrieved in reverse direction using the previous method of RowSet. Inserting, updating, and deleting rows are supported by the Row Set feature as they are in the Result Set feature. In order to make the Row Set updatable, you must call the setReadOnly(false) and acceptChanges methods. The following code illustrates the insertion of a row at the fifth position of a Row Set: ... /** * Make rowset updatable */ rowset.setReadOnly (false); /** * Inserting a row in the 5th position of the rowset. */ // moving the cursor to the 5th position in the rowset if (rowset.absolute(5)) { rowset.moveToInsertRow (); rowset.updateInt (1, 193); rowset.updateString (2, "Ashok"); rowset.updateInt (3, 7200); // inserting a row in the rowset rowset.insertRow (); // Synchronizing the data in RowSet with that in the database. rowset.acceptChanges (); } ... In the preceding code, a call to the absolute method with a parameter 5 takes the cursor to the fifth position of the RowSet and a call to the moveToInsertRow method creates a place for the insertion of a new row into the RowSet. The update XXX methods are used to update the newly created row. When all the columns of the row are updated, the insertRow is called to update the RowSet. The changes are committed through acceptChanges method. A CachedRowSet is a RowSet in which the rows are cached and the RowSet is disconnected, that is, it does not maintain an active connection to the database. The oracle.jdbc.rowset.OracleCachedRowSet class is the Oracle implementation of CachedRowSet. It can interoperate with the reference implementation of Sun Microsystems. The OracleCachedRowSet class in the ojdbc5.jar and ojdbc6.jar files implements the standard JSR-114 interface javax.sql.rowset.CachedRowSet. In the following code, an OracleCachedRowSet object is created and the connection URL, user name, password, and the SQL query for the RowSet object is set as properties. The RowSet object is populated using the execute method. After the execute method has been processed, the RowSet object can be used as a java.sql.ResultSet object to retrieve, scroll, insert, delete, or update data. ... RowSet rowset = new OracleCachedRowSet(); rowset.setUrl("jdbc)); } ... To populate a CachedRowSet object with a query, complete the following steps:. // Executing a query to get the ResultSet object. ResultSet rset = pstmt.executeQuery (); OracleCachedRowSet rowset = new OracleCachedRowSet (); // the obtained ResultSet object is passed to the populate method // to populate the data in the rowset object. rowset.populate (rset); In the preceding example, a ResultSet object is obtained by running a query and the retrieved ResultSet object is passed to the populate method of the CachedRowSet object to populate the contents of the result set into the CachedRowSet. Note:Connection properties, like transaction isolation or the concurrency mode of the result set, and the bind properties cannot be set in the case where a pre-existent ResultSetobject is used to populate the CachedRowSetobject, because the connection or result set on which the property applies would have already been created. The following code illustrates how an OracleCachedRowSet object is serialized to a file and then retrieved: // writing the serialized OracleCachedRowSet object { FileOutputStream fileOutputStream = new FileOutputStream("emp_tab.dmp"); ObjectOutputStream ostream = new ObjectOutputStream(fileOutputStream); ostream.writeObject(rowset); ostream.close(); fileOutputStream.close(); } // reading the serialized OracleCachedRowSet object { FileInputStream fileInputStream = new FileInputStream("emp_tab.dmp"); ObjectInputStream istream = new ObjectInputStream(fileInputStream); RowSet rowset1 = (RowSet) istream.readObject(); istream.close(); fileInputStream.close(); } In the preceding code, a FileOutputStream object is opened for an emp_tab.dmp file, and the populated OracleCachedRowSet object is written to the file using ObjectOutputStream. The serialized OracleCachedRowSet object is retrieved using the FileInputStream and ObjectInputStream objects. OracleCachedRowSet takes care of the serialization of non-serializable form of data like InputStream, OutputStream, binary large objects (BLOBs), and character large objects (CLOBs). OracleCachedRowSets also implements metadata of its own, which could be obtained without any extra server round-trip. The following code illustrates how you can obtain metadata for the RowSet: ... ResultSetMetaData metaData = rowset.getMetaData(); int maxCol = metaData.getColumnCount(); for (int i = 1; i <= maxCol; ++i) System.out.println("Column (" + i +") " + metaData.getColumnName(i)); ... Because the OracleCachedRowSet class is serializable, it can be passed across a network or between Java Virtual Machines (JVMs), as done in Remote Method Invocation (RMI). Once the OracleCachedRowSet class is populated, it can move around any JVM, or any environment that does not have JDBC drivers. Committing the data in the RowSet requires the presence of JDBC drivers. The complete process of retrieving the data and populating it in the OracleCachedRowSet class is performed on the server and the populated RowSet is passed on to the client using suitable architectures like RMI or Enterprise Java Beans (EJB). The client would be able to perform all the operations like retrieving, scrolling, inserting, updating, and deleting on the RowSet without any connection to the database. Whenever data is committed to the database, the acceptChanges method is called, which synchronizes the data in the RowSet to that in the database. This method makes use of JDBC drivers, which require the JVM environment to contain JDBC implementation. This architecture would be suitable for systems involving a Thin client like a Personal Digital Assistant (PDA). After populating the CachedRowSet object, it can be used as a ResultSet object or any other object, which can be passed over the network using RMI or any other suitable architecture. Some of the other key-features of CachedRowSet are the following: Cloning a RowSet Creating a copy of a RowSet Creating a shared copy of a RowSet All the constraints that apply to an updatable result set are applicable here, except serialization, because OracleCachedRowSet is serializable. The SQL query has the following constraints: References only a single table in the database Contains no join operations Selects the primary key of the table it references In addition, a SQL query should also satisfy the following conditions, if new rows are to be inserted: Selects all non-nullable columns in the underlying table Selects all columns that do not have a default value Note:The CachedRowSetcannot hold a large quantity of data, because all the data is cached in memory. Oracle, therefore, recommends against using OracleCachedRowSetwith queries that could potentially return a large volume of data. Connection properties like, transaction isolation and concurrency mode of the result set, cannot be set after populating the RowSet, because the properties cannot be applied to the connection after retrieving the data from the same. A JdbcRowSet is a RowSet that wraps around a ResultSet object. It is a connected RowSet that provides JDBC interfaces in the form of a JavaBean interface. The Oracle implementation of JdbcRowSet is oracle.jdbc.rowset.OracleJDBCRowSet. The OracleJDBCRowSet class in ojdbc5.jar and ojdbc6.jar implements the standard JSR-114 interface javax.sql.rowset.JdbcRowSet. Table 18-1 shows how the JdbcRowSet interface differs from CachedRowSet interface. JdbcRowSet is a connected RowSet, which has a live connection to the database and all the calls on the JdbcRowSet are percolated to the mapping call in the JDBC connection, statement, or result set. A CachedRowSet does not have any connection to the database open. JdbcRowSet requires the presence of JDBC drivers unlike a CachedRowSet, which does not require JDBC drivers during manipulation. However, both JdbcRowSet and CachedRowSet require JDBC drivers during population of the RowSet and while committing the changes of the RowSet. The following code illustrates how a JdbcRowSet is used: ... RowSet rowset = new OracleJDBCRowSet(); rowset.setUrl("java)); } ... In the preceding example, the connection URL, user name, password, and SQL query are set as properties of the RowSet object, the SQL query is processed using the execute method, and the rows are retrieved and printed by traversing through the data populated in the RowSet object. A WebRowSet is an extension to CachedRowSet. It represents a set of fetched rows or tabular data that can be passed between tiers and components in a way such that no active connections with the data source need to be maintained. The WebRowSet interface provides support for the production and consumption of result sets and their synchronization with the data source, both in Extensible Markup Language (XML) format and in disconnected fashion. This allows result sets to be shipped across tiers and over Internet protocols. The Oracle implementation of WebRowSet is oracle.jdbc.rowset.OracleWebRowSet. This class, which is in the ojdbc5.jar and ojdbc6.jar files, implements the standard JSR-114 interface javax.sql.rowset.WebRowSet. This class also extends the oracle.jdbc.rowset.OracleCachedRowSet class. Besides the methods available in OracleCachedRowSet, the OracleWebRowSet class provides the following methods: public OracleWebRowSet() throws SQLException This is the constructor for creating an OracleWebRowSet object, which is initialized with the default values for an OracleCachedRowSet object, a default OracleWebRowSetXmlReader, and a default OracleWebRowSetXmlWriter. public void writeXml(java.io.Writer writer) throws SQLException public void writeXml(java.io.OutputStream ostream) throws SQLException These methods write the OracleWebRowSet object to the supplied Writer or OutputStream object in the XML format that conforms to the JSR-114 XML schema. In addition to the RowSet data, the properties and metadata of the RowSet are written. public void writeXml(ResultSet rset, java.io.Writer writer) throws SQLException public void writeXml(ResultSet rset, java.io.OutputStream ostream) throws SQLException These methods create an OracleWebRowSet object, populate it with the data in the given ResultSet object, and write it to the supplied Writer or OutputStream object in the XML format that conforms to the JSR-114 XML schema. public void readXml(java.io.Reader reader) throws SQLException public void readXml(java.io.InputStream istream) throws SQLException These methods read the OracleWebRowSet object in the XML format according to its JSR-114 XML schema, using the supplied Reader or InsputStream object. The Oracle WebRowSet implementation supports Java API for XML Processing (JAXP) 1.2. Both Simple API for XML (SAX) 2.0 and Document Object Model (DOM) JAXP-conforming XML parsers are supported. It follows the current JSR-114 W3C XML schema for WebRowSet from Sun Microsystems, which is at: See Also: JSR-114 specification at: Java SE 5.0 Javadoc at: Java SE 6.0 Javadoc at: Applications that use the readXml(...) methods should set one of the following two standard JAXP system properties before calling the methods: javax.xml.parsers.SAXParserFactory This property is for a SAX parser. javax.xml.parsers.DocumentBuilderFactory This property is for a DOM parser. The following code illustrates the use of OracleWebRowSet for both writing and reading in XML format: import java.sql.*; import java.io.*; import oracle.jdbc.rowset.*; ... String url = "jdbc:oracle:oci8:@"; Connection conn = DriverManager.getConnection(url,"scott","tiger"); Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery("select * from emp"); // Create an OracleWebRowSet object and populate it with the ResultSet object OracleWebRowSet wset = new OracleWebRowSet(); wset.populate(rset); try { // Create a java.io.Writer object FileWriter out = new FileWriter("xml.out"); // Now generate the XML and write it out wset.writeXml(out); } catch (IOException exc) { System.out.println("Couldn't construct a FileWriter"); } System.out.println("XML output file generated."); // Create a new OracleWebRowSet for reading from XML input OracleWebRowSet wset2 = new OracleWebRowSet(); // Use Oracle JAXP SAX parser System.setProperty("javax.xml.parsers.SAXParserFactory","oracle.xml.jaxp.JXSAXParserFactory"); try { // Use the preceding output file as input FileReader fr = new FileReader("xml.out"); // Now read XML stream from the FileReader wset2.readXml(fr); } catch (IOException exc) { System.out.println("Couldn't construct a FileReader"); } ... Note:The preceding code uses the Oracle SAX XML parser, which supports schema validation. A FilteredRowSet is an extension to WebRowSet that provides programmatic support for filtering its content. This enables you to avoid the overhead of supplying a query and the processing involved. The Oracle implementation of FilteredRowSet is oracle.jdbc.rowset.OracleFilteredRowSet. The OracleFilteredRowSet class in the ojdbc5.jar and ojdbc6.jar files a SQLException exception. The predicate set on an OracleFilteredRowSet object defines a filtering criteria that is applied to all the rows in the object to obtain the set of visible rows. The predicate also defines the criteria for inserting, deleting, and modifying rows. The set filtering criteria acts as a gating mechanism for all views and updates to the OracleFilteredRowSet object. Any attempt to update the OracleFilteredRowSet object, which violates the filtering criteria, throws a SQLException exception. The filtering criteria set on an OracleFilteredRowSet object can be modified by applying a new Predicate object. The new criteria is immediately applied on the object, and all further views and updates must adhere to this new criteria. A new filtering criteria can be applied only if there are no reference to the OracleFilteredRowSet object. Rows that fall outside of the filtering criteria set on the object cannot be modified until the filtering criteria is removed or a new filtering criteria is applied. Also, only the rows that fall within the bounds of the filtering criteria will be synchronized with the data source, if an attempt is made to persist the object. The following code example illustrates the use of OracleFilteredRowSet. Assume a table, test_table, with two NUMBER columns, col1 and col2. The code retrieves those rows from the table that have value of col1 between 50 and 100 and value of col2 between 100 and 200. The predicate defining the filtering criteria is as follows: public class PredicateImpl implements Predicate { private int low[]; private int high[]; private int columnIndexes[]; public PredicateImpl(int[] lo, int[] hi, int[] indexes) { low = lo; high = hi; columnIndexes = indexes; } public boolean evaluate(RowSet rs) { boolean result = true; for (int i = 0; i < columnIndexes.length; i++) { int columnValue = rs.getInt(columnIndexes[i]); if (columnValue < low[i] || columnValue > high[i]) result = false; } return result; } // the other two evaluate(...) methods simply return true } The predicate defined in the preceding code is used for filtering content in an OracleFilteredRowSet object, as follows: ... OracleFilteredRowSet ofrs = new OracleFilteredRowSet(); int low[] = {50, 100}; int high[] = {100, 200}; int indexes[] = {1, 2}; ofrs.setCommand("select col1, col2 from test_table"); // set other properties on ofrs like usr/pwd ... ... ofrs.execute(); ofrs.setPredicate(new PredicateImpl(low, high, indexes)); // this will only get rows with col1 in (50,100) and col2 in (100,200) while (ofrs.next()) {...} ... A JoinRowSet is an extension to WebRowSet that consists of related data from different RowSets. There is no standard way to establish a SQL JOIN between disconnected RowSets without connecting to the data source. A JoinRowSet addresses this issue. The Oracle implementation of JoinRowSet is the oracle.jdbc.rowset.OracleJoinRowSet class. This class, which is in the ojdbc5.jar and ojdbc6.jar files, implements the standard JSR-114 interface javax.sql.rowset.JoinRowSet. Any number of RowSet objects, which implement the Joinable interface, can be added to a JoinRowSet object, provided they can be related in a SQL JOIN. All five types of RowSet support the Joinable interface. The Joinable interface provides methods for specifying the columns based on which the JOIN will be performed, that is, the match columns.. In addition to the inherited methods, OracleJoinRowSet provides the following methods: public void addRowSet(Joinable joinable) throws SQLException; public void addRowSet(RowSet rowSet, int i) throws SQLException; public void addRowSet(RowSet rowSet, String s) throws SQLException; public void addRowSet(RowSet arowSet[], int an[]) throws SQLException; public void addRowSet(RowSet arowSet[], String as[]) throws SQLException; These methods are used to add a RowSet. public int getJoinType() throws SQLException; This method returns an integer value that indicates the JOIN type set on the OracleJoinRowSet object. This method throws a SQLException exception. a SQLException exception. The following code illustrates how OracleJoinRowSet is used to perform an inner join on two RowSets, whose data come from two different tables. The resulting RowSet contains data as if they were the result of an inner join on these two tables. Assume that there are two tables, an Order table with two NUMBER columns Order_id and Person_id, and a Person table with a NUMBER column Person_id and a VARCHAR2 column Name. ... // RowSet holding data from table Order OracleCachedRowSet ocrsOrder = new OracleCachedRowSet(); ... ocrsOrder.setCommand("select order_id, person_id from order"); ... // Join on person_id column ocrsOrder.setMatchColumn(2); ocrsOrder.execute(); // Creating the JoinRowSet OracleJoinRowSet ojrs = new OracleJoinRowSet(); ojrs.addRowSet(ocrsOrder); // RowSet holding data from table Person OracleCachedRowSet ocrsPerson = new OracleCachedRowSet(); ... ocrsPerson.setCommand("select person_id, name from person"); ... // do not set match column on this RowSet using setMatchColumn(). //use addRowSet() to set match column ocrsPerson.execute(); // Join on person_id column, in another way ojrs.addRowSet(ocrsPerson, 1); // now we can go the JoinRowSet as usual ojrs.beforeFirst(); while (ojrs.next()) System.out.println("order id = " + ojrs.getInt(1) + ", " + "person id = " + ojrs.getInt(2) + ", " + "person's name = " + ojrs.getString(3)); ...
http://docs.oracle.com/cd/B28359_01/java.111/b31224/jcrowset.htm
CC-MAIN-2014-52
en
refinedweb
------------------------------------------------------------------------------- -- Copyright (c) 1998: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started working with Pavel Curtis' original work, pcurses, in 1992. Changes through 1.9.9e are recorded by Zeyd M Ben-Halim. Changes since 1.9.9e are recorded by Thomas E Dickey. Contributors include those who have provided patches (even small ones), as well as those who provide useful information (bug reports, analyses). Changes with no cited author are the work of Thomas E Dickey (TD). A few contributors are given in this file by their initials. They each account for one percent or more of the changes since 1.9.9e. See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information.). + modify some modules to allow them to be reentrant if _REENTRANT is defined: lib_baudrate.c, resizeterm.c (local data only) + eliminate static data from some modules: add_tries.c, hardscroll.c, lib_ttyflags.c, lib_twait.c + improve manpage install to add aliases for the transformed program names, e.g., from --program-prefix. + used linklint to verify links in the HTML documentation, made fixes to manpages as needed. + fix a typo in curs_mouse.3x (report by William McBrine). + fix install-rule for ncurses5-config to make the bin-directory. 20061223 + modify configure script to omit the tic (terminfo compiler) support from ncurses library if --without-progs option is given. + modify install rule for ncurses5-config to do this via "install.libs" + modify shared-library rules to allow FreeBSD 3.x to use rpath. + update config.guess, config.sub 20061217 5.6 release for upload to 20061217 + add ifdef's for <wctype.h> for HPUX, which has the corresponding definitions in <wchar.h>. + revert the va_copy() change from 20061202, since it was neither correct nor portable. + add $(LOCAL_LIBS) definition to progs/Makefile.in, needed for rpath on Solaris. + ignore wide-acs line-drawing characters that wcwidth() claims are not one-column. This is a workaround for Solaris' broken locale support. 20061216 + modify configure --with-gpm option to allow it to accept a parameter, i.e., the name of the dynamic GPM library to load via dlopen() (requested by Bryan Henderson). + add configure option --with-valgrind, changes from vile. + modify configure script AC_TRY_RUN and AC_TRY_LINK checks to use 'return' in preference to 'exit()'. 20061209 + change default for --with-develop back to "no". + add XTABS to tracing of TTY bits. + updated autoconf patch to ifdef-out the misfeature which declares exit() for configure tests. This fixes a redefinition warning on Solaris. + use ${CC} rather than ${LD} in shared library rules for IRIX64, Solaris to help ensure that initialization sections are provided for extra linkage requirements, e.g., of C++ applications (prompted by comment by Casper Dik in newsgroup). + rename "$target" in CF_MAN_PAGES to make it easier to distinguish from the autoconf predefined symbol. There was no conflict, since "$target" was used only in the generated edit_man.sh file, but SuSE's rpm package contains a patch. 20061202 + update man/term.5 to reflect extended terminfo support and hashed database configuration. + updates for test/configure script. + adapted from SuSE rpm package: + remove long-obsolete workaround for broken-linker which declared cur_term in tic.c + improve error recovery in PUTC() macro when wcrtomb() does not return usable results for an 8-bit character. + patches from rpm package (SuSE): + use va_copy() in extra varargs manipulation for tracing version of printw, etc. + use a va_list rather than a null in _nc_freeall()'s call to _nc_printf_string(). + add some see-also references in manpages to show related wide-character functions (suggested by Claus Fischer). 20061125 + add a check in lib_color.c to ensure caller does not increase COLORS above max_colors, which is used as an array index (discussion with Simon Sasburg). + add ifdef's allowing ncurses to be built with tparm() using either varargs (the existing status), or using a fixed-parameter list (to match X/Open). 20061104 + fix redrawing of windows other than stdscr using wredrawln() by touching the corresponding rows in curscr (discussion with Dan Gookin). + add test/redraw.c + add test/echochar.c + review/cleanup manpage descriptions of error-returns for form- and menu-libraries (prompted by FreeBSD docs/46196). 20061028 + add AUTHORS file -TD + omit the -D options from output of the new config script --cflags option (suggested by Ralf S Engelschall). + make NCURSES_INLINE unconditionally defined in curses.h 20061021 + revert change to accommodate bash 3.2, since that breaks other platforms, e.g., Solaris. + minor fixes to NEWS file to simplify scripting to obtain list of contributors. + improve some shared-library configure scripting for Linux, FreeBSD and NetBSD to make "--with-shlib-version" work. + change configure-script rules for FreeBSD shared libraries to allow for rpath support in versions past 3. + use $(DESTDIR) in makefile rules for installing/uninstalling the package config script (reports/patches by Christian Wiese, Ralf S Engelschall). + fix a warning in the configure script for NetBSD 2.0, working around spurious blanks embedded in its ${MAKEFLAGS} symbol. + change test/Makefile to simplify installing test programs in a different directory when --enable-rpath is used. 20061014 + work around bug in bash 3.2 by adding extra quotes (Jim Gifford). + add/install a package config script, e.g., "ncurses5-config" or "ncursesw5-config", according to configuration options. 20061007 + add several GNU Screen terminfo variations with 16- and 256-colors, and status line (Alain Bench). + change the way shared libraries (other than libtool) are installed. Rather than copying the build-tree's libraries, link the shared objects into the install directory. This makes the --with-rpath option work except with $(DESTDIR) (cf: 20000930). 20060930 + fix ifdef in c++/internal.h for QNX 6.1 + test-compiled with (old) egcs-1.1.2, modified configure script to not unset the $CXX and related variables which would prevent this. + fix a few terminfo.src typos exposed by improvments to "-f" option. + improve infocmp/tic "-f" option formatting. 20060923 + make --disable-largefile option work (report by Thomas M Ott). + updated html documentation. + add ka2, kb1, kb3, kc2 to vt220-keypad as an extension -TD + minor improvements to rxvt+pcfkeys -TD 20060916 + move static data from lib_mouse.c into SCREEN struct. + improve ifdef's for _POSIX_VDISABLE in tset to work with Mac OS X (report by Michail Vidiassov). + modify CF_PATH_SYNTAX to ensure it uses the result from --prefix option (from lynx changes) -TD + adapt AC_PROG_EGREP check, noting that this is likely to be another place aggravated by POSIXLY_CORRECT. + modify configure check for awk to ensure that it is found (prompted by report by Christopher Parker). + update config.sub 20060909 + add kon, kon2 and jfbterm terminfo entry (request by Till Maas) -TD + remove invis capability from klone+sgr, mainly used by linux entry, since it does not really do this -TD 20060903 + correct logic in wadd_wch() and wecho_wch(), which did not guard against passing the multi-column attribute into a call on waddch(), e.g., using data returned by win_wch() (cf: 20041023) (report by Sadrul H Chowdhury). 20060902 + fix kterm's acsc string -TD + fix for change to tic/infocmp in 20060819 to ensure no blank is embedded into a termcap description. + workaround for 20050806 ifdef's change to allow visbuf.c to compile when using --with-termlib --with-trace options. + improve tgetstr() by making the return value point into the user's buffer, if provided (patch by Miroslav Lichvar (see Redhat Bugzilla #202480)). + correct libraries needed for foldkeys (report by Stanislav Ievlev) 20060826 + add terminfo entries for xfce terminal (xfce) and multi gnome terminal (mgt) -TD + add test/foldkeys.c 20060819 + modify tic and infocmp to avoid writing trailing blanks on terminfo source output (Debian #378783). + modify configure script to ensure that if the C compiler is used rather than the loader in making shared libraries, the $(CFLAGS) variable is also used (Redhat Bugzilla #199369). + port hashed-db code to db2 and db3. + fix a bug in tgetent() from 20060625 and 20060715 changes (patch/analysis by Miroslav Lichvar (see Redhat Bugzilla #202480)). 20060805 + updated xterm function-keys terminfo to match xterm #216 -TD + add configure --with-hashed-db option (tested only with FreeBSD 6.0, e.g., the db 1.8.5 interface). 20060729 + modify toe to access termcap data, e.g., via cgetent() functions, or as a text file if those are not available. + use _nc_basename() in tset to improve $SHELL check for csh/sh. + modify _nc_read_entry() and _nc_read_termcap_entry() so infocmp, can access termcap data when the terminfo database is disabled. 20060722 + widen the test for xterm kmous a little to allow for other strings than \E[M, e.g., for xterm-sco functionality in xterm. + update xterm-related terminfo entries to match xterm patch #216 -TD + update config.guess, config.sub 20060715 + fix for install-rule in Ada95 to add terminal_interface.ads and terminal_interface.ali (anonymous posting in comp.lang.ada). + correction to manpage for getcchar() (report by William McBrine). + add test/chgat.c + modify wchgat() to mark updated cells as changed so a refresh will repaint those cells (comments by Sadrul H Chowdhury and William McBrine). + split up dependency of names.c and codes.c in ncurses/Makefile to work with parallel make (report/analysis by Joseph S Myers). + suppress a warning message (which is ignored) for systems without an ldconfig program (patch by Justin Hibbits). + modify configure script --disable-symlinks option to allow one to disable symlink() in tic even when link() does not work (report by Nigel Horne). + modify MKfallback.sh to use tic -x when constructing fallback tables to allow extended capabilities to be retrieved from a fallback entry. + improve leak-checking logic in tgetent() from 20060625 to ensure that it does not free the current screen (report by Miroslav Lichvar). 20060708 + add a check for _POSIX_VDISABLE in tset (NetBSD #33916). + correct _nc_free_entries() and related functions used for memory leak checking of tic. 20060701 + revert a minor change for magic-cookie support from 20060513, which caused unexpected reset of attributes, e.g., when resizing test/view in color mode. + note in clear manpage that the program ignores command-line parameters (prompted by Debian #371855). + fixes to make lib_gen.c build properly with changes to the configure --disable-macros option and NCURSES_NOMACROS (cf: 20060527) + update/correct several terminfo entries -TD + add some notes regarding copyright to terminfo.src -TD 20060625 + fixes to build Ada95 binding with gnat-4.1.0 + modify read_termtype() so the term_names data is always allocated as part of the str_table, a better fix for a memory leak (cf: 20030809). + reduce memory leaks in repeated calls to tgetent() by remembering the last TERMINAL* value allocated to hold the corresponding data and freeing that if the tgetent() result buffer is the same as the previous call (report by "Matt" for FreeBSD gnu/98975). + modify tack to test extended capability function-key strings. + improved gnome terminfo entry (GenToo #122566). + improved xterm-256color terminfo entry (patch by Alain Bench). 20060617 + fix two small memory leaks related to repeated tgetent() calls with TERM=screen (report by "Matt" for FreeBSD gnu/98975). + add --enable-signed-char to simplify Debian package. + reduce name-pollution in term.h by removing #define's for HAVE_xxx symbols. + correct typo in curs_terminfo.3x (Debian #369168). 20060603 + enable the mouse in test/movewindow.c + improve a limit-check in frm_def.c (John Heasley). + minor copyright fixes. + change configure script to produce test/Makefile from data file. 20060527 + add a configure option --enable-wgetch-events to enable NCURSES_WGETCH_EVENTS, and correct the associated loop-logic in lib_twait.c (report by Bernd Jendrissek). + remove include/nomacros.h from build, since the ifdef for NCURSES_NOMACROS makes that obsolete. + add entrypoints for some functions which were only provided as macros to make NCURSES_NOMACROS ifdef work properly: getcurx(), getcury(), getbegx(), getbegy(), getmaxx(), getmaxy(), getparx() and getpary(), wgetbkgrnd(). + provide ifdef for NCURSES_NOMACROS which suppresses most macro definitions from curses.h, i.e., where a macro is defined to override a function to improve performance. Allowing a developer to suppress these definitions can simplify some application (discussion with Stanislav Ievlev). + improve description of memu/meml in terminfo manpage. 20060520 + if msgr is false, reset video attributes when doing an automargin wrap to the next line. This makes the ncurses 'k' test work properly for hpterm. + correct caching of keyname(), which was using only half of its table. + minor fixes to memory-leak checking. + make SCREEN._acs_map and SCREEN._screen_acs_map pointers rather than arrays, making ACS_LEN less visible to applications (suggested by Stanislav Ievlev). + move chunk in SCREEN ifdef'd for USE_WIDEC_SUPPORT to the end, so _screen_acs_map will have the same offset in both ncurses/ncursesw, making the corresponding tinfo/tinfow libraries binary-compatible (cf: 20041016, report by Stanislav Ievlev). 20060513 + improve debug-tracing for EmitRange(). + change default for --with-develop to "yes". Add NCURSES_NO_HARD_TABS and NCURSES_NO_MAGIC_COOKIE environment variables to allow runtime suppression of the related hard-tabs and xmc-glitch features. + add ncurses version number to top-level manpages, e.g., ncurses, tic, infocmp, terminfo as well as form, menu, panel. + update config.guess, config.sub + modify ncurses.c to work around a bug in NetBSD 3.0 curses (field_buffer returning null for a valid field). The 'r' test appears to not work with that configuration since the new_fieldtype() function is broken in that implementation. 20060506 + add hpterm-color terminfo entry -TD + fixes to compile test-programs with HPUX 11.23 20060422 + add copyright notices to files other than those that are generated, data or adapted from pdcurses (reports by William McBrine, David Taylor). + improve rendering on hpterm by not resetting attributes at the end of doupdate() if the terminal has the magic-cookie feature (report by Bernd Rieke). + add 256color variants of terminfo entries for programs which are reported to implement this feature -TD 20060416 + fix typo in change to NewChar() macro from 20060311 changes, which broke tab-expansion (report by Frederic L W Meunier). 20060415 + document -U option of tic and infocmp. + modify tic/infocmp to suppress smacs/rmacs when acsc is suppressed due to size limit, e.g., converting to termcap format. Also suppress them if the output format does not contain acsc and it was not VT100-like, i.e., a one-one mapping (Novell #163715). + add configure check to ensure that SIGWINCH is defined on platforms such as OS X which exclude that when _XOPEN_SOURCE, etc., are defined (report by Nicholas Cole) 20060408 + modify write_object() to not write coincidental extensions of an entry made due to it being referenced in a use= clause (report by Alain Bench). + another fix for infocmp -i option, which did not ensure that some escape sequences had comparable prefixes (report by Alain Bench). 20060401 + improve discussion of init/reset in terminfo and tput manpages (report by Alain Bench). + use is3 string for a fallback of rs3 in the reset program; it was using is2 (report by Alain Bench). + correct logic for infocmp -i option, which did not account for multiple digits in a parameter (cf: 20040828) (report by Alain Bench). + move _nc_handle_sigwinch() to lib_setup.c to make --with-termlib option work after 20060114 changes (report by Arkadiusz Miskiewicz). + add copyright notices to test-programs as needed (report by William McBrine). 20060318 + modify ncurses.c 'F' test to combine the wide-characters with color and/or video attributes. + modify test/ncurses to use CTL/Q or ESC consistently for exiting a test-screen (some commands used 'x' or 'q'). 20060312 + fix an off-by-one in the scrolling-region change (cf_ 20060311). 20060311 + add checks in waddchnstr() and wadd_wchnstr() to stop copying when a null character is found (report by Igor Bogomazov). + modify progs/Makefile.in to make "tput init" work properly with cygwin, i.e., do not pass a ".exe" in the reference string used in check_aliases (report by Samuel Thibault). + add some checks to ensure current position is within scrolling region before scrolling on a new line (report by Dan Gookin). + change some NewChar() usage to static variables to work around stack garbage introduced when cchar_t is not packed (Redhat #182024). 20060225 + workarounds to build test/movewindow with PDcurses 2.7. + fix for nsterm-16color entry (patch by Alain Bench). + correct a typo in infocmp manpage (Debian #354281). 20060218 + add nsterm-16color entry -TD + updated mlterm terminfo entry -TD + remove 970913 feature for copying subwindows as they are moved in mvwin() (discussion with Bryan Christ). + modify test/demo_menus.c to demonstrate moving a menu (both the window and subwindow) using shifted cursor-keys. + start implementing recursive mvwin() in movewindow.c (incomplete). + add a fallback definition for GCC_PRINTFLIKE() in test.priv.h, for movewindow.c (report by William McBrine). + add help-message to test/movewindow.c 20060211 + add test/movewindow.c, to test mvderwin(). + fix ncurses soft-key test so color changes are shown immediately rather than delayed. + modify ncurses soft-key test to hide the keys when exiting the test screen. + fixes to build test programs with PDCurses 2.7, e.g., its headers rely on autoconf symbols, and it declares stubs for nonfunctional terminfo and termcap entrypoints. 20060204 + improved test/configure to build test/ncurses on HPUX 11 using the vendor curses. + documented ALTERNATE CONFIGURATIONS in the ncurses manpage, for the benefit of developers who do not read INSTALL. 20060128 + correct form library Window_To_Buffer() change (cf: 20040516), which should ignore the video attributes (report by Ricardo Cantu). 20060121 + minor fixes to xmc-glitch experimental code: + suppress line-drawing + implement max_attributes tested with xterm. + minor fixes for the database iterator. + fix some buffer limits in c++ demo (comment by Falk Hueffner in Debian #348117). 20060114 + add toe -a option, to show all databases. This uses new private interfaces in the ncurses library for iterating through the list of databases. + fix toe from 20000909 changes which made it not look at $HOME/.terminfo + make toe's -v option parameter optional as per manpage. + improve SIGWINCH handling by postponing its effect during newterm(), etc., when allocating screens. 20060111 + modify wgetnstr() to return KEY_RESIZE if a sigwinch occurs. Use this in test/filter.c + fix an error in filter() modification which caused some applications to fail. 20060107 + check if filter() was called when getting the screensize. Keep it at 1 if so (based on Redhat #174498). + add extension nofilter(). + refined the workaround for ACS mapping. + make ifdef's consistent in curses.h for the extended colors so the header file can be used for the normal curses library. The header file installed for extended colors is a variation of the wide-character configuration (report by Frederic L W Meunier). 20051231 + add a workaround to ACS mapping to allow applications such as test/blue.c to use the "PC ROM" characters by masking them with A_ALTCHARSET. This worked up til 5.5, but was lost in the revision of legacy coding (report by Michael Deutschmann). + add a null-pointer check in the wide-character version of calculate_actual_width() (report by Victor Julien). + improve test/ncurses 'd' (color-edit) test by allowing the RGB values to be set independently (patch by William McBrine). + modify test/configure script to allow building test programs with PDCurses/X11. + modified test programs to allow some to work with NetBSD curses. Several do not because NetBSD curses implements a subset of X/Open curses, and also lacks much of SVr4 additions. But it's enough for comparison. + update config.guess and config.sub 20051224 + use BSD-specific fix for return-value from cgetent() from CVS where an unknown terminal type would be reportd as "database not found". + make tgetent() return code more readable using new symbols TGETENT_YES, etc. + remove references to non-existent "tctest" program. + remove TESTPROGS from progs/Makefile.in (it was referring to code that was never built in that directory). + typos in curs_addchstr.3x, some doc files (noticed in OpenBSD CVS). 20051217 + add use_legacy_coding() function to support lynx's font-switching feature. + fix formatting in curs_termcap.3x (report by Mike Frysinger). + modify MKlib_gen.sh to change preprocessor-expanded _Bool back to bool. 20051210 + extend test/ncurses.c 's' (overlay window) test to exercise overlay(), overwrite() and copywin() with different combinations of colors and attributes (including background color) to make it easy to see the effect of the different functions. + corrections to menu/m_global.c for wide-characters (report by Victor Julien). 20051203 + add configure option --without-dlsym, allowing developers to configure GPM support without using dlsym() (discussion with Michael Setzer). + fix wins_nwstr(), which did not handle single-column non-8bit codes (Debian #341661). 20051126 + move prototypes for wide-character trace functions from curses.tail to curses.wide to avoid accidental reference to those if _XOPEN_SOURCE_EXTENDED is defined without ensuring that <wchar.h> is included. + add/use NCURSES_INLINE definition. + change some internal functions to use int/unsigned rather than the short equivalents. 20051119 + remove a redundant check in lib_color.c (Debian #335655). + use ld's -search_paths_first option on Darwin to work around odd search rules on that platform (report by Christian Gennerat, analysis by Andrea Govoni). + remove special case for Darwin in CF_XOPEN_SOURCE configure macro. + ignore EINTR in tcgetattr/tcsetattr calls (Debian #339518). + fix several bugs in test/bs.c (patch by Stephen Lindholm). 20051112 + other minor fixes to cygwin based on tack -TD + correct smacs in cygwin (Debian #338234, report by Baurzhan Ismagulov, who noted that it was fixed in Cygwin). 20051029 + add shifted up/down arrow codes to xterm-new as kind/kri strings -TD + modify wbkgrnd() to avoid clearing the A_CHARTEXT attribute bits since those record the state of multicolumn characters (Debian #316663). + modify werase to clear multicolumn characters that extend into a derived window (Debian #316663). 20051022 + move assignment from environment variable ESCDELAY from initscr() down to newterm() so the environment variable affects timeouts for terminals opened with newterm() as well. + fix a memory leak in keyname(). + add test/demo_altkeys.c + modify test/demo_defkey.c to exit from loop via 'q' to allow leak-checking, as well as fix a buffer size in winnstr() call. 20051015 + correct order of use-clauses in rxvt-basic entry which made codes for f1-f4 vt100-style rather than vt220-style (report by Gabor Z Papp). + suppress configure check for gnatmake if Ada95/Makefile.in is not found. + correct a typo in configure --with-bool option for the case where --without-cxx is used (report by Daniel Jacobowitz). + add a note to INSTALL's discussion of --with-normal, pointing out that one may wish to use --without-gpm to ensure a completely static link (prompted by report by Felix von Leitner). 20051010 5.5 release for upload to 20051008 + document in demo_forms.c some portability issues. 20051001 + document side-effect of werase() which sets the cursor position. + save/restore the current position in form field editing to make overlay mode work. 20050924 + correct header dependencies in progs, allowing parallel make (report by Daniel Jacobowitz). + modify CF_BUILD_CC to ensure that pre-setting $BUILD_CC overrides the configure check for --with-build-cc (report by Daniel Jacobowitz). + modify CF_CFG_DEFAULTS to not use /usr as the default prefix for NetBSD. + update config.guess and config.sub from 20050917 + modify sed expression which computes path for /usr/lib/terminfo symbolic link in install to ensure that it does not change unexpected levels of the path (Gentoo #42336). + modify default for --disable-lp64 configure option to reduce impact on existing 64-bit builds. Enabling the _LP64 option may change the size of chtype and mmask_t. However, for ABI 6, it is enabled by default (report by Mike Frysinger). + add configure script check for --enable-ext-mouse, bump ABI to 6 by default if it is used. + improve configure script logic for bumping ABI to omit this if the --with-abi-version option was used. + update address for Free Software Foundation in tack's source. + correct wins_wch(), which was not marking the filler-cells of multi-column characters (cf: 20041023). 20050910 + modify mouse initialization to ensure that Gpm_Open() is called only once. Otherwise GPM gets confused in its initialization of signal handlers (Debian #326709). 20050903 + modify logic for backspacing in a multiline form field to ensure that it works even when the preceding line is full (report by Frank van Vugt). + remove comment about BUGS section of ncurses manpage (Debian #325481) 20050827 + document some workarounds for shared and libtool library configurations in INSTALL (see --with-shared and --with-libtool). + modify CF_GCC_VERSION and CF_GXX_VERSION macros to accommodate cross-compilers which emit the platform name in their version message, e.g., arm-sa1100-linux-gnu-g++ (GCC) 4.0.1 (report by Frank van Vugt). 20050820 + start updating documentation for upcoming 5.5 release. + fix to make libtool and libtinfo work together again (cf: 20050122). + fixes to allow building traces into libtinfo + add debug trace to tic that shows if/how ncurses will write to the lower corner of a terminal's screen. + update llib-l* files. 20050813 + modify initializers in c++ binding to build with old versions of g++. + improve special case for 20050115 repainting fix, ensuring that if the first changed cell is not a character that the range to be repainted is adjusted to start at a character's beginning (Debian #316663). 20050806 + fixes to build on QNX 6.1 + improve configure script checks for Intel 9.0 compiler. + remove #include's for libc.h (obsolete). + adjust ifdef's in curses.priv.h so that when cross-compiling to produce comp_hash and make_keys, no dependency on wchar.h is needed. That simplifies the build-cppflags (report by Frank van Vugt). + move modules related to key-binding into libtinfo to fix linkage problem caused by 20050430 changes to MKkeyname.sh (report by Konstantin Andreev). 20050723 + updates/fixes for configure script macros from vile -TD + make prism9's sgr string agree with the rest of the terminfo -TD + make vt220's sgr0 string consistent with sgr string, do this for several related cases -TD + improve translation to termcap by filtering the 'me' (sgr0) strings as in the runtime call to tgetent() (prompted by a discussion with Thomas Klausner). + improve tic check for sgr0 versus sgr(0), to help ensure that sgr0 resets line-drawing. 20050716 + fix special cases for trimming sgr0 for hurd and vt220 (Debian #318621). + split-out _nc_trim_sgr0() from modifications made to tgetent(), to allow it to be used by tic to provide information about the runtime changes that would be made to sgr0 for termcap applications. + modify make_sed.sh to make the group-name in the NAME section of form/menu library manpage agree with the TITLE string when renaming is done for Debian (Debian #78866). 20050702 + modify parameter type in c++ binding for insch() and mvwinsch() to be consistent with underlying ncurses library (was char, is chtype). + modify treatment of Intel compiler to allow _GNU_SOURCE to be defined on Linux. + improve configure check for nanosleep(), checking that it works since some older systems such as AIX 4.3 have a nonworking version. 20050625 + update config.guess and config.sub from + modify misc/shlib to work in test-directory. + suppress $suffix in misc/run_tic.sh when cross-compiling. This allows cross-compiles to use the host's tic program to handle the "make install.data" step. + improve description of $LINES and $COLUMNS variables in manpages (prompted by report by Dave Ulrick). + improve description of cross-compiling in INSTALL + add NCURSES-Programming-HOWTO.html by Pradeep Padala (see). + modify configure script to obtain soname for GPM library (discussion with Daniel Jacobowitz). + modify configure script so that --with-chtype option will still compute the unsigned literals suffix for constants in curses.h (report by Daniel Jacobowitz: + patches from Daniel Jacobowitz: + the man_db.renames entry for tack.1 was backwards. + tack.1 had some 1m's that should have been 1M's. + the section for curs_inwstr.3 was wrong. 20050619 + correction to --with-chtype option (report by Daniel Jacobowitz). 20050618 + move build-time edit_man.sh and edit_man.sed scripts to top directory to simplify reusing them for renaming tack's manpage (prompted by a review of Debian package). + revert minor optimization from 20041030 (Debian #313609). + libtool-specific fixes, tested with libtool 1.4.3, 1.5.0, 1.5.6, 1.5.10 and 1.5.18 (all work except as noted previously for the c++ install using libtool 1.5.0): + modify the clean-rule in c++/Makefile.in to work with IRIX64 make program. + use $(LIBTOOL_UNINSTALL) symbol, overlooked in 20030830 + add configure options --with-chtype and --with-mmask-t, to allow overriding of the non-LP64 model's use of the corresponding types. + revise test for size of chtype (and mmask_t), which always returned "long" due to an uninitialized variable (report by Daniel Jacobowitz). 20050611 + change _tracef's that used "%p" format for va_list values to ignore that, since on some platforms those are not pointers. + fixes for long-formats in printf's due to largefile support. 20050604 + fixes for termcap support: + reset pointer to _nc_curr_token.tk_name when the input stream is closed, which could point to free memory (cf: 20030215). + delink TERMTYPE data which is used by the termcap reader, so that extended names data will be freed consistently. + free pointer to TERMTYPE data in _nc_free_termtype() rather than its callers. + add some entrypoints for freeing permanently allocated data via _nc_freeall() when NO_LEAKS is defined. + amend 20041030 change to _nc_do_color to ensure that optimization is applied only when the terminal supports back_color_erase (bce). 20050528 + add sun-color terminfo entry -TD + correct a missing assignment in c++ binding's method NCursesPanel::UserPointer() from 20050409 changes. + improve configure check for large-files, adding check for dirent64 from vile -TD + minor change to configure script to improve linker options for the Ada95 tree. 20050515 + document error conditions for ncurses library functions (report by Stanislav Ievlev). + regenerated html documentation for ada binding. see 20050507 + regenerated html documentation for manpages. + add $(BUILD_EXEEXT) suffix to invocation of make_keys in ncurses/Makefile (Gentoo #89772). + modify c++/demo.cc to build with g++ -fno-implicit-templates option (patch by Mike Frysinger). + modify tic to filter out long extended names when translating to termcap format. Only two characters are permissible for termcap capability names. 20050430 + modify terminfo entries xterm-new and rxvt to add strings for shift-, control-cursor keys. + workaround to allow c++ binding to compile with g++ 2.95.3, which has a broken implementation of static_cast<> (patch by Jeff Chua). + modify initialization of key lookup table so that if an extended capability (tic -x) string is defined, and its name begins with 'k', it will automatically be treated as a key. + modify test/keynames.c to allow for the possibility of extended key names, e.g., via define_key(), or via "tic -x". + add test/demo_termcap.c to show the contents of given entry via the termcap interface. 20050423 + minor fixes for vt100/vt52 entries -TD + add configure option --enable-largefile + corrected libraries used to build Ada95/gen/gen, found in testing gcc 4.0.0. 20050416 + update config.guess, config.sub + modify configure script check for _XOPEN_SOURCE, disable that on Darwin whose header files have problems (patch by Chris Zubrzycki). + modify form library Is_Printable_String() to use iswprint() rather than wcwidth() for determining if a character is printable. The latter caused it to reject menu items containing non-spacing characters. + modify ncurses test program's F-test to handle non-spacing characters by combining them with a reverse-video blank. + review/fix several gcc -Wconversion warnings. 20050409 + correct an off-by-one error in m_driver() for mouse-clicks used to position the mouse to a particular item. + implement test/demo_menus.c + add some checks in lib_mouse to ensure SP is set. + modify C++ binding to make 20050403 changes work with the configure --enable-const option. 20050403 + modify start_color() to return ERR if it cannot allocate memory. + address g++ compiler warnings in C++ binding by adding explicit member initialization, assignment operators and copy constructors. Most of the changes simply preserve the existing semantics of the binding, which can leak memory, etc., but by making these features visible, it provides a framework for improving the binding. + improve C++ binding using static_cast, etc. + modify configure script --enable-warnings to add options to g++ to correspond to the gcc --enable-warnings. + modify C++ binding to use some C internal functions to make it compile properly on Solaris (and other platforms). 20050327 + amend change from 20050320 to limit it to configurations with a valid locale. + fix a bug introduced in 20050320 which broke the translation of nonprinting characters to uparrow form (report by Takahashi Tamotsu). 20050326 + add ifdef's for _LP64 in curses.h to avoid using wasteful 64-bits for chtype and mmask_t, but add configure option --disable-lp64 in case anyone used that configuration. + update misc/shlib script to account for Mac OS X (report by Michail Vidiassov). + correct comparison for wrapping multibyte characters in waddch_literal() (report by Takahashi Tamotsu). 20050320 + add -c and -w options to tset to allow user to suppress ncurses' resizing of the terminal emulator window in the special case where it is not able to detect the true size (report by Win Delvaux, Debian #300419). + modify waddch_nosync() to account for locale zn_CH.GBK, which uses codes 128-159 as part of multibyte characters (report by Wang WenRui, Debian #300512). 20050319 + modify ncurses.c 'd' test to make it work with 88-color configuration, i.e., by implementing scrolling. + improve scrolling in ncurses.c 'c' and 'C' tests, e.g., for 88-color configuration. 20050312 + change tracemunch to use strict checking. + modify ncurses.c 'p' test to test line-drawing within a pad. + implement environment variable NCURSES_NO_UTF8_ACS to support miscellaneous terminal emulators which ignore alternate character set escape sequences when in UTF-8 mode. 20050305 + change NCursesWindow::err_handler() to a virtual function (request by Steve Beal). + modify fty_int.c and fty_num.c to handle wide characters (report by Wolfgang Gutjahr). + adapt fix for fty_alpha.c to fty_alnum.c, which also handled normal and wide characters inconsistently (report by Wolfgang Gutjahr). + update llib-* files to reflect internal interface additions/changes. 20050226 + improve test/configure script, adding tests for _XOPEN_SOURCE, etc., from lynx. + add aixterm-16color terminfo entry -TD + modified xterm-new terminfo entry to work with tgetent() changes -TD + extended changes in tgetent() from 20040710 to allow the substring of sgr0 which matches rmacs to be at the beginning of the sgr0 string (request by Thomas Wolff). Wolff says the visual effect in combination with pre-20040710 ncurses is improved. + fix off-by-one in winnstr() call which caused form field validation of multibyte characters to ignore the last character in a field. + correct logic in winsch() for inserting multibyte strings; the code would clear cells after the insertion rather than push them to the right (cf: 20040228). + fix an inconsistency in Check_Alpha_Field() between normal and wide character logic (report by Wolfgang Gutjahr). 20050219 + fix a bug in editing wide-characters in form library: deleting a nonwide character modified the previous wide-character. + update manpage to describe NCURSES_MOUSE_VERSION 2. + correct manpage description of mouseinterval() (Debian #280687). + add a note to default_colors.3x explaining why this extension was added (Debian #295083). + add traces to panel library. 20050212 + improve editing of wide-characters in form library: left/right cursor movement, and single-character deletions work properly. + disable GPM mouse support when $TERM happens to be prefixed with "xterm". Gpm_Open() would otherwise assert that it can deal with mouse events in this case. + modify GPM mouse support so it closes the server connection when the caller disables the mouse (report by Stanislav Ievlev). 20050205 + add traces for callback functions in form library. + add experimental configure option --enable-ext-mouse, which defines NCURSES_MOUSE_VERSION 2, and modifies the encoding of mouse events to support wheel mice, which may transmit buttons 4 and 5. This works with xterm and similar X terminal emulators (prompted by question by Andreas Henningsson, this is also related to Debian #230990). + improve configure macros CF_XOPEN_SOURCE and CF_POSIX_C_SOURCE to avoid redefinition warnings on cygwin. 20050129 + merge remaining development changes for extended colors (mostly complete, does not appear to break other configurations). + add xterm-88color.dat (part of extended colors testing). + improve _tracedump() handling of color pairs past 96. + modify return-value from start_color() to return OK if colors have already been started. + modify curs_color.3x list error conditions for init_pair(), pair_content() and color_content(). + modify pair_content() to return -1 for consistency with init_pair() if it corresponds to the default-color. + change internal representation of default-color to allow application to use color number 255. This does not affect the total number of color pairs which are allowed. + add a top-level tags rule. 20050122 + add a null-pointer check in wgetch() in case it is called without first calling initscr(). + add some null-pointer checks for SP, which is not set by libtinfo. + modify misc/shlib to ensure that absolute pathnames are used. + modify test/Makefile.in, etc., to link test programs only against the libraries needed, e.g., omit form/menu/panel library for the ones that are curses-specific. + (report by Stanislav Ievlev). 20050115 + minor fixes to allow test-compiles with g++. + correct column value shown in tic's warnings, which did not account for leading whitespace. + add a check in _nc_trans_string() for improperly ended strings, i.e., where a following line begins in column 1. + modify _nc_save_str() to return a null pointer on buffer overflow. + improve repainting while scrolling wide-character data (Eungkyu Song). 20050108 + merge some development changes to extend color capabilities. 20050101 + merge some development changes to extend color capabilities. + fix manpage typo (FreeBSD report docs/75544). + update config.guess, config.sub > patches for configure script (Albert Chin-A-Young): + improved fix to make mbstate_t recognized on HPUX 11i (cf: 20030705), making vsscanf() prototype visible on IRIX64. Tested for on HP-UX 11i, Solaris 7, 8, 9, AIX 4.3.3, 5.2, Tru64 UNIX 4.0D, 5.1, IRIX64 6.5, Redhat Linux 7.1, 9, and RHEL 2.1, 3.0. + print the result of the --disable-home-terminfo option. + use -rpath when compiling with SGI C compiler. 20041225 + add trace calls to remaining public functions in form and menu libraries. + fix check for numeric digits in test/ncurses.c 'b' and 'B' tests. + fix typo in test/ncurses.c 'c' test from 20041218. 20041218 + revise test/ncurses.c 'c' color test to improve use for xterm-88color and xterm-256color, added 'C' test using the wide-character color_set and attr_set functions. 20041211 + modify configure script to work with Intel compiler. + fix an limit-check in wadd_wchnstr() which caused labels in the forms-demo to be one character short. + fix typo in curs_addchstr.3x (Jared Yanovich). + add trace calls to most functions in form and menu libraries. + update working-position for adding wide-characters when window is scrolled (prompted by related report by Eungkyu Song). 20041204 + replace some references on Linux to wcrtomb() which use it to obtain the length of a multibyte string with _nc_wcrtomb, since wcrtomb() is broken in glibc (see Debian #284260). + corrected length-computation in wide-character support for field_buffer(). + some fixes to frm_driver.c to allow it to accept multibyte input. + modify configure script to work with Intel 8.0 compiler. 20041127 + amend change to setupterm() in 20030405 which would reuse the value of cur_term if the same output was selected. This now reuses it only when setupterm() is called from tgetent(), which has no notion of separate SCREENs. Note that tgetent() must be called after initscr() or newterm() to use this feature (Redhat Bugzilla #140326). + add a check in CF_BUILD_CC macro to ensure that developer has given the --with-build-cc option when cross-compiling (report by Alexandre Campo). + improved configure script checks for _XOPEN_SOURCE and _POSIX_C_SOURCE (fix for IRIX 5.3 from Georg Schwarz, _POSIX_C_SOURCE updates from lynx). + cosmetic fix to test/gdc.c to recolor the bottom edge of the box for consistency (comment by Dan Nelson). 20041120 + update wsvt25 terminfo entry -TD + modify test/ins_wide.c to test all flavors of ins_wstr(). + ignore filler-cells in wadd_wchnstr() when adding a cchar_t array which consists of multi-column characters, since this function constructs them (cf: 20041023). + modify winnstr() to return multibyte character strings for the wide-character configuration. 20041106 + fixes to make slk_set() and slk_wset() accept and store multibyte or multicolumn characters. 20041030 + improve color optimization a little by making _nc_do_color() check if the old/new pairs are equivalent to the default pair 0. + modify assume_default_colors() to not require that use_default_colors() be called first. 20041023 + modify term_attrs() to use termattrs(), add the extended attributes such as enter_horizontal_hl_mode for WA_HORIZONTAL to term_attrs(). + add logic in waddch_literal() to clear orphaned cells when one multi-column character partly overwrites another. + improved logic for clearing cells when a multi-column character must be wrapped to a new line. + revise storage of cells for multi-column characters to correct a problem with repainting. In the old scheme, it was possible for doupdate() to decide that only part of a multi-column character should be repainted since the filler cells stored only an attribute to denote them as fillers, rather than the character value and the attribute. 20041016 + minor fixes for traces. + add SP->_screen_acs_map[], used to ensure that mapping of missing line-drawing characters is handled properly. For example, ACS_DARROW is absent from xterm-new, and it was coincidentally displayed the same as ACS_BTEE. 20041009 + amend 20021221 workaround for broken acs to reset the sgr, rmacs and smacs strings as well. Also modify the check for screen's limitations in that area to allow the multi-character shift-in and shift-out which seem to work. + change GPM initialization, using dl library to load it dynamically at runtime (Debian #110586). 20041002 + correct logic for color pair in setcchar() and getcchar() (patch by Marcin 'Qrczak' Kowalczyk). + add t/T commands to ncurses b/B tests to allow a different color to be tested for the attrset part of the test than is used in the background color. 20040925 + fix to make setcchar() to work when its wchar_t* parameter is pointing to a string which contains more data than can be converted. + modify wget_wstr() and example in ncurses.c to work if wchar_t and wint_t are different sizes (report by Marcin 'Qrczak' Kowalczyk). 20040918 + remove check in wget_wch() added to fix an infinite loop, appears to have been working around a transitory glibc bug, and interferes with normal operation (report by Marcin 'Qrczak' Kowalczyk). + correct wadd_wch() and wecho_wch(), which did not pass the rendition information (report by Marcin 'Qrczak' Kowalczyk). + fix aclocal.m4 so that the wide-character version of ncurses gets compiled as libncursesw.5.dylib, instead of libncurses.5w.dylib (adapted from patch by James J Ramsey). + change configure script for --with-caps option to indicate that it is no longer experimental. + change configure script to reflect the fact that --enable-widec has not been "experimental" since 5.3 (report by Bruno Lustosa). 20040911 + add 'B' test to ncurses.c, to exercise some wide-character functions. 20040828 + modify infocmp -i option to match 8-bit controls against its table). + modified configure script CF_XOPEN_SOURCE macro to ensure that if it defines _POSIX_C_SOURCE, that it defines it to a specific value (comp.os.stratus newsgroup comment). 20040821 + fixes to build with Ada95 binding with gnat 3.4 (all warnings are fatal, and gnat does not follow the guidelines for pragmas). However that did find a coding error in Assume_Default_Colors(). + modify several terminfo entries to ensure xterm mouse and cursor visibility are reset in rs2 string: hurd, putty, gnome, konsole-base, mlterm, Eterm, screen (Debian #265784, #55637). The xterm entries are left alone - old ones for compatibility, and the new ones do not require this change. -TD 20040814 + fake a SIGWINCH in newterm() to accommodate buggy terminal emulators and window managers (Debian #265631). > terminfo updates -TD + remove dch/dch1 from rxvt because they are implemented inconsistently with the common usage of bce/ech + remove khome from vt220 (vt220's have no home key) + add rxvt+pcfkeys 20040807 + modify test/ncurses.c 'b' test, adding v/V toggles to cycle through combinations of video attributes so that for instance bold and underline can be tested. This made the legend too crowded, added a help window as well. + modify test/ncurses.c 'b' test to cycle through default colors if the -d option is set. + update putty terminfo entry (Robert de Bath). 20040731 + modify test/cardfile.c to allow it to read more data than can be displayed. + correct logic in resizeterm.c which kept it from processing all levels of window hierarchy (reports by Folkert van Heusden, Chris Share). 20040724 +) > terminfo updates -TD + make ncsa-m rmacs/smacs consistent with sgr + add sgr, rc/sc and ech to syscons entries + add function-keys to decansi + add sgr to mterm-ansi + add sgr, civis, cnorm to emu + correct/simplify cup in addrinfo 20040717 > terminfo updates -TD + add xterm-pc-fkeys + review/update gnome and gnome-rh90 entries (prompted by Redhat Bugzilla #122815). + review/update konsole entries + add sgr, correct sgr0 for kterm and mlterm + correct tsl string in kterm 20040711 + add configure option --without-xterm-new 20040710 + add check in wget_wch() for printable bytes that are not part of a multibyte character. + modify wadd_wchnstr() to render text using window's background attributes. + improve tic's check to compare sgr and sgr0. + fix c++ directory's .cc.i rule. + modify logic in tgetent() which adjusts the termcap "me" string to work with ISO-2022 string used in xterm-new (cf: 20010908). + modify tic's check for conflicting function keys to omit that if converting termcap to termcap format. + add -U option to tic and infocmp. + add rmam/smam to linux terminfo entry (Trevor Van Bremen) > terminfo updates -TD + minor fixes for emu + add emu-220 + change wyse acsc strings to use 'i' map rather than 'I' + fixes for avatar0 + fixes for vp3a+ 20040703 + use tic -x to install terminfo database -TD + add -x to infocmp's usage message. + correct field used for comparing O_ROWMAJOR in set_menu_format() (report/patch by Tony Li). + fix a missing nul check in set_field_buffer() from 20040508 changes. > terminfo updates -TD + make xterm-xf86-v43 derived from xterm-xf86-v40 rather than xterm-basic -TD + align with xterm patch #192's use of xterm-new -TD + update xterm-new and xterm-8bit for cvvis/cnorm strings -TD + make xterm-new the default "xterm" entry -TD 20040626 + correct BUILD_CPPFLAGS substitution in ncurses/Makefile.in, to allow cross-compiling from a separate directory tree (report/patch by Dan Engel). + modify is_term_resized() to ensure that window sizes are nonzero, as documented in the manpage (report by Ian Collier). + modify CF_XOPEN_SOURCE configure macro to make Hurd port build (Debian #249214, report/patch by Jeff Bailey). + configure-script mods from xterm, e.g., updates to CF_ADD_CFLAGS + update config.guess, config.sub > terminfo updates -TD + add mlterm + add xterm-xf86-v44 + modify xterm-new aka xterm-xfree86 to accommodate luit, which relies on G1 being used via an ISO-2022 escape sequence (report by Juliusz Chroboczek) + add 'hurd' entry 20040619 + reconsidered winsnstr(), decided after comparing other implementations that wrapping is an X/Open documentation error. + modify test/inserts.c to test all flavors of insstr(). 20040605 + add setlocale() calls to a few test programs which may require it: demo_forms.c, filter.c, ins_wide.c, inserts.c + correct a few misspelled function names in ncurses-intro.html (report by Tony Li). + correct internal name of key_defined() manpage, which conflicted with define_key(). 20040529 + correct size of internal pad used for holding wide-character field_buffer() results. + modify data_ahead() to work with wide-characters. 20040522 + improve description of terminfo if-then-else expressions (suggested by Arne Thomassen). + improve test/ncurses.c 'd' test, allow it to use external file for initial palette (added xterm-16color.dat and linux-color.dat), and reset colors to the initial palette when starting/ending the test. + change limit-check in init_color() to allow r/g/b component to reach 1000 (cf: 20020928). 20040516 + modify form library to use cchar_t's rather than char's in the wide-character configuration for storing data for field buffers. + correct logic of win_wchnstr(), which did not work for more than one cell. 20040508 + replace memset/memcpy usage in form library with for-loops to simplify changing the datatype of FIELD.buf, part of wide-character changes. + fix some inconsistent use of #if/#ifdef (report by Alain Guibert). 20040501 + modify menu library to account for actual number of columns used by multibyte character strings, in the wide-character configuration (adapted from patch by Philipp Tomsich). + add "-x" option to infocmp like tic's "-x", for use in "-F" comparisons. This modifies infocmp to only report extended capabilities if the -x option is given, making this more consistent with tic. Some scripts may break, since infocmp previous gave this information without an option. + modify termcap-parsing to retain 2-character aliases at the beginning of an entry if the "-x" option is used in tic. 20040424 + minor compiler-warning and test-program fixes. 20040417 + modify tic's missing-sgr warning to apply to terminfo only. + free some memory leaks in tic. + remove check in post_menu() that prevented menus from extending beyond the screen (request by Max J. Werner). + remove check in newwin() that prevents allocating windows that extend beyond the screen. Solaris curses does this. + add ifdef in test/color_set.c to allow it to compile with older curses. + add napms() calls to test/dots.c to make it not be a CPU hog. 20040403 + modify unctrl() to return null if its parameter does not correspond to an unsigned char. + add some limit-checks to guard isprint(), etc., from being used on values that do not fit into an unsigned char (report by Sami Farin). 20040328 + fix a typo in the _nc_get_locale() change. 20040327 + modify _nc_get_locale() to use setlocale() to query the program's current locale rather than using getenv(). This fixes a case in tin which relies on legacy treatment of 8-bit characters when the locale is not initialized (reported by Urs Jansen). + add sgr string to screen's and rxvt's terminfo entries -TD. + add a check in tic for terminfo entries having an sgr0 but no sgr string. This confuses Tru64 and HPUX curses when combined with color, e.g., making them leave line-drawing characters in odd places. + correct casts used in ABSENT_BOOLEAN, CANCELLED_BOOLEAN, matches the original definitions used in Debian package to fix PowerPC bug before 20030802 (Debian #237629). 20040320 + modify PutAttrChar() and PUTC() macro to improve use of A_ALTCHARSET attribute to prevent line-drawing characters from being lost in situations where the locale would otherwise treat the raw data as nonprintable (Debian #227879). 20040313 + fix a redefinition of CTRL() macro in test/view.c for AIX 5.2 (report by Jim Idle). + remove ".PP" after ".SH NAME" in a few manpages; this confuses some apropos script (Debian #237831). 20040306 + modify ncurses.c 'r' test so editing commands, like inserted text, set the field background, and the state of insert/overlay editing mode is shown in that test. + change syntax of dummy targets in Ada95 makefiles to work with pmake. + correct logic in test/ncurses.c 'b' for noncolor terminals which did not recognize a quit-command (cf: 20030419). 20040228 + modify _nc_insert_ch() to allow for its input to be part of a multibyte string. + split out lib_insnstr.c, to prepare to rewrite it. X/Open states that this function performs wrapping, unlike all of the other insert-functions. Currently it does not wrap. + check for nl_langinfo(CODESET), use it if available (report by Stanislav Ievlev). + split-out CF_BUILD_CC macro, actually did this for lynx first. + fixes for configure script CF_WITH_DBMALLOC and CF_WITH_DMALLOC, which happened to work with bash, but not with Bourne shell (report by Marco d'Itri via tin-dev). 20040221 + some changes to adapt the form library to wide characters, incomplete (request by Mike Aubury). + add symbol to curses.h which can be used to suppress include of stdbool.h, e.g., #define NCURSES_ENABLE_STDBOOL_H 0 #include <curses.h> (discussion on XFree86 mailing list). 20040214 + modify configure --with-termlib option to accept a value which sets the name of the terminfo library. This would allow a packager to build libtinfow.so renamed to coincide with libtinfo.so (discussion with Stanislav Ievlev). + improve documentation of --with-install-prefix, --prefix and $(DESTDIR) in INSTALL (prompted by discussion with Paul Lew). + add configure check if the compiler can use -c -o options to rename its output file, use that to omit the 'cd' command which was used to ensure object files are created in a separate staging directory (prompted by comments by Johnny Wezel, Martin Mokrejs). 20040208 5.4 release for upload to + update TO-DO. 20040207 pre-release + minor fixes to _nc_tparm_analyze(), i.e., do not count %i as a param, and do not count %d if it follows a %p. + correct an inconsistency between handling of codes in the 128-255 range, e.g., as illustrated by test/ncurses.c f/F tests. In POSIX locale, the latter did not show printable results, while the former did. + modify MKlib_gen.sh to compensate for broken C preprocessor on Mac OS X, which alters "%%" to "% % " (report by Robert Simms, fix verified by Scott Corscadden). 20040131 pre-release + modify SCREEN struct to align it between normal/wide curses flavors to simplify future changes to build a single version of libtinfo (patch by Stanislav Ievlev). + document handling of carriage return by addch() in manpage. + document special features of unctrl() in manpage. + documented interface changes in INSTALL. + corrected control-char test in lib_addch.c to account for locale (Debian #230335, cf: 971206). + updated test/configure.in to use AC_EXEEXT and AC_OBJEXT. + fixes to compile Ada95 binding with Debian gnat 3.15p-4 package. + minor configure-script fixes for older ports, e.g., BeOS R4.5. 20040125 pre-release + amend change to PutAttrChar() from 20030614 which computed the number of cells for a possibly multi-cell character. The 20030614 change forced the cell to a blank if the result from wcwidth() was not greater than zero. However, wcwidth() called for parameters in the range 128-255 can give this return value. The logic now simply ensures that the number of cells is greater than zero without modifying the displayed value. 20040124 pre-release + looked good for 5.4 release for upload to (but see above) + modify configure script check for ranlib to use AC_CHECK_TOOL, since that works better for cross-compiling. 20040117 pre-release + modify lib_get_wch.c to prefer mblen/mbtowc over mbrlen/mbrtowc to work around core dump in Solaris 8's locale support, e.g., for zh_CN.GB18030 (report by Saravanan Bellan). + add includes for <stdarg.h> and <stdio.h> in configure script macro to make <wchar.h> check work with Tru64 4.0d. + add terminfo entry for U/Win -TD + add terminfo entries for SFU aka Interix aka OpenNT (Federico Bianchi). + modify tput's error messages to prefix them with the program name (report by Vincent Lefevre, patch by Daniel Jacobowitz (see Debian #227586)). + correct a place in tack where exit_standout_mode was used instead of exit_attribute_mode (patch by Jochen Voss (see Debian #224443)). + modify c++/cursesf.h to use const in the Enumeration_Field method. + remove an ambiguous (actually redundant) method from c++/cursesf.h + make $HOME/.terminfo update optional (suggested by Stanislav Ievlev). + improve sed script which extracts libtool's version in the CF_WITH_LIBTOOL macro. + add ifdef'd call to AC_PROG_LIBTOOL to CF_WITH_LIBTOOL macro (to simplify local patch for Albert Chin-A-Young).. + add $(CXXFLAGS) to link command in c++/Makefile.in (adapted from patch by Albert Chin-A-Young).. + fix a missing substitution in configure.in for "$target" needed for HPUX .so/.sl case. + resync CF_XOPEN_SOURCE configure macro with lynx; fixes IRIX64 and NetBSD 1.6 conflicts with _XOPEN_SOURCE. + make check for stdbool.h more specific, to ensure that including it will actually define/declare bool for the configured compiler. + rewrite ifdef's in curses.h relating NCURSES_BOOL and bool. The intention of that is to #define NCURSES_BOOL as bool when the compiler declares bool, and to #define bool as NCURSES_BOOL when it does not (reported by Jim Gifford, Sam Varshavchik, cf: 20031213). 20040110 pre-release + change minor version to 4, i.e., ncurses 5.4 + revised/improved terminfo entries for tvi912b, tvi920b (Benjamin C W Sittler). + simplified ncurses/base/version.c by defining the result from the configure script rather than using sprintf (suggested by Stanislav Ievlev). + remove obsolete casts from c++/cursesw.h (reported by Stanislav Ievlev). + modify configure script so that when configuring for termlib, programs such as tic are not linked with the upper-level ncurses library (suggested by Stanislav Ievlev). + move version.c from ncurses/base to ncurses/tinfo to allow linking of tic, etc., using libtinfo (suggested by Stanislav Ievlev). 20040103 + adjust -D's to build ncursesw on OpenBSD. + modify CF_PROG_EXT to make OS/2 build with EXEEXT. + add pecho_wchar(). + remove <wctype.h> include from lib_slk_wset.c which is not needed (or available) on older platforms. 20031227 + add -D's to build ncursew on FreeBSD 5.1. + modify shared library configuration for FreeBSD 4.x/5.x to add the soname information (request by Marc Glisse). + modify _nc_read_tic_entry() to not use MAX_ALIAS, but PATH_MAX only for limiting the length of a filename in the terminfo database. + modify termname() to return the terminal name used by setupterm() rather than $TERM, without truncating to 14 characters as documented by X/Open (report by Stanislav Ievlev, cf: 970719). + re-add definition for _BSD_TYPES, lost in merge (cf: 20031206). 20031220 + add configure option --with-manpage-format=catonly to address behavior of BSDI, allow install of man+cat files on NetBSD, whose behavior has diverged by requiring both to be present. + remove leading blanks from comment-lines in manlinks.sed script to work with Tru64 4.0d. + add screen.linux terminfo entry (discussion on mutt-users mailing list). 20031213 + add a check for tic to flag missing backslashes for termcap continuation lines. ncurses reads the whole entry, but termcap applications do not. + add configure option "--with-manpage-aliases" extending "--with-manpage-aliases" to provide the option of generating ".so" files rather than symbolic links for manpage aliases. + add bool definition in include/curses.h.in for configurations with no usable C++ compiler (cf: 20030607). + fix pathname of SigAction.h for building with --srcdir (reported by Mike Castle). 20031206 + folded ncurses/base/sigaction.c into includes of ncurses/SigAction.h, since that header is used only within ncurses/tty/lib_tstp.c, for non-POSIX systems (discussion with Stanislav Ievlev). + remove obsolete _nc_outstr() function (report by Stanislav Ievlev <inger@altlinux.org>). + add test/background.c and test/color_set.c + modify color_set() function to work with color pair 0 (report by George Andreou <gbandreo@tem.uoc.gr>). + add configure option --with-trace, since defining TRACE seems too awkward for some cases. + remove a call to _nc_free_termtype() from read_termtype(), since the corresponding buffer contents were already zeroed by a memset (cf: 20000101). + improve configure check for _XOPEN_SOURCE and related definitions, adding special cases for Solaris' __EXTENSIONS__ and FreeBSD's __BSD_TYPES (reports by Marc Glisse <marc.glisse@normalesup.org>). + small fixes to compile on Solaris and IRIX64 using cc. + correct typo in check for pre-POSIX sort options in MKkey_defs.sh (cf: 20031101). 20031129 + modify _nc_gettime() to avoid a problem with arithmetic on unsigned values (Philippe Blain). + improve the nanosleep() logic in napms() by checking for EINTR and restarting (Philippe Blain). + correct expression for "%D" in lib_tgoto.c (Juha Jarvi <mooz@welho.com>). 20031122 + add linux-vt terminfo entry (Andrey V Lukyanov <land@long.yar.ru>). + allow "\|" escape in terminfo; tic should not warn about this. + save the full pathname of the trace-file the first time it is opened, to avoid creating it in different directories if the application opens and closes it while changing its working directory. + modify configure script to provide a non-empty default for $BROKEN_LINKER 20031108 + add DJGPP to special case of DOS-style drive letters potentially appearing in TERMCAP environment variable. + fix some spelling in comments (reports by Jason McIntyre, Jonathon Gray). + update config.guess, config.sub 20031101 + fix a memory leak in error-return from setupterm() (report by Stanislav Ievlev <inger@altlinux.org>). + use EXEEXT and OBJEXT consistently in makefiles. + amend fixes for cross-compiling to use separate executable-suffix BUILD_EXEEXT (cf: 20031018). + modify MKkey_defs.sh to check for sort utility that does not recognize key options, e.g., busybox (report by Peter S Mazinger <ps.m@gmx.net>). + fix potential out-of-bounds indexing in _nc_infotocap() (found by David Krause using some of the new malloc debugging features under OpenBSD, patch by Ted Unangst). + modify CF_LIB_SUFFIX for Itanium releases of HP-UX, which use a ".so" suffix (patch by Jonathan Ward <Jonathan.Ward@hp.com>). 20031025 + update terminfo for xterm-xfree86 -TD + add check for multiple "tc=" clauses in a termcap to tic. + check for missing op/oc in tic. + correct _nc_resolve_uses() and _nc_merge_entry() to allow infocmp and tic to show cancelled capabilities. These functions were ignoring the state of the target entry, which should be untouched if cancelled. + correct comment in tack/output.c (Debian #215806). + add some null-pointer checks to lib_options.c (report by Michael Bienia). + regenerated html documentation. + correction to tar-copy.sh, remove a trap command that resulted in leaving temporary files (cf: 20030510). + remove contact/maintainer addresses for Juergen Pfeifer (his request). 20031018 + updated test/configure to reflect changes for libtool (cf: 20030830). + fix several places in tack/pad.c which tested and used the parameter- and parameterless strings inconsistently, i.e., in pad_rin(), pad_il(), pad_indn() and pad_dl() (Debian #215805). + minor fixes for configure script and makefiles to cleanup executables generated when cross-compiling for DJGPP. + modify infocmp to omit check for $TERM for operations that do not require it, e.g., "infocmp -e" used to build fallback list (report by Koblinger Egmont). 20031004 + add terminfo entries for DJGPP. + updated note about maintainer in ncurses-intro.html 20030927 + update terminfo entries for gnome terminal. + modify tack to reset colors after each color test, correct a place where exit_standout_mode was used instead of exit_attribute_mode. + improve tack's bce test by making it set colors other than black on white. + plug a potential recursion between napms() and _nc_timed_wait() (report by Philippe Blain). 20030920 + add --with-rel-version option to allow workaround to allow making libtool on Darwin generate the "same" library names as with the --with-shared option. The Darwin ld program does not work well with a zero as the minor-version value (request by Chris Zubrzycki). + modify CF_MIXEDCASE_FILENAMES macro to work with cross-compiling. + modify tack to allow it to run from fallback terminfo data. > patch by Philippe Blain: + improve PutRange() by adjusting call to EmitRange() and corresponding return-value to not emit unchanged characters on the end of the range. + improve a check for changed-attribute by exiting a loop when the change is found. + improve logic in TransformLine(), eliminating a duplicated comparison in the clr_bol logic. 20030913 > patch by Philippe Blain: + in ncurses/tty/lib_mvcur.c, move the label 'nonlocal' just before the second gettimeofday() to be able to compute the diff time when 'goto nonlocal' used. Rename 'msec' to 'microsec' in the debug-message. + in ncurses/tty/lib_mvcur.c, Use _nc_outch() in carriage return/newline movement instead of putchar() which goes to stdout. Move test for xold>0 out of loop. + in ncurses/tinfo/setbuf.c, Set the flag SP->_buffered at the end of operations when all has been successful (typeMalloc can fail). + simplify NC_BUFFERED macro by moving check inside _nc_setbuf(). 20030906 + modify configure script to avoid using "head -1", which does not work if POSIXLY_CORRECT (sic) is set. + modify run_tic.in to avoid using wrong shared libraries when cross-compiling (Dan Kegel). 20030830 + alter configure script help message to make it clearer that --with-build-cc does not specify a cross-compiler (suggested by Dan Kegel <dank@kegel.com>). + modify configure script to accommodate libtool 1.5, as well as add an parameter to the "--with-libtool" option which can specify the pathname of libtool (report by Chris Zubrzycki). We note that libtool 1.5 has more than one bug in its C++ support, so it is not able to install libncurses++, for instance, if $DESTDIR or the option --with-install-prefix is used. 20030823 > patch by Philippe Blain: + move assignments to SP->_cursrow, SP->_curscol into online_mvcur(). + make baudrate computation in delay_output() consistent with the assumption in _nc_mvcur_init(), i.e., a byte is 9 bits. 20030816 + modify logic in waddch_literal() to take into account zh_TW.Big5 whose multibyte sequences may contain "printable" characters, e.g., a "g" in the sequence "\247g" (Debian #204889, cf: 20030621). + improve storage used by _nc_safe_strcpy() by ensuring that the size is reset based on the initialization call, in case it were called after other strcpy/strcat calls (report by Philippe Blain). > patch by Philippe Blain: + remove an unused ifdef for REAL_ATTR & WANT_CHAR + correct a place where _cup_cost was used rather than _cuu_cost 20030809 + fix a small memory leak in _nc_free_termtype(). + close trace-file if trace() is called with a zero parameter. + free memory allocated for soft-key strings, in delscreen(). + fix an allocation size in safe_sprintf.c for the "*" format code. + correct safe_sprintf.c to not return a null pointer if the format happens to be an empty string. This applies to the "configure --enable-safe-sprintf" option (Redhat #101486). 20030802 + modify casts used for ABSENT_BOOLEAN and CANCELLED_BOOLEAN (report by Daniel Jacobowitz). > patch by Philippe Blain: + change padding for change_scroll_region to not be proportional to the size of the scroll-region. + correct error-return in _nc_safe_strcat(). 20030726 + correct limit-checks in _nc_scroll_window() (report and test-case by Thomas Graf <graf@dms.at> cf: 20011020). + re-order configure checks for _XOPEN_SOURCE to avoid conflict with _GNU_SOURCE check. 20030719 + use clr_eol in preference to blanks for bce terminals, so select and paste will have fewer trailing blanks, e.g., when using xterm (request by Vincent Lefevre). + correct prototype for wunctrl() in manpage. + add configure --with-abi-version option (discussion with Charles Wilson). > cygwin changes from Charles Wilson: + aclocal.m4: on cygwin, use autodetected prefix for import and static lib, but use "cyg" for DLL. + include/ncurses_dll.h: correct the comments to reflect current status of cygwin/mingw port. Fix compiler warning. + misc/run_tic.in: ensure that tic.exe can find the uninstalled DLL, by adding the lib-directory to the PATH variable. + misc/terminfo.src (nxterm|xterm-color): make xterm-color primary instead of nxterm, to match XFree86's xterm.terminfo usage and to prevent circular links. (rxvt): add additional codes from rxvt.org. (rxvt-color): new alias (rxvt-xpm): new alias (rxvt-cygwin): like rxvt, but with special acsc codes. (rxvt-cygwin-native): ditto. rxvt may be run under XWindows, or with a "native" MSWin GUI. Each takes different acsc codes, which are both different from the "normal" rxvt's acsc. (cygwin): cygwin-in-cmd.exe window. Lots of fixes. (cygwinDBG): ditto. + mk-1st.awk: use "cyg" for the DLL prefix, but "lib" for import and static libs. 20030712 + update config.guess, config.sub + add triples for configuring shared libraries with the Debian GNU/FreeBSD packages (patch by Robert Millan <zeratul2@wanadoo.es>). 20030705 + modify CF_GCC_WARNINGS so it only applies to gcc, not g++. Some platforms have installed g++ along with the native C compiler, which would not accept gcc warning options. + add -D_XOPEN_SOURCE=500 when configuring with --enable-widec, to get mbstate_t declaration on HPUX 11.11 (report by David Ellement). + add _nc_pathlast() to get rid of casts in _nc_basename() calls. + correct a sign-extension in wadd_wch() and wecho_wchar() from 20030628 (report by Tomohiro Kubota). + work around omission of btowc() and wctob() from wide-character support (sic) in NetBSD 1.6 using mbtowc() and wctomb() (report by Gabor Z Papp). + add portability note to curs_get_wstr.3x (Debian #199957). 20030628 + rewrite wadd_wch() and wecho_wchar() to call waddch() and wechochar() respectively, to avoid calling waddch_noecho() with wide-character data, since that function assumes its input is 8-bit data. Similarly, modify waddnwstr() to call wadd_wch(). + remove logic from waddnstr() which transformed multibyte character strings into wide-characters. Rewrite of waddch_literal() from 20030621 assumes its input is raw multibyte data rather than wide characters (report by Tomohiro Kubota). 20030621 + write getyx() and related 2-return macros in terms of getcury(), getcurx(), etc. + modify waddch_literal() in case an application passes bytes of a multibyte character directly to waddch(). In this case, waddch() must reassemble the bytes into a wide-character (report by Tomohiro Kubota <kubota@debian.org>). 20030614 + modify waddch_literal() in case a multibyte value occupies more than two cells. + modify PutAttrChar() to compute the number of character cells that are used in multibyte values. This fixes a problem displaying double-width characters (report/test by Mitsuru Chinen <mchinen@yamato.ibm.com>). + add a null-pointer check for result of keyname() in _tracechar() + modify _tracechar() to work around glibc sprintf bug. 20030607 + add a call to setlocale() in cursesmain.cc, making demo display properly in a UTF-8 locale. + add a fallback definition in curses.priv.h for MB_LEN_MAX (prompted by discussion with Gabor Z Papp). + use macros NCURSES_ACS() and NCURSES_WACS() to hide cast needed to appease -Wchar-subscript with g++ 3.3 (Debian #195732). + fix a redefinition of $RANLIB in the configure script when libtool is used, which broke configure on Mac OS X (report by Chris Zubrzycki <beren@mac.com>). + simplify ifdef for bool declaration in curses.h.in (suggested by Albert Chin-A-Young). + remove configure script check to allow -Wconversion for older versions of gcc (suggested by Albert Chin-A-Young). 20030531 + regenerated html manpages. + modify ifdef's in curses.h.in that disabled use of __attribute__() for g++, since recent versions implement the cases which ncurses uses (Debian #195230). + modify _nc_get_token() to handle a case where an entry has no description, and capabilities begin on the same line as the entry name. + fix a typo in ncurses_dll.h reported by gcc 3.3. + add an entry for key_defined.3x to man_db.renames. 20030524 + modify setcchar() to allow converting control characters to complex characters (report/test by Mitsuru Chinen <mchinen@yamato.ibm.com>). + add tkterm entry -TD + modify parse_entry.c to allow a terminfo entry with a leading 2-character name (report by Don Libes). + corrected acsc in screen.teraterm, which requires a PC-style mapping. + fix trace statements in read_entry.c to use lseek() rather than tell(). + fix signed/unsigned warnings from Sun's compiler (gcc should give these warnings, but it is unpredictable). + modify configure script to omit -Winline for gcc 3.3, since that feature is broken. + modify manlinks.sed to add a few functions that were overlooked since they return function pointers: field_init, field_term, form_init, form_term, item_init, item_term, menu_init and menu_term. 20030517 + prevent recursion in wgetch() via wgetnstr() if the connection cannot be switched between cooked/raw modes because it is not a TTY (report by Wolfgang Gutjahr <gutw@knapp.com>). + change parameter of define_key() and key_defined() to const (prompted by Debian #192860). + add a check in test/configure for ncurses extensions, since there are some older versions, etc., which would not compile with the current test programs. + corrected demo in test/ncurses.c of wgetn_wstr(), which did not convert wchar_t string to multibyte form before printing it. + corrections to lib_get_wstr.c: + null-terminate buffer passed to setcchar(), which occasionally failed. + map special characters such as erase- and kill-characters into key-codes so those will work as expected even if they are not mentioned in the terminfo. + modify PUTC() and Charable() macros to make wide-character line drawing work for POSIX locale on Linux console (cf: 20021221). 20030510 + make typography for program options in manpages consistent (report by Miloslav Trmac <mitr@volny.cz>). + correct dependencies in Ada95/src/Makefile.in, so the builds with "--srcdir" work (report by Warren L Dodge). + correct missing definition of $(CC) in Ada95/gen/Makefile.in (reported by Warren L Dodge <warrend@mdhost.cse.tek.com>). + fix typos and whitespace in manpages (patch by Jason McIntyre <jmc@prioris.mini.pw.edu.pl>). 20030503 + fix form_driver() cases for REQ_CLR_EOF, REQ_CLR_EOL, REQ_DEL_CHAR, REQ_DEL_PREV and REQ_NEW_LINE, which did not ensure the cursor was at the editing position before making modifications. + add test/demo_forms and associated test/edit_field.c demos. + modify test/configure.in to use test/modules for the list of objects to compile rather than using the list of programs. 20030419 + modify logic of acsc to use the original character if no mapping is defined, noting that Solaris does this. + modify ncurses 'b' test to avoid using the acs_map[] array since 20021231 changes it to no longer contain information from the acsc string. + modify makefile rules in c++, progs, tack and test to ensure that the compiler flags (e.g., $CFLAGS or $CCFLAGS) are used in the link command (report by Jose Luis Rico Botella <informatica@serpis.com>). + modify soft-key initialization to use A_REVERSE if A_STANDOUT would not be shown when colors are used, i.e., if ncv#1 is set in the terminfo as is done in "screen". 20030412 + add a test for slk_color(), in ncurses.c + fix some issues reported by valgrind in the slk_set() and slk_wset() code, from recent rewrite. + modify ncurses 'E' test to use show previous label via slk_label(), as in 'e' test. + modify wide-character versions of NewChar(), NewChar2() macros to ensure that the whole struct is initialized. 20030405 + modify setupterm() to check if the terminfo and terminal-modes have already been read. This ensures that it does not reinvoke def_prog_mode() when an application calls more than one function, such as tgetent() and initscr() (report by Olaf Buddenhagen). 20030329 + add 'E' test to ncurses.c, to exercise slk_wset(). + correct handling of carriage-return in wgetn_wstr(), used in demo of slk_wset(). + first draft of slk_wset() function. 20030322 + improved warnings in tic when suppressing items to fit in termcap's 1023-byte limit. + built a list in test/README showing which externals are being used by either programs in the test-directory or via internal library calls. + adjust include-options in CF_ETIP_DEFINES to avoid missing ncurses_dll.h, fixing special definitions that may be needed for etip.h (reported by Greg Schafer <gschafer@zip.com.au>). 20030315 + minor fixes for cardfile.c, to make it write the updated fields to a file when ^W is given. + add/use _nc_trace_bufcat() to eliminate some fixed buffer limits in trace code. 20030308 + correct a case in _nc_remove_string(), used by define_key(), to avoid infinite loop if the given string happens to be a substring of other strings which are assigned to keys (report by John McCutchan). + add key_defined() function, to tell which keycode a string is bound to (discussion with John McCutchan <ttb@tentacle.dhs.org>). + correct keybound(), which reported definitions in the wrong table, i.e., the list of definitions which are disabled by keyok(). + modify demo_keydef.c to show the details it changes, and to check for errors. 20030301 + restructured test/configure script, make it work for libncursesw. + add description of link_fieldtype() to manpage (report by L Dee Holtsclaw <dee@sunbeltsoft.com>). 20030222 + corrected ifdef's relating to configure check for wchar_t, etc. + if the output is a socket or other non-tty device, use 1 millisecond for the cost in mvcur; previously it was 9 milliseconds because the baudrate was not known. + in _nc_get_tty_mode(), initialize the TTY buffer on error, since glibc copies uninitialized data in that case, as noted by valgrind. + modify tput to use the same parameter analysis as tparm() does, to provide for user-defined strings, e.g., for xterm title, a corresponding capability might be title=\E]2;%p1%s^G, + modify MKlib_gen.sh to avoid passing "#" tokens through the C preprocessor. This works around Mac OS X's preprocessor, which insists on adding a blank on each side of the token (report/analysis by Kevin Murphy <murphy@genome.chop.edu>). 20030215 + add configure check for wchar_t and wint_t types, rather than rely on preprocessor definitions. Also work around for gcc fixinclude bug which creates a shadow copy of curses.h if it sees these symbols apparently typedef'd. + if database is disabled, do not generate run_tic.sh + minor fixes for memory-leak checking when termcap is read. 20030208 + add checking in tic for incomplete line-drawing character mapping. + update configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by Gerben Wierda <Sherlock@rna.nl>). + make return value from _nc_printf_string() consistent. Before, depending on whether --enable-safe-sprintf was used, it might not be cached for reallocating. 20030201 + minor fixes for memory-leak checking in lib_tparm.c, hardscroll.c + correct a potentially-uninitialized value if _read_termtype() does not read as much data as expected (report by Wolfgang Rohdewald <wr6@uni.de>). + correct several places where the aclocal.m4 macros relied on cache variable names which were incompatible (as usual) between autoconf 2.13 and 2.5x, causing the test for broken-linker to give incorrect results (reports by Gerben Wierda <Sherlock@rna.nl> and Thomas Esser <te@dbs.uni-hannover.de>). + do not try to open gpm mouse driver if standard output is not a tty; the gpm library does not make this check (bug report for dialog by David Oliveira <davidoliveira@develop.prozone.ws>). 20030125 + modified emx.src to correspond more closely to terminfo.src, added emx-base to the latter -TD + add configure option for FreeBSD sysmouse, --with-sysmouse, and implement support for that in lib_mouse.c, lib_getch.c 20030118 + revert 20030105 change to can_clear_with(), does not work for the case where the update is made on cells which are blanks with attributes, e.g., reverse. + improve ifdef's to guard against redefinition of wchar_t and wint_t in curses.h (report by Urs Jansen). 20030111 + improve mvcur() by checking if it is safe to move when video attributes are set (msgr), and if not, reset/restore attributes within that function rather than doing it separately in the GoTo() function in tty_update.c (suggested by Philippe Blain). + add a message in run_tic.in to explain more clearly what does not work when attempting to create a symbolic link for /usr/lib/terminfo on OS/2 and other platforms with no symbolic links (report by John Polterak). + change several sed scripts to avoid using "\+" since it is not a BRE (basic regular expression). One instance caused terminfo.5 to be misformatted on FreeBSD (report by Kazuo Horikawa <horikawa@FreeBSD.org> (see FreeBSD docs/46709)). + correct misspelled 'wint_t' in curs_get_wch.3x (Michael Elkins). 20030105 + improve description of terminfo operators, especially static/dynamic variables (comments by Mark I Manning IV <mark4th@earthlink.net>). + demonstrate use of FIELDTYPE by modifying test/ncurses 'r' test to use the predefined TYPE_ALPHA field-type, and by defining a specialized type for the middle initial/name. + fix MKterminfo.sh, another workaround for POSIXLY_CORRECT misfeature of sed 4.0 > patch by Philippe Blain: + optimize can_clear_with() a little by testing first if the parameter is indeed a "blank". + simplify ClrBottom() a little by allowing it to use clr_eos to clear sections as small as one line. + improve ClrToEOL() by checking if clr_eos is available before trying to use it. + use tputs() rather than putp() in a few cases in tty_update.c since the corresponding delays are proportional to the number of lines affected: repeat_char, clr_eos, change_scroll_region. 20021231 + rewrite of lib_acs.c conflicts with copying of SCREEN acs_map to/from global acs_map[] array; removed the lines that did the copying. 20021228 + change some overlooked tputs() calls in scrolling code to use putp() (report by Philippe Blain). + modify lib_getch.c to avoid recursion via wgetnstr() when the input is not a tty and consequently mode-changes do not work (report by <R.Chamberlin@querix.com>). + rewrote lib_acs.c to allow PutAttrChar() to decide how to render alternate-characters, i.e., to work with Linux console and UTF-8 locale. + correct line/column reference in adjust_window(), needed to make special windows such as curscr track properly when resizing (report by Lucas Gonze <lgonze@panix.com>). > patch by Philippe Blain: + correct the value used for blank in ClrBottom() (broken in 20000708). + correct an off-by-one in GoTo() parameter in _nc_scrolln(). 20021221 + change several tputs() calls in scrolling code to use putp(), to enable padding which may be needed for some terminals (patch by Philippe Blain). + use '%' as sed substitute delimiter in run_tic script to avoid problems with pathname delimiters such as ':' and '@' (report by John Polterak). +. 20021214 + allow BUILD_CC and related configure script variables to be overridden from the environment. + make build-tools variables in ncurses/Makefile.in consistent with the configure script variables (report by Maciej W Rozycki). + modify ncurses/modules to allow configure --disable-leaks --disable-ext-funcs to build (report by Gary Samuelson). + fix a few places in configure.in which lacked quotes (report by Gary Samuelson <gary.samuelson@verizon.com>). + correct handling of multibyte characters in waddch_literal() which force wrapping because they are started too late on the line (report by Sam Varshavchik). + small fix for CF_GNAT_VERSION to ignore the help-message which gnatmake adds to its version-message. > Maciej W Rozycki <macro@ds2.pg.gda.pl>: + use AC_CHECK_TOOL to get proper values for AR and LD for cross compiling. + use $cross_compiling variable in configure script rather than comparing $host_alias and $target alias, since "host" is traditionally misused in autoconf to refer to the target platform. + change configure --help message to use "build" rather than "host" when referring to the --with-build-XXX options. 20021206 + modify CF_GNAT_VERSION to print gnatmake's version, and to allow for possible gnat versions such as 3.2 (report by Chris Lingard <chris@stockwith.co.uk>). + modify #define's for CKILL and other default control characters in tset to use the system's default values if they are defined. + correct interchanged defaults for kill and interrupt characters in tset, which caused it to report unnecessarily (Debian #171583). + repair check for missing C++ compiler, which is broken in autoconf 2.5x by hardcoding it to g++ (report by Martin Mokrejs). + update config.guess, config.sub (2002-11-30) + modify configure script to skip --with-shared, etc., when the --with-libtool option is given, since they would be ignored anyway. + fix to allow "configure --with-libtool --with-termlib" to build. + modify configure script to show version number of libtool, to help with bug reports. libtool still gets confused if the installed ncurses libraries are old, since it ignores the -L options at some point (tested with libtool 1.3.3 and 1.4.3). + reorder configure script's updating of $CPPFLAGS and $CFLAGS to prevent -I options in the user's environment from introducing conflicts with the build -I options (may be related to reports by Patrick Ash and George Goffe). + rename test/define_key.c to test/demo_defkey.c, test/keyok.c to test/demo_keyok.c to allow building these with libtool. 20021123 + add example program test/define_key.c for define_key(). + add example program test/keyok.c for keyok(). + add example program test/ins_wide.c for wins_wch() and wins_wstr(). + modify wins_wch() and wins_wstr() to interpret tabs by using the winsch() internal function. + modify setcchar() to allow for wchar_t input strings that have more than one spacing character. 20021116 + fix a boundary check in lib_insch.c (patch by Philippe Blain). + change type for *printw functions from NCURSES_CONST to const (prompted by comment by Pedro Palhoto Matos <plpm@mega.ist.utl.pt>, but really from a note on X/Open's website stating that either is acceptable, and the latter will be used in a future revision). + add xterm-1002, xterm-1003 terminfo entries to demonstrate changes in lib_mouse.c (20021026) -TD + add screen-bce, screen-s entries from screen 3.9.13 (report by Adam Lazur <zal@debian.org>) -TD + add mterm terminfo entries -TD 20021109 + split-out useful fragments in terminfo for vt100 and vt220 numeric keypad, i.e., vt100+keypad, vt100+pfkeys, vt100+fnkeys and vt220+keypad. The last as embedded in various entries had ka3 and kb2 interchanged (report/discussion with Leonard den Ottolander <leonardjo@hetnet.nl>). + add check in tic for keypads consistent with vt100 layout. + improve checks in tic for color capabilities 20021102 + check for missing/empty/illegal terminfo name in _nc_read_entry() (report by Martin Mokrejs, where $TERM was set to an empty string). + rewrote lib_insch.c, combining it with lib_insstr.c so both handle tab and other control characters consistently (report by Philippe Blain). + remove an #undef for KEY_EVENT from curses.tail used in the experimental NCURSES_WGETCH_EVENTS feature. The #undef confuses dpkg's build script (Debian #165897). + fix MKlib_gen.sh, working around the ironically named POSIXLY_CORRECT feature of GNU sed 4.0 (reported by Ervin Nemeth <airwin@inf.bme.hu>). 20021026 + implement logic in lib_mouse.c to handle position reports which are generated when XFree86 xterm is initialized with private modes 1002 or 1003. These are returned to the application as the REPORT_MOUSE_POSITION mask, which was not implemented. Tested both with ncurses 'a' menu (prompted by discussion with Larry Riedel <Larry@Riedel.org>). + modify lib_mouse.c to look for "XM" terminfo string, which allows one to override the escape sequence used to enable/disable mouse mode. In particular this works for XFree86 xterm private modes 1002 and 1003. If "XM" is missing (note that this is an extended name), lib_mouse uses the conventional private mode 1000. + correct NOT_LOCAL() macro in lib_mvcur.c to refer to screen_columns where it used screen_lines (report by Philippe Blain). + correct makefile rules for the case when both --with-libtool and --with-gpm are given (report by Mr E_T <troll@logi.net.au>). + add note to terminfo manpage regarding the differences between setaf/setab and setf/setb capabilities (report by Pavel Roskin). 20021019 + remove redundant initialization of TABSIZE in newterm(), since it is already done in setupterm() (report by Philippe Blain). + add test/inserts.c, to test winnstr() and winsch(). + replace 'sort' in dist.mk with script that sets locale to POSIX. + update URLs in announce.html.in (patch by Frederic L W Meunier). + remove glibc add-on files, which are no longer needed (report by Frederic L W Meunier). 20021012 5.3 release for upload to + modify ifdef's in etip.h.in to allow the etip.h header to compile with gcc 3.2 (patch by Dimitar Zhekov <jimmy@is-vn.bg>). + add logic to setupterm() to make it like initscr() and newterm(), by checking for $NCURSES_TRACE environment variable and enabling the debug trace in that case. + modify setupterm() to ensure that it initializes the baudrate, for applications such as tput (report by Frank Henigman). + modify definition of bits used for command-line and library debug traces to avoid overlap, using new definition TRACE_SHIFT to relate the two. + document tput's interpretation of parameterized strings according to whether parameters are given, etc. (discussion with Robert De Bath). 20021005 pre-release + correct winnwstr() to account for non-character cells generated when a double-width character is added (report by Michael Bienia <michael@vorlon.ping.de>). + modify _nc_viswbuf2n() to provide better results using wctomb(). + correct logic in _nc_varargs() which broke tracing of parameters for formats such as "%.*s". + correct scale factor in linux-c and linux-c-nc terminfo entries (report Floyd Davidson). + change tic -A option to -t, add the same option to infocmp for consistency. + correct "%c" implementation in lib_tparm.c, which did not map a null character to a 128 (cf: 980620) (patch by Frank Henigman <fjhenigman@mud.cgl.uwaterloo.ca>). 20020928 pre-release + modify MKkey_defs.sh to check for POSIX sort -k option, use that if it is found, to accommodate newer utility which dropped the compatibility support for +number options (reported by Andrey A Chernov). + modify linux terminfo entry to use color palette feature from linux-c-nc entry (comments by Tomasz Wasiak and Floyd Davidson). + restore original color definitions in endwin() if init_color() was used, and resume those colors on the next doupdate() or refresh() (report by Tomasz Wasiak <tjwasiak@komputom.com.pl>). + improve debug-traces by modifying MKlib_gen.sh to generate calls to returnBool() and returnAttr(). + add/use _nc_visbufn() and _nc_viswbufn() to limit the debug trace of waddnstr() and similar functions to match the parameters as used. + add/use _nc_retrace_bool() and _nc_retrace_unsigned(). + correct type used by _nc_retrace_chtype(). + add debug traces to some functions in lib_mouse.c + modify lib_addch.c to handle non-spacing characters. + correct parameter of RemAttr() in lib_bkgd.c, which caused the c++ demo's boxes to lose the A_ALTCHARSET flag (broken in 20020629). + correct width computed in _tracedump(), which did not account for the attributes (broken in 20010602). + modify test/tracemunch to replace addresses for windows other than curscr, newscr and stdscr with window0, window1, etc. 20020921 pre-release + redid fix for edit_man.sed path. + workaround for Cygwin bug which makes subprocess writes to stdout result in core dump. + documented getbegx(), etc. + minor fixes to configure script to use '%' consistently as a sed delimiter rather than '@'. > patch by Philippe Blain: + add check in lib_overlay.c to ensure that the windows to be merged actually overlap, and in copywin(), limit the area to be touched to the lines given for the destination window. 20020914 pre-release + modified curses.h so that if the wide-character version is installed overwriting /usr/include/curses.h, and if it relied on libutf8.h, then applications that use that header for wide-character support must define HAVE_LIBUTF8_H. + modify putwin(), getwin() and dupwin() to allow them to operate on pads (request by Philippe Blain). + correct attribute-merging in wborder(), broken in 20020216 (report by Tomasz Wasiak <tjwasiak@grubasek.komputom.com.pl>). > patch by Philippe Blain: + corrected pop-counts in tparam_internal() to '!' and '~' cases. + use sizeof(NCURSES_CH_T) in one place that used sizeof(chtype). + remove some unused variables from mvcur test-driver. 20020907 pre-release + change configure script to allow install of widec-character (ncursesw) headers to overwrite normal (ncurses) headers, since the latter is a compatible subset of the former. + fix path of edit_man.sed in configure script, needed to regenerate html manpages on Debian. + fix mismatched enums in vsscanf.c, which caused warning on Solaris. + update README.emx to reflect current patch used for autoconf. + change web- and ftp-site to invisible-island.net > patch by Philippe Blain: + change case for 'P' in tparam_internal() to indicate that it pops a variable from the stack. + correct sense of precision and width in parse_format(), to avoid confusion. + modify lib_tparm.c, absorb really_get_space() into get_space(). + modify getwin() and dupwin() to copy the _notimeout, _idlok and _idcok window fields. + better fix for _nc_set_type(), using typeMalloc(). 20020901 pre-release + change minor version to 3, i.e., ncurses 5.3 + update config.guess, config.sub + retest build with each configure option; minor ifdef fixes. + make keyname() return a null pointer rather than "UNKNOWN STRING" to match XSI. + modify handling of wide line-drawing character functions to use the normal line-drawing characters when not in UTF-8 locale. + add check/fix to comp_parse.c to suppress warning about missing acsc string. This happens in configurations where raw termcap information is processed; tic already does this and other checks. + modify tic's check for ich/ich1 versus rmir/smir to only warn about ich1, to match xterm patch #70 notes. + moved information for ripped-off lines into SCREEN struct to allow use in resizeterm(). + add experimental wgetch_events(), ifdef'd with NCURSES_WGETCH_EVENTS (adapted from patch by Ilya Zakharevich - see ncurses/README.IZ). + amend check in kgetch() from 20020824 to look only for function-keys, otherwise escape sequences are not resolved properly. > patch by Philippe Blain: + removed redundant assignment to SP->_checkfd from newterm(). + check return-value of setupterm() in restartterm(). + use sizeof(NCURSES_CH_T) in a few places that used sizeof(chtype). + prevent dupwin() from duplicating a pad. + prevent putwin() from writing a pad. + use typeRealloc() or typeMalloc() in preference to direct calls on _nc_doalloc(). 20020824 +). + ensure clearerr() is called before using ferror() e.g., in lib_screen.c (report by Philippe Blain). 20020817 +. + add checks for null pointer in calls to tparm() and tgoto() based on FreeBSD bug report. If ncurses were built with termcap support, and the first call to tgoto() were a zero-length string, the result would be a null pointer, which was not handled properly. + correct a typo in terminfo.head, which gave the octal code for colon rather than comma. + remove the "tic -u" option from 20020810, since it did not account for nested "tc=" clauses, and when that was addressed, was still unsatisfactory. 20020810 + add tic -A option to suppress capabilities which are commented out when translating to termcap. + add tic -u option to provide older behavior of "tc=" clauses. + modified tic to expand all but the final "tc=" clause in a termcap entry, to accommodate termcap libraries which do not handle multiple tc clauses. + correct typo in curs_inopts.3x regarding CS8/CS7 usage (report by Philippe Blain). + remove a couple of redundant uses of A_ATTRIBUTES in expressions using AttrOf(), which already incorporates that mask (report by Philippe Blain). + document TABSIZE variable. + add NCURSES_ASSUMED_COLORS environment variable, to allow users to override compiled-in default black-on-white assumption used in assume_default_colors(). + correct an off-by-one comparison against max_colors in COLORFGBG logic. + correct a use of uninitialized memory found by valgrind (reported by Olaf Buddenhagen <olafBuddenhagen@web.de>). + modified wresize() to ensure that a failed realloc will not corrupt the window structure, and to make subwindows fit within the resized window (completes Debian #87678, #101699) 20020803 + fix an off-by-one in lib_pad.c check for limits of pad (patch by Philippe Blain). + revise logic for BeOS in lib_twait.c altered in 20011013 to restore logic used by lib_getch.c's support for GPM or EMX mouse (report by Philippe Blain) + remove NCURSES_CONST from several prototypes in curses.wide, to make the --enable-const --enable-widec configure options to work together (report by George Goffe <grgoffe@yahoo.com>). 20020727 + finish no-leak checking in cardfile.c, using this for testing changes to resizeterm(). + simplify _nc_freeall() using delscreen(). 20020720 + check error-return from _nc_set_tty_mode() in _nc_initscr() and reset_prog_mode() (report/patch by Philippe Blain). + regenerate configure using patch for autoconf 2.52, to address problem with identifying C++ bool type. + correct/improve logic to produce an exit status for errors in tput, which did not exit with an error when told to put a string not in the current terminfo entry (report by David Gomez <david@pleyades.net>). + modify configure script AC_OUTPUT() call to work around defect in autoconf 2.52 which adds an ifdef'd include to the generated configure definitions. + remove fstat() check from scr_init(), which also fixes a missing include for <sys/stat.h> from 20020713 (reported by David Ellement, fix suggested by Philippe Blain). + update curs_scanw.3x manpage to note that XSI curses differs from SVr4 curses: return-values are incompatible. + correct several prototypes in manpages which used const inconsistently with the curses.h file, and removed spurious const's in a few places from curses.h, e.g., for wbkgd() (report by Glenn Maynard <glenn@zewt.org>). + change internal type used by tparm() to long, to work with LP64 model. + modify nc_alloc.h to allow building with g++, for testing. 20020713 + add resize-handling to cardfile.c test program. + altered resizeterm() to avoid having it fail when a child window cannot be resized because it would be larger than its parent. (More work must be done on this, but it works well enough to integrate). + improve a limit-check in lib_refresh.c + remove check in lib_screen.c relating dumptime to file's modification times, since that would not necessarily work for remotely mounted filesystems. + modify lrtest to simplify debugging changes to resizeterm, e.g., t/T commands to enable/disable tracing. + updated status of multibyte support in TO-DO. + update contact info in source-files (patch by Juergen Pfeifer). 20020706 + add Caps.hpux11, as an example. + modify version_filter(), used to implement -R option for tic and infocmp, to use computed array offsets based on the Caps.* file which is actually configured, rather than constants which correspond to the Caps file. + reorganized lib_raw.c to avoid updating SP and cur_term state if the functions fail (reported by Philippe Blain). + add -Wundef to gcc warnings, adjust a few ifdef's to accommodate gcc. 20020629 + correct parameters to setcchar() in ncurses.c (cf: 20020406). + set locale in most test programs (view.c and ncurses.c were the only ones). + add configure option --with-build-cppflags (report by Maksim A Nikulin <M.A.Nikulin@inp.nsk.su>). + correct a typo in wide-character logic for lib_bkgnd.c (Philippe Blain). + modify lib_wacs.c to not cancel the acsc, smacs, rmacs strings when in UTF-8 locale. Wide-character functions use Unicode values, while narrow-character functions use the terminfo data. + fix a couple of places in Ada95/samples which did not compile with gnat 3.14 + modify mkinstalldirs so the DOS-pathname case is locale-independent. + fix locale problem in MKlib_gen.sh by forcing related variables to POSIX (C), using same approach as autoconf (set variables only if they were set before). Update MKterminfo.sh and MKtermsort.sh to match. 20020622 + add charset to generated html. + add mvterm entry, adapted from a FreeBSD bug-report by Daniel Rudy <dcrudy@pacbell.net> -TD + add rxvt-16color, ibm+16color entries -TD + modify check in --disable-overwrite option so that it is used by default unless the --prefix/$prefix value is not /usr, in attempt to work around packagers, e.g., for Sun's freeware, who do not read the INSTALL notes. 20020615 + modify wgetch() to allow returning ungetch'd KEY_RESIZE as a function key code in get_wch(). + extended resize-handling in test/ncurses 'a' menu to the entire stack of windows created with 'w' commands. + improve $COLORFGBG feature by interpreting an out-of-range color value as an SGR 39 or 49, for foreground/background respectively. + correct a typo in configure --enable-colorfgbg option, and move it to the experimental section (cf: 20011208). 20020601 + add logic to dump_entry.c to remove function-key definitions that do not fit into the 1023-byte limit for generated termcaps. This makes hds200 fit. + more improvements to tic's warnings, including logic to ignore differences between delay values in sgr strings. + move definition of KEY_RESIZE into MKkeydefs.sh script, to accommodate Caps.osf1r5 which introduced a conflicting definition. 20020525 + add simple resize-handling in test/ncurses.c 'a' menu. + fixes in keyname() and _tracechar() to handle negative values. + make tic's warnings about mismatches in sgr strings easier to follow. + correct tic checks for number of parameters in smgbp and smglp. + improve scoansi terminfo entry, and add scoansi-new entry -TD + add pcvt25-color terminfo entry -TD + add kf13-kf48 strings to cons25w terminfo entry (reported by Stephen Hurd <deuce@lordlegacy.org> in newsgroup lucky.freebsd.bugs) -TD + add entrypoint _nc_trace_ttymode(), use this to distinguish the Ottyb and Nttyb members of terminal (aka cur_term), for tracing. 20020523 + correct and simplify logic for lib_pad.c change in 20020518 (reported by Mike Castle). 20020518 + fix lib_pad.c for case of drawing a double-width character which falls off the left margin of the pad (patch by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>) + modify configure script to work around broken gcc 3.1 "--version" option, which adds unnecessary trash to the requested information. + adjust ifdef's in case SIGWINCH is not defined, e.g., with DJGPP (reported by Ben Decker <deckerben@freenet.de>). 20020511 + implement vid_puts(), vid_attr(), term_attrs() based on the narrow- character versions as well. + implement erasewchar(), killwchar() based on erasechar() and killchar(). + modify erasechar() and killchar() to return ERR if the value was VDISABLE. + correct a bug in wresize() in handling subwindows (based on patch by Roger Gammans <rgammans@computer-surgery.co.uk>, report by Scott Beck <scott@gossamer-threads.com>). + improve test/tclock.c by making the second-hand update more often if gettimeofday() is available. 20020429 + workaround for Solaris sed with MKlib_gen.sh (reported by Andy Tsouladze <andyt@mypoints.com>). 20020427 + correct return-value from getcchar(), making it consistent with Solaris and Tru64. + reorder loops that generate makefile rules for different models vs subsets so configure --with-termlib works again. This was broken by logic added to avoid duplicate rules in changes to accommodate cygwin dll's (reported by George.R.Goffe@seagate.com). + update config.guess, config.sub 20020421 + modify ifdef's in write_entry.c to allow use of symbolic links on platforms with no hard links, e.g., BeOS. + modify a few includes to allow compile with BeOS, which has stdbool.h with a conflicting definition for 'bool' versus its OS.h definition. + amend MKlib_gen.sh to work with gawk, which defines 'func' as an alias for 'function'. 20020420 + correct form of prototype for ripoffline(). + modify MKlib_gen.sh to test that all functions marked as implemented can be linked. 20020413 + add manpages: curs_get_wstr.3x, curs_in_wchstr.3x + implement wgetn_wstr(). + implement win_wchnstr(). + remove redefinition of unget_wch() in lib_gen.c (reported by Jungshik Shin <jshin@jtan.com>). 20020406 + modified several of the test programs to allow them to compile with vendor curses implementations, e.g., Solaris, AIX -TD 20020323 + modified test/configure to allow configuring against ncursesw. + change WACS_xxx definition to use address, to work like Tru64 curses. 20020317 + add 'e' and 'm' toggles to 'a', 'A' tests in ncurses.c to demonstrate effect of echo/noecho and meta modes. + add 'A' test to ncurses.c to demonstrate wget_wch() and related functions. + add manpage: curs_get_wch.3x + implement unget_wch(). + implement wget_wch(). 20020310 + regenerated html manpages. + add manpages: curs_in_wch.3x, curs_ins_wch.3x, curs_ins_wstr.3x + implement wins_wch(). + implement win_wch(). + implement wins_nwstr(), wins_wstr(). 20020309 + add manpages: curs_addwstr.3x, curs_winwstr.3x + implement winnwstr(), winwstr(). 20020223 + add manpages: curs_add_wchstr.3x, curs_bkgrnd.3x + document wunctrl, key_name. + implement key_name(). + remove const's in lib_box.c incorrectly leftover after splitting off lib_box_set.c + update llib-lncurses, llib-ncursesw, fix configure script related to these. 20020218 + remove quotes on "SYNOPSIS" in man/curs_box_set.3x, which resulted in spurious symlinks on install. 20020216 + implement whline_set(), wvline_set(), add manpage curs_border_set. + add subtest 'b' to 'F' and 'f' in ncurses.c to demonstrate use of box() and box_set() functions. + add subtest 'u' to 'F' in ncurses.c, to demonstrate use of addstr() given UTF-8 string equivalents of WACS_xxx symbols. + minor fixes to several manpages based on groff -ww output. + add descriptions of external variables of termcap interface to the manpage (report by Bruce Evans <bde@zeta.org.au>). > patches by Bernhard Rosenkraenzer: + correct configure option --with-bool, which was executed as --with-ospeed. + add quotes for parameters of --with-bool and --with-ospeed configure options. > patch by Sven Verdoolaege (report by Gerhard Haering <haering_linux@gmx.de>): + correct typos in definitions of several wide-character macros: waddwstr, wgetbkgrnd, mvaddwstr, mvwadd_wchnstr, mvwadd_wchnstr, mvwaddwstr. + pass $(CPPFLAGS) to MKlib_gen.sh, thereby fixing a missing definition of _XOPEN_SOURCE_EXTENDED, e.g., on Solaris 20020209 + implement wide-acs characters for UTF-8 locales. When in UTF-8 locale, ignore narrow version of acs. Add 'F' test to test/ncurses.c to demonstrate. + correct prototype in keybound manpage (noted from a Debian mailing list item). 20020202 + add several cases to the wscanw() example in testcurs.c, showing the format. +). + add a call to _nc_keypad() in keypad() to accommodate applications such as nvi, which use curses for output but not for input (fixes Debian #131263, cf: 20011215). + add entrypoints to resizeterm.c which provide better control over the process: is_term_resized() and resize_term(). The latter restores the original design of resizeterm() before KEY_RESIZE was added in 970906. Do this to accommodate 20010922 changes to view.c, but allow for programs with their own sigwinch handler, such as lynx (reported by Russell Ruby <russ@math.orst.edu>). 20020127 + fix a typo in change to mk-1st.awk, which broke the shared-library makefile rules (reported by Martin Mokrejs). 20020126 + update config.guess, config.sub + finish changes needed to build dll's on cygwin. + fix a typo in mvwchat() macro (reported by Cy <yam@homerow.net). 20020119 + add case in lib_baudrate.c for B921600 (patch by Andrey A Chernov). + correct missing sed-editing stage in manpage installs which is used to rename manpages, broken in 20010324 fix for Debian #89939 (Debian #78866). + remove -L$(libdir) from linker flags, probably not needed any more since HPUX is handled properly (reported by Niibe Yutaka <gniibe@m17n.org>). + add configure check for mbstate_t, needed for wide-character configuration. On some platforms we must include <wchar.h> to define this (reported by Daniel Jacobowitz). + incorporate some of the changes needed to build dll's on cygwin. 20020112a + workaround for awk did not work with mawk, adjusted shell script. 20020112 + add Caps.osf1r5, as an example. + modify behavior of can_clear_with() so that if an application is running in a non-bce terminals with default colors enabled, it returns true, allowing the user to select/paste text without picking up extraneous trailing blanks (adapted from patch by Daniel Jacobowitz <dmj+@andrew.cmu.edu>). + modify generated curses.h to ifdef-out prototypes for extensions if they are disabled, and to define curses_version() as a string in that case. This is needed to make the programs such as tic build in that configuration. + modified generated headers.sh to remove a gzip'd version of the target file if it exists, in case non-gzip'd manpages are installed into a directory where gzip'd ones exist. In that case, the latter would be found. + corrected a redundant initialization of signal handlers from 20010922 changes. + clarified bug-reporting address in terminfo.src (report by John H DuBois III <spcecdt@armory.com>). > several fixes from Robert Joop: + do not use "-v" option of awk in MKkey_defs.sh because it does not work with SunOS nawk. + modify definitions for libutf8 in curses.h to avoid redefinition warnings for mblen + quoted references to compiler in shell command in misc/Makefile, in case it uses multiple tokens. 20011229 + restore special case from 20010922 changes to omit SA_RESTART when setting up SIGWINCH handler, which is needed to allow wgetch() to be interrupted by that signal. + update configure macro CF_WITH_PATHLIST, to omit some double quotes not needed with autoconf 2.52 + revert configure script to autoconf 2.13 patched with autoconf-2.13-19990117.patch.gz (or later) from because autoconf 2.52 macro AC_PROG_AWK does not work on HPUX 11.0 (report by David Ellement <ellement@sdd.hp.com>). This also fixes a different problem configuring with Mac OS X (reported by Marc Smith <marc.a.smith@home.com>). 20011222 + modify include/edit_cfg.h to eliminate BROKEN_LINKER symbol from term.h + move prototype for _nc_vsscanf() into curses.h.in to omit HAVE_VSSCANF symbol from curses.h, which was dependent upon the ncurses_cfg.h file which is not installed. + use ACS_LEN rather than SIZEOF(acs_map) in trace code of lib_acs.c, to work with broken linker configuration, e.g., cygwin (report by Robert Joop <rj@rainbow.in-berlin.de>). + make napms() call _nc_timed_wait() rather than poll() or select(), to work around broken implementations of these on cygwin. 20011218 + drop configure macro CF_WIDEC_SHIFT, since that was rendered obsolete by Sven Verdoolaege's rewrite of wide-character support. This makes libncursesw incompatible again, but makes the header files almost the same as in the narrow-character configuration. + simplify definitions that combine wide/narrow versions of bkgd, etc., to eliminate differences between the wide/narrow versions of curses.h + correct typo in configure macro CF_FUNC_VSSCANF + correct location of call to _nc_keypad() from 20011215 changes which prevented keypad() from being disabled (reported by Lars Hecking). 20011215 + rewrote ncurses 'a' test to exercise wgetch() and keypad() functions better, e.g., by adding a 'w' command to create new windows which may have different keypad() settings. + corrected logic of keypad() by adding internal screen state to track whether the terminal's keypad-mode has been set. Use this in wgetch() to update the keypad-mode according to whether the associated window's keypad-mode has been set with keypad(). This corrects a related problem restoring terminal state after handling SIGTSTP (reported by Mike Castle). + regenerate configure using patch for autoconf 2.52 autoconf-2.52-patch.gz at + update config.guess, config.sub from + minor changes to quoting in configure script to allow it to work with autoconf 2.52 20011208 + modify final checks in lib_setup.c for line and col values, making them independent. + modify acs_map[] if configure --broken-linker is specified, to make it use a function rather than an array (prompted by an incorrect implementation in cygwin package). + correct spelling of configure option --enable-colorfgbg, which happened to work if --with-develop was set (noted in cygwin package for ncurses). + modify ifdef for genericerror() to compile with SUNWspro Sun WorkShop 6 update 1 C++ 5.2 (patch by Sullivan N Beck <sbeck@cise.ufl.edu>). + add configure checks to see if ncurses' fallback vsscanf() will compile either of the special cases for FILE structs, and if not, force it to the case which simply returns an error (report by Sullivan N Beck <sbeck@cise.ufl.edu> indicates that Solaris 8 with 64-bits does not allow access to FILE's fields). + modify ifdef's for c++/cursesw.cc to use the fallback vsscanf() in the ncurses library if no better substitute for this can be found in the C++ runtime. + modify the build to name dynamic libraries according to the convention used on OS X and Darwin. Rather than something like libncurses.dylib.5.2, Darwin would name it libncurses. 5.dylib. There are a few additional minor fixes, such as setting the library version and compatibility version numbers (patch by Jason Evans <jevans@apple.com>). + use 'sh' to run mkinstalldirs, to work around problems with buggy versions of 'make' on OS/2 (report by John Polterak <jp@eyup.org>). + correct typo in manpage description of curs_set() (Debian #121548). + replace the configure script existence-check for mkstemp() by one that checks if the function works, needed for older glibc and AmigaOS. 20011201 + modify script that generates fallbacks.c to compile a temporary copy of the terminfo source in case the host does not contain all of the entries requested for fallbacks (request by Greg Roelofs). + modify configure script to accommodate systems such as Mac OS X whose <stdbool.h> header defines a 'bool' type inconsistent with ncurses, which normally makes 'bool' consistent with C++. Include <stdbool.h> from curses.h to force consistent usage, define a new type NCURSES_BOOL and related that to the exported 'bool' as either a typedef or definition, according to whether <stdbool.h> is present (based on a bug report for tin 1.5.9 by Aaron Adams <adamsa@mac.com>). 20011124 + added/updated terminfo entries for M$ telnet and KDE konsole -TD 20011117 + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries (Benjamin C W Sittler). + add putty terminfo entry -TD + if configuring for wide-curses, define _XOPEN_SOURCE_EXTENDED, since this may not otherwise be defined to make test/view.c compile. 20011110 + review/correct several missing/generated items in curses.wide, sorted the lists to make subsequent diff's easier to track. 20011103 + add manual pages for add_wch(), echo_wchar(), getcchar(), mvadd_wch(), mvwadd_wch(), setcchar(), wadd_wch() and wecho_wchar(). + implement wecho_wchar() + modify _tracedump() to handle wide-characters by mapping them to '?' and control-characters to '.', to make the trace file readable. Also dynamically allocate the buffer used by _tracedump() for formatting the results. + modify T_CALLED/T_RETURN macros to ease balancing call/return lines in a trace by using curly braces. + implement _nc_viscbuf(), for tracing cchar_t arrays. + correct trace-calls in setcchar() and getcchar() functions, which traced the return values but not the entry to each function. + correct usage message in test/view.c, which still mentioned -u flag. 20011027 + modify configure script to allow building with termcap only, or with fallbacks only. In this case, we do not build tic and toe. + add configure --with-termpath option, to override default TERMPATH value of /etc/termcap:/usr/share/misc/termcap. + cosmetic change to tack: make menu descriptions agree with menu titles. 20011020 + rewrote limit-checks in wscrl() and associated _nc_scroll_window(), to ensure that if the parameter of wscrl() is larger than the size of the scrolling region, then the scrolling region will be cleared (report by Ben Kohlen <bckohlen@yahoo.com>). + add trace/varargs.c, using this to trace parameters in lib_printw.c + implement _tracecchar_t2() and _tracecchar_t(). + split-out trace/visbuf.c + correct typo in lib_printw.c changes from 20010922 (report by Mike Castle). 20011013 + modify run_tic.sh to check if the build is a cross-compile. In that case, do not use the build's tic to install the terminfo database (report by Rafael Rodriguez Velilla <rrv@tid.es>). + modify mouse click resolution so that mouseinterval(-1) will disable it, e.g., to handle touchscreens via a slow connection (request by Byron Stanoszek <gandalf@winds.org>). + correct mouseinterval() default value shown in curs_mouse.3x + remove conflicting definition of mouse_trafo() (reported by Lars Hecking, using gcc 2.95.3). 20011001 + simpler fix for signal_name(), to replace the one overlooked in 20010929 (reported by Larry Virden). 20010929 + add -i option to view.c, to test ncurses' check for non-default signal handler for SIGINT, etc. + add cases for shared-libraries on Darwin/OS X (patch by Rob Braun <bbraun@synack.net>). + modify tset to restore original I/O modes if an error is encountered. Also modify to use buffered stderr consistently rather than mixing with write(). + change signal_name() function to use if-then-else rather than case statement, since signal-values aren't really integers (reported by Larry Virden). + add limit checks in wredrawln(), fixing a problem where lynx was repainting a pad which was much larger than the screen. 20010922 + fix: PutRange() was counting the second part of a wide character as part of a run, resulting in a cursor position that was one too far (patch by Sven Verdoolaege). + modify resizeterm() to not queue a KEY_RESIZE if there was no SIGWINCH, thereby separating the two styles of SIGWINCH handling in test/view.c + simplified lib_tstp.c, modify it to use SA_RESTART flag for SIGWINCH. + eliminate several static buffers in the terminfo compiler, using allocated buffers. + modify MKkeyname.awk so that keyname() does not store its result into a static buffer that is overwritten by the next call. + reorganize the output of infocmp -E and -e options to compile cleanly with gcc -Wwrite-strings warnings. + remove redefinition of chgat/wchgat/mvwchgat from curses.wide 20010915 + add label to test/view.c, showing the name of the last key or signal that made the screen repaint, to make it clearer when a sigwinch does this. + use ExitProgram() consistently in the test-programs to make it simpler to test leaks with dmalloc, etc. + move hashtab static data out of hashmap.c into SCREEN struct. + make NO_LEAK code compile with revised WINDOWLIST structs. 20010908 + modify tgetent() to check if exit_attribute_mode resets the alternate character set, and if so, attempt to adjust the copy of the termcap "me" string which it will return to eliminate that part. In particular, 'screen' would lose track of line-drawing characters (report by Frederic L W Meunier <0@pervalidus.net>, analysis by Michael Schroeder). 20010901 + specify DOCTYPE in html manpages. + add missing macros for several "generated" functions: attr_get(), attr_off(), attr_on(), attr_set(), chgat(), mvchgat(), mvwchgat() and mouse_trafo(). + modify view.c to agree with non-experimental status of ncurses' sigwinch handler: + change the sense of the -r option, making it default to ncurses' sigwinch handler. + add a note explaining what functions are unsafe in a signal handler. + add a -c option, to set color display, for testing. + unset $data variable in MKterminfo.sh script, to address potential infinite loop if shell malfunction (report by Samuel Mikes <smikes@cubane.com>, for bash 2.05.0 on a Linux 2.0.36 system). + change kbs in mach terminfo entries to ^? (Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>). + correct logic for COLORFGBG environment variable: if rxvt is compiled with xpm support, the variable has three fields, making it slightly incompatible with itself. In either case, the background color is the last field. 20010825 + move calls to def_shell_mode() and def_prog_mode() before loop with callbacks in lib_set_term.c, since the c++ demo otherwise initialized the tty modes before saving them (patch by John David Anglin <dave@hiauly1.hia.nrc.ca>). + duplicate logic used to initialize trace in newterm(), in initscr() to avoid confusing trace of initscr(). + simplify allocation of WINDOW and WINDOWLIST structs by making the first a part of the second rather than storing a pointer. This saves a call to malloc for each window (discussion with Philippe Blain). + remove unused variable 'used_ncv' from lib_vidattr.c (Philippe Blain). + modify c++/Makefile.in to accommodate archive programs that are different for C++ than for C, and add cases for vendor's C++ compilers on Solaris and IRIX (report by Albert Chin-A-Young). + correct manpage description of criteria for deciding if the terminal supports xterm mouse controls. + add several configure script options to aid with cross-compiling: --with-build-cc, --with-build-cflags, --with-build-ldflags, and --with-build-libs (request by Greg Roelofs). + change criteria for deciding if configure is cross-compiling from host/build mismatch to host/target mismatch (request by Greg Roelofs <greg.roelofs@philips.com>). + correct logic for infocmp -e and -E options which writes the data for the ext_Names[] array. This is needed if one constructs a fallback table for a terminfo entry which uses extended termcap names, e.g., AX in a color xterm. + fix undefined NCURSES_PATHSEP when configure --disable-database option is given. 20010811 + fix for VALID_BOOLEAN() macro when char is not signed. + modify 'clean' rule for C++ binding to work with Sun compiler, which caches additional information in a subdirectory of the objects. + added llib-ncursesw. 20010804 + add Caps.keys example for experimental extended function keys (adapted from a patch by Ilya Zakharevich). + correct parameter types of vidputs() and vidattr() to agree with header files (report by William P Setzer). + fix typos in several man-pages (patch by William P Setzer). + remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure macro, which made ncurses C++ binding fail to build with other C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young). + workaround for bug in HPUX 11.x C compiler: add a blank after NCURSES_EXPORT macro in form.h (report by Albert Chin-A-Young) + ignore blank lines in Caps* files in MKkey_defs.sh script (report by Albert Chin-A-Young). + correct definition of key_end in Caps.aix4, which left KEY_END undefined (report by Albert Chin-A-Young). + remove a QNX-specific fallback prototype for vsscanf(), which is obsolete with QNX RTP. + review/fix some of the T() and TR() macro calls, having noticed that there was no data for delwin() in a trace of dialog because there was no returnVoid call for wtimeout(). Also, traces in lib_twait.c are now selected under TRACE_IEVENT rather than TRACE_CALLS. 20010728 + add a _nc_access() check before opening files listed via $TERMPATH. + using modified man2html, regenerate some of the html manpages to fix broken HREF's where the link was hyphenated. 20010721 + add some limit/pointer checks to -S option of tputs. + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries (Benjamin C W Sittler). + add a note in curs_termcap.3x regarding a defect in the XSI description of tgetent (based on a discussion with Urs Jansen regarding the HPUX 11.x implementation, whose termcap interface is not compatible with existing termcap programs). + modify manhtml rule in dist.mk to preserve copyright notice on the generated files, as well as to address HTML style issues reported by tidy and weblint. Regenerated/updated corresponding html files. + comment out use of Protected_Character and related rarely used attributes in ncurses Ada95 test/demo to compile with wide-character configuration. 20010714 + implement a simple example in C++ demo to test scanw(). + corrected stdio function used to implement scanw() in cursesw.cc + correct definition of RemAttr() macro from 20010602 changes, which caused C++ SillyDemo to not show line-drawing characters. + modify C++ binding, adding getKey() which can be overridden by user to substitute functions other than getch() for keyboard processing of forms and menus (patch by Juergen Pfeifer). 20010707 + fix some of the trace calls which needed modification to work with new wide-character structures. + modify magic-cookie code in tty_update.c to compile with new wide-character structures (report by <George.R.Goffe@seagate.com>). + ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if compiling for wide-character configuration. + make addwnstr() handle non-spacing characters (patch by Sven Verdoolaege). 20010630 + add configure check to define _GNU_SOURCE, needed to prop up glibc header files. + split-out include/curses.wide to solve spurious redefinitions caused by defining _GNU_SOURCE, and move includes for <signal.h> before <curses.h> to work around misdefinition of ERR in glibc 2.1.3 header file. + extended ospeed change to NetBSD and OpenBSD -TD + modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it work properly for termcap applications (patch by Andrey A Chernov). 20010623 + correct an overlooked CharOf/UChar instance (reports by Eugene Lee <eugene@anime.net>, Sven Verdoolaege). + correct unneeded ifdef for wunctrl() (reported by Sven Verdoolaege) 20010618 + change overlooked several CharOf/UChar instances. > several patches from Sven Verdoolaege: + correct a typo in wunctrl(), which made it appear that botwc() was needed (no such function: use btowc()). + reimplement wide-character demo in test/view.c, using new functions. + implement getcchar(), setcchar(), wadd_wchnstr() and related macros. + fix a syntax problem with do/if/while in PUTC macro (curses.priv.h). 20010616 + add parentheses in macros for malloc in test.priv.h, fixes an expression in view.c (report by Wolfgang Gutjahr <gutw@knapp.co.at>). + add Caps.uwin, as an example. + change the way curses.h is generated, making the list of function key definitions extracted from the Caps file. + add #undef's before possible redefinition of ERR and OK in curses.h + modify logic in tic, toe, tput and tset which checks for basename of argv[0] to work properly on systems such as OS/2 which have case-independent filenames and/or program suffixes, e.g., ".ext". 20010609 + add a configure check, if --enable-widec is specified, for putwc(), which may be in libutf8. + remove some unnecessary text from curs_extend.3x and default_colors.3x which caused man-db to make incorrect symbolic links (Debian bug report #99550). + add configure check if cast for _IO_va_list is needed to compile C++ vscan code (Debian bug report #97945). > several patches from Sven Verdoolaege: + correct code that used non-standard auto-initialization of a struct, which gcc allows (report by Larry Virden). + use putwc() in PUTC() macro. + make addstr() work for the special case where the codeset is non-stateful (eg. UTF-8), as well as stateful codesets. 20010603 + correct loop expression in NEXT_CHAR macro for lib_addstr.c changes from 20010602 (report by Mike Castle). 20010602 + modify mvcur() to avoid emitting newline characters when nonl() mode is set. Normally this is not a problem since the actual terminal mode is set to suppress nl/crlf translations, however it is useful to allow the caller to manipulate the terminal mode to avoid staircasing effects after spawning a process which writes messages (for lynx 2.8.4) -TD > several patches from Sven Verdoolaege <skimo@kotnet.org>: + remove redundant type-conversion in fifo_push() + correct definition of addwstr() macro in curses.h.in + remove _nc_utf8_outch() + rename most existing uses of CharOf() to UChar(), e.g., where it is used to prevent sign-extension in ctype macros. + change some chtype's to attr_t's where the corresponding variables are used to manipulate attributes. + UpdateAttr() was applied to both attributes (attr_t) and characters (chtype). Modify macro and calls to it to make these distinct. + add CharEq() macro, use in places where wide-character configuration implementation uses a struct for cchar_t. + moved struct ldat into curses.priv.h, to hide implementation details. + change CharOf() macro to use it for masking A_CHARTEXT data from chtype's. + add L() macro to curses.priv.h, for long-character literals. + replace several assignments from struct ldat entries to chtype or char values with combinations of CharOf() and AttrOf() macros. + add/use intermediate ChAttrOf() and ChCharOf() macros where we know we are using chtype data. + add/use lowlevel attribute manipulation macros AddAttr(), RemAttr() and SetAttr(). + add/use SetChar() macro, to change a cchar_t based on a character and attributes. + convert most internal use of chtype to NCURSES_CH_T, to simplify use of cchar_t for wide-character configuration. Similarly, use ARG_CH_T where a pointer would be more useful. + add stubs for tracing cchar_t values. + add/use macro ISBLANK() + add/use constructors for cchar_t's: NewChar(), NewChar2(). + add/use macros CHREF(), CHDEREF(), AttrOfD(), CharOfD() to facilitate passing cchar_t's by address. + add/use PUTC_DATA, PUTC() macros. + for wide-character configuration, move the window background data to the end of the WINDOW struct so that whether _XOPEN_SOURCE_EXTENDED is defined or not, the offsets in the struct will not change. + modify addch() to work with wide-characters. + mark several wide-character functions as generated in curses.h.in + implement wunctrl(), wadd_wch(), wbkgrndset(), wbkgrnd(), wborder_set() and waddnwstr(). 20010526 + add experimental --with-caps=XXX option to customize to similar terminfo database formats such as AIX 4.x + add Caps.aix4 as an example. + modify Caps to add columns for the the KEY_xxx symbols. + modify configure --with-widec to suppress overwrite of libcurses.so and curses.h + add checks to toe.c to avoid being confused by files and directories where we would expect the reverse, e.g., source-files in the top-level terminfo levels as is the case for AIX. 20010519 + add top-level 'depend' rule for the C sources, assuming that the makedepend program is available. As a side-effect, this makes the generated sources, as in "make sources" (prompted by a report by Mike Castle that "make -j" fails because the resulting parallel processes race to generate ncurses/names.c). + modify configure script so that --disable-overwrite option's action to add a symbolic link for libcurses applies to the static library as well as the shared library when both are configured (report by Felix Natter <f.natter@ndh.net>). + add ELKS terminfo entries (Federico Bianchi <bianchi@>) + add u6 (CSR) to Eterm (Michael Jennings). 20010512 + modify test/ncurses.c to work with xterm-256color, which has fewer color pairs than colors*colors (report by David Ellement <ellement@sdd.hp.com>). 20010505 + corrected screen.xterm-xfree86 entry. + update comment in Caps regarding IBM (AIX) function-key definitions. 20010421 + modify c++/Makefile.in to link with libncurses++w.a when configured for wide-characters (patch by Sven Verdoolaege). + add check in _nc_trace_buf() to refrain from freeing a null pointer. + improve CF_PROG_INSTALL macro using CF_DIRNAME. + update config.guess, config.sub from autoconf 2.49e (alpha). 20010414 + add secondary check in tic.c, similar_sgr() to see if the reason for mismatch was that the individual capabilities used a time-delay while sgr did not. Used this to cleanup mismatches, e.g., in vt100, and remove time-delay from Apple_Terminal entries. + add Apple_Terminal terminfo entries (Benjamin C W Sittler <bsittler@iname.com>). + correct definitions of shifted editing keys for xterm-xfree86 -TD + fix a bug in test/bs.c from 20010407 (patch by Erik Sigra). + prevent relative_move() from doing an overwrite if it detects 8-bit characters when configured for UTF-8 (reported by Sven Verdoolaege <skimo@kotnet.org>). 20010407 + add configure checks for strstream.h vscan function, and similar stdio-based function which may be used in C++ binding for gcc 3.0 (reports by George Goffe, Lars Hecking, Mike Castle). + rewrite parts of configure.in which used changequote(). That feature is broken in the latest autoconf alphas (e.g., 2.49d). + add a missing pathname for ncurses_dll.h, needed when building in a directory outside the source tree (patch by Sven Verdoolaege <skimo@kotnet.org>). > fix 2 bugs in test/bs.c Erik Sigra <sigra@home.se>: + no ships were ever placed in the last row or in the last column. This made the game very easy to win, because you never had to waste any shots there, but the computer did. + the squares around a sunken ship that belonged to the player were not displayed as already hit by the computer, like it does for the player. 20010331 +). 20010324 + change symbols used to guard against repeated includes to begin consistently with "NCURSES_" rather than a leading underscore. There are other symbols defined in the header files which begin with a leading underscore, but they are part of the legacy interface. + reorder includes in c++ binding so that rcs identifiers can be compiled-in. + add .cc.ii rule to c++ makefile, to get preprocessor output for debugging. + correct configure script handling of @keyword@ substitutions when the --with-manpage-renames option is given (cf: 20000715, fixes Debian bug #89939). + report stack underflow/overflow in tparm() when tic -cv option is given. + remove spurious "%|" operator from xterm-xfree86 terminfo entry, (reported by Adam Costello <amc@cs.berkeley.edu>, Debian bug #89222). 20010310 + cleanup of newdemo.c, fixing some ambiguous expressions noted by gcc 2.95.2, and correcting some conflicting color pair initializations. + add missing copyright notice for cursesw.h + review, make minor fixes for use of '::' for referring to C-language interface from C++ binding. + modify configure check for g++ library slightly to accommodate nonstandard version number, e.g., <vendor>-2.7 (report by Ronald Ho <rho@mipos2.intel.com>). + add configure check for c++ <sstream> header, replace hardcoded ifdef. + workaround for pre-release of gcc 3.0 libstdc++, which has dropped vscan from strstreambuf to follow standard, use wrapper for C vscanf instead (report by George Goffe <grgoffe@excite.com> and Matt Taggart <taggart@carmen.fc.hp.com>, fixes Debian . 20010303 + modify interface of _nc_get_token() to pass 'silent' parameter to it, to make quieter loading of /etc/termcap (patch by Todd C Miller). + correct a few typos in curs_slk.3x and curs_outopts.3x manpages (patch by Todd C Miller). 20010224 + compiler-warning fixes (reported by Nelson Beebe). 20010210 + modify screen terminfo entry to use new 3.9.8 feature allowing xterm mouse controls -TD 20010203 + broaden patterns used to match OS/2 EMX in configure script to cover variant used in newer config.guess/config.sub + remove changequote() calls from configure script, since this feature is broken in the autoconf 2.49c alpha, maintainers decline to fix. + remove macro callPutChar() from tty_update.c, since this is no longer needed (reported by Philippe Blain). + add a null-pointer check in tic.c to handle the case when the input file is really empty. Modify the next_char() function in comp_scan.c to allow arbitrarily long lines, and incidentally supply a newline to files that do not end in a newline. These changes improve tic's recovery from attempts to read binary files, e.g., its output from the terminfo database (reported by Bernhard Rosenkraenzer). 20010127 + revert change to c++/demo.cc from 20001209, which changed definition of main() apparently to accommodate cygwin linker, but broke the demo program. + workaround for broken egcs 2.91.66 which calls member functions (i.e., lines() and colors() of NCursesWindow before calling its constructor. Add calls to initialize() in a few constructors which did not do this already. + use the GNAT preprocessor to make the necessary switch between TRACE and NO_TRACE configurations (patch by Juergen Pfeifer). > patches by Bernhard Rosenkraenzer: + modify kterm terminfo entry to use SCS sequence to support alternate character set (it does not work with SI/SO). + --with-ospeed=something didn't work. configure.in checked for a $enableval where it should check for $withval. Also, ncurses/llib-lncurses still had a hardcoded short. 20010114 + correction to my merge of Tom Riddle's patch that broke tic in some conditions (reported by Enoch Wexler <enoch@wexler.co.il>) -TD 20010113 + modify view.c to test halfdelay(). Like other tests, this recognizes the 's' and space commands for stopping/starting polled input, shows a freerunning clock in the header. If given a parameter to 's', that makes view.c use halfdelay() with that parameter rather than nodelay(). + fix to allow compile with the experimental configure option --disable-hashmap. + modify postprocess_termcap() to avoid overwriting key_backspace, key_left, key_down when processing a non-base entry (report/patch by Tom Riddle). + modify _nc_wrap_entry(), adding option to reallocate the string table, needed in _nc_merge_entry() when merging termcap entries. (adapted from report/patch by Tom Riddle <ftr@oracom.com>). + modify a few configure script macros to keep $CFLAGS used only for compiler options, preprocessor options in $CPPFLAGS. 20001230 + correct marker positions in lrtest.c after receiving a sigwinch. + fix ifdef's in ncurses.c to build against pre-5.2 for testing. + fixes to tclock for resizing behavior, redundant computation (report and patch by A M Kuchling <akuchlin@mems-exchange.org>). 20001216 + improved scoansi terminfo entry -TD + modify configure script and makefile in Ada95/src to compile a stub for the trace functions when ncurses does not provide those. 20001209 + add ncurses_dll.h and related definitions to support generating DLL's with cygwin (adapted from a patch by Charles Wilson <cwilson@ece.gatech.edu>, changed NCURSES_EXPORT macro to make it work with 'indent') -TD 20001202 + correct prototypes for some functions in curs_termcap.3x, matching termcap.h, which matches X/Open. > patch by Juergen Pfeifer: + a revised version of the Ada enhancements sent in by "H. Nanosecond", aka Eugene V Melaragno <aldomel@ix.netcom.com>. This patch includes - small fixes to the existing ncurses binding - addition of some more low-level functions to the binding, including termcap and terminfo functions - An Ada implementation of the "ncurses" test application originally written in C. 20001125 + modify logic in lib_setup.c to allow either lines or columns value from terminfo to be used if the screen size cannot be determined dynamically rather than requiring both (patch by Ehud Karni <ehud@unix.simonwiesel.co.il>). + add check in lib_tgoto.c's is_termcap() function to reject null or empty strings (reported by Valentin Nechayev <netch@netch.kiev.ua> to freebsd-bugs). + add definition from configure script that denotes the path-separator, which is normally a colon. The path-separator is a semicolon on OS/2 EMX and similar systems which may use a colon within pathnames. + alter logic to set default for --disable-overwrite option to set it to 'yes' if the --prefix/$prefix value is not /usr/local, thereby accommodating the most common cause of problems: gcc's nonstandard search rules. Other locations such as /usr/local/ncurses will default to overwriting (report by Lars Hecking <lhecking@nmrc.ie>). 20001118 + modify default for --disable-overwrite configure option to disable if the --prefix or $prefix value is not /usr. + add cygwin to systems for which ncurses is installed by default into /usr rather than /usr/local. 20001111 + minor optimization in comp_error.c and lib_termname.c, using strncat() to replace strncpy() (patch by Solar Designer). + add a use_terminfo_vars() check for $HOME/.termcap, and check for geteuid() to use_terminfo_vars() (patch by Solar Designer <solar@false.com>). + improved cygwin terminfo entry, based on patch by <ernie_boyd@yahoo.com>. + modify _nc_write_entry() to allow for the possibility that linking aliases on a filesystem that ignores case would not succeed because the source and destination differ only by case, e.g., NCR260VT300WPP0 on cygwin (report by Neil Zanella). + fix a typo in the curs_deleteln.3x man page (patch by Bernhard Rosenkraenzer <bero@redhat.de>). 20001104 + add configure option --with-ospeed to assist packagers in transition to 5.3 change to ospeed type. + add/use CharOf() macro to suppress sign-extension of char type on platforms where this is a problem in ctype macros, e.g., Solaris. + change trace output to binary format. + correct a missing quote adjustment in CF_PATH_SYNTAX autoconf macro, for OS/2 EMX configuration. + rearrange a few configure macros, moving preprocessor options to $CPPFLAGS (a now-obsolete version of autoconf did not consistently use $CPPFLAGS in both the compile and preprocessor checks). + add a check in relative_move() to guard against buffer overflow in the overwrite logic. 20001028 + add message to configure script showing g++ version. + resync config.guess, config.sub + modify lib_delwin.c, making it return ERR if the window did not exist (suggested by Neil Zanella). + add cases for FreeBSD 3.1 to tdlint and makellib scripts, used this to test/review ncurses library. (Would use lclint, but it doesn't work). + reorganized knight.c to avoid forward references. Correct screen updates when backtracking, especially to the first cell. Add F/B/a commands. 20001021 5.2 release for upload to + update generated html files from manpages. + modify dist.mk to use edit_man.sh to substitute autoconf'd variables in html manpages. + fix an uninitialized pointer in read_termcap.c (report by Todd C Miller, from report/patch by Philip Guenther <guenther@gac.edu>). + correct help-message and array limit in knight.c (patch by Brian Raiter <breadbox@muppetlabs.com>). > patch by Juergen Pfeifer: + fix to avoid warning by GNAT-3.13p about use of inconsistent casing for some identifiers defined in the standard package. + cosmetic change to forms/fty_enum.c 20001014 + correct an off-by-one position in test/railroad.c which could cause wrapping at the right margin. + test/repair some issues with libtool configuration. Make --disable-echo force libtool --silent. (Libtool does not work for OS/2 EMX, works partly for SCO - libtool is still very specific to gcc). + change default of --with-manpage-tbl to "no", since for most of the platforms which do have tbl installed, the system "man" program understands how to run tbl automatically. + minor improvement to force_bar() in comp_parse.c (Bernhard Rosenkraenzer <bero@redhat.de>). + modify lib_tparm.c to use get_space() before writing terminating null character, both for consistency as well as to ensure that if save_char() was called immediately before, that the allocated memory is enough (patch by Sergei Ivanov). + add note about termcap ML capability which is duplicated between two different capabilities: smgl and smglr (reported by Sergei Ivanov <svivanov@pdmi.ras.ru>). + correct parameter counts in include/Caps for dclk as well as some printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. > patch by Johnny C Lam <lamj@stat.cmu.edu>: + add support for building with libtool (apparently version 1.3.5, since old versions do not handle -L../lib), using new configure option --with-libtool. + add configure option --with-manpage-tbl, which causes the manpages to be preprocessed by tbl(1) prior to installation, + add configure option --without-curses-h, which causes the installation process to install curses.h as ncurses.h and make appropriate changes to headers and manpages. 20001009 + correct order of options/parameters in run_tic.in invocation of tic, which did not work with standard getopt() (reported by Ethan Butterfield <primus@veris.org>). + correct logic for 'reverse' variable in lib_vidattr.c, which was setting it true without checking if newmode had A_REVERSE set, e.g., using $TERM=ansi on OS/2 EMX (see 20000917). > patch by Todd C Miller: + add a few missing use_terminfo_vars() and fixes up _nc_tgetent(). Previously, _nc_cgetset() would still get called on cp so the simplest thing is to set cp to NULL if !use_terminfo_vars(). + added checks for an empty $HOME environment variable. > patches for OS/2 EMX (Ilya Zakharevich): + modify convert_configure.pl to support INSTALL. Change compiler options in that script to use multithreading, needed for the mouse. + modify OS/2 mouse support, retrying as a 2-button mouse if code fails to set up a 3-button mouse. + improve code for OS/2 mouse support, using _nc_timed_wait() to replace select() call. 20001007 + change type of ospeed variable back to short to match its use in legacy applications (reported by Andrey A Chernov). + add case to configure script for --enable-rpath on IRIX (patch by Albert Chin-A-Young). + minor fix to position_check() function, to ensure it gets the whole cursor report before decoding. + add configure option --disable-assumed-color, to allow pre-5.1 convention of default colors used for color-pair 0 to be configured (see assume_default_colors()). + rename configure option --enable-hashmap --disable-hashmap, and reorder the configure options, splitting the experimental and development + add configure option --disable-root-environ, which tells ncurses to disregard $TERMINFO and similar environment variables if the current user is root, or running setuid/setgid (based on discussion with several people). + modified misc/run_tic.in to use tic -o, to eliminate dependency on $TERMINFO variable for installs. + add table entry for plab_norm to tput, so it passes in strings for that capability. + modify parse_format() in lib_tparm.c to ignore precision if it is longer than 10000 (report by Jouko Pynnonen). + rewrote limit checks in lib_mvcur.c using new functions _nc_safe_strcat(), etc. Made other related changes to check lengths used for strcat/strcpy (report by Jouko Pynnonen <jouko@solutions.fi>). 20000930 + modify several descriptions, including those for setaf, setab, in include/Caps to indicate that the entries are parameterized. This information is used to tell which strings are translated when converting to termcap. Fixes a problem where the generated termcap would contain a spurious "%p1" for the terminfo "%p1%d". + modify ld -rpath options (e.g., Linux, and Solaris) to use an absolute pathname for the build tree's lib directory (prompted by discussion with Albert Chin-A-Young). + modify "make install.man" and "make uninstall.man" to include tack's man-page. + various fixes for install scripts used to support configure --srcdir and --with-install-prefix (reported by Matthew Clarke <Matthew_Clarke@mindlink.bc.ca>). + make configure script checks on variables $GCC and $GXX consistently compare against 'yes' rather than test if they are nonnull, since either may be set to the corresponding name of the C or C++ compiler (report/patch by Albert Chin-A-Young). 20000923 + modify rs2 capability in xterm-r6 and similar where cursor save/restore bracketed the sequence for resetting video attributes. The cursor restore would undo that (report by John Hawkinson <jhawk@MIT.EDU> (see NetBSD misc/11052)). + using parameter check added to tic, corrected 27 typos in terminfo.src -TD + modify tic to verify that its inputs are really files, in case someone tries to read a directory (or /dev/zero). + add a check for empty buffers returned by fgets() in comp_scan.c next_char() function, in case tic is run on a non-text file (fixes a core dump reported by Aaron Campbell <aaron@cs.dal.ca>). + add to railroad.c some code exercising tgoto(), providing an alternate form of display if the terminal supports cursor addressing. + split-out tgoto() again, this time into new file lib_tgoto.c, and implement a conventional BSD-style tgoto() which is used if the capability string does not contain terminfo-style padding or parameters (requested by Andrey A Chernov). + add check to tic which reports capabilities that do not reference the expected number of parameters. + add error checking to infocmp's -v and -m options to ensure that the option value is indeed a number. + some cleanup of logic in _nc_signal_handler() to verify if SIGWINCH handler is setup. Separated the old/new sigaction data for SIGTSTP from the other signals. 20000917 + add S0, E0 extensions to screen's terminfo entry, which is another way to solve the misconfiguration issue -TD + completed special case for tgoto from 20000916 20000916 + update xterm terminfo entries to match XFree86 xterm patch #146 -TD + add Matrix Orbital terminfo entries (from Eric Z Ayers <eric@ale.org>). + add special case to lib_tparm.c to allow 'screen' program to use a termcap-style parameter "%." to tgoto() for switching character sets. + use LN_S substitution in run_tic.in, to work on OS/2 EMX which has no symbolic links. + updated notes in README.emx regarding autoconf patches. + replace a lookup table in lib_vidattr.c used to decode no_color_video with a logic expression (suggested by Philippe Blain). + add a/A toggle to ncurses.c 'b' test, which clears/sets alternate character set attribute from the displayed text. + correct inequality in parameter analysis of rewritten lib_tparm.c which had the effect of ignoring p9 in set_attributes (sgr), breaking alternate character set (reported by Piotr Majka <charvel@link.pl>). + correct ifdef'ing for GCC_PRINTF, GCC_SCANF which would not compile with Sun WorkShop compilers since these tokens were empty (cf: 20000902, reported by Albert Chin-A-Young). 20000909 + correct an uninitialized parameter to open_tempfile() in tic.c which made "tic -I" give an ambiguous error message about tmpnam. + add special case in lib_vidattr.c to reset underline and standout for devices that have no sgr0 defined (patch by Don Lewis <Don.Lewis@tsc.tdk.com>). Note that this will not work for bold mode, since there is no exit-bold-mode capability. + improved patch for Make_Enum_Type (patch by Juergen Pfeifer). + modify tparm to disallow arithmetic on strings, analyze the varargs list to read strings as strings and numbers as numbers. + modify tparm's internal function spop() to treat a null pointer as an empty string. + modify tput program so it can be renamed or invoked via a link as 'reset' or 'init', producing the same effect as 'tput reset' or 'tput init'. + add private entrypoint _nc_basename(), use to consolidate related code in progs, as well as accommodating OS/2 EMX pathnames. + remove NCURSES_CONST line from edit_cfg.sh to compensate for its removal (except via AC_SUBST) from configure.in, making --enable-const work again (reported by Juergen Pfeifer). + regen'd configure to pick up "hpux*" change from 20000902. 20000902 + modify tset.c to check for transformed "reset" program name, if any. + add a check for null pointer in Make_Enum_Type() (reported by Steven W Orr <steveo@world.std.com>). + change functions _nc_parse_entry() and postprocess_termcap() to avoid using strtok(), because it is non-reentrant (reported by Andrey A Chernov <ache@nagual.pp.ru>). + remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. This differed from the "hpux*" case by using reversed symbolic links, which made the 5.1 version not match the configuration of 5.0 shared libraries (reported by Albert Chin-A-Young). + correct a dependency in Ada95/src/Makefile.in which prevented building with configure --srcdir (patch by H Nanosecond <aldomel@ix.netcom.com>). + modify ifdef's in curses.h.in to avoid warning if GCC_PRINTF or GCC_SCANF was not previously defined (reported by Pavel Roskin <proski@gnu.org>). + add MKncurses_def.sh to generate fallback definitions for ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in code to consistently use "#if" rather than "#ifdef". 20000826 + add QNX qansi entries to terminfo -TD + add os2 entry to misc/emx.src (<jmcoopr@webmail.bmi.net>). + add configure option --with-database to allow specifying a different terminfo source-file to install. On OS/2 EMX, this defaults to misc/emx.src + change misc/run_tic.sh to derive it from misc/run_tic.in, to simplify setting .exe extension on OS/2 EMX. + add .exe extension in Ada95/gen/Makefile.in, Ada95/samples/Makefile.in, for OS/2 EMX (reported by <jmcoopr@webmail.bmi.net>). + add configure check for filesystems (such as OS/2 EMX) which do not distinguish between upper/lowercase filenames, use this to fix tags rules in makefiles. + initialize fds[] array to 0's in _nc_timed_wait(); apparently poll() only sets the revents members of that array when there is activity corresponding to the related file (report by Glenn Cooper <gcooper@qantas.com.au>, using Purify on Solaris 5.6). + change configure script to use AC_CANONICAL_SYSTEM rather than AC_CANONICAL_HOST, which means that configure --target will set a default program-prefix. + add note on cross-compiling to INSTALL (which does not rely on the AC_CANONICAL_* macros). 20000819 + add cases for EMX OS/2 to config.guess, config.sub + new version of config.guess, config.sub from lynx 2.8.4dev.7 + add definitions via transform.h to allow tic and tput to check for the transformed aliases rather than the original infotocap, etc. + simplify transform-expressions in progs/Makefile.in, make the uninstall rule work for transformed program names. + change symbol used by --install-prefix configure option from INSTALL_PREFIX to DESTDIR (the latter has become common usage although the name is misleading). + modify programs to use curses_version() string to report the version of ncurses with which they are compiled rather than the NCURSES_VERSION string. The function returns the patch level in addition to the major and minor version numbers. 20000812 + modify CF_MAN_PAGES configure macro to make transformed program names a parameter to that macro rather than embedding them in the macro. + newer config.guess, config.sub (reference version used in lynx 2.8.4dev.7). + add configure option --with-default-terminfo-dir=DIR to allow specifying the default terminfo database directory (request by Albert Chin-A-Young). + minor updates for terminfo.src from FreeBSD termcap change-history. + correct notes in README and INSTALL regarding documentation files that were moved from misc directory to doc (report by Rich Kulawiec <rsk@gsp.org>). + change most remaining unquoted parameters of 'test' in configure script to use quotes, for instance fixing a problem in the --disable-database option (reported by Christian Mondrup <scancm@biobase.dk>). + minor adjustments to work around some of the incompatibilities/bugs in autoconf 2.29a alpha. + add -I/usr/local/include when --with-ncurses option is used in test/configure script. + correct logic in adjust_cancels(), which did not check both alternatives when reclassifying an extended name between boolean, number and string, causing an infinite loop in tic. 20000730 + correct a missing backslash in curses.priv.h 20000729 + change handling of non_dest_scroll_region in tty_update.c to clear text after it is shifted in rather than before shifting out. Also correct row computation (reported by Ruediger Kuhlmann <uck4@rz.uni-karlsruhe.de>). + add/use new trace function to display chtype values from winch() and getbkgd(). + add trace mask TRACE_ATTRS, alter several existing _tracef calls that trace attribute changes under TRACE_CALLS to use this. + modify MKlib_gen.sh so that functions returning chtype will call returnChar(). + add returnChar() trace, for functions returning chtype. + change indent.pro to line up parenthesis. 20000722 + fix a heap problem with the c++ binding (report by <alexander_liberson@ninewest.com>, patch by Juergen Pfeifer). + minor adjustment to ClrToEOL() to handle an out-of-bounds parameter. + modify the check for big-core to force a couple of memory accesses, which may work as needed for older/less-capable machines (if not, there's still the explicit configure option). > fixes based on diff's for Amiga and BeOS found at + alter definition of NCURSES_CONST to make it non-empty. + add amiga-vnc terminfo entry. + redefine 'TEXT' in menu.h for AMIGA, since it is reported to have an (unspecified) symbol conflict. + replaced case-statement in _nc_tracebits() for CSIZE with a table to simplify working around implementations that define random combinations of the related macros to zero. + modify configure test for tcgetattr() to allow for old implementations, e.g., on BeOS, which only defined it as a macro. > patches by Bruno Haible: + when checking LC_ALL/LC_CTYPE/LANG environment variables for UTF-8 locale, ignore those which are set to an empty value, as per SUSV2. + encode 0xFFFD in UTF-8 with 3 bytes, not 2. + modify _nc_utf8_outch() to avoid sign-extension when checking for out-of-range value. 20000715 + correct manlinks.sed script to avoid using ERE "\+", which is not understood by older versions of sed (patch by Albert Chin-A-Young). + implement configure script options that transform installed program names, e.g., --program-prefix, including the manpage names and cross references (patch by Albert Chin-A-Young <china@thewrittenword.com>). + correct several mismatches between manpage filename and ".TH" directives, renaming dft_fgbg.3x to default_colors.3x and menu_attribs.3x to menu_attributes.3x (report by Todd C Miller). + correct missing includes for <string.h> in several places, including the C++ binding. This is not noted by gcc unless we use the -fno-builtin option (reported by Igor Schein <igor@txc.com>). +). 20000708 5.1 release for upload to + document configure options in INSTALL. + add man-page for ncurses trace functions. + correct return value shown in curs_touch.3x for is_linetouched() and is_wintouched(), in curs_initscr.3x for isendwin(), and in curs_termattr.3x for has_ic() and has_il(). + add prototypes for touchline() and touchwin(), adding them to the list of generated functions. + modify fifo_push() to put ERR into the fifo just like other values to return from wgetch(). It was returning without doing that, making end-of-file condition incorrectly return a 0 (reported by Todd C Miller). + uncomment CC_SHARED_OPTS for progs and tack (see 971115), since they are needed for SCO OpenServer. + move _nc_disable_period from free_ttype.c to comp_scan.c to appease dynamic loaders on SCO and IRIX64. + add "-a" option to test/ncurses.c to invoke assume_default_colors() for testing. + correct assignment in assume_default_colors() which tells ncurses whether to use default colors, or the assumed ones (reported by Gary Funck <gary@Intrepid.Com>). + review/correct logic in mk-1st.awk for making symbolic links for shared libraries, in particular for FreeBSD, etc. + regenerate misc/*.def files for OS/2 EMX dll's. + correct quoting of values for CC_SHARED_OPTS in aclocal.m4 for cases openbsd2*, openbsd*, freebsd* and netbsd* (patch by Peter Wemm) (err in 20000610). + minor updates to release notes, as well as adding/updating URLs for examples cited in announce.html > several fixes from Philippe Blain <philippe.blain2@freesbee.fr>: + correct placement of ifdef for NCURSES_XNAMES in function _nc_free_termtype(), fixes a memory leak. + add a call to _nc_synchook() to the end of function whline() like that in wvline() (difference was in 1.9.4). + make ClearScreen() a little faster by moving two instances of UpdateAttr() out of for-loops. + simplify ClrBottom() by eliminating the tstLine data, using for-loops (cf: 960428). 20000701 pre-release + change minor version to 1, i.e., ncurses 5.1 + add experimental configure option --enable-colorfgbg to check for $COLORTERM variable as set by rxvt/aterm/Eterm. + add Eterm terminfo entry (Michael Jennings <mej@valinux.com>). + modify manlinks.sed to pick aliases from the SYNOPSIS section, and several manpages so manlinks.sed can find aliases for creating symbolic links. + add explanation to run_tic.sh regarding extended terminal capabilities. + change message format for edit_cfg.sh, since some people interpret it as a warning. + correct unescaped '$' in sysv5uw7*|unix_sv* rule for CF_SHARED_OPTS configure macro (report by Thanh Ma <Thanh.Ma@casi-rusco.com>). + correct logic in lib_twait.c as used by lib_mouse.c for GPM mouse support when poll() is used rather than select() (prompted by discussion with David Allen <DAllen24@aol.com>). 20000624 pre-release + modify TransformLine() to check for cells with different color pairs that happen to render the same display colors. + apply $NCURSES_NO_PADDING to cost-computation in mvcur(). + improve cost computation in PutRange() by accounting for the use of parm_right_cursor in mvcur(). + correct cost computation in EmitRange(), which was not using the normalized value for cursor_address. + newer config.guess, config.sub (reference version used in TIN 1.5.6). 20000617 + update config.guess, config.sub (reference version used in PCRE 3.2). + resync changes to gnathtml against version 1.22, regenerated html files under doc/html/ada using this (1.22.1.1). + regenerated html files under doc/html/man after correcting top and bottom margin options for man2html in dist.mk + minor fixes to test programs ncurses 'i' and testcurs program to make the subwindow's background color cover the subwindow. + modify configure script so AC_MSG_ERROR is temporarily defined to a warning in AC_PROG_CXX to make it recover from a missing C++ compiler without requiring user to add --without-cxx option (adapted from comment by Akim Demaille <akim@epita.fr> to autoconf mailing list). + modify headers.sh to avoid creating temporary files in the build directory when installing headers (reported by Sergei Pokrovsky <pok@nbsp.nsk.su>) 20000610 + regenerated the html files under doc/html/ada/files and doc/html/ada/funcs with a slightly-improved gnathtml. + add kmous capability to linux terminfo entry to allow it to use xterm-style events provided by gpm patch by Joerg Schoen. + make the configure macro CF_SHARED_OPTS a little smarter by testing if -fPIC is supported by gcc rather than -fpic. The former option allows larger symbol tables. + update config.guess and config.sub (patches by Kevin Buettner <kev@primenet.com> (for elf64_ia64), Bernd Kuemmerlen <bkuemmer@mevis.de> (for MacOS X)). + add warning for 'tic -cv' about use of '^?' in terminfo source, which is an extension. 20000527 + modify echo() behavior of getch() to match Solaris curses for carriage return and backspace (reported by Neil Zanella). + change _nc_flush() to a function. + modify delscreen() to check if the output stream has been closed, and if so, free the buffer allocated for setbuf (this provides an ncurses-specific way to avoid a memory leak when repeatedly calling newterm reported by Chipp C <at_1@zdnetonebox.com>). + correct typo in curs_getch.3x manpage regarding noecho (reported by David Malone <dwmalone@maths.tcd.ie>). + add a "make libs" rule. + make the Ada95 interface build with configure --enable-widec. + if the configure --enable-widec option is given, append 'w' to names of the generated libraries (e.g., libncursesw.so) to avoid conflict with existing ncurses libraries. 20000520 + modify view.c to make a rudimentary viewer of UTF-8 text if ncurses is configured with the experimental wide-character support. + add a simple UTF-8 output driver to the experimental wide-character support. If any of the environment variables LC_ALL, LC_CTYPE or LANG contain the string "UTF-8", this driver will be used to translate the output to UTF-8. This works with XFree86 xterm. + modify configure script to allow building shared libraries on BeOS (from a patch by Valeriy E Ushakov). + modify lib_addch.c to allow repeated update to the lower-right corner, rather than displaying only the first character written until the cursor is moved. Recent versions of SVr4 curses can update the lower-right corner, and behave this way (reported by Neil Zanella). + add a limit-check in _nc_do_color(), to avoid using invalid color pair value (report by Brendan O'Dea <bod@compusol.com.au>). 20000513 + the tack program knows how to use smcup and rmcup but the "show caps that can be tested" feature did not reflect this knowledge. Correct the display in the menu tack/test/edit/c (patch by Daniel Weaver). + xterm-16color does allow bold+colors, removed ncv#32 from that terminfo entry. 20000506 + correct assignment to SP->_has_sgr_39_49 in lib_dft_fgbg.c, which broke check for screen's AX capability (reported by Valeriy E Ushakov <uwe@ptc.spbu.ru>). + change man2html rule in dist.mk to workaround bug in some man-programs that ignores locale when rendering hyphenation. + change web- and ftp-site to dickey.his.com 20000429 + move _nc_curr_token from parse_entry.c to comp_scan.c, to work around problem linking tack on MacOS X DP3. + include <sys/time.h> in lib_napms.c to compile on MacOS X DP3 (reported by Gerben Wierda <wierda@holmes.nl>). + modify lib_vidattr.c to check for ncv fixes when pair-0 is not default colors. + add -d option to ncurses.c, to turn on default-colors for testing. + add a check to _nc_makenew() to ensure that newwin() and newpad() calls do not silently fail by passing too-large limits. + add symbol NCURSES_SIZE_T to use rather than explicit 'short' for internal window and pad sizes. Note that since this is visible in the WINDOW struct, it would be an ABI change to make this an 'int' (prompted by a question by Bastian Trompetter <btrompetter@firemail.de>, who attempted to create a 96000-line pad). 20000422 + add mgterm terminfo entry from NetBSD, minor adjustments to sun-ss5, aixterm entries -TD + modify tack/ansi.c to make it more tolerant of bad ANSI replies. An example of an illegal ANSI resonse can be found using Microsoft's Telnet client. A correct display can be found using a VT-4xx terminal or XFree86 xterm with: XTerm*VT100*decTerminalID: 450 (patch by Daniel Weaver). + modify gdc.c to recognize 'q' for quit, 's' for single-step and ' ' for resume. Add '-n' option to force gdc's standard input to /dev/null, to both illustrate the use of newterm() for specifying alternate inputs as well as for testing signal handling. + minor fix for configure option --with-manpage-symlinks, for target directories that contain a period ('.') (reported by Larry Virden). 20000415 + minor additions to beterm entry (feedback from Rico Tudor) -TD + corrections/updates for some IBM terminfo entries -TD + modify _nc_screen_wrap() so that when exiting curses mode with non-default colors, the last line on the screen will be cleared to the screen's default colors (request by Alexander V Lukyanov). + modify ncurses.c 'r' example to set nonl(), allowing control/M to be read for demonstrating the REQ_NEW_LINE operation (prompted by a question by Tony L Keith <tlkeith@keithconsulting.com>). + modify ncurses.c 'r' example of field_info() to work on Solaris 2.7, documented extension of ncurses which allows a zero pointer. + modify fmt_complex() to avoid buffer overflow in case of excess recursion, and to recognize "%e%?" as a synonym for else-if, which means that it will not recur for that special case. + add logic to support $TERMCAP variable in case the USE_GETCAP symbol is defined (patch by Todd C Miller). + modify one of the m4 files used to generate the Ada95 sources, to avoid using the token "symbols" (patch by Juergen Pfeifer). 20000408 + add terminfo entries bsdos-pc-m, bsdos-pc-mono (Jeffrey C Honig) + correct spelling error in terminfo entry name: bq300-rv was given as bg300-rv in esr's version. + modify redrawwin() macro so its parameter is fully parenthesized (fixes Debian bug report #61088). + correct formatting error in dump_entry() which set incorrect column value when no newline trimming was needed at the end of an entry, before appending "use=" clauses (cf: 960406). 20000401 + add configure option --with-manpage-symlinks + change unctrl() to render C1 characters (128-159) as ~@, ~A, etc. + change makefiles so trace() function is provided only if TRACE is defined, e.g., in the debug library. Modify related calls to _tracechar() to use unctrl() instead. 20000325 + add screen's AX capability (for ECMA SGR 39 and 49) to applicable terminfo entries, use presence of this as a check for a small improvement in setting default colors. + improve logic in _nc_do_color() implementing assume_default_colors() by passing in previous color pair info to eliminate redundant call to set_original_colors(). (Part of this is from a patch by Alexander V Lukyanov). + modify warning in _nc_trans_string() about a possibly too-long string to do this once only rather than for each character past the threshold (600). Change interface of _nc_trans_string() to allow check for buffer overflow. + correct use of memset in _nc_read_entry_source() to initialize ENTRY struct each time before reading new data into it, rather than once per loop (cf: 990301). This affects multi-entry in-core operations such as "infocmp -Fa". 20000319 + remove a spurious pointer increment in _nc_infotocap() changes from 20000311. Add check for '.' in format of number, since that also is not permitted in termcap. + correct typo in rxvt-basic terminfo from temporary change made while integrating 20000318. 20000318 + revert part of the vt220 change (request by Todd C Miller). + add ansi-* terminfo entries from ESR's version. + add -a option to tic and infocmp, which retains commented-out capabilities during source translation/comparison, e.g., captoinfo and infotocap. + modify cardfile.c to display an empty card if no input data file is found, fixes a core dump in that case (reported by Bruno Haible). + correct bracketing in CF_MATH_LIB configure macro, which gave wrong result for OS/2 EMX. + supply required parameter for _nc_resolve_uses() call in read_termcap.c, overlooked in 20000311 (reported by Todd C Miller). > patches by Bruno Haible <haible@ilog.fr>: + fix a compiler warning in fty_enum.c + correct LIB_PREFIX expression for DEPS_CURSES in progs, tack makefiles, which resulted in redundant linking (cf: 20000122). 20000311 + make ifdef's for BROKEN_LINKER consistent (patch by Todd C Miller). + improved tack/README (patch by Daniel Weaver). + modify tput.c to ensure that unspecified parameters are passed to tparm() as 0's. + add a few checks in infocmp to guard against buffer overflow when displaying string capabilities. + add check for zero-uses in infocmp's file_comparison() function before calling _nc_align_termtype(). Otherwise one parameter is indexed past the end of the uses-array. + add an option -q to infocmp to specify the less verbose output, keeping the existing format as the default, though not retaining the previous behavior that made the -F option compare each entry to itself. + adapted patch by ESR to make infocmp -F less verbose -TD (the submitted patch was unusable because it did not compile properly) + modify write_entry.c to ensure that absent or cancelled booleans are written as FALSE, for consistency with infocmp which now assumes this. Note that for the small-core configuration, tic may not produce the same result as before. + change some private library interfaces used by infocmp, e.g., _nc_resolve_uses(). + add a check in _nc_infotocap() to ensure that cm-style capabilities accept only %d codes when converting the format from terminfo to termcap. + modify ENTRY struct to separate the data in 'parent' into the name and link values (the original idea to merge both into 'parent' was not good). + discard repair_acsc(tterm); > patch by Juergen Pfeifer: + drop support for gnat 3.10 + move generated documentation and html files under ./doc directory, adding makefile rules for this to dist.mk 20000304 + correct conflicting use of tparm() in 20000226 change to tic, which made it check only one entry at a time. + fix errors in ncurses-intro.html and hackguide.html shown by Dave Raggett's tidy. + make the example in ncurses-intro.html do something plausible, and corrected misleading comment (reported by Neil Zanella). + modify pnoutrefresh() to set newscr->_leaveok as wnoutrefresh() does, to fix a case where the cursor position was not updated as in Solaris (patch by David Mosberger <davidm@hpl.hp.com>). + add a limit-check for wresize() to ensure that a subwindow does not address out of bounds. + correct offsets used for subwindows in wresize() (patch by Michael Andres <ma@suse.de>). + regenerate html'ized manual pages with man2html 3.0.1 (patch by Juergen Pfeifer). This generated a file with a space in its name, which I removed. + fix a few spelling errors in tack. + modify tack/Makefile.in to match linker options of progs/Makefile.in; otherwise it does not build properly for older HPUX shared library configurations. + add several terminfo entries from esr's "11.0". 20000226 + make 'tput flash' work properly for xterm by flushing output in delay_output() when using napms(), and modifying xterm's terminfo to specify no padding character. Otherwise, xterm's reported baud rate can mislead ncurses into producing too few padding characters (Debian #58530). + add a check to tic for consistency between sgr and the separate capabilities such as smso, use this to check/correct several terminfo entries (Debian #58530). + add a check to tic if cvvis is the same as cnorm, adjusted several terminfo entries to remove the conflict (Debian #58530). + correct prototype shown in attr_set()/wattr_set() manpages (fixes Debian #53962). + minor clarification for curs_set() and leaveok() manpages. + use mkstemp() for creating temporary file for tic's processing of $TERMCAP contents (fixes Debian #56465). + correct two errors from integrating Alexander's changes: did not handle the non-bce case properly in can_erase_with() (noted by Alexander), and left fg/bg uninitialized in the pair-zero case of _nc_do_color() (reported by Dr Werner Fink <werner@suse.de> and Ismael Cordeiro <ismael@cordeiro.com>). 20000219 + store default-color code consistently as C_MASK, even if given as -1 for convenience (adapted from patches by Alexander V Lukyanov). > patches by Alexander V Lukyanov: + change can_clear_with() macro to accommodate logic for assume_default_colors(), making most of the FILL_BCE logic unnecessary. Made can_clear_with() an inline function to make it simpler to read. 20000212 + corrected form of recent copyright dates. + minor corrections to xterm-xf86-v333 terminfo entry -TD > patches by Alexander V Lukyanov: + reworded dft_fgbg.3x to avoid assuming that the terminal's default colors are white on black. + fix initialization of tstLine so that it is filled with current blank character in any case. Previously it was possible to have it filled with old blank. The wrong over-optimization was introduced in 991002 patch. (it is not very critical as the only bad effect is not using clr_eos for clearing if blank has changed). 20000205 + minor corrections/updates to several terminfo entries: rxvt-basic, vt520, vt525, ibm5151, xterm-xf86-v40 -TD + modify ifdef's for poll() to allow it to use <sys/poll.h>, thereby allowing poll() to be used on Linux. + add CF_FUNC_POLL macro to check if poll() is able to select from standard input. If not we will not use it, preferring select() (adapted from patch by Michael Pakovic <mpakovic@fdn.com>). + update CF_SHARED_OPTS macro for SCO Unixware 7.1 to allow building shared libraries (reported/tested by Thanh <thanhma@mediaone.net>). + override $LANGUAGE in build to avoid incorrect ordering of keynames. + correct CF_MATH_LIB parameter, must be sin(x), not sqrt(x). 20000122 + resync CF_CHECK_ERRNO and CF_LIB_PREFIX macros from tin and xterm -TD + modify CF_MATH_LIB configure macro to parameterize the test function used, for reuse in dialog and similar packages. + correct tests for file-descriptors in OS/2 EMX mouse support. A negative value could be used by FD_SET, causing the select() call to wait indefinitely. 20000115 + additional fixes for non-bce terminals (handling of delete_character) to work when assume_default_colors() is not specified. + modify warning message from _nc_parse_entry() regarding extended capability names to print only if tic/infocmp/toe have the -v flag set, and not at all in ordinary user applications. Otherwise, this warning would be shown for screen's extended capabilities in programs that use the termcap interface (reported by Todd C Miller). + modify use of _nc_tracing from programs such as tic so their debug level is not in the same range as values set by trace() function. + small panel header cleanup (patch by Juergen Pfeifer). + add 'railroad' demo for termcap interface. + modify 'tic' to write its usage message to stderr (patch by Todd C Miller). 20000108 + add prototype for erase() to curses.h.in, needed to make test programs build with c++/g++. + add .c.i and .c.h suffix rules to generated makefiles, for debugging. + correct install rule for tack.1; it assumed that file was in the current directory (reported by Mike Castle <dalgoda@ix.netcom.com>). + modify terminfo/termcap translation to suppress acsc before trying sgr if the entry would be too large (patch by Todd C Miller). + document a special case of incompatiblity between ncurses 4.2 and 5.0, add a section for this in INSTALL. + add TRACE_DATABASE flag for trace(). 20000101 + update mach, add mach-color terminfo entries based on Debian diffs for ncurses 5.0 -TD + add entries for xterm-hp, xterm-vt220, xterm-vt52 and xterm-noapp terminfo entries -TD + change OTrs capabilities to rs2 in terminfo.src -TD + add obsolete and extended capabilities to 'screen' terminfo -TD + corrected conversion from terminfo rs2 to termcap rs (cf: 980704) + make conversion to termcap ug (underline glitch) more consistently applied. + fix out-of-scope use of 'personal[]' buffer in 'toe' (this error was in the original pre-1.9.7 version, when $HOME/.terminfo was introduced). + modify 'toe' to ignore terminfo directories to which it has no permissions. + modify read_termtype(), fixing 'toe', which could dump core when it found an incomplete entry such as "dumb" because it did not initialize its buffer for _nc_read_file_entry(). + use -fPIC rather than -fpic for shared libraries on Linux, not needed for i386 but some ports (from Debian diffs for 5.0) -TD + use explicit VALID_NUMERIC() checks in a few places that had been overlooked, and add a check to ensure that init_tabs is nonzero, to avoid divide-by-zero (reported by Todd C Miller). + minor fix for CF_ANSI_CC_CHECK configure macro, for HPUX 10.x (from tin) -TD 19991218 + reorder tests during mouse initialization to allow for gpm to run in xterm, or for xterm to be used under OS/2 EMX. Also drop test for $DISPLAY in favor of kmous=\E[M or $TERM containing "xterm" (report by Christian Weisgerber <naddy@mips.rhein-neckar.de>). + modify raw() and noraw() to clear/restore IEXTEN flag which affects stty lnext on systems such as FreeBSD (report by Bruce Evans <bde@zeta.org.au>, via Jason Evans <jasone@canonware.com>). + fix a potential (but unlikely) buffer overflow in failed() function of tset.c (reported by Todd C Miller). + add manual-page for ncurses extensions, documented curses_version(), use_extended_names(). 19991211 + treat as untranslatable to termcap those terminfo strings which contain non-decimal formatting, e.g., hexadecimal or octal. + correct commented-out capabilities that cannot be translated to termcap, which did not check if a colon must be escaped. + correct termcap translation for "%>" and "%+", which did not check if a colon must be escaped, for instance. + use save_string/save_char for _nc_captoinfo() to eliminate fixed buffer (originally for _nc_infotocap() in 960301 -TD). + correct expression used for terminfo equivalent of termcap %B, adjust regent100 entry which uses this. + some cleanup and commenting of ad hoc cases in _nc_infotocap(). + eliminate a fixed-buffer in tic, used for translating comments. + add manpage for infotocap 19991204 + add kvt and gnome terminfo entries -TD + correct translation of "%%" by infotocap, which was emitted as "%". + add "obsolete" termcap strings to terminfo.src + modify infocmp to default to showing obsolete capabilities rather than terminfo only. + modify write_entry.c so that if extended names (i.e., configure --enable-tcap-names) are active, then tic will also write "obsolete" capabilities that are present in the terminfo source. + modify tic so that when running as captoinfo or infotocap, it initializes the output format as in -C and -I options, respectively. + improve infocmp and tic -f option by splitting long strings that do not have if-then-else construct, but do have parameters, e.g., the initc for xterm-88color. + refine MKtermsort.sh slightly by using bool for the *_from_termcap arrays. 19991127 + additional fixes for non-bce terminals (handling of clear_screen, clr_eol, clr_eos, scrolling) to work when assume_default_colors() is not specified. + several small changes to xterm terminfo entries -TD. + move logic for _nc_windows in lib_freeall.c inside check for nonnull SP, since it is part of that struct. + remove obsolete shlib-versions, which was unintentionally re-added in 970927. + modify infocmp -e, -E options to ensure that generated fallback.c type for Booleans agrees with term.h (reported by Eric Norum <eric@cls.usask.ca>). + correct configure script's use of $LIB_PREFIX, which did not work for installing the c++ directory if $libdir did not end with "/lib" (reported by Huy Le <huyle@ugcs.caltech.edu>). + modify infocmp so -L and -f options work together. + modify the initialization of SP->_color_table[] in start_color() so that color_content() will return usable values for COLORS greater than 8. + modify ncurses 'd' test in case COLORS is greater than 16, e.g., for xterm-88color, to limit the displayed/computed colors to 16. > patch by Juergen Pfeifer: + simplify coding of the panel library according to suggestions by Philippe Blain. + improve macro coding for a few macros in curses.priv.h 19991113 + modify treatment of color pair 0 so that if ncurses is configured to support default colors, and they are not active, then ncurses will set that explicitly, not relying on orig_colors or orig_pair. + add new extension, assume_default_colors() to provide better control over the use of default colors. + modify test programs to use more-specific ifdef's for existence of wresize(), resizeterm() and use_default_colors(). + modify configure script to add specific ifdef's for some functions that are included when --enable-ext-funcs is in effect, so their existence can be ifdef'd in the test programs. + reorder some configure options, moving those extensions that have evolved from experimental status into a new section. + change configure --enable-tcap-names to enable this by default. 19991106 + install tack's manpage (reported by Robert Weiner <robert@progplus.com>) + correct worm.c's handling of KEY_RESIZE (patch by Frank Heckenbach). + modify curses.h.in, undef'ing some symbols to avoid conflict with C++ STL (reported by Matt Gerassimoff <mgeras@ticon.net>) 19991030 + modify linux terminfo entry to indicate that dim does not mix with color (reported by Klaus Weide <kweide@enteract.com>). + correct several typos in terminfo entries related to missing '[' in CSI's -TD + fix several compiler warnings in c++ binding (reported by Tim Mooney for alphaev56-dec-osf4.0f + rename parameter of _nc_free_entries() to accommodate lint. + correct lint rule for tack, used incorrect list of source files. + add case to config.guess, config.sub for Rhapsody. + improve configure tests for libg++ and libstdc++ by omitting the math library (which is missing on Rhapsody), and improved test for the math library itself (adapted from path by Nelson H. F. Beebe). + explicitly initialize to zero several data items which were implicitly initialized, e.g., cur_term. If not explicitly initialized, their storage type is C (common), and causes problems linking on Rhapsody 5.5 using gcc 2.7.2.1 (reported by Nelson H. F. Beebe). + modify Ada95 binding to not include the linker option for Ada bindings in the Ada headers, but in the Makefiles instead (patch by Juergen Pfeifer). 19991023 5.0 release for upload to + effective with release of 5.0, change NCURSES_VERSION_PATCH to 4-digit year. + add function curses_version(), to return ncurses library version (request by Bob van der Poel). + remove rmam, smam from cygwin terminfo entry. + modify FreeBSD cons25 terminfo entry to add cnorm and cvvis, as well as update ncv to indicate that 'dim' conflicts with colors. + modify configure script to use symbolic links for FreeBSD shared libraries by default. + correct ranf() function in rain and worm programs to ensure it does not return 1.0 + hide the cursor in hanoi.c if it is running automatically. + amend lrtest.c to account for optimizations that exploit margin wrapping. + add a simple terminfo demo, dots.c + modify SIGINT/SIGQUIT handler to set a flag used in _nc_outch() to tell it to use write() rather than putc(), since the latter is not safe in a signal handler according to POSIX. + add/use internal macros _nc_flush() and NC_OUTPUT to hide details of output-file pointer in ncurses library. + uncomment CC_SHARED_OPTS (see 971115), since they are needed for SCO OpenServer. + correct CC_SHARED_OPTS for building shared libraries for SCO OpenServer. + remove usleep() from alternatives in napms(), since it may interact with alarm(), causing a process to be interrupted by SIGALRM (with advice from Bela Lubkin). + modify terminal_interface-curses-forms.ads.m4 to build/work with GNAT 3.10 (patch by Juergen Pfeifer). + remove part of CF_GPP_LIBRARY configure-script macro, which did not work with gcc 2.7.2.3 + minor fix to test/tclock.c to avoid beeping more than once per second + add 's' and ' ' decoding to test/rain.c 991016 pre-release + corrected BeOS code for lib_twait.c, making nodelay() function work. 991009 pre-release + correct ncurses' value for cursor-column in PutCharLR(), which was off-by-one in one case (patch by Ilya Zakharevich). + fix some minor errors in position_check() debugging code, found while using this to validate the PutCharLR() patch. + modify firework, lrtest, worm examples to be resizable, and to recognize 'q' for quit, 's' for single-step and ' ' for resume. + restore reverted change to terminal_interface-curses-forms.ads.m4, add a note on building with gnat 3.10p to Ada95/TODO. + add a copy of the standalone configure script for the test-directory to simplify testing on SCO and Solaris. 991002 pre-release + minor fixes for _nc_msec_cost(), color_content(), pair_content(), _nc_freewin(), ClrBottom() and onscreen_mvcur() (analysis by Philippe Blain, comments by Alexander V Lukyanov). + simplify definition of PANEL and eliminate internal functions _nc_calculate_obscure(), _nc_free_obscure() and _nc_override(), (patch by Juergen Pfeifer, analysis by Philippe Blain <bledp@voila.fr>)). + change renaming of dft_fgbg.3x to use_default_colors.3ncurses in man_db.renames, since Debian is not concerned with 14-character, since this does not work for gnat 3.10p + modify tclock example to be resizable (if ncurses' sigwinch handler is used), and in color. + use $(CC) rather than 'gcc' in MK_SHARED_LIB symbols, used for Linux shared library rules. 990925 pre-release + add newer NetBSD console terminfo entries + add amiga-8bit terminfo entry (from Henning 'Faroul' Peters <Faroul@beyond.kn-bremen.de>) + remove -lcurses -ltermcap from configure script's check for the gpm library, since they are not really necessary (a properly configured gpm library has no dependency on any curses library), and if the curses library is not installed, this would cause the test to fail. + modify tic's -C option so that terminfo "use=" clauses are translated to "tc=" clauses even when running it as captoinfo. + modify CF_STDCPP_LIBRARY configure macro to perform its check only for GNU C++, since that library conflicts with SGI's libC on IRIX-6.2 + modify CF_SHARED_OPTS configure macro to support build on NetBSD with ELF libraries (patch by Bernd Ernesti <bernd@arresum.inka.de>). + correct a problem in libpanel, where the _nc_top_panel variable was not set properly when bottom_panel() is called to hide a panel which is the only one on the stack (report/analysis by Michael Andres <ma@suse.de>, patch by Juergen Pfeifer). 990918 pre-release + add acsc string to HP 70092 terminfo entry (patch by Joerg Wunsch <j@interface-business.de>). + add top-level uninstall.data and uninstall.man makefile rules. + correct logic of CF_LINK_FUNCS configure script, from BeOS changes so that hard-links work on Unix again. + change default value of cf_cv_builtin_bool to 1 (suggested by Jeremy Buhler), making it less likely that a conflicting declaration of bool will be seen when compiling with C++. 990911 pre-release + improved configure checks for builtin.h + minor changes to C++ binding (remove static initializations, and make configure-test for parameter initializations) for features not allowed by vendor's C++ compilers (reported by Martin Mokrejs, this applies to SGI, though I found SCO has the same characteristics). + corrected quoting of ETIP_xxx definitions which support old versions of g++, e.g., those using -lg++ + remove 'L' code from safe_sprintf.c, since 'long double' is not widely portable. safe_sprintf.c is experimental, however, and exists mainly as a fallback for systems without snprintf (reported by Martin Mokrejs <mmokrejs@natur.cuni.cz>, for IRIX 6.2) + modify definition of _nc_tinfo_fkeys in broken-linker configuration so that it is not unnecessarily made extern (Jeffrey C Honig). 990904 pre-release + move definition for builtin.h in configure tests to specific check for libg++, since qt uses the same filename incompatibly. + correct logic of lib_termcap.c tgetstr function, which did not copy the result to the buffer parameter. Testing shows Solaris does update this, though of course tgetent's buffer is untouched (reported in Peter Edwards <peter.edwards@ireland.com> in mpc.lists.freebsd.current newsgroup. + corrected beterm terminfo entry, which lists some capabilities which are not actually provided by the BeOS Terminal. + add special logic to replace select() calls on BeOS, whose select() function works only for sockets. + correct missing escape in mkterm.h.awk.in, which caused part of the copyright noticed to be omitted (reported by Peter Wemm <peter@netplex.com.au>). > several small changes to make the c++ binding and demo work on OS/2 EMX (related to a clean reinstall of EMX): + correct library-prefix for c++ binding; none is needed. + add $x suffix to make_hash and make_keys so 'make distclean' works. + correct missing $x suffix for tack, c++ demo executables. + split CF_CXX_LIBRARY into CF_GPP_LIBRARY (for -lg++) and CF_STDCPP_LIBRARY (for -lstdc++) 990828 pre-release + add cygwin terminfo entry -TD + modify CF_PROG_EXT configure macro to set .exe extension for cygwin. + add configure option --without-cxx-binding, modifying the existing --without-cxx option to check only for the C++ compiler characteristics. Whether or not the C++ binding is needed, the configure script checks for the size/type of bool, to make ncurses match. Otherwise C++ applications cannot use ncurses. 990821 pre-release + updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO + minor corrections to beterm terminfo entry. + modify lib_setup.c to reject values of $TERM which have a '/' in them. + add ifdef's to guard against CS5, CS6, CS7, CS8 being zero, as more than one is on BeOS. That would break a switch statement. + add configure macro CF_LINK_FUNCS to detect and work around BeOS's nonfunctional link(). + improved configure macros CF_BOOL_DECL and CF_BOOL_SIZE to detect BeOS's bool, which is declared as an unsigned char. 990814 pre-release + add ms-vt100 terminfo entry -TD + minor fixes for misc/emx.src, based on testing with tack. + minor fix for test/ncurses.c, test 'a', in case ncv is not set. 990731 pre-release + minor correction for 'screen' terminfo entry. + clarify description of errret values for setupterm in manpage. + modify tput to allow it to emit capabilities for hardcopy terminals (patch by Goran Uddeborg <goeran@uddeborg.pp.se>). + modify the 'o' (panel) test in ncurses.c to show the panels in color or at least in bold, to test Juergen's change to wrefresh(). > patches by Juergen Pfeifer: + Fixes a problem using wbkgdset() with panels. It has actually nothing to with panels but is a problem in the implementation of wrefresh(). Whenever a window changes its background attribute to something different than newscr's background attribute, the whole window is touched to force a copy to newscr. This is an unwanted side-effect of wrefresh() and it is actually not necessary. A changed background attribute affects only further outputs of background it doesn't mean anything to the current content of the window. So there is no need to force a copy. (reported by Frank Heckenbach <frank@g-n-u.de>). + an upward compatible enhancement of the NCursesPad class in the C++ binding. It allows one to add a "viewport" window to a pad and then to use panning to view the pad through the viewport window. 990724 pre-release + suppress a call to def_prog_mode() in the SIGTSTP handler if the signal was received while not in curses mode, e.g., endwin() was called in preparation for spawning a shell command (reported by Frank Heckenbach <frank@g-n-u.de>) + corrected/enhanced xterm-r5, xterm+sl, xterm+sl-twm terminfo entries. + change test for xterm mouse capability: it now checks only if the user's $DISPLAY variable is set in conjunction with the kmous capability being present in the terminfo. Before, it checked if any of "xterm", "rxvt" or "kterm" were substrings of the terminal name. However, some emulators which are incompatible with xterm in other ways do support the xterm mouse capability. + reviewed and made minor changes in ncurses to quiet g++ warnings about shadowed or uninitialized variables. g++ incorrectly warns about uninitialized variables because it does not take into account short-circuit expression evaluation. + change ncurses 'b' test to start in color pair 0 and to show in the right margin those attributes which are suppressed by no_color_video, i.e., "(NCV)". + modify ifdef's in curses.h so that __attribute__ is not redefined when compiling with g++, but instead disabled the macros derived for __attribute__ since g++ does not consistently recognize the same keywords as gcc (reported by Stephan K Zitz <zitz@erf.net>). + update dependencies for term.h in ncurses/modules (reported by Ilya Zakharevich). 990710 pre-release + modify the form demo in ncurses.c to illustrate how to manipulate the field appearance, e.g, for highlighting or translating the field contents. + correct logic in write_entry from split-out of home_terminfo in 980919, which prevented update of $HOME/.terminfo (reported by Philip Spencer <pspencer@fields.utoronto.ca>). 990703 pre-release + modify linux terminfo description to make use of kernel 2.2.x mods that support cursor style, e.g., to implement cvvis (patch by Frank Heckenbach <frank@g-n-u.de>) + add special-case in setupterm to retain previously-saved terminal settings in cur_term, which happens when curses and termcap calls are mixed (from report by Bjorn Helgaas <helgaas@dhc.net>). + suppress initialization of key-tries in _nc_keypad() if we are only disabling keypad mode, e.g., in endwin() called when keypad() was not. + modify the Ada95 makefile to ensure that always the Ada files from the development tree are used for building and not the eventually installed ones (patch by Juergen Pfeifer). 990626 pre-release + use TTY definition in tack/sysdep.c rather than struct termios (reported by Philippe De Muyter). + add a fallback for strstr, used in lib_mvcur.c and tack/edit.c, not present on sysV68 (reported by Philippe De Muyter). + correct definition in comp_hash.c to build with configure --with-rcs-ids option. 990619 pre-release + modified ifdef's for sigaction and sigvec to ensure we do not try to handle SIGTSTP if neither is available (from report by Philippe De Muyter). > patch by Philippe De Muyter: + in tic.c, use `unlink' if `remove' is not available. + use only `unsigned' as fallback value for `speed_t'. Some files used `short' instead. 990616 pre-release + fix some compiler warnings in tack. + add a check for predefined bool type in CC, based on report that BeOS predefines a bool type. + correct logic for infocmp -e option, i.e., the configure --with-fallbacks option, which I'd not updated when implementing extended names (cf: 990301). The new implementation adds a "-E" option to infocmp -TD > patch by Juergen Pfeifer: + introduce the private type Curses_Bool in the Ada95 binding implementation. This is to clearly represent the use of "bool" also in the binding. It should have no effect on the generated code. + improve the man page for field_buffer() to tell the people, that the whole buffer including leading/trailing spaces is returned. This is a common source of confusion, so it's better to document it clearly. 990614 pre-release > patch by Juergen Pfeifer: + use pragma PreElaborate in several places. + change a few System.Address uses to more specific types. + change interface version-number to 1.0 + regenerate Ada95 HTML files. 990612 pre-release + modify lib_endwin.c to avoid calling reset_shell_mode(), return ERR if it appears that curses was never initialized, e.g., by initscr(). For instance, this guards against setting the terminal modes to strange values if endwin() is called after setupterm(). In the same context, Solaris curses will dump core. + modify logic that avoids a conflict in lib_vidattr.c between sgr0 and equivalent values in rmso or rmul by ensuring we do not modify the data which would be returned by the terminfo or termcap interfaces (reported by Brad Pepers <brad@linuxcanada.com>, cf: 960706). + add a null-pointer check for SP in lib_vidattr.c to logic that checks for magic cookies. + improve fallback declaration of 'bool' when the --without-cxx option is given, by using a 'char' on i386 and related hosts (prompted by discussion with Alexander V Lukyanov). 990605 pre-release + include time.h in lib_napms.c if nanosleep is used (patch by R Lindsay Todd <toddr@rpi.edu>). + add an "#undef bool" to curses.h, in case someone tries to define it, e.g., perl. + add check to tparm to guard against divide by zero (reported by Aaron Campbell <aaron@ug.cs.dal.ca>). 990516 pre-release + minor fix to build tack on CLIX (mismatched const). > patch by Juergen Pfeifer: + change Juergen's old email address with new one in the files where it is referenced. The Ada95 HTML pages are regenerated. + update MANIFEST to list the tack files. 990509 pre-release + minor fixes to make 'tack' build/link on NeXT (reported by Francisco A. Tomei Torres). 990417 pre-release + add 'tack' program (which is GPL'd), updating it to work with the modified TERMTYPE struct and making a fix to support setaf/setab capabilities. Note that the tack program is not part of the ncurses libraries, but an application which can be distributed with ncurses. The configure script will ignore the directory if it is omitted, however. + modify gpm mouse support so that buttons 2 and 3 are used for select/paste only when shift key is pressed, making them available for use by an application (patch by Klaus Weide). + add complete list of function keys to scoansi terminfo entry - TD 990410 pre-release + add a simple test program cardfile.c to illustrate how to read form fields, and showing forms within panels. + change shared-library versioning for the Hurd to be like Linux rather than *BSD (patch by Mark Kettenis <kettenis@wins.uva.nl>). + add linux-lat terminfo entry. + back-out _nc_access check in read_termcap.c (both incorrect and unnecessary, except to guard against a small window where the file's ownership may change). 990403 pre-release + remove conflicting _nc_free_termtype() function from test module lib_freeall.c + use _nc_access check in read_termcap.c for termpaths[] array (noted by Jeremy Buhler, indicating that Alan Cox made a similar patch). > patch by Juergen Pfeifer: + modify menu creation to not inherit status flag from the default menu which says that the associated marker string has been allocated and should be freed (bug reported by Marek Paliwoda" <paliwoda@kki.net.pl>) 990327 pre-release (alpha.gnu.org:/gnu/ncurses-5.0-beta1.tar.gz) + minor fixes to xterm-xfree86 terminfo entry - TD. + split up an expression in configure script check for ldconfig to workaround limitation of BSD/OS sh (reported by Jeff Haas <jmh@mail.msen.com>). + correct a typo in man/form_hook.3x (Todd C Miller). 990318 pre-release + parenthesize and undef 'index' symbol in c++ binding and demo, to accommodate its definition on NeXT (reported by Francisco A. Tomei Torres). + add sigismember() to base/sigaction.c compatibility to link on NeXT (reported by Francisco A. Tomei Torres). + further refinements to inequality in hashmap.c to cover a case with ^U in nvi (patch by Alexander V Lukyanov). 990316 pre-release + add fallback definition for getcwd, to link on NeXT. + add a copy of cur_term to tic.c to make it link properly on NeXT (reported by Francisco A. Tomei Torres). + change inequality in hashmap.c which checks the distance traveled by a chunk so that ^D command in nvi (scrolls 1/2 screen) will use scrolling logic (patch by Alexander V Lukyanov, reported by Jeffrey C Honig). 990314 pre-release + modify lib_color.c to handle a special case where the curscr attributes have been made obsolete (patch by Alexander V Lukyanov). + update BSD/OS console terminfo entries to use klone+sgr and klone+color (patch by Jeffrey C Honig). + update glibc addon configure script for extended capabilities. + correct a couple of warnings in the --enable-const configuration. + make comp_hash build properly with _nc_strdup(), on NeXT (reported by Francisco A. Tomei Torres <francisco.tomei@cwix.com>). 990313 pre-release + correct typos in linux-c initc string - TD + add 'crt' terminfo entry, update xterm-xfree86 entry - TD + remove a spurious argument to tparm() in lib_sklrefr.c (patch by Alexander V Lukyanov). 990307 pre-release + back-out change to wgetch because it causes a problem with ^Z handling in lynx (reported by Kim DeVaughn). 990306 pre-release + add -G option to tic and infocmp, to reverse the -g option. + recode functions in name_match.c to avoid use of strncpy, which caused a 4-fold slowdown in tic (cf: 980530). + correct a few warnings about sign-extension in recent changes. > patch by Juergen Pfeifer: + fixes suggested by Jeff Bradbury <jibradbury@lucent.com>: + improved parameter checking in new_fieldtype(). + fixed a typo in wgetch() timeout handling. + allow slk_init() to be called per newterm call. The internal SLK state is stored in the SCREEN struct after every newterm() and then reset for the next newterm. + fix the problem that a slk_refresh() refreshes stdscr if the terminal has true SLKs. + update HTML documentation for Ada binding. 990301 pre-release + remove 'bool' casts from definitions of TRUE/FALSE so that statements such as "#if TRUE" work. This was originally done to allow for a C++ compiler which would warn of implicit conversions between enum and int, but is not needed for g++ (reported by Kim DeVaughn). + add use_extended_names() function to allow applications to suppress read of the extended capabilities. + add configure option --enable-tcap-names to support logic which allows ncurses' tic to define new (i.e., extended) terminal capabilities. This is activated by the tic -x switch. The infocmp program automatically shows or compares extended capabilities. Note: This changes the Strings and similar arrays in the TERMTYPE struct so that applications which manipulate it must be recompiled. + use macros typeMalloc, typeCalloc and typeRealloc consistently throughout ncurses library. + add _nc_strdup() to doalloc.c. + modify define_key() to allow multiple strings to be bound to the same keycode. + correct logic error in _nc_remove_string, from 990220. > patch for Ada95 binding (Juergen Pfeifer): + regenerate some of the html documentation + minor cleanup in terminal_interface-curses.adb 990220 pre-release + resolve ambiguity of kend/kll/kslt and khome/kfnd/kich1 strings in xterm and ncsa terminfo entries by removing the unneeded ones. Note that some entries will return kend & khome versus kslt and kfnd, for PC-style keyboards versus strict vt220 compatiblity - TD + add function keybound(), which returns the definition associated with a given keycode. + modify define_key() to undefine the given string when no keycode is given. + modify keyok() so it works properly if there is more than one string defined for a keycode. + add check to tic to warn about terminfo descriptions that contain more than one key assigned to the same string. This is shown only if the verbose (-v) option is given. Moved related logic (tic -v) from comp_parse.c into the tic program. + add/use _nc_trace_tries() to show the function keys that will be recognized. + rename init_acs to _nc_init_acs (request by Alexander V Lukyanov). > patch for Ada95 binding (Juergen Pfeifer): + remove all the *_adabind.c from ncurses, menu and form projects. Those little helper routines have all been implemented in Ada and are no longer required. + The option handling routines in menu and form have been made more save. They now make sure that the unused bits in options are always zero. + modify configuration scripts to + use gnatmake as default compiler name. This is a safer choice than gcc, because some GNAT implementations use other names for the compilerdriver to avoid conflicts. + use new default installation locations for the Ada files according to the proposed GNU Ada filesystem standard (for Linux). + simplify the Makefiles for the Ada binding + rename ada_include directory to src. 990213 + enable sigwinch handler by default. + disable logic that allows setbuf to be turned off/on, because some implementations will overrun the buffer after it has been disabled once. 990206 + suppress sc/rc capabilities from terminal description if they appear in smcup/rmcup. This affects only scrolling optimization, to fix a problem reported by several people with xterm's alternate screen, though the problem is more general. > patch for Ada95 binding (Juergen Pfeifer): + removed all pragma Preelaborate() stuff, because the just released gnat-3.11p complains on some constructs. + fixed some upper/lower case notations because gnat-3.11p found inconsistent use. + used a new method to generate the HTML documentation of the Ada95 binding. This invalidates nearly the whole ./Ada95/html subtree. Nearly all current files in this subtree are removed 990130 + cache last result from _nc_baudrate, for performance (suggested by Alexander V Lukyanov). + modify ClrUpdate() function to workaround a problem in nvi, which uses redrawwin in SIGTSTP handling. Jeffrey C Honig reported that ncurses repainted the screen with nulls before resuming normal operation (patch by Alexander V Lukyanov). + generalize is_xterm() function a little by letting xterm/rxvt/kterm be any substring rather than the prefix. + modify lib_data.c to initialize SP. Some linkers, e.g., IBM's, will not link a module if the only symbols exported from the module are uninitialized ones (patch by Ilya Zakharevich). Ilya says that he has seen messages claiming this behavior conforms to the standard.) + move call on _nc_signal_handler past _nc_initscr, to avoid a small window where Nttyb hasn't yet been filled (reported by Klaus Weide). + (patch by Klaus Weide). + correct spelling of ACS_ names in curs_border.3x (reported by Bob van der Poel <bvdpoel@kootenay.com>). + correct a couple of typos in the macros supporting the configure --with-shlib-version option. 990123 + modify fty_regex.c to compile on HAVE_REGEXPR_H_FUNCS machine (patch by Kimio Ishii <ishii@csl.sony.co.jp>). + rename BSDI console terminfo entries: bsdos to bsdos-pc-nobold, and bsdos-bold to bsdos-pc (patch by Jeffrey C Honig). + modify tput to accept termcap names as an alternative to terminfo names (patch by Jeffrey C Honig). + correct a typo in term.7 (Todd C Miller). + add configure --with-shlib-version option to allow installing shared libraries named according to release or ABI versions. This parameterizes some existing logic in the configure script, and is intended for compatiblity upgrades on Digital Unix, which used versioned libraries in ncurses 4.2, but no longer does (cf: 980425). + resync configure script against autoconf 2.13 + patches + minor improvements for teraterm terminfo entry based on the program's source distribution. 990116 + change default for configure --enable-big-core to assume machines do have enough memory to resolve terminfo.src in-memory. + correct name of ncurses library in TEST_ARGS when configuring with debug library. + minor fixes to compile ncurses library with broken-linker with g++. + add --enable-broken-linker configure option, default to environment variable $BROKEN_LINKER (request by Jeffrey C Honig). + change key_names[] array to static since it is not part of the curses interface (reported by Jeffrey C Honig <jch@bsdi.com>). 990110 + add Tera Term terminfo entry - TD 990109 + reviewed/corrected macros in curses.h as per XSI document. + provide support for termcap PC variable by copying it from terminfo data and using it as the padding character in tputs (reported by Alexander V Lukyanov). + corrected iris-ansi and iris-ansi-ap terminfo entries for kent and kf9-kf12 capabilities, as well as adding kcbt. + document the mouse handling mechanism in menu_driver and make a small change in menu_driver's return codes to provide more consistency (patch by Juergen Pfeifer). + add fallback definition for NCURSES_CONST to termcap.h.in (reported by Uchiyama Yasushi <uch@nop.or.jp>). + move lib_restart.c to ncurses/base, since it uses curses functions directly, and therefore cannot be used in libtinfo.so + rename micro_char_size to micro_col_size, adding #define to retain old name. + add set_a_attributes and set_pglen_inch to terminfo structure, as per XSI and Solaris 2.5. + minor makefile files to build ncurses test_progs + update html files in misc directory to reflect changes since 4.2 990102 + disable scroll hints when hashmap is enabled (patch by Alexander V Lukyanov). + move logic for tic's verify of -e option versus -I and -C so that the terminfo data is not processed if we cannot handle -e (reported by Steven Schwartz <steves@unitrends.com>. + add test-driver traces to terminfo and termcap functions. + provide support for termcap ospeed variable by copying it from the internal cur_term member, and using ospeed as the baudrate reference for the delay_output and tputs functions. If an application does not set ospeed, the library behaves as before, except that _nc_timed_wait is no longer used, or needed, since ospeed always has a value. But the application can modify ospeed to adjust the output of padding characters (prompted by a bug report for screen 3.7.6 and email from Michael Schroeder <Michael.Schroeder@informatik.uni-erlangen.de>). + removed some unused ifdef's as part of Alexander's restructuring. + reviewed/updated curses.h, term.h against X/Open Curses Issue 4 Version 2. This includes making some parameters NCURSES_CONST rather than const, e.g., in termcap.h. + change linux terminfo entry to use ncv#2, since underline does not work with color 981226 + miscellaneous corrections for curses.h to match XSI. + change --enable-no-padding configure option to be normally enabled. + add section to ncurses manpage for environment variables. + investigated Debian bug report that pertains to screen 3.7.4/3.7.6 changes, found no sign of problems on Linux (or on SunOS, Solaris) running screen built with ncurses. + check if tmp_fp is opened in tic.c before closing it (patch by Pavel Roskin <pavel_roskin@geocities.com>). + correct several font specification typos in man-pages. 981220 + correct default value for BUILD_CC (reported by Larry Virden). 981219 + modify _nc_set_writedir() to set a flag in _nc_tic_dir() to prevent it from changing the terminfo directory after chdir'ing to it. Otherwise, a relative path in $TERMINFO would confuse tic (prompted by a Debian bug report). + correct/update ncsa terminfo entry (report by Larry Virden). + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur changes + add Mathew Vernon's mach console entries to terminfo.src + more changes, moving functions, as part of Alexander's restructuring. + modify configure script for GNU/Hurd share-library support, introduce BUILD_CC variable for cross compiling (patch by Uchiyama Yasushi <uch@nop.or.jp>) 981212 + add environment variable NCURSES_NO_SETBUF to allow disabling the setbuf feature, for testing purposes. + correct ifdef's for termcap.h versus term.h that suppress redundant declarations of prototypes (reported by H.J.Lu). + modify Makefile.os2 to add linker flags which allow multiple copies of an application to coexist (reported by Ilya Zakharevich). + update Makefile.glibc and associated configure script so that ncurses builds as a glibc add-on with the new directory configuration (reported by H.J.Lu). 981205 + modify gen_reps() function in gen.c to work properly on SunOS (sparc), which is a left-to-right architecture. + modify relative_move and tputs to avoid an interaction with the BSD-style padding. The relative_move function could produce a string to replace on the screen which began with a numeric character, which was then interpreted by tputs as padding. Now relative_move will not generate a string with a leading digit in that case (overwrite). Also, tputs will only interpret padding if the string begins with a digit; as coded it permitted a string to begin with a decimal point or asterisk (reported by Larry Virden). > patches by Juergen Pfeifer: + fix a typo in m_driver.c mouse handling and improves the error handling. + fix broken mouse handling in the Ada95 binding + make the Ada95 sample application menus work with the new menu mouse support + improve the mouse handling introduced by Ilya; it now handles menus with spacing. + repair a minor bug in the menu_driver code discovered during this rework. + add new function wmouse_trafo() to hide implementation details of _yoffset member of WINDOW struct needed for mouse coordinate transformation. 981128 + modify Ada95/gen/gen.c to avoid using return-value of sprintf, since some older implementations (e.g., SunOS 4.x) return the buffer address rather than its length. > patch by Rick Ohnemus: + modify demo.cc to get it to compile with newer versions of egcs. + trim a space that appears at the end of the table preprocessor lines ('\" t). This space prevents some versions of man from displaying the pages - changed to remove all trailing whitespace (TD) + finally, 'make clean' does not remove panel objects. > patches by Ilya Zakharevich: + allow remapping of OS/2 mouse buttons using environment variable MOUSE_BUTTONS_123 with the default value 132. + add mouse support to ncurses menus. 981121 + modify misc/makedef.cmd to report old-style .def file symbols, and to generate the .def files sorted by increasing names rather than the reverse. + add misc/*.ref which are J.J.G.Ripoll's dll definition files (renamed from misc/*.old), and updated based on the entrypoint coding he used for an older version of ncurses. + add README.emx, to document how to build on OS/2 EMX. + updates for config.guess, config.sub from Lynx > patches by Ilya Zakharevich: + minor fixes for mouse handling mode: a) Do not initialize mouse if the request is to have no mouse; b) Allow switching of OS/2 VIO mouse on and off. + modify Makefile.os2 to support alternative means of generating configure script, by translating Unix script with Perl. > patches by Juergen Pfeifer: + Updates MANIFEST to reflect changes in source structure + Eliminates a problem introduced with my last patch for the C++ binding in the panels code. It removes the update() call done in the panel destructor. + Changes in the Ada95 binding to better support systems where sizeof(chtype)!=sizeof(int) (e.g. DEC Alpha). 981114 + modify install-script for manpages to skip over .orig and .rej files (request by Larry Virden). > patches/discussion by Alexander V Lukyanov: + move base-library sources into ncurses/base and tty (serial terminal) sources into ncurses/tty, as part of Alexander V Lukyanov's proposed changes to ncurses library. + copy _tracemouse() into ncurses.c so that lib_tracemse.c need not be linked into the normal ncurses library. + move macro winch to a function, to hide details of struct ldat > patches by Juergen Pfeifer: + fix a potential compile problem in cursesw.cc + some Ada95 cosmetics + fix a gen.c problem when compiling on 64-Bit machines + fix Ada95/gen/Makefile.in "-L" linker switch + modify Ada95 makefiles to use the INSTALL_PREFIX setting. 981107 + ifdef'd out lib_freeall.c when not configured. + rename _tracebits() to _nc_tracebits(). + move terminfo-library sources into ncurses/tinfo, and trace-support functions into ncurses/trace as part of Alexander V Lukyanov's proposed changes to ncurses library. + modify generated term.h to always specify its own definitions for HAVE_TERMIOS_H, etc., to guard against inclusion by programs with broken configure scripts. 981031 + modify terminfo parsing to accept octal and hexadecimal constants, like Solaris. + remove an autoconf 2.10 artifact from the configure script's check for "-g" compiler options. (Though harmless, this confused someone at Debian, who recently issued a patch that results in the opposite effect). + add configure option --with-ada-compiler to accommodate installations that do not use gcc as the driver for GNAT (patch by Juergen Pfeifer). 981017 + ensure ./man exists in configure script, needed when configuring with --srcdir option. + modify infocmp "-r" option to remove limit on formatted termcap output, which makes it more like Solaris' version. + modify captoinfo to treat no-argument case more like Solaris' version, which uses the contents of $TERMCAP as the entry to format. + modify mk-2nd.awk to handle subdirectories, e.g., ncurses/tty (patch by Alexander V Lukyanov). 981010 + modify --with-terminfo-dirs option so that the default value is the ${datadir} value, unless $TERMINFO_DIRS is already set. This gets rid of a hardcoded list of candidate directories in the configure script. + add some error-checking to _nc_read_file_entry() to ensure that strings are properly terminated (Todd C Miller). + rename manpage file curs_scr_dmp.3x to curs_scr_dump.3x, to correspond with contents (reported by Neil Zanella <nzanella@cs.mun.ca>). + remove redundant configure check for C++ which did not work when $CXX was specified with a full pathname (reported by Andreas Jaeger). + corrected bcopy/memmove check; the macro was not standalone. 981003 + remove unnecessary portion of OS/2 EMX mouse change from check_pending() (reported by Alexander V Lukyanov). 980926 + implement mouse support for OS/2 EMX (adapted from patch against 4.2(?) by Ilya Zakharevich). + add configure-check for bcopy/memmove, for 980919 changes to hashmap. + merge Data General terminfo from Hasufin <hasufin@vidnet.net> - TD + merge AIX 3.2.5 terminfo descriptions for IBM terminals, replaces some older entries - TD + modify tic to compile into %'char' form in preference to %{number}, since that is a little more efficient. + minor correction to infocmp to avoid displaying "difference" between two capabilities that are rendered in equivalent forms. + add -g option to tic/infocmp to force character constants to be displayed in quoted form. Otherwise their decimal values are shown. + modify setupterm so that cancelled strings are treated the same as absent strings, cancelled and absent booleans false (does not affect tic, infocmp). + modify tic, infocmp to discard redundant i3, r3 strings when output to termcap format. > patch by Alexander V Lukyanov: + improve performance of tparm, now it takes 19% instead of 25% when profiling worm. + rename maxlen/minlen to prec/width for better readability. + use format string for printing strings. + use len argument correctly in save_text, and pass it to save_number. 980919 + make test_progs compile (but hashmap does not function). + correct NC_BUFFERED macro, used in lib_mvcur test-driver, modify associated logic to avoid freeing the SP->_setbuf data. + add modules home_terminfo and getenv_num to libtinfo. + move write_entry to libtinfo, to work with termcap caching. + minor fixes to blue.c to build with atac. + remove softscroll.c module; no longer needed for testing. > patches by Todd C Miller: + use strtol(3) instead of atoi(3) when parsing env variables so we can detect a bogus (non-numeric) value. + check for terminal names > MAX_NAME_SIZE in a few more places when dealing with env variables again. + fix a MAX_NAME_SIZE that should be MAX_NAME_SIZE+1 + use sizeof instead of strlen(3) on PRIVATE_INFO since it is a fixed string #define (compile time vs runtime). + when setting errno to ENOMEM, set it right before the return, not before code that could, possibly, set errno to a different value. > patches by Alexander V Lukyanov: + use default background in update_cost_from_blank() + disable scroll-hints when hashmap is configured. + improve integration of hashmap scrolling code, by adding oldhash and newhash data to SP struct. + invoke del_curterm from delscreen. + modify del_curterm to set cur_term to null if it matches the function's parameter which is deleted. + modify lib_doupdate to prefer parm_ich to the enter_insert_mode and exit_insert_mode combination, adjusting InsCharCost to check enter_insert_mode, exit_insert_mode and insert_padding. Add insert_padding in insert mode after each char. This adds new costs to the SP struct. 980912 + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for consistent treatment. + modify ncurses to restore output to unbuffered on endwin, and resume buffering in refresh (see lib_set_term.c and NC_BUFFERED macro). + corrected HTML version numbers (according to the W3C validator, they never were HTML 2.0-compliant, but are acceptable 3.0). 980905 + modify MKterminfo.sh to generate terminfo.5 with tables sorted by capability name, as in SVr4. + modified term.h, termcap.h headers to avoid redundant declarations. + change 'u_int' type in tset.c to unsigned, making this compile on Sequent PRX 4.1 (reported by Michael Sterrett <msterret@coat.com>). 980829 + corrections to mailing addresses, and moving the magic line that causes the man program to invoke tbl to the first line of each manpage (patch by Rick Ohnemus <rick@ecompcon.com>). + add Makefile.os2 and supporting scripts to generate dll's on OS/2 EMX (from J.J.G.Ripoll, with further integration by TD). + correct a typo in icl6404 terminfo entry. + add xtermm and xtermc terminfo entries. > from esr's terminfo version: + Added Francesco Potorti's tuned Wyse 99 entries. + dtterm enacs (from Alexander V Lukyanov). + Add ncsa-ns, ncsa-m-ns and ncsa-m entries from esr version. 980822 + document AT&T acs characters in terminfo.5 manpage. + use EMX _scrsize() function if terminfo and environment do not declare the screen size (reported by Ilya Zakharevich <ilya@math.ohio-state.edu>). + remove spurious '\' characters from eterm and osborne terminfo entries (prompted by an old Debian bug report). + correct reversed malloc/realloc calls in _nc_doalloc (reported by Hans-Joachim Widmaier <hjwidmai@foxboro.com>). + correct misplaced parenthesis which caused file-descriptor from opening termcap to be lost, from 980725 changes (reported by Andreas Jaeger). 980815 + modify lib_setup.c to eliminate unneeded include of <sys/ioctl.h> when termios is not used (patch by Todd C Miller). + add function _nc_doalloc, to ensure that failed realloc calls do not leak memory (reported by Todd C Miller). + improved ncsa-telnet terminfo entry. 980809 + correct missing braces around a trace statement in read_entry.c, from 980808 (reported by Kim DeVaughn <kimdv@best.com> and Liviu Daia). 980808 + fix missing include <errno.h> in ditto.c (reported by Bernhard Rosenkraenzer <bero@k5.sucks.eu.org>) + add NCSA telnet terminfo entries from Francesco Potorti <F.Potorti@cnuce.cnr.it>, from Debian bug reports. + make handling of $LINES and $COLUMNS variables more compatible with Solaris by allowing them to individually override the window size as obtained via ioctl. 980801 + modify lib_vidattr.c to allow for terminal types (e.g., xterm-color) which may reset all attributes in the 'op' capability, so that colors are set before turning on bold and other attributes, but still after turning attributes off. + add 'ditto.c' to test directory to illustrate use of newterm for initializing multiple screens. + modify _nc_write_entry() to recover from failed attempt to link alias for a terminfo on a filesystem which does not preserve character case (reported by Peter L Jordan <PJordan@chla.usc.edu>). 980725 + updated versions of config.guess and config.sub based on automake 1.3 + change name-comparisons in lib_termcap to compare no more than 2 characters (gleaned from Debian distribution of 1.9.9g-8.8, verified with Solaris curses). + fix typo in curs_insstr.3x (patch by Todd C Miller) + use 'access()' to check if ncurses library should be permitted to open or modify files with fopen/open/link/unlink/remove calls, in case the calling application is running in setuid mode (request by Cristian Gafton <gafton@redhat.com>, responding to Duncan Simpson <dps@io.stargate.co.uk>). + arm100 terminfo entries from Dave Millen <dmill@globalnet.co.uk>). + qnxt2 and minitel terminfo entries from esr's version. 980718 + use -R option with ldconfig on FreeBSD because otherwise it resets the search path to /usr/lib (reported by Dan Nelson). + add -soname option when building shared libraries on OpenBSD 2.x (request by QingLong). + add configure options --with-manpage-format and --with-manpage-renames (request by QingLong). + correct conversion of CANCELLED_NUMERIC in write_object(), which was omitting the high-order byte, producing a 254 in the compiled terminfo. + modify return-values of tgetflag, tgetnum, tgetstr, tigetflag, tigetnum and tigetstr to be compatible with Solaris (gleaned from Debian distribution of 1.9.9g-8.8). + modify _nc_syserr_abort to abort only when compiled for debugging, otherwise simply exit with an error. 980711 + modify Ada95 'gen' program to use appropriate library suffix (e.g., "_g" for a debug build). + update Ada95 'make clean' rule to include generics .ali files + add a configure test to ensure that if GNAT is found, that it can compile/link working Ada95 program. + flush output in beep and flash functions, fixing a problem with getstr (patch by Alexander V Lukyanov) + fix egcs 1.0.2 warning for etip.h (patch by Chris Johns). + correct ifdef/brace nesting in lib_sprintf.c (patch by Bernhard Rosenkraenzer <bero@Pool.Informatik.RWTH-Aachen.DE>). + correct typo in wattr_get macro from 980509 fixes (patch by Dan Nelson). 980704 + merge changes from current XFree86 xterm terminfo descriptions. + add configure option '--without-ada'. + add a smart-default for termcap 'ac' to terminfo 'acs_chars' which corresponds to vt100. + change translation for termcap 'rs' to terminfo 'rs2', which is the documented equivalent, rather than 'rs1'. 980627 + slow 'worm' down a little, for very fast machines. + corrected firstchar/lastchar computation in lib_hline.c + simplify some expressions with CHANGED_CELL, CHANGED_RANGE and CHANGED_TO_EOL macros. + modify init_pair so that if a color-pair is reinitialized, we will repaint the areas of the screen whose color changes, like SVr4 curses (reported by Christian Maurer <maurer@inf.fu-berlin.de>). + modify getsyx/setsyx macros to comply with SVr4 man-page which says that leaveok() affects their behavior (report by Darryl Miles, patch by Alexander V Lukyanov). 980620 + review terminfo.5 against Solaris 2.6 curses version, corrected several minor errors/omissions. + implement tparm %l format. + implement tparm printf-style width and precision for %s, %d, %x, %o as per XSI. + implement tparm dynamic variables (reported by Xiaodan Tang). 980613 + update man-page for for wattr_set, wattr_get (cf: 980509) + correct limits in hashtest, which would cause nonprinting characters to be written to large screens. + correct configure script, when --without-cxx was specified: the wrong variable was used for cf_cv_type_of_bool. Compilers up to gcc 2.8 tolerated the missing 'int'. + remove the hardcoded name "gcc" for the GNU Ada compiler. The compiler's name might be something like "egcs" (patch by Juergen Pfeifer). + correct curs_addch.3x, which implied that echochar could directly display control characters (patch by Alexander V Lukyanov). + fix typos in ncurses-intro.html (patch by Sidik Isani <isani@cfht.hawaii.edu>) 980606 + add configure test for conflicting use of exception in math.h and other headers. + minor optimization to 'hash()' function in hashmap.c, reduces its time by 10%. + correct form of LD_SHARED_OPTS for HP-UX 10.x (patch by Tim Mooney). + fix missing quotes for 'print' in MKunctrl.awk script (reported by Mihai Budiu <mihaib@gs41.sp.cs.cmu.edu>). > patch by Alexander V Lukyanov: + correct problem on Solaris (with poll() function) where getch could hang indefinitely even if timeout(x) was called. This turned out to be because milliseconds was not updated before 'goto retry' in _nc_timed_wait. + simplified the function _nc_timed_wait and fixed another bug, which was the assumption of !GOOD_SELECT && HAVE_GETTIMEOFDAY in *timeleft assignment. + removed the cycle on EINTR, as it seems to be useless. 980530 + add makefile-rule for test/keynames + modify run_tic.sh and shlib to ensure that user's .profile does not override the $PATH used to run tic (patch by Tim Mooney). + restore LD_SHARED_OPTS to $(LD_SHARED_FLAGS) when linking programs, needed for HP-UX shared-library path (recommended by Tim Mooney). + remove special case of HP-UX -L options, use +b options to embed $(libdir) in the shared libraries (recommended by Tim Mooney). + add checks for some possible buffer overflows and unchecked malloc/realloc/calloc/strdup return values (patch by Todd C Miller <Todd.Miller@courtesan.com>) 980523 + correct maxx/maxy expression for num_columns/num_lines in derwin (patch by Alexander V Lukyanov). + add /usr/share/lib/terminfo and /usr/lib/terminfo as compatibilty fallbacks to _nc_read_entry(), along with --with-terminfo-dirs configure option (suggested by Mike Hopkirk). + modify config.guess to recognize Unixware 2.1 and 7 (patch by Mike Hopkirk <hops@sco.com>). + suppress definition of CC_SHARED_OPTS in LDFLAGS_SHARED in c++ Makefile.in, since this conflicts when g++ is used with HP-UX compiler (reported by Tim Mooney). + parenthesize 'strcpy' calls in c++ binding to workaround redefinition in some C++ implementations (reported by several people running egcs with glibc 2.0.93, analysis by Andreas Jaeger. 980516 + modify write_entry.c so that it will not attempt to link aliases with embedded '/', but give only a warning. + put -L$(libdir) first when linking programs, except for HP-UX. + modify comp_scan.c to handle SVr4 terminfo description for att477, which contains a colon in the description field. + modify configure script to support SCO osr5.0.5 shared libraries, from comp.unix.sco.programmer newsgroup item (Mike Hopkirk). + eliminate extra GoTo call in lib_doupdate.c (patch by Alexander V. Lukyanov). + minor adjustments of const/NCURSES_CONST from IRIX compile. + add updates based on esr's 980509 version of terminfo.src. 980509 + correct macros for wattr_set, wattr_get, separate wattrset macro from these to preserve behavior that allows attributes to be combined with color pair numbers. + add configure option --enable-no-padding, to allow environment variable $NCURSES_NO_PADDING to eliminate non-mandatory padding, thereby making terminal emulators (e.g., for vt100) a little more efficient (request by Daniel Eisenbud <eisenbud@cs.swarthmore.edu>). + modify configure script to embed ABI in shared libraries for HP-UX 10.x (detailed request by Tim Mooney). + add test/example of the 'filter()' function. + add nxterm and xterm-color terminfo description (request by Cristian Gafton <gafton@redhat.com>). + modify rxvt terminfo description to clear alternate screen before switching back to normal screen, for compatibility with applications which use xterm (reported by Manoj Kasichainula <manojk@io.com>). + modify linux terminfo description to reset color palette (reported by Telford Tendys <telford@eng.uts.edu.au>). + (reported by Daniel Eisenbud <eisenbud@cs.swarthmore.edu>). + minor performance improvement to wnoutrefresh by moving some comparisons out of inner loop. 980425 + modify configure script to substitute NCURSES_CONST in curses.h + updated terminfo entries for xterm-xf86-v40, xterm-16color, xterm-8bit to correspond to XFree86 3.9Ag. + remove restriction that forces ncurses to use setaf/setab if the number of colors is greater than 8. (see 970524 for xterm-16color). + change order of -L options (so that $(libdir) is searched first) when linking tic and other programs, to workaround HP's linker. Otherwise, the -L../lib is embedded when linking against shared libraries and the installed program does not run (reported by Ralf Hildebrandt). + modify configuration of shared libraries on Digital Unix so that versioning is embedded in the library, rather than implied by links (patch by Tim Mooney). 980418 + modify etip.h to avoid conflict with math.h on HP-UX 9.03 with gcc 2.8.1 which redefines 'exception' (reported by Ralf Hildebrandt <R.Hildebrandt@tu-bs.de>). + correct configure tests in CF_SHARED_OPTS which used $CC value to check for gcc, rather than autoconf's $GCC value. This did not work properly if the full pathname of the compiler were given (reported by Michael Yount <yount@csf.Colorado.edu>). + revise check for compiler options to force ANSI mode since repeating an option such as -Aa causes HP's compiler to fail on its own headers (reported by Clint Olsen <olsenc@ichips.intel.com>). 980411 + ifdef'd has_key() and mcprint() as extended functions. + modified several prototypes to correspond with 1997 version of X/Open Curses (affects ABI since developers have used attr_get). + remove spurious trailing blanks in glibc addon-scripts (patch by H.J.Lu). + insert a few braces at locations where gcc-2.8.x asks to use them to avoid ambigous else's, use -fpic rather than -fPIC for Linux (patch by Juergen Pfeifer). 980404 + split SHLIB_LIST into SHLIB_DIRS/SHLIB_LIST to keep -L options before -l to accommodate Solaris' linker (reported by Larry Virden). 980328 + modify lib_color.c to eliminate dependency on orig_colors and orig_pair, since SVr4 curses does not require these either, but uses them when they are available. + add detailed usage-message to infocmp. + correct a typo in att6386 entry (a "%?" which was "?"). + add -f option to infocmp and tic, which formats the terminfo if/then/else/endif so that they are readable (with newlines and tabs). + fixes for glibc addon scripts (patch by H.J.Lu). 980321 + revise configure macro CF_SPEED_TYPE so that termcap.h has speed_t declared (from Adam J Richter <adam@yggdrasil.com>) + remove spurious curs_set() call from leaveok() (J T Conklin). + corrected handling leaveok() in doupdate() (patch by Alexander V. Lukyanov). + improved version of wredrawln (patch by Alexander V. Lukyanov). + correct c++/Makefile.in so install target do not have embedded ../lib to confuse it (patch by Thomas Graf <graf@essi.fr>). + add warning to preinstall rule which checks if the installer would overwrite a curses.h or termcap.h that is not derived from ncurses. (The recommended configuration for developers who need both is to use --disable-overwrite). + modify preinstall rule in top-level Makefile to avoid implicit use of 'sh', to accommodate Ultrix 4.4 (reported by Joao Palhoto Matos <jmatos@math.ist.utl.pt>, patch by Thomas Esser <te@informatik.uni-hannover.de>) + refine ifdef's for TRACE so that libncurses has fewer dependencies on libtinfo when TRACE is disabled. + modify configure script so that if the --with-termlib option is used to generate a separate terminfo library, we chain it to the ncurses library with a "-l" option (reported by Darryl Miles and Ian T. Zimmerman). 980314 + correct limits and window in wredrawln function (reported/analysis by Alexander V. Lukyanov). + correct sed expression in configure script for --with-fallback option (patch by Jesse Thilo). + correct some places in configure script where $enableval was used rather than $withval (patch by Darryl Miles <dlm@g7led.demon.co.uk>). + modify some man-pages so no '.' or '..' falls between TH and SH macros, to accommodate man_db program (reported by Ian T. Zimmerman <itz@rahul.net>). + terminfo.src 10.2.1 downloaded from ESR's webpage (ESR). > several changes by Juergen Pfeifer: + add copyright notices (and rcs id's) on remaining man-pages. + corrected prototypes for slk_* functions, using chtype rather than attr_t. + implemented the wcolor_set() and slk_color() functions + the slk_attr_{set,off,on} functions need an additional void* parameter according to XSI. + fix the C++ and Ada95 binding as well as the man pages to reflect above enhancements. 980307 + use 'stat()' rather than 'access()' in toe.c to check for the existence of $HOME/.terminfo, since it may be a file. + suppress configure CF_CXX_LIBRARY check if we are not using g++ 2.7.x, since this is not needed with g++ 2.8 or egcs (patch by Juergen Pfeifer). + turn on hashmap scrolling code by default, intend to remedy defects by 4.3 release. + minor corrections to terminfo.src changelog. 980302 4.2 release for upload to prep.ai.mit.edu + correct Florian's email address in ncurses-intro.html + terminfo.src 10.2.0 (ESR). 980228 pre-release + add linux-koi8r replace linux-koi8, which is not KOI8 (patch by QingLong <qinglong@Bolizm.ihep.su>). + minor documentation fixes (patch by Juergen Pfeifer). + add setlocale() call to ncurses.c (reported by Claes G. Lindblad <claesg@algonet.se>). + correct sign-extension in lib_insstr.c (reported by Sotiris Vassilopoulos <svas@leon.nrcps.ariadne-t.gr>) 980221 pre-release + regenerated some documentation overlooked in 980214 patch (ncurses-intro.doc, curs_outopts.3x.html) + minor ifdef change to C++ binding to work with gcc 2.8.0 (patch by Juergen Pfeifer). + change maintainer's mailing address to florian@gnu.org, change tentative mailing list address to bug-ncurses-request@gnu.org (patch by Florian La Roche). + add definition of $(REL_VERSION) to c++/Makefile.in (reported by Gran Hasse <gh@raditex.se>). + restore version numbers to Ada95 binding, accidentally deleted by copyright patch (patch by Juergen Pfeifer). 980214 pre-release + remove ncurses.lsm from MANIFEST so that it won't be used in FSF distributions, though it is retained in development. + correct scaling of milliseconds to nanoseconds in lib_napms.c (patch by Jeremy Buhler). + update mailing-list information (bug-ncurses@gnu.org). + update announcement for upcoming 4.2 release. + modify -lm test to check for 'sin()' rather than 'floor()' + remove spurious commas from terminfo.src descriptions. + change copyright notices to Free Software Foundation 980207 + minor fixes for autoconf macros CF_ERRNO, CF_HELP_MESSAGE and CF_SIZECHANGE + modify Makefile.glibc so that $(objpfx) is defined (H.J.Lu). + ifdef-out true-return from _nc_mouse_inline() which depends on merge of QNX patch (pending 4.2 release). > patch to split off seldom-used modules in ncurses (J T Conklin): This reduces size by up to 2.6kb. + move functionality of _nc_usleep into napms, add configuration case for nanosleep(). + moved wchgat() from lib_addch.c to lib_chgat.c + moved clearok(), immedok(), leaveok(), and scrollok() from lib_options.c to lib_clearok.c, lib_immedok.c, lib_leaveok.c and lib_scrollok.c. + moved napms() from lib_kernel.c to lib_napms.c + moved echo() and noecho() from lib_raw.c to lib_echo.c + moved nl() and nonl() from lib_raw.c to lib_nl.c 980131 + corrected conversion in tclock.c (cf: 971018). + updates to Makefile.glibc and associated Linux configure script (patch by H.J.Lu). + workaround a quoting problem on SunOS with tar-copy.sh + correct init_pair() calls in worm.c to work when use_default_colors() is not available. + include <sys/types.h> in CF_SYS_TIME_SELECT to work with FreeBSD 2.1.5 + add ncv capability to FreeBSD console (cons25w), making reverse work with color. + correct sense of configure-test for sys/time.h inclusion with sys/select.h + fixes for Ada95/ada_include/Makefile.in to work with --srcdir option. + remove unused/obsolete test-program rules from progs/Makefile.in (the rules in ncurses/Makefile.in work). + remove shared-library loader flags from test/Makefile.in, etc. + simplify test/configure.in using new version of autoconf to create test/ncurses_cfg.h + suppress suffix rules in test/Makefile.in, provide explicit dependency to work with --srcdir option and less capable 'make' programs. > adapted from patch for QNX by Xiaodan Tang: + initialize %P and %g variables set/used in tparm, and also ensure that empty strings don't return a null result from tparam_internal + add QNX-specific prototype for vsscanf() + move initialization of SP->_keytry from init_keytry() to newterm() to avoid resetting it via a keyok() call by mouse_activate(). + reorganized some functions in lib_mouse() to use case-statements. + remove sgr string from qnx terminfo entry since it is reported to turn off attributes inconsistently. 980124 + add f/F/b/B commands to ncurses 'b' test to toggle colors, providing test for no_color_video. + adjusted emx.src to use no_color_video, now works with ncurses 'b' and 'k' tests. + implement no_color_video attribute, and as a special case, reverse colors when the reverse attribute cannot be combined with color. + check for empty string in $TERM variable (reported by Brett Michaels <brett@xylan.com>). > from reports by Fred Fish: + add configure-test for isascii + add configure-test for -lm library. + modify CF_BOOL_SIZE to check if C++ bool types are unsigned. > patches by J.J.G.Ripoll + add configure/makefile variables to support .exe extension on OS/2 EMX (requires additional autoconf patches). + explicitly initialize variables in lib_data.c to appease OS/2 linker > patches by Fred Fish <fnf@ninemoons.com> + misc/Makefile.in (install.data): Avoid trying to install the CVS directory. + aclocal.m4 (install.includes): Remove files in the include directory where we are going to install new ones, not the original source files. + misc/terminfo.src: Add entry for "beterm", derived from termcap distributed with BeOS PR2 using captoinfo. + aclocal.m4: Wrap $cf_cv_type_of_bool with quotes (contains space) + aclocal.m4: Assume bool types are unsigned. + progs/infocmp.c: workaround mwcc 32k function data limit 980117 + correct initialization of color-pair (cf: 970524) in xmas.c, which was using only one color-pair for all colors (reported by J.J.G.Ripoll). + add multithread options for objects build on EMX, for compatibility with XFree86. + split up an expression in MKlib_gen.sh to work around a problem on OS/2 EMX, with 'ash' (patch by J.J.G.Ripoll). + change terminfo entries xterm (xterm-xf86-v40), xterm-8bit rs1 to use hard reset. + rename terminfo entry xterm-xf86-v39t to xterm-xf86-v40 + remove bold/underline from sun console entries since they're not implemented. + correct _tracef calls in _tracedump(), which did not separate format from parameters. + correct getopt string for tic "-o" option, and add it to man-page synopsis (reported by Darren Hiebert <darren@hmi.com>). + correct typo in panel/Makefile.in, reversed if-statement in scrolling optimization (Alexander V. Lukyanov). + test for 'remove()', use 'unlink() if not found (patch by Philippe De Muyter <phdm@macqel.be>). > patches by Juergen Pfeifer: + Improve a feature of the forms driver. For invisible fields (O_VISIBLE off) only the contents but not the attributes are cleared. We now clear both. (Reported by Javier Kohan <jkohan@adan.fceia.unr.edu.ar>) + The man page form_field_opts.3x makes now clear, that invisible fields are also always inactive. + adjust ifdef's to compile the C++ binding with the just released gcc-2.8.0 c++ and the corresponding new C++ libraries. 980110 + correct "?" command in ncurses.c; it was performing non-screen writes while the program was in screen mode. (It "worked" in 1.9.9e because that version sets OPOST and OCRNL incorrectly). + return error from functions in lib_kernel, lib_raw and lib_ti if cur_term is null, or if underlying I/O fails. + amend change to tputs() so that it does not return an error if cur_term is null, since some applications depend on being able to use tputs without initializing the terminal (reported by Christian J. Robinson <infynity@cyberhighway.net>). 980103 + add a copy of emx.src from J.J.G.Ripoll's OS/2 EMX version of ncurses 1.9.9e, together with fixes/additions for the "ansi" terminal type. + add tic check for save/restore cursor if change_scroll_region is defined (reference: O'Reilly book). + modify read_termcap.c to handle EMX-style pathnames (reported by J.J.G.Ripoll). + modify lib_raw.c to use EMX's setmode (patch from J.J.G.Ripoll). Ripoll says EMX's curses does this. + modify _nc_tic_expand() to generate \0 rather than \200. + move/revise 'expand()' from dump_entry.c to ncurses library as _nc_tic_expand(), for use by tack. + decode \a as \007 for terminfo, as per XSI. + correct translation of terminfo "^@", to \200, like \0. + modify next_char() to treat <cr><lf> the same as <newline>, for cross-platform compatibility. + use new version of autoconf (971230) to work around limited environment on CLIX, due to the way autoconf builds --help message. > patch by Juergen Pfeifer: + check that the Ada95 binding runs against the correct version of ncurses. + insert constants about the library version into the main spec-file of the Ada95 binding. 971227 + modify open/fopen calls to use binary mode, needed for EMX. + modify configure script to work with autoconf 2.10 mods for OS/2 EMX (from J.J.G.Ripoll). + generated ncurses_cfg.h with patch (971222) to autoconf 2.12 which bypasses limited sed buffer length. > several changes from Juan Jose Garcia Ripoll <worm@arrakis.es> (J.J.G.Ripoll) to support OS/2 EMX: + add a _scrolling flag to SP, to set when we encounter a terminal that simply cannot scroll. + corrected logic in _nc_add_to_try(), by ensuring that strings with embedded \200 characters are matched. + don't assume the host has 'link()' function, for linking terminfo entries. 971220 + if there's no ioctl's to support sigwinch handler, disable it. + add configure option --disable-ext-funcs to remove the extended functions from the build. + add configure option --with-termlib to generate the terminfo functions as a separate library. + add 'sources' rule to facilitate cross-compiling. + review/fix order of mostlyclean/clean/distclean rules. + modify install-rule for headers to first remove old header, in case there was a symbolic link that confuses the install script. + corrected substitution for NCURSES_CONST in term.h (cf: 971108) + add null pointer checks in wnoutrefresh(), overlap() (patch by Xiaodan Tang <xtang@qnx.com>) + correct tputs(), which could dereference a null cur_term if invoked before terminal is initialized (patch by Christopher Seawood <cls@seawood.org>) > patch by Juergen Pfeifer: + makes better use of "pragma Inline" in the Ada95 binding + resynchronizes the generated html manpages 971213 + additional fixes for man-pages section-references + add (for debugging) a check for ich/ich1 conflict with smir/rmir to tic, etc. + remove hpa/vpa from rxvt terminal description because they are not implemented correctly, added sgr0. + change ncurses 's' to use raw mode, so ^Q works (reported by Rudolf Leitgeb <leitgeb@leland.stanford.edu>) 971206 + modify protection when installing libraries to (normally) not executable. HP-UX shared libraries are an exception. + add configure check for 'tack'. + implement script for renaming section-references in man-page install, for Debian configuration. + add validity-check for SP in trace code in baudrate() (reported by Daniel Weaver). > patch by Alexander V. Lukyanov (fixes to match sol25 curses) + modify 'overlay()' so that copy applies target window background to characters. + correct 'mvwin()' so that it does not clear the previous locations. + correct lib_acs.c so that 8-bit character is not sign expanded in case of wide characters in chtype. + correct control-char test in lib_addch.c for use with wide chars + use attribute in the chtype when adding a control character in lib_addch.c control char was added with current attribute 971129 + save/restore errno in _tracef() function + change treatment of initialize_color to use a range of 0..1000 (recommended by Daniel Weaver). + set umask in mkinstalldirs, fixing problems reported by users who have set root's umask to 077. + correct bug in tic that caused capabilities to be reprinted at the end of output when they had embedded comments. + rewrote wredrawln to correspond to XSI, and split-out since it is not often used (from report by Alexander V. Lukyanov, 970825) + rewrote Dan Nelson's change to make it portable, as well as to correct logic for handling backslashes. + add code to _nc_tgetent() to make it work more like a real tgetent(). It removes all empty fields, and removes all but the first in a group of duplicate caps. The code was pulled from the BSD libtermcap code in termcap.c (patch by Dan Nelson <dnelson@emsphone.com> + don't include --enable-widec in the --with-develop configure option, since it is not binary-compatible with 4.1 (noted by Alexander V. Lukyanov) > patch by Juergen Pfeifer: + further improvements of the usage of elaboration pragmas in the Ada95 binding + enhanced Ada95 sample to use the user_data mechanism for panels. + a fix for the configuration script to make gnat-3.10 the required version. + resync of the html version of the manpages 971122 > fixes/updates for terminfo.src: + add vt220-js, pilot, rbcomm, datapoint entries from esr's 27-jun-97 version. + add hds200 description (Walter Skorski) + add EMX 0.9b descriptions + correct rmso/smso capabilities in wy30-mc and wy50-mc (Daniel Weaver) + rename xhpterm back to hpterm. > patch by Juergen Pfeifer: + Improves the usage of elaboration pragmas for the Ada95 binding. + Adds a translation of the test/rain.c into Ada95 to the samples. This has been contributed to the project by Laurent Pautet (pautet@gnat.com) 971115 + increase MAX_NAME_SIZE to 512 to handle extremely long alias list in HP-UX terminfo. + correction & simplification of delay computation in tputs, based on comments from Daniel Weaver. + replace test for SCO with more precise header tests. + add configure test for unsigned literals, use in NCURSES_BITS macro. + comment-out the -PIC, etc., flags from c++, progs and test makefiles since they probably are not needed, and are less efficient (noted by Juergen Fluk) + add -L$(libdir) to loader options, after -L../lib so that loaders that record this information will tend to do the right thing if the programs are moved around after installing them (suggested by Juergen Fluk). + add -R option to loader options for programs for Solaris if the --enable-rpath option is specified for the libraries. 971112 + correct installed filename for shared libraries on *BSD (reported by Juergen Fluk). 971108 + cleanup logic for deciding when tputs() should call delay_output(), based on comments from Daniel Weaver. + modified tputs() to avoid use of float. + correct use of trailpad in tputs(), which used the wrong variable in call to delay_output(). + correct inverted expression for null-count in delay_output() (analysis by Daniel Weaver). + apply --enable-rpath option to Solaris (requested by Larry Virden). + correct substitution of EXTRA_CFLAGS for gcc 2.6.3 + correct check for error-return by _nc_tgetent(), which returns 0 for success. + add configure test for BSD 4.4 cgetent() function, modify read_termcap.c to use the host's version of that if found, using the terminal database on FreeBSD (reported by Peter Wemm). + add u8, u9 strings to sun-il description for Daniel Weaver. + use NCURSES_CONST in panel's user-pointer. + modify edit_cfg.sh and MKterm.h.awk.in to substitute NCURSES_CONST so that will work on NeXT. + use _nc_set_screen() rather than assignments to SP to fix port to NeXT (reported by Francisco A. Tomei Torres). 971101 + force mandatory padding in bell and flash_screen, as specified in XSI. + don't allow padding_baud_rate to override mandatory delays (reported by Daniel Weaver). + modify delay_output() to use _nc_timed_wait() if no baudrate has been defined, or if the cur_term pointer is not initialized. XSI treats this as unspecified. (requested by Daniel Weaver). + change getcap-cache ifdef's to eliminate unnecessary chdir/mkdir when that feature is not configured. + remove _nc_err_abort() calls when write_entry.c finds a directory but cannot write to it, e.g., when translating part/all of /etc/termcap (reported by Andreas Jaeger <aj@arthur.rhein-neckar.de>). (this dates back to 951102, in 1.9.7a). + minor ifdef fixes to compile with atac and glibc 2.0.5c + add check for -lgen when configuring regexpr.h + modify Solaris shared-library option "-d y" to "-dy" to workaround incompatibility of gcc 2.7.2 vs vendor's tools. 971026 + correct ifdef's for struct winsize vs struct ttysize in lib_setup.c to compile on SCO. + remove dangling backslash in panel/Makefile.in + modify MKkeyname.awk to work with SCO's nawk, which dumps core in the length() function. + correct length of allocation in _nc_add_to_try(), to allow for trailing null. + correct logic in _nc_remove_key(), which was discarding too many nodes (patch by Alexander V. Lukyanov) 971025 + add definition for $(REL_VERSION) to test/Makefile.in, so *BSD shared libraries link properly (see 970524). + modify Linux shared-library generation to include library dependencies (e.g., -lncurses and -lgpm) in the forms, menu and panel libraries (suggested by Juergen Pfeifer). + modify configure script to use config.guess and config.sub rather than uname, which is unreliable on some systems. + updated Makefile.glibc, test-built with glibc 2.0.5c + modify keyname() to return values consistent with SVr4 curses (patch by Juergen Fluk). > changes requested by Daniel Weaver: + modify delay_output() so that it uses the same output function as tputs() if called from that function. + move _baudrate from SCREEN to TERMINAL so that low-level use of tputs works when SP is not set. > patch by Juergen Pfeifer: + factor lib_menu and lib_form into smaller modules + clean up the interface between panel and SCREEN + minor changes to the Ada95 mouse support implemenation + minor bugfix in C++ binding to ripoff windows + fix a few Ada95 html documentation pages 971018 + split-out lib_ungetch.c, make runtime link to resizeterm() to decouple those modules from lib_restart.c + add xterm-xf86-v39t description to terminfo.src + reset SP->_endwin in lib_tstp.c cleanup() function after calling endwin() to avoid unnecessary repainting if the application has established an atexit function, etc. Encountered this problem in the c++ demo, whose destructors repaint the screen. + combine _nc_get_screensize() and resizeterm() calls as new function _nc_update_screensize(). + minor fixes to allow compile with g++ (suggested by Nelson H. F. Beebe). + implement install-rules for Ada95 makefiles. + use screen_lines or MAXLINES as needed where LINES was coded, as well as screen_columns for COLS, in the ncurses library. > patch by Alexander V. Lukyanov: + modify logic for ripped-off lines to handle several SCREENs. > patch by Juergen Pfeifer: + factors lib_slk.c into some smaller modules + factors panel.c into some smaller modules + puts the static information about the current panel stack into the SCREEN structure to allow different panel stacks on different screens. + preliminary fix for an error adjusting LINES to account for ripped-off lines. 971011 + move _nc_max_click_interval and other mouse interface items to SCREEN struct so that they are associated with a single terminal, and also save memory when the application does not need a mouse (roughly 3k vs 0.5k on Linux). + modify mouseinterval() so that a negative parameter queries the click-interval without modifying it. + modify ncurses 'i' test to work with ncurses' apparent extension from SVr4, i.e., allows nocbreak+noecho (analysis by Alexander V. Lukyanov). + add configure options --with-ada-includes and --with-ada-objects, to drive Ada95 binding install (not yet implemented). + install C++ binding as -lncurses++ and associated headers with the other ncurses headers. + fix header uninstall if configure --srcdir is used. > minor interface changes to support 'tack' program -TD (request by Daniel Weaver <danw@znyx.com>). + export functions _nc_trans_string() and _nc_msec_cost(). + add variable _nc_nulls_sent, to record the number of padding characters output in delay_output(). + move tests for generic_type and hard_copy terminals in setupterm() to the end of that function so that the library will still be initialized, though not generally useful for curses programs. > patches by Alexander V. Lukyanov: + modify ClrBottom() to avoid using clr_eos if there is only one line to erase. + typo in configure --help. > patch by J T Conklin (with minor resync against Juergen's changes) + split-out lib_flash.c from lib_beep.c + split-out lib_hline.c and lib_vline.c from lib_box.c + split-out lib_wattron.c, lib_wattroff.c from lib_addch.c 971005 > patch by Juergen Pfeifer: + correct source/target of c++/edit_cfg.sh 971004 + add color, mouse support to kterm terminfo entry. + modify lib_mouse.c to recognize rxvt, kterm, color_xterm also as providing "xterm"-style mouse. + updated rxvt's terminfo description to correspond to 2.21b, with fixes for the acsc (the box1 capability is incorrect, ech1 does not work). + fix logic in parse_entry.c that discarded acsc when 'synthesizing' an entry from equivalents in XENIX or AIX. This lets ncurses handle the distribution copy of rxvt's terminfo. + modify acsc capability for linux and linux-koi8 terminfo descriptions (from Pavel Roskin <pavel@absolute.spb.su>). + corrected definition in curses.h for ACS_LANTERN, which was 'I' rather than 'i' (see 970802). + updated terminfo.src with reformatted acsc entries, and repaired the trashed entries with spurious '\' characters that this exposed. + add logic to dump_entry.c to reformat acsc entries into canonical form (sorted, unique mapping). + add configure script to generate c++/etip.h + add configure --with-develop option, to enable by default most of the experimental options (requested by Alexander V. Lukyanov). + rename 'deinstall' to 'uninstall', following GNU convention (suggested by Alexander V. Lukyanov). > patches by Alexander V. Lukyanov: + modify tactics 2 and 5 in onscreen_mvcur(), to allow them on the last line of the screen, since carriage return will not cause a newline. + remove clause from PutCharLR() that would try to use eat_newline_glitch since that apparently does not work on some terminals (e.g., M$ telnet). + correct a limit check in scroll_csr_backward() > patches by Juergen Pfeifer: + adds dummy implementations of methods above() and below() to the NCursesPanel class. + fixes missing returncode in NCursesWindow::ripoffline() + fixes missing returncode in TestApplication::run() in demo.cc + We should at least give a comment in etip.h why it is currently a problem to install the C++ binding somewhere + makes the WINDOW* argument of wenclose() a const. + modifies several of the routines in lib_adabind.c to use a const WINDOW* argument. 970927 + add 'deinstall' rules. + use explicit assignments in configure --without-progs option to work around autoconf bug which doesn't always set $withval. + check for ldconfig, don't try to run it if not found. + implement simple/unoptimized case in lib_doupdate.c to handle display with magic cookie glitch, tested with ncurses.c program. + correct missing _tracef in getmouse(), to balance the returnCode macro. + simplify show_attr() in ncurses.c using termattrs(). > patches by Juergen Pfeifer: + provides missing inlines for mvw[hv]line in cursesw.h of the C++ binding + fixes a typo in a comment of frm_driver.c + Enhances Ada95 Makefiles to fulfill the requirement of GNAT-3.10 that generics should be compiled. Proper fixes to the configuration scripts are also provided. 970920 + several modifications to the configure script (requested by Ward Horner): + add configure options --without-progs, to suppress the build of the utility programs, e.g., for cross-compiling. + add $(HOSTCCFLAGS) and $(HOSTLDFLAGS) symbols to ncurses Makefile.in, to simplify setup for cross compiling. + add logic in configure script to recognize "--target=vxworks", and generate load/install actions for VxWorks objects. + move typedef for sigaction_t into SigAction.h to work around problem generating lint library. + modify fty_regex.c to reflect renaming of ifdef's for regular expressions. + simplify ifdef in lib_setup.c for TIOCGWINSZ since that symbol may reside in <sys/ioctl.h>. + merge testcurs.c with version from PDCurses 2.3, clarifying some of the more obscure tests, which rely upon color. + use macros getbegyx() and getmaxyx() in newdemo.c and testcurs.c + modify ncurses.c to use getbegyx() and getmaxyx() macros to cover up implementation difference wrt SVr4 curses, allow 's' test to work. + add missing endwin() to testscanw.c program (reported by Fausto Saporito <fausap@itb.it>). + fixes/updates for Makefile.glibc and related files under sysdeps (patch by H.J.Lu). > patches by Juergen Pfeifer: + add checks for null pointers, especially WINDOW's throughout the ncurses library. + solve a problem with wrong calculation of panel overlapping (reported by Ward Horner): + make sure that a panel's window isn't a pad. + do more error checking in module lib_touch.c + missing files for Ada95 binding from the last patch + synch. of generated html pages (RCS-Id's were wrong in html files) + support for Key_Resize in Ada binding + changed documentation style in ./c++/cursesm.h > patches by Alexander V. Lukyanov: + undo attempt to do recursive inlining for PutChar(), noting that it did not improve timing measurably, but inflated the size of lib_doupdate.o 970913 + modify rain.c to use color. + correct scroll_csr_backward() to match scroll_csr_forward(). + minor adjustment to llib-lncurses, to work with Solaris 2.5.1 + minor fixes to sysdeps/unix/sysv/linux/configure to reflect renaming of configure cache variables in 970906. + correct logic involving changes to O_VISIBLE option in Synchronize_Options function in frm_driver.c (Tony Hoffmann <Tony.Hoffmann@hia.nrc.ca>) + add $(HOSTCC) symbol to ncurses Makefile.in, to simplify setup for cross compiling (suggested by Chris Johns). + modify ifdef in lib_setup.c to only include <sys/ioctl.h> if we can use it to support screen-size calculation (reported by Chris Johns). + #undef unctrl to avoid symbol conflict in port to RTEMS (reported by Chris Johns <cjohns@plessey.com.au>) > patches by Juergen Pfeifer: + simplified, made minor corrections to Ada95 binding to form fieldtype. + The C++ binding has been enhanced: + Improve NCursesWindow class: added additional methods to cover more ncurses functionality. Make refresh() and noutrefresh() virtual members to allow different implementation in the NCursesPanel class. + CAUTION: changed order of parameters in vline() and hline() of NCursesWindow class. + Make refresh() in NCursesPanel non-static, it is now a reimplementation of refresh() in the base class. Added noutrefresh() to NCursesPanel. + Added NCursesForm and related classes to support libform functionality. + Moved most of configuration related stuff from cursesw.h to etip.h + Added NCursesApplication class to support easy configuration of menu and forms related attributes as well as ripped of title lines and Soft-Label-Keys for an application. + Support of Auto-Cleanup for a menu's fieldlist. + Change of return type for current_item() and operator[] for menus. + Enhanced demo. + Fixed a bug in form/fld_def.c: take into account that copyarg and freearg for a fieldtype may be NULL, makearg must not be NULL + Fixed a bug in form/fld_type.c: in set_fieldtype_arg() makearg must not be NULL, copyarg and freearg may be NULL. + Fixed a bug in form/frm_def.c: Allow Disconnect_Fields() if it is already disconnected. + Enhance form/frm_driver.c: Allow growth of dynamic fields also on navigation requests. + Fixed a bug in form/fty_enum.c: wrong position of postincrement in case-insensitiva comparision routine. + Enhanced form/lib_adabind.c with function _nc_get_field() to get a forms field by index. + Enhanced menu/m_adabind.c with function _nc_get_item() to get a menus item by index. + Fixed in curses.h.in: make chtype argument for pechochar() constant. Mark wbkgdset() as implemented, remove wbkgdset macro, because it was broken (didn't handle colors correctly). + Enhanced lib_mouse.c: added _nc_has_mouse() function + Added _nc_has_mouse() prototype to curses.priv.h + Modified lib_bkgd.c: hopefully correct implementation of wbkgdset(); streamlined implementation of wbkgd() + Modified lib_mvwin.c: Disable move of a pad. Implement (costly) move of subwindows. Fixed update behavior of movements of regular windows. + Fixed lib_pad.c: make chtype argument of pechochar() const. + Fixed lib_window.c: dupwin() is not(!) in every bit a really clone of the original. Subwindows become regular windows by doing a dupwin(). + Improved manpage form_fieldtype.3x > patches by Alexander V. Lukyanov: + simplify the PutChar() handling of exit_am_mode, because we already know that auto_right_margin is true. + add a check in PutChar() for ability to insert to the case of shifting character to LR corner. + in terminal initialization by _nc_screen_resume(), make sure that terminal right margin mode is known. + move logic that invokes touchline(), or does the equivalent, into _nc_scroll_window(). + modify scrolling logic use of insert/delete line capability, assuming that they affect the screen contents only within the current scrolling region. + modify rain.c to demonstrate SIGWINCH handler. + remove logic from getch() that would return an ERR if the application called getch() when the cursor was at the lower-right corner of the physical screen, and the terminal does not have insert-character ability. + change view.c so that it breaks out of getch() loop if a KEY_RESIZE is read, and modify logic in getch() so this fix will yield the desired behavior, i.e., the screen is repainted automatically when the terminal window is resized. 970906 + add configure option --enable-sigwinch + modify view.c to test KEY_RESIZE logic, with "-r" option. + modify testcurs.c to eliminate misleading display wrt cursor type by testing if the terminal supports cnorm, civis, cvvis. + several fixes for m68k/NeXT 4.0, to bring cur_term, _nc_curr_line and _nc_curr_col variables into linked programs: move these variables, making new modules lib_cur_term and trace_buf (reported by Francisco Alberto Tomei Torres <fatomei@sandburg.unm.edu>). > patches by Alexander V. Lukyanov: + add pseudo-functionkey KEY_RESIZE which is returned by getch() when the SIGWINCH handler has been called since the last call to doupdate(). + modify lib_twait.c to hide EINTR only if HIDE_EINTR is defined. + add SIGWINCH handler to ncurses library which is used if there is no application SIGWINCH handler in effect when the screen is initialized. + make linked list of all SCREEN structures. + move curses.h include before definition of SCREEN to use types in that structure. + correction to ensure that wgetstr uses only a newline to force a scroll (970831). 970831 + add experimental configure option --enable-safe-sprintf; the normal mode now allocates a buffer as large as the screen for the lib_printw.c functions. + modify wgetch to refresh screen when reading ungetch'd characters, since the application may require this - SVr4 does this. + refine treatment of newline in wgetstr to echo only when this would force the screen to scroll. 970830 + remove override in wgetstr() that forces keypad(), since SVr4 does not do this. + correct y-reference for erasure in wgetstr() when a wrap forces a scroll. + correct x-position in waddch() after a wrap forces a scroll. + echo newline in wgetstr(), making testscanw.c scroll properly when scanw is done. + modify vwscanw() to avoid potential buffer overflow. + rewrote lib_printw.c to eliminate fixed-buffer limits. > patches by Alexander V. Lukyanov: + correct an error in handling cooked mode in wgetch(); processing was in the wrong order. + simplified logic in wgetch() that handles backspace, etc., by using wechochar(). + correct wechochar() so that it interprets the output character as in waddch(). + modify pechochar() to use prefresh() rather than doupdate(), since the latter does not guarantee immediate refresh of the pad. + modify pechochar() so that if called with a non-pad WINDOW, will invoke wechochar() instead. + modify fifo indices to allow fifo to be longer than 127 bytes. 970823 + add xterm-8bit to terminfo.src + moved logic for SP->_fifohold inside check_pending() to make it work properly when we add calls to that function. + ensure that bool functions return only TRUE or FALSE, and TRUE/FALSE are assigned to bool values (patch by H.J.Lu). > patches by Alexander V. Lukyanov: + several fixes to getch: 1. Separate cooked and raw keys in fifo 2. Fix the case of ungetch'ed KEY_MOUSE 3. wrap the code for hiding EINTR with ifdef HIDE_EINTR 4. correctly handle input errors (i.e., EINTR) without loss of raw keys 5. recognize ESC KEY_LEFT and similar 6. correctly handle the case of receiption of KEY_MOUSE from gpm + correct off-by-one indexing error in _nc_mouse_parse(), that caused single mouse events (press/release) to be ignored in favor of composed events (click). Improves on a fix from integrating gpm support in 961229. + add another call to check_pending, before scrolling, for line-breakout optimization + improve hashmap.c by 1. fixed loop condition in grow_hunks() 2. not marking lines with offset 0 3. fixed condition of 'too far' criteria, thus one-line hunks are ignored and two lines interchanged won't pass. + rewrote/simplified _nc_scroll_optimize() by separating into two passes, forward/backward, looking for chunks moving only in the given direction. + move logic that emits sgr0 when initializing the screen to _nc_screen_init(), now invoked from newterm. + move cursor-movement cleanup from endwin() into _nc_mvcur_wrap() function and screen cleanup (i.e., color) into _nc_screen_wrap() function. + add new functions _nc_screen_init(), _nc_screen_resume() and _nc_screen_wrap(). + rename _nc_mvcur_scrolln() to _nc_scrolln(). + add a copy of acs_map[] to the SCREEN structure, where it can be stored/retrieved via set_term(). + move variables _nc_idcok, _nc_idlok, _nc_windows into the SCREEN structure. 970816 + implement experimental _nc_perform_scroll(). + modify newterm (actually _nc_setupscreen()) to emit an sgr0 when initializing the screen, as does SVr4 (reported by Alexander V. Lukyanov). + added test_progs rule to ncurses/Makefile. + modify test/configure.in to check if initscr is already in $LIBS before looking for (n)curses library. + correct version-number in configure script for OSF1 shared-library options (patch by Tim Mooney). + add -DNDEBUG to CPPFLAGS for --enable-assertions (as Juergen originally patched) since the c++ demo files do not necessarily include ncurses_cfg.h + supply default value for --enable-assertions option in configure script (reported by Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>). > patches by Alexander V. Lukyanov: + correct/simplify logic of werase(), wclrtoeol() and wclrbot(). See example firstlast.c + optimize waddch_literal() and waddch_nosync() by factoring out common subexpressions. + correct sense of NDEBUG ifdef for CHECK_POSITION macro. + corrections to render_char(), to make handling of colored blanks match SVr4 curses, as well as to correct a bug that xor'd space against the background character. + replaced hash function with a faster one (timed it) + rewrote the hashmap algorithm to be one-pass, this avoids multiple cost_effective() calls on the same lines. + modified cost_effective() so it is now slightly more precise. > patches for glibc integration (H.J.Lu): + add modules define_key, keyok, name_match, tries + add makefile rules for some of the unit tests in ncurses (mvcur, captoinfo, hardscroll, hashmap). + update Linux configure-script for wide-character definitions. 970809 + modify _tracebits() to show the character size (e.g., CS8). + modify tparm() to emit '\200' where the generated string would have a null (reported by From: Ian Dall <Ian.Dall@dsto.defence.gov.au> for terminal type ncr7900). + modify install process so that ldconfig is not invoked if the package is built with an install-prefix. + correct test program for chtype size (reported by Tim Mooney). + add configure option --disable-scroll-hints, using this to ifdef the logic that computes indices for _nc_scroll_optimize(). + add module ncurses/softscroll.c, to perform single-stage computation of scroll indices used in _nc_scroll_optimize(). This is faster than the existing scrolling algorithm, but tends to make too-small hunks. + eliminate fixed buffer size in _nc_linedump(). + minor fixes to lib_doupdate.c to add tradeoff between clr_eol (el) and clr_bol (el1), refine logic in ClrUpdate() and ClrBottom() (patch by Alexander V. Lukyanov). + add test/testaddch.c, from a pending patch by Alexander V. Lukyanov. + correct processing of "configure --enable-assertions" option (patch by Juergen Pfeifer). 970802 + add '-s' (single-step) option too test/hashtest.c, correct an error in loop limit for '-f' (footer option), toggle scrollok() when writing footer to avoid wrap at lower-right corner. + correct behavior of clrtoeol() immediately after wrapping cursor, which was not clearing the line at the cursor position (reported by Liviu Daia <daia@stoilow.imar.ro>). + corrected mapping for ACS_LANTERN, which was 'I' rather than 'i' (reported by Klaus Weide <kweide@tezcat.com>). + many corrections to make progs/capconvert work, as well as make it reasonably portable and integrated with ncurses 4.1 (reported by Dave Furstenau <df@ravine.binary.net>). 970726 + add flag SP->_fifohold, corresponding logic to modify the behavior of the line breakout logic so that if the application does not read input, refreshes will not be stopped, but only slowed. + generate slk_attr_off(), slk_attr_on(), slk_attr_set(), vid_attr(), ifdef'd for wide-character support, since ncurses' WA_xxx attribute masks are identical with the A_xxx masks. + modify MKlib_gen.sh to generate ifdef'd functions to support optional configuration of wide-characters. + modify tset to behave more like SVr4's tset, which does not modify the settings of intr, quit or erase unless they are given as command options (reported by Nelson H. F. Beebe <beebe@math.utah.edu>). + baudrate() function. + improve breakout logic by allowing it before the first line updated, which is what SVr4 curses does (patch by Alexander V. Lukyanov). + correct initialization of vcost in relative_move(), for cursor-down case (patch by Alexander V. Lukyanov). > nits gleaned from Debian distribution of 1.9.9g-3: + install symbolic link for intotocap. + reference libc directly when making shared libraries. + correct renaming of curs_scr_dmp.3x in man_db.renames. + guard tgetflag() and other termcap functions against null cur_term pointer. 970719 + corrected initial state of software echo (error in 970405, reported by Alexander V. Lukyanov). + reviewed/added messages to configure script, so that all non-test options should be accompanied by a message. + add configure check for long filenames, using this to determine if it is safe to allow long aliases for terminal descriptions as does SVr4. + add configure options for widec (wide character), hashmap (both experimental). > patch by Alexander V. Lukyanov: + hashmap.c - improved by heuristic, so that scroll test works much better when csr is not available. + hardscroll.c - patched so that it continues to scroll other chunks after failure to scroll one. + lib_doupdate.c - _nc_mvcur_scrolln extended to handle more cases; csr is avoided as it is relative costly. Fixed wrong coordinates in one case and wrong string in TRACE. > patch by Juergen Pfeifer: + modify C++ binding to compile on AIX 4.x with the IBM C-SET++ compiler. 970712 + remove alternate character set from kterm terminfo entry; it uses the shift-out control for a purpose incompatible with curses, i.e., font switching. + disentangle 'xterm' terminfo entry from some derived entries that should be based on xterm-r6 instead. + add cbt to xterm-xf86-xv32 terminfo entry; I added the emulation for XFree86 3.1.2F, but overlooked its use in terminfo then - T.Dickey. + correct logic in lib_mvcur.c that uses back_tab. 970706 + correct change from 970628 to ClrUpdate() in lib_doupdate.c so that contents of curscr are saved in newscr before clearing the screen. This is needed to make repainting work with the present logic of TransformLine(). + use napms() rather than sleep() in tset.c to avoid interrupting I/O. 970705 + add limit checks to _nc_read_file_entry() to guard against overflow of buffer when reading incompatible terminfo format, e.g, from OSF/1. + correct some loop-variable errors in xmc support in lib_doupdate.c + modify ncurses 'b' test to add gaps, specified by user, to allow investigation of interaction with xmc (magic cookie) code. + correct typo in 970524 mods to xmas.c, had omitted empty parameter list from has_colors(), which gcc ignores, but SVr4 does not (reported by Larry Virden). + correct rmso capability in wy50-mc description. + add configure option "--enable-hard-tabs", renamed TABS_OK ifdef to USE_HARD_TABS. > patch by Juergen Pfeifer: + Add bindings for keyok() and define_key() to the Ada95 packages. + Improve man pages menu_post.3x and menu_format.3x + Fix the HTML pages in the Ada95/html directory to reflect the above changes. 970628 + modify change from 970101 to ClrUpdate() in lib_doupdate.c so that pending changes to both curscr and newscr are flushed properly. This fixes a case where the first scrolling operation in nvi would cause the screen to be cleared unnecessarily and repainted before doing the indexing, i.e., by repeatedly pressing 'j' (reported by Juergen Pfeifer). + correct error in trans_string() which added embedded newlines in a terminfo description to the stored strings. + remove spurious newlines from sgr in wyse50 (and several other) terminfo descriptions. + add configure option for experimental xmc (magic cookie) code, "--enable-xmc-glitch". When disabled (the default), attributes that would store a magic cookie are suppressed in vidputs(). The magic cookie code is far from workable at this stage; the configuration option is a stopgap. + move _nc_initscr() from lib_initscr.c to lib_newterm.c + correct path for invoking make_keys (a missing "./"). 970621 + correct sign-extension problem with "infocmp -e", which corrupted acsc values computed for linux fallback data. + correct dependency on ncurses/names.c (a missing "./"). + modify configure script to use '&&' even for cd'ing to existing directories to work around broken shell interpreters. + correct a loop-limit in _nc_hash_map() (patch by Alexander V. Lukyanov). 970615 + restore logic in _nc_scroll_optimize() which marks as touched the lines in curscr that are shifted. + add new utility 'make_keys' to compute keys.tries as a table rather than a series of function calls. + correct include-dependency for tic.h used by name_match + removed buffer-allocation for name and description from m_item_new.c, since this might result in incompatibilities with SVr4. Also fixed the corresponding Ada95 binding module (patch by Juergen Pfeifer, report by Avery Pennarun <apenwarr@foxnet.net>) + removed the mechanism to timestamp the generated Ada95 sources. This resulted always in generating patches for the HTML doc, even when nothing really changed (patch by Juergen Pfeifer). + improve man page mitem_new.3x (patch by Juergen Pfeifer). 970614 + remove ech capability from rxvt description because it does not work. + add missing case logic for infocmp -I option (reported by Lorenzo M. Catucci <lorenzo@argon.roma2.infn.it>) + correct old bug in pnoutrefresh() unmasked by fix in 970531; this caused glitches in the ncurses 'p' test since the area outside the pad was not compared when setting up indices for _nc_scroll_optimize. + rewrote tracebits() to workaround misdefinition of TOSTOP on Ultrix 4.4, as well as to eliminate fixed-size buffer (reported by Chris Tanner <tannerc@aecl.ca>) + correct prototype for termattrs() as per XPG4 version 2. + add placeholder prototypes for color_set(), erasewchar(), term_attrs(), wcolor_set() as per XPG4 version 2. + correct attribution for progs/progs.priv.h and lib_twait.c + improve line-breakout logic by checking based on changed lines rather than total lines (patch by Alexander V. Lukyanov). + correct loop limits for table-lookup of enumerated value in form (patch by Juergen Pfeifer). + improve threshhold computation for determining when to call ClrToEOL (patch by Alexander V. Lukyanov). 970531 + add configure option --disable-database to force the library to use only the fallback data. + add configure option --with-fallbacks, to specify list of fallback terminal descriptions. + add a symbolic link for ncurses.h during install; too many programs still assume there's an ncurses.h + add new terminfo.src entry for xterm-xf86-v33. + restore terminfo.src entry for emu to using setf/setb, since it is not, after all, generating ANSI sequences. Corrected missing comma that caused setf/setb entries to merge. + modify mousemask() to use keyok() to enable/disable KEY_MOUSE, so that applications can disable ncurses' mouse and supply their own handler. + add extensions keyok() and define_key(). These are designed to allow the user's application better control over the use of function keys, e.g., disabling the ncurses KEY_MOUSE. (The define_key idea was from a mailing-list thread started by Kenneth Albanowski <kjahds@kjahds.com> Nov'1995). + restore original behavior in ncurses 'g' test, i.e., explicitly set the keypad mode rather than use the default, since it confuses people. + rewrote the newdemo banner so it's readable (reported by Hugh Daniel). + tidy up exit from hashtest (reported by Hugh Daniel). + restore check for ^Q in ncurses 'g' test broken in 970510 (reported by Hugh Daniel) + correct tput program, checking return-value of setupterm (patch by Florian La Roche). + correct logic in pnoutrefresh() and pechochar() functions (reported by Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>). The computation of 'wide' date to eric's #283 (1.9.9), and the pechochar bug to the original implementation (1.9.6). + correct typo in vt102-w terminfo.src entry (patch by Robert Wuest <rwuest@sire.vt.com>) + move calls of _nc_background() out of various loops, as its return value will be the same for the whole window being operated on (patch by J T Conklin). + add macros getcur[xy] getbeg[xy] getpar[xy], which are defined in SVr4 headers (patch by J T Conklin <jtc@NetBSD.ORG>) + modify glibc addon-configure scripts (patch by H.J.Lu). + correct a bug in hashmap.c: the size used for clearing the hashmap table was incorrect, causing stack corruption for large values of LINES, e.g., >MAXLINES/2 (patch by Alexander V. Lukyanov). + eric's terminfo 9.13.23 & 9.13.24 changes: replaced minitel-2 entry, added MGR, ansi-nt (note: the changes described for 9.13.24 have not been applied). > several changes by Juergen Pfeifer: + correct a missing error-return in form_driver.c when wrapping of a field is not possible. + correct logic in form_driver.c for configurations that do not have memccpy() (reported by Sidik Isani <isani@cfht.hawaii.edu>) + change several c++ binding functions to inline. + modify c++ menu binding to inherit from panels, for proper initialization. + correct freeing of menu items in c++ binding. + modify c++ binding to reflect removal of const from user data pointer in forms/menus libraries. 970524 + add description of xterm-16color. + modify name of shared-library on *BSD to end with $(REL_VERSION) rather than $(ABI_VERSION) to match actual convention on FreeBSD (cf: 960713). + add OpenBSD to shared-library case, same as NetBSD and FreeBSD (reported by Hugh Daniel <hugh@rat.toad.com>). + corrected include-dependency in menu/Makefile so that "make install" works properly w/o first doing "make". + add fallback definition for isascii, used in infocmp. + modify xmas to use color, and to exit right away when a key is pressed. + modify gdc so that the scrolled digits function as described (there was no time delay between the stages, and the digits overwrote the bounding box without tidying up). + modify lib_color.c to use setaf/setab only for the ANSI color codes 0 through 7. Using 16 colors requires setf/setb. + modify ncurses 'c' test to work with 16 colors, as well as the normal 8 colors. + remove const qualifier from user data pointer in forms and menus libraries (patch by Juergen Pfeifer). + rewrote 'waddchnstr()' to avoid using the _nc_waddch_nosync() function, thereby not interpreting tabs, etc., as per spec (patch by Alexander V. Lukyanov). 970517 + suppress check for pre-existing ncurses header if the --prefix option is specified. + add configure options "--with-system-type" and "--with-system-release" to assist in checking the generated makefiles. + add configure option "--enable-rpath" to allow installers to specify that programs linked against shared libraries will have their library path embedded, allowing installs into nonstandard locations. + add flags to OSF1 shared-library options to specify version and symbol file (patch by Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>) + add missing definition for ABI_VERSION to c++/Makefile.in (reported by Satoshi Adachi <adachi@wisdom.aa.ap.titech.ac.jp>). + modify link flags to accommodate HP-UX linker which embeds absolute pathnames in executables linked against shared libraries (reported by Jason Evans <jasone@mrc.uidaho.edu>, solved by Alan Shutko <ats@hubert.wustl.edu>). + drop unnecessary check for attribute-change in onscreen_mvcur() since mvcur() is the only caller within the library, and that check in turn is exercised only from lib_doupdate.c (patch by Alexander V. Lukyanov). + add 'blank' parameter to _nc_scroll_window() so _nc_mvcur_scrolln() can use the background of stdscr as a parameter to that function (patch by Alexander V. Lukyanov). + moved _nc_mvcur_scrolln() from lib_mvcur.c to lib_doupdate.c, to use the latter's internal functions, as well as to eliminate unnecessary cursor save/restore operations (patch by Alexander V. Lukyanov). + omit parameter of ClrUpdate(), since it is called only for newscr, further optimized/reduced by using ClearScreen() and TransformLine() to get rid of duplicate code (patch by Alexander V. Lukyanov). + modify scrolling algorithm in _nc_scroll_optimize() to reject hunks that are smaller than the distance to be moved (patch by Alexander V. Lukyanov). + correct a place where the panel library was not ifdef'd in ncurses.c (Juergen Pfeifer) + documentation fixes (Juergen Pfeifer) 970515 4.1 release for upload to prep.ai.mit.edu + re-tag changes since 970505 as 4.1 release. 970510 + modify ncurses 'g' test to allow mouse input + modify default xterm description to include mouse. + modify configure script to add -Wwrite-strings if gcc warnings are enabled while configuring --enable-const (and fixed related warnings). + add toggle, status display for keypad mode to ncurses 'g' test to verify that keypad and scrollok are not inherited from parent window during a call to newwin. + correction to MKexpanded.sh to make it work when configure --srcdir is used (reported by H.J.Lu). + revise test for bool-type, ensuring that it checks if builtin.h is available before including it, adding test for sizeof(bool) equal to sizeof(short), and warning user if the size cannot be determined (reported by Alexander V. Lukyanov). + add files to support configuration of ncurses as an add-on library for GNU libc (patch by H.J.Lu <hjl@lucon.org>) 970506 + correct buffer overrun in lib_traceatr.c + modify change to lib_vidattr.c to avoid redundant orig_pair. + turn on 'echo()' in hanoi.c, since it is initially off. + rename local 'errno' variable in etip.h to avoid conflict with global (H.J.Lu). + modify configure script to cache LD, AR, AR_OPTS (patch by H.J.Lu <hjl@lucon.org>) 970505 4.1 pre-release + regenerate the misc directory html dumps without the link list, which is not useful. + correct dependency in form directory makefile which caused unnecessary recompiles. + correct substitution for ABI_VERSION in test-makefile + modify install rules for shared-library targets to remove the target before installing, since some install programs do not properly handle overwrite of symbolic links. + change order of top-level targets so that 'include' immediate precedes the 'ncurses' directory, reducing the time between new headers and new libraries (requested by Larry Virden). + modify lib_vidattr.c so that colors are turned off only before modifying other attributes, turned on after others. This makes the hanoi.c program display correctly on FreeBSD console. + modify debug code in panel library to print user-data addresses rather than the strings which they (may) point to. + add check to ensure that C++ binding and demo are not built with g++ versions below 2.7, since the binding uses templates. + modify c++ binding and demo to build and run with SGI's c++ compiler. (It also compiles with the Sun SparcWorks compiler, but the demo does not link, due to a vtbl problem). + corrections to demo.cc, to fix out-of-scope variables (Juergen Pfeifer). 970503 + correct memory leak in _nc_trace_buf(). + add configure test for regexpr.h, for Unixware 1.x. + correct missing "./" prefixing names of generated files in ncurses directory. + use single-quotes in configure scripts assignments for MK_SHARED_LIB to workaround shell bug on FreeBSD 2.1.5 + remove tabs from intermediate #define's for GCC_PRINTF, GCC_SCANF that caused incorrect result in ncurses_cfg.h + correct initialization in lib_trace.c, which omitted version info. + remove ech, el1 attributes from cons25w description; they appear to malfunction in FreeBSD 2.1.5 + correct color attributes in terminfo.src and lib_color.c to match SVr4 behavior by interchanging codes 1,4, 3,6 in the setf/setb capabilities. + use curs_set() rather than checks via tigetstr() for test programs that hide the cursor: firework, rain, worm. + ensure that if the terminal lacks change_scroll_region, parm_index and parm_rindex are used only to scroll the whole screen (patch by Peter Wemm). + correct curs_set() logic, which did not return ERR if the requested attributes did not exist, nor did it assume an unknown initial state for the cursor (patch by Alexander V. Lukyanov). + combine IDcTransformLine and NoIDcTransformLine to new TransformLine function in lib_doupdate.c (patch by Alexander V. Lukyanov). + correct hashmap.c, which did not update index information (patch by Alexander V. Lukyanov). + fixes for C++ binding and demo (see c++/NEWS) (Juergen Pfeifer). + correct index in lib_instr.c (Juergen Pfeifer). + correct typo in 970426 patch from Tom's cleanup of lib_overlay.c (patch by Juergen Pfeifer). 970426 + corrected cost computation in PutRange(), which was using milliseconds compared to characters by adding two new members to the SCREEN struct, _hpa_ch_cost and _cup_ch_cost. + drop ncurses/lib_unctrl.c, add ncurses/MKunctrl.awk to generate a const array of strings (suggested by Alexander V. Lukyanov). The original suggestion in 970118 used a perl script. + rewrote ncurses 'b' test to better exercise magic-cookie (xmc), as well as noting the attributes that are not supported by a terminal. + trace the computation of cost values in lib_mvcur.c + modify _nc_visbuf() to use octal rather than hex, corrected sign extension bug in that function that caused buffer overflow. + modify trace in lib_acs.c to use _nc_visbuf(). + suppress trace within _traceattr2(). + correct logic of _tracechtype2(), which did not account for repeats or redefinition within an acsc string. + modify debug-library version baudrate() to use environment variable $BAUDRATE to override speed computation. This is needed for regression testing. + correct problems shown by "weblint -pedantic". + update mailing-list information (now ncurses@bsdi.com). 970419 + Improve form_field_validation.3x manpage to better describe the precision parameter for TYPE_NUMERIC and TYPE_INTEGER. Provide more precise information how the range checking can be avoided. (patch by Juergen Pfeifer, reported by Bryan Henderson) + change type of min/max value of form types TYPE_INTEGER to long to match SVr4 documentation. + set the form window to stdscr in set_form_win() so that form_win() won't return null (patch by Juergen Pfeifer, reported by Bryan Henderson <bryanh@giraffe.netgate.net>). 970412 + corrected ifdef'ing of inline (cf: 970321) for TRACE vs C++. + corrected toggle_attr_off() macro (patch by Andries Brouwer). + modify treatment of empty token in $MANPATH to /usr/man (reported by <Andries.Brouwer@cwi.nl>) + modify traces that record functions-called so that chtype and attr_t values are expressed symbolically, to simplify reuse of generated test-scripts on SVr4 regression testing. + add new trace functions _traceattr2() and _tracechtype2() 970405 + add configure option --enable-const, to support the use of 'const' where XSI should have, but did not, specify. This defines NCURSES_CONST, which is an empty token otherwise, for strict compatibility. + make processing of configure options more verbose by echoing the --enable/--with values. + add configure option --enable-big-core + set initial state of software echo off as per XSI. + check for C++ builtin.h header + correct computation of absolute-path for $INSTALL that dropped "-c" parameter from the expression. + rename config.h to ncurses_cfg.h to avoid naming-conflict when ncurses is integrated into larger systems (adapted from diffs by H.J.Lu for libc). + correct inequality in lib_doupdate.c that caused a single-char to not be updated when the char on the right-margin was not blank, idcok() was true (patch by Alexander V Lukyanov (in 970124), reported by Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu> in 970329). + modify 'clean' rule in include/Makefile so that files created by configure script are removed in 'distclean' rule instead. 970328 + correct array limit in tparam_internal(), add case to interpret "%x" (patch by Andreas Schwab) + rewrote number-parsing in ncurses.c 'd' test; it did not reset the value properly when non-numeric characters were given (reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>) 970321 + move definition of __INTERNAL_CAPS_VISIBLE before include for progs.priv.h (patch by David MacKenzie). + add configuration summary, reordered check for default include directory to better accommodate a case where installer is configuring a second copy of ncurses (reported by Klaus Weide <kweide@tezcat.com>) + moved the #define for 'inline' as an empty token from the $(CFLAGS_DEBUG) symbol into config.h, to avoid redefinition warning (reported by Ward Horner). + modify test for bool builtin type to use 'unsigned' rather than 'unknown' when cross-compiling (reported by Ward Horner). 970315 + add header dependencies so that "make install.libs" will succeed even if "make all" is not done first. + moved some macros from lib_doupdate.c to curses.priv.h to use in expanded functions with ATAC. + correct implementation of lib_instr.c; both XSI and SVr4 agree that the winnstr functions can return more characters than will fit on one line. 970308 + modify script that generates lib_gen.c to support traces of called & return. + add new configure option "--disable-macros", for testing calls within lib_gen.c + corrected logic that screens level-checking of called/return traces. 970301 + use new configure macro NC_SUBST to replace AC_PATH_PROG, better addressing request by Ward Horner. + check for cross-compiling before trying to invoke the autoconf AC_FUNC_SETVBUF_REVERSED macro (reported by Ward Horner) + correct/simplify loop in _nc_visbuf(), 970201 changes omitted a pointer-increment. + eliminate obsolete symbol SHARED_ABI from dist.mk (noted by Florian La Roche). 970215 + add configure option --enable-expanded, together with code that implements an expanded form of certain complex macros, for testing with ATAC. + disable CHECK_POSITION unless --with-assertions is configured (Alexander V Lukyanov pointed out that this is redundant). + use keyname() to show traced chtype values where applicable rather than _tracechar(), which truncates the value to 8-bits. + minor fixes to TRACE_ICALLS, added T_CREATE, TRACE_CCALLS macros. + modify makefiles in progs and test directories to avoid using C preprocessor options on link commands (reported by Ward Horner) + correct ifdef/include-order for nc_alloc.h vs lib_freeall.c (reported by Ward Horner) + modify ifdef's to use configure-defined symbols consistently (reported by Ward Horner) + add/use new makefile symbols AR, AR_OPTS and LD to assist in non-UNIX ports (reported by Ward Horner <whorner@tsi-telsys.com>) + rename struct try to struct tries, to avoid name conflict with C++ (reported by Gary Johnson). + modify worm.c to hide cursor while running. + add -Wcast-qual to gcc warnings, fix accordingly. + use PutChar rather than PutAttrChar in ClrToEOL to properly handle wrapping (Alexander V Lukyanov). + correct spurious echoing of input in hanoi.c from eric's #291 & #292 patches (reported by Vernon C. Hoxie <vern@zebra.alphacdc.com>). + extend IRIX configuration to IRIX64 + supply missing install.libs rule needed after restructuring test/Makefile.in 970208 + modify "make mostlyclean" to leave automatically-generated source in the ncurses directory, for use in cross-compiles. + autogenerated object-dependencies for test directory + add configure option --with-rcs-ids + modify configuration scripts to generate major/minor/patch versions (suggested by Alexander V Lukyanov). + supply missing va_end's in lib_scanw.c + use stream I/O for trace-output, to eliminate fixed-size buffer + add TRACE_ICALLS definition/support to lib_trace.c + modify Ada95 binding to work with GNAT 3.09 (Juergen Pfeifer). 970201 + add/modify traces for called/return values to simplify extraction for test scripts. + changed _nc_visbuf to quote its result, and to dynamically allocate the returned buffer. + invoke ldconfig after installing shared library + modify install so that overwrite applies to shared library -lcurses in preference to static library (reported by Zeyd M Ben-Halim 960928). + correct missing ';' in 961221 mod to overwrite optional use of $(LN_S) symbol. + fixes to allow "make install" to work without first doing a "make all" (suggested by Larry Virden). 970125 + correct order of #ifdef for TABS_OK. + instrumented toe.c to test memory-leaks. + correct memory-deallocation in toe.c (patch by Jesse Thilo). + include <sys/types.h> in configuration test for regex.h (patch by Andreas Schwab) + make infocmp recognize -I option, for SVr4 compatibility (reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>) 970118 + add extension 'use_default_colors()', modified test applications that use default background (firework, gdc, hanoi, knight, worm) to demonstrate. + correct some limit checks in lib_doupdate.c exposed while running worm. + use typeCalloc macro for readability. + add/use definition for CONST to accommodate testing with Solaris (SVr4) curses, which doesn't use 'const' in its prototypes. + modify ifdef's in test/hashtest.c and test/view.c to compile with Solaris curses. + modify _tracedump() to pad pad colors & attrs lines to match change in 970101 showing first/last changes. + corrected location of terminating null on dynamically allocated forms fields (patch by Per Foreby). 970111 + added headers to make view.c compile on SCO with the resizeterm() code (i.e., struct winsize) - though this compiles, I don't have a suitable test configuration since SIGWINCH doesn't pass my network to that machine - T.Dickey. + update test/configure.in to supply some default substitutions. + modify configure script to add -lncurses after -lgpm to fix problem linking against static libraries. + add a missing noraw() to test/ncurses.c (places noted by Jeremy Buhler) + add a missing wclear() to test/testcurs.c (patch by Jeremy Buhler <jbuhler@cs.washington.edu>) + modify headers to accommodate compilers that don't allow duplicate "#define" lines for NCURSES_VERSION (reported by Larry W. Virden <lvirden@cas.org>) + fix formatting glitch in curs_getch.3x (patch by Jesse Thilo). + modify lib_doupdate to make el, el1 and ed optimization use the can_clear_with macro, and change EmitRange to allow leaving cursor at the middle of interval, rather than always at the end (patch by Alexander V Lukyanov). This was originally 960929, resync 970106. 970104 + workaround defect in autoconf 2.12 (which terminates configuration if no C++ compiler is found) by adding an option --without-cxx. + modify several man-pages to use tbl, where .nf/.fi was used (reported by Jesse Thilo). + correct font-codes in some man-pages (patch by Jesse Thilo <Jesse.Thilo@pobox.com>) + use configure script's knowledge of existence of g++ library for the c++ Makefile (reported by Paul Jackson). + correct misleading description of --datadir configuration option (reported by Paul Jackson <pj@sam.engr.sgi.com>) 970101 + several corrections to _nc_mvcur_scrolln(), prompted by a bug report from Peter Wemm: > the logic for non_dest_scroll_region was interchanged between the forward & reverse scrolling cases. > multiple returns from the function allowed certain conditions to do part of an operation before discovering that it couldn't be completed, returning an error without restoring the cursor. > some returns were ERR, where the function had completed the operation, because the insert/delete line logic was improperly tested (this was probably the case Peter saw). > contrary to comments, some scrolling cases were tested after the insert/delete line method. + modify _tracedump() to show first/last changes. + modify param of ClrUpdate() in lib_doupdate.c to 'newscr', fixes refresh problem (reported by Peter Wemm) that caused nvi to not show result of ":r !ls" until a ^L was typed. 961229 (internal alpha) + correct some of the writable-strings warnings (reported by Gary Johnson <gjohnson@season.com>). Note that most of the remaining ones are part of the XSI specification, and can't be "fixed". + improve include-dependencies in form, menu, panel directories. + correct logic of delay_output(), which would return early if there is data on stdin. + modify interface & logic of _nc_timed_wait() to support 2 file descriptors, needed for GPM. + integrate patch by Andrew Kuchling <amk@magnet.com> for GPM (mouse) support, correcting logic in wgetch() and _nc_mouse_parse() which prevented patch from working properly -TD + improve performance of panel algorithm (Juergen Pfeifer 961203). + strip RCS id's from generated .html files in Ada95 subtree. + resync with generated .html files (Juergen Pfeifer 961223). + terminfo.src 10.1.0 (ESR). 961224 4.0 release + release as 4.0 to accommodate Linux ld.so.1.8.5 + correct syntax/spelling, regenerated .doc files from .html using lynx 2.5 + refined forms/menus makefiles (Juergen Pfeifer 961223). 961221 - snapshot + remove logic in read_entry.c that attempts to refine errno by using 'access()' for the directory (from patch by Florian La Roche). + correct configure test/substitution that inhibits generating include-path to /usr/include if gcc is used (reported by Florian La Roche). + modify setupterm() to allocate new TERMINAL for each call, just as solaris' curses does (Alexander V Lukyanov 960829). + corrected memory leaks in read_entry.c + add configure options --with-dbmalloc, --with-dmalloc, and --disable-leaks, tested by instrumenting infocmp, ncurses programs. + move #include's for stdlib.h and string.h to *.priv.h to accommodate use of dbmalloc. + modify use of $(LN_S) to follow recommendation in autoconf 2.12, i.e., set current directory before linking. + split-out panel.priv.h, improve dependencies for forms, menus (Juergen Pfeifer 961204). + modify _nc_freewin() to reset globals curscr/newscr/stdscr when freeing the corresponding WINDOW (found using Purify). + modify delwin() to return ERR if the window to be deleted has subwindows, needed as a side-effect of resizeterm() (found using Purify). Tested and found that SVr4 curses behaves this way. + implement logic for _nc_freeall(), bringing stub up to date. 961215 + modify wbkgd() so that it doesn't set nulls in the rendered text, even if its argument doesn't specify a character (fixes test case by Juergen Pfeifer for bug-report). + set window-attributes in wbkgd(), to simplify comparison against Solaris curses, which does this. 961214 - snapshot + replace most constants in ncurses 'o' test by expressions, making it work with wider range of screen sizes. + add options to ncurses.c to specify 'e' test softkey format, and the number of header/footer lines to rip-off. + add ^R (repaint after resize), ^L (refresh) commands to ncurses 'p' test. + add shell-out (!) command to ncurses 'p' test to allow test of resize between endwin/refresh. + correct line-wrap case in mvcur() by emitting carriage return, overlooked in 960928, but needed due to SVr4 compatibility changes to terminal modes in 960907. + correct logic in wresize that causes new lines to be allocated, broken for the special case of increasing rows only in 960907's fix for subwindows. + modify configure script to generate $(LDFLAGS) with -L and -l options in preference to explicit library filenames. (NOTE: this may require further amending, since I vaguely recall a dynamic loader that did not work properly without the full names, but it should be handled as an exception to the rule, since some linkers do bulk inclusion of libraries when given the full name - T.Dickey). + modify configure script to allow user-supplied $CFLAGS to set the debug-option in all libraries (requested by lots of people) -TD + use return consistently from main(), rather than exit (reported by Florian La Roche). + add --enable-getcap-cache option to configure, normally disabled (requested by Florian La Roche). + make configure test for gettimeofday() and possibly -lbsd more efficient (requested by Florian La Roche <florian@knorke.saar.de>) + minor adjustments to Ada95 binding (patches by Juergen Pfeifer) + correct attributes after emitting orig_pair in lib_vidattr.c (patch by Alexander V Lukyanov). 961208 + corrected README wrt Ada95 (Juergen Pfeifer) 961207 - snapshot + integrate resizeterm() into doupdate(), so that if screen size changes between endwin/refresh, ncurses will resize windows to fit (this needs additional testing with pads and softkeys). + add, for memory-leak testing, _nc_freeall() entrypoint to free all data used in ncurses library. + initialize _nc_idcok, _nc_idlok statically to resolve discrepancy between initscr() and newwin() initialization (reported by Alexander V Lukyanov). + test built VERSION=4.0, SHARED_ABI=4 with Linux ld.so.1.8.5 (set beta versions to those values -- NOTE that subsequent pre-4.0 beta may not be interchangeable). + modify configure script to work with autoconf 2.12 961130 1.9.9g release + add copyright notices to configuration scripts (written by Thomas Dickey). 961127 > patch, mostly for panel (Juergen Pfeifer): + cosmetic improvement for a few routines in the ncurses core library to avoid warning messages. + the panel overlap detection was broken + the panel_window() function was not fool-proof. + Some inlining... + Cosmetic changes (also to avoid warning messages when compiling with -DTRACE). 961126 > patch by Juergen Pfeifer: + eliminates warning messages for the compile of libform. + inserts Per Foreby's new field type TYPE_IPV4 into libform. + Updates man page and the Ada95 binding to reflect this. + Improves inlining in libmenu and libform. 961120 + improve the use of the "const" qualifier in the panel library (Juergen Pfeifer) + change set_panel_userptr() and panel_userptr() to use void* (Juergen Pfeifer) 961119 + change ABI to 3.4 + package with 961119 version of Ada95 binding (fixes for gnat-3.07). (Juergen Pfeifer) + correct initialization of the stdscr pseudo panel in panel library (Juergen Pfeifer) + use MODULE_ID (rcs keywords) in forms and menus libraries (Juergen Pfeifer). > patch #324 (ESR): + typo in curs_termcap man page (reported by Hendrik Reichel <106065.2344@compuserve.com>) + change default xterm entry to xterm-r6. + add entry for color_xterm 961116 - snapshot + lint found several functions that had only #define implementations (e.g., attr_off), modified curses.h.in to generate them as per XSI Curses requirement that every macro be available as a function. + add check in infocmp.c to guard against string compare of CANCELLED_STRING values. + modify firework.c, rain.c to hide cursor while running. + correct missing va_end in lib_tparm.c + modify hanoi.c to work on non-color terminals, and to use timing delays when in autoplay mode. + correct 'echochar()' to refresh immediately (reported by Adrian Garside <94ajg2@eng.cam.ac.uk>) > patch #322 (ESR): + reorganize terminfo.src entries for xterm. 961109 - snapshot + corrected error in line-breakout logic (lib_doupdate.c) + modified newdemo to use wgetch(win) rather than getch() to eliminate a spurious clear-screen. + corrected ifdef's for 'poll()' configuration. + added modules to ncurses, form, menu for Ada95 binding (Juergen Pfeifer). + modify set_field_buffer() to allow assignment of string longer than the initial buffer length, and to return the complete string rather than only the initial size (Juergen Pfeifer and Per Foreby <perf@efd.lth.se>). 961102 - snapshot + configure for 'poll()' in preference to 'select()', since older systems are more likely to have a broken 'select()'. + modified render_char() to avoid OR'ing colors. + minor fixes to testcurs.c, newdemo.c test programs: ifdef'd out the resize test, use wbkgd and corrected box() parameters. + make flushinp() test work in ncurses.c by using napms() instead of sleep(). + undo ESR's changes to xterm-x11r6 (it no longer matched the X11R6.1 distribution, as stated) + terminfo 9.13.18 resync (ESR) + check for getenv("HOME") returning null (ESR). + change buffer used to decode xterm-mouse commands to unsigned to handle displays wider than 128 chars (Juergen Pfeifer). + correct typo curs_outopts.3x (Juergen Pfeifer). + correct limit-checking in wenclose() (Juergen Pfeifer). + correction to Peter Wemm's newwin change (Thomas Fehr <fehr@suse.de>). + corrections to logic that combines colors and attributes; they must not be OR'd (Juergen Pfeifer, extending from report/patch by Rick Marshall). 961026 - snapshot + reset flags in 'getwin()' that might cause refresh to attempt to manipulate the non-existent parent of a window that is read from a file (lib_screen.c). + restructure _nc_timed_wait() to log more information, and to try to recover from badly-behaved 'select()' calls (still testing this). + move define for GOOD_SELECT into configure script. + corrected extra '\' character inserted before ',' in comp_scan.c + corrected expansion of %-format characters in dump_entry.c; some were rendered as octal constants. + modify dump_entry.c to make terminfo output more readable and like SVr4, by using "\s" for spaces (leading/trailing only), "\," for comma, "\^" and "\:" as well. + corrected some memory leaks in ncurses.c, and a minor logic error in the top-level command-parser. + correction for label format 4 (PC style with info line), a slk_clear(), slk_restore() sequence didn't redraw the info line (Juergen Pfeifer). + modified the slk window (if simulated) to inherit the background and default character attributes from stdscr (Juergen Pfeifer). + corrected limit-check in set_top_row (Juergen Pfeifer). 961019 - snapshot + correct loop-limit in wnoutrefresh(), bug exposed during pipe-testing had '.lastchar' entry one beyond '._maxx'. + modify ncurses test-program to work with data piped to it. + corrected pathname computation in run_tic.sh, removing extra "../" (reported by Tim Mooney). + modified configure script to use previous install's location for curses.h + added NetBSD and FreeBSD to platforms that use --prefix=/usr as a default. 961013 + revised xterm terminfo descriptions to reflect the several versions that are available. + corrected a pointer reference in dump_entry.c that didn't test if the pointer was -1. 961005 - snapshot + correct _nc_mvcur_scrolln for terminals w/o scrolling region. + add -x option to hashtest to control whether it allows writes to the lower-right corner. + ifdef'd (NCURSES_TEST) the logic for _nc_optimize_enable to make it simpler to construct tests (for double-check of _nc_hash_map tests). + correct ifdef's for c++ in curses.h + change default xterm type to xterm-x11r6. + correct quoting in configure that made man-pages installed with $datadir instead of actual terminfo path. + correct whitespace in include/Caps, which caused kf11, clr_eol and clr_end to be omitted from terminfo.5 + fix memory leaks in delscreen() (adapted from Alexander V Lukyanov). + improve appearance of marker in multi-selection menu (Juergen Pfeifer) + fix behavior for forms with all fields inactive (Juergen Pfeifer) + document 'field_index()' (Juergen Pfeifer) > patch #321 (ESR): + add some more XENIX keycap translations to include/Caps. + modify newwin to set initial state of each line to 'touched' (from patch by Peter Wemm <peter@spinner.dialix.com>) + in SET_TTY, replace TCSANOW with TCSADRAIN (Alexander V Lukyanov). 960928 - snapshot + ifdef'd out _nc_hash_map (still slower) + add graphic characters to vt52 description. + use PutAttrChar in ClrToEOL to ensure proper background, position. + simplify/correct logic in 'mvcur()' that does wrapping; it was updating the position w/o actually moving the cursor, which broke relative moves. + ensure that 'doupdate()' sets the .oldindex values back to a sane state; this was causing a spurious refresh in ncurses 'r'. + add logic to configure (from vile) to guard against builders who don't remove config.cache & config.status when doing new builds -TD + corrected logic for 'repeat_char' in EmitRange (cf: eric #317), which did not follow the 2-parameter scheme specified in XSI. + corrected logic of wrefresh, wnoutrefresh broken in #319, making clearok work properly (report by Michael Elkins). + corrected problem with endwin introduced by #314 (removing the scrolling-region reset) that broke ncurses.c tests. + corrected order of args in AC_CHECK_LIB (from report by Ami Fischman <fischman@math.ucla.edu>). + corrected formatting of terminfo.5 tables (Juergen Ehling) > patch 320 (ESR): + change ABI to 3.3 + emit a carriage-return in 'endwin()' to workaround a kernel bug in BSDI. (requested by Mike Karels <karels@redrock.bsdi.com>) + reverse the default o configure --enable-termcap (consensus). > patch 319 (ESR): + modified logic for clearok and related functions (from report by Michael Elkins) - untested > patch 318 (ESR): + correction to #317. > patch 317 (ESR): + re-add _nc_hash_map + modify EmitRange to maintain position as per original design. + add hashtest.c, program to time the hashmap optimization. > patch 316 (ESR): + add logic to deal with magic-cookie (how was this tested?) (lib_doupdate.c). + add ncurses.c driver for magic-cookie, some fixes to ncurses.c > patch 315 (ESR): + merged Alexander V Lukyanov's patch to use ech and rep - untested (lib_doupdate.c). + modified handling of interrupted system calls - untested (lib_getch.c, lib_twait.c). + new function _nc_mvcur_resume() + fix return value for 'overlay()', 'overwrite()' 960914 - snapshot + implement subwindow-logic in wresize, minor fixes to ncurses 'g' test. + corrected bracketing of fallback.c (reported/suggested fix by Juergen Ehling <eh@eclipse.aball.de>). + update xterm-color to reflect XFree86 3.1.3G release. + correct broken dtterm description from #314 patch (e.g., spurious newline. The 'pairs' change might work, but no one's tested it either ;-) + clarify the documentation for the builtin form fieldtypes (Juergen Pfeifer) > patch 314 (ESR): + reset scroll region on startup rather than at wrapup time (enhancement suggested by Alexander V Lukyanov). + make storage of palette tables and their size counts per-screen for multi-terminal applications (suggested by Alexander V Lukyanov). + Improved error reporting for infotocap translation errors. + Update terminfo.src to 9.13.14. 960907 - snapshot + rewrote wgetstr to make it erase control chars and also fix bogus use of _nc_outstr which caused the display to not wrap properly (display problem reported by John M. Flinchbaugh <glynis@netrax.net>) + modify ncurses 'f' test to accommodate terminal responses to C1 codes (and split up this screen to accommodate non-ANSI terminals). + test enter_insert_mode and exit_insert_mode in has_ic(). + removed bogus logic in mvcur that assumes nl/nonl set output modes (XSI says they are input modes; SVr4 implements this). + added macros SET_TTY, GET_TTY to term.h + correct getstr() logic that altered terminal modes w/o restoring. + disable ICRNL, etc., during initialization to match SVr4, removing the corresponding logic from raw, cbreak, etc. + disable ONLCR during initialization, to match SVr4 (this is needed for cursor optimization when the cursor-down is a newline). + replaced ESR's imitation of wresize with my original (his didn't work). 960831 - snapshot + memory leaks (Alexander V. Lukyanov). + modified pnoutrefresh() to be more tolerant of too-large screen size (reported by Michael Elkins). + correct handling of terminfo files with no strings (Philippe De Muyter) + correct "tic -s" to take into account -I, -C options. + modify ncurses 'f' test to not print codes 80 through 9F, since they are considered control codes by ANSI terminals. 960824 - snapshot + correct speed variable-type in 'tgetent()' (reported by Peter Wemm) + make "--enable-getcap" configuration-option work (reported by Peter Wemm <peter@spinner.DIALix.COM>) 960820 + correct err in 960817 that changed return-value of tigetflag() (reported by Alexander V. Lukyanov). + modify infocmp to use library default search-path for terminfo directory (Alexander V. Lukyanov). 960817 - snapshot + corrected an err in mvcur that broke resizing-behavior. + correct fall-thru behavior of _nc_read_entry(), which was not finding descriptions that existed in directories past the first one searched (reported by Alexander V. Lukyanov) + corrected typo in dtterm description. > patch 313 (ESR): + add dtterm description + clarify ncurses 'i' test (drop vscanf subtest) 960810 - snapshot + correct nl()/nonl() to work as per SVr4 & XSI. + minor fixes to ncurses.c (use 'noraw()', mvscanw return-code) + refine configure-test for -g option (Tim Mooney). + correct interaction between O_BLANK and NEW_LINE request in form library (Juergen Pfeifer) 960804 + revised fix to tparm; previous fix reversed parameter order. > patch 312 (ESR): correct terminfo.src corrupted by #310 > patch 311 (ESR): + fix idlok() and idcok() and the default of the idlok switch. 960803 - snapshot + corrected tparm to handle capability strings without explicit pop (reported by William P Setzer) + add fallback def for GCC_NORETURN, GCC_UNUSED for termcap users (reported by Tim Mooney). > patch 310 (ESR): + documentation and prototyping errors for has_color, immedok and idcok (reported by William P Setzer <wsetzer@pams.ncsu.edu>) + updated qnx terminfo entry (by Michael Hunter) 960730 + eliminate quoted includes in ncurses subdirectory, ensure config.h is included first. + newterm initializes terminal settings the same as initscr (reported by Tim Mooney). 960727 - snapshot + call cbreak() in initscr(), as per XSI & SVr4. + turn off hardware echo in initscr() as per XSI & SVr4 > patch 309 (ESR): + terminfo changes (9.3.10), from BRL + add more checks to terminfo parser. + add more symbols to infocmp. 960720 - snapshot + save previous-attribute in lib_vidattr.c if SP is null (reported by Juergen Fluk <louis@dachau.marco.de>) + corrected calls on _nc_render so that background character is set as per XSI. + corrected wbkgdset macro (XSI allows background character to be null), and tests that use it. + more corrections to terminfo (xterm & rxvt) + undid change to mcprint prototype (cannot use size_t in curses.h because not all systems declare it in the headers that we can safely include therein). + move the ifdefs for errno into curses.priv.h > patch 308 (ESR): + terminfo changes (9.3.8) + modified logic of error-reporting in terminfo parser 960713 - snapshot + always check for <sys/bsdtypes.h> since ISC needs it to declare fd_set (Juergen Pfeifer) + install shared-libraries on NetBSD/FreeBSD with ABI-version (reported by Juergen Pfeifer, Mike Long) + add LOCAL_LDFLAGS2 symbol (Juergen Pfeifer) + corrected prototype for delay_output() -- bump ABI to 3.2 + terminfo patches #306/307 (ESR). + moved logic that filters out rmul and rmso from setupterm to newterm where it is less likely to interfere with termcap applications. 960707 + rollback ESR's #305 change to terminfo.src (it breaks existing applications, e.g., 'less 290'). + correct path of edit_man.sh, and fix typo that made all man-pages preformatted. + restore man/menu_requestname.3x omitted in Zeyd's resync (oops). + auto-configure the GCC_PRINTFLIKE/GCC_SCANFLIKE macros (reported by Philippe De Muyter). 960706 - snapshot + (reported by David MacKenzie). + add/use gcc __attribute__ for printf and scanf in curses.h + added SGR attributes test-case to ncurses + revised ncurses 't' logic to show trace-disable effect in the menu. + use getopt in ncurses program to process -s and -t options. + make ncurses 'p' legend toggle with '?' + disable scrollok during the ncurses 'p' test; if it is enabled the stdscr will scroll when putting the box-corners in the lower-right of the screen. 960629 - snapshot + check return code of _nc_mvcur_scrolln() in _nc_scroll_optimize() for terminals with no scrolling-support (reported by Nikolay Shadrin <queen@qh.mirea.ac.ru>) + added ^S scrollok-toggle to ncurses 'g' test. + added ^T trace-toggle to ncurses tests. + modified ncurses test program to use ^Q or ESC consistently for terminating tests (rather than ^D), and to use control keys rather than function keys in 'g' test. + corrected misplaced wclrtoeol calls in addch to accommodate wrapping (reported by Philippe De Muyter). + modify lib_doupdate.c to use effective costs to tradeoff between delete-character/insert-character vs normal updating (reported by David MacKenzie). + compute effective costs for screen update operations (e.g., clr_eos, delete_character). + corrected error in knight.c exposed by wrap fixes in 960622; the msgwin needed scrollok set. + corrected last change to IDcTransformLine logic to avoid conflict between PutRange and InsStr + modified run_tic.sh to not use /usr/tmp (reported by David MacKenzie), and further revised it and aclocal.m4 to use $TMPDIR if set. + corrected off-by-one in RoomFor call in read_entry.c 960622 - snapshot + modified logic that wraps cursor in addch to follow the XSI spec, (implemented in SVr4) which states that the cursor position is updated when wrapping. Renamed _NEED_WRAP to _WRAPPED to reflect the actual semantics. + added -s option to tic, to provide better diagnostics in run_tic.sh + improved error-recovery for tabset install. + change ABI to 3.1 (dropped tparam, corrected getbkgd(), added _yoffset to WINDOW). + modified initialization of SP->_ofp so that init_acs() is called with the "right" file pointer (reported by Rick Marshall <rjm@nlc.net.au> + documentation fixes (Juergen Pfeifer). + corrected, using new SCREEN and WINDOW members, the behavior of ncurses if one uses ripoffline() to remove a line from the top of the screen (Juergen Pfeifer). + modified autoconf scripts to prepare for Ada95 (GNAT) binding to ncurses (Juergen Pfeifer). + incorrect buffer-size in _nc_read_entry, reported by ESR. 960617 + corrected two logic errors in read_entry.c, write_entry.c (called by tic, the write/read of terminfo entries used inconsistent rules for locating the entries; the $TERMINFO_DIRS code would find only the first entry in a list). + refined pathname computation in run_tic.sh and shlib. + corrected initialization of $IP in misc/run_tic.sh 960615 - snapshot + ifdef'd out _nc_hash_map() call because it does not improve speed. + display version of gcc if configure script identifies it. + modify configure script to use /usr as Linux's default prefix. + modify run_tic.sh to use shlib script, fixes some problems installing with a shared-library configuration. + adjusted configure script so that it doesn't run tests with the warnings turned on, which makes config.log hard to read. + added 'lint' rule to top-level Makefile. + added configure option '--with-install-prefix' for use by system builders to install into staging locations (requested by Charles Levert <charles@comm.polymtl.ca>). + corrected autoconfigure for Debian man program; it's not installed as "man_db". + set noecho in 'worm'; it was ifdef'd for debug only + updated test/configure.in for timing-display in ncurses 'p' test + corrected misspelled 'getbkgd()'. + corrected wbkgdset to work like observed syvr4 (sets A_CHARTEXT part to blank if no character given, copies attributes to window's attributes). + modified lib_doupdate.c to use lower-level SP's current_attr state instead of curscr's state, since it is redundant. + correction to IDcTransformLine logic which controls where InsStr is invoked (refined by Alexander V Lukyanov). > patch 303 (ESR): + conditionally include Chris Torek's hash function _nc_hash_map(). + better fix for nvi refresh-bug (Rick Marshall) + fix for bug in handling of interrupted keystroke waits, (Werner Fleck). 960601 - snapshot + auto-configure man-page compression-format and renames for Debian. + corrected several typos in curses.h.in (i.e., the mvXXXX macros). + re-order curses.priv.h for lint. + added rules for lintlib, lint + corrected ifdef for BROKEN_LINKER in MKnames.awk.in + corrected missing INSTALL_DATA in misc/Makefile.in + flush output when changing cursor-visibility (Rick Marshall) + fix a minor bug in the _nc_ripoff() routine and improve error checking when creating the label window (Juergen Pfeifer). + enhancement to the control over the new PC-style soft key format. allow caller now to select whether or not one wants to have the index-line; see curs_slk.3x for documentation (Juergen Pfeifer). + typos, don't use inline with -g (Philippe De Muyter) + fixes for menus & wattr-, slk-functions (Juergen Pfeifer) 960526 - snapshot + removed --with-ticdir option altogether, maintain compatibility with existing applications via symbolic link in run_tic.sh + patch for termio.h, signal (Philippe De Muyter) + auto-configure gcc warning options rather than infer from version. + auto-configure __attribute__ for different gcc versions. + corrected special use of clearok() in hardscroll.c by resetting flag in wrefresh(). + include stdlib.h before defs for EXIT_SUCCESS, for OSF/1. + include sys/types.h in case stdlib.h does not declare size_t. + fixes for makefile (Tim Mooney) + fixes for menus & forms (Juergen Pfeifer) 960518 - snapshot + revised ncurses.c panner test, let pad abut all 4 sides of screen. + refined case in lib_doupdate.c for ClrToEOL(). + corrected prior change for PutRange (Alexander V Lukyanov <lav@yars.free.net>). + autoconf mods (Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>). + locale fix for forms (Philippe De Muyter <phdemuyt@ulb.ac.be>) + renamed "--with-datadir" option to "--with-ticdir" to avoid confusion, and made this check for the /usr/lib/terminfo pre-existing directory. > patches 299-301 (ESR): + added hashmap.c + mods to tracing, especially for ACS chars. + corrected off-by-one in IDCtransform. + corrected intermittent mouse bug by using return-value from read(). + mods to parse_entry.c, for smarter defaults. 960512 + use getopt in 'tic'; added -L option and modified -e option to allow list from a file. 960511 + don't use fixed buffer-size in tparm(). + modified tic to create terminfo directory if it doesn't exist. + added -T options to tic and infocmp (for testing/analysis) + refined the length criteria for termcap and terminfo + optimize lib_doupdate with memcpy, PutRange > patches 297, 298 (ESR): + implement TERMINFO_DIRS, and -o option of tic + added TRACE_IEVENT +). + misc cursor & optimization fixes. 960504 - snapshot + modified ncurses 'p' test to allow full-screen range for panner size. + fixes for locale (Philippe De Muyter <phdm@labauto1.ulb.ac.be>) + don't use fixed buffer-size in fmt_entry(). + added usage-message to 'infocmp'. + modified install.includes rules to prepend subdirectory-name to "#include" if needed. 960430 + protect wrefresh, wnoutrefresh from invocation with pad argument. + corrected default CCFLAGS in test/Makefile. 960428 - snapshot + implemented logic to support terminals with background color erase (e.g., rxvt and the newer color xterm). + improved screen update logic (off-by-one logic error; use clr_eos if possible) 960426 - snapshot + change ncurses 'a' test to run in raw mode. + make TIOCGWINSZ configure test less stringent, in case user configures via terminal that cannot get screen size. > patches 295, 296 (ESR): + new "-e" option of tic. + fix for "infocmp -e". + restore working-directory in read_termcap.c + split lib_kernel.c, lib_setup.c and names.c in order to reduce overhead for programs that use only termcap features. 960406 + fixes for NeXT, ISC and HPUX auto-configure + autogenerate development header-dependencies (config.h, *.priv.h) + corrected single-column formatting of "use=" (e.g., in tic) + modify tic to read full terminfo-names + corrected divide-by-zero that caused hang (or worse) when redirecting output + modify tic to generate directories only as-needed (and corrected instance of use of data from function that had already returned). ### ncurses-1.9.8a -> 1.9.9e * fixed broken wsyncup()/wysncdown(), as a result wnoutrefresh() now has copy-changed-lines behavior. * added and documented wresize() function. * more fixes to LOWER-RIGHT corner handling. * changed the line-breakout optimization code to allow some lines to be emitted before the first check. * added option for tic to use symbolic instead of hard links (for AFS) * fix to restore auto-wrap mode. * trace level can be controlled by environment variable. * better handling of NULs in terminal descriptions. * improved compatibility with observed SVR4 behavior. * the refresh behavior of over-lapping windows is now more efficient and behaves like SVR4. * use autoconf 2.7, which results in a working setup for SCO 5.0. * support for ESCDELAY. * small fixes for menu/form code. * the test directory has its own configure. * fixes to pads when optimizing scrolling. * fixed several off-by-one bugs. * fixes for termcap->terminfo translation; less restrictions more correct behavior. ### ncurses-1.9.7 -> 1.9.8a * teach infocmp -i to recognize ECMA highlight sequences * infocmp now dumps all SVr4 termcaps (not just the SVr4 ones) on -C * support infocmp -RBSD. * satisfy XSI Curses requirement that every macro be available as a function. * This represents the last big change to the public interface of ncurses. The ABI_VERSION has now been set at 3.0 and should stay there barring any great catastrophies or acts of God. * The C++ has been cleaned up in reaction to the changes to satisfy XSI's requirements. * libncurses now gets linked to libcurses to help seamless emulation (replacement) of a vendor's curses. --disable-overwrite turns this behavior off. ### ncurses-1.9.6 -> 1.9.7 * corrected return values of setupterm() * Fixed some bugs in tput (it does padding now) * fixed a bug in tic that made it do the wrong thing on entries with more than one `use' capability. * corrected the screen-size calculation at startup time to alter the numeric capabilities as per SVr4, not just LINES and COLS. * toe(1) introduced; does what infocmp -T used to. * tic(1) can now translate AIX box1 and font[0123] capabilities. * tic uses much less core, the dotic.sh kluge can go away now. * fix read_entry() and write_entry() to pass through cancelled capabilities OK. * Add $HOME/.terminfo as source/target directory for terminfo entries. * termcap compilation now automatically dumps an entry to $HOME/.terminfo. * added -h option to toe(1). * added -R option to tic(1) and infocmp(1). * added fallback-entry-list feature. * added -i option to infocmp(1). * do a better job at detecting if we're on SCO. ### ncurses-1.9.5 -> 1.9.6 * handling of TERMCAP environment variables now works correctly. * various changes to shorten termcap translations to less that 1024 chars. * tset(1) added * mouse support for xterm. * most data tables are now const and accordingly live in shareable text space. * Obey the XPG4/SVr4 practice that echo() is initally off. * tic is much better at translating XENIX and AIX termcap entries now. * tic can interpret ko capabilities now. * integrated Juergen Pfeifer's forms library. * taught write_entry() how not to write more than it needs to; this change reduces the size of the terminfo tree by a full 26%! * infocmp -T option added. * better warnings about historical tic quirks from tic. ### ncurses 1.9.4 -> 1.9.5 * menus library is now included with documentation. * lib_mvcur has been carefully profiled and tuned. * Fixed a ^Z-handling bug that was tanking lynx(1). * HJ Lu's patches for ELF shared libraries under Linux * terminfo.src 9.8.2 * tweaks for compiling in seperate directories. * Thomas Dickey's patches to support NeXT's brain-dead linker * Eric Raymond's patches to fix problems with long termcap entries. * more support for shared libraries under SunOS and IRIX. ### ncurses 1.9.3 -> 1.9.4 * fixed an undefined-order-of-evaluation bug in lib_acs.c * systematically gave non-API public functions and data an _nc_ prefix. * integrated Juergen Pfeifer's menu code into the distribution. * totally rewrote the knight test game's interface ### ncurses 1.9.2c -> 1.9.3 * fixed the TERMCAP_FILE Support. * fixed off-by-one errors in scrolling code * added tracemunch to the test tools * took steps to cut the running time of make install.data ### ncurses 1.9.2c -> 1.9.2d * revised 'configure' script to produce libraries for normal, debug, profile and shared object models. ### ncurses 1.9.1 -> 1.9.2 * use 'autoconf' to implement 'configure' script. * panels support added * tic now checks for excessively long termcap entries when doing translation * first cut at eliminating namespace pollution. ### ncurses 1.8.9 -> 1.9 * cleanup gcc warnings for the following: use size_t where 'int' is not appropriate, fixed some shadowed variables, change attr_t to compatible with chtype, use attr_t in some places where it was confused with 'int'. * use chtype/attr_t casts as appropriate to ensure portability of masking operations. * added-back waddchnstr() to lib_addstr.c (it had been deleted). * supplied missing prototypes in curses.h * include <termcap.h> in lib_termcap.c to ensure that the prototypes are consistent (they weren't). * corrected prototype of tputs in <termcap.h> * rewrote varargs parsing in lib_tparm.c (to avoid referencing memory that may be out of bounds on the stack) -- Purify found this. * ensure that TRACE is defined in lib_trace.c (to solve prototype warnings from gcc). * corrected scrolling-region size in 'mvcur_wrap()' * more spelling fixes * use 'calloc()' to allocate WINDOW struct in lib_newwin.c (Purify). * set default value for SP->_ofp in lib_set_term.c (otherwise SunOS dumps core in init_acs()). * include <errno.h> in write_entry.c (most "braindead" includes declare errno in that file). ### ncurses 1.8.8 -> 1.8.9 * compile (mostly) clean with gcc 2.5.8 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wconversion and using __attribute__ to flush out non-portable use of "%x" for pointers, or for chtype data (which is declared as a long). * modified doupdate to ensure that typahead was turned on before attempting select-call (otherwise, some implementations hang). * added trace mask TRACE_FIFO, use this in lib_getch.c to allow finer resolution of traces. * improved bounds checking on several critical functions. * the data directory has been replaced by the new master terminfo file. * -F file-comparison option added to infocmp. * compatibility with XSI Curses is now documented in the man bages. * wsyncup/wsyncdown functions are reliable now; subwindow code in general is much less flaky. * capabilities ~msgr, tilde_glitch, insert_padding, generic_type, no_pad_char, memory_above, memory_below, and hard_copy are now used properly. * cursor-movement optimization has been completely rewritten. * vertical-movement optimization now uses hardware scrolling, il, dl. ### ncurses 1.8.7 -> 1.8.8 * untic no longer exists, infocmp replaces it. * tic can understand termcap now, especially if it is called captoinfo. * The Linux Standard Console terminfo entry is called linux insead of console. It also uses the kernel's new method of changing charsets. * initscr() will EXIT upon error (as the docs say) This wil mostly happen if you try to run on an undefined terminal. * I can get things running on AIX but tic can't compile terminfo. I have to compile entries on another machine. Volunteers to hunt this bug are welcome. * wbkgd() and wbkgdset() can be used to set a windows background to color. wclear()/werase() DO NOT use the current attribute to clear the screen. This is the way SVR4 curses works. PDCurses 2.1 is broken in this respect, though PDCurses 2.2 has been fixed. * cleaned up the test/ directory. * test/worm will segfault after quite a while. * many spelling corrections courtesy of Thomas E. Dickey ### ncurses 1.8.6 -> 1.8.7 * cleaned up programs in test/ directory. * fixed wbkgdset() macro. * modified getstr() to stop it from advancing cursor in noecho mode. * modified linux terminfo entry to work with the latest kernel to get the correct alternate character set. * also added a linux-mono entry for those running on monochrome screens. * changed initscr() so that it behaves like the man page says it does. this fixes the problem with programs in test/ crashing with SIGSEV if a terminal is undefined. * modified addch() to avoid using any term.h #define's * removed duplicate tgoto() in lib_tparm.c * modified dump_entry.c so that infocmp deals correctly with ',' in acsc * modified delwin() to correctly handle deleting subwindows. * fixed Makefile.dist to stop installing an empty curses.h * fixed a couple of out-of-date notes in man pages. ### ncurses 1.8.5 -> 1.8.6 * Implemented wbkgd(), bkgd(), bkgdset(), and wbkgdset(). * The handling of attributes has been improved and now does not turn off color if other attributes are turned off. * scrolling code is improved. Scrolling in subwindows is still broken. * Fixes to several bugs that manifest them on platforms other than Linux. * The default to meta now depends on the status of the terminal when ncurses is started. * The interface to the tracing facility has changed. Instead of the pair of functions traceon() and traceoff(), there is just one function trace() which takes a trace mask argument. The trace masks, defined in curses.h, are as follows: #define TRACE_DISABLE 0x00 /* turn off tracing */ #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ #define TRACE_MAXIMUM 0x0f /* maximum trace level */ More trace masks may be added, or these may be changed, in future releases. * The pad code has been improved and the pad test code in test/ncurses.c has been improved. * The prototype ansi entry has been changed to work with a wider variety of emulators. * Fix to the prototype ansi entry that enables it to work with PC emulators that treat trailing ";m" in a highlight sequence as ";0m"; this doesn't break operation with any emulators. * There are now working infocmp, captoinfo, tput, and tclear utilities. * tic can now compile entries in termcap syntax. * Core-dump bug in pnoutrefresh fixed. * We now recognize and compile all the nonstandard capabilities in Ross Ridge's mytinfo package (rendering it obsolete). * General cleanup and documentation improvements. * Fixes and additions to the installation-documentation files. * Take cursor to normal mode on endwin. ### ncurses 1.8.4 -> 1.8.5 * serious bugs in updating screen which caused erratic non-display, fixed. * fixed initialization for getch() related variable which cause unpredictable results. * fixed another doupdate bug which only appeared if you have parm_char. * implemented redrawln() and redrawwin(). * implemented winsnstr() and related functions. * cleaned up insertln() and deleteln() and implemented (w)insdeln(). * changed Makefile.dist so that installation of man pages will take note of the terminfo directory. * fixed Configure (removed the mysterious 'X'). * Eric S. Raymond fixed the script.* files so that they work with stock awk. #### ncurses 1.8.3 -> 1.8.4 #### #### * fixed bug in refreshing the screen after return from shell_mode. There are still problems but they don't manifest themselves on my machine (Linux 0.99.14f). * added wgetnstr() and modified things accordingly. * fixed the script.src script.test to work with awk not just gawk. * Configure can now take an argument of the target system. * added test/ncurses.c which replaces several other programs and performs more testing. [Thanks to Eric S Raymond for the last 4] * more fixes to lib_overlay.c and added test/over.c to illustrate how it works. * fixed ungetch() to take int instead of ch. * fixes to cure wgetch() if flushinp() is called. One note I forgot to mention in 1.8.3 is that tracing is off by default starting in the version. If you want tracing output, put traceon(); in your code and link with -ldcurses. #### ncurses 1.8.2 -> ncurses 1.8.3 #### #### MAJOR CHANGES: 1) The order of capabilities has been changed in order to achieve binary compatibility with SVR4 terminfo database. This has the unfortunate effect of breaking application currently linked with ncurses. To ensure correct behavior, recompile all such programs. Most programs using color or newer capabilities will break, others will probably continue to work ok. 2) Pavel Curtis has renounced his copyright to the public domain. This means that his original sources (posted to comp.sources.unix, volume 1) are now in the public domain. The current sources are NOT in the public domain, they are copyrighted by me. I'm entertaining ideas on what the new terms ncurses is released under. 3) Eric S. Raymond has supplied a complete set of man pages for ncurses in ?roff format. They will eventually replace most of the current docs. Both sets are included in this release. Other changes and notes from 1.8.2 include: * SIGSEGV during scrolling no longer occurs. * Other problems with scrolling and use of idl have been corrected. * lib_getch.c has been re-written and should perform flawlessly. please use test/getch.c and any other programs to test this. * ripoffline() is implemented (Thanks to Eric) and slk_ functions changed accordingly. * I've added support for terminals that scroll if you write in the bottom-right corner. * fixed more bugs in pads code. If anybody has a program that uses pads I'd love a copy. * correct handling for terminal with back_color_erase capability (such as Linux console, and most PC terminals) * ^Z handling apparently didn't work (I should never trust code sent me to me without extensive testing). It now seems to be fixed. Let me know if you have problems. * I've added support for Apollo and NeXT, but it may still be incomplete, especially when dealing with the lack of POSIX features. * scrolling should be more efficient on terminals with idl capabilities. Please see src/lib_scroll.c for more notes. * The line drawing routines were offset by 1 at both ends. This is now fixed. * added a few missing prototypes and macros (e.g. setterm()) * fixed code in src/lib_overlay.c which used to crash. * added a few more programs in test/ The ones from the PDCurses package are useful, especially if you have SVR4 proper. I'm interested in the results you get on such a systems (Eric? ;-). They already exposed certain bugs in ncurses. * See src/README for porting notes. * The C++ code should really replace ncurses.h instead of working around it. It should avoid name-space clashes with nterm.h (use rows instead of lines, etc.) * The C++ should compile ok. I've added explicit rules to the Makefile because no C++ defaults are documented on the suns. * The docs say that echo() and nocbreak() are mutually exclusive. At the moment ncurses will switch to cbreak() if the case above occurs. Should it continue to do so? How about echo() and noraw()? * PDCurses seem to assume that wclear() will use current attribute when clearing the screen. According to Eric this is not the case with SVR4. * I have discovered, to my chagrin, SunOS 4.x (and probably other systems) * doesn't have vsscanf and God knows what else! I've will do a vsscanf(). * I've also found out that the src/script.* rely on gawk and will not work with stock awk or even with nawk. Any changes are welcome. * Linux is more tolerant of NULL dereferences than most systems. This fact was exposed by hanoi. * ncurses still seems inefficient in drawing the screen on a serial link between Linux and suns. The padding may be the culprit. * There seems to be one lingering problem with doupdate() after shelling out. Despite the fact the it is sending out the correct information to the terminal, nothing takes effect until you press ^L or another refresh takes place. And yes, output does get flushed. #### ncurses 1.8.1 -> ncurses 1.8.2 #### Nov 28, 1993 #### * added support for SVR4 and BSDI's BSD/386. * major update and fix to scrolling routine. * MORE fixes to stuff in lib_getch.c. * cleaned-up configuration options and can now generate Config.* files through an awk script. * changed setupterm() so it can be called more than once, add added set_curterm(), del_curterm(). * a few minor cleanups. * added more prototypes in curses.h #### ncurses 1.8 -> ncurses 1.8.1 #### Nov 4, 1993 #### * added support for NeXTStep 3.0 * added termcap emulation (not well tested). * more complete C++ interface to ncurses. * fixed overlay(), overwrite(), and added copywin(). * a couple of bug fixes. * a few code cleanups. #### ncurses 0.7.2/0.7.3 -> ncurses 1.8 #### Aug 31, 1993 #### * The annoying message "can't open file." was due to missing terminfo entry for the used terminal. It has now been replaced by a hopefully more helpful message. * Problems with running on serial lines are now fixed. * Added configuration files for SunOS, Linux, HP/UX, Ultrix, 386bsd/BSDI (if you have others send'em to me) * Cleaner Makefile. * The documentation in manual.doc is now more uptodate. * update optimization and support for hp terminals, and 386bsd console driver(s). * mvcur optimization for terminals without cursor addressing (doesn't work on Linux) * if cursor moved since last update, getch() will refresh the screen before working. * getch() & alarm() can now live together. in 0.7.3 a signal interrupted getch() (bug or feature?) now the getch is restarted. * scanw() et all were sick, now fixed. * support for 8-bit input (use meta()). * added default screen size to all terminfos. * added c++ Ncursesw class. * several minor bug fixes. #### ncurses 0.7.2 -> ncurses 0.7.3 #### May 27, 1993 #### * Config file to cope with different platforms (386BSD, BSDI, Ultrix, SunOS) * more fixes to lib_getch.c * changes related to Config #### ncurses 0.7 -> ncurses 0.7.2 #### May 22, 1993 #### * docs updated slightly (color usage is now documented). * yet another fix for getch(), this one fixes problems with ESC being swallowed if another character is typed before the 1 second timeout. * Hopefully, addstr() and addch() are 8-bit clean. * fixed lib_tparm.c to use stdarg.h (should run on suns now) * order of capabilities changed to reflect that specified in SYSV this will allow for binary-compatibility with existing terminfo dbs. * added halfdelay() * fixed problems with asc_init() * added A_PROTECT and A_INVIS * cleaned up vidputs() * general cleanup of the code * more attention to portability to other systems * added terminfos for hp70092 (wont work until changes to lib_update.c are made) and 386BSD pcvt drivers. Thanks to Hellmuth Michaelis for his help. optimization code is slated for the next major release, stay tuned! #### ncurses 0.6/0.61 -> ncurses 0.7 #### April 1, 1993 Please note that the next release will be called 1.8. If you want to know about the rationale drop me a line. Included are several test programs in test/. I've split up the panels library, reversi, tetris, sokoban. They are now available separately from netcom.com:pub/zmbenhal/ * color and ACS support is now fully compatible with SYSV at the terminfo level. * Capabilities now includes as many SYSV caps I could find. * tigetflag,tigetnum,tigetstr functions added. * boolnames, boolfnames, boolcodes numnames, numfnames, numcodes, strnames, strfnames, strcodes arrays are now added. * keyname() is added. * All function keys can be defined in terminfo entries. * fixed lin_tparm.c to behave properly. * terminfo entries for vt* and xterm are included (improvements are welcome) * more automation in handling caps and keys. * included fixes from 0.6.1 * added a few more missing functions. * fixed a couple of minor bugs. * updated docs JUST a little (still miles behind in documenting the newer features). #### ncurses 0.6 -> ncurses 0.61 #### 1) Included the missing data/console. 2) allow attributes when drawing boxes. 3) corrected usage of win->_delay value. 4) fixed a bug in lib_getch.c. if it didn't recognize a sequence it would simply return the last character in the sequence. The correct behavior is to return the entire sequence one character at a time. #### ncurses0.5 -> ncurses0.6 #### March 1, 1993 #### * removed _numchngd from struct _win_st and made appropriate changes. * rewritten kgetch() to remove problems with interaction between alarm and read(). It caused SIGSEGV every now and then. * fixed a bug that miscounted the numbers of columns when updating. (in lib_doupdate.c(ClrUpdate() -- iterate to columns not columns-1) * fixed a bug that cause the lower-right corner to be incorrect. (in lib_doupdate.c(putChar() -- check against columns not columns-1) * made resize() and cleanup() static to lib_newterm.c * added notimeout(). * added timeout() define in curses.h * added more function prototypes and fixed napms. * added use_env(). * moved screen size detection to lib_setup.c. * fixed newterm() to confirm to prototype. * removed SIGWINCH support as SYSV does not define its semantics. * cleaned-up lib_touch.c * added waddnstr() and relatives. * added slk_* support. * fixed a bug in wdeleteln(). * added PANEL library. * modified Makefile for smoother installation. * terminfo.h is really term.h #### ncurses 0.4 -> ncurses 0.5 #### Feb 14, 1993 #### * changed _win_st structure to allow support for missing functionality. * Addition of terminfo support for all KEY_*. * Support for nodelay(), timeout(), notimeout(). * fixed a bug with the keypad char reading that did not return ESC until another key is pressed. * nl mapping no longer occur on output (as should be) fixed bug '\n' no causing a LF. * fixed bug that reset terminal colors regardless of whether we use color or not. * Better support for ACS (not quite complete). * fixed bug in wvline(). * added curs_set(). * changed from signal() to sigaction(). * re-included the contents of important.patch into source. #### ncurses 0.3 -> ncurses 0.4 #### Feb 3, 1993 #### * Addition of more KEY_* definitions. * Addition of function prototypes. * Addition of several missing functions. * No more crashes if screen size is undefined (use SIGWINCH handler). * added a handler to cleanup after SIGSEGV (hopefully never needed). * changed SRCDIR from /etc/term to /usr/lib/terminfo. * renamed compile/dump to tic/untic. * New scrolling code. * fixed bug that reversed the sense of nl() and nonl(). #### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### * more support for color and graphics see test/ for examples. * fixed various files to allow correct update after shelling out. * more fixes for updates. * no more core dumps if you don't have a terminfo entry. * support for LINES and COLUMNS environment variables. * support for SIGWINCH signal. * added a handler for SIGINT for clean exits. #### ncurses 0.1 -> ncurses 0.2 #### Aug 14, 1992 #### * support for color. * support for PC graphic characters. * lib_trace.c updated to use stdarg.h and vprintf routines. * added gdc.c (Great Digital Clock) as an example of using color. #### ncurses -> ncurses 0.1 #### Jul 31, 1992 #### * replacing sgtty stuff by termios stuff. * ANSIfication of some functions. * Disabling cost analysis 'cause it's incorrect. * A quick hack for a terminfo entry. -- vile:txtmode:
http://opensource.apple.com/source/ncurses/ncurses-27/ncurses/NEWS
CC-MAIN-2014-52
en
refinedweb
// $Id: readme.dox 30 2007-08-20 11:15:18Z tb $ /** \file readme.dox Contains main doxygen example explanation page. */ /** \mainpage \section sec_summary Summary This %example shows how to use both Flex and Bison in C++ mode. This way both lexer and parser code and data is encapsulated into classes. Thus the lexer and parser are fully re-entrant, because all state variables are contained in the class objects. Furthermore multiple different lexer-parser pairs can easily be linked into one binary, because they have different class names and/or are located in a different namespace. \section sec_website_license Website / License \section sec_whyuse Why Use These Old Tools? Well, they are here to stay and they work well. These days there are much more sophisticated C++ parser generation frameworks around: \li Most well-known is the Boost.Spirit parser framework \li and the ANTLR parser generator. \li Less well known is the Common Text Transformation Library.. \section sec_source_files Source and Generated Files The src directory contains the following source files. Note that some of them are automatically generated from others. \li scanner.ll contains the Flex source for the C++ lexical scanner. \li scanner.cc is generated from scanner.ll by Flex. \li scanner.h defines the lexer class example::Scanner. \li FlexLexer.h copied from Flex distribution. Defines the abstract lexer class. \li parser.yy is the %example Bison parser grammar. \li parser.cc generated from parser.yy by Bison. \li parser.h generated from parser.yy by Bison. \li y.tab.h contains nothing. Just forwards to parser.h \li location.hh installed by Bison. Contains something required by the parser class. \li position.hh same. \li stack.hh same. \li driver.h defines the example::Driver class, which puts together lexer and parser. \li driver.cc implementation for driver.h \li expression.h defines the example's calculator node classes. \li exprtest.cc contains a main function to run the %example calculator. \li readme.dox doxygen explanation text, which you are reading right now. So if you wish to create a program using a C++ Flex lexer and Bison parser, you need to copy the following files: \li scanner.ll, scanner.h, FlexLexer.h \li parser.yy, y.tab.h \li location.hh, position.hh, stack.hh (are created by Bison when run on the grammar) \li driver.h, driver.cc \subsection subsec_namespacelibrary Namespace and Library. \section sec_overview Code Overview This is a brief overview of the code's structure. Further detailed information is contained in the doxygen documentation, comments in the source and ultimately in the code itself. \subsection subsec_overview_scanner Scanner \c int to the enum example::Parser::token defined by parser. \subsection subsec_overview_parser. \subsection subsec_overview_driver Driver(). \section sec_example Example Calculator. \verbatim v = (2 ^ 4 - 4); e = 2.71828 4 * 1.5 + 3 * v 6 * (2 * 2) ^ 2 / 2 \endverbatim The above %example file (included as exprtest.txt) can be processed by calling ./exprtest exprtest.txt. The program outputs the following evaluation: \verbatim Setting variable v = 12 Setting variable e = 2.71828 Expressions: [0]: tree: + add * multiply 4 1.5 * multiply 3 12 evaluated: 42 [1]: tree: / divide * multiply 6 ^ power * multiply 2 2 2 2 evaluated: 48 \endverbatim \author Timo Bingmann \date 2007-08-20 */ /* nothing here */
http://panthema.net/2007/flex-bison-cpp-example/flex-bison-cpp-example-0.1/src/readme.dox
CC-MAIN-2014-52
en
refinedweb
Ben Collins-Sussman wrote: > > On Jan 12, 2005, at 4:50 PM, Ben Collins-Sussman wrote: > >> >> I'm not sure what to do but throw up my hands and write it off as a >> nasty wart. >> > > Talked to gstein on IM, and here's a better solution: > > * have the svn client add an extra subversion namespace or attribute > to the <D:owner> attribute when sending the data. > > *? > That way, only generic DAV clients create these so-called "ugly" locks. > That's much more livable. It means these things would only show up > when sites have activated Autoversioning, and that already implies other > "ugly" things, such as auto-generated log messages. Best regards, Julian -- <green/>bytes GmbH -- -- tel:+492512807760 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.org This is an archived mail posted to the Subversion Dev mailing list.
http://svn.haxx.se/dev/archive-2005-01/0451.shtml
CC-MAIN-2014-52
en
refinedweb
Wrapper class Subrata Saha Greenhorn Joined: Jun 10, 2005 Posts: 19 posted Mar 16, 2006 03:58:00 0 Well i do understand what is wrapper ?? i.e just OO view . int(primitive) --> Integer (wrapper) But i heard some body saying that build a wraaper class then do ..... So what exactly this wrapper class?? satishkumar janakiraman Ranch Hand Joined: May 03, 2004 Posts: 334 posted Mar 16, 2006 04:18:00 0 Hi , Wrapper classes allow primitives to be accessed as objects. For eg, int, char these are primitives and they simple types. I hope, this will help you. bye for now sat Charles Lyons Author Ranch Hand Joined: Mar 27, 2003 Posts: 836 posted Mar 16, 2006 04:38:00 0 If I understand your question correctly, you are asking what the definition of a wrapper class is? Essentially, a wrapper class encapsulates (or "wraps") some form of related data. The most general wrapper implements an interface (or sometimes extends a class), and then encapsulates another instance of that class, in order to perhaps moderate or intercept calls to the object. The best way for me to explain this is to give you a concrete example - this is taken from J2EE Web, but you don't need to know any J2EE to understand it. In J2EE Web, we have a HttpServletResponse object which (in brief) is used to write data back, via a stream, to the client from the Web server. But sometimes we don't want to write data back directly, sometimes it's appropriate to intercept that data and then decide later whether we want to send it to the client or not. In this case we use a HttpServletResponseWrapper : public class HttpServletResponseWrapper implements HttpServletResponse { private HttpServletResponse wrapped; public HttpServletResponseWrapper(HttpServletResponse wrap) { this.wrapped = wrap; } ... // Implement all other methods of HttpServletResponse interface. // These all delegate to the enclosed 'wrapped' object. For example: public PrintWriter getWriter() throws IOException { return wrapped.getWriter(); } ... } Notice that the wrapper is a HttpServletResponse . All our HttpServletResponseWrapper actually does is delegate everything to the enclosed 'wrapped' object - so our wrapper 'looks' just like the enclosed object. Alone this is pretty useless; but if we want to prevent content being written back directly, we can override one or more methods - for example, overriding getWriter() allows us to use an intermediate buffer between the server and client... public class HttpServletResponseWrapper implements HttpServletResponse { private HttpServletResponse wrapped; public HttpServletResponseWrapper(HttpServletResponse wrap) { this.wrapped = wrap; } ... // Implement all other methods of HttpServletResponse interface. public PrintWriter getWriter() throws IOException { /* Use some new buffer; this method doesn't delegate to 'wrapped' */ return new PrintWriter(new ByteArrayOutputStream()); } ... } We've now got an object which looks almost like the enclosed 'wrapped' instance, but makes a few minor changes and overrides a few methods - but in essence, it shares all the same properties (one might be tempted to say it is almost the same object ), and that's what a wrapper is all about - having the same object/properites at heart, but make some exterior modifications. The primitive wrappers in java.lang are also doing just this, except they enclose/wrap a primitive and not an object. They then go on to add extra useful definitions to methods like toString() and equals(), and add the various xxxValue() methods (I've ignored the static methods, which don't technically form part of a wrapper class); these all add extra detail to the primitives, or modify the way in which the wrapped primitive behaves. This is the correct way to think about wrappers - this is a well-known design strategy known as the Wrapper or Decorator pattern . Try a search for "Wrapper pattern". The "Adapter pattern" is similar - in this case, we have a class (ClassA) which provides all the required functionality for some particular purpose, but doesn't implement the correct interface (InterfaceB) to actually be used or passed to any methods as arguments. In this case, all we do is: public class InterfaceBWrapper implements InterfaceB { private ClassA wrapped; public InterfaceBWrapper(ClassA wrap) { this.wrapped = wrap; } // implement all the methods of InterfaceB, delegating to wrapped // where appropriate } instantiating a new wrapper for each instance of ClassA, and passing that wrapper to the methods which take InterfaceB as an argument... Let me know if that has helped. Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004) Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / Amazon Amazon UK ) Stan James (instanceof Sidekick) Ranch Hand Joined: Jan 29, 2003 Posts: 8791 posted Mar 16, 2006 10:47:00 0 Wrapper is a pretty generic term ... for specifics look up Decorator, Adapter and Bridge patterns for a start. Structurally they look a lot alike but the intent and purpose is different in each. If you read up on those and still have questions, scroll on down to the UML, OO etc. forum and ask away. A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi I agree. Here's the link: subject: Wrapper class Similar Threads wrapper classes user defined wrapper class @Wrapper class Implementing the Data Interface @Wrapper class All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter JForum | Paul Wheaton
http://www.coderanch.com/t/379421/java/java/Wrapper-class
CC-MAIN-2014-52
en
refinedweb
09 November 2006 18:01 [Source: ICIS news] ?xml:namespace> ?xml:namespace> This was been followed by a 40,000 tonnes/year closure of PS capacity by Total in Gonfreville and the largest closure, that of Nova Innovene’s 180,000 tonnes/year plant in the UK, finally shut down at the end of last month. The latest announcement of a closure was from BASF who said that their 70,000 tonnes/year high impact (HIPS) line in Some observers had estimated the oversupply in the European PS market at something approaching 600,000 tonnes/year. “While these closures do not bring the market back into balance, they go a long way to help, and instead of running at 75-80% of capacity, the industry can now produce at 90%,” a major PS producer commented on Thursday. Margins in the PS market have been very poor, and PS producers have taken extreme measures to stop the rot. PS prices remained flat in November, however, with even some downward pressure after slight erosion in November styrene. Net spot PS prices were reported at €1,250/tonne free delivered (FD) Northwest Europe (N
http://www.icis.com/Articles/2006/11/09/1104873/europe-ps-output-cut-by-350000-tyr-since-2005.html
CC-MAIN-2014-52
en
refinedweb
Visual Basic 2005: A Developer's Notebook/Visual Studio From WikiContent The new features of Visual Basic 2005 are actually provided by three separate components: the enhanced Visual Studio 2005 IDE, a new version of the VB compiler (vbc.exe), and the revamped .NET 2.0 Framework. In this chapter, you'll start by taking Visual Studio 2005 for a spin. Note At first glance, Visual Studio hasn't changed too radically in its latest incarnation. However, it's worth taking a moment to orient yourself to Microsoft's newest IDE. Tip Visual Studio 2005 is the direct successor to Visual Studio .NET, and it provides the most complete set of tools and features. Visual Basic 2005 Express Edition allows you to build Windows applications, console applications, and DLL components (but not web applications). Visual Web Developer 2005 Express Edition allows you to build only web applications. However, all three of these programs are really variations of the same tool—Visual Studio. As a result, the menus, toolbars, and behavior of these applications are essentially the same. How do I do that? To get started and create a new project, select File → New Project from the Visual Studio menu. You'll see a slightly revamped New Project dialog box, as shown in Figure 1-1. Depending on the version of Visual Studio you're using, you may see a different set of available project types. To continue, select the Windows Application project type and click OK to create the new project. In the Solution Explorer, you'll see that the project contains a single form, an application configuration file, and a My Project node (which you can select to configure project and build settings). However, the list of assembly references won't appear in the Solution Explorer, unless you explicitly choose Project → Show All Files. Figure 1-2 shows both versions of the Solution Explorer. To save your project, choose File → Save [ProjectName] from the menu. One change you're likely to notice is that Visual Studio no longer asks you to specify a directory path when you create a new project. That's because Visual Studio, in a bid to act more like Visual Basic 6, doesn't save any files until you ask it to. Tip This behavior actually depends on the Visual Studio environment settings. When you first install Visual Studio, you have the chance to choose your developer profile. If you choose Visual Basic Development Settings, you won't be asked to save your project when you first create it. Of course, as a savvy programmer you know that files need to reside somewhere, and if you dig around you'll find a temporary directory like C:\Documents and Settings\[UserName]\Local Settings\Application Data\Temporary Projects\[ProjectName] that's used automatically to store new, unsaved projects. Once you save a project, it's moved to the location you choose. Note The process of creating web applications has also changed subtly in Visual Studio 2005, and you no longer need IIS and a virtual directory to test your web site. You'll learn more about web projects in Chapter 4. You can use the simple Windows application you created to try out the other labs in this chapter and tour Visual Studio's new features. What about... ...the real deal of differences between different Visual Studio flavors? You can get the final word about what each version does and does not support from Microsoft's Visual Studio 2005 developer center, at. This site provides downloads of the latest Visual Studio betas and white papers that explain the differences between the express editions and the full-featured Visual Studio 2005. Code, Debug, and Continue Without Restarting Your Application Visual Basic 6 developers are accustomed to making changes on the fly, tweaking statements, refining logic, and even inserting entirely new blocks of code while they work. But the introduction of a new compile-time architecture with the .NET 1.0 common language runtime (CLR) caused this feature to disappear from Visual Studio .NET 2002 and 2003. Fortunately, it's returned in Visual Basic 2005, with a few enhancements and one major caveat—it won't work with ASP.NET. Note The single most requested feature from VB 6 returns to . NET: a debugger that lets you edit code without restarting your application. How do I do that? To see edit-and-debugging at its simplest, it's worth looking at an example where a problem sidelines your code—and how you can quickly recover. Figure 1-3 shows a financial calculator application that can calculate how long it will take you to become a millionaire, using Visual Basic's handy Pmt( ) function. To create this program, first add four text boxes (the labels are optional), and then name them txtInterestRate, txtYears, txtFutureValue, and txtMonthlyPayment (from top to bottom). Then, add a button with the following event handler: Private Sub btnCalculate_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnCalculate.Click Dim InterestRate, Years, FinalValue, MonthlyPayment As Double InterestRate = Val(txtInterestRate.Text) FinalValue = Val(txtFutureValue.Text) MonthlyPayment = Pmt(InterestRate / 12 / 100, _ Years * 12, 0, -FinalValue, DueDate.BegOfPeriod) txtMonthlyInvestment.Text = MonthlyPayment.ToString("C") End Sub Now run the application, enter some sample values, and click the button. You'll receive a runtime exception (with the cryptically worded explanation "Argument NPer is not a valid value") when your code tries to calculate the MonthlyPayment value. One way to discover the source of the problem is to move the mouse over all the parameters in the statement and verify that they reflect what you expect. In this case, the problem is that the Years variable is never set, and so contains the value 0. Thanks to edit-and-continue debugging, you can correct this problem without restarting your application. When the error occurs, click the "Enable editing" link in the error window. Then, add the missing line: Private Sub btnCalculate_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnCalculate.Click Years = Val(txtYears.Text) ... End Sub Now, look for the yellow arrow in the margin that indicates where the debugger is in your code. Click and drag this yellow arrow up to the newly added line so that it will be executed next. When you press F5 or click the Start button, the code resumes from this point and the calculation completes without a hitch. Note You don't need to wait for an error to occur to use edit-and-continue debugging. You can also set a breakpoint in your code or select Debug → Break from the menu at any time. What about... ...changes that the edit-and-continue debugger doesn't support? For the most part, edit-and-continue debugging in Visual Basic 2005 supports a greater variety of edits than supported in Visual Basic 6. However, there are still some types of edits that require you to restart your application. One example is if you delete the method in which your code is currently executing. For the full list, refer to the MSDN help, under the index entry "Edit and Continue → unsupported declaration edits" (which describes disallowed changes to declarations, like properties, methods, and classes) and "Edit and Continue → unsupported property and method body edits" (which describes disallowed changes inside your actual code routines). To alert you when you make an unsupported edit, Visual Studio underlines the declaration of the current class with a green squiggly line. If you hover over that line, a ToolTip appears that explains the offending change. Figure 1-4 shows an example. At this point, you can either undo this change, or continue (knowing that you'll need to restart the program). If you attempt to continue execution (by pressing F5 or F8), Visual Studio asks whether you want to stop debugging or want to cancel the request and continue editing your code. A more significant limitation of the new edit-and-continue feature is that it doesn't support ASP.NET web applications. However, Visual Basic (and C#) developers still receive some improvement in their web-application debugging experience. Visual Studio 2005 compiles each web page separately, rather than into a single assembly (as was the model in previous versions). As a result, when you find some misbehaving code in a web page, you can pause the debugger, edit the code, and refresh the web page by clicking Refresh in your browser. This behavior gives you an experience that's similar to edit-and-continue, but it only works on a per-page basis. Unfortunately, this feature won't help you if you're in the middle of debugging a complex routine inside a web page. In that case, you'll still need to re-request the web page after you make the change and start over. Look Inside an Object While Debugging Visual Studio has always made it possible for you to peer into variables while debugging your code, just by hovering over them with the mouse pointer. But there were always limitations. If the variable was an instance of an object, all you could see was the value returned by the ToString( ) method, which more often than not was simply the fully qualified name of the class itself. Moreover, you couldn't see the content of public properties and indexers. The Watch and Locals windows provided some improvement, but they weren't quite as convenient or intuitive. Visual Studio 2005 changes the picture with a new feature called debugger DataTips. Note In Visual Studio 2005, it's even easier to take a look at the content of complex objects while debugging. How do I do that? To use debugger DataTips, it helps to have a custom class to work with. The code in Example 1-1 shows the declaration for two very simple classes that represent employees and departments, respectively. Example 1-1. Two simple classes Public Class Employee Private _ID As String Public ReadOnly Property ID( ) As String Get Return _ID End Get End Property Private _Name As String Public ReadOnly Property Name( ) As String Get Return _Name End Get End Property Public Sub New(ByVal id As String, ByVal name As String) _ID = id _Name = name End Sub End Class Public Class Department Private _Manager As Employee Public ReadOnly Property Manager( ) As Employee Get Return _Manager End Get End Property Private _DepartmentName As String Public ReadOnly Property Name( ) As String Get Return _DepartmentName End Get End Property Public Sub New(ByVal departmentName As String, ByVal manager As Employee) _DepartmentName = departmentName _Manager = manager End Sub End Class Now you can add some code that uses these objects. Add the following event handler to any form to create a new Employee and Department object when the form first loads. Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load Dim Manager As New Employee("ALFKI", "John Smith") Dim Sales As New Department("Sales", Manager) End Sub Now place a breakpoint on the final End Sub, and run the application. When execution stops on the final line, hover over the Sales variable. An expanded ToolTip will appear that lists every private and public member of the object. Even better, if one object references another, you can drill into the details of both objects. To try this out, click the plus sign (+) sign next to the Manager property to see the linked Employee object. Figure 1-5 shows the DataTip you'll see. Using debugger DataTips, you can also edit simple data types on the fly. Just double click the property or variable, and edit the value. In Figure 1-5, the private variable _Name is currently being edited. What about... ...working with exotic types of data? Using the .NET Framework, it's possible to create design-time classes that produce customized visualizations for specific types of data. While this topic is outside the scope of this book, you can see it at work with the three built-in visualizers for text, HTML, and XML data. For example, imagine you have a string variable that holds the content of an XML document. You can't easily see the whole document in the single-line ToolTip display. However, if you click the magnifying glass next to the content in the ToolTip, you'll see a list of all the visualizers you can use. Select XML Visualizer, and a new dialog box will appear with a formatted, color-coded, scrollable, resizable display of the full document content, as shown in Figure 1-6. Where can I learn more? For more information about debugger visualizers, look for the "Visualizers" index entry in the MSDN help. Diagnose and Correct Errorson the Fly Visual Studio does a great job of catching exceptions, but it's not always as helpful at resolving them. The new Exception Assistant that's hardwired into Visual Studio 2005 gives you a head start. Note Stumbled into a head-scratching exception? Visual Studio 2005 gives you a head start for resolving common issues with its Exception Assistant. How do I do that? You don't need to take any steps to activate the Exception Assistant. Instead, it springs into action as soon as your program encounters an unhandled exception. To see it in action, you need to create some faulty code. A good test is to add the following event handler to any form, which tries to open a non-existent file: Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load Dim XMLText As String = My.Computer.FileSystem.ReadAllText( _ "c:\FileDoesNotExist") End Sub Now run the application. When the error occurs, Visual Studio switches into break mode and highlights the offending statement. The Exception Assistant then appears, with a list of possible causes for the problem. Each suggestion appears as a separate link in the pop-up window. If you click one of these links, the full MSDN help topic will appear. Figure 1-7 shows the result with the faulty file-reading code; the Exception Assistant correctly identifies the reason that the attempt to open the file failed. Note This example uses a new VB language feature—the My object. You'll learn much more about My objects in the next chapter. If you want to see the low-level exception information, click the View Detail link at the bottom of the window. This pops up a dialog box with a PropertyGrid showing all the information of the associated exception object. This change alone is a great step forward from Visual Studio .NET 2003, where you needed to write a Catch exception handler and set a breakpoint to take a look at the underlying exception object. What about... ...solving complex problems? The Exception Assistant isn't designed to help you sort through issues of any complexity. Instead, it works best at identifying the all-too-common "gotchas," such as trying to use a null reference (usually a result of forgetting to use the New keyword) and failing to convert a data type (often a result of an inadvertent type cast). Where can I learn more? For help in the real world, consult a colleague or one of the many .NET discussion groups. Some good choices include (for the latest on Visual Basic 2005) and—once Visual Basic 2005 enters its release phase— (for Windows Forms questions), (for ASP.NET issues), and (for more advanced .NET queries). Rename All Instances of Any Program Element Symbolic rename allows you to rename all instances of any element you declare in your program, from classes and interfaces to properties and methods, in a single step. This technique, which is decidedly not a simple text search-and-replace feature by virtue of its awareness of program syntax, solves many knotty problems found in previous releases of Visual Basic. For example, imagine you want to rename a public property named FirstName. If you use search-and-replace, you'll also inadvertently affect a text box named txtFirstName, an event handler named cmdFirstName_Click, a database field accessed through row("FirstName"), and even your code comments. With symbolic rename, the IDE takes care of renaming just what you want, and it completes all of its work in a single step. Note Need to rename a method, property, or variable without mangling other similar names in the same file? Visual Studio 2005 includes the perfect antidote to clumsy search-and-replace. How do I do that? You can use symbolic rename from any code window. To understand how it works, create a form that has a single text box named TextBox1 and a button named cmdText. Finally, add the form code in Example 1-2. Example 1-2. A simple form that uses the word "Text" heavily Public Class TextTest Private Sub TextTest_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ' Get the text from the text box. Dim Text As String = TextBox1.Text ' Convert and display the text. Text = ConvertText(Text) MessageBox.Show("Uppercase Text is: " & Text) End Sub Public Function ConvertText(ByVal Text As String) As String Return Text.ToUpper( ) End Function End Class This code performs a relatively mundane task: converting a user-supplied string to uppercase and displays it in a message box. What's notable is how many places it uses the word "Text." Now, consider what happens if you need to rename the local variable Text in the event handler for the Form.Load event. Clearly, this is enough to confuse any search-and-replace algorithm. That's where symbolic rename comes in. To use symbolic rename, simply right-click on the local Text variable, and select Rename from the context menu. In the Rename dialog box, enter the new variable name LocalText and click OK. All the appropriate instances in your code will be changed automatically without affecting other elements in your code (such as the text box, the comments, the literal text string, the form class name, the Text parameter in the ConvertText function, and so on). Here's the resulting code: Public Class TextTest Private Sub cmdTest_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles cmdText.Click ' Get the text from the text box. Dim LocalText As String = TextBox1.Text ' Convert and display the text. LocalText = ConvertText(LocalText) MessageBox.Show("Uppercase Text is: " & LocalText) End Sub Public Function ConvertText(ByVal Text As String) As String Return Text.ToUpper( ) End Function End Class Symbolic rename works with any property, class, or method name you want to change. Here are a few important points to keep in mind about how symbolic rename works: - If you rename a class, all the statements that create an instance of that class are also changed. - If you rename a method, all the statements that call that method are also changed. - If you change a variable name that is the same as a method name, only the variable is changed (and vice versa). - If you change a local variable name that is the same as a local variable name with different scope (for example, in another method), only the first variable is affected. The symbolic rename feature isn't immediately impressive, but it's genuinely useful. Particularly noteworthy is the way it properly observes the scope of the item you want to rename. For example, when you rename a local variable, your changes don't spread beyond the current procedure. On the other hand, renaming a class can affect every file in your project. Note that if you change the name of a control variable, your code will also be updated accordingly. However, there's one exception—the names of event handlers are never modified automatically. For example, if you change Button1 to Button2, all the code that interacts with Button1 will be updated, but the event handler subroutine Button1_Click will not be affected. (Remember, the name of the event handler has no effect on how it works in your application, as long as it's connected with the Handles clause.) Tip In Visual Studio 2005, when you rename a .vb file in the Solution Explorer, the name of the class in the file is also renamed, as long as the file contains a class that has the old name. For example, if you rename Form1.vb to Form2.vb and the file contains a class named Form1, that class will be renamed to Form2. Any code statements that create an instance of Form1 will also be updated, no matter where they reside in the project. However, if you've already changed the class name to something else (like MyForm), the class name won't be affected when you rename the file. In Visual Studio 2002 and 2003, the same action of renaming a form file has no effect on your code, so it's worth noting. What about... ...support in Visual Basic 2005 for C# refactoring? Unfortunately, many of the additional refactoring features that Visual Studio provides to C# programmers don't appear in Visual Basic at all. Symbolic rename is one of the few new refactoring features that's alive and well for VB programmers in this release. Use IntelliSense Filteringand AutoCorrect IntelliSense is one of the great conveniences of Visual Studio, and it continues to improve in Visual Studio 2005, with two new features that make it more useful: IntelliSense filtering and AutoCorrect. IntelliSense filtering restricts the number of options you see to those that make sense in the current context. AutoCorrect goes one step further by recommending ways to resolve syntax errors, rather than simply reporting them. Note Visual Studio 2005 makes IntelliSense more intelligent by restricting class names that aren't relevant and suggesting corrections you can apply to resolve syntax errors. How do I do that? There's no need for any extra steps when you use IntelliSense filtering—it's at work automatically. As you enter code, IntelliSense prompts you with lists of classes, properties, events, and more. In Visual Studio 2005, this list is tailored to your immediate needs, based on various contextual details. For example, if you're selecting an attribute to apply to a method, the IntelliSense list will show only classes that derive from the base Attribute class. To see the new IntelliSense in action, start typing an exception-handling block. When you enter the Catch block, the IntelliSense list will show only classes that derive from the base Exception class (as shown in Figure 1-8). Select the Common or All tab at the bottom of the list, depending on whether you want to see the most commonly used classes or every possibility. AutoCorrect is an IntelliSense improvement that targets syntax errors. Every time Visual Studio discovers a problem, it underlines the offending code in blue. You can hover over the problem to see a ToolTip with error information. With AutoCorrect, Visual Studio also adds a red error icon that, when clicked, shows a window with the suggested correction. To see AutoCorrect in action, enter the following code (which attempts to assign a string to an integer without proper type-casting code): Dim X As Integer X = "2" Tip Option Strict catches data type conversion errors at compile time. To switch it on, double-click My Project in the Solution Explorer, click the Compile tab, and look for the Option Strict drop-down listbox. Assuming you have Option Strict switched on, you'll see a red error icon when you hover over this line. Click the red error icon. The AutoCorrect window that appears shows your code in blue, code to be added in red, and code to be removed crossed out with a solid line. Figure 1-9 shows the correction offered for this code snippet. Other problems that AutoCorrect can resolve include class names that aren't fully qualified, misspelled keywords, and missing lines in a block structure. In some cases, it will even show more than one possible correction. What about... ...doing more? There's still a lot of additional intelligence that IntelliSense could provide, but doesn't. For example, when assigning a property from a class to a string variable, why not show only those properties that return string data types? Or when applying an attribute to a method, why not show attribute classes that can be applied only to methods? As computer processors become faster and have more and more idle cycles, expect to see new levels of artificial intelligence appearing in your IDE. Edit Control Properties in Place The Properties window in Visual Studio makes control editing easy, but not always fast. For example, imagine you want to tweak all the text on a form. In previous versions of Visual Studio, the only option was to select each control in turn and modify the Text property in the Properties window one at a time. Although this approach isn't necessarily awkward, it certainly isn't as easy as it could be. In Visual Studio 2005, you can adjust a single property for a series of controls directly on the form. Note When you need to update a single property for a number of different controls, in-place property editing makes it easy. How do I do that? To try in-place property editing, create a new form and add an assortment of controls. (The actual controls you use don't really matter, but you should probably include some text boxes, buttons, and labels.) Then, select View → Property Editing View. Finally, choose the property you want to change from the drop-down list above the form design surface. By default, the Name property is selected, but Figure 1-10 shows an example with the Text property. In property-editing view, an edit box appears over every control on the form with the contents of the selected property. You can edit the value of that property by simply clicking on the edit box and entering the new value. You can also jump from one control to the next by pressing the Tab key. When you are finished with your work, again select View → Property Editing View, or click the Exit Mode link next to the property drop-down list. What about... ...editing tab order? Visual Studio allows you to easily edit tab order by clicking controls in the order that you want users to be able to navigate through them. Select a form with at least one control, and choose View → Tab Order to activate this mode, which works the same as it did in Visual Studio 2003. Call Methods at Design Time Although Visual Studio .NET 2003 included the Immediate window, you couldn't use it to execute code at design time. Longtime VB coders missed this feature, which was a casualty of the lack of a background compiler. In Visual Studio 2005, this feature returns along with the return of a background compiler. Note Need to try out a freshly written code routine? Visual Studio 2005 lets you run it without starting your project. How do I do that? You can use the Immediate window to evaluate simple expressions, and even to run subroutines in your code. To try out this technique, add the following shared method to a class: Public Shared Function AddNumbers(ByVal A As Integer, _ ByVal B As Integer) As Integer Return A + B End Sub By making this a shared method, you ensure that it's available even without creating an instance of the class. Now, you can call it easily in the design environment. By default, the Immediate window isn't shown at design time. To show it, select Debug → Windows → Command from the menu. Statements inside the Immediate window usually start with ? (a shorthand for Print, which instructs Visual Studio to display the result). You can enter the rest of the statement like any other line of code, with the benefit of IntelliSense. Figure 1-11 shows an example in which the Command window is used to run the shared method just shown. When you execute a statement like the one shown in Figure 1-11, there will be a short pause while the background compiler works (and you'll see the message "Build started" in the status bar). Then the result will appear. Note The expression evaluation in the beta release of Visual Studio 2005 is a little quirky. Some evaluations won't work, and will simply launch your application without returning a result. Look for this to improve in future builds. Where can I learn more? The MSDN help includes more information about supported expression types at the index entry "expressions → about expressions." Insert Boilerplate CodeUsing Snippets Some code is common and generic enough that programmers everywhere write it again and again each day. Even though developers have the help of online documentation, samples, and books like the one you're reading, useful code never seems to be at your fingertips when you need it. Visual Studio 2005 includes a new code snippet feature that allows you to insert commonly used code and quickly adapt it to suit your purposes. Early beta builds of Visual Studio 2005 included a tool for building your own snippets. Although this feature isn't in the latest releases, Microsoft has suggested that it might appear as a separate add-on tool at a later time. Note Looking for the solution to an all-too-common nuisance? Visual Studio code snippets might already have the answer. How do I do that? You can insert a code snippet anywhere in your code. Just move to the appropriate location, right-click the mouse on the current line, and select Insert Snippet. A pop-up menu will appear with a list of snippet categories, such as Math, Connectivity and Networking, and Working with XML. Once you select a category, a menu will appear with a list of snippets. Once you select a snippet, the code will be inserted. For example, suppose you want to add the ability to send and receive email messages to your application. Just create a new event handler or a standalone method, and right-click inside it. Then, choose Insert Snippet, and select Connectivity and Networking → Create an Email Message. Figure 1-12 shows the code that's inserted. The shaded portions of code are literal values (like file paths and control references) that you need to customize to adapt the code to your needs. By pressing the Tab key, you can move from one shaded region to the next. Additionally, if you hover over a shaded region, a ToolTip will appear with a description of what content you need to insert. What about... ...getting more snippets? The basic set of code snippets included with Visual Studio .NET is fairly modest. It includes some truly useful snippets (e.g., "Find a Node in XML Data") and some absurdly trivial ones (e.g., "Add a Comment to Your Code"). However, many useful topics, such as encryption, aren't dealt with at all. Where can I learn more? Thanks to the pluggable nature of snippets, you may soon be able to add more snippets to your collection from community web sites, coworkers, third-party software developers, and even sample code from a book like this. Create XML Documentation for Your Code Properly commenting and documenting code takes time. Unfortunately, there's no easy way to leverage the descriptive comments you place in your code when it comes time to produce more detailed API references and documentation. Instead, you typically must create these documents from scratch. Note Use XML comments to effortlessly create detailed code references,a feature C# programmers have had since . NET 1.0. Visual Studio 2005 changes all this by introducing a feature that's been taken for granted by C# programmers since .NET 1.0—XML comments. With XML comments, you comment your code using a predefined format. Then, you can use other tools to extract these comments and use them to build other documents. These documents can range from help documentation to specialized code reports (for example, a list of unresolved issues, legacy code, or code review dates). How do I do that? XML comments are distinguished from ordinary comments by their format. First of all, XML comments start with three apostrophes (rather than just one). Here's an example: ''' <summary>This is the summary.</summary> As you can see, XML comments also have another characteristic—they use tag names. The tag identifies the type of comment. These tags allow you to distinguish between summary information, information about a specific method, references to other documentation sections, and so on. The most commonly used XML comment tags include: - <summary> - Describes a class or another type. This is the highest-level information for your code. - <remarks> - Allows you to supplement the summary information. This tag is most commonly used to give a high-level description of each type member (e.g., individual methods and properties). - <param> - Describes the parameters accepted by a method. Add one <param> tag for each parameter. - <returns> - Describes the return value of a method. - <exception> - Allows you to specify which exceptions a class can throw. - <example> - Lets you specify an example of how to use a method or other member. - <see> - Allows you to create a link to another documentation element. In addition, there are tags that are usually used just to format or structure blocks of text. You use these tags inside the other tags. They include: - <para> - Lets you add structure to a tag (such as a <remarks> tag) by separating its content into paragraphs. - <list> - Starts a bulleted list. You must tag each individual list item with the <item> tag. - <c> - Indicates that text within a description should be marked as code. Use the <code> tag to indicate multiple lines as code. - <code> - Allows you to embed multiple lines of code, as in an example of usage. For example, you would commonly put a <code> tag inside an <example> tag. In addition, you can define custom tags that you can then use for your own purposes. Visual Studio helps you out by automatically adding some XML tags—but only when you want them. For example, consider the code routine shown here, which tests if two files are exactly the same using a hash code. In order to use this sample as written, you need to import the System.IO and System.Security.Cryptography namespaces: Public Function TestIfTwoFilesMatch(ByVal fileA As String, _ ByVal fileB As String) As Boolean ' Create the hashing object. Dim Hash As HashAlgorithm = HashAlgorithm.Create( ) ' Calculate the hash for the first file. Dim fsA As New FileStream(fileA, FileMode.Open) Dim HashA( ) As Byte = Hash.ComputeHash(fsA) fsA.Close( ) ' Calculate the hash for the second file. Dim fsB As New FileStream(fileB, FileMode.Open) Dim HashB( ) As Byte = Hash.ComputeHash(fsB) fsB.Close( ) ' Compare the hashes. Return (Convert.ToString(HashA) = Convert.ToString(HashB)) End Function Now, position your cursor just before the function declaration, and insert three apostrophes. Visual Studio will automatically add a skeleton set of XML tags, as shown here: ''' <summary> ''' ''' </summary> ''' <param name="fileA"></param> ''' <param name="fileB"></param> ''' <returns></returns> ''' <remarks></remarks> Public Function TestIfTwoFilesMatch(ByVal fileA As String, _ ByVal fileB As String) As Boolean ... Now, you simply need to fill in some sample content within the tags: ''' <summary> ''' This function tests whether two files ''' contain the exact same content. ''' </summary> ''' <param name="fileA">Contains the full path to the first file.</param> ''' <param name="fileB">Contains the full path to the second file.</param> ''' <returns>True if the files match, false if they don't.</returns> ''' <remarks> ''' The implementation of this method uses cryptographic classes ''' to compute a hash value. This may not be the most performant ''' approach, but it is sensitive to the minutest differences, ''' and can't be practically fooled. ''' </remarks> To make a more realistic example, put the TestIfTwoFilesMatch( ) method into a class, and add XML documentation tags to the class declaration. Here's a typical example, which uses cross-references that point to the available methods in a list: ''' <summary> ''' This class contains methods for comparing files. ''' </summary> ''' <remarks> ''' <para>This class is stateless. However, it's not safe to use ''' it if the file in question may already be help open by another ''' process.</para> ''' <para>The methods in this class include:</para> ''' <list type="bullet"> ''' <item><see cref="FileComparer.TestIfTwoFilesMatch"/> ''' TestifTwoFilesMatch( ) uses hash codes to compare two files.</item> ''' </list> ''' </remarks> Public Class FileComparer ... End Class Unlike other comments, XML comments are added to the metadata of your compiled assembly. They'll automatically appear in the Object Browser when you examine a type. Additionally, once you've created your XML tags, you can export them to an XML document. Just double-click the My Project node in the Solution Explorer, choose the Compile tab, and ensure that the "Generate XML documentation file" option is selected. The XML documentation is automatically saved into an XML file with the same name as your project and the extension .xml (in the bin directory). The generated document will include all of the XML comments, with none of the code. You can then feed this document into some other type of application. For example, you might create your own custom application to scan XML comment files and build specialized reports. What about... ...creating help documentation? Although Visual Studio 2005 doesn't include any tools of its own, the open source NDoc application provides a solution (). NDoc scans code and uses the XML documentation tags it finds to build MSDN-style web pages or Visual Studio-style (MS Help 2.0) documentation. At the time of this writing, NDoc doesn't yet support .NET 2.0. Where can I learn more? The MSDN reference has much more information about XML comments, including guidelines for how to document types and how to use the standard set of tags. Look for the "XML documentation" index entry.
http://commons.oreilly.com/wiki/index.php?title=Visual_Basic_2005:_A_Developer's_Notebook/Visual_Studio&direction=prev&oldid=9292
CC-MAIN-2014-52
en
refinedweb
On Tue, 06 May 2008 09:56:22 -0400, Curt <curtferguson at cfl.rr.com> wrote: >Ok, first, I'm a true newbie, I've been playing with twisted, and python >for that matter, for about 3 days. I've been trying to get this script >to work, and I *know* I've got to be doing something simple wrong. All >it is, is a slap-together of various examples available in the twisted >documentation to see if I can learn how this works. Here's the script > >All it is supposed to do at this point is accept a normal telnet >connection on one port and authenticate it, and an ssh on another, and >authenticate, I'm attempting to write an interpreter to connect both >inputs to, but right now I'm stuck getting the connections to hold. > >Any assistance would be most welcome. > > [snip] > >class parseInput(recvline.HistoricRecvLine): > > def connectionMade(self): > print("Got Connection to parseInput") > recvline.HistoricRecvLine.connectionMade(self) > print("Came back from the undercall") > self.interpreter=commandInterpreter > > def handle_QUIT(self): > self.terminal.loseConnection() > > def lineReceived(self, line): > print("Input, " + line) > self.terminal.write("I got, " + line) > > [snip] > > if options['telnetPort']: > telnetRealm = _BaseTelnetRealm(telnet.TelnetBootstrapProtocol, > insults.ServerProtocol, > parseInput, > namespace) > > [snip] The
http://twistedmatrix.com/pipermail/twisted-python/2008-May/017648.html
CC-MAIN-2014-52
en
refinedweb
09 October 2009 11:45 [Source: ICIS news] LONDON (ICIS news)--European polyethylene terephthalate (PET) customers have been reassured of continued PET supply despite the financial health of domestic producers and an EU investigation into anti-dumping, speakers at a PET industry forum said late on Thursday. Industry players were speaking at Global Service International’s (GSI) seventh annual “PET day” in ?xml:namespace> “Importers will be the most important suppliers to the European market, if not from Last month, the European Commission launched an anti-dumping investigation into PET imports from The Commission’s investigation followed a campaign launched by the PET Committee of Plastics Europe, which said it was acting on behalf of producers representing over 50% of PET production in the EU, for anti-dumping duties to be imposed on PET imports from the three countries. “Whatever decision of the European Commission, imports will continue,” added Zanchi. According to Reliance Industries’ Sanjay Sinha, there were ample opportunities for PET exporters, in Asia and the Sinha heads Reliance's operations in India for paraxylene (PX), orthoxylene (OX), purified terephthalic acid (PTA) and polyester chips. Speakers at the forum agreed that there would be continued growth in PET demand. Expected global growth in demand for polyester was at a rate of 2m-3m tonnes/year, compared with the 1m-tonne/year increase in 2009 and the slight dip in 2008, according to Sinha. Assuming the world was experiencing a “v-shaped” economic depression, a reasonable recovery was expected over 2009-2011 for PET packaging resin, said Roger Lee of Tecnon OrbiChem, a petrochemical consultancy. Lee estimated that polyester staple would see a recovery of 8.5%, “returning to a longer-term trend of 6% thereafter”. Worldwide capacity of PET was assessed stable at around 18m tonnes/year in 2009, Zanchi said. Due to delayed plant start-ups and downward pressure on prices, which have led to closures, those plants that are in operation have ramped up their utilisation rates, Zanchi said. “It will remain a buyers’ market,” he concluded. The 160 delegates who were present at the forum consumed 8m tonnes of PET globally, according to GSI's Zanchi. For more on PET
http://www.icis.com/Articles/2009/10/09/9253960/Europe-PET-supply-to-continue-to-rely-on-imports-GSI.html
CC-MAIN-2014-52
en
refinedweb
15 March 2012 15:24 [Source: ICIS news] LONDON (ICIS)--?xml:namespace> The parliament, in a non-binding resolution adopted on Thursday, said that in order to further cut CO2 emissions the EU should improve its Emissions Trading System (ETS) through measures such as “a possible set aside of pollution permits.” Frankfurt-based Verband der Chemischen Industrie (VCI) said that a reduction of CO2 permits would hike the permit’s prices, at the expense of chemicals and other industrial producers. VCI general manager Utz Tillmann said that the EU’s plan for a low-carbon emission economy could only be realised through investment in research and innovative products. The EU’s intervention in the ETS market, however, would deprive industry of the very funds needed to invest in climate friendly products and processes, Tillmann said. The EU was starting its roadmap towards lower CO2 emissions with measures typical of a top-down planned economy, rather than implementing it in the most efficient way possible, he added. The Commission's "Roadmap for moving to a low-carbon economy" sets a policy framework to reduce CO2 emissions by at least 40% by 2030, 60% by 2040 and 80% by 2050. The parliament has repeatedly called for the EU's 20% emissions reduction target for 2020 to be increased. A higher short-term emissions reduction target would be more cost-efficient in the long-run, the parliament has argued. The parliament, in its resolution on Thursday, also said that legislation to include emissions from the aviation sector in the ETS should be implemented in full. That legislation has prompted sharp criticism from countries outside the EU, whose aviation industries would
http://www.icis.com/Articles/2012/03/15/9542053/germany-trade-group-slams-eu-parliament-move-to-curb-co2-permits.html
CC-MAIN-2014-52
en
refinedweb
06 July 2012 07:40 [Source: ICIS news] SINGAPORE (ICIS)--?xml:namespace> The producer started preparing for the restart since 27 June. The No 3 VCM line has been shut since an explosion occurred at the adjacent No 2 VCM line on 13 November 2011. The company restarted its 250,000 tonne/year No 1 VCM line at the same site on 8 May and it is currently running at around 90-95%, the source said. Tosoh is still mulling over the re-construction of its 550,000 tonne/year No 2 line, which was severely damaged in the explosion,
http://www.icis.com/Articles/2012/07/06/9575866/japans-tosoh-to-restart-no-3-vcm-line-in-nanyo-on-7.html
CC-MAIN-2014-52
en
refinedweb
This is a homework assignment that have been unable to complete. I've been working on it for 6 days with no success. Everything I try causes the code to fail. The code I'm working on is a test program to run against this code. Code java: // method factorial // computes the factorial for 01 to 12! using a table lookup // factorials larger than 12! exceed the largest value that can be stored // in a Java primitive integer public class Factorial { public static int factorial(int n) { final int f[] = { 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600}; return f[n]; } } The test program needs to catch any exceptions that occur so the program doesn't terminate. The number range is factorials for 0 through 12 only. If the user enters a negative number, a number higher than 12, blank, special characters, or alphabet the exception should be handled. Code java: import java.util.InputMismatchException; import java.util.Scanner; public class FactorialTest { public static void main (String args[]) { Factorial f = new Factorial(); // create scanner object to read user input Scanner scanner = new Scanner(System.in); // prompt user to enter a number between 0 and 12 System.out.println("Please enter a number between 0 and 12"); // store value entered by user int n = scanner.nextInt(); // assert the value of n is between 0 and 12 assert (n >= 0 && n <= 12); System.out.println("Factorial of "+n+" is = "+f+""); try { } catch (InputMismatchException inputMismatchException) { System.err.printf("/nException: %s\n", inputMismatchException); scanner.nextLine(); // discard input so user can try again System.out.println("You must enter a number between 0 and 12"); } if (n < 0) System.out.println("Number should be non-negative."); else { for (n = 0; n <= 12; n++); } } } I checked with my college campus but they do not have any tutors to help with Java programming. I also contacted my instructor but he is not available on weekends. This assignment is due on 2/23/2014. The final output needs to look something like this: Enter an integer number: abc You must enter an integer - please re-enter: Enter an integer number: -5 Factorial of this value cannot be represented as an integer. Please re-enter your integer: Enter an integer number: 13 Factorial of this value cannot be represented as an integer. Please re-enter your integer: Enter an integer number: 9 The factorial of 9 is 362880. Done! Output when a letter is entered Please enter a number between 0 and 12 a Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at FactorialTest.main(FactorialTest.java:25) Output when a number between 0 and 12 is entered Please enter a number between 0 and 12 8 Factorial of 8 is = Factorial@171bbc9 Output when a negative number is entered Factorial of -9 is = Factorial@6f7ce9 Number should be non-negative. The program is not working the way I need it to. When a number between 0 and 12 is entered the factorial amount should be pulled from main program and display in the output but it isn't When a negative number is entered the output should only display "Number should be non-negative" and allow the user to enter another number. When a letter is entered the output should display " Please enter a number between 0 and 12" and allow the user to enter another number. Any assistance you can provide on what I'm doing wrong is greatly appreciated. phendrickson
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/35948-factorial-test-program-printingthethread.html
CC-MAIN-2014-52
en
refinedweb
About collections About data provider components Specifying data providers in MXML applications Setting a data provider in ActionScript Example: Using a collection Data provider components require data for display or user interaction. To provide this data, you assign a collection, which is usually an ArrayCollection, ArrayList, or XMLListCollection object, to the data provider component’s dataProvider property. Optionally, for MX controls only,. Collections are objects that provide a uniform way to access and represent the data contained in a data source object, such as an Array or an XMLList object. Collections provide a level of abstraction between components and the data objects that you use to populate them. The standard collection types in the Flex framework, the ArrayCollection: Ensure that a component is properly updated when the underlying data changes. Components are not updated when noncollection data objects change. (They are updated to reflect the new data the next time they are refreshed.) If the data provider is a collection, the components are updated immediately after the collection change occurs. Provide mechanisms for handling paged data from remote data sources that may not initially be available and may arrive over a period of time. Provide a consistent set of operations on the data, independent of those provided by the raw data source. For example, you can insert and delete objects by using an index into the collection, independently of whether the underlying data is, for example, in an Array or an Object. Provide a specific view of the data that can be in sorted order, or filtered by a developer-supplied method. This is only a view of the data; it does not change the data. Use a single collection to populate multiple components from the same data source. Use collections to switch data sources for a component at run time, and to modify the content of the data source so that changes are reflected by all components that use the data source. Use collection methods to access data in the underlying data source. Another type of collection, ArrayList, extends the IList interface but not the ICollectionView interface. As a result, it is more lightweight and provides most of the same functionality as the ArrayCollection class. It does not, however, support sorting, filtering, or cursors.. Interface Description IList A direct representation of items organized in an ordinal fashion. The interface presents the data from the source object in the same order as it exists in that object, and provides access and manipulation methods based on an index. The IList class does not provide sorting, filtering, or cursor functionality. ICollectionView A view of a collection of items. You can modify the view to show the data in sorted order and to show a subset of the items in the source object, as specified by a filter function. A class that implements this interface can use an IList interface as the underlying collection. The interface provides access to an IViewCursor object for access to the items. IViewCursor Enumerates an object that implements the ICollectionView interface bidirectionally. The view cursor provides find, seek, and bookmarking capabilities, and lets you modify the underlying data (and the view) by inserting and removing items..* and spark.collections.* packages. It does not include constant, event, and error classes. For complete reference information on collection-related classes, see the MX collections, Spark collections, and collections.errors packages, and the CollectionEvent and CollectionEventKind classes in the ActionScript 3.0 Reference for the Adobe Flash Platform. Class ArrayCollection A standard collection for working with Arrays. Implements the IList and ICollectionView interfaces. ArrayList A standard collection for working with Arrays. Implements the IList interface. You can use this class instead of the ArrayCollection class if you do not need to sort, filter, or use cursors in your collection. AsyncListView A standard collections that handles ItemPendingErrors thrown by the getItemAt(), removeItemAt(), and toArray() methods.Use this class to support data paging when accessing data from a remote server. XMLListCollection A standard collection for working with XMLList objects. Implements the IList and ICollectionView interfaces, and a subset of XMLList methods. CursorBookmark Represents the position of a view cursor within a collection. You can save a view cursor position in a CursorBookmark object and use the object to return the view cursor to the position at a later time. Sort Provides the information and methods required to sort a collection. SortField Provides properties and methods that determine how a specific field affects data sorting in a collection. ItemResponder (Used only if the data source is remote.) Handles cases when requested data is not yet available. ListCollectionView Superclass of the ArrayCollection and XMLListCollection classes. Adapts an object that implements the IList interface to the ICollectionView interface so that it can be passed to anything that expects an IList or an ICollectionView. Several Flex components, including all list-based controls, are called data provider components because they have a dataProvider property that consumes data from an ArrayCollection, ArrayList, XMLListCollection object, or a custom collection. For example, the value of an MX. For Spark list-based controls, the value of the dataProvider property must implement the IList interface. Classes that implement IList include ArrayCollection, ArrayList, and XMLListCollection. For the MX list-based controls, you can specify raw data objects, such as an Array of strings or objects or an XML object, the value of the dataProvider property. For MX controls, Flex automatically wraps the raw data in a collection. Adobe recommends that you always specify a collection as the value of the dataProvider property. for MX controls are automatically wrapped in an ArrayCollection object or XMLListCollection, they are subject to the following limitations: Raw objects are often not sufficient if you have data that changes, because the data provider component does not receive a notification of any changes to the base object. The component therefore does not get updated until it must be redrawn due to other changes in the application, or if the data provider is reassigned. At that time, it gets the data again from the updated raw object. Raw objects do not provide advanced tools for accessing, sorting, or filtering data. For example, if you use an Array as the data provider, you must use the native Adobe® Flash® Array methods to manipulate the data. For detailed descriptions of the individual controls, see the pages for the controls in the ActionScript 3.0 Reference for the Adobe Flash Platform. For information on programming with many of the data provider components, see MX data-driven controls. The Flex framework supports the following types of data objects for populating data provider components: You can use list-based data objects with all data provider controls, but you do not typically use them with Tree and most menu-based controls, which typically use hierarchical data structures. For data that can change dynamically, you typically use an ArrayCollection, ArrayList, or XMLListCollection object to represent and manipulate these data objects rather than the raw data object. You can also use a custom object that implements the ICollectionView and/or IList interfaces. If you do not require sorting, cursors, and filtering, you can use a class that implements just the IList interface Tree MenuBar PopUpMenuButton A hierarchical data object dataProvider child tag of a data provider component; or you can define the data provider in ActionScript. All access techniques belong to one of the following patterns, whether data is local or is provided from a remote source: Using a collection implementation, such as an ArrayList object, ArrayCollection object, or XMLListCollection object, directly. This pattern is particularly useful for collections where object reusability is not important. Using a collection interface. This pattern provides the maximum of independence from the underlying collection implementation. Using a raw data object, such as an Array, with an MX list-based control. This pattern is discouraged unless data is completely static. You can use a collection, such as an ArrayList, ArrayCollection,List object as the data provider, and populate the ArrayList object by using an Array that is local or from a remote data source. The following example shows an ArrayList object declared in line in a ComboBox control: <?xml version="1.0"?> <!-- dpcontrols\ArrayCollectionInComboBox.mxml --> <s:Application xmlns:fx="" xmlns:s="library://ns.adobe.com/flex/spark" xmlns: <s:ComboBox <s:ArrayList <fx:Object <fx:Object <fx:Object </s:ArrayList> </s:ComboBox> </s:Application>The executing SWF file for the previous example is shown below: The executing SWF file for the previous example is shown below: In this example, the default property of the ComboBox control, dataProvider, defines an ArrayList object. Because dataProvider is the default property of the ComboBox control, it is not declared. The default property of the ArrayList object, source, is an Array of Objects, each of which has a label and a data field. Because the ArrayList object’s source property takes an Array object, it is not necessary to declare the <fx:Array> tag as the parent of the <fx:Object> tags. The following example uses ActionScript to declare and create an ArrayList object: <?xml version="1.0"?> <!-- dpcontrols\ArrayCollectionInAS.mxml --> <s:Application xmlns:fx="" xmlns:s="library://ns.adobe.com/flex/spark" xmlns: <fx:Script> <![CDATA[ import mx.collections.*; [Bindable] public var stateArray:ArrayList; public function initData():void { stateArray=new ArrayList( [{label:"AL", data:"Montgomery"}, {label:"AK", data:"Juneau"}, {label:"AR", data:"Little Rock"}]); } ]]> </fx:Script> <s:ComboBox </s: <s:Button In many cases, an ArrayList class is adequate for defining a non-XML data provider. However, for web services, remote objects, and uses that require cursors, filters, and sorts, you use the ArrayCollection class. <?xml version="1.0"?> <!-- dpcontrols\ROParamBind22.mxml --> <s:Application xmlns:fx="" xmlns:s="library://ns.adobe.com/flex/spark" xmlns: <s:layout> <s:VerticalLayout </s:layout> <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.utils.ArrayUtil; ]]> </fx:Script> <fx:Declarations> <mx:RemoteObject <mx:method <mx:arguments> <deptId>{dept.selectedItem.data}</deptId> </mx:arguments> </mx:method> </mx:RemoteObject> <mx:ArrayCollection </fx:Declarations> <s:HGroup> <s:Label <s:ComboBox <s:dataProvider> <mx:ArrayCollection> <mx:source> <fx:Object <fx:Object <fx:Object </mx:source> </mx:ArrayCollection> </s:dataProvider> </s:ComboBox> <s:Button </s:HGroup> <mx:DataGrid <mx:columns> <mx:DataGridColumn <mx:DataGridColumn <mx:DataGridColumn </mx:columns> </mx:DataGrid> </s:Application> If you know that a control’s data can always be represented by a specific collection class, use an ArrayList, ArrayCollection, or XMLListCollection object explicitly, as shown above.; ... <s:ComboBox You can then manipulate the interface as needed to select data for viewing, or to get and modify the data in the underlying data object. an MX --> <s:Application xmlns:fx="" xmlns:s="library://ns.adobe.com/flex/spark" xmlns: <fx:Script> <![CDATA[ [Bindable] public var myArray:Array = ["AL", "AK", "AR"]; ]]> </fx:Script> <mx:ComboBox </s:Application>The executing SWF file for the previous example is shown below: In the preceding example, the Array specified as the dataProvider is automatically wrapped in an ArrayCollection object. This is the default type for data providers to be wrapped in. If the data provider were an XML or XMLList object, it would be wrapped in an XMLListCollection object. In this example, the ArrayCollection does not have an id property, but: Using an ArrayCollection to represent data in an Array Sorting the ArrayCollection Inserting data in the ArrayCollection Note that if the example did not include sorting, it could use an ArrayList rather than an ArrayCollection as the data provider. This example also shows the insertion’s effect on the Array and the ArrayCollection representation of the Array: <?xml version="1.0"?> <!-- dpcontrols\SimpleDP.mxml --> <s:Application xmlns:fx="" xmlns:s="library://ns.adobe.com/flex/spark" xmlns: <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import spark.collections.Sort; import spark.collections.SortField; //"}); } ]]> </fx:Script> <fx:Declarations> <!-- An ArrayCollection with an array of objects --> <mx:ArrayCollection <!-- Use an fx:Array tag to associate an id with the array. --> <fx:Array <fx:Object <fx:Object <fx:Object <fx:Object <fx:Object <fx:Object <fx:Object </fx:Array> </mx:ArrayCollection> </fx:Declarations> <s:HGroup <!-- A ComboBox populated by the collection view of the Array. --> <s:ComboBox <s:Button </s:HGroup> </s:Application>The executing SWF file for the previous example is shown below: Twitter™ and Facebook posts are not covered under the terms of Creative Commons.
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b6b.html
CC-MAIN-2014-52
en
refinedweb
Java Persistence/ManyToOne ManyToOneEdit A ManyToOne relationship in Java is where the source object has an attribute that references another object, the target object. I.e. the rather typical Java case that one object holds a reference to another object. A ManyToOne relationship can be specified unidirectional. However, it is typical that the target object has the inverse relationship specified back to the source object. This would be a OneToMany relationship specification in the target object.. In JPA a ManyToOne relationship is specified through the @ManyToOne annotation or the <many-to-one> element. A @ManyToOne annotation is typically accompanied by a @JoinColumn annotation. The @JoinColumn annotation specifies how the relationship should be mapped to (expressed in) the database. The @JoinColumn defines the name of the foreign key column ( @JoinColumn(name = "...")) in the source object that should be used to find (join) the target object. If the reverse OneToMany relationship is specified in the target object, then the @OneToMany annotation in the target object must contain a mappedBy attribute to define this inverse relation., whereas a OneToOne relationship the foreign key may either be in the source object's table or the target object's table. Example of a ManyToOne relationship databaseEdit EMPLOYEE (table) PHONE (table) Example of a ManyToOne relationship annotationsEdit @Entity public class Phone { @Id private long id; ... // Specifies the PHONE table does not contain an owner column, but // an OWNER_ID column with a foreign key. And creates a join to // lazily fetch the owner @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="OWNER_ID") private Employee owner; ... } // Specification of the reverse OneToMany relationship in Employee @Entity public class Employee { @Id private long emp_id; ... // The 'mappedBy = "owner"' attribute specifies that // the 'private Employee owner;' field in Phone owns the // relationship (i.e. contains the foreign key for the query to // find all phones for an employee.) @OneToMany(mappedBy = "owner") private List<Phone> phones; ... Example of a ManyToOne relationship XMLEdit <entity name="Phone" class="org.acme.Phone" access="FIELD"> <attributes> <id name="id"/> <many-to-one <join-column </many-to-one> </attributes> </entity> See AlsoEdit - Relationships - OneToOne - OneToManyEdit Target Foreign Keys, Primary Key Join Columns, Cascade Primary KeysEdit
https://en.m.wikibooks.org/wiki/Java_Persistence/ManyToOne
CC-MAIN-2021-21
en
refinedweb
I am trying to use a GPS Parallax 28146 for a project. I’m just doing some testing on Arduino to make sure it works and is accurate. I’m new to Arduino and I’m having a hard time figuring out what’s wrong with my code. When I run the code, the only thing my GPS.read() is picking up is a value of -1. The GPS has acquired the satellites (the LED is not blinking), I’m obviously just not reading the info correctly. The link to the datasheet for the GPS is below: I have attached my code (this is my first time posting to the forum, so I’m not sure I attached the code correctly…). Any help would be greatly appreciated. #include <SoftwareSerial.h> SoftwareSerial GPS(10, 10); void setup(){ Serial.begin(9600); GPS.begin(4800); } void loop(){ delay(3000); GPS.write('!GPS'); GPS.write(0x01); if (GPS.read() > 0){ Serial.println("Signal Valid"); } else Serial.println("Signal Not Valid"); GPS.write(0x02); Serial.print("# of Acquired Satellites: "); Serial.println(GPS.read()); GPS.write(0x03); Serial.print("Time: "); Serial.println(GPS.read()); GPS.write(0x04); Serial.print("Date: "); Serial.println(GPS.read()); GPS.write(0x05); Serial.print("Latitude: "); Serial.println(GPS.read()); GPS.write(0x06); Serial.print("Longitude: "); Serial.println(GPS.read()); GPS.write(0x09); Serial.print("Heading: "); Serial.println(GPS.read()); }
https://forum.arduino.cc/t/gps-read-only-reading-1/87925
CC-MAIN-2021-21
en
refinedweb
Get a unique identifierTag(s): String/Number Thread Varia Using java.rmi.dgc.VMIDjava.rmi.dgc.VMID can generate an identifier. Each new VMID is unique for all Java virtual machines under the following conditions: - The conditions for uniqueness for objects of the class java.rmi.server.UID are satisfied -. - An address can be obtained for this host that is unique and constant for the lifetime of this object. The format is : [2 chars for each byte in 4 byte ip address]: [8 char unique string]: [16 char from time in hex]: [8 char from count] Code : public class TestVMID { public static void main(String arg[]) { System.out.println(new java.rmi.dgc.VMID().toString()); System.out.println(new java.rmi.dgc.VMID().toString()); System.out.println(new java.rmi.dgc.VMID().toString()); } } Output : d578271282b42fce:-2955b56e:107df3fbc96:-8000 d578271282b42fce:-2955b56e:107df3fbc96:-7fff d578271282b42fce:-2955b56e:107df3fbc96:-7ffe Using java.util.UUIDIn 1.5, you have java.util.UUID which is less esotoric. public class TestUUID { public static void main(String arg[]) { System.out.println(java.util.UUID.randomUUID()); // output : dedc3f57-6ce1-4504-a92f-640d8d9d23c9 } } This is probably the preferred method. Mini-FAQ on the subject : Using Apache commonsIf you need compatibility with 1.4 then the org.apache.commons.id.uuid is an option. Using java.util.concurrent.AtomicLongA simple numerical id, start at zero and increment by one. import java.util.concurrent.AtomicLong; public class Descriptor { private static final AtomicLong nextId = new AtomicLong(); public static long nextId() { return nextId.getAndIncrement(); } } See also this HowTo for unique numerical id based on the system time.
https://rgagnon.com/javadetails/java-0518.html
CC-MAIN-2021-21
en
refinedweb
GREPPER SEARCH SNIPPETS USAGE DOCS INSTALL GREPPER All Languages >> Javascript >> linear gradient react native “linear gradient react native” Code Answer’s react native liner granding javascript by Tense Tarantula on Apr 07 2020 Donate 1 yarn add react-native-linear-gradient Source: github.com linear gradient react native javascript by Outrageous Octopus on Apr 08 2021 Donate 0', },}); Source: react native linear gradient javascript by Impossible Ibex on Apr 17 2021 Donate 0 npm install react-native-linear-gradient --save Source: github.com Add a Grepper Answer Javascript answers related to “linear gradient react native” bottom shadow in react native elevation react native expo linear gradient react native elevation react native gridient button react native linear gradient react native linear gradient border radius round react native shadowcolor liners in react native Javascript queries related to “linear gradient react native” react native linear gradient LinearGradient linear gradient background react native linear gradient in react native background color linear gradient react native how to apply linear gradient background color in react native background linear gradient react native react-native-linear-gradient npm react native liner gradient react native react native gradiant react-native-linear gradient linear gradient custom in react native React-native gradient background linear gradient background color react native linear background react native react native color linear-gradien react-native-linear-gradient example react native background linear gradient background color gradient react native how to change linear gradient color direction in react native color gradient background react native react native linear gradient npm linar gradient react native react linear gradient background how to add linear gradient in react native how to use gradient in react native gradient in react native gradient react native backgorund gradients react native react native background color gradient expo linear gradient full background react native gradient stop background react native lineargradient react native native gradient color react native gradian add linear gradient react native linear gradient react lieaner gradient react native import lineargradient from 'react-native-linear-gradient' react-native linear gradient reacct-native linear gradient react native linear gradient gets black react native background gradient linear gradient style component react native image linear linear gradient style component react native gradient background. react native applying linear gradient in react native how to add linear-gradient react native react native linear gradient without expo react-native-linear-gradient github react native linear gradient circle using a linear gradient inside drawernavigation in reactnative gradient color react native "react-native-linear-text-gradient" react native 0.63 react native linear gradint growing react native linear gradient background import lineargradient in reactjs linearGradient click over react native react native stylesheet linear gradien how to disable zoom in react native LinearGradient linear gradient 180 degre react native linear gradient marble react native lineargradient in react native react native LinearGradient linear-gradient react native react native linear gradient center react native LinearGradientcentereed linear gradient react nativ react native gradient background linear gradient react native exemples react native linear gradien linear gradient react native example view gradient background react native gradient react native react native linear gradient three colors react linear gradient locations with three colors LinearGradient react-nativ react native liner gradient linear gradient react nativbe gradient background react native display gradient username react install react-native-linear-gradient use react native linear gradient with expo project react native <LinearGradient color syntax gradient react native react-native-linear-gradient LinearGradient react native react-naive gradient starter react native react native gradient react native linear graidnet background gradient react native react linear gradient linear gradient react native react native linear gradient react native liner granding » task :app:mergedexdebug failed react native 'react-native' is not recognized as an internal or external command, react native hide scroll indicator react native clear cach two button in one row react native change color of strike through line of text in react native react native debug apk react native text underline device height react native react-native italics border react native remove yellow warning react native emulator multiline textinput in react native disable inputetext in react native items in center in native clean up android build react native keyboard event height react native android center text react native open websute react native shadow elevation react native react native run specific ios device react native rotate react native seperator code iframe in react native display image base64 in REACT NATIVE box shadow react native how to hide header in react navigation white screen issue in react native splashscreen vertical align center react native view center element react native dimensions react native Unable to resolve "react-navigation-stack" react native react native button round remove header border react native react native text wrap react native cover image in parent view create react native app Unable to resolve module react-navigation react native async storage run react native app on android device hide status bar react native react native activity indicator how to remove name in react navigation header expo build apk disable yellow box react native install expo cli mac os space between react native react native touchableopacity disable react-native text overflow ellipsis tab navigation react-native without title how to place a line break in react native textarea react native Message reply react native react-native run-ios command width 100% react native firebase app named default already exists react native how to run react native app set delay react native reactjs fix ios apostrophe encoding #react native shadow create react-native project react native background image react native numbers only input react native flatlist horizontal scroll how to dynamically show image from local storage in react native typeerror undefined is not an object (evaluating 'navigation.navigate') react-native shadow generator flutter background image react native get numeric random string length of 5 characters react native component at bottom center jest Invariant Violation: could not find react-redux context value; please ensure the component is wrapped in a <Provider> react native init project react native textinput turnoff capitalize first letter shadow in react native unordered list in react native react is there a safe area view for android resize image react native how to position View absolute react native android resource linking failed react native image crop picker native base expo web eror how to check if bottom tab is active in react native material bottom tab cant get a react component to show on the screen Module not found: Can't resolve '@date-io/date-fns' in 'C:\Users\61455\Documents\React apps\mya2o\src\pages' create stack navigator has been moved to react-navigation-stack Inject Javascript Function not working in Android React Native WebView but work fine in iOS React Native react native set default ios simulator render image url in react native react native get current time error: Error: Unable to resolve module `react-native-gesture-handler` from `node_modules\@react-navigation\native\lib\module\Scrollables.js`: react-native-gesture-handler could not be found within the project. expo asyncstorage react native italic text react native open email client how to redirect in ionic react Error: open failed: EACCES (Permission denied) react native watchman watch-del-all, and react-native start --reset-cache react native flatlist hide scrollbar error duplicate resources react native how to create react native project at specific version react native text input number only react native tabbed sticky view remove header from certain pages react navigation react native cli create project adding border in react native react-native init AwesomeProject change port Unable to resolve module `react/lib/ReactComponentWithPureRenderMixin` from `node_modules\react-navigation\src\views\Header.js`: react/lib/ReactComponentWithPureRenderMixin could not be found within the project best react native animation library react native app crashes without error TextInput disable react native react native ribbon navigating programatically react react native text area form react native image fit container float right react native ovelay text on image in react native react native slow performance after load iamges react native loading clear textinput react native unexpected token export type react bottontab navigation react native image disable fade in onload border bottom react native react native image when jpeg not fit to container easy peasy state management with react native how to clear pod cache in react native react native activityindicator get current screen name react navigation flutter decoration image react native run on device command line react native backgrunde img unexpected token react native stack navigation create react native app npx how to add button in alert box in react native react native responsive font shadowoffset react native constructor react native class component template keyboard shortcut how to create round image in react native too many open files react native react native button react native checkbox how to add oAuth google signin in react native app ionic capacitor keyboard push content up ion input ios keyboard over how to take 100% width in react native ways to show image in react native content uri react native fs text number of lines react native react native webview react native init specific version shadown reAct native statusbar.sethidden(true) in react native what is react native react native shaddow react native elevation color text react native align text center react native devtools failed to load sourcemap when debugging react native touchableopacity as button in react native sha-1 certificate fingerprint react native react native release apk command create a react native project video in react native stack overflow relative width and height image react native attempt to invoke virtual method 'android.graphics.drawable.drawable react native react native textinput no keyboard react native create button add image in react native photo in React native navigator.useragent export aab react native background transparent react native styling scrollview height in react native react native status bar how to clean react native project expo linear gradient export apk react native react native mac react native text capitalize react native vector icons not showing react native flatlist Platform react native react native stacknavigator react native image not working ios 14 expo create react native app how to map objects in react native react native styles for both platforms react native image file path variable how to make a textarea unwritable in react native textinput onpress react native video expo documentation close exit app react native view background image in react native react native textinput how to put firebase config in a sperate file react native how to align placeholder in react native react native linear gradient border radius make a fixed list in react native text button flutter out of memory gc overhead limit exceeded. react native digitally signed react native useScreens() react native how to remove global react-native-cli package react native flatlist margin bottom react native image react native settimeout how to reload webview in react native how to create a new react native project react native scrollview react native pm ERR! code EINTEGRITY text size react native add search bar react native rebuild android react native get rid of header bar react native react native layout animation react native floating button react native paper how to change package name in react native hide warnings in expo app react native socket io change text size according to screen react native react native input react native gesture handler error metro bundler process exited with code 1 react native statusbar reactnati react-native-paper resize switch resize react native shadow hiding header in a specific screen in react native rn push notification No task registered for key ReactNativeFirebaseMessagingHeadlessTask react native header style generate apk debug react native react native shadow android react native button top right expo update react native react navigation stack react native asyncstorage expo make an infinite list in react native react native text ellipsis shadow border react native button style not working react native react native link fonts picker change event react native react native textinput not show cursor react native passing parameters to routes react native spinner react native vector icons gradlew clean in react native unterminated character class react native navigation reset react-native loading spinner reactnavigation 5 hide header network display react native react native ignore warnings Camera with expo react-native-safe-area-context react native making bigger hitbox how to use .env file in react native how to make apk react native stack navigator FAILURE: Build failed with an exception react native android how to create component in reactjs how to create a component in react native react native header react native get OS react native liner granding react native center text vertically full screen create react native app npm react native camera add background image react native upload a file from react native expo to s3 rtl support react native npx create-react-native-app react native text right align react native add link to text react native getstream @react-navigation/native transition like ios react native dropdown 2 taps is required to close keyboad in react native react native grid view standalone apk build expo react native ellipsis react-native-reanimated npm react native asign width to image Image react native custom font in react native styles in react native react native how to delete android build linker call rect native navigation in react native how to hide title bar react-navigation difference between React Native and React box shadow in react native react native form input react native qrcode scanner permission react native linear gradient drawer navigation set width react native react native webview postmessage example spinner react native convert app function to class component react native react navigation history clear icon shwoing a box react native vector icons react native keyboard event listener how to find network there is no network react native conditional style react native flatlist react native horizontal how to add a button to react native react native gifted chat react native drawer navigation example how to make your own drop down react native flutter build signed bundle --release images not appearing in react native ios react-native android build apk go back button react native linear gradient react native gitignore for react native react native margin vs padding react native routes react native storage react native add custom fonts react native share shadow using react native react native margin react-native-svg react native different status bar configuration based on route create bottom navigation bar react native react native android version code react native modal what is expo react native react native open link in browser react navigation react native splash screen react native change button color react native yarn react native cli react-native-screens app release apk react native react native snackbar text decoration react native animation react native npm undefined is not a function (near '...(0, _reactNative.createStackNavigator)...') react native appbar export app react native react native scroll to toast in react native react native docs react native vector icon remove react native cli mac react native nav bars import json file in react native react native charts Detect the city on application launch via geolocation react native react native text input right react native android padding style debug.xcconfig: unable to open file react native react-native loading screen react native new project mac shadow generator react native react native navigation react native debugger export aab bundle react native android react native passing params to nested navigators swap scroll right in react native circle in react native react native vs flutter react native flexbox 2 columns 1 fixed width line separator with text in the center react native login with gmail in react native expo open app settings react native images react native expo change color android navigation bar onPress image react native android force date inside RecyclerView to re render react native layout animation android react native tab navigation flutter text with icon why navlink in react router always active react native flatlist pull to refresh android:usesCleartextTraffic="true" react native material bottom tabs auto scroll to view react-native react native elements react-native spinner react native get location navigation.navigate is not a function rngesturehandlermodule.default.direction react native how to mark a icon with vector icons in mapview how to add button react native app.js how to add a picker in expo core.js:5967 ERROR TypeError: Cannot read property 'nativeElement' of undefined avoid compressing imagepicker react native react native diasble view how to creat 6 image ui for react native react native length of object set navigation drawer to open by default react native picture and text in same line react native Module '"../../../node_modules/react-native"' has no exported member 'View' react-native-charts-wrapper:compileDebugJavaWithJavac FAILED firebase react native expo command reboot android app react native adb command node_modules/react-native-paper/lib/module/core/Provider.js request-promise-native error RequestError: Error: unable to verify the first certificate back press subscriptions i is not a function react native react native dimensions window vs screen retour à la ligne react native mobx listen to changes react native animation libraries Unable to resolve "@react-native-community/masked-view" from react native scrollview set height react native text area align top flatlist footer react native evaluating '_reactNativeImageCropPicker.default.openCamera react native detect platform react native scrollview scrollto() will console.log will be automatically disabled in react native for development build admob react native react-native make android apk could not resolve module fs react native how to install formik in react native npx react-native bottom shadow in react native react native indicator navigation.openDrawer is not a function react native expo react native how to remove an object from array in react native react native spinkit react router native back button react native expo search bar getting view height dynamically in react native react native post api method expo cli vs react native cli react native autofocus on text input with keyboard display .env file example react native react native navigation remove top header screen how to use react-native-vector-icons react navigation react native create project with version react native shadow react native generator hide screen links in drawerNavigation in react native text input underline react native react-native app localisation react native global styles how to add abutton component to drawer in react native react native preload local images flutter vs react native react native ant design upload image in firebase storage react web text input phone number react native react native version react native camera example react native components location of release apk in react native sttripe for payment in react native andorid start react native camera in react native build apk react native image slider in react native google login with react native react native firebase react native firebase subscribe to topic react native bootstrap how to use algolia react native redirect to url onPress react native react native navigation goback with params shadow react native code in nested forEach loop- react native react native stopwatch label tag alternative in react native ask for expo token and save to firebase vector icons react native react native date time picker modal npm android studio react native plugins implement cai webchat in react native react google maps for development purposes only if statement in react native react native application architecture react native no android sdk found react native scrollbar position issue react native gridient button run react native with debugger breakpoint get all database react native router flux pass props stack react native get user location in react native react-native-quick-scroll npm upload image file in react native using rest api to website react native open email client expo react-native curved view news api react native react native multiline cursor on first line react native: how to know th softkey height flutter app accessible when phone is locked react native panresponder on click react native notifications error app running in expo client is slow unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. can i use hooks with expo in react native react navigation 4 react native maps api key push notification not working on standalone react native circle button react native expo webview refresh how to render react native app under the status bar nested navigation react native shadowcolor liners in react native how to clear text ibput after message sent react native react native run ios not building how to download an mp3 file in react native react native loading overlay react-native-apple-authentication smooth user navigation react native maps react native curved view react native on expo finger print is working bt not in apk react native navigation paramlist never used react native tdd emzyme prevent double tap in react native onpress react native datepicker stackver flow react native swipe screen "rbac" react redux navigation bar react native portrait only keyboard close when typing react native ExoPlayer with auto linking react native responsive calc height react native how ot make a background color faor evaluationbutton in flutter react-native-geolocation-service react native get timezone react native document picker example how to detect if app is loosing focuse in react native mobile nav react npm how to display a calender in react native react native set variable key in loop keyboard avoidance view not working on react native react native google places autocomplete react native Stack Navigation Prop unused variable react native add two view react native better camera flutter app bar action button color round react native react native exo player build errior resize mode stringdef contextcompat NativeKeyboard -> NativeKeyboard -> NativeKeyboard -> NativeKeyboard]: NullInjectorError: No provider for NativeKeyboard! react native port make internal value in render function in react native filter in react native video how to run bare react-native project react native firebase community template react native updating options with setoptions change status bar color react native react-native-redux login example github react native navigation header Right react native hide button codepush react native update unrecognized font family 'feather' react native connect react native app to local api macos Difference in push and navigate in react Navigation react native cognito passwordless react native store sensitive data in redux app immediately closes react native react native whatsapp integration evaluating '_reactNativeImagePicker.default.launchImageLibrary') how to make react native dapp truffle how to prevent previous radio button active react native how to run a cloned react native project react native get source maps react native sovrapporre immagini convert css box shadow to react native react native activity the simulation using expo won't start - react native react native navigate two screens back elevation react native react native app slow lagging image react native call keep how to sent get on react native react native smart splash screen detecting change in animated value react native react native map repeate react native timed out waiting for modules to be invalidated ab mob react native expo react native sharing common options across screens library to add navigation in react native react native scrollview fixed header react native confirm dialog react native onChangeText resize the background image react-native-custom-datetimepicker npm how to go to settings on next click in react native node closes once you open app react-native platform check in react native for status bar color expo login using facebook error after login react native react native how to change programmatically view style horizontal divider react native _40 0 _55 null _65 0 _72 null react native fetch reactnative print in ios react native generate app hash without play console react native countdown expo app.json drag and drop view react native jest simulate toggle switch react native expo has stopped if login using facebook error after login react native how to make apk in android studio reac native como hacer un onpress en react native expo min width react native react native navigation shared element react native camscanner application mobile code react native share image decrease touchableopacity in react native react native multiple touchableopacity making all makers to show in react native map how to get country code in react native uuid react native expo initialization failed for block pool registering (datanode uuid unassigned) service to exiting Duplicate module name: React Native hasteimpl react native android ipa failed react native after processing usb react native device not found how to run react native app on simulator hot loading react native shortcut key imagebackground with input inot avoiding react native react-native-ffmpeg gradel issue React native user based location return <Text> using if condition react native React Native BUILD FAILED on run-ios on focused text input style react native react native anination 2 valuse add clickable link to image in react native get image url in react input file or preview form image react-native eject not working same name different extentions react-native android ios react native detect locale Get LocalStorage from WebView react native await zoomus.joinmeeting crashing app react native react interactions react native bordered image drop with shadow fix No provider for HTTP! { HTTP Native} react native firebase login with facebook react native list view react-native-responsive-screen react native search bar react native image border radius not working scrollview not working react-native react native font based on viewport dimensions native run app debug image react native base64 react native dynamic view size expo appdata//Roaming//npm//node_modules//.expo-cli.DELETE'%22 airbnb react native eslint component navigation without changin the url react router react native toggle button with text react native side drawer how to identify debug and release build in react native array in react native NetworkInformation() { [native code] } como arreglar el error de Linking.openUrl no funciona react native valueof in react native react native textinput disable keyboard react native complete reference react native how to pass id from list to function react native listview date separator site:stackoverflow.com npm react native turn by turn navigation wrap text react native object javascript detect right click difference between React Native and React create a customer in stripe node.js moment is date equals expect vue test utils compare objects react modules npm run command with arguments svelte store dollar sign npm remopve existing files Laravel bootstrap 5 install popper.js error pie charts react jQuery exists function set cookie javascript javascript get cookie how to get session javascript ws3schools js cookie javascript create cookie javascript cookies javascript set and get cookie js set cookie javascript promise Javascript get text input value jquery click function react router js int to string javascript convert number to string int to string js javascript switch statement multiple cases javascript switch append to array js append data in value array javascript javascript add to array append data get array javascript append to array add element to array javascript Javascript append item to array append data array javascript js set class javascript get element by class javascript alert javascript replace string javascript array methods javascript convert string to json object substring javascript javascript class javascript find get current url js javascript get current url javascript get url javacript getHTTPURL add class javascript addclass javascript javascript add class to element js add class js fetch 'post' json javascript onclick javascript fetch api sort javascript array javascript try catch javascript try command to create react app javascript explode array length javascript object keys javascript event listener javascript minecraft color codes javascript foreach addeventlistener fetch api javascript js random number between 1 and 100 Math.floor(Math.random() * (max - min 1) min) js random javascript get random number in range random number javascript JS get random number between random int from interval javascript javascript trim inline style jsx try catch in javascript add bootstrap to react javascript onclick event listener js add click listener js substring local storage javascript localstorage how to install vue how to setup vue install vue-cli javascript date example Javascript get current date javascript date methods get date now javascript javascript date method document ready without jquery javascript after dom ready document ready javacsript ready function javascript Javascript document ready document ready jquery document.ready() document ready js queryselector javascript reverse array javascript in array math.random javascript express js example express hello world express js basic example uppercase string in js javascript reduce javascript replace all occurrences of string javascript replace all js replace all symbols in string js replace all javascript array size how to generate a random number in javascript js keycodes settimeout javascript javascript string lentrh jquery each javascript pushing to an array switch javascript .innerhtml javascript reload page moment format js rounding node js fetch javascript on input change js string to date javascript get element by id javascript check if value in array js preventdefault tolowercase javascript jquery click event remove property from javascript object remove from object javascript remove property from object JS javascript remove property from object js remove property from object javascript remove object property how to remove key value pair from object js jquery submit form for each js router react combine two arrays javascript node http request get value javascript javascript loop over class javascript iterate over json javascript iterate over object javascript loop through object example javascript loop over classes javascript loop through object javascript loop through objec javascript enumerate object properties javascript loop through object array javascript iterate through object javascript for each key in object js iterate object javascript iterate through object properties foreach jas react create app node.js express javascript capitalize first letter merge array in js on change jquery object to json c# how to create react app angular lifecycle hooks javascript sort array with objects return the value of a selected option in a drop-down list how can we take selected index value of dropdown in javascript javascript get selected option JS get select option value jquery ajax post example vue watch jquery add div element jQuery create div element react router dom js delete duplicates from array jquery link script tag get height element use js javascript get element width and height get height use js javascript get element width get height of div use js Javascript get element height and width javascript get element height convert to string javascript javascript delete key from object js date methods js loop array javascript loop thrugh array javascript loop through array javascript code to loop through array javascript through array html loop through array javascript loop through arrya jquery value of input set value of input javascript style an element with javascript format date js map function in react javascript confirm example Javascript compare two dates compare dates in js react background image js timestamp javascript get timestamp javascript get timestamp codegrepper timestamp js jquery get child div window.open in js jquery get selected option value jQuery get selected option jquery onclick function javascript convert date to yyyy-mm-dd turn object into string javascript js throw error react usestate javascript modify css javascript open new window how to find the index of a value in an array in javascript update npm python json string to object tostring js js getelementbyid angular date formats json example javascript reverse a string node express cors headers javascript get first 10 characters of string jquery ajax post sorting array from highest to lowest javascript import img react how to change style of an element using javascript javascript date format body parser express js settimeout Javascript stop setInterval javascript list length javascript event listener hide div in javascript javascript object destructuring how to refresh the page using react for loop javascript js setinterval length of object javacript count properties javascript get length of object JS get length of an object javscript get object size js object length js get object keys install react js javascript test for empty object javascript get parent element nodejs readfile javascript get last element of array javascript style background color javascript orderby foreach javascript javascript join array javascript append element to array redux devtools javascript check if number get value of input jqueyr write json file nodejs javascript to string javascript remoev css class javascript remove css class uninstall node package header in axios timeout javascript javascript sum of array jquery remove class window.href javascript for each loop js get data attribute javascript foreach example foreach over array javascript javascript example of foreach loop mdn foreach javascript for eac loop npx create-react-app on click jquery js classlist axios in vue javascript get attribute javascript delete element check node version axios js and react remove item from array javascript for in javascript angular generate component math.floor js javascript constructor function jquery create html element jquery create element javascript change image src javascript order array by date create child element in javascript setup new angular project check for substring javascript javascript remove event listener npm react router dom javascript is string in array react localstorage jquery foreach javascript object length jquery set attribute get window size javascript function javascript javascript hasownproperty angular cli javascript display block how to check if object has key javascript add sass to react get url javascript javascript get random array value append element javascript open link in new tab javascript js window resize listener javascript window resize listener javascript window resize event window resize event javascript how to append values to dropdown using jquery document.queryselector create-react-app redux stop monitorevents how to create a prompt in javascript deprecationwarning: mongoose encodeuricomponent reverse lastindexof() javascript external javascript files can be cached jspdf online demo Javascript string to int js form submit listener javascript regex email how to implement a promise with daisy chaining in angular javascript is not null macos start simulator from cli vue add script tags and link tags javascript remove non numeric chars from string keep dot write file with deno ionic 5 side menu example typedjs detect adblock javascript javascript detect page last index array javascript javascript empty cache and hard reload constructoers in flutter JavaScript: Manipulating Complex Objects js how to add two arrays together how to smooth scroll in javascript insert property multiple documents mongodb new Sequelize('featherstutorial', 'databaseUser', 'databasePassword' js in_array declare module '@vue/runtime-core' $router remove the items in array which are present in another javascript compare NaN in javascript if condititon workbox Basic JavaScript: Use Recursion to Create a Countdown how to terminate a program in js javascript events list with examples flutter geolocator web enzynme not support react 17 express delete image javascript break inner loop only jqery vdn node test unit javascript if shorthand jest cross origin localhost fobbiden js array delete specific element jquery div hide show not working in wordpress navlink activestyle not working clear screen in js jquery declare variable javascript comment npx create-react-app slick slider direction event, slick, currentSlide, nextSlide previousSlide how to get first and last element of array in javascript ng class project how to do text to speech in javascript how can i create like function in javascript hover con js javascript learning how to compare previous value with current in jquery (node:14372) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. Use emitter.setMaxListeners() to increase limit google auth.onstatechange react native length of object fix a navbar to top of page js requirejs catch javascript select first n elements from array jquery empty npm run watch-poll how to create a constant in javascript getelementsbytagname within a div nodejs encrypt text with key javascript alternative to jquery css video in react native stack overflow what is gulpjs try catch with for loop in javascript true or false questions and answers list react date format ngrok live port vue js make directory in node js how to get the number of days in a month in javascript TS2339: Property 'value' does not exist on type 'Component<{}, {}, any>'. react renderer unit test node js if no arguments axios httponly cookie jquery change image src disable paste space in textbox using javascript copy localstorage javascript javascript endswith can we give a url to img with jquery Module not found: Can't resolve 'react-dom' "deepakkumar.info" graphql playground bad request on heroku javascript convert image to base64 how to add text in javascript append element javascript open new window javascript request to failed, reason: unable to get local issuer certificate how to aadd variable in html tag in js js display 2d array django jquery jquery option selected what is max size for localstorage every in javascript array map edje js not pre compile for node 12 version redux saga fetch data interceptors ionic modal navbar not showing javascript sort map by value convert jquery to string js multiply string break loop after time javascript how to clean react native project cmv wab widgets j'ai eu la chance en anglais jfif to jpeg javascript javascript reset span html javascript truncate array convert milliseconds to seconds JS how to get name array value in jquery js maths objects difference between type and method in ajax javascript use strict how to create node js server Lazy Loading Routes vue leaflet legend prev props nodejs oauth2 request create react app cloudfront invalidation findone and update mongoose javascript clear localstorage firebase tutorial with react reverse keys and values in object javascript javasctipt unix timestamp from date how to do a switch function javascript confirmEnding javascript date 3 months ago javascript todataurl java script member count embed angular formgroup on value change react copy to clipboard button js replace all symbols in string javascript delete first character in string redirect to homepage javascript semantics ui complete responsive menu max value in array javascript how to enable click copy function using js play audio in javascript edit onclick event dm discord.js immutable values jquery each response mongoose schema type RS Brawijaya Healthcare rumah sakit type js setinterval vs settimeout javascript create array from 1 to n js insert text into div javascript remove element from the dom reset navigation to specific tab react-navigation next js create store jquery on window ready get all classes of element jquery dotenv devexpress custom text column field return the value of a selected option in a drop-down list get an image from an array react js how to reverse a string javascript wait 5 seconds document jquery react enzyme how to give the next line in protractor javascript array remove last jquery get current focus element document ready javascript expressjs async await .split javascript slice in javascript javascript get unique values from key how to import npm module javascript hide element by class how to append objects to javascript lists ? Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If jquery: get class list using element id javascript get random number in range javascript remove object property node.js ping javascript onscroll sticky navbar firebase angular send notification to by tocken javascript get sub array regular expression arabic and persion buble sort in js node js split javascript break out of loop generate random number javascript mongoose findoneandupdate js random int javascript redirect to url Limit text to specified number of words using .
https://www.codegrepper.com/code-examples/javascript/linear+gradient+react+native
CC-MAIN-2021-21
en
refinedweb
SB-Messaging Adapter The Service Bus (SB-Messaging) adapter is used to receive and send from Service Bus entities like Queues, Topics, and Relays. You can use the SB-Messaging adapter to connect your on-premises BizTalk Server to Azure. Starting with BizTalk Server 2016 Feature Pack 2, Service Bus Premium is supported. When configuring a send port using this adapter, you can send messages to partitioned queues and topics. Authenticating with Service Bus Service Bus provides two methods to authenticate: - Access Control Service (ACS) - Shared Access Signature (SAS) We recommend using Shared Access Signature (SAS) to authenticate with Service Bus. The Shared Access Key value is listed in the Azure portal. When you create a Service Bus namespace, the Access Control (ACS) namespace is not automatically created. To use Access Control, you need the Issuer Name and Issuer Key values of this namespace. These values are available when you create a new ACS namespace using Windows PowerShell. These values are not listed in the Azure portal. To use ACS for authentication, and get the Issuer Name and Issuer Key values, the overall steps include: Install the Azure Powershell cmdlets. Add your Azure account: Add-AzureAccount Return your subscription name: get-azuresubscription Select your subscription: select-azuresubscription <name of your subscription> Create a new namespace: new-azuresbnamespace <name for the service bus> "Location" -CreateACSNamespace $true -NamespaceType Messaging Example: new-azuresbnamespace biztalksbnamespace "South Central US" -CreateACSNamespace $true -NamespaceType Messaging When the new ACS namespace is created (which can take several minutes), the IssuerName and IssuerKey values are listed in the connection string: Name : biztalksbnamespace Region : South Central US DefaultKey : abcdefghijklmnopqrstuvwxyz Status : Active CreatedAt : 10/18/2016 9:36:30 PM AcsManagementEndpoint : ServiceBusEndpoint : ConnectionString : Endpoint=sb://biztalksbnamespace.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=abcdefghijklmnopqrstuvwxyz NamespaceType : Messaging See New-AzureSBNamespace for guidance. Receive messages from Service Bus In the BizTalk Server Administration console, expand BizTalk Group, expand Applications, and then expand your application. Right-click Receive Ports, select New, and select One-Way receive port. Give it a name, and select Receive Locations. Select New, give it a Name. In the Transport section, select SB-Messaging from the Type drop-down list, and then select Configure. Configure the General properties: Configure the Authentication properties: In the Properties tab, in the Namespace for Brokered Message Properties, enter the namespace that the adapter uses to write the brokered message properties as message context properties on the message received by BizTalk Server. If you want to promote the brokered message properties, select the Promote Brokered Message Properties check box. Select OK. Select your Receive handler, and the Receive pipeline. Select OK to save your changes. Create a Receive Location provides some guidance. Send messages to Service Bus In the BizTalk Server Administration console, right-click Send Ports, select New, and select Static One-way send port. Create a Send Port provides some guidance. Enter a Name. In Transport, set the Type to SB-Messaging, and select Configure. Configure the General properties: Configure the Authentication properties: In the Properties tab, enter the Namespace for the user defined Brokered Message Properties that contains the BizTalk message context properties that you want to write on the outgoing message to Service Bus. All the namespace properties are written to the message as user-defined Brokered Message properties. The adapter ignores the namespace while writing the properties as Brokered Message properties. It uses the namespace only to ascertain what properties to write. You can also enter the values for the BrokeredMessage properties. These properties are described at BrokeredMessage Properties, including the Partition Key. Select OK to save your changes.
https://docs.microsoft.com/en-us/biztalk/core/sb-messaging-adapter?redirectedfrom=MSDN
CC-MAIN-2019-47
en
refinedweb
Spring Boot, Jersey, and Swagger: Always Happy Together Spring Boot, Jersey, and Swagger: Always Happy Together See how Spring Boot, Jersey, and Swagger help create, document, and monitor the infrastructure of API applications more easily. Join the DZone community and get the full member experience.Join For Free We are on the cusp of the API economy: APIs are everywhere, boosting digital transformation and disrupting the way we think, so a shift is also required in the way we develop. APIs are expected to enable automation, in turn driving efficiency, consistency, and cost savings. API quality matters, both for API consumers and implementers. For these reasons, building an API infrastructure from scratch may not be a good idea. It is much easier and more productive to use a good framework or library, often more than one. From a development point of view, it's crucial to achieve the target whilst ensuring the fulfillment of the following requirements: timing, cost saving, and quality. Standardization is an important way to achieve those goals: to ensure consistency, speed up development, enable factorization and simplify maintenance. Furthermore, a very important factor in APIs is complete and accurate documentation., and best of all, the documentation should be produced and provided in a standard form, to automate the documentation process and to ensure a great overall experience in API consuming. Even for the simplest API, achieving all these goals and accomplishing all the required tasks may not be so simple for a developer. A minimal infrastructure must be set up, a set of components has to be selected, configured, and enabled to work together. The API implementation stack configuration can be a complex, repetitive, and error-prone process. The developer should not take care about the configuration and components integration details, focusing on the business tasks the API has to face and resolve. It is where standards, frameworks, and libraries come to help, taking charge of the API infrastructure setup and configuration and leaving the developer free to focus on the API goals. In one sentence: focus on what matters and forget the tedious stuff. In this post, I would like to show you how the Holon Platform can be used in conjunction with some of the most known and industry-standard libraries to face this challenges. We'll start from the beginning, showing how to create a simple API service. We'll focus on project setup and configuration, leaving out the API business logic concerns. In fact, this API will only provide a single "ping" operation, which will respond with a pong message. The building blocks we're going to use for this project are: - Spring Boot for auto-configuration and execution using an embedded servlet container. - Jersey, the reference JAX-RS implementation, to create the API operations using the RESTful paradigm. - JSON as data interchange format. - Swagger (OpenAPI) for API documentation. - Spring Boot Actuator for service monitoring and management. - The Holon Platform JAX-RS module, to leverage on some configuration facilities and automate the API documentation creation and provisioning. The code of this example is available on GitHub:. Creating the API Application We'll use Maven for project setup and dependency management, so let's start by configuring the project's pom dependencies. First of all, we import the Holon Platform BOM (Bill of Materials); this way we'll no longer need to specify the Holon Platform artifacts version. The right version of each artifact is declared and provided by the platform BOM. <dependencyManagement> <dependencies> <!-- Holon Platform BOM --> <dependency> <groupId>com.holon-platform</groupId> <artifactId>bom</artifactId> <version>5.0.2</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> We'll use the Holon JAX-RS Spring Boot starter with Jersey as implementation, so we declare the following dependency: <!-- Holon JAX-RS using Jersey --> <dependency> <groupId>com.holon-platform.jaxrs</groupId> <artifactId>holon-starter-jersey</artifactId> </dependency> Do you prefer to use Resteasy as JAX-RS implementation? It's only a matter of configuration, just change the Holon starter to use it: <!-- Holon JAX-RS using Resteasy --> <dependency> <groupId>com.holon-platform.jaxrs</groupId> <artifactId>holon-starter-resteasy</artifactId> </dependency> These Holon Spring Boot starters inherit the standard Spring Boot web starters, and provide embedded servlet container configuration, logging, and Holon-specific auto-configuration facilities. By default, Tomcat is used as the embedded servlet container. Want to use Undertow? Just change the starter name (for example, holon-starter-jersey-undertow). Concerning JSON data format instead, Jackson is automatically set up. What if Gson is your preferred choice? It's only about changing a name again (for example, holon-starter-jersey-gson). Now, independently from the starter you chose, we have to create just two Java classes. The first one, which we'll call Application, is the Spring Boot application entry-point, which triggers auto-configuration and provides the main method used to run the application itself, starting the embedded servlet container and deploying our API endpoints: @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } An application.yml file can be used to provide application configuration properties. For example, to configure the embedded server port: server: port: 9999 Next, it's time to create the API endpoint, which will provide the API operations listening to the HTTP requests and returning the corresponding responses, using JSON as the data format. As said before, this simple API will only provide a ping operation, mapped to the GET request method, returning a pong response encoded as JSON. Finally, we want to map the API operations endpoint to the base "/api" path. Using JAX-RS, this is how the API endpoint can be defined: @Component @Path("/api") public class ApiEndpoint { @GET @Path("/ping") @Produces(MediaType.APPLICATION_JSON) public Response ping() { return Response.ok("pong").build(); } } Note the @Component annotation on the API endpoint class. This is a standard Spring annotation to declare this class as a Spring component, candidate for auto-detection. Relying on the Holon Platform auto-configuration features, this class will be automatically detected and registered as a JAX-RS resource in Jersey (or Resteasy). And of course, will be enabled as a Spring component, allowing, for example, dependency injections. To run the application, we'll use the Spring Boot Maven plugin, declaring it in the project pom: <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution><goals><goal>repackage</goal></goals></execution> </executions> </plugin> </plugins> </build> This way, a runnable jar will be created by the Spring Boot plugin, with all the required dependencies and able to execute standalone using a JRE. To test the application, we can use the run Spring Boot maven goal this way: mvn spring-boot:run That's it. The application can be now started, activating our API service. The ping operation will be available sending an HTTP GET request to an URL like this: Obtaining a response like the following: HTTP/1.1 200 Content-Type: application/json Content-Length: 4 pong Documenting the API Operations We'll use Swagger for API documentation. The Swagger specification is now the foundation of the Open API Initiative, which is trying to standardizing on how REST APIs are described. The Holon Platform provides many configuration facilities for Swagger, perfectly integrated with JAX-RS and the Spring Boot auto-configuration architecture. Let's start adding the Holon Platform Swagger dependency to our project pom: <dependency> <groupId>com.holon-platform.jaxrs</groupId> <artifactId>holon-jaxrs-swagger</artifactId> </dependency> From now on, the Holon Platform auto-configuration services will auto-detect any JAX-RS endpoint annotated with the standard Swagger @Api annotation and automatically create a JAX-RS endpoint to generate and provide the Swagger API documentation. By default, this endpoint will be mapped to the /api-docs path and supports a type query parameter to obtain the Swagger API documentation as JSON (the default behaviour) or YAML. Standard Swagger annotations are supported to enrich and configure the API documentation, such as @ApiOperation. Additionally, the Holon Platform Swagger module provides the @ApiDefinition annotation, which can be used to configure the overall API information (such the title and the version) and to change the default API documentation endpoint path. In this example, we want to use the /api/docs path to provide the API documentation. So you want to modify the ApiEndpoint class this way: @ApiDefinition(docsPath = "/api/docs", title = "Example API", version = "v1", prettyPrint = true) @Api("Test API") @Component @Path("/api") public class ApiEndpoint { @ApiOperation("Ping request") @ApiResponses({ @ApiResponse(code = 200, message = "OK: pong", response = String.class) }) @GET @Path("/ping") @Produces(MediaType.APPLICATION_JSON) public Response ping() { return Response.ok("pong").build(); } } This way, the Swagger API documentation can be obtained in JSON format performing a GET request to the URL: Or in the YAML format: Using the Swagger Editor to display the API documentation, it will appear like this: Monitoring the API Application As the last step, we want to add application monitoring and management capabilities, using the Spring Boot Actuator, which adds several production grade services to obtain application information, health check, configuration and so on. To enable the Spring Boot Actuator endpoints auto-configuration, we have to add the following dependencies to the project pom: <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.3.11.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>1.5.8.RELEASE</version> </dependency> Now a set of monitoring endpoints should be registered. For example, the health check endpoint listens to the /health path. So we expect to obtain the health information performing a GET request to an URL like this: But wait... things do not go as we expected: the server responds with a 404 (not found) error code! Why? This is a well-known and annoying problem which occurs when the Jersey servlet is mapped to the root context path. The problem is that Jersey will get all the request. It does not know that it needs to forward to any actuator endpoints. This can be resolved by change Jersey to be used as filter instead of a servlet. Using Spring Boot we can do this using a configuration property in the application.yml file: spring: jersey: type: filter But this is not enough: we also have to set the Jersey property to forward requests for URLs it doesn't know. With the Holon Platform JAX-RS module, this is simple, just another configuration property to set: holon: jersey: forwardOn404: true Well done, everything work as expected! The health check endpoint is reachable and provides the following JSON response content: {"status":"UP"} Summary With 2 Java classes, a pom and a Spring Boot configuration file, we set up a production-grade API application, able to be run standalone, with API documentation and monitoring capabilities. Now it's time to focus on business tasks, making the API somehow useful! This article is adapted from one originally published in the Holon Platform website: The source code of the example API created in this post is available on GitHub: Published at DZone with permission of Riccardo Righi . See the original article here. Opinions expressed by DZone contributors are their own. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/spring-boot-jersey-and-swagger-always-happy-togeth
CC-MAIN-2019-47
en
refinedweb
import "github.com/hyperledger/fabric/orderer/consensus" type Chain interface { // Order accepts a message which has been processed at a given configSeq. // If the configSeq advances, it is the responsibility of the consenter // to revalidate and potentially discard the message // The consenter may return an error, indicating the message was not accepted Order(env *cb.Envelope, configSeq uint64) error // Configure accepts a message which reconfigures the channel and will // trigger an update to the configSeq if committed. The configuration must have // been triggered by a ConfigUpdate message. If the config sequence advances, // it is the responsibility of the consenter to recompute the resulting config, // discarding the message if the reconfiguration is no longer valid. // The consenter may return an error, indicating the message was not accepted Configure(config *cb.Envelope, configSeq uint64) error // WaitReady blocks waiting for consenter to be ready for accepting new messages. // This is useful when consenter needs to temporarily block ingress messages so // that in-flight messages can be consumed. It could return error if consenter is // in erroneous states. If this blocking behavior is not desired, consenter could // simply return nil. WaitReady() error // Errored returns a channel which will close when an error has occurred. // This is especially useful for the Deliver client, who must terminate waiting // clients when the consenter is not up to date. Errored() <-chan struct{} // Start should allocate whatever resources are needed for staying up to date with the chain. // Typically, this involves creating a thread which reads from the ordering source, passes those // messages to a block cutter, and writes the resulting blocks to the ledger. Start() // Halt frees the resources which were allocated for this Chain. Halt() } Chain defines a way to inject messages for ordering. Note, that in order to allow flexibility in the implementation, it is the responsibility of the implementer to take the ordered messages, send them through the blockcutter.Receiver supplied via HandleChain to cut blocks, and ultimately write the ledger also supplied via HandleChain. This design allows for two primary flows 1. Messages are ordered into a stream, the stream is cut into blocks, the blocks are committed (solo, kafka) 2. Messages are cut into blocks, the blocks are ordered, then the blocks are committed (sbft) type Consenter interface { // HandleChain should create and return a reference to a Chain for the given set of resources. // It will only be invoked for a given chain once per process. In general, errors will be treated // as irrecoverable and cause system shutdown. See the description of Chain for more details // The second argument to HandleChain is a pointer to the metadata stored on the `ORDERER` slot of // the last block committed to the ledger of this Chain. For a new chain, or one which is migrated, // this metadata will be nil (or contain a zero-length Value), as there is no prior metadata to report. HandleChain(support ConsenterSupport, metadata *cb.Metadata) (Chain, error) } Consenter defines the backing ordering mechanism. type ConsenterSupport interface { crypto.LocalSigner msgprocessor.Processor // VerifyBlockSignature verifies a signature of a block with a given optional // configuration (can be nil). VerifyBlockSignature([]*cb.SignedData, *cb.ConfigEnvelope) error // BlockCutter returns the block cutting helper for this channel. BlockCutter() blockcutter.Receiver // SharedConfig provides the shared config from the channel's current config block. () channelconfig.Orderer // ChannelConfig provides the channel config from the channel's current config block. ChannelConfig() channelconfig.Channel // CreateNextBlock takes a list of messages and creates the next block based on the block with highest block number committed to the ledger // Note that either WriteBlock or WriteConfigBlock must be called before invoking this method a second time. CreateNextBlock(messages []*cb.Envelope) *cb.Block // Block returns a block with the given number, // or nil if such a block doesn't exist. Block(number uint64) *cb.Block // WriteBlock commits a block to the ledger. WriteBlock(block *cb.Block, encodedMetadataValue []byte) // WriteConfigBlock commits a block to the ledger, and applies the config update inside. WriteConfigBlock(block *cb.Block, encodedMetadataValue []byte) // Sequence returns the current config squence. Sequence() uint64 // ChainID returns the channel ID this support is associated with. ChainID() string // Height returns the number of blocks in the chain this channel is associated with. Height() uint64 // Append appends a new block to the ledger in its raw form, // unlike WriteBlock that also mutates its metadata. Append(block *cb.Block) error } ConsenterSupport provides the resources available to a Consenter implementation. Package consensus imports 5 packages (graph) and is imported by 11 packages. Updated 2019-10-23. Refresh now. Tools for package owners.
https://godoc.org/github.com/hyperledger/fabric/orderer/consensus
CC-MAIN-2019-47
en
refinedweb
Nash Nash (or Nash shell) is a minimalist yet powerful shell with focus on readability and security of scripts. It is inspired by Plan9 rc shell and brings to Linux a similar approach to namespaces(7) creation. There is a nashfmt program to correctly format nash scripts in a readable manner, much like the Golang gofmt program. Contents Installation Install the nash-gitAUR package. Configuration Make sure that nash has been successfully installed issuing the command below in your current shell: $ nash λ> If it returned a lambda prompt, then everything is fine. When first executed, nash will create a ~/.nash/ directory in the user's homepath. Enter the command below to discover by yourself what is this directory: λ> echo $NASHPATH /home/username/.nash Put a file called init inside this directory to configure it. Nash only has 1 special variables: PROMPTvariable stores the unicode string used for the shell prompt. Nash default cd is a very simple alias to the builtin function chdir; you may find it odd to use. To improve your usage you can create your own cd alias. In nash you cannot create aliases by matching string to strings, but only binding function to command names. The init below creates a cd alias as example: defPROMPT = "λ> " fn cd(path) { if $path == "" { path = $HOME } chdir($path) PROMPT = "("+$path+")"+$defPROMPT setenv PROMPT } # bind the "cd" function to "cd" command name bindfn cd cd After saving the init file, simply start a new shell and now you can use cd as if it were a builtin keyword. git:(master)λ> nash λ> cd (/home/i4k)λ> cd /usr/local (/usr/local)λ> For a more elaborated cd or other aliases implementation, see the project dotnash. Organizing the init Nash scripts can be modular, but there is no concept of package. You can use the import keyword to load other files inside the current script session. For an example, see dotnash init. Configuring $PATH Inside the init put the code below (edit for your needs): path = ( "/bin" "/usr/bin" "/usr/local/bin" $HOME+"/bin" ) PATH = "" for p in $path { PATH = $PATH+":"+$p } setenv PATH Making nash your default shell See Command-line shell#Changing your default shell. Usage Keybindings The cli supports emacs and vi modes for common buffer editing. Default mode is emacs and you can change issuing: λ> set mode vi
https://wiki.archlinux.org/index.php?title=Nash&printable=yes
CC-MAIN-2019-47
en
refinedweb
#include <xf86drm.h> The Direct Rendering Manager (DRM) is a framework to manage Graphics Processing Units (GPUs). It is designed to support the needs of complex graphics devices, usually containing programmable pipelines well suited to 3D graphics acceleration. Furthermore, it is responsible for memory management, interrupt handling and DMA to provide a uniform interface to applications. In earlier days, the kernel framework was solely used to provide raw hardware access to privileged user-space processes which implement all the hardware abstraction layers. But more and more tasks were moved into the kernel. All these interfaces are based on ioctl(2) commands on the DRM character device. The libdrm library provides wrappers for these system-calls and many helpers to simplify the API. When a GPU is detected, the DRM system loads a driver for the detected hardware type. Each connected GPU is then presented to user-space via a character-device that is usually available as /dev/dri/card0 and can be accessed with open(2) and close(2). However, it still depends on the graphics driver which interfaces are available on these devices. If an interface is not available, the syscalls will fail with EINVAL. All DRM devices provide authentication mechanisms. Only a DRM-Master is allowed to perform mode-setting or modify core state and only one user can be DRM-Master at a time. See drmSetMaster(3) for information on how to become DRM-Master and what the limitations are. Other DRM users can be authenticated to the DRM-Master via drmAuthMagic(3) so they can perform buffer allocations and rendering. Managing connected monitors and displays and changing the current modes is called Mode-Setting. This is restricted to the current DRM-Master. Historically, this was implemented in user-space, but new DRM drivers implement a kernel interface to perform mode-setting called Kernel Mode Setting (KMS). If your hardware-driver supports it, you can use the KMS API provided by DRM. This includes allocating framebuffers, selecting modes and managing CRTCs and encoders. See drm-kms(7) for more. The most sophisticated tasks for GPUs today is managing memory objects. Textures, framebuffers, command-buffers and all other kinds of commands for the GPU have to be stored in memory. The DRM driver takes care of managing all memory objects, flushing caches, synchronizing access and providing CPU access to GPU memory. All memory management is hardware driver dependent. However, two generic frameworks are available that are used by most DRM drivers. These are the Translation Table Manager (TTM) and the Graphics Execution Manager (GEM). They provide generic APIs to create, destroy and access buffers from user-space. However, there are still many differences between the drivers so driver-depedent code is still needed. Many helpers are provided in libgbm (Graphics Buffer Manager) from the mesa-project. For more information on DRM memory-management, see drm-memory(7). Bugs in this manual should be reported to under the "DRI" product, component "libdrm" drm-kms(7), drm-memory(7), drmSetMaster(3), drmAuthMagic(3), drmAvailable(3), drmOpen(3)
https://man.linuxreviews.org/man7/drm.7.html
CC-MAIN-2019-47
en
refinedweb
33742/polling-the-queue-in-amazon-sqs This the scenario. I want to send a bunch of notification emails to customers. And am planning to use my web app(s) and other applications to "send" emails. The plan is to have a method, that generates a chunk of XML representing the email to be sent and adds them to the Amazon SQS queue. I then need a way of checking the queue and physically sending out the email messages. But what would be the best way to poll the queue? One way is you could create a windows service that retrieves any messages from the queue every 10 minutes and then dispatches them. For this, you can try 'postmark' app. Another way is maybe you can use SES. But it is very inexpensive compared to other similar services or building other systems. SNS is a distributed publish-subscribe system and the messages are pushed to ...READ MORE In order to make system more efficient ...READ MORE Assuming you only have one process adding ...READ MORE Below is the answer to your question. ...READ MORE Follow the guide given here in aws ...READ MORE Check if the FTP ports are enabled ...READ MORE To connect to EC2 instance using Filezilla, ...READ MORE AWS ElastiCache APIs don't expose any abstraction ...READ MORE The code would be something like this: import ...READ MORE You can create a cluster using either ...READ MORE OR Already have an account? Sign in.
https://www.edureka.co/community/33742/polling-the-queue-in-amazon-sqs
CC-MAIN-2019-47
en
refinedweb
Adding Search to your Eleventy Static Site with Lunr I recently came back from connect.tech (one of my favorite conferences). I had the honor of giving not one, but two different talks. One of them was on static sites, or the JAMstack. This is a topic I’ve covered many times in the past, but it had been a while since I gave a presentation on it. During my presentation I covered various ways of adding dynamic features back to the static site, one of them being search. For my blog here, I make use of Google’s Custom Search Engine feature. This basically lets me offload search to Google, who I hear knows a few things about search. But I also give up a bit of control over the functionality. Oh, and of course, Google gets to run a few ads while helping find those results… To be clear, I don’t fault Google for those ads, I’m using their service for free, but it isn’t something a lot of folks would want on their site. There’s an alternative that’s been around for a while that I’ve finally made some time to learn, Lunr. Lunr is a completely client-side search solution. Working with an index of your creation (a lot more on that in a moment), Lunr will take in search input and attempt to find the best match it can. You are then free to create your search UI/UX any way you choose. I was first introduced to Lunr while working at Auth0, we used it in the docs for Extend. (Note - this product is currently EOLed so the previous link may not work in the future.) If you use the search form on the top right, all the logic of running the search, finding results, and displaying them, are all done client-side. Lunr is a pretty cool project, but let’s talk about the biggest issue you need to consider - your index. In order for Lunr to find results, you need to feed it your data. In theory, you could feed it the plain text of every page you want to index. That essentially means your user is downloading all the text of your site on every request. While caching can be used to make that a bit nicer, if your site has thousands of pages, that’s not going to scale. This is why I didn’t even consider Lunr for my blog. You also need to determine what you want to actually search. Consider an ecommerce site. Adding search for products is a no brainer. But along with text about the product, you may want to index the category of the product. Maybe a subcategory. Shoot, maybe even a bit of the usage instructions. And even after determining what you want to index, you need to determine if some parts of your index are more important than others. If you are building a support site, you may consider usage instructions for products more important than the general description. Lunr isn’t going to care what you index, but you really think about this aspect up front. I definitely recommend spending some time in the Lunr docs and guides to get familiar with the API. So, how about an example? Our Site For my test, I decided to build a simple static site using Eleventy. This is my new favorite static site generator and I’m having a lot of fun working with it. You can use absolutely any other generator with Lunr. You could also absolutely use an application server like Node, PHP, or ColdFusion. My static site is a directory of GI Joe characters sourced from Joepedia. I only copied over a few characters to keep things simple. You can see the site (including the full search functionality we’re going to build) at. Here’s an example character page. --- layout: character title: Cobra Commander faction: Cobra image: --- Not. Not much is known about him, he is a master of disguise and he has appeared as a goatee artist looking man with a son in a coma, in the Marvel comics. His appearance in the 12 inch G.I. Joe line shows him as a man with dark slicked back hair, his appearance constantly changing leaves him assumed to wear masks, even the commander can keep his identity from the people around him. And how it looks on the site: Our Search Index I decided to build my index out of the character pages. My index would include the title, URL, and the first paragraph of each character page. You can see the final result here:. So how did I build it? The first thing I did was create a custom collection for Eleventy based on the directory where I stored my character Markdown files. I added this to my .eleventy.js file. eleventyConfig.addCollection("characters", function(collection) { return collection.getFilteredByGlob("characters/*.md").sort((a,b) => { if(a.data.title < b.data.title) return -1; if(a.data.title > b.date.title) return 1; return 0; }); }); I am embarrassed to say it took me like 10 minutes to get my damn sort right even though that’s a pretty simple JavaScript array method. Anyway, this is what then allows me to build a list of characters on my site’s home page, like so: <ul> {% for character in collections.characters %} <li><a href="{{ character.url }}">{{ character.data.title }}</a></li> {% endfor %} </ul> This is also how I’m able to look over my characters to build my JSON index. But before I did that, I needed a way to get an “excerpt” of text out of my pages. The docs at Eleventy were a bit weird about this. I had the impression it was baked in via one of the tools it uses, but for the life of me I could not get it to work. I eventually ended up using a modified form of the tip on this article, Creating a Blog with Eleventy. I added his code there to add a short code, excerpt, built like so: eleventyConfig.addShortcode('excerpt', article => extractExcerpt(article)); // later in my .eleventy.js file... // function extractExcerpt(article) { if (!article.hasOwnProperty('templateContent')) { console.warn('Failed to extract excerpt: Document has no property "templateContent".'); return null; } let excerpt = null; const content = article.templateContent; // The start and end separators to try and match to extract the excerpt const separatorsList = [ { start: '<!-- Excerpt Start -->', end: '<!-- Excerpt End -->' }, { start: '<p>', end: '</p>' } ]; separatorsList.some(separators => { const startPosition = content.indexOf(separators.start); const endPosition = content.indexOf(separators.end); if (startPosition !== -1 && endPosition !== -1) { excerpt = content.substring(startPosition + separators.start.length, endPosition).trim(); return true; // Exit out of array loop on first match } }); return excerpt; } Note that I modified his code such that it finds the first closing P tag, not the last. With these pieces in place, I built my index in lunr.liquid: --- permalink: /index.json --- [ {% for character in collections.characters %} { "title":"{{character.data.title}}", "url":"{{character.url}}", "content":"{% excerpt character %}" } {% if forloop.last == false %},{% endif %} {% endfor %} ] Our Search Front-End Because I’m a bit slow and a glutton for punishment, I decided to build my search code using Vue.js. Why am implying this was a mistake? Well it really wasn’t a mistake per se, but I did run into an unintended consequence of using Liquid as my template engine and Vue.js. You see, by using Liquid on the back end (in my static site generator), I made use of a template syntax that is similar to Vue.js. So if I did {{ name }} it would be picked up by Liquid first before Vue ever got a chance to run it. The solution wasn’t too difficult, but possibly added a bit of complexity that may be something you wish to avoid in the future. Of course, using Vue was totally arbitrary here and not something you need to use with Lunr, so please keep that in mind when looking at my solution. Since my own blog also uses Liquid, I’m going to share the HTML code via an image. Note that my entire demo is available at GitHub (via the link I’ll share at the end). In the screen shot above, note the raw and endraw tags surrounding my Vue code. That’s how I was able to get it working. But as I said, let’s ignore that. ;) The code here is rather simple. A search field, a place for the results, and a simple way to handle it when no results are found. Note that my results include a url and title value. This actually takes a little bit of work, and I’ll explain why in a bit. Alright, let’s switch to the JavaScript. First, let’s look at the data and created parts of my code. data:{ docs:null, idx:null, term:'', results:null }, async created() { let result = await fetch('/index.json'); docs = await result.json(); // assign an ID so it's easier to look up later, it will be the same as index this.idx = lunr(function () { this.ref('id'); this.field('title'); this.field('content'); docs.forEach(function (doc, idx) { doc.id = idx; this.add(doc); }, this); }); this.docs = docs; }, When my Vue application loads up, I first make a request to my index data. When that’s done, it’s time to build the Lunr index. This is done via a function passed in to the constructor. The first thing I do is define the ref, or primary identifier of each thing I’m indexing, what Lunr refers to as docs. I then define the fields in my content I want indexed. Note that I could boost certain fields here if I want one to be more important than another. I then loop over each item in my index and here’s a SUPER IMPORTANT thing you need to keep in mind. When Lunr returns search matches, it only returns the ref value. If you remember, my index consists of the url, the title, and a block of text. If I want to tell my users the title of the matched document, and if I want to link to that result, I have to get that information. But I just said - Lunr doesn’t return it. So how do I get it? Since Lunr returns the ref value, I can use that as a way to look up my information in the index. My URLs are unique and I could use array methods to find my data, but if I simply use the position value, the idx above, then I’ve got a quick and easy way to get my original document. This comes together in the search method: search() { let results = this.idx.search(this.term); // we need to add title, url from ref results.forEach(r => { r.title = this.docs[r.ref].title; r.url = this.docs[r.ref].url; }); this.results = results; } I begin by just doing the search, passing your input as is. Lunr will parse it, do it’s magic, and return the results. In order for me to use the title and url values, I refer back to the original array as I loop over the results. And that’s basically it. You can test this yourself - try searching for weapon to find Destro. Finally, you can find the entire repository for this demo here:. I hope this helps, and now you know how to use client-site search with Lunr and Eleventy. And as we know… Header photo by Kayla Farmer on Unsplash
https://www.raymondcamden.com/2019/10/20/adding-search-to-your-eleventy-static-site-with-lunr?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ColdfusionbloggersorgFeed+%28coldfusionBloggers.org+Feed%29
CC-MAIN-2019-47
en
refinedweb
UTF-8. Consider the following string literal expressions, all of which encode U+0123, LATIN SMALL LETTER G WITH CEDILLA: The UTF-8, UTF-16, and UTF-32 string literals have well-defined and portable sequences of code unit values. The ordinary and wide string literal code unit sequences depend on the implementation defined execution and execution wide encodings respectively. Code that is designed to work with text encodings must be able to differentiate these strings. This is straight forward for wide, UTF-16, and UTF-32 string literals since they each have a distinct code unit type suitable for differentiation via function overloading or template specialization. But for ordinary and UTF-8 string literals, differentiating between them requires additional information since they have the same code unit type. That additional information might be provided implicitly via differently named functions, or explicitly via additional function or template arguments. For example: The requirement to, in some way, specify the text encoding, other than through the type of the string, limits the ability to provide elegant encoding sensitive interfaces. Consider the following invocations of the make_text_view function proposed in P0244R2 [P0244R2]: For each invocation, the encoding of the string literal is known at compile time, so having to explicitly specify the encoding tag is redundant. If UTF-8 string literals had a distinct type, then the encoding type could be inferred, while still allowing an overriding tag to be supplied:. #1 performs no conversions. #2 converts between strings encoded in the implementation defined wide and narrow encodings. #3 and #4 convert between either the UTF-16 or UTF-32 encoding and the UTF-8 encoding. Specializations are not currently specified for conversion between the implementation defined narrow and wide encodings and any of the UTF-8, UTF-16, or UTF-32 encodings. However, if support for such conversions were to be added, the desired interfaces are already taken by #1, #3. § 30.11.7.2.2 [fs.path.type.cvt] describes how the source encoding is determined based on whether the source range value type is char, wchar_t, char16_t, or char32_t. A range with value type char is interpreted using the implementation defined execution encoding. It is not possible to construct a path object from UTF-8 encoded text using these constructors. To accommodate UTF-8 encoded text, the file system library specifies the following factory functions. Matching factory functions are not provided for other encodings.: Finally, processing of UTF-8 strings is currently subject to an optimization pessimization due to glvalue expressions of type char potentially aliasing objects of other types. Use of a distinct type that does not share this aliasing behavior may allow for further compiler optimizations. As of November 2017, UTF-8 is now used by more than 90% of all websites [W3Techs]. The C++ standard must improve support for UTF-8 by removing the existing barriers that result in redundant tagging of character encodings, non-generic UTF-8 specific workarounds like u8path, and the need for static casts to examine UTF-8 code unit values. The proposed changes are intended to bring the standard to the state the author believes it would likely be in had char8_t been added at the same time that char16_t and char32_t were added. This includes the ability to differentiate ordinary and UTF-8 literals in function overloading, template specializations, and user-defined literal operator signatures. The following core language changes are proposed in order to facilitate these capabilities: The following library changes are proposed to address concerns like those raised in the motivation section above, and to take advantage of the new core features: These changes necessarily impact backward compatibility as described in the Backward compatibility section. This proposal does not specify any backward compatibility features other than to retain interfaces that it deprecates. The author believes such features are necessary, but that a single set of such features would unnecessarily compromise the goals of this proposal. Rather, the expectation is that implementations will provide options to enable more fine grained compatibility features. The following sections discuss backward compatibility impact. Declarations of arrays of char may currently be initialized with UTF-8 string literals. Under this proposal, such initializations would become ill-formed. This is intended to maintain consistency with initialization of arrays of wchar_t, char16_t, and char32_t, all of which require the initializing string literal to have a matching element type as specified in § 11.6.2 [dcl.init.string]. Implementations are encouraged to add options to allow the above initializations (with a warning) to assist users in migrating their code. Declarations of variables of type char initialized with a UTF-8 character literal remain well-formed and are initialized following the standard conversion rules. Under this proposal, UTF-8 string literals no longer bind to references to array of type const char nor do they implicitly convert to pointer to const char. The following code is currently well-formed, but would become ill-formed under this proposal: Implementations are encouraged to add options to allow the above conversions (with a warning) to assist users in migrating their code. Such options would require allowing aliasing of char and char8_t. Note that it may be useful to permit these conversions only for UTF-8 string literals and not for general expressions of array of char8_t type. Under this proposal, UTF-8 string and character literals have type array of const char8_t and char8_t respectively. This affects the types deduced for placeholder types and template parameter types. This change in behavior is a primary objective of this proposal. Implementations are encouraged to add options to disable char8_t support entirely when necessary to preserve compatibility with C++17. The following code is currently well-formed, and would remain well-formed under this proposal, but would behave differently: The following code is currently well-formed, but would become ill-formed under this proposal: These changes in behavior are a primary objective of this proposal. Implementations are encouraged to add options to disable char8_t support entirely when necessary to preserve compatibility with C++17. The following code is currently well-formed, and would remain well-formed under this proposal, but would behave differently: This change in behavior is a primary objective of this proposal. Implementations are encouraged to add options to disable char8_t support entirely when necessary to preserve compatibility with C++17. This proposal includes a new specialization of std::basic_string for the new char8_t type, a new std::u8string type alias, and changes to the u8string and generic_u8string member functions of filesystem::path to return std::u8string instead of std::string. This change renders ill-formed the following code that is currently well-formed. Implementations are encouraged to add an option that allows implicit conversion of std::u8string to std::string to assist in a gradual migration of code that calls these functions. This proposal includes new overloads of operator ""s and operator ""sv that return char8_t specializations of std::basic_string and std::basic_string_view respectively. This change renders ill-formed the following code that is currently well-formed. Implementations are encouraged to add an option that allows implicit conversion of std::u8string to std::string to assist in a gradual migration of code that calls these functions. 6.7.1 [basic.fundamental] paragraph 5. An implementation is available in the char8_t branch of a gcc fork hosted on GitHub at. This implementation is believed to be complete for both the proposed core language and library features with the exception of the proposed mbrtoc8 and c8rtomb transcoding functions (the author expects to complete these shortly). New -fchar8_t and -fno-char8_t compiler options support enabling and disabling the new features. No backward compatibility features are currently implemented. Richard Smith implemented support for the proposed core wording changes and they are present in the release of Clang 7. The changes are guarded by new -fchar8_t and -fno-char8_t options matching the gcc implementation. No backward compatibility features are currently implemented. Support for the proposed library features has not yet been implemented in libc++. Richard's changes can be found at These changes are relative to N4762 [N4762] Change in table 5 of 5.11 [lex.key] paragraph 1: […] […][…] Change in 5.13.3 [lex.ccon] paragraph 3: A character literal that begins with u8, such as u8'w', is a character literal of type char, known as a UTF-8 character literal.[…] Change in 5.13.5 [lex.string] paragraph 6: After translation phase 6, a string-literal that does not begin with an encoding-prefix is an ordinary string literal, and is initialized with the given characters. Change in 5.13.5 [lex.string] paragraph 7: A string-literal that begins with u8, such as u8"asdf", is a UTF-8 string literal Change in 5 (6.6.4). Drafting note: The deleted paragraph 8 content was incorporated in the changes to paragraphs 6 and 7. Remove 5.13.5 [lex.string] paragraph 9: For a UTF-8 string literal, each successive element of the object representation (6.7) has the value of the corresponding code unit of the UTF-8 encoding of the string. Drafting note: The paragraph 9 content was incorporated in the changes to paragraph 7. Change in 5.13.5 [lex.string] paragraph 15: […] In a narrow string literal, a universal-character-name may map to more than one char element due to multibyte encoding. […] Change in 6.6.5 [basic.align] paragraph 6: The alignment requirement of a complete type can be queried using an alignof expression (7.6.2.6). Furthermore, the narrow character types (6.7.1) shall have the weakest alignment requirement. [ Note: This enables the narrowcharacter types to be used as the underlying type for an aligned memory area (9.11.2). — end note ] Change in 6.7character types. A char, a signed char, and number. These requirements do not hold for other types. In any particular implementation, a plain char object can take on either the same values as a signed char or an unsigned char; which one is implementation-defined. For each value i of type unsigned charin the range 0 to 255 inclusive, there exists a value j of type char such that the result of an integral conversion (7.3.8) from i to char is j, and the result of an integral conversion from j to unsigned char is i. Change in 6.7.1 [basic.fundamental] paragraph 5: […] Type wchar_t shall have the same size, signedness, and alignment requirements (6.6.5) as one of the other integral types, called its underlying type. Types char16_t and char32_t denote distinct types with the same size, signedness, and alignment as uint_least16_t and uint_least32_t, respectively, in <cstdint>, called the underlying types. Change in 6.7.1 [basic.fundamental] paragraph 7: Types bool, char, char16_t, char32_t, wchar_t, and the signed and unsigned integer types are collectively called integral types. […] Change in 6.7.4 [conv.rank] subparagraph (1.8): […] (1.8) — The ranks of char16_t, char32_t, and wchar_t shall equal the ranks of their underlying types (6.7.1). […] Change to footnote 65 associated with 7.4 [expr.arith.conv] subparagraph (1.5): As a consequence, operands of type bool, char16_t, char32_t, wchar_t, or an enumerated type are converted to some integral type. Change in 7.6.2.3 [expr.sizeof] paragraph 1: […] sizeof(char), sizeof(signed char) and sizeof(unsigned char) are 1. The result of sizeof applied to any other fundamental type (6.7.1) is implementation-defined. […] Change in 9.1.7.2 [dcl.type.simple] paragraph 1: The simple type specifiers are simple-type-specifier: […] char char16_t char32_t […] Change in table 11 of 9.1.7.2 [dcl.type.simple] paragraph 2: […] […] Change in 9.3 [dcl.init] subparagraph (12.1): (12.1) — If an indeterminate value of unsigned narrowcharacter type (6.7.1) or std::byte type (16.2.1) is produced by the evaluation of: […] (12.1.3) — the operand of a cast or conversion (7.3.8, 7.6.1.3, 7.6.1.9, 7.6.3) to an unsigned[…] narrowcharacter type or std::byte type (16.2.1), or then the result of the operation is an indeterminate value. Change in 9.3 [dcl.init] subparagraph (12.2): (12.2) If an indeterminate value of unsigned narrowcharacter type or std::byte type is produced by the evaluation of the right operand of a simple assignment operator (7.6.18) whose first operand is an lvalue of unsigned narrowcharacter type or std::byte type, an indeterminate value replaces the value of the object referred to by the left operand. Change in 9.3 [dcl.init] subparagraph (12.3): (12.3) If an indeterminate value of unsigned narrowcharacter type is produced by the evaluation of the initialization expression when initializing an object of unsigned narrowcharacter type, that object is initialized to an indeterminate value. Change in 9.3 [dcl.init] subparagraph (12.4): (12.4) If an indeterminate value of unsigned narrowcharacter type or std::byte type is produced by the evaluation of the initialization expression when initializing an object of std::byte type, that object is initialized to an indeterminate value. […] Change in 9.3 [dcl.init] subparagraph (17.3): […] (17.3) — If the destination type is an array of characters, an array of char16_t, an array of char32_t, or an array of wchar_t, and the initializer is a string literal, see 9.3.2. […] Change in 9.3.2 [dcl.init.string] paragraph 1: An array of narrowcharacter type (6.7.1), char16_t array, char32_t array, or wchar_t array can be initialized by a narrowstring literal, char16_t string literal, char32_t string literal, or wide string literal, respectively, […] Change in table 16 of 14.8 [cpp.predefined] paragraph 1: Change in 15.1 [library.general] paragraph 8: The strings library (Clause 20) provides support for manipulating text represented as sequences of type char, sequences of type char16_t, sequences of type char32_t, sequences of type wchar_t, and sequences of any other character-like type. Change in 15.3.2 [defns.character]: […] [ Note: The term does not mean only char, char16_t, char32_t, and wchar_t objects, but any value that can be represented by a type that provides the definitions specified in these Clauses. — end note ] Change in table 35 of 16.3.1 [support.limits.general] paragraph 3: Change in 16.3.2 [limits.syn]: […] template<> class numeric_limits<char>; template<> class numeric_limits<signed char>; template<> class numeric_limits<unsigned char>; template<> class numeric_limits<char16_t>; template<> class numeric_limits<char32_t>; template<> class numeric_limits<wchar_t>; […] Change in 20 20: 20.2p4 appears to unnecessarily duplicate information previously presented in 20.2p1. Change in 20.2.3 [char.traits.specializations]: namespace std { template<> struct char_traits<char>; template<> struct char_traits<char16_t>; template<> struct char_traits<char16_t>; template<> struct char_traits<char32_t>; template<> struct char_traits<wchar_t>; } Change in 20.2.3 [char.traits.specializations] paragraph 1: The header <string> shall define fourspecializations of the class template char_traits: char_traits<char>, char_traits<char16_t>, char_traits<char32_t>, and char_traits<wchar_t>. Add a new subclause after 20.2.3.1 [char.traits.specializations.char]: namespace std { template<> struct char_traits<char8_t> { using char_type = char8_t; using int_type = unsigned int; using off_type = streamoff; using pos_type = u8streampos; using state_type = mbstate_t; static constexpr void assign(char_type& c1, const char_type& c2) noexcept; static constexpr bool eq(char_type c1, char_type c2) noexcept; static constexpr bool lt(char_type c1, char_type c2) noexcept; static constexpr int compare(const char_type* s1, const char_type* s2, size_t n); static constexpr size_t length(const char_type* s); static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a); static char_type* move(char_type* s1, const char_type* s2, size_t n); static char_type* copy(char_type* s1, const char_type* s2, size_t n); static char_type* assign(char_type* s, size_t n, char_type a); static; }; } Drafting note: The char_traits<char8_t> specification above was copied from the char_traits<char16_t> specification in [char.traits.specializations.char16_t] and then modified to update the targets of the type aliases. Add paragraph 1: The two-argument members assign, eq, and lt are defined identically to the built-in operators =, ==, and < respectively. Add paragraph 2: The member eof() returns an implementation-defined constant that cannot appear as a valid UTF-8 code unit. Drafting note: Paragraphs 1-2 above are lightly edited copies from the char_traits<char16_t> specification in [char.traits.specializations.char16_t] that were then modified to match wording changes in Tim Song's proposed cleanup of the <string> library. Change in 20. Change in 20.3.1 [string.syn]: Header <string> synopsis#include <initializer_list> namespace std { // [char.traits],>; […]>; } […] // [basic.string.hash], hash support: template<class T> struct>; inline namespace literals { inline namespace string_literals { // [basic.string.literals], 20.3.5 [basic.string>; Add a new paragraph after 20.3.6 [basic.string.literals] paragraph 1: u8string operator""s(const char8_t* str, size_t len);Returns: u8string{str, len}. Change in 20>; // [string.view.hash], hash support template<class T> struct hash; template<> struct hash<string_view>; template<> struct hash<u16string_view>; template<> struct hash<u32string_view>; template<> struct hash<wstring_view>; inline namespace literals { inline namespace string_view_literals { // [string.view.literals], suffix for basic_string_view literals constexpr string_view operator""sv(const char* str, size_t len) noexcept; constexpr u16string_view operator""sv(const char16_t* str, size_t len) noexcept; constexpr u32string_view operator""sv(const char32_t* str, size_t len) noexcept; constexpr wstring_view operator""sv(const wchar_t* str, size_t len) noexcept; } } […] Change in 20.4.5 [string.view.hash]: template<> struct hash<string_view>; template<> struct hash<u16string_view>; template<> struct hash<u32string_view>; template<> struct hash<wstring_view>; Add a new paragraph after 20.4.6 [string.view.literals] paragraph 1: constexpr u8string_view operator""sv(const char8_t* str, size_t len) noexcept;Returns: u8string_view{str, len}. Change in 20.5.5 [cuchar.syn]: namespace std { using mbstate_t = see below; using size_t = see 16.2.4; size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps); size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps); size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps); size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps); } Change in 20.5.5 [cuchar.syn] paragraph 1: The contents and meaning of the header <cuchar> are the same as the C standard library header <uchar.h>, except that it does not declare types char16_t nor char32_t. See also: ISO C 7.28 Drafting note: If WG14 were to adopt N2231 [WG14 N2231] in a future revision of ISO C, and if WG21 were to update its normative reference to ISO C to a later revision containing those changes, then the updates to 20.5.5 paragraph 1 above will require modification to exclude a declaration of the char8_t typedef and to remove mention of the additional mbrtoc8 and c8rtomb functions. Change in 20.5.6 [c.mb.wcs] paragraph 1: [Note: The headers <cstdlib> (16.2.2) and <cwchar> (20.5.4) declare the functions described in this subclause. — end note] Add the following paragraphs at the end of 20.5.6 [c.mb.wcs]: size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps);. Change in table 91 of 26.3.1.1.1 [locale.category] paragraph 2: Drafting note: The deleted char based codecvt specializations have been deprecated and moved to annex D, [depr.locale.category]. Change in table 92 of 26.3.1.1.1 [locale.category] paragraph 4: Drafting note: The deleted char based codecvt_byname specializations have been deprecated and moved to annex D, [depr.locale.category]. Change in 26.4.1.4 [locale.codecvt] paragraph 3: The specializations required in Table 91 (26.3.1.1.1) convert the implementation-defined native character set. codecvt<char, char, mbstate_t> implements a degenerate conversion; it does not convert at all. The specialization codecvt<char16_t, char, mbstate_t> converts between the UTF-16 and UTF-8 encoding forms, and the specialization codecvt<char32_t, char, mbstate_t> converts between the UTF-32 and UTF-8 encoding forms. codecvt<wchar_t,char,mbstate_t> converts between the native character sets for narrowand wide characters. 27.3.1 [iosfwd.syn]: […] template<class charT> class char_traits; template<> class char_traits<char>; template<> class char_traits<char16_t>; template<> class char_traits<char32_t>; template<> class char_traits<wchar_t>; […] template<class state> class fpos; using streampos = fpos<char_traits<char>::state_type>; using wstreampos = fpos<char_traits<wchar_t>::state_type>; […] Change in 27.11.4 [fs.req] paragraph 1: Throughout this subclause, char, wchar_t, char16_t, and char32_t are collectively called encoded character types. Change in 27.11.5 [fs.filesystem.syn]: // 27.11.7.7.1, path factory functions template <class Source> path u8path(const Source& source); template <class InputIterator> path u8path(InputIterator first, InputIterator last); Drafting note: The deleted u8path factory functions have been deprecated and moved to annex D, [depr.fs.path.factory]. Change in 27.11.7 [fs.class.path] paragraph 6: […]; […] Change in 27.11.7.2.2 [fs.path.type.cvt] paragraph 1: The native encoding of a narrowcharacter string is the operating system dependent current encoding for pathnames (27.11.7). The native encoding for wide character strings is the implementation-defined execution wide-character set encoding (5.3). Change in 27.11.7.2.2 [fs.path.type.cvt] subparagraph (2.1): (2.1) — char: The encoding is the native narrowencoding. The method of conversion, if any, is operating system dependent. [ Note: For POSIX-based operating systems path::value_type is char so no conversion from char value type arguments or to char value type return values is performed. For Windows-based operating systems, the native narrowencoding is determined by calling a Windows API function. — end note ] [ Note: This results in behavior identical to other C and C++ standard library functions that perform file operations using narrowcharacter strings to identify paths. Changing this behavior would be surprising and error prone. — end note ] Add a new subparagraph after 27.11.7.2.2 [fs.path.type.cvt] subparagraph (2.2): (2.?) — char8_t: The encoding is UTF-8. The method of conversion is unspecified. Change in 27.11.7.4.1 [fs.path.construct] subparagraph (7.2): — Otherwise a conversion is performed using the codecvt<wchar_t, char, mbstate_t> facet of loc, and then a second conversion to the current narrowencoding. Drafting note: Is the requirement for a second conversion stated above correct? codecvt<wchar_t, char, mbstate_t> already converts to the ordinary character encoding. Change in 27.11.7.4.1 [fs.path.construct] paragraph 8: […] For POSIX-based operating systems, the path is constructed by first using latin1_facet to convert ISO/IEC 8859-1 encoded latin1_string to a wide character string in the native wide encoding (27.11.7.2.2). The resulting wide string is then converted to a narrowcharacter pathname string in the current native narrowencoding. If the native wide encoding is UTF-16 or UTF-32, and the current native narrowencoding is UTF-8, all of the characters in the ISO/IEC 8859-1 character set will be converted to their Unicode representation, but for other native narrowencodings some characters may have no representation. […] Change in 27.11.7.4.6 [fs.path.native.obs] paragraph 8: std::string string() const; std::wstring wstring() const; std:: stringu8string() const; std::u16string u16string() const; std::u32string u32string() const; Returns: native(). Change in 27.11.7.4.6 [fs.path.native.obs] paragraph 9: Remarks: Conversion, if any, is performed as specified by 27.11.7.2. The encoding of the string returned by u8string() is always UTF-8. Change in 27.11.7.4.7 [fs.path.generic.obs] paragraph 5: std::string generic_string() const; std::wstring generic_wstring() const; std:: stringgeneric_u8string() const; std::u16string generic_u16string() const; std::u32string generic_u32string() const; Returns: The pathname in the generic format. Change in 27.11.7.4.7 [fs.path.generic.obs] paragraph 6: Remarks: Conversion, if any, is specified by 27.11.7.2. The encoding of the string returned by generic_u8string() is always UTF-8. Remove subclause 27.11.7.7.1 [fs.path.factory]. template<class Source> path u8path(const Source& source); template<class InputIterator> path u8path(InputIterator first, InputIterator last); Drafting note: The u8path factory function templates have been deprecated and moved to annex D, [depr.fs.path.factory]. Change in 29.2 [atomics.syn]: […] // [atomics.lockfree], lock-free property #define ATOMIC_BOOL_LOCK_FREE unspecified #define ATOMIC_CHAR_LOCK_FREE unspecified #define ATOMIC_CHAR16_T_LOCK_FREE unspecified #define ATOMIC_CHAR32_T_LOCK_FREE unspecified #define ATOMIC_WCHAR_T_LOCK_FREE unspecified […] using atomic_ullong = atomic<unsigned long long>; using atomic_char16_t = atomic<char16_t>; using atomic_char32_t = atomic<char32_t>; using atomic_wchar_t = atomic<wchar_t>; Change in 29.5 [atomics.lockfree]: #define ATOMIC_BOOL_LOCK_FREE unspecified #define ATOMIC_CHAR_LOCK_FREE unspecified #define ATOMIC_CHAR16_T_LOCK_FREE unspecified #define ATOMIC_CHAR32_T_LOCK_FREE unspecified #define ATOMIC_WCHAR_T_LOCK_FREE unspecified […] Change in 29.6.2 [atomics.ref.int] paragraph 1: There are specializations of the atomic_ref 29.7.2 [atomics.types.int] paragraph 1: There are specializations of the atomic A.6 [gram.dcl]: […] simple-type-specifier: […] char char16_t char32_t wchar_t […] […] Change in C.1.1 [diff.lex] paragraph 3: […] Affected subclause: 5.13.5 Change: String literals made const. The type of a string literal is changed from "array of char" to "array of const char". The type of a char16_t string literal is changed from "array of some-integer-type" to "array of const char16_t". The type of a char32_t string literal is changed from "array of some-integer-type" to "array of const char32_t". The type of a wide string literal is changed from "array of wchar_t" to "array of const wchar_t". […] Change in C.5.1 [diff.cpp17.lex] paragraph 1: Affected subclause: 5.11 Change: New keywords Rationale: Required for new features. The requires keyword is added to introduce constraints through a requires-clause or a requires-expression. The concept keyword is added to enable the definition of concepts (12.6.8). Effect on original feature: Valid ISO C++ 2017 code using concept orrequires as an identifier is not valid in this International Standard. Add a new paragraph to C.5.1 [diff.cpp17.lex]: Affected subclause: 5.13 Change: Type of UTF-8 string and character literals. Rationale: Required for new features. The changed types enable function overloading, template specialization, and type deduction to distinguish ordinary and UTF-8 string and character literals. Effect on original feature: Valid ISO C++ 2017 code that depends on UTF-8 string literals having type "array of const char" and UTF-8 character literals having type "char" is not valid in this International Standard. const auto *u8s = u8"text"; // u8s previously deduced as const char *; now deduced as const char8_t *. const char *ps = u8s; // ill-formed; previously well-formed. auto u8c = u8'c'; // u8c previously deduced as char; now deduced as char8_t. char *pc = &u8c; // ill-formed; previously well-formed. std::string s = u8"text"; // ill-formed; previously well-formed. void f(const char *s); f(u8"text"); // ill-formed; previously well-formed. template<typename> struct ct; template<> struct ct<char> { using type = char; }; ct<decltype(u8'c')>::type x; // ill-formed; previously well-formed. Add a new subclause after C.5.8 [diff.cpp17.containers]: C.5.? [input.output]: Input/output library [diff.cpp17.input.output] Affected subclause: 27.11.7 Change: Return type of filesystem path format observer member functions. Rationale: Required for new features. Effect on original feature: Valid ISO C++ 2017 code that depends on the u8string() and generic_u8string() member functions of std::filesystem::path returning std::string is not valid in this International Standard. std::filesystem::path p; std::string s1 = p.u8string(); // ill-formed; previously well-formed. std::string s2 = p.generic_u8string(); // ill-formed; previously well-formed. Add a new subclause after D.14 [depr.conversions]: D.?? Deprecated locale category facets [depr.locale.category] Add another new subclause after D.14 [depr.conversions]: D.?? Deprecated filesystem path factory functions [depr.fs.path.factory] Drafting note: The contents of paragraph 1 correspond to the text removed from [fs.filesystem.syn]. The contents of paragraphs 2-5 correspond to the text removed from [fs.path.factory] Michael Spencer and Davide C. C. Italiano first proposed adding a new char8_t fundamental type in P0372R0 [P0372R0]. Thanks to Alisdair Meredith for reviewing wording and providing feedback in advance of the Rapperswil meeting. Thanks to Tim Song and Casey Carter for further "paper of the week" wording review prior to San Diego.
http://www.open-std.org/JTC1/SC22/wg21/docs/papers/2018/p0482r5.html
CC-MAIN-2019-47
en
refinedweb
Django utility for a memoization decorator that uses the Django cache framework. Project description Django utility for a memoization decorator that uses the Django cache framework. Key Features - Memoized function calls can be invalidated. - Works with non-trivial arguments and keyword arguments - Insight into cache hits and cache missed with a callback. - Ability to use as a “guard” for repeated execution when storing the function result isn’t important or needed. Installation pip install django-cache-memoize Usage # Import the decorator from cache_memoize import cache_memoize # Attach decorator to cacheable function with a timeout of 100 seconds. @cache_memoize(100) def expensive_function(start, end): return random.randint(start, end) # Just a regular Django view def myview(request): # If you run this view repeatedly you'll get the same # output every time for 100 seconds. return http.HttpResponse(str(expensive_function(0, 100))) The caching uses Django’s default cache framework. Ultimately, it calls django.core.cache.cache.set(cache_key, function_out, expiration). So if you have a function that returns something that can’t be pickled and cached it won’t work..) See documentation. Advanced Usage args_rewrite Internally the decorator rewrites every argument and keyword argument to the function it wraps into a concatenated string. The first thing you might want to do is help the decorator rewrite the arguments to something more suitable as a cache key string. For example, suppose you have instances of a class whose __str__ method doesn’t return a unique value. For example: class Record(models.Model): name = models.CharField(max_length=100) lastname = models.CharField(max_length=100) friends = models.ManyToManyField(SomeOtherModel) def __str__(self): return self.name # Example use: >>> record = Record.objects.create(name='Peter', lastname='Bengtsson') >>> print(record) Peter >>> record2 = Record.objects.create(name='Peter', lastname='Different') >>> print(record2) Peter This is a contrived example, but basically you know that the str() conversion of certain arguments isn’t safe. Then you can pass in a callable called args_rewrite. It gets the same positional and keyword arguments as the function you’re decorating. Here’s an example implementation: from cache_memoize import cache_memoize def count_friends_args_rewrite(record): # The 'id' is always unique. Use that instead of the default __str__ return record.id @cache_memoize(100, args_rewrite=count_friends_args_rewrite) def count_friends(record): # Assume this is an expensive function that can be memoize cached. return record.friends.all().count() prefix By default the prefix becomes the name of the function. Consider: from cache_memoize import cache_memoize @cache_memoize(10, prefix='randomness') def function1(): return random.random() @cache_memoize(10, prefix='randomness') def function2(): # different name, same arguments, same functionality return random.random() # Example use >>> function1() 0.39403406043780986 >>> function1() 0.39403406043780986 >>> # ^ repeated of course >>> function2() 0.39403406043780986 >>> # ^ because the prefix was forcibly the same, the cache key is the same hit_callable If set, a function that gets called with the original argument and keyword arguments if the cache was able to find and return a cache hit. For example, suppose you want to tell your statsd server every time there’s a cache hit. from cache_memoize import cache_memoize def _cache_hit(user, **kwargs): statsdthing.incr(f'cachehit:{user.id}', 1) @cache_memoize(10, hit_callable=_cache_hit) def calculate_tax(user, tax=0.1): return ... miss_callable Exact same functionality as hit_callable except the obvious difference that it gets called if it was not a cache hit. store_result This is useful if you have a function you want to make sure only gets called once per timeout expiration but you don’t actually care that much about what the function return value was. Perhaps because you know that the function returns something that would quickly fill up your memcached or perhaps you know it returns something that can’t be pickled. Then you can set store_result to False. from cache_memoize import cache_memoize @cache_memoize(1000, store_result=False) def send_tax_returns(user): # something something time consuming ... return some_none_pickleable_thing def myview(request): # View this view as much as you like the 'send_tax_returns' function # won't be called more than once every 1000 seconds. send_tax_returns(request.user) Cache invalidation When you want to “undo” some caching done, you simple call the function again with the same arguments except you add .invalidate to the function. from cache_memoize import cache_memoize @cache_memoize(10) def expensive_function(start, end): return random.randint(start, end) >>> expensive_function(1, 100) 65 >>> expensive_function(1, 100) 65 >>> expensive_function(100, 200) 121 >>> exensive_function.invalidate(1, 200) >>> expensive_function(1, 100) 89 >>> expensive_function(100, 200) 121 An “alias” of doing the same thing is to pass a keyword argument called _refresh=True. Like this: # Continuing from the code block above >>> expensive_function(100, 200) 121 >>> expensive_function(100, 200, _refresh=True) 177 >>> expensive_function(100, 200) 177 There is no way to clear more than one cache key. In the above example, you had to know the “original arguments” when you wanted to invalidate the cache. There is no method “search” for all cache keys that match a certain pattern. Compatibility - Python 2.7, 3.4, 3.5, 3.6 - Django 1.8, 1.9, 1.10, 1.11 Check out the tox.ini file for more up-to-date compatibility by test coverage. Prior Art History Mozilla Symbol Server is written in Django. It’s a web service that sits between C++ debuggers and AWS S3. It shuffles symbol files in and out of AWS S3. Symbol files are for C++ (and other compiled languages) what sourcemaps are for JavaScript. This service gets a LOT of traffic. The download traffic (proxying requests for symbols in S3) gets about ~40 requests per second. Due to the nature of the application most of these GETs result in a 404 Not Found but instead of asking AWS S3 for every single file, these lookups are cached in a highly configured Redis configuration. This Redis cache is also connected to the part of the code that uploads new files. New uploads are arriving as zip file bundles of files, from Mozilla’s build systems, at a rate of about 600MB every minute, each containing on average about 100 files each. When a new upload comes in we need to quickly be able find out if it exists in S3 and this gets cached since often the same files are repeated in different uploads. But when a file does get uploaded into S3 we need to quickly and confidently invalidate any local caches. That way you get to keep a really aggressive cache without any stale periods. This is the use case django-cache-memoize was built for and tested in. It was originally written for Python 3.6 in Django 1.11 but when extracted, made compatible with Python 2.7 and as far back as Django 1.8. django-cache-memoize is also used in SongSear.ch to cache short queries in the autocomplete search input. All autocomplete is done by Elasticsearch, which is amazingly fast, but not as fast as memcached. “Competition” There is already django-memoize by Thomas Vavrys. It too is available as a memoization decorator you use in Django. And it uses the default cache framework as a storage. It used inspect on the decorated function to build a cache key. In benchmarks running both django-memoize and django-cache-memoize I found django-cache-memoize to be ~4 times faster on average. Another key difference is that django-cache-memoize uses str() and django-memoize uses repr() which in certain cases of mutable objects (e.g. class instances) as arguments the caching will not work. For example, this does not work in django-memoize: from memoize import memoize @memoize(60) def count_user_groups(user): return user.groups.all().count() def myview(request): # this will never be memoized print(count_user_groups(request.user)) However, this works… from cache_memoize import cache_memoize @cache_memoize(60) def count_user_groups(user): return user.groups.all().count() def myview(request): # this *will* work as expected print(count_user_groups(request.user)) 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/django-cache-memoize/
CC-MAIN-2018-22
en
refinedweb
Interface to connect the parser with the registry and more. More... #include "clang/ASTMatchers/Dynamic/Parser.h" Interface to connect the parser with the registry and more. The parser uses the Sema instance passed into parseMatcherExpression() to handle all matcher tokens. The simplest processor implementation would simply call into the registry to create the matchers. However, a more complex processor might decide to intercept the matcher creation and do some extra work. For example, it could apply some transformation to the matcher by adding some id() nodes, or could detect specific matcher nodes for more efficient lookup. Definition at line 68 of file Parser.h. Process a matcher expression. All the arguments passed here have already been processed. Errorwill contain a description of the error. Implemented in clang::ast_matchers::dynamic::Parser::RegistrySema.. Reimplemented in clang::ast_matchers::dynamic::Parser::RegistrySema. Definition at line 303 of file Parser.cpp. Compute the list of completions that match any of AcceptedTypes. lookupMatcherCtor(). The matcher constructed from the return of lookupMatcherCtor()should be convertible to some type in AcceptedTypes. Reimplemented in clang::ast_matchers::dynamic::Parser::RegistrySema. Definition at line 309 of file Parser.cpp. Look up a matcher by name. Implemented in clang::ast_matchers::dynamic::Parser::RegistrySema.
http://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1dynamic_1_1Parser_1_1Sema.html
CC-MAIN-2018-22
en
refinedweb
Represents a 'co_return' statement in the C++ Coroutines TS. More... #include "clang/AST/StmtCXX.h" Represents a 'co_return' statement in the C++ Coroutines TS. This statament models the initialization of the coroutine promise (encapsulating the eventual notional return value) from an expression (or braced-init-list), followed by termination of the coroutine. This initialization is modeled by the evaluation of the operand followed by a call to one of: <promise>.return_value(<operand>) <promise>.return_void() which we name the "promise call". Definition at line 432 of file StmtCXX.h. Definition at line 480 of file StmtCXX.h. References clang::Stmt::getStmtClass(). Definition at line 469 of file StmtCXX.h. References clang::CXXCatchStmt::getLocStart().
https://clang.llvm.org/doxygen/classclang_1_1CoreturnStmt.html
CC-MAIN-2018-22
en
refinedweb
To wit: Notepad is opened, the font selected as "Arial, Size 11", the words "this is just a test" carefully entered, a screenshot taken: The following Python code is entered and run: import ImageFont, ImageDraw, Image im = Image.open("c:/textimg.png") #the above image pilfont = ImageFont.truetype("arial.ttf", 11) compimg = Image.new("RGB", im.size, (255, 255, 255)) draw = ImageDraw.Draw(compimg) draw.text((0,0), "this is just a test", (0,0,0), font=pilfont) compimg.save("c:/compimg.png") pygfont = pygame.font.Font(r"c:\windows\fonts\arial.ttf", 15) surf = pygfont.render("this is just a test", False, (0,0,0), (255,255,255)) pygame.image.save(surf, r"c:\pygameimg.png") Font rendering is a complex and subtle process, and one that has been implemented a number of times. In your case, PIL and Windows look different because they are using completely different font rendering engines. Windows uses its built-in rendering, and PIL is using the Freetype it was compiled with. I don't know how each environment interprets its "size" parameter, but even if you get them interpreted the same, the rendering will simply be different. The way to get the same pixels as Notepad is to launch Notepad and grab the screen. Perhaps if you explain more about why you want the same rendering as Notepad, we'll have creative solutions to your problem.
https://codedump.io/share/Mr0jD6DYKI64/1/why-is-my-truetype-font-of-size-11-rendering-different-than-windows
CC-MAIN-2018-22
en
refinedweb
A dart package with many country flag icons This packages gives you the ability to use the icons via new Image.asset('icons/flags/xx.png', package: 'country_icons'); Flags are used from hjnilsson Repo: Homepage: Add this to your package's pubspec.yaml file: dependencies: country_icons: "^0.0.2" You can install packages from the command line: with Flutter: $ flutter packages get Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more. Now in your Dart code, you can use: import 'package:country_icons/country_icons country_icons.dart.
https://pub.dartlang.org/packages/country_icons
CC-MAIN-2018-22
en
refinedweb
ZeroVM theme for Sphinx Project description This package bundles the ZeroVM theme for Sphinx. Install the package and add this to your conf.py: import zerovm_sphinx_theme html_theme_path = [zerovm_sphinx_theme.theme_path] html_theme = 'zerovm' That will configure the theme path correctly and activate the theme. Changelog - 1.1 (2014-03-28): - Version 1.0 did not work since README.rst wasn’t distributed. - 1.0 (2014-03-28): - First release. 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/zerovm-sphinx-theme/
CC-MAIN-2018-22
en
refinedweb
Hey C++ Programmers... I am by classes and now i have an question yet.... here comes my question: - How do i import classes from another folder scripts or another script into an main script ?... This is my first stript, called Main.cpp (from an "Dev C++ Project File (not source file))": Script: Module WhileLoops / Main.cpp.. ..Code:// Module Project / Main.cpp #include <iostream> #include <string> using namespace std; int main() { DoLoop Obj; Obj.Input(0, 100, 5); return 0; } So in this script, i want to import my second script, called CPP Project / Folder / Loops.cpp... Now i get my second script, thad i want import them in my first script (CPP Project / Main.cpp), the second script are in the folder... Script: Module WhileLoops / Scripts / Loops.cpp (Scripts is the folder in my .cpp project file, called where i get the script, named Loops.cpp: Code:// Module Project / Folder / Loops.cpp #include <iostream> #include <string> using namespace std; class DoLoop { public: void Input (int number_min, int number_reapet, int number_step) { while (number_min < number_reapet) { cout << number_min << endl; number_min = number_min + number_step; } } void InputName (int number_min, int number_reapet, int number_step, string name) { while (number_min < number_reapet) { cout << name << number_min << endl; number_min = number_min + number_step; } } private: int number_start, number_case, number_step; string name; }; I have no idea, how i can import classes from another script (called CPP Project > Folder / Loops.cpp), into my main script (called CPP Project > Main.cpp) yet.... So can anyone give my correct my code, just to import my "Folder / Loops.cpp" Classes Function(s) into my Main.cpp Script, just i hope learn about this ?.... and i know, i must do some lessions again about my too fast learn process yet... i think if i am already finnished with my cursus on my SoloLearn app, i do search for tutorials and so i want to do some lessions again yet... Can anyone help me to learn import multiple scripts called with classes, just correct my code or give my an example pleace ?..., thanks for help, Jamie.
http://forums.devshed.com/programming/980564-dev-project-file-multiple-scripts-import-post2985347.html
CC-MAIN-2018-22
en
refinedweb
I. Objective: Simple 1-layer multi layer perceptron (MLP). f is the activation function and introduces the non-linearity to our system. II. Linear Model: A simple linear model with a softmax layer on top. The main difference here is the lack of a non-linear activation function (ReLU, tanh, etc.). Thanks to Karpathy for the data and code structure, but we will break down the math behind the lines for better understanding. You can check out the code for loading the data on the Github repo but here we will focus on the main model operations. # Class scores [NXC] logits = np.dot(X,*W) # Backpropagation dscores = probs dscores[range(len(probs)), y] -= 1 dscores /= config.DATA_SIZE dW = np.dot(X.T, dscores) dW += config.REG*W W += -config.LEARNING_RATE * dW Results: We can see that the decision boundary of our classifier is linear and cannot adapt to the non-linear contortions of the data. III. Neural Network: Now we introduce a neural net with a softmax on the last layer for class probabilities. We use a ReLU unit to introduce non-linearity. Our network will have two layers, where the shape of the input will be manipulated as follows: Once again, let’s break down the code. z_2 = np.dot(X, W_1) a_2 = np.maximum(0, z_2) # ReLU logits = np.dot(a_2, W_1*W_1) loss += 0.5 * config.REG * np.sum(W_2*W_2) # Backpropagation dscores = probs dscores[range(len(probs)), y] -= 1 dscores /= config.DATA_SIZE dW2 = np.dot(a_2.T, dscores) dhidden = np.dot(dscores, W_2.T) dhidden[a_2 &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;= 0] = 0 # ReLu backprop dW1 = np.dot(X.T, dhidden) dW2 += config.REG * W_2 dW1 += config.REG * W_1 W_1 += -config.LEARNING_RATE * dW1 W_2 += -config.LEARNING_RATE * dW2 Our accuracy is very simple and involves doing the forward pass and then comparing the predicted class with the target class. def accuracy(X, y, W_1, W_2=None): logits = np.dot(X, W_1) if W_2 is None: predicted_class = np.argmax(logits, axis=1) print "Accuracy: %.3f" % (np.mean(predicted_class == y)) else: z_2 = np.dot(X, W_1) a_2 = np.maximum(0, z_2) logits = np.dot(a_2, W_2) predicted_class = np.argmax(logits, axis=1) print "Accuracy: %.3f" % (np.mean(predicted_class == y)) Results: The resulting decision boundary is able to classify the non-linear data really well. IV. Tensorflow Implementation: We will start by setting up our tensorflow model but we will have an extra function called summarize() which will store the progress as we training through the epochs. We will decide which values to store with tf.scalar_summary() so we can see the changes later. def create_model(sess, FLAGS): model = mlp(FLAGS.DIMENSIONS, FLAGS.NUM_HIDDEN_UNITS, FLAGS.NUM_CLASSES, FLAGS.REG, FLAGS.LEARNING_RATE) sess.run(tf.initialize_all_variables()) return model class mlp(object): def __init__(self, input_dimensions, num_hidden_units, num_classes, regularization, learning_rate): # Placeholders self.X = tf.placeholder("float", [None, None]) self.y = tf.placeholder("float", [None, None]) # Weights W1 = tf.Variable(tf.random_normal( [input_dimensions, num_hidden_units], stddev=0.01), "W1") W2 = tf.Variable(tf.random_normal( [num_hidden_units, num_classes], stddev=0.01), "W2") with tf.name_scope('forward_pass') as scope: z_2 = tf.matmul(self.X, W1) a_2 = tf.nn.relu(z_2) self.logits = tf.matmul(a_2, W2) # Add summary ops to collect data W_1 = tf.histogram_summary("W1", W1) W_2 = tf.histogram_summary("W2", W2) with tf.name_scope('cost') as scope: self.cost = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(self.logits, self.y)) \ + 0.5 * regularization * tf.reduce_sum(W1*W1) \ + 0.5 * regularization * tf.reduce_sum(W2*W2) tf.scalar_summary("cost", self.cost) with tf.name_scope('train') as scope: self.optimizer = tf.train.AdamOptimizer( learning_rate=learning_rate).minimize(self.cost) def step(self, sess, batch_X, batch_y): input_feed = {self.X: batch_X, self.y: batch_y} output_feed = [self.logits, self.cost, self.optimizer] outputs = sess.run(output_feed, input_feed) return outputs[0], outputs[1], outputs[2] def summarize(self, sess, batch_X, batch_y): # Merge all summaries into a single operator merged_summary_op = tf.merge_all_summaries() return sess.run(merged_summary_op, feed_dict={self.X:batch_X, self.y:batch_y}) Then we will train for several epochs and save the summary each time. def train(FLAGS): # Load the data FLAGS, X, y = load_data(FLAGS) with tf.Session() as sess: model = create_model(sess, FLAGS) summary_writer = tf.train.SummaryWriter( FLAGS.TENSORBOARD_DIR, graph=sess.graph) # y to categorical Y = tf.one_hot(y, FLAGS.NUM_CLASSES).eval() for epoch_num in range(FLAGS.NUM_EPOCHS): logits, training_loss, _ = model.step(sess, X, Y) # Display if epoch_num%FLAGS.DISPLAY_STEP == 0: print "EPOCH %i: \n Training loss: %.3f, Accuracy: %.3f" \ % (epoch_num, training_loss, np.mean(np.argmax(logits, 1) == y)) # Write logs for each epoch_num summary_str = model.summarize(sess, X, Y) summary_writer.add_summary(summary_str, epoch_num) if __name__ == '__main__': FLAGS = parameters() train(FLAGS) Finally, we can view our training progress using: $ tensorboard --logdir=logs and then heading over to on your browser to view the results. Here are a few: Extras (DropOut and DropConnect): There are many add on techniques to this vanilla neural network that works to increase optimization, robustness and overall performance. We will be convering many of them in future posts but I will briefly talk about a very common regularization technique: dropout. What is it? Dropout is a regularization technique that allows us to nullify the outputs of certain neurons to zero. This will effectively be the same as the neuron not existing in the network. We will do this for p% of the total neurons in each layer and for each batch, a new p% of the neurons in each layer are “dropped”. Why do we do this? It works out to be a great regularization technique because for each input batch, we are sampling from a different neural net since a whole new set of neurons are dropped. By repeating this, we are preventing the units from co-adapting too much to the data. The original paper describes each iteration as a “thinned” network because p% of the neurons are dropped. Note: Dropout is only for training time. At test time, we will not be dropping any neurons. In the image above, the layer has p=0.5 which means half of it’s units are dropped. In an other iteration, a different set of 1/2 of the neurons will be dropped. Let’s take a look at masking code to really understand what’s happening. We use a Bernoulli distribution to generation 0/1 with probability p for 0. We apply this mask to the outputs from our layer. The parts that are multiplied by zero are our “dropped” neurons since they will yield an output of 0 when multiplied by the next set of weights. Another regularization method, which is an extension of dropout, is dropconnect. It also involves a similar mechanism but is applied to the weights instead. Notice that here, a set of weights are dropped instead of the neurons. We apply a similar bernoulli mask to the weights and we use those weights for the layers. Any inputs that are dot producted with the zeroed weights will result in 0. You can see the similarity with dropout and so, empirically, both techniques offer similar results. Dropconnect was proposed because you always have more weights than neurons, so there are more ways to create “thinned” models thus results in more robust training. However, in more papers you will see mostly dropout being utilized and very rarely drop connect since results are similar. You can read more about dropout here and dropconnect here. V. Raw Code: GitHub Repo (Updating all repos, will be back up soon!) 2 thoughts on “Vanilla Neural Network” One of the most succinct and clearest NN guides I’ve seen so far, great material LikeLiked by 1 person Thanks 😀 made it for myself initially just to be able to look at it and recall everything quickly
https://theneuralperspective.com/2016/10/02/03-vanilla-neural-network/
CC-MAIN-2018-22
en
refinedweb
Details Description I have a template that references a List returned by a method on an Enum. The method is defined as an abstract member of the enum. This used to work on 1.4, but doesn't work on 1.6.1 I'm able to get it to work on 1.6.1 by changing the abstract method to a regular method of the Enum, which is then overridden by each instance of the enum. Here's the code that doesn't work. Again, it seems to be the abstract modifier, becuase if I change that method to something like public List getMyList(){ return new ArrayList(); } And then just override it in my enum instances, everything works fine. public enum Thing { NUMBER_ONE( ){ public List<String> getInnerThings() { //initialize innerThings if this is first time if ( this.innerThings == null ) return innerThings; } }, NUMBER_TWO( ){ public List<String> getinnerThings() { //initialize innerThings if this is first time if ( this.innerThings == null ) { innerThings = new ArrayList<String>(); innerThings.add( "blah blah" ); innerThings.add("blah blah" ); } return innerThings; } }, NUMBER_THREE( ){ public List<String> getinnerThings() { if ( this.innerThings == null ) return innerThings; } }; List<String> innerThings; //This was an abstract method, but Velocity 1.6 quite working with it. public abstract List<String> getinnerThings(); } Activity - All - Work Log - History - Activity - Transitions scratch that. ClassMap explicitly skipping abstract methods, ostensibly because their implementations would be found, forgetting that the implementing class might not be public. easy fix. Fixed in all revisions. Er... i meant "versions". The trouble seems to be with abstract public methods declared in abstract classes and implemented in non-public classes. An enum class with an abstract public method shows this, but it also happens with things like: public abstract Foo{ public abstract String getBar(); } Foo foo = new Foo() { public String getBar(){ return "bar"; } }; I think this worked in Velocity 1.4 because the ClassMap implementation was based off of Class.getMethods, whereas it was changed to Class.getDeclaredMethods in 1.5 to speed things up. Calling getDeclaredMethods on Foo doesn't return getBar, which is surprising as the declaration is right there. I haven't yet figured out how i want to fix this.
https://issues.apache.org/jira/browse/VELOCITY-701
CC-MAIN-2015-48
en
refinedweb
Some. For each test case output whether the permutation is ambiguous or not. Adhere to the format shown in the sample output. 4 1 4 3 2 5 2 3 4 5 1 1 1 0 ambiguous not ambiguous ambiguous when i press submit button its giving the requested page could not be found...... whats wrong??? the submit page is stilll not found anshuman, don't worry about that error. It doesn't acutally affect your submission. it seems like no one got any problem with this problem...but i can't get the problem. can someone pls explain what these different permutations actually are? The statement itself explains pretty clearly.. what line don't you understand exactly? how are the ambiguous permutation and the inverse permutation similar? i know i'll feel stupid after reading the reply. You mean this line from above? You create a list of numbers where the i-th number is the position of the integer i in the permutation. Let us call this second possibility an inverse permutation. can you give an example showing a permutation ,its inverse permutation and an ambiguous permutation similar to that? a different example from one given above pls. someone? Original permutation = 1 3 2 4 It's inverse permutation is 1 3 2 4 and so it is ambiguous. If Original permutation was 1 4 2 3, its inverse would be 1 3 4 2 and it would be non ambiguous. The sample input and output arnt clear.......if possible someone can help me out. hello all, plz help me.m gttng right answer on my computer.But when I submit it says wrong answer. Heres my code #include<iostream>using namespace std;int main(){ int n,i=0,flag=0; cin>>n; if(n!=0) { int *A=new int(n+1); int *B=new int(n+1); for(i=1;i<=n;i++) { cin>>A[i]; } for(i=1;i<=n;i++) B[A[i]]=i; for(i=1;i<=n;i++) if(A[i]!=B[i]) { flag=1; break; } if(flag==1) cout<<"not ambiguousn"; else cout<<"ambiguousn"; } return 0;} i hv checked my code with the condition"There is exactly one space character between consecutive integers.". bt still gttng wrong answer. plz help my code is working properly on comp.. but m getting runtime error here.. can anyone help me out plz. You are declaring far too much memory (200000 longs) on the stack. Use heap memory instead (ie declare them globally). I have applied all sort of algorithm for execution efficiency.! Still its shows 'time limit exceeded' whats wrong with my code?[python] def qsort(L): if L == []: return [] return qsort([x for x in L[1:] if x< L[0]]) + L[0:1] + qsort([x for x in L[1:] if x>=L[0]])n=input()arr=[]for i in range(n): arr.append(input())arr=qsort(arr)for i in arr: print i got it!!!!!!! what is wrong with sample input 2inputs and 3 outputs Nothing is wrong with the sample input. There are 3 inputs. hey dude what is the flaw in this code? plzz let me know... #include<iostream>using namespace std;int y;int a[100001][100001];int b[100001][100001];void algo(int a[][100001],int y){int count =0; for(int i=1;i<a[y][0];i++){ if(a[y][i]!=b[y][i]){ count =-1; break; }} if(count==-1){ cout<<"not ambiguous"<<endl; } else{ cout<<"ambiguous"<<endl; } }int main(){int z;y=0;while(cin>>z && z!=0){ a[y][0]=z; int t; for(int i=1;i<=z;i++){ cin>>t; a[y][i]=t; b[y][t]=i; } y++;}for(int i=0;i<y;i++){ algo(a,i);} // system("pause"); return 0;} @prashant You have declared too big arrays and moreover int z cannot store 10^5. i am getting run time error while the code runs fine on my system.... how can i get where's the error?? how to declare large long int arrays that can hold integers prescribed in the problem.... please help!!!! I have declared array containing the permutation like this long int *A=new long int(100005); GLOBALLY. and am appending a string with the appropriate strings after checking for the required condition. what could be the problem? That isn't an array at all. Did you mean to use square brackets, ie [100005]? Also, you really shouldn't be using cin/cout or waiting until the very end to output results. See the FAQ. i meant to say that this is how i declare the storage for the permutation. Is this okay?? as this can be used as an array i misnamed it as array. I could not understand what do u mean by " you really shouldn't be using cin/cout or waiting until the very end to output results". can u please where in FAQ you wanted me to direct? Just print out each result as you process it, rather than adding it to a string and waiting until the very end. And no, that is not a correct way of declaring memory as I mentioned. I have tried my program on my computer with a certain number of test cases and its working fine. But here it says wrong answer. Here is my code: //PERMUT2 #include<stdio.h> #include<stdlib.h> #define SIZE 65536 int main() { unsigned int i, num[SIZE], t, test; scanf("%d", &t); for(i=0;i<t;i++) { scanf("%d", &num[i]); } if(num[i]==i+1) test=1; else test=0; if(test) printf("ambiguousn"); else printf("not ambiguousn"); return 0; } What made you choose the number 65536? Read the problem statemenr. the code is working fine with my laptop but not here..can any body help me to figure out the problem plzzzzz #include<iostream>using namespace std;int main(){ int n; int cntr=0; cin>>n; int a[n+1],b[n+1],c[n+1]; for(int i=1;i<=n;i++){ cin>>a[i]; b[i]=i; } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(a[j]==i){ c[i]=b[j]; } } } for(int i=1;i<=n;i++){ if(c[i]==a[i]){cntr++;} } cout<<endl; if(n!=0){ if(cntr==n){cout<<"ambiguous";} else{cout<<"not ambiguous";} } return 0;} @sukhmeet u consider only one input case at a time but there r several input case at a time.. u need to take input till value of n is not equal to zero... read input/output format given in question again.. thanks devendra, really bad eye of me. but now it says Time limit exceeded. I think rather than going for n^2 complexity I should try something faster.What say !!! let c... thnaks again btw getting wrong answer for this code which seem to work fine with my inputs. Please suggest a case where it dosen't. #define no_of_tests 100 int main(){ long unsigned int a=0,b=0,c=0,index=1,num=0; char arr[no_of_tests],str[10]; int i,count=0; while(1) gets(str); if(str[0]==' ') continue; for(i=0;str[i]!=' ';i++) c=10*c+(str[i]-'0'); if(c==0) break; for(i=1;i<=c;i++) a=0; while(fread(str,1,1,stdin)) if(str[0]=='1'||str[0]=='2'||str[0]=='3'||str[0]=='4'||str[0]=='5'||str[0]=='6'||str[0]=='7'||str[0]=='8'||str[0]=='9'||str[0]=='0') a=10*a+(str[0]-'0'); else break; if(index>a) b=b^index; num=num^a; else if(a>index) b=b^a; num=num^index; index++; if(b==0&&num==0) arr[count]='a'; else arr[count]='u'; b=0; num=0 ; index=1; count++; c=0; for(i=0;i<count;i++) if(arr[i]=='u') printf("not ambiguousn"); printf("ambiguousn"); Dear Admin My program is working properly. I satsified all the limititing conditions as well. But still when i am submitting it, it is showing wrong. I couldn't find where the problem is can you please help me out. ^ Did you test your program on the sample input (the complete sample input) ?? Is the output from your program 'exactly' like its supposed to be ? yes i checked for the complete sample input, the output is exactly like its supposed to be Are you sure ?? ... output for each test case is on a new line, your program does that ? yes @Admin - Same problem - Correct on sample input, but says wrong answer.. I've declared all variables as long int in C++.. All outputs are on new line; please let me know where I have gone wrong.. BTW my complexity is n and not n^2 ! :-) .. Your code gives the wrong answer on the majority of inputs; it was lucky to pass the sample input. Giving you a test case would make things far too easy, but note that in order to be ambiguous the inverse permutation must have every element identical to the initial permutation. Oh thanks Stephen, got it running.. @Stephen-my solution times out... any hints..plz.. ? n can be up to 100000. Two nested loops up to 100000 has no chance of running in time. I'm afraid you'll have to think of a completely new idea. @Stephen- yup..i got AC finally..the problem was exactly what you pointed out..i managed to put it in one loop.. thnx :) #define MAX 100001 #include<ctype.h> int str_len,str_len2; char temp[MAX]; char arr[MAX]; int len = 1; int var,var2; int value; int main(void) temp[0]= ' '; while( len > 0 && len <= 100000) int i=1; int flag=1; scanf("%d",&len); if(len == 0) fflush(stdin); fgets(arr,MAX,stdin); str_len = strlen(arr); for(var = 0; var<str_len-1; var++) if(!(isspace(arr[var]))) temp[i]=arr[var]; i++; str_len2 = strlen(temp); for(var2 = 1; var2 < str_len2; var2++) value = (temp[var2]-48); if((temp[value]-48) != var2) flag = 0; if(flag) Can someone plz simplify thils question. How do we get inverse permutations? I am getting Runtime Error..Please Someone HELP!! @Vidura Yashan: Maybe you can read this article this program is providing the expected output as given according to sample input and question logic,but i am getting always wrong answer response.If it is wrong then please provide the specific error description. #include<malloc.h> unsigned long n,*in,*inv,i; int flag; do flag=1; scanf("%lu",&n); in=(unsigned long *)malloc(sizeof(unsigned long)*n); inv=(unsigned long *)malloc(sizeof(unsigned long)*n); for(i=0;i<n;i++) scanf("%lu",&in[i]); if(in[i]>n) i--; inv[in[i]-1]=i+1; if(in[i]!=inv[i]) { flag=0; if(flag==0) printf("not ambiguous"); else if(flag==1&&n!=0) printf("ambiguous"); free(in); free(inv); }while(n!=0); return 0; It doesn't even give the right answer for the sample input. Read the FAQ if you do not know how to test your code properly. is out of memory a compile error??? #include<iostream> using namespace std; { unsigned int num[100000], per[100000]; float n; while(1) { cin>>n; if(n==0) break; for(float i=;i<n;++i) cin>>num[i]; for(i=0;i<n;++i) per[num[i]]=i; int flag=0; if(num[i]!=per[i]) cout<<"ambiguous"<<endl; cout<<"not ambiguous"<<endl; will some1 please point out compile errror in my code!!! Anyone please explain me what is the meaning of "internal error in the system "... my code is running correctly on my PC.... what does this mean??? am confused!! Is there anything special that should be kept in mind for this problem? it seems preetty straightforward for me but can`t seem to find where my code could fail. Thx, SB. There's nothing special in the problem. Your method of reading an integer then trying to store it in a char seems pretty special to me though :) @ Stephan: Can you figure out where am I going wrong? Here's the code... import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n; String currentLine = null; while (in.hasNext()) { n = in.nextInt(); if (n == 0) { System.exit(0); } else { int[] a = new int[n+1]; for (int i=1; i<=n; i++){ a[i] = in.nextInt(); } if (isAmbiguous(n, a)) System.out.println("ambiguous"); System.out.println("not ambiguous"); public static boolean isAmbiguous(int n, int[] a){ boolean answer = false; if(n == 1){ if(a[1] != 1) answer = true; else if(n == 2){ if (! (a[1] == 1 && a[2] == 2)) if (! (a[1] == 2 && a[2] == 1)) else if(a[1] == 1 || a[n] == n) else if (a[1] == n){ for(int l = 2; l <= n; l++){ if(a[l] != (l - 1)){ else if (a[n] == n-1){ for(int m=2; m<=n; m++){ if(a[m] != (m+1)){ return answer; I'm a bit confused about the question. Do the original permutations have to be ordered (ie 2 has to have 1 and 3 on either side of it)? In other words, can there be input permutations like 1,5,2,4,3 or not? The problem defines a permutation as any ordering of the numbers 1 to N. Not just a few of them. I'm still confused. Can 1,5,2,4,3 be a potential permutation? From the examples it seems like it cannot but I just want to double check Yes, it can. There is nothing in the examples that says it cannot or puts any restriction on what permutations are allowed. long int a[100000],n,i; scanf("%ld",&n); if(n==0) for(i=0;i<n;i++) scanf("%ld",&a[i]); if(i+1!=a[a[i]-1]) if(i==n) printf("Ambiguousn"); printf("Not Ambiguousn"); If it were correct, it wouldn't say wrong answer. It says wrong answer, therefore it is incorrect. (In fact, it even fails on the sample input). I got Error ..... :) very lame part of me ! @ admin ...i get the right answer on my pic but get a wrong answer on code chef ..please check why those are not working? @admin I couldn't get the problem. "You create a list of numbers where the i-th number is the position of the integer i in the permutation." What does it mean and how did you create 5 1 2 3 4 from 2 3 4 5 1 ? @ stephen @admin m getting wrong answer please help#include<stdio.h>int a[100001];int main(){ int t,i; int n,c=0; scanf("%d",&t); while(t>0) { scanf("%d",&n); if(n==0) break; for(i=1;i<=n;i++) scanf("%d",&a[i]); for(i=1;i<=n;i++) { if(i==a[a[i]]||a[i]==i) c++; } if(c==n) printf("ambiguous"); else printf("not ambiguous"); t--; c=0; } return 0; } @admin see the following soln has been submitted successfully but mine with almost same logic is wrong..(in c++) main() { int n; int flag; while(n!=0) { cin>>n; flag=1; int a[n]; int b[n]; for( int i=1;i<=n;i++) { cin>>a[i]; } for( int i=1;i<=n;i++) b[a[i]]=i; for( int i=1;i<=n;i++) { if(a[i]!=b[i]) { flag=0; break; } } if(flag==1) { cout<<"ambiguous"<<endl; } else { cout<<"not ambiguous"<<endl; } } return 0; } will u please explain me why..?? whats wrong with code can anybody please xplain in deep how the inverse permutation is calculated, with xample? heylo,,, can some body plz look to my code and tell me the error coz m getting "wrong answer"....and for the test cases discussed here its working correctly... int n; int a[100001],b[100001]; int i,f; cin>>n; f=0; for(i=1;i<=n;i++) cin>>a[i]; b[a[i]]=i; if(a[i]!=b[i]) f=1; if(f==1) cout<<"not ambiguous"; cout<<"ambiguous";.
https://www.codechef.com/problems/PERMUT2/
CC-MAIN-2015-48
en
refinedweb
Building a Photo Gallery with Python and WSGI If you wanted to write a Python web application a few years ago, you'd be faced with quite a glut of choices. You'd have to choose among a bunch of great web frameworks, and then figure out a reasonable way to deploy the application in production. It became a running joke that Python was the language of a thousand frameworks. The Python community had options to solve the problem, cull the number of frameworks, or embrace the diversity. Given the nature of the community, culling didn't seem like an attractive option, so PEP 333 was written as a way to lower the barriers to using Python as a language to develop for the web and the Web Server Gateway Interface (WSGI) was born. WSGI separates the web application from the web server, similar to a Java servlet. In this way, web framework authors could worry about the best way to implement a web application, and leave the server implementation details to those working on the opposite side of the WSGI "tube." Although the intent of WSGI is to allow web framework developers a way to easily interface with web servers, WSGI is also a pretty fun way to build web applications. Ian Bicking, in his presentation "WSGI: An Introduction" at Pycon 2007, compared WSGI to the early days of CGI programming. It turns out, despite its problems, early CGI was a great encapsulation that provided clean separation between the server and the application. The server was responsible for marshalling some environment variables and passing them to the stdin of the application. The application responded with data (usually HTML) on stdout. Of course, CGI was slow and cumbersome, but it encapsulated things really nicely, and was easy to wrap your head around. WSGI is similar to CGI in that the interface is simple. So simple, in fact, that it often throws people off. When you assume that deploying web applications is difficult, the reaction to WSGI is usually a shock. Here's a basic example: def hi(environ, start_response): start_response('200 OK', [('content-type','text/html')]) return "HI!" from wsgiref.simple_server import make_server make_server('', 8080, hi).serve_forever() The application is the function "hi", which takes as arguments the environment (a dictionary), and a function called start_response. The first line of the the hi application "start_response('200 OK', [('content-type','text/html')])" declares that the request was good, returning the HTTP response 200, and lets the client know that what follows is the mimetype text/HTML. The application then returns the HTML, in this case the simple phrase "HI!" It's fairly similar to the CGI way of passing environment in on stdin, and getting a response from stdout. That function is all that's required of a full WSGI application. It's trivial to plug the hi application into a WSGI container and run it. The final two lines of the script do just that: from wsgiref.simple_server import make_server make_server('', 8080, hi).serve_forever() I'm using the WSGI reference server, included in the Python standard library since Python 2.4. I could just as easily substitute it with a FastCGI, AJP, SCGI, or Apache container. In that way, it's a write once, run anywhere...plug and play kind of web application. Now that you're over the hello world hump, it's time to build a useful application. On August 4th, 2007, my wife (Camri) and I had our first child, Mr. William Christopher McAvoy. Since then, we've taken thousands of photographs. All of them are stored in a neatly organized series of folders on an external hard drive on my desk. When Camri wants to find pictures to give to the grandparents, she has to wheel herself over to my computer and look through them. We tried a shared drive, but it was just too slow. I did a little bit of looking for a web application that would read a big filesystem of pictures, but couldn't find any. The existing galleries all wanted you to upload pictures; none assumed a pre-existing series of folders. I puttered around for a few hours in the airport on a trip, and came up with a relatively usable WSGI application that converts web paths to directory paths, dynamically creates thumbnails, and generally makes it easy to browse a big listing of jpegs. When we got home, I plugged the app into a mod_wsgi container on my desktop installation of Apache, and it ran as well as it did in the WSGI container included in Python 2.4 that I was using for development. The full source of the application is available on my public Google code page. The guts of the application is the class fsPicture. "A class?" you say, "I thought WSGI apps were supposed to be functions?!" Sort of. They're supposed to be callable, function-like objects, which is a way of saying that they can be objects, as long as you override the __call__ magic method of the object. Yhis sounds simple enough, but it really confused me when I first started playing with WSGI, so let me spend a minute on it. If I declare a class that looks like this: class Something(object): def __call__(self): return "Hi there!" And then instantiate the class like so: s = Something() I can call 's' as if it were a function, like 's()'. It's functionally equivilent to creating an s function, like this: def s(): return "Hi there!" This is really great, because it means that you can create objects as WSGI applications, which is a lot cleaner than creating a WSGI application with a function as its base. Page 1 of 2
http://www.developer.com/open/article.php/3734416/Building-a-Photo-Gallery-with-Python-and-WSGI.htm
CC-MAIN-2015-48
en
refinedweb
MMA7361 Triple Axis Accelerometer Breakout Introduction This is a breakout for freescale mma7361l analog three axis accelerometer. Features - Low Voltage Operation: 2.2 V – 3.6 V - High Sensitivity (800 mV/g @ 1.5g) - Selectable Sensitivity (±1.5g, ±6g) - Fast Turn On Time (0.5 ms Enable Response Time) - Self Test for Freefall Detect Diagnosis - 0g-Detect for Freefall Protection - Signal Conditioning with Low Pass Filter - Robust Design, High Shocks Survivability - RoHS Compliant - Environmentally Preferred Product - Low Cost Document Usage Here is the guide illustrates how to connect an Arduino to the MMA7361 Triple Axis Accelerometer Breakout. The following is a table describing which pins on the Arduino should be connected to the pins on the accelerometer: First put on the MMA7361 module on the flat and upload the Arduino example code. Then open the serial monitor, after the calibrating, MMA 7361 will output the gravity on x, y and z axis. The photo below shows the output data when the accelerometor is lying flat, the gravity of Z axis is about 100(1 G).Please note keep this module flat when calibrating. Example code #include <AcceleroMMA7361.h> } How to buy
http://www.geeetech.com/wiki/index.php/MMA7361_Triple_Axis_Accelerometer_Breakout
CC-MAIN-2015-48
en
refinedweb
#include <ggi/internal/triple-int.h> int sign_3(unsigned x[3]); int bits_3(unsigned x[3]); int eq0_3(unsigned x[3]); int gt0_3(unsigned x[3]); int ge0_3(unsigned x[3]); int lt0_3(unsigned x[3]); int le0_3(unsigned x[3]); bits_3 counts the number of significant bits of x. I.e. leading zeros in a positive value and leading ones in a negative value are not counted. eq0_3, gt0_3, ge0_3, lt0_3 and le0_3 tests the relation between x and zero. eq0_3 tests if x is equal to zero, gt0_3 if x is greater than zero, ge0_3 if x is greater than or equal to zero, lt0_3 if x is less than zero and last but not least le0_3 tests if x is less than or equal to zero. bits_3 returns 0 for x equal to 0 or -1, 1 for x equal to 1 and -2, 2 for x equal to 2, 3, -3 and -4 etc. eq0_3, gt0_3, ge0_3, lt0_3 and le0_3 all returns non-zero if the relation is true, and zero otherwise. unsigned x[3]; assign_int_3(x, 5); ASSERT(sign_3(x) == 1); ASSERT(bits_3(x) == 3); ASSERT(!eq0_3(x)); ASSERT(gt0_3(x)); ASSERT(ge0_3(x)); ASSERT(!lt0_3(x)); ASSERT(!le0_3(x));
http://www.makelinux.net/man/3/G/ggidev-bits_3
CC-MAIN-2015-48
en
refinedweb
(For more resources on .NET, see here.)ASP.NET MVC Web Application template to create a new web application using this template. first project is a web project where you'll implement your application. The second is a testing project that you can use to write unit tests against. first create some ASPX pages in the Views folder. Note that VS has already created files: . Therefore, the URL is sent to IIS and then to ASP.NET runtime, where it initiates a controller class based on the URL, using the URL routes, and the controller class then loads the data from the model, with this data finally file and examine the following code: public class Global); } The RegisterRoutes() method contains the URL mapping routes. Initially we have only the default rule set: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); The RegisterRoutes() method contains the URL mapping routes. Initially we have only the default rule set: The MapRoute() method, which handles URL routing and mapping, takes three arguments: - Name of the route (string) - URL format (string) - Default settings (object type) In our case, we named the first route "Default" (which is the route name) and then set the-only specified. files in the URLs. So in the code-behind of our Default.aspx page, we have a simple redirect: public void Page_Load(object sender, System.EventArgs e) { Response.Redirect("~/Home"); } So the runtime will first: Controller/action/id So /Home corresponds to a controller named Home, and because we have not specified any action or ID, it takes the default values we specified in the RegisterRoutes() method in the globals.asax.cs. So the default action was Index and the default parameter was an empty string. The runtime initializes the HomeController.cs class, and fires-specific file),Dat a 5-Tier solution and change the GUI layer to make it follow the MVC design using the ASP.NET MVC framework. Open the 5-Tier solution and delete the ASP.NET web project from it. The solution will then only contain 5Tier.BL, 5Tier.DAL and 5Tier.Common projects. Right click the solution in VS, and select Add New Project, and then selectASP.NET MVC Web Application from the dialog box. Name this new web project as Test.MVC. This web project will be the new MVC based UI tier of our OMS application. The Customer.cs and CustomerCollection.cs class files in the business tier (5Tier.Business class library) will be the Model in our MVC application. To show a list of customers, the CustomerCollection class simply calls the FindCustomer() method in CustomerDAL.cs. So we can use an n-tier architecture in an MVC application, hence this shows that MVC and n-tier are not mutually exclusive options while consideringthe application architecture of your web application. Both actually complimenteach file in the Test file under the existing home page route as follows: routes.MapRoute( "Customer", "Customer/{action}/{id}", new { controller = "Customer", action = "Show", id="" } ); This new route will simply fire public first file(REST refers to Representation State Transfer). fire the Add method as shown in the sample code (just for demonstration purposes): public class CustomerController : Controller { public ActionResult Add(string customerName) { //create a business object and fire the add method Customerin the code using one of the many available unit testing frameworks, such as NUnit and MBUnit. Unit testing the GUI of our ASP.NET projects is highly important; but it is difficult to do so under the standard page controller model. However,.The core principle of the ASP.NET MVC framework is that the URL should talk directly to the requested resource in the web application. It is a very good choice for creating a unit-testable and search engine friendly web application which makes our web UI much cleaner by having a clear separation between the UI and code logic. Further resources on this subject: - Working with Master Pages in ASP.NET MVC 2 [article] - ASP.NET MVC 2: Validating MVC [article] - ER Diagrams, Domain Model, and N-Layer Architecture with ASP.NET 3.5 (part1) - ER Diagrams, Domain Model, and N-Layer Architecture with ASP.NET 3.5 (part2)
https://www.packtpub.com/books/content/aspnet-mvc-framework
CC-MAIN-2015-48
en
refinedweb
Specifies the name of the entity. call-property, default-resource-principal, stub-property (sun-web.xml, sun-ejb-jar.xml, sun-application-client.xml); enterprise-beans, principal, property (with subelements) (sun-ejb-jar.xml) none - contains data Specifies the name of one independent fetch group. All the fields and relationships that are part of a named group are fetched at the same time. A field belongs to only one fetch group, regardless of what type of fetch group is used. fetched-with (sun-cmp-mappings.xml) none - contains data Specifies the namespace URI. service-qname, wsdl-port (sun-web.xml, sun-ejb-jar.xml, sun-application-client.xml) none - contains data Specifies that this field or relationship is fetched by itself, with no other fields or relationships. consistency, fetched-with (sun-cmp-mappings.xml) none - element is present or absent
http://docs.oracle.com/cd/E19501-01/819-3660/6n5s7klq3/index.html
CC-MAIN-2015-48
en
refinedweb
std::to the variable, or you can use the usingkeyword like: using namespace std;or using std::cout;. std::cout;. I don't use: using namespace std;because std is huge and it brings in many functions that I don't need. It causes the potential for naming conflicts. ::std::coutin case someone creates their own namespace called "std", nested within another user-defined namespace, and sneaks in a using directive
http://www.cplusplus.com/forum/general/110715/
CC-MAIN-2015-48
en
refinedweb
the Oracle database need to understand the Globalization Support architecture of the database, including the properties of the different character sets, territories, languages and linguistic sort definitions. They also need to understand the globalization functionality of their middle-tier programming environment, and find out how it can interact and synchronize with the locale model of the database. Finally, to develop a globalized Internet application, they need to design and write code that is capable of simultaneously supporting multiple clients running on different operating systems with different character sets and locale requirements. Oracle Globalization Development Kit (GDK) simplifies the development process and reduces the cost of developing Internet applications that will be used to support a global environment. This release of GDK for Java and GDK for PL/SQL are not identical. There are two architectural models for deploying a global Web site or a global Internet application, depending on your globalization and business requirements. Which model to deploy affects how the Internet application is developed and how the application server is configured in the middle-tier. The two models are: Multiple instances of monolingual Internet applications Internet applications that support only one locale in a single binary are classified as monolingual applications. A locale refers to a national language and the region in which the language is spoken. For example, the primary language of the United States and Great Britain is English. However, the two territories have different currencies and different conventions for date formats. Therefore, the United States and Great Britain are considered to be two different locales. This level of globalization support is suitable for customers who want to support one locale for each instance of the application. Users need to have different entry points to access the applications for different locales. This model is manageable only if the number of supported locales is small. Single instance of a multilingual application Internet applications that support multiple locales simultaneously in a single binary are classified as multilingual applications. This level of globalization support is suitable for customers who want to support several locales in an Internet application simultaneously. Users of different locale preferences use the same entry point to access the application. Developing an application using the monolingual model is very different from developing an application using the multilingual model. The Globalization Development Kit consists of libraries, which can assist in the development of global applications using either architectural model. The rest of this section includes the following topics: Deploying a Monolingual Internet Application Deploying a Multilingual Internet Application Deploying a global Internet application with multiple instances of monolingual Internet applications is shown in Figure 8-1. Figure 8-1 Monolingual Internet Application Architecture Each application server is configured for the locale that it serves. This deployment model assumes that one instance of an Internet application runs in the same locale as the application in the middle tier. The Internet applications access a back-end database in the native encoding used for the locale. The following are advantages of deploying monolingual Internet applications: The. As more and more locales are supported, the disadvantages quickly outweigh the advantages. With the limitation and the maintenance overhead of the monolingual deployment model, this deployment architecture is suitable for applications that support only one or two locales. Multilingual Internet applications are deployed to the application servers with a single application server configuration that works for all locales. Figure 8-2 shows the architecture of a multilingual Internet application.. The disadvantage of deploying multilingual Internet applications is that it requires extra coding during application development to handle dynamic locale detection and Unicode, which is costly when only one or two languages need to be supported. Deploying multilingual Internet applications is more appropriate than deploying monolingual applications when Web sites support multiple locales. Building an Internet application that supports different locales requires good development practices. For multilingual Internet applications, the application itself must be aware of the user's locale and be able to present locale-appropriate content to the user. Clients must be able to communicate with the application server regardless of the client's locale. The application server then communicates with the database server, exchanging data while maintaining the preferences of the different locales and character set settings. One of the main considerations when developing a multilingual Internet application is to be able to dynamically detect, cache, and provide the appropriate contents according to the user's preferred locale. For monolingual Internet applications, the locale of the user is always fixed and usually follows the default locale of the runtime environment. Hence the locale configuration is much simpler. The following sections describe some of the most common issues that developers encounter when building a global Internet application: To be locale-aware or locale-sensitive, Internet applications need to be able to determine the preferred locale of the user. Monolingual applications always serve users with the same locale, and that locale should be equivalent to the default runtime locale of the corresponding programming environment. Multilingual applications can determine a user locale dynamically in three ways. Each method has advantages and disadvantages, but they can be used together in the applications to complement each other. The user locale can be determined in the following ways: Get the default ISO locale setting from a browser. The default ISO locale of the browser is sent through the Accept-Language HTTP header in every HTTP request. If the Accept-Language header is NULL, then the desired locale should default to English. The drawback of this approach is that the Accept-Language header may not be a reliable source of information for the locale of a user. Based on user selection Allow users to select a locale from a list box or from a menu, and switch the application locale to the one selected. The Globalization Development Kit provides an application framework that enables you to use these locale determination methods declaratively. To be locale-aware or locale-sensitive, Internet applications need to determine the locale of a user. After the locale of a user is determined, applications should: Construct HTML content in the language of the locale Use the cultural conventions implied by the locale Locale-sensitive functions, such as date, time, and monetary formatting, are built into various programming environments such as Java and PL/SQL. Applications may use them to format the HTML pages according to the cultural conventions of the locale of a user. A locale is represented differently in different programming environments. For example, the French (Canada) locale is represented in different environments as follows: is equal to CANADA. If you write applications for more than one programming environment, then locales must be synchronized between environments. For example, Java applications that call PL/SQL procedures should map the Java locales to the corresponding NLS_LANGUAGE and NLS_TERRITORY values and change the parameter values to match the user's locale before calling the PL/SQL procedures. The Globalization Development Kit for Java provides a set of Java classes to ensure consistency on locale-sensitive behaviors with Oracle databases. For the application to support a multilingual environment, it must be able to present the content in the preferred language and in the locale convention of the user. Hard-coded user interface text must first be externalized from the application, together with any image files, so that they can be translated into the different languages supported by the application. The translation files then must be staged in separate directories, and the application must be able to locate the relevant content according to the user locale setting. Special application handling may also be required to support a fallback mechanism, so that if the user-preferred locale is not available, then the next most suitable content is presented. For example, if Canadian French content is not available, then it may be suitable for the application to switch to the French files instead. The Globalization Development Kit (GDK) for Java provides a J2EE application framework and Java APIs to develop globalized Internet applications using the best globalization practices and features designed by Oracle. It reduces the complexities and simplifies the code that Oracle developers require to develop globalized Java applications. GDK for Java complements the existing globalization features in J2EE. Although the J2EE platform already provides a strong foundation for building globalized applications, its globalization functionalities and behaviors can be quite different from Oracle's functionalities. GDK for Java provides synchronization of locale-sensitive behaviors between the middle-tier Java application and the database server. GDK for PL/SQL contains a suite of PL/SQL packages that provide additional globalization functionalities for applications written in PL/SQL. Figure 8-3 shows the major components of the GDK and how they are related to each other. User applications run on the J2EE container of Oracle Application Server in the middle tier. GDK provides the application framework that the J2EE application uses to simplify coding to support globalization. Both the framework and the application call the GDK Java API to perform locale-sensitive tasks. GDK for PL/SQL offers PL/SQL packages that help to resolve globalization issues specific to the PL/SQL environment. certified with JDK versions 1.3 and later with the following exception: The character set conversion classes depend on the java.nio.charsetpackage, which is available in JDK 1.4 and later. GDK for Java is contained in nine .jar files, all in the form of orai18n*jar. These files are shipped with the Oracle Database, in the $ORACLE_HOME/jlib directory. If the application using the GDK is not hosted on the same machine as the database, then the GDK files must be copied to the application server and included into the CLASSPATH to run your application. You do not need to install the Oracle Database into your application server to be able to run the GDK inside your Java application. GDK is a pure Java library that runs on every platform. The Oracle client parameters NLS_LANG and ORACLE_HOME are not required.. The following> The following code example. GDK for Java provides the globalization framework for middle-tier J2EE applications. The framework encapsulates the complexity of globalization programming, such as determining user locale, maintaining locale persistency, and processing locale information. This framework minimizes the effort required to make Internet applications global-ready. The GDK application framework is shown in Figure 8. The GDK application framework simplifies the coding required for your applications to support different locales. When you write a J2EE application according to the application framework, the application code is independent of what locales the application supports, and you control the globalization support in the application by defining it in the GDK application configuration file. There is no code change required when you add or remove a locale from the list of supported application locales. The following list gives you some idea of the extent to which you can define the globalization support in the GDK application configuration file: The behavior of the GDK application framework for J2EE is controlled by the GDK application configuration file, gdkapp.xml. The application configuration file allows developers to specify the behaviors of globalized applications in one centralized place. One application configuration file is required for each J2EE application using the GDK. The gdkapp.xml file should be placed in the ./WEB-INF directory of the J2EE environment of the application. The file dictates the behavior and the properties of the GDK framework and the application that is using it. It contains locale mapping tables, character sets of content files, and globalization parameters for the configuration of the application. The application administrator can modify the application configuration file to change the globalization behavior in the application, without needing to change the programs and to recompile them. See Also:"The GDK Application Configuration File" For a J2EE application to use the GDK application framework defined by the corresponding GDK application configuration file, the GDK Servlet filter and the GDK context listener must be defined in the web.xml file of the application. The web.xml file should be modified to include the following at the beginning of the file: <web-app> <!-- Add GDK filter that is called after the authentication --> <filter> <filter-name>gdkfilter</filter-name> <filter-class>oracle.i18n.servlet.filter.ServletFilter</filter-class> </filter> <filter-mapping> <filter-name>gdkfilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <!-- Include the GDK context listener --> <listener> <listener-class>oracle.i18n.servlet.listener.ContextListener</listener-class> </listener> </web-app> Examples of the gdkapp.xml and web.xml files can be found in the $ORACLE_HOME/nls/gdk/demo directory. The GDK application framework supports Servlet container version 2.3 and later. It uses the Servlet filter facility for transparent globalization operations such as determining the user locale and specifying the character set for content files. The also override the same methods, then the filter in the GDK framework may return incorrect results. For example, if getLocale returns en_US, but the result is overridden by other filters, then the result of the GDK locale detection mechanism is affected. All of the methods that are being overridden in the filter of the GDK framework are documented in Oracle Globalization Development Kit Java API Reference. Be aware of potential conflicts when using other filters together with the GDK framework. Determining the user's preferred locale is the first step in making an application global-ready. The locale detection offered by the J2EE application framework is primitive. It lacks the method that transparently retrieves the most appropriate user locale among locale sources. It provides locale detection by the HTTP language preference only, and it cannot support a multilevel locale fallback mechanism. The GDK application framework provides support for predefined locale sources to complement J2EE. In a web application, several locale sources are available. Table 8-1 summarizes locale sources that are provided by the GDK. See Also:"The GDK Application Configuration File" for information about the GDK multilevel locale fallback mechanism The GDK application framework provides seamless support for predefined locale sources, such as user input locale, HTTP language preference, user profile locale preference in the database, and the application default locale. You can incorporate the locale sources to the framework by defining them under the <locale-determine-rule> tag in the GDK application configuration file as follows: <locale-determine-rule> <locale-source>oracle.i18n.servlet.localesource.UserInput</locale-source> <locale-source>oracle.i18n.servlet.localesource.HTTPAcceptLanguage</locale-source> </locale-determine-rule>. Custom locale sources, such as locale preference from an LDAP server, can be easily implemented and integrated into the GDK framework. You need to implement the LocaleSource interface and specify the corresponding implementation class under the <locale-determine-rule> tag in the same way as the predefined locale sources were specified. The LocaleSource implementation not only retrieves the locale information from the corresponding source to the framework but also updates the locale information to the corresponding source when the framework tells it to do so. Locale sources can be read-only or read/write, and they can be cacheable or noncacheable. The GDK framework initiates updates only to read/write locale sources and caches the locale information from cacheable locale sources. Examples of custom locale sources can be found in the $ORACLE_HOME/nls/gdk/demo directory. See Also:Oracle Globalization Development Kit Java API Reference for more information about implementing a LocaleSource The GDK offers automatic locale detection to determine the current locale of the user. For example, the following code retrieves the current user locale in Java. It uses a Locale object explicitly. Locale loc = request.getLocale(); The getLocale() method returns the Locale that represents the current locale. This is similar to invoking the HttpServletRequest.getLocale() method in JSP or Java Servlet code. However, the logic in determining the user locale is different, because multiple locale sources are being considered in the GDK framework. Alternatively, you can get a Localizer object that encapsulates the Locale object determined by the GDK framework. For the benefits of using the Localizer object, see "Implementing Locale Awareness Using the GDK Localizer". Localizer localizer = ServletHelper.getLocalizerInstance(request); Locale loc = localizer.getLocale(); The locale detection logic of the GDK framework depends on the locale sources defined in the GDK application configuration file. The names of the locale sources are registered in the application configuration file. The following example shows the locale determination rule section of the application configuration file. It indicates that the user-preferred locale can be determined from either the LDAP server or from the HTTP Accept-Language header. The LDAPUserSchema locale source class should be provided by the application. Note that all of the locale source classes have to be extended from the LocaleSource abstract class. <locale-determine-rule> <locale-source>LDAPUserSchema</locale-source> <locale-source>oracle.i18n.localesource.HTTPAcceptLanguage</locale-source> </locale-determine-rule> For example, when the user is authenticated in the application and the user locale preference is stored in an LDAP server, then the LDAPUserSchema class connects to the LDAP server to retrieve the user locale preference. When the user is anonymous, then the HttpAcceptLanguage class returns the language preference of the web browser. The cache is maintained for the duration of a HTTP session. If the locale source is obtained from the HTTP language preference, then the locale information is passed to the application in the HTTP Accept-Language header and not cached. This enables flexibility so that the locale preference can change between requests. The cache is available in the HTTP session. The GDK framework exposes a method for the application to overwrite the locale preference information persistently stored in locale sources such as the LDAP server or the user profile table in the database. This method also resets the current locale information stored inside the cache for the current HTTP session. The following is an example of overwriting the preferred locale using the store command. <input type="hidden" name="<%=appctx.getParameterName(LocaleSource.Parameter.COMMAND)%>" value="store"> To discard the current locale information stored inside the cache, the clean command can be specified as the input parameter. The following table shows the list of commands supported by the GDK: Note that the GDK parameter names can be customized in the application configuration file to avoid name conflicts with other parameters used in the application. The Localizer object obtained from the GDK application framework is an all-in-one globalization object that provides access to functions that are commonly used in building locale awareness in your applications. In addition, it provides functions to get information about the application context, such as the list of supported locales. The Localizer object simplifies and centralizes the code required to build consistent locale awareness behavior in your applications. The oracle.i18n.servlet package contains the Localizer class. You can get the Localizer instance as follows: Localizer lc = ServletHelper.getLocalizerInstance(request); The Localizer object encapsulates the most commonly used locale-sensitive information determined by the GDK framework and exposes it as locale-sensitive methods. This object includes the following functionalities pertaining to the user locale: For example, when you want to display a date in your application, you may want to call the Localizer.formatDate() or Localizer.formateDateTime() methods. When you want to determine the writing direction of the current locale, you can call the Localizer.getWritingDirection() and Localizer.getAlignment() to determine the value used in the <DIR> tag and <ALIGN> tag respectively. The Localizer object also exposes methods to enumerate the list of supported locales and their corresponding languages and countries in your applications. The Localizer object actually makes use of the classes in the GDK Java API to accomplish its tasks. These classes include, but are not limited to, the following: OraDateFormat, OraNumberFormat, OraCollator, OraLocaleInfo, oracle.i18n.util.LocaleMapper, o racle.i18n.net.URLEncoder, and oracle.i18n.net.URLDecoder. The Localizer object simplifies the code you need to write for locale awareness. It maintains caches of the corresponding objects created from the GDK Java API so that the calling application does not need to maintain these objects for subsequent calls to the same objects. If you require more than the functionality the Localizer object can provide, then you can always call the corresponding methods in the GDK Java API directly. See Also:Oracle Globalization Development Kit Java API Reference for detailed information about the Localizerobject The number of locales and the names of the locales that an application needs to support are based on the business requirements of the application. The names of the locales that are supported by the application are registered in the application configuration file. The following example shows the application locales section of the application configuration file. It indicates that the application supports German ( de), Japanese ( ja), and English for the US ( en-US), with English defined as the default fallback application locale. Note that the locale names are based on the IANA convention. <application-locales> <locale>de</locale> <locale>ja</locale> <locale default="yes">en-US</locale> </application-locales> When the GDK framework detects the user locale, it verifies whether the locale that is returned is one of the supported locales in the application configuration file. The verification algorithm is as follows:. By performing steps 3 and 4, the application can support users with the same language requirements but with different locale settings than those defined in the application configuration file. For example, the GDK can support de-AT (the Austrian variant of German), de-CH (the Swiss variant of German), and de-LU (the Luxembourgian variant of German) locales. The locale fallback detection in the GDK framework is similar to that of the Java Resource Bundle, except that it is not affected by the default locale of the Java VM. This exception occurs because the Application Default Locale can be used during the GDK locale fallback operations. If the application-locales section is omitted from the application configuration file, then the GDK assumes that the common locales, which can be returned from the OraLocaleInfo.getCommonLocales method, are supported by the application. The character set (or character encoding) of an HTML page is a very important piece of information to a browser and an Internet application. The browser needs to interpret this information so that it can use correct fonts and character set mapping tables for displaying pages. The Internet applications need to know so they can safely process input data from a HTML form based on the specified encoding. The page encoding can be translated as the character set used for the locale to which an Internet application is serving. In order to correctly specify the page encoding for HTML pages without using the GDK framework, Internet applications must: Determine the desired page input data character set encoding for a given locale. Specify the corresponding encoding name for each HTTP request and HTTP response. Applications using the GDK framework can ignore these steps. No application code change is required. The character set information is specified in the GDK application configuration file. At runtime, the GDK automatically sets the character sets for the request and response objects. The GDK framework does not support the scenario where the incoming character set is different from that of the outgoing character set. The GDK application framework supports the following scenarios for setting the character sets of the HTML pages:. The character set information is specified in the GDK application configuration file. The following is an example of setting UTF-8 as the character set for all the application pages. <page-charset>UTF-8</page-charset> The page character set information is used by the ServletRequestWrapper class, which sets the proper character set for the request object. It is also used by the ContentType HTTP header specified in the ServletResponseWrapper class for output when instantiated. If page-charset is set to AUTO-CHARSET, then the character set is assumed to be the default character set for the current user locale. Set page-charset to AUTO-CHARSET as follows: <page-charset>AUTO-CHARSET</page-charset> The default mappings are derived from the LocaleMapper class, which provides the default IANA character set for the locale name in the GDK Java API. Table 8-2 lists the mappings between the common ISO locales and their IANA character sets. The locale to character set mapping in the GDK can also be customized. To override the default mapping defined in the GDK Java API, a locale-to-character-set mapping table can be specified in the application configuration file. <locale-charset-maps> <locale-charset> <locale>ja</locale><charset>EUC-JP</charset> </locale-charset> </locale-charset-maps> The previous example shows that for locale Japanese ( ja), the GDK changes the default character set from SHIFT_JIS to EUC-JP. See Also:"Oracle Locale Information in the GDK" This section includes the following topics: Managing Localized Content in JSPs and Java Servlets Managing Localized Content in Static Files Resource bundles enable access to localized contents at runtime in J2SE. Translatable strings within Java servlets and Java Server Pages (JSPs) are externalized into Java resource bundles so that these resource bundles can be translated independently into different languages. The translated resource bundles carry the same base class names as the English bundles, using the Java locale name as the suffix. To retrieve translated data from the resource bundle, the getBundle() method must be invoked for every request. <% Locale user_locale=request.getLocale(); ResourceBundle rb=ResourceBundle.getBundle("resource",user_locale); %> <%= rb.getString("Welcome") %> The GDK framework simplifies the retrieval of text strings from the resource bundles. Localizer.getMessage() is a wrapper to the resource bundle. <% Localizer.getMessage ("Welcome") %> Instead of specifying the base class name as getBundle() in the application, you can specify the resource bundle in the application configuration file, so that the GDK automatically instantiates a ResourceBundle object when a translated text string is requested. <message-bundles> <resource-bundleresource</resource-bundle> </message-bundles>. For a application, which supports only one locale, the URL that has a suffix of /index.html typically takes the user to the starting page of the application. In a globalized application, contents in different languages are usually stored separately, and it is common for them to be staged in different directories or with different file names based on the language or the country name. This information is then used to construct the URLs for localized content retrieval in the application. The following examples illustrate how to retrieve the French and Japanese versions of the index page. Their suffixes are as follows: /fr/index.html /ja/index.html By using the rewriteURL() method of the ServletHelper class, the GDK framework handles the logic to locate the translated files from the corresponding language directories. The ServletHelper.rewriteURL() method rewrites a URL based on the rules specified in the application configuration file. This method is used to determine the correct location where the localized content is staged. The following is an example of the JSP code: <img src="<%="ServletHelper.rewriteURL("image/welcome.jpg", request)%>"> <a href="<%="ServletHelper.rewriteURL("html/welcome.html", request)%>"> The URL rewrite definitions are defined in the GDK application configuration file: <url-rewrite-rule <pattern>(.*)/(a-zA-Z0-9_\]+.)$</pattern> <result>$1/$A/$2</result> </url-rewrite-rule> The pattern section defined in the rewrite rule For example, if the current user locale is ja, then the URL for the welcome.jpg image file is rewritten as image/ja/welcome.jpg, and welcome.html is changed to html/ja/welcome.html. Both ServletHelper.rewriteURL()and Localizer.getMessage() methods perform consistent locale fallback operations in the case where the translation files for the user locale are not available. For example, if the online help files are not available for the es_MX locale (Spanish for Mexico), but the es (Spanish for Spain) files are available, then the methods will select the Spanish translated files as the substitute. Java's globalization functionalities and behaviors are not the same as those offered in the database. For example, J2SE supports a set of locales and character sets that are different from Oracle's locales and character sets. This inconsistency can be confusing for users when their application contains data that is formatted based on 2 different conventions. For example, dates that are retrieved from the database are formatted using Oracle conventions, (such as number and date formatting and linguistic sort ordering), but the static application data is typically formatted using Java locale conventions. Java's globalization functionalities can also be different depending on the version of the JDK that the application runs on. Before Oracle Database 10g, when an application was required to incorporate Oracle globalization features, it had to make connections to the database server and issue SQL statements. Such operations make the application complicated and generate more network connections to the database server. The GDK Java API extends Oracle's database globalization features to the middle tier. By enabling applications to perform globalization logic such as Oracle date and number formatting and linguistic sorting in the middle tier, the GDK Java API allows developers to eliminate expensive programming logic in the database, hence improving the overall application performance by reducing the database load in the database server and the unnecessary network traffic between the application tier and the database server. The GDK Java API also offers advance globalization functionalities, such as language and character set detection, and the enumeration of common locale data for a territory or a language (for example, all time zones supported in Canada). These are globalization features that are not available in most programming platforms. Without the GDK Java API, developers must write business logic to handle them inside an application. The following are the key functionalities of the GDK Java API: Oracle Locale Information in the GDK Oracle Locale Mapping in the GDK Oracle Character Set Conversion (JDK 1.4 and Later) for E-Mail Programs Oracle locale definitions, which include languages, territories, linguistic sorts, and character sets, are exposed in the GDK Java API. The naming convention that Oracle uses may also be different from other vendors. Although many of these names and definitions follow industry standards, some are Oracle-specific, tailored to meet special customer requirements. OraLocaleInfo is an Oracle locale class that includes language, territory, and collator objects. It provides a method for applications to retrieve a collection of locale-related objects for a given locale, for example, a full list of the Oracle linguistic sorts available in the GDK, the local time zones defined for a given territory, or the common languages used in a particular territory. The following are examples of using the OraLocaleInfo class: // All Territories supported by GDK String[] avterr = OraLocaleInfo.getAvailableTerritories(); // Local TimeZones for a given Territory OraLocaleInfo oloc = OraLocaleInfo.getInstance("English", "Canada"); TimeZone[] loctz = oloc.getLocalTimeZones(); The GDK Java API provides the LocaleMapper class. It maps equivalent locales and character sets between Java, IANA, ISO, and Oracle. A Java application may receive locale information from the client that is specified in Oracle's locale name or an IANA character set name. The Java application must be able to map to an equivalent Java locale or Java encoding before it can process the information correctly. The following is an example of using the LocaleMapper class. // Mapping from Java locale to Oracle language and Oracle territory Locale locale = new Locale("it", "IT"); String oraLang = LocaleMapper.getOraLanguage(locale); String oraTerr = LocaleMapper.getOraTerritory(locale); // From Oracle language and Oracle territory to Java Locale locale = LocaleMapper.getJavaLocale("AMERICAN","AMERICA"); locale = LocaleMapper.getJavaLocale("TRADITONAL CHINESE", ""); // From IANA & Java to Oracle Character set String ocs1 = LocaleMapper.getOraCharacterSet( LocaleMapper.IANA, "ISO-8859-1"); String ocs2 = LocaleMapper.getOraCharacterSet( LocaleMapper.JAVA, "ISO8859_1"); The LocaleMapper class can also return the most commonly used e-mail character set for a specific locale on both Windows and UNIX platforms. This is useful when developing Java applications that need to process e-mail messages. See Also:"Using the GDK for E-Mail Programs" The GDK Java API contains a set of character set conversion classes APIs that enable users to perform Oracle character set conversions. Although Java JDK is already equipped with classes that can perform conversions for many of the standard character sets, they do not support Oracle-specific character sets and Oracle's user-defined character sets. In JDK 1.4, J2SE introduced an interface for developers to extend Java's character sets. The GDK Java API provides implicit support for Oracle's character sets by using this plug-in feature. You can access the J2SE API to obtain Oracle-specific behaviors. Figure 8-7 shows that the GDK character set conversion tables are plugged into J2SE in the same way as the Java character set tables. With this pluggable framework of J2SE, the Oracle character set conversions can be used in the same way as other Java character set conversions. Figure 8-7 Oracle Character Set Plug-In Because the java.nio.charset Java package is not available in JDK versions before 1.4, you must install JDK 1.4 or later to use Oracle's character set plug-in feature. The GDK character conversion classes support all Oracle character sets including user-defined characters sets. It can be used by Java applications to properly convert to and from Java's internal character set, UTF-16. Oracle's character set names are proprietary. To avoid potential conflicts with Java's own character sets, all Oracle character set names have an X-ORACLE- prefix for all implicit usage through Java's API. The following is an example of Oracle character set conversion: // Converts the Chinese character "three" from UCS2 to JA16SJIS String str = "\u4e09"; byte[] barr = str.getBytes("x-oracle-JA16SJIS"); Just as with other Java character sets, the character set facility in java.nio.charset.Charset is applicable to all of the Oracle character sets. For example, if you wish to check whether the specified character set is a superset of another character set, then you can use the Charset.contains method as follows: Charset cs1 = Charset.forName("x-oracle-US7ASCII"); Charset cs2 = Charset.forName("x-oracle-WE8WINDOWS1252"); // true if WE8WINDOWS1252 is the superset of US7ASCII, otherwise false. boolean osc = cs2.contains(cs1); For a Java application that is using the JDBC driver to communicate with the database, the JDBC driver provides the necessary character set conversion between the application and the database. Calling the GDK character set conversion methods explicitly within the application is not required. A Java application that interprets and generates text files based on Oracle's character set encoding format is an example of using Oracle character set conversion classes. The GDK Java API provides formatting classes that support date, number, and monetary formats using Oracle conventions for Java applications in the oracle.i18n.text package. New locale formats introduced in Oracle Database 10g, such as the short and long date, number, and monetary formats, are also exposed in these format classes. The following are examples of Oracle date, Oracle number, and Oracle monetary formatting: // Obtain the current date and time in the default Oracle LONG format for // the locale de_DE (German_Germany) Locale locale = new Locale("de", "DE"); OraDateFormat odf = OraDateFormat.getDateTimeInstance(OraDateFormat.LONG, locale); // Obtain the numeric value 1234567.89 using the default number format // for the Locale en_IN (English_India) locale = new Locale("en", "IN"); OraNumberFormat onf = OraNumberFormat.getNumberInstance(locale); String nm = onf.format(new Double(1234567.89)); // Obtain the monetary value 1234567.89 using the default currency // format for the Locale en_US (American_America) locale = new Locale("en", "US"); onf = OraNumberFormat.getCurrencyInstance(locale); nm = onf.format(new Double(1234567.89)); Oracle provides support for binary, monolingual, and multilingual linguistic sorts in the database. In Oracle Database 10g, these sorts have been expanded to provide case-insensitive and accent-insensitive sorting and searching capabilities inside the database. By using the OraCollator class, the GDK Java API enables Java applications to sort and search for information based on the latest Oracle binary and linguistic sorting features, including case-insensitive and accent-insensitive options. Normalization can be an important part of sorting. The composition and decomposition of characters are based on the Unicode Standard, so sorting also depends on the Unicode standard. Because each version of the JDK may support a different version of the Unicode Standard, the GDK provides an OraNormalizer class based on the Unicode 4.0 standard. It contains methods to perform composition. The sorting order of a binary sort is based on the Oracle character set that is being used. Except for the UTFE character set, the binary sorts of all Oracle character sets are supported in the GDK Java API. The only linguistic sort that is not supported in the GDK Java API is JAPANESE, but a similar and more accurate sorting result can be achieved by using JAPANESE_M. The following are examples of string comparisons and string sorting: // compares strings using XGERMAN private static String s1 = "abcSS"; private static String s2 = "abc\u00DF"; String cname = "XGERMAN"; OraCollator ocol = OraCollator.getInstance(cname); int c = ocol.compare(s1, s2); // sorts strings using GENERIC_M private static String[] source = new String[] { "Hochgeschwindigkeitsdrucker", "Bildschirmfu\u00DF", "Skjermhengsel", "DIMM de Mem\u00F3ria", "M\u00F3dulo SDRAM com ECC", }; cname = "GENERIC_M"; ocol = OraCollator.getInstance(cname); List result = getCollationKeys(source, ocol); private static List getCollationKeys(String[] source, OraCollator ocol) { List karr = new ArrayList(source.length); for (int i = 0; i < source.length; ++i) { karr.add(ocol.getCollationKey(source[i])); } Collections.sort(karr); // sorting operation return karr; } The Oracle Language and Character Set Detection Java classes in the GDK Java API provide a high performance, statistically based engine for determining the character set and language for unspecified text. It can automatically identify language and character set pairs, from throughout the world. With each text, the language and character set detection engine sets up a series of probabilities, each probability corresponding to a language and character set pair. The most probable pair statistically identifies the dominant language and character set. The purity of the text submitted affects the accuracy of the language and character set detection. Only plain text strings are accepted, so any tagging needs to be stripped before hand. The ideal case is literary text with almost no foreign words or grammatical errors. Text strings that contain a mix of languages or character sets, or nonnatural language text like addresses, phone numbers, and programming language code may yield poor results. The LCSDetector class can detect the language and character set of a byte array, a character array, a string, and an InputStream class. It supports both plain text and HTML file detection. It can take the entire input for sampling or only portions of the input for sampling, when the length or both the offset and the length are supplied. For each input, up to three potential language and character set pairs can be returned by the LCSDetector class. They are always ranked in sequence, with the pair with the highest probability returned first. See Also:"Language and Character Set Detection Support" for a list of supported language and character set pairs The following are examples of using the LCSDetector class to enable language and character set detection: // This example detects the character set of a plain text file "foo.txt" and // then appends the detected ISO character set name to the name of the text file LCSDetector lcsd = new LCSDetector(); File oldfile = new File("foo.txt"); FileInputStream in = new FileInputStream(oldfile); lcsd.detect(in); String charset = lcsd.getResult().getIANACharacterSet(); File newfile = new File("foo."+charset+".txt"); oldfile.renameTo(newfile); // This example shows how to use the LCSDector class to detect the language and // character set of a byte array int offset = 0; LCSDetector led = new LCSDetector(); /* loop through the entire byte array */ while ( true ) { bytes_read = led.detect(byte_input, offset, 1024); if ( bytes_read == -1 ) break; offset += bytes_read; } LCSDResultSet res = led.getResult(); /* print the detection results with close ratios */ System.out.println("the best guess " ); System.out.println("Langauge " + res.getOraLanguage() ); System.out.println("CharacterSet " + res.getOraCharacterSet() ); int high_hit = res.getHiHitPairs(); if ( high_hit >= 2 ) { System.out.println("the second best guess " ); System.out.println("Langauge " + res.getOraLanguage(2) ); System.out.println("CharacterSet " +res.getOraCharacterSet(2) ); } if ( high_hit >= 3 ) { System.out.println("the third best guess "); System.out.println("Langauge " + res.getOraLanguage(3) ); System.out.println("CharacterSet " +res.getOraCharacterSet(3) ); } All of the Oracle language names, territory names, character set names, linguistic sort names, and time zone names have been translated into 27 languages including English. They are readily available for inclusion into the user applications, and they provide consistency for the display names across user applications in different languages. OraDisplayLocaleInfo is a utility class that provides the translations of locale and attributes. The translated names are useful for presentation in user interface text and for drop-down selection boxes. For example, a native French speaker prefers to select from a list of time zones displayed in French than in English. The following is an example of using OraDisplayLocaleInfo to return a list of time zones supported in Canada, using the French translation names: OraLocaleInfo oloc = OraLocaleInfo.getInstance("CANADIAN FRENCH", "CANADA"); OraDisplayLocaleInfo odloc = OraDisplayLocaleInfo.getInstance(oloc); TimeZone[] loctzs = oloc.getLocaleTimeZones(); String [] disptz = new string [loctzs.length]; for (int i=0; i<loctzs.length; ++i) { disptz [i]= odloc.getDisplayTimeZone(loctzs[i]); ... } You can use the GDK LocaleMapper class to retrieve the most commonly used e-mail character set. Call LocaleMapper.getIANACharSetFromLocale, passing in the locale object. The return value is an array of character set names. The first character set returned is the most commonly used e-mail character set. The following is an example of sending an e-mail message containing Simplified Chinese data in the GBK character set encoding: import oracle.i18n.util.LocaleMapper; import java.util.Date; import java.util.Locale; import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeUtility; /** * Email send operation sample * * javac -classpath orai18n.jar:j2ee.jar EmailSampleText.java * java -classpath .:orai18n.jar:j2ee.jar EmailSampleText */ public class EmailSampleText { public static void main(String[] args) { send("localhost", // smtp host name "your.address@your-company.com", // from email address "You", // from display email "somebody@some-company.com", // to email address "Subject test zh CN", // subject "Content ˘4E02 from Text email", // body new Locale("zh", "CN") // user locale ); } public static void send(String smtp, String fromEmail, String fromDispName, String toEmail, String subject, String content, Locale locale ) { // get the list of common email character sets final String[] charset = LocaleMapper.getIANACharSetFromLocale(LocaleMapper. EMAIL_WINDOWS, locale ); // pick the first one for the email encoding final String contentType = "text/plain; charset=" + charset[0]; try { Properties props = System.getProperties(); props.put("mail.smtp.host", smtp); // here, set username / password if necessary Session session = Session.getDefaultInstance(props, null); MimeMessage mimeMessage = new MimeMessage(session); mimeMessage.setFrom(new InternetAddress(fromEmail, fromDispName, charset[0] ) ); mimeMessage.setRecipients(Message.RecipientType.TO, toEmail); mimeMessage.setSubject(MimeUtility.encodeText(subject, charset[0], "Q")); // body mimeMessage.setContent(content, contentType); mimeMessage.setHeader("Content-Type", contentType); mimeMessage.setHeader("Content-Transfer-Encoding", "8bit"); mimeMessage.setSentDate(new Date()); Transport.send(mimeMessage); } catch (Exception e) { e.printStackTrace(); } } } The GDK application configuration file dictates the behavior and the properties of the GDK application framework and the application that is using it. It contains locale mapping tables and parameters for the configuration of the application. One configuration file is required for each application. The gdkapp.xml application configuration file is character set provided by the GDK. This mapping is used when the page-charset is set to AUTO-CHARSET. For example, for the en locale, the default GDK character set is windows-1252. However, if the application requires ISO-8859-1, this can be specified as follows: <locale-charset-maps> <locale-charset> <locale>en</locale> <charset>ISO_8859-1</charset> </locale-charset> </locale-charset-maps> The locale name is comprised of the language code and the country code, and they should follow the ISO naming convention as defined in ISO 639 and ISO 3166, respectively. The character set name follows the IANA convention. Optionally, the user-agent parameter can be specified in the mapping table to distinguish different clients. . <page-charset>UTF-8</page-charset> However, if the page-charset is set to AUTO-CHARSET, then the character set is based on the default character set of the current user locale. The default character set is derived from the locale to character set mapping table specified in the application configuration file. If the character set mapping table in the application configuration file is not available, then the character set is based on the default locale name to IANA character set mapping table in the GDK. Default mappings are derived from OraLocaleInfo class. This tag section defines a list of the locales supported by the application. <application-locales> <locale default="yes">en-US</locale> <locale>de</locale> <locale>zh-CN</locale> </application-locales> If the language component is specified with the * country code, then all locale names with this language code qualify. For example, if de-* (the language code for German) is defined as one of the application locales, then this supports de-AT (German- Austria), de (German-Germany), de-LU (German-Luxembourg), de-CH (German-Switzerland), and even irregular locale combination such as de-CN (German-China). However, the application can be restricted to support a predefined set of locales. It is recommended to set one of the application locales as the default application locale (by specifying default="yes") so that it can be used as a fall back locale for customers who are connecting to the application with an unsupported locale. This section defines the order in which the preferred user locale is determined. The locale sources should be specified based on the scenario in the application. This section includes the following scenarios:. <db-locale-sourceoracle.i18n.servlet.localesource.DBLocaleSource</db-locale-source> <locale-source>oracle.i18n.servlet.localesource.HttpAcceptLanguage</locale-source> Note that Scenario 3 includes the predefined database locale source, DBLocaleSource. It enables the user profile information to be specified in the configuration file without writing a custom database locale source. In the example, the user profile table is called "customer". The columns are "customer_email", "nls_language", "nls_territory", and "timezone". They store the unique e-mail address, the Oracle name of the preferred language, the Oracle name of the preferred territory, and the time zone ID of a customer. The user-key is a mandatory attribute that specifies the attribute name used to pass the user ID from the application to the GDK framework.. <locale-source>demo.DatabaseLocaleSource</locale-source> <locale-source>oracle.i18n.servlet.localesource.UserInput</locale-source> <locale-source>oracle.i18n.servlet.localesource.HttpAcceptLanguage</locale-source> Note that Scenario 4 uses the custom database locale source. If the user profile schema is complex, such as user profile information separated into multiple tables, then the custom locale source should be provided by the application. Examples of custom locale sources can be found in the $ORACLE_HOME/nls/gdk/demo directory. The tag defines the name of the locale parameters that are used in the user input so that the current user locale can be passed between requests. Table 8-3 shows the parameters used in the GDK framework. The parameter names are used in either the parameter in the HTML form or in the URL. This tag defines the base class names of the resource bundles used in the application. The mapping is used in the Localizer.getMessage method for locating translated text in the resource bundles. <message-bundles> <resource-bundle>Messages</resource-bundle> <resource-bundleNewMessages</resource-bundle> </message-bundles> If the name attribute is not specified or if it is specified as name="default" to the <resource-bundle> tag, then the corresponding resource bundle is used as the default message bundle. To support more than one resource bundle in an application, resource bundle names must be assigned to the nondefault resource bundles. The nondefault bundle names must be passed as a parameter of the getMessage method. For example: Localizer loc = ServletHelper.getLocalizerInstance(request); String translatedMessage = loc.getMessage("Hello"); String translatedMessage2 = loc.getMessage("World", "newresource"); This tag is used to control the behavior of the URL rewrite operations. The rewriting rule is a regular expression. <url-rewrite-rule <pattern>(.*)/([^/]+)$</pattern> <result>$1/$L/$2</result> </url-rewrite-rule> See Also:"Managing Localized Content in the GDK" If the localized content for the requested locale is not available, then it is possible for the GDK framework to trigger the locale fallback mechanism by mapping it to the closest translation locale. By default the fallback option is turned off. This can be turned on by specifying fallback="yes". For example, suppose an application supports only the following translations: de, and ja, and en is the default locale of the application. If the current application locale is de-US, then it falls back to de. If the user selects zh-TW as its application locale, then it falls back to A fallback mechanism is often necessary if the number of supported application locales is greater than the number of the translation locales. This usually happens if multiple locales share one translation. One example is Spanish. The application may need to support multiple Spanish-speaking countries and not just Spain, with one set of translation files. Multiple URL rewrite rules can be specified by assigning the name attribute to nondefault URL rewrite rules. To use the nondefault URL rewrite rules, the name must be passed as a parameter of the rewrite URL method. For example: <img src="<%=ServletHelper.rewriteURL("images/welcome.gif", request) %>"> <img src="<%=ServletHelper.rewriteURL("US.gif", "flag", request) %>"> The first rule changes the "images/welcome.gif" URL to the localized welcome image file. The second rule named "flag" changes the "US.gif" URL to the user's country flag image file. The rule definition should be as follows: <url-rewrite-rule <pattern>(.*)/([^/]+)$</pattern> <result>$1/$L/$2</result> </url-rewrite-rule> <url-rewrite-rule <pattern>US.gif/pattern> <result>$C.gif</result> </url-rewrite-rule> This section contains an example of an application configuration file with the following application properties: is stored in /ja/shop/welcome.jpg. <?xml version="1.0" encoding="utf-8"?> <gdkapp xmlns: <!-- Language to Character set mapping --> <locale-charset-maps> <locale-charset> <locale>ja</locale> <charset>UTF-8</charset> </locale-charset> <locale-charset> <locale>en,de</locale> <user-agent>^Mozilla\/[0-9\. ]+\(compatible; MSIE [^;]+; \)</user-agent> <charset>WINDOWS-1252</charset> </locale-charset> <locale-charset> <locale>en,de,fr</locale> <charset>ISO-8859-1</charset> </locale-charset> </locale-charset-maps> <!-- Application Configurations --> <page-charset>AUTO-CHARSET</page-charset> <application-locales> <locale>ar</locale> <locale>de</locale> <locale>fr</locale> <locale>ja</locale> <locale>el</locale> <locale default="yes">en</locale> <locale>zh-CN</locale> </application-locales> <locale-determine-rule> <locale-source>oracle.i18n.servlet.localesource.UserInput</locale-source> <locale-source>oracle.i18n.servlet.localesource.HttpAcceptLanguage</locale-source> </locale-determine-rule> <!-- URL rewriting rule --> <url-rewrite-rule <pattern>(.*)/([^/]+)$</pattern> <result>/$L/$1/$2</result> </url-rewrite-rule> </gdkapp> Oracle Globalization Services for Java contains the following packages: Package oracle.i18n.lcsd provides classes to automatically detect and recognize language and character set based on text input. It supports the detection of both plain text and HTML files. Language is based on ISO; encoding is based on IANA or Oracle character sets. It includes the following classes: LCSDetector: Contains methods to automatically detect and recognize language and character set based on text input. LCSDResultSet: The LCSDResultSet. Package oracle.i18n.net provides Internet-related data conversions for globalization. It includes the following classes: CharEntityReference: A utility class to escape or unescape a string into character reference or entity reference form CharEntityReference.Form: A form parameter class that specifies the escaped form Package oracle.i18n.Servlet enables JSP and JavaServlet to have automatic locale support and also returns the localized contents to the application. It includes the following classes: ApplicationContext: An application context class that governs application scope operation in the framework Localizer: An all-in-one object class that enables access to the most commonly used globalization information ServletHelper: A delegate class that bridges between Java servlets and globalization objects Package oracle.i18n.text provides general text data globalization support. It includes the following classes: OraCollationKey: A class which represents a String under certain rules of a specific OraCollator object OraCollator: A class to perform locale-sensitive string comparison, including linguistic collation and binary sorting OraDateFormat: An abstract class to do formatting and parsing between datetime and string locale. It supports Oracle datetime formatting behavior. OraDecimalFormat: A concrete class to do formatting and parsing between number and string locale. It supports Oracle number formatting behavior. OraDecimalFormatSymbol: A class to maintain Oracle format symbols used by Oracle number and currency formatting OraNumberFormat: An abstract class to do formatting and parsing between number and string locale. It supports Oracle number formatting behavior. OraSimpleDateFormat: A concrete class to do formatting and parsing between datetime and string locale. It supports Oracle datetime formatting behavior. Package oracle.i18n.util provides general utilities for globalization support. It includes the following classes: LocaleMapper: Provides mappings between Oracle locale elements and equivalent locale elements in other vendors and standards OraDisplayLocaleInfo: A translation utility class that provides the translations of locale and attributes OraLocaleInfo: An Oracle locale class that includes the language, territory, and collator objects OraSQLUtil: An Oracle SQL Utility class that includes some useful methods of dealing with SQL The GDK for PL/SQL includes the following PL/SQL packages: UTL_I18N UTL_LMS UTL_I18N is a set of PL/SQL services that help developers to build globalized applications. The UTL_I18N PL/SQL package provides the following functions: String conversion functions for various datatypes. See Also:PL/SQL Packages and Types Reference
http://docs.oracle.com/cd/B19306_01/server.102/b14225/ch8gdk.htm
CC-MAIN-2015-48
en
refinedweb
.util; 32 33 34 /*** 35 * An exception to indicate an error parsing a date string. 36 * 37 * @see DateUtil 38 * 39 * @author Michael Becke 40 */ 41 public class DateParseException extends Exception { 42 43 /*** 44 * 45 */ 46 public DateParseException() { 47 super(); 48 } 49 50 /*** 51 * @param message the exception message 52 */ 53 public DateParseException(String message) { 54 super(message); 55 } 56 57 }
http://hc.apache.org/httpclient-legacy/xref/org/apache/commons/httpclient/util/DateParseException.html
CC-MAIN-2015-48
en
refinedweb
Opened 6 years ago Closed 5 years ago Last modified 3 years ago #11877 closed Uncategorized (fixed) Document that request.get_host() fails when behind multiple reverse proxies Description We run django behind several layers of proxies (please excuse ASCII art): Client | | Apache (handling SSL connections, mod_proxy) | | Apache (handling static content, load balancing, mod_proxy, mod_proxy_balancer) | | | | Apache (mod_fastcgi) Apache (mod_fastcgi) | | | | django instance django instance Each apache instance that proxies a request appends the ServerName of the proxy server into the X-Forwarded-For and X-Forwarded-Host headers. In our infrastructure, all of the apache instances respond to the same host name (which is preserved through the proxying using ProxyPreserveHost directive), so it ends up looking like this in request.META: 'HTTP_X_FORWARDED_FOR: '10.0.0.1, 10.0.0.2' 'HTTP_X_FORWARDED_HOST': 'portal.example.com, portal.example.com' 'HTTP_X_FORWARDED_SERVER': 'portal.example.com, portal.example.com' This then breaks request.get_host(), which does the following: def get_host(self): """Returns the HTTP host using the environment or request headers.""" # We try three options, in order of decreasing preference. if 'HTTP_X_FORWARDED_HOST' in self.META: host = self.META['HTTP_X_FORWARDED_HOST'] elif 'HTTP_HOST' in self.META: host = self.META['HTTP_HOST'] else: # Reconstruct the host using the algorithm from PEP 333. host = self.META['SERVER_NAME'] server_port = str(self.META['SERVER_PORT']) if server_port != (self.is_secure() and '443' or '80'): host = '%s:%s' % (host, server_port) return host IE, it completely ignores the possibility of more than one host in X-Forwarded-Host. Breaking request.get_host() breaks request.build_absolute_uri(), which in turn breaks HttpResponseRedirect*, leading to redirects with location headers like: Location:, portal.example.com/foo/ I've not attached a patch, because I can think of a number of ways this could be fixed: 1) Change request parsing to notice multi value headers and correctly parse into arrays. 2) Change request.get_host() to look for multi value versions of X-Forwarded-Host and pull out the correct value. 3) Add separate middleware to rewrite request.META with just the 'closest' version of these headers. ... any number of other solutions. This obviously is not a 'normal' deployment of django... We will probably work around with custom middleware for now, it is the least intrusive. This is with 1.0, but the code for request.get_host() is the same in trunk. Attachments (2) Change History (8) Changed 6 years ago by tomevans222 comment:1 Changed 6 years ago by jacob - Component changed from Core framework to Documentation - Needs documentation unset - Needs tests unset - Patch needs improvement unset - Summary changed from request.get_host() fails when behind multiple reverse proxies to Document that request.get_host() fails when behind multiple reverse proxies - Triage Stage changed from Unreviewed to Accepted As you say, this is not a "normal" way of deploying Django, and I don't think there'll be a general solution here. See the back and forth about handling X-Forwarded-For for some background: the basic problem is that Django can't magically know which of a list of values is "correct" here. I think that your solution of handling this problem in middleware is as good as it's gonna get. It would, however, be good to have this documented, so I'm hijacking this ticket and turning it into a doc request. We could add a note to the docs for request.get_host() and include your little bit of middleware as an example. Feel free to work up a doc patch if you wanna grease the wheels a bit. comment:2 Changed 6 years ago by tomevans222 That sounds perfectly reasonable Jacob. I'll try to get a doc patch up as soon as $JOB allows :) Changed 6 years ago by arnav patch with changes to documentation including example comment:3 Changed 6 years ago by arnav - Has patch set documentation patch added comment:4 Changed 5 years ago by gabrielhurley - Resolution set to fixed - Status changed from new to closed (In [14493]) Fixed #11877 -- Documented that HttpRequest.get_host() fails behind multiple reverse proxies, and added an example middleware solution. Thanks to Tom Evans for the report, and arnav for the patch. comment:5 Changed 5 years ago by gabrielhurley (In [14494]) [1.2.X] Fixed #11877 -- Documented that HttpRequest.get_host() fails behind multiple reverse proxies, and added an example middleware solution. Thanks to Tom Evans for the report, and arnav for the patch. Backport of [14493] from trunk. comment:6 Changed 3 years ago by John Borwick <john_borwick@…> - Easy pickings unset - Severity set to Normal - Type set to Uncategorized - UI/UX unset Note for other readers: when using the included MultipleProxyMiddleware, consider whether you want line 30 to pull the *last* element [-1] or the *first* element [0]. The right-most/last is supposed to be the most recent proxy (per <>). The left-most is the furthest upstream proxy. Middleware to work around the issue
https://code.djangoproject.com/ticket/11877
CC-MAIN-2015-48
en
refinedweb
Java Access to SQL Azure via the JDBC Driver for SQL Server The Cloud Zone is brought to you in partnership with Iron.io. Discover how Microservices have transformed the way developers are building and deploying applications in the era of modern cloud infrastructure. I’ve written a couple of posts (here and here) about Java and the JDBC Driver for SQL Server with the promise of eventually writing about how to get a Java application running on the Windows Azure platform. In this post, I’ll deliver on that promise. Specifically, I’ll show you two things: 1) how to connect to a SQL Azure Database from a Java application running locally, and 2) how to connect to a SQL Azure database from an application running in Windows Azure. You should consider these as two ordered steps in moving an application from running locally against SQL Server to running in Windows Azure against SQL Azure. In both steps, connection to SQL Azure relies on the JDBC Driver for SQL Server and SQL Azure. The instructions below assume that you already have a Windows Azure subscription. If you don’t already have one, you can create one here:. (You’ll need a Windows Live ID to sign up.) I chose the Free Trial email after signing up). Connecting to SQL Azure from an application running locally I’m going to assume you already have an application running locally and that it uses the JDBC Driver for SQL Server. If that isn’t the case, then you can start from scratch by following the steps in this post: Getting Started with the SQL Server JDBC Driver. Once you have an application running locally, then the process for running that application with a SQL Azure back-end requires two steps: 1. Migrate your database to SQL Azure. This only takes a couple of minutes (depending on the size of your database) with the SQL Azure Migration Wizard - follow the steps in the Creating a SQL Azure Server and Creating a SQL Azure Database sections of this post. 2. Change the database connection string in your application. Once you have moved your local database to SQL Azure, you only have to change the connection string in your application to use SQL Azure as your data store. In my case (using the Northwind database), this meant changing this… String connectionUrl = "jdbc:sqlserver://serverName\\sqlexpress;" + "database=Northwind;" + "user=UserName;" + "password=Password"; …to this… String connectionUrl = "jdbc:sqlserver://xxxxxxxxxx.database.windows.net;" + "database=Northwind;" + "user=UserName@xxxxxxxxxx;" + "password=Password"; (where xxxxxxxxxx is your SQL Azure server ID). Connecting to SQL Azure from an application running in Windows Azure The heading for this section might be a bit misleading. Once you have a locally running application that is using SQL Azure, then all you have to do is move your application to Windows Azure. The connecting part is easy (see above), but moving your Java application to Windows Azure takes a bit more work. Fortunately, Ben Lobaugh has written a great post that that shows how to use the Windows Azure Starter Kit for Java to get a Java application (a JSP application, actually) running in Windows Azure: Deploying a Java application to Windows Azure with Command-Line Ant. (If you are using Eclipse, see Ben’s related post: Deploying a Java application to Windows Azure with Eclipse.) I won’t repeat his work here, but I will call out the steps I took in modifying his instructions to deploy a simple JSP page that connects to SQL Azure. 1. Add the JDBC Driver for SQL Server to the Java archive. One step in Ben’s tutorial (see the Select the Java Runtime Environment section) requires that you create a .zip file from your local Java installation and add it to your Java/Azure application. Most likely, your local Java installation references the JDBC driver by setting the classpath environment variable. When you create a .zip file from your java installation, the JDBC driver will not be included and the classpath variable will not be set in the Azure environment. I found the easiest way around this was to simply add the sqljdbc4.jar file (probably located in C:\Program Files\Microsoft SQL Server JDBC Driver\sqljdbc_3.0\enu) to the \lib\ext directory of my local Java installation before creating the .zip file. Note: You can put the JDBC driver in a separate directory, include it when you create the .zip folder, and set the classpath environment variable in the startup.bat script. But, I found the above approach to be easier. 2. Modify the JSP page. Instead of the code Ben suggests for the HelloWorld.jsp file (see the Prepare your Java Application section), use code from your locally running application. In my case, I just used the code from this post after changing the connection string and making a couple minor JSP-specific changes: <%@ page language="java" contentType="text/html; charset = ISO-8859-1" import = "java.sql.*" %> <html> <head> <title>SQL Azure via JDBC</title> </head> <body> <h1>Northwind Customers</h1> <% try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); String connectionUrl = "jdbc:sqlserver://xxxxxxxxxx.database.windows.net;" + "database=Northwind;" + "user=UserName@xxxxxxxxxx;" + "password=Password"; Connection con = DriverManager.getConnection(connectionUrl); out.print("Connected.<br/>"); String SQL = "SELECT CustomerID, ContactName FROM Customers"; Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(SQL); while (rs.next()) { out.print(rs.getString(1) + ": " + rs.getString(2) + "<br/>"); } }catch(Exception e){ out.print("Error message: "+ e.getMessage()); } %> </body> </html> That’s it!. To summarize the steps… - Migrate your database to SQL Azure with the SQL Azure Migration Wizard. - Change the database connection in your locally running application. - Use the Windows Azure Starter Kit for Java to move your application to Windows Azure. (You’ll need to follow instructions in this post and instructions above.) Thanks. -Brian The Cloud Zone is brought to you in partnership with Iron.io. Learn how to build and test their Go programs inside Docker containers. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/java-access-sql-azure-jdbc?mz=62447-cloud
CC-MAIN-2015-48
en
refinedweb
Web consultancy based in Tel Aviv, Israel, and Berlin, Germany. We're hiring. Read our blog. Simple database and filesystem backups with S3 and Rackspace Cloud Files support (with optional encryption) We needed a backup solution that will satisfy the following requirements: And since we didn't find any, we wrote our own :) The following functionality was contributed by astrails-safe users: Thanks to all :) sudo gem install astrails-safe --source Please report problems at the Issues tracker Usage: astrails-safe [OPTIONS] CONFIG_FILE Options: -h, --help This help screen -v, --verbose be verbose, duh! -n, --dry-run just pretend, don't do anything. -L, --local skip remote storage, only do local backups Note: CONFIG_FILE will be created from template if missing If you want to encrypt your backups you have 2 options: * use simple password encryption * use GPG public key encryption IMPORTANT: some gpg installations automatically set 'use-agent' option in the default configuration file that is created when you run gpg for the first time. This will cause gpg to fail on the 2nd run if you don't have the agent running. The result is that 'astrails-safe' will work ONCE when you manually test it and then fail on any subsequent run. The solution is to remove the 'use-agent' from the config file (usually /root/.gnupg/gpg.conf) To mitigate this problem for the gpg 1.x series '--no-use-agent' option is added by defaults to the autogenerated config file, but for gpg2 is doesn't work. as the manpage says it: "This is dummy option. gpg2 always requires the agent." :( For simple password, just add password entry in gpg section. For public key encryption you will need to create a public/secret keypair. We recommend to create your GPG keys only on your local machine and then transfer your public key to the server that will do the backups. This way the server will only know how to encrypt the backups but only you will be able to decrypt them using the secret key you have locally. Of course you MUST backup your backup encryption key :) We recommend also pringing the hard paper copy of your GPG key 'just in case'. The procedure to create and transfer the key is as follows: run gpg --gen-key on your local machine and follow onscreen instructions to create the key (you can accept all the defaults). extract your public key into a file (assuming you used test@example.com as your key email): gpg -a --export test@example.com > test@example.com.pub transfer public key to the server scp test@example.com.pub root@example.com: import public key on the remote system: $ gpg --import test@example.com.pub gpg: key 45CA9403: public key "Test Backup test@example.com" imported gpg: Total number processed: 1 gpg: imported: 1 since we don't keep the secret part of the key on the remote server, gpg has no way to know its yours and can be trusted. To fix that we can sign it with other trusted key, or just directly modify its trust level in gpg (use level 5): $ gpg --edit-key test@example.com ... Command> trust ... 1 = I don't know or won't say 2 = I do NOT trust 3 = I trust marginally 4 = I trust fully 5 = I trust ultimately m = back to the main menu Your decision? 5 ... Command> quit export your secret key for backup (we recommend to print it on paper and burn to a CD/DVD and store in a safe place): $ gpg -a --export-secret-key test@example.com > test@example.com.key safe do local :path => "/backup/:kind/:id" s3 do key "...................." secret "........................................" bucket "backup.astrails.com" path "servers/alpha/:kind/:id" end cloudfiles do user "..........." api_key "................................." container "safe_backup" path ":kind/" # this is default service_net false end sftp do host "s" user "astrails" # port 8023 password "ssh password for sftp" end gpg do command "/usr/local/bin/gpg" options "--no-use-agent" # symmetric encryption key # password "qwe" # public GPG key (must be known to GPG, i.e. be on the keyring) key "backup@astrails.com" end keep do local 20 s3 100 cloudfiles 100 sftp 100 end mysqldump do options "-ceKq --single-transaction --create-options" user "root" password "............" socket "/var/run/mysqld/mysqld.sock" database :blog database :servershape database :astrails_com database :secret_project_com do skip_tables "foo" skip_tables ["bar", "baz"] end end svndump do repo :my_repo do repo_path "/home/svn/my_repo" end end pgdump do options "-i -x -O" # -i => ignore version, -x => do not dump privileges (grant/revoke), -O => skip restoration of object ownership in plain text format user "username" password "............" # shouldn't be used, instead setup ident. Current functionality exports a password env to the shell which pg_dump uses - untested! database :blog database :stateofflux_com end tar do options "-h" # dereference symlinks archive "git-repositories", :files => "/home/git/repositories" archive "dot-configs", :files => "/home/*/.[^.]*" archive "etc", :files => "/etc", :exclude => "/etc/puppet/other" archive "blog-astrails-com" do files "/var/www/blog.astrails.com/" exclude "/var/www/blog.astrails.com/log" exclude "/var/www/blog.astrails.com/tmp" end archive "astrails-com" do files "/var/www/astrails.com/" exclude ["/var/www/astrails.com/log", "/var/www/astrails.com/tmp"] end end end
http://astrails.com/opensource/astrails-safe
CC-MAIN-2015-48
en
refinedweb
Logbook query program Started: Monday, January 14; Due: Friday, January 18, at 9:00 am Overview This is your first graded lab. You will work on this lab together with a partner, being sure that it accomplishes all of the tasks that I set forth below. You should decide on your teams and inform me on Monday. In grading this lab, I will check for correctness, robustness, documentation, and that you make good usage of procedures. Obviously, your code should compile without warnings. Your programming tasks We used to have monitors in our MCS computer lab. When the lab monitors worked, a ``logbook'' program would record the times they worked. That program was the final project for one programming team in MC39 (now MCS270, Object-oriented Software Development) a few years ago. They actually wrote a collection of several related programs, one for logging in and out, one for printing out the records, etc. The interface between these programs was certain file formats that conveyed data between them. In this programming, you will write an additional program that would allow an MCS lab monitor to determine how many hours he or she has worked so far this month. There is a file that contains all the data from the month, with one line per monitoring shift. Each line contains three numbers with colons between them. The first is the user identification number, or uid, of the monitor; the second is the starting time; and the third is the ending time. The times are measured in seconds since an uninteresting reference point. So, for example, the line 9041:3000:6600would indicate that the monitor with uid9041 worked a shift that lasted for 3600 seconds, i.e., exactly one hour, starting at time 3000 and ending at time 6600. What you need to do is read these lines in one by one, until end of file is reached, and for each check whether the uidis the one you are looking for. If so, the difference between the start and end times should be added to a running sum. At the end, this running sum can be divided by 3600.0 to get the number of hours the monitor worked, and this can be output. As described in the book, you can check for end of file by testing when the input operation, such as cin >> uid, has a false value. Since the times are quite large, the uidand start and end times should be input into variables of type long, and a longshould also be used for the running total time. One detail is how to know what the uidof the monitor running the program is; what you can do is put the line #include <unistd.h>at the top of your program file and then use the getuid()procedure to get the uidof the user running the program. (It'd be most efficient to do this only once, rather than for each line.) You can download a sample data file logbook.data. Assuming your program is called myHoursand that you are running it in the directory containing the data, you can use the <feature of the shell, as in ./myHours < logbook.datawhich runs the myHours program with its standard input coming from logbook.data. Since this is an MCS lab logbook file that does not contain any of your uids, you are going to have to figure out what your uidis and insert it at several places in the datafile. How many hours did you work? (Be sure to also test your program with inputs simple enough for you to easily check the answer.) One thing I will be looking for in your program is that it does appropriate checks for valid input. By this, I mean that it checks for the following: - Each input line is of the specified format, with no extraneous space - Each starting time precedes the corresponding ending time It's best to send errors to cerrrather than cout: cerr << "Line 2412: Missing colon\n";The test input file has no errors; be sure to introduce errors in your short test file to be sure your program is handling errors properly. Text. Helpful commands A few commands will help you do error checking: - You can peek at the next character without reading it in char c = cin.peek(). - You can find out if a character is a digit using isdigit(c). (You need to #include <ctype.h> - A newline is the character '\n'. (Single quotes denote characters, double quotes are strings.) - You can read (and skip over) the colons by using cin.get(c). - You can detect end of file by first peeking past the end of file and then checking if cin.eof()returns true. - Lazy evaluation of andand oron page 114 will help keep your code clean. In the gdbdebugger you can type (gdb) run < logbook.datato make gdbredirect input from file logbook.data. PostScript Incidentally, once you've successfully completed this problem, the only minor detail standing in the way of it being a useful addition to the logbook system is getting it to automatically access the real data file, rather than needing input fed to it with <. Although we haven't dealt with this yet, it is a very simple matter. So, this problem is a good example of the fact that even a minor amount of custom programming can be useful to someone, particularly when used together with other existing programs. Submitting your code Use Eclipse to export your project directory to a zip file of the same name as your project (I will go over this in class, and you are welcome to ask me for help on this). Then email me that zip
http://homepages.gac.edu/~mc38/2013J/labs/lab7.php
CC-MAIN-2015-48
en
refinedweb
Code: using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Drawing; public partial class _Default : System.Web.UI.Page { protected void Button1_Click(object sender, EventArgs e) { //get the path to the image string path = Server.MapPath(Image1.ImageUrl); //create an image object from the image in that path System.Drawing.Image img = System.Drawing.Image.FromFile(path); //rotate the image img.RotateFlip(RotateFlipType.Rotate90FlipXY); //save the image out to the file img.Save(path); //release image file img.Dispose(); } } Code: 21: Line 22: //save the image out to the file Line 23: img.Save(path); Line 24: Line 25: //release image.
http://www.codingforums.com/asp-net/298391-image-rotate-almost-working.html?s=97bb8dcb5f2f079c61386bcac209c766
CC-MAIN-2015-48
en
refinedweb
Closed Bug 440932 Opened 14 years ago Closed 14 years ago toolkit dlmgr should be buildable by suite Categories (Toolkit Graveyard :: Build Config, defect) Tracking (Not tracked) People (Reporter: Callek, Assigned: Callek) References Details Attachments (2 files, 2 obsolete files) +++ This bug was initially created as a clone of Bug #381157 +++ Bug 381157 requires some toolkit/ changes to enable the DLMGR. This bug will track those changes, adding a new define/makefile variable that Suite's build process can use. Due to current 1.9.0 rules this needs to apply and be pushed to mozilla-central first. r? sdwilsh for toolkit; sr? from neil for xpfe/ (If anyone knows a cleaner way to do these makefile ifdef's please tell me) Attachment #326074 - Flags: superreview?(neil) Attachment #326074 - Flags: review?(sdwilsh) whops, correcting summary and component... Assignee: bugspam.Callek → nobody Status: ASSIGNED → NEW Component: Download Manager → Build Config Product: Mozilla Application Suite → Toolkit QA Contact: download-manager → build-config Summary: Make SeaMonkey download manager use toolkit backend → toolkit dlmgr should be buildable by suite Target Milestone: seamonkey1.0alpha → --- Assignee: nobody → bugspam.Callek Status: NEW → ASSIGNED Is anyone else still using the xpfe download manager? re: c#2, not that I could tell. In that case, might it be easier to have a variable SUITE_USING_XPFE_DM which is turned on by default for suite so you can replace the toolkit ifndef MOZ_SUITE with ifndef SUITE_USING_XPFE_DM rather than the triple ifdef in your patch? Comment on attachment 326074 [details] [diff] [review] patch to mozilla-central > ifneq ($(MOZ_BUILD_APP),camino) >+ifdef MOZ_SUITE >+ifdef SUITE_USING_TOOLKIT_DM > DIRS += download-manager >+endif >+else >+DIRS += download-manager >+endif > endif I don't think the ifdef MOZ_SUITE is necessary as nobody else should be running this Makefile except for camino which is already excluded. I also think your ifdef SUITE_USING_TOOLKIT_DM should be an ifndef. >+#if !defined(SUITE_USING_TOOLKIT_DM) I'd prefer #ifndef Comment on attachment 326074 [details] [diff] [review] patch to mozilla-central Address Neil's comments first, thanks. Attachment #326074 - Flags: review?(ted.mielczarek) → review- (In reply to comment #5) > I don't think the ifdef MOZ_SUITE is necessary as nobody else should be running > this Makefile except for camino which is already excluded. I also think your > ifdef SUITE_USING_TOOLKIT_DM should be an ifndef. Not quite right, everyone is still running this Makefile, but its only Suite/Camino currently running that part of the Makefile. Here is the updated mozilla-central patch... (Note: suite/app-config.mk is included in this patch though would not be pushed to mozilla-central, but it would be applied to 1.9.0.x when it comes time) Attachment #326074 - Attachment is obsolete: true Attachment #326683 - Flags: superreview?(neil) Attachment #326683 - Flags: review?(ted.mielczarek) Attachment #326074 - Flags: superreview?(neil) Comment on attachment 326683 [details] [diff] [review] patch to mozilla-central >+++ b/suite/app-config.mk >@@ -0,0 +1,2 @@ >+SUITE_USING_XPFE_DM=1 >+DEFINES+="SUITE_USING_XPFE_DM=1" I don't think quotes are right here, and I think spaces would be a good idea. >\ No newline at end of file Fix please! >-ifndef MOZ_SUITE >-# XXX Suite doesn't want these just yet > ifdef MOZ_RDF >+ifndef SUITE_USING_XPFE_DM [Twice] Please leave the ifdefs in the same order i.e. suite first, then RDF. >-endif >-endif >+endif # SUITE_USING_XPFE_DM >+endif # MOZ_RDF And I don't see the point of reannotating these, it's only a 1-line ifdef! > ifneq ($(MOZ_BUILD_APP),camino) >+ifdef SUITE_USING_XPFE_DM You could probably remove the camino check; they won't set SUITE_USING_XPFE_DM Attachment #326683 - Flags: superreview?(neil) → superreview+ Comment on attachment 326683 [details] [diff] [review] patch to mozilla-central +DEFINES+="SUITE_USING_XPFE_DM=1" I think this needs to be: DEFINES+="-DSUITE_USING_XPFE_DM=1" Attachment #326683 - Flags: review?(ted.mielczarek) → review+ Pushed to mozilla-central, (minus suite/app-config.mk) going to let it bake a bit before committing to CVS (and requesting approval) pushing to ssh://hg.mozilla.org/mozilla-central/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 7 changes to 7 files Attachment #326683 - Attachment is obsolete: true Status: ASSIGNED → RESOLVED Closed: 14 years ago Resolution: --- → FIXED Comment on attachment 326826 [details] [diff] [review] Patch for checkin baking fine on mozilla-central. Should only affect seamonkey build. Attachment #326826 - Flags: approval1.9.0.1? Unfortunately, this patch is incomplete and I think the bug should be reopened. As app-config.mk gets included by config.mk, we need to have the latter loaded before using any such var in a Makefile.in! Status: RESOLVED → REOPENED Resolution: FIXED → --- I'm not sure if it's the ideal place for every one of those includes, but those includes of config.mk are needed for the new flag and MOZ_SUITE/MOZ_THUNDERBIRD to work in the new world, as it's now config.mk which loads those. Attachment #327280 - Flags: review?(ted.mielczarek) Comment on attachment 327280 [details] [diff] [review] supplemantal patch for including config.mk early enough Looks good. Attachment #327280 - Flags: review?(ted.mielczarek) → review+ supplementary patch checked in as changeset e7939e8a558e, so should be really fixed now. Status: REOPENED → ASSIGNED Status: ASSIGNED → RESOLVED Closed: 14 years ago → 14 years ago Resolution: --- → FIXED Is this patch needed in CVS (1.9.0) since SeaMonkey is moving to hg? If so, please provide a combined patch with both the original patch and the follow up one. Comment on attachment 326826 [details] [diff] [review] Patch for checkin removing approval request as it does appear we won't need this in 1.9.0 due to SeaMonkey's move happening even sooner than I expected. Attachment #326826 - Flags: approval1.9.0.2? Product: Toolkit → Toolkit Graveyard
https://bugzilla.mozilla.org/show_bug.cgi?id=440932
CC-MAIN-2022-33
en
refinedweb
Solcast API Project description pysolcast Solcast API Client library for interacting with the Solcast API Basic Usage from pysolcast import RooftopSite site = RooftopSite(api_key, resource_id) forecasts = site.get_forecasts() Full API Documentation. History 1.0.2 (2020-04-14) - Release to pypi 1.0.0 (2020-04-10) - First release 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. Source Distribution pysolcast-1.0.3.tar.gz (22.4 kB view hashes) Built Distributions pysolcast-1.0.3-py3.8.egg (6.1 kB view hashes)
https://pypi.org/project/pysolcast/1.0.3/
CC-MAIN-2022-33
en
refinedweb
Spring integration Java DSL 1.1 M1 is available Dear Spring community, We are pleased to announce that the Spring Integration Java DSL 1.1 Milestone 1 is now available. Use the Milestone Repository with Maven or Gradle to try it in early access. compile "org.springframework.integration:spring-integration-java-dsl:1.1.0.M1" To be honest, many of the planned features for 1.1 are not implemented yet, but thanks to encouragement from our pal Josh Long and the recent announcement about the Apache Kafka support (Spring Integration Kafka Support 1.1 Release, Spring XD 1.1.1 Release), we’ve released this Milestone 1 mainly to showcase the Apache Kafka support in the Java Configuration DSL. We’ll look at that, and other, features from this release in this post. Apache Kafka Support Let’s start with some “trivial” sample from the KafkaTests class in the Spring Integration Java DSL : @Bean public ConnectionFactory connectionFactory(EmbeddedZookeeper zookeeper) { return new DefaultConnectionFactory( new ZookeeperConfiguration(zookeeper.connectString())); } @Bean public OffsetManager offsetManager(ConnectionFactory connectionFactory) { MetadataStoreOffsetManager offsetManager = new MetadataStoreOffsetManager(connectionFactory); // start reading at the end of the offsetManager.setReferenceTimestamp(OffsetRequest.LatestTime()); return offsetManager; } @Bean public IntegrationFlow listeningFromKafkaFlow( ConnectionFactory connectionFactory, OffsetManager offsetManager) { return IntegrationFlows .from(Kafka.messageDriverChannelAdapter(connectionFactory, TEST_TOPIC) .autoCommitOffset(false) .payloadDecoder(String::new) .keyDecoder(b -> Integer.valueOf(new String(b))) .configureListenerContainer(c -> c.offsetManager(offsetManager) .maxFetch(100))) .<String, String>transform(String::toUpperCase) .channel(c -> c.queue("listeningFromKafkaResults")) .get(); } - The EmbeddedZookeeperis a part of Apache Kafka testartifact ( testCompile 'org.apache.kafka:kafka_2.10:0.8.1.1:test'in our case) and, along with many other features like kafka.utils.TestUtils, it is very useful for unit testing. - Please refer to the Spring Integration Kafka project for more information on ConnectionFactoryand OffsetManager. - The most important part in the config above is IntegrationFlowbean definition. The Spring Integration Java DSL provides a namespace factory - Kafka- which utilizes IntegrationComponentSpecimplementations for the Spring Integration Kafka adapters, like KafkaMessageDrivenChannelAdapterSpecfor the KafkaMessageDrivenChannelAdapter. - An example of the builder pattern, the spec just delegates options from method-chainto the underlying KafkaMessageDrivenChannelAdapterinstance. - For those, like yours truly, who are not familiar with Scala (which is the language Apache Kafka is written in), pay attention to the .payloadDecoder(String::new)line. The kafka.serializer.Decoderis a Scala traitthat is compiled to a Java interface (not a class!) so we can represent it here as a Java 8 lambda method. - the .configureListenerContainer()is a lambda-aware method to separate concerns for the KafkaMessageListenerContainer-specific options. The other self-explained factory-methods from the Kafka namespace factory are .inboundChannelAdapter(...) for the KafkaHighLevelConsumerMessageSource polling adapter and .outboundChannelAdapter(...) for the KafkaProducerMessageHandler. Please refer to their JavaDocs for more information. For more information, check out Josh Long’s post on Using Apache Kafka for Integration and Data Processing Pipelines with Spring! POJO Method invocation A lot of the great feedback from the community (Webinar Replay: Introducing the Java DSL for Spring Integration) was around the bean method invocation components (services, transformers, routers, etc.) and we heard you loud-and-clear: component method selection has been improved. Here is a sample that is analogous to a <int:service-activator in the XML configuration: @Configuration @EnableIntegration @ComponentScan public class MyConfiguration { @Autowired private GreetingService greetingService; @Bean public IntegrationFlow greetingFlow() { return IntegrationFlows.from("greetingChannel") .handle(this.greetingService) .get(); } } @Component public class GreetingService { public void greeting(String payload) { System.out.println("Hello " + payload); } } Here, the greeting method will automatically be selected by the framework. There is an alternative that takes a methodName argument to specify a method in the case of ambiguity. Similar POJO method invocation EIP-methods have been introduced for many other EIP implementations like transform(Object service, String methodName), split(Object service), etc. The Spring Integration Java DSL also respects Spring Integration messaging annotations like @ServiceActivator, @Router, @Filter, etc., and even @Payload, @Header. Please, refer to IntegrationFlowDefinition JavaDocs for more information. IntegrationFlowAdapter It shouldn’t be a surprise that as IntegrationFlow is an interface, we can just provide its direct implementation as a custom component and it works as-is in the Spring Integration Java DSL environment: @Component public class MyFlow implements IntegrationFlow { @Override public void configure(IntegrationFlowDefinition<?> f) { f.<String, String>transform(String::toUpperCase); } } This is similar to the @Bean definitions, but this approach helps our components stay more loosely coupled. But, wait, there’s more! IntegrationFlow implementations (like lambdas in the @Bean definition case) are limited to DirectChannel input channels. We went further here and introduced the IntegrationFlowAdapter. Here’s my favorite sample to demonstrate how it can be used: @Component public class MyFlowAdapter extends IntegrationFlowAdapter { private final AtomicBoolean invoked = new tomic("foo", "FOO")) .filter(this) .handle(this) .channel(c -> c.queue("myFlowAdapterOutput")); } public String messageSource() { return "B,A> foo) { return foo.isPresent(); } @ServiceActivator public String handle(String payload, @Header String foo) { return payload + ":" + foo; } } Of course, with the POJO method invocation support (see above) it won’t be possible to build the flow so easily. Dynamic Languages (Scripting) Support The Spring Framework and Spring Integration have supported Dynamic Languages for a long time now and it is, mostly, linked with XML Spring configuration. It may look strange to deal with scripts (like Groovy, Ruby, JavaScript, etc.) from Java code, but we find it a useful tool for reloading functionality at runtime, and when Java lambas aren’t dynamic enough. Let’s look at the Scripts namespace factory in the Spring Integration Java DSL: @Configuration @EnableIntegration public class ScriptsConfiguration { @Value("com/my/project/integration/scripts/splitterScript.groovy") private Resource splitterScript; @Bean public PollableChannel results() { return new QueueChannel(); } @Bean public IntegrationFlow scriptSplitter() { return f -> f .split(Scripts.script(this.splitterScript) .refreshCheckDelay(10000) .variable("foo", "bar")) .channel(results()); } } This Scripting support allows us to deal only with external resources, which can be changed and reloaded at runtime. The inline scripts, which are supported by the Spring Integration Scripting module, don’t make sense because we have Java 8 lambdas for those cases. Inline WireTap The Wire Tap EI Pattern is implemented as a ChannelInterceptor in Spring Integration and can be injected into any MessageChannel as an interceptor like this: @Bean public MessageChannel myChannel() { return MessageChannels.direct() .interceptor(new WireTap(loggerChannel())) .get(); } The IntegrationFlow definition allows us to omit MessageChannel declarations between EIP components, so we’ve introduced an inline .wireTap() EIP-method to allow a WireTap injection for those anonymous channels. Here are some samples: @Bean public IntegrationFlow wireTapFlow1() { return IntegrationFlows.from("tappedChannel1") .wireTap("tapChannel", wt -> wt.selector(m -> m.getPayload().equals("foo"))) .channel("nullChannel") .get(); } @Bean public IntegrationFlow wireTapFlow2() { return f -> f .wireTap(sf -> sf .<String, String>transform(String::toUpperCase) .channel(c -> c.queue("wireTapSubflowResult"))) .channel("nullChannel"); } Please see the IntegrationFlowDefinition.wireTap() methods JavaDocs for more information and don’t miss our test-cases from project page on GitHub. Wrap up There’s much to do for the 1.1 release, like further simplification of .aggregate(), etc. configuration, an ability to inject external sub-flows, the ability to configure IntegrationComponentSpec implementations as a separate @Bean to simplify the target flow definitions, more protocol-specific Namespace Factories and more. Don’t hesitate to reach us via StackOverflow, JIRA and GitHub issues to share your thoughts and ideas! Project Page | JIRA | Issues | Contributions | StackOverflow ( spring-integration tag)
https://spring.io/blog/2015/04/15/spring-integration-java-dsl-1-1-m1-is-available
CC-MAIN-2022-33
en
refinedweb
12+ Factors for Containerized UI Microservices 11 min read Software application projects can sometimes end with monolithic user interfaces, even when using a microservices architecture. This monolithic UI can lead to unnecessary complexity and can often result in scaling difficulties, performance issues, and other problems as frontend developers try to keep pace with changes to backend microservices. To try and prevent a project ending with a monolithic UI, this blog post describes how to apply the twelve-factor app methodology to the creation of UI microservices. A microservices architecture often starts with a focus on only the creation of the backend microservices. This approach can lead to a monolithic UI that combines and surfaces different functions and data from modular backend microservices. These large and complex UIs go against the fundamental concepts of microservice-based architecture, which is to enable multiple microservices to handle their own functions and tasks across both the backend and frontend. With our own application development, we work towards bringing modularity to both the backend and frontend of our applications. As we develop our UI microservices, we pay close attention to the twelve-factor app methodology for the Kubernetes model. The twelve-factor app methodology provides a well-defined guideline for developing microservices. This methodology is a commonly used pattern to follow to run and scale microservices. This blog focuses on applying the 12 factors to UI microservices development, along with applying additional key factors that are specific to UI microservices and are supported by the Kubernetes model for container orchestration. The details for applying these factors are broken down into three overall categories for Kubernetes-based UI microservices: - Code factors - Deploy factors - Operate factors Code factors Factor I: Codebase "One codebase tracked in revision control, many deploys." Typically, an application is composed of multiple components, with each component supporting backend and UI functions. In a microservices architecture, each component — including any composite UI microservice — should be developed independently of other microservices by dedicated development teams. A composite UI microservice aggregates the UI from other microservices by following a pattern where the UI microservices are decoupled from the composite UI, while still providing a single-pane-of-glass experience. When you develop UI microservices, the code base should follow revision control and a single service with multiple deploys pattern. Consider the following core principles when you are designing your UI microservices codebase: - Single responsibility: Each UI microservice has only a single purpose. For example, your application can have separate inventory UI, governance and risk UI, and cost management UI microservices. - High cohesion: Each microservice must include all functions that are needed to serve its single purpose. - Loose coupling: Each UI microservice must have no direct coupling with the composite UI or any other UI microservice. The following diagram shows multiple separate UI microservices that plug into a main composite UI microservice at runtime to give a consistent experience: Although each UI microservice is independent and can adopt its own choice of technology, designing microservices to use the same technology allows each microservice to share common components and drive consistency. For example, the composite UI and UI microservices in the preceding diagram can adopt different technologies, such as Node.js, React, and JavaScript. These UI microservices can be created using a source control repository, such as a Git repository. Then, specific versions of these UI containerized images can be stored in Docker Hub. With Docker Hub versions available, you can reference a specific image version in the container spec for pods and deployments. With this approach, you can have different versions of a microservice running in your development, staging, and production environments. Applications in these environments can then behave differently based on the configurations for each microservice version: Factor V: Build, release, run “Strictly separate build and run stages.” Decoupled UI microservices provide a strict separation of build, release, and run phases. Each microservice team is responsible for completing tasks to commit code and build Docker images using the build pipeline. Node package manager can be used to install dependent packages for any Node-based UI microservice. The Docker image can also be published in the artifactory. You can then use the Helm Kubernetes Package Manager or Red Hat OpenShift Operators to package your application. These releases can be tagged and used in different development, staging, and production environments: Factor X: Dev/prod parity "Keep development, staging, and production as similar as possible." UI microservices can have dependencies on data from different backend microservices. These UI microservices should be designed to be deployed with the same architecture in any environment for consistency. Essentially, UI microservices should be able to handle various error conditions, such as backend API errors and application domain specific errors. Fault tolerance — such as when data or dependent services are unavailable — should be built into each UI microservice. This fault tolerance should include the composite UI, which should be tolerant towards any contributing UI microservice being unavailable. Typically, UI microservices are developed and tested locally, which is not a production-ready approach. CI/CD processes need to run integration builds with key automated tests to catch integration issues as early as possible. For example, UI microservices can run Selenium-based functional tests with pull request builds and long-running Nightwatch-based tests running once a day to simulate a production-like data workload. The following screenshot shows a Selenium test output that is integrated with a Travis CI build: Deploy factors Factor II: Dependencies “Explicitly declare and isolate dependencies.” UI microservices should be stateless and clearly declare all dependencies. Isolate the header and any authentication or authorization functions that are required for UI microservices into separate services. With Kubernetes, you can use liveliness and readiness probes to clearly declare and check for dependent services. The following diagram shows UI microservices that use readiness probes to check for required services, such as a header service, authorization service, and backing API services. Liveliness probes check whether the UI service is healthy. API services use readiness probes to check whether other data services or provider services are up and available. The composite UI checks whether UI services are discovered, and if any services are not discovered, the UI menu for those missing services does not display: The following screenshot shows a liveliness and readiness probe YAML definition: Factor III: Config “Store config in the environment.” UI microservices typically connect to backing API services. The configuration for connecting to these backing services should be stored in a ConfigMap or in Secrets to ensure that UI microservices are independent of the configurations. These configurations can be moved to different environments without requiring modifications to the source code. A simple, but very effective approach. Factor VI: Process “Execute the app as one or more stateless processes.” UI microservices should be stateless by design. This statelessness enables scaling and failure recovery features to be easily implemented with containerized UI microservices that leverage Kubernetes container orchestration. For example, if you had a UI microservice uiMicroservice1, you can update the microservice deployment within the uiMicroservice1 namespace to use three replicas through the following kubectl command: Then, if you run a kubectl get pods command, your output can include three pods similar to the following output: Factor IV: Backing services “Treat backing services as attached resources.” For example, a composite UI microservice should treat modular UI microservices as backing services. The supporting modular UI microservices should be accessed as services and specified in the configuration so that the the supporting modular microservice can be changed without affecting the composite UI and other modular UI microservices. The modular UI microservices can also have API as a backing service. Usually an API backing service collects data from different providers — such as data sources — and then normalizes and transforms the data into the format that the UI needs. Factor VII: Port binding “Export services via port binding.” Each UI microservice and all dependent backend services need to be exposed through a well-defined port. You can use Ingress to control external access and expose services externally. For example, the following diagram shows UI microservices that use Ingress to control access and expose services externally. These UI microservices can access dependent API services using well-defined service ports. The composite UI microservice constructs the main navigation menu from the different endpoints to provide a consistent single-pane-of-glass experience to users. When you are designing your port bindings, ensure that your routes do not conflict. As a tip, you can run different instances of your service in different Kubernetes namespaces: Operate factors Factor VIII: Concurrency “Scale out via the process model.” As much as possible, UI microservices should remain stateless. This approach allows for horizontal and vertical scaling of the UI. Factor X: Disposability "Maximize robustness with fast startup and graceful shutdown.” For UI microservices, the idea that processes should be disposable means that when an application stops abruptly, the user should not be affected. You can achieve this result by using Kubernetes-provided ReplicaSets. With ReplicaSets, you can control multiple sets of stateless UI microservices, and Kubernetes will maintain a level of availability for the microservices. Factor XI: Logs "Treat logs as event streams." UI microservices must report health and diagnostic information that provides insights to various events so that problems can be detected and diagnosed. This information helps to correlate events between independent microservices. Establish standard practices for your UI and other microservices to achieve a single logging format and to establish how to log health and diagnostic information for each service. Factor XII: Admin Tasks "Run admin/management tasks as one-off processes." Essentially, admin tasks should be isolated. This goal for UI microservices is no different than it is for any other microservice. Beyond the 12 factors In addition to the preceding 12 factors, we pay close attention to the following additional factors when developing production-grade enterprise applications. Adhering to these factors can be beneficial to you in your application development. For more information on these factors, see "7 Missing Factors from 12-Factor Applications." Factor XIII: Observable "Apps should provide visibility about current health and metrics." Web interfaces need to be resilient and available 24/7 to meet business demand. When moving from monolithic UI to a modular microservices-based UI architecture, microservices grow in number and the communication between the microservices becomes more complex. Observability for microservices is critical for gaining visibility into communication failures and reacting to failures quickly. As you design your UI microservices, use the following methods to help you make your microservices observable: - Kubernetes liveliness and readiness probes: These probes can be used to detect whether a service is live and ready to receive traffic. Refer to Factor II: Dependencies to learn more about liveliness and readiness probes. - Custom metrics: Collections of custom metrics like API response times, CPU and memory utilization, and API performance metrics are important for UI microservices. UI microservices should define any essential metrics to observe, such as dependent API response time or dependent UI microservice response time. A monitoring system like Prometheus can be set up to scrape from the metrics endpoint. Production environments should always be set up for observability tools. Leverage the techniques that are available within your production environment for the collection and visualization of key metrics for dependencies. Ensure that thresholds and alerts on the key metrics are based on the overall service level objective for your application. - Synthetic monitoring: Set up synthetic monitoring for all key APIs and URLs. Synthetic monitoring allows you to continuously test your application’s health and performance. You can set up synthetic tests from a different location to monitor the response time of key APIs and transactions. For more information about the synthetic monitoring that we use in the IBM Cloud Pak® for Multicloud Management, see Synthetics PoP. Factor XIV: Schedulable "Applications should provide guidance on expected resource constraints." Like any other microservice, UI microservices should provide guidance on expected resource constraints for CPU and memory usage to ensure Kubernetes reserves the required resources for the microservices. You can define request and limits for CPU and memory in the deployment config. For example, the following screenshot shows how to define requests and memory limits for a UI microservice uiMicroservice1: Factor XV: Upgradable "Apps must upgrade data formats from previous generations." Incremental upgrades for UI microservices are frequently required to release features on shorter delivery cycles. Upgrades without service disruptions are important when upgrading any service. An important feature to understand and support for any dependent API service is backwards compatibility so that no breaking changes are introduced from upgrades. We use Operators to deploy our microservices in Kubernetes and leverage the Operator pattern to manage upgrades. The following diagram shows how you can leverage the Operator pattern to independently manage UI microservice upgrades. In this diagram, the UI and API Operator and product images are pushed to a Red Hat Quay.io repository. Application Operators are deployed in namespace1 and packaged as the Catalog Source. The Operator Source provides the endpoint to receive updates from the Quay.io registry. When the Catalog Source receives updates about the version v2 of the microservice, the Catalog Source updates the subscription based on the preference, which can be automatic or manual: Factor XVI: Least privilege "Containers should be running with the least privilege." Incorrect or excessive permissions that are assigned to pods and containers pose a security threat and can lead to compromised pods. UI microservices need to access API services, Ingress services, and other essential services. When you design your microservices, consider the following areas when you are assigning privileges to pods and containers: - Role-based access control (RBAC) policies: RBAC rules need to maintain the least-privilege principle. As you are developing your services, continuously review and improve the RBAC rules for your services. The following diagram shows a UI Microservice 1pod that can access an API pod to use Get and List APIs. The microservice obtains this access through role creation and a role binding that is required by the API pod: - Non-root user: Run UI and API containers as a non-root user. The following screenshot shows a YAML definition that shows how to run a container as a non-root user: - Network policies: Use network policies to control service-to-service communication. The following diagram shows how to enforce a network policy so a user can connect to the composite UI and other UI microservices, but cannot connect directly to the database pod: Factor XVII: Auditable "Know what, when, who, and where for all critical operations." Well-designed UI microservices are stateless and typically call API backing services to get data. These microservices should have clear audit trails of who did what, which should be tracked through API services. Factor XVIII: Securable (identity, network, scope, certificates) "Protect the app and resources from the outsiders." As a best practice, you should consider incorporating the following key security factors that UI microservices might need to provide: - Authentication: Typically, authentication is a dedicated service that UI microservices connect to for checking the identity of users. - Authorization: Typically, authorization is a dedicated microservice that UI microservices connect to for enforcing role-based access control on different capabilities that are exposed in the UI. - Certificate management: UI microservices can use a certificate manager to create, store, and renew digital certificates. The following list identifies examples of certificate managers that can be deployed in a cluster: - Data protection: Establish security measures for protecting data in transit and at rest. - Vulnerability scans: You can include vulnerability scan automation in your build pipeline to detect any vulnerabilities in the images. - Mutation scans: You can include mutation scan automation in your build pipeline to detect any mutations in the image. - Source code scans: Static and dynamic source code scans are important for UI microservices to detect security flaws in the source code and when interacting with other services. - Accessibility scans: UI microservices need to follow accessibility standards, which can be tracked through checklists. For example, all microservices that are published by IBM adhere to the standards included in the IBM Accessibility checklist. Conclusion We hope you have found this topic interesting. If you are in the middle of containerizing an application UI to deploy in Kubernetes, record the factors that you already applied and apply any factors that you are missing. Share your perspective with others. Thanks for reading. If you found this article interesting, take a look at these related articles: - 7 Missing Factors from 12-Factor Applications - Are your Kubernetes readiness probes checking for readiness? Thanks to Robert Wellon for reviewing this article. Follow IBM Cloud Be the first to hear about news, product updates, and innovation from IBM Cloud.Email subscribeRSS
https://www.ibm.com/cloud/blog/12-plus-factors-for-containerized-ui-microservices
CC-MAIN-2022-33
en
refinedweb
Allocates and deallocates a channel for an Ethernet device handler. #include <sys/device.h> int entmpx (devno, chanp, channame) dev_t devno; int *chanp; char *channame; The entmpx entry point allocates and deallocates a channel for an Ethernet device handler. This entry point is not called directly by a user. The kernel calls the entmpx entry point in response to an open or close request. Note: If the Ethernet device has been successfully opened, any subsequent Diagnostic mode open requests is unsuccessful. If the device has been successfully opened in Diagnostic mode, all subsequent open requests is unsuccessful. An entmpx entry point can be called from the process environment only. In general, communication device handlers use the common return codes defined for an entry point. However, device handlers for specific communication devices may return device-specific codes. The common return codes for the entmpx entry point are the following: The entmpx entry point functions with an Ethernet High-Performance LAN adapter that has been correctly configured for use on a qualified network. Consult the adapter specifications for more information on configuring the adapter and network qualifications. The entopen entry point.
http://ps-2.kev009.com/tl/techlib/manuals/adoclib/libs/ktechrf2/entmpx.htm
CC-MAIN-2022-33
en
refinedweb
go to bug id or search bugs for New/Additional Comment: Description: ------------ Target Manual page is "List of Keywords" (reserved.keywords.html). First, the link of "use" Keyword should not be to "Namespaces" (language.namespaces.html) : almost meanless, but strictly, to "Using namespaces: Aliasing/Importing" (language.namespaces.importing.html). This "use" is used for (1) importing a Class in a Namespace & aliasing it, (2) importing a Namespace, (3) importing a global Class, (4) importing a function, & aliasing it, (5) importing a constant according to the link page. This "use" Keyword may be accompanied by "(as of PHP 5.3.0)". Second, there would exist ADDITIONAL "use" Keyword in the list. This "use" is used for inheriting variables from the parent scope in closures. This "use" Keyword should link to "Example #3" in "Anonymous functions" (functions.anonymous.html#example-180". Expected result: ---------------- (See Description) Actual result: -------------- (See Description) Add a Patch Add a Pull Request
https://bugs.php.net/bug.php?id=80635&edit=1
CC-MAIN-2022-33
en
refinedweb
<< Kayondo Martin7,481 Points ./FlightActivity.java:15: error: cannot find symbol intent.getStringExtra("FUEL_LEVEL"); I can't figure out why the getStringExtra method can't be resolved...Some help please? import android.content.*;"); } } 1 Answer Seth Kroger56,404 Points One thing you should keep in mind is that the fuel level is an int, and not a 'String'. It won't give you a complete answer, but I think it would give you a better message to show you the way if you took that into consideration. Magnus Martin44,123 Points Magnus Martin44,123 Points That was a good hint. Now the second parameter 'defaultValue' makes sense, too. Thanks Seth.
https://teamtreehouse.com/community/flightactivityjava15-error-cannot-find-symbol-intentgetstringextrafuellevel
CC-MAIN-2022-33
en
refinedweb
In the world of computer science, file handling is a very important concept. A file is a type of portable storage that is used to store any type of data. Before a programmer applies any algorithm on a particular file, they need to open that file using the fopen() command. fopen() only has 2 parameters passed into it: FILE *filePointer; filePointer = fopen("filename.txt", "w"); The following code opens a file and writes “Educative!” in it. #include <cstdio> #include <cstring> using namespace std; int main() { int c; FILE *filePointer; filePointer = fopen("filename.txt", "w"); char sampleString[20] = "Educative!"; if (filePointer) { for(int i=0; i<strlen(sampleString); i++) putc(sampleString[i],filePointer); } fclose(filePointer); } RELATED TAGS View all Courses
https://www.educative.io/answers/fopen-in-cpp
CC-MAIN-2022-33
en
refinedweb
toString() is an instance method of the BitSet class that returns the string representation of the BitSet object. The string representation includes the decimal representation of every index for which the BitSet object has a bit in the set state. These indices are given in ascending order, separated by ", " (a comma and a space), and enclosed by braces, similar to the standard mathematical notation for a collection of numbers. The toString method is defined in the BitSet class. The BitSet class is defined in the java.util package. To import the BitSet class, use the following import statement. import java.util.BitSet; bitSet_Object.toString() This method has no parameters. This method returns the string representation of the object. import java.util.BitSet; public class Main{ public static void main(String[] args) { BitSet bitSet = new BitSet(); bitSet.set(2); bitSet.set(3); bitSet.set(9); System.out.println("String representation = " + bitSet.toString()); } } RELATED TAGS CONTRIBUTOR View all Courses
https://www.educative.io/answers/what-is-bitsettostring-in-java
CC-MAIN-2022-33
en
refinedweb
🔼 Module Initializers In this latest version of C # 9.0, the [ModuleInitializer] attribute is used to specify a method that we can invoke before any code in the module, the destination method must be static, without any type of parameter and returned empty. using system; using System.Runtime.CompilerServices; class Program { static void Main(string[] args) { Console.WriteLine($"Data={Data}"); } public static string Data; [ModuleInitializer] public static void Init() { Data="This static method is invoked before any other method in the module"; } } 🔼 Extension GetEnumerator The foreach statement normally operates on a variable of type IEnumerator when it contains a definition of any public extension for GetEnumerator. This is how we can see it in this example 👇 using system; using System.Collections.Generic; IEnumerator<string> colors = new List<string> {"blue", "red", "green"}.GetEnumerator(); foreach (var colors in colors) { Console.WriteLine($"{color} is my favorite color"); } public static class Extensions { public static IEnumerator<T> GetEnumerator<T>(this IEnumerator<T> enumerator) => enumerator; } 🔼 Covariant Return Types In C# 9.0, the return types of override methods are usually much more specific than the declarations in the base type 👇 abstract class Weather { public abstract Temperature GetTemperature(); } class Spain : Weather { public override Celsius GetTemperature() => new Celsius(); } class USA : Weather { public override Farenheit GetTemperature() => ne Farenheit(); } class Temperature{ } class Celsius{ } class Farenheit{ } The GetTemperature () method has the return type Temperature, the derived class Spain overrides this method and returns a specific type Celsius. It is a feature that makes our code more flexible. ✅ 🔼 Init Accessor The init accessor makes immutable objects easier to create and use 👇 Point point1 = new() { X = 1, Y = 2}; Console.WriteLine(point1.ToString()); public record Point { public int X { get; init;} public int Y { get; init;} } The init accessor can be used with Structures, Registers and Classes. The init accessor can be used with Classes, Structures, and Registers 👇 Point point1 = new() { X = 1, Y = 2}; Point point2 = point1 with { Y = 4}; Console.WriteLine(point1.ToString()); public record Point { public int X { get; init;} public int Y { get; init;} } 🔼 Records Now we have a new type of reference called record that gives us equal value. To better understand it, we have this example 👇 Point point1 = new(1, 2); Console.WriteLine(point1.ToString()); Point point2 = new(1, 2)}; Console.WriteLine(point1.Equals(point2)); public record Point { public int X { get;} public int Y { get;} public Point(int x, int y) => (X, Y) = (x, y); } As we can see, the point record is immutable, you can greatly simplify the syntax using init accesor, since its properties are read-only. 🔼 Lambda Discard Parameters The next C# 9.0 improvement is being able to use discard (_) as an input parameter of a lambda expression in case that parameter is not used. //C#8 button.Click += (s, e) => {Message.Box.Show("Button clicked"); }; //C#9 button.Click += (_, _) => {Message.Box.Show("Button clicked"); }; It is a feature that also allows us to read the code in a cleaner and more beautiful way. 🔼 Target-Typed new Another very important feature in this latest version of C# is the ability to omit the type of a new expression when the object type is explicitly known. Let's see a quick and simple example 👇 Point point = new() {X = 1, Y = 2}; Console.WriteLine($"point:({point1.X}, {point.Y})"); public class Point { public int X { get; set; } public int Y { get; set; } } It is a very useful feature since it allows you to read the code in a clean way without having to duplicate the type. Point point = new(1, 2); Console.WriteLine($"point:({point1.X}, {point.Y})"); public class Point{ public int X { get; } public int Y { get; } public Point(int x, int y) => (X, Y) = (x, y); } 🔼 Top-Level Statements In C# 9.0, it is possible to write a top-level program after using declarations. Here we can see the example 👇 using System; Console.WriteLine("Hello World!"); With top-level declarations, you wouldn't need to declare any space between names, main method, or class program. This new feature can be very useful for programmers just starting out, as the compiler does all of these things for you. [CompilerGenerated] internal static class $program { private static void $main(string[] args) { Console.WriteLine("Hello World!"); } } Seeing the new features in C# 9.0, which help make programming much simpler and more intuitive. What can we expect in the future version? future versions of C#. Let's start 👍 🔼 File-level namespaces All of us when we started programming in C# we have created a "Hello World" application. Knowing this we also know that C# uses a block structure for namespaces. namespace HelloWorld { class Hello { static void Main(string[] args) { System.Console.WriteLine("Hello World!"); } } }. namespace HelloWorld; public class Hello { static void Main (string[] args) { System.Console.WriteLine("Hello World!"); } } namespace Company.Product; Company.Product.Component namespace Component { } It is clear that it is not a very big feature, but it is preferable that the more improvements there are, the easier and more intuitive the task of programming will be. 🔼. public class DataSlice { public string DataLabel { get; } public float DataValue { get; } public DataSlice(string dataLabel, float dataValue) { DataLabel = dataLabel; DataValue = dataValue; } }. var adultData = new DataSlice("Vaccinated adults", 741); By using the main constructor, property validation is not excluded. In the same way, its rules can be enforced in a property setter. Let's see an example 👇 public class DataSlice(string dataLabel, float dataValue) { public string DataLabel { get => dataLabel; set { if (value < 0) throw new ArgumentOutOfRangeException(); dataLabel = value; } } public float DataValue { get => dataValue; } } Other details are also possible (calling the base constructor in a derived class, adding constructors). The main downside to all of this is that the primary constructors could collide with the position registers. 🔼 Raw string literals We already know that the ordinary strings that C# has, tend to be quite messy since they need quotation marks (''), newlines (\ n) and backslashes (). What C# offers before this little problem is the use of special characters. For example, we can prefix a string with @ and have free rein to add all these details without any problem 👇 string path = "c:\\path\\backslashes"; string path = @"c:\pathh\backslashes"; string <name>year</name> <description>this is the actual year <ref part="2020">year</ref> actual year. </description> </part> """; If your concern is that there is a possibility of a triple quote sequence within the string, you can simply extend the delimiter so that you can use all the quotes you want, as long as the beginning and end are respected. string xml = """" Now """ is safe to use in your raw string. """"; In the same way as @ strings, newlines and whitespace are preserved in a raw string. What happens is that the common white space, that is, the amount that is used to bleed, is cut off. Let's see more simply with an example 👇 <part number="2021"> <name>year</name> <description>this is the actual year <ref part="2020">year</ref> actual year. </description> </part> To this 👇 <part number="2021"> <name>year</name> <description>this is the actual year <ref part="2021">year</ref> actual year. </description> </part> Conclution: To finish this article, we think that C# still has many years of travel ahead of it and it still has many things to add to make the task of programming even easier and more optimal. From Dotnetsafer we want to thank you for your time in reading this article and don't forget that in our .NET Blog you can learn more. And remember: Now you can try for free our C# obfuscator. You can also protect your applications directly from Visual Studio with the .NET Obfuscator for Visual Studio. Also, before that you can learn how to protect .NET applications. Discussion (1)
https://practicaldev-herokuapp-com.global.ssl.fastly.net/dotnetsafer/c-9-0-features-and-expectations-of-c-10-n7c
CC-MAIN-2022-33
en
refinedweb
Section 4.13 Structs The second aggregate data type in C that we consider is the struct. Structs are also commonly referred to as record. A struct has \(n\) fields of possibly distinct types \(T_1,\dots, T_n\text{.}\) A container for a struct is the combination of containers for the \(n\) fields. For an example, consider a struct that represents aspects of a person. We want to consider for each person a date of birth, a first name, and a last name. A date consists of a day, a month, and a year: struct date { unsigned day, month, year; }; We can use composition (“is part of”) or aggregation (“refers to”) to define our struct: struct person { struct date date_of_birth; char name[16]; char surname[16]; }; struct person { struct date date_of_birth; char const *name; char const *surname; }; In both declarations, the date_of_birth field is added through composition. We could also implement the field via aggregation with a pointer to a date struct. However, the struct date is a small struct, therefore referencing it with a pointer saves little space in the person struct. Reusing struct date objects provides therefore little benefit for this case. We can access the individual fields of a struct container with the . operator: struct person p; /* ... */ printf("%s %s\n", p.name, p.surname); In contrast to arrays, structs can be passed to functions by value in C. With small structs, this can be sensible. In practice however, we usually pass structs via pointer as in the following example: void init_date(struct date *d, unsigned day, unsigned month, unsigned year) { d->day = day; d->month = month; d->year = year; } The expression A->B is an abbreviation for (*A).B. Remark 4.13.3. In C, suffix operators have higher precedence than prefix operators. Therefore, *A.B is not the same as (*A).B: The former accesses a struct field and loads from the address contained there, the latter loads the field of a struct whose address is given. In practice, it is best to use parentheses to make non-obvious precedences explicit. Subsection 4.13.1 typedef Types in C can easily become long, like struct person, or complex, like int *(*)[10]. C provides the means to define shorter, more meaningful names for such types: typedef struct { /* see above */ } person_t; /* ptr_table_t ist a pointer to an array of 10 pointers to ints */ typedef int *(*ptr_table_t)[10]; Example 4.13.4. Initialization. It is a common pattern to define for each struct a function that properly initializes it. The following function initializes the version of struct person where name and surname are aggregated: person_t *person_init(person_t *p, date_t const *d, char const *name, char const *surname) { p->date = *d; p->name = name; p->surname = surname; return p; } Such initialization functions, which are also called constructors, usually expect a pointer to an uninitialized struct container. This makes the constructor independent of how the struct is allocated: as a local variable, a global one, or dynamically: person_t global_p; void person_test() { person_t local_p; person_t *heap_p; heap_p = malloc(sizeof(*heap_p)); person_init(&global_p, /* ... */); person_init(&local_p, /* ... */); person_init(heap_p, /* ... */); free(heap_p); } If we incorporate the name and surname fields by composition instead of aggregation, we need to copy the character sequences into the struct: person_t *person_init(person_t *p, date_t const *d, char const *name, char const *surname) { p->date = *d; snprintf(p->name, sizeof(p->name), "%s", name); snprintf(p->surname, sizeof(p->surname), "%s", surname); return p; } It is important to not copy more characters than fit into the field. We realize this here with the snprintf function with the size sizeof(p->name). If we copied the string without ensuring that the field size is respected, we would encounter undefined behavior (see Section 4.15) when the function is called with too large strings. We can use sizeof here because the type of p->name here is char[16] and not char *. The value of sizeof(p->name) is therefore \(16\text{,}\) rather than the size of a pointer. Example 4.13.5. Polynomials. The following struct represents a polynomial of degree n: typedef struct { unsigned degree; int *coeffs; } poly_t; The coefficients are implemented through aggregation. This is necessary, since we do not want to assume a statically known fixed length for the polynomials. Therefore, an array for the coefficients need to be allocated separately (see Exercise 4.13.3.1). Subsection 4.13.2 Incomplete Structs We use a technique called encapsulation to separate large software systems into modules. By encapsulation, we hide the implementation details of a module from code that uses it. The benefit of this technique is that we can then change the module's implementation without affecting the code parts that use the module. C supports encapsulation through incomplete structs. They allow to hide the specific structure of a struct from other code. We will discuss encapsulation in more detail in the Java part of this book. Consider Example 4.13.5. Let us assume that we want to hide how polynomials are represented from using code parts. We achieve this with an incomplete struct that we declare in a header file (see poly.h in Figure 4.13.6). The values of the data type are then only accessible through a set of functions, a so-called Application Programming Interface (API). The API of such a data type only uses pointers to the incomplete type as the encapsulation ensures that its contents, and therefore the necessary container size, are not known to the outside. #ifndef POLY_H #define POLY_H /* incomplete struct */ typedef struct poly_t poly_t; poly_t *poly_alloc(unsigned degree); void poly_free(poly_t *p); void poly_set_coeff(poly_t *p, unsigned deg, int coeff); int poly_eval(poly_t const *p, int x); unsigned poly_degree(poly_t const *p); #endif /* POLY_H */ poly.h #include "poly.h" struct poly_t { unsigned degree; int *coeffs; }; poly.c. Continuation: Exercise 4.13.3.1 #include <stdlib.h> #include <stdio.h> #include "poly.h" int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "syntax: %s x coeffs...", argv[0]); return 1; } poly_t *p = poly_alloc(argc - 3); for (int i = 2; i < argc; i++) { int coeff = atoi(argv[i]); poly_set_coeff(p, i - 2, coeff); } int x = atoi(argv[1]); int y = poly_eval(p, x); poly_free(p); printf("%d\n", y); return 0; } main.c poly_tis only visible in the translation unit poly.c. Exercises 4.13.3 Exercises 1. Polynomial. We consider the API for polynomials defined in Figure 4.13.6. Complete the file poly.c: Implement the functions declared in the header file poly.h in. Implement a function poly_allocallocating the space for a polynomial on the heap. Implement the function poly_free, that frees a polynomial that was constructed on the heap. Implement the function poly_set_coeffthat sets the coefficients of an polynomial. Implement the evaluation of a polynomial using the Horner schema. Implement the function poly_degreethat returns the degree of a polynomial. #include <stdlib.h> #include <assert.h> #include "poly.h" struct poly_t { unsigned degree; int *coeffs; }; poly_t *poly_alloc(unsigned degree) { poly_t *p = malloc(sizeof(*p)); p->degree = degree; p->coeffs = malloc((degree + 1) * sizeof(p->coeffs[0])); return p; } void poly_free(poly_t *p) { free(p->coeffs); free(p); } void poly_set_coeff(poly_t *p, unsigned i, int val) { assert(i <= p->degree); p->coeffs[i] = val; } int poly_eval(poly_t const *p, int x) { int res = p->coeffs[0]; for (unsigned i = 1; i <= p->degree; i++) res = res * x + p->coeffs[i]; return res; }
https://prog2.de/book/sec-c-structs.html
CC-MAIN-2022-33
en
refinedweb
Available with Spatial Analyst license. Available with Image Analyst license. Summary Performs a Boolean Exclusive Or operation on the cell values of two input rasters. Illustration . The operator with the highest precedence value will be executed first. For more information, see the operator precedence table in Work with operators in Map Algebra. section of Build complex statements. Two inputs are necessary for the Boolean evaluation to take place. The order of the input is irrelevant for this operator. If the input values are floating point, they are converted to integer values by truncation before the Boolean operation is performed. The output values are always integer. Another way to perform the Boolean XOr operation is a ^= b, which is an alternative way to write a = a ^ b. If both inputs are single-band rasters, or one of the inputs is a constant, the output will be a single-band raster. If both inputs are multiband rasters, the operator will perform the operation on each band from one input, and the output will be a multiband raster. The number of bands in each multiband input must be the same. If one of the inputs is a multiband raster and the other input is a constant, the Boolean XOr operation on two input rasters. import arcpy from arcpy import env from arcpy.ia import * env.workspace = "C:/iapyexamples/data" outBooleanXOr = Raster("degs") ^ Raster("negs") outBooleanXOr.save("C:/iapyexamples/output/outboolxor.tif") This sample performs a Boolean XOr operation on two input rasters. # Name: Op_BooleanXOr_Ex_02.py # Description: Performs a Boolean Exclusive Or operation on the # cell values of two input rasters # Requirements: Image Analyst Extension # Import system modules import arcpy from arcpy import env from arcpy.ia import * # Set environment settings env.workspace = "C:/iapyexamples/data" # Set local variables inRaster1 = Raster("degs") inRaster2 = Raster("negs") # Execute BooleanXOr outBooleanXOr = inRaster1 ^ inRaster2 # Save the output outBooleanXOr.save("C:/iapyexamples/output/outboolxor")
https://pro.arcgis.com/en/pro-app/latest/arcpy/image-analyst/boolean-xor-operator.htm
CC-MAIN-2022-33
en
refinedweb
Announcing Fitbit OS SDK 4.0 Fitbit OS SDK 4.0 We're proud to announce the latest version of the software development kit for Fitbit OS. SDK 4.0 adds support for the new Fitbit Versa 2, a comprehensive update to the Cryptography API, multi-view SVG support, and much more. SDK 4.0 support will require the new Fitbit OS 4.0 firmware update which has already begun the rollout process. You can use the updated Fitbit OS Simulator to begin development today if you're waiting for the new firmware. With this release we deprecated SDK 3.0 as we previously described in our deprecation blog post. While existing published projects will continue to work for users, you should now switch to SDK 4.0 for updates, or new projects. Versa 2 for Developers Fitbit Versa™ 2 - A premium, modern designed smartwatch that builds on the popular Versa with advanced health & fitness and convenience features to maximize your day with the addition of Amazon Alexa Built-in, innovative in-app sleep features like daily Sleep Score, and Fitbit Pay™ on all models for wallet-free payments*. Developers will be pleased to learn that the display resolution is the same as Fitbit Versa and Fitbit Versa Lite (300x300 pixels), meaning the majority of clocks and apps are already compatible without any changes. However, there are some hardware differences developers need to be aware of in order to adapt their apps and clock faces to support Versa 2. Hardware Differences The Versa 2 contains the following hardware differences when compared to the original Versa: - New AMOLED display - Added Microphone - Faster CPU - NFC (all editions) - Removal of the two physical buttons (right-hand side) - Removed Gyroscope and Orientation sensor Note: Due to the change in display technology on Versa 2, the Display API has been updated to protect the device from screen burn-in. Additional details below. What's New The SDK 4.0 release contains the following new APIs and developer updates: - Cryptography API - Multi-view SVG - Activity History API - App Cluster Storage - API enhancements In addition to the API changes, there has also been a complete rewrite of the communication stack on device and mobile. This new stack provides improved reliability & performance, true multiplexing, and Quality of Service (QoS). We've updated the reference documentation to incorporate these updates, but let's take a look at each of the new features and enhancements in more detail. Cryptography API We have made some significant updates to the Device Crypto API to align it more closely with the W3 SubtleCypto API. We've added cryptographic functions for verifying, signing, encrypting, decrypting data, and management functions to import and export cryptographic keys. This means that developers can now build secure apps and clock faces with end-to-end encrypted communications. import * as Crypto from "crypto"; const buffer = new ArrayBuffer(16); Crypto.subtle.digest("SHA-256", buffer).then(hash => { const h = new Uint8Array(hash); }); const key = new ArrayBuffer(32); for (let i = 0; i < 32; i++) { key[i] = i; } Crypto.subtle .importKey("raw", key, { name: "HMAC", hash: "SHA-256" }, false, [ "sign", "verify" ]) .then(secret => { const s = new Uint8Array(secret); console.log(`Secret is: ${s}`); Crypto.subtle .sign("HMAC", secret, buffer) .then(signature => { const sgn = new Uint8Array(signature); console.log(`HMAC signature is: ${sgn}`); Crypto.subtle .verify("HMAC", secret, signature, buffer) .then(success => { console.log(success); if (success) { console.log("Signature was successfully verified!"); } else { console.log("Bad signature!"); } }); }) .catch(e => { console.error(e); }); }) .catch(e => { console.error(e); }); For more information please refer to our reference documentation, or the MDN SubtleCrypto documentation. Multi-view SVG Developers can now utilize multiple SVG files to represent different user interface screens in their applications and clock faces. This significant upgrade will allow developers to build more complex on-device experiences, keep their codebase more organized, and reduce their overall memory footprint. Historically, developers had to show and hide elements within a single SVG file to simulate navigation within their app. Now developers can create individual SVG files for each view, then use document.replaceSync() to dynamically load a different SVG file at runtime. This new method of dynamically loading SVG files has some other intentional benefits: - When an SVG file is replaced, all previous event handlers will be unregistered automatically. This means the resources are available for garbage collection, freeing up memory when they are no longer required. - Launch performance can be improved significantly for larger apps by splitting SVG into multiple files, as only the default index.guifile will be parsed on application startup. import * as document from "document"; document.replaceSync("./resources/another-view.gui"); console.log(document.location.pathname); >> ./resources/another-view.gui The SDK Toolchain has also been updated to support code splitting, so JavaScript files can be dynamically loaded at runtime too, saving even more memory and further reducing app launch times! Please note that there are some differences to the CommonJS specification in our implementation, particularly the lack of a module cache. For more information please refer to the reference documentation , and our multi-view sample app. Activity History API Developers can now query historical user activity data that is stored locally on the device. The data is provided minute by minute for the past hour, and day by day for the past week. The data includes steps, distance, calories, elevationGain/floors (excluding Versa Lite), plus average and resting heart rate. This is a historical API, so the current minute, and current day are excluded from the returned data. The amount of data on the device will vary per user, but developers can check the maxRecordCount to determine exactly how many records are available for the minute and day history. It is expected that individual records could be undefined for some periods, for example when the device is powered off, or after a significant clock time correction. Let's take a look at the API in action: import { me as appbit } from "appbit"; import { minuteHistory, dayHistory } from "user-activity"; if (appbit.permissions.granted("access_activity")) { // query the previous 5 minutes step data const minuteRecords = minuteHistory.query({ limit: 5 }); minuteRecords.forEach((minute, index) => { console.log(`${minute.steps || 0} steps. ${index + 1} minute(s) ago.`); }); // query all days history step data const dayRecords = dayHistory.query(); dayRecords.forEach((day, index) => { console.log(`${day.steps || 0} steps. ${index + 1} day(s) ago.`); }); } This would return the following results: 34 steps. 1 minute(s) ago. 29 steps. 2 minute(s) ago. 13 steps. 3 minute(s) ago. 37 steps. 4 minute(s) ago. 55 steps. 5 minute(s) ago. 9823 steps. 1 day(s) ago. 8342 steps. 2 day(s) ago. 9245 steps. 3 day(s) ago. 9324 steps. 4 day(s) ago. 8392 steps. 5 day(s) ago. 9936 steps. 6 day(s) ago. For more information please refer to the reference documentation . App Cluster Storage A new Companion API has been added that allows a developer to persist data on the mobile phone and share it between all of their applications and clock faces.. There are some common use cases where this will be used frequently, such as sharing oAuth tokens between an app and a clock face, so a user would only need to authenticate once, or clock bundle developers could provide an application to persist purchases when switching clocks. This type of storage is only deleted once all referencing apps are uninstalled, so if a user is switching clocks made by the same developer the storage would be persisted as new clocks are installed before the old clock is uninstalled. In order to use the new API, you need to request the access_app_cluster_storage permission, and add two new keys to the fitbit section of the package.json file: appClusterID - must be 1-64 characters, alphanumeric, and periods. developerID - as displayed in GAM. When uploading your project file to GAM, we will verify that yourdeveloperID` is correct. Let's take a look at the API in action: import * as appClusterStorage from "app-cluster-storage"; import { me as appbit } from "companion"; const myCluster = appClusterStorage.get("my.cluster.id"); if (appbit.permissions.granted("access_app_cluster_storage")) { if (myCluster !== null) { myCluster.setItem("myKey", "myValue"); console.log(myCluster.getItem("myKey")); } else { console.error("App Cluster Storage is unavailable."); } } Note: Side-loaded apps cannot share data with apps installed via the Gallery for security reasons. For more information please refer to the reference documentation . API Enhancements In addition to the fantastic new Device and Companion APIs, there are also a number of smaller changes and additions to make developers' lives easier. Device Display API The following changes have been made to the Display API to protect the new AMOLED display used in Versa 2: autoOff - Overriding this value is not supported on Versa 2. You can detect if the device supports disabling this by attempting to change the value and then reading it back afterwards. brightnessOverride - is now an enum with predefined brightness levels ( dim, normal, and max). Each setting uses the ambient light sensor to determine brightness levels, instead of using absolute brightness levels. File System API A new method has been added to the File System API to allow developers to easily determine if a file exists, without having to stat() the file and catch the exception. import * as fs from "fs"; if (fs.existsSync("/private/data/my-file.txt")) { console.log("file exists!"); } Sensor APIs All Sensor APIs (accelerometer, barometer, gyroscope etc.) now allow the sensorOptions to be adjusted after initialization using the setOptions() method, allowing developers to easily adjust the sample rate or batch size on the fly. import { Accelerometer } from "accelerometer"; if (Accelerometer) { // sampling at 1Hz const accel = new Accelerometer({ frequency: 1 }); accel.addEventListener("reading", () => { console.log( `ts: ${accel.timestamp}, x: ${accel.x}, y: ${accel.y}, z: ${accel.z}` ); }); accel.start(); setTimeout(() => { // change sampling rate to 100Hz accel.setOptions({ frequency: 100 }); }, 5000); } Device API The bodyColor property of the Device API has been updated to include the new Versa 2 device colors: carbon, copper-rose, and mist-grey. Scientific API The variance() method in the Scientific API had been incorrectly named var() in previous SDK versions. This has been corrected to match the documentation now. Build Targets Versa 2 is the 4th device to be added as a build target for the Fitbit OS SDK. Each device has its own unique alias, modelId, and modelName. Note: You should always aim to write code based around the device capabilities, not the specific modelId, and definitely never using the modelName. Updating to SDK 4.0 In order to be able to select Versa 2 (mira) as a build target you must first update your projects to SDK 4.0. If you're using Fitbit Studio you just need to select SDK 4.0 in the package.json settings. For the command line tools, change the @fitbit/sdk version to ~4.0.0, and change the @fitbit/sdk-cli to ^1.7.0, then install with npm install or yarn install. If you're migrating from older versions such as SDK 1.x, 2.x, and 3.x, you'll want to check our handy migration guide to facilitate a smooth transition. And Finally... We already know what you're thinking, so let's take a moment to address the elephant in the room. How do I utilize the Always on Display or microphone in my clock face or application? Unfortunately the short answer is you can't at this time. The slightly longer answer is that we're still assessing the capabilities in a way that would make the most sense, so stay tuned for future updates. In the meantime, express your interest by submitting feature suggestions in the community forum! Next Steps If you've previously published an app or a clock face to the Fitbit App Gallery, make sure you submit an updated version with support for all platforms. Don't forget to share your screenshots on Twitter with the #Made4Fitbit hashtag. Until next time! Amazon Alexa not available in all countries. See fitbit.com/voice. See Fitbit Pay availability here.
https://dev.fitbit.com/blog/2019-10-29-announcing-fitbit-os-sdk-4.0/
CC-MAIN-2022-33
en
refinedweb
sl_se_key_descriptor_t Struct Reference Contains a full description of a key used by an SE command. #include <sl_se_manager_types.h> Contains a full description of a key used by an SE command. Field Documentation ◆ type Key type. ◆ size Key size, applicable if key_type == SYMMETRIC. ◆ flags Flags describing restrictions, permissions and attributes of the key. ◆ storage Storage location for this key. Optional password for key usage (8 bytes). If no password is provided (NULL pointer), any key not stored as plaintext will be stored with a password of all-zero bytes. ◆ domain Pointer to domain descriptor if this key contains an asymmetric key on a custom domain The reason for pointing instead of containing is to make it possible to have the parameters in ROM.
https://docs.silabs.com/gecko-platform/3.2/service/api/structsl-se-key-descriptor-t
CC-MAIN-2022-33
en
refinedweb
The purpose of this article is to make everyone (especially C programmers) say: “I do not know C”. I want to show that the dark corners of C are much closer than it seems, and even trivial code lines may contain undefined behavior. The article is organized as a set of questions and answers. All the examples are separate files of the source code. 1. int i; int i = 10; Q: Is this code correct? (Will there occur an error related to the fact that the variable is defined twice? Reminding you that it’s a separate source file and not a part of the function body or compound statement) A: Yes, this code is correct. The first line is the tentative definition that becomes the «definition» after the compiler processes the definition (the second line). 2. extern void bar(void); void foo(int *x) { int y = *x; /* (1) */ if(!x) /* (2) */ { return; /* (3) */ } bar(); return; } Q: Turns out, bar() is invoked even when x is the null pointer (and the program does not crash). Is it the optimizer’s error, or is everything correct? A: Everything’s correct. If x is the null pointer, undefined behavior occurs in line (1), and no one owes anything the programmer: the program does not have to crash in line (1), or make a return in line (2) in case it has managed to execute line (1). If we talk about the rules the compiler has been guided by, it all happens the following way. After the analysis of line (1), the compiler thinks that x cannot be a null pointer, and eliminates (2) and (3) as the dead code. Variable y is removed as unused. Reading from memory is also eliminated, since the *x type is not qualified as volatile. That’s how the unused variable has removed the check for the null pointer. 3. There was a function: #define ZP_COUNT 10 void func_original(int *xp, int *yp, int *zp) { int i; for(i = 0; i < ZP_COUNT; i++) { *zp++ = *xp + *yp; } } They wanted to optimize it this way: void func_optimized(int *xp, int *yp, int *zp) { int tmp = *xp + *yp; int i; for(i = 0; i < ZP_COUNT; i++) { *zp++ = tmp; } } Q: Is it possible to call the original function and the optimized one, so as to obtain different results in zp? A: It is possible, let yp == zp. 4. double f(double x) { assert(x != 0.); return 1. / x; } Q: Can this function return inf? Assume that floating-point numbers are implemented according to IEEE 754 (most machines), and assert is enabled (NDEBUG is not defined). A: Yes, it can. It’s enough to pass a denormalized x, like 1e-309. 5. int my_strlen(const char *x) { int res = 0; while(*x) { res++; x++; } return res; } Q: The provided above function should return the length of the null-terminated line. Find a bug. A: The use of the int type for storing sizes of objects is wrong, as it is not guaranteed that int will be able to store the size of any object. We should use size_t 6. #include <stdio.h> #include <string.h> int main() { const char *str = "hello"; size_t length = strlen(str); size_t i; for(i = length - 1; i >= 0; i--) { putchar(str[i]); } putchar('\n'); return 0; } Q: The loop is infinite. How come? A: size_t is the unsigned type. If i is unsigned, then i >= 0 is always true. 7. #include <stdio.h> void f(int *i, long *l) { printf("1. v=%ld\n", *l); /* (1) */ *i = 11; /* (2) */ printf("2. v=%ld\n", *l); /* (3) */ } int main() { long a = 10; f((int *) &a, &a); printf("3. v=%ld\n", a); return 0; } This program is compiled by two different compilers and run on a little-endian machine. Two different results were obtained: 1. v=10 2. v=11 3. v=11 1. v=10 2. v=10 3. v=11 Q: How can you explain the second result? A: The given program has undefined behavior. Namely, strict aliasing rules are violated. int is being changed in line (2). Therefore, we can assume that any long has not changed. (We cannot dereference the pointer that aliases another pointer of an incompatible type). That’s why the compiler can pass the same long (line (3)) that has been read during the execution of line (1). 8. #include <stdio.h> int main() { int array[] = { 0, 1, 2 }; printf("%d %d %d\n", 10, (5, array[1, 2]), 10); } Q: Is this code correct? If there is no undefined behavior, what does it print then? A: Yes, the comma operator is used here. First, the left argument of the comma is calculated and discarded. Then, the right argument is calculated and used as the value of the entire operator. The output is 10 2 10. Note that the comma symbol in the function call (for example, f(a(), b())) is not the comma operator, and, therefore, it does not guarantee the order of calculations: a(), b() can be called in any order. 9. unsigned int add(unsigned int a, unsigned int b) { return a + b; } Q: What is the result of add(UINT_MAX, 1)? A: The overflow of unsigned numbers is defined, it is calculated by 2^(CHAR_BIT * sizeof(unsigned int)). The result is 0. 10. int add(int a, int b) { return a + b; } Q: What is the result of add(INT_MAX, 1)? A: The overflow of signed numbers – the undefined behavior. 11. int neg(int a) { return -a; } Q: Is undefined behavior possible here? If so, under what arguments? A: neg(INT_MIN). If the ECM represents negative numbers in the additional code (two's complement), the absolute value of INT_MIN is more by one than the absolute values of INT_MAX. In this case, -INT_MIN invokes the signed overflow, which is the undefined behavior. 12. int div(int a, int b) { assert(b != 0); return a / b; } Q: Is undefined behavior possible here? If so, under what arguments? A: If the ECM represents negative numbers in the additional code, then div(INT_MIN, -1) – refer to the previous question. — Dmitri Gribenko <[email protected]> This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://kukuruku.co/hub/programming/i-do-not-know-c
CC-MAIN-2022-33
en
refinedweb
I am having trouble getting an iframe to display correctly on my private Streamlit Cloud deployed app. Locally, the iframe works, but it remains blank on my deployed app. The iframe is a Metabase Dashboard that I have enabled sharing on. I tried the following code to embed this iframe in my app import streamlit as st import streamlit.components.v1 as components st.write("Streamlit Docs Example iframe") components.iframe("") st.write("different iframe test") components.iframe(src="", width=1285, height=1000, scrolling=True) Same thing happens in Chrome browser and Brave Browser. I tried removing the arguments from my iframe, but that did not work either. Streamlit version streamlit==1.10.0 Local Version: Streamlit Cloud Version: e
https://discuss.streamlit.io/t/streamlit-cloud-iframe-is-blank/27517
CC-MAIN-2022-33
en
refinedweb
#include <opencv2/line_descriptor/descriptor.hpp> struct for drawing options Output image matrix will be created (Mat::create), i.e. existing memory of output image may be reused. Two source images, matches, and single keylines will be drawn. Output image matrix will not be created (using Mat::create). Matches will be drawn on existing content of output image. Single keylines will not be drawn.
https://docs.opencv.org/3.4/d8/d6f/structcv_1_1line__descriptor_1_1DrawLinesMatchesFlags.html
CC-MAIN-2022-33
en
refinedweb
Hello everyone, i've installed Renderman 22.5 for Houdini 17.5 and set up the houdini.env file as written in the Renderman Documentation. If I start Houdini, I always get this message in the console: Unable to find libprman. Resorting to backup string table. Rendering will error Error running pythonrc.py: Traceback (most recent call last): File “C: /Program Files/Pixar/RenderManForHoudini-22.5/17.5/python2.7libs/pythonrc.py”, line 41, in <module> import rfh.config # relies on PYTHONPATH having been set above File “C: /Program Files/Pixar/RenderManForHoudini-22.5/17.5/python2.7libs\rfh\config.py”, line 49, in <module> from node_desc import NodeDesc File “C: /Program Files/Pixar/RenderManForHoudini-22.5/17.5/python2.7libs\node_desc.py”, line 55, in <module> from txmanager.txparams import TXMAKE_PRESETS ImportError: No module named txmanager.txparams The Renderman-Part in my environment file looks like this: RMANTREE=“C:\Program Files\Pixar\RenderManForHoudini-22.5” RFHTREE=“C:\Program Files\Pixar\RenderManForHoudini-22.5” HOUDINI_PATH=$HOUDINI_PATH;$APPDATA\SideFX\GameDevToolset\17.5\1.159;$RFHTREE\17.5;& Do you guys have an idea, how to fix this issue? Best Regards, Chrizzo Renderman 22.5 for Houdini 17.5 issue on start842 6 1 raschberg Hi your entry for RMANTREE looks wrong to me, it should point to ProServer like this: RMANTREE=“C Program Files/Pixar/RenderManProServer-22.5”Program Files/Pixar/RenderManProServer-22.5” best regards (eh- without the emoticon, this is a bug from the website) Yeah! It fixed the issue! Thank you very much Edited by Chrizzo - May 9, 2019 15:26:42 - Quick Links Search links - Show recent posts - Show unanswered posts
https://www.sidefx.com/forum/topic/66157/
CC-MAIN-2019-35
en
refinedweb
In this article we will learn two operator in c#.NET , they are "is" and "as". Basically those two operator is useful when we want to compare two object and try to convert one object into another one. Let’s see with example. It is useful when we want to check whether one object belongs to particular class or not?. Have a look on below code. using System;using System.Text;namespace Asynchronious{ class Test { public string Name { get; set; } } class Test1:Test { public string Surname { get; set; } } class Program { public static void Main(String[] args) { Test t = new Test(); if (t is Test1) Console.WriteLine("t is object of Test1"); else Console.WriteLine("t is not object of Test1"); Console.ReadLine(); } }} Here we have declared two classes called Test and Test1 and Test1 is inherited from Test class. Now, within Main() function we are creating object of Test class. Here we are interested to check whether t is object of Test1 or not? And obviously it is not object of Test1. So, using is operator we are checking within if condition. Here is sample output. In output we are seeing that else condition is getting satisfied. So t is not object is Test1 class. as operator is useful when we want to convert one type to another type. But we have to keep in mind that both type should be compatible. Means by applying boxing and unboxing concept it should possible to convert one type to another type. Let’s see by example. using System;using System.Collections.Generic;using System.Linq;using System.Runtime.CompilerServices;using System.Text;using System.Threading;using System.Threading.Tasks;using System.Diagnostics;namespace Asynchronious{ class Test { public Test() { } public string Name { get; set; } } class Test1 : Test { public Test1() { } public string Surname { get; set; } } class Program { public static void Main(String[] args) { Test1 t1 = new Test1(); t1.Name = "Sourav"; t1.Surname = "Kayal"; Test t = new Test(); t = t1 as Test; Console.WriteLine("Name:- " + t.Name); Console.ReadLine(); } }} Here we have Implemented inheritance concept between Test and Test1 class. Now, within Main() function we are populating object ob Test1 class(sub class) and then we are converting from t1 object to object of Test class using below line. t= t1 as Test In output we are seeing that value of t1 object is initiated into t object. conclusion:- In this article we have seen how to use "is" and "as" operator in c#.NET. Hope you have understood the concept. Latest Articles Latest Articles from Sourav.Kayal Login to post response
http://www.dotnetfunda.com/articles/show/2577/is-and-as-operator-in-csharp
CC-MAIN-2019-35
en
refinedweb