text
stringlengths
20
1.01M
url
stringlengths
14
1.25k
dump
stringlengths
9
15
lang
stringclasses
4 values
source
stringclasses
4 values
Hey there! I have a pretty basic rails + webpacker app, 100% following webpacker tutorial. When i’m trying to load an external controller (following this example) which looks like this: import { Controller } from "stimulus" export default class extends Controller { static targets = [ "toggleBtn", "moreFilters" ] toggleMoreFilters (e) { e.preventDefault() this.moreFiltersTarget.classList.toggle('d-none') } submitForm (e) { if (e.key == 'Enter') { this.element.submit() } } } webpacker throws: ERROR in ./node_modules/@beehivecms/core/frontend/controllers/search_form_controller.js Module parse failed: Unexpected token (4:17) You may need an appropriate loader to handle this file type. | | export default class extends Controller { | static targets = [ "toggleBtn", "moreFilters" ] | | toggleMoreFilters (e) { @ ./app/javascript/packs/beehive_admin.js 13:0-100 @ multi (webpack)-dev-server/client? ./app/javascript/packs/beehive_admin.js webpack: Failed to compile. Is there anything obvious i forgot to do in order to be able to include an external controller manually? Thanks in advance!
https://discourse.stimulusjs.org/t/manually-import-controller/603
CC-MAIN-2019-04
en
refinedweb
Microkernel (Scala) The purpose of the Akka Microkernel is to offer a bundling mechanism so that you can distribute an Akka application as a single payload, without the need to run in a Java Application Server or manually having to create a launcher script. The Akka Microkernel is included in the Akka download found at downloads. To run an application with the microkernel you need to create a Bootable class that handles the startup and shutdown the application. An example is included below. Put your application jar in the deploy directory to have it automatically loaded. To start the kernel use the scripts in the bin directory, passing the boot classes for your application. There is a simple example of an application setup for running with the microkernel included in the akka download. This can be run with the following command (on a unix-based system): bin/akka sample.kernel.hello.HelloKernel Use Ctrl-C to interrupt and exit the microkernel. On a Windows machine you can also use the bin/akka.bat script. The code for the Hello Kernel example (see the HelloKernel class for an example of creating a Bootable): /** * Copyright (C) 2009-2012 Typesafe Inc. <> */ package sample.kernel.hello import akka.actor.{ Actor, ActorSystem, Props } import akka.kernel.Bootable case object Start class HelloActor extends Actor { val worldActor = context.actorOf(Props[WorldActor]) def receive = { case Start ⇒ worldActor ! "Hello" case message: String ⇒ println("Received message '%s'" format message) } } class WorldActor extends Actor { def receive = { case message: String ⇒ sender ! (message.toUpperCase + " world!") } } class HelloKernel extends Bootable { val system = ActorSystem("hellokernel") def startup = { system.actorOf(Props[HelloActor]) ! Start } def shutdown = { system.shutdown() } } Distribution of microkernel application To make a distribution package of the microkernel and your application the akka-sbt-plugin provides AkkaKernelPlugin. It creates the directory structure, with jar files, configuration files and start scripts. To use the sbt plugin you define it in your project/plugins.sbt: resolvers += "Typesafe Repo" at "" addSbtPlugin("com.typesafe.akka" % "akka-sbt-plugin" % "2.1.0-RC1") Then you add it to the settings of your project/Build.scala. It is also important that you add the akka-kernel dependency. This is an example of a complete sbt build file: import sbt._ import Keys._ import akka.sbt.AkkaKernelPlugin import akka.sbt.AkkaKernelPlugin.{ Dist, outputDirectory, distJvmOptions} object HelloKernelBuild extends Build { val Organization = "akka.sample" val Version = "2.1.0-RC1" val ScalaVersion = "2.10.0-M6" lazy val HelloKernel = Project( id = "hello-kernel", base = file("."), settings = defaultSettings ++ AkkaKernelPlugin.distSettings ++ Seq( libraryDependencies ++= Dependencies.helloKernel, distJvmOptions in Dist := "-Xms256M -Xmx1024M", outputDirectory in Dist := file("target/hello-dist") ) ) lazy val buildSettings = Defaults.defaultSettings ++ Seq( organization := Organization, version := Version, scalaVersion := ScalaVersion, crossPaths := false, organizationName := "Typesafe Inc.", organizationHomepage := Some(url("")) ) lazy val defaultSettings = buildSettings ++ Seq( resolvers += "Typesafe Repo" at "", // compile options scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"), javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation") ) } object Dependencies { import Dependency._ val helloKernel = Seq( akkaKernel, akkaSlf4j, logback ) } object Dependency { // Versions object V { val Akka = "2.1.0-RC1" } val akkaKernel = "com.typesafe.akka" % "akka-kernel" % V.Akka val akkaSlf4j = "com.typesafe.akka" % "akka-slf4j" % V.Akka val logback = "ch.qos.logback" % "logback-classic" % "1.0.0" } Run the plugin with sbt: > dist > dist:clean There are several settings that can be defined: - outputDirectory - destination directory of the package, default target/dist - distJvmOptions - JVM parameters to be used in the start script - configSourceDirs - Configuration files are copied from these directories, default src/config, src/main/config, src/main/resources - distMainClass - Kernel main class to use in start script - libFilter - Filter of dependency jar files - additionalLibs - Additional dependency jar files Contents
http://doc.akka.io/docs/akka/2.1.0-RC1/scala/microkernel.html
CC-MAIN-2015-40
en
refinedweb
[ ] Dmitry Irlyanov commented on HARMONY-2653: ------------------------------------------ Not at all :) I've just saying that without additional catching regression test is incorrect. My patch is incorrect - you said because (it passes if no exception throws). I've corrected the regression test I think it is unavailing discussion. I've started it due to ironic comment, my apologies. > [classlib][swing] javax.swing.plaf.basic.BasicListUI.getPreferredSize(new JFileChooser() ) throws unspecified ClassCastException > -------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2653 > URL: > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Alexander Simbirtsev > Attachments: BasicListUI-patch.txt, H2653-BasicListUITest.patch, H2653-BasicListUITest.patch > > > There is no mention of any exception in the specification. > Harmony throws unspecified ClassCastException for getPreferredSize(new JFileChooser()) while RI throws unspecified NPE. > Use the following code to reproduce: > import javax.swing.JFileChooser; > import javax.swing.plaf.basic.BasicListUI; > import junit.framework.TestCase; > public class Test extends TestCase { > public void testcase1() { > try { > BasicListUI bl = new BasicListUI(); > bl.getPreferredSize(new JFileChooser() ); > } catch (NullPointerException e) { > //expected > } catch (ClassCastException e) { > fail("No NPE thrown"); > } > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: - For more information on JIRA, see:
http://mail-archives.apache.org/mod_mbox/harmony-commits/200701.mbox/%3C18612950.1169061630554.JavaMail.jira@brutus%3E
CC-MAIN-2015-40
en
refinedweb
perlmeditation eyepopslikeamosquito <P> <blockquote> <P> <I> Another generally applicable golfing tip is to study every single built-in function the language has to offer </I> </P> <P align="right"> <small> -- From [id://761053|Part II] of this series </small> </P> <P> <I> Number of PHP functions in the main namespace: 3079 </I> </P> <P align="right"> <small> -- Cited at <a href="">PHP in contrast to Perl</a> </small> </P> </blockquote> </P> <P> Unlike [id://761053|Ruby and Python], I knew nothing of PHP when this game began. Nothing. Zilch. Nada. And trawling through over 3000 verbose, and often appallingly inconsistent, built-in functions did not make a good first impression. More on this later, but, <I>as a language</I>, PHP is streets behind Perl, Ruby and Python IMHO. </P> <P> Allow me to state this more plainly: if I had to program in PHP for a living, I would poke my eyes out with a fork. And yet I very much enjoyed playing golf in PHP! Why? Golf, at least for me, is essentially a <I>competition</I>, a highly artificial and stylized skill, more akin to chess than to the craft of writing useful, robust and maintainable computer programs. </P> <P> Having already golfed this problem in three languages by now, my confidence was rising. I felt surprisingly calm about being a complete PHP ignoramus because I had formed the opinion that far more important than knowing the language is understanding the problem and its algorithms. </P> <readmore> <P><B>Taking the Early Lead in PHP</B></P> <P> Tuning my magic formula searcher for PHP brought instant rewards in the form of this straightforward 87 stroker: <CODE> <?while($c=ord(fgetc(STDIN)))$t+=$n-2*$n*(+$n<($n=2627%$c/8%8 .E. 71248%$c%5));echo$t?> </CODE> This early submission stole the PHP lead from the (presumably Japanese) golfer Hiro Suzuki by two strokes. I was so thrilled at finding my first PHP golfing trick of shortening the leading <CODE><?php</CODE> to <CODE><?</CODE> that I totally missed the routine golfing trick of shortening the trailing <CODE>?></CODE> to semicolon (<CODE>;</CODE>), Eugene's advice of "Can't possibly work, try it anyway" having been temporarily forgotten. </P> <P> Also of note in this solution is the same exploitation of virtual machine evaluation order that I had used previously in Perl and Ruby, to eliminate the "previous value" variable. To get this to work, I had to use <CODE>+$n</CODE> rather than a bald <CODE>$n</CODE>. Curiously, this behaviour varied between PHP versions, the <CODE>+</CODE> being required only with later PHP versions. </P> <P> <CODE>.E.</CODE> intensely irritating -- though, like Perl, but unlike Ruby and Python, mercifully, I didn't need to quote the <CODE>E</CODE>. </P> <P><B>Breaking the 80 Barrier</B></P> <P> Though delighted to be leading the PHP pack, I was horrified by the length of those two magic formulae. What to do? </P> <P> <blockquote> <I> It's as easy as 1, 2, 3 </I> </blockquote> </P> <P> It occurred to me that in this PHP solution I could replace those two ugly magic formulae with three prettier ones by fiddling with the expression controlling the while loop like so: <CODE> <?while($c=1230%ord(fgetc(STDIN)))$t+=$n-2*$n*(+$n<($n=(41%$c&5).E.$c%9%4));echo$t?> </CODE> Though this required a complete rewrite of my magic formula searcher, it was worth it because it shaved three strokes. Note that, because the while loop expression now eliminates the trailing newline (newline has an ord of 10, so <CODE>1230%ord</CODE> evaluates to zero and terminates the loop), I no longer need to map the newline in the two magic formulae in the loop body. Note too that the intolerable spaces around the <CODE>E</CODE> have been eliminated. Yay! Down to 84 and leading by five now. Despite the overall ugliness of the language, unearthing these tactical tricks was making PHP golfing lots of fun. </P> <P> Applying some further tricks picked up golfing the problem in the other languages, combined with improved magic formulae, and finally remembering good ol' Eugene to find the trailing <CODE>;</CODE> hack, enabled me to whittle this approach all the way down to 75 strokes: <CODE> <?while($c=68040%ord(fgetc(STDIN))/2)$t+=$n-2*$n%+$n=9385%$c.E.$c/8?><?=$t; </CODE> Variety being the spice of life, notice that I also replaced <CODE>echo$t;</CODE> with <CODE><?=$t;</CODE> ... though this did not change the golf score one iota. Leading by 14 now. Where to go from here? </P> <P><B>The Magic of a Built-in md5 Function</B></P> <P> All my moaning about the inelegance of 3000+ built-in functions ceased the instant I stumbled upon the built-in <CODE>md5</CODE> and <CODE>sha1</CODE> functions. These functions were perfect for magic formulae! Why had I not spotted them sooner? </P> <P> The <CODE>md5</CODE> function, you see, enjoys a fundamental advantage over <CODE>ord</CODE> in that you can use all 256 characters in a magic formula, compared to just ten (<CODE>0-9</CODE>) for <CODE>ord</CODE> (for example, <CODE>68040%ord</CODE> in the magic formula above). To illustrate, in a six character string, there are just <CODE>10**6</CODE> combinations available for <CODE>ord</CODE>, while there are <CODE>256**6=2.8*10**14</CODE> combinations available for <CODE>md5</CODE>. </P> <P> There is a catch though. To enjoy all 256 characters you must quote the string, which costs you two strokes. Using Eugene's "can't possibly work, try it anyway" approach, however, revealed that PHP seems to treat characters in the <CODE>ord</CODE> range <CODE>127-255</CODE> as "alphabetic". Anyway, you don't need to quote them, making <CODE>md5</CODE> a certain winner over <CODE>ord</CODE> in any magic formula race. </P> <P> To put all this to the proof, I whittled my 75 stroker by three strokes by replacing <CODE>ord</CODE> with <CODE>md5</CODE>. Here are some of them: <CODE> <; </CODE> where <CODE>XXX</CODE> above is <CODE>chr(115).chr(205).chr(69)</CODE>, <CODE>XXXXX</CODE> is <CODE>chr(225).chr(246).chr(180).chr(162).chr(188)</CODE>, and <CODE>XXXX</CODE> is <CODE>chr(174).chr(110).chr(204).chr(142)</CODE>. </P> <P> The observant reader will have noticed the comical "multiply by one" above, as in <CODE>"5E$c"*1%4999</CODE>. Why on Earth would I waste two strokes like that? Well, my testing revealed that PHP interprets "5E2" as <B>500</B> (i.e. scientific notation) if followed by a multiplies <CODE>*</CODE> operator, but as <B>5</B> if followed by a modulo <CODE>%</CODE> operator! AFAICT, this surprising behaviour is undocumented, an accident of implementation. In case you're interested, Perl consistently interprets "5E2" as 500, whether followed by multiplies <CODE>*</CODE> or modulo <CODE>%</CODE>. Ruby always interprets <CODE>"5E2".to_i()</CODE> as 5 (integer) and <CODE>"5E2".to_f()</CODE> as 500 (floating point). Python, as usual, is the strictest of the gang of four languages, always interpreting <CODE>float("5E2")</CODE> as 500 (floating point), yet emitting an "invalid literal for int()" runtime error for <CODE>int("5E2")</CODE>. </P> <P> Though I swore at PHP's eccentricity here, loud claps of applause could be heard, as described in the next section, when I desperately needed PHP to interpret the "04e9d..." md5 string as four, and not as 4,000,000,000. </P> <P> Down to 72 strokes now and leading by 17. To go lower, I needed to eliminate the <CODE>"E"</CODE> exponentiation. But how? </P> <P><B>Eliminating Exponentiation</B></P> <P> Alone among the four languages, PHP lacks a <CODE>**</CODE> exponentiation operator. This had proved to be only a minor nuisance so far, forcing me to rely instead on <CODE>.E.</CODE> like constructs. Yet with the PHP <CODE>md5</CODE>! </P> <P> What to do? Well, remembering the <CODE>M999D499C99L49X9V4I</CODE> string used in some of my early Perl table lookup solutions, the M -> 999, D -> 499, C -> 99, L -> 49, X -> 9, V -> 4, I -> 0 mapping looked much more promising because the C and X mappings are reduced by one character in length, plus <I>any</I> of <CODE>abcdef</CODE> will now produce the required I -> 0 mapping. The running time of this new and improved mapping was estimated to be less than five years. Getting closer now. Just need to speed up the searcher a bit. </P> <P>: <CODE> <? "; ?> </CODE> Running the above test program produces: <CODE> </CODE> Notice that applying <CODE>%1858</CODE> to <CODE>453851</CODE> produces the required <CODE>499</CODE> D mapping, while leaving the other mappings untouched, thus producing the desired mapping M -> 999, D -> 499, C -> 99, L -> 49, X -> 9, V -> 4, I -> 0, and a corresponding 70 stroke solution: <CODE> <?while(A<$c=fgetc(STDIN))$t+=$n-2*$n%$n=md5(XXXXXX.$c)%1858+1?><?=$t; </CODE> where <CODE>XXXXXX</CODE> above is <CODE>chr(111).chr(178).chr(219).chr(246).chr(172).chr(209)</CODE>. Success at last! </P> <P><B>Proving That a Shorter Solution Exists</B></P> <P> <blockquote> <P> <I> Beware of bugs in the above code; I have only proved it correct, not tried it. </I> </P> <P align="right"> <small> -- <a href="">Donald Knuth</a> </small> </P> </blockquote> </P> <P> <CODE>%1858</CODE> <CODE>499</CODE> D mapping (rather than <CODE>453851</CODE> as above). The ballpark figure of 10000 is got by estimating the probability of a random md5 signature starting with <CODE>499[a-f]</CODE>, which is <CODE>(1/16)*(1/16)*(1/16)*(6/16)=1/10923</CODE>. Now, extending the search space from six characters in length to eight increases the number of possible solutions by about <CODE>180*180=32400</CODE>, which should be more than enough solutions to produce one lucky hit. That is, increasing the magic formula string by two strokes saves five. QED. </P> <a href="">CUDA</a> and <a href="">OpenCL</a>, a humble PC containing six or so high-end NVIDIA graphics cards may well be able to solve it today. To quote Ton Hospel: it has to be tried, at least. </P> <P>. </P> <P><B>References</B></P> <P> <ul> <li> [id://759963] <li> [id://761053] <li> [id://763105] <li> [id://811919] <li> [id://814900] <li><a href="">Golf competitions in Perl, Ruby, Python or PHP</a> <li> [id://600665] </ul> </P> <P> <ul> <li> <a href="">PHP in contrast to Perl</a> <li> <a href="">Why PHP Sucks</a> <li> <a href="">PHP sucks because</a> <li> <a href="">The PHP Singularity</a> <li> <a href="">PHP: a fractal of bad design</a> </ul> </P> <P> <small> Updated 7-may: Minor clarifications to probabilities in "Proving That a Shorter Solution Exists" section. </small> </P> </readmore>
http://www.perlmonks.org/index.pl?displaytype=xml;node_id=762180
CC-MAIN-2015-40
en
refinedweb
With every new release of Windows CE (Windows Embedded CE, Windows Embedded Compact Edition) version 4.x, 5.0, 6.0, 7.0, 2013 (aka 8.0), people ask what version of Visual Studio they should use for Smart Device development. And how much it is different from the Visual Studio you use for developing the OS image, or how much it is different from the latest Visual Studio version? For those people that don’t understand what I am talking, a summary: For these 2 situations, you need 2 different tools. Historical overview Version Platform (OS) Builder -> NK.BIN Smart Device application Windows CE 4.x Windows CE Platform Builder 4.x Embedded Visual Studio 4 Windows CE 5.0 Windows CE Platform Builder 5.0 Visual Studio 2005 + SDK Windows CE 6.0 Plugin for Visual Studio 2005 Visual Studio 2008 + SDK Windows CE 7.0 Windows CE 8.0 Plugin for Visual Studio 2012 Visual Studio 2012 + SDK As you notice, Platform Builder and Smart Device application development required in the past a different version of Visual Studio. This bothered always people because they had to invest in and maintain different (older) versions of Visual Studio projects. Only with Windows CE 8.0 Microsoft finally succeeded in at least using the same (and latest!) version of Visual Studio. For older versions of Windows CE you still need to use the older versions of Visual Studio. Not entirely true! With Visual Studio 2010 and now Visual Studio 2012 you have a lot of control of the internal build system. I will show you how you can also use Visual Studio 2012 to build Windows CE 6.0 and 7.0 Smart Device applications, which gives us the following table: Platform (OS) Builder ->NK.BIN Visual Studio 2008 + SDK or Visual Studio 2012 + SDK Today we have already implemented this setup in my company’s build system, relieving all developers (except me as the Windows CE OS builder J/L) to maintain many project versions in different Visual Studio versions. It was only recent that we could upgrade to Visual Studio 2012, the last 5 years we were forced to stick with Visual Studio 2008 for all our C++ projects because we have some 30+ C++ libraries, few COM DLLs and executables that compile both for desktop Windows and Windows CE (both share the same subset of the Windows API). For convenience both configurations were present in 1 Visual Studio 2008 C++ vcproj file. Now, let me explain how to achieve this. Many thanks also go to my colleague Marcus (The Build Guru) who did most of the initial research. First of all we learned by studying how a Windows CE 8.0 SDK is installed. Basically the SDK (“MyDevice8.msi”) installs itself in folder C:\Program Files\Windows CE Tools\SDKs\MyDevice8. Roughly said, it contains subfolders for the OS APIs in Inc, Atl and Mfc headers in atlmfc and CRT in Crt. The Bin folder contains the tools (compiler, linker, midl, rc, …) How does this look like in a Windows CE 6/7 SDK? There you also have a C:\Program Files\Windows CE Tools\wce600\MyDevice6 (x86) folder. But here you will find only the OS headers and libraries. The Atl, Mfc and Crt headers and libraries are located in C:\Program Files\Microsoft Visual Studio 9.0\VC\ce. In Visual Studio 2012 much of the build system internals is regulated through Property Sheets in C:\Program Files\MSBuild. After installing the Windows CE 8.0 SDK, a subfolder is added in C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\MyDevice8. Notice “MyDevice6 (x86)”; the “(x86)” is typically added in a Windows CE 6/7 SDK name, in Windows CE 8 it is omitted. When I created the Visual Studio 2012 SDK for Windows CE 6/7 projects hereafter, I also omitted the “(x86)”, although it doesn’t really matter (it is just part of a SDK name) What follows are the detailed steps you have to follow to transform your Windows CE 6 SDK (hereafter named “MyDevice6 (x86)”) for Visual Studio 2008 to a new SDK (hereafter named “MyDevice6”) for Visual Studio 2012. Although it might look like there are many steps to follow, we are just going to copy a few folders to a new location and edit a few files to create this new Visual Studio 2012 compatible SDK for Windows CE 6 (the same applies to a Windows CE 7 SDK): Step 1: Property Sheets Step 2: Registry This is a reference to a registry key that needs to exist on the system you wish to use for compiling the Windows CE 6/7 Smart Device projects. This key is used by Visual Studio 2012 to recognize your SDK (Windows CE platform configuration). Create this key manually with Regedit.exe. You will also find the “MyDevice8” SDK key there, use it as an example. Step 3: Folder structure Your folder structure should look like: “Old” Visual Studio 2008 structure “New” Visual Studio 2012 structure C:\Program Files\Windows CE Tools\wce600\MyDevice6 (x86) C:\Program Files\Windows CE Tools\SDKs\MyDevice6\wce600 C:\Program Files\Windows CE Tools\wce600\MyDevice6 (x86)\Include C:\Program Files\Windows CE Tools\SDKs\MyDevice6\wce600\Include C:\Program Files\Windows CE Tools\wce600\MyDevice6 (x86)\Lib C:\Program Files\Windows CE Tools\SDKs\MyDevice6\wce600\Lib C:\Program Files\Microsoft Visual Studio 9.0\VC\ce C:\Program Files\Windows CE Tools\SDKs\MyDevice6\Sdk C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\atlmfc C:\Program Files\Windows CE Tools\SDKs\MyDevice6\Sdk\atlmfc C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\bin C:\Program Files\Windows CE Tools\SDKs\MyDevice6\Sdk\bin C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\crt C:\Program Files\Windows CE Tools\SDKs\MyDevice6\Sdk\crt C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\dll C:\Program Files\Windows CE Tools\SDKs\MyDevice6\Sdk\dll C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include C:\Program Files\Windows CE Tools\SDKs\MyDevice6\Sdk\include C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\lib C:\Program Files\Windows CE Tools\SDKs\MyDevice6\Sdk\lib Step 4: Binary tools folders Step 5: C++ Include headers folders Step 6: C++ Libraries folders Step 7: CE Additional Files Step 8: Linker Additional Dependencies Step 9: Compiler Preprocessor Definitions Step 10: Avoid linker error ” LINK : fatal error LNK1104: cannot open file 'OLDNAMES.lib' “ This will tell the linker to ignore the default library named “oldnames.lib” which has no use in Windows CE Voila, if you have implemented all the previous steps, your Windows CE 6 SDK for Visual Studio 2008 is converted to a Windows CE 6 SDK for Visual Studio 2012. Once again, this also applies to a Windows CE7 SDK. Geek note: You might ask yourself; “how the hell did those geeks find what directories were searched (and in what order) by Visual Studio 2008?” We needed this information to understand how to manipulate and set the C++ include and library directories in the Visual Studio 2012 Property Sheet files. The order is important as some header files exist more than once (in a slightly different variation). We used Sysinternals Process Monitor (Procmon.exe) for that. We installed a filter for Process Name cl.exe, created a Smart Device project in Visual Studio 2008 with 1 C++ source file “test.cpp” with 1 statement #include "search_it.h" As this header file does not exist, cl.exe had to search all its include directories. In Process Monitor, you find these traces (among many others): cl.exe CreateFile C:\Users\werner\Documents\Visual Studio 2008\Projects\MyDevice6 (x86)\AtlDll\AtlDll\search_it.h NAME NOT FOUND C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\search_it.h C:\Program Files\Windows CE Tools\wce600\MyDevice6 (x86)\Include\X86\search_it.h C:\Program Files\Windows CE Tools\wce600\MyDevice6 (x86)\Include\search_it.h C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\atlmfc\include\search_it.h C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SQL Server\Mobile\v3.0\search_it.h PATH NOT FOUND CloseFile C:\Users\werner\Documents\Visual Studio 2008\Projects\MyDevice6 (x86)\AtlDll\AtlDll\Test.cpp SUCCESS When you do the same for a non existing search_it.lib and a filter on Process Name link.exe, you will find the library directories link.exe C:\Users\werner\Documents\Visual Studio 2008\Projects\MyDevice6 (x86)\AtlDll\AtlDll\search_it.lib ink.exe C:\Program Files\Windows CE Tools\wce600\MyDevice6 (x86)\Lib\x86\search_it.lib C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\atlmfc\lib\x86\search_it.lib C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\lib\x86\search_it.lib Note the 3 root directories that are being searched: This order was preserved in the compiler (step 5) and linker (step 6) steps. Print | posted on Friday, September 13, 2013 10:00 PM | Filed Under [ Windows CE Windows Embedded Compact Microsoft Visual Studio 2012 Smart Device application ]
http://geekswithblogs.net/WernerWillemsens/archive/2013/09/13/building-windows-ce-6-or-7-smart-device-application-with.aspx
CC-MAIN-2015-40
en
refinedweb
IE 9 support for Richfaces 3.x branchgonzalad Oct 20, 2010 12:51 PM Hello, Does Richfaces team plan to support IE 9 browser with Richfaces 3.x branch (releasing a 3.3.4 release if needed for IE 9 support) ? Or do you plan to support IE 9 only with Richfaces 4 ? We are running some applications in production and need to know if we need to migrate to RF 4 to provide IE 9 support. The better for us would be of course to have a smooth evolution : for instance use a RF 3.3.4 (or continue with RF 3.3.3 if it's fine with IE 9) once IE 9 is final - just drop the new jar and everything is fine - , and afterwards migrate our applications with Java EE 6, Seam 3, RF 4, etc... (which will be quite a bit more work ). Thanks for your answer ! 1. Re: IE 9 support for Richfaces 3.x branchKriya Studio Oct 20, 2010 1:38 PM (in response to gonzalad) First you have to ask the million dollar question.. will Richfaces ever work... 2. Re: IE 9 support for Richfaces 3.x branchIlya Shaikovsky Oct 25, 2010 5:36 AM (in response to gonzalad) Hi, unfortunatelly yes, we are completelly concentrated at JSF 2 RF 4 branch currently. And we have no releases planned at all for 3.3.x community branch(only for WFK product). But it's open for community patches to provide fixes needed by you in 3.3.4-snapshot. I do not think there will be much problems. And if somebody will report that for example some simple styling should be corrected or some simple js check's to be added and will submit patch to jira - it's likelly to appears in that branch. As about current problems - even if the 3.3.x branch was active now - we normally do not checking RF at not-stable environments. We have too wide set of stable browsers to check all the beta's available First you have to ask the million dollar question.. will Richfaces ever work... Hm.. want to hear more about specific problems. 3. Re: IE 9 support for Richfaces 3.x branchJay Balunas Oct 25, 2010 9:44 AM (in response to Kriya Studio) Not exactly a productive, or helpful answer. I would have hoped for more.... 4. Re: IE 9 support for Richfaces 3.x branchshiyou shao Oct 25, 2010 10:36 AM (in response to Ilya Shaikovsky) yes,JSF 2 RF 4 branch. 5. Re: IE 9 support for Richfaces 3.x branchgonzalad Oct 25, 2010 3:12 PM (in response to Ilya Shaikovsky) Thanks for the answer, we'll wait IE 9 final release and hope we'll not find too much issues then. Thanks once more Ilya ! 6. Re: IE 9 support for Richfaces 3.x branchBrett Williamson Jan 2, 2012 8:13 PM (in response to gonzalad). 7. Re: IE 9 support for Richfaces 3.x branchSilvia Peifer Apr 27, 2012 2:43 AM (in response to Brett Williamson) We have the same problems...any solution available? 8. Re: IE 9 support for Richfaces 3.x branchAdrien Adrien May 19, 2012 10:09 AM (in response to gonzalad) In same case, have you found a good workaround? It's critical, when i look in google analytics IE represent 38.18% of internet and 60% of ie use ie9!!! Millions people !! Impossible to say to users:" no no" not use ie, use chrome or firefox because actually we are in a course for a migration because our library has 1 year and is no more supported.... I think a good workaround (Servlet filter don't work it s impossible to add meta just after <head>) or anything else is welcome and urgent. Please show us Richfaces is the better choice in jsf library. Thanks Adrien 9. Re: IE 9 support for Richfaces 3.x branchgonzalad May 19, 2012 12:30 PM (in response to Adrien Adrien) Hi Adrien, We're using RF 3.3.3.Final, it works fine in IE9 when setting IE8 compatibility mode. You just have to set the necessary HTTP Headers (see). I'm not at work, but it should be something like X-UA-Compatible: IE=EmulateIE8. You can use a servlet filter for this or just modify your apache configuration (we use the first approach, but IMO the second is better since you don't have to modify your webapp). 10. Re: IE 9 support for Richfaces 3.x branchAdrien Adrien May 19, 2012 4:04 PM (in response to gonzalad) Hi Gonzalad, Thanks for the link, very interesting. If you use a Servlet filter how do you do to put the meta just after <head> and before the meta of Richfaces? ServletFilter: ---------------- ->For ServletFilter i've try to do it (with PhaseListener also) , but the meta X-UA-Compatible is always inserted after the meta of richfaces , so it have to be the first meta after <head> In the forum Niraj Adhikary has same problem : (etc...many other post) ->On internet i found many people who have this problem and the only workaround they found to put meta X-UA.. just after <head> is to use servlet filter and set loadScript/StyleStrategie at NONE and add explicitly the metas for richfaces in each page, I've try, it s 'functionnaly' ok but after the problem are skins and rich:page (semantic laouyt) .... APACHE ------------- ->I think it is only for who use mod_jk.....(snif) Thanks for response Adrien 11. Re: IE 9 support for Richfaces 3.x branchgonzalad May 19, 2012 7:41 PM (in response to Adrien Adrien) You just need to set HTTP header. Try something like this (don't know if this compiles), it should work : public class IECompatibilityFilter implements Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) { ((HttpServletResponse) response).setHeader("X-UA-Compatible", "IE=EmulateIE8"); chain.doFilter(request, response); } } Hope this helps 12. Re: IE 9 support for Richfaces 3.x branchAdrien Adrien May 20, 2012 1:14 AM (in response to gonzalad) Hi Gonzalad Thanks for your response. This is exactly the filter I used, but if you look in the console of IE9 n this warning is write :"HTML1115: X-UA-Compatible META tag ('IE=EmulateIE8') ignored because document mode is already finalized." So what is the trick to put the meta before richfaces metas? Adrien 13. Re: IE 9 support for Richfaces 3.x branchgonzalad May 22, 2012 4:04 AM (in response to Adrien Adrien) Hi Adrien, sorry for the late reply. Couldn't get my hands on a desktop with IE 9 ;( However, you shouldn't have to set <meta> in your JSF page (setting HTTP Header with the filter should be enough). The error : "HTML1115: X-UA-Compatible META tag ('IE=EmulateIE8') ignored because document mode is already finalized." is explained here : It appears because your X-UA-Compatible meta directive is not the first meta directive. Once more, don't use the meta directive - just set the HTTP Header. 14. Re: IE 9 support for Richfaces 3.x branch胜强 张 Jun 9, 2012 1:28 AM (in response to gonzalad) Thank you very much! You just described the point exactly and solved my problem.
https://community.jboss.org/message/568220
CC-MAIN-2015-40
en
refinedweb
Adding a driver to Player From The Player Project These are rough directions for adding a new driver to the CVS source-tree for Player/Stage. Other HowTos/Tutorials explaining other aspects of writing and building a Player 2.0 driver: Migrating from Player 1.6 to Player 2.0 How to write a player plugin driver Very good tutorial that describes in detail how to write a new driver Although this example is for a "roboteq" driver it should work for other drivers. "..." in a code block means lines were omitted for clarity. o.k., I have created a patch file for the changes made to the Player source tree in order to add my new Roboteq driver. Only glitch is that the patch does not include the two new files or the new directory: i.e.; position/ roboteq/ roboteq.cc Makefile.am here is the process: 1. cvs checkout of Player source (a cvs checkout and build is its own process; check Player FAQs for more info) 2. drop the directory for the new driver ("roboteq" -- position2d) in "player/server/drivers/position/" with its appropriately edited roboteq.cc (removed the extern "C" Extra stuff for building a shared object, otherwise same as the plugin driver). 3. add a new entry in "player/configure.ac": ... dnl Create the following Makefiles (from the Makefile.ams) AC_OUTPUT(Makefile ... server/drivers/position/roboteq/Makefile ... 4. add a new entry in "player/server/drivers/position/Makefile.am": ... SUBDIRS = isense microstrain vfh ascension bumpersafe lasersafe nav200 nd roboteq ... 5. add new entries in "player/server/libplayerdrivers/driverregistry.cc": ... #ifdef INCLUDE_ROBOTEQ void roboteq_Register (DriverTable* table); #endif ... #ifdef INCLUDE_ROBOTEQ roboteq_Register(driverTable); #endif ... 6. add new entry in "player/acinclude.m4": ... PLAYER_ADD_DRIVER([roboteq],[yes],[],[],[]) ... 7. create "player/server/drivers/position/roboteq/Makefile.am": AM_CPPFLAGS = -Wall -I$(top_srcdir) noinst_LTLIBRARIES = if INCLUDE_ROBOTEQ noinst_LTLIBRARIES += libroboteq.la endif libroboteq_la_SOURCES = roboteq.cc 8. run the usual ./bootstrap ./configure ./make && make install if you want to make sure this worked 9. from the top-level source directory (player/) cvs diff -u > registernewdriver.patch to make a patch file of any existing files that have changed. Check out the patch file to see if its in good shape. Mine had a bunch of ? marks at the top, listing new files cvs did not know about because they had not been added, so I cleaned it up a bit. Otherwise it should show the changes in all the files that were modified (above). 10. cvs did not allow me to add any files to the repository without having write-privileges: $ cvs add roboteq cvs [server aborted]: "add" requires write access to the repository so I just uploaded a tar.gz of the new directory with the patch file to patch tracker - don't know if there is a better way.
http://playerstage.sourceforge.net/wiki/index.php?title=Adding_a_driver_to_Player&oldid=4221
CC-MAIN-2015-40
en
refinedweb
Facebook Wall .NET API This project was awarded to czetxinc for $101.14 USD.Get free quotes for a project like this Awarded to: Project Budget$100 - $150 USD Total Bids2 Project Description We need a .NET library (preferably written in C#, but VB can also be used) that allows us to send markup to the wall of a specified Facebook account. The class should look similar to this: public class FacebookWall static void WriteToWall(username, password, flags, markup) static string GenerateMarkup(string text) static string GenerateMarkup(string photoUrl, string text) static string GenerateMarkup(string text, string urltitle, string url) The first method allows us to specify the username and password of a Facebook account. It also takes an integer that represents flags that further define how to write to the wall (for example, there should be a flag that determines whether a date/time is sent for the wall entry, etc). Finally, it takes the markup text that should be written to the wall (it is our understanding that the wall data must be specified in FB markup). The static helpers that follow returns FB markup from the passed in arguments. For example, the last GenerateMarkup accepts the text and a url that is to follow the text (so when this markup is sent to the wall, it displays the text followed by a clickable link). These utility methods make the library more usable, plus help to show us how to construct the markup for different, FaceBook
https://www.freelancer.com/projects/PHP-Engineering/Facebook-Wall-NET-API/
CC-MAIN-2015-40
en
refinedweb
NAME wait, waitpid, wait4, wait3 - wait for process termination LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include <sys/types.h> #include <sys/wait.h> pid_t wait(int *status); #include <sys/time.h> #include <sys/resource.h> pid_t waitpid(pid_t wpid, int *status, int options);() system call provides a more general interface for programs that need to wait for certain child processes, that need resource utilization). When the WNOHANG option is specified and no processes wish to report status, wait4() returns a process id of 0. The waitpid() function. SEE ALSO _exit(2), ptrace(2), sigaction(2), exit(3), siginfo(3) STANDARDS The wait() and waitpid() functions are defined by POSIX; wait4() and wait3() are not specified by POSIX. The WCOREDUMP() macro and the ability to restart a pending wait() call are extensions to the POSIX interface. HISTORY The wait() function appeared in Version 6 AT&T UNIX.
http://manpages.ubuntu.com/manpages/karmic/man2/waitpid.2freebsd.html
CC-MAIN-2015-40
en
refinedweb
data structure for ASTs in Python-written parsers Discussion in 'Python' started by elib Design structure for a MMORPG server core written in C++Snyke, Aug 5, 2004, in forum: C++ - Replies: - 1 - Views: - 3,105 - Christopher Benson-Manica - Aug 5, 2004 parsers / lexers usable from Python and Java (and C++/C)?John J. Lee, Jun 24, 2003, in forum: Python - Replies: - 3 - Views: - 993 - John J. Lee - Jun 26, 2003 Getting namespaces right when parsing/executing Python ASTsGordon Fraser, Oct 7, 2008, in forum: Python - Replies: - 0 - Views: - 316 - Gordon Fraser - Oct 7, 2008 Generally, are the programs written by C++ slower than written by C10% ?KaiWen, Sep 1, 2011, in forum: C++ - Replies: - 102 - Views: - 3,266 - Jorgen Grahn - Sep 15, 2011
http://www.thecodingforums.com/threads/data-structure-for-asts-in-python-written-parsers.670555/
CC-MAIN-2015-40
en
refinedweb
Details - Type: Bug - Status: Closed - Priority: Critical - Resolution: Fixed - Affects Version/s: 1.5.7, 1.6-beta-2 - Fix Version/s: 1.6-rc-1, 1.7-beta-1 - Component/s: None - Labels:None Description Run the attached script to see the bug in action. It seems getProperty() and DOMCategory.get() end up in an infinite loop. This is a serious problem for Gant since it means that you basically can't use categories in Gant scripts. Issue Links - relates to GROOVY-3220 CLONE for 1.5.x -StackOverflowError with DOMCategory and missing property - Closed Activity - All - Work Log - History - Activity - Transitions Also affects Subversion Head (aka 1.7-beta-1-SNAPSHOT). Even just this fails, without any property in the gstring: import groovy.xml.dom.DOMCategory use(DOMCategory) { println "foo" } import groovy.xml.dom.DOMCategory use(DOMCategory) { test } was failing too This is fixed in 1.6 and 1.7. But it seems the same fix can't be applied to 1.5 without generating some new test failures. I close this bug as the fix is now in 1.5.8 too Applying this fix breaks the 1.5 build on JDK 1.4. I created GROOVY-3220 as a clone for 1.5.x of this bug. Since it works on 1.7/1.6 it might very well be not really related to the patch, but to a problem uncovered by the patch. Anyway, it may be needed to divert from the path taken for 1.7/1.6 so we should protocol thatin the other issue Merged the changes for GROOVY-3220 into the trunk. Will do for 1.6 if no complaints. Your comment in 3220 didn't sound like a complaint about my change, so I've merged it into 1.6. I just tried the same example with org.codehaus.groovy.runtime.TimeCategory instead and that worked fine, so it looks like a problem with DOMCategory alone.
https://issues.apache.org/jira/browse/GROOVY-3109?focusedCommentId=158666&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
CC-MAIN-2015-40
en
refinedweb
Pt-G-4 Thom says: Warning! Unlike earlier example solutions, there are some significant differences of opinion on how to best implement this ‘extra credit’ question. You may find yourself with an edited schema that breaks when you try to migrate, and won’t roll back easily, either (I ended up just dropping the whole database a few times until I got it the way I wanted it.) You may also end up trying to decide whether to still use a foreign key constraint or not (I did), whether to use the strings (cc, po, etc) or just the numeric id’s to store the payment types in their own table (I chose the latter). And you may run into an infuriatingly easy-seeming problem where if you DO include a prompt for the user (eg, ‘pick a value below’), it is not displayed, or if you prompt => nil, it does show the prompt but always displays the prompt, instead of the value you chose (if one of your other fields fails validation.) You may then find yourself on an odyssey through the very difficult to access Rails API documentation (where do I find form.select? With examples?) because while the authors kindly list the four parameters to form.select (:attribute, choices, options, html_options) on p485 of the 2nd printed edition… they do not provide any examples of the use of the latter two parameters. It is Thom’s fervent wish that the “Daves” (authors) would please revisit this section and replace this entire page with a version that is in keeping with the otherwise very well thought out examples on the rest of this wiki. Or that SOMEONE would. Having been warned(!!) read on… but plan to possibly spend a lot more time trying to make this bit work than many of the previous ones. Nicolas says:My first step is to create the model Then I edit the migration script 007_create_payment_types.rbThen I edit the migration script 007_create_payment_types.rb depot> ruby script/generate model payment_type Then I edit checkout.rhtml and modify the form.select bit so it pulls its info out of the payment_types table instead of the instance variable:Then I edit checkout.rhtml and modify the form.select bit so it pulls its info out of the payment_types table instead of the instance variable: class CreatePaymentTypes < ActiveRecord::Migration def self.up create_table :payment_types, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' do |t| t.column :label, :string, :null => false t.column :value, :string, :null => false end PaymentType.create(:label => 'Check' , :value => "check") PaymentType.create(:label => 'Credit Card' , :value => "cc") PaymentType.create(:label => 'Purchase Order' , :value => "po") remove_column :orders, :pay_type add_column :orders, :payment_type_id, :integer, {:null => false} execute "alter table orders add constraint fk_order_payment_types " << "foreign key (payment_type_id) references payment_types(id)" end def self.down execute "alter table orders drop foreign key fk_order_payment_types" remove_column :orders, :payment_type_id add_column :orders, :pay_type, :string, :limit => 10 drop_table :payment_types end end <%= form.select :payment_type_id, PaymentType.find(:all).collect {|type| [type.label, type.value]}, :prompt => "-- Select --", :selected => nil %> Editing order.rb to reflect internal DB changes: class Order < ActiveRecord::Base has_many :line_items validates_presence_of :name, :address, :email, :payment_type_id validates_inclusion_of :payment_type_id, :in => PaymentType.find_all.map {|type| type.value} def add_line_items_from_cart(cart) cart.items.each do |item| li = LineItem.from_cart_item(item) line_items << li end end end I think that covers everything… Correct me otherwise :-) However, the :prompt option doesn’t seem to work, I’m not sure how to do that at this stage. Dave: Maybe because you’re giving the payment_type_id column a default value? :prompt only does its thing if the column has no value. Nicolas: You’re correct, I’ve edited my listings above, removing the default value and adding the :selected symbol, set to nil. It works great now. Ok there is a problem, and I can’t find the answer. The validates_inclusion_of :payment_type_id never returns true. It seems that the value I have put for :in is incorrect, although it does return an array. Any hints? Nicolas:I found the problem. I’m giving the drop-down the old values (cc, po etc..) instead of the payment_type_id that is used as a reference. So in checkout.rhtml, I corrected with this: And in order.rb:And in order.rb: <%= form.select :payment_type_id, PaymentType.find_all.collect {|type| [type.label, type.id]}, :prompt => "-- Select --", :selected => nil %> validates_inclusion_of :payment_type_id, :in => PaymentType.find_all.map {|type| type.id} And it works fine :-) I assumed I had to do rake db:migrate, but it failed on the foreign key creation: execute(“alter table orders add constraint fk_order_payment_types foreign key (payment_type_id) references payment_types(id)”) rake aborted! Mysql::Error: Cannot add or update a child row: a foreign key constraint fails: alter table orders add constraint fk_order_payment_types foreign key (payment_type_id) references payment_types(id) “ I have MySQL? Ver 14.7 Distrib 4.1.20 and looking around in PhpMyAdmin?, I have an orders table, with a payment_type_id field and I have a payment_types table and both tables have “id” as the primary key. I even tried running this statement manually: “alter table orders add constraint fk_order_payment_types foreign key (payment_type_id) references payment_types(id)” but it fails with the same error. Does anyone have any clues as to why this is failing for me? Thanks in advance. Tiago White: Hi Nicolas, I am having problems with its solution aproach, when i hit the “checkout”, i’m reciving this error: NoMethodError in Store#checkout Showing app/views/store/checkout.rhtml where line #21 raised: undefined method `payment_type_id' for #<Order:0x51e1d38> Extracted source (around line #21): 18: <p> 19: <label for="order_pay_type">Pay with:</label> 20: <%= 21: form.select :payment_type_id, 22: PaymentType.find_all.collect {|type| [type.label, type.id]}, 23: :prompt => "-- Select --", 24: :selected => nil RAILS_ROOT: ./script/../config/.. BillyGray: (re foreign key failure) It sounds like you already have existing data in the payment_type_id field that doesn’t match a payment_type in the payment_types table. When you can’t create an FK, it’s usually because existing data violates the proposed constraint. I hope that helps!Another tip I’ve picked up: when doing numerous updates to your database in a migration, it can be very helpful to wrap it all in a transaction block: This way, if one of your later statements fails, you aren’t left with a mess of a migration to fix and an incorrect schema version in the schema_info table.This way, if one of your later statements fails, you aren’t left with a mess of a migration to fix and an incorrect schema version in the schema_info table. def self.up transaction do add_index :some_table, :fk_id execute "ALTER TABLE some_table ADD CONSTRAINT fk_other_table_id FOREIGN KEY....etc" end end However, some databases like MySQL? don’t allow DDL statements like ‘create table’ within a transaction. Which is why you should use PostgreSQL? =P JimJamesAZ: I finally got it to take after emptying the line_items and the orders tables. NicolasConnault: You may also find it useful to add the option :force => true to your migrations’ table creations, this will add the DROP IF EXISTS statement to the SQL. And of course, if you are using referential integrity, don’t forget to set the table to INNODB create_table :orders, :force => true, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' do |t| JimJamesAZ: I decided it would be best to figure out how I would make the change if I wanted to preserve existing data in the order table. This is what I came up with : I did not remove the pay_type column until I had populated the payment_type_id column with info from the pay_type column. Here is the relevent portion: ######## begin Portion of 007_create_payment_types.rb######################### # ... PaymentType.create(:label => 'Purchase Order' , :value => "po") add_column :orders, :payment_type_id, :integer, {:null => false} execute "update orders set payment_type_id = '1' where pay_type = 'check'" execute "update orders set payment_type_id = '2' where pay_type = 'cc'" execute "update orders set payment_type_id = '3' where pay_type = 'po'" remove_column :orders, :pay_type execute "alter table orders add constraint fk_order_payment_types " << "foreign key (payment_type_id) references payment_types(id)" # ... ######## end Portion of 007_create_payment_types.rb######################### NicolasConnault: Good point, it’s important to consider existing data when applying migrations. However, it’s doubtful that you would have to go back that far on a production application, since this is all part of the initial setup. These kinds of considerations would become more important as the project becomes more mature, with lots of testing happening. Jim, contact me at some stage when you’re doing the AJAX stuff, I’m having some difficulties, but also discovering some very interesting things. Jim Alateras: I ended up using the has_one decorator in Order to define the relationship between order and payment type. I also removed the associated validates_inclusion_of decorator from the class. Is there any disadvantage in doing this? linoj says: I dont understand the need for the added complexity of a foreign key here. It seems to make it more fragile (and using the id is an extra level of indirection). For example, if you change the table with more or less options, change their order, and the id’s change, existing data will break. I’d just continue to store the selection list value in the field. thus, my migration (007_create_paytypes.rb) contains def self.up create_table :paytypes do |t| t.column :name, :string, :null => false t.column :value, :string, :null => false end Paytype.delete_all # only needed if creates are in a separate migration Paytype.create(:name => 'Check', :value => "check") Paytype.create(:name => 'Credit card', :value => "cc") Paytype.create(:name => 'Purchase order', :value => "po") end <%= form.select :pay_type, Paytype.find(:all).map { |p| [ p.name, p.value ] }, :prompt => "Select a payment method" %> and order.rb changes to validates_inclusion_of :pay_type, :in => Paytype.find(:all).map { |p| p.value } ilari says: If want to use the existing values in the pay_type-field in orders-table, you can use the following solution:Create the model and migration for pay_types with Then modify generated 007_create_pay_types.rbThen modify generated 007_create_pay_types.rb script/generate model pay_type class CreatePayTypes < ActiveRecord::Migration def self.up create_table :pay_types, {:id => false} do |t| t.column :typeid, :string, :null => false, :limit => 10 t.column :name, :string, :null => false end execute "alter table pay_types add primary key (typeid)" # PayType.create(:id => "check", :name => "Mail Check") # PayType.create(:id => "credit", :name => "Credit card") # PayType.create(:id => "order", :name => "Purchase order") paytype = PayType.new paytype.id = "check" paytype.name = "Mail check" paytype.save paytype = PayType.new paytype.id = "cc" paytype.name = "Credit card" paytype.save paytype = PayType.new paytype.id = "po" paytype.name = "Purchase order" paytype.save execute "alter table orders add constraint fk_orders_pay_types \ foreign key (pay_type) references pay_types(typeid)" end def self.down execute "alter table orders drop foreign key fk_orders_pay_types" drop_table :pay_types end end Then modify generated pay_type.rb class PayType < ActiveRecord::Base set_primary_key :typeid end Then modify order.rb validates_inclusion_of :pay_type, :in => PayType.find(:all).map {|p| p.typeid} And finally modify checkout.rhtml <p><label for="order_pay_type">Pay with:</label> <%= form.select :pay_type, PayType.find(:all).map {|p| [p.name, p.typeid]}, :prompt => "Select a payment method" %></p> This should get you going, and you are also able to rollback your changes. In the migration script, I could not get the PayType?.creates to work (left in commented). Anyone have a solution for that? Dave Moore says: Your create statement is using :id but your column name is :typeid. Hi there, I just wondered what we should need two values for in the payment_types table… once I moved the payment types into the db I only set up a table with one “name” column (besides the id). I guess that output should always be human readable and internaly I only need an ID. My validation then looks like this: validates_inclusion_of :payment_type_id, :in => PaymentType.find(:all).collect { |pt| pt.id } Any reason for having something more then a numeric id? Anthony says: I like the consideration for existing data in a live database, hadn’t thought of that, and its good to know how to convert dynamically – also the point about transactions (postgres over mysql). As for a payment_type_id, I believe its standard to have a numeric id. The short-hand version could be handy for comparison statements when you actually go to implement the payment processing. Which do you want to write?: if ptype.label == 'Personal Check' if ptype.name == 'check' if ptype.id == 7 #=> uh...which one is 7 again? Your label may very well change due to marketing purposes, but the id and the name attributes would have a tendency to remain constant. Bill says: I also added the DB constraint “knitting” to order.rb: belongs_to :payment_type and in payment_type.rb class PaymentType < ActiveRecord::Base has_one :order end sarah says: After trial and error, I agree with linoj who said “I dont understand the need for the added complexity of a foreign key here”. I originally got this working with with a numeric fk (id), where I was adding payment_type_id and deleting pay_type from orders in my migrations. It was working, but it was fragile on the front-end because pay_type was no longer a method, payment_type_id no longer existed, etc. So I re-did it by creating table pay_types with typeid (pk) and name [typeid is the string “cc” or “check”, etc]. But still when I rolled back migrations so there was no longer a pay_types table, this code in checkout.rhtml failed: # This FAILED on rollback <%= form.select :pay_type, PayType.find(:all).map {|p| [p.name, p.typeid]}, :prompt => "Select a payment method" %> And I’d have to manually edit checkout.rhtml and put back the original: # This needed to be restored <%=form.select :pay_type, Order::PAYMENT_TYPES, :prompt=>"Select a payment method" %> I’d also have to restore the PAYMENT_TYPES array and comment out the incorrect validates_inclusion_of lines in order.rb. It was a lot of manual editing for a migration rollback. So I made a method in pay_type.rb that will return pay_types from the DB, or, if the DB doesn’t exist return pay_types from a pre-existing array (the same one we had hard-coded originally in order.rb). Is this overkill? – after all, how many times, realistically, is one going to be adding and deleting the database table pay_types, and do we really need to encapsulate this? BUT doing this allowed me to drop and add the pay_types table and see no change in the code functionality and no errors. That was enough of a motivation. So: In pay_type.rb: Then I changed my checkout.rhtml to:Then I changed my checkout.rhtml to: def self.get_pay_types if PayType.table_exists? pts = PayType.find(:all) payment_types = [] pts.each do |pt| payment_types << [pt.name,pt.typeid] end else payment_types = [ # Displayed #stored in orders table in db ["Check", "check"], ["Credit Card", "cc"], ["Purchase Order", "po"] ] end payment_types end <%=form.select :pay_type, PayType.get_pay_types, :prompt=>"Select a payment method" %> And my order.rb validation to: validates_inclusion_of :pay_type, :in=>PayType.get_pay_types.map{|disp,value| value} And now, no matter where I get my pay_types from (db or array), the code works! Does anyone see a reason to not do it this way (or a variant of this way)? Russell Healy says: NicolasConnault – regarding migrating existing data – it’s also important when you’re developing as a team, because other developers may have existing test data in their test databases. Anyway, here’s my migration which does pretty much the same as JimJamesAZ’s, but with way more lines of code! 007_create_payment_types.rb: class CreatePaymentTypes < ActiveRecord::Migration def self.up create_table :payment_types do |t| t.column :label, :string, :null => false end add_column :orders, :payment_type_id, :integer check = PaymentType.create(:label => "Check") credit_card = PaymentType.create(:label => "Credit card") purchase_order = PaymentType.create(:label => "Purchase order") Order.find(:all).each do |order| case order.pay_type when "check" order.payment_type = check when "cc" order.payment_type = credit_card when "po" order.payment_type = purchase_order end order.save! end change_column :orders, :payment_type_id, :integer, :null => false remove_column :orders, :pay_type execute %Q[alter table orders add constraint fk_order_payment_type foreign key (payment_type_id) references payment_types(id)] end def self.down add_column :orders, :pay_type, :string, :limit => 10 check = PaymentType.find(:first, :conditions => [ "label = ?", "check"]) credit_card = PaymentType.find(:first, :conditions => [ "label = ?", "cc"]) purchase_order = PaymentType.find(:first, :conditions => [ "label = ?", "po"]) Order.find(:all).each do |order| case order.payment_type when check order.pay_type = "check" when credit_card order.pay_type = "cc" when purchase_order order.pay_type = "po" end order.save! end execute %Q[alter table orders drop foreign key fk_order_payment_type] remove_column :orders, :payment_type_id drop_table :payment_types end end kimsk112 says:To make sure that the script by Russell Healy will work, you will need to add a line of code to order.rb. order.rb: belongs_to :payment_type foudfou says: good to know: my form.select would not initialize correctly, because one column of my table payment_types was called display, which conflicts with a well-known method. <%= form.select :payment_type_id, PaymentType.find(:all).collect { |p| [ p.display, p.id ] }, :prompt => "Sélectionner un type de réglement" %> i.e.: p.display would refer to the display method of p, instead of the column named “display” of the table payment_types. solution was to rename the column “name”. nulbyte says: A chink in an otherwise good framework is this nonsense over primary keys having to be integers. There has never been a popular consensus in db that said that primary key had to be like that (database ‘agnostic’ all the same). The OP’s solution that includes both the alphanumeric code and the id. This leaves a sour taste in the mouth. Personally I use the a unique index of a the of the :type_id and set :id=>nil (boo!). I can do the foreign key alright. Foreign keys are generally a good idea in terms of integrity, and to avoid late night debugging. Database ‘agnosticism’ shouldn’t mean database ignorance. James West says: The problem here seems to be a lot more about the headache of migrations rather than the actual changes needed to get the change in place and working. There are some excellent ideas here on the steps required to implement the actual interface requirements which I will certainly have a go at but the main problem appears to be caused by the fact that existing data wil lconflict with the payment types table and there seems to be a lot of confuion over how to deal with this in a migration. In a commercial environment using other development tools I have tackled this problem many times and the solution has been very simple. The steps to the solution as I see it are as follows 1) Create and populate the payment type table. 2) Add a foreign key to the order table (this must allow blanks and have no referential integrity at this stage.) 3) Update existing records in the order table to set the foreign key to point to the payment type table primary key (SQL is VERY good at this sort of thing.) 4) Set the foreign key on the the order table to have referential integrity and to not allow blanks (This can be done now as all data will be populated. 5) Remove the original payment type field from the order table. What I would have done in other development environments would be to write a stored procedure to do the work possibly with an update program depending on the complexity of the situation but can all this be done in a migration. I don’t see why not as SQL can be rn as part of a migration. The same principle applies time and time again in the real world and the above is very definitely the way to approach the solution in my mind there are no issues with key types being numeric that seem to have confused people and is totally database independant. The only thing that you need to be careful of with this approach is that when you create and populate the payment types table is that you can easily identify the records to update in the order table. so set the value of the Payment Type Name field to one of the following for each of the 3 payment type records you create “check”, “cc”, “po” this will allow an update statement to find all recrods where name = “po” and update them with the key from the correspondingly matched record in the payment type table You can then go and change the value of the payment type name field in the payment type table to anything you want after the update has been run. Now all you need to do is apply the changes to the model etc… Have I done this yet? No! But I’m about to and if I have time I’ll post back here the actual changes I made to get it to work. JoeyA says:I’ve updated the checkout view with the following line to display the drop-down based on the new database table: Does anyone know why the prompt doesn’t appear? I.e., the check, credit card, and purchase order options appear but no “Select a payment method.”Does anyone know why the prompt doesn’t appear? I.e., the check, credit card, and purchase order options appear but no “Select a payment method.” <%= form.collection_select :payment_type_id, PaymentType.find(:all), :id, :label, options={:prompt => "Select a payment method"} %> PEZ says:My migration looks much like linoj’s. Then I have this model: In the Order model:In the Order model: class PaymentType < ActiveRecord::Base ALL_OPTIONS = self.find(:all).collect {|pt| [pt.disp, pt.value]} ALL_VALUES = ALL_OPTIONS.map {|disp, value| value} end And the form select:And the form select: validates_inclusion_of :pay_type, :in => PaymentType::ALL_VALUES <%= form.select :pay_type, PaymentType::ALL_OPTIONS, :prompt => "Select a payment method" %> I.e. it’s much like the original code, just moving some of the responsibilities to the PaymentType model. And since most of the wiring is left unchanged the validation still works. PEZ adds But now when I’ve reached the section about integration testing I stumble across some problems. (I’m reading the 3rd edition beta, if that matters.) I think it has to do with that the test database doesn’t have the payment types. Adding them with a fixture doesn’t help since I’m initializing the constants before the table is populated (that’s what I think happens, I could be wrong). The fixture was just something I tried to see if it would work. It’s not a solution that appeals to me. Anyone who can suggest a strategy for keeping the test database’s lookup tables populated? Simon says:About testing lookup tables, it really turned out to be pain in the a-ss. Finally, I’ve created fixures payment_method.yml and changed order.yml fixture to:and changed order.yml fixture to: one_pay: pmethod: Bank robbery This worked for me.This worked for me. one: name: John Smith address: 33 Bunaia email: jsmith@smith.com payment_method_id: <%= Fixtures.identify(:one_pay) %> McWild says: After reading all thread, I still can not understand why all of you want to create a new field(payment_type_id) in orders table? Why not use the old(pay_type) field? And why we should manage migration of existed data with zero records in database(I didn’t count that one test record we have)? Here is my solution of this task: class Order < ActiveRecord::Base has_many :line_items has_one :payment_types def add_item(item_information) line_items << LineItem.new(item_information) end if PaymentType.table_exists? PAYMENT_TYPES = PaymentType.find(:all).collect {|type| [type.label, type.value]} else PAYMENT_TYPES = [ # Displayed Stored in orders table in db ["Check", "check"], ["Credit Card", "cc"], ["Purchase Order", "po"] ] end validates_presence_of :name, :address, :email, :pay_type validates_inclusion_of :pay_type, :in => PAYMENT_TYPES.map {|disp, value| value} end class PaymentType < ActiveRecord::Base belongs_to :orders end class CreatePaymentTypes < ActiveRecord::Migration def self.up create_table :payment_types, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' do |t| t.string :label, :null => false t.string :value, :limit => 10, :null => false t.timestamps end end def self.down drop_table :payment_types end end class AddPaymentTypesData < ActiveRecord::Migration def self.up PaymentType.create(:label => 'Check' , :value => "check") PaymentType.create(:label => 'Credit Card' , :value => "cc") PaymentType.create(:label => 'Purchase Order' , :value => "po") remove_column :orders, :pay_type add_column :orders, :pay_type, :string, :limit => 10, :null => false execute "ALTER TABLE orders ADD CONSTRAINT fk_orders_payment_types FOREIGN KEY (pay_type) REFERENCES payment_types(value)" end def self.down execute "ALTER TABLE orders DROP FOREIGN KEY fk_orders_payment_types" remove_column :orders, :pay_type add_column :orders, :pay_type, :string, :limit => 10, :default => 'check' end end DougEmery says: I wanted to use the association of PayType to Order, and be very deliberate in my steps , so I: - created a PayType scaffold (which, among other things, created a migration for the pay_types table), - added two more migrations for altering the order table and adding the pay_type values, - added the has_many and belongs_to associations to PayType and Order, resp., - changed Order’s validates_inclusion_of to validates_associated - changed checkout.html.erb file to use PayType.find Here are the details: 1) Create PayType scaffold: [depot]>ruby script/generate scaffold pay_type name:string The code of db/migrate/20081211161906_create_pay_types.rb: class CreatePayTypes < ActiveRecord::Migration def self.up create_table :pay_types do |t| t.string :name # could set this to :null => false t.timestamps end end def self.down drop_table :pay_types end end 2a) Add migration for changes to order table: [depot]>ruby script/generate migration add_pay_type_id_to_order \ > pay_type_id:integer Edit migration db/migrate/20081211162213_add_pay_type_id_to_order.rb: class AddPayTypeIdToOrder < ActiveRecord::Migration def self.up > remove_column :orders, :pay_type add_column :orders, :pay_type_id, :integer end def self.down remove_column :orders, :pay_type_id end end 2b) Add migration for adding pay_type values: [depot]>ruby script/generate migration add_pay_types Edit migration db/migrate/20081211162456_add_pay_types.rb class AddPayTypes < ActiveRecord::Migration def self.up > PayType.delete_all > PayType.create(:name => 'Check') > PayType.create(:name => 'Credit Card') > PayType.create(:name => 'Purchase Order') end def self.down > PayType.delete_all end end 3) Added the has_many and belongs_to associations to PayType and Order, resp., class PayType < ActiveRecord::Base > has_many :orders end class Order < ActiveRecord::Base > # PAYMENT_TYPES = [ > # # Displayed stored in db > # [ "Check", "check"], > # [ "Credit card", "cc"], > # [ "Purchase order", "po"] > # ] > belongs_to :pay_type has_many :line_items #... end 4) Change Order’s validates_inclusion_of to validates_associated: class Order < ActiveRecord::Base belongs_to :pay_type has_many :line_items validates_associated :pay_type # validates_inclusion_of :pay_type, # :in => PAYMENT_TYPES.map { |disp,value| value } #... end 5) Change checkout.html.erb file to use PayType.find: <p> <%= form.label :pay_type, "Pay with:" %> <%= form.select :pay_type, > PayType.find(:all).collect { |pt| [ pt.name, pt.id ] }, :prompt => "Select a payment method" %> </p> This did not work as expected, though, because the select returned an ‘id’ and the Order object pay_type field expected a PayType object, so I got: ActiveRecord::AssociationTypeMismatch in StoreController#save_order PayType(#19767680) expected, got String(#111600) The solution was to change :pay_type to the implicit :pay_type_id value that is created by the belongs_to :pay_type association. I found the answer here: <p> <%= form.label :pay_type, "Pay with:" %> <%= form.select :pay_type_id, PayType.find(:all).collect { |pt| [ pt.name, pt.id ] }, :prompt => "Select a payment method" %> </p> Trientalis said: I found a solution similar to the one of PEZ, but a little different: My first migration is: class CreatePayments < ActiveRecord::Migration def self.up create_table :payments do |t| t.string :name t.string :short t.timestamps end end def self.down drop_table :payments end end ... and my second migration populates the payment table with data: class AddPaymentMethods < ActiveRecord::Migration def self.up Payment.create(:name => "Check", :short => "check") Payment.create(:name => "Credit card", :short => "cc") Payment.create(:name => "Purchase order", :short => "po") end def self.down Payment.delete_all end end Sure, you can do this as one migration, but to roll the migrations back it might be better to seperate these two steps. Then I did the following in the new Payment model to make the data useable to other controllers: class Payment < ActiveRecord::Base ALL = self.find(:all, :order=>:name).map do |s| [s.name, s.short] end end I named the displayed string “name” and the value “short”. Now by “ALL” I can call these data in the Order model. And I changed the validation a little so that it works with my column names class Order < ActiveRecord::Base has_many :line_items PAYMENT_TYPES = Payment::ALL validates_presence_of :name, :address, :email, :pay_type validates_inclusion_of :pay_type, :in => PAYMENT_TYPES.map {|name, short| short} . . . end ... and in the checkout file I replaced the old form.select by this: <%= form.select :pay_type, Payment::ALL, :prompt => "Select a payment method!" %> Because I have made the crucial change in the Payment model, the original code still works without many further changes in the order table or so being necessary. Will says Move comments for the book to StackOverflow! Would be much easier to read and vote up the best answer IMHO Brian says: The task said “Can you move this list into a database table?” It didn’t say anything about changing the data we’re storing. So, on that basis, I kept it as simple as possible: # the migration class CreatePaymentTypes < ActiveRecord::Migration def self.up create_table :payment_types do |t| t.string :name t.timestamps end PaymentType.create(:name => 'Cheque') PaymentType.create(:name => 'Credit card') PaymentType.create(:name => 'Purchase order') end def self.down drop_table :payment_types end end And one line of code change in order.rb: PAYMENT_TYPES = PaymentType.find(:all).collect {|type| [type.name]} That’s all there needs to be. You can argue about the merits of referential integrity and storing full payment type names in the orders table but the fact is we weren’t asked to do any of that! :-) ..... except that, although it works perfectly in the browser, I can’t make the tests work! I get failures in test_should_create_order() with @order.errors saying ay_type=>”is not included in the list”. Order::PAYMENT_TYPES seems to be empty at this point, although payment_types.yml is populated appropriately. Honza says Brian, your solution is elegant and perfect for the job. You really don’t need ID’s to get it done, and by keeping textual representation of payment type in the orders table you also keep a track of it to history, even in case someone updates (deletes from) table payment_types. Using ID and foreign keys is IMHO too robust for the case of configuration-type DB table. For the tests: it seems that fixtures only work on tables which have proper primary keys (IDs) so in this case, init from the PaymentType.find(:all) will end with empty result.It helps to use this condition in model: class Order < ActiveRecord::Base if PaymentType.find(:all).count > 0 # fetch conf from db @@payment_type = PaymentType.find(:all).map {|p| p.name} else # some test defaults @@payment_type = ['Cheque', 'Credit card'] end has_many :line_items, :dependent => :destroy validates :name, :address, :email, :pay_type, :presence => true validates :pay_type, :inclusion => @@payment_type # returns payment types on demand anywhere def self.get_payment_types @@payment_type end end I have used class variable @@payment_type with some helper getter instead of class constants, but anyway this works perfectly with your code for migration and functional tests are OK, assuming you have ‘Cheque’ defined as payment_type in fixture orders.yml :one. Tusmechmes says Brian, if you remove the [] from [type.name] your test will run with the fixture. i.e: (also added a puts so I could debug the array content) PAYMENT_TYPES = PaymentType.find(:all).collect {|type| type.name } puts PAYMENT_TYPES.inspect William says below corresponds to Activity G-4 in 4e R3.0 This is my approach for resolving the mass-assignment issue with product_id: 1) Cart.add_product(product_id) - current_item = line_items.build(product_id: product_id) + current_item = line_items.build + current_item.product_id = product_id 2a) LineItemsController#update + params[:line_item].delete(:product_id) Reason is that the product_id is unlikely to be changed/reassigned for an existing line_item, so given the existing functionality it is probably harmless to exclude it from the params hash. 2b) Alternative interpretation After reading it again, it seems like the intent is to for the update to fail when product_id is included. Hence, I updated the original update test with assert_raise and added a new update test that passes without product_id as a parameter. Pierre says test "update should raise error" do params = { line_item: { cart_id: @line_item.cart_id, product_id: @line_item.product_id }} assert_raise ActiveModel::MassAssignmentSecurity::Error do @line_item.udpate_attributes(params[:line_item]) end end Page History - V24: Pierre Sugar [almost 3 years ago] - V23: Pierre Sugar [almost 3 years ago] - V22: Pierre Sugar [almost 3 years ago] - V21: William Ko [almost 3 years ago] - V20: William Ko [almost 3 years ago] - V19: William Ko [almost 3 years ago] - V18: William Ko [almost 3 years ago] - V17: William Ko [almost 3 years ago] - V16: William Ko [almost 3 years ago] - V15: William Ko [almost 3 years ago]
https://pragprog.com/wikis/wiki/Pt-G-4/version/22
CC-MAIN-2015-40
en
refinedweb
Philip KelleyTeam Foundation Server / Visual Studio Online Evolution Platform Developer Build (Build: 5.6.50428.7875)2008-11-12T20:04:39ZAdding a corporate (or self-signed) certificate authority to git.exe’s store<p>This is a topic that I touched on a little bit in my last post, "<a href="">Git network operations in Visual Studio 2013</a>.” If your organization has an on-premises installation of Team Foundation Server 2013 or later, and you connect using HTTPS, then the root certificate which vouches for the authenticity of your SSL cert is probably private to your organization. That root certificate is probably distributed to all domain-joined machines in your organization via group policy, and it is stored in the Windows certificate store for your machine.</p> <p>Any application written to use the Windows crypto APIs will have access to that root certificate, and will consider your TFS deployment to be trusted. Applications using the Windows certificate store include Internet Explorer, Google Chrome, and Visual Studio 2013. However, Git for Windows (git.exe) uses OpenSSL for its crypto stack, and the Git for Windows distribution includes a set of trusted root certificates in a simple text file. Your organization’s root certificate will not be in this list, and if you try to use git.exe to perform network operations against your TFS server, you’ll get an error like this:</p> <p><span style="font-family: 'Courier New'; font-size: x-small;">F:\>git clone <br /> Cloning into 'Proj'... <br /> fatal: unable to access '': SSL certificate problem: unable to get local issuer certificate</span></p> <p>You have a couple of different options for how to work around this problem. The easy way is to just disable SSL certificate validation entirely – if this is what you want to do, you can find numerous articles on the web about how to do this. I won’t address it here because unfortunately, it defeats one of the purposes of having SSL to begin with – server authentication. Your organization probably has HTTPS turned on for a reason. What if we wanted to add the root certificate to git.exe’s certificate store, in the same way that domain membership in your organization has added it to your Windows certificate store? Here’s how.</p> <h3>Step 1. Extract the root certificate as a base64-encoded X.509 CER/PEM file</h3> <p>(These steps were written using Internet Explorer 11. On other versions of IE, I suspect the same steps are still possible, but they may be slightly different.) Open Internet Explorer and visit your TFS server in the web browser. For our example above, the URI would be <a href=""></a>. At the right of the address bar is a lock icon which you can click to learn more about the details of how your connection to the server has been secured.</p> <p>At the bottom of the drop-down is a link to “View certificates.” If you click the “Certification Path” tab of the dialog box which comes up, you can see the entire chain of trust. Select the top-most certificate in the chain – this is the root certificate.</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert1" src="" alt="cert1" width="298" height="370" border="0" /></a></p> <p>Then click “View Certificate” to open up that root certificate, and go to the Details tab.</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert2" src="" alt="cert2" width="298" height="370" border="0" /></a></p> <p>On the Details tab, you can select “Copy to File…”, which will start the export wizard for certificates. On the second page of the wizard, you will be asked what format to use for exporting your certificate. Choose the second option: base64 encoded X.509.</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert3" src="" alt="cert3" width="418" height="408" border="0" /></a></p> <p>Save the certificate somewhere on your disk. You’ll need this for step 2.</p> <h3>Step 2. Switch to using a private copy of the Git root certificate store</h3> <p>When you install Git for Windows (msysgit) on your machine, it drops a file called curl-ca-bundle.crt in your Program Files directory. This is the root certificate store for git.exe. It’s just a text file containing all of the certificates that git.exe trusts, one after another. The text file has UNIX (\n) line endings, though, so if you open it up in Notepad, it won’t look too pretty.</p> <p>What we want to do in this step is to make a copy of the curl-ca-bundle.crt file (which is installed on a per-machine basis) that will be private for just your Windows user. The ideal place to store the file is in your %USERPROFILE% (C:\Users\yourname) directory, right alongside your per-user (“global”) .gitconfig file. On my machine, the following command does it – if you are using 32-bit Windows, you’ll want to fix up the Program Files part of the path so there isn’t an “x86” section.</p> <p>(If you don’t know where your user profile directory is, you can just run “echo %USERPROFILE%” at the command prompt. For example, mine is C:\Users\phkelley.)</p> <p><span style="font-size: x-small;"><span style="font-family: 'Courier New';">copy "C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt" C:\Users\<strong>yourname</strong></span></span></p> <p><strong>(Note: </strong>In the Git for Windows 2.x series, the path has changed to <span>C:\Program Files (x86)\Git\mingw32\ssl\certs\ca-bundle.crt. Thanks Craig for the tip.)</span></p> <p>Next, we’ll want to configure Git to use this private copy of the certificate store. You can set this up with the following command:</p> <p><span style="font-family: 'Courier New'; font-size: x-small;">git config --global http.sslCAInfo C:/Users/<strong>yourname/</strong>curl-ca-bundle.crt</span></p> <p>(Note the use of forward slashes and not backslashes above.) As a quick sanity check, try to clone a repository from GitHub to make sure that everything is still working:</p> <p><span style="font-family: 'Courier New'; font-size: x-small;">git clone</span></p> <h3>Step 3. Add the exported root certificate to the private copy of the store</h3> <p>The last step is to open up the curl-ca-bundle.crt file (the private copy we made in step 2) in a text editor and add an entry at the bottom for your exported root certificate. I used the <a href="">“unix2dos” tool available here</a> to change the line endings in the file from \n to \r\n so that I could open the file up in Notepad:</p> <p><span style="font-family: 'Courier New'; font-size: x-small;">unix2dos C:\Users\<strong>yourname</strong>\curl-ca-bundle.crt</span></p> <p>Then I opened up the exported certificate from step 1 in Notepad and put its entire contents onto the clipboard.</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert4" src="" alt="cert4" width="341" height="415" border="0" /></a></p> <p>Next, I opened up the C:\Users\<strong>yourname</strong>\curl-ca-bundle.crt file, added an entry for this certificate at the end, pasted in the cert, and saved the file. All done!</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="image" src="" alt="image" width="388" height="531" border="0" /></a></p> <h3>Step 4. Try it out…</h3> <p><span style="font-family: 'Courier New'; font-size: x-small;">F:\>git clone <br />Username for '': domain\username <br /> Password for '\username@myserver': <br /> remote: <br /> remote: fTfs <br /> remote: fSSSSSSSs <br /> remote: fSSSSSSSSSS <br /> remote: TSSf fSSSSSSSSSSSS <br /> remote: SSSSSF fSSSSSSST SSSSS <br /> remote: SSfSSSSSsfSSSSSSSt SSSSS <br /> remote: SS tSSSSSSSSSs SSSSS <br /> remote: SS fSSSSSSST SSSSS <br /> remote: SS fSSSSSFSSSSSSf SSSSS <br /> remote: SSSSSST FSSSSSSFt SSSSS <br /> remote: SSSSt FSSSSSSSSSSSS <br /> remote: FSSSSSSSSSS <br /> remote: FSSSSSSs <br /> remote: FSFs (TM) <br /> remote: <br /> remote: Microsoft (R) Visual Studio (R) Team Foundation Server <br /> remote: <br /> Receiving objects: 100% (6781/6781), 47.12 MiB | 32.56 MiB/s, done. <br /> Resolving deltas: 100% (4553/4553), done. <br /> Checking connectivity... done</span></p> <p>Not bad! The steps above for adding a root certificate apply to anyone using git.exe in corporate/self-signed scenarios like this, not just Team Foundation Server 2013 or later.</p><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT) network operations in Visual Studio 2013<p>Visual Studio 2013 includes in-the-box support for Git version control. That support includes the ability to perform Git network operations from inside of Visual Studio, such as cloning a repository, or performing a fetch, push, or pull operation on an existing repository.</p> <p>An endpoint for a clone, fetch, push, or pull operation in Git is called a “remote.” Visual Studio 2013’s Git support contains support for remotes using the following protocols.</p> <ul> <li>HTTP (i.e. <a href=""></a>, or <a href=""></a>)</li> <li>File paths (i.e. F:\myrepo.git, or <a href="file://\\servername\sharename\myrepo.git">\\servername\sharename\myrepo.git</a>)</li> <li>git:// URIs</li> </ul> <p>As of this writing, Visual Studio 2013 does not have support for ssh-based remotes. If you have a Git remote that uses SSH and you try to perform a network operation in Visual Studio, you’ll get the message “This transport isn’t implemented. Sorry.” (This message comes from the libgit2 library.) I don’t have a timeline for when support for SSH remotes might be implemented in Visual Studio.</p> <h3>HTTP endpoints</h3> <p>When performing network traffic against an HTTP endpoint, Visual Studio uses the System.Net stack (HttpWebRequest and friends) to actually issue the web requests. Both HTTP and HTTPS URIs are supported.</p> <p>The System.Net stack in the .NET framework has full support for web proxy configuration through the Internet Options page. If you need to use a web proxy to communicate with your remote endpoint, you should set up your proxy configuration there. Start the Control Panel, then select Internet Options to open the Internet Properties dialog. On the Connections tab, at the bottom of the page is a button labeled “LAN settings.” Clicking this button opens the proxy configuration dialog for Internet Explorer.</p> <p><a href=""><img title="proxy_config" style="border: 0px currentcolor; margin-right: auto; margin-left: auto; float: none; display: block;" border="0" alt="proxy_config" src="" width="394" height="346" /></a></p> <p>The System.Net stack also includes support for proxy authentication (HTTP status code 407), if your environment requires it.</p> <h3>Special considerations for HTTPS endpoints</h3> <p>If an HTTPS URI is used for a remote, the Windows certificate store is used to validate the server’s SSL certificate.</p> <p>If the server to which you are pushing/pulling has a self-signed certificate, then as of this writing, we give an unfortunate and vague error message to the user. “An error occurred while sending the request” is what is commonly seen. You should use the Windows certificate manager (certmgr.msc) to add the self-signed certificate (or the authority at the top of the certificate’s chain) to the Windows certificate store as a trusted certificate, and then try your network operation again. We hope to improve on this user experience in a future release, because it is very hard to make the mental jump here from “an error occurred” to “oh, I need to add the certificate to my certificate store.”</p> <p>Visual Studio 2013 also supports the use of client certificates as part of the SSL negotiation, if the server requires it. Certificate selection is automatic, by default. If you need to use a specific client certificate to prove your identity to the server, you can use the command-line “<a href="">tf certificates</a>” command to select which client certificates are eligible for presentation.</p> <h3>Authentication</h3> <p>When using HTTP to communicate with a remote, Visual Studio may be required to authenticate with the remote server. Visual Studio 2013 supports 3 methods of authentication when communicating with a Git server over HTTP.</p> <ul> <li>Basic authentication</li> <li>Integrated Windows authentication</li> <li>Team Foundation Service federated authentication (used only when communicating with endpoints at <a href="https://*.visualstudio.com/">https://*.visualstudio.com/</a>)    </li> </ul> <p>Each authentication method has its own credentials acquisition dialog.</p> <h3>Basic authentication</h3> <p>If you are communicating with a third-party Git hosting service like Github or Bitbucket, you will probably be using Basic authentication to send your password in cleartext inside the SSL tunnel. Visual Studio 2013 is able to store and retrieve basic auth credentials from the Windows credentials vault using the same protocol as the <a href="">Windows Credential Store for Git</a>. If you have this plug-in for Git for Windows installed, then once you save your credentials once, you should be able to use both git.exe and Visual Studio to perform network operations without any password prompts.</p> <p>If you ever want to clear the password from storage, you can use the Credential Manager in the Control Panel to remove it, or use cmdkey.exe from the command line.</p> <h3>Windows authentication</h3> <p>If you are using an on-premises Team Foundation Server 2013 server to host your Git repository, then you probably authenticate to it with integrated Windows authentication. If you are logged on with your domain account, authentication from Visual Studio should be transparent.</p> <p>However, git.exe (which uses CURL for its transport layer) will not be able to retrieve your credentials transparently. You can either type your DOMAIN\username and password strings when you push/pull, or you can install the <a href="">Windows Credential Store for Git</a> and persist your credentials for git.exe’s use.</p> <p>Most customers do not use HTTPS to secure their Team Foundation Server 2013 server on their intranet. However, if your organization does use HTTPS, and has its own certificate infrastructure used to sign the certificate for the Team Foundation Server 2013 deployment, then you may find git.exe fails to validate the SSL certificate. This is because the root certificate for your organization’s certificate infrastructure is pushed to your machine’s Windows certificate store through Active Directory, but git.exe cannot see it. Git for Windows uses OpenSSL for its certificate store and the set of certificates comes with the Git for Windows package. You can disable SSL verification for git.exe through your .gitconfig file, or use the <a href="">http.sslCAInfo and http.sslCAPath configuration options</a> to help Git for Windows find the certificate at the root of the certification chain for your TFS 2013 deployment.</p> <h3>Federated authentication</h3> <p>This authentication mechanism is used only by the Team Foundation Service (<a href="https://*.visualstudio.com/">https://*.visualstudio.com/</a>) and is based on Windows Live ID. If you have already logged into your Team Foundation Service account using the Team Explorer, you should find that authentication for push, pull, clone, and fetch operations is transparent.</p> <p>The command-line Git for Windows executable, git.exe, does not support this authentication method. If you want to perform network operations against a Team Foundation Service-based Git repository using git.exe, you will need to <a href="">provision a basic authentication username and password</a> using the Edit Profile dialog in the Team Foundation Service web interface. You can then use that basic auth username and password from the command line. (Visual Studio will still prefer to authenticate using federated authentication.)</p><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT) policy multitargeting<p><span style="text-decoration: underline;"><strong>Updated 27 August 2015: The provided solution now supports multi-targeting to Visual Studio 2015 as well!</strong></span></p> <p.</p> <h4>Example multitargeted checkin policy solution</h4> <p>Today we are releasing an example solution which demonstrates two nifty things:</p> <ol> <li>How to use a single code base for your custom check-in policy, but build that check-in policy for Visual Studio 2010, 2012, and 2013 simultaneously.</li> <li>How to deploy your check-in policies to customers using VSIX packages, which are easy to install.</li> </ol> <p><strong>You can download the solution from </strong><a href=""><strong>here</strong></a><strong>. (Updated 27 August 2015)</strong></p> <h4>How does it work?</h4> <p.</p> <p: “<em>The Visual Studio SDK is not installed, so no VSIX installer package can be generated.</em>” <a href="">different download</a>.)</p> <p.</p> <h4>How do I adapt the solution to my existing custom check-in policy’s codebase?</h4> .</p> .</p> <h4>Downsides to VSIX deployment</h4> <p:</p> <ol> <li>Put the DLL file for the check-in policy somewhere on disk</li> <li>Add a registry value of type REG_SZ to “HKLM\SOFTWARE\Microsoft\VisualStudio\[version]\TeamFoundation\SourceControl\Checkin Policies” that points to the check-in policy DLL</li> <li>(<a href="">VS 2012 and later only</a>) Run devenv /setup from an elevated command prompt so that the check-in policy is visible to Visual Studio</li> </ol> <p>If you’re not going to use VSIX deployment, then you don’t need the Visual Studio SDK installed, and you can just ignore the build warning that says the VSIX installer is not being generated.</p><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT): The local data store is currently in use by another operation.<p>This is an error which can occur when using <a href="">local workspaces</a> in Visual Studio 2012 or later. The full text of the message in English is actually “TF400030: The local data store is currently in use by another operation. Please wait and then try your operation again. If this error persists, restart the application.”.</p> <h5>What causes this error?</h5> <p>As mentioned in a <a href="">previous blog post</a>, local workspaces keep certain pieces of data for your workspace on your local machine. With server workspaces, these data are kept on the server. These local pieces of data include your working folders (mappings), your local version table, and your pending changes.</p> <p.</p> <p.</p> <p.</p> <p>However, it’s also possible for this error to pop up during an operation you care more deeply about, like a check-in, or a merge, or an undo operation. In these cases seeing this error may be more of a real problem than a minor annoyance.</p> <h5>45 seconds is a long time. What’s taking so long?</h5> <p>There are 3 main possibilities.</p> <p>The first possibility is that the ‘<strong>scanner</strong>’.</p> .</p> <p>The second possibility is that the user is performing a ‘<strong>reconciled</strong>’.</p> <p>The cost of reconciling is therefore proportional to the number of pending changes in the workspace, and is strongly affected by the bandwidth of your connection to the TFS server and the performance of that TFS server – the speed at which it can complete the reconcile.</p> <p>A third possibility for a slowdown is a <strong>deadlock</strong>.</p> <h5>How can I reduce the frequency of this error or avoid it entirely?</h5> <p>First, please ensure that your copy of Visual Studio 2012 is updated to Update 2 or later. This ensures that you are protected from the deadlock scenarios described above.</p> <p>Second, try to avoid working with extremely large sets of pending changes (10,000+) for a long time without checking in. This helps to keep ‘reconcile’ costs low.</p> <p>Third, and this is probably the most important point to look at – keep the <strong>size of your workspace</strong>.</p> <p.</p> <p.</p> <h5>How can I find out how many items I have in my workspace?</h5> <p>Measuring this is made more complicated than it could be because of the backup copies of each file that we keep to support offline diff and offline undo.</p> <p!</p> <p.)</p> <h5>I’m over the recommended limit - how do I reduce my item count?</h5> <p>Often customers have more than one branch of their source code mapped in the same workspace. There is some guidance <a href="">here</a> for how to start using multiple workspaces – one for each branch.</p> <p).</p> <h5>What is Microsoft doing to make this better in the future?</h5> <p>We are planning to include, in the next major version of Visual Studio, a built-in feedback mechanism that warns you when you greatly exceed the recommendation for the number of items in a local workspace.</p> <p.</p><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT) multiple workspaces with Visual Studio<p>The past couple of posts I’ve made focus on <a href="">workspaces</a> and the differences between <a href="">server and local workspaces</a>. Visual Studio and TFS version control are designed to support the use of multiple workspaces on the same machine, but many customers use only one workspace. Depending on your situation, you might be missing out on a better user experience by limiting yourself to just one workspace!</p> <h5>The Manage Workspaces dialog</h5> <p>Let’s look first at the <strong>Manage Workspaces</strong> dialog, which is used to look at all the workspaces on the current machine.</p> <p><a href=""><img title="image" style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" border="0" alt="image" src="" width="449" height="334" /></a></p> <p>The Manage Workspaces dialog can be accessed through the following methods.</p> <ol> <li>File menu –> Source Control submenu –> Advanced –> Workspaces…</li> <li>Launch the Source Control Explorer. On the toolbar, there is a “Workspace:” combo box. Open the combo box and select “Workspaces…”.</li> <li>(In Visual Studio 2012 and later.) Open the Pending Changes Page in the Team Explorer. From the Actions menu, select “Manage Workspaces.”</li> </ol> <p>The Manage Workspaces dialog shows, by default, those workspaces on the local computer to which you have access. Most of the time that means that the workspaces belong to you. But if you’re on a shared machine and someone has created a public or public-limited workspace, then those workspaces will show up in this list as well.</p> <p>You can check the “<strong>Show remote workspaces</strong>” checkbox at the bottom to refresh the list of workspaces and have it show instead all workspaces, on any machine, where you are the owner of the workspace.</p> <p>From this dialog box, you can add new workspaces, delete existing workspaces, or edit workspaces you already have to change their properties. The properties which you can change are summarized in a previous <a href="">blog post on workspaces</a>.</p> <h5>Switching between workspaces</h5> <p>You may recall that each workspace has its own set of working folders (also called mappings) and pending changes. The Source Control Explorer and Pending Changes Page in the Team Explorer each allow you to switch between workspaces so that you can see and manipulate the pending changes in each workspace. (In Visual Studio 2010 and earlier, the Pending Changes toolwindow also allows you to switch between workspaces.)</p> <p><a href=""><img title="image" style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" border="0" alt="image" src="" width="701" height="152" /></a></p> <p>This screenshot shows the controls which allow you to select your workspace in the Source Control Explorer and in the Pending Changes Page of the Team Explorer. All the workspaces on the local machine to which you have access are available in either drop-down.</p> <p>When you select a different workspace, you may notice that the Source Control Explorer’s left and right panes have some items change from grey to black, or black to grey. This is because the workspace you switched to may be mapping more items, fewer items, or an entirely different set of items with its working folders. The Local Path hyperlinks above the right pane may change accordingly as well.</p> <p>In the Team Explorer’s Pending Changes Page, when you select a different workspace, the set of pending changes, your pending check-in comment, associated work items, etc. will all switch as well. Everything is preserved; you can toggle right back when you want to. Keep in mind, though, that a solution cannot span multiple workspaces and is always ‘in’ a particular workspace.</p> <h5>Scenarios for using multiple workspaces</h5> <p>Many customers using TFS version control use branching and merging to control code movement and perform servicing on existing releases. For example, there might be a Main branch located at $/Project/Main, and several branches for different releases also located underneath $/Project, such as $/Project/Release1, $/Project/Release2. Often there is also a development branch called $/Project/Development.</p> <p>Customers commonly create just one workspace on your machine that maps $/Project to a location on disk like C:\Project. In the example described above, that results in all four branches coming down to the local disk in the same folder. The engineer who does this might be working almost exclusively in the Development branch, and they end up having 4 times as much source code downloaded to their machine. If they end up having to make a change in the Release2 branch to fix a production issue, they will find their pending changes for Development ‘mixed in’ with their Release2 changes.</p> <p>It’s much less error-prone to compartmentalize the branches by creating one workspace for every branch. In this particular scenario the customer might create four workspaces, instead:</p> <table cellspacing="0" cellpadding="2" width="502" border="1"><tbody> <tr> <td valign="top" width="201"> <blockquote style="margin-right: 0px;" dir="ltr"> <p align="left"><strong>Workspace name</strong></p> </blockquote> </td> <td valign="top" width="299"> <blockquote style="margin-right: 0px;" dir="ltr"> <p><strong>Mappings</strong></p> </blockquote> </td> </tr> <tr> <td valign="top" width="202">PHKELLEY-DEV_Main</td> <td valign="top" width="299">$/Project/Main –> C:\Project\Main</td> </tr> <tr> <td valign="top" width="202">PHKELLEY-DEV_Release1</td> <td valign="top" width="299">$/Project/Release1 –> C:\Project\Release1</td> </tr> <tr> <td valign="top" width="202">PHKELLEY-DEV_Release2</td> <td valign="top" width="299">$/Project/Release2 –> C:\Project\Release2</td> </tr> <tr> <td valign="top" width="202">PHKELLEY-DEV_Development</td> <td valign="top" width="299">$/Project/Development –> C:\Project\Development</td> </tr> </tbody></table> <p>This allows work to go on in each branch separately. If you are in the middle of a change in Development but are interrupted and have to make a change in Release2, then just close your copy of the solution from the Development branch and open your copy from the Release2 branch. This action will automatically switch the Pending Changes Page and Source Control Explorer’s workspaces to match the solution’s workspace. All your work from Development is still there and untouched; you can use the Release2 workspace to commit your change there, and then switch back to Development just as easily as you switched to Release2.</p> <h5>Performing integrations</h5> <p>Some customers have mentioned that the reason they map all their branches in the same workspace is to perform integrations (merges) from branch to branch. You can still merge when using multiple workspaces described above. You always want to be performing the merge in the target branch – if I’m integrating from Development to Main, then the workspace selected should be PHKELLEY-DEV_Main, since that’s where changes are being pended and that’s the branch to be modified with a check-in. The source branch doesn’t have to be mapped in the same workspace (or mapped at all!).</p> <h5>Performance benefits</h5> <p>If you’re using <a href="">local workspaces</a>, then you can see some performance benefits by switching to using “one branch == one workspace”. Local workspaces are intended for customers with small to medium size projects where the workspace has 50,000 or fewer items. I have seen customers where each branch of their source code is well within our scalability target for local workspaces – but the customer has placed several branches of source code all in the same workspace. The total number of items then ends up being far beyond 50,000, and performance suffers or “TF400030: The local data store is currently in use by another operation” errors are observed. Simply separating out the branches with a “one branch, one workspace” philosophy brings them back within the scalability target and they end up being much happier.</p><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT) workspaces vs. local workspaces<p>T.”</p> <p>You might be asking, “What are the differences between local and server workspaces, and where do these two names come from?”</p> <h5>Offline support</h5> <p.</p> <ul> <li>Opening a source-controlled solution</li> <li>Checking out a file for edit</li> <li>Pending a new file or folder for add</li> <li>Pending a delete on an existing file or folder</li> <li>Pending a rename on an existing file or folder</li> <li>Asking “what are the pending changes in this workspace?”</li> <li>Undoing pending changes</li> <li>Diffing your copy of a file with the version of the file your change is pended against</li> </ul> <p.</p> <h5>No read-only bit</h5> <p.</p> <p.</p> <p.</p> <h5>Detected changes (or ‘candidate’ changes)</h5> <p. </p> <p.</p> <h5>Invisible to VS 2010 and earlier</h5> <p.</p> <h5>No enforcement of PendChange permission or checkout locks</h5> <p.</p> <h5>Converting to and from local workspaces</h5> <p.</p> <p.</p> <h5>Performance and scalability</h5> <p.</p> <p.</p> <p>Server workspaces are optimized for performance at large scale and can support workspaces with up to 10,000,000 items (provided your SQL Server hardware is sufficient).</p> <h5>Default workspace location</h5> <p.</p><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT)<p><b>What is a workspace?</b></p> <p>TFS version control has two main objects to interact with.</p> <ol> <li>The version control server. There is exactly one of these in every Team Project Collection, and it’s shared by everyone.</li> <li>Your workspace – this belongs to you. You can have as many workspaces as you would like.</li> </ol> <p>Your workspace is the ‘owner’ or ‘container’ of a variety of important artifacts.</p> <ol> <li”.</li> <li.</li> <li>Your conflicts, if you have any.</li> <li>(Advanced topic!) Your local version table – while the working folders define what you want your working copy to look like, the local version table describes what the working copy looks like ‘right now.’</li> </ol> <p>In addition to owning the artifacts above, workspaces have a variety of properties.</p> <ol> <li>Each workspace exists on a particular <b>version control server</b>.</li> <li>A <b>name</b> – the default name is the name of your computer.</li> <li>An <b>owner</b> – an identity known to Team Foundation Server.</li> <li>A <b>comment</b> field in which a description of the workspace can be stored.</li> <li>Each workspace exists on a particular <b>computer name</b>.</li> <li>Each workspace is either a <b>server workspace</b> or a <b>local workspace</b>.</li> <li>Files downloaded to the working copy can either have their <b>last-modified date</b> set to the time of download (default) or to the last check-in date of the file.</li> <li>Workspaces are <b>permissioned</b> objects – by default, they are private, meaning only the owner can use them.</li> </ol> <p>Each of the properties described above can be changed, except for the version control server on which the workspace exists. That particular property of the workspace is immutable.</p> <p><b>Workspace names</b></p> <ul> <li>The maximum length of the workspace name is 64 characters.</li> <li”. </li> <li>The default name for a workspace is the name of the computer on which it was created. If that name is already taken, a “_1” or “_2”, etc. is appended onto the end of the name until an available name is found.<b></b></li> </ul> <p><b>Workspace owners</b></p> <ul> <li>The owner of a workspace is the identity who created the workspace.</li> <li>When changing the owner of a workspace, the identity receiving ownership does not get a chance to reject acquisition. It is a gift which that identity must accept.</li> <li>Depending on the situation, the caller may lose all permissions (except Read) to the workspace after changing the owner. Most workspaces are ‘private’ and only grant Use, Checkin, and Administer permissions to their owner.</li> <li>The “Edit Workspace” dialog will not let you change the owner and the permissions of the workspace at the same time.</li> <li>Prior to TFS 2010, the owner of a workspace cannot be changed.</li> </ul> <p><b>Workspace comment</b></p> <ul> <li>The workspace comment is a string with essentially unlimited length. We will let you store up to 2^30 characters in the workspace comment. However, I believe that some of the earlier versions of TFS may restrict the comment length to 2,048 characters.</li> <li>The comment field is blank by default.</li> </ul> <p><strong>Computer name</strong></p> <ul> <li>Each workspace exists on a particular computer. The computer name field can be up to 31 characters long, and this property is set for you automatically.</li> <li>The TFS server does not do anything with this data other than persist it, and allow clients to use it as a query filter. For example, the query “tell me all the workspaces I have access to on this machine" is very common.</li> <li.</li> <li>Functionality for changing the computer name of a workspace is limited to the command line only – the “/computer:newcomputername” switch to the “tf workspace” command allows you to specify a new computer name. This switch is new in Visual Studio 2010.</li> <li.</li> </ul> <p><strong>Workspace location</strong></p> <ul> <li>Starting with TFS 2012 and Visual Studio 2012, workspaces have a “Location” property. A workspace’s location can either be “server” or “local.”</li> <li>Local workspaces are new in TFS 2012 and Visual Studio 2012. All workspaces on TFS 2005, TFS 2008, and TFS 2010 servers are server workspaces.</li> <li>If your “Edit Workspace” dialog doesn’t show the workspace location combo box (you may need to click “Advanced >>” to see it), then your client must be Visual Studio 2005, 2008, or 2010, which don’t support local workspaces. This means your workspace is a server workspace.</li> <li.</li> <li>There is a long list of differences between server workspaces and local workspaces – enough to fill several blog posts. I hope to blog on this topic in the future.</li> <li.</li> </ul> <p><strong>Last-modified date</strong></p> <ul> <li>When you do a “Get” in TFS version control to update your working copy, files are downloaded from the server and placed on your local disk.</li> <li>Each file on your local disk has a last-modified date. In Visual Studio 2005, 2008, and 2010, the last-modified date of downloaded files is not set to any special value. It gets set to whatever the current time is at the time the file is downloaded.</li> <li>Starting in Visual Studio 2012 and TFS 2012, you have the option to change the last-modified date setting from “<strong>Current</strong>” to “<strong>Checkin</strong>”. This setting is hidden behind the “Advanced >>” button in the “Edit Workspace” dialog.</li> <li>Just like with local workspaces (above), you need both Visual Studio 2012 or higher and TFS 2012 or higher in order to change this setting to “Checkin.”</li> <li>If set to “Checkin,” then downloaded files (not folders) will have their last-modified time set to the date and time that the item was checked into source control. There is a small performance cost to enabling this feature.</li> <li>When you change this setting on an existing workspace, the items you already have downloaded will not have their last-modified times instantly updated. You will need to perform a “tf get /all” in order to get them all set correctly.</li> <li>Most customers do not need to set this setting to “Checkin,” but some have custom workflows or build orchestrations that require the last-modified dates to be set this way.</li> </ul> <p><strong>Workspace permissions</strong></p> <ul> <li>Starting in TFS 2010, workspaces are permissioned objects. There are four permissions on workspaces – Read, Use, Checkin, and Administer.</li> <li>If you have <strong>Read</strong> permission on a workspace, its existence and its properties (including its local version table and pending changes) are visible.</li> <li>If you have <strong>Use</strong> permission on a workspace, you can create and undo pending changes, update the local version table, shelve pending changes, etc.</li> <li>If you have the <strong>CheckIn</strong> permission on a workspace, you can check in the pending changes from the workspaces.</li> <li>If you have the <strong>Administer</strong> permission on a workspace, you can modify the properties of the workspace in the “Edit Workspace” dialog, or delete the workspace.</li> <li>The owner of the workspace always has all permissions on the workspace.</li> <li>All valid users of the Team Project Collection have Read permission on all workspaces. (This is subject to change in future releases of TFS.)</li> <li>Instead of providing a full permissioning UI experience, the “Edit Workspace” dialog lets you pick between a set of predefined “permission profiles.” The default is “<strong>private workspace</strong>”, where only the owner has permissions on the workspace.</li> <li>Other profiles include Public-Limited and Public – in these profiles, permission to Use, Checkin, and/or Administer are extended to all valid users of the Team Project Collection. These permission profiles are useful if you want to have a machine with a single workspace, shared by multiple users.</li> <li>You can read more about workspace permissions in <a href="">this blog post</a>.</li> </ul><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT) get /remap<p>This switch was added to "tf get" to improve performance when a user is switching an existing workspace from one branch to another. The performance benefit is best explained with an example.</p> <p>Let's say that in our Team Project Collection we have one Team Project (<font face="Courier New">$/Proj</font>), and two branches -- <font face="Courier New">$/Proj/Main</font> and <font face="Courier New">$/Proj/Dev</font>. And let's also say that we have a workspace which maps <font face="Courier New">$/Proj/Main</font> to <font face="Courier New">C:\MyWorkspace</font>. Our source tree is pretty small -- we only have 5 files, named a.cs through e.cs. I've done a get, and so when I look in <font face="Courier New">C:\MyWorkspace</font>, this is what I see:</p> <p><font face="Courier New">C:\MyWorkspace>dir <br /> Volume in drive C is Physical Disk 1 <br /> Volume Serial Number is BA8F-FF44</font></p> <font face="Courier New"></font> <p><font face="Courier New"> Directory of C:\MyWorkspace</font></p> <font face="Courier New"></font> <p><font face="Courier New">05/18/2012  01:41 PM    <DIR>          . <br />05/18/2012  01:41 PM    <DIR>          .. <br />05/18/2012  01:41 PM                14 a.cs <br />05/18/2012  01:41 PM                54 b.cs <br />05/18/2012  01:41 PM                 5 c.cs <br />05/18/2012  01:41 PM               115 d.cs <br />05/18/2012  01:41 PM                17 e.cs <br />               5 File(s)            205 bytes <br />               2 Dir(s)  60,134,879,232 bytes free</font></p> <p>Let's also say that my co-worker, John, has made a change in the Dev branch to c.cs. He's really added a big chunk of code in the Dev branch, and so the c.cs file there is much bigger. But he hasn't changed any of the other four files. The other four files are exactly the same in Dev and Main.</p> <p>Furthermore, for some reason (maybe John and I need to work more closely together now) I need to switch my workspace from mapping the Main branch to having the Dev branch. The way I would do this is through the "tf workspace" dialog.</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="remap1" border="0" alt="remap1" src="" width="470" height="229" /></a></p> <p>Change the server path mapping only, from <font face="Courier New">$/Proj/Main</font> to <font face="Courier New">$/Proj/Dev</font>. Leave the local path part (<font face="Courier New">C:\MyWorkspace</font>) the same.</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="remap2" border="0" alt="remap2" src="" width="470" height="229" /></a></p> <p>When you click OK, you'll be prompted to do a get.</p> <p><a href=""><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="remap3" border="0" alt="remap3" src="" width="393" height="145" /></a></p> <p>If I say yes, a regular get will be performed, and everything will work fine -- but the get will be inefficient. Let's watch what happens when I click yes.</p> <p><font face="Courier New">C:\: <br />Getting MyWorkspace <br />Deleting C:\MyWorkspace\a.cs</font></p> <font face="Courier New"></font> <p><font face="Courier New">C:\MyWorkspace: <br />Getting a.cs <br />Deleting C:\MyWorkspace\b.cs <br />Getting b.cs <br />Deleting C:\MyWorkspace\c.cs <br />Getting c.cs <br />Deleting C:\MyWorkspace\d.cs <br />Getting d.cs <br />Deleting C:\MyWorkspace\e.cs <br />Getting e.cs</font></p> <p>Each item is deleted and re-downloaded as part of the switch from <font face="Courier New">$/Proj/Main</font> to <font face="Courier New">$/Proj/Dev</font>. Even the four items that are identical in the two branches are redownloaded, which is not a good use of time.</p> <p>Let's look at what would have happened if I had said "no" to the dialog, and then run a "tf get /remap".</p> <p><font face="Courier New">C:\MyWorkspace>tf get /remap <br />Deleting C:\MyWorkspace\c.cs <br />C:\MyWorkspace: <br />Getting c.cs</font></p> <p>You can see that no action was taken for the four items which are identical. As a result no time was expended downloading these four items unnecessarily.</p> <p>Why not run “tf get /remap” all the time? Nothing bad would happen if you were to do so. However, adding the /remap switch does increase the amount of work done by the server to process your request. As a result, it is not on by default.</p><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT) and ShelvesetCheckInParameters<p>Many <a href="" target="_blank">Workspace.CheckIn</a> family of methods for this purpose.</p> <p.</p> <p><font size="2" face="Consolas"><span style="color: blue">public int</span> CheckIn(<span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span> checkinParameters);</font></p> <p>The legacy methods from TFS 2005 and 2008 are still present and fully supported. But you may find that flags and settings related to new features of TFS 2010 (such as gated check-in) are only available through the WorkspaceCheckInParameters overload.</p> <p>Put simply, the WorkspaceCheckInParameters object encapsulates all the necessary information to complete a check-in from a workspace. Here’s a simple example which checks in all pending changes, with a provided comment.</p> <p><font size="2" face="Consolas"><span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span> wcip = new <span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span>(myWorkspace.GetPendingChanges(), “My changeset comment!”); <br />myWorkspace.CheckIn(wcip);</font></p> <p.</p> <p><font size="2" face="Consolas">myWorkspace.CheckIn(myWorkspace.GetPendingChanges(), “My changeset comment!”);</font></p> <h3></h3> <h3></h3> <h3>An advanced example</h3> <p.</p> <p>Here’s a more complex example which tries to commit a changeset on behalf of another user, and bypasses gated check-in if any of the pending changes being committed are to paths protected by a gated build definition.</p> <p><font size="2" face="Consolas"><span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span> wcip = new <span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span>(“My comment!”); <br />wcip.PendingChanges = myWorkspace.GetPendingChanges();</font><font size="2" face="Consolas"> <br />wcip.Author = “CONTOSO\ClarkKent”; <br />wcip.OverrideGatedCheckIn = true; <br />myWorkspace.CheckIn(wcip);</font></p> <p>You’ll find that this call will fail if you don’t have permission to override gated check-in, or permission to check in on behalf of another user. (It will also fail if the user CONTOSO\ClarkKent doesn’t exist. <font size="2" face="Wingdings">J</font>)</p> <h3>Checking in a shelveset directly</h3> <p>One new feature in TFS 2010 is the ability to directly check in a shelveset. In previous releases, customers were required to unshelve the shelveset into a workspace and check in from there. To support this feature we’ve added new methods to the <a href="" target="_blank">VersionControlServer</a> object.</p> <p><font size="2" face="Consolas"><span style="color: blue">public int</span> CheckInShelveset(<span style="color: rgb(43,145,175)">String</span> shelvesetName, <span style="color: rgb(43,145,175)">String</span> ownerName); <br /><span style="color: blue">public int</span> CheckInShelveset(<span style="color: rgb(43,145,175)">ShelvesetCheckInParameters</span> shelvesetCheckInParameters);</font></p> <p.</p> <p>Here’s an example which checks in a shelveset BugFixes;CONTOSO\ClarkKent and then deletes the shelveset if the check-in successfully completes.</p> <p><font size="2" face="Consolas"><span style="color: rgb(43,145,175)">ShelvesetCheckInParameters</span> scip = new <span style="color: rgb(43,145,175)">ShelvesetCheckInParameters</span>(“BugFixes”, “CONTOSO\ClarkKent”); <br />scip.DeleteShelveset = true; <br />myVersionControlServer.CheckInShelveset(scip);</font></p> <p.)</p><img src="" width="1" height="1">Philip Kelley (MSFT): Slow version control operations when using VS 2010 with an older server<p><strong>Updated 2/25/2010. Thanks to Shaun and Amos for their recommended changes!</strong></p> <p>One of the new features of TFS 2010 is automatic version control proxy configuration. The first time a version control operation is executed, the client contacts the server and asks for proxy configuration information. If no proxy is available for the client, it will ask again after 24 hours have passed.</p> <p>To allow proxies to be auto-configured by location, the client provides to the server its “site name” from Active Directory. This data is used by the server to determine which of several proxies to assign the client to. Clients in Germany can be assigned to the Germany proxy, and clients in South Africa to the South Africa proxy. This is the same mechanism that Windows uses with the Add Printer Wizard to show printers physically close to you.</p> <p>Unfortunately, there is a bug in the automatic proxy configuration mechanism of the VS 2010 client when communicating with a 2005/2008 server. When used against an older server, no query can be made to auto-configure a proxy because the server does not support the functionality. <strong>But the site name from Active Directory is still retrieved</strong>, on every version control operation from the list below.</p> <ul> <li>Get </li> <li>Merge </li> <li>Unshelve </li> <li>Edit </li> <li>Delete </li> <li>Undelete </li> <li>Rename </li> <li>Undo </li> <li>Add </li> <li>Branch </li> <li>Resolve </li> </ul> <p>In all cases, there is some performance penalty for retrieving this data from LDAP. But in some cases it can be particularly bad. One customer reported a delay of 8 to 9 minutes to retrieve the site name from Active Directory. <strong>Fortunately, there is a workaround available for this issue.</strong> If you are using VS 2010 against a TFS 2005/2008 server, you may notice an increase in performance by disabling automatic proxy configuration through the use of the following registry settings.</p> <p>Check your version control proxy settings in Visual Studio first, by going to Tools –> Options –> Source Control –> Visual Studio Team Foundation Server. If you have a proxy configured, your proxy server protocol, name, and port will be available there, and you should not be affected by this issue. (If you want to be 100% sure, instructions for verifying your proxy settings are below.)</p> <h3></h3> <h3>No version control proxy:</h3> <p>These settings are for users who are not using a proxy server. All files are downloaded from the central TFS server directly.</p> <blockquote> <p><font size="2" face="Courier New">Windows Registry Editor Version 5.00 </font></p> <p><font size="2" face="Courier New">[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Proxy] <br />"Enabled"="False" <br />"Url"="" <br />"AutoConfigured"="False" </font></p> </blockquote> <h3>Manually configured version control proxy:</h3> <p>You should not have to take any further action. If you like, you can inspect your registry settings to ensure they look like those below. (If you happen to have “LastCheckTime” or “LastConfigureTime” values in addition to these values, that’s normal and they are harmless.)</p> <blockquote> <p><font size="2" face="Courier New">Windows Registry Editor Version 5.00 </font></p> <p><font size="2" face="Courier New">[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Proxy] <br />"Enabled"="True" <br />"Url"="" <br />"AutoConfigured"="False" </font></p> </blockquote> <h3>Installing the workaround settings</h3> <p>Copy/paste the text into Notepad, save it as a .reg file, and execute it. You’ll be prompted to authorize the merging of this data into the registry. Be sure to restart Visual Studio for the changes to take effect.</p><img src="" width="1" height="1">Philip Kelley (MSFT) to workspaces in TFS 2010<P>In TFS 2005 and 2008, workspaces in version control have the following limitations.</P> <OL> <LI>The owner of a workspace is set at creation time and cannot be changed (immutable). </LI> <LI>A workspace can only be used by its owner. </LI></OL> <P>When we speak of “using” a workspace, that covers any of the following sorts of operations:</P> <UL> <LI>Unshelving a shelveset into the workspace </LI> <LI>Doing a Get in the workspace </LI> <LI>Pending changes or undoing pending changes in the workspace </LI> <LI>Shelving or checking in from the workspace </LI> <LI>Resolving conflicts in the workspace </LI> <LI>… </LI></UL> <P>We lifted both of these limitations in TFS 2010. Adding the ability to change the owner of a workspace was not difficult, but allowing workspaces to be used by more than just their owner required us to make workspaces fully securable objects. We leveraged the new security service to make these changes and settled on four permissions that a user can have for a workspace. Those permissions are: <STRONG>Read, Use, CheckIn, and Administer</STRONG>. </P> <UL> <LI>The <STRONG>Use</STRONG> permission covers operations that change the state of a workspace: its definition (mappings), local versions, conflicts, or pending changes. Most operations that you use on a day-to-day basis are checking for the Use permission on a workspace. See the list at the top of this post for some examples. </LI> <LI>We separated out the ability to check in into its own permission, <STRONG>CheckIn</STRONG>. The reasoning was that there may be some scenarios for shared workspaces where only certain users (like the owner) would be allowed to check in. </LI> <LI>A user needs the <STRONG>Administer</STRONG> permission to change the mappings, name, owner, comment, or computer of a workspace. They also need this permission to delete the workspace from the system or make changes to the access control list for the workspace. </LI> <LI>The <STRONG>Read</STRONG> permission exists as a permission but is not enforced. It would theoretically cover the ability to see that a workspace exists, to view the mappings for a workspace, and to view the pending changes for a workspace. In TFS 2005 and 2008, any valid user could view these properties of any other workspace, and for 2010 we have not altered this behavior. <H3> <UL></UL></H3></LI></UL> <H3>Changing workspace permissions with the Edit Workspace dialog</H3> <P>TFS 2010 does not ship with a full UI for manipulating workspace permissions. Users are limited to choosing between three "permission profiles" for their workspaces; a permission profile is essentially a template for the workspace's access control list. The default permission profile is "<STRONG>Private workspace</STRONG>". A private workspace has the same effective behavior as a workspace in TFS 2005 and 2008: the workspace can only be used by its owner. The access control list for a private workspace has only one entry, granting all permissions to the owner -- for example, John Smith: </P> <P>YOURDOMAIN\johnsmith: Read, Use, CheckIn, Administer</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=privateworkspace border=0 alt=privateworkspace</A></P> <P>The two other permission profiles we ship are "<STRONG>Public-limited</STRONG>" and "<STRONG>Public</STRONG>"..</P> <H3><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=publicworkspace border=0 alt=publicworkspace</A></H3> <H3>Using a public workspace from Visual Studio </H3> <P mce_keep="true"> </P> <Pwindows.</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=workspacedropdown_sce border=0 alt=workspacedropdown_sce</A>Users of Visual Studio 2008 and earlier will not be able to see public workspaces belonging to other users. They will continue to see only their own workspaces.</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=workspacedropdown_2008 border=0 alt=workspacedropdown_2008</A>In this example, I made the shared workspace "Public-limited." You'll see that because I lack the Administer permission for this workspace, I can only view the workspace's mappings, owner, comment, and permissions profile. The controls are read-only.</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=edit_publiclimited border=0 alt=edit_publiclimited</A></P> <H3>Using a public workspace from the command line (tf.exe)</H3> <P>Again, you'll need to log onto the machine which has the public workspace. Once you've started a Visual Studio 2010 command prompt, cd to a mapped path for the workspace. In my case, this is D:\Proj. You can see below that I tried to run a command, but it failed to determine the workspace. This is because the local workspace cache file is per-user and this user has never heard of the workspace in question. I can either:</P> <OL> <LI>Start Visual Studio once and connect to the team project collection. This will populate the local workspace cache. </LI> <LI>Run “tf workspaces” to manually populate the cache file, as the command suggests. </LI></OL> <P>I chose to run “tf workspaces”. We can see that the workspace belonging to the other user is displayed, confirming that I have access to the public workspace. Now my "tf get" command succeeds.</P> <H3><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=commandline border=0 alt=commandline</A> Artifact ownership</H3> <P>If user B shelves changes out of user A's workspace, user B is the owner of the shelveset that was created. Likewise, if user B checks in changes from user A's workspace, user B is recorded as the user who committed the changes. </P> <P>Individual pending changes do not have owners -- only workspaces have owners. If user A checks out file.txt for edit in user B's workspace, some UI components may state that "file.txt is opened for edit by user B," even though user A is the one who pended the change. It would be more accurate to state that "file.txt is opened for edit in workspace X, which is owned by user B."</P> <H3></H3> <H3>Failed permission checks</H3> <P>The TFS 2005/2008 error message "<STRONG>TF14091</STRONG>: You cannot perform this operation on workspace {0} because you are not the owner of the workspace." is no longer issued by TFS 2010. Instead, you will receive the following message indicating which workspace permission the operation demanded: </P> <P><STRONG>TF204017</STRONG>: The operation cannot be completed because the user ({0}) does not have one or more required permissions ({1}) for workspace {2}. </P> <P>In the example below, the workspace was switched back to "Private" just before the command was issued.</P> <H3><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=failed_perm_check border=0 alt=failed_perm_check</A> AdminWorkspaces global privilege</H3> <P>All versions of TFS from 2005 through 2010 have a global privilege called "Administer Workspaces," or <STRONG>AdminWorkspaces</STRONG> for short. By default this privilege is granted to team project collection administrators. Users possessing the AdminWorkspaces privilege automatically get the Administer permission on all workspaces in the system, even if they ordinarily would not receive it. This enables administrators to purge old workspaces in the system, and take ownership of workspaces belonging to employees on vacation, or contractors who are no longer with the team. Users with the AdminWorkspaces privilege can also create workspaces on behalf of other users.</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=adminworkspaces_gui border=0 alt=adminworkspaces_gui</A> </P> <P>If I am granted the AdminWorkspaces privilege and go back to the earlier example, where I was locked out of the Edit Workspace dialog because the workspace was "Public-limited", we can see that I now have full access. My effective permissions are "<STRONG>Read, Use, Administer</STRONG>". If I want the CheckIn permission, I could grant it to myself by changing the permission profile of the workspace to "Public".</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=edit_publiclimited_adminworkspaces border=0 alt=edit_publiclimited_adminworkspaces</A></P> <H3>Custom permissions</H3> <P>While the UI restricts you to the three in-box permission templates, the server has full support for custom access control lists on workspaces. You can query the full access control list by using the security service and the version control service together. The GUID of the security namespace for workspaces is a well-known constant, and the version control client object model has the token in that namespace for any given workspace, accessible through the Workspace.SecurityToken property. The following code sample shows how to extract and display the access control list for the workspace inferred by the current directory.</P> <P>(This code sample needs assembly references to MS.TeamFoundation.Common, MS.TeamFoundation.Client, MS.TeamFoundation.VersionControl.Common, and MS.TeamFoundation.VersionControl.Client.)</P><PRE class=code><SPAN style="COLOR: blue">using </SPAN>Microsoft.TeamFoundation; <SPAN style="COLOR: blue"><BR>using </SPAN>Microsoft.TeamFoundation.Common; <SPAN style="COLOR: blue">using </SPAN>Microsoft.TeamFoundation.Client; <SPAN style="COLOR: blue">using </SPAN>Microsoft.TeamFoundation.Framework.Common; <SPAN style="COLOR: blue">using </SPAN>Microsoft.TeamFoundation.Framework.Client; <SPAN style="COLOR: blue">using </SPAN>Microsoft.TeamFoundation.VersionControl.Common; <SPAN style="COLOR: blue">using </SPAN>Microsoft.TeamFoundation.VersionControl.Client;</PRE><PRE class=code>…</PRE><A href="" mce_href="">< identity service for the TPC. </SPAN><SPAN style="COLOR: #2b91af">IIdentityManagementService </SPAN>ims = tpc.GetService<<SPAN style="COLOR: #2b91af">IIdentityManagementService</SPAN>>(); : green">// Get the full TeamFoundationIdentity objects for the IdentityDescriptor of each access control entry. </SPAN><SPAN style="COLOR: #2b91af">List</SPAN><<SPAN style="COLOR: #2b91af">IdentityDescriptor</SPAN>> descriptors = <SPAN style="COLOR: blue">new </SPAN><SPAN style="COLOR: #2b91af">List</SPAN><<SPAN style="COLOR: #2b91af">IdentityDescriptor</SPAN>>(); <SPAN style="COLOR: blue">foreach </SPAN>(<SPAN style="COLOR: #2b91af">AccessControlEntry </SPAN>ace <SPAN style="COLOR: blue">in </SPAN>acl.AccessControlEntries) descriptors.Add(ace.Descriptor); <SPAN style="COLOR: #2b91af">TeamFoundationIdentity</SPAN>[] identities = ims.ReadIdentities(descriptors.ToArray(), <SPAN style="COLOR: #2b91af">MembershipQuery</SPAN>.None, <SPAN style="COLOR: #2b91af">ReadIdentityOptions</SPAN>.None); <SPAN style="COLOR: green">// Display the access control list to the user. </SPAN><SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">"Access control list for " </SPAN>+ workspace.DisplayName + <SPAN style="COLOR: #2b91af">Environment</SPAN>.NewLine); <SPAN style="COLOR: blue">int </SPAN>i = 0; <SPAN style="COLOR: blue">foreach </SPAN>(<SPAN style="COLOR: #2b91af">AccessControlEntry </SPAN>ace <SPAN style="COLOR: blue">in </SPAN>acl.AccessControlEntries) { <SPAN style="COLOR: blue">if </SPAN>(<SPAN style="COLOR: blue">null </SPAN>== identities[i]) <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">" " </SPAN>+ ace.Descriptor.Identifier + <SPAN style="COLOR: #a31515">":"</SPAN>); <SPAN style="COLOR: blue">else </SPAN><SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">" " </SPAN>+ <SPAN style="COLOR: #2b91af">IdentityHelper</SPAN>.GetDomainUserName(identities[i]) + <SPAN style="COLOR: #a31515">":"</SPAN>); <SPAN style="COLOR: blue">if </SPAN>(0 != ace.Allow) <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">" Allow: " </SPAN>+ ((<SPAN style="COLOR: #2b91af">WorkspacePermissions</SPAN>)ace.Allow).ToString()); <SPAN style="COLOR: blue">if </SPAN>(0 != ace.Deny) <SPAN style="COLOR: #2b91af">Console</SPAN>.WriteLine(<SPAN style="COLOR: #a31515">" Deny: " </SPAN>+ ((<SPAN style="COLOR: #2b91af">WorkspacePermissions</SPAN>)ace.Deny).ToString()); i++; }</PRE> <P>Going back to our public-limited workspace example, we can now use this code to visualize the full access control list for the workspace.</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=readacl border=0 alt=readacl</A></P> <H3>Modifying the access control list</H3> <P>We can take the above code fragment one step further and manipulate the access control list. Let’s remove the access control entry for [Collection0]\Project Collection Valid Users and replace it with an entry that explicitly gives full permissions only to REDMOND\vseqa1. Performing this operation requires <STRONG>Administer</STRONG> permission on the workspace, either explicitly or through the <STRONG>AdminWorkspaces</STRONG> global privilege.<: #2b91af">WorkspacePermissions </SPAN>allWorkspacePermissions = <SPAN style="COLOR: #2b91af">WorkspacePermissions</SPAN>.Read | <SPAN style="COLOR: #2b91af">WorkspacePermissions</SPAN>.Use | <SPAN style="COLOR: #2b91af">WorkspacePermissions</SPAN>.CheckIn | <SPAN style="COLOR: #2b91af">WorkspacePermissions</SPAN>.Administer; acl.RemoveAccessControlEntry(<SPAN style="COLOR: blue">new </SPAN><SPAN style="COLOR: #2b91af">IdentityDescriptor</SPAN>(<SPAN style="COLOR: #2b91af">IdentityConstants</SPAN>.TeamFoundationType, <SPAN style="COLOR: #2b91af">GroupWellKnownSidConstants</SPAN>.EveryoneGroupSid)); acl.SetAccessControlEntry(<SPAN style="COLOR: blue">new </SPAN><SPAN style="COLOR: #2b91af">AccessControlEntry</SPAN>(tpc.AuthorizedIdentity.Descriptor, (<SPAN style="COLOR: blue">int</SPAN>)allWorkspacePermissions, 0), <SPAN style="COLOR: blue">false</SPAN>); workspaceSecurityNamespace.SetAccessControlList(acl);</PRE> <P>After running this code I can see that the workspace access control list now has two entries – one for the workspace owner and one for me (REDMOND\vseqa1).</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=readacl_afterchange border=0 alt=readacl_afterchange</A>Because the workspace’s access control list no longer matches one of the predefined permission profiles (templates), the permissions profile in the Edit Workspace is shown as “<STRONG>Custom permissions</STRONG>”.</P> <P><A href="" mce_href=""><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=custompermissions border=0 alt=custompermissions</A>If you leave the workspace permissions combo box set to “Custom permissions,” then you can change any other property of the workspace without overwriting your customized access control list. But if you later want to go back to one of the pre-defined permission profiles, just select it from the combo box and hit OK. Your custom access control list will be wiped and replaced.</P> <H3>What happens if I accidentally delete the ACE for myself (the owner)?</H3> <P>Version control permission checks will still succeed, even if the owner ACE does not exist in the security service’s access control list. The version control service still knows that you are the owner of the workspace and therefore have full permissions. You will be locked out of making changes to the access control list through the security service until the owner ACE is restored.</P> <P>To restore the owner ACE, open the Edit Workspace dialog and make any change (change the comment, for example). When you click OK and the workspace is updated on the server, the owner ACE will be restored.</P><img src="" width="1" height="1">Philip Kelley (MSFT) a command to the Source Control Explorer context menu - VS 2005<P>I've received a request for a version of the <A class="" href="" mce_href="">sample Source Control Explorer context menu addin</A> that works with Visual Studio 2005.</P> <P>You can find that sample addin here: <A class="" href="" mce_href="">VersionControlExtensibility2005.zip</A></P><div style="clear:both;"></div><img src="" width="1" height="1">Philip Kelley (MSFT) a command to the Source Control Explorer context menu<P><STRONG>Update 2/26/2009: You can find a version of this sample addin that works with VS 2005 <A class="" href="" mce_href="">here</A>.</STRONG> </P> <P>We've gotten some questions recently about how to interact with and extend our out-of-the-box version control functionality. For most users, the main hub of activity is the Source Control Explorer, so it makes sense for us to provide some sample code demonstrating how to add a command to the Source Control Explorer's context menu. The sample additionally provides an add-in command framework making it easier to add commands to other parts of the version control user interface, such as the History window.</P> <P>The new command added to the Source Control Explorer context menu in this sample is called "Multi Label" and is an extension of the "Quick Label" functionality provided in the downloadable Team Foundation Power Tools. With "Multi Label" you can label multiple items at once by selecting them in the Source Control Explorer's right pane. Once the Multi Label dialog is up, you can add more paths to label by typing them in.</P> <P>Here's how to build and try out the add-in. <BR> <BR>1. On a machine with Visual Studio 2008 and Team Explorer installed, download and unzip <A href="" mce_href="">VersionControlExtensibility.zip</A>. Open the VersionControlExtensibility.sln file in Visual Studio. <BR><BR>2. Open the References node for the project in Solution Explorer, and see if any of the assemblies listed have the Warning icon next to them. Microsoft.VisualStudio.TeamFoundation.VersionControl.dll is referenced and is not in the GAC, so you may need to remove and re-add this reference since the path you find it in varies. On my machine (64-bit), the assembly is in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies.<A href="" mce_href=""></A><IMG title=extensibility1</P> <BR>3. Build the solution -- you should end up with the VersionControlExtensibility.dll file in the bin/ directory. <P>Now you're ready to install. Add-ins live in your <B>My Documents\Visual Studio 2008\Addins</B> folder on disk, and you'll need to drop 2 files in that directory: </P> <P>1. The VersionControlExtensibility.AddIn file (which is just an XML file with information about the add-in DLL) <BR>2. The VersionControlExtensibility.dll file which you just built. </P> <P>Restart Visual Studio 2008 if you have it open, and the add-in will be loaded. Right-click on any item in the Source Control Explorer and you should see "Multi Label..." on the list.</P> <P><A href="" mce_href=""><IMG title=extensibility2</A><A href="" mce_href=""><IMG title=image</A></P> <P>To add your own custom command to the SCE context menu, subclass SCEAddInCommand and provide implementations for the following properties.</P> <BLOCKQUOTE> <P><FONT face="Courier New">// From AddInCommand -- base class for all commands <BR>public </FONT><FONT face="Courier New">override </FONT><FONT face="Courier New">String <B>Name</B> { get { return "MyCommandName"; } } <BR>public </FONT><FONT face="Courier New">override </FONT><FONT face="Courier New">String <B>ButtonText</B> { get { return "Text for Context Menu..."; } } <BR>public </FONT><FONT face="Courier New">override </FONT><FONT face="Courier New">String <B>ToolTip</B> { get { return "A short description of my command"; } } <BR>public </FONT><FONT face="Courier New">override </FONT><FONT face="Courier New">bool <B>UseMSOIcon</B> { get { return false; } } // Can be used to provide an icon for your command <BR></FONT><FONT face="Courier New">public </FONT><FONT face="Courier New">override </FONT><FONT face="Courier New">int <B>IconIndex</B> { get { return -1; } } // Can be used to provide an icon for your command <BR><BR></FONT><FONT face="Courier New">// From SCEAddInCommand -- derived from AddInCommand; base class for commands hooking the SCE context menu <BR>public </FONT><FONT face="Courier New">override </FONT><FONT face="Courier New">int <B>SCEContextMenuPosition</B> { get { return 5; } }</FONT></P></BLOCKQUOTE> <P>You’ll also need implementations for the following methods from AddInCommand.</P> <BLOCKQUOTE> <P><FONT face="Courier New">// Called by Visual Studio to determine whether your command is enabled, disabled, or invisible. <BR>public override void <B>QueryStatus</B>(EnvDTE.vsCommandStatusTextWanted neededText, ref EnvDTE.vsCommandStatus status, ref object commandText) <BR>{ <BR> status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled; <BR>}</FONT></P> <P><FONT face="Courier New">// Called by Visual Studio when your command is clicked. <BR>public override void <B>Exec</B>(EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) <BR>{ <BR> handled = true; <BR> MessageBox.Show(“Hi!”); <BR>}</FONT></P></BLOCKQUOTE> <P>Last, you’ll need to add your custom command in Connect.cs’s OnConnection method so that it’s created when the add-in is loaded. I’ve left a sample line there you can uncomment and modify to fit the name of your AddInCommand.</P> <P>Thanks to Ed Hintz for designing the original version of this framework. <BR></P><img src="" width="1" height="1">Philip Kelley (MSFT) you ever wanted to know about locks<p. <blockquote> <p><font face="Consolas" size="3">D:\Workspace1\Proj\main>tf lock /lock:checkout file.txt<br>file.txt<br></font><font size="+0"><br><font face="Consolas" size="3">D:\Workspace1\Proj\main>tf status<br>File name Change Local path<br>--------- ------ ----------------------------------------------------------<br>$/Proj/main<br>file.txt ! lock D:\workspace1\Proj\main\file.txt<br>1 change(s)</font></font> </p></blockquote> <h3>Checkout locks</h3> <p>There are two types of locks in TFS -- checkout and checkin. The type of lock is selected with the /lock: option to the tf lock command (see above). <p>If in some workspace, user A has a checkout lock on $/Proj/file.cs, then user B cannot in his workspace place any kind of pending change on the item $/Proj/file.cs. Any attempt to pend a change on the item will result in an error. <blockquote> <p><font face="Consolas" size="3">D:\Workspace2\Proj\main>tf edit file.txt<br>The item $/Proj/main/file.txt is locked for check-out by DOMAIN\user1 in workspace Workspace1;DOMAIN\user1. </font></p></blockquote> <h3>Checkin locks </h3> <p>If the lock is a checkin lock instead, then user B can pend a change, but is warned that user A has the item locked for checkin. <blockquote> <p><font face="Consolas" size="3">D:\Workspace2\Proj\main>tf edit file.txt<br>file.txt<br><br>$/Proj/main/file.txt:<br> opened for lock in Workspace1;DOMAIN\user1 </font></p></blockquote> <p>The pending change cannot be checked in until the lock is released by the other user. <blockquote> <p><font face="Consolas" size="3">D:\Workspace2\Proj\main>tf checkin /i<br>Checking in edit: file.txt<br><br>The item $/Proj/main/file.txt is locked for check-in by DOMAIN\user1 in workspace Workspace1;DOMAIN\user1.<br>No files checked in.</font> </p></blockquote> <h3>Lock evaluation and recursive locking </h3> <p>Lock evaluation in TFS follows two important rules. We call this the "upside-down Y" check internally. <ol> <li>When you lock an item, you lock all of its parent folders, up to the root. (This is the top part of the Y.) <li>When you lock a folder, you lock all of its children, recursively. (This is the bottom part of the Y.) </li></ol> <p>Here are a few simple consequences of these rules. <ol> <li>If user A has a lock on $/Proj/main/file.txt, then user B cannot rename or delete $/Proj/main. (By rule #1.) <li>If user A has a lock on $/Proj, then user B cannot create an item named $/Proj/silly.txt, or edit an existing item $/Proj/main/file.txt. (By rule #2.) </li></ol> , <font face="Consolas" size="3">tf lock /lock:checkin $/Proj/main</font>. The lock will apply recursively downward. <p>If you instead execute <font face="Consolas" size="3">tf lock <strong>/r</strong> /lock:checkin $/Proj/main</font>, then a lock will be applied to every item under $/Proj/main, recursively. This is not necessary, results in many pending changes, and will significantly slow down lock evaluation by the server. <p>The /r option for the tf lock command is really only for pattern matching. For example if I wanted to lock all files with extension .bmp under $/Proj/main, I might say <font face="Consolas" size="3">tf lock <strong>/r</strong> /lock:checkin $/Proj/main/*.bmp</font> to accomplish this task. <h3>Automatic locking based on file extension</h3> <p. <p>The lock acquired is a checkout lock, as described in the section "Checkout locks" above. A lock that is acquired automatically because of its file extension cannot be undone. <blockquote> <p><font face="Consolas" size="3">D:\Workspace2\Proj\main>tf lock /lock:none file.bmp<br>TF10152: The item $/Proj/main/file.bmp must remain locked because its file type prevents multiple check-outs.</font> </p></blockquote> <p>The list of file extensions is configurable through the Team Explorer by right-clicking the root (server) node and selecting Team Foundation Server Settings → Source Control File Types. <p align="center"><a href=""><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="248" alt="clip_image002" src="" width="420" border="0"></a> </p> <p align="center"><a href=""><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="326" alt="clip_image004" src="" width="617" border="0"></a> </p> <p>To disable automatic locking by file type, you can find the file extension you're interested in, click Edit... and check the box for "Enable file merging and multiple checkout." <p align="center"><a href=""><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="191" alt="clip_image006" src="" width="333" border="0"></a> </p> <p>To disable automatic locking by file type entirely, you can check the box for each type. There are about 12 sets of extensions for which multiple checkout is disabled by default, so it shouldn't take too long. <h3>Automatic locking based on Team Project </h3> <p>TFS also supports automatic lock acquisition (no multiple checkout) at the Team Project level. Right-click the Team Project node in the Team Explorer, and select Team Project Settings → Source Control. <p align="center"><a href=""><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="320" alt="clip_image008" src="" width="374" border="0"></a> </p> <p align="center"><a href=""><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="242" alt="clip_image010" src="" width="628" border="0"></a> </p> <p. <h3>Unlocking an item </h3> <p. <p [<i>Team Project Name</i>]\Project Administrators group have UndoOther permission at the path $/<i>Team Project Name</i> and below. Here’s an example, where DOMAIN\user2 has $/Proj/main/file.txt checked out for “lock, edit.” <blockquote> <p><font face="Consolas" size="3">D:\Workspace1\Proj\main>tf edit file.txt<br>The item $/Proj/main/file.txt is locked for check-out by DOMAIN\user2 in workspace Workspace2;DOMAIN\user2.<br><br>D:\Workspace1\Proj\main>tf lock /lock:none /workspace:Workspace2;DOMAIN\user2 $/Proj/main/file.txt<br>D:\Workspace1\Proj\main:<br>file.txt<br><br>D:\Workspace1\Proj\main>tf edit file.txt<br>file.txt<br><br>$/Proj/main/file.txt:<br> opened for edit in Workspace2;DOMAIN\user2</font> </p></blockquote> <p>You’ll notice that the edit change of DOMAIN\user2 was preserved. Only the lock was removed. <h3>Locks and shelvesets </h3> <p>A lock cannot exist in a shelveset, so if you lock an item and try to shelve it, your lock will be stripped as part of the shelve operation. <p>However, automatic locks can cause trouble when unshelving pending changes, if you preserve the changes in your workspace when shelving them: <p align="center"><a href=""><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="78" alt="clip_image012" src="" width="481" border="0"></a> </p> <p>In this case, any attempt to unshelve the shelveset will fail, since you still have the locks in your current workspace. For this reason, we do not use any automatic locking internally.</p><img src="" width="1" height="1">Philip Kelley (MSFT)
http://blogs.msdn.com/b/phkelley/atom.aspx
CC-MAIN-2015-40
en
refinedweb
In addition to supporting conventional (servlet-based) Web development, Spring also supports JSR-168 Portlet development. As much as possible, the Portlet MVC framework is a mirror image of the Web MVC framework, and also uses the same underlying view abstractions and integration technology. So, be sure to review the chapters entitled Chapter 13, Web MVC framework and Chapter 14, View technologies before continuing with this chapter. (and requires)running framework is designed around a DispatcherPortlet that dispatches requests to handlers, with configurable handler mappings and view resolution, just as the DispatcherServlet in the web framework does. File upload is also supported in the same way. Locale resolution and theme resolution are not supported in Portlet MVC - these areas are in the purview of the portal/portlet container and are not appropriate at the Spring level. However, all mechanisms in Spring that depend on the locale (such as internationalization of messages) will still function properly because DispatcherPortlet exposes the current locale in the same way as DispatcherServlet. The default handler is still a very simple Controller interface, offering just two methods: void handleActionRequest(request,response) ModelAndView handleRenderRequest(request,response) The framework also includes most of the same controller implementation hierarchy, such as AbstractController, SimpleFormController, and so on. Data binding, command object usage, model handling, and view resolution are all the same as in the servlet framework. All the view rendering capabilities of the servlet framework are used directly via a special bridge servlet named ViewRendererServlet. By using this servlet, the portlet request is converted into a servlet request and the view can be rendered using the entire normal servlet infrastructure. This means all the existing renderers, such as JSP, Velocity, etc., can still be used within the portlet. Spring Portlet MVC supports beans whose lifecycle is scoped to the current HTTP request or HTTP Session (both normal and global). This is not a specific feature of Spring Portlet MVC itself, but rather of the WebApplicationContext container(s) that Spring Portlet MVC uses. These bean scopes are described in detail in the section entitled Section 3.4.4, “The other scopes” Portlet MVC is a request-driven web MVC framework, designed around a portlet that dispatches requests to controllers and offers other functionality facilitating the development of portlet applications. Spring's DispatcherPortlet however, does more than just that. It is completely integrated with the Spring ApplicationContext and allows you to use every other feature Spring has. Like ordinary portlets, the DispatcherPortlet is declared in the portlet.xml of your DispatcherPortlet now needs to be configured. In the Portlet MVC framework, each DispatcherPortlet has its own WebApplicationContext, which inherits all the beans already defined in the Root WebApplicationContext. These inherited beans can be overridden in the portlet-specific scope, and new scope- specific beans can be defined local to a given portlet instance. The framework will, on initialization of a DispatcherPortlet, look for a file named [portlet-name]-portlet.xml in the WEB-INF directory of your web application and create the beans defined there (overriding the definitions of any beans defined with the same name in the global scope). The config location used by the DispatcherPortlet can be modified through a portlet initialization parameter (see below for details). The Spring DispatcherPortlet has a fewPortlet. For most of the beans, defaults are provided so you don't have to worry about configuring them. When a DispatcherPortlet is setup for use and a request comes in for that specific DispatcherPortlet, it starts processing the request. The list below describes the complete process a request goes through if handled by a DispatcherPortlet: The locale returned by PortletRequest.getLocale() is bound to the request to let elements in the process resolve the locale to use when processing the request (rendering the view, preparing data, etc.). If a multipart resolver is specified and this is an ActionRequest, the request is inspected for multiparts and if they are found, it is wrapped in a MultipartActionRequest for further processing by other elements in the process. (See Section 16.7, “Multipart (file upload) support” for further information about multipart handling). An appropriate handler is searched for. If a handler is found, the execution chain associated with the handler (pre- processors, post-processors, controllers) will be executed in order to prepare a model. If a model is returned, the view is rendered, using the view resolver that has been configured with the WebApplicationContext. If no model is returned (which could be due to a pre- or post-processor intercepting the request, for example, for security reasons), no view is rendered, since the request could already have been fulfilled. Exceptions that might be thrown during processing of the request get picked up by any of the handler exception resolvers that are declared in the WebApplicationContext. Using these exception resolvers you can define custom behavior in case such exceptions get thrown. You can customize Spring's DispatcherPortlet by adding context parameters in the portlet.xml file or portlet init-parameters. The possibilities are listed below. The rendering process in Portlet MVC is a bit more complex than in Web MVC. In order to reuse all the view technologies from Spring Web MVC), we must convert the PortletRequest / PortletResponse to HttpServletRequest / HttpServletResponse and then call the render method of the View. To do this, DispatcherPortlet uses a special servlet that exists for just this purpose: the ViewRendererServlet. In order for DispatcherPortlet rendering to work, you must declare an instance of the ViewRendererServlet in the web.xml file for your web application as follows: > To perform the actual rendering, DispatcherPortlet does the following: Binds the WebApplicationContext to the request as an attribute under the same WEB_APPLICATION_CONTEXT_ATTRIBUTE key that DispatcherServlet uses. Binds the Model and View objects to the request to make them available to the ViewRendererServlet. Constructs a PortletRequestDispatcher and performs an include using the /WEB- INF/servlet/view URL that is mapped to the ViewRendererServlet. The ViewRendererServlet is then able to call the render method on the View with the appropriate arguments. The actual URL for the ViewRendererServlet can be changed using DispatcherPortlet’s viewRendererUrl configuration parameter. The controllers in Portlet MVC are very similar to the Web MVC Controllers and porting code from one to the other should be simple. The basis for the Portlet MVC controller architecture is the org.springframework.web.portlet.mvc.Controller interface, which is listed below. public interface Controller { /** * Process the render request and return a ModelAndView object which the * DispatcherPortlet will render. */ ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception; /** * Process the action request. There is nothing to return. */ void handleActionRequest(ActionRequest request, ActionResponse response) throws Exception; } As you can see, the Portlet Controller interface requires two methods that handle the two phases of a portlet request: the action request and the render request. The action phase should be capable of handling an action request and the render phase should be capable of handling a render request and returning an appropriate model and view. While the Controller interface is quite abstract, Spring Portlet MVC offers a lot of controllers that already contain a lot of the functionality you might need – most of these are very similar to controllers from Spring Web MVC. The Controller interface just defines the most common functionality required of every controller - handling an action request, handling a render request, and returning a model and a view. Of course, just a Controller interface isn't enough. To provide a basic infrastructure, all of Spring Portlet MVC's Controllers inherit from AbstractController, a class offering access to Spring's ApplicationContext and control over caching. The requireSession and cacheSeconds properties are declared on the PortletContentGenerator class, which is the superclass of AbstractController) but are included here for completeness. When using the AbstractController as a baseclass for your controllers (which is not recommended since there are a lot of other controllers that might already do the job for you) you only have to override either the handleActionRequestInternal(ActionRequest, ActionResponse) method or the handleRenderRequestInternal(RenderRequest, RenderResponse) method (or both), implement your logic, and return a ModelAndView object (in the case of handleRenderRequestInternal). The default implementations of both handleActionRequestInternal(..) and handleRenderRequestInternal(..) throw a PortletException. This is consistent with the behavior of GenericPortlet from the JSR- 168 Specification API. So you only need to override the method that your controller is intended to handle. Here is short example consisting of a class and a declaration in the web application context. package samples; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.springframework.web.portlet.mvc.AbstractController; import org.springframework.web.portlet.ModelAndView; public class SampleController extends AbstractController { public ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) { ModelAndView mav = new ModelAndView("foo"); mav.addObject("message", "Hello World!"); return mav; } } <bean id="sampleController" class="samples.SampleController"> <property name="cacheSeconds" value="120"/> </bean> The class above and the declaration in the web application context is all you need besides setting up a handler mapping (see Section 16.5, “Handler mappings”) to get this very simple controller working. Although you can extend AbstractController, Spring Portlet MVC (no need to hard-code the view name). The PortletModeNameViewController uses the current mode of the portlet as the view name. So, if your portlet is in View mode (i.e. PortletMode.VIEW) then it uses "view" as the view name. Spring Portlet MVC has the exact same hierarchy of command controllers as Spring Web MVC. They provide a way to interact with data objects and dynamically bind parameters from the PortletRequest to the data object specified. Your data objects don't have to implement a framework-specific interface, so you can directly manipulate your persistent objects if you desire. Let's examine what command controllers are available, to get an overview of what you can do with them: filled with the parameters from the request. AbstractFormController - an abstract controller offering form submission support. Using this controller you can model forms and populate them using a command object you retrieve in the controller. After a user has filled the form, AbstractFormController binds the fields, validates, and hands the object back to the controller to take concrete AbstractFormController that provides even more support when creating a form with a corresponding command object. The SimpleFormController lets you specify a command object, a viewname for the form, a viewname for the page you want to show the user when form submission has succeeded, and more. AbstractWizardFormController – a concrete AbstractFormController that provides a wizard-style interface for editing the contents of a command object across multiple display pages. Supports multiple user actions: finish, cancel, or page change, all of which are easily specified in request parameters from the view. These command controllers are quite powerful, but they do require a detailed understanding of how they operate in order to use them efficiently. Carefully review the Javadocs for this entire hierarchy and then look at some sample implementations before you start using them. Instead of developing new controllers, it is possible to use existing portlets and map requests to them from a DispatcherPortlet. Using the PortletWrappingController, you can instantiate an existing Portlet as a Controller as follows: <bean id="myPortlet" class="org.springframework.web.portlet.mvc.PortletWrappingController"> <property name="portletClass" value="sample.MyPortlet"/> <property name="portletName" value="my-portlet"/> <property name="initParameters"> <value>config=/WEB-INF/my-portlet-config.xml</value> </property> </bean> This can be very valuable since you can then use interceptors to pre-process and post-process requests going to these portlets. Since JSR-168 does not support any kind of filter mechanism, this is quite handy. For example, this can be used to wrap the Hibernate OpenSessionInViewInterceptor around a MyFaces JSF Portlet. Using a handler mapping you can map incoming portlet requests to appropriate handlers. There are some handler mappings you can use out of the box, for example, the PortletModeHandlerMapping, but let's first examine the general concept of a HandlerMapping. Note: We are intentionally using the term “Handler” here instead of “Controller”. DispatcherPortlet is designed to be used with other ways to process requests than just Spring Portlet MVC’s own Controllers. A Handler is any Object that can handle portlet requests. Controllers are an example of Handlers, and they are of course the default. To use some other framework with DispatcherPortlet, a corresponding implementation of HandlerAdapter is all that is needed.Portlet will hand it over to the handler mapping to let it inspect the request and come up with an appropriate HandlerExecutionChain. Then the DispatcherPortlet will execute the handler and interceptors in the chain (if any). These concepts are all exactly the same as in Spring Web MVC. The concept of configurable handler mappings that can optionally contain interceptors (executed before or after the actual handler was executed, or both) is extremely powerful. A lot of supporting functionality can be built into a custom HandlerMapping. Think of a custom handler mapping that chooses a handler not only based on the portlet mode of the request coming in, but also on a specific state of the session associated with the request. In Spring Web MVC, handler mappings are commonly based on URLs. Since there is really no such thing as a URL within a Portlet, we must use other mechanisms to control mappings. The two most common are the portlet mode and a request parameter, but anything available to the portlet request can be used in a custom handler mapping. The rest of this section describes three of Spring Portlet MVC's most commonly used handler mappings. They all extend AbstractHandlerMapping and share the following properties: interceptors: The list of interceptors to use. HandlerInterceptors are discussed in Section 16.5.4, “Adding HandlerInterceptors”.. lazyInitHandlers: Allows for lazy initialization of singleton handlers (prototype handlers are always lazily initialized). Default value is false. This property is directly implemented in the three concrete Handlers. This is a simple handler mapping that maps incoming requests based on the current mode of the portlet (e.g. ‘view’, ‘edit’, ‘help’). An example: <bean class="org.springframework.web.portlet.handler.PortletModeHandlerMapping"> <property name="portletModeMap"> <map> <entry key="view" value- <entry key="edit" value- <entry key="help" value- </map> </property> </bean> If we need to navigate around to multiple controllers without changing portlet mode, the simplest way to do this is with a request parameter that is used as the key to control the mapping. ParameterHandlerMapping uses the value of a specific request parameter to control the mapping. The default name of the parameter is 'action', but can be changed using the 'parameterName' property. The bean configuration for this mapping will look something like this: <bean class="org.springframework.web.portlet.handler.ParameterHandlerMapping”> <property name="parameterMap"> <map> <entry key="add" value- <entry key="edit" value- <entry key="delete" value- </map> </property> </bean> The most powerful built-in handler mapping, PortletModeParameterHandlerMapping combines the capabilities of the two previous ones to allow different navigation within each portlet mode. Again the default name of the parameter is "action", but can be changed using the parameterName property. By default, the same parameter value may not be used in two different portlet modes. This is so that if the portal itself changes the portlet mode, the request will no longer be valid in the mapping. This behavior can be changed by setting the allowDupParameters property to true. However, this is not recommended. The bean configuration for this mapping will look something like this: <bean class="org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping"> <property name="portletModeParameterMap"> <map> <entry key="view"> <!-- 'view' portlet mode --> <map> <entry key="add" value- <entry key="edit" value- <entry key="delete" value- </map> </entry> <entry key="edit"> <!-- 'edit' portlet mode --> <map> <entry key="prefs" value- <entry key="resetPrefs" value- </map> </entry> </map> </property> </bean> This mapping can be chained ahead of a PortletModeHandlerMapping, which can then provide defaults for each mode and an overall default as well. Spring's handler mapping mechanism has a notion of handler interceptors, which can be extremely useful when you want to apply specific functionality to certain requests, for example, checking for a principal. Again Spring Portlet MVC implements these concepts in the same way as Web MVC. Interceptors located in the handler mapping must implement HandlerInterceptor from the org.springframework.web.portlet package. Just like the servlet version, this interface defines three methods: one that will be called before the actual handler will be executed (preHandle), one that will be called after the handler is executed (postHandle), and one that is called after the complete request has finished (afterCompletion).Portlet assumes the interceptor itself has taken care of requests (and, for example, rendered an appropriate view) and does not continue executing the other interceptors and the actual handler in the execution chain. The postHandle method is only called on a RenderRequest. The preHandle and afterCompletion methods are called on both an ActionRequest and a RenderRequest. If you need to execute logic in these methods for just one type of request, be sure to check what kind of request it is before processing it. As with the servlet package, the portlet package has a concrete implementation of HandlerInterceptor called HandlerInterceptorAdapter. This class has empty versions of all the methods so that you can inherit from this class and implement just one or two methods when that is all you need. The portlet package also has a concrete interceptor named ParameterMappingInterceptor that is meant to be used directly with ParameterHandlerMapping and PortletModeParameterHandlerMapping. This interceptor will cause the parameter that is being used to control the mapping to be forwarded from an ActionRequest to the subsequent RenderRequest. This will help ensure that the RenderRequest is mapped to the same Handler as the ActionRequest. This is done in the preHandle method of the interceptor, so you can still modify the parameter value in your handler to change where the RenderRequest will be mapped. Be aware that this interceptor is calling setRenderParameter on the ActionResponse, which means that you cannot call sendRedirect in your handler when using this interceptor. If you need to do external redirects then you will either need to forward the mapping parameter manually or write a different interceptor to handle this for you. As mentioned previously, Spring Portlet MVC directly reuses all the view technologies from Spring Web MVC. This includes not only the various View implementations themselves, but also the ViewResolver implementations. For more information, refer to the sections entitled Chapter 14, View technologies and Section 13.5, “Views and resolving them” respectively. A few items on using the existing View and ViewResolver implementations are worth mentioning: Most portals expect the result of rendering a portlet to be an HTML fragment. So, things like JSP/JSTL, Velocity, FreeMarker, and XSLT all make sense. But it is unlikely that views that return other document types will make any sense in a portlet context. There is no such thing as an HTTP redirect from within a portlet (the sendRedirect(..) method of ActionResponse cannot be used to stay within the portal). So, RedirectView and use of the 'redirect:' prefix will not work correctly from within Portlet MVC. It may be possible to use the 'forward:' prefix from within Portlet MVC. However, remember that since you are in a portlet, you have no idea what the current URL looks like. This means you cannot use a relative URL to access other resources in your web application and that you will have to use an absolute URL. Also, for JSP development, the new Spring Taglib and the new Spring Form Taglib both work in portlet views in exactly the same way that they work in servlet views. Spring Portlet MVC has built-in multipart support to handle file uploads in portlet applications, just like Web MVC does. The design for the multipart support is done with pluggable PortletMultipartResolver objects, defined in the org.springframework.web.portlet.multipart package. Spring provides a PortletMultipartResolver for use with Commons FileUpload. How uploading files is supported will be described in the rest of this section. By default, no multipart handling will be done by Spring Portlet MVC, as some developers will want to handle multiparts themselves. You will have to enable it yourself by adding a multipart resolver to the web application's context. After you have done that, DispatcherPortlet will inspect each request to see if it contains a multipart. If no multipart is found, the request will continue as expected. However, if a multipart is found in the request, the PortletMultipartResolver that has been declared in your context will be used. After that, the multipart attribute in your request will be treated like any other attribute. The following example shows how to use the CommonsPortletMultipartResolver: <bean id="portletMultipartResolver" class="org.springframework.web.portlet.multipart.CommonsPortlet. Be sure to use at least version 1.1 of Commons FileUpload as previous versions do not support JSR-168 Portlet applications. Now that you have seen how to set Portlet MVC up to handle multipart requests, let's talk about how to actually use it. When DispatcherPortlet detects a multipart request, it activates the resolver that has been declared in your context and hands over the request. What the resolver then does is wrap the current ActionRequest into a MultipartActionRequest that has support for multipart file uploads. Using the MultipartActionRequest you can get information about the multiparts contained by this request and actually get access to the multipart files themselves in your controllers. Note that you can only receive multipart file uploads as part of an ActionRequest, not as part of a RenderRequest. After the PortletMultip (JSP/HTML) form: <h1>Please upload a file</h1> <form method="post" action="<portlet:actionURL/>" enctype="multipart/form-data"> <input type="file" name="file"/> <input type="submit"/> </form> As you can see, we've created a field named “file” PortletRequestDataBinder. There are a couple of editors available for handling files and setting the results on an object. There's a StringMultipartFileEditor capable of converting files to Strings (using a user-defined character set) and there is a ByteArrayMultipartFileEditor which converts files to byte arrays. They function just as the CustomDateEditor does. So, to be able to upload files using a form, declare the resolver, a mapping to a controller that will process the bean, and the controller itself. <bean id="portletMultipartResolver" class="org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver"/> <bean class="org.springframework.web.portlet.handler.PortletModeHandlerMapping"> <property name="portletModeMap"> <map> <entry key="view" value- </map> </property> </bean> <bean id="fileUploadController" class="examples.FileUploadController"> <property name="commandClass" value="examples.FileUploadBean"/> <property name="formView" value="fileuploadform"/> <property name="successView" value="confirmation"/> </bean> After that, create the controller and the actual class to hold the file property. public class FileUploadController extends SimpleFormController { public void onSubmitAction(ActionRequest request, ActionResponse response, Object command, BindException errors) throws Exception { // cast the bean FileUploadBean bean = (FileUploadBean) command; // let's see if there's content there byte[] byte[] // we have to register a custom editor binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor()); // now Spring knows how to handle multipart object and convert } } this: public class FileUploadController extends SimpleFormController { public void onSubmitAction(ActionRequest request, ActionResponse response, Object command, BindException errors) throws Exception { // cast the bean FileUploadBean bean = (FileUploadBean) command; // let's see if there's content there String a String // we have to register a custom editor binder.registerCustomEditor(String.class, new StringMultipartFileEditor()); // now Spring knows how to handle multipart objects and convert } } editor because there is no type conversion to be performed. public class FileUploadController extends SimpleFormController { public void onSubmitAction(ActionRequest request, ActionResponse response, Object command, BindException errors) throws Exception { // cast the bean FileUploadBean bean = (FileUploadBean) command; // let's see if there's content there MultipartFile file = bean.getFile(); if (file == null) { // hmm, that's strange, the user did not upload anything } // do something with the file here } } public class FileUploadBean { private MultipartFile file; public void setFile(MultipartFile file) { this.file = file; } public MultipartFile getFile() { return file; } } Just like Web MVC, Portlet MVC provides HandlerExceptionResolvers to ease the pain of unexpected exceptions occurring while your request is being processed by a handler that matched the request. Portlet MVC also provides the same concrete SimpleMappingExceptionResolver that enables you to take the class name of any exception that might be thrown and map it to a view name. Port.portlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <bean class="org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> // ... (controller bean definitions) ... </beans> Defining a DefaultAnnotationHandlerMapping and/or AnnotationMethodHandlerAdapter explicitly also makes sense if you would like to customize the mapping strategy, e.g. specifying a custom WebBindingInitializer (see below). The @Controller annotation indicates that a particular class serves the role of a controller. There is no need to extend any controller base class or reference the Portlet API. You are of course still able to reference Portportal.portlet"/> // ... </beans> The @RequestMapping annotation is used to map portlet modes like 'VIEW'/'EDIT' onto an entire class or a particular handler method. Typically the type-level annotation maps a specific mode (or mode plus parameter condition) onto a form controller, with additional method-level annotations 'narrowing' the primary mapping for specific portlet request parameters. The following is an example of a form controller from the PetPortal sample application using this annotation: @Controller @RequestMapping("EDIT") @SessionAttributes("site") public class PetSitesEditController { private Properties petSites; public void setPetSites(Properties petSites) { this.petSites = petSites; } @ModelAttribute("petSites") public Properties getPetSites() { return this.petSites; } @RequestMapping // default (action=list) public String showPetSites() { return "petSitesEdit"; } @RequestMapping(params = "action=add") // render phase public String showSiteForm(Model model) { // Used for the initial form as well as for redisplaying with errors. if (!model.containsAttribute("site")) { model.addAttribute("site", new PetSite()); } return "petSitesAdd"; } "); } } @RequestMapping(params = "action=delete") public void removeSite(@RequestParam("site") String site, ActionResponse response) { this.petSites.remove(site); response.setRenderParameter("action", "list"); } } Handler methods which are annotated with @RequestMapping are allowed to have very flexible signatures. They may have arguments of the following types, in arbitrary order (except for validation results, which need to follow right after the corresponding command object, if desired): Request and/or response objects (Portlet API). You may choose any specific request/response type, e.g. PortletRequest / ActionRequest / RenderRequest. An explicitly declared action/render argument is also used for mapping specific request types onto a handler method (in case of no other information given that differentiates between action and render requests). Session object (Portlet API): of type PortletSession. An argument of this type will enforce the presence of a corresponding session. As a consequence, such an argument will never be (the portal locale in a Portlet environment). java.io.InputStream / java.io.Reader for access to the request's content. This will be the raw InputStream/Reader as exposed by the Portlet API. java.io.OutputStream / java.io.Writer for generating the response's content. This will be the raw OutputStream/Writer as exposed by the Portlet API. @RequestParam annotated parameters for access to specific PortPortal sample application shows the usage: @Controller @RequestMapping("EDIT") @SessionAttributes("site") public class PetSitesEditController { // ... public void removeSite(@RequestParam("site") String site, ActionResponse response) { this.petSites.remove(site); response.setRenderParameter("action", "list"); } // ... }") @SessionAttributes("site") public class PetSitesEditController { // ... @ModelAttribute("petSites") public Properties getPetSites() { return this.petSites; } ") @SessionAttributes("site") public class PetSitesEditController { // ... } process of deploying a Spring Portlet MVC application is no different than deploying any JSR-168 Portlet application. However, this area is confusing enough in general that it is worth talking about here briefly. Generally, the portal/portlet container runs in one webapp in your servlet container and your portlets run in another webapp in your servlet container. In order for the portlet container webapp to make calls into your portlet webapp it must make cross-context calls to a well-known servlet that provides access to the portlet services defined in your portlet.xml file. The JSR-168 specification does not specify exactly how this should happen, so each portlet container has its own mechanism for this, which usually involves some kind of “deployment process” that makes changes to the portlet webapp itself and then registers the portlets within the portlet container. At a minimum, the web.xml file in your portlet webapp is modified to inject the well-known servlet that the portlet container will call. In some cases a single servlet will service all portlets in the webapp, in other cases there will be an instance of the servlet for each portlet. Some portlet containers will also inject libraries and/or configuration files into the webapp as well. The portlet container must also make its implementation of the Portlet JSP Tag Library available to your webapp. The bottom line is that it is important to understand the deployment needs of your target portal and make sure they are met (usually by following the automated deployment process it provides). Be sure to carefully review the documentation from your portal for this process. Once you have deployed your portlet, review the resulting web.xml file for sanity. Some older portals have been known to corrupt the definition of the ViewRendererServlet, thus breaking the rendering of your portlets.
http://docs.spring.io/spring/docs/2.5.6/reference/portlet.html
CC-MAIN-2015-40
en
refinedweb
Originally posted by Don Liu: are we supposed to write the program, or just idea? import com.coolskill.foundation.io.CFile; Originally posted by Joel McNary: BTW, the instructions are unclear -- is the upper left corner 0,0 and lower right N-1, N-1, or is upper left 1,1 and lower right N,N? Originally posted by Joel McNary: No clue what you're doing wrong I can't find any common thread among those that it cannot find. Originally posted by Joel McNary: Got it. You replaced & lt and & gt with '<'. This meant that you could only find words that ran backwards! Copy, paste, replace things correctly, and try again. [ June 05, 2003: Message edited by: Joel McNary ] Originally posted by David Weitzman: Actually I'm probably directing my efforts in the wrong direction, now that I think about it. Judging roughly by output, 10.5 of those seconds were spent in IO and setting up the HashSets. The individual word searches were quite fast. I'll think about that. Originally posted by Sonny Pondrom: Jason, So that others don't do what I did, why don't you change the first message from "where N > 0, N <= 100" to "where N >= 0, N < 100" I got the right answers, but my indicies are off.
http://www.coderanch.com/t/35083/Programming/June-Newsletter-Puzzle
CC-MAIN-2015-40
en
refinedweb
#include <wchar.h> size_t wcsrtombs(char *dest, const wchar_t **src, size_t len, mbstate_t *ps); length limit exists. In both of the above cases, if ps is a NULL pointer, a static anonymous state only known to the wcsrtombs function is used instead. The programmer must ensure that there is room for at least len bytes at dest. Passing NULL as ps is not multi-thread safe.
http://man.linuxmanpages.com/man3/wcsrtombs.3.php
crawl-003
en
refinedweb
#include <wchar.h> size_t wcsnrtombs(char *dest, const wchar_t **src, size_t nwc, size_t len, mbstate_t *ps); If dest is not a NULL pointer, L'\0', destination length limit exists. In both of the above cases, if ps is a NULL pointer, a static anonymous state only known to the wcsnrtombs function is used instead. The programmer must ensure that there is room for at least len bytes at dest. Passing NULL as ps is not multi-thread safe.
http://man.linuxmanpages.com/man3/wcsnrtombs.3.php
crawl-003
en
refinedweb
From: Dave Jones <davej@suse.de> To: Linux Kernel <linux-kernel@vger.kernel.org> Subject: Linux 2.5.9-dj1 Date: Tue, 23 Apr 2002 15:45:27 +0100 More of the same. Back up to date with Linus, and roll in some more pending bits. As usual,.. Patch against 2.5.9 vanilla is available from: Merged patch archive: Check before reporting known bugs that are also in mainline. -- Davej. 2.5.9-dj1 o Resync against 2.5.9 | Configure enhanced to look in /boot/`uname -r` (Me) o Fall back to PCI BIOS if direct access fails. (Me) o Bump size of xconfig variable buffer (Me) o 64bit fixes for x86-64 MTRR driver. (Me) o GL641USB based CF-Reader USB support. (Gert Menke) o Bring x86-64 bluesmoke up to date with ia32. (Me) | And drop non-x86-64 bits. o UP CPU number microoptimisation. (Mikael Pettersson) o ATM resources compile fix. (Frank Davis) o readahead reformatting. (Steven Cole) o Death of SYMBOL_NAME (Brian Gerst) o Add more missing Config.help entries. (Steven Cole) o remove old SCSI-EH methods from Scsi_Host_Template (Christoph Hellwig) | This likely breaks many SCSI drivers. They were broken anyway, | and only worked by chance. With this, they stand a chance of being fixed. o meye driver request_irq bugfix. (Stelian Pop) o Add kernel command line params to meye driver. (Stelian Pop) o Slabcache namespace cleanup. (Ryan Mack) o SIGURG SUSv3 compliance. (Christopher Yeoh) o Ultrastor region handling cleanup. (William Stinson) o Megaraid region handling cleanup. (William Stinson) o Buslogic region handling cleanup. (William Stinson) o IrDA driver update. (Jean Tourrilhes) o Fix ESSID related wireless crash. (Jean Tourrilhes) o Attempt rd.c surgery. (Me, Andrew Morton) | works/doesn't work feedback appreciated. o Fix reboot=bios cache handling. (Robert Hentosh) o Recognise P4 Xeon in mptable. (James Bourne) o 64bit fixes for smbfs. (Urban Widmark) o nfsd double down() fix. (Anton Blanchard) o x86 io.h cleanup revisited. (Brian Gerst) o kjournald open files fix. (Ph. Marek) o Make expfs compilable on old compilers. (Andrew Morton) o Nail the per-cpu-areas problem once and for all. (Rusty Russell) 2.5.8-dj1 o Detect existing disk geometry in scsicam.c (Doug Gilbert) o Various request_region cleanups. (Evgeniy Polyakov) | Via Rusty's trivial patchbot, and cleaned a little by me. o Yet more request_region cleanups. (William Stinson) o IBM USB Memory key support. (Alexander V. Inyukhin) o Add missing IA64 helptexts. (Steven Cole) o Fix BFS superblock allocation error. (Brian Gerst) o romfs superblock cleanups. (Brian Gerst) o Limit charset size in NLS UTF8 (Liyang Hu) o NCR 53c810 PCI class fixup. (Graham Cobb) o Dynamically size LDT on alloc. (Manfred Spraul) o Disable ACPI C3 on PIIX4 whilst busmastering. (Dominik Brodowski) o hitfb compile fix. (James Simmons) o Various ALSA include compile fixes. (Russell King) o fatfs includes compile fix. (Russell King) o Stricter HTML generation from SGML. (Erik van Konijnenburg) o wdt977 BKL removal. (Dave Hansen) o Various suser -> capability checks. (Colin Slater) o Don't miss preemption opportunities. (Robert Love) o Fix up broken strtok->strsep in tmscsim.c (Dan D Carpenter) o Small kernel-api docbook updates. (Erik Mouw) o Various small touchscreen fixes. (James Simmons) o virt_to_bus fixes for synclink driver. (Paul Fulghum) o Correct nfsservctl capability.h comment. (Chris Wright) o Cleanup x86 io.h functions. (Brian Gerst) o Make 'make tags' work with bitkeeper. (Peter Chubb) o Correct Num/Caps_lock state ioctl flags mixup (Rok Papez) o Small Farsync driver fixes. (Francois Romieu, Kevin Curtis) o Make st.c not oops when there are no tapes. (Douglas Gilbert) o Add PnP scanning to AD1848 OSS driver. (Zwane Mwaikambo) o AHA152x update (ISAPNP,ABORT fixed & 2.5 fixes). (Juergen E. Fischer) o Bluesmoke warning fixes. (Robert Love) o Make per-cpu setup compile on uniprocessor (Robert Love) o Fix various framebuffer merge funnies. (James Simmons) o Fix migration_thread preemption race. (Robert Love) o IDE TCQ updates. (Jens Axboe) o SIGIO generation on FIFOs & pipes. (Jeremy Elson) o PNPBIOS SMP fixes. (Thomas Hood et al) o attach_mpu401() cleanup on failure (Zwane Mwaikambo) o Make P4 thermal interrupt warning a compile option. (Me) | init check for same now also checks for Intel P4. o Offer Athlon background MCE checker on i386 too. (Me) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at Please read the FAQ at
http://lwn.net/2002/0425/a/2.5.9-dj1.php3
crawl-003
en
refinedweb
A. The examples assume you are running your Selenium tests against an existing web server (say an integration or staging server). In this case, I typically set up a dedicated Maven project to do the job. This project will start up a Selenium client, run some Selenium integration tests, and then shut down the Selenium client. An alternative approach is to start your application up in Jetty, which works fine as well, but involves a bit more configuration in the pom.xml file. The test cases are written in Groovy, primarily because it is a real pleasure to write anything in Groovy :-). Easyb is also an excellent alternative that works well with Selenium. The Groovy tests by default go in the test/src/groovy directory. You can set up Groovy in your Maven project by adding the gmaven plugin, as shown here: <plugin> <groupId>org.codehaus.groovy.maven</groupId> <artifactId>gmaven-plugin</artifactId> <version>1.0-rc-4</version> <executions> <execution> <goals> <goal>generateStubs</goal> <goal>compile</goal> <goal>generateTestStubs</goal> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> Next, you need to set up Selenium in your Maven project. You can use the Selenium plugin for this: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>selenium-maven-plugin</artifactId> <version>1.0-rc-1</version> <executions> <execution> <id>xvfb</id> <phase>pre-integration-test</phase> <goals> <goal>xvfb</goal> </goals> </execution> <execution> <id>start</id> <phase>pre-integration-test</phase> <goals> <goal>start-server</goal> </goals> <configuration> <background>true</background> <logOutput>true</logOutput> </configuration> </execution> <execution> <id>stop</id> <phase>post-integration-test</phase> <goals> <goal>stop-server</goal> </goals> </execution> </executions> </plugin>> Note that we have set up the Selenium client to start just before the integration tests, and to close down once the integration tests are finished. We also need to configure the Surefire plugin to run the Selenium tests during the integration-test phase. You can use whatever convention you want - in this case, the Selenium tests all go in a package called 'selenium', placed somewhere in the project class structure. In the following configuration, we ensure that these tests are only run during the integration-test phase: <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <excludes> <exclude>**/*IntegrationTest.*</exclude> <exclude>**/selenium/**</exclude> </excludes> <forkMode>never</forkMode> </configuration> <executions> <execution> <id>integration-tests</id> <phase>integration-test</phase> <goals> <goal>test</goal> </goals> <configuration> <excludes> <exclude>**/*Base.java</exclude> <exclude>**/*$*</exclude> </excludes> <includes> <include>**/*IntegrationTest.*</include> <include>**/selenium/**</include> </includes> </configuration> </execution> </executions> </plugin> To make things a bit more flexible, we will be passing in the target URLs to the tests from the command line or via a Maven profile. Now, due to a bug/quirk in the current Maven surefire plugin, you need to set the forkMode option to never for this to work properly. We will also need a dependency on the Selenium Java client classes for our test code later on: <dependencies> <dependency> <groupId>org.seleniumhq.selenium.client-drivers</groupId> <artifactId>selenium-java-client-driver</artifactId> <version>1.0-beta-2</version> <scope>test</scope> </dependency> </dependencies> The Groovy classes themselves are fairly simple. We start off with a base class, which will set up the Selenium client, and shut it down cleanly after the tests. We use a property called base.url to ensure that we can run the tests against different servers as required: public class SeleniumTestBase { /** * Only create one instance of this server for all the tests. */ private static Selenium seleniumInstance /** * Base URL defined by the ${base.url} property. * Child classes should use this variable to ensure that tests are run * against the right test server. */ private static String baseUrl; protected static synchronized Selenium getSelenium() { if (!seleniumInstance) { seleniumInstance = new DefaultSelenium("localhost", 4444, "*firefox", getBaseUrl()) seleniumInstance.start() } return seleniumInstance } public static String getBaseUrl() { if (!baseUrl) { baseUrl = System.getProperty("base.url") ?: "" } return baseUrl } @AfterClass public static synchronized void shutdown() { seleniumInstance.close() seleniumInstance = null } } Finally, the tests themselves are derived from this class, and use the selenium and baseUrl public class VersionNumberTest extends SeleniumTestBase { @Test void homePageShouldHaveAVersionNumberInFooter() { selenium.with { open "${baseUrl}/index.html" waitForPageToLoad "5000" assert isTextPresent(/regexp:myapp version \d+\.\d+\.\d+/) } } ... } That should be enough to get you started with Selenium tests written in Groovy for your Maven projects - have fun! - 3437 reads by tomlo - 2009-06-02 23:17I realise I'll probably get flamed for this, but selenium really is not a great tool. I've seen so many hours wasted maintaining scripts because it's so fragile. Worse than that, because of it's javascript injection, I've witnessed testers convincing developers to make a site less secure just so they can run selenium tests on it. If you're doing a project at home and can't afford a tool it's ok, because your time is your own. As far as a business tool goes, it's TCO is way too high due to frequent test script maintenance and introduced risks. Just because it's free, doesn't mean it's worth it. ROI goes backwards as TCO goes up. That said, nice work making it do what you wanted. Can I ask how long it took you to research and develop this work around? I too do projects at home. :) by johnsmart - 2009-06-04 08:59That's cool, Selenium is not a fix-all solution. I usually use it from Java, using a BDD-like approach, rather than by recording scripts, though there are plenty of folk who do that too. Regarding TCO, in my experience ANY record-replay based testing tool will incure a pretty high maintenance overhead, even the (very) pricy commercial offerings. HTMLUnit is another promising option if you don't like running things in a browser or using javascript.
http://weblogs.java.net/blog/johnsmart/archive/2009/05/a_quick_primer.html
crawl-003
en
refinedweb
Tell us what you think of the site. I wish somebody could help me out on the very basics of compiling a mudbox plugin. I’ve been struggling with it for almost a week, non-stop, and I’ve reached a limbo-guessing state… All reference and documentations for doing this are so minimal when it comes to preparing a compilation environment, and make so many assumptions of knowledge by the reader, it’s really frustrating… What I’m trying to do, is to compile a Qt-ui-based plugin for Mudbox 2011 x64, using the provided SDK, visual-studio 2008 (pro-tial) and Qt 4.5.3, which I downloaded in source and compiled via nmake in vs2008 command line, especially for this task, as there is no viable explanation anywhere on the web on how to compile a qt-plugin for mudbox, I took this suggestion from a maya post I found somewhere… There is so much I don’t know and don’t understand in the way Qt dlls should be built via vs2008, so much implicitness, that i’m pretty lost by now… Please help, in any way you can… I’m new to C++, Qt and VS in general, but I know the concepts, I just lack experience. I know all about the compile/link/build process, and the moc process that has to occur before that, but I don’t know how to configure stuff in VS. 1. What files should the builder use, the Qt ones, the SDK ones, or a certain combination? 2. If it’s a combination, how do I tell the builder what to take from where? 3. I managed to get the examples of the SDK to compile/build, but they don’t include Qt. 4. When I try to add a Qt class via the Qt-add-in, it sais that it cannot add it for projects that where not created by the Qt-VS-add-in. 5. When I start a fresh Qt-dll-project, then I have to configure myself all the build configurations to customarily tailor specifically for making a .mb mudbox-plugin file, and I have no idea how to do that, and could not find anything on the web. 6. What is the makefile file that is in all the examples? It is calling buildgonfig file on the example’s root folder, right? So I need to do something for that to happen? 7. How come that I manage to build the examples in x64 target-platform, but when I try to build the Qt fresh project, for x64 platform, it sais it can’t do that? 8. I managed to compile the source of the TurntableSDKexample that I found somewhere on the web… It does use Qt, and I did manage to get it compiled for x64 platform, it even loaded correctly in mudbox. It seems to not require/use a makefile somehow… The problem is I cannot seem to be able to modify/expand this project-file with it’s configuration without breaking it. If I try to redactor the name of the classes from turntable into something else, or change the file-names, the auto-generated moc_*.* files error out somehow saying they can’t find the class/file turntable*.* stuff… Also, this build configuration does not use the .ui files method of building an interface, so it makes it harder to change the user-interface of this plugin. 9. I need to make my plugin use xml-rpc to interact with an external data-server. I managed to find a Qt-based project that does that, and even download the source, modify for my needs, compile and build it so it interacts with the data-server. But only within it’s own project’s configuration, using the Qt-VS-Add-In kind of project (.pro file), within it’s own environment, which calls for all the Qt-4.5.3 source, not the mudbox-sdk-qt-source… Now I want to integrate the 2 projects, and I have 3 options to do that, as I don’t want to get into all the project-configuration stuff as it’s way too complicated… Option 1: Using the turnTable project that compiles the plugin that loads correctly into mudbox, and extending it to include the source of the QtXmlrpc project, by either copying the files of the QtXmlrpc stuff into the mudbox/sdk/qt-folders and re-orienting the include-directives to using the mudbox/sdk/qt-source-files, or copying the QtXmlrpc sources into the turnTable’s source files into the local folder of the turnTable project. I have tried both, and in both cases - even after dealing with all the pre-processor include directives to satisfy the pre-processor completely, the Linker complains about many “unresolved external symbol"s (LNK2001 - __cdecl stuff...). Option 2: Using the QtXmlrpc project, and copying all the turnTable project files into it, and re configure the project configuration to satisfy both projects, applying onto the QtXmlrpc project, all the mudbox-plugin-compilation-relevant configurations from the turnTable project. I have no idea where to begin going about doing that… Option 3: Using a dll-compiled version of the QtXmlrpc project, within the turnTable project. I don’t know how to do that either… 10. I want to change the plugin-window-type of the turnTable for a QDialog to the mudbox-sdk’s WindowPlugin interface, so it would appear in mudbox as a window that could be opened as docked-within the layers/windows panel… That means sub-classing an “interface” and registering a custom window class or whatever as I understand from the sdk’s documentation… I have no idea how to go about doing that.... Any help is appreciated… Ok.... I see that my suspicions where right… I’m probably one of the few people who try to write a UI-based plugin for mudbox… Soooo, I managed to solve some issues, but not all, and I’d like to share my conclusions so others can benefit, and maybe someone could help me out understanding the remaining issues… Here goes: As it turns out, them problem of integrating the QtXMLRPC project, was due to the fact that it was compiles for a 32bit platform, as well as the entire Qt source I compiled, while the Mudbox 2011 64bit version of the SDK, is using Qt compiled code/libraries that where created and compiled as a 64bit target… I had to re-compile the entire Qt source again, using the 64bit version of the visual studio command prompt, and then do the same for the QtXMLRPC project. I then re-oriented the mudbox-plugin project (turnTable) into sourcing the complete Qt source and not the one that comes with the SDK… That was according to a suggestion I got from Wayne, as he said there are some nasty bugs in the SDK version. I did that as follows: I re-downloaded the source-code of the 4.5.3 Qt, and extracted it to: c:\qt\4.5.3-x64 I then changed the system-environment variables: PATH: &#xQT;DIR%\bin; QTDIR: changed from “c:\qt\4.5.3-vc” to c:\qt\4.5.3-x64 Then, I ran the shortcut in the start menu programs: “Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio 2008 x64 Win64 Command Prompt” That brings up a command prompt that would compile via visual studio 2008 while targeting for a 64bit platform. From “c:\qt\4.5.3-x64” I ran: “configure -platform win32-msvc2005” A couple of minutes later, when the configuring process was complete, I ran: “nmake” That was yesterday… Today, when the compilation of Qt has finished, I did similar process to compile the QtXMLRPC project. Then, I just copied the “qtxmlrpc.lib” file that was generated, as well as the mudbox-specific libraries from the “Mudbox2011\SDK\lib” folder ("MudboxFramework.lib" and “cg.lib") into “c:\qt\4.5.3-x64\lib”. I also copied the entire “Mudbox2011\SDK\include\Mudbox” folder, as is, into “c:\qt\4.5.3-x64\include” Then, in Visual Studio 2008, I opened the solution file of the turnTable project, and in the main menu I went to the Qt Add-In stuff: “Qt > Qt Options” And in the dialog, I added the new x64 compiled version of Qt: In the “Qt Version” tab, I pressed the “Add” button, and in “Version name:” I wrote “4.5.3-x64”, then I pressed the “...” button next to “path” and sourced the “c:\qt\4.5.3-x64” folder, then pressed “ok”. still in the “Qt Versions” tab of the “Qt Options” dialog, down in the “Default Qt\Win Version:” drop-down list, I choose the new “4.5.3-x64” version. Then, I changed the project properties by going in the main menu to “Project > turnTable Properties”, and in the dialog, changed the following: In: Configuration Properties > C/C++ > General : Additional Include Directories: I replaced “..\..\include” with “$(QTDIR)\include” In: Configuration Properties >Linker > General : Additional Library Directories: I replaced “..\..\lib” with “$(QTDIR)\lib” In: Configuration Properties >Linker > Input: Additional Dependencies: I added “qtxmlrpc.lib” Then i pressed “ok” Then..... Everything is Ok, and the project is building successfully, while instantiating an object from the “xmlrpc::Client” class that comes from the “qtxmlrpc.lib” file! Hurray!!! (… champagne, confetti, etc....) BUT: If I tried to move the project folder somewhere else, it stops compiling, saying that it cant find “../../../moc.exe”.... It’s like whatever I do, the “moc_*.*” files that get’s auto-generated, still look for stuff in the relative way in which it only works if the project is in “...Mudbox\SDK\Examples\"… I went through the entire project properties screen to try to find where It’s defined, and I found squat… I really don’t understand how/where in visual studio this info about the moc build-process is being defined… It’s the reason that in this project I can’t use the Qt-Designer… If anything happens to the currently existing “moc_*.*” files, that get’s re-generated anyways, either by moving the entire project folder somewhere else, or by modifying any moc-related code (signals/slots/Q_OBJECT stuff, or trying to use the Qt-Designer, or changing the file-names from which they are supposedly being generated - the source-files of the turnTable project .cpp/.h files), then all hell brakes loos and the project becomes uncompillable… Please, someone help me with this, it’s ridiculousness the state I’m in, locked into using a project called “turnTable” with files called “turnTable.cpp/.h” and “turnTableDialogue.cpp/.h”, that all has to still be left in the “...\Mudbox2011\SDK\examples” folder (even though it doesn’t source anything relative to that location anymore, AFAIKT...), and not being able to use the Qt-Designer, when if I start a new Qt project, everything works fine… It’s like I just need the specific mudbox-plugin-related definitions of compilation, that are in the turnTable project, and re-use them in a new Qt project, and I’ll be set… Also, I really want to understand what’s going on with this whole moccing process… Any ideas? OooooooK, I again see no replies, but increasing views of this topic… That suggests that there are people trying to do this like me, but are as unsuccessful as me… This means that there really is an issue in the way the documentation of how to go about doing that is highly incomplete… Is autodesk aware of this reality? Anyways, here’s an update: I successfully managed to compile a Qt-Project into a working mudbox-plugin (!) Woohoo! I can now graphically-construct UIs for a mudbox plugin that actually loads and works in mudbox! What I did, is simply meticulously copying-over, page-by-page and line-by-line, all of the project-properties of the turnTable project, while maintaining every seemingly relevant properties regarding the Qt-compilation process… I did that for both the “Debug” as well as the “Release” configurations that target the “x64” platform… I still have no idea what the great majority of these properties even mean, that was a blind copying, but it worked… Now: The still-standing problem I have, is my inability to construct a working “WindowPlugin”. That is to say, I want my UI to be embedded/docked into the native UI of mudbox. This should be accomplished by making the plugin as a window, which is invokable from either the window-menu, of the tab-contextual-popup-menu of either the main-pane, or the properties-pane (like “Layers”, “Community-help”, etc...). Now, according to the SDK’s documentation, the way to do that is by implementing an “interface” (abstract-class) called “Mudbox::WindowPlugin”, in the same way the “Community-help” window is built, as it is a sub-class-instance of the “Browser-Plugin” which is an implementation of this “Mudbox::WindowPlugin” interface. Now, according to the SDK’s documentation, the way to do that is NOT by using the general “MB_PLUGIN” macro decleration, which thereupon requires the use of a call to the “Kernel()->AddCallbackMenuItem” function in order to register it to mudbox’s plugin-repositary and make it available in the plugins menu, but rather the very act of implementing the “Mudbox::WindowPlugin”, would automatically make it available in the “window” menu, as well as the new-tab pop-up menus of the panes. However, it is seemingly too vague in the documentation on how to go about doing that, and in what way should this new WindowPlugin class-implementation be declared/associated into mudbox… I found in the SDK’s documentation the way in which you supposedly can sub-class/instanciate the WindowPlugin-derived WebBrowserPlugin, by using the “Kernel()->RegisterWindowPlugin” function. Needless to say I was unsuccessful at doing neither… Where do I specify the name and title of my WindowPlugin? Do I do it in the class-deceleration? In the Start() function implementation? Do I make a constructor/destructor which for the class, with the constructor having the insertion of name/title as parameters, as it is in the WebBrowserPlugin implementation? How do I associate my WindowPlugin with a name and a title, and how do I register it to the mudbox’s windows pool? Do I really need to use the “Kernel()->RegisterWindowPlugin” function? It expects a WindowPlugin, which I assume by that meaning a class-implementation, but I implement it using “class <className> : public Mudbox::WindowPlugin”, which means it’s a sub-class of it, and I get an error when I try to pass it into the RegisterWindowPlugin function, saying that a “type-casting exists but is inaccessible"… Do I need to pass a class-pointer, a class, an instance of the class or an instance-pointer? Where do I need to place that call? This is all very ambiguous and confusing… Finally, got it figured out (!) :buttrock: No thanks to any of you guys! :hmm: I’m talking to myself here.... Is that healthy? :argh: Anyways, as it turns out, you DO still have to use the MB_PLUGIN macro… Just give it a function that contains the registration call: “Kernel()->RegisterWindowPlugin()”. Then, all you have to do, is re-implement every virtual-function, most of the time doing nothing in there… I also included in the implemented-class a constructor which takes a name and title (as QString) and puts them in it’s protected variables, and an empty destructor. Word of caution: In the IsEnabled() implementation, I tried to query my widget-object for IT’s IsEnabled() function, but it caused Mudbox to crash on that line, saying something about illegal-access or something… So I just returned “true” there.. Also, in the Stop() implementation, I tried to do a Close() or a “delete” on the widget-object, and in both-cases Mudbox crashed with an error upon exiting… So I left it empty also… Here is my code: PipelineToolBox.h: #if defined(JAMBUILD) #include <Mudbox/mudbox.h> #else #if defined __APPLE__ #include "Mudbox/mudbox.h" #else #include <Mudbox/mudbox.h> #endif #endif #include "PipelineToolBoxDialog.h" PipelineToolBox.cpp: #include "PipelineToolBox.h" #include "PipelineToolBoxDialog.h" All the UI stuff is being done in the “PipelineToolBoxDialog” files, which include the whole QT moc_ stuff the and .ui file, which enables the usage of Qt-Designer and Qt-Resources. Here is how the test-UI looks in Qt-Designer: Here is how it looks in Mudbox in the properties pane: And, yes - It does add it automatically both to all the right-click context-popup-menus, as well as to the Windows menu, so you can also place it in the main mudbox pane: So, I hope this helps anyone else, it sure as hell would have helped me if I had read such kind of a post a week ago… nJoy! Ah, and F&@# AUTODESK! Mudbox has one of the lousiest SDK-documentation I’ve seen yet! Just had to put that one outta the way… Well done man, its nice to know SOMEONE is playing with the SDK. I wish I knew anything about programming. Well done, I have no even looked at the SDK for Mud so thanks for talking to your self inthis thread. Im sure that it will inspire others to dig in. Paul Neale PEN Productions Inc. penproductions.ca / paulneale.com Master Classes for Max, Mudbox and Composite DotNet Tutorials MX Driver Car and Trailer Rig On Sale! What do you have planned up your sleeve ? :) I’m still learning programming syntax, not even close to touching a SDK, yet. Donno how much I can say, but we’re expanding out pipeline’ed version-control system to include support for other software then just the main 3d-package.
http://area.autodesk.com/forum/autodesk-mudbox/community-help/compiling-qt-plugins-using-the-sdk/
crawl-003
en
refinedweb
JSF 2.0: Writing fully reusable Spinner Component In my previous blog postings, I talked about making the Spinner component, and then added styles via an external css file. Please review those first, if you haven't looked at them yet. This time, we'll move the JavaScript out to a separate file, and make sure that we can execute multiple spinners in a page, like this: <pre> <ez:spinner <ez:spinner </pre> Now, we've changed the implementation of the component to this (I've marked the parts we'll discuss in bold): <pre> <composite:implementation> <h:outputStylesheet <h:outputScript <b><h:outputScript</b> <script type="text/javascript"> <b>init("#{compositeComponent.clientId}","#{compositeComponent.attrs.increment}");</b> </script> <h:inputText <h:panelGroup <h:commandButton id="forward" value="&#652;" styleClass="spinnerButton" <b>onclick="return changeNumber('#{compositeComponent.clientId}',1);"</b> /> <h:commandButton id="back" value="v" styleClass="spinnerButton" <b>onclick="return changeNumber('#{compositeComponent.clientId}',-1);"</b> /> </h:panelGroup> </composite:implementation> </pre> Going through the important bits of this file, we have: - A call to load an external javascript file - A function invocation of an init function, passing two values that will be substituted in at the time the page is sent to the client. Note that, as in the previous example, I've wrapped these values in quotation marks, since they're really just text in a page. - And lastly, we have two onclick handlers, both of which call another function, passing in the clientId of the component, as well as what direction the spinner should turn. Again, the clientId of the component is substituted at the time the page is sent to the browser, so the Javascript never actually sees the EL, just text on a page. Now, we'll take a look at that external JavaScript code. <pre> if (!window["spinnerIncrement"]) { var spinnerIncrement = {}; } function init(componentID, increment) { spinnerIncrement[componentID] = Number(increment); if (isNaN(spinnerIncrement[componentID]) || spinnerIncrement[componentID] == 0 ) { spinnerIncrement[componentID]= 1; } } function changeNumber(componentID, amount) { var entry = document.getElementById(componentID+":"+"number"); var val = Number(entry.value); if (isNaN(val)) { val = 0; } entry.value = val + (amount * spinnerIncrement[componentID]); return false; } </pre> So, why do we do all this odd looking componentID passing? Because we want this file to be used by multiple components - and that means setting up some sort of namespace to store variables for each component. The way I'm showing here is just one possible way, but it works with a fairly short number of lines. Let go through the logic: - First, we check if spinnerIncrement exists, and create it if it does not. - Then, in init, we associate the value of the increment with the componentID of each component. Init will be called once per component, as we saw above. - Lastly, for each onclick, we modify the value of the text input field, as we've done in the prior two Spinner examples. The only difference is that we're now aware of the componentID of the calling component, and we're using it as a context for all our persistent variables. Again, a simple trick, and now you can use multiple ajax aware components in a page. As always, questions welcome - and remember, you can try these examples out in the new Glassfish v3 prelude release, if you use JSF 2.0. I'll continue to build on these examples in future blogs, but for now, I think we've taken the spinner component about as far as it can go. - Login or register to post comments - Printer-friendly version - driscoll's blog - 1385 reads by driscoll - 2008-11-21 11:18JSF 2.0 will be available when Java EE 6 is available - which should be sometime around JavaOne, though the exact date isn't set in stone. Is it possible to change a by gfalco - 2010-06-12 16:01Is it possible to use a h:outputlabel instead of an h:inputText? If no, why? thanks in advance.. by vmunhoz - 2008-11-21 10:12Congrats! Any prevision about when JSF is plain to use in production development? by vladperl - 2008-11-17 09:46What about situation when I need to change something inside the item located in h:dataTable. h:dataTable .... h:inputText If I changed copayAmount in row of datable how to update related value on server side without refreshing whole dataTable? Thank you by rahul_maha - 2008-11-16 01:14Hi Good example and great work!. I cannot see AJAX in this example? RichFaces has a very strong and mature library Ajax4Jsf, I hope all that will be harvested and still work with JSF 2.0. Can you put some lines on Ajax examples, how Ajax4Jsf and other open source projects are being integrated or will get compatibe/interoperable in JSF 2.0 by dumbuzz - 2008-11-14 04:33"the implementation keeps track of whether that tag's been called before" Thanks for answer. I'll try to find how this magic works in sources of jsf2.0 by driscoll - 2008-11-13 10:08Remember that h:outputScript tag? It's not just there because JSF enjoys decorating every portion of the page :-) In the case of the h:outputScript tag, as well as the h:ouputStylesheet tag, the implementation keeps track of whether that tag's been called before. If it has, there's no need to output it a second time. So you'll have one call to script type="text/javascript" src="/basic-ezcomp/javax.faces.resource/spinner/spinner.js.jsf" and two calls to init in the page. The text decoration around the spinner.js file name comes from it being put in the resources directory, as with the css file. by dumbuzz - 2008-11-13 08:28Assume, I have two or more spinner components on page. How JSF achieves, that script "spinner/spinner.js", will not be added two or more times in the resulting rendered output?
http://weblogs.java.net/blog/driscoll/archive/2008/11/jsf_20_writing_2.html
crawl-003
en
refinedweb
JSF 2.0: Writing a Spinner component In a previous posting, I described the basic structure of a JSF 2.0 composite component. Here's a slightly more complex example of writing a component using JSF 2.0's Composite Component feature. The Spinner component takes only 30 lines to create the classic "entry field with buttons" spinner as a component you can use in any JSF page. First a description of what a "Spinner" is, in case you've never heard that name before. Put simply, it's an input field, allowing you to type in (typically numeric) data, with a set of buttons to one side that let you increment that data with a button push. In our example, we'll have an input field with four buttons arranged horizontally to it's right. A better configuration would be to have the buttons vertical - but that will require a bit of css magic, so we'll leave that for another time. Today, we'll just discuss the basic logic of the component, we'll make it pretty in a future post. So, without further introduction, here's the 30 lines you need to make a Spinner. I'll fill you in on what's happening in each line afterward. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns="" xmlns: <head/> <body> <composite:interface> <composite:attribute <composite:attribute </composite:interface> <composite:implementation> <h:inputText <h:commandButton <h:commandButton <h:commandButton <h:commandButton <script type="text/javascript"> function changeNumber(amount) { var increment = Number("#{cc.attrs.increment}"); if (isNaN(increment) || increment == 0 ) { increment = 1; } var entry = document.getElementById("#{cc.clientId}"+":"+"number"); entry.value = Number(entry.value) + (amount * increment); return false; } </script> </composite:implementation> </body> </html> We'll go through this line by line: Doctype and namespace declarations are unsurprising, just be sure to declare the "composite" namespace, as well as any other namespace that you'll need for the components that you use (we need the core html namespace "h", so we declare that too. Next, we declare the interface of the component: in other words, the arguments you pass to it as attributes. We declare two: value, which will act just like the value in a an inputText tag, and increment, which will be an optional attribute that specifies how much the value changes when we press the buttons. After that, we have the implementation section: This is the part that will be output into the using page, in a template-like fashion. For us, it's essentially in two parts - the JSF components, and a little bit of JavaScript that they invoke. The components are just standard JSF components, used in standard ways - one thing to note is that the inputText has a value which is set to an EL expression value="#{cc.attrs.value}" . As in my previous example, this just resolves to whatever is passed to the component's tag's value attribute. Since this is an input text, that value expression needs to be writable, so we'd call this tag with code that looked like: <ez:spinner Where number is a bean that has both setNumber and getNumber methods. The buttons are typical JSF buttons that call Javascript. Since the Javascript function they call returns false, they never submit anything to the server- they just change the value of the inputText field with Javascript. The Javascript itself has a couple of bits that are specific to this being inside a component: The first is this line: var increment = Number("#{cc.attrs.increment}"); As you can see, we got EL right in the Javascript code. This EL substitutes out at runtime into the value of the increment attribute for the spinner tag. We wrap it in quotes and cast it to a number just to be safe, then test it. If it's not a valid entry, we'll use a default value. The next interesting line is: var entry = document.getElementById("#{cc.clientId}"+":"+"number"); One of the trickier parts of using Javascript inside composite components is the fact that id values are dyamically generated at runtime - as they must be, since we may have this code more than once in the page. Dynamically created id's are the only way to make sure that the id's are unique in the page. So, we need to determine the id of any component we act on in a similar dynamic manner. The clientId will be set to the id of the component at runtime, and it will prepend all the id's that you assign subcomponents, with a separator character in between. In the current implementation, ":" will always be that separator character, but for FCS, we'll have to determine that dynamically too. Lastly, here's how to use this component in a page (just as a reminder): - Put a reference to the composite component in your page - xmlns:ez="" - Name your file as resources/spinner/spinner.xhtml - Use a tag that looks like:<ez:spinner And that's all. Please feel free to ask questions... more examples to come. - Login or register to post comments - Printer-friendly version - driscoll's blog - 13281 reads by driscoll - 2008-11-11 09:43If you have several spinners, then this will not work. Why? Because you're using the same function name, even though it's declared multiple times. I'm going to talk about how to program for multiple components on a page with javascript in my next blog post. I left that out because, frankly, it gets complicated - which isn't the fault of the component design process, but simply a side effect of how the web deals with data. by cdanielw - 2008-11-11 05:01What if you have several spinners with different increment on the same page? by driscoll - 2008-11-09 16:13I'll cover those questions in future blog postings - I'm trying to keep the examples to bite -sized pieces. In the meantime, if you want to skip ahead, you can go to the Project Mojarra codebase, and look under jsf-demo/ezcomp00 for an example that does a *lot* of stuff. There's also basic-ezcomp and basic-ajax for the examples I've already covered. by rahul_maha - 2008-11-09 00:26Great work!! That's easy. 1. If custom component has to also do validation or wants to have some actionListner registered, will that be on same lines (like value and increment attributes)? OR somewhat different 2. What if we want to bundle js and images and css in seprate files and distribute, how will that be done> I think this all is going to get v easy now. by gprajeesh - 2009-06-04 11:16Hi Jim, I figured out the problem as I have to change all "#{compositeComponent}" with "#{cc} So it will be "#{cc.clientId}" instead of "#{compositeComponent.clientId} Thanks by gprajeesh - 2009-06-04 09:02Hi, I was trying to run the sample spinner application. I am getting "" for #{compositeComponent.clientId} Coz of this I am not able to run the application. I am using GlassFish v3 with JSF 2.0 BETA1. Could you please tell me why it is getting blank value? Is it a Bug? Regards -Prajeesh Nair
http://weblogs.java.net/blog/driscoll/archive/2008/11/jsf_20_writing.html
crawl-003
en
refinedweb
IDP(4) BSD Programmer's Manual IDP(4) idp - Xerox Internet Datagram Protocol #include <sys/socket.h> #include <netns/ns.h> #include <netns/idp.h> int socket(AF_NS, SOCK_DGRAM, 0); IDP is a simple, unreliable datagram protocol which is used to support the SOCK_DGRAM abstraction for the Internet protocol family. IDP). Xerox protocols are built vertically on top of IDP. Thus, IDP address formats are identical to those used by SPP. Note that the IDP port space is the same as the SPP port space (i.e. an IDP port may be "connected" to an SPP port, with certain options enabled below). In addition broadcast packets may be sent (assuming the underlying network supports this) by using a reserved "broadcast address"; this address is network interface dependent.. [SO_ALL_PACKETS] When set, this option defeats automatic process- ing of Error packets, and Sequence Protocol pack- ets. [SO_DEFAULT_HEADERS] The user provides the kernel an IDP header, from which it gleans the Packet Type. When requested, the kernel will provide an IDP header, showing the default packet type, and local and foreign addresses, if connected. [SO_HEADERS_ON_INPUT] When set, the first 30 bytes of any data returned from a read or recv from will be the initial 30 bytes of the IDP packet, as described by struct idp { u_short idp_sum; u_short idp_len; u_char idp_tc; u_char idp_pt; struct ns_addr idp_dna; struct ns_addr idp_sna; }; This allows the user to determine the packet type, and whether the packet was a multi-cast packet or directed specifically at the local host. When requested, gives the current state of the option, (NSP_RAWIN or 0). [SO_HEADERS_ON_OUTPUT] When set, the first 30 bytes of any data sent will be the initial 30 bytes of the IDP packet. This allows the user to determine the packet type, and whether the packet should be multi-cast packet or directed specifically at the local host. You can also misrepresent the sender of the packet. When requested, gives the current state of the option. (NSP_RAWOUT or 0). [SO_SEQNO] When requested, this returns a sequence number which is not likely to be repeated until the machine crashes or a very long time has passed. It is useful in constructing Packet Exchange Pro- tocol packets. recv(2), send(2), netintro(4), ns(4) The idp.
http://mirbsd.mirsolutions.de/htman/i386/man4/idp.htm
crawl-003
en
refinedweb
This write up discusses the XMLBean integration with Beehive WSM. I have been working on prototypes to address the issues which I should submit soon. The intention of this write up is to explain the current issues requesting comments, suggestion, and alternatives. The issues discussed here only relates to the Axis integration and is not part of the core WSM. Problem There are currently two existing problems that have been documented in JIRA: To better understand the problems see: For this discussion I use the term Document, Anonymous schema types and User-Derived types that are explained above. There roots of the issues are: a) Axis works well with User-derived types. A document or anonymous types are more than just a type. Additional work has to be done to make a document (or anonymous type) to be used as a type (as viewed by Axis). The current Beehive WSM implementation works with User-Derived types but would have issues with Document and Anonymous types. b) XMLBean objects don’t have a method to get their schema types in XML such that it can be added to a WSDL. Each XML Bean object knows the schema file that was used to generate the type. The schema file is treated as source file and the generated classes are viewed as compiled version of the schema. To move the schema to WSDL, we need to read the XML Schema files, parse it and move the required pieces to the WSDL schema. When copying the schema information there are namespace issues that is common for User-Derived types and Documents. Documents (and Annonymous types) however have additional issues that are discussed below. The goal of my prototype is to solve both of the above issues. Use cases For purpose of this discussion I am going to use the following schema: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema :schema> Compiling this schema with XMLBeans would generate the following classes: PersonDocument PersonDocument.Person (inner class) Address .I would like to be able to write methods: @WebMethod void doFoo1(Address myAddress) @WebMethod void doFoo2(PersonDocument myPerson) @WebMethod void doFoo3(PersonDocument.Person myPerson) @WebMethod void doFoo4(AddressHolder myAddressHolder) @WebMethod void doFoo4(PersonDocumentHolder myPersonHolder) @WebMethod Address doBar1(Address myAddress) @WebMethod Address doBar2(PersonDocument myPerson) @WebMethod Address doBar3(PersonDocument.Person myPerson) @WebMethod Address doBar5 (AddressHolder myAddressHolder) @WebMethod Address doBar4(PersonDocumentHolder myPersonHolder) @WebMethod PersonDocument doFooBar1(Address myAddress) @WebMethod PersonDocument doFooBar2(PersonDocument myPerson) @WebMethod PersonDocument doFooBar3(PersonDocument.Person myPerson) @WebMethod PersonDocument doFooBar5 (AddressHolder myAddressHolder) @WebMethod PersonDocument doFooBar4(PersonDocumentHolder myPersonHolder) The methods that are shown in Bold would work with the current WSM, the rest would not. Note that I would like to be able to use both PersonDocument and PersonDocument.Person in my methods. For now I am assuming the returned values from methods, and holders can only be User-Derived types (Address) or Document types (PersonDocument). Anonymous types (at least for now) can’t (at least for now) be used in holders or as return values. When a Document or Anonymous types is used in the method as in: @WebMethod void doFoo2(PersonDocument myPerson) @WebMethod void doFoo3(PersonDocument.Person myPerson) You may want to use the Document as a document or as a type. For instance, assuming a wrapped web service you may want your message body to look: <doFoo2> <Person> <name>joe</name> <addr> <city>Seattle</city> <zip>98000</zip> <addr> </Person> </doFoo2> Or <doFoo2> <myPerson> <Person> <name>joe</name> <addr> <city>Seattle</city> <zip>98000</zip> <addr> </Person> </myPerson> </doFoo2> In the first case documents are used as documents and in the second case a document is just a type. For my current prototype I am assuming the first case. At some point we should allow the user to select the use case (this can be done with @WebParam). An interesting point to note here is that both methods (doFoo2, doFoo3) would generate the same message and hence identical WSDL, even though the type that is used in the method is different. Issues To support the above uses cases there are issues to be dealt with in: • Service Configuration • Serialization • Deserialization • Invocation • WSDL Generation Each of the issues is discussed below. Service Configuration For method: @WebMethod void doFoo2(PersonDocument myPerson) @WebMethod void doFoo3(PersonDocument.Person myPerson) Axis expects myPerson to be an element of the type PersonDocument. The problem is that our element is Person (rather than myPerson) and our type is an anonymous type. Similar issue exists when the document type is used as return value: @WebMethod PersonDocument doFooBar1(Address myAddress) In this case Axis expects the “return” element to be of the type PersonDocument. Solution: My solution to this problem is to define a virtual type “PersonDocumentType” for the element Person, If WSM recognizes a Document or Annonymous type it would configure the service with the element name of the root of the XMLObject and name the type as “xxxDocumentType”. So the parameter description would look like: javaType = xxxDocument, or xxxDocument.Person QName = qname of the root element of the document typeQName = xxxxDocumentType The “xxxDocumentType” is only used internally; it would not be exposed to the user in WSDL. More on this in WSDL generation issue. The javaType matches the real type of the parameter, more on this in Invocation issue. Serialization/De-serialization We would like to be able to use the Document and the Anonymous class in the methods. However, as far as the type system is concern they have the same XML signature in the message and hence we can only use one of them in type mapping configuration. This is particularly issue for deserializer. Once the QName of the type is recognized, the deserailzer needs to find the appropriate deserializer for it to convert the XML to a java type. Solution - The deserializer would always be configured for the document class with the QName of the root object. One side effect of having only Document type as de-serializer is that we can only use Document types in Holders. For now this should be an acceptable limitation. Axis expects the serializer to write the schema of the type it serializes. This wont work for us; the issue is explained further in the WSDL generation section. The de-serializer must also be intelligent to recognize the difference between User-Derived type and Document types. The user derived types should be de-serialized to XML Fragment where as the Document types should be de-serialized to a XML Document. Invocation . Since the serializer is not aware of the actual java type of the method parameters (it always deserializes to document) before invoking a service method we may need to perform the Document to Anonymous type conversion. Solution In the Axis architecture Providers are responsible for invoking the methods on the service. In our implementation ControlProvider class is configured as the provider for the service. The name ControlProvider is not a appropriate name of this class (BeehiveProvider or similar name would be more appropriate), nevertheless, the provider can and should perform the argument conversions as needed. If a method requires the Anonymous class, then provider must introspect the Document class and call the service with the root object of the document as oppose to the document class. WSDL Generation WSDL generation has to be discussed separately in case of Bare and Wrapped case. Let’s assume I have method: @WebMethod void doFoo2(PersonDocument myPerson) As far as Axis is concern, if the service for above method is a Bare type, the WSDL schema would look like: <wsdl:types> <schema elementFormDefault="qualified" targetNamespace="" xmlns=""> <element name="Person" type="tns1:PersonDocumentType"/> </schema> </wsdl:types> For Wrapped service the WSDL would look like: <wsdl:types> <schema elementFormDefault="qualified" targetNamespace="" xmlns=""> <import namespace=""/> <element name="doFoo2"> <complexType> <sequence> <element name="Person" type="tns1:PersonDocumentType"/> </sequence> </complexType> </element> </schema> </wsdl:types> Notice that in case of Bare there are no method over loading, so there can only be one method with <Person> where as the wrapped case the <Person> element may be used in any number of methods, and hence the <element name=”Person” type=”tns1:PersonDocumentType” /> may be used in any number of types. To the above schema, Axis expects the serializer for the PersonDocumentType to add the schema for the type. This would work fine if the type is the User-Derived type as there is either a simpleType or complexType node in the XML Bean schema of the type. Thus in case of the User-derived types, the serializer can move the schema node form the schema file to the WSDL, but this wont work for the Document and Annonymoyus types. The problems are: • The schema file has the element definition for the “Person” and not the type of the Person, we need to find a way to merge the Person element definition with the partial WSDL that Axis has generated • In case of Bare the element definition is only used once, in case of the Wrapped it is used in multiple places inside complexTypes. Hence the complex types has to be modified to use the schema of the types. Solution To generate the correct WSDL we can let Axis generate its partial WSDL then edit the WSDL and add XMLBean types afterward. This wont be possible to do in the serializer (as is expected in Axis). The Provider on the other hand is in position to solve this issue. To generate WSDL, Axis would go through all the types and generate the WSDL as DOM document and save the WSDL on the message context. Axis would then call on the provider to generate WSDL. In my solution the provider then edits the WSDL with the following rules: a) Parse the DOM node of the WSDL to XMLBean document for the WSDL b) For every “xxx” Document or Annonymous type in the service, remove top level elements such as <element name=”xxx” type=”xxxDocumentType” />. c) For every “xxx” Document or Annonymous type in the service, change every element that is defined as <element name=”xxx” type=”xxxDocumentType” /> to <element ref=”xxx” /> d) Get the schema file for the “xxx” type, parse it with XMLBeans, and add the schema element to the WSDL (in XMLBeans from (a) ) e) Convert the XML Bean WSDL object to DOM node and put it back on the msgContext Note the above processing would only be needed if the service uses an XMLBean type, otherwise, there is nothing to do for the provider. (a) is needed because when we move the schema (in step “d”) we need to make sure the namespaces are copied correctly in the new WSDL. In our example the Schema file for Person would have <xsd:element but “impl:Address” doesn’t make sense in the WSDL file, this must be “tns1:Address” as the WSDL file has different namespace mappings. (b) Is needed to remove the elements that are defined in Bare case. The elements would be copied in step “d”. It would be a NOP in case of Wrapped service. ( c) is needed to fix the wrapped case. Since the schema that is copied (in step “d”) contains the actual “element” definition, the “ref” should be used instead of the element. This would be a NOP in case of Bare service. (d) is used to add the extra elements for the types (e) is needed for Axis serialize the wsdl and send it out. Limitation The solution that I have proposed would have the following limitations: • Holders must use Document type. • Only Document types can be used as method return type. • In case of Bare, either Document or Anonymous type can be used, it would be error to use both types. Future Enhancements • Either fix the above limitation or update the APT process, and model validation to flag the error cases. • Be able to use XMLObject (base class for XMLBean). Essentiality let the service deal with “any” schema. • Allow the user to over write the document processing that I outlined here and use a document just as a type. This could be done with @webparam. For instance, If “name” of the parameter is explicitly set to a name that is other than the root of the document, then use the document as a type. To support both behavior we would need to make changes in the service configuration and WSDL generation logic that is described above, this would not be covered in my prototype.
http://wiki.apache.org/beehive/XmnBeansInWsm
crawl-003
en
refinedweb
Description When entering #!/bin/bash into a code block, MoinMoin does not show the line in the HTML view. Steps to reproduce Create a new page (or edit the SandBox) - Create a new code block containing a sample bash script (for example) - Save and view the page - The hashbang line is not rendered in the HTML I expect to see the #!/bin/bash Example This isn't showing the #!/bin/bash line. echo foobar Nor does this show the #!/usr/bin/env python line. def foo: bar This does as the formatter doesn't think that this is a formatting line. - #!/bin/bash echo foobar Component selection - general - formatter Details This Wiki. Workaround Add something else on the line preceeding #!/bin/bash Or apply this HORRIBLE patch (against 1.6.3): --- formatter/__init__.py-orig 2008-07-23 19:07:03.000000000 +0100 +++ formatter/__init__.py-new 2008-07-23 19:06:12.000000000 +0100 @@ -317,6 +317,8 @@ return self.text(errmsg) def _get_bang_args(self, line): + if line.startswith('#!/'): + return None if line.startswith('#!'): try: name, args = line[2:].split(None, 1) Discussion The parser successfully negotiates that the content type should be 'text', but the formatter removes the line if it begins with '#!'. Since many wiki's probably are used for code snippets, these lines are probably missing. It doesn't seem to affect the version of MoinMoin running at though... (1.5.9) if your stuff begins with #! and you want to see that as content (or it is not meant as parser format spec for moin), you have to add another #! line specifying the parser you want to use: {{{ #!python #!/usr/bin/env python def foo: bar }}} Renders as: Plan - Priority: - Assigned to: - Status:
http://www.moinmo.in/MoinMoinBugs/ParserDoesNotShowHashBangSlash
crawl-003
en
refinedweb
posix_trace_get_attr, posix_trace_get_status - retrieve the trace attributes or trace status (TRACING) Synopsis Description Return Value Errors Examples Application Usage Rationale Future Directions See Also #include <trace.h> int posix_trace_get_attr(trace_id_t trid, trace_attr_t *attr); int posix_trace_get_status(trace_id_t trid, struct posix_trace_status_info *statusinfo); The posix_trace_get_attr() function shall copy the attributes of the active trace stream identified by trid into the object pointed to by the attr argument. If the Trace Log option is supported, trid may represent a pre-recorded trace log.: Upon successful completion, these functions shall return a value of zero. Otherwise, they shall return the corresponding error number. The posix_trace_get_attr() function stores the trace attributes in the object pointed to by attr, if successful. The posix_trace_get_status() function stores the trace status in the object pointed to by statusinfo, if successful. These functions shall fail if:The following sections are informative. None. None. None. None. posix_trace_attr_destroy() , posix_trace_attr_init() , posix_trace_create() , posix_trace .
http://www.squarebox.co.uk/cgi-squarebox/manServer/usr/share/man/man3p/posix_trace_get_status.3p
crawl-003
en
refinedweb
I have a virtualbox machine running Ubuntu Server 10.04LTS. My intention is to this machine to work like a VPS, this way I can learn and prepare for when I get a VPS service. Apache+mod_wsgi for deploying the Django app seems the right choice to me. I have the domain (marianofalcon.com.ar) but nothing else, no DNS. The problem is that I'm pretty lost with all the deployment stuff. I know how to configure mod_wsgi(with the django.wsgi file) and apache(creating a VirtualHost). Something is missing and I don't know what it is. I think that I lack networking skills ant that's the big problem. Trying to host the app on a virtualbox adds some difficulty because I don't know well what IP to use. This is what I've got: file placed at: /etc/apache2/sites-available: NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin admin@my-domain.com ServerName ServerAlias my-domain.com Alias /media /path/to/my/project/media DocumentRoot /path/to/my/project WSGIScriptAlias / /path/to/your/project/apache/django.wsgi ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost> django.wsgi file: import os, sys wsgi_dir = os.path.abspath(os.path.dirname(__file__)) project_dir = os.path.dirname(wsgi_dir) sys.path.append(project_dir) project_settings = os.path.join(project_dir,'settings') os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() Yes, you need DNS or something local to substitute it if you stay in LAN. Not sure how is your network (at least between host and VM) but it would be easier to have your VM on the same network as you machine (bridged, not NATed). Now you can use the /etc/hosts file on the VM to make it accessible: /etc/hosts 127.0.0.1 localhost.localdomain localhost 192.168.xxx.xxx www For example. If you have public IP and want this to be reached from outside (a real setup), use your registered domain name but you'll need to define at least 2 DNS servers for it (on) and actually have the 2 DNS resolving to your IP. There are free DNS servers or as you have already a ubuntu server on, you can install a DNS server on it, for a single site access it's easy (and good to know! :) ). OBS: to answer when you said that due to it be a VM you are not sure what IP to use: VM or not, it is a server, so you define and fix its IP (hosts file and /etc/network/interfaces or use your DHCP to give it always the same IP) so you (and the network :) ) will always know how to reach it. /etc/network
http://serverfault.com/questions/164515/deploying-a-django-application-in-a-virtual-ubuntu-server
crawl-003
en
refinedweb
Controls the behaviour of vtol_extract_topology. More... #include <vtol_extract_topology.h> Controls the behaviour of vtol_extract_topology. Definition at line 45 of file vtol_extract_topology.h. Construct with the default values for the parameters. The constructor does not take parameters by design. Use the explicit set_* functions to set the parameters you wish to change. This will make code more robust against changes to the code and parameter set, because we don't have a bunch of unnamed arguments to change or worry about. Definition at line 70 of file vtol_extract_topology.h. Definition at line 59 of file vtol_extract_topology.h. The number of pixels used in smoothing. The edgel curves will be smoothed by fitting a line at each edgel point to the num_for_smooth neighbouring edgel points and projecting onto that line. A value of 0 means no smoothing will occur. Default: 0 (no smoothing) Definition at line 56 of file vtol_extract_topology.h.
http://public.kitware.com/vxl/doc/release/contrib/gel/vtol/html/structvtol__extract__topology__params.html
crawl-003
en
refinedweb
A node in the graph of vertices. More... #include <vtol_extract_topology.h> A node in the graph of vertices. The links correspond to edges between the vertices. Each vertex is located at the corner of the pixel. Definition at line 131 of file vtol_extract_topology.h. Create a node for vertex at (i,j). Definition at line 37 of file vtol_extract_topology.cxx. Null index value. A vertex with an index value >= this value does not correspond to a node in the graph. "Processed" index value. This is used to indicate that the boundary edge following went through a vertex. Direction in which we exit the neighbouring node to get back to this node. That is, (this->link)[n].link[ this->back_dir[n] ] == indexof(this). Definition at line 149 of file vtol_extract_topology.h. Edgel chains leading to neighbouring vertices. Definition at line 152 of file vtol_extract_topology.h. Location. Definition at line 137 of file vtol_extract_topology.h. Definition at line 137 of file vtol_extract_topology.h. Neighbouring vertices in the graph. Definition at line 143 of file vtol_extract_topology.h. vtol vertex in pixel coordinates. Definition at line 140 of file vtol_extract_topology.h.
http://public.kitware.com/vxl/doc/release/contrib/gel/vtol/html/structvtol__extract__topology__vertex__node.html
crawl-003
en
refinedweb
java.lang.Object org.jboss.seam.security.crypto.MacBasedPRForg.jboss.seam.security.crypto.MacBasedPRF public class MacBasedPRF Copied from Matthias Gartner's PKCS#5 implementation - see Default PRF implementation based on standard javax.crypt.Mac mechanisms.. protected Mac mac protected int hLen protected String macAlgorithm public MacBasedPRF(String macAlgorithm) macAlgorithm- Mac algorithm to use, i.e. HMacSHA1 or HMacMD5. public MacBasedPRF(String macAlgorithm, String provider) public byte[] doFinal(byte[] M) PRF doFinalin interface PRF M- Input data/message etc. Together with any data supplied during initilization. public int getHLen() PRF getHLenin interface PRF public void init(byte[] P) PRF initin interface PRF P- The password supplied as array of bytes. It is the caller's task to convert String passwords to bytes as appropriate.
http://docs.jboss.org/seam/2.2.0.CR1/api/org/jboss/seam/security/crypto/MacBasedPRF.html
crawl-003
en
refinedweb
java.lang.Object org.jboss.seam.security.crypto.BinToolsorg.jboss.seam.security.crypto.BinTools public class BinTools Copied from Matthias Gartner's PKCS#5 implementation - see Free auxiliary functions. static final String hex public BinTools() public static String bin2hex(byte[] b) b- Input bytes. May be null. nullinput. public static byte[] hex2bin(String s) s- String containing hexadecimal digits. May be null. On odd length leading zero will be assumed. null. IllegalArgumentException- when string contains non-hex character public static int hex2bin(char c) c- 0-9, a-f, A-F allowd. IllegalArgumentException- on non-hex character
http://docs.jboss.org/seam/2.2.0.CR1/api/org/jboss/seam/security/crypto/BinTools.html
crawl-003
en
refinedweb
import "go.mongodb.org/mongo-driver/internal/testutil" AddCompressorToUri checks for the environment variable indicating that the tests are being run with compression enabled. If so, it returns a new URI with the necessary configuration AddOptionsToURI appends connection string options to a URI. AddTLSConfigToURI checks for the environmental variable indicating that the tests are being run on an SSL-enabled server, and if so, returns a new URI with the necessary configuration. AutoCreateIndexes creates an index in the test cluster. AutoDropCollection drops the collection in the test cluster. func AutoInsertDocs(t *testing.T, writeConcern *writeconcern.WriteConcern, docs ...bsoncore.Document) AutoInsertDocs inserts the docs into the test cluster. ColName gets a collection name that should be unique to the currently executing test. compareVersions compares two version number strings (i.e. positive integers separated by periods). Comparisons are done to the lesser precision of the two versions. For example, 3.2 is considered equal to 3.2.11, whereas 3.2.0 is considered less than 3.2.11. Returns a positive int if version1 is greater than version2, a negative int if version1 is less than version2, and 0 if version1 is equal to version2. func ConnString(t *testing.T) connstring.ConnString ConnString gets the globally configured connection string. DBName gets the globally configured database name. DisableMaxTimeFailPoint turns off the max time fail point in the test cluster. DropCollection drops the collection in the test cluster. EnableMaxTimeFailPoint turns on the max time fail point in the test cluster. func GetConnString() (connstring.ConnString, error) func GetDBName(cs connstring.ConnString) string GlobalMonitoredSessionPool returns the globally configured session pool. Must be called after GlobalMonitoredTopology() GlobalMonitoredTopology gets the globally configured topology and attaches a command monitor. func InsertDocs(t *testing.T, dbname, colname string, writeConcern *writeconcern.WriteConcern, docs ...bsoncore.Document) InsertDocs inserts the docs into the test cluster. Integration should be called at the beginning of integration tests to ensure that they are skipped if integration testing is turned off. func MonitoredTopology(t *testing.T, dbName string, monitor *event.CommandMonitor) *topology.Topology MonitoredTopology returns a new topology with the command monitor attached func RunCommand(t *testing.T, s *topology.Server, db string, cmd bsoncore.Document) (bsoncore.Document, error) RunCommand runs an arbitrary command on a given database of target server SessionPool gets the globally configured session pool. Must be called after Topology(). Topology gets the globally configured topology. func TopologyWithConnString(t *testing.T, cs connstring.ConnString) *topology.Topology TopologyWithConnString takes a connection string and returns a connected topology, or else bails out of testing Package testutil imports 19 packages (graph) and is imported by 1 packages. Updated 2019-10-10. Refresh now. Tools for package owners.
https://godoc.org/go.mongodb.org/mongo-driver/internal/testutil
CC-MAIN-2019-51
en
refinedweb
In my usual roundup, let's have a quick look at what's new an noteworthy for JET Custom Component Authors in JET 6.0.0 which was released recently. If you read the documentation and have a look at the cookbook, you'll notice that there is a subtle re-naming operation slowly taking place. We're talking less about "CCA" and more about Custom Web Components in those places. There is nothing to worry about here though, they are both the same thing, but we're just switching to use the more industry standard term to refer to the custom components that you create (Yes you are creating real Web Components). Throughout my blog articles I'm sure I'll slip up from time to time and revert to using CCA (because it shorter!), but I'll do my best... A subtle but valuable change has occurred in what happens when you do an ojet build or ojet serve command on a project that includes Custom Web Components. As you will know, if you use the ojet create component command your new component will be created in the /src/js/jet-composites folder, this has not changed, but two slightly different things happen when you deploy: So what does this mean to you? Well the major point is that when you consume a component in a view, in your define() block, rather than referring to the component by an absolute path e.g. jet-composites/demo-comp/loader, instead you can just use the path with the same name as the component e.g. simply demo-comp/loader. Over time this will be a good thing because it will allow you to carry out tasks such as bundling, or deploying your components to a CDN and not have to touch any of your code that relies on that component because all you will have to do is to tweak the RequireJS path for "demo-comp" (in this example). The final topic to discuss for the 6.0.0 release is a change you will see in the loader script generated for you by the ojet create component command. In earlier versions you'll be familiar with loaders that look very much like this: define([ 'ojs/ojcore', './viewModel', 'text!./component.json', 'text!./view.html', 'css!./styles', 'ojs/ojcomposite' ], function ( oj, viewModel, metadata, view) { 'use strict'; oj.Composite.register('demo-comp', { view: view, viewModel: viewModel, metadata: JSON.parse(metadata) }); } ); Whereas in 6.0.0 and above you will see this, with the ojs/Composite class now "in charge" so to speak and no need to import ojcore: define([ 'ojs/ojcomposite', './viewModel', 'text!./component.json', 'text!./view.html', 'css!./styles' ], function ( Composite, viewModel, metadata, view) { 'use strict'; Composite.register('demo-comp', { view: view, viewModel: viewModel, metadata: JSON.parse(metadata) }); } ); This change is part of a larger simplification / cleanup that you'll see over the next few releases to remove the need to use the oj. namespace as a root to access everything. Both forms still work, and if you want your components to be compatible with older versions of JET then you can revert to the pre-6.0.0 format without a problem. Tis is particularly important if you are creating components for versions of Visual Builder Cloud Service that are using these earlier versions of JET. If you've just arrived at Custom JET Components and would like to learn more, then you can access the whole series of articles on the topic from the Custom JET Component Architecture Learning Path
https://blogs.oracle.com/groundside/jet-600-notes-for-component-authors
CC-MAIN-2019-51
en
refinedweb
Sounds like fun :-p Thanks! Type: Posts; User: crepincdotcom Sounds like fun :-p Thanks! Greetings, Back many years ago, I figured out how to control the pins of a serial port independently under Win98 in VB6. IE, rather than writing data to the port, I could set two of the pins low... is -Wall like "use strict;" in perl then? ahhhh you guys are great. I removed the time() call... I knew it was something stupid. Thanks again, Hey all, I can't for the life of me figure out why this is segfaulting... sorry to bother you all with such a lame question. Here's the source: #include <stdlib.h> #include <stdio.h>... (disregard this... browser issue) Yes.... but I threw a few more tableouts() in there.... I'll keep working on it. I know gcc is a good compiler, so globals in general are not bad, is that correct? It's an error on my part somewhere? I've debugged like crazy: it goes in one way, comes out a bit different... And... I just did a logical run through and some debug strings and that var seems to be ok... Thanks for the idea though, I should have thought of lint. Hello all, I'm writting (have written...) a program that uses genetic algorithms to solve the Travelling Salesman Problem. (Search google if the idea of the interests you). I hate to post a whole... Hello, I have an array, declared as such: double a[8]; a[0] through a[7] contain numbers that I would like to sort. Were this simply the issue, I'm sure I could find a function on Google. But... I was talking to a math major at MIT the other day, he had an intersting scope on this. As N approches infinity, Vn being the Nth term, Vn / V(n-1) becomes (1+ sqrt(5))/2. That is, the ratio between... OK, but I'm not searching for a particular starting string, I'm searching for only second occurences of groups already present. Running through every 2-char combo would be a little inefficient... ... Thanks all... I think I'll go cry now. Just kidding, but my code is pretty bad isn't it. Dave_Sinkula, your code is very pretty and I will test it tonight. But your use of pointers and (not... Dave, the formula I provided is not the proper one. It is correctly inplemented in the code, I check that many times over. The line double top=0; Does that need to be double top=0.0; ... :mad: I've got this one little function that calculates standard deviation. All the separate peices work, but together it blows up. I simply cannot figure out why. I'm trying to get this... But a managed switch can be changed to allow a larger MTU. Nevermind I found it, Thanks Jez, I don't have to define a window or anything? -Jack Carrozzo The network stack takes care of frame size for you. If you allow jumbo frames, as root type: ifconfig eth0 mtu 9000 Remember that only other computers with jumbos enable can receve what you... Hello, I've written a math code that does some pretty things, and outputs its data in a text file. Id like to now write a visualizer. Thus, I would simply read through my file, and have an array,... So to recap, if I simply use a double rather than float it should work? Sorry to not have figured this out myself. Thanks guys, interesting discussion too ;-)
https://cboard.cprogramming.com/search.php?s=09b7b041a5bdab4c3202f23e13414453&searchid=2221931
CC-MAIN-2019-51
en
refinedweb
The Josephus problem (or Josephus permutation) is a theoretical problem related to a certain counting-out game. You may also like to read Solving Josephus problem using PHP People are standing in a circle waiting to be executed. Counting begins at a specified point in the circle and proceeds around the circle in a specified direction. After a specified number of people are skipped, the next person is executed. The procedure is repeated with the remaining people, starting with the next person, going in the same direction and skipping the same number of people, until only one person remains, and is freed. For more information you can read /> The source code example is given below package com.test; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; public class JosephProblem { public static void main(String[] args) { int winner = joseph(5, 3); System.out.println("winner is " + winner); winner = joseph(10, 3); System.out.println("winner is " + winner); winner = joseph(5, 2); System.out.println("winner is " + winner); winner = joseph(7, 3); System.out.println("winner is " + winner); } public static int joseph(int noOfPeople, int remPosition) { int tempPos = remPosition - 1; int[] people = new int[noOfPeople]; for (int i = 0; i < noOfPeople; i++) { people[i] = i + 1; } int iteration = noOfPeople - 1; List<Integer> list = IntStream.of(people).boxed().collect(Collectors.toList()); while (iteration > 0) { list.remove(tempPos); tempPos += remPosition - 1; if (tempPos > list.size() - 1) { tempPos = tempPos % list.size(); } iteration--; } return list.get(0); } }.
https://www.roytuts.com/solving-josephus-problem-using-java/
CC-MAIN-2019-51
en
refinedweb
Introduction Deep Learning at scale is disrupting many industries by creating chatbots and bots never seen before. On the other hand, a person just starting out on Deep Learning would read about Basics of Neural Networks and its various architectures like CNN and RNN. But there seems like a big jump from the simple concepts to industrial applications of Deep Learning. Concepts such as Batch Normalization, Dropout and Attention are almost a requirement to know in building deep learning applications. In this article, we will cover two important concepts used in the current state of the art applications in Speech Recognition and Natural Language Processing – viz Sequence to Sequence modelling and Attention models. Just to give you a sneak peek of the potential application of these two techniques – Baidu’s AI system uses them to clone your voice It replicates a persons voice by understanding his voice in just three seconds of training.You can check out some audio samples provided by Baidu’s Research team which consist of original and synthesized voices. Note: This article assumes that you already are comfortable with basics of Deep Learning and have built RNN models. If you want a refresher, you can go through these articles first: - Fundamentals of Deep Learning – Starting with Artificial Neural Network - Fundamentals of Deep Learning – Introduction to Recurrent Neural Networks Table of Contents - Problem Formulation for Sequence to Sequence modelling - A glance of Sequence to Sequence modelling technique - Improving the performance of seq2seq – Beam Search and Attention models - Hands-on view of Sequence to Sequence modelling Problem Formulation for Sequence to Sequence modelling We know that to solve sequence modelling problems, Recurrent Neural Networks is our go-to architecture. Let’s take an example of a Question Answering System to understand what a sequence modelling problem looks like. Suppose you have a series of statements: Joe went to the kitchen. Fred went to the kitchen. Joe picked up the milk. Joe travelled to the office. Joe left the milk. Joe went to the bathroom. And you have been asked the below question: Where was Joe before the office? The appropriate answer would be “kitchen”. A quick glance makes this seem like a simple problem. But to understand the complexity – there are two dimensions which the system has to understand: - The underlying working of the English language and the sequence of characters/words which make up the sentence - The sequence of events which revolve around the people mentioned in the statements This can be considered as a sequence modelling problem, as understanding the sequence is important to make any prediction around it. There are many such scenarios of sequence modelling problems, which are summarised in the image below. The example given above is a many input – one output problem (If you consider a word as a single output). A special class of these problems is called a sequence to sequence modelling problem, where the input as well as the output are a sequence. Examples of sequence to sequence problems can be: 1. Machine Translation – An artificial system which translates a sentence from one language to the other. 2. Video Captioning – Automatically creating the subtitles of a video for each frame, including a description of the sound cues (such as machinery starting up, people laughing in the background, etc.). A glance of Sequence to Sequence modelling technique A typical sequence to sequence model has two parts – an encoder and a decoder. Both the parts are practically two different neural network models combined into one giant network. Broadly, the task of an encoder network is to understand the input sequence, and create a smaller dimensional representation of it. This representation is then forwarded to a decoder network which generates a sequence of its own that represents the output. Let’s take an example of a conversational agent to understand the concept. Source: In the image given above, the input sequence is “How are you”. So when such an input sequence is passed though the encoder-decoder network consisting of LSTM blocks (a type of RNN architecture), the decoder generates words one by one in each time step of the decoder’s iteration. After one whole iteration, the output sequence generated is “I am fine”. Improving the performance of models – Beam Search and Attention mechanism A sequence to sequence modelling network should not be used out of the box. It still needs a bit of tuning to squeeze out the best performance out there to meet expectations. Below are two techniques which have proven to be useful in the past in sequence to sequence modelling applications. - Beam Search - Attention mechanism Beam Search As we saw before, the decoder network generates the probability of occurrence of a word in the sequence. At each time step, the decoder has to make a decision as to what the next word would be in the sequence. One way to make a decision would be to greedily find out the most probable word at each time step. For example, if the input sequence was “Who does John like?”, there could be many sentences that can be generated by a single decoder network in multiple iterations, making a tree like structure of sentences as shown above. The greedy way would be to pick a word with the greatest probability at each time step. What if it comes out to be, “likes Mary John”? This does not necessarily give us the sentence with the highest combined probability. For this, you would have to intelligently sort out the appropriate sequence for the sentence. Beam search takes into account the probability of the next k words in the sequence, and then chooses the proposal with the max combined probability, as seen in the image below: Attention mechanism When a human tries to understand a picture, he/she focuses on specific portions of the image to get the whole essence of the picture. In the same way, we can train an artificial system to focus on particular elements of the image to get the whole “picture”. This is essentially how attention mechanism works. Let’s take an example of an image captioning problem, where the system has to generate a suitable caption for an image. In this scenario, to generate the caption, attention mechanism helps the model to grasp individual parts of the image which are most important at that particular instance. To implement attention mechanism, we take input from each time step of the encoder – but give weightage to the timesteps. The weightage depends on the importance of that time step for the decoder to optimally generate the next word in the sequence, as shown in the image below: Source – Keeping these two techniques in mind, you can then build an end-to-end sequence to sequence model that works wonderfully well. In the next section, we will go through a hands on example of the topics we have learnt and apply it on a real life problem using python. Hands-on view of Sequence to Sequence modelling Let’s look at a simple implementation of sequence to sequence modelling in keras. The task is to translate short English sentences into French sentences, character-by-character using a sequence-to-sequence model. The code for this example can be found on GitHub. The original author of this code is Francois Chollet. For implementation, we will use a dataset consisting of pairs of English sentences and their French translation, which you can download from here (download the file named fra-eng.zip). You also should have keras installed in your system. Here’s a summary of our implementation: 1) Turn the sentences into 3 Numpy arrays, encoder_input_data, decoder_input_data, decoder_target_data: encoder_input_datais a 3D array of shape (num_pairs, max_english_sentence_length, num_english_characters)containing a one-hot vectorization of the English sentences decoder_input_datais a 3D array of shape (num_pairs, max_french_sentence_length, num_french_characters)containing a one-hot vectorization of the French sentences decoder_target_datais the same as decoder_input_databut offset by one timestep. decoder_target_data[:, t, :]will be the same as decoder_input_data[:, t + 1, :] 2) Train a basic LSTM-based Seq2Seq model to predict decoder_target_data given encoder_input_data and decoder_input_data. 3) Decode some sentences to check that the model is working (i.e. turn samples from encoder_input_data into corresponding samples from decoder_target_data). Now let’s have a look at the python code. # import modules. encoder_states = [state_h, state_c] # Set up the decoder, using `encoder_states` as initial state. decoder_inputs = Input(shape=(None, num_decoder_tokens)) # We set up our decoder to return full output sequences, # and to return internal states as well. We don't use the # return states in the training model, but we will use them in inference. decoder_lstm = LSTM(latent_dim, return_sequences=True, return_state=True) decoder_outputs, _, _ = decoder_lstm(decoder_inputs, initial_state=encoder_states) decoder_dense = Dense(num_decoder_tokens, activation='softmax') decoder_outputs = decoder_dense(decoder_outputs) # Define the model that will turn # `encoder_input_data` & `decoder_input_data` into `decoder_target_data` model = Model([encoder_inputs, decoder_inputs], decoder_outputs) # Run training model.compile(optimizer='rmsprop', loss='categorical_crossentropy') model.fit([encoder_input_data, decoder_input_data], decoder_target_data, batch_size=batch_size, epochs=epochs, validation_split=0.2) encoder_model = Model(encoder_inputs, encoder_states) decoder_state_input_h = Input(shape=(latent_dim,)) decoder_state_input_c = Input(shape=(latent_dim,)) decoder_states_inputs = [decoder_state_input_h, decoder_state_input_c] decoder_outputs, state_h, state_c = decoder_lstm( decoder_inputs, initial_state=decoder_states_inputs) decoder_states = [state_h, state_c] decoder_outputs = decoder_dense(decoder_outputs) decoder_model = Model( [decoder_inputs] + decoder_states_inputs, [decoder_outputs] + decoder_states) def decode_sequence(input_seq): # Encode the input as state vectors. states_value = encoder_model.predict(input_seq) # Generate empty target sequence of length 1. target_seq = np.zeros((1, 1, num_decoder_tokens)) # Populate the first character of target sequence with the start character. target_seq[0, 0, target_token_index['\t']] = 1. # Sampling loop for a batch of sequences # (to simplify, here we assume a batch of size 1). stop_condition = False decoded_sentence = '' while not stop_condition: output_tokens, h, c = decoder_model.predict( [target_seq] + states_value) # Sample a token sampled_token_index = np.argmax(output_tokens[0, -1, :]) sampled_char = reverse_target_char_index[sampled_token_index] decoded_sentence += sampled_char # Exit condition: either hit max length # or find stop character. if (sampled_char == '\n' or len(decoded_sentence) > max_decoder_seq_length): stop_condition = True # Update the target sequence (of length 1). target_seq = np.zeros((1, 1, num_decoder_tokens)) target_seq[0, 0, sampled_token_index] = 1. # Update states states_value = [h, c] return decoded_sentence Here is a preview of the output which is generated: Input sentence: Be nice. Decoded sentence: Soyez gentil ! - Input sentence: Drop it! Decoded sentence: Laissez tomber ! - Input sentence: Get out! Decoded sentence: Sortez ! End Notes In this article, we went through a brief overview of sequence to sequence modelling and attention models, two of the most important techniques which are used in state-of-the-art deep learning products focused on natural language and speech processing. There is a lot of scope of applying these models in practical day-to-day life scenarios. If you do try them out, let us know in the comments below! Learn, engage , hack and get hired! You can also read this article on Analytics Vidhya's Android APPYou can also read this article on Analytics Vidhya's Android APP 5 Comments very useful artile Thanks Nandini though it is a short one, informative. Thanks for the info. Thanks Anantha tnx. u made it look very simple and practical.
https://www.analyticsvidhya.com/blog/2018/03/essentials-of-deep-learning-sequence-to-sequence-modelling-with-attention-part-i/
CC-MAIN-2019-51
en
refinedweb
Dalin Nkulu15,587 Points foreach loop challenge: i don't understand the conditional statement in the conditional statement what is the 3 "frog" for me the first "Frog" is the class the second ("frog") act as a counter the third it the object of the class why "frogs.TongueLength" do not work but "frog.TongueLength" will work namespace Treehouse.CodeChallenges { class FrogStats { public static double GetAverageTongueLength(Frog[] frogs) { double average = 0.0; foreach(Frog frog in frogs) { average = frogs.TongueLength; } return average/frogs.Lenght; } } } namespace Treehouse.CodeChallenges { public class Frog { public int TongueLength { get; } public Frog(int tongueLength) { TongueLength = tongueLength; } } } 2 Answers Brendan WhitingFront End Web Development Treehouse Moderator 84,129 Points frog is a variable of type Frog, which is a class that has a TongueLength property. frogs is a variable of type Frog[], a list of frogs. Lists don't have TongueLength, individual frogs in the list do. Try iterating through all the lists and calculating a sum of tongue lengths, and then dividing that sum by the number of frogs in the list. Dalin Nkulu15,587 Points hey Brendan are you on social media? if yes what your handle? Brendan WhitingFront End Web Development Treehouse Moderator 84,129 Points Brendan WhitingFront End Web Development Treehouse Moderator 84,129 Points I'm on LinkedIn
https://teamtreehouse.com/community/foreach-loop-challenge-i-dont-understand-the-conditional-statement
CC-MAIN-2019-51
en
refinedweb
Proposed exercise Create a program to "invert" a file, using a "FileStream":. Output Solution using System; using System.IO; class InverterFileStream { static void Main() { Console.Write("Enter the name: "); string name = Console.ReadLine(); FileStream file = File.OpenRead(name); long size = file.Length; byte[] data = new byte[ size ]; file.Read(data,0,(int)size); file.Close(); FileStream outFile = File.Create(name + ".data"); for (long i = size - 1; i >= 0; i--) outFile.WriteByte( data[i] ); outFile.Close(); } }
https://www.exercisescsharp.com/2013/04/823-invert-binary-file-2.html
CC-MAIN-2019-51
en
refinedweb
- Type: New Feature - Status: Resolved - Priority: Trivial - Resolution: Implemented - Affects Version/s: None - Fix Version/s: None - Component/s: None - Labels:None - Release Note:adds api features to the webapp part of hadoop allowing to retrieve task stats for a given job a rest api that returns a simple JSON containing information about a given job such as: min/max/avg times per task, failed tasks, etc. This would be useful in order to allow external restart or modification of parameters of a run. Attachments - is related to - - MAPREDUCE-679 XML-based metrics as JSP servlet for JobTracker - Closed MAPREDUCE-506 make HistoryViewer a public class. - Resolved
https://issues.apache.org/jira/browse/MAPREDUCE-2818
CC-MAIN-2019-51
en
refinedweb
Fitting with constraints¶ fitting support constraints, however, different fitters support different types of constraints. The supported_constraints attribute shows the type of constraints supported by a specific fitter: >>> from astropy.modeling import fitting >>> fitting.LinearLSQFitter.supported_constraints ['fixed'] >>> fitting.LevMarLSQFitter.supported_constraints ['fixed', 'tied', 'bounds'] >>> fitting.SLSQPLSQFitter.supported_constraints ['bounds', 'eqcons', 'ineqcons', 'fixed', 'tied'] Fixed Parameter Constraint¶ All fitters support fixed (frozen) parameters through the fixed argument to models or setting the fixed attribute directly on a parameter. For linear fitters, freezing a polynomial coefficient means that the corresponding term will be subtracted from the data before fitting a polynomial without that term to the result. For example, fixing c0 in a polynomial model will fit a polynomial with the zero-th order term missing to the data minus that constant. The fixed coefficients and corresponding terms are restored to the fit polynomial and this is the polynomial returned from the fitter: >>> import numpy as np >>> np.random.seed(seed=12345) >>> from astropy.modeling import models, fitting >>> x = np.arange(1, 10, .1) >>> p1 = models.Polynomial1D(2, c0=[1, 1], c1=[2, 2], c2=[3, 3], ... n_models=2) >>> p1 # doctest: +FLOAT_CMP <Polynomial1D(2, c0=[1., 1.], c1=[2., 2.], c2=[3., 3.], n_models=2)> >>> y = p1(x, model_set_axis=False) >>> n = (np.random.randn(y.size)).reshape(y.shape) >>> p1.c0.fixed = True >>> pfit = fitting.LinearLSQFitter() >>> new_model = pfit(p1, x, y + n) # doctest: +IGNORE_WARNINGS >>> print(new_model) # doctest: +SKIP Model: Polynomial1D Inputs: ('x',) Outputs: ('y',) Model set size: 2 Degree: 2 Parameters: c0 c1 c2 --- ------------------ ------------------ 1.0 2.072116176718454 2.99115839177437 1.0 1.9818866652726403 3.0024208951927585 The syntax to fix the same parameter ``c0`` using an argument to the model instead of ``p1.c0.fixed = True`` would be:: >>> p1 = models.Polynomial1D(2, c0=[1, 1], c1=[2, 2], c2=[3, 3], ... n_models=2, fixed={'c0': True}) Bounded Constraints¶ Bounded fitting is supported through the bounds arguments to models or by setting min and max attributes on a parameter. Bounds for the LevMarLSQFitter are always exactly satisfied–if the value of the parameter is outside the fitting interval, it will be reset to the value at the bounds. The SLSQPLSQFitter optimiztion algorithm handles bounds internally. Tied Constraints¶ The tied constraint is often useful with Compound models. In this example we will read a spectrum from a file called spec.txt and fit Gaussians to the lines simultaneously while linking the flux of the OIII_1 and OIII_2 lines. import numpy as np from astropy.io import ascii from astropy.utils.data import get_pkg_data_filename from astropy.modeling import models, fitting fname = get_pkg_data_filename('data/spec.txt', package='astropy.modeling.tests') spec = ascii.read(fname) wave = spec['lambda'] flux = spec['flux'] # Use the rest wavelengths of known lines as initial values for the fit. Hbeta = 4862.721 OIII_1 = 4958.911 OIII_2 = 5008.239 # Create Gaussian1D models for each of the Hbeta and OIII lines. h_beta = models.Gaussian1D(amplitude=34, mean=Hbeta, stddev=5) o3_2 = models.Gaussian1D(amplitude=170, mean=OIII_2, stddev=5) o3_1 = models.Gaussian1D(amplitude=57, mean=OIII_1, stddev=5) # Tie the ratio of the intensity of the two OIII lines. def tie_ampl(model): return model.amplitude_2 / 3.1 o3_1.amplitude.tied = tie_ampl # Also tie the wavelength of the Hbeta line to the OIII wavelength. def tie_wave(model): return model.mean_0 * OIII_1 / Hbeta o3_1.mean.tied = tie_wave # Create a Polynomial model to fit the continuum. mean_flux = flux.mean() cont = np.where(flux > mean_flux, mean_flux, flux) linfitter = fitting.LinearLSQFitter() poly_cont = linfitter(models.Polynomial1D(1), wave, cont) # Create a compound model for the three lines and the continuum. hbeta_combo = h_beta + o3_1 + o3_2 + poly_cont # Fit all lines simultaneously. fitter = fitting.LevMarLSQFitter() fitted_model = fitter(hbeta_combo, wave, flux) fitted_lines = fitted_model(wave) from matplotlib import pyplot as plt fig = plt.figure(figsize=(9, 6)) p = plt.plot(wave, flux, label="data") p = plt.plot(wave, fitted_lines, 'r', label="fit") p = plt.legend() p = plt.xlabel("Wavelength") p = plt.ylabel("Flux") t = plt.text(4800, 70, 'Hbeta', rotation=90) t = plt.text(4900, 100, 'OIII_1', rotation=90) t = plt.text(4950, 180, 'OIII_2', rotation=90) plt.show()
http://docs.astropy.org/en/latest/modeling/example-fitting-constraints.html
CC-MAIN-2019-51
en
refinedweb
12 Hr Binary Clock, Hours and Minutes Only, DS1307 RTC, I2C, Arduino-Nano Introduction: 12 Hr Binary Clock, Hours and Minutes Only, DS1307 RTC, I2C, Arduino-Nano For a while now I have wanted to make a binary clock, but after looking around I decided I wanted something just a bit different. So I decided to only display the hours and minutes and only display a 12 hours clock, this means you only need 3 columns and the pattern of LED’s looks neater. Also with only 11 LED’s you don’t need to multiplex, you can just drive the LEDs on the output pins directly. So with the above in mind I had decided on the design, all I really needed was a suitable case and while I was sat in front of my computer I realised the small speaker would make an idea case. So the basic set up is 11 LED's and resistors linked to a Arduino NANO, a DS1307 RTC connected to the NANO via i2C and then two buttons to adjust the hours and minutes, all fitted into a "dumb" speaker using 5volts supply from the active usb powered speaker. Step 1: The LED Board So to start with I am using 5mm Green LEDS and these along with the resistors are all soldered onto a small piece of breadboard 17 tracks wide by 17 long. The resistors are 470ohm and as you can see in the photos I have soldered 3 on the correct side of the breadboard but the rest of the resistors and the links were soldered onto the track side (the wrong side) Where the legs of the resistors go over other tracks I have covered them using insulation stripped from single core wire. Have a good look at the photos as there are several track breaks under some resistors. All the resistors have a common ground, which means that 3 of the tracks are ground which allows the RTC and Arduino nano to get the ground from the breadboard. I haven’t gone into much detail about the LED board as it’s not too hard to complete, and you may wish to change the spacing. The 11 LEDs connect to pins 2 to 12 on the nano (via a 470ohm resistor) it doesn’t really matter which order you put them as long as you define the order in the sketch. After I had completed the LEDs and resistors and links I soldered on different coloured wires to the edge and then checked each LED worked. Just in case you don't understand Binary clocks, the right column displays the units of minutes (0-9) the middle column displays the tens of minutes (0-5) and the left column displays the hours (1-12). In all cases the bottom LED is worth 1 the second is worth 2 the third 4 and the 4th is worth 8, to get the time you add up all the LED's in the column which are illuminated to give the number. You may have spotted in one of the pictures above that I managed to pick up the wrong value resistor and solder it in place. I spotted it and replaced it as I did the links. Step 2: The Aduino Nano. Once the LED board was complete and checked to be working I Then used foam double sided tape and stuck the Arduino Nano on top of the resistors. Then looped the previously connected wired from the breadboard to the input pins, at this stage I just soldered then all in place neatly not worrying about the pin order, the last connection from the breadboard to the Nano is the ground, again to keep it neat I choose the ground pin next to the digital pin 2. Step 3: RTC DS1307 Connected Via I2C Next to be wired is the RTC module, the Tiny RTC I2C DS1307 Clock Module was brought from Ebay and cost about £1.00. It connects to the nano via i2C on pins A4 and A5 (A5 SCL and A4 SDA). The module also needs a ground and 5volt, the ground was from the breadboard and the 5 volts was from the VCC pin next to A4. The RTC module will be foam tapped to the speaker so the wires are about 5” long. Step 4: Hour and Minute Adjust Buttons. The buttons were what I had laying around, they are a bit too big and I would have preferred black, but that are what I had and as they are mounted on the back it doesn’t really matter. I chose to mount the buttons either side of the cable entry hole. The holes had to be 12mm so I drilled in steps and at 9mm I filed to the correct size aligning the holes so they looked even. All the wires were then connected, the buttons to the nano (via the inline resistors) and the 4 core speaker and USB cable to the relevant connections (ground and “RAW” on the nano) The buttons are single pole, normally open (momentary close). They are wired so they are pulled down to ground via a 10K resistor and set to 5volts when the button is pressed. A 1k resistor is on each input to the nano. I decided to connect the resistors to the wires as shown in the photos, it’s a neat way to connect the switches and as long as you cover the connections with heatshrink you shouldn’t have any problems with shorts. The two buttons connect to A0 and A1 which can be configured to digital by adding 14 to the pin number so pin A0 is 14 and A1 is 15. One button is for the hour adjust and the other for the minutes, each button just adds either a minute or hour to the clock. Step 5: Fitting the Clock Into the Speaker The speaker looked ideal to house the LED’s and as the speakers were amplified I could use the USB voltage to power the clock. However the speaker which has the amplifier and the USB 5 volts didn’t have room for the clock so the “slave” speaker was going to be used to house the clock, I was then going to run an extra pair of wires from the amplified speaker to the slave to supply the 5 volts. I then had a light bulb moment and realised I could use an old USB keyboard cable and replace the existing 2 wire cable. This meant a little more work but I think it was worth it. One thing I will point out is that you should not use a mouse cable as within each core of the 4 wires are fibres of plastic? So it is a bit harder to work with. The keyboard cable is slightly bigger in diameter but the cores don’t have fibres in them and are a bigger diameter. You can see in the photos the 4 connections I made at each end. In one photo you can see the difference in the mouse cable and keyboard cable, the green wire is the mouse cable and has plastic strands in each core, the red wire is from the keyboard and is tinned copper. To mount the LEDs in the slave speaker I firstly masked the front with tape then marked out the 11 holes. Because I have used breadboard the spacing is nice and even with each column 0.5” apart and 0.4” between LEDs in each column. Take care not to get carried away and drill out the middle top LED, as there isn’t an LED in that position! When drilling the masking tape helps to stop the drill bit wondering and if you start with a 2mm drill you can check everything is in line before drilling bigger, and even then I prefer to drill in steps using a 3.3mm drill then lastly 5mm. Step 6: The Arduino NANO Program Explained and Libraries Needed/ The program uses the RTC library and the time library which was downloaded from: Make sure you unzip the libraries into the Arduino/ libraries file. I then programed the binary clock using a simple decimal to binary code. However I had a few problems as the RTC returns a time value in 24 hour format, so to overcome this problem I firstly check if the hours is zero and if it is, set it to 12. Then if the hour’s value is greater than 13 then I subtract 12. That sorts out the 24 hour time. Then we come to setting the time, the hours and minutes are adjusted by adding to the “raw” time code, 60 is added for each minute and 3600 for each hour. if (digitalRead(setM) == HIGH) { unsigned long j = RTC.get(); j = j + 60; RTC.set(j); } if (digitalRead(setH) == HIGH) { unsigned long j = RTC.get(); j = j + 3600; RTC.set(j); } There is a little problem with this code, if you load this code into your Arduino and nothing happens then you may need to set the RTC using the “setTime” sketch in the Sketchbook/libraries/DS1307RTC/setTime file. Once loaded click the serial monitor to check the time is correct, from what I can work out if you buy a new RTC module it needs to be “started” else it won’t be active. Then reload the binaryRTC code again and everything should work. I have listed the code, but please note I am not very good at programming so don’t expect too much! Step 7: The Full Program. #include <Wire.h> #include <Time.h> #include <DS1307RTC.h> const int setH = 14; //button for hour increase const int setM = 15; // button for minute increase const int UnitMin01 = 12; const int UnitMin02 = 9; const int UnitMin04 = 8; const int UnitMin08 = 7; const int UnitTen01 = 2; const int UnitTen02 = 11; const int UnitTen04 = 10; const int UnitHrs01 = 3; const int UnitHrs02 = 4; const int UnitHrs04 = 5; const int UnitHrs08 = 6; void setup() { delay(200); pinMode(setH, INPUT); pinMode(setM, INPUT); pinMode(UnitMin01, OUTPUT); pinMode(UnitMin02, OUTPUT); pinMode(UnitMin04, OUTPUT); pinMode(UnitMin08, OUTPUT); pinMode(UnitTen01, OUTPUT); pinMode(UnitTen02, OUTPUT); pinMode(UnitTen04, OUTPUT); pinMode(UnitHrs01, OUTPUT); pinMode(UnitHrs02, OUTPUT); pinMode(UnitHrs04, OUTPUT); pinMode(UnitHrs08, OUTPUT); } void loop() { tmElements_t tm; if (RTC.read(tm)) { if (digitalRead(setM) == HIGH) { unsigned long j = RTC.get(); j = j + 60; RTC.set(j); } if (digitalRead(setH) == HIGH) { unsigned long j = RTC.get(); j = j + 3600; RTC.set(j); } binaryOutputHours(tm.Hour); binaryOutputMinutes(tm.Minute); } delay(1000); } void binaryOutputHours(int number) { if (number == 0) { number = 12; } if (number >= 13) { number = number - 12; } setBinaryHours(number); } void binaryOutputMinutes(int number) { if (number >= 10) { int tens = number/10; int units = number - (tens*10); setBinaryMins(units); setBinaryTens(tens); } else { int tens = 0; int units = number; setBinaryMins(units); setBinaryTens(tens); } } void setBinaryMins(int units) { if (units >= 8) { digitalWrite(UnitMin08, HIGH); units = units - 8; } else { digitalWrite(UnitMin08, LOW); } if (units >= 4) { digitalWrite(UnitMin04, HIGH); units = units - 4; } else { digitalWrite(UnitMin04, LOW); } if (units >= 2) { digitalWrite(UnitMin02, HIGH); units = units - 2; } else { digitalWrite(UnitMin02, LOW); } if (units >= 1) { digitalWrite(UnitMin01, HIGH); units = units - 1; } else { digitalWrite(UnitMin01, LOW); } } void setBinaryTens(int tens) { if (tens >= 4) { digitalWrite(UnitTen04, HIGH); tens = tens - 4; } else { digitalWrite(UnitTen04, LOW); } if (tens >= 2) { digitalWrite(UnitTen02, HIGH); tens = tens - 2; } else { digitalWrite(UnitTen02, LOW); } if (tens >= 1) { digitalWrite(UnitTen01, HIGH); tens = tens - 1; } else { digitalWrite(UnitTen01, LOW); } } void setBinaryHours(int hours) { if (hours >= 8) { digitalWrite(UnitHrs08, HIGH); hours = hours - 8; } else { digitalWrite(UnitHrs08, LOW); } if (hours >= 4) { digitalWrite(UnitHrs04, HIGH); hours = hours - 4; } else { digitalWrite(UnitHrs04, LOW); } if (hours >= 2) { digitalWrite(UnitHrs02, HIGH); hours = hours - 2; } else { digitalWrite(UnitHrs02, LOW); } if (hours >= 1) { digitalWrite(UnitHrs01, HIGH); hours = hours - 1; } else { digitalWrite(UnitHrs01, LOW); } } Mr_fid Love the clock. Built it on a breadboard. Having problems with code. I would like for you to take a look and see where I'm off. What's a good way to send it to you? I've copied some of the errors for you to get a brief glimpse. C:\User\Snoopy's_blah_blah_blah\documents\arduino\_12_Hr_Binary_Clock\_12_Hr_Binary_Clock.ino: In function 'Void Loop'()': _12_Hr_Binary_Clock:43: Error: 'tmElements_t' was not declared in this scope tmElements_t tm; ^ _12_Hr_Binary_Clock:44: error: 'RTC' was not declared in scope if (RTC.read(tm)) ^ There are more errors than that, but it's a good example to start with. Some of the post talk about the RTC Library. I believe I've installed them in the library correctly. (IDE; Sketch; drop down menu; include library DS1307RTC) (download Zip. IDE; Sketch; drop down menu; Include library; Add .Zip Library) Know it has to be a programing / library issue. The problem is I'm learning this all the hard way. No formal classes or instructors just a few books (Programming Arduino, Simon Monk) Any help would be both great and educational. (chalk one more up for hard knocks) Thanks Thanks for your comments, and hopefully as a bit of encouragement.... this was one of my first programs with the Arduino, and just like you i took the same path learning on my own with the help of Simon Monk's book! And the program is really really bad! (but works) its written in a very poor style! One of my first problems was the libraries, what i did was to get the DS1307RTC library and put the "DS1307RTC" folder into the libraries folder, which should be in the Arduino folder in my Documents. Also another Library is needed, Time should also be added to the librarys folder and can be downloaded from give those two bits a try and in the meantime i am cleanng up this program listing to make it easyer to read. Hello Sir. I've finally got the clock working on the breadboard. Had to do some rewiring (switches) and much reading and studying (in between my farming). Now to finalize it into a permanent container. Thanks so much for making the original and inspiring the rest of us too. I'll post a picture of the final product when it's complete. This looks great! I have a Binary Clock Widget on my phone. How accurate is your clock? Just to update this comment... I have had the clock running for a few weeks now and I can see it gains about 9 seconds day. so when I get a chance I will update the program to subtract 9 seconds each morning? Ha! That's a great soluition! That's a good question, this was the second one I made and as yet I haven't run it for more than one day. However the original unit did lose time. So I was going to keep a note of the new RTC and work out how much the clock loses/gains and change the program so it corrects the clock every day. That's providing it always loses/gains time and not both (if you see what I mean)
http://www.instructables.com/id/12-Hr-Binary-Clock-hours-and-minutes-only-DS1307-R/
CC-MAIN-2017-34
en
refinedweb
Design Pattern - Factory. Implementation We're going to create a Shape interface and concrete classes implementing the Shape interface. A factory class ShapeFactory is defined as a next step. FactoryPatternDemo, our demo class will use ShapeFactory to get a Shape object. It will pass information (CIRCLE / RECTANGLE / SQUARE) to ShapeFactory to get the type of object it needs. Step 1 Create an interface. Shape.java public interface Shape { void draw(); } Step 2 Create concrete classes implementing the same interface. Rectangle.java public class Rectangle implements Shape { @Override public void draw() { System.out.println("Inside Rectangle::draw() method."); } } Square.java public class Square implements Shape { @Override public void draw() { System.out.println("Inside Square::draw() method."); } } Circle.java public class Circle implements Shape { @Override public void draw() { System.out.println("Inside Circle::draw() method."); } } Step 3 Create a Factory to generate object of concrete class based on given information. ShapeFactory.java public class ShapeFactory { //use getShape method to get object of type shape public Shape getShape(String shapeType){ if(shapeType == null){ return null; } if(shapeType.equalsIgnoreCase("CIRCLE")){ return new Circle(); } else if(shapeType.equalsIgnoreCase("RECTANGLE")){ return new Rectangle(); } else if(shapeType.equalsIgnoreCase("SQUARE")){ return new Square(); } return null; } } Step 4 Use the Factory to get object of concrete class by passing an information such as type. FactoryPatternDemo.java public class FactoryPatternDemo { public static void main(String[] args) { ShapeFactory shapeFactory = new ShapeFactory(); //get an object of Circle and call its draw method. Shape shape1 = shapeFactory.getShape("CIRCLE"); //call draw method of Circle shape1.draw(); //get an object of Rectangle and call its draw method. Shape shape2 = shapeFactory.getShape("RECTANGLE"); //call draw method of Rectangle shape2.draw(); //get an object of Square and call its draw method. Shape shape3 = shapeFactory.getShape("SQUARE"); //call draw method of circle shape3.draw(); } } Step 5 Verify the output. Inside Circle::draw() method. Inside Rectangle::draw() method. Inside Square::draw() method.
https://www.tutorialspoint.com/design_pattern/factory_pattern.htm
CC-MAIN-2017-34
en
refinedweb
iOS 10 Video Playback using AVPlayer and AVPlayerViewController Whilst the iPhone 3GS model introduced support for recording videos using the built in camera, all iPhone and iPad models and iOS versions have included support for video playback. Video playback support in iOS is provided by combining the AVFoundation AVPlayer and AVKit AVPlayerViewController classes. This chapter presents an overview of video playback in iOS 10 using these two classes followed by a step by step example. The AVPlayer and AVPlayerViewController Classes The sole purpose of the AVPlayer class is to play media content. An AVPlayer instance is initialized with the URL of the media to be played (either a path to a local file on the device or the URL of network based media). Playback can be directed to a device screen or, in the case of external playback mode, via AirPlay or an HDMI/VGA cable connection to an external screen. The AVKit Player View Controller (AVPlayerViewController) class provides a view controller environment through which AVPlayer video is displayed to the user together with a number of controls that enable the user to manage the playback experience. Playback may also be controlled from within the application code by calling the play and pause methods of the AVPlayer instance. The iOS Movie Player Example Application The objective of the remainder of this chapter is to create a simple application that will play back a video when a button is pressed. The video will be streamed over the internet from a movie file located on a web server. Begin by launching Xcode and creating a new iOS application project based on the Single View Application template configured for the Swift language and Universal devices, naming the product AVPlayerDemo. Adding a Security Exception for an HTTP ConnectionIn iOS 9, Apple tightened the level of security for external resources such as files on remote servers. This is referred to as App Transport Security (ATS) and, by default, access to HTTP resources are now blocked within iOS apps. Wherever possible, therefore, the more secure HTTPS protocol should be used instead of HTTP. In recognition of the fact that not all servers support HTTPS it is possible to add an exception to the Info.plist file of the app project. This can be configured on a general basis or declared for individual domains. To demonstrate this exception process in action, the video file used in this example is stored on an HTTP based web server. To add an exception for this server, locate and select the Info.plist file and set the properties as outlined in the figure below: Figure 93-1 Alternatively, Ctrl-click on the Info.plist file in the Project Navigator panel, select Open As -> Source Code from the resulting menu and enter the following exception settings for the ebookfrenzy.com domain: <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>ebookfrenzy.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSTemporaryExceptionMinimumTLSVersion</key> <string>TLSv1.1</string> </dict> </dict> </dict> Designing the User Interface Select the Main.storyboard file and display the Object Library (View -> Utilities -> Show Object Library). Drag a single Button instance to the view window and change the text on the button to “Play Movie”. With the button selected in the storyboard canvas, display the Auto Layout Align menu and add both horizontal and vertical container constraints to the view with both offset values set to 0. From the Object Library panel, locate the AVKit Player View Controller object and drag and drop it onto the storyboard to the right of the existing view controller. Ctrl-click on the button in the first view controller and drag the resulting line to the AVKit Player View Controller. Release the line and select show from the segue selection menu. On completion of these tasks, the storyboard should resemble that of Figure 93 2: Figure 93-2 Initializing Video Playback When the “Play Movie” button is tapped by the user the application will perform a segue to the AVPlayerViewController scene. Verify that this works by running the application and selecting the button. The AVPlayerViewController will appear and display the video playback controls but as yet no AVPlayer has been configured to play video content. This can be achieved by implementing the prepare(for segue:) method within the ViewController.swift file as follows, the code for which relies on the AVKit and AVFoundation frameworks having been imported: import UIKit import AVKit import AVFoundation class ViewController: UIViewController { . . . override func prepare(for segue: UIStoryboardSegue, sender: Any?) { let destination = segue.destination as! AVPlayerViewController let url = URL(string: "") if let movieURL = url { destination.player = AVPlayer(url: movieURL) } } . . The code in this above method begins by obtaining a reference to the destination view controller, in this case the AVPlayerViewController instance. A URL object is then initialized with the URL of a web based video file. Finally a new AVPlayer instance is created, initialized with the video URL and assigned to the player property of the AVPlayerViewController object. Running the application once again should cause the video to be available for playback within the player view controller scene. Build and Run the Application With the design and coding phases complete, all that remains is to build and run the application. Click on the run button located in the toolbar of the main Xcode project window. Assuming that no errors occur, the application should launch within the iOS Simulator or device. Once loaded, touching the Play Movie button should launch the movie player in full screen mode and playback should automatically begin: Figure 93-3 Creating AVPlayerViewController Instance from Code The example shown in this chapter used storyboard scenes and a transition to display an AVPlayerViewController instance. While this is a quick approach to working with the AVPlayerViewController and AVPlayer classes, the same result may also be achieved directly by writing code within the application. The following code fragment, for example, initializes and plays video within an application using these two classes without the use of a storyboard scene: let player = AVPlayer(url: url!) let playerController = AVPlayerViewController() playerController.player = player self.addChildViewController(playerController) self.view.addSubview(playerController.view) playerController.view.frame = self.view.frame player.play() Summary The basic classes needed to play back video from within an iOS 10 application are provided by the AVFoundation and AVKit frameworks. The purpose of the AVPlayer class is to facilitate the playback of video media files. The AVPlayerViewController class provides a quick and easy way to embed an AVPlayer instance into a view controller environment together with a set of standard on-screen playback controls.
http://www.techotopia.com/index.php/IOS_8_Video_Playback_using_AVPlayer_and_AVPlayerViewController
CC-MAIN-2017-34
en
refinedweb
Configure Recipes Configure recipes are assigned to the layer's Configure lifecycle event, which occurs on all of the stack's instances whenever an instance enters or leaves the online state. You use Configure recipes to adjust an instance's configuration to respond to the change, as appropriate. When you implement a Configure recipe, keep in mind that a stack configuration change might involve instances that have nothing to do with this layer. The recipe must be able to respond appropriately, which might mean doing nothing in some cases. tomcat::configure The tomcat::configure recipe is intended for a layer's Configure lifecycle event. Copy include_recipe 'tomcat::context' # Optional: Trigger a Tomcat restart in case of a configure event, if relevant # settings in custom JSON have changed (e.g. java_opts/JAVA_OPTS): #include_recipe 'tomcat::container_config' The tomcat::configure recipe is basically a metarecipe that runs two dependent recipes. The tomcat::contextrecipe create a web app context configuration file. This file configures the JDBC resources that applications use to communicate with the MySQL instance, as discussed in the next section. Running this recipe in response to a configure event allows the layer to update the web app context configuration file if the database layer has changed. The tomcat::container_configSetup recipe is run again to capture any changes in the container configuration. The include for tomcat::container_config is commented out for this example. If you want to use custom JSON to modify Tomcat settings, you can remove the comment. A Configure lifecycle event then runs tomcat::container_config, which updates the Tomcat related configuration files, as described in tomcat::container_config and restarts the Tomcat service. tomcat::context The Tomcat cookbook enables applications to access a MySQL database server, which can be running on a separate instance, by using a J2EE DataSource object. With Tomcat, you can enable the connection by creating and installing a web app context configuration file for each application. This file defines the relationship between the application and the JDBC resource that the application will use to communicate with the database. For more information, see The Context Container. The tomcat::context recipe's primary purpose is to create this configuration file. Copy include_recipe 'tomcat::service' node[:deploy].each do |application, deploy| context_name = deploy[:document_root].blank? ? application : deploy[:document_root] template "context file for #{application} (context name: #{context_name})" do path ::File.join(node['tomcat']['catalina_base_dir'], 'Catalina', 'localhost', "#{context_name}.xml") source 'webapp_context.xml.erb' owner node['tomcat']['user'] group node['tomcat']['group'] mode 0640 backup false only_if { node['datasources'][context_name] } variables(:resource_name => node['datasources'][context_name], :webapp_name => application) notifies :restart, resources(:service => 'tomcat') end end In addition to Tomcat cookbook attributes, this recipe uses the stack configuration and deployment attributes that AWS OpsWorks Stacks installs with the Configure event. The AWS OpsWorks Stacks service adds attributes to each instance's node object that contain the information that recipes would typically obtain by using data bags or search and installs the attributes on each instance. The attributes contain detailed information about the stack configuration, deployed apps, and any custom data that a user wants to include. Recipes can obtain data from stack configuration and deployment attributes by using standard Chef node syntax. For more information, see Stack Configuration and Deployment Attributes. With Chef 11.10 stacks, you also can use Chef search to obtain stack configuration and deployment data. For more information, see Using Chef Search. deploy attributes refers to the [:deploy] namespace, which contains deployment-related attributes that are defined through the console or API, or generated by the AWS OpsWorks Stacks service. The deploy attribute includes an attribute for each deployed app, named with the app's short name. Each app attribute contains a set of attributes that characterize the app, such as the document root ( [:deploy][:). For example, here is a JSON representation of a highly abbreviated version of the stack configuration and deployment attributes for an app named appname][:document_root] my_1st_jsp that was deployed to a Tomcat-based custom layer from an Amazon S3 archive. Copy { ... "datasources": { "ROOT": "jdbc/mydb" } ... "deploy": { "my_1st_jsp": { "document_root": "ROOT", ... "scm": { "password": null, "repository": "", "ssh_key": null, "scm_type": "archive", "user": null, "revision": null }, ... "deploy_to": "/srv/www/my_1st_jsp", ... "database": { "password": "86la64jagj", "username": "root", "reconnect": true, "database": "my_1st_jsp", "host": "10.254.3.69" }, ... } }, ... } The context recipe first ensures that the service is defined for this Chef run by calling tomcat::service. It then defines a context_name variable which represents the configuration file's name, excluding the .xml extension. If you use the default document root, context_name is set to the app's short name. Otherwise, it is set to the specified document root. The example discussed in Create a Stack and Run an Application sets the document root to "ROOT", so the context is ROOT and the configuration file is named ROOT.xml. The bulk of the recipe goes through the list of deployed apps and for each app, uses the webapp_context.xml.erb template to create a context configuration file. The example deploys only one app, but the definition of the deploy attribute requires you to treat it as a list of apps regardless. The webapp_context.xml.erb template is not operating-system specific, so it is located in the templates directory's default subdirectory. The recipe creates the configuration file as follows: Using default attribute values, the configuration file name is set to and installed in the context_name.xml /etc/tomcat6/Catalina/localhost/directory. The ['datasources']node from the stack configuration attributes contains one or more attributes, each of which maps a context name to the JDBC data resource that the associated application will use to communicate with the database. The node and its contents are defined with custom JSON when you create the stack, as described later in Create a Stack and Run an Application. The example has a single attribute that associates the ROOT context name with a JDBC resource named jdbc/mydb. Using default attribute values, the file's user and group are both set to the values defined by the Tomcat package: tomcat(Amazon Linux) or tomcat6(Ubuntu). The templateresource creates the configuration file only if the ['datasources']node exists and includes a context_nameattribute. The templateresource defines two variables, resource_nameand webapp_name. resource_nameis set to the resource name that is associated with context_nameand webapp_nameis set to the app's short name. The template resource restarts the Tomcat service to load and activate the changes. The webapp_context.xml.erb template consists of a Context element that contains a Resource element with its own set of attributes. Copy <Context> <Resource name="<%= @resource_name %>" auth="Container" type="javax.sql.DataSource" maxActive="20" maxIdle="5" maxWait="10000" username="<%= node['deploy'][@webapp_name]['database']['username'] %>" password="<%= node['deploy'][@webapp_name]['database']['password'] %>" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://<%= node['deploy'][@webapp_name]['database']['host'] %>:3306/<%= node['deploy'][@webapp_name]['database']['database'] %>" factory="org.apache.commons.dbcp.BasicDataSourceFactory" /> </Context> These Resource attributes characterize the context configuration: name–The JDBC resource name, which is set to the resource_namevalue defined in tomcat::context. For the example, the resource name is set to jdbc/mydb. auth and type–These are standard settings for JDBC DataSourceconnections. maxActive, maxIdle, and maxWait–The maximum number of active and idle connections, and the maximum wait time for a connection to be returned. username, and password–The database's user name and root password, which are obtained from the deployattributes. driverClassName–The JDBC driver's class name, which is set to the MySQL driver. url–The connection URL. The prefix depends on the database. It should be set to jdbc:mysqlfor MySQL, jdbc:postgresqlfor Postgres, and jdbc:sqlserverfor SQL Server. The example sets the URL to jdbc:mysql://, where host_IP_Address:3306:simplejsp simplejspis the app's short name. factory–The DataSourcefactory, which is required for MySQL databases. For more information on this configuration file, see the Tomcat wiki's Using DataSources topic.
http://docs.aws.amazon.com/opsworks/latest/userguide/create-custom-configure.html
CC-MAIN-2017-34
en
refinedweb
I'm running into a bit of trouble, I'm trying to create a list of places for the user to select from. The choices have distances assigned to them, I then want to get the first and second choices from the user and add the distances together, however it will only allow me to output as a string, whereas in this code I have chosen to output as an integer but I just get an error saying it can't do that. Here is the code I am trying to use, the code may look a little odd and that may be because we have to use a library that was created by one of our tutors. - Code: Select all import Py110 import turtle print 'The available places to select from are: ' print 'Birmingham, Coventry, West Bromwich: ' Place1, Place2, Place3 = 50,40,30 First = raw_input('Please select from the list where you are coming from: ') Second = raw_input('Please select where you are going to: ') distance = First + Second print('the distance between the two places are' +int(distance))
http://www.python-forum.org/viewtopic.php?p=6216
CC-MAIN-2017-34
en
refinedweb
This action might not be possible to undo. Are you sure you want to continue? 1 2 The Final Song. Part two. REWIND. REWIND. REWIND. REWIND. © © © © Bruce C. Lee December 2005. This book was written at Nitmiluk Gorge from July 2005 to December 2005. 3 © Bruce Cameron Lee December 2005 The Final Song. Part two. REWIND. B. Cameron Lee PROLOGUE. Ruth lay back on the hot sand of the Fijian beach. A thin towel was all that separated her magnificent, scantily clad body from the sticky grains beneath her. It allowed all the heat through, heat that she enjoyed soaking up. It recharged the batteries in her demon body. Ah, holidays. A short time, once a year, when she could escape the City and travel to a foreign destination. There she could be by herself and relive the memories of the evil committed during the past year. It was difficult when the Devil was your old man. He could appear anywhere, at any time but they had an unwritten agreement that holidays were ‘private’. She closed her eyes and listened to the Pacific Ocean, lapping the coral sand at the high tide line as the breeze soughed through the fronds of the palm trees further up the beach behind her. She was aware of the gaze of some of the boys from the resort who had wandered down the seafront to ogle her. Let them look, she didn’t care. She was here to relax. The Halloween Party at ‘Satans’ nightclub, ten days ago, had gone well. She had returned there after taking Chris’ soul when he died in the car crash and the night had been a big success. For her, the biggest success had been the Devil agreeing to give her Chris’ soul for her very own. It was her first one. There was something about Chris that attracted her. Yeah, he was easily duped and led astray but he had an intensity of emotion that was directed at her. She couldn’t understand it but liked the adulation though demons were not supposed to have emotions, that’s what her Dad had told her on many occasions. However, the more she dealt with Chris, the more she felt something strange but interesting happening within her. An unspoken bond. He had gotten over the transition from death to being a soul inside of her pretty quickly, all things considered. Her Dad had told her it sometimes took years for spirits to regain their sanity but Chris had clung to her like a limpet and adjusted rapidly to his circumstances. The heat from the sun was delicious; she stretched languorously as her pale white skin soaked up the energy of its rays. She could not burn, she was a demon. As she drifted off to sleep, her hand unconsciously wandered to the mound between her legs, her fingers idly massaging that special spot. Chris’ spirit was released. “Leave me alone,” it wailed inside her. 4 “Don’t you love me?” she asked. “Yes but now that I know you are a demon, it doesn’t feel right. You are dedicated to evil. You conned me. All I did was love you.” This was not going well; she wasn’t supposed to feel guilty about such things. “Chris. I, we are on holiday. I don’t have to be evil on holiday. If I agree to be ‘good’ will you be nice to me?” “You’re a demon, you tell lies. How can I believe you?” “Look into my dark soul if you want the truth. I’ll open it up to you.” Ruth did the necessary mental adjustment and waited. After a while Chris spoke within her again. This time, he sounded gentler and more than a little incredulous as he delved deeper. “You had a normal childhood. Your mother was a nun! You didn’t become evil until the Devil came for you at puberty. The bastard! What he did to you! Ruth, I am truly sorry. I didn’t realize that being a demon meant that you had a human mother. Why can’t you stop being a demon?” “To tell you the truth, I’ve never thought about it. Being bad is its own drug. Now, will you be nice to me?” Chris’ spirit interleaved with Ruth’s mind and his undying love for her washed over Ruth as he gently titillated the pleasure centres of her brain. At the same time, her own fingers were moving in ever decreasing circles under the tiny thong of her bikini. She opened her eyes but the pleasure continued to build, until it burst in a shattering crescendo which tore a cry from her lips. After, she lay on the sand thinking about some of the things that had occurred during the last sixty years of her being alive. Nothing could match the feeling that she had when she was with Chris. What was going on? This was not right. The heart of stone was developing cracks. 5 Chapter 1. Steve sat on the cold wet rocks at the end of the long promontory, gazing out at the spume tipped, heaving grey seas. The wind’s incessant howling tugged at the hood of his padded Gortex jacket and made his nose run. The lighthouse behind him pointed at the leaden skies, its tip disappearing into the low clouds being blown in by the rising storm. The first day of the New Year. He gazed down at the box on his knees. No ordinary box this; it was about the size of a shoe box and made from jet black onyx with gold hinges and a golden lock on the front with a tiny golden key. The exterior was plain and unadorned, apart from one word inlaid in gold in the centre of the lid, CHRIS. It had arrived by courier, addressed to him at his home with no return address, just three weeks after his best friend had died in a burning car wreck. Included with the onyx box was a typewritten note which read, “For his earthly remains. You will know what to do with them.” The rising wind shifted its song up a few notes. Even the seagulls had forsaken their aerial games as Steve sat contemplating the box. Inside were the mortal remains of his friend, all that could be collected together. The burning car he had died in had not totally consumed him, as the fire department had arrived in time to extinguish the blaze before that had happened but there was not much of a body left to cremate later. The tears on his face mingled with the driven sea spray as he sat deep in thought, a lonely figure in a wild place, on a mission. Steve could not believe his friend was dead. The car accident had followed directly on the heels of Chris being pursued by the police for the atrocious murder of his ex-landlady, who had been chopped into pieces and then decapitated. Chris could never have done such a thing, Steve knew but no one would listen to him. The case had been closed rapidly as the police had their suspect, albeit dead and they were not interested in reopening it, even though there were a number of anomalies in the chain of events leading up to Chris’ death at close to midnight on 31 st October, Halloween. Where had Chris been for the three weeks before his death? No one knew or could find out. The police had used the car registration to trace back to Father O’Connor at St. Pauls, where Chris had won the car in a fund raising raffle, just a few short months before his death. Father O’Connor had checked with Steve before giving the police Steve’s telephone number. At that time Steve had been eager to help the police with their investigations, in the hope that Chris’ name could be cleared. Unknown to him, the police had taken the liberty of doing a background check on Steve without his knowledge and then came to him for answers. He had none. All he could tell them was where Chris had worked. They then went to the Fleeting Image Advertising Agency and viewed Chris’ files, retrieving next of kin data. Chris had listed his grandmother as his 6 next of kin but she was old and frail and could not cope with the loss of her favourite grandson. She flatly refused to believe anything she was told regarding Chris’ wrongdoings, consistently maintaining that the police must be mistaken. She did however, give them the address of Chris’ brother at a University on the west coast, clear across the country. Then the circle completed itself. Steve received a phone call from Chris’ brother, Michael, who was in the process of doing final exams for his Law degree. Michael knew of the close bond that Steve and his brother had shared and being unable to spare the time at precisely that moment, due to exam pressures, asked him if he would mind taking care of the arrangements regarding Chris’ cremation and personal affairs. Steve had then enquired after Chris’ sister Catherine but she was travelling overseas, whereabouts unknown. So he had agreed. Michael sent a letter to Steve giving him the power of attorney in dealing with Chris’ mortal remains and tying up any loose ends of that life. All that he asked in return was to be consulted regarding the final resting place for Chris. Then the onyx box had arrived. Steve shuddered and looked down at the box again. CHRIS. The gold lettering on the top stood out, even in the dimming light. The wind was building and the first drops of rain were beginning to fall, he felt chilled, in spite of his expensive jacket and knew that he would soon have to act out the final scene of his friend’s life. Such a short life. Steve shuddered again. The days following Chris’ death had been weird. Steve was not used to being treated like a criminal. The police were looking for accomplices to the murder and made life difficult for him for a short while then the case was suddenly closed with no explanation, a fortnight after Chris’ death. Although an autopsy had been performed on Chris’ body, the results came back negative for drugs and alcohol, completely contrary to what was expected. It was almost as if the whole accident thing was being made to seem commonplace to avoid too much investigation. The police would not accept the power of attorney letter at face value and contacted Michael to check that the document was real. They would not release the remains of the body to Steve initially and he had to enlist Father O’Connor’s help in that matter. It still took a while. At long last, at the end of November, the mortal remains were cremated and the ashes, contained in a little plastic tub, were placed into Steve’s care. When he had returned home with the ashes that evening, Mary, his lady, had taken him into the study where she had set up a small table. The table had been covered with a red velvet cloth, on the top of which were placed the black onyx box with a candle at each side and a bible. There, by candlelight, on their knees, they had prayed for Chris’ soul and transferred his ashes from the plastic tub into the onyx box and then locked it. A telephone call to Michael a few days later had resulted in a long discussion regarding the final resting place for the ashes. Michael was of the opinion that Steve should decide where that was to be, as Steve knew Chris better than 7 anyone. Steve on the other hand was of the opinion that ‘family’ should take responsibility for that decision. It was then that Michael dropped a bombshell, he said he had no desire to be associated with a murderer, dead or alive and maybe a religious person like Steve would be the best person to say a few words as the ashes were scattered somewhere of Steve’s choosing. The discussion ended there. Steve and Mary talked it over and decided that the first day of the New Year would be the appropriate time to scatter the ashes of his dead friend. As for a place: the lighthouse promontory where sky, sea and land met. It was decided, they both agreed. So here he was, shivering with cold, in a rising storm with building seas. If he didn’t act soon he ran the risk of being washed off the rocks where he sat. Still, he could not act. Something was not right. When he had gone to Central police station to ask after Chris’ possessions once the case was closed, he had been stalled. No one seemed to know what had happened to them. Passed from one department to the next, with one bland excuse after another, he finally lost patience and threatened legal action to recover them. This got a response and he was ushered into the office of a fairly high ranking policeman. Why? This surely should have been a routine matter. It was explained to him, rather officiously, that because of the nature of the case, the possessions could not be released. When Steve had pointed out that the case had been closed and he would be taking legal action to recover the few things left, no matter what it cost him, a telephone call had suddenly been able to locate them. He left the police station with a plastic bag containing a charred watch, a slightly burnt wallet, some loose change and a small, blackened and very burnt metal box with bits of melted plastic stuck to it. The wallet had apparently been saved from incineration because it was in Chris’ hip pocket. That particular area had escaped the intense heat of the blaze due to the protection afforded by Chris’ body being in contact with the seat. The plastic bag was now sitting, unopened, on Steve’s desk at home. He was still trying to get the remains of the car released. The daylight was starting to fade and the tide was coming in. If he sat here much longer he would catch pneumonia. It was now or never. As he grasped the key to unlock the box so he could scatter Chris’ ashes in the storm, he paused momentarily. This was the last tangible link to his best friend. Then a small voice whispered inside his head. “What about Ruth?” Ruth. Where did she fit into all of this? Mary and he did not like Ruth, she felt decidedly evil but Chris had adored her and in return Ruth had seemed to have some affection for Chris. They looked good together and Steve had never seen his friend so head over heels about anyone before. Not even his one time live-in girlfriend Angela. He knew that Ruth had something to do with a mysterious club that went by the name of ‘Satans’ but its whereabouts was unknown to 8 anyone he had asked, including the authorities. When he had mentioned Ruth to the police, in connection with the murders, they had seemed disinterested in his theories. Curious. Really, there was a lot more to all of this than met the eye. Then there was the cassette tape that Chris had told him was responsible for all of his good fortune. Steve had listened to it but had heard nothing. There was nothing recorded on it, or was there? Where did the tape end up? Was it burned in the car? He still had to go and deal with the insurance people regarding the payout on the car. It was lucky that the post mortem had turned up negative for drink and drugs or they wouldn’t have to pay up. However, they were stalling on payment because they couldn’t get the car released from the police impound yard either but if they could, maybe he could have a look through it before the insurance people took it. He felt squeamish at the thought of looking through the car his friend had been burnt to death in but at the same time resolved to be strong in his search for the truth. Steve did not believe that Chris had murdered Patricia, his ex-landlady, nor did he believe that Chris’ death had been accidental. Somewhere, somehow, Ruth was involved in all of this and he meant to find out the truth of the matter. The crash of the last wave breaking on the rocks called him from his reverie at about the same time that the swirling waters rose up and thoroughly soaked his legs up to his knees. His shoes full of water, Steve scrambled back up the rocks holding the onyx box carefully in front of him. Another mystery. Where had this box come from? It was beautifully made, perfect even and very, very costly. Yet no one had taken responsibility for providing it. Someone had cared and knew a bit more about what was happening than a lot of other people. It had arrived just three weeks after Chris’ death with his name inlaid in the top and it had been delivered to Steve, the one person to whom all the responsibility would eventually fall for subsequent arrangements. There it was again, coincidence. The last light of the day was rapidly dying, being extinguished by the dense black clouds that had gathered overhead. Rain had started to fall, blowing sideways, driven in the near gale force winds that were mounting in intensity all the time. This weather had not been forecast, just stormy conditions. Steve came to a decision. He would not scatter the last remains of his friend. That act would be too final and irrevocable. There must be something that he could do to clear his friend’s name so he was not laid to rest as a murderer. In the meantime, this beautifull black onyx box would be just the thing to contain the last remains of his friend. Tucking the box under his arm, Steve leaned into the wind so he would not blow over and eventually reaching the sealed road around the lighthouse, walked quickly over to his car and jumped inside. His teeth were chattering uncontrollably as he pulled the keys out of his pocket and tried to insert them into the ignition with wildly shaking hands. He could not feel the ends of his fingers or his nose or his toes and knew that when the heater warmed the car up 9 they were going to get very painfull. With the car now started, he put it into gear and headed for home, happy with the decision he had just made and feeling a lot better about things now, than he had for the last couple of months. He intended to get to the bottom of this mystery. It was fortunate that his grandfather had left him a small fortune when he had died several years ago, that would give him the time and resources to investigate this matter fully. His fingers had started to ache as the blood flow returned to them and his nose dripped steadily. He reflexively wiped his nose and wondered, as he drove home, how Mary would feel having someone’s ashes in the house with them. Ah well, he would find out soon enough. 10 Chapter 2. The love of his life, Mary, was waiting for him anxiously when he arrived home wet and cold from his lonely sojourn. Mary had entered his life last year, about six months ago, after being introduced to his bible group by George and Doris Stansbury. They were good friends of his who had died in a car wreck shortly after selling Chris the winning ticket in a Church raffle. The prize was the red Corvette that Chris had died in. Mary was beautifull. Blond, athletic and softly spoken, a counterpoint to Ruth, Chris’ girlfriend, who was black haired, pale and slightly oriental looking. Steve and Mary had sensed a rightness in each other and had gravitated rapidly into a close relationship. She had not yet told Steve her full history and was somewhat of a mystery but Steve had not pried, accepting her for herself and figuring that she would tell him in her own good time. Mary ran from the front door of his house to the car, through the howling wind and rain, with a coat over her head. “Are you all right? I have been worried about you my love.” “Sorry. I got lost in thought sitting out there and didn’t realise that it was so late. Let’s get inside and I‘ll tell you about it there. I am really cold and need a shower and a change of clothes.” Picking up the onyx box from the front seat he tucked it under his arm and made a dash for the house following Mary. Pushing the front door closed against the insistent wind he turned and gave her a lingering kiss. “I missed you out there. It was pretty wild toward the end and I couldn’t decide what to do. Give me a few minutes to shower and change and we’ll talk.” He took his jacket off and hung it on the coat rack then placed the onyx box on the hall table and went up the long hallway towards the back of the house where the bathroom and kitchen were located. On his way he grabbed some dry clothes from the bedroom to wear after he had showered. Meanwhile, Mary headed for the kitchen to make him a hot, strong coffee. She turned, halfway up the long hallway, to look back at the onyx box. How could something be so black? She felt very uneasy about it. Fifteen minutes later, warmed up and in dry clothes, Steve retrieved the black box from the hall table and taking it into the kitchen at the back of the house, sat it on the kitchen table. He took a seat at the table and Mary sat down beside him. They both studied the casket in front of them, holding hands as Steve sipped his coffee and slowly gathered his thoughts together. “I don’t really know where to start,” he began. “It doesn’t matter. Start where you feel comfortable,” she suggested. “If there is anything I don’t understand, I can always ask.” He smiled gratefully at her. Mary was so understanding and patient with him. 11 “Well, I had fully intended scattering Chris’ ashes at the lighthouse as we discussed but as I was sitting there getting into the necessary frame of mind, I wondered at all the anomalies surrounding his death. A lot of things are not fitting together.” Mary was listening intently. “Tell me a few of them,” she prompted. “Well, Chris could not have killed Patricia. Especially the way she was murdered. I have known him a long time and even in the grip of evil there would always be a core of goodness in him that would preclude that sort of action. He liked Patricia. We talked about how he felt about her. He was really gratefull toward her for the chance she had taken on him, renting him a room in her apartment in his hour of need. However, no matter how hard I try explaining this to the police, no one in charge of this case will listen to me.” Mary studied him before commenting. “Yes, even while the evil was running through him I also felt that core of truth. He wasn’t totally evil; there was good left in there somewhere.” Steve squeezed her hand gratefully before continuing. “Then there is Ruth. We both felt the total lack of morals or goodness in her, despite appearances to the contrary. Chris was addicted to her. So where is she? According to the police that were in charge of the case, no one besides you or I actually saw them together and they are totally disinterested in looking for her. Even if they were interested, we don’t even know her surname to pass it on to them.” “Yes,” Mary concurred. “There are a few unanswered questions aren’t there.” “That’s not all. How did the accident occur? Chris was getting quite good at driving his Corvette. How did he miss all the warning lights and marker cones and drive through the only gap in the wall for a couple of kilometres? Where had he been for the three to four weeks before his death? Don’t forget, someone rang us the night before he died. There was only a lot of distorted noise on the answer phone for that last message but I thought I could just make out Chris’ name. ” “That‘s true, I just haven’t given it much thought or put it all together in that way before.” Mary was starting to look interested now. “There is more. I got to thinking about this casket.” Steve nodded at the black box on the table in front of him. “Who sent it and why the note? There just seems to be too many questions and a shortage of answers. Chris was my best friend, we had something and now he’s gone but not forgotten. I couldn’t bring myself to just throw him away with so much unresolved. His ashes are my last link with him, so I brought them back.” Mary didn’t look all that suprised. “I kind of figured that, when you were away so long this afternoon and then took so much care of the casket bringing it into the house.” She placed her hands on the casket. “Although, I must admit, I sense something odd about it. What, I am not sure but there is a certain energy involved in this. Something I am not familiar with, neither good nor evil.” Steve raised his eyebrow. “Any possibility of being more specific?” 12 “No my love, not at this time. What are you going to do with it?” She took her hands from the casket. “Well, if you don’t mind, I thought I would keep it in the study, on that little table you set up with the candles and the bible. You know, with the red velvet cloth.” “Good idea, being near the bible would be usefull I think. In view of the last couple of months of his life.” She smiled at him. “Shall we put him there now? Then we can go to bed early and I can warm you up some more.” As she spoke the last words, Mary snuggled her face against his neck and kissed and nibbled him enthusiastically. He smiled at her and rose to his feet, taking up the casket before him to carry it through to the study before he joined her in the bedroom. The next morning was cold. The high winds had dropped overnight and the forecast was for extreme cold with the probability of snowfalls. Mary decided to go to the supermarket and lay in provisions in case the weather conditions turned nasty. She never asked Steve for money, ever, and Steve never pried into her history. Still, he wondered where Mary got her money from as she didn’t work. Another mystery that would have to wait for Mary’s explanation. All in good time he hoped. With nothing to do he sat sipping his coffee in the kitchen pondering his next steps in his investigation into Chris’ death. Where to start? He suddenly remembered the meagre bag of Chris’ possessions that he had struggled so hard to recover from the police. It was on his desk in the study. Rising to his feet, he picked up his coffee and headed into the study. Settling himself at his desk he couldn’t help but to look over at the black casket on the small table. “I will do whatever I can Chris,” he thought to himself. Then he reached over and picked up the bag of possessions, emptying them out onto the desk in front of him. Steve sat and looked them over, the last things Chris had on him when he died. His thoughts drifted for a while then the front door was opened and slammed shut with a gust of wind. “Sorry Steve. It’s only me with the shopping.” Mary’s voice drifted down the hall. “I am in the study Mary,” he called in reply then went back to his inspection of the articles. The loose change he put to one side, then he picked up the blackened watch. It had been on the wrist of his dead friend at the time of the accident. He wiped the face of the watch but could not remove the burn residue. He picked up his empty coffee cup and wandered into the kitchen. Some rubbing with a pot scourer revealed the face of the watch underneath the glass. It had stopped at five past eleven. Mary came back into the kitchen after changing out of her damp clothes and proceeded to put the shopping away in the cupboards and refrigerator. “Found anything yet?” “No, I have just cleaned up the watch face to examine it.” 13 As his fingers felt over the glass while he was talking, they picked up very slight irregularities in the surface. Too small to make out with the naked eye. “I’m just going back to the study. I need to use a magnifying glass.” “Okay, I’ll be along shortly,” Mary replied. Back in the study, he took a magnifying glass out of the desk drawer and examined the face of the watch. There, embedded in the glass, were some tiny globules of molten metal. How had they got there? The fire in the car was not hot enough, nor had it burnt long enough, to melt metal. As he looked even more closely, it appeared as if the molten metal had left tiny trails across the glass before embedding into it. Odd, what could have caused that? Just at that moment the door was bumped open and Mary entered, carrying two steaming mugs of coffee. She handed one to Steve and pulled up a seat beside him. “Have a look at this,” he said, handing her the watch and magnifying glass. Mary inspected it carefully. “There appears to be trails of melted glass and metal globules on the face.” “Exactly but there was not enough heat in the car fire to melt metal, so how did that happen?” They looked at each other in puzzlement. The watch did not offer any further clues so Steve put it to one side, next to the pile of change. He picked up the metal box but it was really blackened and covered with bits of burnt plastic so he put it to one side until last, as he would have to clean it before examining it. That left the wallet. All its corners had been burnt and the side that would have been away from Chris’ body was charred but not right through the leather. Steve opened it carefully, trying not to break the now brittle leather. He opened up the section that normally held bank notes and was suprised by the wad of cash. He withdrew it carefully and gave a low whistle of amazement as he counted it. The notes were charred on each corner but there was well over a thousand dollars in his hand. At least now he knew that Chris had not been short of cash. As much as he disliked Michael’s attitude, Chris’ brother and sister would definitely be glad of this windfall. He laid the cash to one side and continued with his exploration of the wallet. A couple of business cards, the usual, real estate agent, Corvette dealer, even one from the Fleeting Image Advertising Agency. There was a driving license and a credit card but little else. Steve was disappointed, he was really desperate for a clue, something to start his investigation off with. “Nothing,” he said, handing the wallet to Mary. She went through the wallet again, this time looking into the bottom of each compartment of the wallet. In the third compartment she looked in, she noticed a crumpled piece of blue paper squashed deep inside. Grabbing a pair of tweezers Mary pulled it out. If the police had already been through the wallet, they may have missed this. Fighting down rising excitement, Mary opened up the scrap of blue paper very carefully and spread it out flat. On it was a phone number. Who or what it referred to she had no idea, as there was no further information written down. “What have you got there, love? Steve asked her. 14 “I don’t know, it looks like a phone number but there is no name or anything to identify it,” she replied. Steve took the scrap of blue paper and sat back, considering what to do, then got up, went to the toilet and made them another cup of coffee before coming back to the desk. He handed one mug to Mary before sitting down and taking a sip of his own coffee, trying to compose himself. “What are we going to with this?” Mary asked, pointing to the telephone number. Steve looked at her. “I am going to ring it now. It is the only way we can find out who it is. It could be important.” Then with shaking hands he picked up the telephone and dialled the number on the scrap of paper. It rang. “Yo.” Steve almost jumped out of his skin. “Who is this please?” “Mike Carruthers, who am I talking to?” “You don’t know me, my name is Steve.” “What can I do for you Steve?” Gruffly. “Did you know Chris Wilkins; I am trying to find some things out?” “What are you, a reporter or something?” Suspicion was evident in the voice. “No! I was his best friend. I need to know what happened to him. You know, before he died.” “Listen bud. This is DETECTIVE Mike Carruthers. You ought to be carefull who you talk to about this matter, it could get a bit sticky.” “Are you one of the detectives from the case?” Steve asked with a sinking feeling in the pit of his stomach. “No I’m not. Look, we should meet in person. There are some things that cannot be discussed over the telephone. It is possible that you may be being watched. Can we meet later this afternoon?” “Yeah, how about Tonies Coffee Shop about four o’clock. Can I bring a friend?” “Sure you are not a reporter?” the gruff voice asked again. “Detective Carruthers, I am sitting here looking at the casket containing my friend’s ashes. No, I am not a reporter.” “Can’t be too carefull bud. See you later.” With that the telephone line went dead, leaving Steve with a slight feeling of elation. He had a lead at last. Someone to talk to who may know something about Chris. He was so excited that he forgot about the small metal box sitting to one side of the desk covered in splashes of melted plastic. What did the Detective mean about being watched? Who would want to watch him or Mary and why? Mary was looking at him expectantly, her head tilted quizzically to one side. “We have a lead,” he exulted. “We are going to meet a Detective Mike Carruthers at four this afternoon. We may actually learn something now.” Mary was a little worried, this was getting deep. What was going on? 15 Chapter 3. Four o’clock that afternoon found Steve and Mary sitting in Tonies Coffee Shop gazing out at the first thick flurries of snow beginning to fall as the daylight waned. They had been there for about ten minutes and were both waiting apprehensively for the person that they were supposed to meet. They were the only people in the shop, probably due to the weather, which was extremely cold. Mary found herself being caught up in Steve’s mounting excitement but was slightly worried about the warning that Steve had been given. What if it was a trap? The door suddenly banged open with the wind as someone entered. They both looked up at the same time, startled, to see a figure in an old overcoat and beaten up hat enter the coffee shop. The figure took off the hat and coat revealing a well built man in a shabby suit with a three day growth of whiskers covering a battered face, complete with broken nose. He looked like a thug. Mary started to tremble. What if......... Catching sight of them the man came over and extended his hand in Steve’s direction. “Detective Mike Carruthers.” Steve took the big paw in his hand and shook it, noting the firm, warm grip which felt very reassuring. “Steve Sinclair and this is my partner Mary, Detective Carruthers.” “Call me Mike, no need for formalities. What does a man have to do to get a cup of java around here?” “Allow me. How do you have it?” “Black and strong please.” As the day outside slid into darkness, the detective studied the earnest young people in front of him while waiting for his coffee to arrive. His first impression of Steve was of a person he could trust. Steve looked pretty average but had an aura of quiet determination about him. A stayer, not someone who would easily crumble. Bit of a tenderfoot. He might need all of that resolve the way things were shaping up with regard to his friend’s case. The girl on the other hand, Mary, was a real looker. He studied her closely. One of the things he prided himself on was never forgetting a face and she looked familiar. “Have we met before Mary,” he asked. She looked suddenly startled and giving Steve a quick glance replied, “No, I don’t think so.” He saw the pleading in her eyes and suddenly realized that although these two people were a couple and they looked it, Mary had secrets that Steve knew nothing about. He decided not to push it, she seemed nice. “Sorry, my mistake. We haven’t met before.” 16 Gratitude shone from her eyes. He bathed in it for a second or two until his coffee was placed in front of him. He would protect her if he could, there was an innocence there. Steve was a lucky guy. Mike took a sip of his coffee before sitting back and looking at Steve. “Okay, you want to start talking?” Steve drew in a breath as he studied the detective. Could he trust this man? What else did he have to go on? “What would you like to know?” “Everything from where it started to get strange. Off the record, I talked to Chris for the first time when I telephoned him the day after the suspicious suicide, when Sally jumped off the balcony at what was to become his apartment.” “Yeah Mike, I remember that happening but it started a little earlier than that.” Steve sat for a second or two gathering his thoughts then proceeded to tell the detective the whole story, starting from the accident involving the colored guy which occurred right outside the coffee shop they were in, back in late July. It took a while to relate the story up to the present and by the time Steve had finished, the coffee shop proprietor was looking to close up. Steve glanced at his watch and was amazed to find it was nearly six o’clock. “I’m really sorry Mike, I didn’t realise how late it is getting. Your wife will be wondering where you are.” “I’m not married bud; we’ll just keep going ‘till we get to the end of this. You both want to eat? There is a restaurant in the Mall across the Boulevard.” Steve glanced over at Mary who nodded assent. “Okay,” he said, “but we are paying.” “No argument there bud.” They left Tonies Coffee Shop in a group, huddled into their coats and hats, leaning into the wind driven snow. The lights went off in the coffee shop behind them as they were crossing the grass verge to the road. Some of the streetlights along the Boulevard were off also and it was pretty dark. Steve was the first to reach the edge of the road and seeing no car lights stepped off the footpath. Two things happened almost simultaneously. A large paw grabbed the collar of his zipped up jacket and yanked him forcibly backwards as a big, dark car roared through the place he had just been standing in. “You ought to be more carefull bud or you’ll wind up dead. No number plates, they were out to get you. Although how they knew you were going to be here is anybody’s guess. Might be an idea to get a mobile phone, your house phone is probably bugged.” While Steve’s legs stopped their wobbling he realised that Mike had saved his life and that Mike was a pretty cool customer. “Thank you Mike, I owe you my life. I am in your debt.” “De nada. You are buying me a meal, we’re even.” 17 Ensconced in a cosy restaurant in the Mall, with few other customers around, Mike told them about the telephone call he had received early on the morning that Chris had died. “I wasn’t on that case but I advised him to give himself up. All the evidence was stacked against him though. He wouldn’t have stood a chance in court. I did mention, at his insistence, that a tape recorded confession from the real killer would help and offered to fit him up with a wire. He hung up but I had traced the call by then.” “Where was he calling from?” Steve asked. “A big holiday hotel down the coast called Holiday Magic. He had rented the Penthouse, paid cash but left suddenly. Early in the morning the day after the story broke.” “I wonder what he was doing down there?” Steve mused. Mary looked up. “Running away from Ruth?” Both men looked at her, Mary stared right back. “How do you know that?” the detective queried. “I don’t know; I just know it. I cannot explain how but I know that is the reason. Ruth is most likely responsible for Patricia’s death.” Mary’s eyes were gleaming. Steve explained. “Mary has this gift and she has never been wrong. Strange as it may sound, I fully believe her. Ruth is someone we need to talk to.” The meals arrived, a big T-bone steak for the detective and fish dishes for Steve and Mary. Before long there were three empty plates on the table and the detective was ordering a big slab of cake for desert. He looked intently at both of them, considering, before relating the next thing he had to say. “This case is very strange. I know the policemen that were assigned to it and why it was closed so quickly. Some police on the force are dishonest. They became policemen for the power and the money that can be made on the side. I hear a lot of things in passing, like who is getting kickbacks, who is getting bribed and who is getting blackmailed. The people who blackmail cops have to be very smart or strong otherwise they end up dead. ‘Satans’ is known to some policemen but I only hear faint whispers. The star dancer is a black haired, pale skinned woman who, after what you have told me, is probably this Ruth person. Now, I am not allowed to investigate this case but I can find out information here and there which may help you. Once you give me a mobile number, I can call you with information and advice.” Steve was flabbergasted. This was far more than he had hoped for, far more than he ever believed possible. “Why are you helping us when you could lose your job?” he asked. “Two reasons. I like you guys and I probably could have done more to help your friend. I feel guilty that I didn’t. This isn’t going to be a walk in the park. I advise you to buy a gun each and learn how to use it. Get silver bullets too.” This last was delivered with a wry grin. 18 Steve looked at Mike and shook his head. “No guns. We have God on our side.” The detectives reply was immediate. “Well ain’t that fine and dandy. Let me tell you, God has never stopped a bullet. Do yourselves a favour and buy a telescoping steel rod each and learn how to use that. They may be illegal but are a very handy piece of gear. The people I know about kill for fun. That’s right. Fun. Get strong locks on your doors and windows and put your car in the garage at night so no one can put a bomb in it. You think the attempted hit and run out the front was an accident? Most likely crooked cops were driving the car.” The big slab of cake arrived with three coffees. Mike seemed to have a bottomless hole where his stomach was and quickly disposed of the cake. As he was sipping his coffee he suddenly thought of one more thing. “If you ever hear of the whereabouts of ‘Satans’, don’t go there. It is far too dangerous a place for the likes of you. Tell me where it is and I will go in and check it out. For now, if you get a chance, check out the story of the staff at the Holiday Magic hotel. Get an idea of what was happening with Chris while he was staying there and take notes. Do not rely on memory alone.” Steve and Mary both nodded in unison, impressed with the seriousness of the detective’s tone. Steve had a suggestion of his own to make. “If our phone is bugged, yours may be also. Allow me to buy you a mobile phone under my name. That way our phone calls will remain private and there is less chance of another ambush.” “Good point bud. By all means, if you have got the money I’m all in favour of increasing our odds in this little venture. Now remember, be carefull! I like you guys and don’t want to have to investigate your deaths.” Shortly after, they left separately. Mike first then Steve and Mary, heading out into the frigid evening. The snow was getting deeper by now and the drive home was accomplished with much care. They didn’t see anything suspicious but Steve was very cautious after his near recent brush with death. When they arrived home the house was pleasantly warm as they had left the central heating on. They checked through the house but nothing appeared to have been tampered with. Both Steve and Mary were feeling a little paranoid after their meeting with Detective Carruthers and sat for a while in the main lounge room discussing what they would do next. “First thing tomorrow I am going to get an alarm system installed in the house and garage. A good one. Also, I think the idea of the telescoping steel rod is pretty good for self defence. What do you think Mary?” “I don’t want a steel rod, we are not violent people and the thought of hitting someone is revolting but I will obtain some Mace spray if I can get it. I think we should stick together from now on and go everywhere together when we are out of the house. It may be a little awkward sometimes but having you nearly run over tonight has scared me quite a lot. I never thought that death could be so close. I am going to pray for us. Surely God will stand on the side of right.” 19 “I hope so my love. I sincerely hope so.” Steve was looking sombre. “I’m off to have a bath now,” Mary said. “I need the relaxation. Join me?” “In a while. There are a couple of things I need to clear up in the study,” he responded. So while Mary went off to run her bath, Steve wandered into the study to organise the results of the day and find out the phone number of the Holiday Magic Hotel down the coast. Sitting at his desk, telephone book on his lap, he happened to look up and spotted the little metal box, all blackened and encrusted. He found the number he was looking for and wrote it down in his notebook then put the notebook down and picked up the metal box. The hairs on the back of his neck prickled, his own private indicator of evil. This would take more looking into. Getting up from the desk he went through to the kitchen and put the box on the chopping board. Arming himself with a small but sturdy knife, he started prising the melted plastic off the lid. It came away suprisingly easily in largish chunks leaving behind blackened metal. Back to the pot scourer. He ran hot water into the sink with a little detergent added and set to. Ten minutes later he had a relatively shiny but scratched box. He dried it off and went back to the study. Sitting comfortably in his chair he opened the lid and was rewarded by a small gush of water, detergent and carbon which soaked his pants. Reminding himself he didn’t swear, he went back to the kitchen and checking that there was nothing further in the box, rinsed it out. It was clean but blackened inside. He noticed the little spoon on the underside of the lid, a bit of a giveaway. He wandered into the bathroom where Mary was ensconced in the bath, bubbles all over the water. He smiled at her, waved the box and sat down on the end of the bath to look it over. Inspecting the base first, Steve found the hallmark that told him the box was made of solid silver. So. An expensive item. A gift? Next he took note of the plainness of the sides and bottom. The top he was saving until last. Then he had a look under the lid, pulling out the tiny spoon from its cleverly designed clip then returning it. This was a box to store cocaine in with its own dispensing spoon. The cocaine must have carbonised in the flames that engulfed Chris’ car, otherwise the police would not have let him have the box. It would have been kept for evidence. Lastly he closed the lid and inspected the top of the box. It was plain apart from the name on it. CHRIS. He looked at the name again, something niggling at his brain. What? What? He looked up to find Mary studying him. She smiled and held out her hand for the silver box. He handed it to her so she could examine it. Mary noticed things, most women did but Mary had a good eye and a quick mind. She finished her inspection and handed the box back. “Did you notice the writing on the lid is the same as the writing on the casket?” Then it hit him. Steve quickly got to his feet and went into the study and over to the small table where the black casket was. He held the silver box beside the casket so he could see the name CHRIS on both boxes. The lettering and style 20 was identical. Both boxes had come from the same source. They had been made by the same equipment but one was onyx and the other silver. Someone with a lot of ability had been paid a lot of money to make these items and they both had been for Chris. One, antemortem and one, post mortem. Mary by now had finished with her bath. He could hear her moving around. “Mary,” he called out to her excitedly, “can you come in here for a moment, please.” Mary entered the room looking quite luscious in her tight fitting silk robe and walked over to stand beside him. He drew her attention to the lids. “You were right, they are identically lettered.” A small gasp escaped her lips. “Where did this silver box come from?” she queried. “It was with Chris possessions that I had to fight to get back from the police. It is a box for storing cocaine in. See here under the lid, this clever little spoon must be for sniffing from.” He crossed back to the desk and placed the little silver box on it. Turning to Mary he said, “That’s not quite enough excitement for one day. I’m going to have a quick bath and join you in bed.” Mary gave him the sweetest most innocent smile, she liked sport and recreation. Later that night, Steve dreamt. The landscape he was in was a dull monochrome, lacklustre. He was sitting outside of Tonies Coffee Shop with a coffee, stirring, stirring, stirring. Someone sat down beside him and he looked up to see Chris sitting there. Chris spoke to him. “Hello old buddy. I haven’t got much time. Just managed to sneak out for a little while but if she wakes up I will get shit for it.” Steve replied, “This is a dream Chris. What are you talking about?” “I am not really dead Steve. My soul is inside.... I cannot mention the name because she will wake instantly. Suffice to say, I am slowly learning my way around in there. Now, if she sleeps, I can use some of her power to do little things like this occasionally. Trouble is, she hardly ever sleeps. No, don’t try to talk, just listen. Did you scatter my ashes? No. Excellent. If you had I could never come back. At least now there is a very slim chance I may be able to.” Steve felt a caress of air as a wind started to blow. In the distance a long howl could be heard, getting ever louder. Something was approaching. The landscape took on a red hue. “Shit, she’s awake.” “Who?” “Ruth!” Chris shouted. “Look out Steve.” A female devil form came streaking out of the dream heaven. Red scaly skin, red eyes, small horns on top of her head and a tail behind. Still horrendously beautifull even with the red talons held out in front of her. She alighted in front of them, hissing. Steve stepped forward between Chris and the she-devil. “This is my dream. In the name of Jesus, be gone!” 21 She laughed as she raked her talons down the left side of his face and grabbing Chris forcibly, took off. Yelling over her shoulder. “Jesus has no power, he was a King of the Jews once. That is all.” Then they both disappeared into the distance and he woke up. His face hurt abominably so he got up and looked in the mirror. Down one side of his face, the left, blood was oozing from four lightly gashed furrows. He put his hand up to his face wonderingly, feeling the gashes. His fingers came away bloody. Then before his eyes, the gashes started to heal, like in time delay photography. In a few minutes, there was no trace of any injury, not even scars. He shivered involuntarily and went back to bed. 22 Chapter 4. Not long after, ten city blocks to the east, there was activity in the darkened building that housed the Fleeting Image Advertising Agency. From the street below, the lights of the sixteenth floor, flickering on, could just be observed through the ever thickening snow fall. A band of light in an otherwise darkened building. Upstairs, a meeting was shortly about to start. The room the meeting was being held in was opulent to the point of extreme. None of the regular staff of the company had the key to this room and only a select few ever got to visit it. Louise was presently the only occupant in that luxurious place and it was she that had turned the lights on, preparing the room at the agreed-on time for the next arrivals. The position she held in the company was as the receptionist for the managerial level on the sixteenth floor. Her extra duties, known only to a select few, were as a facilitator for other, more mysterious and sometimes fatal, intrigues. Always elegant and refined in designer label clothing, she was also quite beautifull and managed to exude sex appeal in a subtle but catchy way. She regretted being mortal. However, that was probably her main attraction to the biggest player of the coming meeting. Also, she was getting impatient with her status. Being a favourite of the Devil was okay but it didn’t carry the importance or permanency of being a child bearer. That was what she was aiming for, bearing the Devil’s next child, her own little demon. Once it was born, she would have real status. There was a flash and the ‘whumph’ of displaced air, heard and also felt as a slight compression in the ears as the air pressure readjusted. Standing before her was a dark man, elegantly dressed in an Armani three piece suit complete with gold fob watch and chain. He was slim and very handsome for an older person with narrow red eyes and a thin lipped smile. Almost sardonic, except for the evil undertones. Here was a person capable of great cruelty. “Hello darling, good to see you again,” she said to the well dressed figure. “Don’t call me that, you know how much I hate that bullshit, lovey-dovey stuff!” the dark man growled at her. “Sorry, Mr. D, I forgot.” Louise’s apology was earnest. You didn’t mess around with this guy. He spoke again, “Is it time to fetch the others?” “I guess so, they should be ready about now. They are usually waiting for you on these important occasions.” He nodded his head and his gaze turned inward, next moment there was another ‘whumph’ and after Louise’s eyes had recovered from the flash, she recognised the naked young demon standing before her. Well built, tallish, with red scaly skin, red eyes, little horns and a tail. Completely naked. He had the same sort of mouth as his father. “Hello Andrew. Mr. D is already here.” 23 “Greetings Louise.” Turning around he nodded at the figure in the three piece suit. “Father.” “Don’t call me that. You know the RULES, for us there is only one ‘Father’. If you have to use human terms, I believe ‘Dad’ fits.” The Devil concentrated on the back of a chair and clothes appeared over it. Neatly folded and new, still with labels attached. Somewhere fairly close, a clothing store owner would notice items missing the next day and suspect a staff member of stealing. As Andrew walked over to the chair and began removing labels from the clothing his demon body gradually began changing into its human form. That of a handsome, black haired man with a well tanned skin. He removed the labels and put on the clothes which fitted him perfectly. “You know Dad; I sometimes get tired of being brought to meetings. Why can’t we have powers like yours? Then we could bring ourselves along and do lots of other stuff as well. It is ridiculous that we can only teleport what we can see while your range is over a hundred kilometres. Also, if you could teleport me to meetings in human form, already clothed, it would save you having to bring clothes in from nearby when I arrive somewhere. Is there any way that we demons can acquire the extra power to do more?” The Devil shrugged, “You know the RULES are not changeable. It is a contract between HIM and ME. HE claims humanity as his children and uses us to cull the bad ones. For that I am allowed four demon children to assist. The limits to your powers are set so we cannot take over. That is because HE has more power than I do. How many times do I have to explain to you about genetics? You get fifty percent of ME and fifty percent of your mother. Your mother, I shouldn’t need to remind you, was human, so you can only have fifty percent of MY abilities and not the true power that I possess. MY power is given to me by HIM as part of my contract. It is unfortunate that you only posses the minor abilities but that is how it is. Your powers only work on what you can see and you lack enough mental strength to teleport yourself.” Andrew shrugged, “It was worth a try. Why don’t you break the contract?” “Yet once again I have to explain. Dummy. If I break the contract or any of the rules, I may cease to exist. Simple. And before you get any ideas, that goes for my immediate offspring also. So don’t even think about it.” The Devil strode over to the table and pulling out a chair, sat down. He made a very small gesture and a steaming cappuccino appeared on the table in front of him. In a late night coffee shop about three blocks away, a confused waitress found she was one coffee short when she arrived at a group’s table. “Want one? Louise? Andrew?” Before they could answer, the Devil paused for a second, head cocked to one side, still. Their reply was stalled by another flash and a ‘whumph’. They looked over to see a gorgeous female demon with red scaly skin and similar demonic attributes as Andrew. Naked, she was magnificent. She slowly changed into a beautifull female form with black hair and pale, pale skin. There was a slightly oriental cast 24 to her features. The Devil nodded in her direction and immediately she was clothed in an elegant evening gown. “Hi Papa. Thanks.” She gave him a little wave then looked down at herself. “What, no label.” “It came off a window dummy. Why weren’t you ready for me earlier Ruth?” “Er, I forgot the time?” The hesitation was obvious to all in the room. “Don’t lie to me daughter. I might get angry with you and you know what that means.” His face darkened slightly and little forks of lightning flickered throughout the room. “I fell asleep for a few moments while I was in human form. The wards slipped and Chris got away for a few seconds. I had to Change and go get him back. It won’t happen again, honest.” She gave her father a timid smile and blushed. “Save it daughter. You may be Daddy’s little girl but if you cannot control that spirit I gave you to use, I can always take it back. Tell me, you are half devil. What’s with the ‘honest’?” Ruth laughed and followed Louise and Andrew over to the table where they all sat down. A coffee appeared in front of Louise and the Devil raised an eyebrow toward Andrew and Ruth. “Tequila please,” they both chanted in unison. On the table in front of them a bottle of tequila and two glasses appeared. Andrew unscrewed the cap and poured two generous helpings, one of which he slid in front of Ruth. The Devil gazed around the table, stirring his coffee, which immediately started boiling and then looking directly at Ruth, spoke. “How was the holiday? Ready for another year of evil?” “The holiday was great Dad and yes, I am ready for work.” “Good. Now I will take this opportunity to remind you that the job you did on the air hostess was messy. We cannot succeed in our endeavours if we draw attention to ourselves like that. You were exceedingly lucky that the Chris person went for a drive at the same time you were slicing the hostess up or he would have had an alibi. Any complications regarding our tame police that you would like to report on?” “No Papa, the porno videotapes from the club guarantee that I have quite a few important police in my pocket. Blackmail works wonders. There is one complication though.” The Devil raised his eyebrows, “Which is?” “Chris’ best friend Steve ended up with power of attorney for Chris’ estate. He managed to get the few possessions that were in police custody and is trying to get the car released also.” The teaspoon in the Devils hand bent as it started to soften with heat, “Shit! We don’t need any problems at the moment. If there is anything incriminating on or in the car, I don’t want it known. Take care of this human if need be daughter and try to be subtle about it.” “Yes papa,” was Ruth’s meek response. 25 “And remember; try to make it look like an accident and no murder while in demon form, unless someone tries to kill you first. The RULES don’t allow it.” Then turning to Andrew, he spoke one word. Andrew and Ruth glanced at one another for an instant before Andrew formulated his reply. “The tape idea is working fairly well. We have acquired a number of minions, both male and female, which make the seductions easier for us. We can now delegate quite a bit of the field work. This gives Ruth and I more time to collect the souls that you require. However, we have a problem. Having only copies of the one tape to work with, most of the victims end up working here for a brief period of time. It’s not too bad as we can bring them back to work here when they are minions. Only you have the power to do the last minute attunement of the tapes to the final recipients and although it is nothing for you to do so, we still cannot work fast enough.” The Devil studied his son. “Explain.” Andrew continued. “Although it is working exceedingly well, the process for soul capture is taking far longer than we had originally anticipated it would. At the present rate of soul acquisition, it will be over a century before we reach our target number.” The elegant figure of the Devil morphed into a horrendous apparition which roared at them mightily before once more becoming the dark man. A slight sardonic smile creased the leathery face for a moment. “Do not give me excuses. We do not have that much time. Our plan calls for the Army of Night to be mobilized within a year. This year coming. All the signs are right for a takeover. HIS religions are fighting each other for supremacy and HE cannot take sides or show favouritism. All the prayers and chants from all the different religions, each asking him for exclusive backing, are making him a little confused. HE is a little off HIS game at the moment and HE is not taking much notice of us. If peace comes, we lose our chance.” The Devil took a sip of the still boiling coffee and replaced the cup in it’s saucer. “So what do you propose to do about it?” Andrew sat studying his hands and buffed nails for a short time before looking up and meeting the Devil’s flat and cruel gaze. “Sis and I have come up with a very workable plan. Something that we do not have to monitor and something that will be more popular than the music tape is. It will not require your continual input and it will be self promoting. Of course, the age group will be a little younger than the tape idea but Ruth and I reckon that the numbers will be phenomenal. The only drawback is, whether or not it fits in with the RULES.” Andrew poured himself and Ruth another healthy shot of tequila each, sure he had interested the Devil. He was not disappointed. “Well, details. NOW!” 26 Good old dad, always so predictable. Pity he couldn’t take the Old Boy out and then become the Master. “Nice thought son. I am so proud of you but don’t ever try it or you will cease to exist immediately. Now get on with it.” Andrew shrugged, he should have known, the old bastard was so powerfull. “Well Dad, we were thinking of using a computer game based on the tape manipulation. It is a classy way to go. Every game would have the same story and music. We can manufacture them for computers and make them easy to copy. If the game proves popular, we could also manufacture it for any game console and it would spread like a virus across the whole country. Maybe even across the whole world. What we cannot decide is; if the person playing the game is controlling the evil that occurs in the game, are they then responsible for that evil. Do the RULES allow us to take a soul for directing evil that hasn’t happened in reality but only as a surrogate on a screen? The people playing the game are actually making evil decisions as they play. Is that sinning?” Andrew tossed his drink back and refilled his glass. Louise was fascinated. These demons, spawn of the Devil, were really quite clever. She secretly hoped that one day she could bear the Devil a child just as clever. Ruth chimed in. “We have gone over the RULES many times but the language is so difficult. It is very old fashioned, full of ‘thees’ and ‘thys’ and ‘smiting’ and all that sort of shit. We just weren’t sure about it all, so we thought we’d better run it by you and see what you thought.” The Devil looked pleased. “Well done. Everything is not ‘written’. I have just checked the RULES and guess what? All that self-determination crap HE wrote into them has left a loophole. HE never foresaw computers and there are no regulations regarding that subject. No regulations mean we are not breaking any RULES. Herod was condemned as a sinner for ordering all the boy children killed when Jesus was born and he never killed one of them himself. So it should work in our favour. Now, I do not, as you know, understand all this modern technology. I am much too old to even try. So tell me, in simple terms, just what you need to get everything up and running.” Andrew started speaking again. “We are going to have to write the programmes for the game. Not too difficult but it would be easier if we had Sonya and Tyrus here to help us. They are pretty good at computer stuff.” The Devil looked from Andrew to Ruth and then finally to Louise. “What do you think, my clever little favourite? Does this sound like a workable scheme? Should I bring my other two children here as well?” Louise held his gaze, considering the options before speaking. “If the game is catchy and becomes popular, it will be really effective in quickly garnering souls for you. Whatever it takes to make it so, should be considered. Even bringing all your offspring together in one location is not too high a price to 27 pay. Is it?” She smiled at him, mentally adding that if anything happened to any of them, she would be happy to bear the next one. The Devil looked at her appraisingly and nodded in agreement before making his decision. Then he addressed the three of them again, the expression on his face becoming quite serious as he spoke. “As you know, we usually never all work together in the same place. Buying into this company has given us a legitimate front which may help but there is a reason that we do not come together. In the past, I have taken care of earthly opposition myself, so you remain relatively unknown. However, it is now time you know. There is an organization known as The Brotherhood, sworn to act as HIS soldiers, which has dedicated itself to ridding the world of me and my offspring. It is a clandestine operation whose operatives are descended from the blood of Solomon and David, through Jesus the King of the Jews. It is a royal bloodline that has continued in an unbroken fashion for thousands and thousands of years. Today, the bloodline is very dilute and these people do not have much power individually but they are very dangerous because there are quite a lot of them. Occasionally, an individual surfaces that has the blood on both sides of the family. They are stronger and more deadly to us. Well, not to me but to my get. If we come together, you,” looking at Andrew and Ruth, “and your brother and sister, could be in danger. Are you prepared to take that risk?” There was a moment’s stunned silence as the Devil’s words sank home. Louise sat back and watched the disbelief crossing both Ruth and Andrew’s faces. Young demons, both thought themselves invincible until this moment. They both tossed off their drinks and refilled their glasses. Then turning to the Devil as one, they said in unison. “We are not afraid. We will enjoy killing whoever or whatever gets in our way. We need all the family together to have this happen. Make it so Mr. D.” Then they laughed. Fiendish laughter, starting with a chuckle and ending in great evil shouts of glee. The Devil sat back, considering Louise. The summoning had just gone out. His family would soon be together. The time had come. 28 Chapter 5. Steve woke late the next morning. Looking across at Mary, he saw she was still fast asleep so he decided to get up and put the coffee on. Rising, he put on his dressing gown and went up the hall toward the kitchen at the back of the house, stopping off in the bathroom along the way. He walked into the kitchen and picking up the coffee pot from the coffee machine, went over to the sink under the window to fill it. Turning back toward the coffee machine he spotted the hooded person sitting in the chair beside the Welsh dresser. Before he could think, his nerveless fingers dropped the coffee pot which hit the floor with a loud explosive crash, sending water and broken glass all over the kitchen floor. “Who the hell are you?” he shouted. The voice that replied was male, even though the face was concealed and the words were calm and measured. “I would be carefull of your language, if I were you.” At that moment Mary came running into the kitchen barefoot, her night gown fluttering out behind her. Steve held up his hand. “Hold it Mary, there’s glass on the floor.” He purposefully looked over at the man beside the Welsh dresser and Mary followed his gaze. She gasped and immediately turned to run out of the kitchen. “Hold it right there Mary,” said the stranger, a gun immediately appearing in his hand. It was so fast, it was almost magical. Mary stood still and looked at Steve questioningly. Steve shrugged in reply. The stranger spoke again. “I am not going to hurt you, nor am I going to steal from you. I just want to talk to you both for a little while. I have some information that is vitally important and I want to put a proposition to you both.” Steve looked annoyed, “You could have knocked on the door to tell us that,” he growled. “Instead of frightening us both half to death. Who are you anyway, to come into our house like that uninvited?” The man’s reply was slightly chilling. “What if I had been someone who wanted to harm you both? You would be dead by now. I came to warn you that you are both in danger. I thought the best way to show you was to do what your enemies could do. You are lucky that I am here first. So how about cleaning up that mess on the floor, making three instant coffees, mine is white and two please and then sitting down with me and hearing what I have to say.” “What do you mean, we are in danger,” Steve asked concernedly. “Please, the coffee first. I have been sitting here half the night guarding you. I could use a drink.” Saying that he threw back the hood of his tracksuit top to reveal a person of indeterminate age and European heritage. Black hair, a dark complexion with an aquiline nose and a well trimmed beard was offset by piercing blue eyes that never wavered in their intense gaze. 29 “Sorry about the hood,” he said. “I find it comfortable. I will explain shortly but first the coffee, if you don’t mind. Please do not try to leave the room for the moment.” The gun was moved ever so slightly away from targeting Mary. Steve looked at Mary, she nodded then carefully made her way over to the cupboard underneath the sink to take out the dustpan and brush. Treading very carefully over the floor to miss the broken glass, she proceeded to clear up the mess as Steve turned to the kitchen bench top and grabbing the electric kettle, filled it and plugged it in. Ten minutes later, the three of them were sitting around the kitchen table. The stranger was on one side with Steve and Mary on the other. The gun had disappeared as fast as it had appeared. The stranger started to talk. “I must apologise for startling you. It was the only way I could guard you and get your attention. If I had just turned up at the door and tried to tell you what I am about to relate, you would have probably asked me to leave. If there is anything that you do not understand when I am talking, ask me. It is important that you both comprehend fully what I am about to impart. First, my name is Roberto and secondly I am with The Brotherhood.” He paused for a sip of coffee. “I also apologise for drawing a gun on you Mary, maybe you didn’t notice but the safety was on. You are both extremely important people. How important, you have no idea but shortly, it should all become clear to you both. Good coffee by the way.” Steve looked annoyed, “Why don’t you just get on with it then you can leave us in peace,” he growled. “Sorry,” came the reply, “but it will be a long time before you will be in peace again. That is why I am here. You see I know about Chris, your friend. A shame, my condolences. His death is not an isolated incident, there have been too many unexplained deaths in this city. Not murders, just unusual deaths, not ‘normal’.” “Who did you say you were with?” Steve asked. “The Brotherhood.” “What is that?” “A simple question but one that will take a bit of explaining. Bear with me. I know that you are religious but I don’t know how much religious history you know, so I’m going to give you both a short history lesson leading up to what the Brotherhood is today. Stop me anytime if you have a question, as this is very important. Remember, your lives may depend on what I tell you. Now, most of the, so called, Christian bibles in use today are merely a compilation of the Old Testament and parts of certain texts, especially in the New Testament, that the early Roman Church put together from the writings of some of the apostles. The Church did this with some pretty heavy duty editing, to put a certain ‘slant’ on the religion that was around at the time of Jesus. It resulted in a Christian religion that has lots of laws and rules. More was better to the Roman Church and they policed their version of religion pretty hard, 30 brooking no opposition. The original copies of these early texts are in the Vatican, locked away. The Brotherhood has access to many, even earlier copies of those texts that were ignored or destroyed by the Catholic Church, as it came to be known. The texts that The Brotherhood has are older and more reliable. Most present day Christian religions are derived from those early bibles put out by the Roman Church and that is where most of the problems arise. Essentially, The Brotherhood believes that there is only one God and that Jesus was not his ‘son’. Somewhat similar to the Jewish and Moslem religions. The Christian angle is one of the things that the Roman church started. They needed a religion that went one better than all the others, so they invented Jesus as the Son of God dying for our sins. With the incorporation of the Holy Ghost, they ended up with far more angles to their religion than any other on the planet at that time. By cleverly making the Christian religious festivals coincide with earlier pagan festivals, they drew in quite a large consumer base. Any challenge to the Catholic version of things is first ignored. If that doesn’t work, the next step is to use heavy duty discrediting and if that doesn’t work, any opposition is crushed. Throughout history, the Catholic Church has purged whole sections of communities and populations. Did you know of the Crusade in the Languedoc, in what is now southern France? It was called by Pope Innocent III in 1209. An army of 30,000 knights and foot-soldiers ravaged and razed the whole area. They came from Northern Europe and didn’t even have to cross the sea to do it. The knights wore red crosses on their surcoats, doing the Church’s work. In one town alone, Beziers, 15,000 men, women and children were put to the sword. This whole area was a centre of learning with many universities and churches and the people that occupied it were known as Cathars. Their beliefs did not suit the Roman church, which is why the crusade was called. The dark ages soon followed that crusade.” Here Roberto paused in his story and drank the remainder of his by now, cold coffee. Steve was stunned, “Is all that true?” he asked. “You have my oath on it,” replied Roberto. “I hope to be able to show you the documentation.” Steve glanced at Mary who was sitting with her mouth hanging slightly open. “Yes, but what relevance does that have for us?” Roberto smiled, “There is much more to tell before I get to the end of my tale.” “What say we all pause and have some breakfast and fresh coffee? Mary? Steve?” Steve looked at Mary and slightly lifted one eyebrow, she replied with a tiny one sided smile. Neither of them felt threatened now and they were both interested in what was unfolding from this unusual encounter with a stranger in their kitchen. “You go to a lot of trouble for a free breakfast,” Steve remarked over his shoulder as he and Mary quickly whizzed around the kitchen putting a breakfast together, moving around and past each other with grace and speed. Before long they were all tucking into bacon and eggs with heaps of toast. The kitchen was bright, light 31 reflecting in through the windows from the snow which had been falling all night and outside the back garden was all white, white, white. Central heating was a real bonus sometimes. After the dishes had been cleared away, Roberto continued with his discourse. “Most of the early religions in the area now known as The Middle East were all based on the Old Testament. Islam and Judaism are basically similar, neither believe in Jesus being the Son of God and for good reason. That is a Catholic invention as I have already discussed. Now comes the clincher. There is evidence, although not extremely strong, that Jesus was not crucified for real but rather that the ‘crucifixion’ was a private ceremony held in a private garden. A sort of ritual rebirthing that was not uncommon in some Jewish sects in those days. After the ceremony, Jesus slipped away and if you want to go out on a limb, there are reports that he is buried in the Kashmir region, although we cannot substantiate those. The important thing is; Jesus was the King of the Jews. He was not some poor little kid as is generally portrayed and he often stayed with rich relatives. Trouble was that Rome could not allow his popularity to grow because their hold on the region was tenuous. Pontius Pilate was bribeable you know and Jesus was from a rich extended family.” Here Roberto paused and asked if he could use the bathroom. While he was out of the room, Steve turned to Mary and asked her what she thought of Roberto and what he was divulging. Mary looked serious before replying. “Let’s see what else he has to say. It is very interesting so far but I don’t know whether to believe him or not. He seems okay, apart from the gun thing. I must admit he had me worried earlier but I feel he is honest and trustworthy. You know, that female intuition thing.” Steve nodded, “Yeah, I feel it too.” Roberto entered the kitchen, “I am glad that you trust me. I could hear you from the bathroom. It is a good thing. Now we come to why I am here.” Steve and Mary gave him their complete attention as he started again. “After the crucifixion, real or not, James, his brother and the Magdalene, Jesus’ wife, travelled to the area of what is now Marseille in the south of France. The Magdalene was pregnant with the child of Jesus. The blood of Solomon and David, descending through Jesus and James, is the blood of the Kings of the Jews. The Jewish people and God go back a long way. The Brotherhood was formed to guard this bloodline where possible and to fight the evil that is always trying to take over the world.” Here, Roberto paused and looked from one to the other before continuing. “You both have that blood in your veins. Steve twice, through both mother and father and Mary, strongly through her mother.” After dropping this minor bombshell, Roberto sat back, waiting. “How do you know this stuff about Mary and I?” Steve asked him, interested in spite of the strangeness. Roberto put his hand into his pocket and withdrew a 32 couple of folded sheets of paper which he proceeded to unfold and flatten out on the table. “These are your genealogies going back to the Merovingian bloodlines of about 1000A.D.” “What!” Steve exploded in surprise, echoed by Mary’s gasp a second later as the import hit her. “How? Why?” “Simple. The Brotherhood keeps track of all the important bloodlines. We are not a small organisation and we have many resources you know. More than you could ever imagine. See here, Steve. This is you, an only child. Your Grandfather, the one who left you the money, was in The Brotherhood. He migrated out here after the Second World War from Scotland. Sinclair derives from Saint-Claire which originally was French. A lot of French people went to Scotland in the fourteenth and fifteenth century. Your mother, on the other hand, had a father who was a French Canadian. That is why you have the blood on both sides. Mary derives from a pretty pure branch of the Merovingian bloodline known as the Hapsburgs, who were a northern European branch of the family living in Austria and Germany. Hard to say which, as those borders have changed so much in the last couple of hundred years. There is your lineage. Both of you are of the line of David, who was favoured by God. You will have talents that are not found in a lot of people, whether you know it or not.” ‘Yeah, I get prickly feelings on the back of my neck when I am near someone evil.” Steve volunteered. Mary added her contribution. “Yes, and I just ‘know’ when someone is bad.” “How do you ‘feel’ about me?” smiled Roberto. They looked at one another puzzled then looked at Roberto. “Nothing.” In unison. “Good, I would have been worried if that wasn’t the case. Now, have you noticed anyone lately that has caused you to react?” Steve looked a little concerned. “Yes, as a matter of fact we have.” He exchanged a meaningfull look with Mary, then continued. “Both Mary and I felt very strongly about Chris’ friend Ruth. She came to dinner here once but it was a strained evening. She was bad all the way through.” Roberto was visibly excited. “Did she have black hair, a pale skin and look slightly oriental?” “Yes. How did you know?” They both spoke in unison and then looked sheepishly at each other. “She has been mentioned in relation to a number of our recent enquiries around town. You say she uses the name Ruth. This could be very helpfull. I actually came here for two reasons. I want both of you to join The Brotherhood, so you can learn how to defend yourselves and understand how to use your gifts and also because you are in danger.” He sat back and watched them both, waiting for a reaction. It was not long in coming. “Why are we in danger?” Mary asked seriously. 33 Roberto looked pleased with her response. “Because you have both met Ruth and know something about her.” Steve and Mary exchanged glances. “You seem very well informed,” commented Steve. “When you are in the business I am in, you have to be.” “What exactly, is your business?” Steve asked him. “The Brotherhood hunts down evil. We kill the Devil’s children wherever we can find them. Ruth is a demon, one of the Devil’s four children. It has taken us a long time to track her down. Now with your help, we have a lead. She must die. Unfortunately we cannot kill the Devil. He is the Dark for God’s Light and can never die but his children can. That is what we do, wait for groups of deaths and unusual occurrences in one location, then investigate. Ruth is the youngest, a replacement for the last one The Brotherhood killed over sixty years ago.” “No way,” Steve interrupted. “Ruth is nowhere near sixty years old.” Roberto looked patient as he continued. “Demons have a long life span. They have fifty percent of the Devil’s genes and he is immortal. One of his current children, Tyrus, is close to seven hundred years old and is by far the most dangerous of them. We don’t know where he is at present. It is a bit of a worry as he is exceedingly clever and totally ruthless. You are in danger because Ruth will try to kill you to make sure you cannot involve her. It has to be an accident as she cannot kill innocents directly. Your house may burn down with you in it, your car may have an accident or you might just simply drown.” “I find this all too unbelievable. Just too pat. What are you after really?” quizzed Steve. Mary merely looked uncertain. Roberto took Steve’s hand in his, saying earnestly. “Let me stay here for a couple of days. I have some seriously researched books with me that you are welcome to read. We can talk and when you are happy about us, you can make a decision.” At exactly that moment, the doorbell rang. “Are you expecting anyone?” Roberto queried. Steve’s reply was a terse, “No.” The doorbell rang again and Steve headed off down the hallway to answer it. He carefully opened the door and looked out around the edge of it. Cold and white, the snow in his front yard was a wide unmarked expanse out to the front gate. A splash of colour caught his peripheral vision and he looked down to find a bouquet of beautifull out-of-season flowers. No one was in sight. He picked the bouquet up and closing the door against the cold, went back into the kitchen. “Who was it?” Mary asked while Roberto looked on, replacing his gun in its holster. “There was nobody there, but look.” Mary gasped as he drew the bunch of flowers from behind his back. Then she exclaimed. “There’s a card! Open it, see who they are from.” Steve took the envelope and quickly opened it and removed the card. As he read it the colour drained from his face. 34 “What is it?” Mary asked. “It reads, ‘I am really sorry that Chris died’, and it is signed, ‘Ruth’.” Roberto gasped. “An interesting coincidence, seeing as we were just talking about her. Any tracks Steve?” “Tracks?” “Yes, did you look for tracks in the snow? Footprints, that sort of thing.” Steve was looking very sheepish, so Roberto got up and went down the hall to the front door. Steve tagged along behind, still holding the flowers, while Mary brought up the rear. Roberto opened the front door and the three of them looked out at the expanse of recent, new fallen snow. Nothing marred the purity of the surface, not a mark, not a scuff, nor could any trace of a footprint be seen. The surface was unbroken right out to the footpath beyond the front gate. They looked at each other for a moment, then Steve quickly shut the door. Turning to Roberto, he asked tersely. “When did you say you were moving in?” 35 Chapter 6. Roberto had left to get whatever things he needed and some of the books about what he claimed was the ‘true’ religion. Steve had his doubts about all of it but being the sort of person that he was, decided to keep an open mind. The snow had ceased falling but the skies were still leaden and grey, brooding. Mary had gone to the kitchen and was busily cooking lunch in anticipation of Roberto’s return. She seemed to like him. That was a good thing, as her intuition about people had yet to be proved wrong. Steve was in the study contemplating the onyx and the silver boxes when the telephone rang. It was Michael, Chris’ brother. “Hello. Is that Steve?” “Yes it is. Who am I speaking to please?” “This is Michael. Happy New Year.” “Same to you Michael, how can I help you?” “Well, I got a phone call from Sis a few days ago to wish me a Happy New Year. She is over in France. She mentioned that she was running out of money. I was just wondering if you had received anything from the insurance company yet with respect to the payout on Chris’ car.” “Sorry, not yet. The police have been stonewalling me a bit on getting the car released. The insurance company will not pay out until they have the car in their possession. Leave it with me, I will chase it up immediately and get back to you within the next couple of days. I have some good news though, Chris’ personal possessions have been released to me and there is just over one thousand dollars, in cash, in his wallet. I could send it to you.” “Thank you Steve. You don’t know how much of a help you’ve been to Sis and I in this matter. Talk to you later. Bye.” Steve sat looking at the phone in his hand. It was time to buy some mobile phones, one each for him and Mary and one for Detective Mike Carruthers. That would diminish the risks of their conversations being overheard in case his telephone was being bugged. Steve took out his notebook and rang the police station. When the call was answered, he asked to be put through to the officer in charge of impounded vehicles. There was a pause, then after a few rings it was answered. “Hello. This is Steve Sinclair; I have the power of attorney relating to Chris Wilkins’ estate. I believe you have a burnt-out, red Corvette convertible in the impound yard.” “Yes sir, we do.” “Well, I would like it released immediately, as the insurance company is waiting to take delivery of it.” “Sorry sir but I can’t do that, I have instructions not to release it.” 36 Steve was getting used to these sorts of replies and countered instantly. “You do realise that the case is now closed and there is no reason to hold onto the car don’t you?” “No sir. I can only release the car with the appropriate paperwork.” “Very well. Please put me through to whoever I need to talk to about getting the car released.” “Yes sir, please hold.” The phone was put down and distantly over the line Steve could hear the officer talking to someone. The line went dead for a second and then another voice announced. “This is Captain Stobles, I have been put in charge of this matter. What do you want?” Steve was suprised. “I wasn’t expecting to talk to a Captain but as you are aware, this case is closed and there is no reason, as far as I can see, that the police should keep the car.” “That is our business, sir. When we wish to release it, we will.” The Captain’s response bordered on gruff. “Well, I am making it my business now, as the relatives of Chris Wilkins have need of the money from the insurance on the vehicle and I have the power of attorney in the estate. If I do not hear back from you within one hour, I intend ringing my lawyer and finding out why the release is being blocked and who authorised it. Believe me, I intend to get to the bottom of this and will not give up. I have resources enough to make things happen. Your choice. Goodbye.” Steve hung up, his hands shaking. In his whole life he had never spoken to the police in such an abrupt manner. He was not going to take any more crap from these people. There was definitely something fishy going on. Roberto turned up soon after with boxes of books, a suitcase and a trunk with locks on. Steve helped him move his things into one of the spare bedrooms but was intrigued by the trunk. It was very heavy. “What’s in the trunk?” he casually asked. “That is for later, when the time is right. You need to walk before you run my distantly related relative.” Roberto smiled. “What!” “We share the Merovingian bloodline Steve. I thought you realised that. All active members of The Brotherhood do.” “Yes, sorry. By the way, do you have a mobile phone?” “Sure, I will give you the number later. Do you?” Roberto raised one of his expressive eyebrows. “No, but I am getting one later in case the telephone is bugged.” “Excellent,” was the succinct reply. They had a pleasant lunch, sitting in the kitchen and chatting about inconsequential things for a while, until the telephone rang. 37 It was Captain Stobles, a little more conciliatory than earlier in the day. He said he had taken the matter up with his superiors and the car was now to be released. He also mentioned that there had been a bit of a mix-up with the paperwork and that he didn’t want any trouble. The car was now available to be picked up from the police impound yard. However, there was no apology forthcoming from that quarter. When Steve related the good news to Mary, Roberto looked over at Steve. “Any chance of getting a look at the car before the insurance company takes it?” he asked. “This could be your first lesson in our methods.” “Sure, we could do that. I’ll go ring a towing company to pick it up and we can have a look at it on the back of the truck when we get it out of the impound yard. I will have to go down to the police station to sign for it anyway. On the way I can buy a couple of mobile phones and introduce you to an honest policeman.” Roberto beamed, “That could be very usefull.” He turned to Mary. “Will you come with us please? I would feel happier knowing you were safe.” Mary nodded, a look of concern passing over her face. An hour later, with three mobile phones in his pocket, Steve was at the police station with Mary and Roberto. He scanned the directory at the entrance and found Detective Mike’s room number. The three of them then went upstairs and Steve knocked on the door. “It’s open.” They went in to find a very astonished Detective Mike Carruthers. “Shut the door, quickly. Sorry, but you shouldn’t be here. Who’s this?” Introductions were made and Roberto and Mike sized each other up before shaking hands in a firm and friendly fashion. Steve handed a mobile phone to the detective and also gave one to Mary. They spent the next few minutes programming each others numbers into the mobile phones. “Good,” the detective said. “At least we can talk to each other without getting bugged. Just remember to keep the phone with you at all times. Steve, have you talked to the people at the Holiday Magic hotel yet?” “No but it is the next thing on my list to do. Anything I should know?” “Yeah, offer them money to tell you the truth. I know you see it on the movies a lot but it does work. We want to find out as much as we can about what has been going on. What did you say you did Roberto?” Roberto looked directly at the detective, “I didn’t but I will tell you, as you are a good man. I am with The Brotherhood.” At the mention of that name, Detective Mike went very still. He looked anew at the figure standing before him. “I am a Freemason. We know a little about The Brotherhood. Has it come to that?” “I am afraid so Mike. There is a nexus of evil in this city and I am here with others to root it out and try to destroy it.” 38 The detective’s gaze took in the three people standing in front of him, they were so young, so vulnerable. “If I can help in any way, without being found out, let me know. The work you do is important and I can be of assistance.” They all thanked him and took off, making sure no one was watching as they slid out of the office and went down to pick up the paperwork for the car’s release. The tilt-tray tow truck was there and very shortly after flashing the paperwork, the three of them were following the truck, bearing the remains of Chris’ Corvette, back to Steve’s place. The tow truck driver was getting a little impatient, as the afternoon was wearing on and he had to be back at the depot by six o’clock, before which he had to drop the car off at the insurers. It was also starting to get quite cold as the sun descended rapidly in the skies. A fifty dollar bill and the promise of a cup of coffee put a smile on his face. He waited in his truck while Roberto went into the house. He returned with a small hand held bag and a hot coffee for the truck driver. Steve and he climbed up onto the back of the truck and took their first serious look into the car. It was a mess. The fire had burnt a lot of the interior to bare metal. All of the plastics had virtually disappeared but the leather seat uppers were still recognisable. Behind the seats there was a huge rent in the floor caused by the car being impaled on a large steel sculpture after it left the overpass when the accident occurred. There wasn’t much left in it at all. Roberto set down his case and opened it, taking out a small camera. “This is a digital camera with a macro lens. I will photograph the interior and exterior all over and we can analyse the photographs after I download them into the computer.” He set about working quickly in the fading light, the camera flashing with each picture, while Steve looked on, slightly sickened by the thought that some of his friend may still be amongst the ashes on the floor. Roberto then put some gloves on and picking up tweezers and some zip-lock bags, started to pick up small samples of whatever he thought important. When he came to the seats, he held open the crack between the upright and flat part of the seats and picked out samples of something which he placed into the little bags. The passenger seat seemed to interest him the most. After ten minutes he was satisfied. “Well, that’s it. Do you want to do anything further?” he asked Steve. “No, I have had enough of this.” Steve choked down, glad they were finished. They got down from the back of the truck as the last of the light was waning and sending the relieved driver on his way, hurried into the house. It was warm and cosy inside, much to their relief as they were both quite chilled. Mary had made a hot meal for them and they ate in silence, quickly, as Roberto was going to do some analysis on the photographs and samples. After the meal, the table was quickly cleared and Roberto opened the suitcase, instructing both Steve and Mary to pull up chairs beside him so they could watch him at work. The inside of the case lid was a computer screen and other electronics could be seen inside the case itself. Steve was impressed. This was really high tech gear, 39 very expensive. Roberto loaded the pictures he had taken into the computer and brought them up on the screen one by one, looking for something at ever higher magnifications. Nothing. Then he adjusted the pictures, changing the light source to create deeper shadows and ran through them again. He finally stopped at one with a sigh. “Look. Right there. This is a picture of part of the outer passenger side door, just below the top of it. What do you see?” He fiddled with the computer a bit more and there on the screen were the dished impressions left by four finger ends. Just below each one, was a single, evenly depressed small mark, digging into the fibreglass of the door. Steve looked at Roberto. “What is it?” “The impression of four clawed fingertips that were extremely strong. That is why they have marked deeply. Demon claws. There was a passenger in this car that was not human. It probably gripped the door reflexively at the time of the crash. Now, one more test.” He took one of the zip-lock bags and carefully extracted a tiny fragment of something which he placed into a slot inside the equipment in the suitcase. He activated a switch. “This came from the crack in the passenger seat. I believe it is a piece of skin which would have been shed at the transformation from human to demon. The machine should be able to show us soon.” There was a small beep and Roberto pressed another button on the computer. The picture on the screen changed to show chromosomes, human, nearly and definitely female. The Y chromosome was obvious in the picture. Roberto was not suprised by what he saw. “A female demon was in the car before the time of the accident. My guess is that it was the demon known as Ruth.” Steve and Mary exchanged a look with each other. Their fears had been realised and a small amount of guilt at not being able to help their friend was also contained in that look. Despite the guilt, Steve was really impressed with the quick confident way in which Roberto worked and the equipment he had to work with. He may not believe in Roberto’s version of the Bible at this time but he recognised integrity when he saw it. Roberto was a ‘good’ man, Steve and Mary should hear him out thoroughly and take the information he gave them without prejudging. You never knew, Roberto may just be right. After everything had been cleared away and the kitchen tidied up, the three of them adjourned to the lounge where Roberto starting pulling books, some of them extremely old, out of a solid cardboard box. He laid them out on the coffee table in piles, with a brief comment on each pile. “These are the copies of the original scriptures on which the New Testament is based. When you read them, you will notice differences to the current one. These are a history of the bloodline of David and Jesus, Kings of the Jews. This pile is the history of our Order and here is the verifiable data on the four children of the 40 Devil, the Demons. It is a bit scant in places. Read what you wish, if you want to. I would like you to, please. Now I must bid you goodnight as I am really tired and have sleep to catch up on.” Startled, Steve and Mary looked up and both wished Roberto a pleasant night’s sleep and blessed him. Roberto smiled shyly and went to bed, leaving them to their studies. It was midnight before Steve and Mary could tear themselves away from their reading and head for bed, making sure all the windows and doors were securely locked before they turned in for a well earned night’s repose. Steve found himself in a desert, low sand dunes with rocky valleys in between. The valley floors had low crooked cactuses growing in them and the whole scene was bathed in a reddish light. He was standing, wondering what was going on, when a voice spoke from behind him. “Hello my friend, good to see you again.” Steve whipped around. “Chris! Is that really you? How? What?” “Steady on, be calm and listen. I don’t know how much time we have. One of Ruth’s ‘clients’ smacked her up the side of the head and knocked her out, which has freed me up until she comes around. This is what her mind looks like. Bleak, isn’t it? You are dreaming at this moment but it is really me. I want to show you something. Come this way.” With that, Chris set off across the landscape, Steve following, his mind awhirl with what was happening. They trudged up a sand dune and cresting the top saw before them an oasis. The pool of water in the middle was crystal clear and palms and shrubs grew around the edge. “What is this?” Steve queried. “It is mine. I made this, all of it, in the short time I have been here but I want to show you something in particular. Look over there, see that rose bush growing. It even has flowers. Ruth made it, without being asked. It is not evil and I believe that she is not totally evil either.” Steve looked sad. “We just found evidence that she was in the car with you when you died.” “Yes but she didn’t kill me. She wanted me to be her minion. You know, an evil person in thrall to a demon. I couldn’t bring myself to be totally evil. We fought while I was driving too fast and then I lost control of the car. It was my fault I died in the accident, not hers. Since I have been in her mind, I have discovered a lot about Ruth. She was born about sixty years ago, her mother was a Catholic nun. The Devil appeared to her mother as a handsome young priest and by dint of lies, managed to seduce her. He likes doing shit like that, it amuses him. Ruth was born and her mother left the convent, eventually taking up teaching. She had a happy childhood. Neither of them knew the Devil was her father until she started to menstruate. That is when He came and took her. Her eldest demon brother was her first sexual encounter and during the next few years, between the Devil and the demons, they killed any good that was in her and planted evil. 41 That is the desolation of the desert. Look before you though, an oasis and she hasn’t destroyed it and has even got a plant of her own growing. I firmly believe that Ruth can be saved and plead with you that you help me.” Here, Chris stood in front of Steve and took both of Steve’s hands in his. “Promise me as my friend that you will do everything you can to help Ruth turn from being evil. Quickly, I feel her starting to stir and I have to send you back. Please, promise me.” Steve looked into his friends eyes, they were so sad. “Okay, I promise. I will do whatever I can to help Ruth escape evil.” Chris smiled, “And I will help you whenever I can, my friend. I am learning how to use her powers.” Steve suddenly sat bolt upright. He was in bed. Rubbing his eyes, he looked around but saw nothing in the darkened bedroom. Beside him, Mary stirred at his change of position and reached out an arm in sleep for him. What a dream. What would his overworked mind come up with next? As he lay back down he turned his head to the left. There, on the bedside table, seen in the dim glow from the alarm clock, was a perfect white rose. 42 Chapter 7. Andrew stood, gazing out from his office window on the sixteenth floor of the Fleeting Image Advertising Agency, at the scene below. White was the motif. Apart from where heat escaped the buildings and tyre tracks had melted the snow, the whole cityscape before him was mono-colored. It had stopped snowing recently and a melt had almost started but plunging temperatures overnight had frozen the snow solid. Andrew hated the cold with a vengeance, he would have much preferred being somewhere a lot warmer. He hadn’t really quit from his job a few months ago like he had told Chris, that was a lie. Andrew liked telling lies; it was fun and anyway, why quit a job where your dad owned half the company. What he had done however, was to promote himself, so he could get off the fourteenth floor where the drudges worked and into an office of his own, two floors up, where he had some privacy. There was a discreet tap on the door and Louise entered as Andrew turned from the window. “Yes Louise, what is it?” “Good morning Andrew, I just popped in to tell you that the airport is closed. Tyrus and Sonya were due to fly in this morning but their flight has been rerouted to Bravura, due to the runway being iced up here. I guess they will get a rental car and drive down.” Andrew frowned. “How long do you think that will take?” “Oh, about six to seven hours in these conditions,” replied Louise. “Damn. Well, not much we can do about now. Let me know when you hear anything further.” Andrew went back to his surveillance of the weather. Louise coughed discreetly and Andrew turned around to face her again. “Mr. D would like to know why Ruth is being a bit strange.” She smiled a little as she lowered her gaze. Being the Devil’s favourite was quite a good thing to be when dealing with the family. “Ruth is not being strange. She is just putting more time into the club these days. The videotapes of so called deviate behaviour that we have made there are paying of handsomely as blackmail for City officials and Ruth is working hard to build up the numbers we have on our side. If Mr. D wants to know anything about Ruth, he can always go and see her at the club. She is the youngest of us and still needs some further training of her abilities.” He sighed and pulling out his chair, sat at his desk, leaning back to look up at her. “She will be fine, just try and keep the old man off her case for a while. All of us will be together shortly and things will change.” His eyes narrowed and he transfixed Louise with his gaze. “Remember, you may be Dad’s favourite but you are not one of the family, yet. Be very, very carefull around Tyrus. He doesn’t fear the old man much and will maim you at the drop of a hat if he feels you are being disrespectfull. I won’t warn you again. Remember your place.” 43 Louise looked suitably chagrined as she backed out of the door but once the door was closed her beautifull face transformed into a mask of rage. Who did he think he was, to tell her what to do? She was the Devil’s favourite, which meant a lot. Fuck Andrew and his warnings. All it took was the right manipulation and she could have anything. Two hundred and fifty kilometres away, the international flight from Europe touched down and taxied into the terminal building. As the passengers filed out through immigration, all female eyes magnetically swivelled to observe the tall, bearded Arabian looking gentleman accompanied by a stunning blonde woman. Tyrus was used to the attention, he was handsome in that dark, exotic fashion that women find irresistible. His conception had been another of the Devil’s little jokes. A seduction of a little Jewish virgin over six hundred and fifty years ago that had brought shame to the family of the Rabbi had resulted in the birth of Tyrus. He had been using that attraction to his evil advantage ever since. He smiled secretly to himself as he put his current passport away in his pocket, if these women only knew, they would run screaming from his sight. Beside him, the blonde woman, Sonya, was a real contrast. Her mother was Scandinavian, one of the early converts to Christianity. The Devil liked his little jokes and there wasn’t much point in knocking up heathens. Tyrus and Sonya travelled as man and wife even though they were half brother and sister. It was convenient and a good cover, besides they liked having sex together. As themselves or as demons it didn’t matter, it was excellent either way. Humans were so frail sometimes when one let rip in the throes of passion. They had both left many dead people behind them after sex sessions that were intense and turned out very messy. Sonya had been caught once tearing out someone’s heart at the moment of orgasm and had to turn into her demon form to get away. The Devil frowned on that, as he wanted the existence of his children kept very low key. He was concerned about organised resistance to the family and the chance of one of them being killed. It had happened in the past, most recently about sixty years ago. Humans were soft and squishy but dangerous when organised, especially when HE was on their side. Tyrus told Sonya to wait for him out the front of the airport and then headed over to the rental car desk, smiling at the woman behind the counter as he approached. She flushed pink and fell over herself to help him and within minutes, Sonya and he were outside, where a top of the line Audi Quattro sports car was being brought around to them. They put their luggage in the small boot. “Pity we have to drive.” Sonya commented. “Why? I like to drive. All those years of dirty horses and slow carriages that I have had to put up with. This present age has no idea how lucky it is in that respect.” “Well, if you put it that way, I guess you have a point.” Sonya relented. 44 “Sure do sis and we can have some fun on the way.” Tyrus followed this comment with a broad and evil smile. Sonya knew that smile, someone was about to die. They hopped into the Audi and drove from the airport. The roads were slippery but the four wheel drive and traction control on the car more than made up for it. Besides, Tyrus had been driving for over a century now and was rather good at it. If it wasn’t for the stricture about publicity he would have been a world class racing driver. That would have been a problem when he didn’t age along with everyone else though. He turned the Audi up the curving access road onto the highway and headed for their destination and a long awaited family reunion. Sonya looked puzzled. “It would be quicker to take the Freeway wouldn’t it?” she asked him. “Yes, but not as much fun as we are going to have,” was his enigmatic reply. As the afternoon wore on, the light started to fade and headlights were going on. The traffic was light. Not many people were on the road due to the weather but very soon Tyrus gave a chuckle. “Sit tight Sonya. Fun time!” Away in the distance a set of lights were coming towards them. As they got closer the other driver dipped his lights. Tyrus didn’t and moved their car over the centre line until he was driving straight at the oncoming vehicle. The other driver flashed his lights at them but Tyrus stayed where he was. As the other car moved over to the side of the road, so did Tyrus, accelerating even more. The other driver only realised at the last moment how fast Tyrus was going and wrenched the wheel over so the two cars wouldn’t collide. He lost control of his vehicle and it skidded sideways off the road, at speed, rolling a number of times to eventually come to rest wrapped around a tree. The driver was impaled on the steering column. Tyrus laughed with glee. “I do so like driving,” he said. His next target was a semi trailer loaded with fuel. Although at the time all he could see were truck lights coming towards him. It was a close thing, with the back mudguard of the sports car being dented by the back of the trailer as it went into its final, fatefull, jack-knife slide. Only some excellent driving by Tyrus kept their car on the road as the truck and trailer overturned and exploded into a huge fireball, visible for miles. It didn’t matter if Tyrus and Sonya were in an accident, a quick change to demon form would render them virtually indestructible. It had always been easy for them in that respect. It was all a game. One Tyrus had played many times before. “What do we do about the damage to the car,” Sonya asked him. “Drop it off and tell them we swerved to avoid a deer and went into a skid and hit a roadside fence. It doesn’t matter, insurance will cover it.” “Hope Dad doesn’t find out.” Tyrus grinned, “No matter if he does, what’s he gonna do?” 45 They played chicken a couple of more times with other road users until they got close to the city, only managing to kill one further person before dropping the rental car off. Tyrus went in to the office alone, having left Sonya down the road a ways. His explanation of the rear mudguard damage was accepted by the lady at the counter who tried to find out where they were staying. Not for any reason other than she hoped to bump into Tyrus later that evening. Literally. “Looks like I will have to change passports again,” Tyrus said to Sonya as they walked away from the rental car agency. She smiled, it was not the first time this had occurred. Walking down the road about a block they found a narrow alley and ducked into it. Tyrus flashed in and out of demon form. His beard had disappeared in the transitions and he now looked totally different from before. Without the facial hair, his nose looked a little more hooked and his lips a little fuller. It would not have been easy to compare the previous bearded version with the present version. His passport was torn up and dropped into a dumpster and he retrieved a new one from his briefcase, one of six spares, this one showing him clean shaven and with a different name. Heading back out to the road, they caught a cab to the Fleeting Image Advertising Agency building. Before long they were up on the sixteenth floor sitting in Andrew’s office. Louise was introduced to them and Andrew, being aware of Tyrus’ proclivities, suggested he did not ‘fiddle’ with her as she was the Devil’s favourite. “How is sister Ruth?” Tyrus asked Andrew. “I haven’t had her or tried her out for over fifty years. I hear she is a bit of a Hell Cat when she gets going.” Sonya looked on approvingly, her brother was so disgustingly direct sometimes. What a demon he was! Andrew looked a little discomfited, “I’m afraid Ruth will be a little uncooperative at the moment. Due to the pressure she has been under with our venture into tape recorded recruitment, she is feeling the strain and has been acting a little out of character. Nothing serious you understand but you will get to meet her later when we have our family conference. Dad is keen to get going on the new venture and we will explain it all later this evening. Meanwhile, both of you are booked into the best hotel in town as husband and wife, as per your request. I suggest that you check out your accommodation, have a look around and be ready to be back here around half past midnight. Dad will teleport you both in, this floor is secure from prying eyes.” Tyrus looked at Sonya for confirmation, a small nod was sufficient. They both rose and headed for the door. As they were exiting, Tyrus turned at the door and spoke to Andrew. “See you later little brother.” Then with a wink at Louise he followed Sonya out. “He is dangerous.” Louise confided to Andrew. “Yeah, you have no idea how much of a loose cannon he can be,” was Andrew’s response. “He is however, simply brilliant and we need him. Sonya keeps him in check a little but she is nearly as bad as him. It’s their age you know. Six hundred 46 and fifty years of evil will do that to a demon. I have no idea how Dad keeps it all together. He’s been at it for thousands of years.” Louise said nothing but her mind was working overtime. Being the Devil’s favourite was maybe not quite what she had anticipated. What if he decided to pass her around? Tyrus scared her shitless. Steve, Mary and Roberto arrived at the Holiday Magic Hotel. It was an hour and a half drive down the coast from the city, more in the snow. They had come here to talk with the day clerk who had observed Steve’s friend, Chris, leave the hotel on that fatefull day when his landlady was murdered. The roads were icy, so the drive took them a little longer than expected and they arrived just before the day clerk knocked off work. After a round of introductions, Roger, the clerk, asked them what their business was. Steve took him to one side and explained that Chris was a friend of his and he didn’t believe that Chris could have killed anyone. A hundred dollar bill changed hands and Roger smiled and started talking. “When the police came they didn’t want to know much. They acted like they had already decided he was guilty. I only saw him leave. I remember the time because I was just about to finish my shift. That’s at six in the evening. I remember Chris because of his car, the red Corvette convertible. In fact, I watched him drive off, so cool. Funny though, he headed off down the coast, not back to town but the police weren’t interested when I told them that. They reckoned he only did that to make people think he was going south. I don’t know what time he returned as I had already knocked off but Serge might. He was the night clerk that night. He will be here shortly. Hope you find out what you want to know, the police were bastards. Thanks for the tip. Good Luck.” With that Roger wandered out of the hotel heading for his car in the carpark, finished for the day. The three of them headed into the empty bar to wait for Serge. According to the barman it wouldn’t be that much longer before he arrived. Steve bought a round of drinks for them and they sat around a table talking amongst themselves while they were waiting. Before much longer, an earnest young man in hotel uniform introduced himself to them as Serge. After an exchange of handshakes and the passage of another hundred dollar bill, Serge sat down and recounted the events of that night last October. He remembered Chris because of the car and the fact that the hotel was nearly empty. According to Serge, Chris had returned about nine thirty that evening. He had seemed fairly relaxed as he passed the reception desk and nothing about him suggested that he had committed a crime of that magnitude. The clincher was the fact that his clothes were clean, impossible, unless he had changed clothes and there just wasn’t enough time. “The police just wanted to know the time and said maybe I was mistaken. I was not mistaken, I checked the clock but they didn’t write that down.” Serge 47 informed them. “The policemen were not very nice I thought. They had already made up their minds about this.” “Or had their minds made up for them.” Roberto added darkly. When Serge had left to go back to work, Steve pulled his mobile out of his pocket and rang Detective Mike. “Hi Mike, looks like you were right. Chris couldn’t have got up to town and murdered Patricia then got back down here already cleaned up. The two hotel employees we talked to think that the police had already decided to pin this on Chris. Is there any way you could discreetly check it out? Yeah, we’re okay. What was that?” Steve sat listening with a concerned expression on his face, nodding to something that Detective Mike was saying. Mary was getting a little worried, she knew that expression well. He finally started talking again. “We are heading back now. Thanks. Yes, we will take care, talk to you later.” Steve put the phone back into his pocket then turned to Mary and Roberto. “He’s going to look into it for us. He also warned us to be carefull. There has been a series of motor vehicle accidents, including a tanker truck exploding, between Bravura and the city. Three people are dead and one is in a coma in hospital. No witnesses and all the vehicles had run off the road with no other vehicles apparently involved. Someone or something has come into the city from the direction of Bravura. Some of the police at Central police station are acting a bit jumpy. It may be just coincidence, nothing more but we had better keep our eyes open. Shall we go?” They thanked Serge again on the way out and hopping into their car, headed back towards the city. 48 Chapter 8. ‘Satans’ night club had just opened for the night and the odd assortment of clients were starting to fill the place up. It was only ten thirty in the evening and the music was barely audible above the hubbub of voices as people pushed to the bar to get drinks and snorts of cocaine. ‘Satans’ was really Ruth’s club, if the truth were known, but her father, the Devil, owned half of it. Andrew, her brother, helped with the books and the business side of things which took quite a burden from Ruth. She was the star dancer here, the one that drew the audiences night after night to see her dance her demon routine. What the audience didn’t know was that the horns, tail and glowing red eyes during her performance were real, not stage costuming. Up until a few months ago, this life was all she had wanted. The video tapes of the goings on in the private rooms were disgusting enough for her to bribe quite a few powerfull city officials and policeman to turn a blind eye to the club’s existence and leave her alone. The trade in drugs was excellent. Officially the club didn’t exist and she was doing her part for the greater cause of evil by promoting the sort of behaviour that would get anyone thrown out of any other place in town. However, she was not happy. The family did not need the money the club made, hell, the Devil could teleport all the money they could ever want out of bank vaults. The Devil had been insistent though, that the club would provide excellent cover for their many schemes and scams, including the one that Andrew had worked out for soul recruitment using audio tape cassettes. The only problem had been tailoring the tapes for the target people. Any last minute adjustments had to be made by the Devil and He had to deliver them to their targets. Trouble was he was not always available for delivery. A second problem that had become apparent was a lack of minions to help corrupt the targets by steering them into evil deeds. The plan was excellent in theory but very unwieldy in practice. Andrew had come up with a new plan, very different and innovative and there was a family meeting at half past midnight to discuss it. Her eldest brother, Tyrus, who was reputedly over six hundred and fifty years old, would be there, as would Sonya, her five hundred year old sister. Tyrus and Sonya played at man and wife. She had not met Sonya, her sister, and was looking forward to it. Tyrus she knew from her initiation into evil. He frightened her. The Devil only had four children at any one time, a rather exclusive family. Ruth’s stage act was scheduled to begin at midnight and she didn’t like to be out the front of the club mixing with patrons before it. The impact was lost. So she got up and moved to the private bedroom out the back of the underground club. The king-size, four-poster bed looked inviting, so she lay down for a while. Relaxing, she allowed her mind to wander and once again it turned to thoughts of Chris. Chris, who should have been her minion. Chris, who had given her pleasures a demon only dreamed of. Chris, who had died beside her in a car crash after trying to get evidence to vindicate himself of a murder he didn’t 49 commit. She had committed the murder, a slice and dice job on his ex-landlady, in order to bring him to heel. It hadn’t worked. Deep inside him, enough good had lingered to stop him making the final commitment to evil. In order not to lose him, she had asked her father, the Devil, to give her Chris’ soul. He was there inside her, mentally chained but not silent. Her hand crept down under her mini skirt and her fingers gently moved her thong sideways, creeping back to the tuft of black hair and massaging her moist, warm nether lips before delving inside. She shuddered at the feelings her fingers generated. Chris. Her control lapsed at the thought of him and Chris’ soul moved inside her mind, taking over the movements of her fingers. His voice intruded into her thoughts. “I love you Ruth, always. I know what you are and what you have done but I still love you. Remember, you are half human. Your mother was a good woman, seduced by the Devil for his own amusement. She taught you what goodness was before the Devil came for you. There must be a way we can be together again.” Ruth moaned, tormented by her pleasure and the fact her lover was dead. Not forgotten though, how could she ever forget, when his soul reminded her at every opportunity? She was a demon, evil was supposed to be inherent in her, wasn’t it? Her fingers were being moved faster now and the heat and moisture being generated threatened a coming explosion. At the moment of release she screamed and shifted to demon form unwittingly, her talons grazing the insides of her most delicate spot. She chuckled evilly. “Well, Big Boy.” Her favourite pet name for him. “What do you suggest?” The Chris’ spirit thought for a few seconds. “How do you feel about not having sex with anyone but me from now on?” he asked. The red scaled demon lazily rolled over on the bed, tasting her moist fingers, eyes flashing red as her tail twitched back and forth in the aftermath of passion. “I don’t know if I could do that. No more pleasures, no more corruptions. What would I do?” “You could come to bed and release me into your thoughts. I know many ways to pleasure you. I have been in your mind for a couple of months and have found all those little things that you like. Even some tender ones, Demon spawn.” She inspected her talons before changing back to Ruth. “Answer me one question. Why should I?” She smirked at posing a difficult question to the spirit inside herself, totally unprepared for the answer that came without hesitation. “Because I love you, I always have and always will. No matter what you do, that love will always be true. I loved you from the first time I met you until you caused my death and I still do. It would please me a lot to know that you cared for me enough to refrain from casual sex.” She laughed then, a cruel and evil laugh and banished him back to the dungeon in her mind, reserved only for him. As she did, a tear, a real tear, spilled out of her right eye and trickled down her cheek. Wonderingly, she reached up and collected it on the end of her finger, staring at the rainbow reflected from it by 50 the light in the bedroom. Ruth’s last tear had been shed the day she was taken from her mother by the Devil. Over sixty years before. Shaken, she rose from the bed and checked the bedside clock. It would soon be time for her act. Walking back from the bedroom, through the office to the club beyond, she thought seriously about Chris’ suggestion. Yes, she was a demon. Yes, she was supposed to be evil and laugh at feelings but something inside her moved in step with the suggestion that Chris had made. For the first time in her life, since she was parted from her mother, she felt loved unequivocally. Not for the super attractive sex machine that she was but for herself. As only Chris could know her. She resolved to try it. Smiling and holding her head high she went to the back of the stage area to prepare for her routine. The meeting, on the sixteenth floor of the Fleeting Image Advertising Agency, which was to begin at half past midnight, actually began at one o’clock in the morning. The Devil was the first to arrive, on time, closely followed by Louise, who he teleported in right after he arrived. Ruth and Andrew were next to be teleported in. Arriving in demon form they both greeted their father, the Devil, before changing to human form and dressing in the clothes he teleported in for them. Ruth’s clothing was worn a little less sexily than usual but neither the Devil nor Andrew seemed to notice. The Devil turned to Louise and asked. “Does Tyrus know what time he is supposed to be ready for teleporting here?” Louise replied to the affirmative. “I telephoned him about eight o’clock and confirmed the time of the meeting with him. I also reminded him that you do not like people being late.” “Good. Excuse me a second while I locate them.” Just then, at that moment, there was a loud report and a flash of flame shortly followed by a second loud report and a smaller flash. Standing before the group were both Tyrus and Sonya in their demon forms. Tyrus was magnificently evil. Whereas Andrew and Ruth were attractive, in a strange way, in their demonic forms, Tyrus was magnificently other world. From the top of his head to the soles of his feet, several hundred years of being a demon had transformed him. His horns were huge, fully forty centimetres long and joined across the base in a huge bony ridge which extended down the forehead to the large craggy brow ridges. The eyes were deep set liquid fire above a hooked nose with large flaring nostrils. The thin lipped mouth had fangs jutting over the lower lip. He was huge and well muscled with washboard abs above a large erect penis. His tail, long and thick, lashed from side to side as he stood there and both his hands and feet ended in long, strong talons. Sonya was similarly presenting but not being quite so old; the changes had not carried quite so far. Her breasts, normally average sized, in this form were small with sharp points where the nipples were expected to be. 51 Tyrus, retaining his demon form, walked over to where the Devil was seated and went down on one bended knee. “Master, I am yours to command. Use me as you see fit and let me feed.” Sonya moved right beside Tyrus also on one bended knee. “My Lord, we came at your bidding to do your work. Command us.” “Rise, rise and be welcome my eldest children.” Turning to Andrew and Ruth he commented. “I do so like the old ways, when respect was automatically given to the powerfull. Take note you two.” Turning back to Tyrus and Sonya he spoke again. “It is time for you to meet your youngest sister, Sonya. Andrew you already know. This is Ruth, very young, less than seventy human years old. She replaces Tanya who had her head cut off by a jealous lover or The Brotherhood, while she was in human form but you already knew that.” Turning to Ruth, the Devil beckoned to her with a finger. “Come over here and say hello to your eldest brother and sister. They have travelled far and can teach you much.” Ruth rose from her chair and went to shake the hands of her brother and sister but Tyrus grabbed her hand first and hugged her roughly to him, poking his giant erection into her stomach as he did so and whispering in her ear. “I will try you out later sister. Be ready for me.” His leer was way above the top of her head as he towered over her diminutive figure. She pulled away from him irritatedly and shook hands with Sonya who smiled at her a tad maliciously. After Tyrus and Sonya had transformed into their human forms and the Devil teleported in some clothes for them to dress in, the group sat down together. Louise fetched strong coffee, a favourite of the demons and set the mugs down on the table before filling them from the coffee pot. Placing the pot on the table she went and sat down beside the Devil with an almost proprietary air, which was not lost on the group. “Is she worth trying out?” Tyrus asked the Devil, nodding at Louise, who looked extremely alarmed at the prospect of being handed to the Devil’s eldest son. “I haven’t fully broken her in, she won’t be ready for your brand of service yet,” was the reply. Tyrus knew better than to argue. “Right,” the Devil spoke authoritatively, “Shall we begin? You all may or may not know the full story but in a nutshell, Andrew found a way to get around the RULES. It involved a music cassette tape being prepared, with modern music, which had a run of songs on it gradually sucking the listeners deeper and deeper into evil by first hooking them on easy rewards then dragging them into depravity. It was the prototype in a scheme which looked quite promising. We had a number of copies of the tape prepared, which allowed us to lead quite a few people down the pathway to evil simultaneously. As the necessary warnings were on the cassette and in the first songs, we could start the ball rolling automatically after the victim received the tape. We had hoped to have quite a few minions by now to help run the system. The idea was good but in practice the scheme has proved difficult to run and soul pickup is not fast enough, so we are going to scrap it. We need souls fast at the moment because HE is having a 52 few problems due to HIS religions fighting each other and we could attempt a takeover bid if we had a large enough army of tortured souls. Andrew however, has come up with another idea that sounds like a winner for us. I will let Andrew explain it as it is too high tech for me. Andrew.” The Devil sat back in his chair gazing at his family. Pride was a sin he enjoyed. Gazing at the fruit of his loins made him grin with satisfaction. He looked at his youngest, Ruth. She was a worry. Rebellious with just a touch too much human about her yet. That would change as the evil matured within her. It took time to make a really bad demon. His eyes swivelled to Tyrus, his pride and joy. That was one mean ‘mother’ of a demon. If only they were all that bad, he could rule the world. The group were all looking at Andrew who cleared his throat before he spoke. “The tape idea lacked sophistication in the delivery system and the amount of input required from us, so I tried to think of something that would run itself and be popular enough to travel through the earth’s susceptible population. I hit on a computer game. We could take the theme of the tape and transfer it to a game. A first person role playing type of game. In the vein of creating someone’s life from down and out no-hoper to successfull go-getter. All the warnings would still be in the songs embedded within the game, so that would get us around the RULES. To go to each new level within the game would mean finishing each section by accepting the prize for that level. The person playing the game is actually controlling the evil in the game by making decisions about committing acts which are deemed evil by.....” Here, Andrew raised his eyes in an upward direction. “You get my drift. The beauty of it is, that one story line will work for every game. Male or female is chosen by the player at the start and the game runs for either. When someone gets to the end of the game, their soul is ours. We will put sex into it in a big way, as that is a good hook, so our target audience is eighteen and over. No doubt the youngsters will make copies and pass it around. We make it cheap, addictive and easily copied.” Tyrus cleared his throat. “Have you worked out a storyline?” “As a matter of fact we have. It revolves around one of the people that played the music tape right through. Someone that Ruth was running. A guy named Chris. She did well and really wound him up, quite a few juicy murders and plenty of illicit sex and drug use. It ended with a fiery car crash.” There was an involuntary gasp from Ruth, “You didn’t mention to me that you were going to use Chris’ story.” She accused him. “I didn’t have to. What’s the big deal?” Andrew queried her. Ruth hesitated. “Nothing. It was just a suprise, that’s all.” “Okay. Well that about sums it up. Anyone got any questions.” Tyrus sat back in his chair. “Yeah, what the fuck are Sonya and I doing here? You seem to have everything under control.” “Everything? Not quite. We need you both to write the program for the game. No one else among us can do that Tyrus. We need your brains and expertise.” 53 “Flattery will get you everywhere but do you realise how long it will take? I’ll tell you. About three to four months working almost non-stop.” Andrew looked extremely pleased. “That quick. Excellent. I actually thought it would take a lot longer than that.” The Devil shifted in his chair and regarded Tyrus, “Do you think it is feasible?” he asked. “Sure, sounds like an excellent idea. Wish I had thought of it myself but what about computers and stuff to work on?” “The next floor down has everything you will need my son. Complete this game and soon we will be able to rise and take what is ours and free ourselves from the Father. Start tomorrow night. Right now it is time for us to get the creative juices flowing in the way that we know best.” Sonya leaned forward and interrupted. Speaking to the Devil directly. “I would like to try out Andrew and introduce him to some mature sex. If he is willing.” The Devil nodded and Andrew left his seat heading for Sonya like he had been shot out of a gun. They met in the middle of the floor and started tearing the clothes of each other immediately. “Human form first, then demon. Agree?” Andrew asked around mouthfulls of Sonya. “Yes, yes, anything. Just fuck me now, hard.” They effectively excluded everyone else in the room as the frenetic pace of their initial coming together kept going with no let up and they took advantage of the floor space in the room. Tyrus meanwhile, leapt out of his chair and striding over to Ruth, picked her up and went to plant a kiss on her full red lips. She slapped him, hard. It was not friendly nor was it meant to be. He dropped her and rubbed his cheek angrily. “What is the meaning of that,” he asked, glaring at her. “You never asked,” was the reply. “Okay, can we get it on?” he asked as he reached for her again. “No! I do not want you. Leave me alone.” Tyrus turned to the Devil, who was looking a little concerned at that moment and appealed to him. “Master, this is not right. All the family fuck each other whenever. How can we set a bad example if we do not?” The Devil turned his gaze to Ruth who stood there defiantly, arms crossed. “I don’t want him Daddy. He has no respect for me. To him I am just a fuck on legs. He doesn’t know me and is not prepared to take the time to do so. I will choose, not him.” The Devil looked exasperated and turned to Tyrus muttering, “Modern bloody women, I hate this shit.” Then to Tyrus he said, “Unfortunately, we must progress with humanity, so until Ruth says you may, you are not to have sex with her. Definitely no raping allowed. Got that.” 54 Tyrus glared at Ruth with a frustrated hatred as he nodded his head, not trusting himself to speak. Before long he was on the floor with Sonya and Andrew. The Devil studied Ruth for a moment silently before looking down at the sprawl of his other children engaging in wanton sex. He left with a smile on his face, leading Louise into the next door bedroom. He just loved the old ways, where you took without asking. Later that night when Ruth had finished her second act at ‘Satans’ and the doors of the club had closed, she went to bed alone and released Chris from his mental shackles. He immediately took over the pleasuring of Ruth, using both her hands this time. She got hot immediately. “That was very brave of you, to face up to Tyrus. He is really scary.” Chris commented on the earlier action. “It felt good Chris. Like I was in charge of myself again. You do realise that I know of no other way to live than like this. Even if I wanted to change I don’t know how.” “I could help you. We could be together, just the two of us.” The voice in her head was comforting but she longed for the real thing. Being a demon was fun but it was also lonely. How could anyone trust a demon daughter of the great liar? Chris seemed to want to........ Was it possible? 55 Chapter 9. Steve sat at one end of the kitchen table opposite Mary, who sat at the other end. Between them on the table was a fairly sizeable pile of books of all ages and sizes. Most of them had little bookmarkers stuck in between the pages where they needed to cross reference information. The snow of a couple of weeks ago had melted and now cold winds were blowing from the south making the outside chill. Pale, weak sunlight shone wanly into the kitchen past the cafe style curtains hanging on the windows. It was getting close to lunchtime. Roberto had moved in with them after the incident with the flowers and true to his word he had not tried to change their beliefs. All he had done was to bring over a pile of books which he suggested they both read, so they could make up their own minds about the truth of the religion in which Steve and Mary presently believed. Roberto was easy to have in the house, almost unnoticed at times and very unobtrusive. After he had been in the house for a couple of days, Steve had given him a key of his own, to come and go as he pleased. This he did, ducking out on errands at odd times whenever the need arose. Roberto had liaised with the local chapter of The Brotherhood in the city and was now, so he said, ‘getting ready for the war’. Steve sighed and stood up, heading for the new coffee pot once again. “Would you like a coffee Mary?” “Yes please my love. That would be great. What do you think about all of this information we have been reading?” Steve considered for a moment while he was filling the machine and adding ground coffee to the filter paper. “I am not really sure. You learn something your whole life then in a few days it is all turned upside down. Makes for great difficulty in accepting what is true or not. The evidence on the table is very compelling. For instance, the statement ‘There is only one true God” runs right into the heart of religious belief. I agree that Christ and the Holy Ghost are probably a manufacture of the Holy Roman Church in times gone by and some of the information here is very compelling.” Mary considered him for a moment before adding her point of view. “Yes, plus the fact that Jesus really was a King of the Jews and descended from David and Solomon and that line is favoured by God. According to what Roberto told us, we have some of that blood in our veins. He reckons that is why we can sense evil in people the way we do.” Steve finished fussing with the coffee pot and sat back down while he waited for the coffee to be made. “Really, what we are looking at is a faith closer to Judaism or Islamic beliefs rather than any of the Christian religions which are all derivations from the scriptures put together by the Roman Church. Personally, I don’t have a problem with it, as I still believe in God. What about you, Mary?” “I don’t have a problem with it either Steve. In fact I was waiting for you to decide what you wanted, as I decided over a week ago.” 56 “Why didn’t you tell me?” Steve asked, suprised. “Because I did not want to influence you in your choice. Now that we are both agreed I guess it is time to sit down and talk seriously with Roberto.” Steve got up and finished making their coffees and then sat back down at the table, handing a mug to Mary. Just at that moment the front door could be heard opening and Roberto called out, “It’s only me.” “We are in the kitchen, fresh coffee available.” Steve called back. Roberto prowled into the kitchen, that was the only way to describe how he moved. As well as being handsome he was also tall and well built. Not much fat on that body and it had been well trained, judging by the way he held himself as he walked. He went over to the coffee pot and poured himself one. Turning, he looked at Steve and Marys’ smiling faces. Not understanding, he looked down at himself to see if his fly was open then finding everything okay, looked back at them. “What?” he asked. “It’s not you. Steve and I have decided to accept that there is only one God and are now ready for your instruction.” Mary’s eyes fairly twinkled as she related this information. Roberto however, looked more serious than they thought he would at receiving this information. He sat down at the table and looked sombrely from one to the other. “That is excellent news but in truth it is the easiest part of all we have to do. If you start training to become part of The Brotherhood you will find that there are trials both of the mind and body that are far more demanding.” “What do you mean?” Steve queried. “For instance,” Roberto paused to take a sip of coffee, “there can be no secrets between us. The Devil and his children use things like secrets to create divisions between their enemies. Us. We have to know everything there is to know about each other in order to take this battle to them. I must trust you both wholeheartedly as I expect you to trust in me. This trust is very important and we cannot go forward until we do. That is Brotherhood. Family.” Mary sat at the end of the table, white-faced and stricken. Both men felt the change in the air and turned to her at the same time. “What’s the matter Mary?” Steve asked her, concern in his voice. She burst into tears, her hands covering her face and in a sobbing voice replied. “Oh Steve, there are things I have done in my past that I didn’t want you to find out about. I have been living in fear of you ever knowing, in case you decided I wasn’t worth loving anymore. If we go through with this, it may mean the end of our relationship.” “Mary, Mary. Do you think I am so shallow? When I accepted you, I accepted you wholly for what you are. Not what you were. That is why I have never pried into your past. I figured that one day you would tell me when you were ready.” Roberto got up to leave the room but Mary spoke before he had even cleared his chair. 57 “No, stay Roberto. You have to know this about me; you might as well hear it now. It will save me repeating it again.” Roberto sat and Mary continued. “My father is quite wealthy and I went to a good private school but got mixed up with the wrong crowd of people. By the time I was fourteen I was into partying and drugs and alcohol. I guess it was one of those rich kid things. Well, one thing led to another and I was expelled and ran off to the streets. My father cut off all money and told me not to return home until I was prepared to give up that life, so I learned to steal. I had progressed to heroin at that stage, which is quite expensive. Luckily I was sensible and used clean needles and syringes so I didn’t pick up any horrible diseases but I became a really good thief. I spent a year stealing from retail stores until I learned how to open safes. I don’t know how I do it but I seem to feel/perceive the tumblers falling into place. If I hadn’t got caught, due to a concealed motion sensor hooked to a silent alarm, I would still be doing it now. The police recovered a lot of the money that I had hidden away in my squat and I got sent to a juvenile detention centre for a couple of years until I turned eighteen. I’d been hardened up on the streets so I kept out of trouble there and managed to keep up with my education. It was there that I got off the drugs and found God. Religion was a great help in getting through that place and when I got out I swore I would always stay with God and find good people in my life. Steve is the very best of them, the most caring person I have ever known and I am honoured to be with him.” Steve blushed at this, up ‘till now having been totally engrossed in what Mary was relating. Roberto looked a little uncomfortable at these, oh so personal, revelations. Not quite finished, Mary continued. “After getting out of the detention centre at eighteen, I went home and apologized to my father and mother for all the trouble and pain I had put them through. They were really happy that I had ‘grown up’ and found God and my father set up an account to pay me money every month until I found my way in the world. I have been doing church work since then, helping kids on the street who are like what I used to be like. I feel as though it makes a difference to them that someone cares.” Steve got up and went and squatted beside Mary, putting his arm around her and giving her a long hug. “I love you more every day that I am with you and thank God that you came into my life. Not only are you beautifull but you are very brave as well. Thank you for sharing that with me, it can only bind us together ever more tightly.” Mary looked relieved and smiled, pure sunshine in the darkening room. Roberto looked at them both and also smiled, his strong white teeth a stark contrast to his dark skin. “This is not going to be as difficult as I thought. If we talk to each other tonight as Mary has just talked, we will be able to go onto the next stage of training tomorrow. Welcome Sister. Welcome Brother.” Steve couldn’t restrain himself, “What is the next stage of training?” he enquired. 58 Roberto grinned again, “That is for tomorrow, tonight we feast and talk and talk. Remember, no secrets between us. They are ammunition for the wicked.” The rest of the evening was one that Steve and Mary would remember for a long, long time. They learned about Roberto and his family. Most of them Brotherhood, keeping an eye on the descendants of the line of the Jewish kings favoured by God. They learned that he had killed people as part of that job but only as a last resort. Evil men and women, minions sent by demons or the Devil to do their dirty work. They stayed up late and drank a little too much wine. It would be one of the few occasions for a long, long time when they could afford to relax so much. Neither Steve nor Mary realised that Roberto did not drink much of the wine at all. If you hunted demons, you couldn’t afford to be drunk, ever. The next morning saw three people, who now knew and trusted each other, sitting in the large lounge room. There was a large pile of documents on the coffee table in front of Roberto which he was sorting through. “The training will have to be quick unfortunately, as we do not have much time. Things have quietened down recently, which is not a good sign. I have put together a timetable for us, so that each area of expertise is covered at least basically. In all, this breaks down to theory, unarmed combat and weapons training. As I said, we will only have time for basics but in this situation, it is better than nothing at all. Steve, I would like some of the Brotherhood to secure the house with alarm systems and protective devices, maybe change a few walls. Is that all right with you?” “Yeah, no problem,” Steve acquiesced. “Good. They will start later today. All it takes is a phone call to get that underway. Next, we will be having a vehicle delivered. A very special vehicle. Lined with Kevlar and built with bullet-proof windows; strong enough to withstand a demon attack for a few minutes, if it comes to that. We need a room in the house emptied for the unarmed combat training and I need you fitted for Kevlar vests. I am sorry to tell you that what we are dealing with is extremely dangerous. You still have time to pull out if you want to, in fact up until we go into battle, you don’t have to commit. Once we start, that is a different story. Mary, we may need to use your cat burglar abilities but in the name of good this time. Can you do that?” Mary appeared subdued, “Only if there is no other way,” she replied. “I thought I had left that behind me.” “Okay, that’s fine,” Roberto replied. “We are getting closer to finding ‘Satans’, the night club that Chris was caught up in and we know, from the information that Steve supplied, that is where we should find Ruth, the youngest demon.” “Has anyone ever killed a demon?” Steve asked Roberto. “Yes, a number of demons have been killed over the years. Not as many as we would like but as soon as we kill one, the Devil makes another. He is allowed 59 four. Finding them is not easy. The last must have been about sixty years ago. It wasn’t by us though. I believe this Ruth is her replacement. Our methods for locating them have improved with time but we have to be subtle in some cases. How is your history?” “Passable,” was Steve’s reply. “Okay, here is an example. Philippe IV of France, known as Philippe le Bel was a demon.” Steve chuckled, “Get out of here, no way.” “Yes, way. He wanted the riches of the Knights Templars whose Order was created by a Pope and he wanted them out of the way, so he and his ministers kidnapped and killed Pope Boniface VIII and also possibly poisoned Pope Benedict XI between 1303 and 1305. Then in 1305 he secured the election of the Archbishop of Bordeaux to the empty papal throne. The Archbishop took the name Pope Clement V and did whatever Philippe wanted. In this case it was a pre-timed raid made on every Templar establishment in Europe at dawn on Friday, October thirteenth, 1307. He had the Grand Master, Jacques de Molay, crucified to within an inch of his life but kept him alive. In 1312 he got the Knights Templars officially disbanded and in March 1314 he had Jacques de Molay and Geoffroi de Charney, who was the Preceptor of Normandy, slowly roasted to death over a bed of coals.” Mary shivered, a shiver that started at the top of her body and travelled all the way to her toes. Roberto noticed. “Not nice. Anyway, The Brotherhood got to him. Poured Holy water on him while he slept, which stops the change to a demon form and inserted a thick needle up through the base of his skull into his brain through the hairline. No bleeding and a tiny wound. Looked like he died in his sleep. Tyrus was his replacement and Tyrus is presently the worst of them that we know of. His ‘wife’ Sonya, is another demon, nearly as old as he is, although we do not know much about her. Thanks to you, we now know about Ruth, probably the youngest, which leaves one we know nothing about. I feel that he is in this city as well. Something is brewing.” Steve was impressed. There was a lot more to life than met the eye. To think, the Brotherhood had been battling for centuries against demons and no one knew anything about it. He cast his eyes over Mary, to find her sitting in rapt attention. “So. Where would you like us to start?” he asked Roberto. Almost as if he had been expecting the question, Roberto removed an embossed sheet of heavy paper from the pile in front of him. “At the beginning. This is a copy of part of an ancient document that came from under the Temple of David when the original Knights Templars excavated there in 1109 or thereabouts. It is incomplete. The first two parts are missing with only this third part surviving. Over the centuries it has been found to be reliable and seems to be rules regarding what demons are allowed to do and what they are not allowed to do. I want you both to memorise these rules because from now on 60 your life may depend on knowing this stuff.” He stared from one to the other of them, a deadly serious look on his face. “I was standing right beside my friend Ignacio when Sonya, in demon form, ripped his heart out and ate it in front of me. I was lucky, she could have had mine too right then but I didn’t shoot at her. She followed the rules on that paper.” Before either of them could comment, Roberto excused himself and went off on another mission. Steve and Mary were left staring at the single sheet of parchment. · · · · · · · · ··. · · · · · · ·· ·· · . · ·· · · · . · ··. . · · . · 61 “Whew, this is pretty heavy stuff we are getting into Mary. Do you really want to do this?” Steve’s concern for her showed in his voice as Mary took his hand in hers and gazed into his eyes. “As long I have the chance to be by your side, I would ride into Hell itself,” she told him. “Hey, that’s sweet but definitely not funny. We just don’t know what is going to happen next.” Mary kissed his hand shyly. “We will make a good team you and I. Whatever happens, we have each other.” 62 Chapter 10. The training proved to be extremely arduous. Six o’clock each morning, their day started with a run. The fitter they got, the further they ran. Roberto always accompanied them and never seemed to tire. The slight bulge under the left arm of his tracksuit top proved to be a fully loaded and ready to use Glock nine millimetre pistol. When asked about it, Roberto just smiled and said. “Insurance.” After the run, while they were still warm, a couple of circuits of weight training were fitted in before breakfast. After this, theory of religion and an ever widening appreciation of the Brotherhood and how it guarded the people of Earth. This was followed by Martial arts, then lunch. After lunch came weapons training. Not only guns but knives, blades, stakes and staves. Between three and four in the afternoon there was a rest period followed by another run. Suprisingly it was Mary who took to the training like a duck to water and she quickly became fit and proficient at the basics. Steve was not far behind her but took longer to cope with the level of training they were getting. After a week or so, when the training was well underway, a succession of overalled tradesman kept turning up at the house. Roberto informed Steve and Mary that they were all Brotherhood. After some initial discussion, alterations were made to the interior layout of the house. Complete walls were removed to make rooms bigger, a panic room was fitted and the whole house was alarmed from the attic space right through to the old fashioned basement. Secret compartments were installed in each room, to be fitted with special weapons in case of emergencies. The teams of workers came and went for a fortnight before Roberto was satisfied. During this time Steve and Mary had contacted all of their Bible group friends and talked with them about their inability to continue on with the group meetings. It was a difficult time for them but they had both realised that they needed to protect the people associated with them and the best way to do that was to not see them. Any of their friends could and would be used as a tool against them if any of the demons got wind of their friendships. At first they had thought that Roberto was taking things too far in suggesting that they do this but he patiently talked with them, telling stories about how innocent people that he once had known were now dead or in mental hospitals because he hadn’t believed what he had been told and didn’t take the advice. It was chilling. The story that they gave to their friends was one that they cooked up with Roberto’s help and it rang true, because it was. They explained that they both had a crisis of faith with the religion that they had once believed in and were studying an older form of religion with a foreign priest. This was not a lie, as Roberto was an ordained priest in The Brotherhood. 63 The hardest thing that Steve had to do was to go and talk with Father O’Connor at St. Pauls. He had dreaded going to see his old mentor but found that the actuality was not as bad as he had thought it would be. “I am sorry that you feel that way.” Father O’Connor had said to him. “What are you doing about your relationship with God?” “Nothing,” Steve had answered. “I hope I still have the same relationship with Him. It is just that now I believe in God. The one God. Not bits and pieces of him transferred into other iconic figures.” Father O’Connor tilted his head to one side regarding Steve quizzically. “I do believe that you are happy with this, therefore I have no problem personally. In reality I should be using words like ‘heresy’ but I am not stupid. There is a whole world of beliefs out there but as long as the one true God figures in them, I do not have any trouble accepting other’s beliefs. Did your friend Chris’ death have anything to do with this change?” Steve pondered for a moment. “No, not really but subsequent events have reinforced my position. His life towards the end and his death were both very odd. I am still finding out about them. Mary and I have talked with the members of our Bible group and told them of our shift in faith. Do you think you could smooth it over with them please? They are all good people.” “Certainly Steve, your honesty is to be admired. Remember, if you ever need a helping hand or a place to crash, or even if you just want to argue doctrine, you and Mary are always welcome here.” Steve smiled and extended his hand. “As always, a pleasure Father O’Connor. I will miss your wisdom. Thank you for the past few years.” Shaking the priest’s hand was the last time for a long while that Steve would have any dealing with a Christian church but he still dropped a sizeable donation into the collection box on his way out. After the last workman had departed from Steve’s house, Roberto took Steve and Mary on a guided tour of their own place. It was all so new and smelt refreshingly of sawn wood and drying paint. The layout of the house had changed considerably. The passage from the front door remained but with no doors leading off it. Access to those rooms was now from the enlarged central area of the house. Similarly, a short passageway led to the back door, it also had no doors leading from it. Roberto’s explanation for these changes was simple. “If anyone or anything enters through the front or back door uninvited, they are in a trap for the length of the passageway. It may give us a fraction of a second advantage. Once into this large central room, whoever or whatever can be easily targeted. The panic room is over there where the study used to be. It is also lockable from the outside in case we catch a demon. Here is the secret switch.” He twisted the plate of the ornate wall-mounted light switch to the right and underneath the panel were a red button and a numbered keypad. “It has a ‘close’ function with the red button but needs a combination entered into this keypad to 64 open the door from the outside,” he explained. They checked out the inside of the ‘panic’ room and opened and closed the thick steel door a number of times. It worked perfectly. There were plenty of supplies laid up and also a closed circuit television camera which was partly concealed behind a ventilation grille. “What is that for?” Steve asked, pointing to the camera. “In case we catch a demon,” Roberto replied. “We may need to keep an eye on it.” They were then shown all the concealed hiding places that weapons were going to be hidden in throughout the house. Just in case! Then there were instructions on how the alarm system worked and how to turn it off and on both for the house and the garage. Roberto was pleased with them and told them so. “I wish a lot of our recruits were as quick and able as the two of you. If they were, there would be no demons left on the planet. Now come outside, I have something to show you. It has only just been delivered.” They trooped outside to find a brand new Nissan four-door Skyline parked beside Steve’s old car. It was a deep silver grey with blacked out windows and completely unadorned. The wheels were wide with low profile tyres making it sit low to the pavement. Steve’s mouth fell open at the sight of it. “Is this yours?” he stammered, looking at Roberto. “No, it’s yours,” he replied enjoying the look of amazement that passed over Steve’s face. “Fully tricked out with all the go-faster gear that we could fit into it. Four wheel drive and turbo. Also with bulletproof glass and lots of Kevlar lining the body panels. Not only is it extremely hard to break into but there is not much around here that could keep up with it and it’s not too expensive to repair if you dent it.” That took care of the next hour or so as Roberto explained the modifications that had been done to the vehicle and after setting the alarms on the house, they went for a drive. Steve drove it first, then Mary. She was quite an adventurous driver and Steve found himself gripping the dashboard on a couple of corners that Mary took at speed. The car was perfect. They were now ready for the lessons on how to fight demons. After dinner that night, Steve jokingly asked Roberto about sharpened wooden stakes. “Why?” was all he said. “Well, this is getting too much like Buffy the Vampire Slayer and I figured that a couple of wooden stakes would not go amiss.” Steve meant it as a joke but to his amazement Roberto replied seriously. “We are not here to go after vampires. That is handled by another branch of The Brotherhood. Vampires are base creatures which started from the mating of a male demon in demon form with a human female. Very occasionally this mating results in a vampire offspring. Most of the vampires today are a result of Tyrus’ proclivities. Their blood contains a strand of DNA which can infect humans, a bit like the way that Creutzfeldt-Jakob disease works. Anyone that gets vampire 65 blood into their system turns into a vampire also. They are not too difficult to kill and not that common. Just extremely hard to find. A wooden stake through the heart is not the best way to kill them, that’s for the movies. Concentrate on demons for now.” Steve was abashed. “Sorry, I was only having a joke. Shit, vampires are for real.” He glanced over at Mary, who had visibly paled and took her hand in his. “We will be okay my love, God is on our side.” Mary returned the smile with one of her own, shyly. Ten blocks away, lights were on fifteen floors up in an office building housing the Fleeting Image Advertising Agency. It was the floor with the big computer system on it. Tyrus, in human form, was sitting in front of a giant flat screen monitor punching keys in response to the computer code flowing across it. His fingers were blurs as they danced on the keys like dervishes. He was laughing. “Am I the best or what?” he announced without pausing. Andrew looked up from the computer he was working on, curious. “Why? Are you getting somewhere at last?” “Getting somewhere! Give me another minute and....... Ah!” Tyrus punched the ‘enter’ key and the screen swirled with colour, resolving into a picture of the view across the Boulevard from ‘Tonies’ Coffee Shop. “Take a look at this Andrew and tell me what you think.” Andrew rolled his chair over to the desk that Tyrus occupied and watched in amazement as Tyrus fast-forwarded through the backgrounds for the computer game that they were making. “That is absolutely brilliant. Amazing detail. You are as good as the Old Man said you were. So fast. We are well ahead of schedule now. How long do you reckon before all the lighting and shadowing are done. “Just a few more weeks little brother and we will be ready to incorporate the icons for the players. Sonya is nearly finished with the music and sound effects and hopefully your characters are nearly done. I think we will be finished completely in two to three months.” “Excellent Tyrus, truly excellent. What time are you working to tonight?” Tyrus regarded Andrew with a puzzled look for a second. “What sort of demon are you? I have been working all day every day for the last few weeks getting the backgrounds finished and now it is time to play. I haven’t had much fun in a long while and I need some now. I am going out.” He looked down the row of desks, “Sonya,” he called out loudly. She looked up from the screen of the computer she was working on and removed the headphones that she had been wearing for the music editing. “Yes.” “Playtime.” 66 She grinned an evil grin and stood up immediately, ready to go. “About time, this place is really boring. I would much rather be in Europe or Iraq. Let’s go, I am definitely in the mood for fun.” Half an hour later found them both in a nightclub. Not Satans but another that was fairly boisterous with pulsating lights and loud music and a lot of people dancing in the strobe lights. Quite a few of them looked high as they swayed and bumped to the insistent beat. Tyrus gave Sonya a dark smile and a nod as they entered the club and split up. For what they were after, single hunting was the best. Tyrus wandered onto the dance floor, casually moving to the music without effort, one of the many things he did well after six hundred plus years of practice. He was hunting, senses raised, sniffing the air for a hot human female, preferably a sinner. Eventually he found one that suited his purpose, dancing alone with a vacuous expression on her pretty face. She was well endowed; breasts and thighs chunky and voluptuous with dark hair cascading down her back over the skimpy top to reach the low cut jeans that hugged her ample legs. Just how Tyrus liked them. He moved in front of her and placed his hand on her waist. Her eyes focused on him. Hmm. Handsome but she couldn’t be too easy. “Fuck off!” Tyrus smiled to himself. Yes, this one would do. “Interested in a snort? Columbian, uncut.” “Fuck off I said. I don’t do drugs with strangers.” “No problem, my name is Tyrus. What’s yours?” She was interested now. Most men would have been discouraged by now but this guy had something about him. “Melanie. Were you serious about the Columbian?” “Sure, want to go somewhere a little more private?” Melanie, thoroughly amoral, who blew strangers in back alleys for extra pocket money, thought for less than a second. He sure looked good and she would have something to relate to the girls in the office tomorrow. “Where?” “I’ve got a motel room just down the road, if that’s okay.” “Sure, we can come back later if we get pass-outs. Lead on Tyrus.” A slick smile passed across his face as he followed Melanie out of the club. He and Sonya had both taken motel rooms in the same motel in anticipation of the night’s activities. He led Melanie down the road to where the motel sign advertised ‘vacancy’. With the motel room door firmly closed and locked behind them Tyrus took a large vial of white powder out of his jacket pocket and proceeded to make up huge lines of coke on top of the motel bible. Nice touch he thought as he rolled up a hundred dollar bill to snort through. Melanie was sitting on the edge of the bed, seemingly idly flicking through television channels as she drank a Scotch from the minibar but she didn’t miss the hundred dollar bill being rolled up. 67 Tyrus walked in front of her, blocking the television and holding out the rolled up bill for her. “After you,” she said. Melanie wasn’t stupid. If he was all right after a hit then she was going to have a big one. This sort of offer didn’t turn up every day. Tyrus took two big hits and handed the bible over to her along with the rolled up bill. Melanie snorted up one line and only got half way down the second before the top of her head seemed to explode. She had already dropped an Ecstasy tab earlier in the evening and now was having difficulty dealing with the coke. “It must be pure,” was all she could think before toppling backward onto the bed. Her pussy was on fire and she was so horny but almost unable to move. Tyrus was talking to her but the words weren’t getting through. He smiled a feral smile and started to undress her, caressing and licking her as her clothes came off. Then he was licking between her legs and she was coming in wave after wave of pure pleasure. “Inside me,” was all she could gasp. Tyrus stood up and removed his clothes. His penis was erect and huge, sticking straight out in front of him as he advanced toward the bed. “No way,” Melanie tried to say but his hand came down over her mouth as his erect organ tore into her. The pain was horrendous but through it, as he started to move, the pleasure built. She passed out for a short while and when she came to she was lying on her front and he was still pounding into her but the pleasure/pain had moved to a different location. “NO!” she exclaimed, “Not up my rear end.” She tried to scream but the sound was cut off by one of his hands across her mouth. The other was in the small of her back holding her down. She couldn’t move. The pounding became harder and faster and blood was now seeping from between her legs but there was no relief. At the moment of his orgasm, Tyrus hauled back on Melanie’s head and her neck snapped. Dead. Tyrus then changed to demon form and pumped his seed into the body beneath him, tasting the soul but it was not quite evil enough for him to take and he had to watch it depart, screaming, heading for the light which opened above to receive it. Somewhere he could never go. In the throes of orgasm, he ripped the corpse with his talons and spun it over while it was still impaled on his hardness, to eventually plunge his hand into her chest cavity and rip out the heart. He feasted. Sonya meanwhile, was not in such a hurry. She enjoyed a slow build-up to her entertainment and upon entering the club, went and sat at the bar. Her low neckline and short skirt revealed a lot more than it concealed and it wasn’t long before a succession of hopefulls had cruised up to her and been rebuffed. She didn’t play with boys, no sport. After an hour or so, a large bald-headed black man with lots of gold rings and chains came over and sat down beside her. “You working?” he enquired gruffly. “No, what do you mean?” she replied innocently. 68 “With your looks and my contacts, you could make a lot of money ‘working’ for me,” was his reply. “Interested?” “Could be. What do I have to do?” “First thing babe is for me to sample what you got. Then we know where we at.” She smiled and reached lazily down between his legs. He recoiled slightly. “What you doin’ bitch?” “Just checking out if you have what it takes.” He relaxed against her hand and she was pleased by what she felt. “Do you like cocaine?” she asked in her little girl voice. “You holdin’?” he queried. “Sure. Best quality Columbian. Care to join me? I have a motel room down the street.” “Lead on, bitch.” She got up from her seat, the tall powerfull black man following. This was going to be good. In the motel room she made up the lines of coke and they both had four lines each. His constitution was amazing; two lines would stop most normal people but not him. Better and better all the time. He roughly grabbed her breasts through her top and started pawing her. “Not like that,” she said pushing him back on the bed and leaning over to switch on the radio which she tuned to a station with funky music. Then she did a strip for him, finishing by removing her G string and putting a couple of fingers inside herself, moving them around in time to the music. His face was getting extremely red at this stage and not being able to contain himself any longer, he jumped up and tore his clothes off, grabbing her around the waist and throwing her to the bed. His erection was bouncing in front of him. He grabbed it and waved it at her. “Teasin’ white bitch, now you goin’ to get some real cock in yo pussy.” Sonya smiled as he jumped on top of her and roughly mounted her, pumping in and out in time to the music. He was rough but that is exactly how she liked it and his size was no problem, after all the years she had spent with Tyrus. He came quickly but didn’t stop pumping and quickly grew hard again. “This time bitch I’m goin’ to unload in yo mouth.” She didn’t move fast enough for his liking, so he slapped her across the face, twice. Hmm, yes, just what she liked, aggression. Now she could retaliate when and how she liked. He sat on the edge of the bed as she knelt on the floor in front of him and holding her head, by wrapping his hands in her hair on both sides, worked his penis into her mouth. She obligingly opened it wider for him and took his penis right down her throat. His breathing grew ragged and just at the moment of ejaculation, he looked down to find his penis fully buried in the mouth of a demon. His eyes widened in terror just as she bit his penis off. In that instant of suprise, before he could react, she jumped up and clamped his mouth shut with both of her taloned hands. Blood was spraying around the room and 69 the black man struggled mightily but to no avail. Sonya, now fully changed into demon form, spat his penis out and then bit his nose right off. She loved pain and giving it to people. The struggling diminished as the man suffocated on his own blood, his thrashing body meant nothing to Sonya who had enough strength in demon form to subdue five like him at the same time. She looked into his soul. Lucky Sonya, it was a bad one. She took it. Mr. D. would be pleased with that little gift. Now, one last thing to do. Plunging her taloned hand into his chest, she tore the heart out and ate it while it was still pumping. She was glad Tyrus had shown her how to do this, it was nearly as good as sex. Afterwards she showered and leaving the body on the bed and the cocaine on the bedside table, went along to Tyrus’ room. He answered the knock on the door and she got a quick look into the room before he came out, closing the door behind himself. “Was it as good for you as it was for me?” she asked him. His answer was to grab her and tongue fence for a moment before suggesting, “Let’s go home and have us some real sex.” Sonya agreed. Was there a finer demon on the planet? 70 Chapter 11. The next morning, just after breakfast, the morning run and weight training over with, Steve’s mobile phone rang. Mary and Roberto stopped talking and looked at him when he opened it and took the call. Only one other person had this number and he was on the other end of the line. “Hi Detective Mike, what can I do for you?” Whatever reply he received was not heard by the others but Steve looked very serious, nodding his head rapidly in response to what he was being told. After a couple of minutes he then held the phone out to Roberto. “He wants to talk to you. Apparently there have been a couple of gruesome murders at a motel. Both in separate rooms but with the same sort of M.O.” Roberto took the phone and started to talk to the Detective. Meanwhile, Mary looked over at Steve with a questioning look on her face. “Well, out with it. Stop with the ‘I want to protect you’ crap and just tell me. I am in this just as much as you. Remember? Demon hunters.” Steve sighed, “Sorry, you’re right, I just can’t help trying to protect you. The police were called to a motel in the City. The cleaners found a body of a young woman this morning. She had been sexually abused, sodomised and had her neck broken and heart ripped out. Her body was covered with claw marks and the heart is missing. She was nineteen. However, that is not all. Three rooms away, the body of a large black man, a well known pimp, was also discovered. His penis and nose had been bitten off and his heart was missing too. More claw marks. Forensics are down there looking for clues.” Mary had sat there quietly while Steve described the murders but now she turned to Roberto who was handing the closed phone back to Steve. “Are we going downtown to take a look?” she asked Roberto. He smiled, a little wanly, “No, we are not going downtown, I am. Before you protest, listen. Your training has a ways to go and this may be a trap. If you get spotted by a demon, they might trail you back here and we lose the element of suprise. Mike is going to pick me up at the end of the road and take me to the motel. There, I will be introduced as an out of town colleague and hopefully get some pictures with a hidden minicam. Remember? We covered those last week.” He left the room and returned a few moments later with his jacket on. It was still chilly outside. Then Steve noticed the badge on the lapel. Pointing, he asked. “Is that the camera?” “Yeah, well spotted. Now you two, I want you to read this until I get back. This is one of the most important pieces of information that you will get.” Roberto then showed them the slim glossy volume that they hadn’t noticed he was holding in his hand. “This is a treatise, with illustrations, of all the ways known to kill demons, both in their human form and in their demon form.” “It’s not very thick,” Mary offered. 71 “Exactly,” was Roberto’s succinct reply. “So learn it well, it may save your lives one day. Wait here until I get back or phone you. Do not go out and do not answer the door. Please.” Ten blocks away, on the sixteenth floor of Fleeting Image, a row was about to get underway in the private quarters. The Devil had materialized in front of Louise’s desk in the public area. She knew he could check places ahead of his arrival but it was still a very dangerous thing to do, as the risk of discovery was increased dramatically. What was more worrisome was that he was having difficulty controlling his human form. His normally urbane public manner was gone and the smell of singed clothing was very noticeable. His eyes kept flicking to vertical slit pupils and back again and every so often smoke would come down his nose. Louise was worried that the smoke detectors might go off. “Do not let anyone enter the private area,” he had informed her. “No one. Got that.” She nodded dumbly as he strode off toward the private office, smacking his fist into the palm of the other hand with a loud cracking noise. Once inside the office, he composed himself slightly and concentrated. There was a crack and whumph of displaced air and a very suprised Sonya looked up from the floor and quickly got to her feet. “What are you doing Dad? I was fast asleep.” “Shut up and sit over there,” he said pointing at a lounge chair. She walked over towards it as a pair of blue overalls materialised on the chair back. “And put those on.” There was another crack and whumph of displaced air and Tyrus stood before the Devil. One look at the Devil’s face and Tyrus shut his mouth and said nothing. “Very wise Tyrus but you always were smart.” Tyrus smiled. “But not fucking smart enough you stupid pair of fuckwits. I’ve seen more brains in angel shit. What were you thinking of? Don’t bother trying to answer. I got a call about ten minutes ago from one of Ruth’s tame policemen. Seems they have found two bodies at a motel. Yes, both at the same fucking motel. Both fucked over, clawed and with their hearts ripped out and missing. I know it was you two who did it. I should have kept you both on a shorter leash. What were you thinking?” Tyrus scowled at his father, “We were bored. We’ve been working very hard, night and day on the computer game, so we thought we would have a break. They won’t be able to trace it back to us anyway.” “That is not the point dipshit. What if there is Brotherhood in this town? They will know it was demons that did it. Now, if you look on the chair behind you Tyrus, you will find a pair of blue overalls like Sonya is holding. Put them on and then go and clean every restroom on the fourteenth, fifteenth and sixteenth floors, top to bottom. The whole of Fleeting Image. When you have finished, 72 move your stuff into the private apartment here and do not show your faces outside this building until we see what repercussions come from your little ‘jaunt’. I expect if our tame police cannot smother this, your descriptions will be circulated in every hotel, motel and rooming house in the city.” Looking suitably chagrined, Tyrus and Sonya dressed in the overalls after they changed into human form and headed for the door. Just as they reached it, the Devil called out after them. “I did like the way you killed them though and don’t forget to give me the soul Sonya.” She turned and blew him a kiss containing the soul. The Devil smiled with pleasure, “Thank you sweetie.” He leaned on the intercom button and asked Louise to get Andrew for him as soon as possible. A few minutes later there was a knock at the door and Andrew came in looking a little subdued also. “You heard?” the Devil asked. At Andrew’s nod the Devil continued. “You are probably the only one of us that the police or any of the others don’t know. Get down to the motel and keep a watch. Take one of the mobile phones with a camera in it and photograph anyone that you don’t recognise who enters those two motel rooms. We have to find out if The Brotherhood is in town. Find out the address of the motel from Tyrus. Now go.” Andrew left quickly, you didn’t bug the ‘Old Man’ when he was in a temper, that had a tendency to get painfull. Shortly after this exchange, Mike and Roberto arrived at the motel. It was a little chaotic with police cars and forensic vehicles littering the parking area. Detective Mike waved his badge and introduced Roberto as an expert from overseas. As forensics were still working the case, they could only observe the crime scenes from the doorway of the two units. There was blood everywhere; on the beds, on the floor and on the walls. It was a slaughterhouse, enough evidence for Roberto, who turned to the Detective and mouthed the word, “Demons.” They both turned and headed for the motel office where the manager was being questioned. After a few questions, the manager of the motel opened up and gave them a pretty good description of the man and woman who had booked those rooms. Mike called in to Police Headquarters for a police artist to come out to the motel and draw the suspects from the manager’s descriptions While they were standing around, they didn’t notice Andrew turn up and mingle with the crowd of curious onlookers, surreptitiously taking photographs while looking like he was trying to place a call on a mobile phone. He wasn’t there for long before leaving. No point in being noticed. When Andrew got back to Fleeting Image, the Devil was waiting impatiently for him, pacing up and down in his office. He grabbed the mobile phone from Andrew and started checking out the photographs. On the fourth one he stopped. “Ha! I knew it, Brotherhood.” He showed the photograph to Andrew. “That is Roberto, all the way from Italy. He is definitely Brotherhood. Who was he with?” 73 Andrew took back the phone and shortly handed it back with another picture showing. “This man was with Roberto, Mr. D.” “Do we know him?” “Yes Mr. D, he was on the case of Sally’s apparent suicide. You remember, the girl that Ruth threw off the balcony.” “Course I remember, I may be ancient but I am not senile. What is his name?” “Detective Mike Carruthers, we have nothing on him. He’s as clean as they come. What are you going to do?” Andrew smiled, he liked to see his Dad in action. The Devil picked up the phone and dialled a number. When it was answered he spoke quickly using Ruth’s voice, “Hello Commissioner, we have a slight problem that needs fixing. One of your men, a Detective Carruthers was at a crime scene today. Yes, the motel. He took a civilian with him. I need him off the case. Oh, it wasn’t his case. How fortunate. Deal with it, this guy could be a problem. Just remember the tape we have of you with the transvestite and do your best. Yes, I will see you at the club and give you a little reward as usual. Thank you, bye.” Turning to Andrew, the Devil smiled. “Well, that should give us a bit of time. Good work Andrew. Now leave.” Later that day, Roberto and Mike turned up back at Steve’s house. The first time the Detective had been there. Steve was suprised to see Mike with Roberto but was even more suprised to hear that he had been suspended for taking a civilian to a crime scene that was not even his case. Badge and gun job. Indefinite, until it was officially reviewed. Detective Mike was really pissed off. “We were made at the motel and pressure was applied,” Mike opined. “I would love to find what these guys are being bribed with. I reckon ‘Satans’ has something to do with all this. Call it a hunch but I would love to get in there and have a look around.” Heads nodded in agreement and Mary went off to make coffee, more to escape the tension in the room than for reasons of thirst. Roberto reached down to the coffee table, picked up the slim volume he had left with Steve and Mary and turned to Mike. “You are welcome to work with us while you are on suspension, if you like.” He said to the Detective, who slowly nodded his head. “Fine by me. What’s that you got there?” Mike asked Roberto. “A basic handbook on ways to deal with demons. The three of you should study it together and if you have any questions, I will be around to answer them.” The Detective nodded and when Mary came back with the coffees, they all sat around the table studying the book. Basically, it all boiled down to a few ways to deal with demons. These were; 1. Holy water. When sprayed on a demon in human form it stopped the change to demon form. The human form was then vulnerable to any form of death that 74 would kill a normal person. However, if the water evaporated or was dried off, the effect was negated. 2. Total immersion in Holy water. This put the demon’s human body but not the mind, into a state of suspended animation. 3. Violent death of the human body by any means. It had to be instantaneous or the demon would change to demon form which was nearly invincible. 4. Beheading, or something equally non-reversible, of the demon form. This required a blade which was blessed and had never been used for evil purposes. 5. Explosive devices, remembering that if seen by a demon, they could be teleported away. “That’s it?” Steve looked a little shaken. “Doesn’t exactly leave us a lot of room to manoeuvre in, Roberto.” He checked out Mary and Detective Mike to gauge their opinion. Roberto chuckled, “It would seem that way but tomorrow you start your training in the many ways to kill demons that these methods open up to us. Would you like to learn also, Mike?” The Detective nodded, “Could be pretty usefull, considering what I’ve seen today. What time do we start?” Mary looked at him shyly, “Well, if you have no reason to go home, why don’t you stay here for the night. We have plenty of room and dinner shouldn’t take long. We would love to have you as a guest.” Mike smiled at her warmly, the warmest smile they had all seen from him yet. “It would be a pleasure Mary and if you ever give Steve the boot, come and look me up.” She blushed and they all had a chuckle over it. The evening went on to become a very convivial occasion which did a lot to bond them together. After they had all gone to bed, in the early hours of the morning, Steve dreamed yet again. He was back in the desert but it had changed. Where before there had been sand, rocks and a few stunted shrubs, now the land was fairer. Grass grew and trees dotted the countryside. Under one of them, Chris sat chewing lazily on a piece of grass. Steve gave a low whistle of amazement as Chris rose and joined him. “What’s happening here?” Chris looked pleased, “Let’s walk over to the oasis. I want to show you something.” They trooped over the hill, wading through the fresh green grass which came up to their knees. On the other side, the oasis was a riot of colour. All types of 75 flowers were growing in abundance and bees and birds were working in amongst them. “This is amazing Chris, talk to me.” “Ruth allowed me to come to see you. Her human side is remembering what ‘good’ is. I think she wants to stop being a demon but she can’t. Can you help us? I just need to have her to myself for a while, maybe a month and I think I may be able to do it.” “Do what?” Steve asked his friend. “Finish the conversion that my love for her has started.” Just at that moment, a familiar figure stood up from beside the waterhole where she had been sitting unnoticed. Steve tensed, and then saw that Ruth was more conservatively dressed than usual in a swaying skirt and loose peasant top. It suited her and she looked really pretty but not in that sexy, man-eating way that she used to. “Hello Steve. It is good to see you. I am truly and deeply sorry for any pain that I may have caused you or Mary. Please forgive me. We need your help to try and get away from the Devil. It will be dangerous; doubly so if the Devil finds out because he will take Chris’ soul from me and we will lose Chris forever. I couldn’t live without Chris. I have come to appreciate just what ‘love’ is through the devotion that Chris has continually shown me. Will you help us?” Steve stood considering. Was this a trap? It didn’t feel like one. “I will do what I can but first I must consult with Mary, and Roberto who you haven’t met. He is Brotherhood as we are becoming. I will need to take something concrete back with me that will help us in our fight. How about the location of ‘Satans’.” “I cannot do that,” she sobbed. “I am bound in a demon oath not to reveal its location.” “But I’m not.” Chris said with a smile and to Ruth’s delight, promptly gave away the location of ‘Satans’ to Steve. “Excellent. Now we may be able to take the fight to the Devil by killing his demons. No offence Ruth. Hang in there both of you and I will see what we can pull off.” With smiles all round the dream faded and Steve woke up feeling refreshed. It was only after he was fully awake that he realised that the hairs on the back of his neck had not bristled with their usual warning of evil when Ruth had shown up. Looked like change was in the air. 76 Chapter 12. Detective Mike was on his third cup of coffee and had breakfast already prepared when the other three occupants of the house straggled into the kitchen early the next morning. A pile of pancakes was sitting in the middle of the table and fresh coffee was brewing on the coffee maker. “Sorry, I rummaged around and found the ingredients. Thought you might like breakfast made for you. I don’t sleep that much,” he said with a smile. Steve, Mary and Roberto sat down and got stuck into the food before them. It was great. Around mouthfulls of pancake, Steve explained his dream to them and told them of his discovery of the location of ‘Satans’. “You believe this?” Roberto asked Steve. “No possibility of a trick?” “I believe that the Chris I talked to in the dream is the Chris that I knew. This is not the first time that I have been contacted by Chris. He may be crazy falling in love with a demon but I am sure it is him that is appearing in my dreams. He has had a really rough time of it but he has always been straight with me. Yes, I believe this.” Steve looked levelly at Roberto. “What can we do to help them?” “Them!” Roberto exploded. “I have no intention of helping a demon. I spend my waking hours fighting against demons. I have pledged my life to killing them.” Mary interjected. “Roberto, it doesn’t matter which religion we are in, we all pray to God. All religions mention forgiveness. Shouldn’t we at least try to help Ruth, who is half human?” “Ah, gentle Mary. I hope your heart does not betray us. Demon vengeance is swift and often final. Very well, we need a plan but first I have something to show you all.” Roberto got up from the remains of his breakfast with a nod of thanks towards Mike and went off to his room, returning shortly with a strange looking contraption in his hands. It vaguely resembled a gun with a short barrel under which was a long cylinder. At the back of the cylinder, above the pistol grip was a ‘T’ piece and topping the whole contraption off, looking very incongruous, a plastic drink bottle was attached vertically, upside down, at the rear above the barrel. The neck of the bottle looked to be screwed into a socket there. Mike looked puzzled. “Ain’t like any gun I’ve ever seen. What is it?” Roberto chuckled, “A water cannon.” Detective Mike spat his coffee back into his cup to avoid spraying everyone with his mouthfull of coffee and exclaimed, “A water cannon! Shit, don’t tell me you intend we fight demons with a water pistol. Might as well piss on them.” He blushed and turning to Mary, apologised for his language. “Okay, you got me, how does it work anyway?” “First off, remember your lessons from yesterday. This canon fires Holy water. This spot here is where a standard plastic bottle screws in, it will take any size but I prefer five hundred ml. bottles as they are the easiest to handle and carry. This ‘T’ piece at the back is the air pump, just pump it in and out a few times and 77 the compressed air is stored in the cylinder under the barrel. All you do to use it is point and squirt. It has a range of about thirty metres.” Steve looked a little concerned, “That is really interesting Roberto but where do we get the Holy water from. We’ll probably need quite a bit.” Roberto grinned ear to ear. “Wait one moment please,” he said as he rapidly exited the room returning moments later with a cardboard box which he placed on the table. “Never underestimate The Brotherhood my friends. Check it out.” The other three people around the table looked into the box and then reached in and withdrew a full five hundred ml. bottle each. Made of a greenish plastic and with a label that read, ‘Rennes le Chateau, one hundred percent pure spring water. Product of France.’ They all looked a little bewildered. Roberto was enjoying their puzzlement. It was a couple of minutes before he explained. “Rennes le Chateau is a little village built on a mountaintop. A few miles to the south-east is another peak, Bezu, with the ruins of a medieval fortress, once a Knights Templar preceptory. The village church in Rennes le Chateau was built over a sixth century Visigoth structure and was consecrated to the Magdalene in 1059. It has a deep well in the cellar with pure water. This is blessed as it is drawn from the well and bottled into these bottles. It is distributed by The Brotherhood at the village to destinations all around the world as bottled drinking water. However, it all ends up stockpiled with The Brotherhood at their various chapterhouses around the globe. Yes, this is bottled Holy water, as much ammunition as you will ever need.” Comprehension dawned on their faces and the water cannon was passed around from hand to hand and investigated. So simple, yet possibly so effective. If the books were to be believed. A short while later and Steve was lost in thought. Gazing at the kitchen ceiling, his mind off on a mission, he started to worry Mary. The other two noticed Mary’s concern and their conversation drifted off. “Steve, Steve!” Mary tried to get his attention, eventually succeeding. He shook himself, as if waking from a reverie and turned to Roberto. “How much of this can we lay our hands on?” he asked seriously. Roberto considered for a moment. “About ten cases for now. Why?” Steve smiled. “I was thinking about our lessons the yesterday and what Chris said to me in the dream. If we can capture Ruth and immerse her in Holy water, she would be alone with just Chris in her mind. Exactly what Chris asked for. He seems to think he can win her over from her evil and he seems to be succeeding already. I would really like to try this Roberto. What do you think?” Roberto looked unimpressed. “No one has ever captured a demon before and the writings that we have are ancient. We don’t even know if it will work. No, it is too dangerous.” A side of Steve emerged just then that even Mary had not seen before. Stubborn and forcefull. “Roberto, we have accepted you and taken your version of faith to 78 our hearts. We have become Brotherhood. I want this and am personally willing to take a chance on attempting it. Mary?” “I am with you on this Steve, we owe it to Chris.” Steve and Mary turned to Mike, who regarded them both with an open gaze for about half a minute before speaking. “Well, I feel that I let Chris down when he needed me so I guess I’ll also agree to back you on this.” They all turned their attention back to Roberto who just sighed. “If I have to die, I might as well go trying to save a soul. Even if it is a demon’s.” The planning went on well into the afternoon before there was general agreement. First, ‘Satans’ had to be reconnoitred to find out the quietest times throughout the whole day and night. They would go in at the time of least activity. Detective Mike was the volunteer for that job and according to Roberto, if he soaked his clothes with Holy water, the demons would be unable to sense him. Mary would be in charge of getting them inside and once there, they would spray anyone they found inside the club with Holy water. Mary and Steve would carry telescoping steel batons for self defence, as their pistol skills were woefully inadequate, Detective Mike had his hideaway gun still and Roberto would be carrying his own nine millimetre pistol and a daito, a long Japanese sword. Steve had asked him about that but all Roberto would tell him was that the Japanese made the finest sword blades and his had been blessed. They would all have the water cannons of course. The ‘panic’ room would have a big plastic tub put in it for the immersion of Ruth in Holy water. If they could capture her and provided that they came out of the adventure alive. The panic room was the best place they all decided because it was pretty secure, the walls were quite thick and it had a lockable steel door. Tentatively, one week from today would be when the raid went down and it was agreed that if there was time during the raid, a search could be made, at the club, for whatever material was being used to bribe the police and local government officials. Game on. That very afternoon there was a heated arguement going on at ‘Satans’ in the main bar area. Andrew was there with Ruth and the Devil. The Devil drew himself up to his full height and fixed his gaze on Ruth. “Andrew has informed me that you are no longer doing ‘tricks’ with the punters. He also informs me that you are spending a lot of time on your own. I personally cannot feel the level of evil emanating from you that I think is required to be a fully functioning demon. We are here to corrupt, daughter. That is what you must do!” Ruth glared at Andrew. “He is just pissed with me because I didn’t want to sleep with him. He can get any woman he wants to. Why should I just lie down and spread them when he asks?” 79 The Devil sighed. “We are evil. Incest is evil. That is why we enjoy it. It is part of our work. Sleeping with your brothers, including Tyrus who you also turned down, is perfectly normal for a demon. It worries me that your behaviour in this respect is abnormal.” Ruth looked uncomfortable and Andrew was amused, revelling in her discomfort. “Daddy, I am just a little tired. I will be alright and back to normal soon.” “Daughter, demons don’t get ‘tired’. My children don’t even need to sleep; it just helps the human part last a little longer. I suspect your problem has something to do with the extra spirit you are carrying. Do you want it removed?” Ruth had to work hard to hide her anxiety at this remark but hide it she did. “I’ll be fine Daddy, I’m feeling better than I was. I should be back to normal very soon.” “Excellent. You have one week, then you will come and sport with me and my two sons. Tyrus is dying to try you out again and it is a while since I have partaken of a little chippy off the old block. One week daughter or we will come and take you anyway. We are evil you know.” With a final wink, the Devil disappeared. Ruth turned to Andrew with a scowl on her face. “How could you, you little weasel. Is all of this because I wouldn’t let you fuck me? How could you go to the Old Man about it?” “We are demons sis. What do you expect, loyalty, honour, no way. I do what it takes to get what I want. I will be watching you closely for the next week. Don’t fuck up or else.” He turned and walked off towards the back entrance whistling one of the songs from the new computer game that was slowly nearing completion. Ruth pulled out a chair and slumped into it resting her head in her hands. It was all so complicated now. What was she doing? More to the point, what was Chris up to? Early March was cold and Detective Mike, not being of a religious bent, couldn’t understand the necessity of keeping himself soaked in Holy water. He respected Roberto though and duly kept to the plan they had hatched by keeping his underclothes soaked from the bottles of Holy water that he had with him, while wearing warm clothing on top. He had never worn long johns before and felt ridiculous in them but they kept his nether regions warm enough, even if he was wet. The only problem was his feet, they were damned, oops, cold. He had taken station upstairs in an abandoned building opposite the back of the club. Most buildings around this area were abandoned, it was an old part of town and scheduled for demolition or so he was led to believe. He refused to be relieved by the others as he reckoned he was the best person for this job and took his work seriously. The others could do all that demon killing stuff but he would get them the intelligence that they needed to do it. Over the next few days he 80 photographed the comings and goings at the back of the club night and day. During the day he used a silent digital camera and at night added a nightscope to it. He built up a pattern of movement over the nights he watched, which suggested the quietest time for a raid was about six in the morning, after everyone had left and before the cleaning staff arrived. Each day, around ten in the morning, he snuck away from his hidey hole and briefed the others then took a nap, resuming his watch about eight in the evening. It was cold miserable work but someone had to do it. After four days of surveillance the team had enough information to go on and the final plans were laid. They would go in two days from now. During the night, about five in the morning, Steve had another dream. He met Chris in the desert landscape again. Only this time it was weirdly different. The whole of the dream world was coming apart. Literally, coming apart. Large voids of midnight black appeared as fissures all across the dreamscape. Steve was extremely concerned at what he saw. “What is happening Chris?” he said looking about himself at the devastation. “The Devil has given Ruth an ultimatum. Either return to her evil ways or loose me, forever. She is distraught and barely holding things together.” “Okay buddy, don’t worry. Plans are underway but I can’t tell you because it may be pulled from her mind. Tell me. Do you know what the demons are using to blackmail the police and City officials?” “Yes. Video tapes of them performing various sick acts with people or animals. They were filmed without their knowledge.” “Do you know where the tapes are kept?” Steve asked. Chris did and gave Steve explicit instructions on where to find them. They were parted suddenly, shortly after that, as Steve was woken by a worried Mary who was forcibly shaking him. “You were talking in your sleep and shaking your head. Sorry, I just had to wake you.” “That’s okay my love. We now have all the information we need.” That morning, Steve told everyone what had transpired in his dream. Roberto still looked like he thought Steve was making it all up but Brotherhood being Brotherhood he took it at face value. The raid would have to be moved up one day to the following morning at six o’clock. Mary went out shopping for a while and spent part of the rest of the day checking over some equipment that she had purchased. Suprisingly, she declined to show everyone what she had bought, being more than a little embarrassed about her previous life. After checking each of the items out, she carefully stowed them in a black briefcase. Roberto produced long black coats for them, with pockets sewn on the insides, usefull for holding spare Holy water bottles. He told them they were also flame proof. He also supplied Kevlar vests for them which would stop anything up to a full 81 grown bull elephant but apologised for the fact that they only slowed a demon down. It was starting to get serious now. He had them drilling on bottle changes and pressurising the water cannons until they could do it blindfolded. Detective Mike got sick of doing the drills and sat in a corner pulling his hidey gun apart and reassembling it. The time was drawing closer and they were all feeling the strain of waiting for their first raid together as a team. Roberto and Steve filled the plastic bath in the ‘panic’ room with Holy water, in preparation for Ruth’s body, Roberto shaking his head all the while at this untried gambit. That evening, all preparations finished, they sat around after the evening meal having a final drink before an early bed. Roberto asked for silence and said a short prayer while the other three sat with their heads bowed. “Lord God all powerfull. We of the Brotherhood and Detective Mike are going to work on your behalf in the morning, to continue the fight against evil. Please bless our endeavours and keep watch over us. If we die, I ask that our souls be free to find their own final resting place. Thank you Lord. Amen.” The ‘Amen’ was echoed all around the group, even Detective Mike joined in. Very shortly afterwards they all headed for bed, each person thinking about what was to come early the next morning. 82 Chapter 13. At four thirty in the morning, the alarm went off and Steve and Mary, Roberto and Detective Mike rose and donned their long underclothes after soaking them in warmed Holy water. Over the top of these went warm black clothing before the Kevlar vests were velcroed into place. Once dressed, they met in the kitchen for a quick coffee before putting on their equipment, gathering up their previously packed bags and the long black coats. It was time. They all jumped into Steve’s ‘special’ Nissan and headed off into the darkness of the early hours. Parking a block away from the back door of ‘Satans’, they made their way as silently as possible to the club. All was quiet. They stood across the street from the back door and put their masks on. At a signal from Roberto, Mary quickly and suprisingly quietly, crossed the street to the entry door. This was the tricky part but she had come prepared. Reaching into her bag she removed a ‘stud’ finder, a small device that detects metal nails in wall studs. She ran it around the door frame and noted where its indicator light blinked. There was a strong response at the top of the door, probably a contact alarm. She then removed two thin strips of magnetised metal, joined by a long thin wire and insulated from each other. Holding her breath she inserted them between the door and the frame where the contacts were. Nothing happened that she could hear. Taking a few steadying breaths she turned her attention to the lock and took out a set of lock picks. Not the easiest thing to get hold of but some of her old friends hadn’t forgotten her. She went to work on the lock and in a very short time had it open but she didn’t push the door yet. Carefully she reached up and separated the two thin bits of metal with the wire attached, then she gently swung the door in. One piece of the device stayed on the metal contact of the door frame, the other swung in with the metal contact on the door. She then took out some tape and taped them in place. All up, less than five minutes. Mary signalled the others, who came quickly and silently across the street. Steve gave her arm a reassuring squeeze on his way past. Mary closed the door behind them, now bringing up the rear of the group as originally planned. Roberto led them, they were all now wearing night goggles and could see quite well as they descended the stairs and crossed the cellar. There was a door off the passage to their right. Roberto held his finger in front of his mouth for quiet and ever so slowly turned the handle on the door. The lock was well oiled and so were the hinges, the door opening silently. It was a bedroom and there on the bed, nude and fast asleep, was Ruth, looking as beautifull as ever. At a signal, they all pointed their water cannons and fired simultaneously, totally unprepared for what happened next. Ruth woke screaming, Roberto jumped on her as Detective Mike leapt in to help and the roll of ‘gaffer’ tape that Roberto had ready was put to good use. As soon as Ruth’s arms were taped to her sides, Roberto took a wrap of tape around her head to shut off the screaming and then 83 taped her legs up, with lots of assistance from the other three. Ruth was very strong. About then, Roberto gave up on silence. “Quick. Wet down the bedspread with Holy water and wrap it around her. Detective Mike, carry her back to the car and put her in the boot. Whatever you do, keep the bedspread wet with Holy water while you wait for us or she will turn into a demon. Take no chances; it could get really nasty for you if you do. Guard your back, if we have not returned in fifteen minutes, leave and carry out the rest of the plan. Steve, you know where the blackmail tapes are. Show me the way. I will lead. Mary, wait here. Guard our backs.” With Steve guiding him, Roberto went into the office from the bedroom and Steve followed. Once in there, Steve immediately spotted the bookcase and located the copy of Dante’s Inferno on the right side of the top shelf. He tilted it forward and was rewarded with a loud ‘click’. The bookcase swung open silently on its hinges, to reveal a small room with video surveillance equipment and recording devices. To the right of these was a shelf with at least a hundred video tapes on it. “Which ones?” Roberto gasped. “There are hundreds.” Steve smiled. “The power of dreams my friend, the power of dreams,” was all he said as he reached past Roberto and opened a drawer in a filing cabinet, located below the shelf. From this he removed about twenty videocassettes which he placed in his shoulder bag. “Okay, mission accomplished. Let’s get out of here.” Roberto could not agree more and they both headed back to the bedroom to collect Mary and get the hell out of there. Luckily, they stuck to their plan, with Roberto taking the lead. For just as they stepped out of the door onto the street they met Andrew, who was returning to the club unexpectedly. For one split second Andrew and Roberto’s eyes met. Roberto raised his water cannon. That was all the perceived threat that Andrew required and he instantly changed to demon form. The Holy water evaporated into steam before it got to the demon’s hot, naked body. Its clothes had immediately incinerated to ash with the fierce heat of its rage. The demon form screamed and ran at Roberto. It all happened so fast, that later on, Steve could not really tell anyone what had occurred in that instant. All he knew was that Roberto let go of the water cannon which fell to his right side on its strap and simultaneously, with a lethal whisper, drew the daito sword and swung it, all in one fluid motion. There was a lot of power in that swing and the sword descended, whistling, until it met the demon’s outstretched right arm, slicing it off effortlessly just below the elbow. The arm hit the ground and disappeared. The demon that was Andrew pulled up short, staring at the stump of the right arm in amazement. There was no blood but he had never been injured before, ever. This should not be happening. He was a demon, son of the Devil, invincible. Roberto advanced, showing no fear, the sword held down beside him, out from his body to the right. Another swing of the sword. This time high, going for the neck of the demon. At the last 84 moment, with superhuman speed, the Andrew demon ducked but lost the end of one horn to the swing. It too disappeared when it hit the ground. The Andrew demon backed off, confused. Maybe he should stop attacking them and leave, in case whoever they were could kill him. He would have to consult with Dad on this one. Turning, he ran off through the predawn light in the direction of Fleeting Image, reluctant to change into human form in case he bled to death. Who were those people? ‘Those people’ were shaking and trembling, in the aftermath of the demon attack, even Roberto. A fully-grown, attacking demon tends to do that to people and for all his poise and bravery, Roberto was human. They made their way back to the car without further incident. Detective Mike was looking a bit perturbed. “What in God’s name was that screaming?” he asked them. “It sounded horrible from here.” “We just bumped into a demon and you should have seen Roberto move. He is amazing.” Steve was interrupted by Roberto. “Not now Steve, sorry but we have to go, immediately.” They all piled into the car and after driving a block or so, removed their masks and took it quietly until they got home to Steve and Mary’s house. Steve backed the car as close to the house as possible and between them they lifted the still struggling Ruth from the boot and carried her into the house, depositing her on the floor in front of the ‘panic’ room. Steve looked to Roberto for guidance, pointing at the still writhing body inside the bedspread. “What do we do with her now? Will she drown if we dump her into the bath?” “I honestly don’t know. Let me make a quick phone call to headquarters so we can find out.” Roberto replied, and grabbing a mobile phone he made the call. A couple of urgent questions and some headshaking later he replied. “Kill her.” “No way,” Steve protested. “My friend is inside her and you are not going to kill her because he will die too.” Roberto drew his gun. “Sorry, I have my orders.” A quiet throat clearing behind them made them look around. Mary gasped, there stood Detective Mike with his hidey gun pointed levelly at Roberto. “Sorry, I failed Chris once and I don’t intend for it to happen again. Put the gun away and we will work this out. Otherwise I will have to shoot you and I will if necessary. You said yourself that capturing a demon alive has never been done before, yet we’ve done it. Let’s try and finish the job. Believe in your own resource material Roberto and work with us. We just may be able to save them.” Roberto sighed and put his gun away. “I didn’t really feel right about the order from headquarters. If this goes sideways, you all realise I am in deep shit. Not the least for ignoring an order given by a superior.” 85 Steve replied evenly. “We are all in deep shit Roberto. Mary and I are also Brotherhood now, remember. Anyway, our superior is ‘there’ and we are right here.” Roberto smiled warmly. “Yes you are and you are both an excellent acquisition. So be it. I believe we must immerse her in the tub of Holy water and hold her underneath until she stops struggling. It must be done soon.” “Won’t that just kill her by drowning?” Mary asked in a worried voice. “I’m afraid we will just have to be guided by the old texts. We have nothing more to go on. Let’s just do it before she dries out,” was Roberto’s terse reply. They opened the door to the ‘panic’ room and lugged the body in. Roberto and Steve lifted Ruth into the bath. Mary left, it was too much for her to participate in at this stage, she could not bear to watch someone being drowned, even if it was a demon. The still struggling body was placed in the bath and Roberto pulled the bedspread down and removed the tape from Ruth’s mouth. The screaming started and was abruptly cut off as he pushed her head under water. Steve went pale as Ruth started thrashing and he held her lower section under the water at the same time as Roberto held her upper body and head under. “Seeing someone drown is not a pleasant experience for anyone,” he thought as the struggling gradually subsided. Eventually Ruth was still. Roberto looked sickened by what he had just done and removed the bedspread completely from the body. “We should leave the tape on until we know what has happened.” Steve agreed. They were both terribly shaken by what they had just done. Ruth lay still in the water. No movement, no attempt at breathing, to all intents and purposes, dead. A tear slipped down Steve’s face. He wiped it with the back of his hand and gazed at Ruth’s body. God she was beautifull. What a shame. He put his hand into the water and held her hand. It was soft and warm. If only there had been another way. A tiny pulse ticked once under his grasp. Was it just his imagination? Thirty seconds went by. There was another tiny pulse. “Mary, Roberto, Mike,” he cried out, “come here, quickly.” They all crowded into the ‘panic’ room and each had a go at feeling the pulse, one every thirty seconds, regular as clockwork. The demon part of Ruth was keeping her body alive, just. They had succeeded. Across Southtown, the Andrew demon had ripped the front from a Salvation Army clothing bin with its good arm, several blocks away from the club. He could not afford to be seen as a demon but couldn’t change back, in case he bled to death in his human form. He found some old trousers, a huge pair of worn shoes to cover his taloned feet and a smelly track top with a hood. As he put the trousers on he tucked his tail up between his legs and secured it with the waist band of the trousers before donning the track top. Finally, after putting the huge shoes on and leaving the laces untied he pulled the hood of the track top up to 86 cover his head with its missing horn. The track top stank. Andrew was a sharp dresser normally and now he had to wear this lot. Someone was going to pay. He made his way on foot to the building that housed Fleeting Image and took the elevator to the sixteenth floor. Louise called out after the shambling, smelly figure as it made its way past her desk but was ignored. She was in the process of calling security when she saw the figure punch the numbers into the electronic lock pad of the private suite. The door opened and she relaxed. Only a few people knew that number. As Andrew entered the private suite it occurred to him that he was fortunate, in that it was early enough to avoid being spotted getting up here, apart from Louise at her desk. The Devil should be in soon. He would know what to do. At exactly nine o’clock in the morning, the Devil materialized in the private quarters. Slightly startled by having a demon waiting for him he hesitated for a moment. “What is the meaning of this Andrew and why are you dressed in such scruffy clothes?” Andrew threw back the hood of the track top and the Devil gasped as he saw one horn was missing. “What happened to your horn?” In answer, Andrew tore the track top off to reveal his missing right forearm. The Devil roared and the whole building shook to its foundations. “HOW?” “At the club, this morning,” was Andrew’s fearfull reply. He had only seen his Dad angry a couple of times but that was enough. The Devil winked out of existence only to wink straight back a few minutes later. He struggled to compose himself before speaking to Andrew. “Ruth is gone. Holy water has been used at the club, that means Brotherhood. Damn, damn, damn and damn again. The video tapes which we used for bribery are gone also. This means war. Did you get a look at them? Could you recognise them?” “No Dad, they were wearing masks and they had wet themselves with Holy water so I couldn’t get a ‘sense’ of them. Can you do anything about my arm?” “Sorry son, I got a little excited. Yes, I can fix it, come over here.” Andrew walked over to the Devil who took the right arm in his hands, above the elbow and closed his eyes. Instantly, in front of Andrew’s gaze, his arm grew back. Bones first, then muscles and blood vessels and finally the scaly demon skin. Next the Devil pressed his hand on Andrew’s head and the horn grew back. Stepping back to admire his handiwork, the Devil said, “Now you can change back to your human form and get cleaned up and put some decent clothes on. You will need to double your food intake for a couple of days to make up for the tissue you have lost. Come back in an hour, we are going to have a council of war. How dare these puny humans harm a member of my family. They will regret their actions sooner rather than later.” With that he disappeared again. 87 One hour later they were all assembled in the private quarters. The Devil, Tyrus, Sonya, Andrew and Louise. The leaden March skies outside the window perfectly reflected the Devil’s mood. Dark, grey and angry. “What’s all the fuss about Sire and why the urgency?” Tyrus enquired. The Devil shifted his gaze around the room to take in all of them before replying. “The club has been raided and Ruth is missing, as are the tapes she made for blackmail.” “The little double-crossing slut,” Tyrus exclaimed. “I knew she was up to something.” A bolt of electrical discharge shot from the Devil’s hand and caught Tyrus right between the eyes. Tyrus recoiled, rubbing the spot with his fingers. “What was that for? I was just saying what I thought. She has been acting weird lately. Maybe it was all her idea.” “Tyrus, for all the years that you have lived, you sometimes speak without thinking. Ruth is missing. You forget, I am THE Devil and I can find my children anywhere on the planet, instantly, whenever I want to. How do you think I know some of the stupid things that you have done over the years? I make sure all of you do not break the RULES or we would all cease to exist. Ruth is missing. I cannot find her. She is not dead or I would have felt it. This has never happened before and it’s embarrassing. I have a feeling that HE may be involved in this somehow. You all know who I am referring to. Andrew, tell them what happened earlier this morning.” Andrew, looking a little pale under his tan, started his tale of woe. By the time he had finished the other demons were looking angry and a little worried. Sonya was the first to break the silence. “Dad, give us your slant on this. It sounds a little like The Brotherhood to me but they have never done anything as daring as this before. We usually have to dodge them a bit and change our operations centre; but disappearing a demon. That is heavy shit.” The Devil smiled at Sonya. “You always were the smart one when it came to seeing the issues. Yes, I believe The Brotherhood is involved but they are getting stronger and smarter. How did they know about the tapes and how did they choose the right ones out of all that were there? Who are they and did they have divine help? What is our response to be?” Tyrus growled, low and long. “Find them and kill them all, slowly and painfully.” “Ah, my son. Exactly what I would expect from you. Two things you have to remember. One, you can only kill them while you are in human form, unless they threaten you. In human form you are vulnerable to death and these people have shown they are a force to be reckoned with. Two, what about your sister?” “Fuck her. She was a flaky demon anyway. Imagine not wanting to fuck your own brother. That’s weird. As to the so called Brotherhood. Well, I think we should go and have a really good look all around the club and through it, in case 88 there are any clues as to their identity.” Tyrus looked around the group to see how his suggestion had been taken. There were nods here and there. “Andrew, your thoughts on the matter please.” The Devil requested. “I agree about searching around the club, we should do that very soon before all the scents dissipate. As to Ruth. The RULES state that you are allowed four demon children at one time. You say that Ruth is not dead but you cannot locate her. That means that she is no longer a demon. You could have another daughter.” The Devil beamed. “I knew your education would come in usefull some day. Let me check.” The Devil sat staring off into some far distance for a while then collected himself. “Right on the money Andrew, it is within the RULES. Okay here is what we do. Sonya, you can investigate the club and its surroundings. Be carefull and be thorough. In the club, use demon form if necessary to pick up other clues. Anything suspicious, anything at all, we need to know about it.” Here, the Devil paused for a moment. Sitting, deep in thought, while the others waited respectfully. It didn’t pay to upset the Old Man. After a few moments contemplation, he looked up with a smile on his face and an evil gleam in his eyes. “What we need is a diversion. One that will have The Brotherhood chasing their tails and barking up the wrong tree. We must give them something real and with meaning. Tyrus, my athletic son, who has been working so hard in Europe for so long. Your offspring from human women, all those little vampires that you have made over the centuries, do you know how to contact the covens?” Andrew’s head shot up. “What are you talking about?” Tyrus looked smug but it was the Devil who replied. “Sorry Andrew, you do not know of this because traditionally, only the eldest male demon is made aware of how to make vampires.” Andrew looked annoyed. “So tell me now. I may be the eldest son soon, if The Brotherhood doesn’t take the bait.” The Devil considered for a moment. “You could be right. Very well, it goes like this; if you mate with a human female during the full moon and she is receptive to your seed, your offspring will be a vampire. Half demon only, they are not bound by the RULES. In their blood is a DNA strand that can infect normal humans and turn them into vampires within a couple of weeks. It is something that we find usefull to use in our little contest with HIM. For the last six hundred years, Europe has been very fertile for Tyrus or should I say Tyrus has been very fertile for Europe. The culture there lends itself to having vampires and Tyrus likes them. Don’t you Tyrus.” Tyrus looked a little abashed and bowed his head, speaking in almost a whisper. “Yes Sire, I go and play with them sometimes. My vampire daughters fuck up a storm and it is so refreshing seeing them kill. I get jealous because they are not bound by RULES like we are. They let me drink the blood sometimes.” 89 “Excellent. Contact some of the covens. I want twenty to thirty vampires over here immediately. A little mayhem will help us in our fight. It will provide a diversion to keep The Brotherhood occupied and off our case for a while. After you have done that, get back to work on the game, I want it ready to roll in one month.” At the look on Tyrus’ face, the Devil stressed, “One month Tyrus, no excuses, finished.” Turning to Andrew, he then said. “Your job is to find a dark, comfortable place for our visitors. Somewhere they can come and go without too much difficulty. Somewhere easy to defend if necessary. Some sort of business cover for their activities would be usefull also. However much it costs, whatever it takes. Do it. After that, locate that Brotherhood bastard Roberto who you photographed at the motel. If he is the one that chopped your arm off, kill him. Remember that these people are dangerous. Report in to Sonya at regular intervals. I mean it, let it be so.” He sat back, a grim smile on his face. “You all have your orders. Now go and carry them out. Louise, remain behind.” The three demons rose as one and trooped out of the suite to carry out their various tasks. That left Louise sitting by herself with the Devil. He contemplated her for a moment. “Louise, my precious, I know what has been in your heart for a long while. You want power. You lust for it. Well now is your chance to earn it. We will make a daughter together, you and I. However, the situation is urgent, so we are going to do something a little different. I can tweak my seed by altering the DNA, one of the advantages of being the Devil, which means your gestation will be of one month duration. You are young and healthy, it won’t kill you but it will be challenging for you. Once our daughter is born she will grow exceedingly quickly. In six months she will be the equivalent of ten human years old and will reach maturity in a year from now. We will purchase you a proper house, befitting your position as mother of my child and you will no longer work here. Sonya can do your job until we can find another minion for it.” Rising, he approached her with his hand outstretched and took her hand in his. “Tonight my dear, you and I are going to have some real sex. By this time tomorrow you will be carrying a demon inside you. A special one, a prototype for the new order. A female demon that no one has seen the like of before.” They were going to have a baby. 90 Chapter 14. In the first few hours after the raid on the club, Steve and his friends were euphoric with the success of their venture but very quickly that euphoria was replaced with the realisation of the reality of what they had done. They had taken one of the Devil’s children and stolen the videotapes used for the blackmailing of city officials. The Devil was going to be pissed. They could possibly expect reprisals at any time. Steve’s house was an anomaly. It was one of the original houses in the area, single story, constructed of weatherboards, with high ceilings and sitting on a decent size piece of land with gardens front and rear. All around his place there were two story apartment blocks crowded onto small segments of land. The developers had been after Steve for a while now to sell them the house so they could tear it down and build a couple of apartment buildings. He had refused all offers, enjoying the space. However, the small band in the house now realised that the walls would not stop a demon intent on entering. For the next few days they slept in rotation with one of them always on guard. “Roberto. How reliable are the rules regarding demon conduct?” Steve asked. Voicing the question that they all were thinking. “Well, in eight centuries of the Brotherhood being active, they have never been broken. We rely on them. If they are going to come, they will come in human form. They always have in the past, without exception.” The relief around the room was palpable. Mary took Detective Mike yet another coffee. He had been viewing the stolen videotapes on Steve’s home theatre system and was making notes. He was visibly shaken by what he had seen on them, never having been exposed to such sordid behaviour before, even after twenty years on the police force. She stood beside him, her affection for the grizzled police officer apparent to all. He was like a father to her. “What are you going to do now?” she asked. Detective Mike looked up with fondness. “I am going to copy these tapes and send copies to all the people in them, with a note telling them that the originals are in a safe place. The note will ask them to do their jobs properly or else the media will get a copy of their tape. I am going to get my suspension lifted and get myself put on the motel murders case. Then I am going home. That should be enough.” Roberto looked up from polishing his sword. Demon flesh had slightly pitted the blade. “If you do that, we will not be able to protect you. You will be exposed.” “Not a problem buddy. As far as I am concerned, I have been on vacation and got sent these tapes by special delivery. There is no way to connect me with you guys, apart from us visiting the motel together. You should be worrying more than me about reprisals.” 91 Roberto shrugged. “If that is how you want to play it, I cannot stop you. All I can do is wish you luck and remind you about our mobile phones.” Mary whirled around to face Roberto. “You can’t just let him walk out of here. He could be in danger.” Roberto shrugged. “He is not Brotherhood, he is his own man and a fine one at that. Thank you for your help so far Detective and remember, if you ever need help or assistance, contact us.” There was murmured agreement all around. Mike looked embarrassed at this then continued with his work of copying the tapes. That night, under the cover of darkness and rain, he left the house to continue their fight in the way he knew best. His one capitulation to common sense was to take a water cannon and ten spare bottles of Holy water. The front door closed firmly behind him and the alarm was set. In the silence that ensued, Steve was the first to speak. “Roberto, I want to learn how to handle a sword like yours. Will you show me?” Roberto looked steadily at Steve for a moment, obviously weighing up the pros and cons. How could he not. Steve was courageous and determined, and Brotherhood. “Okay, we start now. I already have another daito, a long sword, part of a set but you don’t get to draw it from its sheath, except for polishing it, until I say. We practice with wooden swords until you are good enough to handle the real thing. Also, I want you to wear it strapped to your back at all times. It has to become a part of you, move with you and be an extension of your body. You have to love and respect it. If you agree to this, we begin.” Steve looked at Mary with such an imploring look on his face that Mary laughed. “You big kid. No, I don’t mind, I know I’m your number one love and I am not jealous of a sword. Besides, it seems a very effective weapon. Roberto, please teach me also.” “To you Mary, I will teach the technique of the shoto, a shorter sword. I have one here, the mate to Steve’s daito. Both of these blades have been blessed and purified ready for their work .It is fitting, paired swords for paired people.” The lessons started that evening, beginning with the history of the swords they received, made by a master swordsmith in Japan and over two hundred years old. The scabbards were plain and black, mounted in the buke-zukuri or katana style. The swords appeared at first to be plain also but when they looked closely, they saw the beauty of the guards at the base of the rayskin leather bound handles where the blade started. A finely wrought design of intertwining dragons, one large and one small, the same on both the long and short swords, was crafted with minute attention to detail. The blades themselves ended in an angled point and hundreds of wavy lines extended along the length of the blades. Roberto explained that these were due to the steel being folded again and again during the crafting process. This is what gave them strength, suppleness and the incredible sharpness. Steve strapped his to his back with the adjustable 92 harness but Mary chose to strap hers to her left thigh as she was left handed. It was not too long and ended before her knee. She giggled. “I feel like a Western gunfighter with it strapped here but it isn’t in the way and I can move quite freely. A little more feminine don’t you think.” Roberto shrugged; the attitude of modern women was a subject he had difficulty with. Steve just smiled lovingly at her. How had this woman come to him, of all people? He was blessed. That night Steve dreamt. He found himself in a glade within a forest; fresh green leaves on broad, straight limbs formed a canopy which leaned over him, supported by the tall, stately trees which encircled the glade. It was carpeted with myriad wildflowers, swaying above the verdant grass in which he sat. Birds sang in those trees and squirrels bounced up and down the branches, cavorting in play. The sunlight was mellow and slanted down through the foliage, bringing warmth with it. This dreamscape was beautifull. He heard laughter and looked up to see Chris and Ruth enter the glade hand in hand. Ruth had totally changed. Gone were the sexy siren looks, instead a very pretty looking woman of oriental appearance, dressed in a long dress that looked almost medieval, gathered as it was under the bodice, stood demurely beside his friend Chris. She was one fine looking female. They came over to him. “Hi Steve, we just don’t know how much to thank you. For the first time since becoming a woman, Ruth knows peace. We have no idea how long it will last but we are gratefull.” Chris came up and gave him a big hug, suprisingly, so did Ruth. “Thank you,” she whispered in his ear. Chris spoke again. “We have been thinking about God and how we fit into the scheme of things. We were wondering if you would talk with us about God so we may learn about him.” Steve considered carefully. “Can we extend this dream to include Mary?” Ruth answered. “Yes, I can do that.” She concentrated and the next moment Mary was with them. Mary looked stunned. Standing gawping like a fish as she took in the surroundings and the three people in it. “Am I dreaming you all?” she asked in general. “Sort of my love,” Steve said. “This is what I told you about but the dreamscape has changed. For the better I might add.” He looked at Ruth and Chris grinning. Mary stepped back from Ruth, ignoring her purposefully, a worried look on her face. “Is she dangerous?” She directed the question at Steve, who was a little quizzical. “No I’m not.” Ruth answered for herself and just about then Mary realised that her evil detecting abilities were silent. She apologised profusely and gave Ruth a big hug. “I’m sorry. Your life must have been so hard. It’s just.........” 93 “I understand Mary, I have been a bad, bad girl; but now? Well, we brought you here because Chris and I want to learn more about God. When we asked Steve about God, he said he would like you here to help him with instruction. So here you are. Now, we have some very important information for both of you. The demon side of me had knowledge which may help us. It ‘knew’ that if we had a recently deceased male body in good condition, I may be able to put Chris’ soul into it, so he is once more ‘alive’. I emphasize, recently dead and little or no damage. It could be very tricky, as I believe the new soul has to be transferred in, just after the old one has departed. Too long a gap between and it won’t transfer. If it doesn’t, we may lose Chris’ soul for ever. Gone. Just something for us to think on.” The dreaming for Steve and Mary was long and full of discussion about God and the body requirements for Chris. It was the first of many such occasions for them, with different dream environments each time. One dream, an island beach, bathed in warm sunshine. The next, a moonlit balcony of a hacienda with a view from the Andean mountains. Ruth was good at that stuff. It was a time of peace, away from the challenge of the real world. However, the waking world was much too quiet. No unexplained deaths or accidents in the city. No disappearances or runaway teenagers. Nothing. Like the calm before the storm, it was the hush that presaged the possible violence to come. Roberto, Steve and Mary used that time to hone their skills. All day, everyday, they worked on martial arts, fitness and weaponry. Attack. Parry. Thrust. Roberto was a skillfull teacher, bringing out the best in them and they rapidly developed abilities that they never thought to master. They became skilled. Every so often Steve or Mary would check on Ruth, floating submerged in the plastic tub in the ‘panic’ room. She never altered, although a small smile could be seen on her face now as the hardness that was previously there, left it. They had removed the rest of the restraining tape which wrapped her for security and Mary had donated a matching bra and panty set for the sake of modesty. She had actually put them on Ruth herself. She considered Ruth as her friend now. One whom she would help whatever the cost. Mary was a warrior of the Lord. When Sonya had set out to investigate ‘Satans’ night club, she had arrived too late. The cleaning crew, not knowing otherwise, had done their usual thorough job. No spots or stains anywhere. There were no clues to be found there at all. Searching the abandoned buildings around the area of the club, she had eventually found the place where Detective Mike had been watching the club from. Demon senses were put into play but gave her nothing. A mystery. She did however, notice the tracks in the dust of someone’s coming and going. Quite a few tracks, the club had been under observation for a number of days. Why had no one been able to pick that up? The biggest clue was in the mud outside the remains of the back door. There she found a large bootprint belonging to 94 someone who was quite large and heavy. That was all. She reported this back to the Devil. “I couldn’t find anything using demon sense but a large man had been there a number of times. The place was clean. Like a professional had been there. Someone who knew not to leave any clues.” The Devil was impressed, as much by his daughter as by the calibre of the opposition. “He must have been soaked in Holy water. That is why he was undetectable. It has to be one of The Brotherhood or someone working with them. That is one of their tricks. This is a puzzle for me to solve. Thank you daughter, now go and take over the reception desk for now. That will be your job until Andrew can locate Dixie, one of Ruth’s minions from ‘Satans’. She doesn’t know yet but she is getting a promotion. If you have any problems, get Cindy downstairs to help you and remember that she is not one of us.” Sonya left and the Devil sat, chin in hand, pondering on the Game. God was good at it, with lots of subtlety but every now and again he cheated a little. So did the Devil. Over the next few days, the Devil and Louise chose a house in one of the better suburbs of the city. His next child had already been conceived. Louise had been very enthusiastic and he had felt the spark of new life within half an hour of their tryst. Devil sperm was strong and fast. Particularly the sperm he had altered for this union. Now, a week later, Louise was ensconced at their new place with a mountain of food. She needed it. Her tummy hadn’t started to bulge yet but her appetite was outrageous. She was eating five main meals a day and putting on weight. That extra weight would be needed as she entered the last week of the month long pregnancy and also after the birth, as she met the demands of a rapidly growing demon child. The Devil smiled to himself as he watched her eating yet again. He had tinkered with more than the growth rate of his DNA. His next little demon child was going to be a product for the twenty first century. To hell with the RULES, there were loopholes and God was giving him the shits. If it all went sideways, God could have his little paradise on Earth. The Devil was getting tired of his job, it wasn’t the same anymore, it was getting too hard. Maybe he should ask God if he could retire in favour of Tyrus. Sort of give God a bit more of a challenge in the Game. Still, he took his work seriously, maybe next week, for now there was some serious evil planning to do. The vampires should start arriving early next week. He had leased a plane for their transport. A cargo plane with no windows so they could travel comfortably, even during the day. The plan was to load them at night in Prague and unload them at night over here. As far as Customs were concerned, he was bringing in an empty plane to pick up a load of grain and staples for famine relief in Mombolani in Africa. He had already bought the grain and medical supplies locally as part of his cover and he was well known as a philanthropist. He, he. It was a good cover, like the shell game. Only he knew where the pea was. He wasn’t called the Prince of Liars for nothing. A couple of trips were all it would take and he could sell the grain to the warlords around Mombolani. To cover his 95 costs of course. Andrew had found an excellent place for the vampires to live and work, a basement beneath a shopping centre. They had already bought planning permission to turn it into an adult nightclub. People would be coming and going all night. What an excellent cover for a vampire coven. He would get them to feed sparingly but infect a lot of people and create lots more vampires. Until the time was ripe to unleash them on an unsuspecting city. It would be delicious. This city was going to be a war zone. No one took a Devil child and lived long enough to regret it. Brotherhood or no. That policeman photographed by Andrew at the motel, the one with Roberto. He was probably the person who had watched ‘Satans’ for a few days. A personal visit was on the cards for that one. He picked up the phone. Tyrus finished the first part of the computer game ahead of schedule. Played it a few times to iron out any glitches in the programming, then played it again to see how the music was, then played it again for fun. That is where the Devil found him, in front of a computer screen, playing the game. “This is a really good storyline, Sire. Turned out to be quite a fun game. It will be completed in three weeks. All we need for the marketing is a name for it.” Tyrus spoke while still playing. “How about, ‘The Final Song’.” The Devil suggested. “Sounds good to me. Want to pull in some scruffy college kids when it is finished and give it a try on them. You know, market research, might gain us a couple of kiddie minions while we are at it. At the worst, they could be the start of our distribution network.” “Excellent idea Tyrus, apart from some of your enthusiastically disgusting habits, you are really excellent at what you do. Before this game is finished, we will unleash the vampires to create as much trouble as possible for the opposition. While they are dealing with that, we can launch the game on an unsuspecting public. Hopefully, it will take hold unnoticed for a while. If so, it has the potential to spread all over the world. After the launch, we will give it a couple of months until we finally have enough minions to go to war. Then you can be enthusiastically disgusting all you want.” Tyrus smiled to himself with a thoroughly evil smirk. Detective Mike was happy. He was reinstated, back in the Department and keeping an eye on city officials on the quiet. They seemed to be doing their job adequately and the city was settling down to the normal low crime level. Detective Mike had been assigned to the team which investigated the motel murders and now had two identikit pictures of the perpetrators. One male and one female. The guy was Arab or Jewish looking and may have been involved with the trail of destruction on the road south from Bravura earlier in the year. Beards were easy to loose and not many gentlemen of that persuasion visited here. The woman, on the other hand, looked similar to Ruth in some regards. 96 Boy, the Devil sure threw beautifull girl children, deadly too. Mike realized he would have to keep his eyes open while he was around town. You never knew what might turn up. He Emailed Roberto and sent the two pictures as an attachment. The message read, ’Photofits of the two motel killers, most likely demons. Take care, Det. Mike.’ Happy now, he turned from his desk and got out of his chair. Time to head home. Smiling, he grabbed his hat and coat on the way out. He so liked doing the job he had dedicated his life to. 97 had disappeared and now he had been instructed to kill one of the people who had caused her disappearance. Fine by him, all he had to do was find the bastard. It was a little complex due to the fact that the vampire nieces and nephews, who he had never met, were due to fly in tomorrow night. He had spent quite a bit of his time recently getting things ready for them, what with the club idea and all. Before they arrived though, he had this problem to solve. How to locate Roberto and kill him. A puzzle, but one which should not be too hard to work out. He knew from the feedback of their no-longer corrupt policemen, before the raid on the club over ten days ago, that the car in which Chris had died had been released from impound to a friend of Chris’. That friend may be able to give him a lead. All he had to do was get the information from the guys at the impound yard. Shouldn’t be too hard to bribe one of them. Yeah, that’s what he would do. Soon. First though, sitting on the table in front of him, there were three or four lines of coke to take care of. Shame Dixie was now working over at Fleeting Image, he felt like sporting with her for a bit of relaxation. He liked her moves a lot and she squealed appealingly at the right moments. Maybe tonight after she finished her receptionist’s job. He are not allowed to divulge information like that to anyone. It. 98 “Hold on, I’ll just see what comes up on the computer.” He ducked back into the booth and worked on the computer for a minute or so, then came back. “All I can tell you is that it was taken away by Regent Towing Services. You will find them over on Tremaine Street, down the far end.” “Thank you very much,” Andrew replied as he backed off and wandered away. Excellent. Now he had to get over to Regent Towing and see if he could find the driver of the tow truck before he knocked off for the day. Pulling out his mobile phone, he contacted Sonya at Fleeting Image. “Hi Sonya, this is Andrew. The Old Man is getting a bit paranoid and asked me to keep in touch. I am on my way to Regent Towing on Tremaine Street to follow up a lead on the car. How is Dixie doing? Yeah, that good. Tell her I’ve got a job for her tonight, dress optional. Right, spot you later. Bye.” He put block from the place where Ruth had taken apart that air hostess. Roberto, Steve and Mary had just finished their sword training with the wooden swords. They wore their real ones as they had been doing for the last ten days since the raid on ‘Satans’, getting used to the weight and feel of them. All three of them were standing in the central area of the house wiping the sweat from their faces with towels and having a drink of water. The training sessions that they were doing were pretty intense and they were feeling it. The doorbell rang. “I’ll get it.” Roberto said throwing his towel down. “I am expecting a delivery.” He went to the front door, forgetting to check the closed circuit television monitor as he should have. He did however, pick up his water cannon as he passed the place where it was hung on the wall and slung the strap over his shoulder in a practiced manner. He strode to the door and flung it open with a smile on his face that instantly froze as he recognised just who was standing there. He grabbed for his water cannon, which was a big arm and stopped him. It had only taken an instant but the noise of the fracas reached the main room and Steve, with a sense of foreboding, came to see what was happening. What he saw was his worst nightmare. Roberto, dangling, with his feet off the ground being gripped around the throat by a demon. The demon Andrew had not advanced into the house and the narrow passageway actually stopped Steve 99 from rendering any assistance, as Roberto was between him and the demon. He dropped back into the main room to find the eyes of a worried Mary observing him. “This is it Mary! There is a demon in the passageway strangling Roberto. I can’t get past him to reach the demon. I need you to go out of the back of the house and quickly head around to the front door. Stab the demon with your sword if you can. I will try to keep him occupied so he doesn’t see you. Go!” Mary didn’t need telling twice, she sprinted toward the back door and out of the house while Steve turned and started yelling at the demon. “Save your breath human or you will be next. This one took my arm so he is mine. The woman has run away, why don’t you?” Andrew was exultant. Killing was such a buzz. Especially when he was full of coke. The Devil was going to be very proud of him. Never mind that he hadn’t been around as long as Tyrus, he could still get the job done and he was smarter. business end of a short sword protruding from its stomach. With a roar of rage, Roberto was thrown away and with blinding speed the demon swung around. Mary’s sword hilt was ripped from her grasp but she stood her ground, praying loudly to their God. Steve had not wasted any time and as soon as Roberto’s body was clear of the demon, in one motion he drew and swung his daito with all his might in an overhead arc. The wondrous blade hit the demon on the top of the head, fair between the horns and carried on down through the demon’s body until it finished up beside its mate, Mary’s shoto. The swords seemed to pulse once before Steve grasped both swords screamed his rage and the impotence that came from not knowing where this had happened. There was no way he could track it, the moment, along with his demon son, didn’t exist anymore. He looked over at Louise who was just starting to show. “Andrew is dead. I need another wife to make another child. Any suggestions?” Mary looked at Steve who was standing gazing at the swords in his hand, a look of amazement on his face. He shook himself and handed Mary’s sword back to her, hilt first. “You okay?” she asked him. “Yeah, you okay?” he replied looking up and smiling at the realisation that they had slain a demon. Their first. Then a little dose of reality intruded. 100 “Roberto.” They said in unison as Steve turned and with Mary beside him they hurried to where Roberto lay, not moving. Between them, and considered Mary. “Well my love, what do we do now?” Mary looked back at him, eyes brimming with tears. She had really liked Roberto and now he lay dead in front of her. Dead. DEAD! have to end up fighting any more enemies around. Stepping over to the large plastic tub they gazed down at Ruth’s apparently lifeless body clad only in bra and panties. She had been under the holy water for nearly two weeks but looked as if she had been immersed but five minutes ago. Steve took the arms and Mary held the legs and after a count of three, they lifted Ruth out of the water and placed her on the floor beside the tank. “What do we do now?” Steve asked Mary. “I don’t know. Dry her off?” Mary took one of Ruth’s hands in hers and started patting and squeezing it. Steve responded by grabbing moans escaped her beautifull lips. “Ruth, RUTH. It’s alright you’re with Steve and Mary. We had to wake you. Ruth. Open your eyes.” Ruth’s eyes opened. Deep emerald green, focusing on Steve first and then Mary. She coughed, “Where, what.” “We had to wake you, Roberto’s been killed by a demon. Choked to death. You said you needed a body if we were to help Chris.” Mary told her, tears in her voice. “Are we in danger?” Ruth croaked. Steve studied the closed circuit television monitors on the wall of the panic room. They showed every room in the house and a view of the grounds outside. He could see no danger. “As far as I can tell we are on our own,” he said to her. 101 the body, Ruth helped where she could but was still a little weak from her suspended animation. Meanwhile, Steve had returned with the casket. Ruth spoke again, “Get some of the Holy water and mix it with the ashes in the casket. Then smear them onto Roberto’s body, particularly around the head and over the heart. We don’t have much time left.” Steve hurried to comply, using a new, unopened bottle of Holy water to make the slurry which he then smeared onto Roberto’s now naked body. Ruth looked down approvingly at the body before her on the floor, smeared with Chris’ ashes. “Well equipped. Excellent. I really hope this works. Okay you two, I have to change to demon form to do this and I don’t even know if I can perform the exchange of Chris’ soul into this body. I have colored. Ruth was amazing to behold. There was however, no time to sit and stare as Ruth leaned forward, placing her hands on each side of Roberto’s still temples. She closed her eyes and concentrated. Everyone was holding their breath, not knowing what to expect. Hoping against hope that the transfer would work. Ruth took her hands away and sat back on her heels. “That’s it, all I could do. I don’t know if it will work or not. It is up to Chris now.” The seconds ticked by. Two people and something other than human, intently watched the body in front of them for some sign of life. A minute had passed and still nothing. Heading on for two minutes, Steve noticed rapid eye movement in the body and drew the others attention to it. Ruth moaned and raising her arm, gave the body a healthy whack on the chest. A quick gasp ensued, followed by another then another. This was followed by a long intake of breath which settled down into regular breathing. The body was alive but who or what was in there and how much? Ruth looked down at herself. 102 “I was born a demon but what is this? Something I have never seen or heard of. What am I? How much power do I have and what sort of power is it?” A bout of coughing drew their attention, quickly followed by a groan as Roberto’s? head started to move. The eyes slowly opened and focused on each of them in turn, questioning. “Chris?” The longing in Ruth’s voice could not be disguised as she spoke the name of the man who had loved her through emotional suffering, pain and his own death. A smile came to the face of the body on the floor and one word changed their lives for ever. “Yes?” A couple of hours later and Chris was sitting with them in the kitchen having a cup of coffee. Beside him, Ruth in her human form was touching, touching, in an almost unbelieving fashion. Upon awakening, almost in front of their eyes, his bruised and battered throat had started to heal. He had dressed, after showering the ashes from his old body off his new one and had proceeded to try and explain what was happening to him. “It is hard to describe in words but it felt as though Ruth had lain me in an empty shell. It wasn’t empty though. I took a while to realise that I could use it by hooking myself into it. Like driving a car only a bit more complex. Before long things were running automatically and I didn’t have to think about what to do to stay alive. What is even scarier is that all of Roberto’s memories are in here with me and available. It will take a little while to get used to accessing them automatically. What is even scarier is that all of his fighting ability is here too. It is like moving into a fully furnished house that someone has just walked out of. Speaking of which.......” Here he turned and took Ruth’s hands into his own, gazing deep into her emerald eyes. “I love you so much but you know that. We have been closer together than any other lovers have ever been. Because of that, I saw how things work and I believe I have a little suprise for you.” Chris/Roberto sat and concentrated for a moment. Then slowly, before all of the amazed faces at the table, he started to change. Silver scales replaced skin, hair drew back into his head and diamond-tipped talons emerged from what were his fingers. “We are something new Ruth. I have the knowledge of the Brotherhood in my head. I have Roberto’s love for God and my own growing faith and I have you beside me again. We can never go back to who we were. This is our chance to fight evil and redeem ourselves. Are you in agreement my love?” Ruth’s gaze never wavered for an instant. “For what has been done to you and me, I vow to fight evil for the rest of my life. However long that may be.” They both looked at Steve and Mary. “Are you with us?” Steve and Mary replied in unison, “Until the end!” 103 For the next hour or two they sat and discussed strategy. It would be unsafe to remain where they were. Steve’s house would have to be abandoned. Luckily, Chris/Roberto could get them into the main Brotherhood’s safe house in the city, a place where the demons could not find them. Ruth told them of the meeting that had occurred at Fleeting Image and of the computer game that was being developed to replace the tape as a means of ensnaring souls. It would be ready in approximately two weeks if the schedule was being met. Its release had to be stopped however they could manage it, because once it got out, there would be a snowball effect if it was popular and soon it would be all over the world. Chaos. The only thing that was not discussed was the thing that none of them knew anything about, the arrival of the vampire covens. Later that night, safely transferred to the Brotherhood safe house, they headed off to bed. As Chris settled under the covers, Ruth reached down and took his potent erection in her hand. “We are so lucky that Roberto was really well endowed. I’m sure that God doesn’t mind wild uninhibited sex between consenting adults. Do you mind if I call you ‘Big Boy’ now and again?” Chris’ answer was to slide beneath the covers to kiss that other set of lips before testing his new equipment. If anything it was better than the old. Much to Ruth’s enjoyment. 104 Chapter 16. The Devil was slightly worried. This didn’t happen very often but neither did loosing two of his offspring in such a short time frame. Yeah, sure, he could do the rapid pregnancy thing with another offspring but if he did, the demon child wouldn’t have a very long lifespan, not like Tyrus. Now there was a demon. A son to be proud of. Defiant, arrogant and definitely evil. Apart from his occasional stupid mistakes when the bloodlust took him over, Tyrus was definitely the pick of the litter. He was the Devil’s longest living child and appeared to be in perfect health. What Tyrus didn’t know was that the Devil wanted to retire. He had been doing this job long enough. If nothing else, a long service leave of a couple of centuries would go down well. Tyrus wasn’t ready yet though, he still had some rough edges to knock off and needed to develop a sense of humour or at the least, irony. The Devil sighed, he had to make another child but his threat to bring in another woman and start off another rapid pregnancy was merely a teasing of Louise. She was getting too possessive and needed a little reminder now and again that he was THE Devil, the original bad-arse guy, not some little, wimpy johnny- come-lately. Another sigh, he had rather liked Andrew and all that time spent at college, gone, yesterday, late afternoon. These demon slayers were getting better; it might be that technology was helping them or HIM. He thought through the options that presented themselves, planning on the run. Maybe it would be better to make his next child in a discrete location, where it could not be traced by The Brotherhood. He could whiz over there after its birth, grab it and give it to someone to rear for him. Then it could grow up in a privileged environment and wield the power befitting a true demon. He would make this one Muslim, an increase in the religion base was important. It was going to be a boy, which was something he had no control over. Whatever child needed replacing, the sex was automatically correct. Fuck the RULES, he would like to have more daughters than sons, easier on the eye and not as difficult to deal with. He considered the options, it had been a long time since he had a black demon child. Mmm, Africa, that would take the young one out of harm’s way and he could do a seed and forget. No more of the fast pregnancy style however but the rapid growth thing was usefull. He would do that. It would be night over there now. Perfect. One less thing to worry about and The Brotherhood would have no idea. A Muslim! The ruler of Mombolani, a small nation in sub-Saharan Africa, was becoming worried. Not only were his people in the grip of a famine but he had no son to follow in his footsteps. If he did not produce one shortly, the people would start to doubt his manhood and he might just be deposed. One of his six wives had to get pregnant soon but unless he went and did something with one of them, that would not happen. He decided on wife number three and waddled off to do 105 something about it. Fifteen minutes later, tired from his exertions, he went to his own bed. Wife number three lay on her bed, totally unsatisfied. The King had lost his fizz, half hard for ten minutes and then a grunt and that was it. She longed for some real sex. The sound of someone approaching interrupted her reverie. It could only be the King, he was the only one the guards would allow in here. He must have forgotten something. The King entered her room with a swagger in his step and a very obvious bulge in the front of his robes. Wife number three was instantly interested. “Why, sire, it is most unusual for you to return to my chambers so soon and the bulge in your robe is quite large.” “Yes wife number three, I decided to show you what I am really made of. I am a King and a man!” With that, the robe was flung off. Wife number three had never seen the King with such a huge erection before and more than her mouth was watering at the sight of it. “Come to me my King and we shall make a baby, the like of which has never been seen before.” The Devil, Prince of Liars, wearing the shape of the King, muttered to himself, “Ain’t that the truth.” Wife number three had never, in all her whole life, been fucked like she was that night. The King’s weapon was huge and insistent. It made her eyes water to accept the thing inside her and when the King came, it was like liquid fire inside her, burning deliciously. He was tireless, his erection never went down. Even after coming so copiously that it ran out of her in streams, he was still hard. He left her before dawn, sleeping, with enough to dream about to keep her happy for quite a while. Wife number three was also pregnant. The Devil was happy. She was a good fuck and this son was going to be the best so far, he just knew it. Big, black and powerfull. A Muslim leader and demon to be reckoned with. The Devil suddenly reappeared in his chair by the fire, the time difference making it about local early afternoon. Spring was late and he was getting sick of the cold, the African climate was much more moderate. Louise was seated in the chair opposite. She was just starting to show, with two weeks of her four week pregnancy left to go. She was munching, as usual. “Hi Mr. D. How was it?” “Fine. Mission accomplished. We won’t be having a little chippy running around the house while you are here.” He smiled to himself, he did so much like lying, it was almost an art form. “The next thing to deal with are the vampires, they are arriving tonight, later on. Andrew was in charge of the arrangements but he is no longer with us. Luckily I kept abreast of developments and most of the basics are on the computer. I have been thinking about ‘Satans’, now that Ruth is no longer with us. We are using back-up dancers at the club and the living space there is now available. We could house some of the coven masters in it and they could 106 make converts out of some of the police and politicians that we lost when the tapes were stolen and take control of them. Yes, that should work quite well. Of course the rest of the vampires would occupy the underground club we organised in the city centre. Louise my darling, do you think a Gothic theme would be overdoing it for the nightclub?” Louise sat considering for a moment. “No, I think in view of the entertainment, a Gothic theme would be ideal.” “Great, I’m glad you approve. Now I must go and do some business. Bye.” Before Louise could reply, the Devil stood and disappeared from view. She felt alone and uncomfortable with the rapidly advancing pregnancy. This is not what it was supposed to be like. She had envisioned sitting at the Devil’s side, his Queen, wielding power and helping to decide important matters, not being stuck at home like a breeding bag. She was afraid. Once the child was able to fend for itself, she would no longer be of any value to the Devil and he had virtually promised her to Tyrus. Louise shivered at the thought of entertaining Tyrus. He was equipped like a horse and sex with him would be far more pain than pleasure. Louise got to thinking about her future and just how little bargaining power she would have. Louise was not a stupid woman, her biggest mistake had been in believing the Prince of Liars. She needed to acquire power from somewhere, real tangible power, power of her own. As her mind wandered over the options, she started fantasizing about what it would be like to have the powers of a vampire. She would have to find out more about them. Maybe she could live for ever. The Devil appeared on the sixteenth floor of Fleeting Image, checked his attire, straightened his cloak and went down to the fifteenth floor. On his way past the front desk he stopped in front of Sonya, who was still tutoring Dixie in her new job, to have a chat with her. “Andrew is dead, yesterday afternoon.” There was an indrawn gasp from both girls. “That’s why he didn’t show up last night,” Dixie whispered sadly. “Whatever. We are down to two demons now Sonya, you and Tyrus. It is possible that you may both be a target for The Brotherhood. Dixie can run this desk whether she is ready to or not as I have other uses for you, Sonya.” Dixie smiled proudly and inhaled, straining the buttons on her business suit. “There is always Cindy from the fourteenth floor to help her if she gets stuck. I want you downstairs in the computer room now; we have some planning to do.” “Yes Sire, immediately,” was Sonya’s reply to the Devil’s back as he swept away. In her own way Sonya really loved her Old Man. He was a complete prick, a liar, a cheat and the most evil person she had ever met. What a perfect father. The Devil swept into the room containing the big computers. Tyrus was bent over a keyboard entering raw code into the machine. On the screen in front of him, a figure which could only be Chris, was in the process of killing a man 107 outside of a bar while the image of Ruth looked on. The animation was excellent. The Devil was able to see the rage in the figure on the screen. “Greetings my son. The game is progressing?” “Yes Sire, it is coming together well but I am getting tired of having to remain in this building. I need some fun and entertainment.” “Your brother Andrew is dead.” “WHAAAT.” Tyrus roared as he pushed out of his chair and turned to face the Devil. “When, how?” The Devil smiled, he did so like this one. “Yesterday afternoon, late. Possibly Brotherhood, I had told him to deal with Roberto. I think he found Roberto but was careless and placed too much reliance on his demon powers. As you know, there will shortly be a new sister coming along and I have started off another brother for you as well but we will keep that under wraps for now. Listen, Andrew rang Sonya yesterday and told her he was going to Regent Towing on Tremaine Street to follow up a lead. Must have something to do with finding the red Corvette that Chris owned. The one that you are building into the game. I think a little research will do you good. I want you to go there and find out what Andrew found out then go and investigate. Be carefull, the Brotherhood are resourcefull and dangerous.” Sonya entered the room. “Oh and take your sister with you as back up, she could probably use some fresh air too.” “Excellent Sire, I was getting frustrated with being caged in here.” Tyrus turned and sat on his desk. “What time do the Covens arrive?” “The plane is coming in around eleven this evening. The Coven leaders will go to ‘Satans’ with Sonya. She is going to live there and keep an eye on them. As well as having some fun.” Sonya was beaming all over her face, this was excellent news. Some of the Coven leaders were long time pals that she and Tyrus often partied with. They sure knew how to have a good time and liked a good snort as well. Sonya was pleased. “What about me, my evil Sire?” Tyrus asked hopefully. “You Tyrus can have your hearts desire. Once the game is finished you will live with the vampires at the new underground complex in the city centre. Until that time, I want you working all day and through until midnight on the game. Andrew and I decided to call the new club, ‘The Mausoleum’. It opens tomorrow night. Although your brother was stupid enough to get himself killed, he was a pretty smart cookie in some respects. He left messages at a lot of the less salubrious ‘chat rooms’ that the club opening was tomorrow night and that entry was free. It was to have a ‘Gothic’ theme. Expect a large crowd of younger people bent on having a good time. They are the ones the vampires will infect. You can play there from midnight on if you want, as long as by working during the day, you can get our computer game finished inside the timeframe. One thing though, stay in touch with either Sonya or Louise. We don’t want another Andrew incident.” 108 Tyrus was skipping up and down with glee. What was the point in being an evil bastard if you couldn’t do anything evil? Now was his chance to have some fun. “Trust me Mr. D. I will get the job done for you.” “Make sure you do and keep a low profile,” were the Devil’s last words as he swept out of the room. Tyrus and Sonya turned to each other and gave a high five in exultation at their new found freedom and the chance for working evil. An hour later and Tyrus and Sonya were standing out the front of Regent Towing. They asked whether Andrew had been there and after spending a hundred dollars to find out the information that they required, they went to the address they were given. The largish old fashioned house was set back from the road among a profusion of two story apartment buildings. It appeared deserted but the two demons were not going to make the same mistake that Andrew had made. They split up and circled the house, noting the CCTV cameras around the outside of the house and the signs of new work having been recently carried out. The windows were locked and the curtains were drawn, barring any observation of the interior. “What do you think?” Sonya asked Tyrus. “I think we should break in and have a look. First though, we should disconnect the power.” They searched around the house until Sonya found the short pipe coming out the ground beside the front of the house and disappearing under the weatherboards. “Here it is,” she exclaimed. Tyrus wandered over and took a look. Checking there was no one observing, he shifted to demon form without the heat and grasping the pipe, ripped it out of the wall. Arcing wires at the end of the cables soon shorted out the local distribution fuses and all went quiet. He changed back to human form. They went around the back of the house and entered through the back door. Tyrus didn’t even need demon form for that, a hefty kick was all it took. They stepped back from the door, just in case, but all remained quiet inside. Taking a small chance, Tyrus walked down the short hallway while Sonya remained outside. Not for long though, Tyrus called her to join him and she entered the house also. They explored it together. There were signs that the occupants had left in a hurry, unwashed crockery in the sink, half-eaten food in the refrigerator and small pieces of rubbish scattered around. Tyrus found some empty five hundred ml. bottles and read the label before sniffing the top. “Brotherhood. This is stinking Holy water! We need to find out who owns this house and whether Roberto has been here.” They continued around the large room until they got to the ‘panic room’ doorway. Luckily it had been left open; otherwise it would have taken a lot of demon energy to get through the steel door. On entering, they found the plastic 109 tub of water in the middle of the room. Tyrus idly put his hand into the water then hurriedly withdrew it. “Shit! My hand is burning and I can’t move it,” he cried, dashing into the kitchen to rinse his hand under the tap. “Holy water, a bath full of it. No wonder the Devil couldn’t find Ruth. She must have been here all that time. This has never been accomplished before.” He looked squarely at Sonya. “We are up against some tough opposition here.” Then he smiled a dark smile. “Excellent. For over six hundred years I have been looking for opposition worthy of my talents and now finally, I have a chance to really let loose. Come on Sonya, we have to report this to Mr. D.” They left the house the same way they entered but not before starting a fire that would shortly consume the whole building. The mobile phone rang and Steve answered. “Yo, Detective Mike, to what do we owe the pleasure?” “No pleasure Steve, your house has just been burnt to the ground. Sorry.” “Shit. Well, couldn’t be helped. It was insured and we are not there any more. I took out everything that was of value last night when we shifted. We have had some new developments and need to bring you up to speed. Can we meet you somewhere after work and bring you to our new safe house?” “Sure, buddy. Say six o’clock. The phone box two blocks down from where I work. I just need to check I am not being tailed.” “Okay Detective Mike, see you there. At precisely six o’clock a Nissan Skyline, with blacked out windows, stopped briefly at a phone box. A man jumped in and the car left quickly. It was unobserved. Fifteen minutes later it pulled up outside an ornate set of steel gates in a long wall surrounding an estate. The gates opened and the car sped up the drive and entered a large garage set beside the house. The garage door closed behind the car. Only when the door was fully closed did the car doors open and the two occupants stepped out. “My, you certainly have had a change of fortunes,” drily observed Detective Mike. Could do a lot worse.” Steve smiled; he liked the gruff detective and found his dry humour amusing. “It was necessary believe me. This is a Brotherhood ‘safe house’, headquarters in this city and if you come with me, you will see why we are here. How is your heart by the way?” “Fine, lead on.” Steve didn’t see the quizzical expression on the detective’s face as he followed Steve up into the house, passing armed guards at various intervals. “Pretty tight security you have here Steve. What’s it all about?” the detective asked. “Two minutes and all will be revealed,” answered Steve as they came to a large single steel door. It looked very strong. Steve pressed the switch beside the door 110 and spoke into the microphone. The door swung open to reveal a large lounge area. Steve ushered in Detective Mike and the door closed firmly behind them. Mike was shocked. Standing before him was Ruth, the demon woman. He went for his gun but Steve’s now strong grip, thanks to all the training, caught his wrist before he could get his hand under his jacket. “Wait. Listen to what we have to tell you before going off. Okay.” Detective Mike assented grudgingly and Steve let go of his wrist. Roberto nodded at Detective Mike who nodded back but thought he saw an amused gleam in Roberto’s eyes. He sat where indicated, never taking his eyes off Ruth. The four friends proceeded with the story until just after the transfer of Chris’ spirit into Roberto’s dead body but they didn’t mention how Ruth and Chris could now change into ‘other’. Chris/Roberto smiled at Detective Mike and advanced with his hand held out. “I just want to thank you for doing your job and helping me in small ways,” he said. “I know you are a good person and I hold no grudges.” Detective Mike could not believe what was happening. This was Roberto, not Chris. What were they trying to pull here and why was Ruth, a full on demon, sitting with them? Steve took up the narrative. “All this occurred yesterday afternoon. Roberto was killed by asphyxiation, a demon choked him and Mary, my beloved ‘butter wouldn’t melt in my mouth’ Mary, slew the demon.” “We both did, lover.” Mary corrected. Steve continued, “Mary and I have been communicating with Ruth and Chris by way of dreams for a while. Myself for longer than Mary. I assure you that Ruth is now one of us. She and Chris are committed to fighting evil.” Detective Mike looked like he was really confused but finally his brow cleared and he stood up and took Chris’ hand. “I believe you all and if you really are Chris, I owe you an apology for not doing more to help you at the time. Unfortunately, I only learned about all the crooked cops and officials after you had died.” He nearly choked on that last word. “I mean passed on. Oh shit, I don’t know what I mean. C’mere.” Detective Mike pulled Chris/Roberto to him and gave him a monstrous bear hug. “I am just glad you got another chance, sorry about Roberto though, I kinda liked him.” Chris leaned back, “He is still all here, only the soul is missing. That essential part that makes us who we are. Yes, it was a shame but nothing of Roberto has been lost. If I hadn’t taken this body, all of it would be no more.” Detective Mike moved over to stand in front of Ruth and held his arms open. “You were a bad bastard and I should be taking you in for what you have done but you gave Chris back and they tell me you have reformed.” She smiled sweetly and folded into his arms, giving him a big hug. “I was told how you helped in the raid on ‘Satans’ to get me out. You are a wonderfull, brave huggy bear. Thank you Mike.” She stepped back in time to see Detective 111 Mike’s face go pink with embarrassment. Everyone had a chuckle and the ice was broken. “One last thing Detective Mike and this must remain secret. We don’t know the implications yet but something amazing has happened. Chris, Ruth, if you don’t mind.” Chris and Ruth stepped back into a clear space and standing facing one another, began to change. They could have done it instantly but for the sake of Detective Mike, they allowed the change to happen slowly. What he saw was, the areas of their body that weren’t covered by clothes changed to scales. Bright silver, shimmering scales and all the hair on their heads vanished. Their hands changed to talons ending in diamond nails. They turned to face him, fierce and beautifull, a pair of new beings never before seen on the face of the Earth. His knees started to wobble and he sat down suddenly, his pink face draining of colour. “What the fuck.......” was all he could manage. When he looked up again, there were Chris and Ruth, standing before him again. “Guys,” he croaked. “Is there really a God?” The four friends looked at him and smiled tenderly. “We tend to think so but only you can answer that question for yourself. Now, down to more mundane matters.” Steve spoke as he walked to the large desk and picked up a sheaf of papers. “I printed off a few copies of the Photofits that you sent of the people involved in the motel murders. Ruth has confirmed that they are a pretty accurate representation of two demons, Tyrus and Sonya. They are based at the Fleeting Image Advertising Agency on the sixteenth floor, coincidentally where Chris scored a job. These two demons are exceedingly dangerous and the Devil owns half the business. We need to act before the computer game they are cooking up is released in a couple of weeks. It could mean the end of civilization as we know it.” Detective Mike looked a little puzzled, “Why don’t we just go over there with a squad of policeman and arrest them.” “How do you know they are there? The Devil could send them anywhere within a hundred kilometre radius instantly.” Ruth’s dulcet tones interjected gently. Then she continued, “You may not believe in God but I strongly suggest that you believe in the Devil. He is here in this City and He is mighty. I know, He was my father once. He could make your whole squad disappear in the blink of an eye if they showed any aggression towards him at all. Going to His place, armed, is not a good idea. Believe me.” Ruth sat down and Chris sat beside her, holding her hand. After being disembodied for so long he just couldn’t stop holding her. “What do you suggest then?” he asked them. Mary answered, her voice soft and personal. “We have two weeks before the game’s release. We should plan to move on Fleeting Image in about a week’s time. That is where the computers are that the game is being made on. To do that, we need excellent planning. Since Chris has taken over Roberto’s body we have access to all the resources of the Brotherhood and we are going to need 112 them. One thing though Detective Mike, as recently as yesterday we have all been through some pretty heavy action and we all need a rest. How about you have dinner with us this evening, as our guest. Stay the night and we can get down to some serious planning tomorrow.” “But what about going to work?” Chris looked up, it was unnerving dealing with him in Roberto’s body but they were getting used to him as Chris now. He spoke. “Get a life. Take a sickie. We are planning to save the world and you want to go to work?” Steve joined in. “Yeah, take a sickie but only one day. We could still use the inside line to the police force. I still don’t trust those bent officials and you are our only intelligence on them.” Detective Mike looked relieved. “That is an excellent suggestion.” Looking at the others he asked them. “Do you all agree?” They all agreed, so Detective Mike stayed the night and the next day sat in on the planning session. 113 Chapter 17. Late that evening the Russian transport plane arrived at the airport right on time. Unfortunately, it overshot the main runway and ended up on the grass near the fence around the airport. As the pilot was explaining to the control tower, in fragmented English, why he had overshot the runway, dark shapes were dropping out of the rear side door and heading for the fence. By the time the pilot had turned the plane around, the door had been closed and an empty plane arrived at the cargo terminal for the customs inspection. The thirty or so dark shapes disappeared through a hole in the fence which was subsequently wired back together. They boarded a couple of small mini buses which drove off quietly into the night without lights. Very smooth and very slick. The mini buses delivered the majority of them to ‘The Mausoleum’, the new dance club in the centre of the city, while the rest, the Coven leaders, were delivered to ‘Satans’. ‘The Mausoleum’ was extremely well designed for the purpose to which it was going to be put. There were luxurious permanent living quarters at the very rear of the premises behind the kitchens and storage areas. These had their own exit to the streets above. At the front, there were false walls inside the main area of the underground club. It appeared fairly innocuous, decorated as it was around the walls with coffin lids but each of these coffin lids affixed to the walls had a secret catch. When activated, the lids swung back on hinges to reveal a small room with a large bed in it, synonymous to a crypt. Once the door was closed, the rooms were lit but when the door was opened, the light went out. This was where unsuspecting patrons were going to be given free coke and provide the opportunity for feeding the vampires and being ‘turned’. Although inspected by building inspectors, its secrets had not been discovered. The best way to cause mayhem in the City was to multiply the vampires as quickly as possible. All it took was vampire blood in the bloodstream of a normal person and within a week or so, that person would become a vampire also. Even dead, Andrew’s legacy was a well organised and built venue for the continuation of ancient evil. Tyrus was in his element. At the new club, each of the vampires was given his, or her, own crypt and they quickly settled in. Some of them called Tyrus father, some of the younger, blood infected ones, called him grandfather. Tyrus liked this; it gave him a paternal feeling that had been missing since the last time he had played with them. Tonight they would have to go hungry. As he explained the plan of action to them, more and more smiles could be seen around the room. Smiles that revealed wicked looking canine teeth, modified for venipuncture and razor sharp. It was a good plan, simple but efficient. After a couple of weeks, 114 when things hotted up, the original vampires could disperse throughout their newly adopted country. Emigration and leaving the old country behind was the way to go. Make a new start in a land of opportunity. After the briefing, things started to relax a lot. Bags of coke appeared and the music went on. With flashing lights and Marilyn Manson on the sound system, the private party started in earnest. It wasn’t long before Tyrus headed off to a crypt with his favourite daughter and granddaughter. He loved playing with vampires, they could take everything he dished out and even give some back. They had no morals and healed quickly. If he was particularly destructive, a little feed of blood revived them no end. They even allowed him to fuck them in his demon form, something that would kill a normal human woman. Tyrus was ecstatic. Tomorrow was another day. At ‘Satans’ the atmosphere was a little more reserved. Sonya was sitting in the private office with five coven leaders, four men and a woman. It was unusual to find a female coven leader but she had risen to power because she was strong and ruthless. Sonya was outlining the plan to them. “We intend to turn every policeman, politician and city official that visits this club into a vampire. There are quite a few of them, so you will have your work cut out. My old man, the Devil, asks for your co-operation in this matter and suggests we should work on a timetable of one week to have the bulk of them turning.” Lucinda, the female Cven leader, chimed in, “Why the rush? What difference will it make whether we take one week or three weeks?” She sat back and looked closely at Sonya, trying to work out how dangerous she was. “The other part of our plan involves a computer game that we believe will be very popular. It is nearly finished. If we can have the authorities in confusion and arguing with each other, the game can be launched quietly. Hopefully, this will allow it to spread quickly all over the country and then the world.” Sonya had tried for a concise explanation. Dragovich chimed in, his English a little rough. “So, what is importance of mere computer game to us. Where do we benefit?” Sonya paused, “Sorry, I didn’t make the explanation perfectly clear. We believe that this game has the potential of making all who play it into minions. That is, a reservoir of evil souls at the Devil’s command, which is also a resource of food for the Covens. Evil wins and good looses out. God takes one on the chin for a change and the dark times will come. Do you know how powerfull we will be?” Dragovich laughed, “Power I do not need. I am Coven leader. I am powerfull.” Lucinda bared her fangs and hissed at Dragovich, “Do not listen to the old fart. He is more of a woman than me and becoming toothless with age. I want power. What about the rest of you?” There were nods all around as all the Coven leaders accepted the plan. Sonya would be the lure and once an official or policeman was in a private room they 115 would be subdued and infected. Lucinda was the other bait for the male patrons of ‘Satans’, she would be irresistible to them. The female patrons of the club would be easy prey for the Coven masters. They would start tonight. Louise was bored. Sure she had a new house and a big one at that but the Devil had not come near her sexually since the night she was impregnated. She was just starting to show and as randy as all get up and go. She needed a good session of lovemaking and the Devil wasn’t going to do it. He couldn’t expect her to sit at home all alone while he was out fornicating and accepting virgin sacrifices. The world was in the twenty first century now and dual standards were rapidly becoming a thing of the past. She had to get out of the house but where could she go? ‘Satans’ that’s where. The club that the Devil set up for Ruth. It was the place where all the bad people went and she should be in her element there. She could find some well mannered gentleman and have anonymous sex with him. One never knew, it could be good. The taxi dropped her off near the club. She had been enough times to know that she had to go down the side street and into the ally. There was no problem with entry and one o’clock in the morning was not too late for this place. She was hot and getting hotter. Louise squeezes her thighs together, causing little ripples of pleasure around her clitoris. Her panties were wet. She had to get something happening soon. That something was four noses, which smelt her in the club very shortly after she had walked through the door. The aroma of sweet pussy with subtle undertones of early pregnancy was a beacon for the four male Coven masters. Dragovich was the first to reach her, bowing with a flourish before introducing himself. “I am Count Dragovich, at your service madam and you are?” “Louise, Count Dragovich. So pleased to meet you.” She was getting squirmy now. This guy was really quaint in an old fashioned way but she felt drawn to him. If only she could get him alone soon. Almost as though he were reading her mind, Dragovich turned and picking up a bottle of champagne and two glasses, asked her if she would like to accompany him to a private room. He was irresistible, charming and there was no way she could refuse. Louise followed Dragovich to a private room and there, with the door locked, they undressed each other. It was not frenzied, Dragovich slowly removed each piece of clothing from her, licking and caressing her skin as he removed it. She in turn responded in a like manner. By the time she was naked, she was so turned on that bodily fluids were running down the inside of her legs. Dragovich was rampant. He was not much in the length department but his penis was very thick and covered with gnarled veins and tiny scars. It looked old, although he didn’t. They got down on the bed and Dragovich pointed at her stomach, “You are pregnant, just showing. How long?” “Two weeks,” Louise replied without thinking. 116 “Ah, you make joke, no. Ha ha.” “Yes I make joke, I meant to say four and a half months.” “Good, good. It make your titties sensitive and make you horny, no.” He spoke as he slid his hand down between her thighs. His fingers barely brushed her shaved lips but she bucked in response. It felt like an electric shock. “It makes me horny, yes. Please, put it in me, I can’t wait any longer.” She grasped his thick penis in her hand and pulled him towards her with it. It was so fat, her fingers did not meet around it. No problem though, she was so wet that with a little shove he coasted right into her. All the way to his pubic hair. “I like a woman to have bald pussy. Very sexy,” he commented before starting the in and out rhythm she was aching for. Her back arched in pleasure as she met his thrusts blow for blow. It all felt so good. She came, wave after wave of pleasure but still Dragovich kept up the rhythmical thrusting. Then, wonder of wonders, she came again and again, then almost continuously until with a great shout, Dragovich started coming. She had never met a man who shot as much as him, spasm after spasm wracked his body, each one accompanied by a jet of fluids. Finally he stopped. The sheets were sopping wet with their combined juices and Louise felt really languid, she flopped her head back on the pillow and lay trying to catch her breath. Dragovich however, started to move down her body, kissing and nibbling her flesh. It felt wonderfull and she lay back allowing him to explore her pussy with his tongue then move down to the inside of her thigh. She was rapturous and even the small pricking bite didn’t interrupt her enjoyment. It was not unusual for the Devil to lay bigger bites on her. It was only when Dragovich came back up her body to lie beside her that she opened her eyes and noticed the blood on his mouth. Sitting up, she looked down and saw the blood on the inside of her thigh trickling from two small puncture wounds over the femoral vein. She looked at his face again and saw the cut on his lip where his own blood was leaking out. Before her eyes, it healed up leaving not a trace. Her heart sank and a feeling of despair wrapped itself around her like a clammy blanket. “Tell me that you are not a vampire. Tell me that you have not infected me,” she whispered in anguished tones. Dragovich looked suprised. “How did you know? We modern vampires never use the puncture of the neck. It is too obvious. How can you tell I am a vampire?” “I couldn’t until you bit me. Please, if you have infected me, make it go away.” “I am sorry Louise, that is not possible. There is no known cure once infected. You will become a vampire as will your unborn child. There is no cause for concern, you can join my Coven. I find you rather tasty.” Saying this, he ran his tongue over his lips in an obviously sexual gesture. Louise was frightened. All the joy and satisfaction of the liaison just disappeared. Evaporating into the sexual aromatics of the room they were in. She got up and quickly wiped herself down with one of the provided towels, then dressed 117 hurriedly. She had to get home immediately before anyone saw her or recognised her. She fled the room, heading for the way out and failed to see Sonya who was passing. Sonya however, had seen Louise and curiosity piqued her. She went to the door of the room that Louise had just left and entered, to find Dragovich slowly dressing. “Did you infect the woman you were just with,” she asked him anxiously. “Of course. Is that not the plan you told us. Infect as many as possible as quick as possible. I do my duty at the Devil’s command.” Sonya was looking more worried as the conversation progressed. “Do you know who she is?” Dragovich paused, something was going on here. “No, I do not know who she is but I would like to fuck with her again. She is very wanton.” Sonya made a decision at that moment. This incident was best kept a secret for now, even from the Devil. If he found out he would be very wrathfull and no one knew how much power the Devil could really wield. He might just take out all of the players in this game if he was mad enough. If she could only slow down the change, just until the demon child was born, the Devil may not care as much. “Is there any way I can slow down the infection?” she asked Dragovich. “This is really important. It may mean your life if she turns too quickly.” By now he was worried. Here was a demon and a powerfull one at that, begging for his help. At the same time she was telling him that his life may be forfeit. He had enjoyed his four hundred years of existence and didn’t want to die just yet. Dragovich considered. “Feed her lots of garlic. Italian food is good. Three times a day. When she cannot accept the garlic anymore she will change. Maybe two weeks if we are lucky.” “That’s it! The only way!” “You could always kill her. That method works very well.” Dragovich chortled at his own joke. “You fool!” she yelled at him and spinning on her heel, turned and left the room. Sonya figured Louise would head for home. The new one, the mansion, not Fleeting Image. As she turned into the gravel drive, she was gratified to see Louise’s car sitting beside the house. This was going to be a tricky thing to handle. Still, being alive for around five hundred years helped to some degree. Sonya rang the bell and before to long Louise’s voice could be heard. “Who is it?” “Sonya. Let me in please.” The door swung open and Louise asked suspiciously. “What do you want, I don’t feel like talking.” “Well you had better listen then.” Sonya said as she pushed past Louise and entered the house. “Is the Devil around?” “Who ever knows? Not in the flesh anyway,” was the reply. “Good. Listen up, we don’t have much time. I know what happened tonight. I don’t care about the sex thing, we are evil and it is our job to keep the standards 118 as low as possible. However, you have been infected by a vampire while carrying the Devil’s child. That has never happened before and Mr. D. could go ballistic. You don’t know what that means but I do. It ain’t pretty. Bulk death, etcetera.” Louise spoke up. “But I didn’t know he was a vampire, he never said. Just bit me the horrible bastard. Who is he anyway?” “One of Tyrus’ children by a human mother from long ago. He is a Coven master now and quite important in the vampire world. You just got caught up in one of the parts of the Devil’s big plan, honey. Thing is, the Devil can’t know about it for now, so we have to disguise it.” “Can’t you make it stop?” wailed Louise. “Unfortunately not. Seems as if there is no cure. However, it can be slowed down for a week or so if you eat huge quantities of garlic. Like Italian food three times a day. Also, we have no idea what effect it is going to have on the little demon you are carrying. Could be interesting.” Louise’s emotions had graduated past scared and now she was angry. “Fuck that. I am already eating five meals a day to keep up with the demands of this pregnancy. We live in the modern age. Tomorrow I am off to the health food store to pick up a decent supply of odourless garlic tablets. That way the Devil won’t be able to smell something stinky going on.” She chuckled at her own joke. Sonya was relieved; Louise wasn’t as flaky as she had thought. She was bearing up well to the pressures of the situation. They may get out of this alive yet. “Good girl, I won’t breath a word of this to anyone, it will be our little secret, just between you and me. If you need help, contact me. Now go to bed and carry on your life as normal. As if having a one month pregnancy is anywhere near normal. I am going back to ‘Satans’ now. See you later on.” She turned and went down the steps to her car. Just as she reached it she heard her name called. “Sonya.” She stopped and turned. Louise gave her a really gratefull smile. “Thank you ever so much, I won’t forget this.” Then she turned and went inside. Sonya left. As she was driving away she felt somewhat sorry for Louise. Sorry? What was this shit! She was a demon, daughter of the Devil. Sorry? What the fuck, Louise got what was coming to her. Stupid bitch shouldn’t have gone to the club in the first place. It just had to be kept quiet in case the Devil went ape shit. 119 Chapter 18. Steve and Mary, Chris and Ruth and Detective Mike had a leisurely breakfast together. The Brotherhood house was well run and totally staffed by Brotherhood. Some fought, some planned and some cared for others. After basic training the members of the Brotherhood gravitated to what they were best at. Roberto had been fairly high up in the organisation and had a fair amount of autonomy. He was in charge of the present campaign in the City. As Chris had occupied the body, with all its memories intact, when Roberto was killed, it was effectively Chris that was calling the shots. However, he relied heavily on the advice of his friends and any insight that Ruth could give him on the inner workings of the demon cabal. Steve and Mary had been conversing with each other the night before while they were in bed, prior to going to sleep. It had come to Steve’s awareness that every member of the Brotherhood was a distant relative of both Mary and he. In fact he and Mary were distantly related. It was a peculiar feeling, he thought while eating his breakfast, to know that he was related to the man who cooked his food, the man who served it and any other of the Brotherhood in the house. After the breakfast dishes had been cleared away they got themselves another cup of coffee each and the meeting started. Steve had become the default leader of the little group because everyone respected his commitment to the venture and his level headedness. Chris had all the information on the technical side of the Brotherhood’s workings and Ruth was the mine of information about demonology. Detective Mike lent his years of experience as a policeman and Mary was, well, Mary. The quiet one who could bridge the others’ ideas. With the table cleared they got down to the business at hand. Unfortunately, the one piece of information they were missing was the fact that a plane load of vampires had arrived in the city the night before. Steve started the ball rolling. “Okay, so far, we know that we are facing up to the Devil and two older demons, Tyrus and Sonya. We know what the demons look like and have pictures of them. Their plan is to release a computer game which is the story of Chris’ ‘adventure’ under the influence of the cassette tape. From what Ruth tells us, the RULES by which the Devil works do not cover a computer game. Apparently, if anyone plays the game through, by accepting the warnings and making the characters continue in the game, they are as guilty of sinning as someone who actually did those things.” Chris groaned and put his head in his hands shamefully. “Don’t remind me please.” 120 Mary piped up. “It’s all right Chris, you never turned fully and you have accepted God. You are a good person and we respect you.” Mary understood completely, her life previous to ‘finding’ God had not been without its bad side. Steve continued. “The idea of the game is to create an army of minions to further the work of the Devil and to act as a reservoir of souls for the Devil to draw on. We have to stop this game getting out. I believe that is our objective. Now, any ideas or comments.” Detective Mike put his hand up. “It looks like we have to get to the computers and destroy the game before it is finished. That means getting into Fleeting Image and accessing the computers, wherever they are.” Steve jotted down that point on a pad before him. “Right, do we all agree.” There were nods all around. “Good. Next.” Chris was the next to speak. “The computers are on the fifteenth floor. I used to work there and have a fairly good knowledge of the layout. Between Ruth and I, we could come up with a floor plan of the three floors that Fleeting Image occupies. I don’t know much about the sixteenth floor, particularly the ‘private’ area but Ruth will be able to fill in the blanks.” “Okay, excellent.” Steve made another note on the pad. “I will leave the floor plans to the pair of you. Well done. Next.” It was Mary who spoke next. “If we have to go in there, we need to know what the Devil looks like.” There was a snort from Ruth. “I’m afraid I have some bad news for you all. We are talking about The Prince of Liars, The Great Pretender. He can be whatever he wants. The little girl eating an ice-cream on the street corner, your mother, even you if he so desires. Most of the time he favours a three-quarter length, black leather coat and a black Stetson hat. The other piece of bad news is that he cannot be killed; he is the flip side of Devine but with slightly less powers. However, he cannot just up and kill one of God’s children for no reason. You are your own protection. If your heart is true and you carry your belief strongly within you, as long as you don’t commit a sin, you are safe. In other words. If you kill one innocent person by mistake, he can take you out in the blink of an eye. For most of the routine wet work he has his demons to kill for him. That is what we are up against.” There were sombre looks all around the table. This was not going to be easy. “We need someone on the inside.” Detective Mike suggested. “It would make access easier if we had a key or two. Any suggestions Chris?” Chris sat pondering for a moment then a smile lit his face. “I wonder if Cindy still works there. She was pretty good to me and seemed sorry when I was fired. She seemed like a good person, untainted. Ruth?” “As far as I am aware, she wasn’t a minion or one of us. Might be worth a try.” Steve considered this point. “It would save us a lot of time and effort if we had easy access. Someone will have to talk with her. Who?” 121 Mary put her hand up. “Detective Mike and Roberto were probably seen at the motel murder scene. Ruth is known and you, Steve, may be compromised by being Chris’ best friend. That leaves me. I am the only one that can not be recognised. I will go.” Steve was not happy with that but Mary was right. Another note was added to the list. “Chris, how do you think we should deal with the computers?” A smile crossed Chris’ face. “Blow them up.” “What!” “Blow them up. They are probably password protected and the game will be on the huge hard drives. There will also be backup copies of parts of the game stored in desks or other places. I reckon we should use plastic explosive on the computers themselves and incendiary charges over the rest of the fifteenth floor. We can’t leave anything to chance. The sprinkler system will cut in and contain the fire but the windows blowing out could be a problem.” Detective Mike smiled. “Not much of one if we blow it around four in the morning on Sunday. I like that plan. Very positive and very direct.” Steve chipped in, “That is in six days time. Any comment?” No one around the table had any objections to the idea, so it was added to the list on the pad in front of Steve. “Where do we get all the explosives from?” Detective Mike queried. “We are sitting on them.” Chris answered, gesturing in a downward direction. “The cellar’s chock full of armaments.” Mike was amused. “From a professional standpoint. How did you get them into the country?” Chris winked at him. “They were already here and that is all I am going to say on the matter.” “So how’s this going to go down?” Steve asked them all. It was Chris who answered again. “Detective Mike downstairs watching the main entrance. We will all be wearing earpieces and throat mikes for communication. Mike has no experience in fighting demons, so it is safest for him to be there. Mary, I believe you are the expert at getting into places. We will need to use the stairwell to access the fifteenth floor from the fourteenth. I doubt Cindy has keys to the upper level stairwell doors and access by the lift to the fifteenth and sixteenth floors will also be controlled by key locks. There may also be an alarm system activated. Steve, once we gain access to the fifteenth floor, you protect Mary and I will go and set the charges. I would like Ruth to go with me. Does that sound okay to you guys?” Steve smiled. “Spoken like a Commander of the Brotherhood.” Everyone laughed as Chris blushed a deep crimson. He was unused to taking charge but his new body had been very used to it and sometimes went into autopilot. Still, 122 he had only been in it a couple of days and was continually adjusting to the finer points. The group had made good progress during the morning, a plan had been hatched and the notes that Steve had taken were fleshed out over the next couple of hours as details were added to them. By the time they broke for lunch in the early afternoon, everyone had a good idea of what they were going to be doing. Mary decided to get the ball rolling as quickly as possible and left shortly afterwards to try and make contact with Cindy. Steve went with her, his intention being to wait in the car, close to the Fleeting Image building, in case of any problems. The fact that the weather was cold was very handy as the hooded track top he was wearing covered not only his head but also the handle of his sword which was strapped to his back. Mary carried a mobile phone with her. Detective Mike also left with them. He was to be dropped off near his home which wasn’t too far out of their way. Truth be told, he wasn’t really happy with his role in the up and coming attack on Fleeting Image. Being delegated to watch the door of the building during the operation was not his idea of an important task. He was a take charge sort of person and he felt the idea of being a glorified doorman was a little beneath his talents. Anyway, how bad could those supposed demons be if Steve could take one out? He could see the sense in all of the plan but not having anything to do with demons directly, made him wonder at the stories he was hearing. He carried two guns and he knew how to use them. Had used them. Had killed armed and dangerous criminals. Still and all, he was part of a team and that is what they had all agreed on. After the others had left, Chris and Ruth sat together stroking each other on the arms, the face, anywhere the skin was bare. It was a source of endless pleasure for them to be reunited in the flesh. Ruth was still coming to terms with the new body that Chris occupied. She had liked the old one well enough but this one was bigger and stronger and just as well endowed. His new face was not as handsome as the old but held far more character. Years of training, knowledge and combat were engraved there, giving his countenance an almost regal quality. Chris saw Ruth as Ruth, the woman he had fallen in love with, before he knew she was a demon. The woman he had loved even when he suspected she was evil. The woman who had contained his soul after his death. The woman who was no longer evil and who had placed his soul in another body so he could live again. They laughed simultaneously. “You know, I would love to take you to bed and see what it is like to be together ‘changed’. Chris whispered in Ruth’s ear. “Okay, let’s go.” They adjourned upstairs to their room, locked the door and got undressed. Lying on the bed together they changed into their other shiny, scaled forms instantly. Ruth wiggled underneath Chris and guided him into her. They meshed and MESHED. 123 The external world was gone. They had no awareness of their bodies. They were back in that forest that they had created together, naked, in human form. They stood and stared at each other and their surroundings. “What the......” Ruth placed a finger on his lips. “Don’t talk lover. We are in our own place. Whatever is happening to us is something that we should enjoy. We have peace. It may be a gift or it may be something which is a side effect of our trials but I think we should enjoy what we have.” He nodded dumbly and holding each other they sank to the deep moss of the forest floor. The two silver forms on the bed, one on top of the other, were glowing with a dim silvery glow which reflected from the rooms furnishings. There was no movement, all was still. Time had ceased to exist for them. About four o’clock that afternoon, Steve dropped Mary off outside the tall, glass- walled building where Fleeting Image occupied the fourteenth to sixteenth floors. Mary entered and took the lift up to the fourteenth floor. The lift doors opened and she stepped out looking lost. The attractive blond girl behind the reception desk looked up. “Hello. I’m Cindy. Welcome to Fleeting Image, can I help you?” “Um, er, oops. Sorry, wrong floor. My mistake.” Mary’s acting must have been very convincing because Cindy replied. “No problem, happens quite a bit. You get used to it.” Mary smiled as a ‘ping’ signalled the next lift down. “Thank you for being understanding,” she said as she boarded the lift. “See you.” Cindy gave her a little wave as the lift doors closed. Mary waited in the coffee shop in the foyer of the building, trying to be inconspicuous in a secluded corner with a view of the lifts. It was finishing time upstairs and crowds of people were now disgorging from the lifts as businesses closed for the day. The crowds started to thin out and just as Mary thought that she had missed her, Cindy came out of the lifts. Mary rose from her seat and walked quickly to intercept Cindy, trying not to hurry as she edged up beside the attractive blond girl. “Hi, remember me,” she said. “Yeah, the girl from the lift. What do you want?” “Fifteen minutes of your time for which I will pay one hundred dollars.” Mary took a folded bill from her pocket just as they were exiting the building. “No tricks, just hear what I have to say and the money is yours.” Cindy was intrigued, this was quite a novel approach. Deciding that she had nothing to lose, she agreed and they entered a bar down the street. A Nissan Skyline with blacked-out windows also moved down the road and took up station just down from the bar. Inside, Mary bought them both a drink and they 124 settled into a private booth at the back of the bar. She unfolded the hundred dollar bill and placed it on the table in front of Cindy. “This is yours, whatever.” Cindy was impressed but thought she had better get the ball rolling. “Start talking sister, the clock’s ticking.” “Okay. At the beginning of last year, a half share of the company was sold to an unknown buyer. Since that time there has been some strange goings on associated with the company. The death of a junior executive in a car crash fire, the hiring and firing of Chris and his subsequent death. Andrew, started work downstairs but then after Chris was fired he stopped working there for a while but still hung around on the sixteenth floor. Louise who came to work at Fleeting Image after the purchase of the company, replaced the original receptionist who disappeared. Ruth, hanging around the sixteenth floor and being involved in all sorts of shady deals, including getting Chris hooked on coke. Now there is a stranger working almost non-stop on the computers on the fifteenth floor. What do you think about all of that?” Cindy was amazed. “How do you know all of that stuff? Yeah, it’s kinda creepy all right. There is other stuff that you didn’t mention, like the number of new people who start there but only last six weeks or so. Most of them seemed to coke out. Now that I think of it, it is pretty weird. Then there is that guy working the computers on the fifteenth floor, he gives me the willies. He looks at me like I was a piece of steak and he was hungry. Those eyes, nasty. Anyway, what do you want?” “I am working for a secret organisation that believes the security of the nation is under threat. We believe that Fleeting Image is being used as a cover for some power that intends to do this country harm. We have been watching them for some time, which is how come we know so much. Even down to the fact that you arrive for work half an hour early and cover for the people who work on the fifteenth floor whenever possible.” “Okay, okay. What do you want me to do?” Cindy couldn’t believe how much this person knew. Their surveillance was excellent. “All we want you to do, is for you to give us your company keys for two minutes so I can take a wax impression of them. We need to get to the computers on the fifteenth floor without any of these people knowing. There we can search for any incriminating information and maybe do something to the files to corrupt them. This will delete the data in there which we believe constitutes a serious threat to the wellbeing of the country. You will not be implicated, no one will know of the part you played because the operation is totally secret. Oh, by the way, you will also receive one thousand dollars cash. A small reward for helping your country in these troubled times.” Being a lady who liked her cash, Cindy handed over the company keys. Mary took a couple of slim metal tins, for making wax impressions, out of her bag and taking the four identified keys off the keyring, placed two into each tin side by 125 side and shut the lids. After the keys were copied, they were placed back on the keyring and returned to Cindy. “Cool, I always wondered how that was done. When are you going in?” “Can’t tell you that Cindy, it’s top secret. However, we will get your money to you after we’re done. Now, is there anything further we need to know that could help us?” Cindy grinned at Mary as she pocketed the one hundred dollar bill. “Yeah, don’t get caught.” She picked up her glass and drained the last of the drink before getting up and leaving the bar. Mary could not believe her luck. She hadn’t lied; everything that she said was the truth. She was stunned, she did work for a secret organisation, her, Mary. She finished her drink and left the bar, jumping into the waiting car outside. “How did it go?” Steve asked. “Suprisingly easily,” she replied with a smile. “We’re in.” As the light in the bedroom dimmed with the approach of evening, so to did the pulsating glow from the silvery bodies. With a deep indrawn breath they rolled apart and changed to human form. “Wow.” Chris said. “Hey, your lips didn’t move,” she replied wondrously. “Neither did yours, my telepathic darling.” 126 Chapter 19. It was only early in the evening but the streets around ‘The Mausoleum’, a new Gothic style underground nightclub in the centre of the city, were starting to fill up with crowds of young people. The club wasn’t due to open for a couple of hours but the promise of free entry on the opening night had attracted a lot of people early on. Steve and Mary, on their way back to The Brotherhood safe house after their meeting with Cindy, noticed the large number of weirdly dressed youngsters waiting to enter the club. Flowing dark clothes and face makeup, the eyes darkened to look almost cadaverous, dark lipsticks and pale faces along with body piercing, made the effect rather ghoulish. ”I wonder what is happening there.” Mary commented to Steve, as they drove past. “Don’t know but the makeup and the way they are dressed makes them look like animated corpses.” Steve replied. A shiver ran up Mary’s spine. “Do you feel it?” “What?” “How is the back of your neck?” “Fine, why do you......” Steve stopped talking in mid sentence as he felt a very sharp tingle of the hairs at the base of his neck. He looked over at Mary and slowed the car. There was nowhere to park and he was in traffic so he couldn’t stop but as they passed the club, they gave it a close inspection. Steve relaxed a little. “’The Mausoleum’. What will they think of next? Doors aren’t open yet, so it must be someone in the crowd setting us off. I will see if Chris can get one of The Brotherhood to keep an eye on this place. Maybe even call Detective Mike to see if he can find anything out about it.” Mary seemed a little more relaxed now and as they were past the club, they just kept driving. “Don’t forget we have to get those keys made up,” she reminded him. As the countdown continued until the time that the club opened its doors, the activity inside intensified. The coven leaders had come over from ‘Satans’ to brief the covens. The vampires were hungry. Dragovich and Lucinda, being the eldest, stood on the stage to address the vampires below. “We are here,” Dragovich spoke in a low voice which carried to every corner of the large room, “to make vampires. We are not here to feast. No killing. This place should be respected. If you kill, we will be hunted down mercilessly and 127 possibly exterminated. The Coven masters are also fasting but trying to recruit as many of the ruling elite as possible. In a week or so, we can start feeding on the newly turned. Then we expand to other cities. What is the term used in this country? Franchising, that is it. Our future as vampires in this new land depends on all of you obeying me. Is that understood?” A rousing chorus of yells and ululations accompanied fists punching the air showed the vampires understood. Lucinda moved to the front of the stage, she frightened all the vampires in the Covens. Nobody ever messed with Lucinda. She addressed the Covens in a loud menacing tone. “You all know me. A few have crossed paths with me, to their regret. I tell you now. Any vampire caught feeding will be dealt with by me. That eventually means death and you will welcome it when it comes. Do I make myself clear?” There was a low mumble of assent. “Sorry, didn’t hear that. Do I make myself clear?” “YES,” the crowd roared. “Good. Now you have been instructed in the use of the crypts around the room. There are Ecstasy tabs, speed and cocaine available in them for both you and our ‘guests’. Try not to be too obvious entering and leaving the crypts. Use small bites for infecting and fornication is allowed, even encouraged. Have fun.” A cheer ran around the room as Dragovich stepped up again. “This club will open in one hour. The Coven masters have to leave now to go to our other club. Remember what you have been told. Enjoy.” He and Lucinda left the stage, accompanied by a deafening roar from the assembled vampires below. The music started half an hour before the doors opened to the public. Out on the street the tension was building and people began pushing towards the doors, not wanting to miss out on a free evening. A few fights broke out but they were quickly stopped before anyone got too injured. At nine o’clock the doors opened and two large people came out. Their job was to weed out undercover cops and newspaper reporters. They set up some ropes and stands and started ushering people into the club. The crowd surged, no one wanted to miss out. Slowly, over the next half hour, a hundred and twenty people gained entrance to the club. That was the limit and the doors were being shut. Just before going back inside, one of the doormen addressed the crowd of mostly late teens and young twenties. “We don’t close until four in the morning, if you hang around out here, you may be able to get in later when some others come out.” Then he disappeared inside and shut the door behind himself. Some stayed but the majority went home. Something, which for some of them, may have been a life saver. The club rocked to the heavy base beat of the music and as the new patrons descended the stairs, they were unsurprised to see quite a few people already in the club. Everywhere you went in society, there was always that group of people 128 who either had bulk money or sucked up to those who did. The crowd swelled with the recently admitted and the alcohol flowed freely. The twenty something males were the first to be turned. They strutted their stuff and weren’t at all surprised when some dark eyed, dark haired girl made a move on them. It was their due as kings of cool. The girls sidled up in a very suggestive manner, licking blood red, full lips with the tip of a moist tongue. Speaking in a sexy foreign accent, the offer was made to go for a private party. Who could refuse? A crypt door was surreptitiously opened and a couple slipped in, closing and locking the door behind them. Once in there, coke seemed to be the drug of choice and quite a few of the patrons were amazed that it was being given away free. Most accepted the explanation of a once only, opening night special and snorted the nearly pure stuff like it was going out of style. After a couple of minutes, it was down to the business in hand and the girls were adept at giving blow jobs. “Sorry, did I catch you with my teeth? Don’t worry, I’ll kiss it better.” The girls tongue, with a drop of her own blood on the end, was extended toward the little nick in one of the veins of the penis. A small dab and the infection had begun. The vampire girls swallowed copious amounts of semen during the evening’s work but every now and again they found some guy who was well endowed and spent extra time in the crypts banging away to their hearts content, mixing a bit of pleasure with their business. The male vampires did not have it quite so easy however, as some of the young women were resistant to their gothic looks and romantic foreign accents. No problem, who needs drink spiking when you can gaze into a woman’s eyes and bend her will. The coke helped a lot also, as the girls tended to become wet and ready after a couple of snorts of the excellent coke provided. Nibbling gently around the top of the legs, it didn’t take much to open a small hole in a vein and pass the infection. Most of the time, this procedure went unnoticed. After a number of love making sessions however, the vampire males were just too tired to go the whole hog and resorted to just passing on the infection with a bit of pussy licking. This left a number of dazed women wandering about feeling a little dissatisfied and in need of the real thing. Some left the club after a while, accompanied by boys that wanted more than a blow job and more patrons were allowed into the club to replace them. Ecstasy tabs were passed around, as was the speed, and the whole club rocked. By four in the morning the place had been cleared of the public, some being shovelled into taxis semi comatose and the vampires gathered to drink and boast about the numbers they had turned during the evening. The opening night of ‘The Mausoleum’ had been a great success. Over at ‘Satans’ a similar pattern of events was taking place but the coven leaders, being fewer in number were more circumspect. They engaged their prey in conversation first, to find those which held positions of importance in the 129 community, then they worked on them to infect them. Often, a little mesmerism had to be employed but the end result was always the same. Another vampire on the way. The Devil was there, thoroughly enjoying himself in the club named after him. He chose to be a transvestite and took his pleasure at every turn. He preferred to be with masochists as he liked to inflict pain, sometimes withholding it to inflict more. He sampled the essence of evil souls, heady stuff, an aperitif before the release of the game which he was looking forward to. It was going to be fun. Hitler as a minion was a good experiment but the Jews weren’t evil nor were most of the German army. Rwanda was better but a bit of a bust as only the killers were evil, not the millions that were killed. With minions, however, he could feed and play. Yes, things were going well. Between the two clubs, over one hundred and sixty people had been infected that night and the epidemic had just begun. The only down side was that someone or something had been able to make his daughter, Ruth, disappear and Andrew had been killed. Possibly by the same agency. The Brotherhood most likely. Still, a little competition always made the game more fun and when the new vampires got going there would be so much confusion in the city that the game would get out and he would have an army at last. God would get what was coming to him and Evil would be in charge for once. Then he could change the RULES and maybe take a vacation. He was due for one. The Devil smiled as he tasted another soul. Death was good. Tyrus was pissed off. He and Sonya had to work on the damned game tonight while everyone else got to party at the opening night of ‘The Mausoleum”. It wasn’t too bad for Sonya living at ‘Satans’ as she was. This was the last night he was going to work on it though, hadn’t the Devil said he could work on the game during the day and party after midnight. He didn’t miss Andrew and couldn’t give a fuck about Ruth. He was just pissed off. The game however, was coming along well. It was going to be finished on time now, so he could start enjoying himself again. All the major parts were complete, now all that remained was to join them up with the end sections, smooth a bit of music over the links and put a title to it. It would have to be computer based as they did not have the facilities for manufacturing Playstation, X Box or other platform based games. No problem, this game could be emailed all over the world when it was finished in less than two weeks and shortly he would be second-in-command over a generation of minions. It almost made up for missing a few nights of debauchery. Speaking of which. “Sonya,” he called out. She was down the other end of the room, working on the music again. “Yes Tyrus?” “It’s time for a break. Come over here.” Smiling, Sonya got to her feet and started taking off her clothes as she approached Tyrus. 130 “You little mind reader,” he grunted as, stepping out of the last of his clothes, he turned into a demon. She did also and as their naked bodies met they started tearing at each other in a frenzied exhibition of demon fucking. To say sparks flew would be an understatement. The game would have to wait a little while. When Steve and Mary arrived back with the wax impressions of the keys to Fleeting Image, Chris, as Roberto, sent them off to the workshop to be made up and then came back and sat down with Ruth and the other two in the conference room. He was smiling. “Okay Chris, even in someone else’s body, I know that smile. What gives?” Steve asked him, an amused tone in his voice. “Ruth and I have had a little quality time together and we have discovered that in our changed forms, we can communicate telepathically.” Steve and Mary were suitably impressed. “That’s wonderfull,” Mary said to them both. “What else can you do?” “We don’t know but I am thinking of going down to the training rooms in the basement to give us both a workout. Just to see what our ‘other selves’ can do. Interested?” Steve looked at Mary and raised his eyebrows. She giggled, a delightfull little giggle and answered him. “Well, we have been sitting around a lot today. Might as well go and hone our fighting skills. We may need them shortly.” They all trooped downstairs to the training rooms and found they were the only ones there. They locked the doors and changed into light combat suits. Chris rang upstairs to inform security that the surveillance camera was going to be covered up for a while. “The Brotherhood may not understand if Roberto changes into something else,” he joked as he hung his shirt over the camera, “and as our other forms do not generate heat like demons, we can remain clothed to save you embarrassment.” So they began. Steve and Mary sparred together, practicing in unarmed combat, knife play and sword play. Every so often they would stop and watch the magnificence of two silver creatures fighting. Before long, they forgot all about practicing and just stood, open mouthed in amazement, as the two shiny forms in their combat suits came together. Neither pulled blows or strikes, the force was just absorbed and seemed to make them stronger. Chris used the knowledge from Roberto and Ruth used sixty years of experience as a demon. At times they were moving so fast that they blurred. When it came time for weapons, Ruth, unarmed, faced Chris who came at her with blinding speed, wooden sword in hand. Ruth calmly reached into the blur and gripped the sword which turned to dust where she squeezed it. They stopped then, which was a good idea as Steve and Mary were having a reality crisis. What they were seeing was just not possible. “Wow guys. To say I am impressed would be an understatement. Have you found anything that you can’t do yet?” 131 Chris, back in his human form, smiled shyly, “I don’t think I can fly,” he said. “How about you, Ruth?” She looked adoringly at Chris. “This form is better than the old one but I can’t do fire. Maybe we have some things to discover yet, lover.” “When the time is right, God will reveal our abilities.” “Amen,” they all chorused and bowed their heads in silent prayer. Sitting in his apartment that evening, Detective Mike was suprised to find he was lonely, for the first time in his life. After spending the day in the company of Steve and Mary and Chris and Ruth, he had come to realise something that he had never been made aware of before. Men and women were two halves of something greater than either and when they worked together with love, respect and mutual understanding, almost anything could be accomplished. He had observed the couples throughout the morning with his finely honed abilities and more so now than ever before, he could almost see each couple as one entity. It saddened him to realise that because of his attitude to life, he may have missed out on something wonderfull. He cursed and reached for the ever present bottle of Scotch which occupied his private time. She could be a harsh mistress but helped dull the memories of some of the horrors that he had seen in his job and some of the things he had done in the past. He picked up the remote and turned the television to a sports channel. Tomorrow was another day. 132 Chapter 20. Four days later, reports of a mysterious illness started appearing in the local newspapers. It seemed to be affecting mostly the sixteen to twenty-five year old age group, although isolated cases were turning up in other age groups. The numbers were large enough for the word ‘epidemic’ to appear in connection with the reports. Some of the affected people had been hospitalised while others had been told to go home and rest and were under observation. The symptoms of the disease were puzzling to the doctors who were investigating the cases. The patients were presenting with flu-like signs, malaise, weakness of the muscles and no desire to eat. Quite a few of the patients also exhibited aversion to bright lights. Temperatures were slightly elevated and occasionally, rashes on the skin appeared. Laboratory testing had revealed very few changes in the blood picture apart from a small amount of lysis of red blood cells with a suprising decrease in blood haemoglobin and changes to the morphology of some of the white blood cells. Epidemiological studies were initiated and drug panels were run. A large number of the affected people were found to have used cocaine in the previous few days and had attended a new night club, ‘The Mausoleum’ in the centre of the city. Public health workers and a few police were dispatched to the club to investigate. Nothing was found. The crypts, behind the coffin lids on the walls, hid their secrets well. Reports in the newspaper indicated that the club owner did not encourage drug use but could not monitor the activities of the people who attended his club. As no food had been served, the club was given a clean bill of health and allowed to continue operating. Steve came into the common room that morning with a newspaper which carried a report on the mysterious illness. He and Mary had read it over breakfast and as they were reading the article, the warning signals for evil had gently made themselves known. Had the game already been released without their knowledge? This was something that Chris and Ruth should be made aware of. Hence his trip to the common room. They had all had plenty of time in there over the previous few days, going over the planning for the raid on Fleeting Image and now three days before the planned attack they thought they could relax somewhat. Steve sauntered in to find Chris and Ruth sitting on one of the lounges with their heads together, deep in discussion. “Hope it’s something good,” he joked. They looked up, slightly startled. “Oh, good morning Steve, How’s it going?” Chris was the one to speak, Ruth nodded at him. 133 “Fine, Mary and I are enjoying the quiet time. Have you seen this report in the newspaper regarding a mysterious illness that’s sweeping mostly the young people in the city?” He passed the newspaper over to Chris who took it from him and spread it out to read. Ruth went round behind Chris and leant on him to read the article over his shoulder. As they read down the article, Ruth’s face took on a look of dismay. Chris looked back over his shoulder and seeing Ruth’s face said. “Are you thinking what I am thinking?” “I hope not.” Steve couldn’t contain himself. “What?” They looked up at him and spoke in unison. “Vampires!” “What! Get out of here.” Steve exclaimed. Chris sat back. “One thing about Roberto is that he had a brilliant mind. Hold on while I go and get a book for you.” With that he rose and headed off toward the library, returning shortly with a book which he opened and placed in front of Steve. Ruth remained seated but looked agitated. Steve read. Vampires. A product of the mating of a demon with a human female. Creatures of the night which feed on human blood. After a person is infected with vampire blood, the change to a vampire will occur within ten days. The change may be slowed by ingestion of garlic. Symptoms of a bite include fever, muscle weakness, aversion to bright light and inappetence. Steve looked up and saw Chris studying him. “It goes on and explains in some detail about vampires but basically it boils down to a few basics, once you cut through the folk lore.” He held up his hand and ran through the points, turning a finger down for each one. “Sunlight doesn’t kill them, they just sunburn far more easily than people. They don’t have to drink human blood, any blood will do. They live a long time and can infect other people by the exchange of blood, a bit like AIDS and Hepatitis C. They regenerate and heal amazing quickly and the only way to kill one is by decapitation.” “How come we haven’t bumped into one before?” Chris replied. “Two reasons; mainly, The Brotherhood have been keeping them under control. There is a division devoted to vampire slaying. I think I will let Ruth answer on the second point.” Here, Ruth took over. “My evil brother, Tyrus, has been in Europe for most of his six hundred and fifty years. He just loves fornication and is pretty indiscriminate about who or what he fornicates with. I suppose we are lucky that sex with animals is infertile. It has 134 been his little hobby to build up Covens of vampires in remote areas of Eastern Europe. He often spends his vacations there with them. Up until now, they haven’t bothered about migration but something or someone has got them moving. They must be here. Now, we have a problem.” “I’d better go and get Mary then.” Steve interjected. “We need to sit down and work out what we are going to do. Won’t be long.” With that he got up and went upstairs to find her. Before long they were all sitting around the table together. After Mary had been brought up to speed, she looked thoughtfull for a second. “Steve, remember the other night when we were returning from our mission at Fleeting Image. We saw all those young people on the footpath in the centre of town. You remember, the ones dressed in that Gothic style.” “Yeah, right.” Steve looked interested. “They must have been waiting to get into that club that’s mentioned in the newspaper article, ‘The Mausoleum’. I bet that is where they got infected, even though the place was cleared by the police and the Health Department.” Chris picked it up. “The only way to find out is to send someone in under cover. One of the young Brotherhood here should do. It will be a good mission for him. Just dress him up in Gothic clothing and have him check it out. Shouldn’t take long for him to suss out what is going on.” Ruth, who had been fairly quiet up until then, now entered the conversation. “Yes, but what are we going to do? We have arranged to undertake a raid on Fleeting Image to destroy the game. We cannot deal with both.” Mary looked at the faces around the table. “I think that the game has the potential to cause the biggest problem. We should go ahead with our plans and try to deal with the vampires afterwards. What do you all think?” There was a moment’s silence, then Steve said, “I agree.” Chris and Ruth exchanged looks. “So do we.” It was settled. The mission at Fleeting Image was going ahead as planned and a young member of the Brotherhood was to be sent to ‘The Mausoleum’ that evening. They adjourned for lunch. Later, around nine that evening, the young agent of The Brotherhood, Mat, short for Mathew, fronted up to ‘The Mausoleum’. This was his first field assignment and the only reason he had got it was because of his young age. He was not the brightest match in the box and had been given a quick briefing on the does and don’ts, while he was in the club. Do go into the club, don’t stay to long. Do observe what happens, don’t get involved. Do learn about the workers there, don’t give away any secrets about the Brotherhood. Do look like you are having a good time, don’t enjoy yourself. After paying his ten dollars and entering the club, Mat realised that there were fewer people here than he had expected but the music filled the room. There must be a finite limit to the number of young people in the city who enjoyed this sort of nightlife. He wandered down the stairs, through the light crowd, with his 135 mouth hanging open. He had led a fairly sheltered life up to now and found the scene around him to be amazing. Goths, grunge and punks. After a short period of time, he saw one of the crypt doors open and a young girl stagger out, obviously under the effects of something. She wandered over to a group of young people on the dance floor and nodded her head. They smiled and patted her on the back in a congratulatory sort of way. Mat decided that a little more investigation was required. He turned and bumped into a very attractive woman with deepset eyes and long dark hair. She laid a hand on his chest as she gazed into his eyes. He was confused at his reaction. His penis became very hard. This could be a bad situation if he didn’t leave immediately. He couldn’t leave, his body would not obey him and his head was a little fuzzy. The woman took him by the hand and led him into one of the crypts, never taking her eyes from his. After locking the door behind them, she offered him some drugs. He refused the offer but had no ability to stop her lowering his trousers. Her eyes seemed to bore into him, she was taking over his world and his mind did not belong to him at the moment. Laying Mat back onto the pillows, the exotic lady smiled up at him before engulfing his erection within her luscious mouth. It was almost heaven, or so it felt like but her teeth were a little sharp. He didn’t even feel the nip when it happened, almost at the point of ejaculation as he was and afterwards he couldn’t feel anything down there. She wiped him off and pulled his trousers up gently, zipping them up for him. “You are nice man. You I like. Taste good. Come see me in couple of weeks. My name is Katrina. Ask for me.” The only words she had spoken to him since he bumped into her. Katrina led him out of the hidden crypt and he stumbled up the stairs and out of the club. This was not good. How was he ever going to explain to his superiors in the Brotherhood? He walked around the corner, making sure he wasn’t followed and got into the car. Time to report. When Mat got back to the safe house, even though it was quite late, he was ushered in to see Chris and Ruth to make his report. It was all fairly standard until he got to the part about bumping into the exotic lady and how he had difficulty acting on his own accord. Ruth’s eyes hardened. “She took you somewhere and did something to you, didn’t she. Tell us.” Mat squirmed in his seat. This woman knew everything he realised. Who was she? Where did she come from? Roberto had just turned up with her one day out of the blue and she had moved in and become his right hand. He told them haltingly what had transpired in the club earlier. Ruth sighed. “Take down your trousers please.” Mat was shocked. What sort of request was that to make. He looked to Chris/Roberto, his superior, for confirmation. “Just do it.” Chris told him. 136 Mat was extremely embarrassed but stood and lowered his trousers. He was even more embarrassed when Ruth came over and gently took his penis in her hand and inspected it closely. “Here,” she said, “underneath. Take a look ‘Roberto’.” Chris came over and looked where she was pointing. There it was, a tiny cut, already crusting over with a scab. Ruth looked up at Mat. “Sorry to have to tell you this but you have been infected. The exotic lady was a vampire and soon you will be too.” To say Mat was devastated would be a huge understatement. Tears sprang to his eyes as he watched his future disappear into a hellhole. What could he do? Ruth watched him for a moment or two then spoke to him. “Mathew, you are named after one of the friends of Jesus who was your distant relative. What has happened to you is not the end of the world. A vampire does not have to be evil. You are not born of demon seed, you have merely been infected. Trust in God. You will develop a taste for blood but it doesn’t have to be human. You’ll find sunlight will cause you to sunburn rapidly and you will prefer dimness. On the other hand, if you don’t give in to base desires, you will be extremely usefull to the Brotherhood. Your senses will become much, much sharper, you will be able to move much more quickly and you will heal very fast. On top of that you will have an ability to bend people to your will. All these things are positives for someone in your line of work. Oh, and you will live a very long time. Maybe long enough to head the Brotherhood some day if you use your brain more.” Mathew could not believe what he was hearing. He forgot about his embarrassment at having his trousers around his ankles, he forgot about his dread of a few minutes ago and he gazed down at this black haired, oriental looking woman before him with adoration. No wonder Roberto had teamed up with her. “Thank you for what you have just told me,” he said as he pulled his trousers up. “God bless you and you also Roberto.” Ruth smiled. “One thing though Mathew. You are going to be a pretty sick puppy and very vulnerable to evil for the next couple of weeks. Do not leave these premises. The woman will be calling you and you will be hard pushed not to answer her summons. If it gets too difficult, we can lock you in but it is best if you can fight it yourself. That will make you stronger. We will let cook know of your future requirements for eating and see if we can rustle up some black pudding for you. That, you will enjoy. Remember that we are here to help. Now get out of here and in future, try not to fuck up.” Mathew backed out with little bows and after the door had closed, Chris chuckled before commenting. “Well done my love. You handled that really well. I am proud of you and I think that Mathew may be a little in love with you.” She smiled at him lovingly. “There is only one man for me, Big Boy and guess what. It’s bedtime.” 137 Chris jumped up and kissed her tenderly before taking her by the hand and heading upstairs. Louise was far from happy. She was in her third trimester now and she had only been pregnant a little under three weeks. The speed her skin was having to stretch, to accommodate the rapidly growing bulge in her belly, was causing her agony. She was sick of eating five or six large meals a day and gulping down large numbers of odourless garlic pills was a pain. All in all, things were not going that well. Her problem was in having believed the Prince of Liars but he was so glib and believable. Her other problem was that she was starting to feel the effects of the vampire bite that she had received, she was feeling feverish and her joints ached. The garlic capsules helped a little but they were starting to make her feel nauseous. Also she was getting a bit averse to sunlight now. It was probably good that the Devil was only popping in for a few minutes here and there and seemed distracted when he was home, otherwise he might have found out about her being bitten by a vampire. Sonya had dropped in a couple of times over the last few days but other than that, she was on her own. She was starting to feel a little afraid of the whole affair. Detective Mike was finishing off his bottle of Scotch. Something was going on with some of the ranking police officers and city officials that he had kept an eye on for the last few weeks. Most of them were off work on sick leave. All at the same time; that was suspicious. The big job was going down in two days and his finely tuned detective intuition told him he should be worrying but the Scotch told him not to bother. He sighed and refilled his glass. 138 Chapter 21. In the Brotherhood safe house, the excitement levels were building as the time for the raid on Fleeting Image neared. The Brotherhood observers posted near ‘The Mausoleum’ had reported decreased numbers of young people entering the club and that quite a few of the people now attending the place were repeat visitors. The assumption was that all the susceptible young people had been infected and the next wave of infections would be when the present victims craved human blood. According to the texts that Chris had consulted, this would start in anywhere from one to two weeks. It was a very worrying time. Detective Mike was visiting The Brotherhood safe house for a final planning session. Before it got under way, he conveyed his fears to the group around the table. “Listen everyone, I believe this is important. You know the people holding power in the city, the ones that have previously been bribed with the tapes made of licentious and degenerate behaviour at ‘Satans’, they’re away from their offices on sick leave. I believe they have also been infected. If so, we are going to be in deep shit pretty soon.” “Thanks for that Mike but we can’t dwell on all these other problems at the moment,” Chris said apologetically. “We have to get ourselves really focused on the job tomorrow night. Now, let’s go over the plan one more time then adjourn to rest and get our equipment ready. Detective Mike, you first please.” Detective Mike looked around the group. These were the nicest bunch of people you could ever meet and he loved them all, although he still had secret fears about Ruth. Trouble was, they were all so young. All his life he had done most of his thinking and planning for himself and now he was having difficulty with going along with taking orders but shit, he had seen the ruination of the two bodies in the motel and the menace they were fighting had to be stopped. “Okay, we arrive at four o’clock in the morning and park at the side of the building away from the main road. I check that the coast is clear and Mary uses the keys to open the front door. We all go in and lock it behind us in case of security checks. The four of you go up to the fourteenth floor by elevator and I wait downstairs, hidden in a doorway, to protect the rear. I keep my copy of the key handy in case we have to leave in a hurry.” “Excellent Mike, thank you. Steve?” “I am Mary’s bodyguard making sure that her back is covered while she does her magic with alarms and locks and stuff. I am also carrying a pack with incendiary bombs for you to set when we get to the computers on the fifteenth floor.” “Mary?” 139 “I do locks and alarms. From the information which we have, the floors above fourteen have been locked down recently. Alarms have apparently been fitted to the stairwell doors and the lift. We have decided to lock one of the lifts with the doors open and access the fifteenth floor through the roof of the lift. I am then to neutralise the alarm on the fifteenth floor lift well doors and open them. Any locked office doors will be picked by me. Once we have access, Steve hands over the pack of goodies and he and I return to wait at the lift doors on the fifteenth floor.” Chris sat back and smiled. “Right on the money Mary. Perfect. Now, Ruth my love. What do you do?” “I follow everyone and carry a pack of explosives. It is my job to guard Chris’ back while he sets all the charges. We are using timers which are linked electronically. When the first one goes off, it will set the rest off. If there is electronic interference, then each charge will explode on its own timer. Hopefully failsafe. After the timers are set, we retrace our steps and get out of there before the fireworks begin. With any luck, we will leave no trace of our presence.” “Thank you Ruth. My job is to carry a pack of explosives and set the charges where ever necessary after identifying the main computer. Roberto’s memory will help with the first and my memory with the second. Remember I used to work in that place once. Okay, I suggest we get ourselves a little rest and check the equipment for a final time then meet back here about eleven thirty tomorrow night for supper. Yes Mike.” Mike studied his finger nails, “Is there going to be any demon shit going down? You know, weird stuff.” “Can’t say Mike, why?” “Will guns be any use?” “Depends what happens. If a demon appears, it would be better to let Ruth or I handle it. If one is coming upstairs, use the walkie-talkie to let us know it’s coming. If you have to shoot, aim between the eyes. That will slow it down for a couple of seconds. Remember that demons are incredibly fast and you might miss. It is better to hide than to take one on. Remember also, a demon form cannot kill you unless you show aggression but its human form can. That goes for all of you. Guns are what you use when you have run out of other weapons, okay! We will be carrying water cannons.” There was a general chorus of assent and then the group broke up to go their separate ways. They would be rolling in less than thirty six hours. Eleven thirty the following night, they all met again in the boardroom. A supper had been laid out for them and they sat down to enjoy what could possibly be their last meal together. All of them were nervous to some degree except for Chris, who had the advantage of Roberto’s memories and knew that action was necessary and whatever happened would happen. If they failed tonight, a new chapter would begin in humankind’s never ending fight against evil. One that 140 might not be won this time around. This was a nexus point in the centuries old struggle, the one that God used to see if his little experiment would be successfull or not. If not, God had plenty of time to set up another one using a different approach. If humans could not become good, there was no real point in continuing with the present model. Chris shrugged to himself. It wouldn’t hurt to ask for help though. After everyone had finished eating and the remains of the repast had been cleared away, he turned to Steve. “I think we should all pray to God and ask for his assistance. Steve, would you be so kind as to say a prayer for us all.” Steve looked very solemn as he bowed his head and began. “Dear Lord. Your ways are mysterious but your path is laid out. We believe in your goodness and mercy and ask that you help protect us in the fight against the enemy of mankind, your creation. Some among us have come into your fold only recently but we are devout and honest in our love for you. We all fight in your service and hope you will care for us in these dark times. Amen.” While the prayer was being recited they all stood around with bowed heads except for Detective Mike. He really didn’t cotton to all this religious stuff, a man did what a man did and religion was for those who didn’t have the strength to act for themselves. Still, he was impressed with the sincerity of the people around him. The next hour or so was spent checking and rechecking equipment, polishing up the razor sharp swords that some of them carried and taping up anything that might jingle and make noise. This was going to be a silent operation. At three thirty in the morning they filed out to the Nissan Skyline Special, loaded their gear into the boot and headed out. They arrived at Fleeting Image about ten to the hour and parked around the darkened side of the building away from the main road. Getting out, they unloaded their gear while Mary and Mike went to the front door. Mike gave them a signal when the front door was open and they quickly filed around to the front and entered the foyer area. Mike took up his station in a darkened doorway while Steve and Mary went to the lifts and Mary used the second key to bring a lift down to the ground floor. Chris and Ruth ran quietly over and got into the lift followed by Mary and last of all, Steve, who gave Mike a little wave. The lift headed up and stopped at the fourteenth floor. The doors opened smoothly and quietly. Mary took a telescoping rod out of her pack and extended it to fit the width of the lift doors. Placing the rod just above floor level she twisted it to lock the lift doors open. This was the hard bit. She signalled Steve who cupped his hands in front of him to provide a step and Mary climbed up to sit on his shoulders. She then tested various roof panels in the lift until one swung open. Using Steve as a ladder she climbed onto the top of the lift and waited until Steve had been assisted up there also. Up above them they could see the back of the doors which opened onto the fifteenth floor and in a very short space of time they were balanced behind them. 141 In her time, Mary had been a very successfull thief and now she used that ability to scan for alarms on the doors in front of her. It took a little while for her to locate it and the tension was beginning to be felt below but the consensus had been for quiet and this was observed. Mary removed a length of electrical cable, with alligator clips on each end, from her pack and used it to bridge the circuit of the alarm. It was relatively simple then to lift the lock on the doors and wind them open manually. They didn’t hear any alarms and breathed a sigh of relief as Mary fitted a telescoping rod in these doors also. Ruth and Chris were quick to join them and then Chris led Ruth and Mary down the corridor to the main computer room. So far the operation had been silent. One thing that could not be denied about the Brotherhood was that it had access to excellent equipment. Chris stopped at a doorway and checked it, locked. He signalled to Mary who moved up and took her lockpicks out then started on the lock. Meanwhile, on a signal from Chris, Ruth went off checking and opening the doors that she could, right around the floor. With a quiet snick, the door that Mary was working on opened and she withdrew to go wait with Steve at the elevator. Chris smiled happily and entered the room, taking his pack off his back as he went toward the big computer. Ruth enlisted Mary’s aid in opening a few more doors that were found to be locked then, after seeing Mary safely back with Steve, she took his pack and rejoined Chris who was laying charges. They visited every locked room first then circulated through the others, scattering incendiary bombs freely throughout. The charges were armed. Five minutes to leave the building. Go. Quickly retracing their steps they lifted the lock rod and shut the outer lift doors of the fifteenth floor. Removing the alarm deactivator they then dropped quietly through the roof of the elevator below. The clock was ticking. While Mary removed the rod holding the doors open, Ruth, on Chris’ shoulders, shut the trapdoor in the roof of the lift. Mary pressed the button for the ground floor and the lift started to descend. Meanwhile. The Devil had just returned from a sightseeing trip to Iraq. He really loved the job his minions there were doing. It didn’t matter what faith you were, there was only one God and one Devil in the world and the Devil was enjoying that particular conflict. He particularly loved car bombs, all those innocent victims, a real slap in the face for God. It was so satisfying. He materialized in the new house which he had bought for Louise and wandered into the bedroom to find Louise lying on the bed groaning. She was propped up with lots of pillows trying to get comfortable. Her stomach was quite distended and her skin was blotchy red in patches. She looked awfull. He tried the cheery approach. “How are you my dear? Coping alright?” She looked up in surprise, her eyes dark rimmed and haunted. 142 “You bastard,” she screamed at him. “You never told me it was going to be like this. I am in agony. Where have you been? You are never around to help anymore. Look at my stomach you shit, I feel like I am going to die. How dare you just go off and leave me!” Now, being the Devil, the most evil thing in the world, means you only have one Boss to answer to. Louise was not that boss and she was pissing the Devil off in a big way. He knew she wasn’t going to die, so........ “I just dropped by to check on you my dear and now I have to go to the office on urgent business. I will come back later when you are not quite so emotional.” With that he translated to the sixteenth floor of Fleeting Image. It was his favourite sanctum, a place he could come to relax and enjoy his little triumphs. Sitting quietly at his desk with a good Scotch, he looked over to the window where he could survey some of the city beneath. This was where his little computer game would soon unleash the most subtle, soul capturing trick that humanity had ever seen. It was going to be his trump card. He got up and poured another large Scotch then walked over to the window to gloat. After a couple of minutes gazing out, he happened to look down and caught a flicker of movement in the foyer. What was this? Placing the Scotch down, he went to investigate. Detective Mike was bored. Nothing was going to happen here, it was four twenty in the morning and the streets were deserted. He was stiff from standing and needed to walk a little to help the muscles in his legs. He had just turned around after walking across the foyer when bang in front of him was a little girl clutching a doll. Before he realised, he whipped his gun out and if it wasn’t for the fact he had to lower the muzzle to target, he would have popped a cap into the little girl. “Er, hello little girl. What are you doing here?” The little girl stared at him with big round eyes. He tried again. “Where are your Mummy and Daddy?” he asked, puzzled. The little girl spoke in a little girl’s voice. “Hello Detective Mike, what are you doing here? Shall we play a game?” Mike was gobsmacked, this was not right. It shouldn’t be happening but he was compelled. “Okay little girl, what game is that?” “A guessing game. I get to go first. Let’s see. Why did you become a policeman? I know, back in college your girlfriend, who you really loved, was shot dead in a bungled hold-up. You became a policeman when you came back from Vietnam so you could get revenge on criminals. Am I right?” Mike was taken aback. “What the fuck!” “Am I correct?” the girl asked. “Yes!” Mike exploded. “Goody, it’s my turn again. How did you get revenge I wonder? I know, you killed criminals ‘resisting arrest’ or ‘running away’ before they even went to trial. Guess what? Some of them were innocent. Am I right?” 143 Mike could not understand this, merely nodding his head in his slightly dazed state. The little girl put her head on one side and looked at him. “What are you doing here though?” Suddenly there was a roar and Mike found himself looking at the Devil in all his Glory. Wings unfurled, tall and so ugly it hurt to look. “THE GAME? YOU DARE? A TEAM?” That was the last thing Detective Mike heard before he went to hell. Two swipes from the Devil’s huge, razor sharp talons and Mike fell onto the floor in ten, very messy, very separate pieces. The Devil disappeared just before the lift doors opened and disgorged Chris and Ruth, Steve and Mary who rushed up to the just recognisable remains of Detective Mike. They stood there staring for a second in horror at their friend’s remains. Tears welled in Mary’s eyes. “We have to leave NOW!” Chris yelled, galvanising them into action. The Devil arrived on the fifteenth floor and walked into the main computer room just as the charges went off. It would take him several minutes to reassemble himself. Downstairs, the four friends heard the loud explosion as the charges went off simultaneously and felt the building shudder just as they were opening the front door. Mary was hauled back into the building by Chris just in time to avoid being hit by the shards of glass and debris that were raining out of the sky in huge quantities. The flash of the incendiary bombs had lit the night sky, blowing every window out of the fifteenth floor and all around, apart from the sound of impacting debris, the night lay in stunned silence. “Well, I guess that did the trick,” Steve giggled with nervous laughter. “Now it’s time we exit, stage right.” They fled the scene and drove away from the building with their lights off for quite a while before turning around and heading for Detective Mike’s place by the backstreets. There were a few things to pick up there like the blackmail tapes. With Mike gone, someone would have to try and keep the city officials in line. Half an hour later they left Mike’s and headed for home. Mary couldn’t help sobbing in the back seat as she recalled the mess that was Mike. Steve, an arm around her shoulders, consoled her as best he could. Mission accomplished. The Devil was really, really pissed off. If it wasn’t for the RULES, he would have gone on a killing spree but he had been playing this game with God so long that he had become philosophical about it all. It had taken him a while to assemble all his bits and pieces together after the blast, change into evening wear and pour himself a stiff drink. The only puzzle for him was just who the other players had been. He had caught a glimpse from Detective Mike’s mind, just before he was dismembered but it was not detailed enough to identify them. He really shouldn’t have let his temper rule him but he was so pissed off with Louise that the discovery of the plot against Fleeting Image had just driven him over the edge and caused him to snap. 144 “Tyrus is not going to be happy after all his hard work,” the Devil reflected. “I had better bring him over here and have a talk with him.” He went back upstairs, retrieved his drink, sat back in his comfortable chair and pondered his next moves. Tyrus, at that moment, was thoroughly enjoying himself being very demonic. All the vampires that had come into the country on the plane were his children and they adored him, they would do anything for him, for which Tyrus was very gratefull. Although most of the female vampires were slim, he preferred the ample ones and currently he was entertaining himself with three of them. They were great, he could damage them and they never complained, just went away and healed up ready for the next time he felt in the mood. Out of all of them, he liked Lucinda, his eldest, the best. Pity she was over at ‘Satans’ working. To hell with all this work, work, work. A demon should have time to do the things that demon’s liked to do. He was just at the point of entering his third female vampire when the Devil located him and took him. Tyrus sprawled on the floor at the Devil’s feet, his huge demon erection jutting painfully from his body. “Very impressive Tyrus but I have something to show you,” the Devil drawled. Clothes appeared on the back of a chair and Tyrus changed to human form and proceeded to get dressed. “Aw Dad, I was really having fun for once. What could be so important that you tore me away?” “Follow me,” was all the Devil said and headed out the door. Tyrus was close behind pulling on a tee shirt as he followed the Devil, who took the stairs down to the next floor. When they managed to pull the door to the fifteenth floor open, Tyrus stepped in wordlessly. The place looked like a bomb had hit it, which it had. His face became darker and darker as he surveyed the damage. The fire system sprinklers were on and a strong breeze was blowing through the floor, taking the last of the smoke and steam out. None of the computers or any of the systems were left intact. Plastic and small bits of burnt computer innards littered the floor, floating in the puddles of dirty water. The place smelt of burning, something he normally enjoyed. Tyrus stood in the middle of the floor and howled his fury, flickering in and out of Demon form as he did, his clothes burning off his back. “Wait until I find the people responsible for this. By the time I am finished with them they will beg to go to Hell for a brief respite from me.” The Devil by now was calm. “Son, all this is only a game. Just like chess only played on a larger scale. We lost a piece or two but we haven’t lost the game yet. God is a cheat. He didn’t give me as much power as he has. Come upstairs and have a drink with me, I have a few things to tell you. We can leave before the police and firemen arrive.” 145 They trooped back upstairs and the Devil brought in more clothes and poured Tyrus a large Scotch and after handing it to him, sat back in his comfortable chair again. “I am guilty of not telling you enough about us over the years and leaving you to make your own way in the world. However, what I am about to tell you will increase your understanding of how things work between God and the Devil. I am not the original Devil, that was my Grandfather. When a Devil retires, the eldest son is given the power to be the next Devil. I am seriously thinking of retiring which will make you the next Devil. My current batch of children would all serve you. Just as they do me at the moment.” Tyrus sat back, a huge smile on his face, thinking of the power and the glory associated with the position. The Devil continued. “When God made humans, he was hoping for companionship but he forgot to imbue them with enough intelligence. HE decided that they would become smarter if he left them to make their own way in the world. As he only wanted goody goodies, a Devil was created to influence those which could be corrupted and to take their souls, so as not to pollute Heaven. However, a lot more souls than He expected became evil, due to the excellent work of my Grandfather. So, HE made up RULES by which to play. See where this is going? We didn’t have a say in those RULES, so they are rather one sided. That is why we have to be smart, cunning, devious and downright dishonest. Even within the RULES, it is just possible for us to win but we have to play it cool, calm and collected and always remember, it is just a job.” Tyrus was really intrigued with what the Devil was saying. His Dad had never talked to him like this before and what he was hearing gave him pause for thought. Maybe there was room for change in his own behaviour. “Not much Tyrus,” the Devil said, reading his thoughts. “Each new Devil puts his own stamp on the way things get done. If you do become the Devil, all I advise is controlling your temper. Anyway, you have to have a job interview with God first, to see if you are acceptable to him.” Off in the distance sirens could be heard. Getting closer. The Devil looked up then carried on talking to Tyrus. “HE always has the advantage but we are catching up. We haven’t finished with that game idea yet and once the new batch of vampires comes into their thirst, this city will become chaotic and a great source of evil for us. It will run on its own and we can go somewhere else, maybe Europe for a change. I am thinking of pulling out from here in a couple of weeks from now. After Louise has delivered your sister. We could all, and that means any of your vampire children that wish to leave, do with a holiday in the South of France for a while. Right now, we have to get out of here before the police arrive, so we can be suprised when we are informed about the damage later. I am going to ‘Satans’ for now. Do you want to be returned to where I pulled you from?” “Yeah, wouldn’t mind Sire, I was having fun.” 146 “Very well.” Tyrus disappeared and the Devil closed his eyes for a second before smiling. That boy of his was a chip off the old block. Shame about his temper though. It was the one thing that had to be controlled by Tyrus if he ever wanted to rise above being a lackey in the future. Then the Devil had an idea. Tyrus needed to learn to take more responsibility. What better way than to put him in charge of famine relief. The hired cargo plane was due back from its latest relief flight tomorrow and after being loaded, it was scheduled to fly out to Mombolani. Tyrus could accompany the planeload of food and medical supplies as the new Distribution Head of Famine Relief. He should be able to get in with the Royal Family of Mombolani pretty easily, another plane load or two for the black market would take care of that and when his brother was born, it would be simple for Tyrus to steal him and meet up with the Devil in Europe somewhere. Knowing Tyrus, half the Royal wives would be producing little vampires not long after he left. Then the Devil could hand over the reins to Tyrus and retire to take life easy. Firemen were running up the stairs so the Devil sat back, closed his eyes and popped off to ‘Satans’. 147 Chapter 22. The scene in the foyer of the office block that housed Fleeting Image was chaotic the next morning. People from all the different businesses in the building were milling around trying to get to work, while police and ‘special teams’ were cordoning off areas of the foyer around the remains of Detective Mike’s body to preserve clues. The fifteenth floor was also cordoned off for the same reason. Television news teams outside the building were setting up for on-the-spot news reports and the news helicopters were circling the fifteenth floor, where every window had been blown out. Reporters from City newspapers were interviewing people as fast as they could, trying to get a story together for the afternoon editions. This was big. The Devil was annoyed, he didn’t need the exposure but this was out of his hands and as a half owner of Fleeting Image he had to deal with all the relevant authorities that were there to ask questions. He didn’t like it. Too much publicity was not good for the way he operated. “Do you think this attack is related to the supply of aid to Mombolani?” one official had asked him in earshot of a reporter and within a very short period of time, although the Devil had answered in the negative, it had become fact, as other news teams picked up on it. What kept the pot bubbling was the arrival of the aid plane, which at that very moment was being loaded for a return trip to Mombolani. He would have to get Tyrus out with the plane tomorrow afternoon when it left. They were too exposed. Damn the Brotherhood. In the early afternoon, the four friends, rested and cleaned up, met in Roberto’s office at The Brotherhood safe house to debrief and make plans. They were all saddened by the death of Detective Mike who they had loved and respected. It was Steve who summed it up for them. “He would have wanted to die while he was doing his job rather than becoming old and feeble. I think we should pray together and say a few words to God on his behalf. It will do us no good to dwell on this as we have other work to do. We can remember him in our hearts as a brave and true friend then we must put it behind us.” There was a chorus of assents from around the table and Steve bowed his head and led them in prayer. Just as they finished, there was a knock on the door and Mathew entered to ask if they required coffee. As he came into the room, Mary’s head shot up and she stared at him levelly. Steve also focused on Mathew with an intense gaze. “How do you feel?” Mary asked, aware of Steve’s interest also. “A bit strange,” Mathew replied, obviously puzzled. “Why?” 148 “Because you have evil within you,” she answered flatly. Mathew looked worried. “Well, I have been getting these urges to drink blood and my dreams are really weird. Lots of naked bodies and stuff....” His voice trailed off in embarrassment. Chris studied Mathew. “Fight it and pray. If you cannot, you will be lost to evil. Ask the cook to prepare you some black sausage, it’s made from blood. That may help a little and yes, we would like some coffee please.” Mathew withdrew. Chris surveyed the group around him and sat back in his chair, picked up the remote for the television and turned it on. After a short channel search he found one reporting on the devastation at the Fleeting Image building. The pictures had been taken from a helicopter flying around the building and the voice-over was just at the point of discussing apparent motives. “It is believed that terrorists were responsible for the attack, in the early hours of this morning, which wiped out an entire floor of the Fleeting Image Advertising Agency’s offices. One of the owners of the company is a well known philanthropist who has recently supplied aid to the African country of Mombolani. It is believed enemies of that country may have perpetrated this outrage. I am Naomi Clark, reporting for Channel Ten, now, back to the studio.” Chris smiled and switched off the television set. “Well, it seems as if we are international terrorists now.” He looked at the others. “We have a lot more to do before this city is safe. There is the problem of the vampires. Any suggestions?” Ruth eased back in her seat. “We all know that they have to die. There is no other way to stop them. Only beheading or burning will work and we need to move quickly.” Mary looked concerned and addressed a question to all of them. “What about the ones that have been infected in the last couple of weeks. We can’t kill all of them. There could be anywhere from a hundred and fifty to two hundred of them.” “We may have to if no other solution presents itself, although I never saw myself as a butcher.” Chris looked downcast as he spoke. He may have Roberto’s memories but this wasn’t right. “Tomorrow.” Steve suggested. “They won’t be expecting another attack so soon and we will have the advantage of surprise.” There was a general murmur of agreement around the table and they started to discuss possible plans and avenues of attack. Mathew returned with the coffee and Chris, Ruth, Steve and Mary settled into what was to become a long planning session. In the wake of the mystery disease outbreak that had occurred, hospitals were now getting people turning up with bite wounds and no memory of how they got them. Some of these people were suffering from blood loss also. Beneath the jokes, people were getting worried and questions were being asked about the relationship of the new disease to the terrorist attack on Fleeting Image. A couple of black vans had arrived in the City over the last few days and large, burly men 149 in dark suits had been out and about flashing badges and asking questions. When one of them turned up with bite marks, blood loss and no memory of the event, fear started to creep into the people closest to the problem. Armed police guards were stationed on every floor of the hospitals and in medical centres. Meanwhile, in ‘Satans’ and ‘The Mausoleum’ there was a feeling of accomplishment as the ranks of the vampires started to swell in the evenings as the newly changed came to the clubs. Vampires were feeding now, doing what came naturally and blood was their food. Not a few of the homeless in the City had disappeared from the streets, eventually finding their way into the river as drained corpses. The vampire ranks were swelling. Soon there would be enough of them to split up and head throughout the land to infect it all. Soon, the whole country would be in thrall to vampires and their ilk. Louise was doing it hard. She had another three to four days to go but was in difficulties now. The skin over her abdomen was being stretched too quickly and every day was painfull for her, she could hardly move. On top of that, the garlic pills were not working anymore and she had a strong desire to drink blood. Damn Dragovich. The Devil was being a bastard and had not been that interested in her lately. She was left alone for long periods of time, broken only by Sonya’s occasional visits. The last was two days ago. The baby turned rapidly inside her and yet more pain flashed through Louise as she gasped for air. Why had she ever agreed to have the Devil’s child? Later that evening on the sixteenth floor of Fleeting Image, the Devil’s eldest child, Tyrus, was sitting with his sire discussing their plans for the future. “So,” the Devil said, leaning back in his chair with a cigar and a Scotch, “you will be leaving tomorrow afternoon on the plane for Mombolani. I will come to the airport to see you off and we will meet again at our Chateau in the South of France in nine months. If you need me in the interim, just think of me and I will turn up to assist you.” “I am hoping that will not be necessary Sire. I should be able to handle this assignment without any problems and am looking forward to it.” Tyrus grinned evilly. “A Muslim brother. That’s an interesting twist.” “Yes, I thought so too. As it is your last night in this country, is there anything you would especially like to do?” The Devil’s eyebrows rose in query. Tyrus considered for a moment. “Yes, spend it with Lucinda and Sonya. Those two will be enough for me tonight I think.” The Devil nodded thoughtfully. “It shall be so and I think I will spend a night of evil fornication at ‘The Mausoleum’. It has been a long time since I have sampled the delights of fucking vampire girls. They do like their Grandfather you know.” He gave Tyrus a wink before they both vanished. The next morning, at The Brotherhood safe house, the four friends met again to finalise their plan. After much discussion, it had been decided that Ruth would go to ‘Satans’ with Steve and that Chris would go to ‘The Mausoleum’ with 150 Mary. The lovers didn’t really want to be separated but Ruth had the most experience with demons and so was the logical choice for ‘Satans’. Steve was going as Ruth’s backup because Chris was the logical choice to lead the raid on ‘The Mausoleum’ and he would take Mary as his partner. The raids had to be staged simultaneously; otherwise one of the groups could be warned in advance of an attack. They had thought about the timing of the raids carefully and decided to go early, at eight o’clock, so as to avoid lots of the newly infected people who may be there after opening time. Chris picked up the sword that had been Roberto’s and drew the daito blade from its sheath to give it a final polish. The shinier it was, the easier it cut. As the blade came free from the sheath, it slipped and he caught it reflexively and in doing so received a nasty cut to his hand which started bleeding profusely. Mary jumped to her feet and opening the door, stuck her head out and yelled to Mathew. “Bring the first aid kit please Mathew. Quickly.” Mathew turned up seconds later and quickly mopped up the blood with a couple of swabs and applied a light pressure bandage to reduce further bleeding. Ruth looked on amused as Mathew cleaned up the mess and left the room. “Why are you so amused by this Ruth?” Steve enquired, a little shaken by Ruth’s apparent unconcern. In answer, she pointed towards Chris, who was taking off the bandage. “No Chris, leave it on.” Mary expostulated. Chris merely smiled and held up his hand. There was no cut. It had healed already. There was not even a scar. Just then there was a wailing cry followed by a loud thud from the corridor on the other side of the door. The four of them ran out to find Mathew writhing on the floor about ten paces from the door. He appeared to be in agony and had blood on his lips. Mary placed a hand on his forehead. “He is burning up. What is happening?” Chris looked Mathew over and noticed something in his right hand. Bloody swabs, the same swabs that moments before had been used to wipe up Chris’ blood from the sword cut. “Bring him into the office. We need privacy.” To the other members of The Brotherhood that had come running in response to the cry, he said. “It is alright, everything is under control. Go back to your work. We will take care of this. Thank you.” They picked up Mathew and took him into the office, closing the door behind them. Chris immediately changed to his other form and placed one of his silver scaled hands on Mathew’s forehead while with the other he examined Mathew’s lips. A look of wonderment passed over his face and he glanced at each of them in turn. “Unbelievable. God does work in mysterious ways.” “What? Will he be all right? Tell us.” They all chorused. Mathew had stopped groaning and the colour was returning to his cheeks. In fact he looked better than 151 he had for the past fortnight. Chris changed back to his normal form. Mathew’s eyes opened and he looked very relieved. “Do you want to tell them or shall I?” Chris queried with a smile. “I will, I am still Brotherhood.” He considered the faces looking down at him before continuing. “When I left the office with the bloody swabs, I could not control the urge for blood that rose within me. I must confess that I sucked on the bloody swabs.” Here, Chris took over the story. “In his haste he bit his own lip with his newly sharp teeth. I guess some of my blood entered his circulatory system directly.” Looking down at Mathew he chuckled. “Tell them how you feel.” “Great. Never felt better. The desire for blood has gone, I don’t feel sick anymore and my chronic sinus problem seems to have gone also.” Mathew sat up. “Can I go now? I have other work to do.” “Yes Mathew, you may go but what has happened here has to remain our secret. Okay? Now get out of here and try to stay out of trouble.” After Mathew had gone, Chris beamed at the group. “You know what this means? My blood can be used to cure infected vampires. A very small amount injected intravenously will affect a cure. We don’t have to kill all those people that have been infected. All we have to do is take out the ones who have been born vampires. Tonight.” After a long night of fornication, the Devil was feeling much better and a lot less tense than he had been. So in the morning he ducked over to the new house to check on Louise. Big mistake; she was writhing around in agony and her stomach was grotesquely distended. Between gasps and grunts of pain she abused the Devil mightily for what he had done to her, conveniently forgetting it was her own lust for power that had contributed to the state of affairs she was in. The Devil was putting his eldest son on a plane that afternoon and was in no mood to put up with the abuse that Louise was handing out, so he left. Not long after he left, Louise was wracked with even greater spasms of pain and the baby started moving in earnest. Louise could do no more than lay back and look at her rotund belly which was stretching even more. It appeared as though a tiny hand was pushing upward, the fingers almost individually discernable through her skin. Another tiny hand joined the first and the agony was excruciating now. Then before Louise’s unbelieving, pain-filled vision, the skin on her belly ruptured and that tiny hand pushed through. By now she was screaming almost non stop and flickering in and out of consciousness. The first tiny hand was closely followed by a second tiny hand pushing through the hole in her abdomen then both hands gripped the edges of the wound and stretched it. The baby popped up as the skin over her belly tore and blood started pumping from arteries, spurting over the surrounding furniture and light colored carpet. The last thing Louise saw in this life was her first child. Ugly as sin, with malevolent eyes and its brand new mouth full of sharp fangs. Long claws were at the ends of 152 its fingers and as it turned away to gaze around, she saw two nobbles of flesh on its back. Her eyes closed for the last time and her lifeless head fell back as the little child started lapping Louise’s blood from the open wound in her abdomen. Her body had now became a food source for the little one as it progressed from lapping blood to flesh eating over the next hour or so. Tyrus showed one of his passports to the Immigration official and had it stamped with an exit visa. The Devil already had clearance to be out on the tarmac with his plane. They walked to the now fully loaded aircraft together, looking like any father and son, chatting amicably before its departure. Tyrus made his way on board and the stairway was removed prior to the door shutting. The engines revved up and the plane turned around and headed off down the runway with ever increasing speed until with a lurch, it grabbed sky and became airborne. As the plane became a smaller and smaller dot in the sky, the Devil gave a final wave then headed off. If he was pulling out of the City soon, he would need to have a chat to the Covens but first, Fleeting Image still required his attention. He would visit the vampires later, after they had slept throughout the day, as was their habit. At seven thirty that evening outside The Brotherhood safe house, two cars were waiting to take Chris and Mary and Ruth and Steve to their appointment with destiny. Both men were equipped with their daito swords and Mary had her shoto sword. Ruth was unarmed, preferring her natural abilities, learned when she was a demon. They didn’t take water cannons, as holy water was not an effective weapon against vampires. After fond farewells, they climbed into their respective vehicles for the trip downtown. As he entered the car behind Ruth, Steve pulled the hood of his track top up over his head to hide the handle of the sword strapped to his back. The element of surprise could be important shortly. He smiled at Ruth as he got into the back of the car with her. “Who would have thought you and I would be going to fight evil together,” he chuckled. She nodded in agreement. “Yeah, who would have thought.” Lucinda was at ‘Satans’ with the other Coven masters and Sonya and the Devil. They were discussing plans for the spread of vampirism throughout the country. She had enjoyed last night’s fornication with her father, Tyrus, but something was not quite right. Why had he left? Oh, she had heard all the reasons that they gave but still, after the bombing of Fleeting Image she was becoming a little insecure. One must never forget that the Devil and his demons lie. Her Coven was important to her. She was the eldest vampire and her Coven was her life. She had to go and see them and warn them about the state of affairs. Without further ado and telling no one, she drifted off and quietly slipped out of ‘Satans’ by the back door, heading off across town on foot to ‘The Mausoleum’. Not five 153 minutes after she had left ‘Satans’, a Brotherhood car pulled up outside the back door at one minute to eight. At exactly the same time, the other Brotherhood car pulled up outside of ‘The Mausoleum’. Chris and Ruth got out and headed for the front doors which were still locked, while their car and driver parked across the street to wait for them. Mary took out her lock picks and within minutes they were inside. The lighting was dim but sounds of discordant music could be heard coming from the club area through the foyer. They both drew their swords, holding them down low as they advanced. The first attack came as they opened the swinging doors to the club proper. A male vampire sprang from the side at Chris. There was a flicker of reflected light off the barely visible sword blade and Mary gasped as the body fell one way and the head the other, blood gouting from the severed neck. Chris grimaced with distaste and set his jaw firmly. Down the stairs they went, side by side, while before them about twenty vampires formed a semi circle, laughing and joking. “Lucky shot. Need a girl to do your fighting. You a ninja, dummy. She can do a head job on me anytime.” The vampires were confident of their abilities. Chris said nothing, merely motioned Mary to fall into position behind him to watch his back. He halted and stood there silently, waiting. He didn’t have long to wait as half a dozen vampires charged him simultaneously, some waved wicked looking knives. Chris changed on the move and Mary lost track of him, he was moving too quickly in the dim light for her to follow with her eyes. It was like trying to follow moving mist. He was back where he started, in the same pose, in human form, before the first body had hit the ground. As it hit, the head rolled off, as did all the others. Blood fountained out of the corpses, their clothes were splattered. Mary was amazed and horrified at the same time. She knew these were vampires but still hated to see things killed. “Be carefull,” Steve whispered to her. “I won’t be able to guard you for a moment.” Then he changed again and began the dance of death. Almost too fast and fluid to see, the wonderfull, silver servant of God swept through the room, carrying out beheadings faster than Mary could count. It beggared belief, even though she had seen him in action before. When it was finished, he stood, an alien silver creature, with his head bowed, praying for forgiveness. While he was doing so, a crypt door flew open and a vampire with a huge knife launched himself at Chris. Without thinking, Mary turned, went down on one knee and drove her sword two-handed into its abdomen, right to the hilt. She was thrown over backwards with the momentum of the attack but had slowed the vampire enough for Chris to spin around and decapitate it. “You all right Mary?” he asked as he pushed the headless body off her and pulled her to her feet. “Yeah, I’ll live. I just need my sword,” she said as she tugged her shoto out of the vampires body, trying not to look where the head had been. “We better check to see if any more of these hidey holes contain vampires. Just in case.” 154 Chris nodded and they checked every crypt, finding two more vampires which were dispatched quickly. They then swept through the whole club but found nothing more. “That’s us. I wonder how Ruth and Steve are doing.” Chris said to Mary as they exited ‘The Mausoleum’ and headed quickly toward their car, glancing around in case they were seen in their bloodied state. When Ruth and Steve exited their car at the back of ‘Satans’, Ruth had walked over to the door and just flickering into her other, silvery form, gave it a hard shove. It opened explosively, tearing part of the door jamb with it. “So much for surprise,” Steve giggled nervously. Ruth motioned with her hand and they entered the club and passed through the bedroom and office on their way in. The bedroom had been very well used recently but there was no one in it now. As they entered the main area of the club, they were spotted. Ruth just carried on walking, right into the centre of the open area. Steve, with his hood up, followed along behind, keeping a wary eye out on both sides until Ruth stopped, then he turned around and stood back to back with her, protecting her from a rear attack. The Devil was there, as was Sonya and the five remaining Coven leaders, Lucinda having just snuck out. They had been sitting around a table making plans but now they stood, the vampires fanning out around the sides. The Devil was the first to speak and he was incredulous. “RUTH! What? How? Nice to see you daughter, I thought you were lost.” He stared at her for a moment then shook his head. “You are lost to me. No longer a demon eh. Full of that damn Light. It will be a shame to kill you, I did like you.” “You cannot kill me sire, I have no sin now. A power greater than yours is now my master and HE has forgiven me my sins. I have entrusted my soul to GOD.” She shouted the last word and every evil being present shivered at the sound of that name. Only Sonya smiled. “The Devil may not be able to hurt you but I can. There are no RULES about demon kin fighting and you were born demon. In human form, Sonya advanced quickly toward Ruth who stood her ground. Just before she reached the spot where Ruth was standing, Sonya became demon and the fist she was swinging was white hot. There was a flicker of silver as Ruth changed into her other form and easily deflected the blow. All the creatures in the room gasped in unison at the change in Ruth as Sonya stepped back. “What is this,” the Devil enquired in a sneering fashion. “Tricks?” “No tricks. This is what God did to my demon half when he forgave my sins. It is his gift to me. Now Sonya, you have shown aggression. Defend yourself.” As she spoke, Ruth moved forward toward Sonya, dropping into a fighting crouch and facing the red scaled demon woman. Long diamond claws on the ends of Ruth’s talons glittered in the available light. The battle began. So swift and so powerfull were they that tables and chairs were sent flying like toys, some carved up into 155 matchwood. Steve noticed the vampire leaders starting to fan out around the sides of the conflict and readied himself for treachery. It was not long in coming, as two Coven leaders launched themselves at Ruth’s back simultaneously. In one single motion, Steve dropped his hood back, grasped the hilt of the daito and swung. One vampire’s head shot off its neck and fell to roll along the floor. As the other turned with a look of amazement on his face, the backswing took his head off also. Dragovich roared at this attack on his fellow vampires and launched himself at Steve, who could only wound the Coven leader with his first swing. Dragovich grabbed the sword exultantly, only to stare in amazement as his fingers fell off, cut through by the exquisite edge of the Japanese blade. Steve recovered in that instant and swung again, this time his aim was true and Dragovich’s head rolled. The other two Coven leaders hung back, waiting to see the outcome of Sonya’s and Ruth’s battle. Flames, fall out from Sonya, were starting to spring up around the club as the contestants raged against each other. Both combatants were showing wounds; Ruth’s diamond tipped talons were very effective, even against demon hide but Sonya was very strong. Finally Sonya managed to get Ruth into a headlock and proceeded to strangle her. Steve was really worried now, things weren’t going so well. What if Ruth was killed? Just as it looked as though defeat was on the cards, Ruth backflipped right over Sonya’s head, tearing out of the chokehold, to land behind her. Before the demon could turn around Ruth rammed the middle digit of her right hand up beneath the occipital bone of Sonya’s head. It was a perfect strike. The diamond tipped finger penetrated right through the soft spot at the base of the skull and smashed the brain stem to pulp. Sonya went rigid for a second then limply fell off Ruth’s raised middle digit and disappeared. Ruth stood, holding up the bloody middle digit in front of the Devil. A demon insult. The Devil disappeared and Steve advanced toward the two remaining Coven leaders, sword held at the ready but before he could get there, there was a flicker of motion and two heads were parted from their shoulders by one swipe of a diamond tipped, silver, taloned hand. Ruth changed back to human form and stood naked before him, swaying with weariness. Steve went and found her a chair but she refused it. “We can’t stay here, it’s on fire. Let’s get out into the fresh air.” They retraced their way back out of the club and Ruth paused in the bedroom to grab some clothes. Steve was relieved, as Ruth was stupendous naked. Then back up the stairs, Steve helping Ruth where necessary. As they got outside, Ruth paused for an instant with her eyes closed. When she opened them, some of the weariness had gone to be replaced with a smile. “Chris and Mary are fine and have completed their mission. We are to meet them at the safe house.” They signalled the driver across the road who brought the car over. They got in and left the now burning building behind as they headed home for a well earned rest. 156 The Devil had transported himself to ‘The Mausoleum’. What he found when he arrived there was a heap of headless bodies and Lucinda, quietly weeping on the stairs. He was angry. Bloody GOD, cheating bastard. What had he done to Ruth? That wasn’t in the RULES. Thinking of which, he realised that tweaking his own DNA wasn’t really in the RULES either. Oh shit! Louise. He motioned to Lucinda, wrapped his arms around her and transported them both to his new house. They arrived in the lounge room to find the body of Louise lying on the couch with her innards pulled out onto the floor. There, a very ugly and rotund young baby was feasting on them. Lucinda gagged but the Devil strode over and picked up the child who squealed in delight and tried to bite the Devil’s fingers. The Devil cuffed it gently and held it out in front of him. A little girl, good. “Your name is Tamsyn and you are the first of a new breed of demon. Long may you live in evil.” The baptism over, he handed the ugly little girl to Lucinda who took it gingerly, wary of being bitten. “Louise fucked up. It looks like she must have been bitten by a vampire while she was pregnant. For the next year you will be its mother and I will help you raise it. This is the future of evil. Tyrus is going to like this one. He may even have a child with you.” Before Lucinda could reply the Devil wrapped his arms around her and the baby. “This game is over but the weather in the South of France is beautifull at this time of year. Let us away to my Chateau.” They vanished. 157 EPILOGUE. The Devil, no longer the Devil now but plain old Mr. Dee, leaned back in the pool-side lounger sipping on his Scotch-on-the-rocks and took in the view. Young, well endowed women in micro bikinis, lazed around the pool waiting to be spotted by rich older men, just like him. He was enjoying his retirement, immensely. Tyrus had arrived in the South of France from Mombolani a couple of years ago with his dark skinned baby brother, Hamma, who was now fully grown. He had found Lucinda there and a nearly fully grown sister, who had become prettier as she had aged. Luckily. She still had the little nobbles of skin on her back though and no one knew her full potential yet. When she had first changed to demon form, she had even scared the Devil a bit. Hamma and Tamsyn ‘trained’ with each other regularly. Tyrus was overjoyed to find Lucinda there waiting for him as she was his favourite. He was still very evil but had matured so much that the Devil decided it was time for him to retire in favour of Tyrus. They made the necessary appointment with GOD, who was impressed enough with Tyrus that the ceremony was held immediately and Tyrus was granted the necessary powers to become the fourth Devil since the position was created. The RULES were updated and Mr. Dee retired from the world scene and was given plenty of funds for his retirement. Tyrus paid him a consultancy fee and consulted him now and again. Between them they had figured out that Devil and vampire matings would produce the finest demons so Tyrus, against all expectations, had taken Lucinda as his one and only all time wife. She was now pregnant with their second and last child for now. Normal gestation but rapid growth. Mr. Dee’s first demon grandchild, named in memory of Sonya, was nearly fully grown and so evil. Well, that Tyrus was a lucky fellow and he had been doing good work. So many wars and famines, more and more people in a world that didn’t have room for them and maybe a computer game on the way to snare some more souls. GOD was going to need his ‘specials’. 158 © Bruce C. Lee December 2005.
https://www.scribd.com/document/24503993/The-Final-Song-Part-Two-Rewind
CC-MAIN-2017-34
en
refinedweb
Spring about the various components involved in Spring Portlet framework like Controllers, Handler Mappings, View Resolvers etc. Finally, it concludes with a sample which illustrates developing Portlet applications using Spring’s Portlet approach. Before delving into this article, the reader is expected to have a fair bit of knowledge on Core Spring framework and Spring MVC. For more information on this, please refer and read Introduction to Spring Web MVC. also read: Java Portlets Portlets are web components similar to Servlets managed by Portlet Container (similar to Web Container which manages Servlets). Portlets are components used in the UI layer for displaying the content fetched from different data sources to the end user. Portlets can generate dynamic content or static content. Typically, a web portal (or a portal application) is one comprising of multiple Portlets that retrieves dynamic or static content from various data sources. It is the responsibility of the portal to aggregate the content retrieved from various Portlets to make a display suitable to the end user. Portlet APIs Similar to Servlet interface, there is Portlet interface which will be extended directly or indirectly by all the Java Portlets. The life-cycle of a Portlet (such as creation, request processing and destruction) is completely managed by Portlet Container. When the Portlet Container creates an instance of a Portlet, it will call the init() method defined in the Portlet interface. The client portal which initiates the request can fall under two flavors. They are - Action Request - View Request When the request type is Action, then the Portlet Container will call the processAction() method. On the other hand, when the request is of type View, the Container will call render() method defined on the Portlet interface. Portlet Modes The specification supports three standard Portlet modes, although it is possible to define custom Portlet modes as well. The standard modes are - View Mode - Help Mode - Edit Mode In the View Mode, the portal is expected to retrieve the contents from different Portlets without any user interaction and the specification mandates to support this mode. In Help mode, the Portlet is expected to provide context sensitive information about the Portlet. In Edit mode, the Portlets are expected to fetch the content based on user preferences. The help and the edit mode are optional according to the specification. Note that, there is a class GenericPortlet which already defines the template methods doView(), doHelp() and doEdit() for supporting view, help and edit modes. Spring Portlets Architecture The concepts and components of Spring Portlets resemble the very same as Spring Web MVC, the framework used for developing Web Applications using Spring. We will study and understand the following components before going into a sample application. Dispatcher Portlet Similar to DispatcherServlet in Spring Web MVC, we have DispatcherPortlet which acts as the front controller for receiving the client requests. This front controller plays a key role as it drives the entire Portlet framework by wiring the other components. <portlet> <portlet-name>test</portlet-name> <display-name>Test Service</display-name> <portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class> <portlet-info> <title>Test Service</title> </portlet-info> </portlet> Every instance of Dispatcher Portlet maintains its own application context. For example, in the above sample, the dispatcher Portlet will look for a file name by test-portlet.xml in the folder /WEB-INF directory and if it present, will try to load all the bean definitions from that file. Handler Mappings Handler Mapping are components which are used to map incoming Portlet requests from the client to appropriate handlers. Spring provides a number of built-in handler mapping components with the most familiar being the PortletModeHandlerMapping which maps the Portlet modes (like view, edit, help etc) directly to handlers. For example, consider the following code snippet, <bean> <property name="portletModeMap"> <map> <entry key="view" value- <entry key="edit" value- <entry key="help" value- </map> </property> </bean><map> </map> Controllers Controllers are components which are called for performing any operation, they will be called from the Dispatcher Portlet after it does mapping for the Portlet requests. There are many built-in controllers like AbstractCommandController, SimpleFormController, AbstractWizardFormController and they all implement the Controller interface that defines the following methods - handleRenderRequest(RenderRequest, RenderResponse) - handleActionRequest(ActionRequest, ActionResponse) Remember that a Portlet can act in two modes, one is the view mode in which case the method handleRenderRequest() where the response content will be rendered to the client and the other is the action mode where the method handleActionRequest() will be invoked. View Resolvers Controllers are never coupled with the views and one can note that in the implementation of a controller, the controller will specify only the name of the view. The name of the view is so abstract, hence View Resolver components come into place for resolving the actual view based on the view name. For example, the following bean definition will try to resolve the view names mentioned in controllers are JSP views. <bean id="jspViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> Design In this sample application, we will design Portlets for displaying the list of the movies running this week and also for displaying the live cricket score-cards. Note that the implementation will never hit an external service for getting the information instead it will hard-code the necessary details within the java code itself. Interface Design We will start with the interface design for retrieving the list of the movies and the list of the score-cards. MovieService.java package net.javabeat.articles.spring.portlets.sample.movie; import java.util.Set; public interface MovieService { Set getAllMoviesForThisWeek(); } The above movie service defines a method for getting the list of movies running that are running for the current week. Similarly, the following score-card service provides the live score cards. ScoreCardService.java package net.javabeat.articles.spring.portlets.sample.scorecard; import java.util.Set; public interface ScoreCardService { Set getLiveScoreCards(); } Note that the service interfaces are dependant on the model objects Movie and ScoreCard. We will see the declaration of these model objects in the next section Model objects Given below is the declaration of the model objects Movie and ScoreCard. The Movie objects contains the properties like the movie id and the name of the movie along with appropriate getters and setters. Movie.java package net.javabeat.articles.spring.portlets.sample.movie; public class Movie { private String id; private String name; public Movie(String id, String name){ this.id = id; this.name = name; } public String getId(){ return id; } public void setId(String id){ this.id = id; } public String getName(){ return name; } public void setName(String name){ this.name = name; } } Similarly, the score-card model objects contains the name of the two teams along with the scores at the current moment. ScoreCard.java package net.javabeat.articles.spring.portlets.sample.scorecard; public class ScoreCard { private String teamOneName; private String teamOneScore; private String teamTwoName; private String teamTwoScore; public ScoreCard(String teamOneName, String teamOneScore, String teamTwoName, String teamTwoScore){ this.teamOneName = teamOneName; this.teamOneScore = teamOneScore; this.teamTwoName = teamTwoName; this.teamTwoScore = teamTwoScore; } public String getTeamOneName() { return teamOneName; } public void setTeamOneName(String teamOneName) { this.teamOneName = teamOneName; } public String getTeamOneScore() { return teamOneScore; } public void setTeamOneScore(String teamOneScore) { this.teamOneScore = teamOneScore; } public String getTeamTwoName() { return teamTwoName; } public void setTeamTwoName(String teamTwoName) { this.teamTwoName = teamTwoName; } public String getTeamTwoScore() { return teamTwoScore; } public void setTeamTwoScore(String teamTwoScore) { this.teamTwoScore = teamTwoScore; } } Service implementations For the implementations of the MovieService and the ScoreCardService, we are not going to hit the some external API or web-service for getting the details. Instead we are going to maintain some kind of hard-coded data within the implementation code to achieve this. MovieServiceImpl.java package net.javabeat.articles.spring.portlets.sample.movie; import java.util.LinkedHashSet; import java.util.Set; public class MovieServiceImpl implements MovieService{ private static Set allMovies = new LinkedHashSet(); public Set getAllMoviesForThisWeek() { if (allMovies.size() == 0){ initMovies(); } return allMovies; } private static void initMovies(){ allMovies.add(new Movie("TKK", "The Karate Kid")); allMovies.add(new Movie("SFA", "Shrek Forever After")); allMovies.add(new Movie("TS3", "Toy Story 3")); } } Similarly, have a look at the implementation of the ScoreCard service implementation. ScoreCardServiceImpl.java package net.javabeat.articles.spring.portlets.sample.scorecard; import java.util.LinkedHashSet; import java.util.Set; public class ScoreCardServiceImpl implements ScoreCardService { private static Set liveScoreCards = new LinkedHashSet(); public Set getLiveScoreCards() { if (liveScoreCards.size() == 0){ initScoreCards(); } return liveScoreCards; } private static void initScoreCards(){ liveScoreCards.add(new ScoreCard("India", "320/5", "Pakistan", "210/8")); liveScoreCards.add(new ScoreCard("SouthAfrica", "296/3", "West Indies", "246/6")); liveScoreCards.add(new ScoreCard("Bangladesh", "196/9", "Srilanka", "199/4")); } } Controller Components Till now, the components that we have written doesn’t have any dependency with the Spring APIs or with any of the J2EE components. Now we are going to write the Controller components which will depend on the Spring Portlet APIs. Have a look at the following MovieController component. MovieController.java package net.javabeat.articles.spring.portlets.sample.movie; import java.util.Set; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.springframework.web.portlet.ModelAndView; import org.springframework.web.portlet.mvc.AbstractController; public class MovieController extends AbstractController{ private MovieService movieService; public void setMovieService(MovieService movieService) { this.movieService = movieService; } @Override public ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response){ Set movies = movieService.getAllMoviesForThisWeek(); ModelAndView mv = new ModelAndView("moviesView", "movies", movies); return mv; } } Note the declaration of the MovieController class, it extends from Spring Portlet’s AbstractController component. The MovieController component is dependant on MovieService component. Later on, we will walk through on establishing dependency between MovieController and MovieService components. Have a note of the signature of the template method handleRenderRequestInternal(). This method will be called by the framework for rendering the response to the client. For rendering the response to the client, we need the view and the model that will be displayed on the view. Spring encapsulates this behaviour with the help of ModelAndView objects. Note that we fetch the model through the method getAllMoviesForThisWeek() defined on MovieService object. Finally we construct and return a ModelAndView object with the name of the view, the name of the model and the model object itself. Note that at this point, we have only defined the name of the view. Later on in this article, we will see how this view is getting resolved to a real view object. Similarly, have a look at the declaration on the ScoreCardController component. Note that this controller is dependant on ScoreCardService component that does the job of fetching the model from the method getLiveScoreCards() defined on ScoreCardService. ScoreCardController.java package net.javabeat.articles.spring.portlets.sample.scorecard; import java.util.Set; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.springframework.web.portlet.ModelAndView; import org.springframework.web.portlet.mvc.AbstractController; public class ScoreCardController extends AbstractController { private ScoreCardService scoreCardService; public void setScoreCardService(ScoreCardService scoreCardService) { this.scoreCardService = scoreCardService; } @Override public ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response){ Set liveScoreCards = scoreCardService.getLiveScoreCards(); ModelAndView mv = new ModelAndView("liveScoreCardsView", "liveScoreCards", liveScoreCards); return mv; } } Web Application Deployment Descriptor For making use of Spring’s Portlet framework, we have to provide a hook in web.xml mentioning the web server (or the web container) to go through a different flow. Given below is the complete listing for the file web.xml. web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app <display-name>Demo Portal</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> > We have added a context listener for loading the spring application context. The name of the listener is ContextLoaderListener and it will try to load the application context with the file name taken from the parameter contextConfigLocation. Note that we have provided the application context’s file name as applicationContext.xml. In the later section, we will see the content and the description of the file. For the time-being, assume that the bean definitions defined in the application context will be loaded. Spring Web MVC uses HttpServletRequest for handling the request and HttpServletResponse for rendering the response and also for supporting multiple view technologies. However, Spring Portlet framework deals with RenderRequest and RenderResponse for handling request and response. In order to support the existing view technologies supported by Spring’s Web MVC we have to declare the ViewRendererServlet in which case the DispatcherServlet will map the RenderRequest/RenderResponse APIs to HttpServletRequest/HttpServletResponse APIs with the help of ViewRendererServlet. Application Deployment Descriptor Note that the context loader listener defined in web.xml will try to load the bean definitions from the context file applicationContext.xml. Given below is the listing for the file applicationContext.xml applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns: <bean id = "movieService" class = "net.javabeat.articles.spring.portlets.sample.movie.MovieServiceImpl"> </bean> <bean id = "scoreCardService" class = "net.javabeat.articles.spring.portlets.sample.scorecard.ScoreCardServiceImpl"> </bean> <bean id = "viewResolver"> <property name = "viewClass" value = "org.springframework.web.servlet.view.JstlView" /> <property name = "prefix" value = "/WEB-INF/jsp/" /> <property name = "suffix" value = ".jsp" /> </bean> </beans> In the above file, we have the declaration for movie service and score-card service. Remember that in the beginning of the sample, we have designed the movie and the score-card services. The configuration file also contains the definition for the view resolver class for resolving the view names to a particular view technology like JSP, JSTL, Velocity etc. Views In the above section, we have seen that the view names moviesView and liveScoreCardsView will be mapped to moviesView.jsp and liveScoreCardsView.jsp present in /WEB-INF/jsp folder. Here is the listing of both the files. moviesView.jsp <[email protected] <tr> <th>Id</th> <th>Name</th> </tr> <c:forEach <tr> <td>${movie.id}</td> <td>${movie.name}</td> </tr> </c:forEach> </table> Note that the above JSP with the help of JSTL iterates over the model object by the name movies (this name we set in the MovieController while creating the ModelAndView object) to create the HTML fragment. Have the look at the following listing for liveScoreCardsView.jsp that does the job of iterating over the model object liveScoreCards for generating the HTML fragment. liveScoreCardsView.jsp <[email protected] <tr> <th>Scores</th> </tr> <c:forEach <tr> <td>${liveScoreCard.teamOneName} (${liveScoreCard.teamOneScore}) Vs ${liveScoreCard.teamTwoName} (${liveScoreCard.teamTwoScore})</td> </tr> </c:forEach> </table> Portlet Descriptor Now, we will see how to configure the Portlet configuration file so that the Portlet components can be loaded and processed by the framework. Have a look at the following portlet.xml file, portlet.xml <?xml version='1.0' encoding='UTF-8' ?> <portlet-app <portlet> <portlet-name>movie</portlet-name> <display-name>Movie Service</display-name> <portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class> <supports> <mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> </supports> <portlet-info> <title>Movie Service</title> </portlet-info> </portlet> <portlet> <portlet-name>scorecard</portlet-name> <display-name>Live Score-Card Service</display-name> <portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class> <supports> <mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> </supports> <portlet-info> <title>Live Score-Card Service</title> </portlet-info> </portlet> </portlet-app> This file should reside in WEB-INF/ folder. In the above file, we have defined two Portlets – the movie Portlet and the score-card Portlet. Note that we have defined the Portlet class as DispatcherServlet for both the portlets. This makes the DispatcherPortlet to look for a configuration files with the name movie-portlet.xml and scorecard-portlet.xml in the /WEB-INF folder. We will look into the contents of both these files in the next section. Portlet Configuration files In general, the Portlet configuration files will contain the definition of controller objects as well the mapping modes that defines the mapping of the client requests to the handler components. Have a look at the following listing, movie-portlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns: <bean id = "movieController" class = "net.javabeat.articles.spring.portlets.sample.movie.MovieController"> <property name = "movieService" ref = "movieService"/> </bean> <bean id = "portletModeHandlerMapping" class = "org.springframework.web.portlet.handler.PortletModeHandlerMapping"> <property name = "portletModeMap"> <map> <entry key = "view" value- </map> </property> </bean> </beans> The above code has the definition of the movie controller which in turns has reference to the movie service component. Note that we have already declared the the movie service in the applicationContext.xml file. Beans declared in this applicationContext.xml are visible throughout all other configurations. We have made use of the built-in mapping mode PortletModelHandlerMapping for directly mapping the mode of the Portlet to appropriate handlers. In this case we have mapped the Portlet view mode to the handler movie controller. Same logic goes into the scorecard Portlet which is defined below. scorecard-portlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns: <bean id = "scoreCardController" class = "net.javabeat.articles.spring.portlets.sample.scorecard.ScoreCardController"> <property name = "scoreCardService" ref = "scoreCardService"/> </bean> <bean id = "portletModeHandlerMapping" class = "org.springframework.web.portlet.handler.PortletModeHandlerMapping"> <property name = "portletModeMap"> <map> <entry key = "view" value- </map> </property> </bean> </beans> Deploying the application The above sample application has to be packaged as a regular web application with the standard directory layout. Now this application has to be deployed in a portal container or a portal server which is compliant to the JSR 168. For example, Pluto Portal Container – Apache – Pluto (from Apache) provides a easy way for deploying portal applications. For example, when deploying Portlet application in Pluto, it is mandatory to define a Pluto invoker Servlet for each Portlet defined in portlet.xml as follows, <servlet> <servlet-name>weather</servlet-name> <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class> <init-param> <param-name>portlet-name</param-name> <param-value>movie</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name> movie</servlet-name> <url-pattern>/PlutoInvoker/ movie</url-pattern> </servlet-mapping> You have to read the documentation available in the Portlet container for deploying the application as the deployment process generally varies between Portal containers. also read: Conclusion In this article, we covered the basics of Portlet development using Spring’s Portlet framework. The article had a walkthrough of the various components in detail explaining about the interaction between them. An important point to remember here is that, even though there are multiple configuration files for wiring-in the components in the Portlet API, separation of components will be of much help while developing larger applications. Hi Krishna Im using Liferay with Spring and i have a few doubts related to the integration configuration. –> why each portlet has to be defined as a servlet in web.xml? what is the use of doing it so? –> when the container reads portlet.xml ? i mean when we deploy the application contextloaderlistener will come in picture and it will instatiate the spring container but how portlet.xml is recognized. will that servletcontainer or portlet container? –> do we have both the servlet container and portlet container ? if so how these were interacting we have portlet loaded into portlet container and servlets loaded into servlet container then how the interaction takes place. please give me some idea or some reference where i can get these stuff im actually ,not able put all these things arranged. hope u put me in some right path. Thanks in advance Surender Very good tutorial, simple and intuitive to understand. Hello Ramesh, Thank you for the comments!! Hi Krishna, The tutorial is very good. Could you provide me the source code please? Regards, Yellappa We don’t have packaged source code download for this tutorial. I follow exactly same steps provided by you. I am using Apache Pluto 2.0.3 but When I am trying to Run the application on server I am not getting any output. In web.xml I have kept movie org.apache.pluto.container.driver.PortletServlet portlet-name movie movie /PortletSample/movie . You mentioned to put these lines in portlet.xml but it is giving error when i tried to paste above lines in portlet.xml . Rest all is exactly same as what you have mentioned. Please do let me know how to run the application on Apache Pluto. web,xml movie /PortletSample/movie scorecard org.apache.pluto.container.driver.PortletServlet portlet-name scorecard Hi , I found source code for Spring MVC Portlet in Liferay Check this out . Very Good Example
http://javabeat.net/introduction-to-spring-portlets/
CC-MAIN-2017-34
en
refinedweb
27 June 2005 22:59 [Source: ICIS news] HOUSTON (CNI)--US prompt benzene spot prices moved past $3/gal Monday for the first time since 27 April with traders citing rising crude prices for the increase. Traders said July spot business was completed today at $3.03/gal FOB USG. But later in the day traders said the July bid/offer range was difficult to assess. Some traders said bullish July spot offers were as high as $3.30/gal FOB USG. Others estimated the July bid/offer range at $3.05-3.15/gal FOB USG. ?xml:namespace> In late April US benzene spot prices were talked at $3.05-3.10/gal FOB USG. The increase in benzene spot prices is attributed to the persistent rise in crude oil prices. On Monday the Nymex August crude oil contract closed up 70 cents/bbl at $60.54/bbl. The August crude oil contract rose to as high as $60.95/bbl on Monday. The August crude oil contract has increased $2.45/bbl since June 22 when it became the spot month contract. The increase in benzene spot prices is expected to result in higher styrene monomer (SM) spot prices for July loading. Traders said today that SM spot offers were difficult to assess, with sellers remaining on the sidelines until they can see how European and Asian SM spot markets react to the increase in US benzene
http://www.icis.com/Articles/2005/06/27/688507/us-july-benzene-spot-prices-at-3gal-highest-since.html
CC-MAIN-2014-52
en
refinedweb
Code-signing certificates About AIR code signing About AIR publisher identifiers About Certificate formats Time stamps Obtaining a certificate Example: Getting an AIR Developer Certificate from Thawte Changing certificates Terminology iOS Certificates Generating a certificate signing request Converting a developer certificate into a P12 keystore file: If you sign an application with a self-signed certificate (or a certificate that does not chain to a trusted certificate), the user must accept a greater security risk by installing your application. The installation dialogs reflect this additional risk:. To determine the original publisher ID, find the publisherid file in the META-INF/AIR subdirectory where the original application is installed. The string within this file is the publisher ID. Your application descriptor must specify the AIR 1.5.3 runtime (or later) in the namespace declaration of the application descriptor file in order to specify the publisher ID manually. The publisher ID, when present, is used for the following purposes: As part of the encryption key for the encrypted local store As part of the path for the application storage directory As part of the connection string for local connections As part of the identity string used to invoke an application with the AIR in-browser API As part of the OSID (used when creating custom install/uninstall programs) When a publisher ID changes, the behavior of any AIR features relying on the ID also changes. For example, data in the existing encrypted local store can no longer be accessed and any Flash or AIR instances that create a local connection to the application must use the new ID in the connection string. The publisher ID for an installed application cannot change in AIR 1.5.3 or later. If you use a different publisher ID when publishing an AIR package, the installer treats the new package as a different application rather than as an update. AIR Developer Tool (ADT). You can also export and sign AIR files using Flash, Flash Builder, Flash Professional,. To apply a migration signature use the ADT migrate command, as described in Signing an updated version of an AIR application. or later, the application identity cannot change. The original application and publisher IDs must be specified in the application descriptor of the update AIR file. Otherwise, the new package is not recognized as an update.. The code signing certificates issued by Apple are used for signing iOS applications, including those developed with Adobe AIR. Applying a signature using a Apple development certificate is required to install an application on test devices. Applying a signature using a distribution certificate is required to distribute the finished application. To sign an application, ADT requires access to both the code file, itself, does not include the private key. You must create a keystore in the form of a Personal Information Exchange file (.p12 or .pfx) that contains both the certificate and the private key. See Converting a developer certificate into a P12 keystore file. To obtain a developer certificate, you generate a certificate Portal. The certificate signing request process generates a public-private key pair. The private key remains on your computer. You send the to Apple, who is acting in the role of a Certificate Authority. Apple signs your certificate with their own World Wide Developer Relations certificate. On Mac OS, you can use the Keychain Access application to generate a code signing request. The Keychain Access application is in the Utilities subdirectory of the Applications directory. Instructions for generating the certificate signing request are available at the Apple iOS Provisioning Portal.. Upload the CSR file to Apple at the iPhone developer site. (See “Apply for an iPhone developer certificate and create a provisioning profile”.) To create a P12 keystore, you must combine your Apple developer certificate and the associated private key in a single file. The process for creating the keystore file depends on the method that you used to generate the original certificate signing request and where the private key is stored. Once you have downloaded the Apple iPhone certificate from Apple, Development Certificate. The private key is identified by the iPhone Developer: <First Name> <Last Name>. To develop AIR for iOS applications, you must use a P12 certificate file. You generate this certificate based on the Apple iPhone developer certificate file you receive from Apple. Convert the developer certificate file you receive from Apple into a PEM certificate file. Run the following command-line statement from the OpenSSL bin directory: openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM If you are using the private key from the keychain on a Mac computer, convert it into a PEM key: openssl pkcs12 -nocerts -in mykey.p12 -out mykey.pem You can now generate a valid P12 file, based on the key and the PEM version of the iPhone developer certificate: openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out iphone_dev.p12 If you are using a key from the Mac OS keychain, use the PEM version you generated in the previous step. Otherwise, use the OpenSSL key you generated earlier (on Windows). Twitter™ and Facebook posts are not covered under the terms of Creative Commons.
http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff0.html
CC-MAIN-2014-52
en
refinedweb
Hi. I started programming a couple of weeks ago. I'm going through that C++ Without Fear book recommended on this site. I'm on page 107. Basically, I made this program that calculates factorials (with some help from the answers on the CD I admit). It's below. In the get_factorials function, I've added in a second variable, int b, so that I can set this after I have printed out "Factorials = ". If I don't do this, get_factorials runs itself and outputs stuff prematurely (yeah I know I should probably have given b different names in main and get_factorials). Is there a way of coding it so that it waits until you actually want it to run, without wasting code like int b etc.? Thanks. Code: #include <iostream> #include <math.h> using namespace std; // int b is only necessary below to stop it acting prematurely int get_factorials(int n, int b); int main() { int n, b; while(1) { cout << "Enter a number (0 to exit) and press ENTER: "; cin >> n; if (n == 0) break; cout << "Factorial(" << n << ") = "; b = 20; // This is just to stop the get factorials function running // and putting all the "n *" stuff out early. cout << get_factorials(n, b); cout << endl; } return 0; } int get_factorials(int n, int b) { if (n > 0) { cout << n; if (n > 1) cout << "*"; else cout << " = "; return n * get_factorials(n-1, b); } else return 1; }
http://cboard.cprogramming.com/cplusplus-programming/94045-making-functions-execute-certain-times-printable-thread.html
CC-MAIN-2014-52
en
refinedweb
Difference between revisions of "FAQ How do I access the active project?" Latest revision as of 09:29, 22 October 2013EditorInput(); if (!(input instanceof IFileEditorInput)) return null; return ((IFileEditorInput)input).getFile(); } The code above has a minor error: IEditorInput input = editor.getEditorInput(); To obtain the project from the resource use IResource.getProject(). Beware that while Eclipse uses "selected" rather than "active" for the active project, it uses "active" rather than "selected" for the active editor. Or is that "selected editor" ;-). For example, IWorkbench iworkbench = PlatformUI.getWorkbench(); if (iworkbench == null)... IWorkbenchWindow iworkbenchwindow = iworkbench.getActiveWorkbenchWindow(); if (iworkbenchwindow == null) ... IWorkbenchPage iworkbenchpage = iworkbenchwindow.getActivePage(); if (iworkbenchpage == null) ... IEditorPart ieditorpart = iworkbenchpage.getActiveEditor(); See Also: This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.
http://wiki.eclipse.org/index.php?title=FAQ_How_do_I_access_the_active_project%3F&diff=349680&oldid=12406
CC-MAIN-2014-52
en
refinedweb
Thanks alot for the response but what I guess I don't get is why does explicit casting exist for objects? Since upcasting is implicit, it doesn't require a cast in the () format as my first example. This compiles just fine: public class BaseTest2{ public static void main(String [] args){ BaseTest2 base = new BaseTest2(); Sub2 sub = new Sub2(); base = sub; } } class Sub2 extends BaseTest2{} What situations wouldn't throw a runtime exception, or is it simply there because it is required for primitives and the exception just lets you know that "hey, downcasting is never leagal under any circumstances???" originaly posted by Sabarish It is not that downcasting is always illegal at runtime. In some cases u may use a superclass reference to hold an object of the subclass. In that case, u can get that object back into a subclass reference by using the downcast. I have modified ur program to demonstrate this... code: -------------------------------------------------------------------------------- public class BaseTest2 { public static void main(String [] args) { //Below line is modified to hold subclass object BaseTest2 base = new Sub2(); //The following should now be valid at runtime too Sub2 sub = (Sub2)base; }} class Sub2 extends BaseTest2 {} -------------------------------------------------------------------------------- Such a downcast is to instruct the compiler that u know what ur doing, that is u know that ur casting the object reference into a more specialized type. In some cases this may be desirable. For ex suppose Sub2 has a method m2() which is not in BaseTest2. In that case u can't invoke that method using the reference base even though base points to a valid Sub2 type object and has the m2() method. U will have to cast the reference to a Sub2 type reference to make the program compile and invoke m2(). That should be the reason why ClassCastException is a RuntimeException. Only the programmer can predict whether the cast will work or throw an exception ! Originally posted by Barkat Mardhani: Hi Ron: Your example is talking about classcast exception when you cast one derived class to another derived class. Whereas, Alan is talking about casting a super class object to a derived class.... public class BaseTest2 { public static void main(String [] args) { BaseTest2 base = new BaseTest2(); Sub sub = (Sub)base; } } class Sub2 extends BaseTest2 { } Compiles fine, but throws a ClassCastException. Now, I understand why the cast is required for compiling, but why is there an exception? Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. Kinght." Originally posted by Alan Phillips: How can I access the methods in a superclass from a subclass which overides the method. Originally posted by Alan Phillips: working through it really helped me understand that a superclass can be a subclass or a superclass, a subclass can ONLY be a subclass. This is why Ron and I are getting the feeling that you're still a bit off. The runtime type of an object never changes: once it's instantiated, it will remain the same type no matter what kind of casting you do. Casting merely allows you to reference an object in a more general (upcasting) or specific (downcasting) manner. Casting does not change the type of an object Casting simply allows you to assign the value of one reference variable to another. As an added precaution, the Java Runtime checks if the reference type is compatible with the actual object type; if it isn't a ClassCastException is thrown. 2. The runtime type of the actual object that obj references is determined by the argument to new, which in line 2 is SubClass, and in line 4 is SuperClass.
http://www.coderanch.com/t/239272/java-programmer-SCJP/certification/Dan-exam-ClassCastException
CC-MAIN-2014-52
en
refinedweb
jGuru Forums Posted By: Andre_TheMunchkin Posted On: Tuesday, June 19, 2001 12:21 PM Solution (well...): use URLConnection and turn caching off Solution problem: urlconection.getContent() returns an object that needs be deciphered (it's a gif). i'd rather not write the gif handler code so....??? What doesn't work: the existing content handler provided by sun does work in some browsers (linux netscape, ie5 win98), but generates security exceptions in others (classloader can't find the content/image/gif class, it seems). import sun.net.; ... // open urlconnection to image file ... gif gi = new gif(); smImg = createImage((java.awt.image.ImageProducer)gi.getContent(urlconnection)); I've contemplated trying to find, decompile, and reverse engineer some gif.class code, but that sounds like about as much of a hassle as translating some C language gif decoder routines. anDY Re: preventing caching with urlconnection and sun.net. Posted By: Finlay_McWalter Posted On: Wednesday, June 20, 2001 10:04 PM
http://www.jguru.com/forums/view.jsp?EID=441584
CC-MAIN-2014-52
en
refinedweb
I'm afraid that by using longs to keep track of time for each individual output I will quickly run out of memory. static unsigned short Previous;const unsigned short Rate = 1313;void loop( void ){ unsigned short Current; Current = millis(); if ( Current - Previous >= Rate ) // If necessary, use type casting here to ensure everything is unsigned short. { // Do your thing Previous += Rate; }} int freeRam () { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); }
http://forum.arduino.cc/index.php?topic=158759.msg1188771
CC-MAIN-2014-52
en
refinedweb
On Wed, 18 Mar 2009 20:08:49 +0200 Boaz Harrosh <bharrosh@panasas.com> wrote:> implementation of directory and inode operations.> > * A directory is treated as a file, and essentially contains a list> of <file name, inode #> pairs for files that are found in that> directory. The object IDs correspond to the files' inode numbers> and are allocated using a 64bit incrementing global counter.> * Each file's control block (AKA on-disk inode) is stored in its> object's attributes. This applies to both regular files and other> types (directories, device files, symlinks, etc.).> >> ...>> +static inline unsigned long dir_pages(struct inode *inode)> +{> + return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;> +}Do we need i_size_read() here? Probably not if it's always calledunder i_mutex. Needs checking and commenting please.> +static unsigned exofs_last_byte(struct inode *inode, unsigned long page_nr)> +{> + unsigned last_byte = inode->i_size;> +> + last_byte -= page_nr << PAGE_CACHE_SHIFT;hm. Strange to left-shift an unsigned long and then copy it to asmaller type.Are the types here appropriately chosen?> + if (last_byte > PAGE_CACHE_SIZE)> + last_byte = PAGE_CACHE_SIZE;> + return last_byte;> +}> +> +static int exofs_commit_chunk(struct page *page, loff_t pos, unsigned len)>> ...>This all looks vaguely familiar :)
http://lkml.org/lkml/2009/3/31/90
CC-MAIN-2014-52
en
refinedweb
/* Kernel Object Display facility for Cisco Copyright 1999, 2000 Free Software Foundation, Inc. Written by Tom Tromey <tromey@cygnus_string.h" #include "kod.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif /* Define this to turn off communication with target. */ /* #define FAKE_PACKET */ /* Size of buffer used for remote communication. */ #define PBUFSIZ 400 /* Pointers to gdb callbacks. */ static void (*gdb_kod_display) (char *); static void (*gdb_kod_query) (char *, char *, int *); /* Initialize and return library name and version. The gdb side of KOD, kod.c, passes us two functions: one for displaying output (presumably to the user) and the other for querying the target. */ char * cisco_kod_open (kod_display_callback_ftype *display_func, kod_query_callback_ftype *query_func) { char buffer[PBUFSIZ]; int bufsiz = PBUFSIZ; int i, count; gdb_kod_display = display_func; gdb_kod_query = query_func; /* Get the OS info, and check the version field. This is the stub version, which we use to see whether we will understand what comes back. This is lame, but the `qKoL' request doesn't actually provide enough configurability. Right now the only defined version number is `0.0.0'. This stub supports qKoI and the `a' (any) object requests qKaL and qKaI. Each `a' object is returned as a 4-byte integer ID. An info request on an object returns a pair of 4-byte integers; the first is the object pointer and the second is the thread ID. */ #ifndef FAKE_PACKET (*gdb_kod_query) ("oI;", buffer, &bufsiz); #else strcpy (buffer, "Cisco IOS/Classic/13.4 0.0.0"); #endif count = 2; for (i = 0; count && buffer[i] != '\0'; ++i) { if (buffer[i] == ' ') --count; } if (buffer[i] == '\0') error (_("Remote returned malformed packet.")); if (strcmp (&buffer[i], "0.0.0")) error (_("Remote returned unknown stub version: %s."), &buffer[i]); /* Return name, version, and description. I hope we have enough space. */ return (xstrdup ("gdbkodcisco v0.0.0 - Cisco Kernel Object Display")); } /* Close the connection. */ void cisco_kod_close (void) { } /* Print a "bad packet" message. */ static void bad_packet (void) { (*gdb_kod_display) ("Remote target returned malformed packet.\n"); } /* Print information about currently known kernel objects. We currently ignore the argument. There is only one mode of querying the Cisco kernel: we ask for a dump of everything, and it returns it. */ void cisco_kod_request (char *arg, int from_tty) { char buffer[PBUFSIZ], command[PBUFSIZ]; int done = 0, i; int fail = 0; char **sync_ids = NULL; int sync_len = 0; int sync_next = 0; char *prev_id = NULL; if (! arg || strcmp (arg, "any")) { /* "Top-level" command. This is really silly, but it also seems to be how KOD is defined. */ /* Even sillier is the fact that this first line must start with the word "List". See kod.tcl. */ (*gdb_kod_display) ("List of Cisco Kernel Objects\n"); (*gdb_kod_display) ("Object\tDescription\n"); (*gdb_kod_display) ("any\tAny and all objects\n"); return; } while (! done) { int off = 0; /* Where we are in the string. */ long count; /* Number of objects in this packet. */ int bufsiz = PBUFSIZ; char *s_end; strcpy (command, "aL"); if (prev_id) { strcat (command, ","); strcat (command, prev_id); } strcat (command, ";"); #ifndef FAKE_PACKET /* We talk to the target by calling through the query function passed to us when we were initialized. */ (*gdb_kod_query) (command, buffer, &bufsiz); #else /* Fake up a multi-part packet. */ if (! strncmp (&command[3], "a500005a", 8)) strcpy (buffer, "KAL,01,1,f500005f;f500005f;"); else strcpy (buffer, "KAL,02,0,a500005a;a500005a;de02869f;"); #endif /* Empty response is an error. */ if (strlen (buffer) == 0) { (*gdb_kod_display) ("Remote target did not recognize kernel object query command.\n"); fail = 1; break; } /* If we don't get a `K' response then the buffer holds the target's error message. */ if (buffer[0] != 'K') { (*gdb_kod_display) (buffer); fail = 1; break; } /* Make sure we get the response we expect. */ if (strncmp (buffer, "KAL,", 4)) { bad_packet (); fail = 1; break; } off += 4; /* Parse out the count. We expect to convert exactly two characters followed by a comma. */ count = strtol (&buffer[off], &s_end, 16); if (s_end - &buffer[off] != 2 || buffer[off + 2] != ',') { bad_packet (); fail = 1; break; } off += 3; /* Parse out the `done' flag. */ if ((buffer[off] != '0' && buffer[off] != '1') || buffer[off + 1] != ',') { bad_packet (); fail = 1; break; } done = buffer[off] == '1'; off += 2; /* Id of the last item; we might this to construct the next request. */ prev_id = &buffer[off]; if (strlen (prev_id) < 8 || buffer[off + 8] != ';') { bad_packet (); fail = 1; break; } buffer[off + 8] = '\0'; off += 9; sync_len += count; sync_ids = (char **) xrealloc (sync_ids, sync_len * sizeof (char *)); for (i = 0; i < count; ++i) { if (strlen (&buffer[off]) < 8 || buffer[off + 8] != ';') { bad_packet (); fail = 1; break; } buffer[off + 8] = '\0'; sync_ids[sync_next++] = xstrdup (&buffer[off]); off += 9; } if (buffer[off] != '\0') { bad_packet (); fail = 1; break; } } /* We've collected all the sync object IDs. Now query to get the specific information, and arrange to print this info. */ if (! fail) { (*gdb_kod_display) ("Object ID\tObject Pointer\tThread ID\n"); for (i = 0; i < sync_next; ++i) { int off = 0; int bufsiz = PBUFSIZ; /* For now assume a query can be accomplished in a single transaction. This is implied in the protocol document. See comments above, and the KOD protocol document, to understand the parsing of the return value. */ strcpy (command, "aI,"); strcat (command, sync_ids[i]); strcat (command, ";"); #ifndef FAKE_PACKET (*gdb_kod_query) (command, buffer, &bufsiz); #else strcpy (buffer, "KAI,"); strcat (buffer, sync_ids[i]); strcat (buffer, ",ffef00a0,cd00123d;"); #endif if (strlen (buffer) == 0) { (*gdb_kod_display) ("Remote target did not recognize KOD command.\n"); break; } if (strncmp (buffer, "KAI,", 4)) { bad_packet (); break; } off += 4; if (strncmp (&buffer[off], sync_ids[i], 8) || buffer[off + 8] != ',') { bad_packet (); break; } off += 9; /* Extract thread id and sync object pointer. */ if (strlen (&buffer[off]) != 2 * 8 + 2 || buffer[off + 8] != ',' || buffer[off + 17] != ';') { bad_packet (); break; } buffer[off + 8] = '\0'; buffer[off + 17] = '\0'; /* Display the result. */ (*gdb_kod_display) (sync_ids[i]); (*gdb_kod_display) ("\t"); (*gdb_kod_display) (&buffer[off]); (*gdb_kod_display) ("\t"); (*gdb_kod_display) (&buffer[off + 9]); (*gdb_kod_display) ("\n"); } } /* Free memory. */ for (i = 0; i < sync_next; ++i) xfree (sync_ids[i]); xfree (sync_ids); }
http://opensource.apple.com/source/gdb/gdb-1344/src/gdb/kod-cisco.c
CC-MAIN-2014-52
en
refinedweb
- Fund Type: Investment Trust - Objective: Value Small Cap - Asset Class: Equity - Geographic Focus: U.K. Aberforth Smaller Companies Trust PLC+ Add to Watchlist ASL:IX1,030.0000 GBp 5.0000 0.48% As of 11:30:00 ET on 12/17/2014. Snapshot for Aberforth Smaller Companies Trust PLC (ASL) ETF Chart for ASL - ASL:IX 1,030.0000 1,035.0000 … Previous Close - 1D - 1W - 1M - YTD - 1Y - 3Y - 5Y Open: High: Low:Volume: Recently Viewed Symbols Save as Watchlist Saving as watchlist... Fund Profile & Information for ASL Aberforth Smaller Companies Trust plc is an investment trust incorporated in the United Kingdom. The aim of the Fund is to achieve a net asset value total return (with dividends reinvested) greater than its benchmark, the Hoare Govett Smaller Companies Index (Excluding Investment Companies), over the long term. The Fund invests in a diversified portfolio of small UK quoted companies. Fundamentals for ASL Dividends for ASL Performance for ASL Top Fund Holdings for ASLFiling Date: 10/31/2014 Quotes delayed, except where indicated otherwise. Mutual fund NAVs include dividends. All prices in local currency. Time is ET. Sponsored Link Recommended Symbols: Advertisement - 1 - 2 - 3 - 4 - 5 Related News Advertisement Sponsored Links Advertisements
http://www.bloomberg.com/quote/ASL:IX
CC-MAIN-2014-52
en
refinedweb
21 January 2010 07:51 [Source: ICIS news] By Nurluqman Suratman SINGAPORE (ICIS news)--Prices of petrochemical products in Asia may start to feel some pressure as China – a major importer in the region – appeared to have accelerated its credit tightening measures, analysts and market sources said on Thursday. Still, demand was expected to hold up, in line with the recovery of the global economy and prevent prices from crashing, they said. Based on media reports, Chinese banks have been ordered to stop new lending for the rest of January, as their loan portfolio ballooned in just the first few weeks of the new year. This followed a series of interest rate hikes on the three- and one-year bills of the People’s Bank of China (PoBC), as well as an increase in the share of deposits that banks must place with the central bank. “The last time ?xml:namespace> In that year, With the country likely importing less of the polymer because of the credit curbs, there would be more supply for the rest of Asia, which could pull prices down from current high levels, said a Mumbai-based PE trader. “Domestic prices in Some regional players in the polyethylene (PE) and polypropylene (PP) markets have held back purchases, anticipating prices to slide following Other petrochemical players expect the market impact to be short-lived. “Traders and buyers will adopt a cautious stance and trades may slow down initially, but it will be limited as the overall demand is still very good,” said a source at a southeast Asian synthetic rubber producer. Petrochemical product values in Asia have enjoyed a good rally since the start of the year given some recovery in demand, which is being led by Government efforts to prevent a hard landing for But this had led to some excesses in new lending, which nearly doubled to yuan (CNY) 9,590bn ($1,400bn) – a record high, central bank data showed. The credit boom prompted petrochemical product traders to engage in more speculative activities, which were most likely to be curtailed now that “If liquidity is reduced in “One way to look at it is that The Chinese economy logged in a strong 10.7% year-on-year growth in the fourth quarter, with average inflation at 1.9%, based on official data. If the rapid growth in lending was not restrained, this could lead to higher asset and commodity prices and cause the Chinese economy to overheat, analysts said. Most analysts expect China, Asia’s biggest emerging economy, to return to its double-digit expansion in 2010 after a two-year lag. “The Chinese government don’t want to see inflation. They don’t want to see a slowdown (in economy) so they are very cautious,” said Yan Kefeng, a consultant at Cambridge Energy Research Associates (CERA). With additional reporting by Prema Viswanathan, John Richardson, Felicia Loo and Helen Yan To discuss issues facing the chemical industry go to ICIS connect
http://www.icis.com/Articles/2010/01/21/9327597/mild-pressure-on-asia-petchems-as-china-steps-up-credit-squeeze.html
CC-MAIN-2014-52
en
refinedweb
06 September 2012 18:26 [Source: ICIS news] HOUSTON (ICIS)--Producers of specialty fracking chemicals will continue to see good growth prospects in ?xml:namespace> Nexant - which is working on an in-depth study of the market for fracking (hydraulic fracturing) chemicals - estimates that producers should see compound growth rates of about 10% over the next five to six years as gas firms expand shale gas output in However, at the same time the market for fracking chemicals will change as legislators and regulators mandate new rules on the composition and use of those chemicals, Nexant said. Fracking chemicals have been linked to contamination of drinking water supplies. Nexant expects to complete its study in the first quarter of 2013. In related news on Thursday, an expert
http://www.icis.com/Articles/2012/09/06/9593471/outlook-for-fracking-chemicals-good-nexant.html
CC-MAIN-2014-52
en
refinedweb
"). After that $primitive remains the same, but it is now bless()ed as object that exposes corresponding perltie methods, so that the following, for example, become interchangeable for both tied() and not tied() %$primitive: $primitive->{foo}; $primitive->FETCH('foo'); # same $primitive->fetch('foo'); # same Also, in case of tie()d primitive instead of: tied(%$primitive)->method(); just be tied()less: $primitive->method(); In case non-tied() primitives need to be interchangeable with tied() ones that have extended tied() interface, instead of cumbersome (possibly repeating many times) extended interface available through tied() object. For example, application cache may be allowed to optionally use either screamingly fast plain hash or some highly evolved persistent hashes tie()d to disk storage (like DB_File, etc.). There are many similar examples for filehandles, arrays and even scalars. Those are cases when Object::Hybrid combined with simple coding style can make code that handles those primitives compatible across whole spectrum, from plain primitives to all types of extended tied() primitives. There are also other uses, including working around gaps in tiehandle implementation, adding some fancy operations to primitives without using tie() as well as plain syntactic sugar. In the context of this module hybrid object is defined as a Perl object that represents its own bless()ed primitive (i.e. the primitive it is implemented with, currently hash, scalar, array, or filehandle). According to this definition, hybrid object can be seen as both primitive and object at the same time. In general case, it is a violation of object encapsulation to access object's underlying bless()ed primitive directly (at least outside of class's methods), but in special case of hybrid objects it is perfectly ok to do so - no violation of encapsulation takes place. Hybrid objects are instances of the class that is referred to as "hybrid class". This module implements default hybrid classes and exports promote() function that bless()es Perl's primitives (hash, scalar, array, or filehandle) into either default or user-specified (custom) hybrid classes to make them hybrid objects. Promoting primitive to become hybrid (i.e. bless()ing it into hybrid class) simply adds object interface to primitive and is a way to extend Perl primitives that is compatible with and complementary to another major way of extending primitives - perltie API. extended tie()d primitives as it unifies their interfaces and make them interchangeable. For example, if same code is required to accept and handle both plain hashes, i.e. fast, in-memory hashes, and tie()d hashes with extended perltie interface, e.g. slow persistent hashes tie()d to disk storage, then it is useful to promote() each of those hashes to become hybrid. Whenever plain access is required the following code: $hybrid->{foo}; will work for both in-memory and persistent hashes, and is really fast in case of in-memory hash. And in case you need to use extended interface, something like next code will also work for promote()d both in-memory and persistent hashes: $hybrid->FETCH('foo', @args); $hybrid->can('custom_method') and $hybrid->custom_method(); For performance comparison of various interface options see "Performance" section. Despite promoting primitives to become hybrids turn them into Perl objects, compatibility with arbitrary Perl objects in practice has little value, since code that manipulates objects usually assume objects to be of very specific class. Accessing tied() interface of tie()d primitive no longer requires cumbersome (possibly conditional) tied() call, i.e. instead of: tied(%$hybrid)->method(); one can write: $hybrid->method(); # same : stat $FH->self; -X $FH->self; Custom hybrid classes can be used for overloading operators on primitives. However, unfortunately such hybrid classes currently can only be used to promote() non-tied() primitives (see "Operator overloading"). Object::Hybrid is a lightweight pure Perl module with no dependencies beyond core. Usually, there is no need to read any of the following documentation to use Object::Hybrid - you can stop reading at this point. What you have read so far, or even just self-explanatory SYNOPSIS, is enough in most cases. The following documentation covers optional features that need not to be learned for using Object::Hybrid in most usual case (e.g. occasionally). use Object::Hybrid use Object::Hybrid; # exports nothing use Object::Hybrid $feature; # enables single named feature use Object::Hybrid \@feature; # enables array of named features use Object::Hybrid \%options; # most general form use Object::Hybrid %options; # most general form The following features are supported: use Object::Hybrid 'promote'; use Object::Hybrid feature => 'promote'; # same use Object::Hybrid feature => ['promote']; # same use Object::Hybrid export => 'promote'; # same use Object::Hybrid export => ['promote']; # same which exports (i.e. declares for use) the promote() function into caller's namespace. Next features depend on autobox pragma being installed (can be installed from CPAN archive): use Object::Hybrid 'autobox'; use Object::Hybrid feature => 'autobox'; # same use Object::Hybrid feature => ['autobox']; # same use Object::Hybrid autobox => Object::Hybrid->CLASS; # same, but can be custom hybrid class which will automatically promote() any primitive within the current scope, and "unpromote" them back beyond that scope. It is is equivalent to: use Object::Hybrid; use autobox HASH => Object::Hybrid-); $hybrid = new Object::Hybrid $primitive; # bless() to make $primitive a hybrid $hybrid = new Object::Hybrid $primitive => \%args; # same, but with named arguments $hybrid = new Object::Hybrid $primitive => %args; # same $hybrid = new Object::Hybrid $primitive => $class; # same, but with explicit $class to tie() to or bless() into $hybrid = new Object::Hybrid $primitive => $class, \%args; # same, but with named arguments $hybrid = new Object::Hybrid $primitive => $class, %args; # same Or corresponding direct method call notation for any of the above can be used, for example: $hybrid = Object::Hybrid->new($primitive); # etc. The new() constructor promote()s $primitive to hybrid and returns it. It is roughly equivalent to: sub new { shift; return promote(@_) } Refer to promote() documentation. Note that new() do not construct object of Object::Hybrid class, even not $hybrid->isa('Object::Hybrid'), so beware. $tied = Object::Hybrid->tie( $primitive, $tieclass, @args); # for %$primitive same as... $tied = tie(%$primitive, $tieclass, @args); # ... except $primitive also gets promote()d These are utility methods useful to sort things out. Generally, all ref_foo() (ref_*()) methods return boolean that tells whether its argument is reference or not, but exact boolean value depends of the value of 'foo' suffix: Object::Hybrid->ref_type({}) eq 'HASH'; # true Object::Hybrid->ref_type(bless {}, 'Foo') eq 'HASH'; # true and so on... $obj = bless {}, 'Foo'; Object::Hybrid->ref_isa($obj); # true Object::Hybrid->ref_isa($obj) eq $obj; # true Object::Hybrid->ref_isa($obj, 'Foo') eq $obj; # true Object::Hybrid->ref_isa($obj, 'Bar'); # false Object::Hybrid->ref_isa({}); # false and so on... This method is useful to try some unknown $thing at hands that it is too uncertain to call $thing->isa('Foo') on it. It returns true, more specifically passes through its argument (for use in expressions and chained calls) if reference is blessed and, if second argument defined, isa() of second argument type (exact type can be obtained with ref(ref_isa($var)) instead). Otherwise returns false. More specifically, returns 0 for blessed references, '' for non-blessed references and undef for non-references. $tied = tie %$primitive, 'Foo'; Object::Hybrid->ref_tied($primitive) eq $tied; # true Object::Hybrid->ref_tied({}) eq '0'; # true Object::Hybrid->ref_tied(sub{}) eq ''; # true, since sub{} is not tie()able Object::Hybrid->ref_tied('string') eq ''; # true, since 'string' is not tie()able and so on. Hybrid objects are out of the box compatible with any valid tieclass. However, to support workarounds for "gaps" in perltie implementation, tieclasses may need to meet additional requirements - those are some of requirements that hybrid classes already comply with, intended specifically to work around perltie implementation gaps, namely: "Complete perltie API" and "self() method". Currently tie()ing filehandles is still incomplete in Perl, so these requirements mainly apply to tiehandle classes. The most simple tiehandle classes, like Tie::StdHandle (loaded by "use Tie::Handle"), already comply with this requirements, as for them default self() and other methods provided by default hybrid class are good enough. A bit more complex tiehandle classes need just to implement self() method. If defining self() is not possible in case of more complex tiehandle classes, additional SYSOPEN(), TRUNCATE(), FLOCK(), FCNTL(), STAT() and FTEST() methods may need to be implemented as workarounds by tiehandle class. Since tie() do not pass primitive to be tie()d to TIE*() constructor, TIE*() cannot be made to optionally promote() that primitive. Instead, tieclass can expose promote() as one of its methods allowing user to promote primitives or expose Object::Hybrid->tie() method analog for built-in tie() that both tie()s and promote() given primitive. This, however, should probably not be dove via subclassing. Custom hybrid classes can be used for overloading operators on promote()d primitives. However, unfortunately hybrid classes with overloaded operators currently can only be used to promote() non-tied() primitives. This is because currently overload pragma is broken - bless()ing tie()d primitive into such class will implicitly untie() it. Should this be fixed in the future, operator overloading can be used without this limitation. However, even used on non-tied() primitives operator overloading is very powerful and can have some interesting (and possibly even useful) applications. In particular, overloading of dereference operators allows to achieve effects somewhat similar to using tie(), like "back-door" state similar to that of tied() objects. It is even possible to have "hybrid primitive" that is simultaneously hash, scalar, array, subroutine and glob (however such hybrid class may violate equivalence requirement as FETCH(0) need to be equivalent to $hybrid->{0} and $hybrid->[0] at the same time).. Currently tests cover only tiehashes and tiehandles, there should be tests for other types as well. As soon as (and if) Object::Hybrid interface stabilizes enough, its version is to jump to 1.0. The use autobox pragma is another way of doing somewhat similar, but not the same things, so autobox and Object::Hybrid are not mutually substitutive. However, if autobox pragma is installed, then either "autobox" or "autopromote" feature can be enabled - see "use Object::Hybrid". hybrid. Object::Hybrid, or Object::Hybrid::croak("tied() class defines nor valid self() method for $_[0] (self() returned $self)");
http://search.cpan.org/~metadoo/Object-Hybrid-0.07/lib/Object/Hybrid.pm
CC-MAIN-2014-52
en
refinedweb
Using XML in Visual Basic 2005: Chapter 12 of Professional VB 2005 This chapter introduces the five XML namespaces in the .NET Framework and demonstrates how to generate and manipulate XML in VB 2005. Continue Reading This Article Enjoy this article as well as all of our content, including E-Guides, news, tips and more. By submitting you agree to receive email communications from TechTarget and its partners. Privacy Policy Terms of Use. For newcomers to Visual Basic 2005, the enhanced language can seem daunting. But books such as Professional VB 2005 can help you learn the language and all the new features included in it. This title covers Visual Basic virtually from start to finish. It starts by looking at the .NET Framework and ends by looking at best practices for deploying .NET applications. Chapter 12, Using XML in Visual Basic 2005, discusses the five XML-specific namespaces exposed in the .NET Framework -- System.XML, System.XML.Serialization, System.XML.Schema, System.XML.XPath and System.XML.XSL. From there, the authors cover the objects and classes within those namespaces and offer an overview of how XML is used in other Microsoft technologies, primarily SQL Server and ADO.NET Read the rest of the excerpt in this PDF. MORE: Click here to read Chapter 13 of this book, Security in the .NET Framework 2.0, courtesy of SearchAppSecurity.com. Excerpted from the Wrox Press book, Professional VB 2005 (ISBN 0-7645-7536-8) by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Rama Ramachandran, Kent Sharkey and Bill Sheldon. Copyright © 2005. Published by John Wiley & Sons Inc.. Reprinted with permission.
http://searchwindevelopment.techtarget.com/tip/Using-XML-in-Visual-Basic-2005-Chapter-12-of-Professional-VB-2005
CC-MAIN-2014-52
en
refinedweb
Troubleshoot content deployment Updated: April 28, 2009 Applies To: Office SharePoint Server 2007 Topic Last Modified: 2009-05-26 This article provides troubleshooting steps for common issues that you might encounter during content deployment in Microsoft Office SharePoint Server 2007. In this article: Ensure that the SharePoint update level on the source and destination farms is identical Ensure that all required language packs are available on the destination site collection The .cab file size exceeds the configured maximum content length configured in IIS 7 Insufficient disk space on the source server Duplicate column names defined in a root site and subsite Conflicting content on source and destination The maximum upload size on the destination Web application is smaller than the files being deployed A document in a source library is marked as virus-infected SQL Server deadlocks during Stsadm import operations Timeouts during content deployment Error: The changeToken refers to a time before the start of the current change log Symptom A content deployment job between servers with different update levels may fail if hotfix releases have changed the schema of the export packages so that the source server has a higher update level than the destination server. This applies both to content deployment jobs run using the Central Administration Web site, as well as using the Stsadm export and import operations. Cause Content deployment is only supported if the Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 update levels are identical on both the source and destination servers, or if the update level on the destination server is higher than the update level on the source server. Resolution Ensure that all servers in the farms have had all the current Office SharePoint Server 2007 and Windows SharePoint Services 3.0 hotfixes installed. Symptom A content deployment job will fail if a required language pack is missing from the destination site collection. Cause Language packs used in the source site collection must also be installed on the destination site collection. Resolution Install the required language packs on the destination site collection, and rerun the content deployment job. Symptom The content deployment job will fail as soon as it tries to upload a .cab file that exceeds 29 MB. The following entries will be shown in the application event log of the export (source) entries similar to the following in the Unified Logging Service (ULS) log on the export verify that the problem is the upload size of the .cab file, you must check the IIS log on the import (destination) server to see if the response is a 404.13 error similar to the following: Cause Content deployment first exports all content to the file system as XML and binary files, and then packages these files into .cab files. These files are then uploaded by using HttpPost to the destination server, where they are extracted and imported. The preconfigured maximum size of the .cab files generated by the content deployment process is 10 MB; however, IIS 7 has a preconfigured upload limit of 29 MB. Office SharePoint Server 2007 does not split single exported files into multiple .cab files. Therefore, if a Office SharePoint Server 2007 site contains single documents that cannot be compressed to less than 10 MB, and the resulting .cab file size exceeds the IIS 7 default upload limit of 29 MB, the content deployment job will fail. For more information, see KB article 925083, Error message when you try to upload a large file to a document library on a Windows SharePoint Services 3.0 site: "Request timed out" (). Resolution Modify the web.config file of the Central Administration Web site, and add an entry similar to the following: The maxAllowedContentLength property is a number, expressed in bytes, that represents the maximum size of the .cab file to be uploaded to the server. In this example, 52428800 equals 50 MB. You should adjust this value to the specific needs of your deployment environment. When you are finished, rerun the content deployment job. Symptom When using the Stsadm export operation or when a content deployment job fails during the export phase, the following error message will be returned in the command window or in the event log: "Failed to create package file. Unknown compression type in a cabinet folder." Cause This problem is almost always caused by insufficient disk space on the source server. Resolution Monitor the disk space during the export and compression phase, and ensure that sufficient disk space is available on the source server to perform this operation. Symptom The content deployment import process cannot handle duplicate column names between site collections and sites. This will result in an error message similar to the following:() Cause If you create a new column named "MyCustomColumn" in a subsite of a site collection, and then you create a column with the same name in the root site of the site collection, when you return to the subsite, there will now be two columns listed with the same name. Such a configuration will cause content deployment jobs to fail. Resolution Ensure that column names are unique. If necessary, delete the duplicate column, and then recreate it with a new name in either the subsite or the root site. When you are finished, rerun the content deployment job. Symptom In the event that an item on the destination server has the same URL but a different GUID as an item that is being imported, the content deployment job will fail, and the Content Deployment Report will return an error similar to the following: The Web site address "/A" is already in use." or "The specified name is already in use. A document cannot have the same name as another document or folder in this document library or folder. Cause Items in the content deployment job that are scheduled for import should either not exist on the destination server, or should be older versions of the items that are currently being deployed. If the content deployment job finds an item with the same URL as an item being imported, it checks the GUID of the item to verify that it is the same item as the one being imported. If the GUID is the same, import will create a new version, provided versioning has been enabled on the destination server, or it will replace the item on the destination site. If the GUID is different, it returns an error message, and the content deployment job will fail. Resolution Ensure that no content is added to the destination server that is identical to content that exists on the source server. In general, you should not permit any authoring activity to be done on the destination server at all. Symptom The content deployment job fails with an error message similar to "The form submission cannot be processed because it exceeded the maximum length allowed by the Web administrator. Please resubmit the form with less data." Cause The Web application on the destination server is often created with default values, which means that the maximum upload size is set to 50 MB. If the source site collection contains files that are bigger than the upload limit on the destination server, the deployment will fail. Resolution Ensure that the maximum upload size of the Web application on the destination server is at least as big as the largest item in the source site collection. For information about how to change the maximum upload size for a Web application, see Configure Web application general settings. If the content deployment job failed, simply rerun the deployment job. If the job completes with the status Succeeded, but the report contains warnings or errors, do one of the following: Do a full deployment into an empty destination database. -or- Modify the items that were not deployed to ensure that the next incremental deployment job will pick them up again the next time it runs. Symptom Sometimes a document on the source server is marked as being virus-infected when this is not actually the case. The Content Deployment Report may contain an error message similar to the following:) Cause If something goes wrong with the virus scanning phase during the upload—such as the signature files were in the process of being updated while the document was uploaded—it can cause the uploaded files to be incorrectly marked as being virus-infected. Resolution To determine whether or not the file is actually infected, you will need to look at the error message for the specific error code 0x80041050. This means that the item is virus-infected. If the item is virus-infected, either delete the infected item, or attempt to clean it using your virus scan application. If the item is not virus-infected, restart the content deployment job. Symptom In some cases, using the Stsadm import operation to import content into an empty site collection causes the import operation to fail at different points during the import. When this happens, the ULS log will contain errors similar to): "..." Cause Such behavior is usually an indication that asynchronous actions have interacted with the import operation, causing a deadlock on the computer that is running SQL Server. If you have custom event receivers in a site collection that perform actions similar to authoring events, such as creating new items, or moving items from one location to another, the firing of these event receivers may cause a deadlock on the computer that is running SQL Server. Isolating this issue can be difficult, because SQL Server tries to stop one of the deadlocking queries as soon as possible, while the child process (in this case Stsadm.exe, and potentially a second process, such as Owstimer.exe or a third-party import tool) continues to run until it finally fails, due to the fact that the query was not successful. It is possible to isolate the issue in a test environment by attaching a debugger to the computer running SQL Server and setting a breakpoint right before the deadlock query is stopped. This will cause the deadlock to persist, and enable you to create a memory dump of Stsadm.exe and the other involved processes. Resolution To resolve the issue, you must do one of the following: Disable the event receivers in the features on the destination server when performing the import. -or- Create a custom import application that uses the content deployment and migration API, and sets the SuppressAfterEvents property to true. For information about importing items, see Deep Dive into the SharePoint Content Deployment and Migration API - Part 3 (). Symptom If you have a large content deployment job running with several gigabytes of content, the decompression phase can take longer than the default time of 600 seconds (10 minutes), which will result in a timeout. Cause During the import process, the export server that hosts the content deployment job definition polls the import server at regular intervals to get the status of the import operation at each phase of the process. These intervals are based on a timeout value that defines the maximum amount of time allowed between changes to the status report. During the actual import, the report changes frequently; however, some phases of the import process take more time than others. If the amount of time a particular phase takes exceeds the remote timeout value, then a timeout is reported back to the export server. Use the following procedure to determine whether or not the deployment has succeeded or failed. On the top navigation bar of the Central Administration Web site, click Operations. On the Operations page, in the Content Deployment section, click Content deployment paths and jobs. On the Manage Content Deployment Paths and Jobs page, click Check Status on the menu for the job that has timed out. This option will only be displayed if the job status is Timed Out, and will enable you to see if the job succeeded or failed. Resolution To avoid these timeout messages, you can adjust the RemoteTimeout property on the exporting server. The following code sample enables you to configure the RemoteTimeout property value to one hour. using System; using Microsoft.SharePoint.Publishing.Administration; namespace CustomContentDeployment.Tools { class AdjustContentDeploymentDeploymentSettings { static void Main(string[] args) { ContentDeploymentConfiguration config = ContentDeploymentConfiguration.GetInstance(); config.RemoteTimeout = 3600; config.Update(); } } } For information about using the RemoteTimeout property, see ContentDeploymentConfiguration.RemoteTimeout Property (Microsoft.SharePoint.Publishing.Administration) (). Symptom An incremental content deployment job fails with the error message "The changeToken refers to a time before the start of the current change log." Cause The time span between the current job and the last incremental deployment job is too long. Office SharePoint Server stores the change token of the last successful incremental deployment inside the properties of the incremental content deployment job. When a new incremental deployment is run, Office SharePoint Server 2007 compares the change token in these settings with the entries in the change log. By default, the change log is configured to keep a record of any changes for 15 days. If the time span between two incremental deployment jobs exceeds this time span—for example, if it has been 20 days since the last content deployment job was run—then the change log will not contain entries from before the last change token. As a result, the incremental deployment will not start in order to prevent only parts of the required content from being deployed. Resolution Increase the time span for which the change log entries should be preserved, using the following procedure: On the top link bar of the SharePoint Central Administration Web general settings. After the correct Web application is selected, in the Change Log section, enter the number of days for which you want log entries kept in the change log. Click OK. When you are finished, perform a full content deployment into an empty database.
http://technet.microsoft.com/en-us/library/dd795107.aspx
CC-MAIN-2014-52
en
refinedweb
I am transferring this over from the old RE forums, because I think i's a helpful guide for those interested in adding another application to the exploit module in the Metasploit Unleashed - Mastering the Framework course. The guide also goes into detail about exploit development using Metasploit. This guide is not part of the course, and the author can not be held responsible if the subsequent modules from the Metasploit Unleashed course no longer work or conflict the with the initial setup. Here is the original post: I did the Metasploit Unleashed course over the holiday weekend and I want to say WOW! Amazing work, enjoyed it so much! :D I wanted to add another application to fuzz and exploit for my own lab, and then I ended up getting carried away and wrote a small guide/module for the course. It plays off the existing modules. There's nothing really 'spectacular' about the guide especially in comparison to the course, but it brings up a good point that happened to me when I installed the FTP server and tried to exploit it. __________________________________________ Simple FTP Fuzzer Remember the carpenter's mantra: measure twice, cut once? Well, the same can be applied for creating exploits. We'll take for example our target running running WFTPD Server 3.23 on our XP machine. First, will go ahead and download the software: If you installed the FTP server in Windows components, please uninstall it before installing the software. Go to the Control Panel and open 'Add or Remove Programs'. Select 'Add/Remove Windows Components' on the left-hand side. Double click on 'Internet Information Services (IIS)' and un-check 'File Transfer Protocol FTP Service' Install the software, add a FTP user and password with full rights and enable logging. After running our enumeration scans we see this exploit is already written in Metasploit and decide to go ahead and try it. Set the options and payload and run the exploit. Also make sure to specify the target as it defaults to Windows 2000 Pro SP4. And the results are....."Exploit completed, but no session was created." Well...we got a crash, but no bind shell. In fact if we we're doing a pentest and that was our only way into the network, we just blew it! The application would have to be reset for us to get another shot! This is where 'measure twice, cut once', comes into play. A good rule of thumb is to always test your exploits before firing them off. Create a lab, as we've done, and test it before you try it on the actual target. The great thing about Metasploit is that it allows you to reuse and modify code very easily. We see the exploit that was already built in doesn't work, so we are going to have to fix it! If we hook a debugger up we see the crash comes right at the jump code. Normally a simple fix would be just to change the jump code, since the current one does not appear to work. Since we want to be thorough, we are going to test this exploit from scratch, using our previously made IMAP fuzzer. First we'll go ahead and make a few minor changes in the code. WeWeCode: root@BT4VM:/pentest/exploits/framework3/modules/auxiliary/fuzzers# chmod 755 ftpfuzz.rb root@BT4VM:/pentest/exploits/framework3/modules/auxiliary/fuzzers# cat ftpfuzz.r::Auxiliary include Msf::Exploit::Remote::Ftp include Msf::Auxiliary::Dos def initialize super( 'Name' => 'Simple FTP Fuzzer', 'Description' => %q{ An example of how to build a simple FTP fuzzer. Account FTP credentials are required in this fuzzer. }, 'Author' => [ 'ryujin' ], 'License' => MSF_LICENSE, 'Version' => '$Revision: 1 $' ) end def fuzz_str() return Rex::Text.rand_text_alphanumeric(rand(1024)) end def run() srand(0) while (true) connected = connect_login() if not connected print_status("Host is not responding - this is G00D ;)") break end print_status("Generating fuzzed data...") fuzzed = "\x41" * 1500 print_status("Sending fuzzed data, buffer length = %d" % fuzzed.length) req = "SIZE /" + fuzzed + "\r\n" print_status(req) res = raw_send_recv(req) print_status(res) disconnect() end end end Lets go ahead and fire back up metasploit and see how this looks.Lets go ahead and fire back up metasploit and see how this looks.Code: cat /pentest/exploits/framework3/modules/exploits/windows/ftp/wftpd_size.rb
http://www.backtrack-linux.org/forums/printthread.php?t=368&pp=10&page=1
CC-MAIN-2014-52
en
refinedweb
GREPPER SEARCH SNIPPETS USAGE DOCS INSTALL GREPPER All Languages >> Javascript >> functional component react with state “functional component react with state” Code Answer’s state with react functions javascript by Testy Tamarin on Mar 13 2020 Donate 6 1 import React, { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times</p> <button onClick={() => setCount(count + 1)}> Click me </button> </div> ); } Source: reactjs.org usestate whatever by Tense Trout on Jul 12 2020 Donate -2 const [count, setCount] = useState(0); Javascript queries related to “functional component react with state” component state set usestate hooks states in function react react state function component state reactjs setting state in function component react react state inside functional component usestate both ways react using state in funcion compnents in reactjs use of usestate in react state in react function component using state in functional component react react state docs state react functional component react js functional state statex react using this.state in react function why this.state react js state function can functions have state in react state created at react create state in react ...state in reactjs what is ...state in react ...state reactjs this.state = how to declare a state function in react class this.state. function components set state state function functions , states react states in react functions create state in react function usestate react set react create state define a state in react this.state with type sage on state update react how to use stae variable in functional component in reactjs get hook state testing state react how to access all state defined in function component in react like this.state use State set react js state example using state with super propst react how to create state in react state with state in react react.setstete set staete hooks react class component update state object where we use state class component where we use state set state react function this.state on function this.state on function react state on function react react native onstate update how to display state data in react js declare useState react update all state with react hooks how to setstate in react native useState(0) meaning change hook value react when to use props state hooks how to handle state from a render react react this.state example this.set state difference usestate avec and sans shallow update on useState in react js react tutorial state react.usestate false react set var derived from change of state hooks What is state in ReactJS? react state vs component react typescript state functional component set state in react functional compoenet new react state raect state object declare in js state react what to use instead of state in functional format of react js react props and state react put function in state setstate react component state var in react useestate react state jsx use state on click what is local state react use state with function component react call state with a react hook use state in reactjs js react setstate setting state in react with out this statement usesate hook setstate react hook state in function components in react page with lot of states react clas and function onclick usestate change alternative in class component updating state react hook local state functio components with states reactJs usestate and setstate where does react store state DOM react useStates() [open, setOpen] = React.useState(false); react get state from <element/> react get state from element react native setstate react change internal state opf hook react render counter use state if we want to add number in new state what is the initial value we set while we are adding state usestate install how to use state in const method set number prop for state variable react set number prop for state variable reacty add usestate in react how to ensure the useState hook was applied render() react class state use state or only hooks how do i define a setState html setState react create new local object from state object react functional components usestate usestate with function state define in react react class component setstate React user name with useState(0) hook examples of state react jsx usestate set state in react hooks on render react hooks set state react.js upliftstate setstate react hook state and props how to use the state hook to create a count, setcount pair in Javascript purpose of state for react example setting the initial state on reCT EXAMPLES useState get value import usestate from react how to include to state together reactjs state on react assigning a class react hook update component state componenet state react useState in class based react component state in funcyional component react reactjs default state data state in returnung element react react update when local state changes react state in variable state hook in component variable state function components react when to use usestate why we have to use state in react js usestate object example state in state function react use state in state function is it possible to use usestate in a class in react different type of states in react react usestate and setstate convert this setstate to useState in es6 react how to use state in react components? local state and lifecycle react usestate vs setstate how to make state in react class ClassStateExample.js" react ahowState state and props in react react ...state useState array state reactv set with react use state how to use a find() usestate how to set state object in react functional component what is state in react js react element in state react class component create on state change usestate hook in react\ react state and props explained init state react react state in class component usestate for array what is the state hook react state variable in react Reac State const [python3Installed, setPython3Installed] = useState(false); defining state in react useState set state working with State ReactJS global state react hooks state how to set a state using hooks in react this state on react how to use state react this.state. how to ue this state in react native react hooks subscribe to part of state what is state and how to use state in react project react native usestate example dieclaring states in react how to connect the useState hook to the main state react set state in constructor React.useState(false); react set state example react how to get all states functional component how to use state in functional component\ react usestate counter js set state state in class components react state and lifecycle docs setItem react hooks docs usestate onclick react usestate how to setstate in functional component react using state with functions how to set state in functional component react add state from prop state reac tjs useState count initial state in functional component react setState hook render in react hook to use this.state how we add components to button in react js hooks EXAMPLES OF STATE IN REACT WHAT IS A STATE IN REACT reactjs.org useState react if change state add function in react js state react add to state using state from ract hooks in other functions the state object react react hook sample should I set state coming from props to local state in a react class component state in functions in react react hook with button use state [] function components with state in react setstate doc this . setstate doc react function returns many set hook react function returns set hook react return setstate hook react hooks documenttaion react where do you put your state use state import set state with hooks react native state in function react native react functional components with state components in react state useStatereact native state in functio based component react state function reactjs how to make state in react all hooks react component state react native javascript react do after the setState usestate hook example defining state with another state react example react hooks setstate react native function component tutorial component state state for react classes const component in hooks react native const component in hool react state example react useState false useState react hook props update state in react hooks how to use for state in React jsx react state count import statehook react useState hok update state litteration react react set Count hook reach setState hook how do you set state in function component usestate([]) reactjs state update react state props how to get props in react hooks state class component usestate react onClick react.usestate(0) in class component add state element react js type of hook state in react js How to use second part of useState hook react .usesState react components state usestate react import react flexreact style hook react props and state management react hook set count useState set hooks keeps its state usestate react js usestate set specific state changing the state change the dom set state react function component react hook example use state in react hooks counter react hook functional component states do you have to use const for react usestate how it works react state declare state with api call react call api at state declaration react syntax for react class component in react with state react class component vs functional components const usestate state guidelines react react import usestate vs react.usestate react use state in function usestate counter react functional component react setstate adding state to functional component react term with states setstate js setstate in hooks functional setstate hooks state change react native setstate react class component usestate react hook useState with state call state value in react usestate react state class component use states in class components react native how to set component state from import react react component use state react js useState react state hook example hooks setstate insert document as state react what is state react use state in react native how many usestate we can use in react js states in a functional component react js state = react react usestaet set state in React.Component this.setState( react hooks setting state react what is useeffect usestate react functional components add to state hooks this state react passing state as props react hooks this. setstate this.state in react hooks what do you import usestate from in react add to state react functional components react setstate react js constructor state define state in class component react set react state Declaring a state object in react class react hooks use .update setstate react class states this.setstate in hooks state.handlers react definition state in a function component usestate import react hook usestate define variable react hooks set state with type react use state set 0 how to change type of state javascript react what is use effect hook in reactjs get hook from string React how to call a usestate method function setstate react recall state in reactjs hook change value state react class and states state React.FC<{}> how to declare state in class component in react js how to initialize a react functional component with hooks can you use an object for state react how to update state in react react setstate() how to use usestate in class component using usestate in react using usestate in react class set state in function component this.setstate in functional component react native useSate setstate react hooks react functional component states how use usestate in constructor react class useState react state update react useEffect() ; what is state in reat get state react hooks what state react react state with functional component react use state with functional component setstate class component in react js state props usestate in react functional component useState<[{id:number,value:string}]> hot to setState use hook react example import useState without import react state hook use hook function to set local state use hook to set state how to use variable in state name in functional conponent react use state nextcomponnet with maxlenght react setstate with using state functional component state state in hooks how to use setState inside a function in a react function component react passing state using hooks state in class compoijnents how to get result from hook react react function to add component to screen update react component when state changes what should I put in react state setcount react previous react functional component initialising state site: super state react define state in react js component local component in reactjs this.state variable react documenting useState hooks in project how to declare a variable in state in react native hooks how to use this.state in hooks this.state in functional react render a state variable in react update state in react setting state before update is complete react hook reac class component state react component state setstate react react use state example default state react functional compornet how to set state in react hooks this.state in variable react state refuses to set react state in fuction react what is setstate function in reactjs react-native lifecycle idle state usestate documentation react set state jsx react declare state how to get the current value of state in react hook react new useState react setstate in function component what is setstate in react does each rendered component have it's own state in react does each rendered component have it's own state react functional component rerender react usestate onclick setState in react native hooks hook setstate replacing this.state in hooks && how to show updated state in react what is use satate method in react react state on functional component import * as react from 'react' usestate react class and react stae how to write state in react js update the state of a component react hooks how to use setState onClick react hooks react usestate plus 1 react hooks example setState usestate hook sytnax usestate(0) life cycle mothods of react native react hook when state set usestae hoks react set state in function react react class component set state state use in react js react native move state usestate in react example usestate([] || usestate([] or how to set a state react functional components hooks and state using setstate in react does every component have own state in react usestate in class what happens when there is change in state in react set state in react react component example with state react counter react change state in constructor why function is react hook use square brackets state update react state management how to access recent state in react functional components in react state can be accessed using react props.state react state definition this.state react use setstate react create state react hooks usestate(false) react status declating states in react react lifecycle hoooks class component constructor state react setst this.state class react hooks to set vlaue clock react js set React jsx as State state trong react complete state react react import state from react onclick setstate hook functional stateless component react updating state in compnent class components vs functional components react when all states finished react jsx inside usestate hook react constructor for object functional component this.state.value in react state in sunction component inside usestate react do we need state for showing date react.js react hook value only state functional components react state hooks react state usestate syntax useSetState react lifecycle hooks react react native hooks usestate how to declare state in react function how to grab a react element in a functional component how to use state in render react how to render state react react hook button prop how to use setstate in react react.usestate vs usestate setState with hooks this.setstate react react change state method in react chang state react count in reactjs state and setstate in react js which component to setstate when props & state change define state in functional component how to write state in class component why state in react react native function useState default state of usestate passing the state as props in functional react hooks this.state in react react functional component state object react previous state set state updatestate in react react.component usestate state in react hooks access state in functional component import usestate in react satate in react import react state how to define state in class component how to use setstate in hooks in react native how to use setstate in react hooks What is a state in functional components? react native lifecycle hooks set state inside a functional component usestate function version react render use state react render recive state react lifecycle hook react state in functional component example react state in functional component exmaple create state react how to update state and not effect other portions of state in react {usestate} react {use state} react can you set a state variable to be a function react react clock component setstate react jsx react change hooks react setstate in functional component only declare set in useState react how to use state value in react how to use state change while rendering what is a setstate in react js this.setstate in react how to import usestatte what is atate in react reactjs state chto delaet update in react state use a class with state react how to grab updated state variables hook react this.state javascript react counter in state react states in function usestate react example when to use setstate in react why the component not render on set state react hooks call state in hook react hooks usestate set function state hook in html file usestate = react get state in function react react using state variable as state variable react ! state reactjs use state inside function react js functional component state state management in functional component react const [, updateState] = useState(); how to setstate in react react state hand over class component react usestate react how to set state in a function state hook in react native react setstat react js clock state js update state ...state update state react check state change states in reacct how to change state in functional component react.js state how to set state with usestate get state to main compnont react react component for making a change state ---- to update state variables in a React class component this.getState react react includes on a state variable react state syntax useState import object state of component react react make states states in react js what is the use of state in react how to handle state in a functional component react usestate api react native hook doc update state in react class component how to redner on state change in react class component this.time react class.state state react.js usestate in react docs functional react components with state usestate with example update state in reract js react use state hook to update variable param this. state previous state in react hooks react state is reference vraiable React components defined as a function and as a class have to access state in a different way this setState javascript update State() method render state class component react to dom stateless component setstate react states react hooks use previous state react usestate via params jsx for state to show last update react react.component state counter react js setstate react read state react render initial state class component this.state javascript updateState() method statefull react react js tutorial state management react what is a state react hooks usestate example react js update state usestate() in react how do i get useState on reactjs setstate in rexcat js class what is state variable react ghow to take value statein react hook how to decide for state in componenet where should state place react reactjs set state on opening a model this.setstate reactjs state react js add useState to react react usestate in class component setup state react onclick usestate react how to setstate using hooks how to define state in functional component react write state in functional component react react js state value with object react js state object react use state doc react component setState useState reaacct hook react js adding state to components react js state this.state component react how to subscribe react view to state change react state for function hook how to set 3 state on one setstate react native hooks setting state in react state variable react hooks i made a usestate hook with all the states inside it setstate using hooks does our component render on every state update? react hook to get state in function state on functional component this.state! updateApplicationState react what is a react state update when does state refresh react update setcount how to add states in react reactjs state in function counter example react js useState pass param as fucntion react js how to set in hooks in function react native states state hook react update state variable react in component did update set state functional react state with objects where you should write your state in react this.state class react state withstate react hook with state react how to use state in functional components react React.use state react hooks setstate with prev state class as state react jsx is written before state update react state data react hooks with examples how to set state creating states in react native functions state of js react update state in functional component react react hooks use state proper way to update react state class component useState in react js setsatte in react js react component updates on state change import react hooks state = { }; react define state in function component react how to use state in reactjs states in react react return state is jsx react native function that change state react usestate setstate react use state set state setstate in class component react constructor react this state in react functional component why use effect recat reactjs usestate reactjs state monitor setstate hook data type react setState hook after stat is set it flips back instantly react setting state with react hooks react javascript usestate functional component react counter example functional component react counter state react app state react change state react state with constructor functionalal state in react js useState(""); how to use set state hoook usestate in react native why does react have state js adding state how to update a state in react react functional component local state react hooks setstate more function use states react react hooks usestate function states in class component use state hook use state equivalent in class component functional components by default have state? what is the method used to modify state in React component? react state. use state functional component react inside class component use State how to use this in hooks how to tell if react state changes how to update state in react native usestate in react hooks react class component state examplle state ={ react class component state examplle js setstate appending new jsx with use state react import useState hook using states import setSTae how to use states in functional component react define function in a state state react in functions update state class component The useState hook allows us to use ____ in our functional components The second value returned from the useState ___ that updates the paired state variable. useState(false); update react state example react native setstate sate state inside get how to set state in react hook react createstatte how to use setState react function what function does setstate take react react hooks update state render react class compoent state state when it comes to react function and state for react states of function componenets using hooks react acessing the state of a component react update function react js react how to set hooks how to handle state in a functional component reactjs state in a component react updating states syntax react react update state ... syntaxes use this.state = {...this.state, how to show the changed stated in react react show state as html setState in hook react state in functional components function in state react native how to catch lastest change of state react how to catch last change of state react react hooks usetatwe setstate + react what does ...state mean in react react set state rreact react functional components with usestate react useState function how yo pudate state in react state ={} setting state in class reacct setting state in class update current state function states reacct if a react component has state it must be a what type how to get set state data in every component in react js setting state functional component this.setstate reactjs hooks example updatting state react hooks change state in class component react what is the state for time in react js reacte set state react constructor with state function component setstate react hook use state import se state react state in functional component raect react s«usestate use State react example react functional component state react hooks state that doesn't need function react how to create a state usestate in reactjs react use state function how to use setstate in a class react change component how to get state final in reactjs setting state from a component react change state render react js react js functional state component should state always be in app.js how to set state in react class react web state react class state declaration react usestate set react state component example add the existing state react react use state to show html react setstate in function set react state to previous hooks add state in function create state of objects in react using useState hook create state of objects in react react component<IState> use sate in react bative functional component why do we need state in react setCount(value) use setState in component create a state react and props with hooks use usestate variable how to use a state in class component hooks react use state react class state def react change state in const React.usestate breaking component two this.setstate in component what is react state set hook react this.setstate is equevelent to functional component import React, {useState} from 'react'; define react state react native + how to use usestate set initialize state in react native functional component for object state in raect js react state functional component object how to set states without hooks react how to swt state without hiiks react this.state{}; REACT JS , set a element in usestate how to use usestate react js add item on click usestate react useState props in jsx useState ...state react this.state.variable how to set state using useState hook react react setstate functional component react hook change state example of state hook react app why do we need to use state in react useState hook set state state with functional components functional component useState in react example functional component in react example can you add numbers to useState(0) how to create local state in functions react satete function return value can i set to usestate in react native using usestate can i give function for useCount(func1)) react hooks super state is react states of react rstate react native useState api state hooks do i have to use both args how to pass state variable as props in react hooks useState<any>([]) usestate() react useSate in react how to create a new state in react in a function if state in usestate what do you import useState fro set a component reference into a hook state Ho w to pass state from class component to function component and change state in function component react class based component state importing react hooks react state simple example reactjs updating state setState function js react state with class components state react native react set state hooks in order setting class state useState on click show react state does a functional component have state react funcitonal hook compone what is the meaning of const [todos , setTodo] = useState([]); how to set vslue in usestate hook usestate in react function react hooks next state import setState in react inport setstate in react change state in functional component react local state data react onstate change react import state hook react hooks useforwardingref update state in state explained react set state in function react native react updating state performance react state of base component how to pass state to functional component react react import use state hooks setstate in next set reactjs state as function react set state as function react use staet states props jsx why we use state in react react access state variable in function component react setstate hook parameter react usestate parameters how setState works in reactjs usestate[0] react react component change it's internal stater are const changed on state changes in react (0 , _react.useState) How do we change state in class based components? define state in react hooks state usestate how to write a function that updates an item in react state react, multiple state hooks useState set address update state in next component react state in reactsjs hooks name value usestate({}) const [note]= setState in reactjs why useState use in react how many this.state can you use react state and state change in react state in function rect how to set the result of a find method to the state react react native hooks return string react check what's changing state react setting state with hooks import react, {useState} when using useState, should I only put one item in it? set single state react native set 1 state react native what are react states where to define state react native update state usestate ways to update state in react when does react update state how to check for state with ?. reacdt how to set the state to the return value of the find method react how to get the previous state value after updating a component in react js thios.setstate initialize useState in class component react state varible react react hooks usehooks usestate react examples setState a hook where is useState code found in react.js how to access state in functional component send html from react function with setState React hooks usxeEffect simple example on usestate in react react hooks sorbutton use state calass what is reaactjs state react display state variables onclick change state react hooks usestate react react.js create react app useState setStateComponent React react setstate using previous state in functional components how to setstate in function react react state hooks how to define the state in functional components setting state on event react using state in return of a functional compenent who i read a state in react hooks react setState setting state in react functions. How do you use state in react?] setstate react class component string component level state react update state using hooks How to keep track of state updtaes in react const [mobileOpen, setMobileOpen] = React.useState(false); The state hook is a A that returns B how to set state react js can we use setstate in functional component setState reat setstate and state react ...state react meaning state each component set state hook react native on state change functional component react hooks maint state between render reactdom.render in a state component useState in jss ad state in react how to set state to equal const de factors state react const [] = userstate react state component syntazx display state object react what should be in the state in react reactjs hook component example change class state to hook setstate state to setState how can we write state and new state in react js in same functionality react how to access local state in functional component how to access local state in react functional component react functional component access local state react functional component access state from function local state hook import (useState) from 'react'; import react (useState) from 'react'; how to set usestate usaState using api react how to know state updated on functinoal omponet state change state in react example le state in react react changing state react assiging data in state variable in react functional component initiate state values functional components state in function component react native how to update react hooks usestate setstate call functional component react function on state change usestate() hook react countre org use state how to call other componen useState react use state to declare variable react settate use state to declare variable react state and setstate in react functional component this state in function based can someone explain to me what's the brackets in react hooks how to use state in react component change state hooks usestate with render What is state in React Component? use state js where to useState react native hooks variable declare handle state in functional component react state function in react native how change this.state to usestate state props functional components react usetstate react in this.state how to test react functional components with state react native hook integer addition use setstate react hooks ...values react usestate why do we use states in react how to use state in class component way of changing state in reactjs hooks can state be used in functional components how to use usestate for one time and set all state variable react useSta set in react js setstate in component react-native can i put jsx in useState usestate in function without hooks react use state in function react how to setState from functional component to class component import use state state in functional compoenents this.state.post react react list component setState setstate in functional component react native react hooks use eff how to access state hooks invoke useState best way to setState hook set state with hooks react set state hook react how to send usestate as component in reatc what is usestate in reactjs this.setstate to hooks import react usestate from 'react' react hooks how to update state function component Which function can initialize a state variable in a React function component? how to define state in react class component add a state to a component usestate hook arguments functional components with react outer set state function how to use changes of state in react where does state go in react react counter functional component react class update state get usestate react state in class setstate() in react usestate vs setstate react react hook setstate on load call function to handle state how to update state with usestate access function component state variable react javascript setState change state on click hooks import usestate hook from react usestate setstate writing state in functional component without hooks this.state in class component useState hook reactjs react usestate set all states change state react ... change state react how to use state in a component react how to usestate in class react useeffect hook in react state doesn't upset initailly react how to use state and setstate in react hooks creating a react state how to use state in a functional component react setState in cont component use state in a function using hooks how to use usestate react can i have a function on state in react setstate functional how to create state in functional component how can i update state of component when component gets updated state update in react react hook setstate with function vs object use state as a prop react return state from component react what is a react state localstate class components react state variables in react js react usestate class component .create(this.state).then jsx rules of setting up state reactjs reactjs functional component onStateChange state in class component useparmas stateless component setState in jsx all ways to set state in react state and setstate for functional component in react fucntional componet uses old sate ways to setstate in react render new component on change to state render state object react native react set state of object react usestate current value render api state react render state react react 'useState' updating page state on type react function usestate react react .useState set state in functional component from functions what is equalto setstate in function component react useState scope creating states in react state of react function state function component react how does state work in react usestate button setstate in function react create State react react this.orignal state how to setstate in class component state = { activeSlide: 0, activeSlide2: 0 }; as a functional component desestructure useState react useStateValue() hook useStateValue() hook] react Use State' how to use this state and set state in react setstate in usestate local state react do we need to use this setstate in react functional components how to set number in usestate hook seting state in a function how do you reference state in a class component pass use state a function to initialize what is react state? How do you update state in react hooks? update a state in react react difference between state and usestate ho to change state in js localState reactjs react.usestate means default state name react react mode use state setstate react counter update state doing for one state beofre state update taking for one state before react how to change state in a component how to update state in class component react setstate syntax hooks state?.'' in react use hooks to set state add component to a component with setstate hook usestate State.object in react can I create the state inside a component and then call the component on the app.js how to change state in functional components in react get class state in function react how to use hooks and state base function react how to access props from hooks on state function usestate render react react how to distructure useState how to import state in react how to merge two arrays from usestate this.state to hold api staet inside react .component React.useState inside class set string functional compoenents state stat in functional compoenent reqadt asignación de variable de estado local react how to update state within a react component class Test extends React.Component { constructor() { this.state = { ID: 1, subscribe: 0 }; } render() { return ( <div> <p>{this.state.ID}</p> // Modify the code here </div> ); } } this variable in functional component react how can i get current state in functional component in react state react object react transform using state state transform react change state react functinal component set data to state in react react manage state in functional component react how to use useState in class component how to pass setState of hooks as a prop to class component get state in functional component react how to state in a function component jsx why we cant use state in functional component useState how to pass the current state how can we use state in function how to set a number in usestate how to use state to prop function how to use usestate hook react native update initial state use stte return update a state react js class component state management reactjs class component setstate react object in state const [count, setCount] = React.useState(0); are state variables different per user react reactjs set users with hooks react update state on setState react function components state how to make more number of set state in react js method how to useState react use setstate What is a state in reactjs how to change state with setState react setting up state jsx how to get time in useState hook react multiple states usestate react this state use state vs set state react hooks states react react js state = object react hook from button usestate with initial state in react native outputting state in react how to define state in react setstate usestate in feact native react count setCount declaring a new state variable react state variable in functional component add props state react hooks setting props to state react react hook update the state react react native functional component state changing by reference what is sate in react react setstate example funbctional component value of default state in react js class based component state react import userstate hook react use steate What is the purpose of state in React? how to make a state read write react react use statw react functional components how to use state w 4-make it work-react state setstate example what is the purpose of states in react react usestate with jsx inside react usestate with node react hook jsx in state react usestate contains component react hooks state with component how to set value using hooks in react change the state in the class based component react how to update state using hooks are functional components needed to use hooks declare state jsx state variable react js setstate example in react javascript setstate in react javascript react changing compononent by state react function add to state state is change states in component class changing state react import useState from "react"; react set state of a class update the previous state with new state in react js counter functional component get state class components state to functional how to use useState in react hook modify state react most update state value react useState managing stats in react react 16 state object state in react js reactjs add local state to class reactjs local state and class react state constructor what are states in react how to change only one state react hoks how to change only one state react use state in react component how to change a state into hook What does the useState function return? react hook how to maintain state in functional component can we change the state in funcitonal component in react how to update state in functional component react react native use sate edit in react using hooks usestate add in state react how to set state in a function using set state in functional component define a function in state in react setting state react set stste import React, { useState } from 'react' react useState called from different functions how to check state change in functional component react react how to get state as soon as it is updated React.useState({}); usestate() parameter usestate in react component using function to update reaxt state react set state on load declaring initial set state hooks functional component react state object can a component link to a state in reactjs react native hooks should i set state variable to const or let state class react state react example react native hook object react state crawing can you set variables in react function components how to know what is changing state in react how to create handle state for react for any state react on state change various states react how to create a state in functional component for adding data states in functional component react react functional state updater set hook in react react const variable using state reactjs when to use state react function with state state hooks functional component useeffect set local state value how to set state using hooks usestate object react how to set state in react.js pass state from component using hook object state variable functional hooks react native state within a function react react hook uselifo proper usestate hook changing state in react ...this.state react library useState react on state change hook update jsx in component on state change what is state object in react react state in hooks from classed to state in react functional component this state import useState react native Como retornar um estado para um valor inicial react react constructor state string function component why hold state reaectjs get state react this.state usestate react get item from state state in react definition set react hook to a function how to setState can i use setState in stateless component pass the usestate functional in component react usestate react props react set state with this.setstate set an state in class hooks react functions creating state in react set state in usestate in react class component this.setState example clocal state in a functional component react native setstate functional component update react js state state declaration in react react can i use hook in hook usestate class usestate hook in class component use stae hook how many useState cna I have in a react app stateless component react js with state manage how we will access state from useStateValue how we will access state from useState setting state value in react js how to import react hooks can state control a component react react check if state variable changed use state get initial values js this.setstate can you set a component to a state variabel react set state to component react functional component render component through state variabel react hook examples usestate hook import states react native how many state in functional method how many stage in functioal component constructor state usestate hook in react js how to update set state to current state can i directly change current state in reactjs use satate in react js react native hook set state based on time what does this.set to react what does this.set do react usestet react reactjs usestate function functional on hook change const = usestate component setstate setstate hooks react objects in state react how is state in react const and updated what is state in reactjs Which of the following statements are correct regarding how a React.js component uses state? ikm this.state react changing from different states how to make method under state in react js react how to change component default state set state class component setState() using const in state react js change setstate when page closed setState react hook example this.setsState functional component with state const {count} = this.state use effect hooks react state in functional components react default state react js how to add state in react function react class component update this.setstate in react example what is react staate const [] = useStaete react.useSate vs import update state with a const setstate usestate how to usestate react example how to usestate react exaple how to state react exaple how to change state react how to access state in functional component in react why do we using state in react how to include all state in usestate react how to manage state on react class component useState in a class react component simple state edit state js changing state with hooks how to transorm this.setState into use state how to use state in functional component react native this.state reactjs userstate use array react native add on with useState react change uni usestate react counter how to useState in react component use states in react usestate count example class component setstate react react state object react multiple states functional components use effect react js initializer function use state how to set a new state in raect hooks unable to find this.state in render reactjs how to do setstate in react react state in app.js react should you have state in app this setState react to update how to handle state change with useState how to handle state change with react 16 how to access state in functional react how to access state in function react setting state in function react update the state in react react Explain how to update a component's state from a child component. functional components state update state from function state update with every functional component react react state set state in react state component in react momoise hook react props and state in react js state syntax in react render on state change react react functional components variables update state variable react native function component react native function component setstate how to declare and update state in a function component react native this.state object how to set state in class component set state of functional react component class state this.setstate in react.js usestate hook variable react use state greater than 0 setstate in function component react native react setting state in useeffect how to reach div in react functional component with states state in functional component for data use state once const state js state in functional react setting state react how to usestate in fucntional component with react react do i have to use state pass state to another function react hooks react set methods use usestate react hook how to set variable in react functional component how to get the not count as a react setState hook react display this.state variable react how to set initial state in react userstate hooks set state usestate within class component react can usestate be used within react class where i should write usestate in react create-react-app state vs function react, ( usestate) render component from state variable react render component from state use setstate in react react class component usestate set state class update string react use state string react setting the state how to create an initial state in functional component set state as function react how do I update state in a class component react functional compon ent state constructtor with state what is this.state in react can you have state in a function react using state in react using state and setstate do something as soon as state updates react usestate hook in class component how to add pervstate to state in react hooks jsx in react state use state hooks react state of react how to check new state updates react how to setstate in react in fuction react functional components set state function react functional components setstate multiple use states React JS set values with usestate setState hook use state within other use states what is state in react component is react state available by component? react state functional component set hook un react userstate reactjs create hook react const state react react setstate with previous state dictionary update the state react hooks using this state in functional component set update state functional component use setstate hook inside function use hook setstate using setstate hook in a function state each in react js react stae React.useState([0]); useeffect react syntax react 16 useeffect what is a state in react js react update state hook meny setstate react how to update state in functional component using setState react functional component state on click state change functional component react setstate function component de react usestae default how to return state in react react component tutorial usestate class component state how to change state in react usestatevalue javascript react setState js use state onclick usestate class component react native state component react multiple state values function components react hook button can you use state in a react function use hooks instead of state react stateless compoennt setstate state in hooks react react use state false react hook update state state in components react we can use usestate in constructor in react ? react get all useState react hook setstate create a new object react class constructor state use state in react js react js state vs object What the different react state and an object react hooks on effect class componet react with state React.useState([]); how to call react state how to get update functional component values reactjs how to get updated functional component values reactjs state variable react sestate react what is the state in react react docs state is local react state import react this get state react state in dom set state with react functional component update state react native how to use setState in App.js react using useState in App.js react react count is it true that only functional components can have state in react how to create state and use them on react functional component how to create state and use them on react how to create state on react what is local state in react create state in react and on click setstate how to make state private in react function al component in react with sate state in new react update show state react React Native Component updating with state changes which component run state change in react native what is a state attribute in react how to change a value in functional component and use it how to set state using functional components setting state in a functional component react changing the state of a counter react change state using functional component react use this.state in react react useState set function with 2 parameters state in react class components hooks in react example what is the state react why use state in react react subscribe to state change update react compoenent state this.setstate react native example simple react replace function with usestate how to use useState inside react-native class react functional compoentns update state on click usestate javascript react react adding state to function based component props to state react how to define state in react function useStte in react where should i put state in function react react how to usestate of array: JSX.element const usestate = react javascript usestate set state react hooks native functional component set state react native functional component set state react native react js usestate example react function component set state react js usestate variable react usestate functional component react how to change state in render usestate and setstate in react different methods of writing setState in react what does state do in react React state how to update update react page functional component • How can you use state in a component reactjs react class with useState set state in react hooks react state counter react documentation hooks effect using state in function component react this set state accessing objects in state react hooks react props state declare state in react using hooks in react hock vs state in react js component that get colled oce in few secounts react use effects react react js store object in state if in react jxs usestate different ways of setting state in react react functional component save file to state react hooks state get current value react functional components set state react navtive usestate component only show before state is updated in react hooks react list user key state of a class in react usestate rendering elements as state react how to manage state in functional component react react use setstate in functional component react use state in functional component how do states work in react js state components into functional components usestate example in react react us state react hooks view state state in react native what is @state in jsx react state methods react functinal componenet access state within sub function react hooks set state to false react hooks handleDidLoad react hooks set .then react hooks set react hooks set working working setstate with react hooks this variable in functional conponents reactjs setstate distructuring react.usestate react isState react what is being used for state management in the component if useState is used set blinkint text in react js using hook react create new state react create a new state from the code reactjs state = "'entering'" react hooks get state create local copy of state in react function how to add state in react state react function state to variable in react react class based state what is react component state update state react from non component boostarpmodal open usestate react on change hook value react react class component should I use state how to declare state in functional component how to apply state in function componeny set in react react hooks component state class component react state react updating state what is usestate react useeffect hook react syntax setting usestate equal to a variable IState react react hook set react how to update state useState list in react native chnage state in react react functional component with state vaiables define state in a funcion component in react react js class component example state objects state in react functions react state in functions react class components set state set the data for state in reactjs react when to use state can we have multiple states in constructor in reactjs class based componentts update usestate react react js class component example state react use state value as part of function variable react use state as part of function useEffect in react component class based components in reactjs with state react hooks usestate set class to state react hooks usestate with class react hooks usestate class react hooks set new class how to define object state in reactjs setstate in react from js update on button change reaact function component implementing states inside React App react hook initialize state with props react usestate increamer react setstate docs save state in const react react state example with function component react state vs constructor this.state when to use in react state components and when functional creating an additonal state within state react hooks const value setvalue = react.usestate('') react set state in different function should you use hooks or setstate in react? react working with states "...state" react new state react import useSateValue how to update state for one value in react hooks lazyLady react hooks define:state react get state using hooks react is use state the same as setting the intial state in react? set state in react component this.setState on functional component reactjs states usestate react component useState in component react react why setstate react why set state uesstate react different examples usestate hook import syntax handle update react hooks how to extend react hooks state react FC state react classes state how to use the state on a react component react contstructor this.state set staye react react setstate jsx functional component react function component constructor local state in react create state in functional component react native react component state example use hooks in react how to render a component in reactjs on change state in hooks ...state in react hooksatate react use node function in react usestate install useState react nat state class based component react js what is state importance of states in reactjs why states are needed in react change state in functional component setstate in react ooks usestate example in react js react interactive state class component what is component state in react react functional component after state update reactjs this.state && react pertinent component state functional component state react declare state in functional component react usestate react 16 react state the old way in functional component how to set state in react js on onclickhooks react state set with function react update state class component class based component own state this.state react change how to assign set to state in react react setsdtate example react state change how to set the state in a functional component react functional component with state difference between state and setstate in react js how to define state in react js only use setState react usestate(0) react define state react setState hook react syntax state with react how uppdate state in reactjs setting state in react basic code react js this.setState react js on change and state react lifecycle usestate motifi went state update in reactjs usestate react tutorials find element and update state in reactjs react class component with statre what is this.state in react js react update state of only one component how to import usestate in react examples how to use usestate in javascript what is setstate react constructor state react react functional component function not taking state react usestate set initial state add to existing state react hooks set state on function reaxct hooks react when setstate compnent update use react state hooks inside javascrpt function use react state hooks insidr javascrpt function what is React State mean create a component function with state react react usestate in app.js constructor react hooks setstate react documentation how change state react What is state in React? What function can be used to change the state of a React component? if a react component has a state it is a how to print react UseState value in js function component state react react hooks setstate current state js state define state reactjs react class component state why is my react state an object how to create a state in react react function usestate react native function component state how to use usestate in function component onclick setstate react hooks how to use setstate in react functional component get the value with react state hokos get value of react hooks how to set state react hook react state flow how do i set up id in my react state manage state in functional component react states and hooks react what is react state used for how to setstate in react hooks state hook reactjs call the state from app.js into different components react create state in functional component react what is an app level state in react state react class component react state tutorial use state as a variable react what is reactjs state react display state in template pass usestate hook as parameter javascript update state in react native class component handle state in class component react native render react component with state react functional components on state change react makestate change html based on var in react hooks usestate hooks reactjs return updating state in react what happens when state changesin react how to declare state in react state with an object in react functional component react when to update state declaring a state object in react react functional components increase value assign html in setstate react update state in react js react hooks list example how to add state to the react app describing react state in ease words how do you declare a state object in javascript react usestate indefinite number of elements find state on functional component react js hooks assigning a state variable to local variable ...state meaning in react use state react native diagram this.state reactjs react effectw react component state react hooks usestate elements are equal use effect reactjs using state in react functional components react function hooks class component react with state how to import useState get new state in app react js calling setstate react hooks What is React "state?" react hook counter example setstate in a function react set state in a function component state react mean how to set component class state react how to set component state react react hoooks use state state string in functional component react.js set state react.js useStatechange fire funciton show component based on usestate value setstate in react native multiple states in a single functional component react using multiple useStates react react render return after usestate count setcount react how to setstate in react functional component react what is state usestate react hooks example react hooks with numbers setstate in a functional component how to print useState value in react js react check if state changed useEffect react doc set state in .then reactjs state elements react state in function component' reactjs react useffect declare state react use huck in react example set state class react react.js hook state increment react native functional components state setstate javascript react state react hooks use state jsx use state in react class component react class with state return additional based on state react react button examples with hooks how to use state in react in class component react import setSate react class component update state react native usestate hook state to h1 react js reactjs hooks changes the state secong time s soon as the state of react component is changed, component will As soon as the state of react component is changed, component will react.js useState setstate on click how can a set state hook passed to component state hooke react import react usestate state in react simple example use state reactjs state in class react calling setstate or a variable in map react useState state in react class component use state in a put command react react set state where to put state in react application can state be added to functional component setstate function react react function with state inside functional component reactjs show if state has changed state in a function react js use state in a function react js manage state in functional component state on react componet state normal value of showing in function in react functional component react set multiple states state in a functional component how to make a react state for component usestate react documentation usestate react function state in react using updated state in react react use state hook state full component in react acces state in functional components react function component setstate declare function in state react js react state hook react use hooks in stateless component react const usestate react hooks multiple state states in functional components when to use state react constructor with state in react class state react usestate react hooks react set state of class setstate in hook react set state in hook react how to use state in functional component react js Which of the following is not a built-in React Hook? how to use hooks in react react hooks update state react native hooks example purpose of state react react usestate initial value react screen state based react screen state bsed react state functions react set state function react effects this.state in functional component react.js hook useState initial state react.js hook setstatte react hooks why does usestate take in a function states in react hooks add this.state to class react react usesate reactjs hooks setstate react.js usestate count variable in useState set state of one variable by another in react native functional component react how to read useState in jsx how to read useState in jsx react hooks examples what is state in react update state in function use state variable from app.js react how to usestate in react setState jsx useState method in reactjs updating state react create object from state values react adding new property to react state hooks react.js setState how to use local state in javascript useeffct react exmaple of state and set state in react js react functional component useState use state in functional component react js use this.state in function how to create state in react js apply state in react js class component adding state react react functional components state hooks how to count all the cities in react hooks add then to setState react hooks react use setate usestate variables examples react functional components using state how do you use data stored in react hooks state how to use usestate in react native usestate hook react react usestate component react state component react Where react hooks state this.state in react js what is this.setstate in react render state in react react usetsate hook how do states work react react state change function react state classes react class component state what is state react react hooks sample how to write state in a react component usestate for counter react react multiple usestates react documentation set state setting state with react class components react.js update useState usestate hooks reactjs react useState not a' react useState get the state reactjs useeffect satetset but not all components are updated reactjs useeffect in react js usescorll hook react useEffect how to set component to state in react react multiple state variables react useState onquit can react useState access other useStates numbers in react hooks reactjs render class is state state with function react how to pass setting function of usestate hook to other component what's state for reactjs add this.state to a const in react js set state jsx update state react react usestate hook mutlitple state react native call state in css setstate react functional component react this setstate how to use states in functions reasct update hook value functional component from previous to count+1 react functioncal component use state for an object Reacjs is used in which USA state the most which US states that use React js the most on state change react where to write headStle in react react class component with state state in react component use state in functional component access hook state from function component complete list of react hooks state variables reacts useeffect hook react const inside react hook add this.state in a const react user registration useState and SetState in react mutiple states in react hook react state change return on change state return react hooks on change state return react react use effect react function setState only set useSatte react import useState from state javascript react state components js react hooks update state parameter react hooks how to change one parameter in state variable setstate show component react on state change react native react native forget useState functional update react hooks how to watch over a state in react hooks react hook setstate on itrate useState hook in react react constructor state usestate react native setstate in hooks react native useeffect example BUild the State in React declare usestate in react with number react functional compement state react get class state react return state what are all the hooks in react call function to initialize state value react hook set state value from function react hook list of react hooks how to setstate in function component functional component react with state react usestate how to get state before render React JS State and Props setting state in functional component react state in class component react react functional component default state react native hook variable react state = function react state function return react usestate show correct answer react this.state vs usestate react hooks usestate and onclick react usestate intial for number react use state intial for number functional react js on update react native update state counter state reactjs understanding previousstate react in react what does previousstate do? how to setstate based on prop react functional components request handlers that update state react react when set state react useState() useeffect react what is change state after 7 sec react how to get value from hooks function react useState, return jsx how to add buttons react hook usewhyamibeingupdated react hook changes to state variable render after event reactjs react usestate gallery multiple state rendered inside a function useState reactnative use effect react states example reactjs react native + funcational component + useState + tutorial writing useState in functions paperthem switch save state react native satates in react react usestaa state inside function react standard react hooks state in react app usestate hook function update react const setstate component state in react react native usestate react native state react native funcation change state functional component react state count react react native setstate inclass component how to set state with setstate usestate react how to set state usestate react react native function state setstate in html tag in react js instances of state in react react useState [name] class component with state in react setstate in function component react react function component update setState childcompunent react hooks useState childcompunent react hooks change state react hooks how to use state in react native state react inside funciton react hooks use effect basic hooks react stat in react react useState per click add number hooks react update state inside aios react react update state data react userstate react functional component initial state useState function update react setstate in a function stateless components react object state state react setstate in react component use hooks in react component useeffect react usestate react native for number change state in REACT function what happens when state changes in react state in a function reactjs HOW TO USE react.usestate react square brackets functional componet usestate in functional component setstate functional component react component usestate how to define state in react use state in function class component reactjs using this.state inside this.state react component update specific state useState react docs cnage sate with react. hokks ...this.state in react usestate access state react react.js useState set once react native functional component setstate react usestate example react hooks create new state from other states react hooks create new state with 2 states React hooks set new state with two other states replace any declaration inside the constructor with react hooks how to access state in react hooks react 16 usestate isnotdefi react native setstate in a functional component how to handle state in react how to pass string as initial state in react usestate how to use state in react class react hook set state reactjs component update on state change import hooks react how to use usestate in react react not preserving state how to usestate in hooks of react react fc usestate react use a single variable in a useState setstate functional component react create to const varaibale for 1 function using react hooks how to add state to component react how to add state to functional component in react how to set state in react react function component usestate current state react hooks reactjs useState example how to use constructor and state in react function components react class state state with react functional component why to use state in react can use state contain jsx setstate in react multiple state in react component _this.state is not an object react setstate example in react js using state inside react in function state can be changed in react? set state reactjs update state react class state in react js react class component example with state make state in reactfunction useState hook where should you import it ywhere should you import use state react get state with hooks hooks examples react react hooks using setState react hooks using set what to functions have as states react react hooks state variables but no re render react old states to usestate every react component has stat react native update state with hooks react import state state in function react react use state can we use this state in function state functional component react react set stat update a name using react hooks usestate import react in html import React, { useState } from 'react'; usestate import react react functional components get state react functional components state react function component what setting a state does how to update state in react functional component usestate tutorial use state react falsestate function component react js userState react setcount state in functional component react native state in reactjs how to setstate of user text using hooks react how to set state of user text using hooks react how to set state using hooks react react functions and use state how to declair a state in a fucntion react useState first render usestate function react update state setstate react function can i use use state hook inside react function compinent name your usestate useState react es5 react usestate in class setState in react sortState react setstate react native setstate example for dvarious states react usestate hook setstate hooks how to write this state in functional component how to write state in functional component function components state import usestate react and from 'react' import usestate react react use state inside function initialize react state with function funciton initial state react usestate react two variable usestate react two variable string reatc usestate react update info on use state hooks react update info on setstate hooks react update info on setsatate how to set value in react hooks how to set state value in react hooks setstate recat usestate functional component load a react state in functional component how to set state iby hooks i can able to see only one state in my react component state variables react state class component react usestate hooks example set state react react class component with state example react useState without node react function to change state set state react hooks useState update useState during update use state react function state react hooks example setsatte react useState hooks usestate hook on a button react usestate hook in class how to use setstate hooks hooks const [value, setValue] = useState(props) react counter in functional component react state as props functional component setstate react setstate in functional component react react hooks state : state React.useState to send state react state in functional component react usestate in functional component useState() react usestate syntax react functional component usestate default set react hook usestate update JS state hook counter init calls in react functional component counter init calls in react in functional component using usestate change state inside functional component react react setState setstate in functional component setState updating state for locally react usestate set state hooks usestate how to render state react hooks how to call state usestate hook react hook refresh useState react check if state changed functional setState react usestate react class create new state per user react set state in functional component react functioanloal componset set state react understanding usestate setstate documentation useState example react functional component state variables using functions in state hooks using states in react passing a state variable ways to set state react usestate class component usestate multiple usestate multiple states react class state component using state value in react functions react hook state update state in hooks change state in hooks state in function component react react usestate use function usestate react button state in react import usestate useState how to update state with hooks react update functional component usestate in react number of states of a component react react increment state hook how to setState in cont REACT react functional state functional component react usestate how to set props to state in react js in functional components using state in functional component usestate react reactjs componentdimount update setting state in function react native binding functions in react hooks react js use use state in functional component react react state function use state in react using state react for users using state react react function component state use state react how to use state in react function state react react native use state using stestate in functional component react function component state how to use state react using localstate inside of react use state to class react react call function on state change functional component
https://www.codegrepper.com/code-examples/javascript/functional+component+react+with+state
CC-MAIN-2021-10
en
refinedweb
Developing a Workflow This chapter describes how to develop a workflow and add it to a production. The next chapter provides details on optional customizations you can perform during development. This chapter includes the following topics: Designing the Workflow Process Creating and Adding the Workflow Process Adding the Workflow Operations to a Production The appendix “Exploring the Workflow Sample” presents a simple example, available within the ENSDEMO namespace. Overview The following diagram shows workflow elements in a production: These components are as follows, from left to right: A message request class carries the specific details of the workflow from its originator elsewhere in the production. This is a standard message request class that you define, that is, a subclass of Ens.Request or some (less often) another persistent class. A message response class carries the specific details of the workflow back to the originator, once the task has been completed or otherwise handled. This is a standard message response class that you define, that is, a subclass of Ens.Response or some (less often) another persistent class. This book does not provide any special details on defining this class or the corresponding request class, because the implementation is completely dependent on your needs. A workflow process that serves as the coordinator of the communications. To create this: Use the Business Process Designer and create a business process based on the class Ens.BusinessProcess.BPL. It must contain the logic to receive the inbound messages and to call (asychronously) to business operations in the same production, as needed. Add the business process to the production as usual. A special message class EnsLib.Workflow.TaskRequest carries requests from the business process. Likewise, the special message class EnsLib.Workflow.TaskResponse carries replies from the Workflow Engine. You can create and use subclasses, but that is not generally necessary, because these classes are designed to carry information in a flexible manner. Each workflow operation receives task requests and communicates with the Workflow Engine, which makes tasks visible to specific users. In particular, each workflow operation has exactly one associated workflow role. The workflow operation makes tasks visible to all users who belong to that workflow role; other users do not see these tasks. To create each of these, you add a business operation based on EnsLib.Workflow.Operation. Little configuration is needed. Or you can subclass EnsLib.Workflow.Operation and implement its callback methods to interact with the Workflow Engine in a custom way. Designing the Business Process The first step is to design the business process class and make some key decisions. Identify where calls to workflow (human processes) will occur. Each of these calls is a task; name each task. Name each workflow role to which a task is sent. Decide on a task distribution strategy for each task (perhaps the default strategy). Create any message types needed to invoke the business process. This book does not provide any special details on defining these messages, because the implementation is completely dependent on your needs. Create the business process class as described in the next section. Creating the Workflow Process To create the workflow process, use the Business Process Designer as described in Developing BPL Processes. For each task in the business process: Provide a <call> to invoke the workflow operation asynchronously. In the <call> identify the destination workflow operation by name. Each workflow operation is associated with exactly one workflow role, which in turn corresponds to a configurable set of users. In the <call> use the correct task request object (EnsLib.Workflow.TaskRequest or a subclass) and sets its properties. The <call> should also examine the task response object (EnsLib.Workflow.TaskResponse or a subclass), and use it to set the BPL context variable for use in later processing. Provide a <sync> to catch the results of the asynchronous <call>. For an example, see the appendix “Exploring the Workflow Sample.” Defining the Task Request Each <call> in the process should use EnsLib.Workflow.TaskRequest or a subclass as its message class. To define the request, the <call> should set properties of the callrequest variable. The following table lists the available properties in EnsLib.Workflow.TaskRequest. These properties are all optional, but of course your business process must send all the information that the Workflow Engine needs. Using the Task Response As noted earlier, the <call> for a given task should also examine the task response object (EnsLib.Workflow.TaskResponse or a subclass), and use it to set the BPL context variable for use in later processing. EnsLib.Workflow.TaskResponse defines the following properties: Adding the Workflow Process to the Production To add the workflow process to a production, do the following: Display the production in the Ensemble, Production Configuration page of the Management Portal. To access this page, click Ensemble, click Configure, click Production, and then click Go. In the Processes column, click the Add button (a plus sign). Ensemble displays a dialog box. For Business Process Class, select the class you created in the Business Process Editor. For Process Name, type a suitable name. Click OK. For information on other settings, see Configuring Ensemble Productions. Adding the Workflow Operations to a Production To add a workflow operation to a production, do the following: Display the production in the Ensemble, Production Configuration page of the Management Portal. To access this page, click Ensemble, click Configure, click Production, and then click Go. In the Operations column, click the Add button (a plus sign). Ensemble displays a dialog box. Click the Workflow tab. Select the EnsLib.Workflow.Operation class from the Class Name list. Or select your custom subclass. For Operation Name, type the name of this business operation. The name must match the target attribute in the corresponding <call> from the BPL business process. Optionally click Auto-Create Role. If enabled, this option causes Ensemble to automatically create a workflow role whose name is identical to Operation Name. You can enable this setting later, if wanted. Click OK. For information on other settings, see Configuring Ensemble Productions. Next Steps Associate workflow users with the appropriate workflow roles. See “Managing Workflow Roles, Users, and Tasks” in Managing Ensemble. Test the workflow as described in the chapter “Testing a Workflow.” Optionally add a dashboard so supervisors can monitor workflow progress. Ensemble automatically collects certain workflow metrics. The general development and configuration tasks are as usual: Create one or more business metric classes. See “Defining Business Metrics” in Developing Ensemble Productions. Each class can invoke methods of the class EnsLib.Workflow.Engine, which provides methods that report statistics about workflow roles. For quick reference, these are listed in the appendix “Available Workflow Metrics.” When configuring the production, add each business metric as a business service. Define dashboards. See “Defining Dashboards” in Configuring Ensemble Productions.
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=EGWF_DEV
CC-MAIN-2021-10
en
refinedweb
. Dependencies This library makes use of: - pyusb for USB-printers - Pillow for image printing - qrcode for the generation of QR-codes - pyserial for serial printers Documentation and Usage The basic usage is: from escpos.printer import Usb """ Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) """ p = Usb(0x04b8,0x0202,0). 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/python-escpos/
CC-MAIN-2018-26
en
refinedweb
This chapter provides an overview of the triple index in MarkLogic Server and includes the following sections: The triple index is used to index schema-valid sem:triple elements found anywhere in a document. The indexing of triples is performed when documents containing triples are ingested into MarkLogic or during a database reindex. The triple index stores each unique value only once, in the dictionary. The dictionary gives each value an ID, and the triple data then uses that ID to reference the value in the dictionary. all new installations of MarkLogic 9 and later, the triple index and collection lexicon are enabled by default. Any new databases will also have the triple index and collection lexicon enabled. This section covers the following topics:, as described in Sizing Caches. The triple cache holds blocks of compressed triples from disk, which are flushed using a least recently used (LRU) algorithm. Blocks in the triple cache refer to values from a dictionary. The triple value cache holds uncompressed values from the triple index dictionary. The triple value cache is also a least recently used cache. Triples in the triple index are filtered out depending on the query timestamp and timestamps of the document they came from. The triple cache holds information generated before the filtering happens, so deleting a triple has no effect on triple caches. However, after a merge, old stands may be deleted. When a stand is deleted, all its blocks are flushed from the triple caches. Cache timeout controls how long MarkLogic Server will keep triple index blocks in the cache after the last time it was used (when it hasn't been flushed to make room for another block). Increasing the cache timeout might be good for keeping the cache hot for queries that are run at infrequent periods. Other more frequent queries may push the information out of the cache before the infrequent query is re-run. triple index stores positions if the triple positions is enabled. See Enabling the Triple Index. The type store has an index file that stores the offset into the type data file for each stored type. This is also mapped into memory. This table describes the memory-mapped index files that store information used by the triple indexes and values stores. By default, the triple index is enabled for databases in MarkLogic 9 or later. This section discusses how you would enable the triple index or verify that it is enabled. It also discusses related indexes and configuration settings. It includes the following topics: The triple index can be enabled or disabled on the Admin Interface () database configuration page. The hostname is the MarkLogic Server host for which the triple index is to be enabled. For more information about index settings, see Index Settings that Affect Documents of the Administrator's Guide and Configuring the Database to Work with Triples. For all new installations of MarkLogic 9 and later, the triple index is enabled by default. Any new databases will also have the triple index enabled. You may want to verify that existing databases have the triple index enabled. Use the following procedures to verify or configure the triple index and related settings. To enable the triple positions index, the in-memory triple index size, and collection lexicon, use the Admin interface () or the Admin API. See Using the Admin API for details. In the Admin Interface, scroll down to the triple index setting and set it to true. When you enable the triples index for the first time, or if you are reindexing your database after enabling the triple index, only documents containing valid sem:triple elements are indexed. You can enable the triple positions index for faster near searches using cts:triple-range-query. It is not necessary to enable the triple position index for querying with native SPARQL. You can set the size of cache and buffer memory to be allocated for managing triple index data for an in-memory stand. When you change any index settings for a database, the new settings will take effect based on whether reindexing is enabled ( reindexer enable set to true). Use these Admin API functions to enable the triple index, triple index positions, and configure the in-memory triple index size for your database: This example sets the triple index of 'Sample-Database' to true using the Admin API: xquery version "1.0-ml"; import module namespace admin = "" at "/MarkLogic/admin.xqy"; (: Get the configuration :) let $config := admin:get-configuration() (: Obtain the database ID of 'Sample-Database' :) let $Sample-Database := admin:database-get-id( $config, "Sample-Database") let $c := admin:database-set-triple-index($config, $Sample-Database, fn:true()) return admin:save-configuration($c) This example uses the Admin API to set the triple positions of the database to true: xquery version "1.0-ml"; import module namespace admin = "" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $Sample-Database := admin:database-get-id( $config, "Sample-Database") let $c := admin:database-set-triple-positions($config, $Sample-Database, fn:true()) return admin:save-configuration($c) This example sets the in-memory triple index size of the database to 256MB: xquery version "1.0-ml"; import module namespace admin = "" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $Sample-Database := admin:database-get-id( $config, "Sample-Database") let $c := admin:database-set-in-memory-triple-index-size($config, $Sample-Database, 256) return admin:save-configuration($c) For details about the function signatures and descriptions, see the admin:database functions (database) in the XQuery and XSLT Reference Guide. This section includes the following topics: The triple cache and the triple value cache are d-node caches, which are partitioned for lock contention. This partitioning enables parallelism and speeds up processing. The maximum sizes of the caches and number of partitions are configurable. To change the triple or triple value cache sizes for the host, you can use the Groups configuration page in the Admin Interface or use the Admin API. In the Admin Interface () on the Groups configuration page, specify values for caches sizes, partitions, and timeouts: This table describes the Admin API functions for group cache configurations: During a merge, triple values and types may become unused by the triple index. To merge the triple index in a single streaming pass, type and value stores are merged before the triples. Unused values and types are identified during the merge of the triples. During the next merge, the unused types and values identified are be removed, releasing the space they previously used. For best compaction, two merges are needed. This is not an issue in normal operations because MarkLogic Server is designed to periodically merge. Since the type store is ordered by frequency, it is merged entirely in memory. The value and triple stores are merged in a streaming fashion, from and to disk directly. For more information about merging, see Understanding and Controlling Database Merges in the Administrator's Guide. Since SPARQL execution does not fetch fragments, there is the potential to scale back on expanded and compressed tree caches on triple-only deployments. You can configure tree caches from the Group configuration page in the Admin Interface, or by using these functions: admin:group-set-expanded-tree-cache-size admin:group-set-compressed-tree-cache-size You can monitor the status of the database and forest from the database Status page in the Admin Interface: You can also use the MarkLogic monitoring tools, Monitoring Dashboard and Monitoring History: For more information, see Using the MarkLogic Server Monitoring Dashboard in the Monitoring MarkLogic Guide. You can also use these functions for query metrics and to monitor the status of forests and caches:
http://docs.marklogic.com/guide/semantics/indexes
CC-MAIN-2018-26
en
refinedweb
public class KeyStroke extends AWTKeyStroke. Keymap, getKeyStroke(char) equals, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStrokeForEvent, getKeyChar, getKeyCode, getKeyEventType, getModifiers, hashCode, isOnKeyRelease, readResolve, registerSubclass, toString clone, finalize, getClass, notify, notifyAll, wait, wait, wait public static KeyStroke getKeyStroke(char keyChar) KeyStrokethat represents a KEY_TYPEDevent for the specified character. keyChar- the character value for a keyboard key @Deprecated) KeyStrokethat represents a KEY_TYPEDevent for the specified Character object and a set of modifiers. Note that the first parameter is of type Character rather than char. This is to avoid inadvertent clashes with calls to getKeyStroke(int keyCode, int modifiers). The modifiers consist of any combination of following: keyChar- the Character object for a keyboard character modifiers- a bitwise-ored combination of any modifiers IllegalArgumentException- if keyChar is null InputEvent public static KeyStroke getKeyStroke(int keyCode, int modifiers, boolean onKeyRelease) onKeyRelease- trueif the KeyStroke should represent a key release; falseotherwise. KeyEvent, InputEvent public static KeyStroke getKeyStroke(int keyCode, int modifiers) KeyEvent, InputEvent NullPointerException- if anEventis null Key.
https://docs.oracle.com/javase/8/docs/api/javax/swing/KeyStroke.html
CC-MAIN-2018-26
en
refinedweb
- Hour 8: Windows Client for the Four Function Calculator - Building a Proxy Class with WSDL.exe - Summary - Q&A - Workshop Building a Proxy Class with WSDL.exe An alternative to using the Visual Studio.NET Web Reference wizard to create your proxy classes is a DOS utility called WSDL.exe. WSDL.exe, although much more complicated to use than the Visual Studio tool, provides far greater control over the DLL that is created. Another great benefit of the WSDL.exe is that it is built into the .NET framework. This means that developers creating ASP applications without the benefit of the Visual Studio.NET tool set can create proxy classes, compile them using a set of DOS compilers, and consume Web services in their applications. Listing 8.2 shows the syntax for using the WSDL.exe. The switches, any of the commands proceeded by a /, are used to set various parameters of the utility. Switches in brackets, [], are optional, and if left off will either revert to some default or not be used at all. Listing 8.2 The Syntax for the WSDL.exe WSDL.exe [/language:] [/protocol:] [/namespace:] [/username] [/password] [/domain] [/out:] <url or path> Table 8.1 shows the various switches used by the WSDL.exe application. The switches pertaining to working with a proxy server and to switching base URLs have been left out. If you need to accomplish one of these tasks, you can get help by simply typing Wsdl /? Table 8.1 WSDL.exe's Switches The out switch and path or url are the two settings that you will need to concern yourself with the most when creating proxies. In order to create a proxy, the out switch needs to be set to a valid file namefor example, SomeName.VB, in the case of a Visual Basic proxy. The path needs to be set to the URL or local file path of the Web Service's WSDL file. NOTE It is a good idea to use a tool such as Internet Explorer to confirm the path to a Web Service's WSDL file before you enter it into the WSDL.exe's path switch. Errors will result if the path switch has the utility pointing to an incorrect URL. Creating the Four Function Calculator's Proxy with WSDL.exe Open a DOS Window and, at the C prompt, type in the command in Listing 8.3. This will create a proxy class called FourFunctionCalc.cs and place it in a directory called book on your C drive. Feel free to modify the directory that you save the proxy class to. The command also gives the proxy a namespace of FourCalc. Listing 8.3 Using WSDL.exe to Create a Proxy Class for the Four-Function Calculator C:\>WSDL.exe /language:CS /namespace:FourCalc /out:c:\Captures\FourCalc.cs http:\\localhost/FourFunctionCalc/Service1.asmx?sdl NOTE You can use the optional language tag to create the proxy class in Visual Basic if you wish to examine the code and are more comfortable with Visual Basic. There is almost never a reason to alter this class yourself. For the purposes of this example, you can let the proxy be created using the default language, C#. Figure 8.8 shows how the DOS window should appear if you have successfully created your proxy class. Figure 8.8 Creating the Four Function Calculators Proxy Code Now, you can compile the class into a usable dll. This can be done by either opening the class in Visual Studios, or by using one of the command line compilers that ships with the .NET framework. Those compilers, reachable through a DOS prompt, are csc, to compile C# code, and vbc, for compiling Visual Basic code. With these compilers, it is possible, though not at all advisable, to write complete programs in a Word Processor, even one as simple as Notepad, and compile them. Listing 8.4 shows the command syntax for compiling your C# class. Listing 8.4 Compiling the Proxy Class 1: C:\>csc /t:library /r:System.Web.Services.dll 2: /out:c:\Book\FourCalc.dll c:\Captures\FourCalc.CS NOTE The command in Listing 8.4 should be entered in as one continuous line with space appearing before each / switch. The /t or target switch is set to library, which lets the compiler know that you are trying to create a DLL. The /r or reference switch tells the compiler to include a reference to System.Web.Services.dll. The final switch of the command is the /out switch, which sets the name and path of the DLL you wish to create. In this case, you are creating a DLL called FourCalc to be placed in the directory c:\Book. You may feel free to change the directory to whatever you like. The last portion of the command is the path to the proxy class that was created by the WSDL.exe, c:\Captures\FourCalc.cs or whatever path you saved the file to. To obtain help on the csc, C# compiler, type in the following command at a DOS prompt: csc /? In order to obtain help on the Visual Basic command line compiler, vbc, type the following in at a DOS prompt: vbc /? These compilers include the ability to generate bug reports, link additional resources, set precompiler directives, and much more. Adding a Reference to a Proxy DLL Once you have created and compiled the FourCalc.dll, you can begin using it in your client applications. Create a new Windows application called FourCalcClient to act as the client to your new proxy. Inside your new project, create a form identical to the one you created in the CalcClient application (see Figure 8.1 for the form's layout). You can now add a reference to your FourCalc proxy. This time, because the proxy is already created and local, you will add the reference the way you would any other DLL. Choose Add Reference from the Project menu to bring up the Add Reference dialog. From there, choose Browse and navigate to your FourFunc.dll. Figure 8.9 shows the Select Component dialog for finding components. Figure 8.9 Adding a reference to the four function calculator's proxy. Now that you have found and selected your component, add a reference to the System.Web.Services.dll. You should see both DLLs at the bottom of the Add Reference screen, in the Selected Components window (see Figure 8.10). Figure 8.10 Adding all the references to the four function calculator. Using the WSDL.exe-Generated Proxy Class After you have added your references, using the XML Web service proxy is just like using the proxy generated by Visual Studio .NET, except that you have control over the location of the DLL and can reuse the DLL in additional projects without having to go through the trouble of using the Add Web Reference dialog again. To create an instance of the FourCalc.dll's Service1 object, add the following line to the general declarations section of your FourCalcClient's Form1: Dim oCalc As New FourCalc.Service1() After creating the oCalc object, you can add code to the button events of Form1. The code for these events is identical to that of the CalcClient application, shown in Listing 8.1. You can now run the application and verify that both versions of the four-function calculator's clients behave in exactly the same manner.
http://www.informit.com/articles/article.aspx?p=29399&seqNum=3
CC-MAIN-2018-26
en
refinedweb
How to bind DataGrid to a list of Hashtable objects (or any IEnumerable of IDictionary) Contents Introduction Are the traditional .NET languages, C# and Visual Basic, truly dynamic languages? Well, we all know the answer to that question: They are not. Ok, but if they can be used in the same way that we normally use dynamic languages then, perhaps, in a sense they are dynamic. So can we use those languages in some situations as if they were dynamic? My hope is that, after reading this article, you will agree that the answer to that question is a qualified “Yes”. I believe that the best way to illustrate this is to demonstrate how it can solve a common programming problem. The DataGrid and many of the controls, developed by Microsoft are designed in a way so to expect a list of typed objects as a data source. There are many good reasons for that; but, if we assume for a moment that there might be also a benefit of binding a DataGrid to a list of Hashtables without having to change the controls, wouldn’t that be an example of the dynamic capabilities of .NET languages? If we can turn a list of key value pairs into a class with corresponding properties, then that would certainly be an example of crossing the barrier between dynamic data and static types: We have to be able to do that at run time, of course. Why would you need to perform such a task? Well, you may need to do it if the number and type of the columns in your DataGrid is something that you can’t predict at design time. This would be the case if, for example, you require that the columns in the grid will display items previously chosen by the user. There are several alternative programming strategies you could use to handle this, and the approach I’m about to describe is among them. I will discuss the other ways later in this article. How to use it You would expect that the way to pass dynamic data to the control should be very similar to a traditional dynamic language. Adding a key to Hashtable or IDictionary of (string, object) is just like adding a dynamic property to a dynamic object. In a dynamic language you would use something like this: In a .NET language you can do likewise, by using IDictionary. So our code, could look like that: or in Visual Basic (without the yield return statement) If we were allowed to bind IDictionary to a DataGrid we could just use this code:If we were allowed to bind IDictionary to a DataGrid we could just use this code: But you cannot bind a list of Hashtables or Dictionaries to DataGrid. If you attempt this, you will actually bind the properties of the collection object and not the key because value pairs are treated as object properties. There is just one more thing we have to do in order to make that work. We have to define an extension method ToDataSource() of the IEnumerable of IDictionary. The method will transform the list of dictionaries into a list of typed objects with each key turned into object property of the corresponding type. So our binding method will have to be modified just as: There is no such method defined by the .NET framework for IEnumerable of IDictionary so we have to define it, and much of this article describes how that works. You can also see the attached source of that extension method for both C# and Visual Basic. Here we see one of the amazing aspects of .NET 3.5: we have the means to define a method for an interface as an extension method. This is also one dynamic feature in the framework because we don’t have to modify the definition of IEnumerable of T – something we would not be able to do anyway because this is as interface and yet we can make that method a part of the IEnumerable of IDictionary, by a simple inclusion of the extension method class into the current code. One more using statement and your interface is enriched with a new method. I have to stress here that overusing this feature may result in an abundance of unneeded methods but I think we can safely assume that anytime you have IEnumerable of IDictionary you can expect that it may be designed for transformation into a collection of typed objects. The extension method will use the first IDictionary entry as a template for a newly created typed object. If the next IDictionary contains more properties then they will be ignored, if it contains fewer then the properties will be assigned with the default values. Each key of IDictionary must be alphanumeric and start with character – because it will be transformed into an object property. If it is not alphanumeric then an exception will be thrown. If the keys of IDictionary are not strings they will be transformed to strings by calling ToString() method. If you end up with a key collision because of different dictionary key objects resulting in the same string then an exception will be thrown. It all may look like a lot of rules, but if you always use strings as keys for the IDictionary as you would in a dynamic language, and make sure that all IDictionary entries have the same keys with the same types, it will just work. If you want column headers in the grid even if your collection contains no data, you would have to define columns of the grid and set the AutoGenerateColumns property to false. Despite all the reflection, the code works fine in a middle trust environment of a typical shared hosting. You could also use the same code not only for traditional .NET applications but for Silverlight projects as well. In fact I came to the idea of using this extension method while working on a Silverlight application. In Silverlight 2.0 you have no Hashtables, so there you would use Dictionary of string and object. I find it quite exciting that, within the limited range of Silverlight framework, you can use so powerful data transformation techniques based on reflection. You don’t need to change anything to make it work in Silverlight. Just use the same code. Static vs. Dynamic – system architecture concerns I am sure some developers would be convinced that we shouldn’t use the technique I’ve described, because there is a reason for a DataGrid not to accept dynamic data. The argument, in a nutshell, is that the dynamic data does not enforce the data constraints and therefore opens a potential risk of errors. This isn’t the place for the endless discussion of the merits of Static vs. Dynamic languages, but I cannot pass this topic without even mentioning it. I agree that in general we have to try to restrict the data to the constraints it should follow. This is especially true when we talk about data operations within the business layer, where the application business logic resides. However in the user interface layer, we can be a little bit more liberal if that will make us more agile and if it will help to implement UI changes easier, quicker and with less code. I think that the area of user interface data binding is a perfect place for a more dynamic approach. It has to be said as well, that if you want to add a data verification code just between the method generating IEnumerable of IDictionary and the call to ToDataSource extension method you are free to do so. There is nothing that prevents you from doing that. I personally believe that both dynamic and static code have their place in the architecture of one enterprise system. The business layer should be more static and the user interface can be more dynamic. But whatever is your opinion on this topic I believe you will agree with me that having one additional tool in your arsenal will not be a bad idea. And the approach I describe here is just another tool to pass dynamic data into a UI control that expects a collection of statically typed objects. Alternative ways to pass dynamic data to a DataGrid Internally the grid will check for the first item in the collection if it is ICustomTypeDescriptor. If it is not, then the properties of the object will be used for column binding. If it is, then the TypeDescriptor.GetProperties static method will transform that object into a collection of PropertyDescriptors. So defining your collection, as ICustomTypeDescriptor would be the classical way of passing dynamic data into a .NET control. This is because many of the .NET controls will check for the type to see if it is ICustomTypeDescriptor. Here is a reference to Windows Forms code send to me by Lionel WindowsApplicationDataBinding.cs The code here achieves the same goal as the code I propose; the transformation of IDictionary into a collection that can be bound, but it is based on PropertyDescriptors and ICustomTypeDescriptor interface. I find it to be a very impressive code and would certainly advise you to check it. It has some significant advantages – it does not use reflection and it does not have the restriction that the property has to start with letter. But despite all the advantages this approach also has some drawbacks. Even though the Windows Forms DataGridView works fine with it, web forms DataGrid could not auto generate columns based on that code, so there you’d have to define the columns by yourself. But the biggest problem is that the code would not work in Silverlight because there is no PropertyDescriptor object defined by the Silverlight framework. Another way to apply dynamic data to a DataGrid would be to generate DataSet out of Hashtable or XML or anything dynamic. If you choose this way you would have to do some more work to generate the DataSet. You could also populate DataGrid with many other techniques that are not direct data binding but I will not discuss them, as they are not pure techniques of data binding – passing a collection of data and attaching the data elements to the UI. All those methods should be considered as valid choices with their advantages and disadvantages. The reason that I prefer the dynamic solution I’ve described is that it will work without any changes for Windows Forms, Web Forms and Silverlight. It can also be used for a wider range of goals beyond data binding because the objects generated are valid .NET types. The method I propose offers very clean and simple interface – a single extension method transforms “dynamic” object into typed one. The disadvantage of this idea is in the fact that using reflection will have some performance implications – each binding will result in a separate new dynamic assembly. For a web project where you have thousands of users viewing the grid simultaneously you would rather choose the solution proposed by Lionel, but for a single Windows Forms user you should not expect to notice any performance drawbacks and the same is true for a Silverlight project. As a matter of fact Silverlight is probably the best candidate for that solution because the more traditional ways are not available there and yet this is a single client executing on the client machine and not on the server. If solving this task is all you are interested in, then you can get the Visual Basic DataSourceCreator.vb or C# DataSourceCreator.cs source, where the ToDataSource extension method is defined and just use it in your code the way it was described above, but if you want to understand how it actually works, please read the next part of this article. What if you use .NET 2.0 and not 3.5? I chose to develop this idea using C# 3.0 feature of extension methods as I find this to be a very elegant way to extend the functionality of common interfaces very similar to the idea of extending a dynamic object by simply adding a new method. However if you use .NET 2.0 you could still use my code. You would only have to change method definition by removing this keyword to be as or in Visual Basic, change To remove the attribute Extension and have the method just as Then in your code simply use it as a static method: How does it work? Here is what happens inside the extension method. First of all I generate dynamic assembly and I call it “TempAssembly” plus the hash code of the IEnumerable collection. I then define the type of the object will be public class. After that, I get the first IDictionary in the IEnumerable to be used as a template for the newly generated statically typed object. First I check with a regular expression that each key is alphanumeric and starts with letter so it can be transformed into property name. This is the regular expression I have used: If the key does not follow this constraint, then I throw an application exception. Then for each key I generate a property. In .NET on a lower level getter property is transformed to get_<PropertyName>() method and setter property is transformed to set_<PropertyName>(value) method. So I generate both setter and getter and the private field lying underneath. The private field starts as usual with an underscore character. I get the type for the properties and private field from the current value in the IDictionary. If the value is NULL then the property is of type object. Here is how the code generating properties looks: After that, the process of object creation is completed, and you may think that we are done here – let’s just put it into an array of objects and this is all. Unfortunately this is not a good idea because UI controls may use the type of the collection for their internal functionality. Thus the Silverlight DataGrid has sorting functionality that is implemented based on a reflection of the bound collection. I assume that they do this because they want to be able to know what columns they have even if the collection is empty. But that means that we have to pass a collection not of general object type but of the dynamic type we have just generated. This is the way we do that: As you can see, I generate a generic type List of our object type, then I instantiate it with the activator. After that I traverse each IDictionary DictionaryEntry, matching it with the corresponding property in order to set the value. Here we will get an exception if the type of the first IDictionary key is not the same as the type of the corresponding current IDictionary key. You may ask here if all this reflection work will have significant performance implications, and I need to clarify that the length of the list of IDictionary objects will not have such performance implications because all the reflection work that I’ve described is being applied to the first IDictionary only. After that, the type is already created and everything is just as if you were binding a regular collection of predefined typed objects. In other words a slow down due to the reflection operations can be expected if you generate a huge number of columns / properties, but should not be expected because of a huge number of records. This is because all records except the first one are processed with a type defined in assembly that has already been loaded into the framework. But still each binding will result in a creation of a dynamic assembly. This is not a problem for a single Windows or Silverlight application but might be a problem for multi-user server. Summary The solution that I’ve described here will be among your first choices for a Silverlight project where you have much more limited set of options. It is one of the many options in Windows Forms and can be applied in Web Forms, though it may not be the best choice in this case because each page visit results in a new assembly being generated on the server. The ability to dynamically generate typed objects makes .NET a really powerful environment. We can retain the constraints of the statically typed objects and at the same time benefit from the agility of the dynamic data. Data binding of the user interface is a critical point where the dynamic data has to be presented in a way that isn’t known at design time. Once we know how to transform IDictionary into a typed object we can just use Hashtables as if they were dynamic objects – and this is what has been demonstrated in this article. I hope that now you will agree with me in my conclusion that .NET languages C# and Visual Basic can be used just as regular dynamic language for data binding of user interface controls. As always, the C# and VB code is downloadable from the bottom of the article. Vladimir’s blog on is always well-worth reading.
https://www.red-gate.com/simple-talk/dotnet/net-framework/dynamically-generating-typed-objects-in-net/
CC-MAIN-2018-26
en
refinedweb
Opened 6 years ago Last modified 4 years ago #2219 new enhancement Support reconfig-by-restart Description (last modified by dustin) Best practices for buildbot configuration are to have modular config of some sort. Don't ship with an example that doesn't follow best practices. <@exarkun> (Heck, the sample deployment _starts_ as a mess; to avoid a mess, you'd have to clean it up the config distributed with buildbot) Change History (6) comment:1 Changed 6 years ago by dustin comment:2 Changed 6 years ago by tom.prince That won't be an issue, once we reconfig by graceful shutdown. comment:3 Changed 6 years ago by bdbaddog I've got a pretty stable modular config which handles reconfig's well. The main trick was to get rid of : from XYZ import a,b,c Since those aren't re-evaluated on reconfig. However doing something like: import XYZ a=XYZ.a b=XYZ.b c=XYZ.c Seems to handle reconfig well. comment:4 Changed 5 years ago by ewong I tried the following: import buildbot.status html=buildbot.status.html I get the following error during checkconfig: (sandbox)bash-4.1$ buildbot checkconfig master error while parsing config file: Traceback (most recent call last): File "/home/cc/projs/bb9/master/bin/buildbot", line 4, in <module> runner.run() File "/home/cc/projs/bb9/master/buildbot/scripts/runner.py", line 743, in run sys.exit(subcommandFunction(subconfig)) File "/home/cc/projs/bb9/master/buildbot/scripts/checkconfig.py", line 50, in checkconfig return cl.load(quiet=quiet) File "/home/cc/projs/bb9/master/buildbot/scripts/checkconfig.py", line 29, in load self.basedir, self.configFileName) --- <exception caught here> --- File "/home/cc/projs/bb9/master/buildbot/config.py", line 156, in loadConfig exec f in localDict File "/home/cc/projs/playground/c-c/master/master.cfg", line 116, in <module> html=buildbot.status.html exceptions.AttributeError: 'module' object has no attribute 'html' Configuration Errors: error while parsing config file: 'module' object has no attribute 'html' (traceback in logfile) comment:5 Changed 5 years ago by dustin Right, that won't work - Python doesn't automatically import all sub-modules of a package. I'm not sure what prompted you to try that? comment:6 Changed 4 years ago by dustin - Milestone changed from 0.9.0 to 0.9.+ - Summary changed from Make sample configuration modular. to Support reconfig-by-restart I'm re-purposing this bug to be about reconfig by starting a new master and cleanly stopping the running master. This is a plan for nine or one-oh, when multi-master is fully and automatically supported. Even then, it will only work if you're not using sqlite. Modular configs lead to difficulty with reloading, so they're not for the faint of heart. I'm not sure that the initial recommendation should look like that.
http://trac.buildbot.net/ticket/2219
CC-MAIN-2018-26
en
refinedweb
Red Hat Bugzilla – Bug 427617 Python.h unconditionally (re)defines _XOPEN_SOURCE Last modified: 2008-01-31 18:08:39 EST Description of problem: The Python.h header unconditionally defines _XOPEN_SOURCE, even if it's already defined. This causes redefinition errors in kdebindings (PyKDE4) with GCC 4.3. Version-Release number of selected component (if applicable): python-2.5.1-19.fc9 How reproducible: Always Steps to Reproduce: 1. Try building kdebindings in Rawhide with GCC 4.3. Actual results: In file included from /usr/include/python2.5/pyconfig.h:6, from /usr/include/python2.5/Python.h:8, from /usr/include/python2.5/sip.h:29, from /builddir/build/BUILD/kdebindings-3.97.0/x86_64-redhat-linux-gnu/python/pykde4/sip/solid/sipAPIsolid.h:28, from /builddir/build/BUILD/kdebindings-3.97.0/x86_64-redhat-linux-gnu/python/pykde4/sip/solid/sipsolidpart1.cpp:24: /usr/include/python2.5/pyconfig-64.h:944:1: error: "_XOPEN_SOURCE" redefined <command-line>: error: this is the location of the previous definition Expected results: No error 1. Python isn't exactly "well namespaced". 2. This file is providing information you can't get any other way, about what Python thinks the environment is. 3. pytohon*/*.h can/do trigger off these headers, so if you don't include Python.h _first_ (so the same features are visible) you are taking your compiles into your own hands IMO. ...feel free to file upstream, but this isn't something I want to change. You're misunderstanding me: all I'm asking for is to change this: #define _XOPEN_SOURCE 600 to: #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 or: #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 #endif or maybe, to make it absolutely correct: #if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE<600 #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 #endif all 3 of which will have absolutely no effect on programs which are already working right now, but will all fix kdebindings. Oh, and to implement the #undef solution, adding: #undef _XOPEN_SOURCE to the top of the multilib hack /usr/include/python2.5/pyconfig.h (before including the wordsize-specific version) should be enough. If you think that'll fix your problem, and cause no other problems, just do the #undef manually before including pyconfig.h To expand on point #3, it doesn't really matter what the header _changes_ _XOPEN_SOURCE to after features.h has been included and other parts of the the python headers can be relying on those features being enabled. So IMNSHO, anything using pyconfig.h should be including it first ... so that features.h gets setup correctly, or alternatively set everything up manually with the required #define's and #undef's (good luck with that). I understand that just putting this hack in pyconfig.h now will probably not do anything bad, but I'd have to make sure it continues to not do anything bad for each new upstream change we take ... and again, it gives people an unrealistic impression of how they can/should be using pyconfig.h. 1. This is generated code, we'd have to hack the sip generator to add the #undef, there's probably no way it can be fixed in kdebindings (except possibly by filtering out the -D_XOPEN_SOURCE from the command line, but I don't even know where this is set, probably a global cmake or KDE setting). 2. The sources _are_ including pyconfig.h first, the existing _XOPEN_SOURCE definition comes from the command line, not some other header. 3. I believe the correct solution is really to fix this in Python. A header must not blindly assume that feature macros like this are not set, many projects set these in the command line. And 4. I don't understand this resistance to a change which will change absolutely nothing except to make projects which currently have redefinition errors from GCC 4.3 compile again (and makes them do the exact same thing they always did with GCC 4.1). I can reassign this against sip, of course, but I believe adding the #undef in sip would be a crude hack around a bug in Python, which is likely to affect other Python-using software too, not just sip-generated bindings, and which is trivial to fix correctly. Ok, if you can show me one other thing that puts -D_XOPEN_SOURCE on the command line ... I'll work around it for that case, but that's a pretty poor thing to do IMNSHO. Googling for "-D_XOPEN_SOURCE" (with the quotes) returns thousands of results. Also searching for: "-D_XOPEN_SOURCE" Python.h in Google shows that at least (some versions of) SuperKaramba and mod_python are using both -D_XOPEN_SOURCE on the command line and #include <Python.h>. They may have their own workarounds for this issue though, and AFAIK this issue also only affects C++ (it's still a warning in C). > Googling for "-D_XOPEN_SOURCE" (with the quotes) returns thousands of results. That's fine, any apps. not including pyconfig.h can do that without any problems. SuperKaramba isn't in Fedora and I've just done a mod_python mock build and it doesn't use _XOPEN_SOURCE on any files AFAICS. FWIW kdebindings 4.0.1 now builds with GCC 4.3, so this must have been worked around somewhere in SIP or kdebindings itself.
https://bugzilla.redhat.com/show_bug.cgi?id=427617
CC-MAIN-2018-26
en
refinedweb
Kill all Aliens! Hello. Just added my space shooter game if any of you are interested in testing it. It's far from completed but it has a boss now Things in need of improvement and bugs - Boss only moves when beeing hit ( wanted it to move all the time - Enemy lasers do not always need to hit the ship ( if they are really close it considered a hit) - Distance to Boss needs to reset when boss is killed so distance to next boss is displayed) - PowerUps!!! - Alot more but these are the things im working on now Please leave feedback for improvments Im only doing this because it's fun and I want to learn Hello again! I have created a gist and updated the game now there are powerups that when the player collect will make it shoot green twin lasers Still haven't fixed so they shoot for a period of time, so for now they only fire once If anybody has any idea for how to make them better please let me know Here is the url: link text Hello again! Game update: - Power-up works fine now (They do not work on bosses) - Added second boss - Fixed some issues with enemy lasers and boss lasers - Added score (Just for fun) Link to game: ToDo: - Add new enemies - Add final boss or more bosses - more power-ups - Start up screen/ end screen Hi everybody. I have a problem with a function and Im wondering if anybody can help me with it I have create "Bombs" that explode if you shot them, however my issue is that I would like the ship to die if it touches the explosion and I thought that it should look something like this for it to work: def bomb_gone(self, bomb): explode = SpriteNode('shp:Explosion00', parent=self) explode.scale = 0.5 explode.position = bomb.position if self.ship.position == explode.frame: exit() explode.run_action(A.move_by(10, 10, 1.6, TIMING_EASE_OUT)) explode.run_action(A.sequence(A.wait(1), A.remove())) bomb.remove_from_parent() as you can see if the ships and explode occupies the same frame the game is over, but it does not work, it works if the "bomb" has not exploded and I fly right into it but not if they explode, any suggestions? if self.ship.position == explode.frame: - Position is a point - Frame is a rect - I would have written: - if self.ship.position in explode.frame: @ccc thanks for the help, but I stll don't get it to work maybe I have forgotten something else. Anyhow thank you for your help will look through it all again Your code only checks the first time, not while the explosion moves. Is that what you wanted? Also, really what you want is if the two frames intersect --@ccc's code only checks the position, which might be the center, or corner, so probably isnt what you want rect offers an intersect method: if self.ship.frame.intersects(explode.frame) which would check if the bounding boxes intersect. note that this might be "unfair", since if you have a round explosion, and round ship, this test would pass when the corners touch, not the circles. I forget if shapenodes or textures have an intersect method... It might be better to use a circular distance check, which would let the explostion intersect slightly. abs(self.ship.position-explode) < (explode.width + self.ship.width)/2. you could play with a scale factor multilier on the right, to get something that looks/feels right. @JonB yes, I want the ship to "die" if it touches the explosion, gonna try your solution when I get home, thank you
https://forum.omz-software.com/topic/4304/kill-all-aliens
CC-MAIN-2018-26
en
refinedweb
Part: I’m currently in the process of moving houses and planning a wedding – busy, exciting, happy times. There are lots of positives – more yard space, more square footage, time with friends and family, cake…the list goes on. However, mixed in with these big, happy life changes is an underlying anxiety that something could go wrong. There’s always a chance that accidents, inclement weather or illness could ruin the party for everyone. It’s not pleasant to consider and I’d honestly rather sweep it all under the rug and go on with the merry-making (mmm cake!). But the voice at the back of my head won’t stop whispering what if? It’s this voice that’s prompted me to take steps towards protecting my investments with liability insurance. Now, I’m not keen on laying out funds where I don’t have to, and I’m always the first to try and save a buck (coupons are my best friends!), but where any large investment is being made, it only makes sense for me to part with some of my hard coupon-saved dollars to protect that. I may never need it, true… but what if? At Pythian, we spend a lot of our time exploring the world of what if? What if there’s an outage? What if there’s a breach? What will we lose? What will it cost? These are uncomfortable questions for a lot of organizations and especially uncomfortable when things are going well. If you haven’t had an outage or a data breach yet, it is easier to assume that this won’t happen. What if we invest in protection and that spend is wasted because nothing ever goes wrong? Naïve? Maybe. Comfortable? Oh yeah. In a post-Snowden, post-Target, post-Home Depot world, it’s more important than ever for organizations to move out of the comfortable and really consider what the total impact of any one incident could be on their environment and take steps to insure themselves against it. Let’s spend some time being uncomfortable, considering more than just the Total Cost of Operations and think instead about the Total Cost of Incident. Recently we’ve ran into an interesting question from one of our clients. They were seeing messages of the following form in syslog: "Aug 11 11:56:02 ***** kernel: EXT3-fs warning (device ******): ext3_dx_add_entry: Directory index full!" I haven’t encountered this before, and did a bit of research. My initial suspicion ended up being correct, and it was due to too many files being created, somewhere in that file system. I had a look around, and eventually checked out the ORACLE_HOME of the ASM / Grid Infrastructure software, which is running version 12.1.0.2 on that host. I snooped around using du -sh to check which directories or sub-directories might be the culprit, and the disk usage utility came to a halt after the “racg” directory. Next in line would be “rdbms”. The bulb lit up somewhat brighter now. Entering the rdbms/audit directory, I issued the common command you would if you wanted to look at a directories contents: “ls”. du -sh Five minutes later, there was still no output on my screen. Okay, we found the troublemaker. So we’re now being faced with a directory that has potentially millions of files in it. Certainly we all are aware that “rm” isn’t really able to cope with a situation like this. It would probably run for a couple minutes until it’s done parsing the directory index, and then yell “argument list too long” at us. Alternatively, we could use find, combined with -exec (bad idea), -delete, or even pipe into rm using xargs. Looking around a bit on the good ol’ friend google, I came across this very interesting blog post by Sarath Pillai. I took his PERL one-liner, adjusted it a wee bit since I was curious how many files we actually got in there and ran it on a sandbox system with a directory with 88’000 files in it: perl -e 'my $i=0;for(<*>){$i++;((stat)[9]<(unlink))} print "Files deleted: $i\n"' It completed in 4.5 seconds. That’s pretty good. In Sarath’s tests he was able to delete half a million files in roughly a minute. Fair enough. After getting the OK from the client, we ran it on the big beast. It took 10 minutes. Files deleted: 9129797 9.1 million files. Now here comes the interesting bit. This system has been actively using 12.1.0.2 ASM since May 6th, 2015. That’s only 3 months. That translates to 3 million files per month. Is this really a desirable feature? Do we need to start running Hadoop just to be able to mine the data in there? Looking at some of the files, it seems ASM is not only logging user interactions there, but also anything and everything done by any process that connects to ASM. As I was writing this, I happened to take another peek at the directory. [oracle@cc1v3 audit]$ ls -1 | wc -l 9134657 Remember those numbers from before? Three million a month? Double that. I suspect this was due to the index being full, and Linux has now re-populated the index with the next batch. Until it ran full again. A new syslog entry just created at the same time seems to confirm that theory: Aug 12 00:09:11 ***** kernel: EXT3-fs warning (device ******): ext3_dx_add_entry: Directory index full! After running the PERL one-liner again, we deleted another vast amount of files: Files deleted: 9135386 It seems that the root cause is the added time stamp to the file names of the audit files that Oracle writes in 12.1. The file names are much more unique, which gives Oracle the opportunity to generate so many more of them. Where in previous versions, with an adequately sized file system you’d probably be okay for a year or more; on 12.1.0.2, on an active database (and our big beast is very active) you have to schedule a job to remove them, and ensure it runs frequently (think 18+ million files in 3 months to put “frequently” into perspective). For implementing Large Pages on AIX first you will need to choose large page size at OS level. On AIX you can have multiple large page sizes of 4KB, 64KB, 16MB, and 16GB. In this example we will be using a large page size of 16MB. Steps for implemenatation: 1- Based on MOS Doc ID 372157.1 first you need to enable Large Pages at OS level # vmo -r -o lgpg_size=16777216 -o lgpg_regions=<Total number of pages> # vmo -o lru_file_repage=0 # vmo -p -o v_pinshm=1 # lsuser -a capabilities oracle # chuser capabilities=CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle # bosboot -a This needs a server reboot For complete instruction please review note ID 372157.1 2- Setting parameters at instance level On AIX databases you only need to set LOCK_SGA to TRUE: alter system set lock_sga=TRUE scope=spfile; Note: On AIX databases, USE_LARGE_PAGES parameter has NO impact. These parameters are only valid for databases running on Linux, the value of this parameter even if set to FALSE will be ignored on AIX. By default when Large Pages is available on AIX it will be used by database instances regardless of USE_LARGE_PAGES parameter value. You only need to set LOCK_SGA. 3- Restart the instance and confirm Large Pages is in use: After setting lock_sga instance must be restarted. As I explained above, when Large Pages is available at OS level it will be used by instance, but the key point in here is how to confirm whether Large Pages is in use or not. How to check if Huge Pages is used by Oracle instance. For Oracle 11g running on AIX, no informational message is written to the alert log as what we see in the alert log of databases running on Linux. So for your database instance running on AIX do NOT expect following lines in the alert log: ****************** Large Pages Information ***************** Total Shared Global Region in Large Pages = xx MB (100%) Large Pages used by this instance: xxx (xxx MB) Large Pages unused system wide = x (xxx MB) (alloc incr 4096 KB) Large Pages configured system wide = xxx (xxx MB) Large Page size = 16 MB *********************************************************** The only way you can make sure large pages is being used by instance is checking memory usage at OS level: Consider SGA_TARGET in your instance is 8G Total number of Large Pages (with size of 16M) will be 8G/16M + 1 which is : 8589934592 / 16777216 + 1 = 513 Check the number of large 16M pages in use at OS level before starting your instance: $ vmstat -P all System configuration: mem=98304MB pgsz memory page ----- -------------------------- ------------------------------------ siz avm fre re pi po fr sr cy 4K 4420992 2926616 487687 0 0 5 1280 2756 0 64K 582056 581916 754 0 0 0 0 0 0 16M 2791 87 2704 0 0 0 0 0 0 In this example number of 16M pages in use before starting instance is 87 pages from total available of 2791 pages. We start the instance with SGA size of 8G: SQL> startup ORACLE instance started. Total System Global Area 8551575552 bytes Fixed Size 2238616 bytes Variable Size 2348812136 bytes Database Buffers 6190792704 bytes Redo Buffers 9732096 bytes Database mounted. Database opened. SQL> show parameter sga_target NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sga_target big integer 8G SQL> show parameter lock_sga NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ lock_sga boolean TRUE Then we check Large pages in use again : $ vmstat -P all System configuration: mem=98304MB pgsz memory page ----- -------------------------- ------------------------------------ siz avm fre re pi po fr sr cy 4K 4428160 2877041 420004 0 0 5 1279 2754 0 64K 581608 530522 51695 0 0 0 0 0 0 16M 2791 600 2191 0 0 0 0 0 0 As you can see the total number of 16M pages in use is now 600 pages, which is exactly 513 pages more than what it was before instance startup. This proves that 16M pages have been used by our instance. You can also check memory usage of your instance by checking one of the instance processes like pmon: $ ps -ef|grep pmon oracle 14024886 31392176 0 14:05:34 pts/0 0:00 grep pmon oracle 41681022 1 0 Mar 11 - 3:12 ora_pmon_KBS Then check memory used by this process is from 16M Pages: $ svmon -P 41681022 ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 41681022 oracle 2180412 2109504 1778 2158599 Y N Y PageSize Inuse Pin Pgsp Virtual s 4 KB 31820 0 1650 9975 m 64 KB 2959 516 8 2961 L 16 MB 513 513 0 513 I hope this will be useful for you, and good luck. Several years ago I wrote an article on Oracle date math. Amazingly, that article was still available online at the time of this writing. Working With Oracle Dates An update to that article is long overdue. While date math with the DATE data type is fairly well known and straight forward, date math with Oracle TIMESTAMP data is less well known and somewhat more difficult. Let’s begin by enumerating the data types and functions that will be discussed Documentation for Datetime and Interval Data Types Documentation for Datetime Literals Documentation for Interval Literals Documentation for Datetime/Interval Arithmetic There is not a link to the heading, just scroll down the page until you find this. Documentation for Datetime Functions There quite a few of these available. Most readers will already be familiar with many of these, and so only some of the more interesting functions related to timestamps will be covered. It is always interesting to have some idea of how different bits of technology work. In Working With Oracle Dates I showed how Date values are stored in the database, as well as how a Date stored in the database is somewhat different than a date variable. Let’s start by storing some data in a timestamp column and comparing how it differs from systimestamp. Test table for Timestamp Math Blog: col c1_dump format a70 col c1 format a35 col funcname format a15 set linesize 200 trimspool on set pagesize 60 drop table timestamp_test purge; create table timestamp_test ( c1 timestamp ) / insert into timestamp_test values(systimestamp ); insert into timestamp_test values(systimestamp - 366); commit; 'timestamp' funcname, c1, dump(c1) c1_dump from timestamp_test union all 'systimestamp' funcname, systimestamp, dump(systimestamp) systimestamp_dump from dual / FUNCNAME C1 C1_DUMP --------------- ----------------------------------- ---------------------------------------------------------------------- timestamp 26-MAR-16 03.09.27.649491 PM -07:00 Typ=180 Len=11: 120,116,3,26,16,10,28,38,182,114,56 timestamp 26-MAR-15 03.09.27.000000 PM -07:00 Typ=180 Len=7: 120,115,3,26,16,10,28 systimestamp 26-MAR-16 03.09.27.687416 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,9,27,0,192,34,249,40,252,0,5,0,0,0,0,0 3 rows selected. One of the first things you might notice is that the value for Typ is 180 for TIMESTAMP columns, but for SYSTIMESTAMP Typ=188. The difference is due to TIMESTAMP being an internal data type as stored in the database, while SYSTIMESTAMP is dependent on the compiler used to create the executables. Another difference is the length; the first TIMESTAMP column has a length of 11, whereas the SYSTIMESTAMP column’s length is 20. And what about that second TIMESTAMP column? Why is the length only 7? An example will show why the second row inserted into TIMESTAMP_TEST has a length of only 7. 1* select dump(systimestamp) t1, dump(systimestamp-1) t2, dump(sysdate) t3 from dual 15:34:32 ora12c102rac01.jks.com - jkstill@js122a1 SQL- / T1 T2 T3 ---------------------------------------- ---------------------------------------- ---------------------------------------- Typ=188 Len=20: 224,7,3,22,22,34,35,0,16 Typ=13 Len=8: 224,7,3,21,18,34,35,0 Typ=13 Len=8: 224,7,3,22,18,34,35,0 0,181,162,17,252,0,5,0,0,0,0,0 1 row selected. T2 was implicitly converted to the same data type as SYSDATE because standard date math was performed on it. The same thing happened when the second row was inserted TIMESTAMP_TEST. Oracle implicitly converted the data to a DATE data type, and then implicitly converted it again back to a timestamp, only the standard date information is available following the previous implicit conversion. You may have noticed that in this example the length of the data is 8, while that stored in the table was 7. This is due to the use of SYSDATE, which is an external data type, whereas any data of DATE data type that is stored in the database is using an internal data type which always has a length of 7. Let’s see if we can determine how each byte is used in a SYSTIMESTAMP value The following SQL will use the current time as a baseline, and start a point 10 seconds previous, showing the timestamp value and the internal representation. col t1 format a35 col t2 format a38 col dump_t1 format a70 col dump_t2 format a70 set linesize 250 trimspool on /* using to_disinterval() allows performing timestamp math without implicit conversions see for an explanation of the PTnS notation being used in to_dsinterval() */ alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss'; -- subtract 1 second from the current date -- do it 10 times --systimestamp t1, --dump(systimestamp) dump_t1, systimestamp - to_dsinterval('PT' || to_char(level) || 'S') t2, dump(systimestamp - to_dsinterval('PT' || to_char(level) || 'S')) dump_t2 from dual connect by level <= 10 order by level desc / T2 DUMP_T2 -------------------------------------- ---------------------------------------------------------------------- 26-MAR-16 03.34.55.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,34,55,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.34.56.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,34,56,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.34.57.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,34,57,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.34.58.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,34,58,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.34.59.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,34,59,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.35.00.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,35,0,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.35.01.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,35,1,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.35.02.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,35,2,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.35.03.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,35,3,0,152,108,205,20,252,0,5,0,0,0,0,0 26-MAR-16 03.35.04.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,35,4,0,152,108,205,20,252,0,5,0,0,0,0,0 10 rows selected. From the output we can see that seconds are numbered 0-59, and that the 7th byte in the internal format is where the second is stored. We can also see that the Month is represented by the 3rd bytes, and the Day by the fourth 4th byte. One would then logically expect the 5th bite to show us the hour. Glancing at the actual time of 3:00 PM it seems curious then the value we expect to be the hour is 19 rather than 15. The server where these queries is being run has a Time Zone of EDT. Next I ran the same queries on a server with a TZ of PDT, and though the time in the timestamp appeared as 3 hours earlier, the value stored in the 5th byte is still 19. Oracle is storing the hour in UTC time, then using the TZ from the server to get the actual time. We can modify the local session time zone to find out how Oracle is calculating the times. The first attempt is made on the remote client where scripts for this article are developed. The TZ will be set for Ethiopia and then the time checked at the Linux command line and in Oracle. # date Sat Mar 26 13:16:12 PDT 2016 # TZ='Africa/Addis_Ababa'; export TZ # date Sat Mar 26 23:16:17 EAT 2016 # sqlplus jkstill/XXX@p1 Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production SQL- !date Sat Mar 26 23:16:40 EAT 2016 SQL- l 1 select 2 systimestamp t1, 3 dump(systimestamp) dump_t1 4* from dual 23:16:50 ora12c102rac01.jks.com - jkstill@js122a1 SQL- / T1 DUMP_T1 ----------------------------------- ---------------------------------------------------------------------- 26-MAR-16 04.16.56.254769 PM -04:00 Typ=188 Len=20: 224,7,3,26,20,16,56,0,104,119,47,15,252,0,5,0,0,0,0,0 Setting the TZ on the client clearly has no effect on the time returned from Oracle. Now let’s try while logged on to the database server. $ date Sat Mar 26 16:20:23 EDT 2016 $ TZ='Africa/Addis_Ababa'; export TZ $ date Sat Mar 26 23:20:38 EAT 2016 $ sqlplus / as sysdba Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production SQL- l 1 select 2 systimestamp t1, 3 dump(systimestamp) dump_t1 4* from dual SQL- / T1 DUMP_T1 ----------------------------------- ---------------------------------------------------------------------- 26-MAR-16 11.22.48.473298 PM +03:00 Typ=188 Len=20: 224,7,3,26,20,22,48,0,80,244,53,28,3,0,5,0,0,0,0,0 This experiment has demonstrated two things for us: Given the location of the month, it would be expected to find the year in the byte just previous the month byte. There is not just one byte before the month, but two. You will recall that SYSTIMESTAMP has a different internal representation than does the TIMESTAMP data type. Oracle is using both of these bytes to store the year. Working with this timestamp from an earlier example, we can use the information in Oracle Support Note 69028.1 to see how this works. T2 DUMP_T2 -------------------------------------- ---------------------------------------------------------------------- 26-MAR-16 03.34.55.349007000 PM -04:00 Typ=188 Len=20: 224,7,3,26,19,34,55,0,152,108,205,20,252,0,5,0,0,0,0,0 For the timestamp of March 16 2016 the first two bytes of the timestamp are used to represent the year. The Formula for AD dates is Byte 1 + ( Byte 2 * 256 ). Using this formula the year 2016 can be arrived at: 224 + ( 7 * 256) = 2016 For the TIMESTAMP data type, the format is somewhat different for the year; actually it works the same way it does for the DATE data type, in excess 100 notation. SQL- l 1* select c1, dump(c1) dump_c1 from timestamp_test where rownum < 2 SQL- / C1 DUMP_C1 ------------------------------ --------------------------------------------------- 26-MAR-16 03.09.27.649491 PM Typ=180 Len=11: 120,116,3,26,16,10,28,38,182,114,56 The 2nd byte indicates the current year – 1900. Now let’s decode all of the data in a TIMESTAMP. First we need some some TIMESTAMP test data The following SQL will provide some test data for following experiments. We may not use all of the columns or rows, but they are available. drop table timestamp_tz_test purge; create table timestamp_tz_test ( id integer, c1 timestamp, c2 timestamp with time zone, c3 timestamp with local time zone ) / -- create 10 rows each on second apart begin for i in 1..10 loop insert into timestamp_tz_test values(i,systimestamp,systimestamp,systimestamp ); dbms_lock.sleep(1); null; end loop; commit; end; / We already know that TIMESTAMP data can store fractional seconds to a billionth of a second. Should you want to prove that to yourself, the following bit of SQL can be used to insert TIMESTAMP data into a table, with each row being 1E-9 seconds later than the previous row. This will be left as an exercise for the reader. create table t2 as select level id, to_timestamp('2016-03-29 14:25:42.5' || lpad(to_char(level),8,'0'),'yyyy-mm-dd hh24.mi.ssxff') c1 from dual connect by level <= 1000 / col dump_t1 format a70 col c1 format a35 col id format 99999999 select id, c1, substr(dump(c1),instr(dump(c1),',',-1,4)+1) dump_t1 from t2 order by id / Oracle uses 4 bytes at the end of a timestamp to store the fractional seconds. The value of the least byte is as shown. Each greater byte will be a power of 256. The following SQL will make this more clear. Don’t spend too much time at first trying to understand the SQL, at it will become more clear after you see the results. SQL to decode 1 row of TIMESTAMP data. col id format 99 col t1 format a35 col dumpdata format a50 col tz_type format a10 col ts_component format a40 col label format a6 col real_value format a50 set linesize 200 trimspool on alter session set nls_timestamp_format = 'yyyy-mm-dd hh24.mi.ssxff'; alter session set nls_timestamp_tz_format = 'yyyy-mm-dd hh24.mi.ssxff tzr'; with rawdata as ( select c2 t1, dump(c2) dump_t1 from timestamp_tz_test where id = 1 ), datedump as ( select t1, substr(dump_t1,instr(dump_t1,' ',1,2)+1) dumpdata from rawdata ), -- regex from datebits as ( select level id, regexp_substr (dumpdata, '[^,]+', 1, rownum) ts_component from datedump connect by level <= length (regexp_replace (dumpdata, '[^,]+')) + 1 ), labeldata as ( select 'TS,DU,CC,YY,MM,DD,HH,MI,SS,P1,P2,P3,P4' rawlabel from dual ), labels as ( select level-2 id, regexp_substr (rawlabel, '[^,]+', 1, rownum) label from labeldata connect by level <= length (regexp_replace (rawlabel, '[^,]+')) + 1 ), data as ( select db.id, db.ts_component from datebits db union select 0, dumpdata from datedump dd union select -1, to_char(t1) from rawdata ) select d.id, l.label, d.ts_component, case l.label when 'DU' then d.ts_component when 'CC' then 'Excess 100 - Real Value: ' || to_char(to_number((d.ts_component - 100)*100 )) when 'YY' then 'Excess 100 - Real Value: ' || to_char(to_number(d.ts_component - 100 )) when 'MM' then 'Real Value: ' || d.ts_component when 'DD' then 'Real Value: ' || d.ts_component when 'HH' then 'Excess 1 - Real Value: ' || to_char(to_number(d.ts_component)-1) when 'MI' then 'Excess 1 - Real Value: ' || to_char(to_number(d.ts_component)-1) when 'SS' then 'Excess 1 - Real Value: ' || to_char(to_number(d.ts_component)-1) when 'P1' then 'Fractional Second P1 : ' || to_char((to_number(d.ts_component) * POWER(256,3) ) / power(10,9)) when 'P2' then 'Fractional Second P2 : ' || to_char((to_number(d.ts_component) * POWER(256,2) ) / power(10,9)) when 'P3' then 'Fractional Second P3 : ' || to_char((to_number(d.ts_component) * 256 ) / power(10,9)) when 'P4' then 'Fractional Second P4 : ' || to_char((to_number(d.ts_component) + 256 ) / power(10,9)) end real_value from data d join labels l on l.id = d.id order by 1 / When the values for the Pn fractional second columns are added up, they will be equal to the (rounded) value shown in the timestamp. ID LABEL TS_COMPONENT REAL_VALUE --- ------ ---------------------------------------- -------------------------------------------------- -1 TS 2016-03-31 09.14.29.488265 -07:00 0 DU 120,116,3,31,17,15,30,29,26,85,40,13,60 120,116,3,31,17,15,30,29,26,85,40,13,60 1 CC 120 Excess 100 - Real Value: 2000 2 YY 116 Excess 100 - Real Value: 16 3 MM 3 Real Value: 3 4 DD 31 Real Value: 31 5 HH 17 Excess 1 - Real Value: 16 6 MI 15 Excess 1 - Real Value: 14 7 SS 30 Excess 1 - Real Value: 29 8 P1 29 Fractional Second P1 : .486539264 9 P2 26 Fractional Second P2 : .001703936 10 P3 85 Fractional Second P3 : .00002176 11 P4 40 Fractional Second P4 : .000000296 13 rows selected. Timezones are recorded in an additional two bytes in TIMESTAMP WITH TIMEZONE and TIMEAZONE WITH LOCAL TIMEZONE data types. Decoding those two bytes is left as an exercise for the reader. Now that we have had some fun exploring and understanding how Oracle stores TIMESTAMP data, it is time to see how calculations can be performed on timestamps. Note: See this ISO 8601 Article to understand the notation being used in to_dsinterval(). It is a common occurrence to add or subtract time to or from Oracle Dates. How that is done with the Oracle DATE data type is fairly well known. Following is a brief refresher on that topic: alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss'; select sysdate today, sysdate -1 yesterday from dual; select sysdate now, sysdate - (30/86400) "30_Seconds_Ago" from dual; select sysdate now, sysdate + ( 1/24 ) + ( 15/1440 ) + ( 42/86400) "1:15:42_Later" from dual; SQL- @date-calc Session altered. TODAY YESTERDAY ------------------- ------------------- 2016-03-30 13:39:06 2016-03-29 13:39:06 NOW 30_Seconds_Ago ------------------- ------------------- 2016-03-30 13:39:06 2016-03-30 13:38:36 NOW 1:15:42_Later ------------------- ------------------- 2016-03-30 13:39:06 2016-03-30 14:54:48 While this same method will work with timestamps, the results may not be what you expect. As noted earlier Oracle will perform an implicit conversion to a DATE data type, resulting in truncation of some timestamp data. The next example makes it clear that implicit conversions have converted TIMESTAMP to a DATA type. alter session set nls_timestamp_format = 'yyyy-mm-dd hh24.mi.ssxff'; alter session set nls_date_format = 'DD-MON-YY'; select systimestamp today, systimestamp -1 yesterday from dual; select systimestamp now, systimestamp - (30/86400) "30_Seconds_Ago" from dual; select systimestamp now, systimestamp + ( 1/24 ) + ( 15/1440 ) + ( 42/86400) "1:15:42_Later" from dual; SQL- @timestamp-calc-incorrect TODAY YESTERDAY --------------------------------------------------------------------------- --------- 2016-03-31 11.35.29.591223 -04:00 30-MAR-16 NOW 30_Second --------------------------------------------------------------------------- --------- 2016-03-31 11.35.29.592304 -04:00 31-MAR-16 NOW 1:15:42_L --------------------------------------------------------------------------- --------- 2016-03-31 11.35.29.592996 -04:00 31-MAR-16 Oracle has supplied functions to properly perform calculations on timestamps. The previous example will work properly when ds_tointerval is used as seen in the next example. col c30 head '30_Seconds_Ago' format a38 col clater head '1:15:42_Later' format a38 col now format a35 col today format a35 col yesterday format a38 alter session set nls_timestamp_format = 'yyyy-mm-dd hh24.mi.ssxff'; alter session set nls_timestamp_tz_format = 'yyyy-mm-dd hh24.mi.ssxff tzr'; -- alternate methods to subtract 1 day select systimestamp today, systimestamp - to_dsinterval('P1D') yesterday from dual; select systimestamp today, systimestamp - to_dsinterval('1 00:00:00') yesterday from dual; -- alternate methods to subtract 30 seconds select systimestamp now, systimestamp - to_dsinterval('PT30S') c30 from dual; select systimestamp now, systimestamp - to_dsinterval('0 00:00:30') c30 from dual; -- alternate methods to add 1 hour, 15 minutes and 42 seconds select systimestamp now, systimestamp + to_dsinterval('PT1H15M42S') clater from dual; select systimestamp now, systimestamp + to_dsinterval('0 01:15:42') clater from dual; TODAY YESTERDAY ----------------------------------- -------------------------------------- 2016-03-30 18.10.41.613813 -04:00 2016-03-29 18.10.41.613813000 -04:00 TODAY YESTERDAY ----------------------------------- -------------------------------------- 2016-03-30 18.10.41.614480 -04:00 2016-03-29 18.10.41.614480000 -04:00 NOW 30_Seconds_Ago ----------------------------------- -------------------------------------- 2016-03-30 18.10.41.615267 -04:00 2016-03-30 18.10.11.615267000 -04:00 NOW 30_Seconds_Ago ----------------------------------- -------------------------------------- 2016-03-30 18.10.41.615820 -04:00 2016-03-30 18.10.11.615820000 -04:00 NOW 1:15:42_Later ----------------------------------- -------------------------------------- 2016-03-30 18.10.41.616538 -04:00 2016-03-30 19.26.23.616538000 -04:00 NOW 1:15:42_Later ----------------------------------- -------------------------------------- 2016-03-30 18.10.41.617161 -04:00 2016-03-30 19.26.23.617161000 -04:00 The values for years, months, days, hours and seconds can all be extracted from a timestamp via the extract function. The following code demonstrates a few uses of this, along with examples of retrieving intervals from two dates. The values in parentheses for the day() and year() intervals specify the numeric precision to be returned. def nls_tf='yyyy-mm-dd hh24.mi.ssxff' alter session set nls_timestamp_format = '&nls_tf'; col d1_day format 999999 col full_interval format a30 col year_month_interval format a10 with dates as ( to_timestamp_tz('2014-06-19 14:24:29.373872', '&nls_tf') d1 , to_timestamp_tz('2016-03-31 09:42:16.8734921', '&nls_tf') d2 from dual ) extract(day from d1) d1_day , ( d2 - d1) day(4) to second full_interval , ( d2 - d1) year(3) to month year_month_interval , extract( day from d2 - d1) days_diff , extract( hour from d2 - d1) hours_diff , extract( minute from d2 - d1) minutes_diff , extract( second from d2 - d1) seconds_diff from dates / D1_DAY FULL_INTERVAL YEAR_MONTH DAYS_DIFF HOURS_DIFF MINUTES_DIFF SECONDS_DIFF ------- ------------------------------ ---------- ---------- ---------- ------------ ------------ 19 +0650 19:17:47.499620 +001-09 650 19 17 47.4996201 Building on that, the following example demonstrates how the interval value the represents the difference between dates d1 and d2 can be added back to d1 and yield a date with the same value as d1. def nls_tf='yyyy-mm-dd hh24.mi.ssxff' alter session set nls_timestamp_format = '&nls_tf'; col d1 format a30 col d2 format a30 col full_interval format a30 col calc_date format a30 with dates as ( to_timestamp('2014-06-19 14:24:29.373872', '&nls_tf') d1 , to_timestamp('2016-03-31 09:42:16.873492', '&nls_tf') d2 from dual ) d1,d2 , ( d2 - d1) day(4) to second full_interval , d1 + ( d2 - d1) day(4) to second calc_date from dates / D1 D2 FULL_INTERVAL CALC_DATE ------------------------------ ------------------------------ ------------------------------ ------------------------------ 2014-06-19 14.24.29.373872000 2016-03-31 09.42.16.873492000 +0650 19:17:47.499620 2016-03-31 09.42.16.873492000 The ISO 8601 Article previously mentioned will be useful for understanding how time durations may be specified with interval functions. The following combination of SQL and PL/SQL is used to convert the difference between two timestamps into seconds. The code is incomplete in the sense that the assumption is made that the largest component of the INTERVAL is hours. In the use case for this code that is true, however there could also be days, months and years for larger value of the INTERVAL. The following code is sampled from the script ash-waits-use.sql and uses PL/SQL to demonstrate the use of the INTERVAL DAY TO SECOND data type in PL/SQL. var v_wall_seconds number col wall_seconds new_value wall_seconds noprint declare ash_interval interval day to second; begin select max(sample_time) - min(sample_time) into ash_interval from v$active_session_history; max(sample_time) - min(sample_time) into ash_interval from v$active_session_history where sample_time between decode('&&snap_begin_time', 'BEGIN', to_timestamp('1900-01-01 00:01','yyyy-mm-dd hh24:mi'), to_timestamp('&&snap_begin_time','yyyy-mm-dd hh24:mi') ) AND decode('&&snap_end_time', 'END', to_timestamp('4000-12-31 23:59','yyyy-mm-dd hh24:mi'), to_timestamp('&&snap_end_time','yyyy-mm-dd hh24:mi') ); :v_wall_seconds := (extract(hour from ash_interval) * 3600 ) + (extract(second from ash_interval) * 60 ) + extract(second from ash_interval) ; end; / select round(:v_wall_seconds,0) wall_seconds from dual; Similarly the to_yminterval function is used to to perform timestamp calculations with years and months. col clater head 'LATER' format a38 col now format a35 col today format a35 col lastyear format a38 col nextyear format a38 alter session set nls_timestamp_format = 'yyyy-mm-dd hh24.mi.ssxff'; alter session set nls_timestamp_tz_format = 'yyyy-mm-dd hh24.mi.ssxff tzr'; -- alternate methods to add 1 year select systimestamp today, systimestamp + to_yminterval('P1Y') nextyear from dual; select systimestamp today, systimestamp + to_yminterval('01-00') nextyear from dual; -- alternate methods to subtract 2 months select systimestamp now, systimestamp - to_yminterval('P2M') lastyear from dual; select systimestamp now, systimestamp - to_yminterval('00-02') lastyear from dual; -- alternate methods to add 2 year, 4 months, 6 days ,1 hour, 15 minutes and 42 seconds select systimestamp now, systimestamp + to_yminterval('P2Y4M') + to_dsinterval('P2DT1H15M42S') clater from dual; select systimestamp now, systimestamp + to_yminterval('02-04') + to_dsinterval('2 01:15:42') clater from dual; TODAY YESTERDAY ----------------------------------- -------------------------------------- 2016-03-31 09.06.22.060051 -07:00 2016-03-30 09.06.22.060051000 -07:00 TODAY YESTERDAY ----------------------------------- -------------------------------------- 2016-03-31 09.06.22.061786 -07:00 2016-03-30 09.06.22.061786000 -07:00 NOW 30_Seconds_Ago ----------------------------------- -------------------------------------- 2016-03-31 09.06.22.063641 -07:00 2016-03-31 09.05.52.063641000 -07:00 NOW 30_Seconds_Ago ----------------------------------- -------------------------------------- 2016-03-31 09.06.22.064974 -07:00 2016-03-31 09.05.52.064974000 -07:00 NOW 1:15:42_Later ----------------------------------- -------------------------------------- 2016-03-31 09.06.22.066259 -07:00 2016-03-31 10.22.04.066259000 -07:00 NOW 1:15:42_Later ----------------------------------- -------------------------------------- 2016-03-31 09.06.22.067600 -07:00 2016-03-31 10.22.04.067600000 -07:00 While date math with the DATE data type is somewhat arcane, it is not too complex once you understand how it works. When Oracle introduced the TIMESTAMP data type, that all changed. Timestamps are much more robust than dates, and also more complex Timestamps bring a whole new dimension to working with dates and times; this brief introduction to working with timestamp data will help demystify the process of doing math with timestamps. When you have a SQL Server environment where a very complex replication setup is in place, and you need to migrate/move (without upgrading), some or all the servers involved in the replication topology to new servers/Virtual Machines or to a new Data Center/Cloud, this Blog post is for you! Let’s assume you also have Transactional and/or Merge publications and subscriptions in place, and you need to move the publisher(s) and/or distributor(s) to a new environment. You also have one or more of the following restrictions: Here are the general steps for this migration: Prior the migration date: On migration date: At any case, it is strongly recommended to test the migration prior to the real cutover, even if the test environment is not identical to Production, just to get a feel for it. Ensure that you are including most replication scenarios you have in Production during your test phase. The more scripts you have handy for the cutover date, the less downtime you may have. It is extremely important to also have a good and tested rollback plan. In future Blog posts I will discuss more complex replication scenarios to be migrated and rollback plans. If you would like to make suggestions for future blogs, please feel free to add a comment and I will try to include your request in future posts.. Because Oracle’s IaaS offering is quite new, it has yet to match the flexibility and feature set of Azure and AWS. For example, enterprise VPN connectivity between cloud and on-premises infrastructure is still very much a work in progress. Unlike AWS, however, Oracle provides a free software appliance for accessing cloud storage on-premises. In addition to offering an hourly metered service, Oracle also provides unmetered compute capacity with a monthly subscription. Some customers prefer this option because it allows them to more easily control their spending through a predictable monthly fee rather than a pure pay-as-you-go model. At the same time, Oracle Cloud IaaS has a limited selection of instance shapes, there is no SSD storage yet or guaranteed input/output performance levels, and transferring data is more challenging for large-volume migrations. What to expect from Oracle Cloud PaaS Oracle’s PaaS offerings are quickly becoming among the most comprehensive cloud-based services for Oracle Database. They include: Oracle Database Schema Service This is the entry-level unmetered offering, available starting at $175 a month for a 5GB database schema limit. Tenants share databases but are isolated in their own schemas. This means you have no control over database parameters, only the schema objects created. This service is currently available only with Oracle Database 11g Release 2 (i.e., it is not yet included in the latest release of Oracle Database 12c). Oracle Exadata Cloud Service This is a hosted service with monthly subscriptions starting at $70,000 for a quarter rack with 28 OCPUs enabled and 42TB of usable storage provisioned. You have full root OS access and SYSDBA database access, so you have total flexibility in managing your environment. However, this means Oracle manages only the bare minimum—the external networking and physical hardware—so you may end up expending the same effort as you would managing Exadata on-premises. Oracle Database Virtual Image Service This is a Linux VM with pre-installed Oracle Database software. The license is included in the rate. It’s available metered (priced per OCPU per hour of runtime) and unmetered (priced per OCPU allocated per month). As you’ll need to manage everything up from the VM level, including OS management and full DBA responsibilities, the metered service is a particularly good option for running production environments that require full control over the database deployment. Oracle Database-as-a-Service (DBaaS) This is an extension of Virtual Image Service and includes additional automation for database provisioning during service creation, backup, recovery, and patching. While you are still responsible for the complete management of the environment, the embedded automation and tooling can simplify some DBA tasks. I should point out that,. While Oracle’s cloud options are still quite new and require additional features for broad enterprise adoption, if this option sparks your interest, now is the time to take the first steps. If you want to learn more about the migration path to Oracle Cloud, check out our white paper, Migrating Oracle Databases to Cloud.22b3fb2-5e70-11e5-b55a-0800279d00c5 Master_Info_File: /mysql/data gg.classpath.
http://www.orafaq.com/aggregator/sources/147?page=3
CC-MAIN-2016-26
en
refinedweb
Exherbo::Packager use Exherbo::Packager qw/init_config gen_template/; my $config_loc = "/etc/exherbo-packager.yml" init_config($config_loc); gen_template("Exherbo::Packager"); This module exports two functions, one to initialize the configuration of the packager, and the other to generate the exheres. Currently, this package only generates Exheres for Perl modules, but support for other languages is coming soon. An OO version of this module is also planned, since exporting things into the global namespace is icky. gen_template takes one argument, and that is the name of the perl module you wish to generate. It will output the exheres in your current directory, in a subdirectory named by the category it chooses. This will die with an error if the exheres already exists. init_config can optionally take one argument, that being the location of the config file you wish to use for this run of the packager. Once run, it will get all of the configuration information for calls to gen_template(). William Orr <will@worrbase.com>
http://search.cpan.org/~worr/Exherbo-Packager-1.122480/lib/Exherbo/Packager.pm
CC-MAIN-2016-26
en
refinedweb
The goal is to eliminate need for use of SystemAction & similar and replace their common usages with something more declarative, easier to use and effective in the runtime. Please review the plan to introduce @ActionRegistration as described at DS01: "The actual usages in menu & co. will remain in layers". I don't think this is the right approach. I suggest that the annotation somehow covers also possibility to create the needed shadow links to the generated layer entry. DS02: @ActionRegistration( ... displayName="#Save", iconBase="org/netbeans/modules/openide/actions/save.png", ) Can/will the processor check that the mentioned image file is present? Also can/will the processor check that the bundle entry for the display name is present? DS02: Bundle check is there. Icon check is not yet. Good idea. DS01: I agree writing a link in a file that points to non-existing file that will be generated later is confusing. Thus let's add: @interface ActionReference { String path(); // folder in sfs String id() = ""; // name of the .shadow file, by default taken from reference String refid() = ""; // path to original action, inferred if @ActionReference and @ActionDeclaration used at once } Suggest including the stuff in spi.actions here - while this solves the general case of declarative registration, there is still a need for a simple replacement for a hand-coded CookieAction - for example, you are writing a Node and want to provide some actions for it by overriding getActions(boolean). Adding to DS1, [JG01] Making these annotations work well with _registrations_ of actions to particular places in the GUI is the tricky part (and must be solved for this API to be accepted). We should not do the straightforward (if not trivial) work in the trunk and then hope that the hard part can be solved later. So I do not agree with there being a Phase I that ignores the hard decisions, unless this is done only in a branch (so we can decide to defer for after 6.8, or rewrite the API before merge). [JG02] You should use SourceVersion.RELEASE_6, not SourceVersion.RELEASE_5, since you support -source 1.6. [JG03] Accept ElementType.METHOD as well as TYPE in @AR. For non-context-sensitive actions, only need to change calculation of id. (This logic should anyway be moved into a helper method in LayerGeneratingProcessor or LayerBuilder or something.) For C-S actions, I guess you should accept a method with parameters? Whatever logic is in @ProjectServiceProvider etc. should be factored out into helper methods. [JG04] I think ANY is less expected and less often used than EACH (or ALL?) for C-S actions. E.g. if you declared @AR(...) public class CloseProjects implements ActionListener { public CloseProjects(Collection<Project> projects) {...} ... } the expectation is that this action will be available iff the selection consists of one or more nodes associated with a Project, not if it is one Project node and one JDBC table node etc. [JG05] For C-S actions, does the processor enforce that it is an ActionListener? Does it check that you are using <T> rather than <? extends T>? [JG06] ContextSelection should have the method isEnabledOnData implemented on it rather than using a switch statement. Similarly, it could have a method ContextActionPerformer<Object> to get an injector. [JG07] Consider putting @AR and associated code into a fresh module, perhaps api.actions. It is strange to be importing "org.openide.awt" when this has little to do with AWT. openide.awt will become rather cluttered with all the new code, which does not have much to do with the former contents (mostly utilities dealing with Swing components). And it would be nice to have Tim's stuff (currently in spi.actions) be included, too. [JG08] "Closeable" is incorrect. You meant "Closable". Similarly "Saveable" should be "Savable" and so on. In general in English, 'e' should be inserted before a suffix only if the stem ended in a soft 'c' or 'g' ("Cloneable" is too late to correct): markable replaceable singable pageable and note that certain words have special forms from Latin, e.g. read -> legible. [JG09] If you are going to copy code, please take some care to clean it up in the process. It is pretty strange to see a brand-new class labeled * @author Petr Hamernik * @version 0.10, Apr 03, 1998 ! [JG10] As I have argued elsewhere, the proposed interface for Savable is bad; cookie-like interfaces should be designed so that they need not be dynamically added to or removed from lookups, i.e. SaveCookie was misdesigned. There are subtleties, especially to get Save All action to work in a more modern way (as has often been requested by Platform users); look at issue #77210. To be clearer about JG01, the "tricky parts" are those things mentioned in I have some ideas how these issues might be resolved, but these ideas are unproven. We should not commit to a basic infrastructure until it is clear that it will support the chosen techniques. For example, the issue of having a data loader specify a list of well-known actions (rather than vice-versa) means that we want some developer-friendly way to refer to a list of action IDs. If we simply use String id() default ""; in @AR and many actions use the generated ID then it is unclear how you are supposed to know exactly what that ID is! Ideally any reference to an action ID would use a compiler-verified constant, so that the module defining the actions could export these IDs as an API (without necessarily exporting the action impls themselves). Should this ID type be a String? Or an Enum<?>? Or a Class<?>? [JG11] Probably context @ActionRegistration should be on the constructor rather than the class, making it intuitive that you can alternately use a static method. (Inconsistent with @PSP but maybe that could be (compatibly) fixed too.) So you could have either: public class MyAction implements ActionListener { @AR(...) public MyAction(Collection<DataObject> ds) {...} } or // anywhere @AR(...) public static ActionListener myAction(Collection<DataObject> ds) {...} Created attachment 83410 [details] Sketch of @ActionReference, see especially @MimeAction registration definition and usage, this would be handy for defining @Shortcut, @Menu, etc. [RM01] Phase II requires more work in apisupport than changing New Action Wizard templates. Annotation registrations are not reflected in layer filesystem until project is compiled (and not yet at all in NB.org projects). We've talked about this in person, but I realized further consequences, namely <this layer in context> node and NAW show wrong content, resulting in buggy behavior in fairly common use-cases: a) Just added action will show up neither in layer nodes in project window nor in NAW. b) When adding two actions consecutively, you cannot place the 2-nd one after the 1-st one in wizard, as the 1-st won't show up. c) After adding a menu (presuming menus will be finally registered by annotations as well), you cannot directly add an action to it, as the menu won't show up in NAW. To get this fixed we'd need either full-fledged Compile on Save or perhaps "process annotations on save" (?) or something similar. Without it we'll end up with regressed and buggy apisupport projects for long. [RM02] ad JG01: +1, also from the POV of NAW solving currently messy context menu registrations would be the most beneficial part, otherwise it is just another fancy way how to add an action atop of about 10 already existing ones. Why not just state a path (or a list of paths) in layer file, where will be the action registered, e.g. "Loaders/text/html" for mime-type based registration? Such a path then becomes sort of well-known ID for registration. The other side would register this path as its, well, extension point, allowing validation and some generic processing. What I don't understand is (maybe a naive question), what would you need e.g DataObject to state its actions? The vice-versa approach, i.e. action registers itself to DO, editor, project type, etc. seems more appropriate to me. [RM03] ad custom presenters being out of scope: most of custom Presenter.Popup implementations are used for: a) showing a submenu in popup menu b) dynamically showing and hiding a menu item Both cases could be IMHO expressed declaratively thus lowering number of necessary custom presenters to bearable minimum. Showing static text/icon until item is clicked in not an option IMHO. -1 on @ActionReference.Meta; specialized annotations ought to be handled by specialized processors which perform proper compile-time validation - that a MIME type is well-formed, a keyboard shortcut representation is valid, and so on. If necessary there can be convenience APIs to make writing such processors as quick as possible. To RM01 - I think this is a somewhat separate issue; we already needed a different way of displaying layer entries in 6.7. That said, "process annotations on save" would be natural. The "on save" part is less important than the "process annotations" part - i.e. support JSR 269 in NB. Long overdue, but there may be unforeseeable difficulties in its implementation. Surely filed somewhere in java/source. "action registers itself to DO, editor, project type, etc." - this does not work in general. Should OpenAction register itself for *.form files? Or ReformatAction for *.xsd? Or SetAsMainAction for BPEL model projects? Impossible. Also see (written for 6.7): ad [RM03]: I also consider implementing of Presenter.Menu or Presenter.Popup due to checkbox menu item for editor actions. Altghough there's Actions.connect(JCheckBoxMenuItem item, BooleanStateAction action, boolean popup) I don't like the fact that BooleanStateAction extends SystemAction. [MM01] Since I'm just working on cleanup of editor actions (issue 166027): Do we plan to bring any kind of unification of editor actions with "system" actions? I guess not or not with this issue. [MM02] What would @Shortcut include? Please keep in mind that 1) There are multiple shortcut profiles and action should show up in each of them. 2) Action can have multi-key shortcut. Created attachment 84192 [details] Javadoc with new context interfaces and factory methods I'd like to integrate tomorrow. All issues resolved, API created, apisupport changed, certain basic actions rewritten: TCR1 - I kept SaveCookie as requested and rewrote SaveAction to work without nodes. However the logic of SaveAction is complex, it needs to seek the Lookup itself. Thus I needed to enhance Actions.context to delegate also to any ContextAwareAction. TCA2 - The original advice was to not expose .context(...) factory method in Java API because of its meaningless signature. Due to the support for SaveAction mentioned above I needed to change the signature so it makes sense now. Thus I included both context and callable methods in the API. core-main#6dbe2ad21459 Integrated into 'main-golden', will be available in build *200907011400* on (upload may still be in progress) Changeset: User: Jaroslav Tulach <jtulach@netbeans.org> Log: #166658: Merge of work on declarative actions *** Bug 18325 has been marked as a duplicate of this bug. *** *** Bug 66836 has been marked as a duplicate of this bug. ***
https://netbeans.org/bugzilla/show_bug.cgi?id=166658
CC-MAIN-2016-26
en
refinedweb
Python and the Mac Clipboard I wanted a handy way to convert a feed url to the redirected url. For example, Reeder puts this url on the clipboard: “” But when I make a post, I want this url: “” There are a number of reasonable ways to do this, but I like Python so that’s what I went with. It’s a Hack! I’m an inquisitive hack. I know just enough of these technologies to be dangerous. I accept that risk. Anyone else running these scripts should accept the same risks. I’ve omitted all of the standard try blocks from the scripts for brevity. They really should have more error handling. I’ve hung many apps with poorly crafted scripts. I like to build my own solutions when I can. It provides an opportunity to learn something new, but it also forces me examine my workflows and motivations. For example, I’ve abandoned several “tools” in favor of consolidating into more simple options. The script in this post will make it’s way into Keyboard Maestro. Getting The URL Get the redirect URL is fairly trivial in Python import urllib2 feedUrl = '' f = urllib2.urlopen(feedUrl) source = f.read() f.close() newurl = f.geturl() newurl = newurl.split('?')[0] print newurl The “f.geturl()” function grabs the redirected url from the feed. But that url also has some garbage at the end indicating that it also came from a feed: “” The second to last line of the Python script splits the url at the “?” and grabs the first bit of the string. All well and good. This does extract the base url I wanted. But now I need a better way to set the feed url. I don’t want to open the script every time and edit the feedUrl variable. I could do this Keyboard Maestro but I wanted a more general solution. That means Python needs access to the OS X clipboard. Clipboard and Python There are a number of ways I could do this. I could first grab the clipboard in the shell environment then pass in the result to the python script when it is run. That’s fine, but I wanted something a little more direct. I wanted Python to get the clipboard from within the script. Subprocess I found this very thorough and very interesting tutorial for making a cross OS clipboard sharing script. In it, there are two nice methods that I’ve lifted.() These are pretty clever tricks (to me) and something I never thought of. Subprocess allows Python to spawn a shell command for pbpaste and pipe the results to a variable. How cool is that. One method gets the clipboard contents and the other puts content back on the clipboard. Putting it all together and I get this script for converting the current clipboard url to a normal address. import urllib2() f = urllib2.urlopen(getClipboardData()) source = f.read() f.close() newurl = f.geturl() newurl = newurl.split('?')[0] setClipboardData(newurl) PyObjC This process seemed a bit indirect. It means I run a shell command to run a python script that then spawns a shell command to get the clipboard. There’s nothing wrong with that as far as I can see, but I wanted to learn more about Python on the Mac. So, I kept reading. PyObjC is a Python library for accessing the Objective C frameworks in Python. It should provide a native mechanism for accessing the OS X clipboard and provide additional features not available through the subprocess methods above. After some reading and fiddling[1], I ended up with a version of the above script that uses the NSPasteboard class to get and set the clipboard instead of a using the shell command. import urllib2 from Foundation import * from AppKit import # Sets the clipboard to a string def pbcopy(s): pb = NSPasteboard.generalPasteboard() pb.declareTypes_owner_([NSStringPboardType], None) newStr = NSString.stringWithString_(s) newData = newStr.nsstring().dataUsingEncoding_(NSUTF8StringEncoding) pb.setData_forType_(newData, NSStringPboardType) # Gets the clipboard contents def pbpaste(): pb = NSPasteboard.generalPasteboard() content = pb.stringForType_(NSStringPboardType) return content f = urllib2.urlopen(pbpaste()) source = f.read() f.close() newurl = f.geturl() newurl = newurl.split('?')[0] pbcopy(newurl) Conclusion I found this whole process interesting and educational. At the very least I have a better appreciation for the clipboard and how complex a clipboard item can be. But it also gave me a way to make more generalized macros. Applications like TextExpander and Keyboard Maestro can access the clipboard through token replacements, but if I’m embedding a script, I might as well handle the clipboard myself. That means that the same script can be used in multiple application, including Launchbar and the terminal.
http://macdrifter.com/2011/12/python-and-the-mac-clipboard.html
CC-MAIN-2016-26
en
refinedweb
import wx app = wx.App() win = wx.Frame(None) win.Show() app.MainLoop() When I run it I get the error: Traceback (most recent call last): File "C:\Python27\test.py", line 2, in <module> app = wx.App() AttributeError: 'module' object has no attribute 'App' Does anyone know how to fix this? The wxPython installed it the directory C:\Python27\Lib\site-packages if you were wondering.
http://www.dreamincode.net/forums/topic/210263-wxpython-error-module-has-no-attribute-app/
CC-MAIN-2016-26
en
refinedweb
camera_get_whitebalance_regions() Retrieve the white balance regions configured on the camera. Synopsis: #include <camera/camera_api.h> camera_error_t camera_get_whitebalance white balance regions available on the camera. - numsupported The pointer to an integer that is populated with the number of white balance regions supported by the camera. - numreturned The pointer to an integer that is populated with the number of white balance regions returned in the regions array. - regions A pointer to a camera_region_t array. The array is updated with the white balance regions configured on the camera. Ensure that you create an array with the same number of elements as the numasked argument. Library:libcamapi Description: This function allows you to retrieve the configured auto- white balance grid from the camera. See camera_set_exposure_regions() for details on configuring this grid. When regions are defined, the auto white balance algorithm will give auto whitebalancing priority to objects in the defined areas. The maximum number of supported white balance.
https://developer.blackberry.com/playbook/native/reference/com.qnx.doc.camera.lib_ref/topic/camera_get_whitebalance_regions.html
CC-MAIN-2016-26
en
refinedweb
Hello Atti, One option is to... - create an object that will do what you want - drop a reference to it into the context - reference it from your velocity template Occasionally I have had a need to execute business logic from within a template and this approach works for that. Another other option is to create a "Tool" (I am using 2.3.1... I think this is still available in 2.3.2), and then to register it within your turbine props. For example here is a basic tool that I use that I find handy for string manipulation (yours would obviously do something different) public class StringGoodies implements org.apache.turbine.services.pull.ApplicationTool { public StringGoodies() { } public void init(Object data) { } public void refresh() { } public String replicate (String str, int qty) { return StringFunctions.replicate(str, qty); } ... } put something like this in your turbine props... tool.global.strtool=com.somecompany.somelib.StringGoodies Then it is always available within your velocity templates and can be used like (again yours would have different methods) $strtool.replicate("=",20) here are some notes from the example turbine props file #. # # persistent: tool is instantitated once for each use session, and # is stored in the user's permanent hashtable. This means # for a logged in user the tool will be persisted in the # user's objectdata. Tool should be threadsafe and # Serializable. Best of luck Tony -------------------------------------------------- From: "Szűcs Attila" <szucs.attila@codespring.ro> Sent: Wednesday, September 01, 2010 1:19 AM To: <user@turbine.apache.org> Subject: [?? Probable Spam] Template execution finished listener > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org For additional commands, e-mail: user-help@turbine.apache.org
http://mail-archives.apache.org/mod_mbox/turbine-user/201009.mbox/%3C85044A1377194974AA309B2EAC4332A0@lifeinnov.int%3E
CC-MAIN-2016-26
en
refinedweb
.... Hashed indices constitute a trade-off with respect to ordered indices: if correctly used, they provide much faster lookup of elements, at the expense of losing sorting information. Let us revisit our employee_set example: suppose a field for storing the Social Security number is added, with the requisite that lookup by this number should be as fast as possible. Instead of the usual ordered index, a hashed index can be resorted to: #include <boost/multi_index_container.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/identity.hpp> #include <boost/multi_index/member.hpp>> >, // hashed on ssnumber hashed_unique<member<employee,int,&employee::ssnumber> > > > employee_set Note that the hashed index does not guarantee any particular ordering of the elements: so, for instance, we cannot efficiently query the employees whose SSN is greater than a given number. Usually, you must consider these restrictions when determining whether a hashed index is preferred over an ordered one. If you are familiar with non-standard hash_sets provided by some compiler vendors, then learning to use hashed indices should be straightforward. However, the interface of hashed indices is modeled after the specification for unordered associative containers by the C++ Standard Library Technical Report (TR1), which differs in some significant aspects from existing pre-standard implementations: lower_boundor upper_boundmember functions (unlike Dinkumware's solution.) Just like ordered indices, hashed indices have unique and non-unique variants, selected with the specifiers hashed_unique and hashed_non_unique, respectively. In the latter case, elements with equivalent keys are kept together and can be jointly retrieved by means of the equal_range member function. Hashed indices specifiers have two alternative syntaxes, depending on whether tags are provided or not: (hashed_unique | hashed_non_unique) <[(tag)[,(key extractor)[,(hash function)[,(equality predicate)]]]]> (hashed_unique | hashed_non_unique) <[(key extractor)[,(hash function)[,(equality predicate)]]]> The key extractor parameter works in exactly the same way as for ordered indices; lookup, insertion, etc., are based on the key returned by the extractor rather than the whole element. The hash function is the very core of the fast lookup capabilities of this type of indices:. The equality predicate is used to determine whether two keys are to be treated as the same. The default value std::equal_to<KeyFromValue::result_type> is in most cases exactly what is needed, so very rarely will you have to provide your own predicate. Note that hashed indices require that two equivalent keys have the same hash value, which in practice greatly reduces the freedom in choosing an equality predicate. The lookup interface of hashed indices consists in member functions find, count and equal_range. Note that lower_bound and upper_bound are not provided, as there is no intrinsic ordering of keys in this type of indices. Just as with ordered indices, these member functions take keys as their search arguments, rather than entire objects. Remember that ordered indices lookup operations are further augmented to accept compatible keys, which can roughly be regarded as "subkeys". For hashed indices, a concept of compatible key is also supported, though its usefulness is much more limited: basically, a compatible key is an object which is entirely equivalent to a native object of key_type value, though maybe with a different internal representation: // US SSN numbering scheme struct ssn { ssn(int area_no,int group_no,int serial_no): area_no(area_no),group_no(group_no),serial_no(serial_no) {} int to_int()const { return serial_no+10000*group_no+1000000*area_no; } private: int area_no; int group_no; int serial_no; }; // interoperability with SSNs in raw int form struct ssn_equal { bool operator()(const ssn& x,int y)const { return x.to_int()==y; } bool operator()(int x,const ssn& y)const { return x==y.to_int(); } }; struct ssn_hash { std::size_t operator()(const ssn& x)const { return boost::hash<int>()(x.to_int()); } std::size_t operator()(int x)const { return boost::hash<int>()(x); } }; typedef employee_set::nth_index<2>::type employee_set_by_ssn; employee_set es; employee_set_by_ssn& ssn_index=es.get<2>(); ... // find an employee by ssn employee e=*(ssn_index.find(ssn(12,1005,20678),ssn_hash(),ssn_equal())); In the example, we provided a hash functor ssn_hash and an equality predicate ssn_equal allowing for interoperability between ssn objects and the raw ints stored as SSNs in employee_set. By far, the most useful application of compatible keys in the context of hashed indices lies in the fact that they allow for seamless usage of composite keys. Hashed indices have replace, modify and modify_key member functions, with the same functionality as in ordered indices. Due to the internal constraints imposed by the Boost.MultiIndex framework, hashed indices provide guarantees on iterator validity and exception safety that are actually stronger than required by the C++ Standard Library Technical Report (TR1) with respect to unordered associative containers: rehashprovides the strong exception safety guarantee unconditionally. TR1 only warrants it if the internal hash function and equality predicate objects do not throw. The somewhat surprising consequence is that a TR1-compliant unordered associative container might erase elements if an exception is thrown during rehashing!)
http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/tutorial/indices.html
CC-MAIN-2016-26
en
refinedweb
This series of articles started when I wanted to write a weblog about the impact of class loaders in a J2EE server. But the log entry grew, due the fact that a few basic rules still can provide a complex system, as you see in physics, where a few basic components and forces can build up something like our universe with all of the stars, black holes, pulsars, galaxies, and planets. In this part, I want to lay the groundwork on which we can start a discussion about dynamic and modular software systems. Class loaders may seem to be a dry topic, but I think it is one of the topics that separate the junior from the senior software engineer, so bear with me for an exciting journey into the darker corners of Java. Now you may ask yourself, "Why should I deal with multiple class loaders and their limitations and problems?" The short answer is that you probably have to, one way or the other. Even when you write a simple servlet or JSP program and deploy within a servlet container, your code is loaded by your very own class loader, preventing you from accessing other web applications' classes. In addition, many "container-type" applications such as J2EE servers, web containers, NetBeans, and others are using custom class loaders in order to limit the impact of classes provided by a component, and thus will have an impact on the developer of such components. As we will see later, even with dynamic class loading, there can only be one class loaded in a particular JVM. Additional class loaders enable a developer to partition the JVM so that the reduced visibility of a class makes it possible to have multiple, different definitions of the same class loaded. The class loaders work like the federal bank of each country, issuing their own currency. The border of each country defines the visibility and usability of the currency and makes it possible to have multiple currencies in the world. First we need to explain some definitions: java.lang.Class Class loaders and their usage follow a few simple rules: Now I want to put on some meat to these bare-bone rules to provide better understanding. Before we start, let's look at a typical class loader hierarchy, as illustrated by Figure 1: Figure 1. Class loader hierarchy example As shown in Figure 1, the bootstrap class loader (BS) loads the classes from the JVM, as well as extensions to the JDK. The system class loader (CP) loads all of the classes provided by the CLASSPATH environment variable or passed using the -classpath argument to the java command. Finally we have several additional class loaders, where A1-3 are children of the CP, and B1-2 are children of A3. Every class loader (except BS) has a parent class loader, even if no parent is provided explicitly; in the latter case, the CP is automatically set as the parent. CLASSPATH -classpath java Related Reading Java Enterprise Best Practices By The O'Reilly Java Authors That alone does not mean much but has a big impact on class-loading delegation. The Javadoc of java.lang.ClassLoader specifies that any class loader must first delegate the loading of a class to the parent, and only if this fails does it try to load the class itself. Actually, the class loader does not care about which one gets the bytes of the class, but rather which one calls defineClass(). In this final method, an instance of class java.lang.Class is created and cached in the class loader so that the byte code of a class cannot change on a following request to load the class. This method also checks that the given class name matches the class name in the byte code. Because this method is final, no custom class loader can change this behavior. java.lang.ClassLoader defineClass() final As previously mentioned, a class loader must delegate the loading of a class (although a developer can override loadClass() and change this behavior). On one hand, if loading of system classes is not delegated, an application could provide malicious code for JDK classes and introduce a ton of problems. On the other hand, all classes at least extend java.lang.Object, and this class must be resolved, too. Thus the custom class loader has to load this class by itself, otherwise the load fails with a linkage error. These two facts imply that a custom class loader has to delegate class loading. In JDK 1.4, two of the three versions of defineClass() throw a SecurityException if the given class name starts with "java", while the third version is deprecated due to these security concerns. loadClass() java.lang.Object SecurityException I want to stress the fact here that there is a difference between the class loader that starts the process of loading the class and the one that actually loads (defines) the class. Assuming that in our example no class loader delegates the loading of a class to one of its children, any class is either loaded by the Initial CL or by one of its ancestors. Let us assume that a class A contains a symbolic link to class B that in turn contains a symbolic link to class C. The class loader of C can never be a child of the class loader of B or of A. Of course, one should never say "never," and yes, it is possible to break this rule, but like multiple inheritance in C++, this is "black belt" programming. A more prominent exception of the JDK delegation model of "delegating first" is the class loader for a web container described in the servlet specification. This one tries to load a class first by itself before it delegates to the parent. Nevertheless, some classes, such as java.*, javax.*, org.xml.sax.* and others, are delegated first to the parent. For more information, please check out the Tomcat 5.0 documentation. java.* javax.* org.xml.sax.* After a class is defined with defineClass(), it must be linked in order to be usable by the final resolveClass() method. Between this method call and the first usage of a symbolic link, the class type is loaded by the class loader of the containing class as Initial CL. If any linked class (type) cannot be loaded, the method will throw a linkage error (java.lang.NoClassDefFoundError). Keep in mind that the resolution of symbolic links is up to the JVM and can be done anywhere between the loading of the containing class (eager resolution or C-style) and the first actual usage of the symbolic link (lazy resolution). It can happen that a symbolic link is in a class and if it is never used, the linked class will never be loaded such as in this example with JDK 1.4.2 on Windows 2000: resolveClass() java.lang.NoClassDefFoundError public class M { // In JDK 1.4.2 on W2K this class can be used // fine even if class O is not available. public O mMyInstanceOfO; } whereas this class will fail with a linkage error if the class O cannot be loaded: O public class M { // In JDK 1.4.2 and W2K the creation of an // instance of M will FAIL with // a NoClassDefFoundError if class O is not // available public O mMyInstanceOfO = new O(); } and to make matters a little bit more complicated, it only fails when an instance is created: // Fine because in JDK 1.4.2 on W2K class // linking is done lazy Class lClassM = Class.forName("M"); // Fails with NoClassDefFoundError Object lObject = lClassM.newInstance(); For more information, please read Chapter 12: "Execution" in the Java Language Specification. To a beginner, a class is identified solely by the class type. As soon as you start to deal with class loaders, this is no longer the case. Provided that class type M is not available to CP, A1 and A2 could load the same class type M with different byte code. Even when the byte code would be the same from a Java point of view, these classes are different, no matter if the byte code is the same or not. To avoid ambiguities, a class is identified by its class type as well as the Effective CL, and I will use the notation <Class Name>-<Class Loader>. So for this case, we have classes M-A1 and M-A2. Imagine we also have another class, Test-A1, with a method upcastM() that looks like this: <Class Name>-<Class Loader> M-A1 M-A2 Test-A1 upcastM() public void upcastM(Object pInstance) throws Exception { M lM = (M) pInstance; } Because the class Test is loaded by A1, its symbolic link M is also loaded by A1. So we are going to upcast a given object to M-A1. When this method is called with an instance of the class M-A1 as an argument, it will return successfully, but if it is called with an instance of M-A2, it will throw a ClassCastException because it is not the same class, according to the JVM. Even with reflection this rule is enforced, because both java.lang.Class.newInstance() and java.lang.reflect.Constructor.newInstance() return an instance of class java.lang.Object-BS. Unless only reflection is used during the lifetime of this object, the instance has to be upcast at some point. In the case of only using reflection to avoid conflicts, any arguments of a method still be subject to an upcast to the class of the method signature and therefore the classes must match, otherwise you get a java.lang.IllegalArgumentException due to the ClassCastException. Test A1 M ClassCastException java.lang.Class.newInstance() java.lang.reflect.Constructor.newInstance() java.lang.Object-BS java.lang.IllegalArgumentException The sample code may help the reader to better understand the concepts described above and, later, to do their own investigations. In order to run the sample code, just extract it in the directory of your choice and execute the ant build script in the classloader.part1.basics directory. It has three directories: main, version_a, and version_b. The main directory contains the startup class Main.java as well as the custom class loader that will load classes from a given directory. The other two directories both contain one version of M.java and Test.java. The class Main will first create two custom class loaders each loading classes, after delegating to the parent class loader, from either the version_a or version_b directories. Then it will load the class M by each of these two class loaders and create an instance through reflection: Main.java Main // Create two class loaders: one for each dir. ClassLoader lClassLoader_A = new MyClassLoader( "./build/classes/version_a" ); ClassLoader lClassLoader_B = new MyClassLoader( "./build/classes/version_b" ); // Load Class M from first CL and // create instance Object lInstance_M_A = createInstance( lClassLoader_A, "M" ); // Load Class M from second CL and // create instance Object lInstance_M_B = createInstance( lClassLoader_B, "M" ); In order to test an upcast, I need a class where the Effective CL is one of the custom class loaders. I then use reflection in order to invoke a method on them because I cannot upcast them because Main is loaded by the CP: // Check the upcast of a instance of M-A1 // to class M-A1. This test must succeed // because the CLs match. try { checkUpcast( lClassLoader_A, lInstance_M_A ); System.err.println( "OK: Upcast of instance of M-A1" + " succeeded to a class of M-A1" ); } catch (ClassCastException cce) { System.err.println( "ERROR: Upcast of instance of M-A1" + " failed to a class of M-A1" ); } // Check the upcast of a instance of M-A2 to // class M-A1. This test must fail because // the CLs does not match. try { checkUpcast( lClassLoader_A, lInstance_M_B ); System.err.println( "ERROR: upcast of instance of M-A2" + " succeeded to a class of M-A1" ); } catch (ClassCastException cce) { System.err.println( "OK: upcast of instance of M-A2 failed" + " to a class of M-A1" ); } The checkUpcast() loads the class Test through reflection and calls the Test.checkUpcast() method, which makes a simple upcast: checkUpcast() Test.checkUpcast() private static void checkUpcast( ClassLoader pTestCL, Object pInstance ) throws Exception { try { Object lTestInstance = createInstance( pTestCL, "Test" ); Method lCheckUpcastMethod = lTestInstance.getClass().getMethod( "checkUpcast", new Class[] { Object.class } ); lCheckUpcastMethod.invoke( lTestInstance, new Object[] { pInstance } ); } catch( InvocationTargetException ite ) { throw (ClassCastException) ite.getCause(); } } Afterwards, there are some tests that do the same thing, but check the upcast restriction against reflection to ensure that reflection cannot compromise the rules posted at the beginning of the article. The last test checks the linking of symbolic links. On Windows 2000 and JDK 1.4.2, it will also show the lazy loading of classes because the loading of the class succeeds, whereas the creation of the instance eventually fails: // Load a class N that has a symbolic link to // class O that was removed so that the class // resolving must fail try { // Upcast ClassLoader to our version in // order to access the normally protected // loadClass() method with the resolve // flag. Even the resolve flag is set to // true the missing symbolic link is only // detected in W2K and JDK 1.4.2 when the // instance is created. Class lClassN = ( (MyClassLoader) lClassLoader_A).loadClass( "N", true ); // Finally when the instance is created // any used symbolic link must be resolved // and the creation must fail lClassN.newInstance(); System.err.println( "ERROR: Linkage error not thrown even" + "class O is not available for" + " class N" ); } catch( NoClassDefFoundError ncdfe ) { System.err.println( "OK: Linkage error because class O" + " could not be found for class N" ); } Please note that in the directory version_a there is a class named O.java, because in order to compile the class N.java, this class is needed. However, the ant build script will remove the compiled class O.class before the test is started. O.java N.java ant O.class As long as a Java developer does not deal with his or her own class loader, all of the classes are loaded by the bootstrap and system class loader, and there will never be a conflict. Thus, it seems that a class is defined only by the fully qualified class name. As soon as there are sibling class loaders -- neither a parent of the other -- a class type can be loaded multiple times with or without different byte code. The class loader also defines the visibility of a class type because any upcast checks against the class name as well as its class loaders. To use the currency analogy, this is expressed by the fact that you can have several currencies in your wallet, but as soon as you want to use one, the cashier will check if your money is of the local currency. Still, you can carry these currencies in your pocket wherever you go, and likewise, you can carry around instances of classes even when they are unknown or not compatible in a particular class, as long as the class of the reference is compatible there. Luckily in Java, java.lang.Object is the superclass of all instances and is loaded by the BS, which is the parent of all class loaders no matter what. This means a reference of a class java.lang.Object is always compatible. I think of this as a "tunneling through" of classes from one compatible island to the next -- something that is very important in J2EE, as will be shown in a future installment. My analogy with the currencies is very simplified, because it implies that all classes have the same visibility due to the single border of a country. The analogy is based on the two-dimensional world map, whereas with Java class loaders, each level within the hierarchy of the class loaders is adding a new layer and building up a three-dimensional space. Additional class loaders enable a Java developer to write modular applications where the visibility of classes is restricted, and therefore, multiple class types can be loaded and managed. Nevertheless, it requires effort to understand the used class loaders and the organization of the classes and class loaders. As with threads, class loading is a runtime behavior that is not obviously visible to the developer, and requires experience and testing to understand and utilize. Now that the groundwork is laid, we can finally delve into the usage of class loaders. In the next article, we will see how class loaders can be used in a J2EE application server to manage deployments and what the effects are on invocations through local or remote interfaces. Afterwards, we will see how advanced class loaders make it possible to drop class types or massage the code in order to add "Advices" (AOP) at runtime without changing or recompiling your code. Andreas Schaefer is a system architect for J2EE at SeeBeyond Inc., where he leads application server development..
http://www.onjava.com/pub/a/onjava/2003/11/12/classloader.html?page=last
CC-MAIN-2016-26
en
refinedweb
Details Description Modified description to be clearer: Ivy is extremely aggressive towards repositories . This can result in failures to resolve, even against a healthy repository and with no network latency. The symptom: [ivy:resolve] 01-07-2008 13:16:24 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry [ivy:resolve] INFO: I/O exception (java.net.BindException) caught when processing request: Address already in use: connect. This is especially a problem with large repositories (lots of revisions) and resolving against latest.integration as this will fetch ivy.xml md5 and sha1 files for every revision. As I've included in a comment, the problem appears to be Ivy's attempts to list URLs that don't actually exist. Ivy builds up URLs using the repository location and appending organizations and module names. We have ivy chains that contain 5 links or more. So for each successful attempt to list an URL, there are several attempts to list non-existent URLs. This is wasteful in terms of time, and can lead to using up all of the available Windows ports on the client machine. Issue Links Activity - All - Work Log - History - Activity - Transitions That looks like it helps quite a bit! I now see perhaps one port being left around in TIME_WAIT state per resolve, which is much better than lots of ports being left around per resolve. I'll try to confirm tomorrow with a more taxing example. I've committed a potential fix in SVN trunk. Could you please give it a try to see if it fixes the problem? I couldn't test it because I'm on windows Vista right now which doens't seem to have the problem (butI could reproduce the problem earlier this day on a windows XP machine) Attached my hackaround. This suffers from general caching shortcomings, but has the side benefit of reducing unnecessary server connections. Minimally tested. I'm just including it here as a possibility if the underlying problem can't be fixed without a Java sdk fix. hackaround that prevents the problem by capturing bad URLs and preventing them from being accessed again ...but it does not appear that our Ant setup includes any version of http-client.jar. I'll have to check on that tomorrow. It appears to be using BasicURLHandler. While I was debugging, I set breakpoints in HttpClientHandler and did not see them hit. We have also reproduced this problem running from Ant (in the process of both doing builds), but it's a little more difficult to tell what's going on there. Could you tell what URLHandler is used? For instance, what class does URLHandlerRegistry.getDefault() returns? As far as I can tell, commons-httpclient will only be used if you use the Ant tasks or use the Ivy CLI. I already had httpclient 3.0 in my classpath. I updated to 3.1 and it didn't seem to make any difference. I think httpclient is on the classpath properly. I am running the Ivy source code (2.0) and using Ivy API methods directly if that makes a difference. ok, I see the problem and I was able to fix the problem illustrated by your main-method, now I'll have to apply the same approach it to Ivy's codebase. Can you confirm that this problem does not occur when you add commons-httpclient-3.x to Ivy's classpath?. It appears that the problem we are experiencing right now is because of all the attempts to read non-existent directories using the ApacheURLLister class. When the connection attempts (and fails) to get the input stream, it is apparently enough to create a connection, but the connection is not cleaned up properly, even using the disconnect call. The code below reproduces the problem (on windows) if you put the proper data in the url definition. You will get the BindException after about 15 seconds. If you do a "netstat" from the command line, you will see lots of connections in the TIME_WAIT state. I think Nascif's idea above makes sense to reduce the number of connections being made. I think it would also make sense to reduce the number of invalid URLs used. I hacked together some code to keep a hash of the shortest invalid urls and then not attempt to make connections when subsequent urls show up with an invalid prefix. This seems to work but I haven't really validated it yet. This idea could also be used in conjunction with Nascif's idea. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.BindException; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; public class Test2 { public static void main(String[] args) throws IOException { for (int i=0;;i++) { URL url=new URL("http", "<your server>", 80, "<bad path on server>"); //shows problem // URL url=new URL("http", "<your server>", 80, "<existing path on server>"); //works fine; does not leak connections URLConnection conn=url.openConnection(); String htmlText = ""; try catch (BindException e){ e.printStackTrace(); } catch (IOException e) {} finally { if (conn instanceof HttpURLConnection) } } } } From Nascif: I believe we are seeing the same issue on Ivy 2.0 final, will post more details soon. I have to agree that the current design is very much a DOS attack on the server. Our scenario is very much as described above as well, large number of modules, with large number of revisions, and resolving for latest. We can easily get to thousands of connections created and destroyed in a resolve, and we are bumping into the Windows limitations described in;EN-US;196271. For continuous integration builds, this is a major issue. I wonder if a different approach could be taken for the url resolver. Instead of releasing the connection on every download() and upload(), why not take advantage of HTTP 1.1 ability to keep connections open? You would go from thousands of connections per resolve to 1 - and it would be constant, instead of on the order of modules x versions x resolvers as it is today. Since there is already a concept of locking in Ivy, it means there is a concept of transaction borders. You could use that to implement to setup and closing of the connection. I've cloned because we appear to have the same issue, but I don't know how to change the status of it back to "Open". I'm copying the comments Nascif and I made on it into this comment for easier reference. ok, so I'll mark this issue as fixed. Please reopen if you still have problems. Thanks for the help in solving this issue! Maarten
https://issues.apache.org/jira/browse/IVY-1105?attachmentOrder=desc
CC-MAIN-2016-26
en
refinedweb
This is a discussion on [kdvi,kviewshell] possible patches - KDE ; First, is this the right forum to be talking about all this? I have made some progress in my efforts to port kdvi to Windows and now have an app that runs without using the KParts factory stuff to create ... First, is this the right forum to be talking about all this? I have made some progress in my efforts to port kdvi to Windows and now have an app that runs without using the KParts factory stuff to create the EmptyMultiPage and KDviMultiPage widgets. I can continue down this path, stripping out the KDE-specific stuff, but first I thought I should offer some (potential) patches back. Some are really trivial. Some might need some discussion. Please indicate which, if any, of these you're interested in: 1. Whitespace. There's a heap of trailing whitespace in kdegraphics/{kviewshell,kdvi}. s/ *$// 2. private static data in header files. It's just polluting the header file. I propose to move it out of the classes and into the .cpp files only. = documentWidget.h: static QPixmap waitIcon, URShadow, BRShadow, BLShadow; marklist.h: static QPixmap waitIcon; 3. I had a lot of problems getting things up and running because these static QPixmaps above are plain evil. If their translation unit (here documentWidget.cpp, marklist.cpp) is instantiated before that containing QApplication then there's a run time failure: QPaintDevice: Must construct a QApplication before a QPaintDevice I've used singletons in the .cpp file instead: QPixmap & URShadow() { static QPixmap * pixmap =3D createPixmap(); return *pixmap; } A real solution should address multi-threading concerns, but you need *something*. Alexandrescu's "Double-Checked Locking Pattern" springs to mind here. (Modern C++ Design, section 6.9.1) 4. There are many raw pointers that just smack of resource leaks. A quick read of the QGuardedPtr docs suggests that it's a little heavy but would clearly do the job. Is there a KDE policy against Boost? Why aren't you using boost::scoped_ptr<> everywhere? 5. Memory allocation/fragmentation. "new" is expensive, right? For example, kdegraphics/kviewshell/searchWidget.h has: SearchWidget* searchWidget; QPushButton* stopButton; QLabel* searchLabel; KLineEdit* searchText; QPushButton* findNextButton; QPushButton* findPrevButton; QCheckBox* caseSensitiveCheckBox; QHBoxLayout* layout; why aren't you using the Pimpl idiom in such cases? Only one "new" as opposed to 8... 6. Is there a KDE policy against anonymous namespaces? There appears to be a stack of "static Foo foo;" stuff in .cpp files that I would expect to see as "namespace { Foo foo; }". 7. Why does kdegraphics/kviewshell/units.h use a class and static function when I'd expect: namespace distance { float convertToMM(...); } 8. This one is perhaps a real bug. Why are you passing copies of TextSelection around? Why not "TextSelection const &"? class DocumentPageCache: public QObject { public: void selectText(TextSelection selection); }; class DocumentWidget: public QWidget { public slots: void select(TextSelection); protected: void updateSelection(TextSelection newTextSelection); }; class KMultiPage { protected slots: void gotoPage(TextSelection); }; class RenderedDocumentPage { public: QRegion selectedRegion(TextSelection selection); }; 9. Is there a KDE policy on order of inclusion of header files? At LyX we use the "most specific first" policy. Ie, the "..." headers come before the <...> ones. That way, the contents of the <...> headers don't polute our own stuff. You *appear* to do things the other way round. Is this a conscious policy or is that just "how it happened". Would you like a patch? 10. Goes with (9) really. You #include a bunch of stuff that you don't need or use. I have a little script that removes each header file in turn, tries to compile and if it fails puts the header back. The result is invariably "leaner and meaner". Just trying to get a feel for all things KDE ;-) If you're interested in receiving patches to any of these, just holler. Angus = >> Visit to unsubscrib= e <<
http://fixunix.com/kde/147791-%5Bkdvi-kviewshell%5D-possible-patches.html
CC-MAIN-2016-26
en
refinedweb
perlquestion acanfora Hello all, I am trying to export by default a variable from a module in the importer namespace, please look at this sample code: <code> package EXAMPLE; use strict; use warnings; sub import{ my $context = caller; my $symbol = "$context\:\:my_dirt_sneaky_object_reference"; warn $context; warn $symbol; { no strict 'refs'; *$symbol = \EXAMPLE->new; } } sub new{ my $class = shift; my $self = {}; return bless $self, $class; } sub my_example_method{ print "hi, I am here!"; } </code> when I call it from a traditional CGI, all works without a glitch: <code> #!/usr/bin/perl use lib '/path/to/whateveryoulike'; use EXAMPLE; $my_dirt_sneaky_object_reference->my_example_method; </code> When I call the same code from mod_perl (Registry), I get a segmentation fault after the first invocation. Am I doing any big mistake with mod_perl? Is it the bad way to play with namespaces in mod_perl? To tell the truth, what I am trying to achieve is a bit more convoluted, but I tried to reduce it to what I believe is the kernel of the problem. Any idea? Thanks in advance for tips and advices.
http://www.perlmonks.org/?displaytype=xml;node_id=996605
CC-MAIN-2016-26
en
refinedweb
So is the while loop beyond the scope of the original value of location? prog- is a list of strings. The print statement is just for me trying to debug. The if statement looks for a condition to end the loop. - Code: Select all # here is a broken solution to get you started def execute(prog): location = 0 T=0 while True: if location==len(prog)-1: return "success" prog[location].split() print(prog[location]) location = findLine(prog, T) Traceback (most recent call last): In line 8 of the code you submitted: prog[location].split() TypeError: list indices must be integers, not NoneType As a small aside, it looks as if the original definition of location is used as a way to refer to list index 0, but then the value of location is updated by location=findLine(prog,T). Which to me, seems to make the use of location as a counter pointless in the way it's used. Any help or discussion about this will be great. Many thanks.
http://www.python-forum.org/viewtopic.php?p=5450
CC-MAIN-2016-26
en
refinedweb
The State of XML Parsing in Ruby (Circa 2009) It's almost the end of 2009, and I have to ask: are we through dealing with XML yet? Although many of us wish we could consume the web through a magic programmer portal that shields us and our code from all the pointy angle brackets, the reality that is the legacy of HTML, Atom and RSS on the web leaves us little choice but to soldier on. So let's take a look at what Ruby-colored armor is available to us as we continue our quest to slay the XML dragons. Background Historically, Ruby has had a number of options for dealing with structured markup, though oddly none have reached a solid consensus among Ruby developers as the “go to” library. The earliest available library seems to be Yoshida Masato's XMLParser, which wraps Expat and was first released around the time that Expat itself was released, back in 1998. A pure Ruby parser by Jim Menard called NQXML appeared in 2001, though it never matured to the level of a robust XML parser. In late 2001, Matz expressed his desire for out of the box XML support, but sadly, nothing appeared in Ruby's standard library until 2003, when REXML was imported for the 1.8.0 release. After reading bike-shed discussions like this one on ruby-talk in November 2001, or this wayback-machine page from the old RubyGarden wiki, it's not hard to see why. Meanwhile, other language runtimes, such as Python and Java, moved along and built solid, acceptable foundations, making Ruby's omission seem more glaring. But all was not lost: Ruby has always had a quality without a name that made it a great language for distilling an API. All that was needed was an infusion of interest and talent in Ruby, and a few more experiments and iterations. Fast forward to the present time, and all those chips have fallen. We've seen evolution from REXML to libxml-ruby to Hpricot, and finally to Nokogiri. So, is the XML landscape on Ruby so dire? Certainly not, as you'll see by the end of this article! While the standard library support for XML hasn't progressed beyond REXML yet, state-of-the-art solutions are a few keystrokes away. XML APIs A big part of what makes XML such a pain to work with is the APIs. We Rubyists tend to have an especially low tolerance for friction in API design, and we really feel it when we work with XML. If XML is just a tree structure, why isn't navigating it as simple and elegant as traversing a Ruby Enumerable? The canonical example of API craptasticism is undoubtedly the W3C DOM API. For proof, observe the meteoric rise of jQuery in the JavaScript world. While it would be easy to fill an entire article with criticisms regarding the DOM, it's been done before. (Incidentally, read the whole series of interviews with Elliotte Rusty Harold for a series of insights on API design, schema evolution, and more.) Instead, we'll take a brief exploratory tour of some Ruby XML APIs using code examples. Though some of the examples may seem trivially short, don't underestimate their power. Conciseness and readability are Ruby's gifts to the library authors and they're being put to good use. The libraries we'll use for comparison are REXML, Nokogiri, and JAXP, Java's XML parsing APIs (via JRuby). Parsing The simplest possible thing to do in XML is to hand the library some XML and get back a document. REXML require 'rexml/document' document = REXML::Document.new(xml) Nokogiri require 'nokogiri' document = Nokogiri::XML(xml) Both REXML and Nokogiri more or less get this right. What's also nice is that they both transparently accept either an IO-like object or a string. Contrast this to Java: JAXP/JRuby factory = javax.xml.parsers.DocumentBuilderFactory.newInstance factory.namespace_aware = true # unfortunately, important! parser = factory.newDocumentBuilder # String document = parser.parse(xml) # IO document = parser.parse(xml.to_inputstream) In that familiar Java style, the JAXP approach forces you to choose from many options and write more code for the happy path. JRuby helps you a little bit by converting a Ruby string into a Java string, but needs a little help with intent for converting an IO to a Java InputStream. XPath Now that we've got a document object, let's query it via XPath, assuming the underlying format is an Atom feed. Here is the code to grab the entries' titles and store them as an array of strings: REXML elements = REXML::XPath.match(document.root, "//atom:entry/atom:title/text()", "atom" => "") titles = elements.map {|el| el.value } Nokogiri elements = document.xpath("//atom:entry/atom:title/text()", "atom" => "") titles = elements.map {|e| e.to_s} Again, both REXML and Nokogiri clock in at similar code sizes, but subtle differences begin to emerge. Nokogiri's use of #xpath as an instance method on the document object feels more natural as a way of drilling down for further detail. Also, note that both APIs return DOM objects for the text, so we need to take one more step to convert them to pure Ruby strings. Here, Nokogiri's use of the standard String#to_s method is more intuitive; REXML::Text's version returns the raw text without the entities replaced. Unfortunately, doing XPath in Java gets a bit more complicated. First we need to construct an XPath object. At least JRuby helps us a bit here–we can create an instance of the NamespaceContext interface completely in Ruby, and omit the methods we don't care about. JAXP/JRuby xpath = javax.xml.xpath.XPathFactory.newInstance.newXPath ns_context = Object.new def ns_context.getNamespaceURI(prefix) {"atom" => ""} \[prefix\] end xpath.namespace_context = ns_context Next, we evaluate the expression and construct the array titles: JAXP/JRuby nodes = xpath.evaluate("//atom:entry/atom:title/text()", document, javax.xml.xpath.XPathConstants::NODESET) titles = [] 0.upto(nodes.length-1) do |i| titles << nodes.item(i).node_value end That last bit where we need to externally iterate the DOM API is particularly un-Ruby-like. With JRuby we can mix in some methods to the NodeList class: JAXP/JRuby module org::w3c::dom::NodeList include Enumerable def each 0.upto(length - 1) do |i| yield item(i) end end end And replace the external iteration with a more natural internal one: JAXP/JRuby titles = nodes.map {|e| e.node_value} This kind of technique tends to become a fairly common occurrence when coding Ruby to Java libraries in JRuby. Fortunately Ruby makes it simple to hide away the ugliness in the Java APIs! Walking the DOM Say we'd like to explore the DOM. Both REXML and Nokogiri provide multiple ways of doing this, with parent/child/sibling navigation methods. They also each sport a recursive descent method, which is quite convenient. REXML titles = [] document.root.each_recursive do |elem| titles << elem.text.to_s if elem.name == "title" end Nokogiri titles = [] document.root.traverse do |elem| titles << elem.content if elem.name == "title" end Needless to say, Java's DOM API has no such convenience method, so we have to write one. But again, JRuby makes it easy to Rubify the code. Note that our #traverse method makes use of our Enumerable-ization of NodeList above as well. JAXP/JRuby module org::w3c::dom::Node def traverse(&blk) blk.call(self) child_nodes.each do |e| e.traverse(&blk) end end end titles = [] document.traverse do |elem| titles << elem.text_content if elem.node_name == "title" end Pull parsing All three libraries have a pull parser (also called a stream parser or reader) as well. Pull parsers are efficient because they behave like a cursor scrolling through the document, but usually result in more verbose code because of the need to implement a small state machine on top of lower-level XML events. They are best employed on very large documents where it's impractical to store the entire DOM tree in memory at once. REXML parser = REXML::Parsers::PullParser.new(xml_stream) titles = [] text = '' grab_text = false parser.each do |event| case event.event_type when :start_element grab_text = true if event \[0\] == "title" when :text text << event \[1\] if grab_text when :end_element if event \[0\] == "title" titles << text text = '' grab_text = false end end end Nokogiri reader = Nokogiri::XML::Reader(xml_stream) titles = [] text = '' grab_text = false reader.each do |elem| if elem.name == "title" if elem.node_type == 1 # start element? grab_text = true else # elem.node_type == 15 # end element? titles << text text = '' grab_text = false end elsif grab_text && elem.node_type == 3 # text? text << elem.value end end (Aside to the Nokogiri team: where are the reader node type constants?) JAXP/JRuby include javax.xml.stream.XMLStreamConstants factory = javax.xml.stream.XMLInputFactory.newInstance reader = factory.createXMLStreamReader(xml_stream.to_inputstream) titles = [] text = '' grab_text = false while reader.has_next case reader.next when START_ELEMENT grab_text = true if reader.local_name == "title" when CHARACTERS text << reader.text if grab_text when END_ELEMENT if reader.local_name == "title" titles << text text = '' grab_text = false end end end Not surprisingly, all three pull parser examples end up looking very similar. The subtleties of the pull parser APIs end up getting blurred in the loops and conditionals. Only write this code when you have to. Performance At the end of the day, it comes down to performance, doesn't it? Although the topic of Ruby XML parser performance has been discussed before, I thought it would be instructive to do another round of comparisons with JRuby and Ruby 1.9 thrown into the mix. System Configuration - Mac OS X 10.5 on a MacBook Pro 2.53 GHz Core 2 Duo - Ruby 1.8.6p287 - Ruby 1.9.1p243 - JRuby 1.5.0.dev (rev c7b3348) on Apple JDK 5 (32-bit) - Nokogiri 1.4.0 - libxml2 2.7.3 Here are results comparing Nokogiri and Hpricot on the three implementations along with the JAXP version which only runs on JRuby (smaller is better). The REXML results were over an order of magnitude slower, so it's easier to view them on a separate graph. Note the number of iterations here is 100 vs. 1000 for the results above. While these results don't paint a complete picture of XML parser performance, they should give you enough of a guideline to make a decision on which parser to use once you take portability and readability into account. In summary: - Use REXML when your parsing needs are minimal and want the widest portability (across all implementations) with the smallest install footprint. - Use JRuby with the JAXP APIs for portability across any operating system that supports the Java platform (including Google AppEngine). - Use Nokogiri for everything else. It's the fastest implementation, and produces the most programmer-friendly code of all Ruby XML parsers to date. (As a footnote, we on the Nokogiri and JRuby teams are looking for community help to further develop the pure-Java backend for Nokogiri so that AppEngine and other JVM deployment scenarios that don't allow loading native code can benefit from Nokogiri's awesomeness. Please leave a comment or contact the JRuby team on the mailing list if you're interested.) The source code for this article is available if you'd like to examine the code or run the benchmarks yourself. Keep an eye on the Engine Yard blog for an upcoming post on Nokogiri, and as always, leave questions and thoughts in the comments! Share your thoughts with @engineyard on Twitter
https://blog.engineyard.com/2009/xml-parsing-in-ruby
CC-MAIN-2016-26
en
refinedweb
hello guys i need a little bit of help. i have a java program that is suppose to be an assignment on learning for loops, this is my coding iv done (below) , it is suppose to accumulate 4 integers and add them together and if the value = below 34 it gives a certain message and vice versa if above 34 it gives another message. unfortunetly when i run the program it doesnt give me the correct accumulated value any help would be great. import javax.swing.JOptionPane; public class assessment4 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String disabilityclass; int legality = 0; for (int i = 1; i <=4; i++) { disabilityclass= JOptionPane.showInputDialog("What is the disability class of swimmer on leg " + i +"?"); legality= Integer.parseInt(disabilityclass); legality = legality + i; } if (legality <= (34)) { JOptionPane.showMessageDialog(null, "That is a legal team with " + legality + " point"); } else JOptionPane.showMessageDialog(null, "That is a illegal team with " + legality + " point"); } } -- Sat Oct 13, 2012 8:29 pm -- found the problem myself guys i simply needed to change legality+= Integer.parseInt(disabilityclass);
https://www.hackthissite.org/forums/viewtopic.php?f=36&t=9366
CC-MAIN-2016-26
en
refinedweb
On Mon, 12 Sep 2005, Scott Eade wrote: >> Therefore I am inclined to follow the proposed solution and throw an >> exception in the constructor of LargeSelect if the chosen DB does not >> support native limit and offset. >> ... >> >> Are there any objections ? Is everybody ok with throwing a >> RuntimeException, or would it be better to add the TorqueException to >> the throws clause, possibly breaking people's code because >> TorqueException is not caught ? > > My only comment would be that as a heavy user of LargeSelect, if I were > to ever switch to a database that did not support limit and offset I > could not easily produce an executing (though obviously poorly > performing when it comes to LargeSelect) version of my application. > > I would prefer us to add an appropriately worded statement in the docs > and javadocs highlighting the issue with a recommendation that it not be > used for the affected databases. > The comment already exists, though maybe one could highlight it more. The problem is that the performance is much poorer than it need be, because fetching one page at a time is exactly the thing you should not do if you do not have native limit/offset. Thinking over it again, the real solution would be to fetch the whole memoryLinit at once and do the offset by hand if the database does not support native limit/offset. The bad thing is that I do not know the LargeSelect code and have not the time to do it at the moment (sigh). >> >> I would also guess that the problems with databases which do not >> support native limit/offset have lead to the exclusion of the >> LargeSelectTest from the runtimetest. Does anybody object to include >> the LargeSelectTest and print an error but not execute the test if the >> database dose not support native limit/offset ? Sample code would be >> >> public class LargeSelectTest extends BaseRuntimeTestCase >> { >> .... >> >> public void testLargeSelect() throws TorqueException >> { >> if (Torque.getDB(Torque.getDefaultDB()).getLimitStyle() >> == DB.LIMIT_STYLE_NONE) >> { >> log.error("LargeSelect is known not to work for databases " >> + "which do not support native limit/offset"); >> return; >> } >> >> .... >> >> If one adds this, the LargeSelectTest also runs for hsqldb which does >> not support native limit/offset. > > Does the test case fail at present? At the moment, the method LargeSelectTest.testLargeSelect() fails. > If we continue to let the code code > execute for the reason given above then the test case should at least be > enabled to make sure that the simulated limit and offset are indeed > compatible with the behaviour when the database supports them. > If we manage to do the limit/offset manually, one could take it out again. Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org
http://mail-archives.apache.org/mod_mbox/db-torque-dev/200509.mbox/%3C20050911225103.H42165@minotaur.apache.org%3E
CC-MAIN-2016-26
en
refinedweb
...one of the most highly regarded and expertly designed C++ library projects in the world. — Herb Sutter and Andrei Alexandrescu, C++ Coding Standards #include <boost/phoenix/bind/bind_member_variable.hpp> Member variables can also be bound much like member functions. Member variables are not functions. Yet, like the ref(x) that acts like a nullary function returning a reference to the data, member variables, when bound, act like a unary function, taking in a pointer or reference to an object as its argument and returning a reference to the bound member variable. For instance, given: struct xyz { int v; }; xyz::v can be bound as: bind(&xyz::v, obj) // obj is an xyz object As noted, just like the bound member function, a bound member variable also expects the first (and only) argument to be a pointer or reference to an object. The object (reference or pointer) can be lazily bound. Examples: xyz obj; bind(&xyz::v, arg1) // arg1.v bind(&xyz::v, obj) // obj.v bind(&xyz::v, arg1)(obj) = 4 // obj.v = 4
http://www.boost.org/doc/libs/1_47_0/libs/phoenix/doc/html/phoenix/modules/bind/binding_member_variables.html
CC-MAIN-2016-26
en
refinedweb
i have split a string by space ,done some operation and now how to properly order them for sending a mail in java or jsp - JSP-Servlet i have split a string by space ,done some operation and now how to properly... a string by space and collected some special charactor in that and done some... that is not properly ordered i.e see the following ///I typed a matter like this in a text GJTester - Java Unit Testing Tool GJTester - Java Unit Testing Tool GJTester, a general Java testing tool, accomplishes the unit, regression and contract testing of your Java programsSP-Servlet servlets hi, can anybody help me as what exactly to be done to for compilation,execution of servlets. i also want to know the software required in this execution request processing in servlets request processing in servlets how request processing is done in servlets and jsp Please visit the following links: JSP Tutorials Servlet Tutorials Here, you will find several examples of processing request servlets execution - JSP-Servlet servlets execution the xml file is web.xml file in which the servlet name,servlet class,mapping etc which has to be done. What u want...:// Thanks. Amardeep java servlets with database interaction java servlets with database interaction hai friends i am doing a web application in that i have a registration page, after successfully registered... i have done if you want i can send sample code. mycode import java.io. JTable values are not gettiing properly Not get ans properly code not working properly Why are my variables not dividing properly? Why are my variables not dividing properly? Why are my variables not dividing properly Servlets servlets the iPhone Applications Testing iPhone Applications Testing Developing..., which develop Apple's, own apps have a separate testing unit, but small and medium enterprises hire a testing firm to test their product GUI testing/software testing - Java Beginners GUI testing/software testing how to create a GUI testing/software testing module in java Running and testing application Running And Testing Application The complete database driven application with testing is given below You can test your application many way like using Mock... of Junit and then write the test case. To know more about the action testing click output not coming properly - JSP-Servlet output not coming properly I am not getting the output properly when i had written my code like below: Add Employee Details for( j=0;j<11;j++) { out.println("Department code Keyboard Done button in iphone Keyboard Done button in iphone hii,, how can i set a function on press keyboard done button. hello, For making keyboard Done button press :- import keyboard displacement by adding this line #define kOFFSET Struts validation not work properly - Struts Introduction to Java Servlets Introduction to Java Servlets Java Servlets are server side Java programs that require... associated information required for creating and executing Java Servlets online test project on java using servlets and jsp online test project on java using servlets and jsp as i am doing online test project on java using jsp and servlets ,,,the problem is in the code... ...,both buttons works properly .....,so i want a solution for placing the two... to return the uikeyboard on done button click. Do not forget to call < junit testing - JUNIT junit testing How to perform a testing in JUnit? Hi,Could you please explain me in detail "junit testing on stack". What is stack and how do you want to test?Please let's know, I will try to provide Installation, Configuration and running Servlets Installation, Configuration and running Servlets  ... to install a WebServer, configure it and finally run servlets using this server...). This Server supports Java Servlets 2.5 and Java Server Pages (JSPs) 2.1 specifications jsp -servlets jsp -servlets i have servlets s1 in this servlets i have created emplooyee object, other servlets is s2, then how can we find employee information in s2 servlets Testing - IDE Questions struts 2 testing Mobile Software Testing Services, Mobile Application Software Testing Service RoseIndia ; padding-bottom:9px; } Mobile Software Testing Services Now... a mobile software-testing firm to stress testing their mobile software. Roseindia... is offering a complete mobile testing solutions for all major brands of mobile. We Open Source Testing Tools in Java Open Source Testing Tools in Java In this page we are discussing about the different Open Source Testing Tools available in Java. JUnit JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used Using MYSQL Database with JSP & Servlets. Using MYSQL Database with JSP & Servlets. MYSQL... machine. Testing the installation is complete. Issue Building and Testing Struts Hibernate Plugin Application Building and Testing Struts Hibernate Plugin Application... and packaging will done by ant tool. To compile and create war file for deployment, open...;C:\Struts-Hibernate-Integration\dist" directory. Deploying and testing
http://www.roseindia.net/tutorialhelp/comment/93842
CC-MAIN-2014-10
en
refinedweb
Using Speech Dictionaries to Improve Handwriting Recognition Results Stefan Wick Microsoft Corporation June 2004 Applies to: Microsoft Tablet PC Platform SDK Windows XP Tablet PC Edition 2005 Handwriting recognition Custom dictionaries Summary: This article describes how the handwriting recognizer uses speech dictionaries. In addition, this article illustrates how to programmatically modify the dictionaries in order to improve results for handwriting recognition in your applications. The corresponding sample, written in C++, uses the Microsoft Tablet PC Platform SDK version 1.7, currently in Beta. Some example code is given in C#. (15 printed pages) Contents Introduction Overview Using the Sample Managing the User Dictionary Installing an Application Dictionary Removing an Application Dictionary Testing Handwriting Recognition Improvements Accessing Speech Dictionaries from Managed Code Conclusions Introduction The handwriting recognizers for western languages in Windows XP Tablet PC Edition 2005 are designed to take advantage of dictionaries. They can recognize known words with higher confidence than unknown words, such as e-mail names or abbreviations. There are three types of dictionaries: - System Dictionary—The system dictionary is part of the handwriting recognizer and contains a typical subset of words in the supported languages. - User Dictionary—The user dictionary is a customizable dictionary for each user. Users can add words to and remove words from the user dictionary. This dictionary is empty by default. - Application Dictionary—The application dictionary is typically installed with an application. The words in such a dictionary are available to all users on the system. By default, no application dictionary is installed. The handwriting recognizers share the infrastructure for user and application dictionaries with the Microsoft Speech SDK (SAPI 5.1). Note Words added to the current user's dictionary or installed as part of an application dictionary will be available in any application that uses handwriting or speech recognition. When your application instantiates a RecognizerContext object the system loads the current user's dictionary and any installed application dictionary. The words in these dictionaries are stored with an associated language identifier. This identifier can either be a locale ID or LANG_INVARIANT. If you use LANG_INVARIANT, the word will be used by any language recognizer. All entries in the dictionaries that match a language that is supported by the current handwriting recognizer are added to an internal word list. The handwriting recognizer recognizes words on that list with higher accuracy than words not on the list. For this reason, you can add words that are not in the system dictionary—such as e-mail names or abbreviations—to the current user's dictionary or an application dictionary to increase recognition accuracy. The following illustration details the creation of a RecognizerContext object: Note The procedure of creating the internal word list for handwriting recognition has been significantly improved in Microsoft Windows® XP Tablet PC Edition 2005. In the previous version the handwriting recognizer only used the current user's dictionary and ignored the language identifier. Furthermore, dramatic performance improvements in this area now allow you to add thousands of words to a dictionary without causing a noticeable delay when creating a RecognizerContext object. The Tablet PC Input Panel of Windows XP Tablet PC Edition 2005 enables users to modify the current user's dictionary through the correction UI, as shown in the following screenshot. This article focuses on programmatic access to this data. Using the Sample In order to compile the sample source code, you must have the following components installed on your computer: - Microsoft Visual Studio® .NET 2003. - Microsoft Tablet PC Platform SDK version 1.7, currently in Beta. - Microsoft Speech SDK 5.1. The sample application has a user interface that enables you to: - View the content of the current user's dictionary. - View the content of any installed application dictionary. - Filter the content of a selected dictionary by language. - Add words to the current user's dictionary. - Remove words from the current user's dictionary. - Install and remove application dictionaries. - Test handwriting recognition results for the current locale and dictionary configuration. Note The Add Lexicon and Import Words buttons prompt for a text file containing the words to be added. In the text file, each entry must be on a separate line, and the file must be saved in ANSI encoding. The following illustration shows the UI for the DictionarySample application. Important Tablet PC Input Panel does not add newly installed application dictionaries dynamically. You need to log off from Windows and then log on again to ensure that Input Panel uses any new dictionary. Managing the user dictionary Managing the current user's dictionary can be divided into three main sections: - Viewing the content of the user dictionary. - Adding words to the user dictionary. - Removing words from the user dictionary. Viewing the Content of the User Dictionary Use the ISpLexicon::GetWords API in order to retrieve words from user or application dictionaries. The following example code illustrates how to retrieve all words for a given locale ID (specified by currentLCID) from the current user's dictionary. The DictionarySample application uses this code in its CUserDictionarySampleDlg::PopulateDictList method. #include "sapi.h" #include "sphelper.h" ... CComPtr<ISpLexicon> spLex; HRESULT hr = S_FALSE; SPWORDLIST speechWords; DWORD dwGeneration = 0; DWORD dwCookie = 0; if SUCCEEDED(spLex.CoCreateInstance(CLSID_SpLexicon)) { while (SUCCEEDED(hr)) { memset(&speechWords, 0, sizeof(speechWords)); hr = spLex->GetWords(eLEXTYPE_USER, &dwGeneration, &dwCookie, &speechWords); if FAILED (hr) { // handle error for failed call to GetWords break; } for (SPWORD *pword = speechWords.pFirstWord; pword != NULL; pword = pword->pNextWord) { if (pword->LangID == currentLCID) { // add word to UI if it matches the current locale } } CoTaskMemFree(speechWords.pvBuffer); if (hr == S_OK) break; // nothing more to retrieve } } Adding Words to the User Dictionary Use the ISpLexicon::AddPronunciation API in order to add words to the current user's dictionary. The following example code illustrates how to add a word (specified by pszWord) for a given locale ID (specified by currentLCID) to the current user's dictionary. Use LANG_INVARIANT instead of a locale ID in order to add the word for all languages. The DictionarySample application uses this code when you click Add Word or Import Words. Removing Words from the User Dictionary Use the ISpLexicon::RemovePronunciation API in order to remove words from the current user's dictionary. The following example code illustrates how to remove a word (specified by pszWord) for a given locale ID (specified by currentLCID) from the current user's dictionary. Use LANG_INVARIANT instead of a locale ID in order to remove the word for all languages. Note Internally, LANG_INVARIANT is treated as a regular locale ID. This means if you add a word as English(UK) and again as LANG_INVARIANT, then removing it for LANG_INVARIANT will not remove the entry for English(UK). The DictionarySample application uses this code when you click Remove Word or Clear Dictionary. Note After removing words from the user dictionary, the Tablet PC Input Panel still keeps those words on its internal wordlist until the user logs off from Windows. Installing an Application Dictionary Microsoft Speech SDK (SAPI 5.1) provides two helper functions that make the creation of on application dictionary straight forward: SpCreateNewTokenEx and SpCreateObjectFromToken. The following example code illustrates how these helper functions are used to install an application dictionary and add words to it for a given locale ID (specified by currentLCID). Use LANG_INVARIANT instead of a locale ID in order to add a word for all languages. The DictionarySample application uses this code when you click Add Lexicon. Note Once an application dictionary has been installed it is read-only. To add or remove words, remove the application dictionary, make the changes necessary, and reinstall the application dictionary. #include "sapi.h" #include "sphelper.h" ... CComPtr<ISpLexicon> spLexicon; CComPtr<ISpObjectToken> spToken; WCHAR szTempAppLexCategoryId[MAX_PATH]; wcscpy(szTempAppLexCategoryId, SPREG_LOCAL_MACHINE_ROOT); wcscat(szTempAppLexCategoryId, L"\\AppLexicons"); if SUCCEEDED(SpCreateNewTokenEx(szTempAppLexCategoryId, NULL, &CLSID_SpUnCompressedLexicon, NULL, 0, NULL, &spToken, NULL)) { if SUCCEEDED(SpCreateObjectFromToken(spToken, &spLexicon)) { // add each word by calling AddPronunciation spLexicon->AddPronunciation(pszWord1, (WORD)currentLCID, SPPS_Unknown, NULL); spLexicon->AddPronunciation(pszWord2, (WORD)currentLCID, SPPS_Unknown, NULL); // ... } } Removing an Application Dictionary Passing NULL to ISpObjectToken::Remove removes the application dictionary specified by its respective token object. The following example code illustrates how to remove an application dictionary (specified by index lLexIndex). The sample application uses this code when the user clicks Remove Lexicon. Note As long as there is a running application that holds a reference to a RecognizerContext object, no application dictionary can be removed, except if the application dictionary was installed after the RecognizerContext was instantiated. Because of this, you cannot remove any application dictionary that has been added before the last logon, as Tablet PC Input Panel maintains a RecognizerContext object throughout its lifetime. To work around this, stop the TabTip.exe process before removing the application dictionary. Then reboot your system to ensure that the TabTip.exe process gets restarted properly. #include "sapi.h" #include "sphelper.h" ... CComPtr<ISpObjectTokenCategory> spCat; CComPtr<IEnumSpObjectTokens> spTokens; CComPtr<ISpObjectToken> spToken; HRESULT hr; if SUCCEEDED(spCat.CoCreateInstance(CLSID_SpObjectTokenCategory)) { if SUCCEEDED(spCat->SetId(SPCAT_APPLEXICONS, true)) { if SUCCEEDED(spCat->EnumTokens(NULL, NULL, &spTokens)) { if SUCCEEDED(spTokens->Item((long)i-1, &spToken)) { hr = spToken->Remove(NULL); if SUCCEEDED(hr) // dictionary removed successfully else if (hr == SPERR_TOKEN_IN_USE) // dictioanry in use by another application } } } } Testing Handwriting Recognition Improvements There is no direct access to the internal word list that the RecognizerContext object creates based on the dictionaries and the supported languages; however, you can programmatically check whether or not a given instance of the RecognizerContext class references a certain word. When you click String Supported?, the sample application uses the following code: Note The IInkRecognizerContext::IsStringSupported method returns true if the word is contained in the system dictionary, user dictionary, or application dictionary for the supported languages; otherwise false. #include "msinkaut_i.c" #include "msinkaut.h" #include "sapi.h" #include "sphelper.h" ... CComPtr<IInkRecognizerContext> spRecoCtxt; CComPtr<IInkRecognizers> spRecos; CComPtr<IInkRecognizer> spReco; HRESULT hr; VARIANT_BOOL varBool; CComBSTR bstr = L"John123"; // create collection of installed handwriting recognizers if SUCCEEDED(spRecos.CoCreateInstance(CLSID_InkRecognizers)) { // create a recognizer context for the current locale if SUCCEEDED(spRecos->GetDefaultRecognizer(currentLCID, &spReco)) { if SUCCEEDED(spReco->CreateRecognizerContext(&spRecoCtxt)) { // check if string is supported if SUCCEEDED(spRecoCtxt->IsStringSupported(bstr, &varBool)) { if (varBool == VARIANT_TRUE) MessageBox(L"Supported"); else MessageBox(L"Not supported"); } } } } You can verify handwriting recognition results by writing in the Handwriting Test field in the DictionarySample form. This field is an InkPicture control. The IInkRecognitionAlternates object is displayed in the ListBox control on the bottom right of the form and are listed in order of confidence. The following example code illustrates how to recognize strokes collected by an InkPicture control and how to retrieve the recognition alternates. CComPtr<IInkDisp> spInk; CComPtr<IInkStrokes> spStrokes; CComPtr<IInkRecognitionResult> spRecoResult; InkRecognitionStatus recoStatus; // obtain the Ink object from the InkPicture control if SUCCEEDED(spInkPicture->get_Ink(&spInk)) { // obtain the strokes collection from the Ink object if SUCCEEDED(spInk->get_Strokes(&spStrokes)) { // assign strokes to the recognizer context and recognize them if SUCCEEDED(spRecoCtxt->putref_Strokes(spStrokes)) { if SUCCEEDED(spRecoCtxt->Recognize(&recoStatus, &spRecoResult)) { if (recoStatus == IRS_NoError) { CComPtr<IInkRecognitionAlternates> spAlts; // get the recognition alternates if SUCCEEDED(spRecoResult->AlternatesFromSelection( IRAS_Start, IRAS_All, IRAS_DefaultCount, &spAlts)) { long lAltCount = 0; if SUCCEEDED(spAlts->get_Count(&lAltCount)) { for (long l=0; l<lAltCount; l++) { CComPtr<IInkRecognitionAlternate> spAlt; if SUCCEEDED(spAlts->Item(l, &spAlt)) { CComBSTR RecoString; if SUCCEEDED(spAlt->get_String(&RecoString)) { // display RecoString in your UI } } } } } } } } } } Accessing Speech Dictionaries from Managed Code From managed code you can access the speech dictionaries by calling speech automation APIs through COM Interop: - In Visual Studio, on the Project menu, click Add Reference. - In the Add Reference dialog, on the COM tab, click Microsoft Speech Object Library, click Select, and then click OK. Viewing the Contents of the User Dictionary by Using C# The following C# example code illustrates how to retrieve all words from the current user's dictionary by calling the GetWords method on the SpLexiconClass object. Adding Words to the User Dictionary by Using C# The following C# example code illustrates how to add a word (specified by newWord) for a given locale ID (specified by currentLCID) to the current user's dictionary by calling the AddPronunciation method on the SpLexiconClass object. Removing Words from the User Dictionary by Using C# The following C# example code illustrates how to remove a word (specified by wordToRemove) for a given locale ID (specified by currentLCID) from the current user's dictionary by calling the RemovePronunciation method on the SpLexiconClass object. Conclusions - Words that are in the system dictionary, user dictionary, or application dictionary are recognized with higher confidence and accuracy by the handwriting recognizer. - Words can be programmatically added and removed to and from the current user's dictionary by using Speech APIs. - Application dictionaries can be programmatically installed and removed by using Speech APIs. - If you want to add words to the dictionary for all users on the system, install an application dictionary. Otherwise, add them to the user's dictionary. - If a word applies to all languages, use LANG_INVARIANT when adding the word to the dictionary. - Speech automation APIs can be accessed from managed code through COM Interop.
http://msdn.microsoft.com/en-us/library/ms812511.aspx
CC-MAIN-2014-10
en
refinedweb
="... I... Both include and require include and evaluate the file specified as argument. The only difference is, when the included file cannot be found, include emits a warning while require emits a fatal error. Example: <?php include('non-existing-file'); require(...Outputs: PHP Warning: include(non-existing-file): failed t...Suppress error with @ : <?php @include('non-existing-file'); echo "A...Outputs: After include Use the codecs module to read file in Unicode. This is from the Python doc : import codecs f = codecs.open('unicode.rst', en...I had some luck reading files mainly in ASCII but contained some binary data with: import codecs f = codecs.open('unicode.rst', en... For Python 2.6 and later, this: with open(filename) as logfile: for line in...is equivalent to this: logfile = open(filename) try: for line i... This is an Ant custom task to merge Properties files I lifted from , with some minor bug fixes. Example usage: <taskdef name="mergeProperty" classname="ant.task....Implementation: package ant.task.addon; import java.io.Buff..."; ...
http://www.xinotes.net/notes/keywords/line/file/open/
CC-MAIN-2014-10
en
refinedweb
« Return to documentation listing #include <mpi.h> int MPI_Init_thread(int *argc, char ***argv, int required, int *provided) INCLUDE ’mpif.h’ MPI_INIT_THREAD(REQUIRED, PROVIDED, IERROR) INTEGER REQUIRED, PROVIDED, IERROR #include <mpi.h> int MPI::Init_thread(int& argc, char**& argv, int required) int MPI::Init_thread(int required) MPI_Init_thread, as compared to MPI_Init, has a provision to request a certain level of thread support in required: The level of thread support available to the program is set in provided, except in C++, where it is the return value of the function. In Open MPI, the value is dependent on how the library was configured and built. Note that there is no guarantee that provided will be greater than or equal to required. Also note that calling MPI_Init_thread with a required value of MPI_THREAD_SINGLE is equivalent to calling MPI_Init. All MPI programs must contain a call to MPI_Init or MPI_Init_thread. Open MPI accepts the C/C++ argc and argv arguments to main, but neither modifies, interprets, nor distributes them: { /* declare variables */ MPI_Init_thread(&argc, &argv, req, &prov); /* parse arguments */ /* main program */ MPI_Finalize(); } implementation, it should do as little as possible. In particular, avoid anything that changes the external state of the program, such as opening files, reading standard input, or writing to standard output. shell$ ompi_info | grep -i thread Thread support: posix (mpi: yes, progress: no) shell$ The "mpi: yes" portion of the above output indicates that Open MPI was compiled with MPI_THREAD_MULTIPLE support. Note that MPI_THREAD_MULTIPLE support is only lightly tested. It likely does not work for thread-intensive applications. Also note that only the MPI point-to-point communication functions for the BTL’s listed below « Return to documentation listing
http://icl.cs.utk.edu/open-mpi/doc/v1.5/man3/MPI_Init_thread.3.php
CC-MAIN-2014-10
en
refinedweb
awt list item* - Swing AWT information. Thanks...awt list item* how do i make an item inside my listitem...); choice.add("Java "); choice.add("Jsp"); choice.add("Servlets Item Events in Java events in java. This demonstrates that the event generated when you select an item... Item Events in Java  ...; items from the item group. Here, you will see the handling item event through Java AWT event hierarchy Java AWT event hierarchy What class is the top of the AWT event hierarchy? The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy Java AWT Package Example Java AWT Package Example  ... types of event are used in Java AWT. Events In this section, you... item events in java. This demonstrates that the event generated when you Event handling in Java AWT Event handling in Java AWT  ... events in java awt. Here, this is done through the java.awt.*; package of java... related to the event handling through this example and used methods through which you navigation between panels when item is selected from jcombobox - Swing AWT on JComboBox in Java visit to : between panels when item is selected from jcombobox hi...(2nd panel).the combo box is in main panel. when a item is selected from combobox Java AWT Java AWT What interface is extended by AWT event listeners awt - Swing AWT , For solving the problem visit to : Thanks... market chart this code made using "AWT" . in this chart one textbox when user Need an Example of calendar event in java Need an Example of calendar event in java can somebody give me an example of calendar event of java java awt package tutorial Java AWT Package In Java, Abstract Window Toolkit(AWT) is a platform... is used by each AWT component to display itself on the screen. For example... interaction when an AWT GUI is displayed. When any event is received by this new Event Handling In Java Event Handling In Java In this section you will learn about how to handle... that happens and your application behaves according to that event. For example.... In Java event handling may comprised the following four classes : Event Sources awt Java AWT Applet example how to display data using JDBC in awt/applet java-swings - Swing AWT :// Thanks. Amardeep...java-swings How to move JLabel using Mouse? Here the problem is i... frame = new JFrame("mouse motion event program Chart Item Event in Flex4 Chart Item Event in Flex4: Chart uses the ChartItemEvent when you perform the operation click on the chart Item. This event is the part of chart package...= "Data Not Found"; } // Chart Item Event public awt in java awt in java using awt in java gui programming how to false the maximization property of a frame Dispatcher Thread ; In the tutorial Java Event Dispatcher thread in Graphics, we'll illustrate you how to handle events in graphics using Java. This example... if the current is an AWT event dispatching thread. The method fireTableCellUpdated (row Java AWT Java AWT What is meant by controls and what are different types of controls in AWT java - question - Swing AWT Java question I want to create two JTable in a frame. The data.... This query is fixed. This query is "select * from item". Item table has following columns-Item_code,Item_name,Item_Price. When I click on one of the row in first Event Dispatcher Thread ; In the tutorial Java Event Dispatcher thread in Graphics, we'll illustrate you how to handle events in graphics using Java. This example... is an AWT event dispatching thread. The method fireTableCellUpdated (row Java - Swing AWT Java Hi friend,read for more information, AWT Tutorials AWT Tutorials How can i create multiple labels using AWT???? Java Applet Example multiple labels 1)AppletExample.java: import javax.swing.*; import java.applet.*; import java.awt.*; import how to use JTray in java give the answer with demonstration or example please Java AWT Package Example java swings - Swing AWT . swings I am doing a project for my company. I need a to show... write the code for bar charts using java swings. Hi friend, I am swings - Swing AWT :// What is Java Swing Technologies? Hi friend,import... TwoMenuItem{ public static void main(String[] args){ TwoMenuItem item = new TwoMenuItem query - Swing AWT java swing awt thread query Hi, I am just looking for a simple example of Java Swing Java event handling Java event handling What event results from the clicking of a button AWT java what will be the code for handling button event in swing? Hi Friend, Try the following code: import java.awt.*; import javax.swing.*; import java.awt.event.*; class ButtonEvent extends JFrame - Swing AWT : Thanks...java swing how to add image in JPanel in Swing? Hi Friend, Try the following code: import java.awt.*; import java.awt.image. Different types of event in Java AWT Different types of event in Java AWT  ... in Java AWT. These are as follows : ActionEvent AdjustmentEvent... that are generated by your AWT Application. These events are used to make the application more Java event delegation model Java event delegation model What is the highest-level event class of the event-delegation model Java event-listener Java event-listener What is the relationship between an event-listener interface and an event-adapter class java - Swing AWT java how can i add items to combobox at runtime from jdbc Hi Friend, Please visit the following link: Thanks Hi Friend Java Swing Key Event Java Swing Key Event In this tutorial, you will learn how to perform key event in java swing. Here is an example that change the case of characters... KeyAdapter to perform the keyReleased function over textfield. Example: import Java - Swing AWT ....("Paint example frame") ; getContentPane().add(new JPaintPanel JList - Swing AWT is the method for that? You kindly explain with an example. Expecting solution as early... == listModel.getSize()) { //removed item in last position...(); ename.setText(""); //Select the new item and make BASE PROJECT JAVA AWT BASE PROJECT suggest meaningful java AWT-base project java awt calender java awt calender java awt code for calender to include beside a textfield Linking JMenu Item with a JPane in Netbeans Linking JMenu Item with a JPane in Netbeans How do you link a Jpane window to a JMenu Item in Java Netbeans java - Swing AWT What is Java Swing AWT What is Java Swing AWT Java AWT Java AWT What is the relationship between the Canvas class and the Graphics class Event management Event management Hi, I want event management application like maintaining email notifications while task creation and update in broader way using spring java Create a Container in Java awt Create a Container in Java awt Introduction This program illustrates you how to create...; } } Download this example Java Ivent Handler - Swing AWT Java Ivent Handler Is it possible to make two listeners work simultaneously?I used a keyboard listener to detect key press and also a mouse listener... if any key is pressed or released it cannot detect the keyboard event Java AWT Java AWT How can the Checkbox class be used to create a radio button Java - Event Listeners Example in Java Applet Java - Event Listeners Example in Java Applet Introduction The event... on the several objects. In this example you will see that how to use the event SWINGS - Swing AWT more information,Examples and Tutorials on Swing,AWT visit to : How to save data - Swing AWT to : Thanks... the Dimensions of an Item in a JList Component"); JPanel panel = new JPanel...()); if (-1 < index) { String item = (String)getModel displaying image in awt - Java Beginners to display image using awt from here and when I execute the code I am getting... ActionListener{ JFrame fr = new JFrame ("Image loading program Using awt"); Label... void actionPerformed(ActionEvent event){ Button b = (Button)event.getSource Handling Key Press Event in Java Handling Key Press Event in Java  ... the handling key press event in java. Key Press is the event is generated when you press any key to the specific component. This event is performed by the KeyListener Problem to display checkbox item ;/div> 2) gettable.jsp: <%@page language="java" import Click event Click event hi............ how to put a click event on a particular image, so that it can allow to open another form or allow to display result in tabular form????????/ can u tell me how to do that????????/ using java swings Java JComboBox Get Selected Item Value Java JComboBox Get Selected Item Value In this section we will discuss about how to get the selected item value form JComboBox. javax.swing.JComboBox... example into which I shall get the combo box selected item value and stored jdbc awt jdbc programm in java to accept the details of doctor (dno,dname,salary)user & insert it into the database(use prerparedstatement class&awt Handling Mouse Clicks in Java the mouse click event in the awt application. This program simply implements the left click event of the mouse. When you click "Click Me" button... Handling Mouse Clicks in Java   JFrame Components Printing - Swing AWT ... but i go through the link that you have specified and downloaded the codes and compiled it got...(ActionEvent event) { PrintableDocument.printComponent(this); } class JFrame components printing - Swing AWT ... but i go through the link that you have specified and downloaded the codes and compiled it got...); } public void actionPerformed(ActionEvent event) { PrintableDocument.printComponent mouse event - Java Beginners =getContentPane(); setLayout(new FlowLayout()); setTitle("Mouse Event... Event"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(btnClose-awt - Swing AWT Java Swings-awt Hi, Thanks for posting the Answer... I need to design a tool Bar which looks like a Formating toolbar in MS-Office Winword(Standard & Formating) tool Bar. Please help me... Thanks in Advance Event Handling - Java Beginners Event Handling import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calculator extends JFrame { JLabel lblNumber=new JLabel("Number"); JLabel lblSquareRoot=new JLabel("Square Root... menu item in it. assume that the user pressing down key 3 times. I need to show The Window Event - Swing AWT void actionPerformed(ActionEvent event) { } public static void swing button click event java swing button click event java swing button click event public void doClick() Java Swing Tutorials code - Swing AWT code i want example problem for menubar in swings Hi Friend, Please visit the following links: Program for Calculator - Swing AWT Program for Calculator write a program for calculator? Hi Friend, Please visit the following link: Hope that it will be helpful Tree and a desktoppane - Swing AWT Tree and a desktoppane Hi , Iam kind of new to Java... on top, a tree (separate java class outside using JTree and the corresponding... frame on the desktop pane. I do not know how to fire the event in the tree swings - Swing AWT swings how to develope desktop applications using swing Hi Friend, Please visit the following link: Here you will get lot of swing applications Image Selection - Swing AWT click on any item, the image of that item should be selected as done in windows...(); } } ------------------------------------------------ Read for more informaton. Drag and Drop Example in SWT Drag and Drop Example in SWT Drag and Drop in Java - This section is going to illustrates you how to create a program to drag and drop the tree item in Java . In SWT remove item from list box using java script - Java Beginners remove item from list box using java script remove item from list box using java script Hi friend, Code to remove list box item using java script : Add or Remove Options in Javascript function addItem
http://www.roseindia.net/tutorialhelp/comment/96275
CC-MAIN-2014-10
en
refinedweb
Archived:How to add a submenu in PySymbian From Nokia Developer Wiki Article Metadata Tested with Devices(s): Nokia N96Compatibility Platform(s): S60 2nd Edition, S60 3rd EditionArticle Keywords: appuifw, menu Created: (15 Mar 2007) Last edited: fasttrack (25 Sep 2009) Overview Python can use submenu in menu options but it can be difficult to remember how to use them ! - Item 1 - Submenu - Item 2 - Item 3 Identation has been used for a better understanding. Don't mismatch the parentheses ! Item2 and item3 will be displayed on screen only when you click on submenu. Code #import module import appuifw # create menu appuifw.app.menu = [(u"item 1", item1_cb), (u"Submenu", ( (u"sub item 2", subitem2_cb), (u"sub item 3", subitem3_cb) ) ) ] # item1_cb, subitem2_cb, subitem3_cb are callback Postconditions Here is a screenshot to illustrate this submenu.
http://developer.nokia.com/community/wiki/index.php?title=How_to_add_a_submenu&oldid=63897
CC-MAIN-2014-10
en
refinedweb
#include <relaxation_block.h> Block Jacobi (additive Schwarz) method with possibly overlapping blocks. This class implements the step() and Tstep() functions expected by SolverRelaxation and MGSmootherRelaxation. They perform an additive Schwarz method on the blocks provided in the BlockList of AdditionalData. Differing from PreconditionBlockJacobi, these blocks may be of varying size, non-contiguous, and overlapping. On the other hand, this class does not implement the preconditioner interface expected by Solver objects. Definition at line 244 of file relaxation_block.h. Default constructor. Define number type of matrix. Definition at line 256 of file relaxation_block.h. Perform one step of the Jacobi iteration. Definition at line 224 of file relaxation_block.templates.h. Perform one step of the Jacobi iteration. Definition at line 238 of file relaxation_block.templates.h. Return the memory allocated in this object.
http://www.dealii.org/developer/doxygen/deal.II/classRelaxationBlockJacobi.html
CC-MAIN-2014-10
en
refinedweb
> I have been trying to do some CSV-style processing. My code works > fine for small input (up to 10MB), but performs poorly for moderate to > large input (it can't seem to finish 100MB of input with 700MB heap > space). I have gone through several optimization passes with profiler > help, and now I am hoping someone else can point out some other > approaches to improving the code's performance (both space and time). > > The code breaks a large file into smaller files all of whose entries > have the same date. First of all, for this problem and 100 MB input, you have to think carefully about what you do. I'll point out three quirks in your code and afterwards discuss how a better solution looks like. > module Main where > > import Debug.Trace > import Control.Monad > import Data.List > import qualified Data.ByteString.Lazy.Char8 as B > import qualified Data.Map as M > import System.Environment (getArgs) > > > myRead file = do > v <- B.readFile file > let (cols' : rows) = map (B.split ',') $ B.lines v > let cols = foldl' (\mp (k,v) -> M.insert k v mp) M.empty (zip cols' [0 ..]) > return (cols, rows) > > getColId cols col = M.lookup col cols > > getCol cols col row = do > i <- getColId cols col > return $! row!!i > > > dates file nRows = do > (cols, rows) <- myRead file > let addDate mp row | mp `seq` row `seq` False = undefined > | otherwise = do When using addDate in foldM like below, you certainly don't want to search the cols for the string "Date" again and again everytime addDate is called. The index of the "Date" field is a number determined when parsing the header. That and only that number has to be plugged in here. Thus the next line should read let date = row !! datefieldindex instead of > date <- getCol cols (B.pack "\"Date\"") row > let old = M.findWithDefault [] date mp > return $ M.insert date (row:old) mp The main thing in the code that makes me feel very very ill is the fact that the code is quite "impure" (many many dos). The next line promptly bites back: > res <- foldM addDate M.empty $ take nRows rows Did you notice this appeal to addDate makes its callee getCol live in the IO-Monad? From the use of M.lookup in getColId, I think you intended to have getCol :: _ -> Maybe _, do you? M.lookup recently got the more general type M.lookup :: Monad m => _ -> m a, so it happily lives in IO. I strongly suggest that you restructure your code and restrict IO to one place only: main = do .. input <- B.readFile file let outs = busywork input mapM_ [writeFile name contents | (name,contents) <- outs] where busywork does the work and is purely functional. > mapM_ writeDate $ M.toList res > where > fmt = B.unpack . B.map (\x -> if x == '-' then '_' else x) . > B.takeWhile (/= ' ') > writeDate (date,rows) = > B.writeFile (dataDir++fmt date) The following line does unnecessary work: myRead splits a row to get access to the date, but now you join it without having changed any field. It would be wiser to split for the date but to keep an intact copy of the line so that you can pass it here without join. This will reduce memory footprint. > (B.unlines $ map (B.join (B.pack ",")) rows) > > main = do > args <- getArgs > case args of > ["dates",file,nRows] -> dates file (read nRows) To summarize, the code is not very clean and several things slipped in, just as one would expect from an imperative style. The key is to separate concerns, which means here: IO will just do very dumb in and output, fetching the index of the "Date" from the header is handled separately, grouping the lines by date is to be separated from the to-be-output-contents of the lines. Now, we'll think about how to solve the task in reasonable time and space. Your current solutions reads the input and "calculates" all output files before writing them to disk in a final step. This means that the contents of the output files has to be kept in memory. Thus you need least a constant * 100MB of memory. I don't know how ByteString interacts with garbage collection, but it may well be that by keeping the first line (you "cols") in memory, the entire input file contents is also kept which means an additional constant * 100 MB. It is likely that both can be shared if one resolves the code quirks mentioned above.? Regards, apfelmus
http://www.haskell.org/pipermail/haskell-cafe/2006-October/018832.html
CC-MAIN-2014-10
en
refinedweb
A Kalzium double bill today, with Kalzium gaining recognition in OsnaBrück University's annual prize giving, and this week's People Behind KDE interview. Find out everything you wanted to know about chemistry, the small print on toothpaste, and why not to visit Bavaria in the People Behind KDE interview with Carsten Niehaus, author of Kalzium. Read on for details of the prize. KDE this week gained further recognition from the wider world. In an awards ceremony at Osnabrück University in Germany, Carsten Niehaus won the Intevation Prize for Achievements in Free Software for his work on Kalzium, KDE's interactive periodic table. The judges from Intevation praised the interactive features of Kalzium which help students by making facts easily discoverable. The prize was open to all past and present members of the University. Accepting a cheque for €750, Carsten said "It is an honour to be rewarded for my project Kalzium. I created it to have a good tool for my own use, but with a great community behind me I was able to develop something for others that I am proud of. A prize like this helps to keep up the motivation to improve Kalzium to be the tool of choice for teacher and student alike!" Kalzium, which takes its name from the German for the element calcium, supports many advanced features, including plotting data from all elements to show trends in the mass or atomic size for example. Its ease of use and range of features have won users in Osnabrück as well as further afield: Egon Willighagen, lead developer of BlueObelisk and CDK, says, "Kalzium brings the core chemistry in an easy-to-browse way to the desktop". Kalzium is part of the KDE Edutainment project, which provides educational software for all ages. "I am really pleased to see a KDE-Edu program getting another award. Kalzium's success is due to Carsten's constant efforts to improve his software and I am very proud to see him getting this award", Anne-Marie Mahfouf, a member of the KDE Edutainment team, said. Good article and congradulations on the award Carsten! I use Kalzium some for my chemistry class. The type-ahead feature sounds great... I'd use that just for convenience. :) Corrections: "What was you most brillant hack" should be "what was your most brilliant hack" And also there are two sections that the response is formatted in the same big blue font that the question is in. Not that it matters that much :) -Sam and "12 January 2006" should be "12 February 2006" :) the interview says that many programs @ his school still run windows. I just want to know what programs are this ? ist there still stuff missing ? btw. for electronic classes there ist ktechlab () ch All the big schoolbook vendors only produce software for Windows, sometimes for Mac. So each and every single school-book software is missing (there are many such programs, perhaps about 3 per schoolbook) The situation with 3d-viewers for proteins and other big molecules is now much butter than two years ago, but still those for windows are oftern better. D-GISS. D-GISS is a software almost every (at least german) school has but which doesn't work in linux as it is somehow based on MS-Access. It is not used for teaching but more a database. Still, I would really like to be able to run D-GISS. It doesn't even install in wine. There are many more, especially the situation with school-book software is a shame. And the vendors don't even answer email when you contact them about it. Btw: About the drawing tools: Egon Willighagen pointed me to "his" java based drawing tool. It doesn't crash and is the best I know for Linux, but still ACDLabs is much better. Sorry that I have to say that :( It looks nice and may in certain situations be usefull as a teaching tool, but in many ways ktechlab are a toy. Besides electronics are one of the areas where Linux support is good, several of the major vendors have Linux versions of their tools. In other areas the situation are not that good, increased addoption of Java has improved the situation some. And you can even find helpfull tools in the form of Java applets scattered around the net. Usually very specialized, but usefull to help explain/understand different concepts. Like this collection: Was wikipedia support ever added to kalzium? Or is it still planned/just a wish? We need the Webapi of MediaWiki first, so it is a KDE4-task. No, you dont need KDE4 - look how Amarok did it :-) Amarok is only parsing the html the wikipedia spits out, removes the wikipedia-stuff and displays the content. What if the Wikipedia changes the html? Amarok would need to be patched. Also, the integration is much more than just displaying an article. Wikipedia has special url to get the raw data for an article. I'd have to look it up, but it's something like ?raw ?action=raw for the raw wiki text e.g. This is however not really useful, because you get the unformatted wiki text. Why is that not really useful? I thought the pre-processed data is what was wanted to begin with? (That this needs to be processed first to embed images and links etc. is obvious, but this also offers added flexibility.) We want far more, for example an API for: "give me an article for the word "Enzyme". If that article is available in one of these languages return in one of these languages (in order of listing), if not return the english article [de,fr,it]" That is not possible now. Or "Give me articles related to the article "Enzyme"" I hope you can now see we need much more then "give me article 'x'". I tried compiling it... got some errors: (...........) make[3]: Entering directory `/root/Downloads/ktechlab-0.3/src' source='itemgroup.cpp' object='itemgroup.o' libtool=no \ depfile='.deps/itemgroup.Po' tmpdepfile='.deps/itemgroup.TPo' \ depmode=gcc3 /bin/sh ../admin/depcomp \ g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../src -I../src/drawparts -I../src/electronics -I../src/electronics/components -I../src/electronics/simulation -I../src/flowparts -I../src/gui -I../src/languages -I../src/mechanics -I../src/micro -I/opt/kde/include -I/usr/lib/q -c -o itemgroup.o `test -f 'itemgroup.cpp' || echo './'`itemgroup.cpp itemgroup.cpp: In member function `void ItemGroup::slotDistributeHorizontally() ': itemgroup.cpp:239: error: ISO C++ forbids declaration of `multimap' with no type itemgroup.cpp:239: error: template-id `multimap' used as a declarator itemgroup.cpp:239: error: parse error before `;' token itemgroup.cpp:241: error: `DIMap' undeclared (first use this function) itemgroup.cpp:241: error: (Each undeclared identifier is reported only once for each function it appears in.) itemgroup.cpp:244: error: `ranked' undeclared (first use this function) itemgroup.cpp:244: error: `make_pair' undeclared in namespace `std' itemgroup.cpp:249: error: ISO C++ forbids declaration of `DIMap' with no type itemgroup.cpp:249: error: uninitialized const `DIMap' itemgroup.cpp:249: error: parse error before `::' token itemgroup.cpp:250: error: parse error before `::' token itemgroup.cpp:250: error: name lookup of `it' changed for new ISO `for' scoping itemgroup.cpp:243: error: using obsolete binding at `it' itemgroup.cpp:250: error: `rankedEnd' undeclared (first use this function) itemgroup.cpp:252: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:263: error: parse error before `::' token itemgroup.cpp:265: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:265: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:265: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:268: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:249: warning: unused variable `const int DIMap' itemgroup.cpp: In member function `void ItemGroup::slotDistributeVertically()': itemgroup.cpp:285: error: ISO C++ forbids declaration of `multimap' with no type itemgroup.cpp:285: error: template-id `multimap' used as a declarator itemgroup.cpp:285: error: parse error before `;' token itemgroup.cpp:290: error: `make_pair' undeclared in namespace `std' itemgroup.cpp:295: error: ISO C++ forbids declaration of `DIMap' with no type itemgroup.cpp:295: error: uninitialized const `DIMap' itemgroup.cpp:295: error: parse error before `::' token itemgroup.cpp:296: error: parse error before `::' token itemgroup.cpp:296: error: name lookup of `it' changed for new ISO `for' scoping itemgroup.cpp:289: error: using obsolete binding at `it' itemgroup.cpp:298: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:309: error: parse error before `::' token itemgroup.cpp:311: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:311: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:311: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:314: error: base operand of `->' has non-pointer type ` QValueListIterator' itemgroup.cpp:295: warning: unused variable `const int DIMap' make[3]: *** [itemgroup.o] Error 1 make[3]: Leaving directory `/root/Downloads/ktechlab-0.3/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/root/Downloads/ktechlab-0.3/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/Downloads/ktechlab-0.3' make: *** [all] Error 2 bash-2.05b# Any ideas? I really want to use this for simulating circuits and things If you want a quick&dirty solution, try to remove the -ansi parameters in the generated Makefile files. Have a nice day! I removed all instances of -ansi from all the generated Makefiles, but the errors didn't go away. Upgraded to gcc-3.4 and the errors disapeared :-) 7 years of vim and still one keystroke too much... s/:wq/:x/ ;-) Yes, that is the only one thing I cannot remember in vim :) I will always use :wq, sorry ;-) :wq In the Interview there are some HTML Tags missting. Look at "Which text editor do you use? Why?" for example. The whole opart is written as a headline. Calle to Carsten and all other ppl that contributed to Kalzium and the other kde-edu developers! you guys are doing a great job, its very cool to show off your apps and i'm sure they are being used, and will be used even more :D And perhaps when KDE 4 arrives you can create a "Pro" version and earn some compensation? This company does a nice one for OS X. I know that table from the screenshots, looks pretty nice, yes. If somebody want to donate money: I have a bank-account and an amazon-wishlist (german amazon). It would be really nice to recieve a DVD or two of course :-) But Kalzium will always be free as in beer and as in freedom. Just a big "Thank you!" to Carsten and all the kdeedu developers for the amazing applications they are creating. My wife and I educate our children at home, and the KDE programs are proving extremely useful. Please keep up the good work! What does he mean there is no Linux program for scientific drawing of compounds? That's just silly, so what has all the chemical physicists used all those years when the rest of the scientific world has been writing in TeX/LaTeX? Probably something like XyMTeX, that's what. Jonas, of course you can draw them. I studied chemistry myself without touching non-free software. I used xfig, inkscape, latex, xdrawchem and so on. But those tools are absolutly not usable for a regular chemistry teacher. If you want Linux in School you need software for teachers and students alike. Furthermore, ACDLabs is *much* better than any !windows solution out there. It is easy to use, fast, high quality, supports all kinds of calculations, has a very good 3d-mode, names molecules for you and so on. *That* is what we need, not a ChemTex-solution where you need to read 10 howtos to draw Acetylesalicyleacid!
http://dot.kde.org/comment/89332
CC-MAIN-2014-10
en
refinedweb
bug at jsf 2.0 f:setPropertyActionListener f:setPropertyActionListener works after action, but must work before action. It seems like bug at mojarra It's simple test which I tried to undestand this problem. What message should appear when click on test button? I think there should be "heyMan", but if you'll try you see "heynull" at first click. And only after second click you'll see right message @ManagedBean(name="testBean") @SessionScoped public class TestBean implements Serializable{ private String name; private String message; public void test(ActionEvent e) { message = "hey" + name; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } xmlns: [b]actionListener[/b]s are called in the order in which they are specified on the page. Since your button's [b]actionListener[/b] precedes the [b]setPropertyActionListener[/b] on the page, it's called first. As a workaround, you could replace the [b]actionListener[/b] with [b]action[/b]. You should return null from the action method, so that you'll remain on the same page. I suppose you could also do something like this: [code] [/code] Thus, the [b]setPropertyActionListener[/b] precedes the [b]actionListener[/b]. However, I'm not at my PC at the moment and won't be there for several more hours, so I'm just writing this without having tested it first. I just think it should work. Could you show your code? I tried a commandButton with an action and sPAL, and it worked properly, but I may be doing something completely different than you. You may also wish to read this:...
https://www.java.net/node/701686
CC-MAIN-2014-10
en
refinedweb