Search Results

Search found 52962 results on 2119 pages for 'text message'.

Page 2/2119 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • PHP text formating: Detecting several symbols in a row

    - by ilnur777
    I have a kind of strange thing that I really nead for my text formating. Don't ask me please why I did this strange thing! ;-) So, my PHP script replaces all line foldings "\n" with one of the speacial symbol like "|". When I insert text data to database, the PHP script replaces all line foldings with the symbol "|" and when the script reads text data from the database, it replaces all special symbols "|" with line folding "\n". I want to restrict text format in the way that it will cut line foldings if there are more than 2 line foldings used in each separating texts. Here is the example of the text I want the script to format: this is text... this is text... this is text...this is text...this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... I want to restict format like: this is text... this is text... this is text...this is text...this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... So, at the first example there is only one line folding between 2 texts and on the second example there are 3 line foldings between 2 texts. How it can be possible to replace more than 2 line foldings symbols "|" if they are detected on the text? This is a kind of example I want the script to do: $text = str_replace("|||", "||", $text); $text = str_replace("||||", "||", $text); $text = str_replace("|||||", "||", $text); $text = str_replace("||||||", "||", $text); $text = str_replace("|||||||", "||", $text); ... $text = str_replace("||||||||||", "||", $text); $text = str_replace("|", "<br>", $text); HM, I HAVE PROBLEMS! THIS DOES NOT WORK WHEN TEXT DATA IS SENT IN POST METHOD. LOOK AT THIS: //REPLACING ALL LINE FOLDINGS WITH SPECIAL SYMBOL $_POST["text"] = str_replace("\n","|",$_POST["text"]); // REMOVING ALL LINE FOLDINGS $_POST["text"] = trim($_POST["text"]); // IF THERE ARE MORE THAN 3 LINE HOLDINGS - FORMAT TO 1 LINE HOLDING $_POST["text"] = preg_replace("/\|{3,}/", "||", $_POST["text"]); echo $_POST["text"];

    Read the article

  • Text Expansion Awareness for UX Designers: Points to Consider

    - by ultan o'broin
    Awareness of translated text expansion dynamics is important for enterprise applications UX designers (I am assuming all source text for translation is in English, though apps development can takes place in other natural languages too). This consideration goes beyond the standard 'character multiplication' rule and must take into account the avoidance of other layout tricks that a designer might be tempted to try. Follow these guidelines. For general text expansion, remember the simple rule that the shorter the word is in the English, the longer it will need to be in English. See the examples provided by Richard Ishida of the W3C and you'll get the idea. So, forget the 30 percent or one inch minimum expansion rule of the old Forms days. Unfortunately remembering convoluted text expansion rules, based as a percentage of the US English character count can be tough going. Try these: Up to 10 characters: 100 to 200% 11 to 20 characters: 80 to 100% 21 to 30 characters: 60 to 80% 31 to 50 characters: 40 to 60% 51 to 70 characters: 31 to 40% Over 70 characters: 30% (Source: IBM) So it might be easier to remember a rule that if your English text is less than 20 characters then allow it to double in length (200 percent), and then after that assume an increase by half the length of the text (50%). (Bear in mind that ADF can apply truncation rules on some components in English too). (If your text is stored in a database, developers must make sure the table column widths can accommodate the expansion of your text when translated based on byte size for the translated character and not numbers of characters. Use Unicode. One character does not equal one byte in the multilingual enterprise apps world.) Rely on a graceful transformation of translated text. Let all pages to resize dynamically so the text wraps and flow naturally. ADF pages supports this already. Think websites. Don't hard-code alignments. Use Start and End properties on components and not Left or Right. Don't force alignments of components on the page by using texts of a certain length as spacers. Use proper label positioning and anchoring in ADF components or other technologies. Remember that an increase in text length means an increase in vertical space too when pages are resized. So don't hard-code vertical heights for any text areas. Don't be tempted to manually create text or printed reports this way either. They cannot be translated successfully, and are very difficult to maintain in English. Use XML, HTML, RTF and so on. Check out what Oracle BI Publisher offers. Don't force wrapping by using tricks such as /n or /t characters or HTML BR tags or forced page breaks. Once the text is translated the alignment will be destroyed. The position of the breaking character or tag would need to be moved anyway, or even removed. When creating tables, then use table components. Don't use manually created tables that reply on word length to maintain column and row alignment. For example, don't use codeblock elements in HTML; use the proper table elements instead. Once translated, the alignment of manually formatted tabular data is destroyed. Finally, if there is a space restriction, then don't use made-up acronyms, abbreviations or some form of daft text speak to save space. Besides being incomprehensible in English, they may need full translations of the shortened words, even if they can be figured out. Use approved or industry standard acronyms according to the UX style rules, not as a space-saving device. Restricted Real Estate on Mobile Devices On mobile devices real estate is limited. Using shortened text is fine once it is comprehensible. Users in the mobile space prefer brevity too, as they are on the go, performing three-minute tasks, with no time to read lengthy texts. Using fragments and lightning up on unnecessary articles and getting straight to the point with imperative forms of verbs makes sense both on real estate and user experience grounds.

    Read the article

  • Hidden text and links appearing just on click for SEO?

    - by CamSpy
    I am working on a site that has neat clean/minimalistic design/layout. Menu items are "hidden" behind an icon, to see them, users need to click on that icon to get a javascript toggled overlay with the list of menu items. Then there are blocks with photos and users need to click on a small icon/button on each of them to get a block of text shown for each of the photo. While I don't like such "design" myself, making me click lots of time just to read, I also think that for SEO purpose this model is really wrong. Is such model bad for SEO? Are there ways to keep design like this but have "safe" methods of displaying text content on click that will not hurt SEO?

    Read the article

  • Java Swt Text (SWT.MULTI) append text without scroll

    - by mchr
    I have a Java SWT GUI with a multiline Text control. I want to append lines of text to the Text control without affecting the position of the cursor within the text box. In particular, the user should be able to scroll and select text at the top of the Text control while new text lines are appended to the bottom. Is this possible?

    Read the article

  • Message Queue: Which one is the best scenario?

    - by pandaforme
    I write a web crawler. The crawler has 2 steps: get a html page then parse the page I want to use message queue to improve performance and throughput. I think 2 scenarios: scenario 1: structure: urlProducer -> queue1 -> urlConsumer -> queue2 -> parserConsumer urlProducer: get a target url and add it to queue1 urlConsumer: according to the job info, get the html page and add it to queue2 parserConsumer: according to the job info, parse the page scenario 2: structure: urlProducer -> queue1 -> urlConsumer parserProducer-> queue2 -> parserConsumer urlProducer : get a target url and add it to queue1 urlConsumer: according to the job info, get the html page and write it to db parserProducer: get the html page from db and add it to queue2 parserConsumer: according to the job info, parse the page There are multiple producers or consumers in each structure. scenario1 likes a chaining call. It's difficult to find the point of problem, when occurring errors. scenario2 decouples queue1 and queue2. It's easy to find the point of problem, when occurring errors. I'm not sure the notion is correct. Which one is the best scenario? Or other scenarios? Thanks~

    Read the article

  • Installing sublime text plugins all at once

    - by James
    Is there a way to install all the sublime text 2 plugins that you would like to install all at once. In Notepad++, there is a plugin manager which lets you install all the plugins you want to install by checking the box next to the plugin name & description. I was wandering if there is something like that for sublime text. For eg, I would like to install Zen Coding, JQuery Package for Sublime Text, Sublime Prefixr, JS Format, SublimeLinter and many other plugins all at once rather than typing each plugin in the Package Control and installing it one by one.

    Read the article

  • Open and scroll through 42 GB text file in Mac OS X

    - by Django Johnson
    I am running Mac OS X 10.8.4 (Mountain Lion) and I am trying to open and scroll through a 42 GB .XML file. I plan on using an XML parser to parse through it and delete parts, but first I need to know how the document is structured so I can know what parts to save. How can I open this text / XML file and scroll through it so I can get a glimpse of its structure? I tried my default text-editor, text-mate, and that couldn't open it. I tried gEdit and that shows the first 10 or so lines, but then quits after trying to load the rest. I would greatly appreciate any and all suggestions!

    Read the article

  • Windows Azure Service Bus Splitter and Aggregator

    - by Alan Smith
    This article will cover basic implementations of the Splitter and Aggregator patterns using the Windows Azure Service Bus. The content will be included in the next release of the “Windows Azure Service Bus Developer Guide”, along with some other patterns I am working on. I’ve taken the pattern descriptions from the book “Enterprise Integration Patterns” by Gregor Hohpe. I bought a copy of the book in 2004, and recently dusted it off when I started to look at implementing the patterns on the Windows Azure Service Bus. Gregor has also presented an session in 2011 “Enterprise Integration Patterns: Past, Present and Future” which is well worth a look. I’ll be covering more patterns in the coming weeks, I’m currently working on Wire-Tap and Scatter-Gather. There will no doubt be a section on implementing these patterns in my “SOA, Connectivity and Integration using the Windows Azure Service Bus” course. There are a number of scenarios where a message needs to be divided into a number of sub messages, and also where a number of sub messages need to be combined to form one message. The splitter and aggregator patterns provide a definition of how this can be achieved. This section will focus on the implementation of basic splitter and aggregator patens using the Windows Azure Service Bus direct programming model. In BizTalk Server receive pipelines are typically used to implement the splitter patterns, with sequential convoy orchestrations often used to aggregate messages. In the current release of the Service Bus, there is no functionality in the direct programming model that implements these patterns, so it is up to the developer to implement them in the applications that send and receive messages. Splitter A message splitter takes a message and spits the message into a number of sub messages. As there are different scenarios for how a message can be split into sub messages, message splitters are implemented using different algorithms. The Enterprise Integration Patterns book describes the splatter pattern as follows: How can we process a message if it contains multiple elements, each of which may have to be processed in a different way? Use a Splitter to break out the composite message into a series of individual messages, each containing data related to one item. The Enterprise Integration Patterns website provides a description of the Splitter pattern here. In some scenarios a batch message could be split into the sub messages that are contained in the batch. The splitting of a message could be based on the message type of sub-message, or the trading partner that the sub message is to be sent to. Aggregator An aggregator takes a stream or related messages and combines them together to form one message. The Enterprise Integration Patterns book describes the aggregator pattern as follows: How do we combine the results of individual, but related messages so that they can be processed as a whole? Use a stateful filter, an Aggregator, to collect and store individual messages until a complete set of related messages has been received. Then, the Aggregator publishes a single message distilled from the individual messages. The Enterprise Integration Patterns website provides a description of the Aggregator pattern here. A common example of the need for an aggregator is in scenarios where a stream of messages needs to be combined into a daily batch to be sent to a legacy line-of-business application. The BizTalk Server EDI functionality provides support for batching messages in this way using a sequential convoy orchestration. Scenario The scenario for this implementation of the splitter and aggregator patterns is the sending and receiving of large messages using a Service Bus queue. In the current release, the Windows Azure Service Bus currently supports a maximum message size of 256 KB, with a maximum header size of 64 KB. This leaves a safe maximum body size of 192 KB. The BrokeredMessage class will support messages larger than 256 KB; in fact the Size property is of type long, implying that very large messages may be supported at some point in the future. The 256 KB size restriction is set in the service bus components that are deployed in the Windows Azure data centers. One of the ways of working around this size restriction is to split large messages into a sequence of smaller sub messages in the sending application, send them via a queue, and then reassemble them in the receiving application. This scenario will be used to demonstrate the pattern implementations. Implementation The splitter and aggregator will be used to provide functionality to send and receive large messages over the Windows Azure Service Bus. In order to make the implementations generic and reusable they will be implemented as a class library. The splitter will be implemented in the LargeMessageSender class and the aggregator in the LargeMessageReceiver class. A class diagram showing the two classes is shown below. Implementing the Splitter The splitter will take a large brokered message, and split the messages into a sequence of smaller sub-messages that can be transmitted over the service bus messaging entities. The LargeMessageSender class provides a Send method that takes a large brokered message as a parameter. The implementation of the class is shown below; console output has been added to provide details of the splitting operation. public class LargeMessageSender {     private static int SubMessageBodySize = 192 * 1024;     private QueueClient m_QueueClient;       public LargeMessageSender(QueueClient queueClient)     {         m_QueueClient = queueClient;     }       public void Send(BrokeredMessage message)     {         // Calculate the number of sub messages required.         long messageBodySize = message.Size;         int nrSubMessages = (int)(messageBodySize / SubMessageBodySize);         if (messageBodySize % SubMessageBodySize != 0)         {             nrSubMessages++;         }           // Create a unique session Id.         string sessionId = Guid.NewGuid().ToString();         Console.WriteLine("Message session Id: " + sessionId);         Console.Write("Sending {0} sub-messages", nrSubMessages);           Stream bodyStream = message.GetBody<Stream>();         for (int streamOffest = 0; streamOffest < messageBodySize;             streamOffest += SubMessageBodySize)         {                                     // Get the stream chunk from the large message             long arraySize = (messageBodySize - streamOffest) > SubMessageBodySize                 ? SubMessageBodySize : messageBodySize - streamOffest;             byte[] subMessageBytes = new byte[arraySize];             int result = bodyStream.Read(subMessageBytes, 0, (int)arraySize);             MemoryStream subMessageStream = new MemoryStream(subMessageBytes);               // Create a new message             BrokeredMessage subMessage = new BrokeredMessage(subMessageStream, true);             subMessage.SessionId = sessionId;               // Send the message             m_QueueClient.Send(subMessage);             Console.Write(".");         }         Console.WriteLine("Done!");     }} The LargeMessageSender class is initialized with a QueueClient that is created by the sending application. When the large message is sent, the number of sub messages is calculated based on the size of the body of the large message. A unique session Id is created to allow the sub messages to be sent as a message session, this session Id will be used for correlation in the aggregator. A for loop in then used to create the sequence of sub messages by creating chunks of data from the stream of the large message. The sub messages are then sent to the queue using the QueueClient. As sessions are used to correlate the messages, the queue used for message exchange must be created with the RequiresSession property set to true. Implementing the Aggregator The aggregator will receive the sub messages in the message session that was created by the splitter, and combine them to form a single, large message. The aggregator is implemented in the LargeMessageReceiver class, with a Receive method that returns a BrokeredMessage. The implementation of the class is shown below; console output has been added to provide details of the splitting operation.   public class LargeMessageReceiver {     private QueueClient m_QueueClient;       public LargeMessageReceiver(QueueClient queueClient)     {         m_QueueClient = queueClient;     }       public BrokeredMessage Receive()     {         // Create a memory stream to store the large message body.         MemoryStream largeMessageStream = new MemoryStream();           // Accept a message session from the queue.         MessageSession session = m_QueueClient.AcceptMessageSession();         Console.WriteLine("Message session Id: " + session.SessionId);         Console.Write("Receiving sub messages");           while (true)         {             // Receive a sub message             BrokeredMessage subMessage = session.Receive(TimeSpan.FromSeconds(5));               if (subMessage != null)             {                 // Copy the sub message body to the large message stream.                 Stream subMessageStream = subMessage.GetBody<Stream>();                 subMessageStream.CopyTo(largeMessageStream);                   // Mark the message as complete.                 subMessage.Complete();                 Console.Write(".");             }             else             {                 // The last message in the sequence is our completeness criteria.                 Console.WriteLine("Done!");                 break;             }         }                     // Create an aggregated message from the large message stream.         BrokeredMessage largeMessage = new BrokeredMessage(largeMessageStream, true);         return largeMessage;     } }   The LargeMessageReceiver initialized using a QueueClient that is created by the receiving application. The receive method creates a memory stream that will be used to aggregate the large message body. The AcceptMessageSession method on the QueueClient is then called, which will wait for the first message in a message session to become available on the queue. As the AcceptMessageSession can throw a timeout exception if no message is available on the queue after 60 seconds, a real-world implementation should handle this accordingly. Once the message session as accepted, the sub messages in the session are received, and their message body streams copied to the memory stream. Once all the messages have been received, the memory stream is used to create a large message, that is then returned to the receiving application. Testing the Implementation The splitter and aggregator are tested by creating a message sender and message receiver application. The payload for the large message will be one of the webcast video files from http://www.cloudcasts.net/, the file size is 9,697 KB, well over the 256 KB threshold imposed by the Service Bus. As the splitter and aggregator are implemented in a separate class library, the code used in the sender and receiver console is fairly basic. The implementation of the main method of the sending application is shown below.   static void Main(string[] args) {     // Create a token provider with the relevant credentials.     TokenProvider credentials =         TokenProvider.CreateSharedSecretTokenProvider         (AccountDetails.Name, AccountDetails.Key);       // Create a URI for the serivce bus.     Uri serviceBusUri = ServiceBusEnvironment.CreateServiceUri         ("sb", AccountDetails.Namespace, string.Empty);       // Create the MessagingFactory     MessagingFactory factory = MessagingFactory.Create(serviceBusUri, credentials);       // Use the MessagingFactory to create a queue client     QueueClient queueClient = factory.CreateQueueClient(AccountDetails.QueueName);       // Open the input file.     FileStream fileStream = new FileStream(AccountDetails.TestFile, FileMode.Open);       // Create a BrokeredMessage for the file.     BrokeredMessage largeMessage = new BrokeredMessage(fileStream, true);       Console.WriteLine("Sending: " + AccountDetails.TestFile);     Console.WriteLine("Message body size: " + largeMessage.Size);     Console.WriteLine();         // Send the message with a LargeMessageSender     LargeMessageSender sender = new LargeMessageSender(queueClient);     sender.Send(largeMessage);       // Close the messaging facory.     factory.Close();  } The implementation of the main method of the receiving application is shown below. static void Main(string[] args) {       // Create a token provider with the relevant credentials.     TokenProvider credentials =         TokenProvider.CreateSharedSecretTokenProvider         (AccountDetails.Name, AccountDetails.Key);       // Create a URI for the serivce bus.     Uri serviceBusUri = ServiceBusEnvironment.CreateServiceUri         ("sb", AccountDetails.Namespace, string.Empty);       // Create the MessagingFactory     MessagingFactory factory = MessagingFactory.Create(serviceBusUri, credentials);       // Use the MessagingFactory to create a queue client     QueueClient queueClient = factory.CreateQueueClient(AccountDetails.QueueName);       // Create a LargeMessageReceiver and receive the message.     LargeMessageReceiver receiver = new LargeMessageReceiver(queueClient);     BrokeredMessage largeMessage = receiver.Receive();       Console.WriteLine("Received message");     Console.WriteLine("Message body size: " + largeMessage.Size);       string testFile = AccountDetails.TestFile.Replace(@"\In\", @"\Out\");     Console.WriteLine("Saving file: " + testFile);       // Save the message body as a file.     Stream largeMessageStream = largeMessage.GetBody<Stream>();     largeMessageStream.Seek(0, SeekOrigin.Begin);     FileStream fileOut = new FileStream(testFile, FileMode.Create);     largeMessageStream.CopyTo(fileOut);     fileOut.Close();       Console.WriteLine("Done!"); } In order to test the application, the sending application is executed, which will use the LargeMessageSender class to split the message and place it on the queue. The output of the sender console is shown below. The console shows that the body size of the large message was 9,929,365 bytes, and the message was sent as a sequence of 51 sub messages. When the receiving application is executed the results are shown below. The console application shows that the aggregator has received the 51 messages from the message sequence that was creating in the sending application. The messages have been aggregated to form a massage with a body of 9,929,365 bytes, which is the same as the original large message. The message body is then saved as a file. Improvements to the Implementation The splitter and aggregator patterns in this implementation were created in order to show the usage of the patterns in a demo, which they do quite well. When implementing these patterns in a real-world scenario there are a number of improvements that could be made to the design. Copying Message Header Properties When sending a large message using these classes, it would be great if the message header properties in the message that was received were copied from the message that was sent. The sending application may well add information to the message context that will be required in the receiving application. When the sub messages are created in the splitter, the header properties in the first message could be set to the values in the original large message. The aggregator could then used the values from this first sub message to set the properties in the message header of the large message during the aggregation process. Using Asynchronous Methods The current implementation uses the synchronous send and receive methods of the QueueClient class. It would be much more performant to use the asynchronous methods, however doing so may well affect the sequence in which the sub messages are enqueued, which would require the implementation of a resequencer in the aggregator to restore the correct message sequence. Handling Exceptions In order to keep the code readable no exception handling was added to the implementations. In a real-world scenario exceptions should be handled accordingly.

    Read the article

  • What is the best way to implement paginated text editing in Python?

    - by W.F
    I'm trying to build a formatted text editor in python. I need the editor to be paginated on edit mode. Same as in all popular word processors - when the user is editing the document what he/she sees is a representation of the actual, physical, page. I've tried looking into PySide but I can't find any ready solution to this, nor I can work out a way to do it myself. I am totally open to new technologies, so if you think Python is not the right choice here I would love to hear about new stuff (especially when I'm this new to UI coding). It only needs to be cross-platform and let me do rapid development (hence me looking for an out-of-the-box solution to this). Please suggest the best way to implement this. Please also note that I am looking for either a ready solution or an advice on how to tackle this. Thank you very much !

    Read the article

  • Software to store frequently used text in PC

    - by user15660
    Hi, I am a looking for a free software that can run on the task bar (near the system time) where I can store frequently used text like my full street address, paths of specific deep folders & files in the computer etc etc. This way I can just click the icon which should popup a screen where I should be able to copy the text/string I am looking for Any ideas? thanks in advance

    Read the article

  • How to make a text search template?

    - by Flipper
    I am not really sure what to call this, but I am looking for a way to have a "template" for my code to go by when searching for text. I am working on a project where a summary for a piece of text is supplied to the user. I want to allow the user to select a piece of text on the page so that the next time they come across a similar page I can find the text. For instance, lets say somebody goes to foxnews.com and selects the article like in the image below. Then whenever they go to any other foxnews.com article I would be able to identify the text for the article and summarize it for them. But an issue I see with this is for a site like Stack Exchange where you have multiple comments to be selected (like below) which means that I would have to be able to recursively search for all separate pieces of text. Requirements Be able to keep pieces of text separate from each other. Possible Issues DIV's may not contain ids, classes, or names. A piece of text may span across multiple DIVs How to recognize where an old piece of text ends and a new begins. How to store this information for later searching?

    Read the article

  • MessageListener didnt receive full message ASMACK Android

    - by Frank Junior
    i got problem when want to receive message, right now i am able to receive message, but some attribut is missing class MyMessageListener implements MessageListener { @Override public void processMessage(Chat chat, Message message) { Util.DebugLog("message->"+message.toXmlns()); } } what i got is <message to="[email protected]" type="chat" from="[email protected]/ff3b2485"><body asdf="asdf">aaa</body></message> talk_id and chat type inside message is missing. This is want i want when receive message <message to="[email protected]" type="chat" talk_id="304" chat_type="0" from="[email protected]/ff3b2485"><body asdf="asdf">aaa</body></message>

    Read the article

  • Organising levels / rooms in a MUD-style text based world

    - by Polynomial
    I'm thinking of writing a small text-based adventure game, but I'm not particularly sure how I should design the world from a technical standpoint. My first thought is to do it in XML, designed something like the following. Apologies for the huge pile of XML, but I felt it important to fully explain what I'm doing. <level> <start> <!-- start in kitchen with empty inventory --> <room>Kitchen</room> <inventory></inventory> </start> <rooms> <room> <name>Kitchen</name> <description>A small kitchen that looks like it hasn't been used in a while. It has a table in the middle, and there are some cupboards. There is a door to the north, which leads to the garden.</description> <!-- IDs of the objects the room contains --> <objects> <object>Cupboards</object> <object>Knife</object> <object>Batteries</object> </objects> </room> <room> <name>Garden</name> <description>The garden is wild and full of prickly bushes. To the north there is a path, which leads into the trees. To the south there is a house.</description> <objects> </objects> </room> <room> <name>Woods</name> <description>The woods are quite dark, with little light bleeding in from the garden. It is eerily quiet.</description> <objects> <object>Trees01</object> </objects> </room> </rooms> <doors> <!-- a door isn't necessarily a door. each door has a type, i.e. "There is a <type> leading to..." from and to are references the rooms that this door joins. direction specifies the direction (N,S,E,W,Up,Down) from <from> to <to> --> <door> <type>door</type> <direction>N</direction> <from>Kitchen</from> <to>Garden</to> </door> <door> <type>path</type> <direction>N</direction> <from>Garden</type> <to>Woods</type> </door> </doors> <variables> <!-- variables set by actions --> <variable name="cupboard_open">0</variable> </variables> <objects> <!-- definitions for objects --> <object> <name>Trees01</name> <displayName>Trees</displayName> <actions> <!-- any actions not defined will show the default failure message --> <action> <command>EXAMINE</command> <message>The trees are tall and thick. There aren't any low branches, so it'd be difficult to climb them.</message> </action> </actions> </object> <object> <name>Cupboards</name> <displayName>Cupboards</displayName> <actions> <action> <!-- requirements make the command only work when they are met --> <requirements> <!-- equivilent of "if(cupboard_open == 1)" --> <require operation="equal" value="1">cupboard_open</require> </requirements> <command>EXAMINE</command> <!-- fail message is the message displayed when the requirements aren't met --> <failMessage>The cupboard is closed.</failMessage> <message>The cupboard contains some batteires.</message> </action> <action> <requirements> <require operation="equal" value="0">cupboard_open</require> </requirements> <command>OPEN</command> <failMessage>The cupboard is already open.</failMessage> <message>You open the cupboard. It contains some batteries.</message> <!-- assigns is a list of operations performed on variables when the action succeeds --> <assigns> <assign operation="set" value="1">cupboard_open</assign> </assigns> </action> <action> <requirements> <require operation="equal" value="1">cupboard_open</require> </requirements> <command>CLOSE</command> <failMessage>The cupboard is already closed.</failMessage> <message>You closed the cupboard./message> <assigns> <assign operation="set" value="0">cupboard_open</assign> </assigns> </action> </actions> </object> <object> <name>Batteries</name> <displayName>Batteries</displayName> <!-- by setting inventory to non-zero, we can put it in our bag --> <inventory>1</inventory> <actions> <action> <requirements> <require operation="equal" value="1">cupboard_open</require> </requirements> <command>GET</command> <!-- failMessage isn't required here, it'll just show the usual "You can't see any <blank>." message --> <message>You picked up the batteries.</message> </action> </actions> </object> </objects> </level> Obviously there'd need to be more to it than this. Interaction with people and enemies as well as death and completion are necessary additions. Since the XML is quite difficult to work with, I'd probably create some sort of world editor. I'd like to know if this method has any downfalls, and if there's a "better" or more standard way of doing it.

    Read the article

  • SQL SERVER – Parsing SSIS Catalog Messages – Notes from the Field #030

    - by Pinal Dave
    [Note from Pinal]: This is a new episode of Notes from the Field series. SQL Server Integration Service (SSIS) is one of the most key essential part of the entire Business Intelligence (BI) story. It is a platform for data integration and workflow applications. The tool may also be used to automate maintenance of SQL Server databases and updates to multidimensional cube data. In this episode of the Notes from the Field series I requested SSIS Expert Andy Leonard to discuss one of the most interesting concepts of SSIS Catalog Messages. There are plenty of interesting and useful information captured in the SSIS catalog and we will learn together how to explore the same. The SSIS Catalog captures a lot of cool information by default. Here’s a query I use to parse messages from the catalog.operation_messages table in the SSISDB database, where the logged messages are stored. This query is set up to parse a default message transmitted by the Lookup Transformation. It’s one of my favorite messages in the SSIS log because it gives me excellent information when I’m tuning SSIS data flows. The message reads similar to: Data Flow Task:Information: The Lookup processed 4485 rows in the cache. The processing time was 0.015 seconds. The cache used 1376895 bytes of memory. The query: USE SSISDB GO DECLARE @MessageSourceType INT = 60 DECLARE @StartOfIDString VARCHAR(100) = 'The Lookup processed ' DECLARE @ProcessingTimeString VARCHAR(100) = 'The processing time was ' DECLARE @CacheUsedString VARCHAR(100) = 'The cache used ' DECLARE @StartOfIDSearchString VARCHAR(100) = '%' + @StartOfIDString + '%' DECLARE @ProcessingTimeSearchString VARCHAR(100) = '%' + @ProcessingTimeString + '%' DECLARE @CacheUsedSearchString VARCHAR(100) = '%' + @CacheUsedString + '%' SELECT operation_id , SUBSTRING(MESSAGE, (PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1)) - (PATINDEX(@StartOfIDSearchString, MESSAGE) + LEN(@StartOfIDString) + 1))) AS LookupRowsCount , SUBSTRING(MESSAGE, (PATINDEX(@ProcessingTimeSearchString,MESSAGE) + LEN(@ProcessingTimeString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@ProcessingTimeSearchString,MESSAGE) + LEN(@ProcessingTimeString) + 1)) - (PATINDEX(@ProcessingTimeSearchString, MESSAGE) + LEN(@ProcessingTimeString) + 1))) AS LookupProcessingTime , CASE WHEN (CONVERT(numeric(3,3),SUBSTRING(MESSAGE, (PATINDEX(@ProcessingTimeSearchString,MESSAGE) + LEN(@ProcessingTimeString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@ProcessingTimeSearchString,MESSAGE) + LEN(@ProcessingTimeString) + 1)) - (PATINDEX(@ProcessingTimeSearchString, MESSAGE) + LEN(@ProcessingTimeString) + 1))))) = 0 THEN 0 ELSE CONVERT(bigint,SUBSTRING(MESSAGE, (PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1)) - (PATINDEX(@StartOfIDSearchString, MESSAGE) + LEN(@StartOfIDString) + 1)))) / CONVERT(numeric(3,3),SUBSTRING(MESSAGE, (PATINDEX(@ProcessingTimeSearchString,MESSAGE) + LEN(@ProcessingTimeString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@ProcessingTimeSearchString,MESSAGE) + LEN(@ProcessingTimeString) + 1)) - (PATINDEX(@ProcessingTimeSearchString, MESSAGE) + LEN(@ProcessingTimeString) + 1)))) END AS LookupRowsPerSecond , SUBSTRING(MESSAGE, (PATINDEX(@CacheUsedSearchString,MESSAGE) + LEN(@CacheUsedString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@CacheUsedSearchString,MESSAGE) + LEN(@CacheUsedString) + 1)) - (PATINDEX(@CacheUsedSearchString, MESSAGE) + LEN(@CacheUsedString) + 1))) AS LookupBytesUsed ,CASE WHEN (CONVERT(bigint,SUBSTRING(MESSAGE, (PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1)) - (PATINDEX(@StartOfIDSearchString, MESSAGE) + LEN(@StartOfIDString) + 1)))))= 0 THEN 0 ELSE CONVERT(bigint,SUBSTRING(MESSAGE, (PATINDEX(@CacheUsedSearchString,MESSAGE) + LEN(@CacheUsedString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@CacheUsedSearchString,MESSAGE) + LEN(@CacheUsedString) + 1)) - (PATINDEX(@CacheUsedSearchString, MESSAGE) + LEN(@CacheUsedString) + 1)))) / CONVERT(bigint,SUBSTRING(MESSAGE, (PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1), ((CHARINDEX(' ', MESSAGE, PATINDEX(@StartOfIDSearchString,MESSAGE) + LEN(@StartOfIDString) + 1)) - (PATINDEX(@StartOfIDSearchString, MESSAGE) + LEN(@StartOfIDString) + 1)))) END AS LookupBytesPerRow FROM [catalog].[operation_messages] WHERE message_source_type = @MessageSourceType AND MESSAGE LIKE @StartOfIDSearchString GO Note that you have to set some parameter values: @MessageSourceType [int] – represents the message source type value from the following results: Value     Description 10           Entry APIs, such as T-SQL and CLR Stored procedures 20           External process used to run package (ISServerExec.exe) 30           Package-level objects 40           Control Flow tasks 50           Control Flow containers 60           Data Flow task 70           Custom execution message Note: Taken from Reza Rad’s (excellent!) helper.MessageSourceType table found here. @StartOfIDString [VarChar(100)] – use this to uniquely identify the message field value you wish to parse. In this case, the string ‘The Lookup processed ‘ identifies all the Lookup Transformation messages I desire to parse. @ProcessingTimeString [VarChar(100)] – this parameter is message-specific. I use this parameter to specifically search the message field value for the beginning of the Lookup Processing Time value. For this execution, I use the string ‘The processing time was ‘. @CacheUsedString [VarChar(100)] – this parameter is also message-specific. I use this parameter to specifically search the message field value for the beginning of the Lookup Cache  Used value. It returns the memory used, in bytes. For this execution, I use the string ‘The cache used ‘. The other parameters are built from variations of the parameters listed above. The query parses the values into text. The string values are converted to numeric values for ratio calculations; LookupRowsPerSecond and LookupBytesPerRow. Since ratios involve division, CASE statements check for denominators that equal 0. Here are the results in an SSMS grid: This is not the only way to retrieve this information. And much of the code lends itself to conversion to functions. If there is interest, I will share the functions in an upcoming post. If you want to get started with SSIS with the help of experts, read more over at Fix Your SQL Server. Reference: Pinal Dave (http://blog.sqlauthority.com)Filed under: Notes from the Field, PostADay, SQL, SQL Authority, SQL Backup and Restore, SQL Query, SQL Server, SQL Tips and Tricks, T SQL Tagged: SSIS

    Read the article

  • The Best Websites for Downloading and Playing Classic and New Text Adventure Games

    - by Lori Kaufman
    Before computers could handle graphical games, there were text adventure games. The games are interactive stories, so playing a text adventure game is like being part of a book in which you affect the story. Text adventure games are also referred to as “interactive fiction.” Interactive Fiction (IF) is actually a more accurate term for text adventure games, because these games can cover any topics, such as romances or comedies, not just adventures. They can also simulate real life. Even though computers can now handle intensely graphical games, playing text adventure games can still be fun. It’s like reading a good book and getting lost in the universe of the story, except you become the hero or heroine and affect the ending of the story. We’ve collected some links to websites where you can download classic and new text adventure games or play them online. There are also some free tools available for creating your own text adventure games. We even found a documentary about the evolution of computer adventure games and some articles about the art and craft of developing the original text adventure games. How To Create a Customized Windows 7 Installation Disc With Integrated Updates How to Get Pro Features in Windows Home Versions with Third Party Tools HTG Explains: Is ReadyBoost Worth Using?

    Read the article

  • Is there a tool to do round trip software engineering between a sequence diagram and a group of objects that message back and forth?

    - by DeveloperDon
    Is there a tool to do round trip software engineering between a sequence diagram and a group of objects that message back and forth? Perhaps this seems a little exotic, but it seems like a function that includes message calls or even method invocations on other objects could be automatically converted to a sequence diagram given that it is not hard to do manually. Similarly, when a sequence diagram is modified, based on the message name and type of message, should it not be possible to add a message or method to the calling object?

    Read the article

  • PHP text formating: Detectng several symbols in a row

    - by ilnur777
    I have a kind of strange thing that I really nead for my text formating. Don't ask me please why I did this strange thing! ;-) So, my PHP script replaces all line foldings "\n" with one of the speacial symbol like "|". When I insert text data to database, the PHP script replaces all line foldings with the symbol "|" and when the script reads text data from the database, it replaces all special symbols "|" with line folding "\n". I want to restrict text format in the way that it will cut line foldings if there are more than 2 line foldings used in each separating texts. Here is the example of the text I want the script to format: this is text... this is text... this is text...this is text...this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... I want to restict format like: this is text... this is text... this is text...this is text...this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... So, at the first example there is only one line folding between 2 texts and on the second example there are 3 line foldings between 2 texts. How it can be possible to replace more than 2 line foldings symbols "|" if they are detected on the text? This is a kind of example I want the script to do: $text = str_replace("|||", "||", $text); $text = str_replace("||||", "||", $text); $text = str_replace("|||||", "||", $text); $text = str_replace("||||||", "||", $text); $text = str_replace("|||||||", "||", $text); ... $text = str_replace("||||||||||", "||", $text); $text = str_replace("|", "<br>", $text);

    Read the article

  • XSLT Escape Character not working

    - by liveek
    I am trying to use escape charaters in my text output, as i would like too surround the output in emailData tags. I am using <xsl:text>&#60;emailData&#62;</xsl:text> In the XSLT to esnure that this works however because i am using a tool called Cast Iron for some reason it is not converting the &#60; into < and just spits out &lt;emailData> You can see am image of it HERE that illustrates the output i am getting. My source code is this. How else could i wrap this in emailData tags? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="header"> <xsl:text>&#60;emailData&#62;</xsl:text> <xsl:text>&#10;</xsl:text> <xsl:text>From: </xsl:text> <xsl:value-of select="from/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text>To: </xsl:text> <xsl:value-of select="to/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text>Subject: </xsl:text> <xsl:value-of select="subject/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text>Content-Type: </xsl:text> <xsl:value-of select="contentType/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text> boundary="</xsl:text> <xsl:value-of select="boundary/text()"/> <xsl:text>"</xsl:text> <xsl:text>&#10;</xsl:text> <xsl:text>MIME-Version: </xsl:text> <xsl:value-of select="mimeVersion/text()"/> </xsl:template> <xsl:template match="email"> <xsl:text>&#10;&#10;</xsl:text> <xsl:text>--</xsl:text> <xsl:value-of select="../header/boundary/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text>Content-Type: </xsl:text> <xsl:value-of select="contentTypeBody/text()"/> <xsl:text> charset="us-ascii"</xsl:text> <xsl:text>&#10;</xsl:text> <xsl:text>Content-Transfer-Encoding: </xsl:text> <xsl:value-of select="contentTransfer/text()"/> <xsl:text>&#10;&#10;</xsl:text> <xsl:value-of select="body/text()"/> </xsl:template> <xsl:template match="Attachment"> <xsl:for-each select="Attachments"> <xsl:text>&#0010;&#0010;</xsl:text> <xsl:value-of select="../../header/boundary/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text>Content-Type: </xsl:text> <xsl:value-of select="attachmentContentType/text()"/> <xsl:text> name="</xsl:text> <xsl:value-of select="attachmentDescription/text()"/> <xsl:text>"</xsl:text> <xsl:text>&#10;</xsl:text> <xsl:text>Content-Description: </xsl:text> <xsl:value-of select="attachmentDescription/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text>Content-Disposition: attachment; filename="</xsl:text> <xsl:value-of select="atachementDisposition/text()"/> <xsl:text>"</xsl:text> <xsl:text>&#10;</xsl:text> <xsl:text>Content-Transfer-Encoding: </xsl:text> <xsl:value-of select="attachmentContentTransfer/text()"/> <xsl:text>&#10;&#10;</xsl:text> <xsl:value-of select="attachementBody/text()"/> <xsl:text>&#10;</xsl:text> <xsl:text>&#60;/emailData&#62;</xsl:text> </xsl:for-each> </xsl:template> <xsl:template match="text()"/> </xsl:stylesheet>

    Read the article

  • How to Use Text in Unity3d

    - by ZiG-ZaG
    How Can i Create Text in Unity3D? I Use "3D Text" But Its Always on Top Of Everything! Can You Suggest Anything? I creating a 2D Game So its not Necessarily a 3D Text.. Edit: Because I Building a 2D Game My Scene is Full of Planes in Front of Camera And I want My Text to be Over One of the Planes and when plane is moving My Text appears behind it. But When I Use "3D Text" Its Always In Front of Everything. Sorry for My Bad English...

    Read the article

  • Text editing best practices (with tags, etc.)

    - by Ron
    Hi there, I want to create a text field with some text, that is styled with tags. Think of MS Word, some ext is bold, some is a headline, etc. The tags that style the text are not visible to the user, he just sees the text in bold. How do I preserve these tags? I mean when I backspace over the closing bold-tag, for example, how do I preserve that and prevent that the rest of the text is now bold until the end? I guess this is a pretty basic question for experiences programmers. Are there any algorithms or best practices? This problem surely has been solved before, any pointers? (If this is of any concern, I develop for the iPhone OS and the text field will be a UITextView, but my question is more general I guess.) Thanks in advance!

    Read the article

  • hiding text using "text-indent"

    - by Crippletoe
    hi all, i am trying to hide some text inside an on my website using the text indent property (setting it to text-indent: -999px;). for some reason this doesnt work when i set the direction of the document to "rtl" (my site is in Hebrew, which is written from right to left). under "rtl" direction, the text still shows. anyone knows any way around this? thanks

    Read the article

  • Which Message Queue should I choose (must run on Linux)

    - by MHS
    There are many open source Message queues for Linux, and I need some help deciding what I should go for. My problem is simple - I get sent a list of files that needs to be processed. Each job can't be split up, but they are self contained and can be spread to multiple computers. I'm thinking of solving this using a message queue. Multiple clients send a message to a central queue. Each queue has a number of subscribers that will take jobs from that queue when they have finished processing the current job. Ideally it should have the following qualities Message queue must be able to store unprocessed messages in case of a shutdown/reboot A job can only be processed by a single subscriber (don't want duplicate jobs) The subscribers should be able to send jobs of their own, that will be processed by a different set of subscribers. Can anyone suggest a simple to use message queue?

    Read the article

  • Displaying text letter by letter

    - by Evi
    I am planing to Write a Text adventure and I don't know how to make the text draw letter by letter in any other way than changing the variable from h to he to hel to hell to hello That would be a terrible amount of work since there are tons of dialogue. Here is the source code so far { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; Texture2D sampleBG; Texture2D TextBG; SpriteFont defaultfont; KeyboardState keyboardstate; public bool spacepress = false; public bool mspress = false; public int textheight = 425; public int rowspace = 40; public string namebox = "(null)"; public string Row1 = "(null)"; public string Row2 = "(null)"; public string Row3 = "(null)"; public string Row4 = "(null)"; public int Dialogue = 0; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.PreferredBackBufferHeight = 600; graphics.PreferredBackBufferWidth = 800; IsMouseVisible = true; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here sampleBG = Content.Load <Texture2D>("SampleBG"); defaultfont = Content.Load<SpriteFont>("SpriteFont1"); TextBG = Content.Load<Texture2D>("textbg"); } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { KeyboardState keyboardstate = Keyboard.GetState(); MouseState mousestate = Mouse.GetState(); // Changes Dialgue by pressing Left Mouse Button or Space #region Dialogue changer if (mousestate.LeftButton == ButtonState.Pressed && mspress == false) { mspress = true; Dialogue = Dialogue + 1; } if (mousestate.LeftButton == ButtonState.Released && mspress == true) { mspress = false; } if (keyboardstate.IsKeyDown(Keys.Space) && spacepress == false) { spacepress = true; Dialogue = Dialogue + 1; } if (keyboardstate.IsKeyUp(Keys.Space) && spacepress == true) { spacepress = false; } #endregion // ------------------------------------------------------ // Dialgue Content #region Dialgue if (Dialogue == 1) { Row1 = "Input Text 1 Here."; Row2 = "Input Text 2 Here."; Row3 = "Input Text 3 Here."; Row4 = "Input Text 4 Here."; } if (Dialogue == 2) { Row1 = "Text 1"; Row2 = "Text 2"; Row3 = "Text 3"; Row4 = "Text 4"; } #endregion // ------------------------------------------------------ base.Update(gameTime); } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here spriteBatch.Begin(); spriteBatch.Draw(sampleBG, new Rectangle(0, 0, 800, 600), Color.White); spriteBatch.Draw(TextBG, new Rectangle(0, 400, 800, 200), Color.White); spriteBatch.DrawString(defaultfont, Row1, new Vector2(10, (textheight + (rowspace * 0))), Color.Black); spriteBatch.DrawString(defaultfont, Row2, new Vector2(10, (textheight + (rowspace * 1))), Color.Black); spriteBatch.DrawString(defaultfont, Row3, new Vector2(10, (textheight + (rowspace * 2))), Color.Black); spriteBatch.DrawString(defaultfont, Row4, new Vector2(10, (textheight + (rowspace * 3))), Color.Black); spriteBatch.End(); base.Draw(gameTime); } } }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >