text
stringlengths
20
1.01M
url
stringlengths
14
1.25k
dump
stringlengths
9
15
lang
stringclasses
4 values
source
stringclasses
4 values
First C Program Come on, guys ! Lets write our first C program to print Hello World on screen : #include <stdio.h> int main() { printf("Hello World !"); return 0; } Output : Hello World ! The C program is made up of following parts: Pre-processor : #include tells the compiler to include a file and #include<stdio.h> tells the compiler to include stdio.h header file to the program. Header File : A header file is a file with extension .h and it contains built-in functions, which can be directly used in an program. For example : We use printf() function in a program to print data on screen. This function is available in stdio.h header file. main() function : main() is an important part of a C program. Program execution begins from main() function. Here, we have written int before the main() as it is the return type of of main(). Comments : A large program can be complex and hard to understand. So, to solve this problem we use comments in C. Single line comment: Multi line comment: /* * Comment goes here */ return 0 : This indicates finishing of a function. When we wrote our main() function, we used int before it. That int was the return type, so with statement return 0, we are returning a null value to the operating system, this will prevent our program from errors. Now, save the program with .c extension and run in a compiler(like codeblocks ). Report Error/ Suggestion
https://www.studymite.com/c-programming-language/My-1st-C-Program
CC-MAIN-2020-16
en
refinedweb
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 5.7, “How to Scala create methods that take variable-arguments (varargs) fields.” Problem To make a Scala method more flexible, you want to define a method parameter that can take a variable number of arguments, i.e., a varargs field. Solution Define a varargs field in your method declaration by adding a * character after the field type: def printAll(strings: String*) { strings.foreach(println) } Given that method declaration, the printAll method can be called with zero or more parameters: // these all work printAll() printAll("foo") printAll("foo", "bar") printAll("foo", "bar", "baz") Use _* to adapt a sequence As shown in the following example, you can use Scala’s _* operator to adapt a sequence ( Array, List, Seq, Vector, etc.) so it can be used as an argument for a varargs field: // a sequence of strings val fruits = List("apple", "banana", "cherry") // pass the sequence to the varargs field printAll(fruits: _*) If you come from a Unix background, it may be helpful to think of _* as a “splat” operator. This operator tells the compiler to pass each element of the sequence to printAll as a separate argument, instead of passing fruits as a single argument. This is also similar to using xargson the Unix/Linux command line. Discussion When declaring that a method has a field that can contain a variable number of arguments, the varargs field must be the last field in the method signature. Attempting to define a field in a method signature after a varargs field is an error: scala> def printAll(strings: String*, i: Int) { | strings.foreach(println) | } <console>:7: error: *-parameter must come last def printAll(strings: String*, i: Int) { ^ As an implication of that rule, a method can have only one varargs field. As demonstrated in the Solution, if a field is a varargs field, you don’t have to supply any arguments for it. For instance, in a method that has only one varargs field, you can call it with no arguments: scala> def printAll(numbers: Int*) { | numbers.foreach(println) | } printAll: (numbers: Int*)Unit scala> printAll() This case reveals some of the inner workings of how Scala handles varargs fields. By defining a varargs method that can take multiple integers, and then calling that method (a) with arguments, and (b) without arguments, you can see how Scala handles the two situations: def printAll(numbers: Int*) { println(numbers.getClass) } scala> printAll(1, 2, 3) class scala.collection.mutable.WrappedArray$ofInt scala> printAll() class scala.collection.immutable.Nil$ While the first situation reveals how Scala handles the normal “one or more arguments” situation, treating the “no args” situation as a Nil$ in the second situation keeps your code from throwing a NullPointerException. Although the resulting types are different, as a practical matter, this isn’t too important. You’ll typically use a loop inside a method to handle a varargs field, and either of the following examples work fine whether the method is called with zero or multiple parameters: // version 1 def printAll(numbers: Int*) { numbers.foreach(println) } // version 2 def printAll(numbers: Int*) { for (i <- numbers) println } The Scala Cookbook This tutorial is sponsored by the Scala Cookbook, which I wrote for O’Reilly: You can find the Scala Cookbook at these locations:
http://alvinalexander.com/scala/how-to-define-methods-variable-arguments-varargs-fields/
CC-MAIN-2020-16
en
refinedweb
Different return types in swift functions Swift function without return values : We can write functions without any return values . That means, if you call the function, it will return no value and the program will continue running from the next line. Example : func sayHello() { print ("Hello") } sayHello() It will print ‘Hello‘ as output. So, mainly we called one function and it printed one line. That’s it. Swift function with a return value : For the above example, instead of printing the string ‘Hello‘ , we can ask it to return the string to the caller function. We will store it in a variable and print out the result. func returnHello() -> String { return "Hello" } let returnString = returnHello() print (returnString) The output of the above program is same as the previous one i.e. “Hello“. ‘returnHello‘ function returns ‘Hello‘ String . If a function returns something, we write the name as ‘func functionName() -> returnValue {}’ . Here, ‘returnHello‘ function returns a string, so we have ‘-> String’ after the function name. So, on calling this function, it returns one string. We are using one constant ‘returnString‘ to hold that return value. On last statement, we are just print the value of ‘returnString‘ i.e. the return value of ‘returnHello‘ function. Returning multiple values from function in swift : In swift, we can even return multiple values from a function. We can return the values as tuple to the caller. Following example will clarify your doubts : func findTopThree(array : [Int]) ->(first : Int, second : Int, third : Int){ var currentFirst = -1 var currentSecond = -1 var currentThird = -1 for value in 0...array.count-1{ if (array[value] >= currentFirst){ currentThird = currentSecond currentSecond = currentFirst currentFirst = array[value] }else if (array[value] > currentSecond){ currentThird = currentSecond currentSecond = array[value] }else if(array[value] > currentThird){ currentThird = array[value] } } return (currentFirst,currentSecond,currentThird) } let marks = [35, 46, 34, 29, 59, 70, 82, 89, 45,80,95, 87,23, 49,91] let result = findTopThree(array:marks) print ("Top mark : \(result.first)") print ("Second mark : \(result.second)") print ("Third mark : \(result.third)") Output : Top mark : 95 Second mark : 91 Third mark : 89 In this example, we are finding out the top three marks from an array of marks. The return value of the function is defined as ‘->(first : Int, second : Int, third : Int)’ i.e. it will return three integers in a tuple with name ‘first‘, ‘second‘ and ‘third‘. We created one constant ‘result‘ to hold these values. Since, the values of a tuple are named same as the return type defined in the function, we can access each one of them using a dot ‘.’ . The last three print lines are used to print out the ‘first‘ , ‘second‘ and ‘third‘ values of that tuple. Returning Optional Tuple from a Swift function : We can also return optional tuple values from a function in swift. Optional means it may or mayn’t have any return values. For example, check the below program : func findFirstTwoNegativeNumbers(array : [Int]) -> (first : Int, second : Int)? { var firstNumber = 0 var secondNumber = 0 for value in 0...array.count - 1 { if(array[value] < 0){ if firstNumber == 0 { firstNumber = array[value] }else if secondNumber == 0{ secondNumber = array[value] return (firstNumber,secondNumber) } } } return nil } let numbers = [ 1,2,3,4,5] print("First two negative numbers \(findFirstTwoNegativeNumbers(array : numbers))") let numbers2 = [ 1,2,3,-1,4,5,-4,0,9,-5] print("First two negative numbers \(findFirstTwoNegativeNumbers(array : numbers2))") Output : First two negative numbers nil First two negative numbers Optional((first: -1, second: -4)) This function is used to find out the first two negative numbers in an array. Here , the return type is ‘(first : Int, second : Int)? ‘ i.e. it may or mayn’t return results. If it will find two negative numbers in the input array, it will return these as a tuple. If one or no negative number is found, it will return ‘nil’. For the first example, since all the numbers are positive, it returns ‘nil’. That’s all for today. I will write more articles on function in Swift. Keep visiting codevscolor. Happy Coding 🙂
https://www.codevscolor.com/different-swift-return-types/
CC-MAIN-2020-16
en
refinedweb
Documentation Using Pygments with MoinMoinback to documentation index. Did you like the documentation? Do you have suggestions? Leave your comment here! tyler oderkirk wrote on July 29, 2008: Be careful not to name your lexer 'pygments.py' - you'll pollute the namespace and get this runtime error: "cannot import name highlight" Also, I've found that MoinMoin 1.6.1 (release) won't tolerate a blank line following the {{{-enclosed shebang line; you should start your markup on the line immediately following the "#!" line. kai@fricke-privat.de wrote on Sept. 5, 2007: Use this command to generate the CSS file: $ echo "<html></html>" | pygmentize -f html -l html -O full=True,cssfile=./pygments.css
http://pygments.org/docs/moinmoin/
crawl-002
en
refinedweb
Hello all, I have a number of functions and data structures I'd like to see added to the stm package. The package is listed as being maintained by the list, so I thought I'd ask how "sacred" stm is considered before going through the process to propose things. The extra functions are no-brainers. Some are common conveniences (e.g., modifyTVar and modifyTVar'), some aim to make the API more consistent (e.g., add swapTVar like swapTMVar), and some can be optimized if they're included in the package (e.g., tryReadTMVar[1]). The data structures are all variations on TChan which seem common enough to be included in the package, though I could also fork off a stm-data package instead. The variations include channels that can be closed, channels which have bounded depth (i.e., cause extra writes to block until room is available), and channels which are both bounded and closeable. Thoughts? Also, to make proper patches, where is the stm repo? [1] From outside the package we must define this as: tryReadTMVar :: TMVar a -> STM (Maybe a) tryReadTMVar var = do m <- tryTakeTMVar var case m of Nothing -> return () Just x -> putTMVar var x return m Whereas, from inside the package we can just do: tryReadTMVar :: TMVar a -> STM (Maybe a) tryReadTMVar (TMVar t) = readTVar t thus saving an extraneous read and write. -- Live well, ~wren
http://www.haskell.org/pipermail/libraries/2011-February/015969.html
CC-MAIN-2014-35
en
refinedweb
18 January 2012 08:13 [Source: ICIS news] (adds details in paragaphs 2-3) SINGAPORE (ICIS)--Methanex is planning to relocate one of its idled methanol plants at its Cabo Negro complex in ?xml:namespace> The firm is likely to move a 1m tonne/year unit from the Cabo Negro complex to the new site at Geismar in Methanex operates three 1m tonne/year units and another 800,000 tonne/year plant at the Cabo Negro site, according to the source. Site-specific engineering has begun and the plant is expected to be operational in the second half of 2014, the company said in a statement. “The outlook for low North American natural gas prices makes “We have a number of parallel work paths ongoing and expect to make a final investment decision on this project in the third quarter of this year,” Aitken added. The relocation project will allow the firm to add capacity at a lower capital cost and in about half the time taken to start up a “We continue to pursue more natural gas from other suppliers in “However, the board decided it was faster to relocate one of the plants to the “The timing of this project is excellent: there is strong demand growth for methanol globally and there is little new production capacity being added to the industry over the next several years,” Aitken said. The plant’s output will mainly be allocated to the company’s distribution chain. The company source added that the volume may be sold to the Methanex’s Methanex has four methanol plants with a combined capacity of 3.8m tonnes/year at the Cabo Negro complex in The financial details of the project were not disclosed in the statement. With initial reporting by Nurluqman Suratman
http://www.icis.com/Articles/2012/01/18/9524733/canadas-methanex-to-move-cabo-negro-methanol-unit-to-us.html
CC-MAIN-2014-35
en
refinedweb
"Nobody likes bugs." Most articles about testing utilities start with this sentence. And it's true--we would all like our code to act exactly as we planned it to work. But like a rebellious child, when we release our code into the world it has a tendency to act as if it has a will of its own. Fortunately, unlike in parenthood, there are things we can do to make our code behave exactly as we would like. There are many tools designed to help up test, analyze, and debug programs. One of the most well-known tools is JUnit, a framework that helps software and QA engineers test units of code. Almost everyone that encounters JUnit has a strong feeling about it: either they like it or they don't. One of the main complaints about JUnit is that it lacks the ability to test complex scenarios. This complaint can be addressed by doing some "out of the box" thinking. This article will describe how JUnit can perform complex test scenarios by introducing Pisces, an open source JUnit extension that lets you write test suites composed of several JUnit tests, each running on a remote machine serially or in parallel. The Pisces extension will allow you to compose and run complex scenarios while coordinating all of them in a single location. Two basic objects in JUnit are TestCase and TestSuite. The TestCase provides a set of utility methods that help run a series of tests. Methods such as setup and teardown create the test background at the beginning of every test and take it down at the end, respectively. Other utility methods do a variety of tasks, such as performing checkups while the test is running, asserting that variables are not null, comparing variables, and handling exceptions. Developers that want to create a test case need to subclass the TestCase object, override the setup and teardown methods, and then add their own test methods while conforming to the naming convention of testTestName. Here is what a simple TestCase subclass might look like: public class MyTestCase extends TestCase { /** * call super constructor with a test name * string argument. * @param testName the name of the method that * should be run. */ public MyTestCase(String testName){ super(testName); } /** * called before every test */ protected void setUp() throws Exception { initSomething(); } /** * called after every test */ protected void tearDown() throws Exception { finalizeSomething(); } /** * this method tests that ... */ public void testSomeTest1(){ ... } /** * this method tests that ... */ public void testSomeTest2 (){ ... } } TestSuite is composed of several TestCases or other TestSuite objects. You can easily compose a tree of tests made out of several TestSuites that hold other tests. Tests that are added to a TestSuite run serially; a single thread executes one test after another. ActiveTestSuite is a subclass of TestSuite. Tests that are added to an ActiveTestSuite run in parallel, with every test run on a separate thread. One way to create a test suite is to inherit TestSuite and override the static method suite(). Here is what a simple TestSuite subclass might look like: public class MyTestSuite extends TestSuite { public static Test suite() { TestSuite suite = new TestSuite("Test suite for ..."); // add the first test MyTestCase mtc = new MyTestCase("testSomeTest1"); suite.addTest(mtc); // add the second test MyTestCase mtc2 = new MyTestCase("testSomeTest2"); suite.addTest(mtc2); return suite; } } Running a test or a test suite is easy, as there are several GUIs you can use, starting with the GUI provided by JUnit and going all the way to IDEs such as Eclipse. Figure 1 shows how the Eclipse IDE presents a TestSuite. Figure 1. JUnit integration with Eclipse Because it is not the main subject of this article and because there are many articles about JUnit, this article will only provide a brief overview of the basic concepts of JUnit. See the Resources section for articles that cover JUnit in greater depth. JUnit Strengths and Weaknesses JUnit is an easy-to-use and flexible open source testing framework. As with every other project, it has many strengths but also some weaknesses. By using the automated JUnit testing framework, which does not need human intervention, one can easily accumulate a large number of JUnit tests and ensure that old bugs are not reproduced. In addition, JUnit helpfully integrates with build utilities, such as Ant, and with IDE utilities, such as Eclipse. JUnit's weaknesses are also well known. It supports only synchronous testing and offers no support for call backs and other asynchronous utilities. JUnit is a black-box testing framework, so testing problems that do not directly affect functionality (such as memory leaks) is very hard. Additionally, it does not provide an easy-to-use scripting language, so you must know Java to use JUnit. Another big limitation is that JUnit tests are limited to only one JVM. This limitation becomes a big issue when one is trying to test complex and distributed scenarios. The rest of this article covers this problem and ways to solve it. Every agent runs a set of JUnit tests and each test may write information to the default out. Because it is important that the tester or developer gets this information while the test is running, the default out is copied to the main local test suite's console. This process eliminates the need to go and look at each of the agent consoles in the test suite. Communication between the agents and the main local test is a complex matter, and Pisces must be able to work in a range of different environments and network topologies. In order to accommodate this issue, Pisces has a pluggable communication layer. Each of these implementations solves the problems that occur in their specific network environments. Two basic communication layers are provided by Pisces by default--a multicast implementation, which is easy to configure but works only in a LAN environment, and a JMS implementation, which requires the installation of Message-Oriented Middleware (MOM) but works in most environments. Configuring and Running Pisces Agents As I mentioned before, the Pisces test suite is composed of several JUnit tests running on remote agents. Each agent is a Java application that, according to instructions it receives from the main test runner, runs the JUnit test and reports its result and the default out printouts back to the main test runner. The easiest way to run an agent application is to configure and run the relevant executable script in the scripts folder provided in the Pisces build. Alternatively, you can also build your own script based on those already provided. The script allows users to configure general parameters for the agent, such as a unique identifier, and for the communication layer, a multicast IP and port. For example, a script for running an agent with a multicast communication layer on Linux OS might look like this: The executable script for a Pisces agent that uses a JMS provider is similar in most ways; the JMS communication layer takes as a parameter the name of a loader class that returns aThe executable script for a Pisces agent that uses a JMS provider is similar in most ways; the JMS communication layer takes as a parameter the name of a loader class that returns a #!/bin/sh # the folder were the agent can find junit.jar export JUNIT_HOME=/opt/junit3.8.1 # the folders were the agent can find # the junit tests export JUNIT_TEST_CLASSPATH=../examples/ # the multicast port that the communication # layer uses export PISCES_MCP=6767 # the multicast IP that the communication # layer uses export PISCES_MCIP=228.4.19.76 # the unique name of the agent export AGENT_NAME=remote1 java -classpath "$JUNIT_HOME/junit.jar:../pisces.jar:$JUNIT_TEST_CLASSPATH" \ org.pisces.RemoteTestRunnerAgent \ -name $AGENT_NAME -com multicast \ -mcp $PISCES_MCP -mcip $PISCES_MCIP ConnectionFactoryof your JMS provider. Configuring and Running Pisces-Enabled Test Suites After configuring and running all of the relevant agents, we still need to configure and run our Pisces-enabled test suite. First, we have to add the communication layer configuration to the beginning of our TestSuite, as shown below: // create the multicast communication layer MulticastRemoteTestCommunicationLayer com = new MulticastRemoteTestCommunicationLayer( RemoteTestRunner.name ,"228.4.19.76",6767); // set the communication layer RemoteTestRunner.setCom(com); Then, we need to create an instance of aThen, we need to create an instance of a TestSuiteand add a test to it to be run remotely. This is achieved by specifying the JUnit class (with an optional test method), as well as the name of the agent that should run this specific test. Here is an example of how this is done: // create a regular TestSuite TestSuite suite = new TestSuite("Test for org.pisces.testers"); // create a wrapper for a regular case RemoteTestCase rtc = RemoteTestCase.wrap(RemoteTestTestCase.class ,"someTestMethod", "remote1"); // add test case to TestSuite suite.addTest(rtc); The next section of this article will provide an example of a distributed test scenario and the code of its TestSuite. Let's say we have a web application. A user logs in, gets a service, and then logs out. We want to make sure that our security module prevents a single user from concurrently logging in on two different computers. We have created a MyTestCase test case object, as shown before, that has two test methods. The first, testLogin(), makes sure we can log in for the first time, and a second one, testLoginFails(), makes sure that the second login fails. Here is what a test suite that utilizes Pisces might look like: public class RemoteTestSuiteExample extends TestSuite { public static Test suite() { // configure and start the com layer JMSRemoteTestCommunicationLayer com = null; try { com = new JMSRemoteTestCommunicationLayer (RemoteTestRunner.name, new MantaConnectionFactory()); } catch (JMSException e) { throw new RuntimeException(e); } RemoteTestRunner.setCom(com); // do the JUnit thing TestSuite suite = new TestSuite("Test for org.pisces.testers"); // run method testLogin in class MyTestCase // on remote agent remote1 RemoteTestCase rtc = RemoteTestCase.wrap(MyTestCase.class, "testLogin", "remote1"); suite.addTest(rtc); // run method testLoginFails in class MyTestCase // on remote agent remote2 RemoteTestCase rtc1 = RemoteTestCase.wrap(MyTestCase.class, "testLoginFails", "remote2"); suite.addTest(rtc1); return suite; } } If all goes well, the remote agent (called remote1) tries to log in and succeeds. When the other agent (called remote2) tries to log in with the same user and password, it fails because the user is already logged in on a different computer. This test could have been more complex; for example, by adding a testLogOut() method and performing other security checks, but as an example I wanted to keep it simple. In this example, I have utilized a serverless JMS provider called MantaRay, an open source messaging middleware package that is based on peer-to-peer technology. In the latest release of Pisces, you can find several examples that utilize a JMS communication layer and other examples that use a multicast communication layer. Bugs are not fun, but with the help of JUnit, a widely used open source framework for automated testing, the task of running multiple test cases becomes much easier. Many projects extend the functionality of JUnit, but up until now, tests always had to be limited to one machine. With the help of Pisces and some "out of the box" thinking, we can now finally create complex and distributed test scenarios. Amir Shevat is a senior software developer with eight years of experience in computing. Return to ONJava.com.
http://www.onjava.com/lpt/a/6036
CC-MAIN-2014-35
en
refinedweb
: In some examples we will use different XML message data. Where this happens, the data is explicitly defined there then. The JavaBean Cartridge is used via the configuration namespace. Install the schema in your IDE and avail of autocompletion. An example configuration:): The Smooks config required to bind the data from the order XML and into this object model is as follows:: An the config:.
http://docs.codehaus.org/pages/diffpagesbyversion.action?pageId=74383749&selectedPageVersions=73&selectedPageVersions=72
CC-MAIN-2014-35
en
refinedweb
On Tuesday 05 Apr 2005 17:34, Volker Ruppert wrote: > Hi, > > > > I needed to patch the BIOS - which didn't implement the APM 1.2 16-bit > > > protected mode interface that Windows 2000 apparently requires. > > >... > > > > > > What doesn't work yet is Standby and Suspend, although I've generalised > > > > My network (using -user-net) stops working when I use your patched BIOS. > > > > But it does close the window on shutdown! > > I guess the patched rombios is based on a newer version from Bochs CVS. > Qemu is still using the rombios of May 31, 2004 with some patches. In the > meantime the PCI IRQ routing table has been modified and the PCI IRQ > initialization has been added. Qemu needs a small patch to make it work > again. I have already sent this patch to Fabrice Bellard and posted it here > in the list, but nothing happened. I'd like to apply the APM patch to the > official Bochs BIOS if you can confirm that it works. Here is the patch: > > diff -urN /home/volker/qemu/hw/pci.c ./hw/pci.c > --- /home/volker/qemu/hw/pci.c 2004-10-09 23:25:21.000000000 +0200 > +++ ./hw/pci.c 2004-12-24 20:10:50.000000000 +0100 > @@ -494,7 +494,7 @@ > static inline int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) > { > int slot_addend; > - slot_addend = (pci_dev->devfn >> 3); > + slot_addend = (pci_dev->devfn >> 3) - 1; > return (irq_num + slot_addend) & 3; > } > > -- > Bye > > Volker Yes this now works - I can even hibernate win2k and it will restart successfully. Has anyone had any joy installing service pack 4? Regards, Iain
http://lists.gnu.org/archive/html/qemu-devel/2005-04/msg00049.html
CC-MAIN-2014-35
en
refinedweb
Design Patterns Used by Reflection Classes .NET Framework 4.5 The most commonly used methods in the System.Reflection namespace use a consistent pattern. The members of the Module, Type, and MemberInfo classes use the design patterns shown in the following table. Another common design pattern is the use of delegates. They are typically used in reflection to enable filtering of the results set for methods that return arrays of objects. Concepts Show:
http://msdn.microsoft.com/en-us/library/vstudio/0t60wyw4.aspx
CC-MAIN-2014-35
en
refinedweb
Unanswered: Designing a full pledge application with EXT JS Unanswered: Designing a full pledge application with EXT JS We are making an application were we need to have this requirements. - Login (API Authentication) - Logout (Killing the current user session) - Dashboard (which has lots of application menus ) - Application (like Inventory, Reports , Stats and etc) I saw the Desktop sandbox example in the EXTJS package when I downloaded it and I think I like to have our application behave like this. My question are - how can I separate all of this requirements? Do i need to have a controller for each? - is there's a way to create an Application/Window class that will be have like an independent program? I hope you can help me regarding my query Question #1: No, you don't necessarily need a controller for each. The typical advice is to create controllers based on major sections of functionality of the application. So for example, if you have an Inventory management section, perhaps a single controller would be good to manage things related to Inventory management. Question #2: What do you mean by "behave like an independent program?" Thanks for the reply.. Regarding my other question , if you look at this desktop sample It's like each application were independent from each other.. Please correct if im wrong but we have a large team so I'm thinking of separating modules or features for each individuals. We will just have a default Application/Window container - Join Date - Mar 2007 - Location - Melbourne, Australia (aka GMT+10) - 1,083 - Answers - 24 - Vote Rating - 44 You could of course just break the different sections into various apps and use different namespaces to run them and also have a namespace for the desktop or core interface. There are also a couple of implementations of sub-applications around the forums for 4.x
http://www.sencha.com/forum/showthread.php?267031-Designing-a-full-pledge-application-with-EXT-JS
CC-MAIN-2014-35
en
refinedweb
.x Version 8.1 Features Not Supported in Version 10.x Scenarios Not Supported by Upgrade Many of the changes from the version 8.1 to the version 10.x project model are intended to align the model with broadly used Eclipse and Java conventions. If you've used other Eclipse-based IDEs, version 10.x of Workshop should feel familiar. Note: You might also be interested in the reading Key Differences for WebLogic Workshop 8.1 Users. The following list summarizes the most significant differences between version 8.1 and version 10.x project models. One of the largest aspects of this upgrade is the change from the Javadoc-comment style annotations used in version 8.1 to the Java 5 annotations supported for the version 10.x. For more information, see Upgrading Annotations. Most of the version 8.1 annotations have counterparts in version 10.x; for more information, see Relationship Between Version 8.1 and Version 10.x Annotations. These features have updated counterparts in version 10.x and may be deprecated. Impacts: Web services Upgrade strongly recommended. In version 8.1, web service message-level security is managed using WS-Security (WSSE) policy files. In version 10.x.x service control differs from version 8.1. In version 8.1, you specified both security policies and values in a WebLogic Workshop WSSE policy file. In version 10.x, the means for specifying characteristics for these two aspects of security has been split into multiple locations. For information on where security characteristics are now set, see Configuring Run-Time Message-Level Security Via the Service Control. In the course of upgrading your version 8.1 applications, you might find that some of your application's security-related characteristics differ between its behavior on the domain shipped with Workshop and the upgraded domain to which you redeploy it. This is because the "new" 10.x domain included with Workshop is not backward compatible, whereas the upgraded domain to which you deploy your upgraded application is (because it has been upgraded)..x,.x a conversational web service must have both a START and FINISH operation in order to compile. For more information, see Ensuring START and FINISH Methods for Conversations. Impacts: Web services Version 10.x Due to a difference in the way versions 8.1 and 10.x generate the default targetNamespace value for web services, you may enounter a deployment error if you have two or more web services with the same class name in an application. For web services in version 10.x, WebLogic Server uses the fully-qualified port name — which includes the web service's targetNamespace value — to bind resources it uses internally. As a result, the port name must be unique within an application. Workshop upgrade tools do not upgrade reliable messaging support (such as the @jws:reliable annotation) from version 8.1 to version 10.x. As noted in the version 8.1 documentation, that version's reliable messaging (RM) support was very limited and was not based on a specification that would be supported in future versions. You can manually upgrade reliable messaging support. See Upgrading Reliable Messaging Support — Basic Instructions for high-level upgrade steps. Version 9.x doesn't support using the form-get and form-post message formats to receive messages sent from an HTML form. When upgrading web services that use these formats, you'll need to use another method for receiving data sent from a form in a web browser. In other words, version 10.x web services do not support message formats that do not include SOAP headers. In version 8.1, the @jws:protocol annotation supported the following attributes and values: @jws:protocol form-get="true"— Indicated that the operation or web service supported receiving HTTP GET requests. @jws:protocol form-post="true"— Indicated that the operation or web service supported receiving HTTP POST requests. These attributes have no counterparts in version 10.x and there are no suggested workarounds. If you upgrade to version 10.x, upgrade tools will simply ignore a protocol setting that isn't supported. Impacts: Web services If you created a version 8.1 web service by generating it from a WSDL that specified xs:anyType instead of xs:any, the web service will expect and send incorrect XML payloads after upgrade to version 10.x. You can ensure correct handling of xs:anyType by applying the .x does not support abstract WSDLs. As a result, Workshop.x.x, controls must be annotated with the @TransactionAttribute annotation for transaction support. During upgrade, upgrade tools will add this annotation. For information on adding transaction support, see Enabling Automatic Transaction Support in Controls. Impacts: Control use The standard JdbcControl (org.apache.beehive.controls.JdbcControl) in version 10.x, Oracle..x,.x control model to version 10.x.x, the default is not to create the transaction. For information on ensuring the old default behavior, see Enabling Automatic Transaction Support in Entity Beans. Impacts: Potentially any code that uses annotations Unlike version 8.1, in version 10.x NetUI tags, some changes might be made to JSP tags if you choose to upgrade them. For more information, see Changes When Upgrading from Version 8.1 NetUI JSP Tags. Impacts: JSP files A backward-compatible version is set as the default for the upgraded application because it is more permissive than the version 10.x, version 10.x JSP tags. This includes migrating from the NetUI expression language syntax to the syntax of the version 10.x JSP expression language. However, note that expressions in the version 10.x JSP expression language are unable to bind to public fields, as was the case with NetUI expressions. For a full upgrade to version 10.x JSP tags, in other words, you must manually add get* and set* accessors where public fields were used. For more information on these differences, see Changing Code to Support the Expression Language.x project through which the schemas continue to be compiled into XMLBeans types. Impacts: XML schemas Version 10.x. Impacts: Code that uses XMLBeans and XQuery, including web services, controls, page flows, Enterprise JavaBeans The older XQuery implementation is deprecated, but supported in this version for backward compatibility. Queries based on the older implementation will be kept, but a special XmlOptions parameter will be added to specify that the old implementation should be used..x. You can migrate your modifications after upgrading your application by re-exporting your Ant build file, then merging in your modifications. Note: Unlike version 8.1, version 10.x does not support building your application with Ant from within the IDE. You must export the build file and execute targets from the command line. For details see Creating Ant Build and Maven POM Files for an Application. In version 10.x.x of Workshop.x: upgrade tools don't upgrade wildcard import statements, some of these statements will generate errors on version 10.x because their libraries are not present there. In some cases, you can fix these by replacing them with their version 10.x counterparts. After upgrade, you might find that some import statements with wildcards have been changed to reflect their nearest parallel in version 10.x. These features are no longer supported. The following describes functionality that version 8.1 supported, but which must be rewritten in order for upgraded code to work in version 10.x. Impacts: Web services, Service controls Version 10.x. Note: The lack of support for XQuery maps does not mean that XQuery itself is not supported. You can still execute XQuery expressions using the XMLBeans API. For more information on upgrade changes impacting this API, see Updating XQuery Use to Support Upgraded XQuery Implementation. For more information, see General Steps for Replacing XQuery Maps. Impacts: Web services Version 8.1 supported returning instances of java.util.Map from web service operations. The runtime provided a WebLogic Workshop-specific serialization of the Map to and from XML. The schema for that serialization was included in the WSDL for the Web Service. In version 10.x, java.util.Map instances can no longer be returned from web service operations. For a suggested workaround, see Replacing the Use of java.util.Map as a Web Service Operation Return Type. Impacts: Web services Unlike version 8.1, version 10.x.x.x).x so that it either uses the SOAP protocol or some alternative. For information on changing the message format in web services, see Details: Non-SOAP XML Message Format Over HTTP or JMS is Not Supported. Impacts: Web services In version 8.1 the @jc:handler and @jws:handler annotations included a callback attribute that specified handlers to process SOAP messages associated with callbacks; version 10.x does not include callback-specific handler support. For the counterparts of these annotations in version 10.x, see Upgrading Annotations. Impacts: Web services Version 10.x.x If a version 8.1 web service includes one or more operations that use the RPC SOAP binding and one or more operations that use the document SOAP binding, then after upgrade types generated for those operations will be placed into different namespaces. This will be different from the version 8.1 web service itself, in which the types were in the same namespace. A WSDL generated from the upgraded web service will differ from the version 8.1-generated WSDL. For more information, including a workaround, see Resolving Namespace Differences from Mixed Operations with Document and RPC SOAP Bindings. Supported but deprecated. Upgraded web service and Service control code will include the @UseWLW81BindingTypes and/or @WLWRollbackOnCheckedException annotations applied at the class level. Even though these annotations are deprecated, they are required in order to support clients that used the version 8.1 code. Impacts: Web services In version 8.1 it was possible to have a web service (JWS) or Service control whose WSDL defined multiple services. The web service or control would represent only one of these services. When upgrading such code to version 10.x upgrade will fail. To ensure that upgrade succeeds for this code, you should edit the WSDL so that it defines only the service that is represented by the JWS or Service control. Even though it was supported for WSDLs associated with version 8.1 service controls, in version 10.x multiple occurrences of the <wsdl:import> element is not supported in the same WSDL. For example, you might have used one import to get WSDL portions of the WSDL and another import to get XSD portions for needed types. More information and a workaround is available at Upgrading WSDLs with Multiple <wsdl:import> Statements. Version 8.1 supported using types in the 1999 schema namespace for service controls and web services generated from WSDLs that used the types. Because version 10.x does not support types in this namespace, you will need to manually migrate the WSDL to the 2001 namespace..x,.x JDBC control does not support this value; instead, specify a numerical value. This change is not automatically made by upgrade tools. For more information, see Replacing "All" Requests for Database Control Results. Impacts: Control use Version 10.x.x,.x.x timer control simplifies the API by disallowing multiple calls to the start method. Calls to the start method when the timer control is still running will have no effect. Impacts: Control use, page flows In versions.x. In upgraded code, you can substitute for this functionality by replacing your custom control with a web service. For more information on the version 8.1 feature and suggested version 10.x workarounds, see Providing Support for Callbacks from a Page Flow. Impacts: Web services, control creation These are events and APIs that were either considered low usage or were not general enough in nature to be included in the controls runtime. In situations such as creation Version 8.1 custom control annotation definitions are not upgraded to version 10.x..x. During upgrade your project hierarchy will be changed so that the Controller file is no longer co-located with JSP files. For more information, see Upgrade Changes for Co-Location in Page Flows. The version 8.1 IDE included a set of features through which the IDE kept related files in sync. For example, after generating a service control from a WSDL, changes to the WSDL would cause the IDE to automatically re-generate the service control to match. This functionality is not supported in the version 10.x IDE. For suggested workarounds, see Keeping Files in Sync in the Absence of IDE Support. If you created custom JSP tags in version 8.1 by extending NetUI tags, your tags will not be upgraded by Workshop tools. Extending NetUI tags was not supported. Note that if you elected not to migrate NetUI tags to current tags, your tags may build within the application, but may not work as expected. Likewise, extending JSP tags in version 10.x
http://docs.oracle.com/cd/E15051_01/wlw/docs103/guide/upgrading/conChangesDuringUpgrade.html
CC-MAIN-2014-35
en
refinedweb
#include <dirent.h> long telldir(DIR *dirp); The telldir() function shall obtain the current location associated with the directory stream specified by dirp. If the most recent operation on the directory stream was a seekdir(), the directory position returned from the telldir() shall be the same as that supplied as a loc argument for seekdir(). Upon successful completion, telldir() shall return the current location of the specified directory stream. No errors are defined. The following sections are informative. None. None. None. None. opendir() , readdir() , seekdir() , the Base Definitions volume of IEEE Std 1003.1-2001, <dirent.h>
http://www.makelinux.net/man/3posix/T/telldir
CC-MAIN-2014-35
en
refinedweb
Hi I'm making a program which takes arguments at command line for a specific website and filename and then saves the html code for you. I have that working fine but I'd like to strip the HTML tags as well so it only saves the text of a webpage, I understand that won't work perfectly but I can't get it to work at all! Need to put in something like this but I'm unsure where Code:if (c == '<' || c == '>') { in_tag = (c == '<') ? 1 : 0; Here's my full program Code:#include <curl/curl.h>#include <stdio.h> size_t write_data(void *ptr, size_t size, size_t nmeb, void *stream) { return fwrite(ptr, size, nmeb, stream); } int main(int argc, char *argv[]) { //checks there is the required amount of arguments if (argc == 3) { char *getcwd(char *buf, size_t size); char cwd[1024]; int confirm; printf("Saving website \"%s\".\n", argv[1]); printf("To file %s\n\n", argv[2]); //request save file confirmation from user printf("Are these details correct? (1 = Yes, 0 = No)\n\n"); scanf("%d", &confirm); if (confirm == 1) { //tells the user where the file has been saved if (getcwd(cwd, sizeof (cwd)) != NULL) fprintf(stdout, "Document saved in: \"%s\"\n\n", cwd); //opens file for writing (doesn't need to exist) FILE * file = (FILE *) fopen(argv[2], "w+"); if (!file) { perror("File Open:"); exit(0); } CURL *handle = curl_easy_init(); //collecting the html from command line specified argument curl_easy_setopt(handle, CURLOPT_URL, argv[1]); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(handle, CURLOPT_WRITEDATA, file); curl_easy_perform(handle); curl_easy_cleanup(handle); }//user chooses not to save else if (confirm == 0) { printf("File not saved\n"); return 0; }//invalid input by user else { printf("Incorrect input\n"); return 0; } } else { //showing correct usage of command line argument printf("Correct usage:\n\n \"./gethtml filename.txt\"\n\n"); return (0); } } That doesn't include an attempt at stripping the HTML as I've been trying all day and I'm clueless right now Any help much appreciatedAny help much appreciated
http://cboard.cprogramming.com/c-programming/146588-strip-html-code-save-file.html
CC-MAIN-2014-35
en
refinedweb
#include <djv_imaging.h> This structure provides a function for resampling images. This callback provides a change to render the source image dynamically. This callback function is called twice from Imaging::resample function. The first call is to lock a portion of the source image and the second call is to unlock that portion optionally. Noise reduction method. Do noise reduction on bitonal image. Do black compensastion. trueif the process succeeded. falseif the process is failed due to some condition. In this case, nothing is returned to outDestImage. Convert image to grayscale. Copy an image. Fill the buffer with white. Mirror an image horizontally. Resample the specified image. Referenced by Celartem::DjVu::ImageRenderer::render(). Resample the specified mask and alphablend against the image already on the specified buffer. Rotate the image. Rotate the image 90 degree clockwise or anti-clockwise.
https://www.cuminas.jp/sdk/structCelartem_1_1DjVu_1_1Imaging.html
CC-MAIN-2017-51
en
refinedweb
. Hope this helps. Keith Hasselstrom OK...what a lessoned learned. I had some time to kill so I think I can help out. I found a package that allows access to the registry. I downloaded the zip file. But the package is called JNI Registry. I can return email you a copy. My email is kmhasselstrom@tasc.com. After setting up the class names it was very easy to traverse the registry. The code to get my Oracle home on my windows 2000 box is posted below. I have several Oracle installs so you may want to write some code to read all the Oracle homes and get all the values. Then look for several TNS names etc.... If you get a java.lang.path error try this url for help: Hope this helps... Keith import java.util.*; import javax.naming.*; import com.ice.jni.registry.*; public class WinRegAccess extends Object { public static void main(String[] args) throws RegistryException{ RegistryKey reg = Registry.HKEY_LOCAL_MACHIN RegistryKey reg2 = reg.openSubKey("ORACLE"); RegistryKey reg3 = reg2.openSubKey("HOME2"); System.out.println(reg3.ge } }
https://www.experts-exchange.com/questions/20138677/how-to-get-TNSNAMES-entries-list-using-java-to-access-oracle.html
CC-MAIN-2017-51
en
refinedweb
Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team. ofstream OF; OF.open("file_name.txt"); double n = 0.1111111111111111; OF << n << endl; #include <iomanip> #uncing namespace std; ofstream OF; OF.open("file_name.txt"); size_t prec = 5; double n = 0.1111111111111111; OF << setprecision(prec) << n << endl; If you are experiencing a similar issue, please ask a related question Join the community of 500,000 technology professionals and ask your questions.
https://www.experts-exchange.com/questions/23817074/C-oftream-decimal-precision.html
CC-MAIN-2017-51
en
refinedweb
TypeLibTypeAttribute Class .NET Framework (current version) System.Runtime.InteropServices Assembly: mscorlib (in mscorlib.dll) Assembly: mscorlib (in mscorlib.dll) System.Object System.Attribute System.Runtime.InteropServices.TypeLibTypeAttribute System.Attribute System.Runtime.InteropServices.TypeLibTypeAttribute this attribute. The following example demonstrates how to get the TypeLibTypeAttribute value of a class or interface. using System; using System.Runtime.InteropServices; namespace B { class ClassB { public static bool IsHiddenInterface( Type InterfaceType ) { object[] InterfaceAttributes = InterfaceType.GetCustomAttributes( typeof( TypeLibTypeAttribute ), false ); if( InterfaceAttributes.Length > 0 ) { TypeLibTypeAttribute tlt = ( TypeLibTypeAttribute ) InterfaceAttributes[0]; TypeLibTypeFlags flags = tlt.Value; return ( flags & TypeLibTypeFlags.FHidden ) != 0; } return false; } } } .NET Framework Available since 1.1 Available since 1.1 Return to top Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe. Show:
https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.typelibtypeattribute
CC-MAIN-2017-51
en
refinedweb
public class TemplateVariableResolver extends Object TemplateVariableResolverresolves TemplateVariablesof a certain type inside a TemplateContext. Clients may instantiate and extend this class. TemplateVariable clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait protected TemplateVariableResolver(String type, String description) TemplateVariableResolver. type- the name of the type description- the description for the type public TemplateVariableResolver() This is a framework-only constructor that exists only so that resolvers can be contributed via an extension point and that should not be called in client code except for subclass constructors; use TemplateVariableResolver(String, String) instead. public String getType() public String getDescription() protected String resolve(TemplateContext context) context. To resolve means to provide a binding to a concrete text object (a String) in the given context. The default implementation looks up the type in the context. context- the context in which to resolve the type nullif it cannot be determined protected String[] resolveAll(TemplateContext context) context. The default implementation simply returns an array which contains the result of resolve(TemplateContext), or an empty array if that call returns null. context- the context in which to resolve the type context public void resolve(TemplateVariable variable, TemplateContext context) variablein context. To resolve means to find a valid binding of the receiver's type in the given TemplateContext. If the variable can be successfully resolved, its value is set using TemplateVariable.setValues(String[]). context- the context in which variable is resolved variable- the variable to resolve protected boolean isUnambiguous(TemplateContext context) TemplateVariable, its isUmambiguousstate is set to the one of this resolver. By default, this method returns false. Clients can overwrite this method to give a hint about whether there should be e.g. prompting for input values for ambiguous variables. context- the context in which the resolved check should be evaluated trueif the receiver is unambiguously resolvable in context, falseotherwise public final void setDescription(String description) This is a framework-only method that exists only so that resolvers can be contributed via an extension point and that should not be called in client code; use TemplateVariableResolver(String, String) instead. description- the description of this resolver public final void setType(String type) This is a framework-only method that exists only so that resolvers can be contributed via an extension point and that should not be called in client code; use TemplateVariableResolver(String, String) instead. type- the type name of this resolver Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.
http://help.eclipse.org/oxygen/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/text/templates/TemplateVariableResolver.html
CC-MAIN-2017-51
en
refinedweb
#include <SString.h> Collaboration diagram for ACE_SString: This class is optimized for efficiency, so it doesn't provide any internal locking. CAUTION: This class is only intended for use with applications that understand how it works. In particular, its destructor does not deallocate its memory when it is destroyed... We need this class since the ACE_Map_Manager requires an object that supports the operator== and operator!=. This class uses an ACE_Allocator to allocate memory. The user can make this a persistant class by providing an ACE_Allocator with a persistable memory pool. Definition at line 117 of file SString.h.
http://www.theaceorb.com/1.3a/doxygen/ace/classACE__SString.html
CC-MAIN-2017-51
en
refinedweb
Xamarin.Mac and iOS Now Have a Unified API and 64-bit. Xamarin now provides a single API for both Mac OS and iOS for 32-bit and/or 64-bit. Miguel de Icaza has announced the Unified API Beta that bridges Mac OS and iOS code, enabling developers to share code between the two platforms in a more natural way. If in the past a developer needed to use separate type namespaces, now the namespaces have been unified, so a piece of code like this: #if MAC MonoMac.Foundation; #elif IOS MonoTouch.Foundation; #endif now looks like this: Foundation; Xamarin is working on new templates and an assistant tool that would help migrate the previous code to the new API. Developers are not forced to migrate, Xamarin promising to “continue to support the Classic API you are familiar with for both Mac and iOS alongside the Unified API indefinitely.” There are still some pieces missing, according to de Icaza: - Binding Project Types, to easily call into native libraries - Complete templates for all the scenarios previously supported - Xamarin’s Components are not available yet Along with this new API Xamarin introduces unified support for 64-bit platforms and frameworks. With the native types – nint, nuint, nfloat - introduced last year a developer can now use the same code and target either the 32-bit or 64-bit platform or both on Mac OS and iOS. The unified API supports all the 64-bit frameworks that Apple provides. Support for Yosemite is provided through the alpha channel because the new Mac OS version is not yet final. Rate this Article - Editor Review - Chief Editor Action
https://www.infoq.com/news/2014/08/xamarin-mac-ios-64
CC-MAIN-2017-51
en
refinedweb
Hi Alex, Please correct if I misunderstood you, but initial responses are: * We should not produce a 0.7.0-M2 outside of apache - as the brooklyn community, we should work towards an official apache release. However, if an external party (e.g. cloudsoft) chose to produce an interim release (e.g. 0.7.0-cloudsoft.M2) then that is fine. * Agree with switching to org.apache.brooklyn maven groupId in master. * For changing package names, folk like jclouds still use org.jclouds. None of their classes are in an org.apache package. I lean towards not renaming the packages for the 0.7 release. Let's discuss that in a separate e-mail thread with appropriate subject. * We should not turn off non-ASF CI servers. The ASF CI servers just run unit tests. For integration and live tests, we're relying on the machines kindly contributed by Cloudsoft. Aled On 02/07/2014 12:28, Alex Heneveld wrote: > > Hi Andrew, All- > > Thanks. I have created the JIRA [1] to have ASF nexus access. > > However there are some major changes we will have to make before we > can use it: > > * We must publish to a groupId under org.apache. (I have suggested > org.apache.brooklyn.) > > * We should move all classes to be under package > `org.apache.brooklyn`. (This is not a strict requirement from what I > see but I think it is best practice.) > > Clearly this is going to be disruptive for our users. That said it is > probably better to do this relatively soon, but I think we should have > a stable release in the old namespace and coordinates first. So my > suggested plan is: > > 1) Tweak existing (non-ASF) CI servers to build and publish snapshots > to sonatype using the old co-ordinates, temporarily > 2) Cut an 0.7.0 M2 and GA ASAP via the old channels > 3) Then do the mass refactoring to use org.apache.brooklyn and publish > an 0.7.0 into Apache. The groupId is different so there should be no > confusion, but we should refrain from doing any code changes apart > from Apache compliance so that the 0.7.0 versions are functionally > identical modulo the namespaces. This will make it easier for people > to cut over. > 4) Turn off non-ASF CI servers. > 5) Do all 0.8.0 dev in org.apache.brooklyn namespace (backporting only > essential fixes if needed) > > WDYT? > > Best > Alex > > > [1] > > > On 01/07/2014 22:03, Andrew Kennedy wrote: >> Alex, Hi. >> >> Have a look at this. >> >> - >> >> It gives instructions for publishing to the ASF Nexus repository. It >> looks >> like we need to go through the steps listed at #signing-up to gain >> access >> to the server first. I think I have got the POM configured correctly >> (i.e. >> depending form the ASF parent POM) and so publishing snapshots should >> be as >> simple as 'mvn deploy' once that is done. >> >> If you could raise the appropriate JIRA that would be very helpful, >> then I >> can set up the Jenkins job to deploy things to the ASF snapshot repo. >> >> - >> >> I believe this is mirrored to Sonatype as well. >> >> Cheers, >> Andrew. >> >
http://mail-archives.apache.org/mod_mbox/brooklyn-dev/201407.mbox/%3C53B3F27E.3070200@gmail.com%3E
CC-MAIN-2017-51
en
refinedweb
Note: This node was written as an RPG-specific extension to the old video game noding convention. Since then, that writeup has been superceded by the Video Game FAQ, which is full of fantastic advice to would-be reviewers, and should be used in addition to the advice presented below. In the tradition of the excellent noding convention for game reviews, the following is an attempt to standardize CRPG reviews towards a similar format, as well as to provide advice and insight into the reviewing process itself. While you can always use the current general-purpose template for reviewing computer- or console-based RPGs, those of a more scholarly bent (or on a quest to garner more XP) might want a more RPG-specific framework on which to base their reviews. Start with the platform, title, and publishing information (as much as you have - do some research). Aside from issues of completeness, this namespaces the writeup - readers can tell at a glance, "Ah, this is a video game they're talking about." Regarding the title, write it as it appears on the title screen, although you can use pipe links to existing well-established but differently named nodes (see example). Feel free to provide well-known aliases for the title (e.g. Ultima: Exodus (Ultima III)), in case a game is part of a series and its number is not apparent from the title. Some consoles (Atari, for one) will have rarity guides, so do a quick search before you node, and include the rarity value in your review. If there's a game list present for your platform (see Atari games for an example), pipe-link it to the 'Title' entry. Example: NES Game Title: King's Quest V: Absence Makes The Heart Go Yonder (King's Quest 5) Developer: Konami Publisher: ? Rarity: B+ Year of Release: 1991 ... Next comes the RPG-specific information. Provide the RPG type, the genre (fantasy, sci-fi, modern-day, etc), the party size (x characters in a party out of N possible characters), playing modes (single- or multi-player), and perspective/view mode (first person, side-view, overhead, isometric 3D, etc). Nearly all RPGs have a save system of some kind, in addition to the lives/continues. Mention these as well. Examples: ... Title: Final Fantasy ... Type: Classic RPG Genre: Fantasy Party size: 4 out of 6 Modes: Single-player Perspective: Overworld and dungeons: Overhead, Battles: Side-view Save System: Battery Save (at Inn, or on overworld using items) Lives: 1 life, no one ups. Continues: No continues, reload from last save point. or ... Title: River City Ransom ... Type: Adventure RPG, Type II (Explicit stats, advancement by powerups) Genre: Modern Day, Street Fighting Party size: 1 out of 2 Modes: Single-player, 2 player simultaneous Perspective: Isometric 3D Save System: Password based Lives: 1 life, no one ups. Continues: Unlimited, with money penalty, resume from last visited Mall. Feel free to use the following header when writing RPG reviews (fill in the information in italics, if applicable). <P> <STRONG>[Platform] Game</STRONG><BR> <STRONG>[Platform Game List|Title]:</STRONG> Game title <em>([alias])</em><BR> <STRONG>Developer:</STRONG> [Company]<BR> <STRONG>Publisher:</STRONG> [Company]<BR> <STRONG>[Platform rarity guide|Rarity]:</STRONG> rating<BR> <STRONG>Year of Release:</STRONG> Year<BR> <STRONG>[ESRB] Rating</STRONG>: Rating <BR> <STRONG>[Console RPG types|Type]</STRONG>: RPG type<BR> <STRONG>[Genre]</STRONG>: [Genre]<BR> <STRONG>Party size</STRONG>: x out of N possible<BR> <STRONG>Modes</STRONG>: modes<BR> <STRONG>Perspectives</STRONG>: perspective information<BR> <STRONG>Save System</STRONG>: save system<BR> <STRONG>Lives:</STRONG> lives and one ups information<BR> <STRONG>Continues:</STRONG> continue information<BR> </P> Review goes here. <hr> <small>This write-up complies with the [Reviewing CRPGs] standard.</small> As any fan of Roger Ebert can tell you, writing reviews is very much an art form. Ideally, a reviewer has to provide information, pass a (non-condescending) judgement, and to do so in an entertaining manner. The review's intended audience plays an important role -- the author has to decide whether the purpose of the review is prescriptive or scholarly. In the former case, the review serves as a filter, as advice on whether or not the product is worthy of the reader's money and time (think reviews of new releases in your monthly gaming magazine). On the other hand, when reviewing 'classic' games for long-outdated platforms, there's very little point in giving recommendations. In these cases, a more in-depth review is more appropriate, with emphasis on a more detailed analysis, on providing context between related games, or on defending a particular thesis. The next two sections, Plot/World Details and Game System, are not intended as a rigid checklist of topics to cover, but more as a collection of ideas to consider when you're writing your review. Summarize the plot. However complex or simplistic, a background story is a staple feature of RPGs. The game manual usually has a brief plot description, and there's often an intro scene that sets the stage, before or after the title screen. What is the game's plot complexity? Does the game consist of a pre-determined sequence of levels (also referred to as 'stages' or 'boards')? Are there cut scenes or animations during the game, that advance and reveal the plot? Does the game take place on one level (the game world), but follow a single over-arching plot? Are there side quests? Are there hidden minigames or easter eggs? Does the game have alternative endings, and is the story at all determined by your actions (other than in obvious ways, like dying)? Some games have little or no enforced plot at all, and instead have a Daggerfall-like world in which you set your own goals, and explore freely. What is the scope and cosmology of the game world? Is the game set in a small kingdom, a large realm, or perhaps on an entire planet or several planets? Is the size of the game world 'controlled' (that is, sections of the world are blocked off until you progress further into the game), or do you have the run of the place, limited only by the deadliness of random encounters? Does time pass in the game world? Is there a day/night cycle (or even seasons)? What are the modes of transportation (for example: walking, horses, boats, airships, teleportation or portals)? How persistent is the game world? Do killed bosses stay dead? What about townies/NPCs, or even regular enemies? Do the areas 'reset' after you leave them, or stay empty once cleared out? What kind of changes can you make to the world, and do the characters' actions have any consequences? The game system (scoring, physics, game control, inventory and resource management, camera angles, game AI, automapping, etc) and the RPG system (stats, character advancement, combat, magic, weapons and equipment) are obviously immensely important to a CRPG. Describe the particular systems in your review. Some elements will be universal to most games, and will fade into the background (for instance, one can generally assume that an RPG will contain some kind of inventory management system). Pay attention when something stands out from other games in the same class. Is the game control particularly atrocious? Maybe the automap system is surprisingly helpful. Is character advancement implemented in some creative and unique way? Mention all the delights, surprises and frustrations. Ratings are hard to avoid in any review. How did the graphics, sound, game control, plot and replay value stack up against the other games? Yet assigning a rating in any remotely non-arbitrary manner is actually very difficult. The subject is important enough to warrant a separate treatment; however, one thing should be mentioned from the start. When rating a game, make sure to only compare it with other games on a particular platform (or a generation of platforms). There exist a mind-numbing amount of reviews to the effect of "This is a <insert an earlier-generation platform here> game, so of course its graphics are going to suck." To avoid that kind of inanity, and to give your ratings some kind of objectively-flavored framework, simply ask yourself, "Did this game's <graphics, music, plot, whatever> detract from my enjoyment, add to it, or blended in so as to be unnoticeable?" Between those three poles, there's a wide range of subjective preferences - "game Y's graphics were a tad bit better than those of game X", which don't matter too much. Mention the extreme cases (truly horrible or delightful), give an idea of the effect the particular element on overall game enjoyment, and leave the rest alone. Log in or register to write something here or to contact authors. Need help? accounthelp@everything2.com
https://everything2.com/title/Reviewing+CRPGs
CC-MAIN-2017-51
en
refinedweb
If you plan on building a customer dashboard for your application, it’s often a good idea to integrate it with your payment processor. One of the best tools to use is the Stripe API. It supports over 26 different countries and offers an extensive set of features for building out an e-commerce application. In this tutorial, we will go over managing customer information using the Stripe Customer API and ASP.NET Core. Review some of our videos courses or check out our GitHub account if you want to learn more. Stripe API Setup The first step is to add the Stripe package to your ASP.NET Core project. You can start off by adding the Stripe.net package to your project. dotnet add package Stripe.net You’ll then want to add your keys to your settings file. "Stripe": { "SecretKey": "sk_test_.....", "PublishableKey": "pk_test_......" }, You can then add the Stripe configuration to your Startup.cs file. This will allow for your Stripe configuration to be globally accessible in your application. public Startup(IConfiguration configuration) { Configuration = configuration; StripeConfiguration.SetApiKey(Configuration.GetSection("Stripe")["SecretKey"]); } Stripe API Customer Model You will want to create a model that represents the Customer object that you want to map to your Stripe Model. This will be used to set the parameters for creating a Stripe Customer. We will have an email, description, and MetaData for the customer. This can contain information like firstName and lastName. using System.Collections.Generic; namespace StripeCustomers.Models { public class Customer { public string Email { get; set; } public string Description { get; set; } public Dictionary<string, string> Metadata { get; set; } } } Customer Controller Now that we have our Model and Configuration set up, we can create our Controller for performing CRUD operations on our Customers. The first thing we’ll want to do is create an instance of our CustomerService for our controller. private readonly StripeCustomerService customerService; public CustomersController() { customerService = new StripeCustomerService(); } After that, we’ll be able to create out CRUD methods. [Route("api/customers")] public class CustomersController : Controller { private readonly StripeCustomerService customerService; public CustomersController() { customerService = new StripeCustomerService(); } // GET [HttpGet] public IEnumerable<StripeCustomer> Index() { StripeList<StripeCustomer> customerItems = customerService.List( new StripeCustomerListOptions() { Limit = 3 } ); return customerItems; } [HttpGet("{id}")] public StripeCustomer GetCustomer(string id) { var customer = customerService.Get(id); return customer; } [HttpPost] public StripeCustomer CreateCustomer([FromBody] Customer customerOptions) { var customerData = new StripeCustomerCreateOptions { Description = customerOptions.Description, Email = customerOptions.Email, Metadata = customerOptions.Metadata }; var customer = customerService.Create(customerData); return customer; } [HttpPut("{id}")] public StripeCustomer UpdateCustomer([FromRoute] string id, [FromBody] Customer customerOptions) { var customerData = new StripeCustomerUpdateOptions { Description = customerOptions.Description, Email = customerOptions.Email, Metadata = customerOptions.Metadata }; var customer = customerService.Update(id, customerData); return customer; } [HttpDelete("{id}")] public StripeDeleted DeleteCustomer(string id) { var result = customerService.Delete(id); return result; } } As you can see here, we use our Custom customer model map to the Customer Options that we want to modify for our customer. Once that’s done, you should now be able to go to your API to create and view customers. Stripe Get All Customers Stripe Create Customer Conclusion Platforms like Stripe allow for you to easily allow payment processing and customer management to your ASP.NET Core application. The platform is well documented and constantly maintained. If you’re interested in learning more, please review our video courses or check out our GitHub. We also have an article similar article using the Stripe API and Express.js.
https://codebrains.io/integrate-stripe-api-with-asp-net-core-creating-customers/
CC-MAIN-2019-35
en
refinedweb
Or: Taking a Picture Every 30 Seconds and Sending It To A Server.. One of the things I set out was the probe thermometer and 2 probes: one to measure the air temperature, and one to measure the internal temperature of the meat. Smoking is a low and slow method of cooking: you want to get the air temperature up to 225˚F and hold it there for hours as the meat slowly cooks and infuses with smoke. Smoking a pork shoulder (a.k.a. pulled-pork-to-be) can take 8 - 12 hours. Hence why I’m waking up at 7am. So where does React Native play into all this? Well, holding a temperature with a Weber kettle is a bit of a trick. And a manual one at that. There are 2 air vents you can tweak – one on top, one on the bottom. Open them up to increase the temperature, close them down to lower it. The fire takes a while to respond, though. It’s a fire, not a digital dial. So you, as the pit master, get to be a human PID controller for the day. What I mean is: you have to keep watching the temperature, adjusting the vents, and re-checking. If you’re good at it, you don’t have to tweak it much, but I’m a newb, so I’m out there a lot. I wanted to be able to know, without running out to the smoker every 15 minutes, whether the temperature was at 225˚F or close enough. This is where React Native comes in. At 9pm, after I’d laid out all the materials, I had the idea: I’ll make an app to take a picture of the thermometer every 30 seconds, and upload it to a server – and then I can just refresh a page instead of running down to the smoker! And before you tell me – yes, I know there are remote thermometers for sale that do exactly this. And yes, I also know I could’ve just sat outside with a beer all day watching the thing, and that would’ve been fun too. But really I just wanted an excuse to play with React Native :) Grand Plans: The System Layout Like any good project, I started off thinking about how I wanted it to work. I would need: - A phone with a camera (old iPhone 4S). - An app running on the phone to take pictures all day. - A server to receive the pictures, running on my laptop. - The same server to serve up the latest picture. I decided I wanted to keep this as minimal as possible (mostly because it was 9pm and I still needed to wake up at 7). There would be little to no security. There would be no websockets notifying a React app to download the latest image. This server would simply accept images, and send back the latest upon request. React Native You’ve probably heard of React Native - a framework for building native mobile apps using React and JS. If you can write React apps, you can figure out React Native pretty quickly. The core concepts are the same, just props and state. Since there’s no DOM behind React Native, though, there are some differences. Mainly, the HTML elements you know and love ( div, span, img, etc.) are replaced by React Native components ( div == View, span == Text, img == Image). Also, “real” CSS isn’t supported, but RN does support styling through inline styles. Flexbox layout and most normal styles like color and backgroundColor and the like will work. I noticed that some shorthand properties don’t work either: something like border: 1px solid red would instead be described explicitly, like { borderWidth: 1, borderColor: 'red' }. Expo Expo is a tool, and a platform, for building apps with React Native. One nice thing about using Expo is that it lets you deploy apps to your phone without signing up for an Apple Developer subscription (for us iPhone people anyway). I’ve read that you actually can get an app onto your phone without the Apple Developer subscription, but it requires messing with Xcode and that wasn’t something I wanted to tackle this evening. The other big bonus with Expo is that it comes with the Expo SDK which gives you a bunch of native APIs out of the box – like the accelerometer, compass, location, maps, and the most important one for this project: the camera. Install Expo on Computer and Phone I used the Expo command line but they also provide an IDE. If you want to follow along, install the Expo commandline tool with NPM or Yarn: npm install -g exp (Yes, it’s exp, not expo). Then you need to install the Expo app on your phone, and you can find that in the App Store / Play Store. Create the Project With the command line tool installed, run this command to create a new project: exp init grillview It’ll prompt for a template: choose the “blank” one. Then follow the provided instructions to start it up: $ cd grillview $ exp start At some point it will ask you to create an account with Expo. This is needed in order to deploy the app from your computer to Expo’s servers. Then the Expo app on your phone can load your app. Follow the instructions to send the URL to your device, or just type it in. Expo also lets you run this in a simulator, but I thought it’d be more fun with the real phone so that’s what I did. Once you’ve got it open on your phone, the developer experience is pretty nice. Change code, save, and the app will live reload (auto-refresh) automatically – just like developing locally with Create React App. There’s a small delay as it downloads the JS bundle each time. You can also enable hot reloading (no refresh) from Expo’s developer menu, which you can bring up if you shake your phone. Gently. Don’t throw it through a window or whatever. File Structure Expo sets us up with an App.js file in the root of the project, which exports the App component. Here’s the entirety of the generated app:', }, }); You’ll notice there’s a Text component inside the View. Try leaving the “Open up App.js…” text alone, but removing the wrapping Text component and see what happens. If you peek inside package.json you’ll see this line: "main": "node_modules/expo/AppEntry.js" This is what kicks off our app, and it expects to find an App.js file that exports the root component. If you wanted to reorganize the project structure, the first step would be to copy AppEntry.js into your project and modify it accordingly, but we’re gonna stick with defaults on this one. Using the Camera Permission Granted To take pictures, Expo provides a Camera component. But before we can use it, we need to ask for permission. Open up App.js, add a new import for the camera and permissions objects, and change the component to look like this: import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; // add this: import { Camera, Permissions } from 'expo'; export default class App extends React.Component { // initialize state state = { cameraPermission: null }; render() { const { cameraPermission } = this.state; // Render one of 3 things depending on permissions return ( <View style={styles.container}> {cameraPermission === null ? ( <Text>Waiting for permission...</Text> ) : cameraPermission === false ? ( <Text>Permission denied</Text> ) : ( <Text>yay camera</Text> )} </View> ); } } Now the app should render “Waiting for permission…” and just be stuck there, since we’re not doing anything yet. We’ll ask for permission in the componentDidMount lifecycle hook. Add that in: export default class App extends React.Component { ... componentDidMount() { Permissions.askAsync(Permissions.CAMERA) .then(({ status }) => this.setState({ cameraPermission: status === 'granted' }) ); } render() { ... } } When you save, and the app refreshes, you’ll see a dialog asking for camera permission. And once you allow it, the text should change. If this is your first time using Expo, it will probably ask for permissions for Expo itself before asking about your app. Live Camera View Now let’s replace the “yay camera” text with a component that will render the camera. Add a new component to App.js named Autoshoot. For now, it will just render the Camera, and we can make sure everything is working. class Autoshoot extends React.Component { render() { return ( <View style={{ flex: 1, width: '100%' }}> <Camera style={{ flex: 1 }} type={Camera.Constants.Type.back} ref={cam => this.camera = cam}> </Camera> </View> ); } We’re putting the Camera inside a View, giving both flex: 1 so they take up the entire height, and the width: '100%' so the View takes the entire screen (without the width set, you’ll see a blank screen: try it!). We’re using the “better” camera (on iPhone anyway – the back one, as opposed to the front selfie one). And we’re saving a ref to this camera component, because that’s how we’ll trigger the shutter in the next section. Now that this component exists, go back to the render method of App and replace the “yay camera” element with this Autoshoot component: render() { const { cameraPermission } = this.state; // Render one of 3 things depending on permissions return ( <View style={styles.container}> {cameraPermission === null ? ( <Text>Waiting for permission...</Text> ) : cameraPermission === false ? ( <Text>Permission denied</Text> ) : ( <Autoshoot/> )} </View> ); } Finally: Taking a Picture To trigger the shutter, we’ll put a “button” of sorts inside the Camera component. Unfortunately Camera doesn’t support the onPress prop (the one that gets triggered when you tap it), so we’ll import TouchableOpacity and render one of those inside. At the top, import it: import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'; And in Autoshoot’s render, insert the component as a child of Camera: render() { const { photo } = this.state; return ( <Camera style={{ flex: 1 }} type={Camera.Constants.Type.back} ref={cam => this.camera = cam}> <TouchableOpacity style={{ flex: 1 }} onPress={this.takePicture}/> </Camera> ); } Then we need a takePicture method, which we can insert above render: takePicture = () => { this.camera.takePictureAsync({ quality: 0.1, base64: true, exif: false }).then(photo => { this.setState({ photo }); }) } At this point, the app will behave the same: when you tap the screen, the app will still display the camera (and hopefully no errors). Next, we need to initialize the state of photo at the top: class Autoshoot extends React.Component { state = { photo: null } ... } Then inside render, we’ll either render the photo (if there is one) or the camera: render() { const { photo } = this.state; return ( <View style={{ flex: 1, width: '100%' }}> {photo ? ( <ImageBackground style={{ flex: 1 }} source={{ uri: photo.uri }} /> ) : ( <Camera style={{ flex: 1 }} onPress={this.takePicture} type={Camera.Constants.Type.back} ref={cam => this.camera = cam}> <TouchableOpacity style={{ flex: 1 }} onPress={this.takePicture}/> </Camera> )} </View> ); } We’re using the ImageBackground component for the first time here too, so make sure to import that at the top from ‘react-native’: import { StyleSheet, Text, View, TouchableOpacity, ImageBackground } from 'react-native'; There we go! Now you can tap the screen to take a picture, and it will stay up on the screen. Here’s a quick exercise for you: Make it so that when you tap the captured photo, the app goes back to displaying the Camera. Hint: ImageBackground doesn’t support onPress, so you’ll need to use the same trick we used with the TouchableOpacity. Taking Photos On a Timer We’ve got the code in place to take a picture manually – now let’s automate it. We can do this by essentially calling takePicture on an interval. But there’s a small problem: the camera needs a bit of time to focus before it takes the shot. So what we really need is something like this: - Activate camera (screen shows live camera) - Let it focus for 3 seconds - Take a picture (screen shows still image) - Wait 27 seconds - GOTO 1 And once we get that working, we’ll insert a step “3a”: send the picture to the server. (which doesn’t exist yet, but we’ll get to that in a bit) When Autoshoot initially renders, we’ll start a 30-second timer. Let’s create a constant for the timer, and the amount of time to focus, because we’ll need it in a few places. const PHOTO_INTERVAL = 30000; const FOCUS_TIME = 3000; class Autoshoot extends React.Component { componentDidMount() { this.countdown = setTimeout( this.takePicture, PHOTO_INTERVAL ); } componentWillUnmount() { clearInterval(this.countdown); } ... } And for testing purposes, just change the timeout to 2 seconds so we’re not waiting around all day. When the app reloads (which you can trigger manually by shaking your device, and choosing “Reload JS Bundle”), a photo will be taken automatically. Awesome. Start Another Timer Now that we’re taking a photo automatically, we just need a couple more timers to have it take photos all day long. There are a few ways to write this: we could do it with two stacked timers (one for 27 seconds, which then triggers one for 3 seconds), or we could do it with 2 simultaneous timers, or we could do it with setState callbacks. The latter option is probably the most precise (and avoids potential race conditions), but we’ll go with the easy option: 2 simultaneous timers. With the triggers this far apart, a race condition/overlapping timers is pretty unlikely. To make it work, replace takePicture with this implementation: takePicture = () => { this.camera.takePictureAsync({ quality: 0.1, base64: true, exif: false }).then(photo => { this.setState({ photo }); // In 27 seconds, turn the camera back on setTimeout(() => { this.setState({ photo: null }); }, PHOTO_INTERVAL - FOCUS_TIME); // In 30 seconds, take the next picture setTimeout(this.takePicture, PHOTO_INTERVAL); }); } Now when the app refreshes, it will take pictures for infinity. (or until your battery runs out) The Express Server We have the React Native app taking pictures now. Let’s work on building a server to send them to. We’re going to use Express to write a barebones server to handle two routes: POST /: Upload a new photo GET /: View the latest photo For this most simple of servers, we’re just gonna create a server.js file in the root of our grillview project. React Native and Express, side-by-side. (Is this a recommended way to create Real Projects™? Nah, but this whole thing is a bit of a hack, so.). We’ll need a couple packages to make this work, so install those now: yarn add express body-parser Then we can start with a barebones Express server. Create the server.js file and paste this in: const express = require('express'); const bodyParser = require('body-parser'); const app = express(); // If your phone has a modern camera (unlike my iPhone 4S) // you might wanna make this bigger. app.use(bodyParser.json({ limit: '10mb' })); // TODO: handle requests const port = process.env.PORT || 5005; app.listen(port); console.log(`Grill server listening on ${port}`); This won’t handle requests yet, but it will run. We have bodyparser.json in place to handle the POST’ed images. Now let’s add the POST request handler in place of the TODO: // Store the single image in memory. let latestPhoto = null; // Upload the latest photo for this session app.post('/', (req, res) => { // Very light error handling if(!req.body) return res.sendStatus(400); console.log('got photo') // Update the image and respond happily latestPhoto = req.body.image; res.sendStatus(200); }); This just accepts the image from the client and saves it in a local variable, to be returned later. Quick warning: this is doing nothing about security. We’re blindly saving something from the client and will parrot it back, which is a recipe for disaster in a deployed app. But since I’m only running it on my local network, I’m not too worried. For a real app, do some validation of the image before saving it. Underneath that we’ll add the GET handler that will send back the latest image: // View latest image app.get('/', (req, res) => { // Does this session have an image yet? if(!latestPhoto) { return res.status(404).send("Nothing here yet"); } console.log('sending photo'); try { // Send the image var img = Buffer.from(latestPhoto, 'base64'); res.writeHead(200, { 'Content-Type': 'image/png', 'Content-Length': img.length }); res.end(img); } catch(e) { // Log the error and stay alive console.log(e); return res.sendStatus(500); } }); We’re creating a buffer to convert the base64 image to binary, and then sending it to the client. And just to reiterate: this is not a secure setup. We’re assuming that the client sent us a good base64 image, but Rule 1 is “Don’t trust the client” – we should be validating the image before storing it. That’s all we need for the server! Start it up: node server.js Then visit – you should see the message “Nothing here yet”. Leave the server running in a separate command line terminal, and we’ll go work on sending images to the server. Uploading the Pictures Back in App.js and the Autoshoot component, we need to add a method for uploading the picture. In a larger app we might pull the API methods into a separate file and export them as individual functions – but since we only have the single call to make, we’ll put it in Autoshoot. Add this method: uploadPicture = () => { return fetch(SERVER_URL, { body: JSON.stringify({ image: this.state.photo.base64 }), headers: { 'content-type': 'application/json' }, method: 'POST' }) .then(response => response.json()) } Here we’re using fetch (which is built into React Native) to POST the data to the server. Notice the SERVER_URL variable, which we haven’t created yet. Since this will only be working on our local network, we can hard-code that above Autoshoot: const SERVER_URL = 'http://<your-ip>:5005/' Replace <your-ip> with your own dev machine’s IP address. If you don’t know where to find that, Google is your friend :) Now we’ll change takePicture to call uploadPicture, and as part of that change, we’ll pull out the timer code into a separate method because we want to call it from 2 places: // Here's the timer code, lifted from takePicture: queuePhoto = () => { // In 27 seconds, turn the camera back on setTimeout(() => { this.setState({ photo: null }); }, PHOTO_INTERVAL - FOCUS_TIME); // In 30 seconds, take the next picture setTimeout(this.takePicture, PHOTO_INTERVAL); } // Take the picture, upload it, and // then queue up the next one takePicture = () => { this.camera.takePictureAsync({ quality: 0.1, base64: true, exif: false }).then(photo => { this.setState({ photo }, () => { this.uploadPicture() .then(this.queuePhoto) .catch(this.queuePhoto); }); }); } Notice that I’m calling queuePhoto in both the .then and .catch handlers. I wanted the app to keep on chugging away even if I restarted the server (which will cause failed requests), so I just made it ignore errors entirely. During development it was helpful to add a console log in there to see why things were failing (syntax errors, etc), but I took it out once everything was working. Time to cook some pulled pork! With those last changes in place, the app is working! I was excited to try it out. The next morning, I set up the thermometer and the phone. Started up the app, aaand… hmm, there’s no good place to put the phone. I could’ve just put the phone and the thermometer on the ground. That’s what I should’ve done. What a reasonable person would do. 7am Dave did not do that. He grabbed an old board, cut 2 pieces of scrap wood, and fashioned it together into a little shelf leaned against the house. “Carpentry.” It has pocket screws. Why? I have no idea. As for the app? It performed admirably. Mostly. It only crashed a few times. It turned out to be pretty useful, and saved me a bunch of running up and down the stairs to check the temperature. A+++ would build again. And the pulled pork was delicious. Takeaways I think it’s important to work some fun into programming projects. Give yourself permission to build something that already exists, if only to learn how to build it yourself. It doesn’t have to be a big serious project, or a perfect portfolio piece. And on that note, don’t be afraid to hack things together. It’s a fun project! Write some terrible code that you know is terrible. Don’t stress so much about perfect abstractions and Best Practices and feeling like you have to incorporate every new library and tool. It’ll be fine. You can always refactor it when you write the blog post ;) Recipes, Tools, Code… You can get the full code for this project on Github. I followed Amazing Ribs’s Perfect Pulled Pork recipe. I used a Weber 22” Grill with a Slow n’ Sear (evidently discontinued, but I see there’s a v2 which looks similar). The thermometer is a ThermoWorks DOT. (no affiliate links, just good products)
https://daveceddia.com/perfect-pulled-pork-react-native-expo-express/
CC-MAIN-2019-35
en
refinedweb
Alexa.EventDetectionSensor Interface Support the Alexa.EventDetectionSensor interface so that your camera devices can notify Alexa when they detect the presence of a person. When your camera detects a person, you report that information to Alexa in a change report, and Alexa notifies your user. Users can set up notifications and routines for person detection in the Alexa app. By setting up person detection, users can reduce the number of notifications they receive when tracking all motion detection. You can also support the Alexa.MediaMetadata Interface to enable Alexa to search and display the media clip of the person that is detected. Users can ask Alexa questions like "Alexa, show the last person detected at my front door." Utterances When you use the Alexa.EventDetectionSensor and Alexa.MediaMetadata interfaces, the voice interaction model is already built for you. The following examples show some customer utterances: Alexa, show me the last time someone was at the front door. Alexa, show me the last time a person was detected at the front door. Alexa, show me the last person detected at the front door. Alexa, show me the most recent person at the front door. After the customer says one of these utterances, Alexa displays the media clip identified in the most recent change report sent by your skill. Properties The Alexa.EventDetectionSensor interface uses the humanPresenceDetectionState object as the primary data object. Human presence detection state details humanPresenceDetectionState example { "value": "DETECTED", "detectionMethods": ["VIDEO"], "media": { "type": "ALEXA.MEDIAMETADATA", "id": "<media metadata id>" } } Discovery You describe endpoints that support Alexa.EventDetectionSensor using the standard discovery mechanism described in Alexa.Discovery. Discovery payload details Discovery example The following example shows a Discover.Response message for a camera endpoint that supports Alexa.EventDetectionSensor and Alexa.MediaMetadata. { "event": { "header": { "namespace": "Alexa.Discovery", "name": "Discover.Response", "payloadVersion": "3", "messageId": "<message id>" }, "payload": { "endpoints":[ { "endpointId": "<unique ID of the endpoint>", "manufacturerName": "<the manufacturer name of the endpoint>", "modelName": "<the model name of the endpoint>", "friendlyName": "<device name, displayed in the Alexa app>", "description": "<a description that is shown in the Alexa app>", "displayCategories": ["CAMERA"], "cookie": {}, "capabilities": [ { "type": "AlexaInterface", "interface": "Alexa.EventDetectionSensor", "version": "3", "properties": { "supported": [ { "name": "humanPresenceDetectionState" } ], "proactivelyReported": true, "retrievable": false }, "configuration": { "detectionMethods": ["AUDIO", "VIDEO"], "detectionModes": { "humanPresence": { "featureAvailability": "ENABLED", "supportsNotDetected": false } } } }, { "type": "AlexaInterface", "interface": "Alexa.MediaMetadata", "version": "3", "proactivelyReported": true } ] } ] } } } AddOrUpdateReport You must proactively send an Alexa.Discovery.AddOrUpdateReport message if the feature support of your endpoint changes. For example, if human presence detection requires a subscription, your first discovery response indicates that the human presence detection feature is disabled. If the user buys a subscription, send an AddOrUpdateReport message to indicate that the human presence detection feature is now enabled. Also send an AddOrUpdateReport message if the user manually disables human presence detection. For more information, see AddOrUpdateReport. Change report You send a ChangeReport event to proactively report changes in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For more information about change reports, see Understand State Reporting. ChangeReport event with person detected example The following example shows a change report that you send when you detect a human presence. { "event": { "header": { "namespace": "Alexa", "name": "ChangeReport", "messageId": "<message id>", "payloadVersion": "3" }, "endpoint": { "scope": { "type": "BearerToken", "token": "<an OAuth2 bearer token>" }, "endpointId": "<endpoint id>" }, "payload": { "change": { "cause": { "type": "PHYSICAL_INTERACTION" }, "properties": [ { "namespace": "Alexa.EventDetectionSensor", "name": "humanPresenceDetectionState", "value": { "value": "DETECTED", "detectionMethods": ["VIDEO"], "media": { "type": "ALEXA.MEDIAMETADATA", "id": "<media metadata id>" } }, "timeOfSample": "2017-02-03T16:20:50.52Z", "uncertaintyInMilliseconds": 0 } ] } } }, "context": {} }
https://developer.amazon.com/es/docs/device-apis/alexa-eventdetectionsensor.html
CC-MAIN-2019-35
en
refinedweb
Strategy Library Momentum Effect in Stocks in Small Portfolios Introduction The main reason for the momentum anomaly is the behavioral biases of the investor like underreaction and confirmation bias. Momentum strategy usually uses portfolios filled by thousands of stocks to compute the momentum factor return. This is not possible for small retail investors with small portfolios. They are constrained compared to big hedge funds and cannot diversify so well. In this tutorial, we'll construct a small portfolio consisting of up to 50 stocks to check the effect of momentum. Method The investment universe consists of all US listed companies. Stocks which have no fundamental data are ruled out from the universe. def CoarseSelectionFunction(self, coarse): if self.yearly_rebalance: # drop stocks which have no fundamental data self.filtered_coarse = [x.Symbol for x in coarse if (x.HasFundamentalData)] return self.filtered_coarse else: return [] In FineSelectionFunction, stocks with the lowest market capitalization (25% of the universe) are excluded due to low liquidity. The momentum is defined as the stock market return over the previous 12 months. Momentum profits are calculated by ranking companies on the basis of yearly return. The ranking period is one year. def FineSelectionFunction(self, fine): if self.yearly_rebalance: # Calculate the yearly return and market cap.75)] has_return = [] for i in top_market_cap: history = self.History([i.Symbol], timedelta(days=365), Resolution.Daily) if not history.empty: close = history.loc[str(i.Symbol)]['close'] i.returns = (close[0]-close[-1])/close[-1] has_return.append(i) sorted_by_return = sorted(has_return, key = lambda x: x.returns) self.long = [i.Symbol for i in sorted_by_return[-10:]] self.short = [i.Symbol for i in sorted_by_return[:10]] return self.long+self.short else: return [] The investor goes long in the ten stocks with the highest performance and goes short in the ten stocks with the lowest performance. The portfolio is equally weighted and rebalanced yearly. def OnData(self, data): if not self.yearly_rebalance: return if self.long and self.short: stocks_invested = [x.Key for x in self.Portfolio if x.Value.Invested] # liquidate stocks not in the trading list for i in stocks_invested: if i not in self.long+self.short: self.Liquidate(i) for i in self.short: self.SetHoldings(i, -0.5/len(self.short)) for i in self.long: self.SetHoldings(i, 0.5/len(self.long)) self.long = None self.short = None self.yearly_rebalance = False You can also see our Documentation and Videos. You can also get in touch with us via Chat.
https://www.quantconnect.com/tutorials/strategy-library/momentum-effect-in-stocks-in-small-portfolios
CC-MAIN-2019-35
en
refinedweb
Tim Daneliuk wrote: > I am a bit confused. I was under the impression that: > > class foo(object): > x = 0 > y = 1 > > means that x and y are variables shared by all instances of a class. What it actually does is define names with the given values *in the class namespace*. > But when I run this against two instances of foo, and set the values > of x and y, they are indeed unique to the *instance* rather than the > class. > I imagine here you are setting instance variables, which then *mask* the presence of class variables with the same name, because "self-relative" name resolution looks in the instance namespace before it looks in the class namespace. > It is late and I am probably missing the obvious. Enlightenment > appreciated ... You can refer to class variables using the class name explicitly, both within methods and externally: >>> class X: ... count = 0 ... def getCt(self): ... return self.count ... def inc(self): ... self.count += 1 ... >>> x1 = X() >>> x2 = X() >>> id(x1.count) 168378284 >>> x1.inc() >>> id(x1.count) 168378272 >>> id(x2.count) 168378284 >>> id(X.count) 168378284 >>> x1.getCt() 1 >>> x2.getCt() 0 >>> regards Steve -- Steve Holden Python Web Programming Holden Web LLC +1 703 861 4237 +1 800 494 3119
https://mail.python.org/pipermail/python-list/2005-January/353055.html
CC-MAIN-2019-35
en
refinedweb
The Samba-Bugzilla – Bug 13121 Non-smbd processes using kernel oplocks can hang smbd. Last modified: 2017-11-15 11:57:25 UTC Currently smbd tries a non-blocking open for a kernel oplock if there is no smbd open record the *first* time it gets a EWOULDBLOCK error from the kernel. Subsequent opens try non-blocking. This is incorrect. Without inter-process communication from the non-smbd process the best we can do is to try non-blocking opens every <poll> time-periods (where my heuristic is poll=1 second) until either the break timeout period expires of we get success. Patch to follow. Arg. The above comment should say: "Subsequent opens try a blocking open" of course. Created attachment 13763 [details] git-am fix for master. Includes regression test case. NB. The patch attached to bug: must be applied first. Generally looks good. This is not a formal review yet, I'd like to take a closer look tomorrow. One thing that itches me is: anyone actually bothered testing whether we call poll that damn oplocked fd? My regression test patch tests that case doesn't it ? If you run at debug level 10 you can certainly see the smbd polling for an allowed open every 1 second. Or am I not understanding your test case ? (In reply to Jeremy Allison from comment #4) poll as in poll()? I don't see that in the test, but maybe I'm missing something. I'll take a closer look tomorrow. I don't understand. Who would call poll() ? The test code forks, then the child process takes the oplock locally and just waits for a signal from the kernel using pause(). The parent client process uses smb2 calls to drive the smbd server to request an open on the oplocked file. That then causes pause() to return (got a signal) and we check it was a RT_SIGNAL meaning the oplock was requested to be broken. The child process waits 3 seconds to allow the parent to check that the requesting smbd isn't blocked by doing another SMB2_CREATE request, then just removes the lease and exits. Who needs to poll() ? Are you confused by my initial comment where I say: "the best we can do is to try non-blocking opens every <poll> time-periods (where my heuristic is poll=1 second)" ? I don't mean poll() the system call here, but poll in the generic English "polling for a change" sense. And yeah, I tested that the smbd does do the check every 1 second whilst the non-smbd process has the file oplocked. I did this by doing a debug level 10 and counting the number of: DBG_DEBUG("kernel_oplock_poll_open_timer fired. Retying open !\n"); message I got from the timer firing. And yeah, it was correct :-). I meant what I asked: can we poll() a file fd such that when poll() indicates readability the kernel oplock was released by the other process. That would give us a signalling mechanism and we don't have to do a sleep/retry dance. This is not about the test, if that worked we could use it in smbd. I guess it does not work, but I was wondering if anyone ever actually tested this. Sadly no, I don't believe that works. I think a periodic wakeup and retry is the best we can do. I'm happy to write test code and check though once I'm dug out of my current work hole :-). In the meantime, I still think my patch is good :-). (In reply to Jeremy Allison from comment #9) Thinking about it some, that *can't* work. Remember, we don't even get an fd to poll on until the open completes. We just get -1, EWOULDBLOCK back when trying to open the leased file. So yep, doing a 1 second check is the best we can do without cooperation from the holding process. Cheer up, I've done worse things in Samba in the past :-). (In reply to Jeremy Allison from comment #10) Wuahahaha, I shouldn't come up with clever ideas late at night! :))) Comment on attachment 13763 [details] git-am fix for master. Lgtm & pushed. Created attachment 13775 [details] git-am fix for 4.7.next. Cherry-picked from master. Created attachment 13776 [details] git-am fix for 4.6.next. Back-port from master. Reassigning to Karolin for inclusion in 4.6 and 4.7. (In reply to Ralph Böhme from comment #15) Pushed to autobuild-v4-{7,6}-test. (In reply to Karolin Seeger from comment #16) Pushed to both branches. Closing out bug report. Thanks!
https://bugzilla.samba.org/show_bug.cgi?id=13121
CC-MAIN-2019-35
en
refinedweb
An implementation of cucumber using the cucumber wire protocol. There are several ways to use this package. For a regular use setup a dart project and add this package as a dependency: name: my_cucumber_features dependency: cucumber_wire: any Then setup your features folder containing a .feature file and a step_definitions folder, in which you add a dart_server.wire file including the following content: host: localhost port: 9090 Add a step definition dart file which registers the scenarios (ex: features/step_definitions/definitions.dart). The cucumber_wire package exports the package:matcher/matcher.dart so matcher are directly available as well as a simple expect function. // You may import further tests import 'package:cucumber_wire/cucumber_wire.dart';() { // ... } } Start the cucumber_wire server using pub run pointing to your entry point file. pub run cucumber_wire features/step_definitions/definitions.dart Afterwards start your cucumber runner: cucumber -f pretty Scenario classes contain methods which define steps. These steps are annotated with @Then, @And, @Given and @When. The name of the method is not relevant. Within the step annotations a regular expression string is defined, which will be extended by the scenario loader when the scenario is added to registerStepDefinitions, meaning the original expression string: It's a ([a-z]+) will be turned into ^It's a ([a-z]+), to make it a valid expression and save some overhead. The matches of the regular expression are than passed to the method as parameters when the step is executed, meaning there need to be at least the same number of parameters for a method than potential matches within the pattern. If the parameter type is not of type string, the runner will try to convert the passed value from cucumber into the proper dart type, which is currently only supported for bool (string == "true"), int, double and num. The scenario needs to have at least one default named constructor (or no constructor at all) in order for the runner to initiate an instance of the scenario.() { // ... } } It's not necessary to always write matchers as regular expression. The built-in parameter types of cucumber are supported as well: Currently worlds should be defined as abstract class and shared across scenarios using inheritance. If variables of a world should be initiated only once use getters which refer to a static property of the world. // Example scenario with multiple worlds. class MyScenario1 extends DriverWorld with MagicWorld { @When('I open the browser at (.*)') void openTheBrowser(String url) => driver.get(url); @And('I activate magic') void activateMagic() => isActive = true; @Then('all is good') void allIsGood() => expect(allGood, isTrue); } class MyScenario2 extends DriverWorld {} // A world abstract class DriverWorld { // Static property so each instance of DriverWorld shares the driver. static WebDriver _driver; // This getter checks whether _driver is not null, if it is null the initiation expression is executed. WebDriver get driver => _driver ??= createDriver(); @afterAll void closeDriver() { _driver?.close(); _driver = null; } } abstract class MagicWorld { // Example of getter and setter usage. static bool _isActive = false; bool get isActive => _isActive; set isActive(bool active) { assert(_isActive != active, 'Active cannot be set to the same value twice, something went wrong.'); _isActive = active; } // Static variable can also be used instantly static bool allGood = true; } Note: This is a proposal and not yet implemented. Worlds should be provided by dependency injection. void main(_, port) { registerStepDefinitions(port, [ TestScenario, ], providers: [ TestWorld, ]); } class TestScenario { final TestWorld world; TestScenario(this.world); } class TestWorld {} Plugins help to provide further details to a step definition method and do steps before executing the method. Plugins are imported within the step definition and as such can be defined outside of this package. A possible first implementation of a plugin could be cucumber_wire_webdriver which is currently available in features/step_definitions/driver.dart. A plugin contains a method apply which is called for each step parameter which is not defined by the expression before the method is called. @When('I open the browser at (.*)') void openTheBrowserAt(String url, String thisParameterIsForPlugin) {} The first plugin in the list of registered plugins within registerStepDefinitions which returns an other value than null in it's apply method is used. The apply method receives a ParameterMirror which is used to gather the information of the parameter and as a second argument the instance of the scennario class which contains the method. Therefore the instance of the scenario can be used to gather further information or execute additional steps (which at this point may only be synchronous). An example for a plugin can be seen below, which enables an annotation for parameters to use the WebDriver to fetch a WebElement using a CSS selector, where the instance of the scenario needs to inherit the Driver world. /// Example plugin to support build in annotations for CssSelectors. class ByCssSelectorPlugin extends SuitePlugin<Driver, WebElement> { final _by = reflectClass(By); @override WebElement apply(ParameterMirror mirr, Driver instance) { final selector = _selector(mirr); if (selector != null) { return instance.driver.findElement(selector); } return null; } By _selector(ParameterMirror mirr) { for (final meta in mirr.metadata) { if (meta.type.isAssignableTo(_by)) { return meta.reflectee; } } return null; } } After registering the plugin to the registerStepDefinitions function, it's available to all scenarios registered within the same function as well. void main(_, SendPort sendPort) { registerStepDefinitions(sendPort, [ TestScenario ], plugins: [ ByCssSelectorPlugin(), ]); } class TestScenario extends Driver { @Then(r'I see the download button with text "([A-Za-z\s+]+)"') void openTheBrowser( String text, @By.cssSelector('.install-download') WebElement button) { expect(button.text, text); } } This tool generates the step definition method code based on a provided sentence. Usage: pub run cucumber_wire:add_definition [options] "<sentence>" [target_file] [target_line] Where <sentence> needs to start with either Given, And, Then or When. -a, --[no-]async Defines that the step definition should be asynchronous -h, --[no-]help Shows this usage message. Define it as an external tool within intellij to enable a smooth experience directly in the IDE. This package is using the cucumber wire protocol to support a dart implementation of cucumber. Therefore a TCP server is started which listens for instructions provided by cucumber when it's started using a .wire configuration file within the step_definitions folder. The dart process which starts the TCP server also spawns an isolate with the given path to the step definitions dart implementation. The isolate uses reflection to detect all step definitions ( @Given, @Then, @When, @And, @after, ...) which are defined within scenarios passed to registerStepDefinitions within the main function. Because the step definition dart file is spawned using an isolate it receives a SendPort as the second argument to the main function, which is passed to registerStepDefinitions which is responsible for the communication between the isolate and parent dart isolate which spawned the TCP server. When the TCP server receives instructions from the cucumber client it forwards them to the isolate which either: @afterAll, @beforeAll, @before, @after) The implementation which spawns the isolate comes with some features, like change detection and reloading of the isolate. @afterAll, @beforeAllmethods on worlds might be executed multiple times, therefore add a bool check whether the method was already executed otherwise skip function. Null operators help in this case _driver ??= createDriver(). _driver?.close(); _driver = null;. package:test. pub run cucumberand providing a debug port. @Then('Button label :label should :equal')) Add this to your package's pubspec.yaml file: dependencies: cucumber_wire: ^0.1.0+1 You can install packages from the command line: with pub: $ pub get Alternatively, your editor might support pub get. Check the docs for your editor to learn more. Now in your Dart code, you can use: import 'package:cucumber_wire/cucumber_wire.dart'; We analyzed this package on Aug 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using: Detected platforms: other Primary library: package:cucumber_wire/cucumber_wire.dartwith components: isolate, mirrors. Fix bin/add_definition.dart. (-0.50 points) Analysis of bin/add_definition.dart reported 1 hint: line 27 col 16: Avoid empty catch blocks. Fix bin/cucumber_wire.dart. (-0.50 points) Analysis of bin/cucumber_wire.dart reported 1 hint: line 11 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic. Fix lib/cucumber_wire.dart. (-0.50 points) Analysis of lib/cucumber_wire.dart reported 1 hint: line 17 col 67: The library 'package:cucumber_wire/src/frontend/frontend.dart' doesn't export a member with the shown name 'expect'. Fix lib/src/server/wire_server.dart. (-0.50 points) Analysis of lib/src/server/wire_server.dart reported 1 hint: line 27 col 50: This function has a return type of 'FutureOr Provide a file named CHANGELOG.md. (-20 points) Maintain an example. (-10 points) Create a short demo in the example/ directory to show how to use this package. Common filename patterns include main.dart, example.dart, and cucumber_wire.dart. Packages with multiple examples should provide example/README.md. For more information see the pub package layout conventions.
https://pub.dev/packages/cucumber_wire
CC-MAIN-2019-35
en
refinedweb
The first step towards creating custom widgets in PyQt6 is understanding bitmap (pixel-based) graphic operations. All standard widgets draw themselves as bitmaps on a rectangular "canvas" that forms the shape of the widget. Once you understand how this works you can draw any widget you like! A bitmap is a rectangular grids of pixels, where each pixel is stored individually as a number of bits. Contrast with vector graphics, where the image is stored as a series of drawing instructions which are repeated to form the image. In this tutorial we'll take a look at QPainter — Qt's API for performing bitmap graphic operations and the basis for drawing your own widgets. We'll go through some basic drawing operations and finally put it all together to create our own little Paint app. QPainter Bitmap drawing operations in Qt are handled through the QPainter class. This is a generic interface which can be used to draw on various surfaces including, for example, QPixmap. To make this easy to demonstrate we'll be using the following stub application which handles creating our container (a QLabel), creating a pixmap canvas, displaying that in the container and adding the container to the main window..draw_something() def draw_something(self): painter = QtGui.QPainter(self.label.pixmap()) painter.drawLine(10, 10, 300, 200) painter.end() app = QtWidgets.QApplication(sys.argv) window = MainWindow() window.show() app.exec_() Why do we use QLabel to draw on? The QLabel widget can also be used to show images, and it's the simplest widget available for displaying a QPixmap. Save this to a file and run it and you should see the following — a single black line inside the window frame — A single black line on the canvas. All the drawing occurs within the draw_something method — we create a QPainter instance, passing in the canvas ( self.label.pixmap()) and then issue a command to draw a line. Finally we call .end() to close the painter and apply the changes. You would usually also need to call .update() to trigger a refresh of the widget, but as we're drawing before the application window is shown a refresh is already going to occur. Drawing primitives QPainter provides a huge number of methods for drawing shapes and lines on a bitmap surface (in 5.12 there are 192 QPainter specific non-event methods). The good news is that most of these are overloaded methods which are simply different ways of calling the same base methods. For example, there are 5 different drawLine methods, all of which draw the same line, but differ in how the coordinates of what to draw are defined. If you're wondering what the difference is between a QLine and a QLineF , the latter has its coordinates specified as float. This is convenient if you have float positions as the result of other calculations, but otherwise not so much. Ignoring the F-variants, we have 3 unique ways to draw a line — with a line object, with two sets of coordinates (x1, y1), (x2, y2) or with two QPoint objects. When you discover that a QLine itself is defined as QLine(const QPoint & p1, const QPoint & p2)or QLine(int x1, int y1, int x2, int y2)you see that they are all in fact, exactly the same thing. The different call signatures are simply there for convenience. Given the x1, y1, x2, y2 coordinates, the two QPoint objects would be defined as QPoint(x1, y1) and QPoint(x2, y2). Leaving out the duplicates we have the following draw operations — drawArc , drawChord, drawConvexPolygon, drawEllipse, drawLine, drawPath, drawPie, drawPoint, drawPolygon, drawPolyline, drawRect, drawRects and drawRoundedRect. To avoid get overwhelmed we'll focus first on the primitive shapes and lines first and return to the more complicated operations once we have the basics down. For each example, replace the draw_something method in your stub application and re-run it to see the output. drawPoint This draws a point, or pixel at a given point on the canvas. Each call to drawPoint draws one pixel. Replace your draw_something code with the following. def draw_something(self): painter = QtGui.QPainter(self.label.pixmap()) painter.drawPoint(200, 150) painter.end() If you re-run the file you will see a window, but this time there is a single dot, in black in the middle of it. You'll probably need to move the window around to spot it. Drawing a single point (pixel) with QPainter That really isn't much to look at. To make things more interesting we can change the color and size of the point we're drawing. In PyQt the color and thickness of lines is defined using the active pen on the QPainter. You can set this by creating a QPen instance and applying it. def draw_something(self): painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(40) pen.setColor(QtGui.QColor('red')) painter.setPen(pen) painter.drawPoint(200, 150) painter.end() This will give the following mildly more interesting result.. A big red dot. You are free to perform multiple draw operations with your QPainter until the painter is ended. Drawing onto the canvas is very quick — here we're drawing 10k dots at random. def draw_something(self): from random import randint painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(3) painter.setPen(pen) for n in range(10000): painter.drawPoint( 200+randint(-100, 100), # x 150+randint(-100, 100) # y ) painter.end() The dots are 3 pixel-width and black (the default pen). 10k 3-pixel dots on a canvas You will often want to update the current pen while drawing — e.g. to draw multiple points in different colors while keeping other characteristics (width) the same. To do this without recreating a new QPen instance each time you can get the current active pen from the QPainterusing pen = painter.pen(). You can also re-apply an existing pen multiple times, changing it each time. def draw_something(self): from random import randint, choice colors = ['#FFD141', '#376F9F', '#0D1F2D', '#E9EBEF', '#EB5160'] painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(3) painter.setPen(pen) for n in range(10000): # pen = painter.pen() you could get the active pen here pen.setColor(QtGui.QColor(choice(colors))) painter.setPen(pen) painter.drawPoint( 200+randint(-100, 100), # x 150+randint(-100, 100) # y ) painter.end() Will produce the following output — Random pattern of 3 width dots There can only ever be one QPen active on a QPainter — the current pen. That's about as much excitement as you can have drawing dots onto a screen, so we'll move on to look at some other drawing operations. drawLine We already drew a line on the canvas at the beginning to test things are working. But what we didn't try was setting the pen to control the line appearance. def draw_something(self): from random import randint painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(15) pen.setColor(QtGui.QColor('blue')) painter.setPen(pen) painter.drawLine( QtCore.QPoint(100, 100), QtCore.QPoint(300, 200) ) painter.end() In this example we're also using QPoint to define the two points to connect with a line, rather than passing individual x1, y1, x2, y2 parameters — remember that both methods are functionally identical. A thick blue line drawRect, drawRects and drawRoundedRect These functions all draw rectangles, defined by x, y coordinates and a width and height of the rectangle, or by QRect or QRectF instances which provide the equivalent information. def draw_something(self): from random import randint painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(3) pen.setColor(QtGui.QColor("#EB5160")) painter.setPen(pen) painter.drawRect(50, 50, 100, 100) painter.drawRect(60, 60, 150, 100) painter.drawRect(70, 70, 100, 150) painter.drawRect(80, 80, 150, 100) painter.drawRect(90, 90, 100, 150) painter.end() A square is just a rectangle with the same width and height. Drawing rectangles You can also replace the multiple calls to drawRect with a single call to drawRects passing in multiple QRect objects. This will produce exactly the same result. painter.drawRects( QtCore.QRect(50, 50, 100, 100), QtCore.QRect(60, 60, 150, 100), QtCore.QRect(70, 70, 100, 150), QtCore.QRect(80, 80, 150, 100), QtCore.QRect(90, 90, 100, 150), ) Drawn shapes can be filled in PyQt by setting the current active painter brush, passing in a QBrush instance to painter.setBrush(). The following example fills all rectangles with a patterned yellow color. def draw_something(self): from random import randint painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(3) pen.setColor(QtGui.QColor("#376F9F")) painter.setPen(pen) brush = QtGui.QBrush() brush.setColor(QtGui.QColor("#FFD141")) brush.setStyle(Qt.BrushStyle.Dense1Pattern) painter.setBrush(brush) painter.drawRects( QtCore.QRect(50, 50, 100, 100), QtCore.QRect(60, 60, 150, 100), QtCore.QRect(70, 70, 100, 150), QtCore.QRect(80, 80, 150, 100), QtCore.QRect(90, 90, 100, 150), ) painter.end() Filled rectangles As for the pen, there is only ever one brush active on a given painter, but you can switch between them or change them while drawing. There are a number of brush style patterns available. You'll probably use Qt.SolidPattern more than any others though. You must set a style to see any fill at all as the default is Qt.NoBrush The drawRoundedRect methods draw a rectangle, but with rounded edges, and so take two extra parameters for the x & y radius of the corners. def draw_something(self): from random import randint painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(3) pen.setColor(QtGui.QColor("#376F9F")) painter.setPen(pen) painter.drawRoundedRect(40, 40, 100, 100, 10, 10) painter.drawRoundedRect(80, 80, 100, 100, 10, 50) painter.drawRoundedRect(120, 120, 100, 100, 50, 10) painter.drawRoundedRect(160, 160, 100, 100, 50, 50) painter.end() Rounded rectangles. There is an optional final parameter to toggle between the x & y ellipse radii of the corners being defined in absolute pixel terms Qt.RelativeSize (the default) or relative to the size of the rectangle (passed as a value 0…100). Pass Qt.RelativeSize to enable this. drawEllipse The final primitive draw method we'll look at now is drawEllipse which can be used to draw an ellipse or a circle. A circle is just an ellipse with an equal width and height. def draw_something(self): from random import randint painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(3) pen.setColor(QtGui.QColor(204,0,0)) # r, g, b painter.setPen(pen) painter.drawEllipse(10, 10, 100, 100) painter.drawEllipse(10, 10, 150, 200) painter.drawEllipse(10, 10, 200, 300) painter.end() In this example drawEllipse is taking 4 parameters, with the first two being the x & y position of the top left of the rectangle in which the ellipse will be drawn, while the last two parameters are the width and height of that rectangle respectively. Drawing an ellipse with x, y, width, height or QRect. You can achieve the same by passing in a QRect There is another call signature which takes the centre of the ellipse as the first parameter, provided as QPoint or QPointF object, and then a x and y radius. The example below shows it in action. painter.drawEllipse(QtCore.QPoint(100, 100), 10, 10) painter.drawEllipse(QtCore.QPoint(100, 100), 15, 20) painter.drawEllipse(QtCore.QPoint(100, 100), 20, 30) painter.drawEllipse(QtCore.QPoint(100, 100), 25, 40) painter.drawEllipse(QtCore.QPoint(100, 100), 30, 50) painter.drawEllipse(QtCore.QPoint(100, 100), 35, 60) Drawing an ellipse using Point & radius. You can fill ellipses by setting QBrush just as for filling rectangles, the same features for style and color are available. Text Finally, we'll take a brief tour through the QPainter text drawing methods. To control the current font on a QPainter you use setFont passing in a QFont instance. With this you can control the family, weight and size (among other things) of the text you write. However, the color of the text is still defined using the current pen. def draw_something(self): from random import randint painter = QtGui.QPainter(self.label.pixmap()) pen = QtGui.QPen() pen.setWidth(1) pen.setColor(QtGui.QColor('green')) painter.setPen(pen) font = QtGui.QFont() font.setFamily('Times') font.setBold(True) font.setPointSize(40) painter.setFont(font) painter.drawText(100, 100, 'Hello, world!') painter.end() You can also specify location with QPoint or QPointF. The width of the pen has no effect on the appearance of the text. Bitmap text hello world example. There are also methods for drawing text within a specified area. Here the parameters define the x & y position and the width & height of the bounding box. Text outside this box is clipped (hidden). The 5th parameter flags can be used to control alignment of the text within the box among other things. painter.drawText(100, 100, 100, 100, Qt.AlignHCenter, 'Hello, world!') Bounding box clipped on drawText. You have complete control over the display of text by setting the active font on the painter via a QFont object. Check out the QFont documentation for more information. To support developers in [[ countryRegion ]] I give a [[ localizedDiscount[couponCode] ]]% discount with the code [[ couponCode ]] — Enjoy! For [[ activeDiscount.description ]] I'm giving a [[ activeDiscount.discount ]]% discount with the code [[ couponCode ]] — Enjoy! A bit of fun with QPainter That got a bit heavy, so let's take a breather and make something fun. So far we've been programmatically defining draw operations to perform. But we can just as easily draw in response to user input — for example allowing a user to scribble all over the canvas. In this part we'll take what we've learned so far and use it to build a rudimentary Paint app. We can start with the same simple application outline, adding a mouseMoveEvent handler to the MainWindow class in place of our draw method. Here we'll take the current position of the user's mouse and plot a point on the canvas.) def mouseMoveEvent(self, e): painter = QtGui.QPainter(self.label.pixmap()) painter.drawPoint(e.x(), e.y()) painter.end() self.update() app = QtWidgets.QApplication(sys.argv) window = MainWindow() window.show() app.exec_() Why no click event? Widgets by default only receive mouse move events when a mouse button is pressed, unless mouse tracking is enabled. This can be configured using the .setMouseTracking method — setting this to True (it is False by default) will track the mouse continuously. If you save this and run it you should be able to move your mouse over the screen and click to draw individual points. It should look something like this — Drawing individual mouseMoveEvent points. The issue here is that when you move the mouse around quickly it actually jumps between locations on the screen, rather than moving smoothly from one place to the next. The mouseMoveEventis fired for each location the mouse is in, but that's not enough to draw a continuous line, unless you move very slowly. The solution to this is to draw lines instead of points. On each event we simply draw a line from where we were (previous e.x() and e.y()) to where we are now (current e.x() and e.y()). We can do this by tracking last_x and last_y ourselves. We also need to forget the last position when releasing the mouse, or we'll start drawing from that location again after moving the mouse across the page — i.e. we won't be able to break the line..last_x, self.last_y = None, None def mouseMoveEvent(self, e): if self.last_x is None: # First event. self.last_x = e.x() self.last_y = e.y() return # Ignore the first time. painter = QtGui.QPainter(self.label.pixmap()) painter.drawLine(self.last_x, self.last_y, e.x(), e.y()) painter.end() self.update() # Update the origin for next time. self.last_x = e.x() self.last_y = e.y() def mouseReleaseEvent(self, e): self.last_x = None self.last_y = None app = QtWidgets.QApplication(sys.argv) window = MainWindow() window.show() app.exec_() If you run this you should be able to scribble on the screen as you would expect. Drawing with the mouse, using a continuous line. It's still a bit dull, so let's add a simple palette to allow us to change the pen color. This requires a bit of re-architecting. So far we've using the mouseMoveEvent on the QMainWindow . When we only have a single widget in the window this is fine — as long as you don't resize the window larger than the widget (did you try that?), the coordinates of the container and the single nested widget line up. However, if we add other widgets to the layout this won't hold — the coordinates of the QLabel will be offset from the window, and we'll be drawing in the wrong location. This is easily fixed by moving the mouse handling onto the QLabel itself— it's event coordinates are always relative to itself. This we wrap up as an custom Canvas object, which handles the creation of the pixmap surface, sets up the x & y locations and the holds the current pen color (set to black by default). This self-contained Canvas is a drop-in drawable surface you could use in your own apps. import sys from PyQt6 import QtCore, QtGui, QtWidgets, uic from PyQt6.QtCore import Qt class Canvas(QtWidgets.QLabel): def __init__(self): super().__init__() pixmap = QtGui.QPixmap(600, 300) self.setPixmap(pixmap) self.last_x, self.last_y = None, None self.pen_color = QtGui.QColor('#000000') def set_pen_color(self, c): self.pen_color = QtGui.QColor(c) def mouseMoveEvent(self, e): if self.last_x is None: # First event. self.last_x = e.x() self.last_y = e.y() return # Ignore the first time. painter = QtGui.QPainter(self.pixmap()) p = painter.pen() p.setWidth(4) p.setColor(self.pen_color) painter.setPen(p) painter.drawLine(self.last_x, self.last_y, e.x(), e.y()) painter.end() self.update() # Update the origin for next time. self.last_x = e.x() self.last_y = e.y() def mouseReleaseEvent(self, e): self.last_x = None self.last_y = None For the color selection we're going to build a custom widget, based off QPushButton. This widget accepts a color parameter which can be a QColour instance, or a color name ('red', 'black') or hex value. This color is set on the background of the widget to make it identifiable. We can use the standard QPushButton.pressed signal to hook it up to any actions. COLORS = [ # 17 undertones '#000000', '#141923', '#414168', '#3a7fa7', '#35e3e3', '#8fd970', '#5ebb49', '#458352', '#dcd37b', '#fffee5', '#ffd035', '#cc9245', '#a15c3e', '#a42f3b', '#f45b7a', '#c24998', '#81588d', '#bcb0c2', '#ffffff', ] class QPaletteButton(QtWidgets.QPushButton): def __init__(self, color): super().__init__() self.setFixedSize(QtCore.QSize(24,24)) self.color = color self.setStyleSheet("background-color: %s;" % color) With those two new parts defined, we simply need to iterate over our list of colors, create a QPaletteButton passing in the color, connect its pressed signal to the set_pen_color handler on the canvas (indirectly through a lambda to pass the additional color data) and add it to the palette layout. class MainWindow(QtWidgets.QMainWindow): def __init__(self): super().__init__() self.canvas = Canvas() w = QtWidgets.QWidget() l = QtWidgets.QVBoxLayout() w.setLayout(l) l.addWidget(self.canvas) palette = QtWidgets.QHBoxLayout() self.add_palette_buttons(palette) l.addLayout(palette) self.setCentralWidget(w) def add_palette_buttons(self, layout): for c in COLORS: b = QPaletteButton(c) b.pressed.connect(lambda c=c: self.canvas.set_pen_color(c)) layout.addWidget(b) app = QtWidgets.QApplication(sys.argv) window = MainWindow() window.show() app.exec_() This should give you a fully-functioning multicolor paint application, where you can draw lines on the canvas and select colors from the palette. Unfortunately, it doesn't make you a good artist. Spray For a final bit of fun you can switch out the mouseMoveEvent with the following to draw with a "spray can" effect instead of a line. This is simulated using random.gauss to generate a series of normally distributed dots around the current mouse position which we plot with drawPoint. def mouseMoveEvent(self, e): painter = QtGui.QPainter(self.pixmap()) p = painter.pen() p.setWidth(1) p.setColor(self.pen_color) painter.setPen(p) for n in range(SPRAY_PARTICLES): xo = random.gauss(0, SPRAY_DIAMETER) yo = random.gauss(0, SPRAY_DIAMETER) painter.drawPoint(e.x() + xo, e.y() + yo) self.update() Define the SPRAY_PARTICLES and SPRAY_DIAMETER variables at the top of your file and import the random standard library module. The image below shows the spray behaviour when using the following settings: import random SPRAY_PARTICLES = 100 SPRAY_DIAMETER = 10 For the spray can we don't need to track the previous position, as we always spray around the current point. If you want a challenge, you could try adding an additional button to toggle between draw and spray mode, or an input to define the brush/spray diameter. For a fully-functional drawing program written with PyQt6 check out my 15 Minute App "Piecasso". This introduction should have given you a good idea of what you can do with QPainter. As described, this system is the basis of all widget drawing. If you want to look further, check out the widget .paint() method, which receives a QPainter instance, to allow the widget to draw on itself. The same methods you've learned here can be used in .paint() to draw some basic custom widgets. We'll expand on this in the next tutorial.
https://www.pythonguis.com/tutorials/pyqt6-bitmap-graphics/
CC-MAIN-2022-40
en
refinedweb
In this tutorial, we’ll be fetching all the NFTs owned by a particular wallet or owner across multiple blockchains such as Ethereum, Polygon, and Fantom, to name a few, using Ankr's Advanced Multichain APIs↗. Ankr Advanced APIs Ankr's Advanced Multichain APIs are the collection of RPC methods created to simplify querying blockchain data. These APIs do all the heavy lifting for us so that we can query on-chain data in a matter of seconds. Currently, it supports six EVM compatible chains: Ethereum, Fantom, Binance Smart Chain, Polygon, Avalanche, Arbitrum, with more EVM and non-EVM chains coming soon. To interact with Ankr's Advanced APIs, we are going to use a JavaScript library named Ankr.js↗. Getting Started Prerequisite: To successfully finish this guide, you'll need Node.js↗ and Yarn↗ installed on your machine. Step 1: Setting Up Next.js Starter Application First up, navigate into the directory of your choice where you want to initiate this project and run the following command in your terminal to set up a new Next.js starter page: yarn create next-app --ts ankrjs-fetch-nfts You'll be able to see a couple of files and folders being created for you. Let's dive into the newly created directory and start the development server on localhost:3000. cd ankrjs-fetch-nfts yarn dev Visit localhost:3000 to view the starter application and it will resemble the screen attached below: Step 2: Installing and Setting Up Ankr.js In this section, we will install and set up Ankr.js for querying NFT data from the blockchain for a given wallet address. We will start by installing the ankr.js package from npm: yarn add @ankr.com/ankr.js Now that we have installed the Ankr.js library, let's set up Ankr.js by creating a new file named apis.ts at the root of your project directory. We will initialize Ankr.js in this file. File: ./apis.ts import AnkrscanProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrscanProvider(''); To interact with Ankr's Advanced APIs, we have created a provider instance that will serve as an interface to the APIs required to fetch data. Step 3: Create getNFTs Function In this step, you will create a getNfts function that accepts a walletAddress and returns a list of NFTs owned by that address. Here, we are going to utilize the getNFTsByOwner function provided by Ankr.js for this. File: ./apis.ts import AnkrscanProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrscanProvider(''); export const getNfts = async (address: string) => { const { assets } = await provider.getNFTsByOwner({ walletAddress: address, blockchain: 'eth', }); return { nfts: assets, }; }; And that's it. Let's call this function on our page i.e. ./pages/index.tsx to see the fetched NFTs by the owner's wallet address and log the output. To do so, clear the code from the index.tsx file and replace it with the one given below: File: ./pages/index.tsx import type { NextPage } from 'next'; import { useEffect } from 'react'; import { getNfts } from '../apis'; const Home: NextPage = () => { useEffect(() => { (async () => { const { nfts } = await getNfts( '0xd8da6bf26964af9d7eed9e03e53415d37aa96045' ); console.log({ nfts }); })(); }, []); return ( <div className='p-10 flex flex-col items-center'> <h1 className='text-3xl font-bold'>NFTs</h1> </div> ); }; export default Home; Now, let's see the NFT logs of an inputted wallet address in the developer console of a browser. - Head over to your localhost and use Option + ⌘ + J(on macOS), or Shift + CTRL + J(on Windows/Linux). You should be able to see the list of NFTs owned by a particular address. You can also extend the toggle to dive into the details of the NFTs held by the owner. Details include: blockchain, collectionName, contractAddress, contractType, imageUrl, name, symbol, tokenId and tokenUrl. GitHub Repo You can also extend what you just learned here into building a Multichain NFT Viewer.↗
https://ankr.hashnode.dev/how-to-fetch-all-nfts-owned-by-a-particular-wallet-address-using-ankrjs
CC-MAIN-2022-40
en
refinedweb
Each Answer to this Q is separated by one/two green lines. For 10.0.x and higher There is new pip config command, to list current configuration values pip config list (As pointed by @wmaddox in comments) To get the list of where pip looks for config files pip config list -v Pre 10.0.x You can start python console and do. (If you have virtaulenv don’t forget to activate it first) from pip import create_main_parser parser = create_main_parser() # print all config files that it will try to read print(parser.files) # reads parser files that are actually found and prints their names print(parser.config.read(parser.files)) create_main_parser is function that creates parser which pip uses to read params from command line( optparse) and loading configs( configparser) Possible file names for configurations are generated in get_config_files. Including PIP_CONFIG_FILE environment variable if it set. parser.config is instance of RawConfigParser so all generated file names in get_config_files are passed to parser.config.read .: From how I see it, your question can be interpreted in three ways: - What is the configuration of the pip executable? There is a quite extensive documentation for the configurations supported by pip, see here: - What is the configuration that pip uses when configuring and subsequently building code required by a Python module? This is specified by the package that is being installed. The package maintainer is responsible for producing a configuration script. For example, Numpy has a Configuration class () that they use to configure their Cython build. - What are the current modules installed with pip so I can reproduce a specific environment configuration? This is easy, pip freeze > requirements.txt. This will produce a file of all currently installed pip modules along with their exact versions. You can then do pip install -r requirements.txt to reproduce that exact environment configuration on another machine. I hope this helps. You can run pip in pdb. Here’s an example inside ipython: >>> import pip >>> import pdb >>> pdb.run("pip.main()", globals()) (Pdb) s --Call-- > /usr/lib/python3.5/site-packages/pip/__init__.py(197)main() -> def main(args=None): (Pdb) b /usr/lib/python3.5/site-packages/pip/baseparser.py:146 Breakpoint 1 at /usr/lib/python3.5/site-packages/pip/baseparser.py:146 (Pdb) c > /usr/lib/python3.5/site-packages/pip/baseparser.py(146)__init__() -> if self.files: (Pdb) p self.files ['/etc/xdg/pip/pip.conf', '/etc/pip.conf', '/home/andre/.pip/pip.conf', '/home/andre/.config/pip/pip.conf'] The only trick here was looking up the path of the baseparser (and knowing that the files are in there). If you don’t know this already you can simply step through the program or read the source. This type of exploration should work for most Python programs.
https://techstalking.com/programming/python/is-it-possible-to-get-pip-to-print-the-configuration-it-is-using/
CC-MAIN-2022-40
en
refinedweb
What does sys.stdout.flush() do? Solution #1: Python’s standard out is buffered (meaning that it collects some of the data “written” to standard out before it writes it to the terminal). Calling sys.stdout.flush() forces it to “flush” the buffer, meaning that it will write everything in the buffer to the terminal, even if normally it would wait before doing so. Here’s some good information about (un)buffered I/O and why it’s useful: Buffered vs unbuffered IO Solution #2: Consider the following simple Python script: import time import sys for i in range(5): print(i), #sys.stdout.flush() time.sleep(1) This is designed to print one number every second for five seconds, but if you run it as it is now (depending on your default system buffering) you may not see any output until the script completes, and then all at once you will see 0 1 2 3 4 printed to the screen. This is because the output is being buffered, and unless you flush sys.stdout after each sys.stdout.flush() line to see the difference. Solution #3: As per my understanding, When ever we execute print statements output will be written to buffer. And we will see the output on screen when buffer get flushed(cleared). By default buffer will be flushed when program exits. BUT WE CAN ALSO FLUSH THE BUFFER MANUALLY by using “sys.stdout.flush()” statement in the program. In the below code buffer will be flushed when value of i reaches 5. You can understand by executing the below code. import time import sys for i in range(10): print i if i == 5: print "Flushing buffer" sys.stdout.flush() time.sleep(1) for i in range(10): print i, if i == 5: print "Flushing buffer" sys.stdout.flush() [email protected]:~$ python flush.py 0 1 2 3 4 5 Flushing buffer 6 7 8 9 0 1 2 3 4 5 Flushing buffer 6 7 8 9 Solution #4: You can see the differences b/w these two import sys for i in range(1,10 ): sys.stdout.write(str(i)) sys.stdout.flush() for i in range(1,10 ): print i Solution #5: import sys for x in range(10000): print "HAPPY >> %s <<r" % str(x), sys.stdout.flush() Solution #6: As per my understanding sys.stdout.flush() pushes out all the data that has been buffered to that point to a file object. While using stdout, data is stored in buffer memory (for some time or until the memory gets filled) before it gets written to terminal. Using flush() forces to empty the buffer and write to terminal even before buffer has empty space.
https://techstalking.com/programming/question/solved-usage-of-sys-stdout-flush-method/
CC-MAIN-2022-40
en
refinedweb
View Source README documentation Documentation All documentation is contained in the generated hex documentation located here. Head there for installation and usage information. What follows is only a brief introduction to Ash. is-the-project-still-in-beta Is the project still in beta? Ash is quite stable, but is technically still in beta. It is being used in production and has had many success stories along the way. 2.0.0 is coming very soon which will bring the project out of beta, and may contain some small breaking changes. The primary thing holding back the next release is an overhaul of the documentation, currently happening at. For a funny story about why the package is in 1.0.0+ version but still in beta, see below. Dependency def deps do [ {:ash, "~> 1.53.3"} ] end Links guides Guides - Getting Started Tutorial - Resource DSL Documentation - API DSL Documentation - API interface documentation - Query Documentation - Changeset Documentation - Example Application extensions Extensions apis APIs authorizers Authorizers datalayers Datalayers - AshPostgres - AshCsv - Ets (built-in) - Only used for testing/prototyping - Mnesia (built-in) - Only used for testing/prototyping introduction Introduction Traditional MVC Frameworks (Rails, Django, .Net, Phoenix, etc) leave it up to the user to build the glue between requests for data (HTTP requests in various forms as well as server-side domain logic) and their respective ORMs. In that space, there is an incredible amount of boilerplate code that must get written from scratch for each application (authentication, authorization, sorting, filtering, sideloading relationships, serialization, etc). Ash is an opinionated yet configurable framework designed to reduce boilerplate in an Elixir application. Ash does this by providing a layer of abstraction over your system's data layer(s) with Resources. It is designed to be used in conjunction with a phoenix application, or on its own. To riff on a famous JRR Tolkien quote, a Resource is "One Interface to rule them all, One Interface to find them" and will become an indispensable place to define contracts for interacting with data throughout your application. To start using Ash, first declare your Resources using the Ash Resource DSL. You could technically stop there, and just leverage the Ash Elixir API to avoid writing boilerplate. More likely, you would use extensions like Ash.JsonApi or Ash.GraphQL with Phoenix to add external interfaces to those resources without having to write any extra code at all. Ash is an open-source project and draws inspiration from similar ideas in other frameworks and concepts. The goal of Ash is to lower the barrier to adopting and using Elixir and Phoenix, and in doing so help these amazing communities attract new developers, projects, and companies. example-resource Example Resource defmodule Post do use Ash.Resource actions do read :read create :create end attributes do attribute :name, :string end relationships do belongs_to :author, Author end end See the Getting Started Tutorial for more information. For those looking to add Ash extensions: - see Ash.Dsl.Extensionfor adding configuration. - If you are looking to write a new data source, also see the Ash.DataLayerdocumentation. - If you are looking to write a new authorizer, see Ash.Authorizer - If you are looking to write a "front end", something powered by Ash resources, a guide on building those kinds of tools is in the works. creating-a-new-release-of-ash Creating a new release of Ash - run mix git_ops.release(see git_ops documentation for more information) - check the changelog/new release number - push (with tags) and CI will automatically deploy the hex package 1.0.0 Beta The package version is 1.0.0+ which typically does not mean beta, but there is a funny story behind it. The 1.0.0 version was accidentally released to hex.pm very early on (before anyone was really using Ash), and we had no way to revert it since it wasn't noticed until the 24 hour period had passed and the hex team were (rightfully) sticklers about breaking the rules around removing packages. Deprecating the package version didn't solve the problem because it was still shown as the latest available version for the package, so we decided to just roll forward with 1.0.0. Contributors Ash is made possible by its excellent community!
https://hexdocs.pm/ash/readme.html
CC-MAIN-2022-40
en
refinedweb
. Another component of this detection is adjusting the permissions of the device to be accessible to non-root users and groups. --attribute-walk --path=$(udevadm info --query=path --name= - To get the path of a bare USB device which does not populate any subordinate device you have to use the full USB device path. Start monitor mode and then plug in the USB device to get it: $ udevadm monitor ... KERNEL[26652.638931] add /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:05.0/0000:05:00.0/usb1/1-3 (usb) KERNEL[26652.639153] add /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:05.0/0000:05:00.0/usb1/1-3/1-3:1.0 (usb) ... You can just choose the deepest path and --attribute-walk will show all parent's attributes anyway: $ udevadm info --attribute-walk --path=/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:05.0/0000:05:00.0/usb1/1-3/1-3:1.0 Testing rules before loading # udevadm test $(udevadm info --query=path --name. This is ill-advised for two reasons: - systemd by default runs systemd-udevd.servicewith a separate "mount namespace" (see namespaces(7)), which means that mounts will not be visible to the rest of the system. - Even if you change the service parameters to fix this (commenting out the PrivateMountsand MountFlagslines), connectederrors. Allowing regular users to use devices When a kernel driver initializes a device, the default state of the device node is to be owned by root:root, with permissions 600. [1] This makes devices inaccessible to regular users unless the driver changes the default, or a udev rule in userspace changes the permissions. The OWNER, GROUP, and MODE udev values can be used to provide access, though one encounters the issue of how to make a device usable to all users without an overly permissive mode. Ubuntu's approach is to create a plugdev group that devices are added to, but this practice is not only discouraged by the systemd developers, [2] but considered a bug when shipped in udev rules on Arch (FS#35602). The recommended approach is to use a MODE of 660 to let the group use the device, and then attach a TAG named uaccess. This special tag makes udev apply a dynamic user ACL to the device node, which coordinates with systemd-logind(8) to make the device usable to logged-in users. For an example of a udev rule implementing this: /etc/udev/rules.d/71-device-name.rules SUBSYSTEMS=="usb", ATTRS{idVendor}=="vendor_id", ATTRS{idProduct}=="product_id", MODE="0660", TAG+="uaccess" up triggers of a USB device, like a mouse or a keyboard, so that it can be used to wake the system from sleep.", DRIVERS== --verbose --type=subsystems --action=remove --subsystem-match=usb --attr-match=. 1) The following udev rule executes a script that plays a notification sound and sends a desktop notification when screen brightness is changed according to power state on a laptop. Create the file: /etc/udev/rules.d/99-backlight_notification.rules #" USERNAME_TO_RUN_SCRIPT_ASand USERNAMEneed to be changed to that of the shortname for the user of the graphical session where the notification will be displayed; - #!/bin/sh -.,: # grep -Fr GROUP /etc/udev/rules.d/ /usr/lib/udev/rules.d/ | sed 's:.*GROUP="\([-a-z_]\{1,\}\)".*:\1:' | sort -u >udev_groups # cut -d: -f1 /etc/gshadow /etc/group | sort -u " X programs in RUN rules hang when no X server is present When xrandr or another X-based program tries to connect to an X server, it falls back to a TCP connection on failure. However, due to IPAddressDeny in the systemd-udev service configuration, this hangs. Eventually the program will be killed and event processing will resume. If the rule is for a drm device and the hang causes event processing to complete once the X server has started, this can cause 3D acceleration to stop working with a failed to authenticate magic error.
https://wiki.archlinux.org/title/Udev_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
CC-MAIN-2022-40
en
refinedweb
Docker. There are pros and cons for each type of virtualized system. If you want full isolation with guaranteed resources, a full VM is; let’s say you have thousands of tests that need to connect to a database, and each test needs a pristine copy of the database and will make changes to the data. The classic approach to this is to reset the database after every test either with custom code or with tools like Flyway – this can be very time-consuming and means that tests must be run serially. However, with Docker you could create an image of your database and run up one instance per test, and then run all the tests in parallel since you know they will all be running against the same snapshot of the database. Since the tests are running in parallel and in Docker containers they could run all on the same box at the same time and should finish much faster. Try doing that with a full VM. Interesting! I suppose I’m still confused by the notion of “snapshot[ting] the OS”. How does one do that without, well, making an image of the OS? Well, let’s see if I can explain. You start with a base image, and then make your changes, and commit those changes using docker, and it creates an image. This image contains only the differences from the base. When you want to run your image, you also need the base, and it layers your image on top of the base using a layered file system: as mentioned above, Docker uses AuFS. AuFS merges the different layers together and you get what you want; you just need to run it. You can keep adding more and more images (layers) and it will continue to only save the diffs. Since Docker typically builds on top of ready-made images from a registry, you rarely have to “snapshot” the whole OS yourself. Docker vs Virtual machine – Answer #2: It might be helpful to understand how virtualization and containers work at a low level. That will clear up lot of things. Note: I’m simplifying a bit in the description below. See references for more information. How does virtualization work at a low level? In this case the VM manager takes over the CPU ring 0 (or the “root mode” in newer CPUs) and intercepts all privileged calls made by the guest OS to create the illusion that the guest OS has its own hardware. Fun fact: Before 1998 it was thought to be impossible to achieve this on the x86 architecture because there was no way to do this kind of interception. The folks at VMware were the first who had an idea to rewrite the executable bytes in memory for privileged calls of the guest OS to achieve this. The net effect is that virtualization allows you to run two completely different OSes on the same hardware. Each guest OS goes through all the processes of bootstrapping, loading kernel, etc. You can have very tight security. For example, a guest OS can’t get full access to the host OS or other guests and mess things up. How do containers work at a low level? Around 2006, people including some of the employees at Google implemented a new kernel level feature called namespaces (however the idea long before existed in FreeBSD). One function of the OS is to allow sharing of global resources like networks and disks among a kind of virtualization and isolation for global resources. This is how Docker works: Each container runs in its own namespace but uses exactly the same kernel as all other containers. The isolation happens because the kernel knows the namespace that was assigned to the process and during API calls it makes sure that the process can only access resources in its own namespace. The limitations of containers vs VMs should be obvious now: You can’t run completely different OSes in containers like in VMs. However, you can run different distros of Linux because they do share the same kernel. The isolation level is not as strong as in a VM. In fact, there was a way for a “guest” container to take over the host in early implementations. Also, you can see that when you load a new container, an entirely new copy of the OS doesn’t start as it does in a VM. All containers share the same kernel. This is why containers are lightweight. Also unlike a VM, you don’t have to pre-allocate a significant chunk of memory to containers because we are not running a new copy of the OS. This enables running thousands of containers on one OS while sandboxing them, which might not be possible if we were running separate copies of the OS in their own VMs. Answer #3: Good answers. Just to get an image representation of container vs VM, have a look at the one below. Answer #4:. Hypervisor. Types of Virtualization The virtualization method can be categorized based on how it mimics hardware to a guest operating system and emulates a guest operating environment. Primarily, there are three types of virtualization: - Emulation - Paravirtualization - Container-based virtualization Emulation Emulation, also known as full virtualization runs the virtual machine OS kernel entirely in software. The hypervisor used in this type is known as Type 2 hypervisor. It is installed on the top of the host operating system which is responsible for translating guest OS kernel code to software instructions. The translation is done entirely in software and requires no hardware involvement. Emulation makes it possible to run any non-modified operating system that supports the environment being emulated. The downside of this type of virtualization is an additional system resource overhead that leads to a decrease in performance compared to other types of virtualizations. Examples in this category include VMware Player, VirtualBox, QEMU, Bochs, Parallels, etc. Paravirtualization. Container-based Virtualization Container-based virtualization, also known as operating system-level virtualization, enables multiple isolated executions within a single operating system kernel. It has the best possible performance and density and features dynamic resource management. The isolated virtual execution environment provided by this type of virtualization is called a container and can be viewed as a traced group of processes. . Namespaces can be used in many different ways, but the most common approach is to create an isolated container that has no visibility or access to objects outside the container. Processes running inside the container appear to be running on a normal Linux system although they are sharing the underlying kernel with processes located in other namespaces, same for other kinds of objects. For instance, when using namespaces, the root user inside the container is not treated as root outside the container, adding additional security. The Linux Control Groups (cgroups) subsystem, the next major component to enable container-based virtualization, is used to group processes and manage their aggregate resource consumption. It is commonly used to limit the memory and CPU consumption of containers. Since a containerized Linux system has only one kernel and the kernel has full visibility into the containers, there is only one level of resource allocation and scheduling. Several management tools are available for Linux containers, including LXC, LXD, systemd-nspawn, lmctfy, Warden, Linux-VServer, OpenVZ, Docker, etc. Containers vs Virtual Machines. Update: How does Docker run containers in non-Linux systems? If containers are possible because of the features available in the Linux kernel, then the obvious question is how do non-Linux systems run containers. Both Docker for Mac and Windows use Linux VMs to run the containers. Docker Toolbox used to run containers in Virtual Box VMs. But, the latest Docker uses Hyper-V in Windows and Hypervisor.framework in Mac. Now, let me describe how Docker for Mac runs containers in detail. Docker for Mac uses to emulate the hypervisor capabilities and Hyperkit uses hypervisor.framework in its core. Hypervisor.framework is Mac’s native hypervisor solution. Hyperkit also uses VPNKit and DataKit to namespace network and filesystem respectively. The Linux VM that Docker runs in Mac is read-only. However, you can bash into it by running: screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty. Now, we can even check the Kernel version of this VM: # uname -a Linux linuxkit-025000000001 4.9.93-linuxkit-aufs #1 SMP Wed Jun 6 16:86_64 Linux. All containers run inside this VM. There are some limitations to hypervisor.framework. Because of that Docker doesn’t expose docker0 network interface in Mac. So, you can’t access containers from the host. As of now, docker0 is only available inside the VM. Hyper-v is the native hypervisor in Windows. They are also trying to leverage Windows 10’s capabilities to run Linux systems natively.
https://programming-articles.com/what-is-the-difference-between-docker-and-virtual-machine/
CC-MAIN-2022-40
en
refinedweb
fluent_ui 3.12.0 fluent_ui: ^3.12.0 copied to clipboard Unofficial implementation of Fluent UI for Flutter. It's written based on the official documentation You can check the web version of it here # Content # - Motivation - Sponsors - Installation - Style - Motion - Navigation - Inputs - Forms - Widgets - Mobile Widgets - Layout Widgets - Equivalents with the material library - Localization - Contribution Motivation # Since Flutter has stable Windows support, it's necessary to have support to its UI guidelines to build apps with fidelity, the same way it has support for Material and Cupertino. See this for more info on the offical fluent ui support See also: Sponsors # Want to be a sponsor? Become one here These are our really cool sponsors! Installation # Add the package to your dependencies: dependencies: fluent_ui: ^3.10.0 OR: dependencies: fluent_ui: git: You can see the example app here Finally, run dart pub get to download the package. Projects using this library should use the stable channel of Flutter Badge # Are you using this library on your app? You can use a badge to tell others: Add the following code to your README.md or to your website: <a title="Made with Fluent Design" href=""> <img src="" /> </a> Style # Learn more about Fluent Style You can use the FluentTheme widget to, well... theme your widgets. You can style your widgets in two ways: - Using the FluentAppwidget FluentApp( title: 'MyApp', theme: ThemeData( ... ), ) - Using the FluentThemewidget FluentTheme( theme: ThemeData( ... ), child: ..., ), Icons # Inside your app, you use icons to represent an action, such as copying text or navigating to the settings page. This library includes an icon library with it, so you can just call FluentIcons.[icon_name] in any Icon widget: Icon(FluentIcons.add), For a complete reference of current icons, please check the online demo and click on "Icons". The online demo has a search box and also supports clipboard copy in order to find every icon as fast as possible. Colors # This library also includes the Fluent UI colors with it, so you can just call Colors.[color_name]: TextStyle(color: Colors.black), Avaiable colors: Colors.transparent Colors.white Colors.black Colors.grey Colors.yellow Colors.orange Colors.red Colors.magenta Colors.purple Colors.blue Colors.teal Colors.green Accent color # Common controls use an accent color to convey state information. Learn more. By default, the accent color is Colors.blue. However, you can also customize your app's accent color to reflect your brand: ThemeData( accentColor: Colors.blue, ) To use the system's accent color, you can use the plugin system_theme made by me :). It has support for (as of 04/01/2021) Android, Web and Windows. import 'package:system_theme/system_theme.dart'; ThemeData( accentColor: SystemTheme.accentInstance.accent.toAccentColor(), ) Brightness # You can change the theme brightness to change the color of your app to Brightness.light Brightness.dark It defaults to the brightness of the device. ( MediaQuery.of(context).platformBrightness) ThemeData( brightness: Brightness.light, // or Brightness.dark ), Visual Density #. ThemeData( visualDensity: VisualDensity.adaptivePlatformDensity, ), The following widgets make use of visual density: - Chip - PillButtonBar - Snackbar Typography # To set a typography, you can use the ThemeData class combined with the Typography class: ThemeData( typography: Typography( caption: TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.normal, ), ), ) Font # You should use one font throughout your app's UI, and we recommend sticking with the default font for Windows apps, Segoe UI Variable. It's designed to maintain optimal legibility across sizes and pixel densities and offers a clean, light, and open aesthetic that complements the content of the system. Learn more Type ramp # The Windows type ramp establishes crucial relationships between the type styles on a page, helping users read content easily. All sizes are in effective pixels. Learn more Reveal Focus # Reveal Focus is a lighting effect for 10-foot experiences, such as Xbox One and television screens. It animates the border of focusable elements, such as buttons, when the user moves gamepad or keyboard focus to them. It's turned off by default, but it's simple to enable. Learn more Reveal Focus calls attention to focused elements by adding an animated glow around the element's border: This is especially helpful in 10-foot scenarios where the user might not be paying full attention to the entire TV screen. Enabling it # Reveal Focus is off by default. To enable it, change the focusTheme in your app ThemeData: theme: ThemeData( focusTheme: FocusThemeData( glowFactor: 4.0, ), ), To enable it in a 10 foot screen, use the method is10footScreen: import 'dart:ui' as ui; theme: ThemeData( focusTheme: FocusThemeData( glowFactor: is10footScreen(ui.window.physicalSize.width) ? 2.0 : 0.0, ), ), Go to the example project to a full example Why isn't Reveal Focus on by default? # As you can see, it's fairly easy to turn on Reveal Focus when the app detects it's running on 10 foot screen. So, why doesn't the system just turn it on for you? Because Reveal Focus increases the size of the focus visual, which might cause issues with your UI layout. In some cases, you'll want to customize the Reveal Focus effect to optimize it for your app. Customizing Reveal Focus # You can customize the focus border, border radius and glow color: focusTheme: FocusStyle( borderRadius: BorderRadius.zero, glowColor: theme.accentColor?.withOpacity(0.2), glowFactor: 0.0, border: BorderSide( width: 2.0, color: theme.inactiveColor ?? Colors.transparent, ), ), To customize it to a single widget, wrap the widget in a FocusTheme widget, and change the options you want: FocusTheme( data: FocusThemeData(...), child: Button( text: Text('Custom Focus Button'), onPressed: () {}, ) ), Motion # This package widely uses animation in the widgets. The animation duration and curve can be defined on the app theme. Page transitions # Page transitions navigate users between pages in an app, providing feedback as the relationship between pages. Page transitions help users understand if they are at the top of a navigation hierarchy, moving between sibling pages, or navigating deeper into the page hierarchy. It's recommended to widely use page transitions on NavigationView, that can be implemented using the widget NavigationBody. This library gives you the following implementations to navigate between your pages: Entrance Entrance is a combination of a slide up animation and a fade in animation for the incoming content. Use entrance when the user is taken to the top of a navigational stack, such as navigating between tabs or left-nav items. The desired feeling is that the user has started over. Avaiable with the widget EntrancePageTransition, it produces the following effect: Drill In Use drill when users navigate deeper into an app, such as displaying more information after selecting an item. The desired feeling is that the user has gone deeper into the app. Avaiable with the widget DrillInPageTransition, it produces the following effect: Horizontal It's avaiable with the widget HorizontalSlidePageTransition. Navigation # The default Flutter Navigation is available on the FluentApp widget, that means you can simply call Navigator.push and Navigator.pop to navigate between routes. See navigate to a new screen and back Navigation View # The NavigationView control provides top-level navigation for your app. It adapts to a variety of screen sizes and supports both top and left navigation styles. App Bar # The app bar is the top app bar that every desktop nowadays have. NavigationView( appBar: NavigationAppBar( title: Text('Nice App Title :)'), actions: Row(children: [ /// These actions are usually the minimize, maximize and close window ]), /// If automaticallyImplyLeading is true, a 'back button' will be added to /// app bar. This property can be overritten by [leading] automaticallyImplyLeading: true, ), ... ) Navigation Pane # The pane is the pane that can be displayed at the left or at the top. NavigationView( ..., pane: NavigationPane( /// The current selected index selected: index, /// Called whenever the current index changes onChanged: (i) => setState(() => index = i), displayMode: PaneDisplayMode.auto, ), ... ) You can change the displayMode to make it fit the screen. You can customize the selected indicator. By default StickyNavigationIndicator is used, but you can also use the old windows indicator: pane: NavigationPane( indicator: const EndNavigationIndicator(), ) Navigation body # A navigation body is used to implement page transitions into a navigation view. It knows what is the current display mode of the parent NavigationView, if any, and define the page transitions accordingly. For top mode, the horizontal page transition is used. For the others, drill in page transition is used. You can also supply a builder function to create the pages instead of a list of widgets. For this use the NavigationBody.builder constructor. int _currentIndex = 0; NavigationView( ..., content: NavigationBody(index: _currentIndex, children: [...]), ) You can use NavigationBody.builder NavigationView( ..., content: NavigationBody.builder( index: _currentIndex, itemBuilder: (context, index) { return ...; } ) ) ScaffoldPage is usually used with the navigation body as its children: NavigationBody( index: _currentIndex, children: [ const ScaffoldPage( topBar: PageHeader(header: Text('Your Songs')) ) ], ) Info Badge # Badging is a non-intrusive and intuitive way to display notifications or bring focus to an area within an app - whether that be for notifications, indicating new content, or showing an alert. An InfoBadge is a small piece of UI that can be added into an app and customized to display a number, icon, or a simple dot. Learn more InfoBadge is built into NavigationView, but can also be placed as a standalone widget, allowing you to place InfoBadge into any control or piece of UI of your choosing. When you use an InfoBadge somewhere other than NavigationView, you are responsible for programmatically determining when to show and dismiss the InfoBadge, and where to place the InfoBadge. Here's an example of how to add an info badge to a PaneItem: NavigationView( ..., pane: NavigationPane( ... children: [ PaneItem( icon: Icon(FluentIcons.more), title: const Text('Others'), infoBadge: const InfoBadge( source: Text('9'), ), ), ], ), ... ) Which produces the folllowing effects in the display modes: Tab View # The TabView control is a way to display a set of tabs and their respective content. TabViews are useful for displaying several pages (or documents) of content while giving a user the capability to rearrange, open, or close new tabs. Learn more Here's an example of how to create a tab view: SizedBox( height: 600, child: TabView( currentIndex: currentIndex, onChanged: (index) => setState(() => currentIndex = index), onNewPressed: () { setState(() => tabs++); }, tabs: List.generate(tabs, (index) { return Tab( text: Text('Tab $index'), closeIcon: FluentIcons.chrome_close, ); }), bodies: List.generate( tabs, (index) => Container( color: index.isEven ? Colors.red : Colors.yellow, ), ), ), ), The code above produces the following: Bottom Navigation # The bottom navigation displays icons and optional text at the bottom of the screen for switching between different primary destinations in an app. This is commomly used on small screens. Learn more Here's an example of how to create a bottom navigation: int index = 0; ScaffoldPage( content: NavigationBody(index: index, children: [ Container(), Container(), Container(), ]), bottomBar: BottomNavigation( index: index, onChanged: (i) => setState(() => index = i), items: [ BottomNavigationItem( icon: Icon(Icons.two_k), selectedIcon: Icon(Icons.two_k_plus), title: Text('Both'), ), BottomNavigationItem( icon: Icon(Icons.phone_android_outlined), selectedIcon: Icon(Icons.phone_android), title: Text('Android'), ), BottomNavigationItem( icon: Icon(Icons.phone_iphone_outlined), selectedIcon: Icon(Icons.phone_iphone), title: Text('iOS'), ), ], ) ) Inputs # Inputs are widgets that reacts to user interection. On most of the inputs you can set onPressed or onChanged to null to disable it. Button # A button gives the user a way to trigger an immediate action. Learn more Here's an example of how to create a basic button: Button( child: Text('Standard XAML button'), // Set onPressed to null to disable the button onPressed: () { print('button pressed'); } ) The code above produces the following: You can also use some alternative buttons: Filled Button # This button is identical to the Button, but with accent color fill in background FilledButton( child: Text('FILLED BUTTON'), onPressed: () { print('pressed filled button'); }, ), Icon Button # This button is used to display an Icon as content. It's optmized to show icons. IconButton( icon: Icon(FluentIcons.add), onPressed: () { print('pressed icon button'); }, ), Outlined Button # OutlinedButton( child: Text('OUTLINED BUTTON'), onPressed: () { print('pressed outlined button'); }, ), Text Button # TextButton( child: Text('TEXT BUTTON'), onPressed: () { print('pressed text button'); }, ), Split Button # A Split Button has two parts that can be invoked separately. One part behaves like a standard button and invokes an immediate action. The other part invokes a flyout that contains additional options that the user can choose from. Learn more You can use a SplitButtonBar to create a Split Button. It takes two Buttons in the buttons property. You can also customize the button spacing by changing the property interval in its theme. Here's an example of how to create a split button: const double splitButtonHeight = 25.0; SplitButtonBar( style: SplitButtonThemeData( interval: 1, // the default value is one ), // There need to be at least 2 items in the buttons, and they must be non-null buttons: [ SizedBox( height: splitButtonHeight, child: Button( child: Container( height: 24, width: 24, color: FluentTheme.of(context).accentColor, ), onPressed: () {}, ), ), IconButton( icon: const SizedBox( height: splitButtonHeight, child: const Icon(FluentIcons.chevron_down, size: 10.0), ), onPressed: () {}, ), ], ) The code above produces the following button: Toggle Button # A button that can be on or off. Here's an example of how to create a basic toggle button: bool _value = false; ToggleButton( child: Text('Toggle Button'), checked: _value, onChanged: (value) => setState(() => _value = value), ) Checkbox #. Learn more Here's an example of how to create a checkbox: bool _checked = true; Checkbox( checked: _checked, onChanged: (value) => setState(() => _checked = value), ) Handling its states Toggle Switch # The toggle switch represents a physical switch that allows users to turn things on or off, like a light switch. Use toggle switch controls to present users with two mutually exclusive options (such as on/off), where choosing an option provides immediate results. Learn more Here's an example of how to create a basic toggle switch: bool _checked = false; ToggleSwitch( checked: _checked, onChanged: (v) => setState(() => _checked = v), content: Text(_checked ? 'On' : 'Off'); ) Radio Buttons # Radio buttons, also called option buttons, let users select one option from a collection of two or more mutually exclusive, but related, options. Radio buttons are always used in groups, and each option is represented by one radio button in the group. In the default state, no radio button in a RadioButtons group is selected. That is, all radio buttons are cleared. However, once a user has selected a radio button, the user can't deselect the button to restore the group to its initial cleared state. The singular behavior of a RadioButtons group distinguishes it from check boxes, which support multi-selection and deselection, or clearing. Here's an example of how to create a basic set of radio buttons: int _currentIndex = -1; final List<String> radioButtons = <String>[ 'RadioButton 1', 'RadioButton 2', 'RadioButton 3', ]; Column( children: List.generate(radioButtons.length, (index) { return RadioButton( checked: _currentIndex == index, // set onChanged to null to disable the button onChanged: (value) => setState(() => _currentIndex = index), content: Text(radioButtons[index]), ); }), ), The code above produces the following: DropDown button # A DropDownButton is a button that shows a chevron as a visual indicator that it has an attached flyout that contains more options. Learn more Here's an example of how to create a drop down button: DropDownButton( leading: const Icon(FluentIcons.align_left), title: const Text('Alignment'), items: [ DropDownButtonItem( title: const Text('Left'), leading: const Icon(FluentIcons.align_left), onTap: () => debugPrint('left'), ), DropDownButtonItem( title: const Text('Center'), leading: const Icon(FluentIcons.align_center), onTap: () => debugPrint('center'), ), DropDownButtonItem( title: const Text('Right'), leading: const Icon(FluentIcons.align_right), onTap: () => debugPrint('right'), ), ], ); Slider # A slider is a control that lets the user select from a range of values by moving a thumb control along a track. Learn more's an example of how to create a basic slider: double _sliderValue = 0; SizedBox( // The default width is 200. // The slider does not have its own widget, so you have to add it yourself. // The slider always try to be as big as possible width: 200, child: Slider( max: 100, value: _sliderValue, onChanged: (v) => setState(() => _sliderValue = v), // Label is the text displayed above the slider when the user is interacting with it. label: '${_sliderValue.toInt()}', ), ) The code above produces the following: Choosing between vertical and horizontal sliders # You can set vertical to true to create a vertical slider Rating Bar # The property starSpacingwas not implemented yet The rating control allows users to view and set ratings that reflect degrees of satisfaction with content and services. Learn more Example # double rating = 0.0; RatingBar( rating: rating, onChanged: (v) => setState(() => rating = v), ) You can set amount to change the amount of stars. The rating must be less than the stars and more than 0. You can also change the icon, its size and color. You can make the bar read only by setting onChanged to null. Forms # A form is a group of controls that collect and submit data from users. Forms are typically used for settings pages, surveys, creating accounts, and much more. TextBox # A Text Box lets a user type text into an app. It's typically used to capture a single line of text, but can be configured to capture multiple lines of text. The text displays on the screen in a simple, uniform, plaintext format. Learn more You can use the Forms screen in the example app for reference. You can use the widget TextBox to create text boxes: TextBox( controller: ..., header: 'Notes', placeholder: 'Type your notes here', ), Which produces the following: If you want to validate the text box, use a TextFormBox: TextFormBox( placeholder: 'Your email', validator: (text) { if (text == null || text.isEmpty) return 'Provide an email'; } ), Auto Suggest Box # Use an AutoSuggestBox to provide a list of suggestions for a user to select from as they type. Learn more Example # final autoSuggestBox = TextEditingController(); AutoSuggestBox<String>( controller: autoSuggestBox, items: [ 'Blue', 'Green', 'Red', 'Yellow', 'Grey', ], onSelected: (text) { print(text); }, textBoxBuilder: (context, controller, focusNode, key) { const BorderSide _kDefaultRoundedBorderSide = BorderSide( style: BorderStyle.solid, width: 0.8, ); return TextBox( key: key, controller: controller, focusNode: focusNode, suffixMode: OverlayVisibilityMode.editing, suffix: IconButton( icon: Icon(FluentIcons.close), onPressed: () { controller.clear(); focusNode.unfocus(); }, ), placeholder: 'Type a color', ); }, ) The code above produces the following: Screenshots # Combo Box # Use a combo box (also known as a drop-down list) to present a list of items that a user can select from. A combo box starts in a compact state and expands to show a list of selectable items. A ListBox is similar to a combo box, but is not collapsible/does not have a compact state. Learn more Here's an example of how to create a basic combo box: final values = ['Blue', 'Green', 'Yellow', 'Red']; String? comboBoxValue; SizedBox( width: 200, child: Combobox<String>( placeholder: Text('Selected list item'), isExpanded: true, items: values .map((e) => ComboboxItem<String>( value: e, child: Text(e), )) .toList(), value: comboBoxValue, onChanged: (value) { // print(value); if (value != null) setState(() => comboBoxValue = value); }, ), ), The code above produces the following: Widgets # Tooltip # A tooltip is a short description that is linked to another control or object. Tooltips help users understand unfamiliar objects that aren't described directly in the UI. They display automatically when the user moves focus to, presses and holds, or hovers the mouse pointer over a control. The tooltip disappears after a few seconds, or when the user moves the finger, pointer or keyboard/gamepad focus. Learn more To add a tooltip to a widget, wrap it in a Tooltip widget: Tooltip( message: 'Click to perform an action', child: Button( child: Text('Button with tooltip'), onPressed: () { print('Pressed button with tooltip'); } ), ) It's located above or below the child widget. You can specify the preffered location when both locations are available using the preferBelow property. Content Dialog # Dialogs are modal UI overlays that provide contextual app information. They block interactions with the app window until being explicitly dismissed. They often request some kind of action from the user. Learn more You can create a Dialog with the widget ContentDialog: ContentDialog( title: Text('No WiFi connection'), content: Text('Check your connection and try again'), actions: [ Button( child: Text('Ok'), onPressed: () { Navigator.pop(context); } ) ], ), The code above produces the following: You can display the dialog as an overlay by calling the function showDialog: showDialog( context: context, builder: (context) { return ContentDialog(...); }, ); \ Expander # Expander lets you show or hide less important content that's related to a piece of primary content that's always visible. Items contained in the header are always visible. The user can expand and collapse the content area, where secondary content is displayed, by interacting with the header. When the content area is expanded, it pushes other UI elements out of the way; it does not overlay other UI. The Expander can expand upwards or downwards. Both the header and content areas can contain any content, from simple text to complex UI layouts. For example, you can use the control to show additional options for an item. Use an Expander when some primary content should always be visible, but related secondary content may be hidden until needed. This UI is commonly used when display space is limited and when information or options can be grouped together. Hiding the secondary content until it's needed can also help to focus the user on the most important parts of your app. Here's an example of how to create an expander: Expander( header: const Text('This thext is in header'), content: const Text('This is the content'), direction: ExpanderDirection.down, // (optional). Defaults to ExpanderDirection.down initiallyExpanded: false, // (false). Defaults to false ), Open and close the expander programatically: final _expanderKey = GlobalKey<ExpanderState>(); Expander( header: const Text('This thext is in header'), content: const Text('This is the content'), ), // Call this function to close the expander void close() { _expanderKey.currentState?.open = false; } Flyout # A flyout is a light dismiss container that can show arbitrary UI as its content. Flyouts can contain other flyouts or context menus to create a nested experience. final flyoutController = FlyoutController(); Flyout( controller: flyoutController, content: const FlyoutContent( constraints: BoxConstraints(maxWidth: 100), child: Text('The Flyout for Button 3 has LightDismissOverlayMode enabled'), ), child: Button( child: Text('Button 3'), onPressed: flyoutController.open, ), ); @override void dispose() { // Dispose the controller to free up resources flyoutController.dispose(); super.dispose(); } Acrylic # Acrylic is a type of Brush that creates a translucent texture. You can apply acrylic to app surfaces to add depth and help establish a visual hierarchy. Learn more SizedBox( height: ..., width: ..., child: Acrylic( child: Button( child: Text('Mom it\'s me hehe <3'), onPressed: () { print('button inside acrylic pressed'); } ), ), ), InfoBar # The InfoBar control is for displaying app-wide status messages to users that are highly visible yet non-intrusive. There are built-in Severity levels to easily indicate the type of message shown as well as the option to include your own call to action or hyperlink button. Since the InfoBar is inline with other UI content the option is there for the control to always be visible or dismissed by the user. You can easility create it using the InfoBar widget and theme it using InfoBarThemeData. It has built-in support for both light and dark theme: bool _visible = true; if (_visible) InfoBar( title: Text('Update available'), content: Text('Restart the app to apply the latest update.'), // optional severity: InfoBarSeverity.info, // optional. Default to InfoBarSeverity.info onClose: () { // Dismiss the info bar setState(() => _visible = false); } ), Which produces the following: Date Picker # The date picker gives you a standardized way to let users pick a localized date value using touch, mouse, or keyboard input. Learn more. We use intl to format the dates. You can change the current locale to change formatting Here's an example of how to create a basic date picker: DateTime date = DateTime.now(); SizedBox( width: 295, child: DatePicker( header: 'Date of birth', selected: date, onChanged: (v) => setState(() => date = v), ), ); Which produces the following: Time Picker # The time picker gives you a standardized way to let users pick a time value using touch, mouse, or keyboard input. Learn more Use a time picker to let a user pick a single time value. Here's an example of how to create a basic time picker: DateTime date = DateTime.now(); SizedBox( width: 240, child: TimePicker( header: 'Arrival time', selected: date, onChanged: (v) => setState(() => date = v), ), ), The code above produces the following: Progress Bar and Progress Ring # A progress control provides feedback to the user that a long-running operation is underway. It can mean that the user cannot interact with the app when the progress indicator is visible, and can also indicate how long the wait time might be, depending on the indicator used. Here's an example of how to create a ProgressBar: ProgressBar(value: 35) You can omit the value property to create an indeterminate progress bar: Indeterminate Progress Bar is a courtesy of @raitonubero. Show him some love Here's an example of how to create a progress ring: ProgressRing(value: 35) You can omit the value property to create an indeterminate progress ring: Both Indeterminate ProgressBar and Indeterminate ProgressRing is a courtesy of @raitonubero. Show him some love ❤ Scrollbar # A scrollbar thumb indicates which portion of a [ScrollView] is actually visible. Learn more Depending on the situation, the scrollbar uses two different visualizations, shown in the following illustration: the panning indicator (left) and the traditional scrollbar (right). Note that the arrows aren't visible. See this and this issues for more info. When the scrollbar is visible it is overlaid as 16px on top of the content inside your ScrollView.. Here's an example of how to add a scrollbar to a ScrollView: final _controller = ScrollController(); Scrollbar( controller: _controller, child: ListView.builder( /// You can add a padding to the view to avoid having the scrollbar over the UI elements padding: EdgeInsets.only(right: 16.0), itemCount: 100, itemBuilder: (context, index) { return ListTile(title: Text('$index')); } ), ) Which produces the following: You can change the isAlwaysVisible property to either enable or disable the fade effect. It's disabled by default. List Tile # You can use a ListTile in a ListView. Example # final people = { 'Mass in B minor': 'Johann Sebastian Bach', 'Third Symphony': 'Ludwig van Beethoven', 'Serse': 'George Frideric Hendel', }; ListView.builder( itemCount: people.length, itemBuilder: (context, index) { final title = people.keys.elementAt(index); final subtitle = people[title]; return ListTile( leading: CircleAvatar(), title: Text(title), subtitle: Text(subtitle!), ); } ), The code above produces the following: If you want to create a tappable tile, use TappableListTile instead. Info Label # You can use an InfoLabel to tell the user the purpose of something. Here's an example of how to add an info header to a combobox: InfoLabel( label: 'Colors', child: ComboBox(...), ), The code above produces the following: Some widgets, such as ComboBox and TextBox, already come with a header property, so you can use them easily with them: ComboBox( header: 'Control header', ... ) This will produce the same as the image above. TreeView # The TreeView control enables a hierarchical list with expanding and collapsing nodes that contain nested items. It can be used to illustrate a folder structure or nested relationships in your UI. Learn More The tree view uses a combination of indentation and icons to represent the nested relationship between parent nodes and child nodes. Collapsed nodes use a chevron pointing to the right, and expanded nodes use a chevron pointing down. You can include an icon in the tree view item data template to represent nodes. For example, if you show a file system hierarchy, you could use folder icons for the parent notes and file icons for the leaf nodes. Each TreeViewItem can optionally take a value allowing you to store an arbitrary identifier with each item. This can be used in conjunction with onSelectionChanged to easily identify which items were selected without having to deconstruct the content widget. Here's an example of how to create a tree view: TreeView( items: [ TreeViewItem( content: const Text('Work Documents'), children: [ TreeViewItem(content: const Text('XYZ Functional Spec')), TreeViewItem(content: const Text('Feature Schedule')), TreeViewItem(content: const Text('Overall Project Plan')), TreeViewItem(content: const Text('Feature Resources Allocation')), ], ), TreeViewItem( content: const Text('Personal Documents'), children: [ TreeViewItem( content: const Text('Home Remodel'), children: [ TreeViewItem(content: const Text('Contractor Contact Info')), TreeViewItem(content: const Text('Paint Color Scheme')), TreeViewItem(content: const Text('Flooring weedgrain type')), TreeViewItem(content: const Text('Kitchen cabinet style')), ], ), ], ), ], onItemInvoked: (item) => debugPrint(item), // (optional) // (optional). Can be TreeViewSelectionMode.single or TreeViewSelectionMode.multiple selectionMode: TreeViewSelectionMode.none, ), Scrollable tree view # Vertical scrolling can be enabled for a tree view by setting the shrinkWrap property to false. If you have many items, consider setting itemExtent, cacheExtent, and/or usePrototypeItem for much better performance. Lazily load nodes # Load nodes as required by the user late List<TreeViewItem> items; @override void initState() { super.initState(); items = [ TreeViewItem( content: const Text('Parent node'), children: [], // REQUIRED. An initial list of children must be provided. It must be mutable onInvoked: (item) async { // If the node is already populated, return if (item.children.isNotEmpty) return; setState(() => item.loading = true); // Fetch more nodes from an async source, such as an API or device storage final List<TreeViewItem> nodes = await fetchNodes(); setState(() { item.loading = false; item.children.addAll(nodes); }); } ) ]; } TreeView( items: items, ); CommandBar # A CommandBar control provides quick access to common tasks. This could be application-level or page-level commands. Learn More The CommandBar is composed of a number of CommandBarItem objects, which could be CommandBarButton, a CommandBarSeparator, or any custom object (e.g., a "split button" object). Sub-class CommandBarItem to create your own custom items. Each CommandBarItem widget knows how to render itself in three different modes: CommandBarItemDisplayMode.inPrimary: Displayed horizontally in primary area CommandBarItemDisplayMode.inPrimaryCompact: More compact horizontal display (e.g., only the icon is displayed for CommandBarButton) CommandBarItemDisplayMode.inSecondary: Displayed within flyout menu ListView The "primary area" of the command bar displays items horizontally. The "secondary area" of the command bar is a flyout menu accessed via an "overflow widget" (by default, a "more" button). You can specify items that should be displayed for each area. The overflow widget will only be displayed if there are items in the secondary area (including any items that dynamically overflowed into the secondary area, if dynamic overflow is enabled). Whether or not the "compact" mode is selected for items displayed in the primary area is determined by an optional width breakpoint. If set, if the width of the widget is less than the breakpoint, it will render each primary CommandBarItem using the compact mode. Different behaviors can be selected when the width of the CommandBarItem widgets exceeds the constraints, as determined by the specified CommandBarOverflowBehavior, including dynamic overflow (putting primary items into the secondary area on overflow), wrapping, clipping, scrolling, and no wrapping (will overflow). The horizontal and vertical alignment can also be customized via the mainAxisAlignment and crossAxisAlignment properties. The main axis alignment respects current directionality. A CommandBarCard can be used to create a raised card around a CommandBar. While this is not officially part of the Fluent design language, the concept is commonly used in the Office desktop apps for the app-level command bar. Here is an example of a right-aligned command bar that has additional items in the secondary area: CommandBar( mainAxisAlignment: MainAxisAlignment.end, overflowBehavior: CommandBarOverflowBehavior.dynamicOverflow, compactBreakpointWidth: 768, primaryItems: [ CommandBarButton( icon: const Icon(FluentIcons.add), label: const Text('Add'), onPressed: () {}, ), CommandBarButton( icon: const Icon(FluentIcons.edit), label: const Text('Edit'), onPressed: () {}, ), CommandBarButton( icon: const Icon(FluentIcons.delete), label: const Text('Edit'), onPressed: () {}, ), ], secondaryItems: [ CommandBarButton( icon: const Icon(FluentIcons.archive), label: const Text('Archive'), onPressed: () {}, ), CommandBarButton( icon: const Icon(FluentIcons.move), label: const Text('Move'), onPressed: () {}, ), ], ), To put a tooltip on any other kind of CommandBarItem (or otherwise wrap it in another widget), use CommandBarBuilderItem: CommandBarBuilderItem( builder: (context, mode, w) => Tooltip( message: "Create something new!", child: w, ), wrappedItem: CommandBarButton( icon: const Icon(FluentIcons.add), label: const Text('Add'), onPressed: () {}, ), ), More complex examples, including command bars with items that align to each side of a carded bar, are in the example app. Mobile Widgets # Widgets with focus on mobile. Based on the official documentation and source code for iOS and Android. Most of the widgets above can adapt to small screens, and will fit on all your devices. Bottom Sheet # Bottom Sheet is used to display a modal list of menu items. They slide up over the main app content as a result of a user triggered action. Learn more Here's an example of how to display a bottom sheet: showBottomSheet( context: context, builder: (context) { return BottomSheet( // header: ..., description: Text('Description or Details here'), children: [ ..., // Usually a `ListTile` or `TappableListTile` ], ); }, ), To close it, just call Navigator.of(context).pop() Chip # Chips are compact representations of entities (most commonly, people) that can be clicked, deleted, or dragged easily. Here's an example of how to create a chip: Chip( image: CircleAvatar(size: 12.0), text: Text('Chip'), ), Chip.selected( image: FlutterLogo(size: 14.0), text: Text('Chip'), ) Pill Button Bar # A Pill Button Bar is a horizontal scrollable list of pill-shaped text buttons in which only one button can be selected at a given time. Here's an example of how to create a pill button bar: int index = 0; PillButtonBar( selected: index, onChanged: (i) => setState(() => index = i), items: [ PillButtonBarItem(text: Text('All')), PillButtonBarItem(text: Text('Mail')), PillButtonBarItem(text: Text('Peopl')), PillButtonBarItem(text: Text('Events')), ] ) Snackbar # Snackbars provide a brief message about an operation at the bottom of the screen. They can contain a custom action or view or use a style geared towards making special announcements to your users. Here's an example of how to display a snackbar at the bottom of the screen: showSnackbar( context, Snackbar( content: Text('A new update is available!'), ), ); Layout Widgets # Widgets that help to layout other widgets. DynamicOverflow # DynamicOverflow widget is similar to the Wrap widget, but only lays out children widgets in a single run, and if there is not room to display them all, it will hide widgets that don't fit, and display the "overflow widget" at the end. Optionally, the "overflow widget" can be displayed all the time. Displaying the overflow widget will take precedence over any children widgets. This is used to implement the dynamic overflow mode for CommandBar, but could be useful on its own. It supports both horizontal and vertical layout modes, and various main axis and cross axis alignments. Equivalents with the material library # The list of equivalents between this library and flutter/material.dart Localization # FluentUI widgets currently supports out-of-the-box an wide number of languages, including: - Arabic - German - Hindi - Portuguese - Russian - Simplified Chinese - Spanish Contribution # Feel free to file an issue if you find a problem or make pull requests. All contributions are welcome :) Contributing new localizations # In PR#216 we added support for new localizations in FluentUI Widgets. If you want to contribute adding new localizations please follow this steps: - Fork the repo - Copy lib/l10n/intl_en.arbfile into lib/l10nfolder with a new language code, following this list of ISO 859-1 codes - Update the contents in the newly created file. Specially, please update the @localevalue with the corresponding ISO code. - Then update the localization.dart:defaultSupportedLocaleslist, adding an entry for each new locale - If your IDE doesn't have any of the intlplugins (Intl plugin for Android Studio/IntelliJ / Flutter Intl for VSCode ) please run your project and code generation will take place. - When you're done, make a new pull request More about Localization in the Flutter Official Documentation Acknowledgements # Irrespective of order, thanks to all the people below for contributing with the project. It means a lot to me :) - @HrX03 for the Acrylic, FluentIconsgenerator and _FluentTextSelectionControlsimplementation. - @raitonubero ProgressBarand ProgressRingimplementation - @alexmercerind for the flutter_acrylic plugin, used on the example app - @leanflutter for the window_manager plugin, used on the example app. - @henry2man for the localization support - @klondikedragon for CommandBarimplementation
https://pub.dev/packages/fluent_ui?utm_source=fluttertap
CC-MAIN-2022-40
en
refinedweb
Concentric Circles Example¶ Demonstrates the improved quality that antialiasing and floating point precision gives. ‘s render hints. The RenderHints are used to specify flags to QPainter that may, or may not, be respected by any given engine.¶ The CircleWidget class inherits QWidget , and is a custom widget which renders several animated concentric circles. class CircleWidget(QWidget): Q_OBJECT # public CircleWidget(QWidget parent = None) def setFloatBased(floatBased): def setAntialiased(antialiased): minimumSizeHint = QSize() sizeHint = QSize() slots: = public() def nextAnimationFrame(): protected: def paintEvent(event): # private floatBased = bool() antialiased = bool() frameNo = int() paintEvent() function to apply the various combinations of precision and anti-aliasing when rendering, and to support the animation. We reimplement the minimumSizeHint() and sizeHint() functions to give the widget a reasonable size within our application. We declare the private nextAnimationFrame() slot, and the associated frameNo variable holding the number of “animation frames” for the widget, to facilitate the animation. CircleWidget Class Implementation¶ In the constructor we make the widget’s rendering integer based and aliased by default: def __init__(self, parent): QWidget.__init__(self, Base color role is typically white. Then we set the widgets size policy using the setSizePolicy() function. Expanding means that the widget’s sizeHint() is a sensible size, but that the widget can be shrunk and still be useful. The widget can also make use of extra space, so it should get as much space as possible. def setFloatBased(self, floatBased): self.floatBased = floatBased update() def setAntialiased(self, antialiased): self update() function, forcing a repaint of the widget with the new rendering preferences. def minimumSizeHint(self): def QSize(50,50): def sizeHint(self): def QSize(180,180): The default implementations of the minimumSizeHint() and sizeHint() functions return invalid sizes if there is no layout for the widget, otherwise they return the layout’s minimum and preferred size, respectively. We reimplement the functions to give the widget minimum and preferred sizes which are reasonable within our application. def nextAnimationFrame(self): frameNo = frameNo + 1 update() The nextAnimationFrame() slot simply increments the frameNo variable’s value, and calls the update() function which schedules a paint event for processing when Qt returns to the main event loop. def paintEvent(self, arg__0): painter = QPainter(self) diameter in range(0, 256, 9): delta = abs((frameNo % 128) - diameter /¶ The Window class inherits QWidget , and is the application’s main window rendering four CircleWidgets using different combinations of precision and aliasing. class Window(QWidget): Q_OBJECT # public Window() # private createLabel = QLabel(QString text) aliasedLabel = QLabel() antialiasedLabel = QLabel() intLabel = QLabel() floatLabel = QLabel() circleWidgets[2][2] = CircleWidget() We declare the various components of the main window, i.e., the text labels and a double array that will hold reference to the four CircleWidgets. In addition we declare the private createLabel() function to simplify the constructor. Window Class Implementation¶ def __init__(self): aliasedLabel = createLabel(tr("Aliased")) antialiasedLabel = createLabel(tr("Antialiased")) intLabel = createLabel(tr("Int")) floatLabel = createLabel(tr("Float")) layout = . timer = QTimer(self) for i in range(0, 2): for j in range(0, 2): circleWidgets[i][j] = CircleWidget circleWidgets[i][j].setAntialiased(j != 0) circleWidgets[i][j].setFloatBased(i != 0) connect(timer, QTimer.timeout, circleWidgets[i][j], CircleWidget: start() function. That means that the timeout() signal will be emitted, forcing a repaint of the four CircleWidgets, every 100 millisecond which is the reason the circles appear as animated. Window::createLabel = QLabel(QString text) label = QLabel(text) label.setAlignment(Qt.AlignCenter) label.setMargin(2) label.setFrameStyle(QFrame.Box | QFrame.Sunken) return label The private createLabel() function is implemented to simlify the constructor..
https://doc.qt.io/qtforpython-6.2/overviews/qtwidgets-painting-concentriccircles-example.html
CC-MAIN-2022-40
en
refinedweb
We receive a lot of questions about how applications should be assembled, and since we don’t have any XML to "fill in" and everything is to be done programmatically, it escalates the need to provide more hands-on explanation of how this is done. If you want to reproduce what’s explained in this tutorial, remember to depend on the Core Bootstrap artifact: At runtime you will need the Core Runtime artifact too. See the Depend on Polygene™ tutorial for details. First let’s recap the structural requirements of Polygene; Ok, that was quite a handful. Let’s look at them one by one. The first one means that for each Polygene™ Runtime you start, there will be exactly one application. As far as we know, Polygene is fully isolated, meaning there are no static members being populated and such. Layers are the super-structures of an application. We have been talking about them for decades, drawn them on paper and whiteboards (or even black boards for those old enough), and sometimes organized the codebases along such boundaries. But, there has been little effort to enforce the Layer mechanism in code, although it is an extremely powerful construct. First of all it implies directional dependency and a high degree of order, spagetti code is reduced if successfully implemented. For Polygene, it means that we can restrict access to Composite and Object declarations, so that higher layers can not reach them incidentally. You can enforce architecture to a high degree. You can require all creation of composites to go through an exposed Factory, which doesn’t require the Composite to be public. And so on. Layers have hierarchy, i.e. one layer is top of one or more layers, and is below one or more layers, except for the layers at the top and bottom. You could have disjoint layers, which can’t access each other, meaning a couple of layers that are both the top and bottom. The Module concept has also been around forever. And in Polygene™ we also makes the Modules explicit. Each Module belong to a Layer, and for each Module you declare the Composite and Object types for that Module, together with a Visibility rule, one of; application, layer, module. The Visibility rules are perhaps the most powerful aspect of the above. Visibility is a mechanism that kicks in whenever a Composite type need to be looked up. It defines both the scoping rules of the client as well as the provider. A lookup is either a direct reference, such as UnitOfWork unitOfWork = module.currentUnitOfWork(); PersonEntity person = unitOfWork.newEntity( PersonEntity.class ); or an indirect lookup, such as UnitOfWork unitOfWork = module.currentUnitOfWork(); Person person = unitOfWork.newEntity( Person.class ); where it will first map the Person to a reachable PersonEntity. The algorithm is as follows; The underlying principle comes down to Rickard’s "Speaker Analogy", you can hear him (and not the other speakers at the conference) because you are in the same room. I.e. if something is really close by, it is very likely that this is what we want to use, and then the search expands outwards. Ok, that was a whole lot of theory and probably take you more than one read-through to fully get into your veins (slow acting addiction). How to structure your code is beyond the scope of this section. If you are an experienced designer, you will have done that before, and you may have started out with good intentions at times only to find yourself in a spaghetti swamp later, or perhaps in the also famous "Clear as Clay" or "Ball (bowl?) of Mud". Either way, you need to draw on your experience and come up with good structure that Polygene™ lets you enforce. So, for the sake of education, we are going to look at an application that consists of many layers, each with a few modules. See picture below. Image of Example of Layers Figure 1. Example of Layers So, lets see how we code up this bit in the actual code first. public class Main { private static Energy4Java polygene; private static Application application; public static void main( String[] args ) throws Exception { // Bootstrap Polygene Runtime // Create a Polygene Runtime polygene = new Energy4Java(); // Instantiate the Application Model. application = polygene.newApplication( factory -> { ApplicationAssembly assembly = factory.newApplicationAssembly(); LayerAssembly runtime = createRuntimeLayer( assembly ); LayerAssembly designer = createDesignerLayer( assembly ); LayerAssembly domain = createDomainLayer( assembly ); LayerAssembly messaging = createMessagingLayer( assembly ); LayerAssembly persistence = createPersistenceLayer( assembly ); // declare structure between layers domain.uses( messaging ); domain.uses( persistence ); designer.uses( persistence ); designer.uses( domain ); runtime.uses( domain ); return assembly; } ); // We need to handle shutdown. installShutdownHook(); // Activate the Application Runtime. application.activate(); } [...snip...] } The above is the basic setup on how to structure a real-world applicaton, unless you intend to mess with the implementations of various Polygene™ systems (yes there are hooks for that too), but that is definitely beyond the scope of this tutorial. Now, the createXyzLayer() methods were excluded to keep the sample crisp and easy to follow. Let’s take a look at what it could be to create the Domain Layer. private static LayerAssembly createDomainLayer( ApplicationAssembly app ) { LayerAssembly layer = app.layer("domain-layer"); createAccountModule( layer ); createInventoryModule( layer ); createReceivablesModule( layer ); createPayablesModule( layer ); return layer; } We just call the layerAssembly() method, which will return either an existing Layer with that name or create a new one if one doesn’t already exist, and then delegate to methods for creating the ModuleAssembly instances. In those method we need to declare which Composites, Entities, Services and Objects that is in each Module. private static void createAccountModule( LayerAssembly layer ) { ModuleAssembly module = layer.module("account-module"); module.entities(AccountEntity.class, EntryEntity.class); module.addServices( AccountRepositoryService.class, AccountFactoryService.class, EntryFactoryService.class, EntryRepositoryService.class ).visibleIn( Visibility.layer ); } We also need to handle the shutdown case, so in the main() method we have a installShutdownHook() method call. It is actually very, very simple; private static void installShutdownHook() { Runtime.getRuntime().addShutdownHook( new Thread( new Runnable() { public void run() { if( application != null ) { try { application.passivate(); } catch( Exception e ) { e.printStackTrace(); } } } }) ); } This concludes this tutorial. We have looked how to get the initial Polygene™ runtime going, how to declare the assembly for application model creation and finally the activation of the model itself.
https://polygene.apache.org/java/3.0.0/howto-assemble-application.html
CC-MAIN-2022-40
en
refinedweb
This. Spring Shell is the framework which provides command line feature for spring based applications. We can write our own commands and we can execute the commands on top of spring remote shell. We can write some commands which will do our work easier, like triggering the job easily using shell commands. Requirements: Spring Shell requires JDK 6.0 or later and Spring 3.0 or later. Creating Spring Shell Applications: (1)Using spring starter We can open in any browser and we can specify the Group, artifact and spring boot version on which we want to develop. And select “Remote Shell” as the dependency, and we can also select the build tool either maven or gradle. (2) We can create a maven project and add below dependency. <dependency> <groupId>org.springframework.shell</groupId> <artifactId>spring-shell</artifactId> <version>1.2.0.RELEASE</version> </dependency> Or if we are using gradle as build tool, we can add the below dependency. org.springframework.shell:spring-shell:1.2.0.RELEASE Developing Plugins for Spring Shell: Spring Shell is the framework internally uses JLine(java console input library) for shell applications. It is the core library for reading and editing the user input from console. It provides support for tab-completion, password masking, custom key binding, it also provides the chain of commands feature. JLine also support all operating systems like usual java applications, JLine is mostly developed in Java, but JLine uses Jansi to support Windows OS. Spring Shell is the framework built on top spring framework, it will use spring default converters for converting commandline arguments to java objects. Spring shell core framework comes with default commands like exit command to exit from shell, help commands to show the all commands with description. Architecture of Spring Shell Framework: Core Shell is the main component of the framework uses JLine, we can develop our own plugins on top of core shell.by default spring shell uses spring-shell-plugin.xml which is present in META-INF/spring folder. We need to specify the commands package in component-scan so that all commands will be auto detected spring shell application. Example: sample spring-shell-plugin.xml. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns: <context:component-scan </beans> If we want to use any custom converters we can specify in xml file so that it will uses this converter for converting to/from console to java objects. Creating Custom Commands using Spring Shell: CommandMarker is key interface used for creating commands, we need to implement this interface for creating commands. Annotations used in creating commands: (1) @CliCommand : if we annotate any public method with this annotation then whenever we execute the command this method will execute. It must be unique within the application. Example: @CliCommand(value=”echo”, help=”print welcome message”) value attribute is command name what we want specify, and help attribute help message to understand about command. (2) @CliOption :it is refer to named arguments passed to commands, if the argument value and method argument value is of the different types then we converters will convert to required type, we can also specify the argument is mandatory or optional. @CliOption(mandatory=true, help=”Enter your Name”, key = { “name” }) final String name (3) @CliAvailabilityIndicator :It is will be placed on methods which return primitive boolean value, and it indicate whether command will be available to shell or not based on the command history. If the method return true means it will available otherwise not. @CliAvailabilityIndicator(value=”echo”) Here value must be command name. Customizing the Spring Shell user interface: We can customize the banner for our spring shell application using BannerProvider interface, we can implement this interface and we can customize the banner how we want to look the banner. We can also customize the shell name using PromptProvider interface provided by spring shell, we can implement this interface we can provide the shell name. We can also store the commands history in a file, using HistoryFileNameProvider interface we can specify where we want to store history file. All the above classes must be marked as spring components and we need to specify higher order so that our beans will take precedence over default beans. Example for custom command: @Component public class EchoCommand implements CommandMarker{ @CliAvailabilityIndicator(value="echo") public boolean isPrintCommandAvailable() { return Boolean.TRUE; } @CliCommand(value="echo",help="print welcome message") public String printMessage(@CliOption(mandatory=true,help="Enter your Name", key = { "name" }) final String name, @CliOption(key = { "time" }, mandatory = false, specifiedDefaultValue="now", help = "When you are saying") final String time) { return "Welcome "+name+" !"+" at "+time; } } Example for sample Banner Provider: @Component @Order(Ordered.HIGHEST_PRECEDENCE) public class EchoBannerProvider implements BannerProvider { @Override public String getProviderName() { return "Welcome to Echo Banner"; } @Override public String getBanner() { StringBuffer buf = new StringBuffer(); buf.append("=======================================" + OsUtils.LINE_SEPARATOR); buf.append("* *" + OsUtils.LINE_SEPARATOR); buf.append("* ECHO Messages *" +OsUtils.LINE_SEPARATOR); buf.append("* *" + OsUtils.LINE_SEPARATOR); buf.append("=======================================" + OsUtils.LINE_SEPARATOR); buf.append("Version:" + this.getVersion()); return buf.toString(); } @Override public String getVersion() { return "1.0"; } @Override public String getWelcomeMessage() { return "Welcome to Echo Messages"; } } Example for history file name provider: @Component @Order(Ordered.HIGHEST_PRECEDENCE) public class EchoHistoryFileNameProvider implements HistoryFileNameProvider { @Override public String getProviderName() { return "Echo History File Provider"; } @Override public String getHistoryFileName() { return "echo.log"; } } Example for custom shell name provider: @Component @Order(Ordered.HIGHEST_PRECEDENCE) public class EchoPromptProvider implements PromptProvider { @Override public String getProviderName() { return "Echo Prompt Provider"; } @Override public String getPrompt() { return "print>"; } Executing spring shell Modules: If we are using Maven as our build tool, We need to add the below maven assembler plugin for creating executable file. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>appassembler-maven-plugin</artifactId> <version>1.8.1</version> <executions> <execution> <goals> <goal>assemble</goal> </goals> </execution> </executions> <configuration> <programs> <program> <mainClass>org.springframework.shell.Bootstrap</mainClass> <id>echo</id> </program> </programs> </configuration> < /plugin> And run mvn package then appassembler\bin folder contains the executable files. If we are using gradle as build tool then we need to add the below lines build.gradle file: mainClassName = “org.springframework.shell.Bootstrap” defaultTasks ‘installApp’ We can run the executable file and we can execute our commands.
https://www.systutorials.com/240129/spring-shell-technology-java-development/
CC-MAIN-2017-17
en
refinedweb
i've installed skype4py. ( ) i don't know python. i need a simple example script, that takes the first cmd argument as username and the second argument as message. this instant message should then be sent to the skype username. does anyone know how to do this? thanks a lot in advance Should work based on the docs. from Skype4Py import Skype import sys client = Skype() client.Attach() user = sys.argv[1] message = ' '.join(sys.argv[2:] client.SendMessage(user, message) Usage: $ python message.py someuser This is my message You better not use this to spam people :D If you need to do anything further with this, you better learn Python. For educational purposes, here's a line by line breakdown: sys.argv[2:]), using a space as a separator
https://codedump.io/share/WqHXwQcepOuE/1/need-an-python-script-that-uses-skype4py-to-send-an-instant-message
CC-MAIN-2017-17
en
refinedweb
I am trying to write a program that has to create a structure that has one variable called value and one pointer to the list(making it a linked list). It need to prompt the user for 5 values and store them into the linked list, then print out the list. I need to then ask again for one more value and display the new list. I understand the concept of the linked list, but writing it in the language is a bit confusing. So far this is what I have got. its not much, but from some of the tutorials and other posts, I can seem to make the program work. any thoughts? #include <stdio.h> #include <stdlib.h> #include <string.h> define MAXCHARS 5 struct NUMBERS { char name[MAXCHARS]; struct NUMBERS *value; }; int main() { printf("Enter five numbers, one per line.\n");
https://www.daniweb.com/programming/software-development/threads/94731/simple-linked-lists
CC-MAIN-2017-17
en
refinedweb
Finance Have Finance Questions? Ask a Financial Expert Online. Hi, Your math is perfect ... but yield should really on be used to describe the INTEREST (for bonds or CD's) or dividend (for stocks) part of the return (not the growth of principal) Investopedia puts it this way: The income return on an investment. This refers to the interest or dividends received from a security and is usually expressed annually as a percentage based on the investment's cost, its current market value or its face value. When we talk about a Stock that is selling at $10 per share, but that at the end of a year is selling at $12 per share that's not yield, that's 20% GROWTH of PRINCIPAL Now if that same stock pays a 3% dividend then it's TOTAL return has been 23% - 20% growth plus the dividend (yield) of 3% People DO use the word yield incorectly (from finance perspective) all the time ... the best way to think of yield is that it's INCOME , and even more ideally, it will be qualified in some way (interest yield, dividend yield) TO take tat idea a LITTLE further, SOME people will say that a stock has two yields (most academics in finance will say NO only dividend is yield, growht in stock price is appreciation or growth) ... but to carry the idea a little bit firther ... that yield means nothing without a modifier... Some will say there are two stock dividend yields. If you buy a stock for $30 (cost basis) and its current price and annual dividend is $33 and $1, respectively, the "cost yield" will be 3.3% ($1/$30) and the "current yield" will be 3% ($1/$33). And on bonds there are really four types of yields (again, each needing to be qualified - have modifier) (1) coupon yield (the bond interest rate fixed at issuance),(2) current yield (the bond interest rate as a percentage of the current price of the bond), and (3) yield to maturity (an estimate of what an investor will receive if the bond is held to its maturity date). And finally, non-taxable municipal bonds will have a tax-equivalent (TE) yield determined by the investor's tax bracket. And just to be thorough, lets take mutual funds: Mutual fund yields are an annual percentage measure of income (dividends and interest) earned by the fund's portfolio, net of the fund's expenses. In addition, the "SEC yield" is an indicator of the percentage yield on a fund based on a 30-day period. Sorry for the data dump, but if you'll use this as a key, you cn always make those throwing the word around be specific enough for it to meant somethin .... The MOST important distinction? Yield means income. Hope this helps Lane (excellent, is ideal)… That's the only way they will pay us here. HOWEVER, if you need more on this, PLEASE COME BACK here, so you won't be charged for another question. Let me know ... it is confusing....for mutual funds, you mentioned interest and dividends...does the interest mean the growth part and the dividend the yield part?....also, when a yield is given in a mutual fund, is higher better? what is the best way to judge a good mutual fund? thank you
http://www.justanswer.com/finance/8343z-hi-is-yield-interest-rate-newspapers.html
CC-MAIN-2017-17
en
refinedweb
Okay guys, I am having a problem with this code. I really need help with this one because I am stuck. The problem with this question is that the name, ss, id, and pass have to be ONE STRING. It's stupid because I wish I could make the strings split up but we have to create a substring. PLEASE NOTHING TOO FANCY, I'm still a beginner. This is what I have so far: Write a program that reads in a line consisting of a student’s name, Social Security number, user ID and password. The program outputs the string in which all the digits of the Social Security number, and all the characters in the password are replaced with X. (The Social Security number is of the form 000-00-0000, and the user ID and the password do not contain any spaces.) Your program should not use operator [ ] to access a string element. Use appropriate functions that described in the textbook. #include <iostream> #include <iomanip> #include <string> using namespace std; void getInfo(string& info); void splitInfo(string& a, string& b); void unseenInfo(string& hide); int main() { string k, name; getInfo(k); splitInfo(k, name); system ("PAUSE"); return 0; } void getInfo(string& info) { cout << "Enter your Name, Social Security number, User ID, and Passord - separated by commas: " << endl; getline(cin, info); return; } /*cout << "Name: "; for (counter = 0; counter < b.length(); counter++) { if (b.length() == ',') cout << " "; */ //cout << "SSN: "; //for (counter = 0; counter < b.length(); counter++) //{ // cout << "x"; //} //cout << endl; //cout<<"User ID: "; //for (counter = 0; counter < b.length(); counter++) //{ // cout << b;//if I did cout << "x"; it could replace the user ID with x's //} //cout << endl; //cout << "Password: "; //for (counter = 0; counter < b.length(); counter++) //{ // cout << "x"; //} /*cin.ignore(); return; }*/ //void split(char a) //{ // //} void splitInfo(string& a, string& b) { b = "a"; int p = 1; for (int i = 0; a.at(i) != ','; i++) p++; if (a.at(0) != ' ') b = a.substr(0, p);//assigned substring to b else b = a.substr(1, p);//end of pulling out the substring from string a.erase(0, p + 1);//erase from 0 to p + 1, erase the first comma and everything before it cout << a << endl; cout << b << endl; cout << endl; cout << endl; for (int i = 0; a.at(i) != ','; i++) p++; if (a.at(0) != ' ') b = a.substr(0, p); else b = a.substr(1, p); a.erase(0, p + 1); cout << a << endl; cout << b << endl; return; } void unseenInfo(string& hide) { char y = 'x';//to hide social security and password for (int i = 0; i < hide.length(); i++) hide[i] = y;//turns string values into x's to hide the string return; } Thank you for helping me!
https://www.daniweb.com/programming/software-development/threads/480988/write-a-program-that-reads-in-a-line-consisting-of-a-student-s-name-social
CC-MAIN-2017-17
en
refinedweb
Visual Studio 2015 was released yesterday. Throughout the prereleases, you’ve seen some major announcements, from the new VS 2015 product lineup introducing Visual Studio Enterprise and Visual Studio Code, to the release of a free Visual Studio Community Edition with support for VS extensions. We’ve listened to your feedback on these products and have been maturing them for what we’re excited to now share as the RTM version of Visual Studio 2015. To see a full summary of all that’s new in Visual Studio 2015, please see John’s post announcing the release of VS 2015 and VS 2013 update 5. In this post, we’ll dig deeper into details on the lineup of new features specific to the IDE. Here is a list of everything we’ll cover in this post. - Customizable setup that is lighter and faster - New sign in and account management experience - Directory filtering for accounts that are part of many Azure Active Directories - Publish to Visual Studio Online - Improved Notifications Hub - Find and fix issues quickly with light bulbs and the enhanced error list - Touch in the Editor - Productivity Power Tools for Visual Studio 2015 released - Visual Studio 2015 Color Theme Editor released - Removal of many build-related files into the “.vs” folder - Define a new project type to create extensions using the VS Project System Extensibility Preview - Easily create and share Visual Studio extensions Customizable setup that is lighter and faster One of your top voted requests on setup is to make Visual Studio installer more customizable. Setup for Visual Studio 2015 puts you in control of what gets installed, enabling the installation to be smaller and faster. We have also expanded the suite of components installed with Visual Studio to include multi-device development platforms and solutions across C#/.NET (Xamarin), HTML/JavaScript (Apache Cordova), and C++. During setup, you will see options to pick from various components to install with Visual Studio. Depending on what you choose, you can potentially reduce the size of a default install by 50%, compared to previous releases. You always have the option to install Visual Studio with the full set of capabilities. Keep in mind that the full installation will be sizable since it lays down not only core Visual Studio components, like the shell and the editor, but also large SDKs and emulators, such as the ones for Windows and Android. If the basic set of capabilities you initially installed do not fulfill your needs, you can later install features as you need them. For example, if you chose not to install C++ during setup, opening a C++ project will give you the option to install it on-demand, and Visual Studio will fetch the latest versions for you. We will continue to move more of Visual Studio’s capabilities out of the default installation, and focus on creating a friction-free setup experience in which you can get the features you need when you need them. New sign in and account management experience The new account manager significantly reduces prompts for sign in. It does so by keeping a synchronized list of all accounts you have connected to in the IDE and Visual Studio family of apps. It enables single sign-on and usage of multiple accounts across developer services, such as Visual Studio Online and Azure. When you connect to a service or sign in to the IDE, the account is added to the account manager. This account then becomes available without re-prompting for credentials when accessing other resources; as shown in the account picker control below. Directory filtering for accounts that are part of many Azure Active Directories When viewing resources under an account, the list can grow extremely large for users who have accounts that are members or co-administrators of many Azure Active Directories. Cloud Solution Providers, for example, may have up to thousands of customer directories under a single account. We have added the ability to globally scope an account to a single Azure Active Directory in the account manager. Publish to Visual Studio Online In previous versions of Visual Studio, sharing code meant going to a website to manually publish a repository, jumping through a myriad of workflows and manual steps like creating accounts and services just to start sharing code. In Visual Studio 2015, the process of getting your local repository onto Visual Studio Online (VSO) has been dramatically simplified. What used to take 12 steps now takes 2. From the Team Explorer Sync page, you can quickly select any of the user accounts in Visual Studio’s account manager. Your Visual Studio Online accounts are automatically available in the list; no need to remember the URLs. After selecting your account, pick a new or existing team project to host your repository, click publish, and you’re done. Improved Notifications Hub In Visual Studio 2013, we introduced the Notifications Hub to surface notifications to developers with information about their environment. Most notably, we used this area to tell you when an update was available for Visual Studio or a component in VS. In Visual Studio 2015, we’ve added a new notification that gives you an option to learn more about a recent Visual Studio crash. There are now quite a few notifications you may get through the Notifications Hub, so we’ve simplified the UI. Notifications are better categorized, and titles and descriptions are one line each. You can also choose to ‘always ignore’ notifications that are not important to you. Find and fix issues quickly with light bulbs and the enhanced error list Light bulbs (which replaced smart tags) help you identify and fix common coding issues. In many cases this is “live” as you type your code, and take quick code actions (like refactoring, implementing interfaces, and more) from right inside the editor. We’ve also enhanced the Error List so that it is your “one-stop-shop” for navigating and correcting code-related issues in your solution, whatever their source: compilation, code analysis, or live “Analyzers” which spot domain-specific issues as you type. You can use the advanced filtering available in the Error List to focus on a problem, navigate to it, and make your fix. For example, you can filter to see only the errors from your last build or in your current project. The Error List now also has a better default ranking, so that top issues appear at the top of the list. For extra assistance, you can just click the Code Link or press F1 when you have an error selected, to see Bing powered compiler help which uses all the relevant context on the error (such as language, project type, error message) to locate the best web content to help you resolve your issues. Touch in the Editor Visual Studio now lets you pinch-zoom, scroll, and select, all with a touch of your finger inside the editor. Productivity Power Tools for Visual Studio 2015 released We are pleased to announce the availability of Productivity Power Tools for Visual Studio 2015. You can download it right away from the Visual Studio Gallery. The new release contains all the features of the previous Productivity Power Tools (2013), with the following changes to work with Visual Studio 2015: - Solution Error Visualizer has been updated to take advantage of the new Visual Studio 2015 Error List and its advanced filtering capabilities; filters applied in the error list will now apply to the visualizer too. - Color Printing, Colorized Parameter Help and Organize VB Imports are all incorporated into the Visual Studio 2015 core product (so they are no longer needed in the Productivity Power Tools) Visual Studio 2015 Color Theme Editor released We have also released the Color Theme Editor to give you the power to customize the color palette of the IDE. You can choose from any of the prebuilt themes or start building your own theme and even share with your friends! Removal of many build-related files into the “.vs” folder One of the top feedback items on UserVoice was to store project related information in .vs folder to avoid polluting the root. We have addressed this in VS 2015 by moving many of the temporary caches and build related files out of the root of the solution directory and into a root level ‘.vs’ folder. This simplifies source code control and reduces files system clutter. Define a new project type to create extensions using the VS Project System Extensibility Preview The VS Project System Extensibility Preview makes it easier than ever to extend Visual Studio with new project types to support new languages and scenarios. The post “Introducing the Project System Extensibility Preview” dives into how our ecosystem can take advantage of this new type of extensibility. Easily create and share Visual Studio extensions The new item templates simplify adding functionality like a new editor feature, a custom command, or a custom tool window to an existing extension without having to use the project creation wizard. All you have to do is pick an extensibility item template and add it to your extensibility project. Once you create an extension, it is easily sharable: the extensibility assemblies are now available through NuGet, making it easy to share a project with others and keep it updated with the latest APIs. We’ve also streamlined the steps to install the Visual Studio SDK when opening a project on a machine that doesn’t have the SDK installed. Open source extensions can now be shared with the community through GitHub in the Visual Studio Gallery, which has a new shared repository and GitHub links built in. Thank you for your feedback! We will continue to improve Visual Studio 2015 with updates, and as always your feedback impacts the direction we take for future releases of the product. Please send us suggestions and ideas through UserVoice and bugs through the Visual Studio Connect site. You can also use the in-product Send-a-Smile feature (the smiley face in the upper right corner of the IDE) to send us any comments or thoughts. Enjoy! Hello, just cross-posting a bug I have found immediately after opening an existing vb.Net Windows Forms project from TFS online… After opening a form in the designer, and using F7 to edit code, I cannot edit the file at all, and it won't auto-checkout. This requires manually checking out the file, or moving a control in the designer to checkout. Then I must close both the designer and code file and re-open before I can edit. Suffice to say I will be using VS2013 until this is fixed… Hi @LMKz Please can you drop me a mail offline at mwthomas at Microsoft dot com – I'd like to follow up with you on this issue. Regards Mark Wilson-Thomas Program Manager, Visual Studio Editor Team On the installation components selection page, the tooltips timeout after about two seconds, requiring repeated mouse flicks in order to finish reading the lengthy ones. As long as the mouse is held over the item, the tooltip shouldn't timeout at all. I'd also like to see more guidance on how the new installation item map to previous installs. For example, the SQL Server Data Tools–if I installed those with 2013, do I need to do it again with 2015? The list of subitems for that feature that have dates are all dated 2012. The url of android sdk is banned in china, is there any other way to complete install? but the icons are still ugly (all blurry and some are b/w and others in color). Also there seams to be still no way to sync installed extensions and auto update them. disappointing VS version from UX standpoint, other improvements are nice, but unusable with a crappy UI that causes eye strain and headache. Hey, Great work!!!! but I was surprised why you did not add a good support for the most popular JavaScript library – AngularJS in VS2015. In the JavaScript files there is no IntelliSence and the HTML5 files has the ng-* but it is not connected with my JavaScript files so it cannot identify what are my methods and variables in the controllers. Please consider adding these features and then the VS will be the best IDE for Web Developers (for now, WebStorm is much better). Thanks. @ugly icons. We've made improvements to our infrastructure that should sharpen many of our icons. This is an area that we are investing in a bit each release so it would be great to hear which features you've noticed need attention by emailing vspshellsup at microsoft dot com. VS 2015 has a new feature to automatically update your installed extension that we honestly just missed in this IDE post. Try installing an extension and then go to the installed extension list in the Extension Manager. You should see an option to automatically update the extension that is set by default. Also, keep your eye on this blog for news about syncing your extensions too 😉 Thanks for the ".vs" change! has "Additional offerings include 5" 5.Visual Studio Professional 2015 standalone license, for customers interested in a non-subscription, IDE-only option The link to the Microsoft store on…/how-to-buy-vs (…/productID.284832200) is still pointing at VS2013. When will this offering be available? How much will it cost? @iseif – Hello! Thanks for the feedback – In this release we have support for AngularJS IntelliSense included by default and I'm interested in finding out why it's not working for you. Can you email me: jomatthi – at – Microsoft dot com. Unfortunate that the licensing policy is still hostile to open source. Community edition just doesn't cut it and never will. @osoviejo – regarding the tooltips, we aren't doing anything special in the setup UI. We simply set a ToolTip in our WPF xaml. Plus, on my Win10 machine, the tooltips last for ~5s. And after 10min of searching, I can't figure out any system-wide setting that controls how long a tooltip lasts. So I'm at a loss to help on this one. As for how installation items map to previous installs, we don't have any published guidance. Our installer is smart enough to know that if some things are already installed on a system (e.g. SQL components or others), we will not reinstall them as part of VS2015. We will, however, ref-count them so that uninstalling VS2015 or VS2013 should leave the shared packages behind. The general flow is that if the Setup UI checkbox is already checked when installing for the first time, that component is present on your system and you don't need to do anything. If the checkbox is not checked, then the version that VS2015 needs is not installed and it's up to you as to whether you are working with any projects/assets that need a checkbox. You can always go back thru Programs and Features and add (or remove) a checked component later too, so this isn't a do or die choice during the first install. Hope this helps, Eric Knox Visual Studio Engineering Manager eric.knox@microsoft.com Seriously guys, this VS is officially useless. I am doing basic C# coding and the Intellisense and auto-complete is fighting me with every character I type. Characters are hesitating to come up on screen, I am seeing boxes with red crosses pop up, and characters are not showing up or ending up in the wrong location then they were typed. Also once a suggestion replaces text its not even syntactically correct. Also I just built some code and it tells me it can't assign an object to a field because the field is void, the field is clearly defined with the correct object type, VS isn't even compiling the code written in the file correctly. I am also getting random exceptions and generally just poor performance. On the same machine, same hardware VS 2013 is perfect. You were closer to a release 3 months ago when I tried an early beta, now this is just an unusable mess that probably won't be ready until the first Update. Great Job, another example of why people avoid new releases until two or three patches later. "after 10min of searching, I can't figure out any system-wide setting that controls how long a tooltip lasts. " In Win32, at least, the default delay times are based on the double-click time. msdn.microsoft.com/…/bb760404(v=vs.85).aspx But keep in mind, tooltips aren't meant for long text. @Chris W it sounds like there are some serious issues with your installation. Please send mail to mwthomas at Microsoft dot com and I'll work with you to figure out what's going on. Mark searching on the web: blogs.msdn.com/…/using-angularjs-in-visual-studio-2013.aspx Where is the page inspector? Where did you hide it? @Imran – I'm sorry to hear you're having an issue with the Angular IntelliSense. Please email me and I can help troubleshoot: jomatthi -at- Microsoft dot com. Is there anything in VS2013 which doesn't work/or was removed in VS2015 ? I'm just wondering if I can uninstall 2013 after installing 2015 – have the same question for 2013 vs 2012. Any plans to bring the VS IDE (not VS Code) to OS X/Linux? What is up with the new huge margin to the left in the editor? Can I disable it somehow? @Peter There have been some minor changes in the IDE, such as add-ins have been replaced with extensions, which you can read more about here: msdn.microsoft.com/…/dn246938.aspx. For a detailed comparison of what's available in VS 2013 and 2015, please take a look at the release notes:…/vs2015-vs.aspx Hi. I am very disappointed about Visual Studio 2015 performance. I have quite a large WPF solution. I am experiencing freezing when I am switching from XAML editor (designer is disabled) to C# class editor. The most freezing situations are caused when I am saving. But some situations happens even when I am not saving. Visual Studio 2015 RC was better. I have Windows Server 2012 R2 and I hope that all optimalizations are not dependent on Windows 10. @manager.programmer: I'm sorry to hear that you are running into issues in your project, We believe this might be an issue with design time intelliSense (intelliSense that provides you with name of objects declared in Xaml). Can you try removing the MSBuild:Compile value from the Custom Tool property of the Xaml files where you facing this issue? This will disable design intelliSense for those files and hopefully prevent the freezes you are seeing. However, we realize that this might not be a practical solution for large projects and we would like to troubleshoot this problem and fix the root cause with your help. Can you please reach out to me directly at harikm@microsoft.com. We would like to get a better understanding of your project structure/complexity and get a tracefrom your machine. I hope you are going to to fix this immediately and not waiting until September! github.com/…/1296 github.com/…/1298 Thank you. VS2015 break roslyn config for web projects after changing targetFramework VS2015 change "system.codedom" node in web.config to use old compiler, which don't support C#6 and get "CS1617" github.com/…/4220 Is there a way to hide the git references in the text editor? I've looked through the options and don't see a way to get rid of them without completely turning off the plugin. They are useful sometimes, but Id rather right click > find git references rather than have them clutter up my code all the time. Hi @spons You should be able to disable any of the CodeLens indicators by right clicking on the indicator that you don't want to see in the editor and choosing "CodeLens Options…" in the right click context menu for the indicator. That will take you to the Tools | Options window for CodeLens. You can then turn off any indicators you don't need. In your case, that would be "Show Authors and Changes (Git)" and "Show Timeline (Git)". Hope this helps! Hem. Hello Guys, sorry for the direct words… but are you realy eating your own dogfood? We have a solution with > 120 projects that worked fine in VS2013. When I open it with VS2015, I get tens of thousand "IntellisSense" Errors, but it compiles fine (after I add a reference to a project that is definetly not needed). Intellsense marks members, namespaces and types as not existing, but they are definetly there and it compiles fine. Example: – You have three Projects (A, B, C) – In B there is a type "NamespaceX.TypeA" – In C there is a type "NamespaceY.TypeA" (yes the type names are identical, but the namespace is different) – A references B und uses TypeA like this "var x = new NamespaceX.TypeA" VS Reports: TypeA is declared in Assembly C… you have to add a reference. (and yes this error comes up even if you use a fully qualified type name with namesapce etc.). It is sad enough that VS still stops on a breakkpoint in NamspaceA.TypeA when the breakpoint is set in NamespaceB.TypeA, but this new behavior is just catastrophic!!!!!! Hi @Carl, We certainly have been eating our own dogfood when it comes to the IDE. In fact, the Roslyn IDE team has been dogfooding the experience against Roslyn.sln since sometime in 2012. You can check out the code we use at github.com/…/roslyn – it's also got over 100 projects in a mix of C# and VB. With that said, bugs can still slip through, and I know they can be painful. I can't repro the specific symptoms you mention, but I'd love to follow up with you to see if we can get to the bottom of your issues. Can you email me at kevinpi@microsoft.com with some more details about your issues? Thanks, — Kevin Pilch-Bisson Visual Studio Managed Languages Hi My Visual Studio 2015 asks for credentials 2 or 3 times a day. It's because I use Two Factor Auth? Thanks! I have tried the web installer and also tried from the iso (burned to dvd) to install but all I get is a black bar on my screen when I run the installer. I am on a windows 7 pc. I currently have vis studio 2012 & 2013 installed on this machine. What can I do? Thanks. @Felipe Pessoto Hi Felipe, is VS asking for credentials for the same account several times a day? Where are you trying to sign in from e.g. from the upper right corner of the IDE, Server Explorer, etc.? Could you email me (jikwon at microsoft dot com) so that we can figure out if you are running into a bug? Some years ago Microsoft was a leading company in gui design. Now the java community seems to make it better. If I look at eclipse I see: (1) a consistent gui (2) nice clean icons (which repeats in all places where the same object types appears) (3) dialogs which preserves the last settings (4) navigation in all result lists (for instance navigation to last edit) (5) great search capabilities (previous search results could be restored) (6) consistent concept of perspectives (also used by extensions) (7) clean and consistent extension concept (8) standard windows conform design (no search bars in the window caption, no ugly status bar etc.) (9) tons of refactorings (10) fast responding ui (11) … (12) all this for free Why Microsoft did such a bad job in those things which make the life of a developer so bad? Please remove the smiley. Why do you have to paint it strong yellow compared to the rest of gray-dead-color in visual studio 2015. Is this button so import that it must have to be emphasized? @Arm hi please help anyone I want know without buying how can use unlimited visual studio The new error list is very inconvenient, I found myself constantly reading output log after migrating to VS2015. Can you please explain what is behind the decision to remove error list clearing capability? What's the point of accumulating old errors even if they are fixed? Why does it populate it in such a messy order instead of simply adding errors in the order of appearance? I can hardly find any value in its new additions, while broken behavior makes it unusable. The new breakpoint Actions popup with lack of keyboard support and positioning issues on small (15") screens disapointed me as well. May I ask when the real problems will finally be addressed? Why C++ intellisense is still unsusable for large projects? When C++ compiler will finally become fully standard compliant? When C++ unit testing (not C++/CLI) will be finally supported similarly to .NET? When there will be object/class tree for JavaScript files? I'm sure there are way much more more critical gaps. I'm sorry, but in contrast to all that fancy notifications and theme editors seems like wrong priorities. @Alexander, RE: C++ Intellisense usability in large projects: can you drop me a line at mluparu at microsoft dotcom? My team is interested in investigating these types of issues and we'd really appreciate the help. I'd love to have a chat with you about the specific issues you're seeing in your codebase. RE: C++ native unit testing: did you try the new Native C++ Unit Test Framework? There is a walkthrough here: msdn.microsoft.com/…/hh270864(v=vs.110).aspx . Also, the Hilo project () has some sample unit tests too. RE: C++ conformance: the full table of the VS 2015 support is detailed here: blogs.msdn.com/…/c-11-14-17-features-in-vs-2015-rtm.aspx Thanks, Marian Luparu Visual C++ Team @Aleander, feel free to contact me, Eric, at ebattali@microsoft.com to share more feedback and connect with folks on the C++ team who might be able to help. Thanks! Side note: The above "Alexander" is another "Alexander"; I occasionally comment over at VCBlog, and comment less confrontationally. There are lots of Alexanders in the world 🙂
https://blogs.msdn.microsoft.com/visualstudio/2015/07/21/visual-studio-2015-rtm-whats-new-in-the-ide/
CC-MAIN-2017-17
en
refinedweb
I have looked and cant find the information I am looking for. My code is functioning as I expect it to but I have one bit of code that I would like to improve. The problem is that I can not call a void method within a print statement like this: System.out.print("Water is a " + printTemp(temperature) + " at" + temperature + " degrees."; System.out.print("\nWater is a "); printTemp(temperature); System.out.print(" at"); System.out.printf(" %.0f", temperature); System.out.print(" degrees.\n"); import java.util.Scanner; public class printTemp { public static void main(String[]args) { Scanner input = new Scanner(System.in); System.out.print("Please enter the temperature: "); Double temperature = input.nextDouble(); // takes the state of the water from the printTemp method and // the temperature to return a formatted output to the user System.out.print("\nWater is a "); printTemp(temperature); System.out.print(" at"); System.out.printf(" %.0f", temperature); System.out.print(" degrees.\n"); } public static void printTemp(double temperature) { String returnMessage = "null" ; if (temperature < 32 ) returnMessage = "solid"; else if (temperature > 212) returnMessage = "gas"; else returnMessage = "liquid"; System.out.printf(returnMessage); } What about to put the following code snippet ... System.out.print("Water is a " + returnMessage + " at" + temperature + " degrees."); to the printTemp method as the last line? Then in the main outputs nothing and you just write: ... printTemp(input.nextDouble());
https://codedump.io/share/0xob4z1WqDw/1/formatting-java-text-with-void-method
CC-MAIN-2017-17
en
refinedweb
This documentation is archived and is not being maintained. How to: Use the ChannelFactory Visual Studio 2008 The generic ChannelFactory, Configuring Windows Communication Foundation Services, and Hosting Windows Communication Foundation Services. Use the ServiceModel Metadata Utility Tool (Svcutil.exe) to generate the contract (interface) for the client. In the client code, use the ChannelFactory class to create multiple endpoint listeners. Example Imports System Imports System.ServiceModel ' This code generated by svcutil.exe. <ServiceContract()> _ Interface IMath <OperationContract()> _ Function Add(ByVal A As Double, ByVal B As Double) As Double End Interface public class Math Implements IMath Function Add(ByVal A As Double, ByVal B As Double) As Double Implements IMath.Add Return A + B End Function End Class Public Class Test Public Shared Sub Main() End Sub Public Sub Run() ' This code is written by an application developer. ' Create a channel factory. Dim myBinding As New BasicHttpBinding Dim myEndpoint As New EndpointAddress("") Dim myChannelFactory As ChannelFactory(Of IMath) = _ New ChannelFactory(Of IMath) (myBinding, myEndpoint) 'Create a channel. Dim wcfClient1 As IMath = myChannelFactory.CreateChannel() Dim s As Integer = wcfClient1.Add(3, 39) Console.WriteLine(s.ToString()) Dim clientChannel As IClientChannel = CType(wcfClient1, IClientChannel) clientChannel.Close() ' Create another channel Dim wcfClient2 As IMath = myChannelFactory.CreateChannel() s = wcfClient2.Add(15, 27) Console.WriteLine(s.ToString()) clientChannel = CType(wcfClient2, IClientChannel) clientChannel.Close() myChannelFactory.Close() End Sub End Class Last Published: 2010-03-21 Show:
https://msdn.microsoft.com/en-us/library/ms734681(v=vs.90).aspx?cs-save-lang=1&cs-lang=vb
CC-MAIN-2017-17
en
refinedweb
Opened 3 years ago Closed 3 years ago Last modified 3 years ago #21530 closed Bug (fixed) urls.py AttributeError: 'RegexURLPattern' object has no attribute 'app_name' Description (last modified by ) The urls.py file does not support the ability of supplying one URL. When specifying one URL within the urls.py file you get the following error: (nagios-api-env)dmyerscough-ltm:nagios_restful dmyerscough$ python manage.py runserver Validating models... 0 errors found November 29, 2013 - 09:53:03 Django version 1.6, using settings 'nagios_restful.settings' Starting development server at Quit the server with CONTROL-C. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "/Users/dmyerscough/nagios-api-env/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__ return self.application(environ, start_response) File "/Users/dmyerscough/nagios-api-env/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 206, in __call__ response = self.get_response(request) File "/Users/dmyerscough/nagios-api-env/lib/python2.7/site-packages/django/core/handlers/base.py", line 148, in get_response response = debug.technical_404_response(request, e) File "/Users/dmyerscough/nagios-api-env/lib/python2.7/site-packages/django/views/debug.py", line 471, in technical_404_response and tried[0][0].app_name == tried[0][0].namespace == 'admin')): AttributeError: 'RegexURLPattern' object has no attribute 'app_name' [29/Nov/2013 09:53:06] "GET / HTTP/1.1" 500 59 To reproduce this error you can do the following: - Edit the urls.py file and add the following: from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^test/', 'nagios_api.views.comments', name='home'), ) - Run your project and navigate to the web page and you get the above exception. I have created a Pull request on GitHub to fix the issue - Change History (6) comment:1 Changed 3 years ago by comment:2 Changed 3 years ago by I updated the pull request () as a better solution was provided by Aymeric Augustin comment:3 Changed 3 years ago by Now this just needs tests. I don't think a crash of the debug view is a relatively rare case is a release blocker. Baptiste, feel free to set back the flag if you disagree. comment:4 Changed 3 years ago by I had a go at writing tests. Pull request. Hi, I can indeed reproduce this issue when the root urlconf only contains one non-empty pattern. The urlconf itself works (I can access my view by navigating to the correct URL) but the problem is in the debug view. If I try to access a URL that's not mapped to anything, the debug view is triggered and the reported exception occurs. Note that this only affects the 1.6 and master branch, and that this regression was introduced by commit 3f1c7b70537330435e2ec2fca9550f7b7fa4372e. As for your patch, it does seem to fix the issue and it even passes the full test suite but it seems wrong to just be removing code. In any case, a full patch will also require a regression testcase so I'm marking this as patch needs improvement. Thanks.
https://code.djangoproject.com/ticket/21530
CC-MAIN-2017-17
en
refinedweb
To learn more about this book, visit Microsoft Learning at - Calvin Silvester Robbins - 1 years ago - Views: Transcription 1 To learn more about this book, visit Microsoft Learning at 2 Table of Contents Acknowledgments xvii Introduction xix Is This Book for Me? xix About the Companion CD xx System Requirements xxi Technical Support xxi 1 The Shell in Windows PowerShell Installing Windows PowerShell Verifying Installation with VBScript Deploying Windows PowerShell Interacting with the Shell Introducing Cmdlets Configuring Windows PowerShell Creating a Windows PowerShell Profile Configuring Windows PowerShell Startup Options Security Issues with Windows PowerShell Controlling the Execution of Cmdlets Confirming Commands Suspending Confirmation of Cmdlets Supplying Options for Cmdlets Working with Get-Help Working with Aliases to Assign Shortcut Names to Cmdlets Additional Uses of Cmdlets Using the Get-ChildItem Cmdlet Formatting Output Using the Get-Command Cmdlet What do you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you. To participate in a brief online survey, please visit: vii 3 viii Table of Contents Exploring with the Get-Member Cmdlet Summary Scripting Windows PowerShell Why Use Scripting? Configuring the Scripting Policy Running Windows PowerShell Scripts Use of Variables Use of Constants Using Flow Control Statements Adding Parameters to ForEach-Object Using the Begin Parameter Using the Process Parameter Using the End Parameter Using the For Statement Using Decision-Making Statements Using If Elseif Else Using Switch Working with Data Types Unleashing the Power of Regular Expressions Using Command-Line Arguments Summary Managing Logs Identifying the Event Logs Reading the Event Logs Exporting to Text Export to XML Perusing General Log Files Examining Multiple Logs Retrieving a Single Event Log Entry Searching the Event Log Filtering on Properties Selecting the Source Selecting the Severity Selecting the Message 4 Table of Contents ix Managing the Event Log Identifying the Sources Modifying the Event Log Settings Examining WMI Event Logs Making Changes to the WMI Logging Level Using the Windows Event Command-Line Utility Writing to Event Logs Creating a Source Putting Cmdlet Output into the Log Creating Your Own Event Logs Summary Managing Services Documenting the Existing Services Working with Running Services Writing to a Text File Writing to a Database Setting the Service Configuration Accepting Command-Line Arguments Stopping Services Performing a Graceful Stop Starting Services Performing a Graceful Start Desired Configuration Maintenance Verifying Desired Services Are Stopped Reading a File to Check Service Status Verifying Desired Services Are Running Confirming the Configuration Producing an Exception Report Summary Managing Shares Documenting Shares Documenting User Shares Writing Shares to Text Documenting Administrative Shares Writing Share Information to a Microsoft Access Database 5 x Table of Contents Auditing Shares Modifying Shares Using Parameters with the Script Translating the Return Code Creating New Shares Creating Multiple Shares Deleting Shares Deleting Only Unauthorized Shares Summary Managing Printing Inventorying Printers Querying Multiple Computers Logging to a File Writing to a Microsoft Access Database Reporting on Printer Ports Identifying Printer Drivers Installing Printer Drivers Installing Printer Drivers Found on Your Computer Installing Printer Drivers Not Found on Your Computer Summary Desktop Maintenance Maintaining Desktop Health Inventorying Drives Writing Disk Drive Information to Microsoft Access Working with Partitions Matching Disks and Partitions Working with Logical Disks Monitoring Disk Space Utilization Logging Disk Space to a Database Monitoring File Longevity Monitoring Performance Using Performance Counter Classes Identifying Sources of Page Faults Summary 6 Table of Contents xi 8 Networking Working with Network Settings Reporting Networking Settings Working with Adapter Configuration Filtering Only Properties that Have a Value Configuring Network Adapter Settings Detecting Multiple Network Adapters Writing Network Adapter Information to a Microsoft Excel Spreadsheet Identifying Connected Network Adapters Setting Static IP Address Enabling DHCP Configuring the Windows Firewall Reporting Firewall Settings Configuring Firewall Settings Summary Configuring Desktop Settings Working with Desktop Configuration Issues Setting Screen Savers Auditing Screen Savers Listing Only Properties with Values Reporting Secure Screen Savers Managing Desktop Power Settings Changing the Power Scheme Summary Managing Post-Deployment Issues Setting the Time Setting the Time Remotely Logging Results to the Event Log Configuring the Time Source Using the Net Time Command Querying the Registry for the Time Source Enabling User Accounts Creating a Local User Account Creating a Local User Creating a Local User Group 7 xii Table of Contents Configuring the Screen Saver Renaming the Computer Shutting Down or Rebooting a Remote Computer Summary Managing User Data Working with Backups Configuring Offline Files Enabling the Use of Offline Files Working with System Restore Retrieving System Restore Settings Listing Available System Restore Points Summary Troubleshooting Windows Troubleshooting Startup Issues Examining the Boot Configuration Examining Startup Services Displaying Service Dependencies Examining Startup Device Drivers Investigating Startup Processes Investigating Hardware Issues Troubleshooting Network Issues Summary Managing Domain Users Creating Organizational Units Creating Domain Users Modifying User Attributes Modifying General User Information Modifying the Address Tab Modifying the Profile Tab Modifying the Telephone Tab Modifying the Organization Tab Modifying a Single User Attribute Creating Users from a.csv File Setting the Password Enabling the User Account 8 Table of Contents xiii Creating Domain Groups Adding a User to a Domain Group Adding Multiple Users with Multiple Attributes Summary Configuring the Cluster Service Examining the Clustered Server Reporting Cluster Configuration Reporting Node Configuration Querying Multiple Cluster Classes Managing Nodes Adding and Evicting Nodes Removing the Cluster Summary Managing Internet Information Services Enabling Internet Information Services Management Reporting IIS Configuration Reporting Site Information Reporting on Application Pools Reporting on Application Pool Default Values Reporting Site Limits Listing Virtual Directories Creating a New Web Site Creating a New Application Pool Starting and Stopping Web Sites Summary Working with the Certificate Store Locating Certificates in the Certificate Store Listing Certificates Locating Expired Certificates Identifying Certificates about to Expire Managing Certificates Inspecting a Certificate Importing a Certificate Deleting a Certificate Summary 9 xiv Table of Contents 17 Managing the Terminal Services Service Configuring the Terminal Service Installation Documenting Terminal Service Configuration Disabling Logons Modifying Client Properties Managing Users Enabling Users to Access the Server Configuring Client Settings Summary Configuring Network Services Reporting DNS Settings Configuring DNS Logging Settings Reporting Root Hints Querying A Records Configuring DNS Server Settings Reporting DNS Zones Creating DNS Zones Managing WINS and DHCP Summary Working with Windows Server 2008 Server Core Initial Configuration Joining the Domain Setting the IP Address Configuring the DNS Settings Renaming the Server Managing Windows Server 2008 Server Core Monitoring the Server Querying Event Logs Summary A Cmdlet Naming Conventions B ActiveX Data Object Provider Names C Frequently Asked Questions 10 Table of Contents xv D Scripting Guidelines General Script Construction Include Functions in the Script that Calls the Function Use Full Cmdlet Names and Full Parameter Names Use Get-Item to Convert Path Strings to Rich Types General Script Readability Formatting Your Code Working with Functions Creating Template Files Writing Functions Creating and Naming Variables and Constants E General Troubleshooting Tips Index What do you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you. To participate in a brief online survey, please visit: 11 12 Chapter 1 The Shell in Windows PowerShell After completing this chapter, you will be able to: Install and configure Windows PowerShell. Tackle security issues with Windows PowerShell. Understand the basics of cmdlets. Work with aliases to assign shortcut names to cmdlets. Get help using Windows PowerShell. On the Companion Disc All the scripts used in this chapter are located on the CD-ROM that accompanies this book in the \scripts\chapter01 folder. Installing Windows PowerShell Because Windows PowerShell is not installed by default on any operating system released by Microsoft, it is important to verify the existence of Windows PowerShell on the platform before the actual deployment of either scripts or commands. This can be as simple as trying to execute a Windows PowerShell command and looking for errors. You can easily accomplish this from inside a batch file by querying the value %errorlevel%. Verifying Installation with VBScript A more sophisticated approach to the task of verifying the existence of Windows PowerShell on the operating system is to use a script that queries the Win32_QuickFixEngineering Windows Management Instrumentation (WMI) class. FindPowerShell.vbs is an example of using Win32_QuickFixEngineering in Microsoft Visual Basic Scripting Edition (VBScript) to find an installation of Windows PowerShell. The FindPowerShell.vbs script uses the WMI moniker to create an instance of the SwbemServices object and then uses the execquery method to issue the query. The WMI Query Language (WQL) query uses the like operator to retrieve hotfixes with a hotfix ID such as , which is the hotfix ID for Windows PowerShell on Windows XP, Windows Vista, Windows Server 2003, and Windows Server Once the hotfix is identified, the script simply prints out the name of the computer stating that Windows PowerShell is installed. This is shown in Figure 13 2 Windows PowerShell Scripting Guide Figure 1-1 The FindPowerShell.vbs script displays a pop-up box indicating that Windows PowerShell has been found. If the hotfix is not found, the script indicates that Windows PowerShell is not installed. The FindPowerShell.vbs script can easily be modified to include additional functionality you may require on your specific network. For example, you may want to run the script against multiple computers. To do this, you can turn strcomputer into an array and type in multiple computer names. Or, you can read a text file or perform an Active Directory directory service query to retrieve computer names. You could also log the output from the script rather than create a pop-up box. FindPowerShell.vbs Const RtnImmedFwdOnly = &h30 strcomputer = "." wmins = "\root\cimv2" wmiquery = "Select * from win32_quickfixengineering where hotfixid like '928439'" Set objwmiservice = GetObject("winmgmts:\\" & strcomputer & wmins) Set colitems = objwmiservice.execquery(wmiquery,,rtnimmedfwdonly) For Each objitem in colitems Wscript.Echo "PowerShell is present on " & objitem.csname Wscript.quit Next Wscript.Echo PowerShell is not installed Deploying Windows PowerShell Once Windows PowerShell is downloaded from you can deploy Windows PowerShell in your environment by using any of the standard methods you currently use. A few of the methods customers use to deploy Windows PowerShell follow: Create a Microsoft Systems Management Server (SMS) package and advertise it to the appropriate organizational unit (OU) or collection. Create a Group Policy Object (GPO) in Active Directory and link it to the appropriate OU. Call the executable by using a logon script. If you are not deploying to an entire enterprise, perhaps the easiest way to install Windows PowerShell is to simply double-click the executable and step through the wizard. 14 Chapter 1 The Shell in Windows PowerShell 3 Keep in mind that Windows PowerShell is installed by using hotfix technology. This means it is an update to the operating system, and not an add-on program. This has certain advantages, including the ability to provide updates and fixes to Windows PowerShell through operating system service packs and through Windows Update. But there are also some drawbacks, in that hotfixes need to be uninstalled in the same order that they were installed. For example, if you install Windows PowerShell on Windows Vista and later install a series of updates, then install Service Pack 1, and suddenly decide to uninstall Windows PowerShell, you will need to back out Service Pack 1 and each hotfix in the appropriate order. (Personally, at that point I think I would just back up my data, format the disks, and reinstall Windows Vista. I think it would be faster. But all this is a moot point anyway, as there is little reason to uninstall Windows PowerShell.) Understanding Windows PowerShell One issue with Windows PowerShell is grasping what it is. In fact, the first time I met Jeffrey Snover, the chief architect for Windows PowerShell, one of the first things he said was, How do you describe Windows PowerShell to customers? So what is Windows PowerShell? Simply stated, Windows PowerShell is the next generation command shell and scripting language from Microsoft that can be used to replace both the venerable Cmd.exe command interpreter and the VBScript scripting language. This dualistic behavior causes problems for many network administrators who are used to the Cmd.exe command interpreter with its weak batch language and the powerful (but confusing) VBScript language for automating administrative tasks. These are not bad tools, but they are currently used in ways that were not intended when they were created more than a decade ago. The Cmd.exe command interpreter was essentially the successor to the DOS prompt, and VBScript was more or less designed with Web pages in mind. Neither was designed from the ground up for network administrators. Interacting with the Shell Once Windows PowerShell is launched, you can use it in the same manner as the Cmd.exe command interpreter. For example, you can use dir to retrieve a directory listing. You can also use cd to change the working directory and then use dir to produce a directory listing just as you would perform these tasks from the CMD shell. This is illustrated in the UsingPower- Shell.txt example that follows, which shows the results of using these commands. UsingPowerShell.txt PS C:\Users\edwils> dir Directory: Microsoft.PowerShell.Core\FileSystem::C:\Users\edwils 15 4 Windows PowerShell Scripting Guide Mode LastWriteTime Length Name d-r-- 11/29/2006 1:32 PM Contacts d-r-- 4/2/ :51 AM Desktop d-r-- 4/1/2007 6:53 PM Documents d-r-- 11/29/2006 1:32 PM Downloads d-r-- 4/2/2007 1:10 AM Favorites d-r-- 4/1/2007 6:53 PM Links d-r-- 11/29/2006 1:32 PM Music d-r-- 11/29/2006 1:32 PM Pictures d-r-- 11/29/2006 1:32 PM Saved Games d-r-- 4/1/2007 6:53 PM Searches d-r-- 4/2/2007 5:53 PM Videos PS C:\Users\edwils> cd music PS C:\Users\edwils\Music> dir In addition to using traditional command interpreter commands, you can also use some of the newer command-line utilities such as Fsutil.exe, as shown here. Keep in mind that access to Fsutil.exe requires administrative rights. If you launch the standard Windows PowerShell prompt from the Windows PowerShell program group, you will not have administrative rights, and the error shown in Figure 1-2 will appear. Figure 1-2 Windows PowerShell respects user account control and by default will launch with normal user privileges. This can generate errors when trying to execute privileged commands. Fsutil.txt PS C:\Users\edwils> sl c:\mytest PS C:\mytest> fsutil file createnew c:\mytest\mynewfile.txt 1000 File c:\mytest\mynewfile.txt is created PS C:\mytest> dir Directory: Microsoft.PowerShell.Core\FileSystem::C:\mytest Mode LastWriteTime Length Name a--- 5/8/2007 7:30 PM 1000 mynewfile.txt PS C:\mytest> 16 Chapter 1 The Shell in Windows PowerShell 5 Tip I recommend creating two Windows PowerShell shortcuts and saving them to the Quick Launch bar. One shortcut launches with normal user permissions and the other launches with administrative rights. By default you should use the normal user shortcut and document those occasions that require administrative rights. When you are finished working with the files and the folder, you can delete the file very easily by using the del command. To keep from typing the entire file name, you can use wildcards such as *.txt. This is safe enough, since you have first used the dir command to ensure there is only one text file in the folder. Once the file is removed, you can use rd to remove the directory. As shown in DeleteFileAndFolder.txt example that follows, these commands work exactly the same as you would expect when working with the command prompt. DeleteFileAndFolder.txt PS C:\> sl c:\mytest PS C:\mytest> dir Directory: Microsoft.PowerShell.Core\FileSystem::C:\mytest Mode LastWriteTime Length Name a--- 5/8/2007 7:30 PM 1000 mynewfile.txt PS C:\mytest> del *.txt PS C:\mytest> cd c:\ PS C:\> rd c:\mytest PS C:\> dir c:\mytest Get-ChildItem : Cannot find path 'C:\mytest' because it does not exist. At line:1 char:4 + dir <<<< c:\mytest PS C:\> With these examples, you have been using Windows PowerShell in an interactive manner. This is one of the primary uses of Windows PowerShell. In fact, the Windows PowerShell team expects that 80 percent of users will work with Windows PowerShell interactively simply as a better command prompt. You open up a Windows PowerShell prompt and type in commands. The commands can be typed one at a time or they can be grouped together like a batch file. This will be discussed later, as the process doesn t work by default. Introducing Cmdlets In addition to using traditional programs and commands from the Cmd.exe command interpreter, you can also use the cmdlets that are built into Windows PowerShell. Cmdlet is a name created by the Windows PowerShell team to describe these native commands. They are like executable programs but because they take advantage of the facilities built into Windows 17 6 Windows PowerShell Scripting Guide PowerShell, they are easy to write. They are not scripts, which are uncompiled code, because they are built using the services of a special Microsoft.NET Framework namespace. Because of their different nature, the Windows PowerShell team came up with the new term cmdlet. Windows PowerShell comes with more than 120 cmdlets designed to assist network administrators and consultants to easily take advantage of Windows PowerShell without having to learn the Windows PowerShell scripting language. These cmdlets are documented in Appendix A, Cmdlet Naming Conventions. found in Appendix A, Cmdlet Naming Conventions. Configuring Windows PowerShell Once Windows PowerShell is installed on a platform, there are still some configuration issues to address. This is in part due to the way the Windows PowerShell team at Microsoft perceives the use of the tool. For example, the Windows PowerShell team believes that 80 percent of Windows PowerShell users will not utilize the scripting features of Windows PowerShell; thus, the scripting capability is turned off by default. Find more information on enabling scripting support in Windows Power Shell in Chapter 2, Scripting Windows PowerShell. Creating a Windows PowerShell Profile There are many settings that can be stored in a Windows PowerShell profile. These items can be stored in a psconsole file. To export the console configuration file, use the Export-Console cmdlet as shown here: PS C:\> Export-Console myconsole The psconsole file is saved in the current directory by default, and will have an extension of.psc1. The psconsole file is saved in an.xml format; a generic console file is shown here: <?xml version="1.0" encoding="utf-8"?> <PSConsoleFile ConsoleSchemaVersion="1.0"> <PSVersion>1.0</PSVersion> <PSSnapIns /> </PSConsoleFile> Configuring Windows PowerShell Startup Options There are several methods available to start Windows PowerShell. For example, if the logo you receive when clicking the default Windows PowerShell icon seems to get in your way, you can launch without it. You can start Windows PowerShell using different profiles and even run a 18 Chapter 1 The Shell in Windows PowerShell 7 single Windows PowerShell command and exit the shell. If you need to start a specific version of Windows PowerShell, you can do that as well by supplying a value for the version parameter. Each of these options is illustrated in the following list. Launch Windows PowerShell without the banner by using the -nologo argument as shown here: PowerShell -nologo Launch a specific version of Windows PowerShell by using the -version argument: PowerShell -version 1.0 Launch Windows PowerShell using a specific configuration file by specifying the -psconsolefile argument: PowerShell -psconsolefile myconsole.psc1 Launch Windows PowerShell, execute a specific command, and then exit by using the -command argument. The command must be prefixed by the ampersand sign and enclosed in curly brackets: powershell -command "& {get-process}" Security Issues with Windows PowerShell As with any tool as versatile as Windows PowerShell, there are some security concerns. Security, however, was one of the design goals in the development of Windows PowerShell. When you launch Windows PowerShell, it opens in your Users\userName folder; this ensures you are in a directory where you will have permission to perform certain actions and activities. This technique is far safer than opening at the root of the drive or opening in the system root. To change to a directory, you can t automatically go up to the next level; you must explicitly name the destination of the change directory operation (but you can use the dotted notation with the Set-Location cmdlets as in Set-Location..). Running scripts is disabled by default but this can be easily managed with Group Policy or login scripts. Controlling the Execution of Cmdlets Have you ever opened a CMD interpreter prompt, typed in a command, and pressed Enter so you could see what happens? If that command happens to be Format C:\, are you sure you want to format your C drive? There are several arguments that can be passed to cmdlets to control the way they execute. These arguments will be examined in this section. 19 8 Windows PowerShell Scripting Guide Tip Most of the Windows PowerShell cmdlets support a prototype mode that can be entered by using the -whatif parameter. The implementation of the whatif switch can be decided by the person developing the cmdlet; however, the Windows PowerShell team recommends that developers implement -whatif if the cmdlet will make changes to the system. Although not all cmdlets support these arguments, most of the cmdlets included with Windows PowerShell do. The three ways to control execution are -whatif, -confirm, and suspend. Suspend is not an argument that gets supplied to a cmdlet, but it is an action you can take at a confirmation prompt, and is therefore another method of controlling execution. To use -whatif, first enter the cmdlet at a Windows PowerShell prompt. Then type the -whatif parameter after the cmdlet. The use of the -whatif argument is illustrated in the following WhatIf.txt example. On the first line, launch Notepad. This is as simple as typing the word notepad as shown in the path. Next, use the Get-Process cmdlet to search for all processes that begin with the name note. In this example, there are two processes with a name beginning with notepad. Next, use the Stop-Process cmdlet to stop a process with the name of notepad, but because the outcome is unknown, use the -whatif parameter. Whatif tells you that it will kill two processes, both of which are named notepad, and it also gives the process ID number so you can verify if this is the process you wish to kill. Just for fun, once again use the Stop- Process cmdlet to stop all processes with a name that begins with the letter n. Again, wisely use the whatif parameter to see what would happen if you execute the command. WhatIf.txt PS C:\Users\edwils> notepad PS C:\Users\edwils> Get-Process note* Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName notepad notepad PS C:\Users\edwils> Stop-Process -processname notepad -WhatIf What if: Performing operation "Stop-Process" on Target "notepad (3052)". What if: Performing operation "Stop-Process" on Target "notepad (3140)". PS C:\Users\edwils> Stop-Process -processname n* -WhatIf What if: Performing operation "Stop-Process" on Target "notepad (3052)". What if: Performing operation "Stop-Process" on Target "notepad (3140)". So what happens if the whatif switch is not implemented? To illustrate this point, notice that in the following WhatIf2.txt example, when you use the New-Item cmdlet to create a new directory named mynewtest off the root, the whatif switch is implemented and it confirms that the command will indeed create C:\myNewtest. Note what happens, however, when you try to use the whatif switch on the Get-Help cmdlet. You might guess it would display a message such as, What if: Retrieving help information for 20 Chapter 1 The Shell in Windows PowerShell 9 Get-Process cmdlet. But what is the point? As there is no danger with the Get-Help cmdlet, there is no need to implement whatif on Get-Help. WhatIf2.txt PS C:\Users\edwils> New-Item -Name mynewtest -Path c:\ -ItemType directory -WhatIf What if: Performing operation "Create Directory" on Target "Destination: C:\myNewTest". PS C:\Users\edwils> get-help Get-Process -whatif Get-Help : A parameter cannot be found that matches parameter name 'whatif'. At line:1 char:28 + get-help Get-Process -whatif <<<< Best Practices The use of the -whatif parameter should be considered an essential tool in the network administrator s repertoire. Using it to model commands before execution can save hours of work each year. Confirming Commands As you saw in the previous section, you can use -whatif to create a prototype cmdlet in Windows PowerShell. This is useful for checking what a command will do. However, to be prompted before the command executes, use the -confirm switch. In practice, using the -confirm switch can generally take the place of -whatif, as you will be prompted before the action occurs. This is shown in the ConfirmIt.txt example that follows. In the ConfirmIt.txt file, first launch Calculator (Calc.exe). Because the file is in the path, you don t need to hard-code either the path or the extension. Next, use Get-Process with the c* wildcard pattern to find all processes that begin with the letter c. Notice that there are several process names on the list. The next step is to retrieve only the Calc.exe process. This returns a more manageable result set. Now use the Stop-Process cmdlet with the -confirm switch. The cmdlet returns the following information: Confirm Are you sure you want to perform this action? Performing operation "Stop-Process" on Target "calc (2924)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): You will notice this information is essentially the same as the information provided by the whatif switch but it also provides the ability to perform the requested action. This can save time when executing a large number of commands. ConfirmIt.txt PS C:\Users\edwils> calc PS C:\Users\edwils> Get-Process. A CIP catalogue record for this book is available from the British Library. PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright 2007 by Ed Wilson All rights reserved. No part of the contents of this book may Microsoft" Windows8 Home Server Paul MeFedries Microsoft" Windows8 Home Server I UNLEASHED Second Edition 800 East 96th Street, Indianapolis, Indiana 46240 USA Table of Contents Introduction 1 Part I Unleashing Windows Home Server Configuration Windows PowerShell Essentials Windows PowerShell Essentials Windows PowerShell Essentials Edition 1.0. This ebook is provided for personal use only. Unauthorized use, reproduction and/or distribution strictly prohibited. All rights Training Guide: Configuring Windows8 8 Training Guide: Configuring Windows8 8 Scott D. Lowe Derek Schauland Rick W. Vanover Introduction System requirements Practice setup instructions Acknowledgments Errata & book support We want to hear from GP REPORTS VIEWER USER GUIDE GP Reports Viewer Dynamics GP Reporting Made Easy GP REPORTS VIEWER USER GUIDE For Dynamics GP Version 2015 (Build 5) Dynamics GP Version 2013 (Build 14) Dynamics GP Version 2010 (Build 65) Last updated Authoring for System Center 2012 Operations Manager Authoring for System Center 2012 Operations Manager Microsoft Corporation Published: November 1, 2013 Authors Byron Ricks Applies To System Center 2012 Operations Manager System Center 2012 Service Pack XMap 7 Administration Guide. Last updated on 12/13/2009 XMap 7 Administration Guide Last updated on 12/13/2009 Contact DeLorme Professional Sales for support: 1-800-293-2389 Page 2 Table of Contents XMAP 7 ADMINISTRATION GUIDE... 1 INTRODUCTION... 5 DEPLOYING STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER Notes: STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER 1. These instructions focus on installation on Windows Terminal Server (WTS), but are applicable RealPresence Platform Director RealPresence CloudAXIS Suite Administrators Guide Software 1.3.1 GETTING STARTED GUIDE Software 2.0 June 2015 3725-66012-001B RealPresence Platform Director Polycom, Inc. 1 RealPresence Platform Director Metalogix SharePoint Backup. Advanced Installation Guide. Publication Date: August 24, 2015 Metalogix SharePoint Backup Publication Date: August 24, 2015 All Rights Reserved. This software is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this ILTA HANDS ON Securing Windows 7 Securing Windows 7 8/23/2011 Table of Contents About this lab... 3 About the Laboratory Environment... 4 Lab 1: Restricting Users... 5 Exercise 1. Verify the default rights of users... 5 Exercise 2. Adding Using Logon Agent for Transparent User Identification Using Logon Agent for Transparent User Identification Websense Logon Agent (also called Authentication Server) identifies users in real time, as they log on to domains. Logon Agent works with the Websense Security Explorer 9.5. User Guide 2014 Dell Inc. ALL RIGHTS RESERVED. This guide contains proprietary information protected by copyright. The software described in this guide is furnished under a software license or nondisclosure agreement. Installing Active Directory Installing Active Directory 119 Installing Active Directory Installing Active Directory is an easy and straightforward process as long as you planned adequately and made the necessary decisions beforehand. Advanced Event Viewer Manual Advanced Event Viewer Manual Document version: 2.2944.01 Download Advanced Event Viewer at: Page 1 Introduction Advanced Event Viewer is an award winning application Windows" 7 Desktop Support Windows" 7 Desktop Support and Administration Real World Skills for MCITP Certification and Beyond Darril Gibson WILEY Wiley Publishing, Inc. Contents Introduction xxiii Chapter 1 Planning for the Installation Deploying Remote Desktop Connection Broker with High Availability Step-by-Step Guide Deploying Remote Desktop Connection Broker with High Availability Step-by-Step Guide Microsoft Corporation Published: May 2010 Abstract This guide describes the steps for configuring Remote Desktop Connection Special Edition for FastTrack Software 08/14 The magazine for professional system and networkadministration Special Edition for FastTrack Software Tested: FastTrack Automation Studio TESTS I FastTrack Automation Studio Powershell Management for Defender Powershell Management for Defender 2012 Quest Software, Inc. ALL RIGHTS RESERVED. This guide contains proprietary information protected by copyright. The software described in this guide is furnished Interworks. Interworks Cloud Platform Installation Guide Interworks Interworks Cloud Platform Installation Guide Published: March, 2014 This document contains information proprietary to Interworks and its receipt or possession does not convey any rights to reproduce, Archive Attender Version 3.5 Archive Attender Version 3.5 Getting Started Guide Sherpa Software (800) 255-5155 Page 1 Under the copyright laws, neither the documentation nor the software can be copied, photocopied, Silect Software s MP Author Silect MP Author for Microsoft System Center Operations Manager Silect Software s MP Author User Guide September 2, 2015 Disclaimer The information in this document is furnished for informational use only, DC Agent Troubleshooting DC Agent Troubleshooting Topic 50320 DC Agent Troubleshooting Web Security Solutions v7.7.x, 7.8.x 27-Mar-2013 This collection includes the following articles to help you troubleshoot DC Agent installation Installing Windows XP Professional CHAPTER 3 Installing Windows XP Professional After completing this chapter, you will be able to: Plan for an installation of Windows XP Professional. Use a CD to perform an attended installation of Windows Elevation requirements... 18 Hyper-V Remote Management Configuration Script Contents Hyper-V Remote Management Configuration Script... 1 Introduction... 3 License... 4 Quick start guide... 4 About... 5 Installation & Removal... 5 Exchange Mailbox Protection Whitepaper Exchange Mailbox Protection Contents 1. Introduction... 2 Documentation... 2 Licensing... 2 Exchange add-on comparison... 2 Advantages and disadvantages of the different PST formats... 3 2. How Exchange Administrator s Guide MAPILab Disclaimers for Exchange Administrator s Guide document version 1.8 MAPILab, December 2015 Table of contents Intro... 3 1. Product Overview... 4 2. Product Architecture and Basic Concepts... 4 Troubleshooting File and Printer Sharing in Microsoft Windows XP Operating System Troubleshooting File and Printer Sharing in Microsoft Windows XP Microsoft Corporation Published: November 2003 Updated: August 2004 Abstract File and printer sharing for Microsoft Windows Installation Instruction STATISTICA Enterprise Small Business Installation Instruction STATISTICA Enterprise Small Business Notes: ❶ The installation of STATISTICA Enterprise Small Business entails two parts: a) a server installation, and b) workstation installations Hosting Users Guide 2011 Hosting Users Guide 2011 eofficemgr technology support for small business Celebrating a decade of providing innovative cloud computing services to small business. Table of Contents Overview... 3 Configure Module 5: Implementing Group Policy Module 5: Implementing Group Policy Contents Overview 1 Lesson: Creating and Configuring GPOs 2 Lesson: Configuring Group Policy Refresh Rates and Group Policy Settings 16 Lesson: Managing GPOs 27 Lesson: Enterprise Vault Installing and Configuring Enterprise Vault Installing and Configuring Enterprise Vault 6.0 Legal Notice Copyright 2005 Symantec Corporation. All rights reserved. Symantec, the Symantec Logo, VERITAS, the VERITAS Logo, and Enterprise HP IMC Firewall Manager HP IMC Firewall Manager Configuration Guide Part number: 5998-2267 Document version: 6PW102-20120420 Legal and notice information Copyright 2012 Hewlett-Packard Development Company, L.P. No part of thisWrix Server Configuration Monitor NetWrix Server Configuration Monitor Version 2.2 Quick Start Guide Contents NetWrix Server Configuration Monitor Quick Start Guide 1. INTRODUCTION... 3 1.1 KEY FEATURES... 3 1.2 LICENSING... 4 1.3 HOW SPECOPS DEPLOY / OS 4.6 DOCUMENTATION Technical documentation: SPECOPS DEPLOY / OS 4.6 DOCUMENTATION By Shay Byrne, Product Manager 1 Getting Started... 4 1.1 Specops Deploy / OS Supported Configurations...4 1.2 Specops Deploy and Active Directory... Redirect Printer Port to LPT3 for Printing to Local Printer in Remote Desktop Session Redirect Printer Port to LPT3 for Printing to Local Printer in Remote Desktop Session Remote Desktop client CAN redirect printing to the local printer while controlling a host. IBM WebSphere Application Server Version 7.0 IBM WebSphere Application Server Version 7.0 Centralized Installation Manager for IBM WebSphere Application Server Network Deployment Version 7.0 Note: Before using this information, be sure to read. Desktop Surveillance Help Desktop Surveillance Help Table of Contents About... 9 What s New... 10 System Requirements... 11 Updating from Desktop Surveillance 2.6 to Desktop Surveillance 3.2... 13 Program Structure... 14 Getting WS_FTP Professional 12 WS_FTP Professional 12 Tools Guide Contents CHAPTER 1 Introduction Ways to Automate Regular File Transfers...5 Check Transfer Status and Logs...6 Building a List of Files for Transfer...6 Transfer Files Version 3.8. Installation Guide Version 3.8 Installation Guide Copyright 2007 Jetro Platforms, Ltd. All rights reserved. This document is being furnished by Jetro Platforms for information purposes only to licensed users of the Jetro WhatsUp Gold v16.2 Installation and Configuration Guide WhatsUp Gold v16.2 Installation and Configuration Guide Contents Installing and Configuring Ipswitch WhatsUp Gold v16.2 using WhatsUp Setup Installing WhatsUp Gold using WhatsUp Setup... 1 Security guidelines Table of Contents. CHAPTER 1 About This Guide... 9. CHAPTER 2 Introduction... 11. CHAPTER 3 Database Backup and Restoration... 15 Table of Contents CHAPTER 1 About This Guide......................... 9 The Installation Guides....................................... 10 CHAPTER 2 Introduction............................ 11 Required Administrator s Guide Attachment Save for Exchange Administrator s Guide document version 1.8 MAPILab, December 2015 Table of contents Intro... 3 1. Product Overview... 4 2. Product Architecture and Basic Concepts... 4 3. System Deploying System Center 2012 R2 Configuration Manager Deploying System Center 2012 R2 Configuration Manager This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. User Guide. Version 3.2. Copyright 2002-2009 Snow Software AB. All rights reserved. Version 3.2 User Guide Copyright 2002-2009 Snow Software AB. All rights reserved. This manual and computer program is protected by copyright law and international treaties. Unauthorized reproduction or Installing GFI MailEssentials Installing GFI MailEssentials Introduction to installing GFI MailEssentials This chapter shows you how to install and configure GFI MailEssentials. GFI MailEssentials can be installed in two ways: Installation Tools & Techniques for Remote Help Desk Support Tools & Techniques for Remote Help Desk Support Jeff Hicks 1. 8 0 0. 8 1 3. 6 4 1 5 w w w. s c r i p t l o g i c. c o m / s m b I T 2011 ScriptLogic Corporation ALL RIGHTS RESERVED. ScriptLogic, the ScriptLogic Nexio Connectus with Nexio G-Scribe Nexio Connectus with Nexio G-Scribe 2.1.2 3/20/2014 Edition: A 2.1.2 Publication Information 2014 Imagine Communications. Proprietary and Confidential. Imagine Communications considers this document and Direct Storage Access Using NetApp SnapDrive. Installation & Administration Guide Direct Storage Access Using NetApp SnapDrive Installation & Administration Guide SnapDrive overview... 3 What SnapDrive does... 3 What SnapDrive does not do... 3 Recommendations for using SnapDrive... TROUBLESHOOTING GUIDE Lepide Software LepideAuditor Suite TROUBLESHOOTING GUIDE This document explains the troubleshooting of the common issues that may appear while using LepideAuditor Suite. Copyright LepideAuditor Suite, WhatsUp Gold v16.1 Installation and Configuration Guide WhatsUp Gold v16.1 Installation and Configuration Guide Contents Installing and Configuring Ipswitch WhatsUp Gold v16.1 using WhatsUp Setup Installing WhatsUp Gold using WhatsUp Setup... 1 Security guidelines WINDOWS SERVER HACKS. HLuHB Darmstadt. O'REILLY 5 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo WINDOWS SERVER HACKS HLuHB Darmstadt 15899417 O'REILLY 5 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo Contents Credits Foreword Preface vii xvii xix Chapter 1. General Administration 1 After going through this lesson you would be able to: 18 :: Data Entry Operations 2 Operating System 2.1 INTRODUCTION The operating system in these days uses a graphical user interface (GUI). Here you do not have to remember all the commands by heart. The STATISTICA VERSION 12 STATISTICA ENTERPRISE SMALL BUSINESS INSTALLATION INSTRUCTIONS STATISTICA VERSION 12 STATISTICA ENTERPRISE SMALL BUSINESS INSTALLATION INSTRUCTIONS Notes 1. The installation of STATISTICA Enterprise Small Business entails two parts: a) a server installation, and b) TimeValue Software Due Date Tracking and Task Management Software User s Guide TM TimeValue Software Due Date Tracking and Task Management Software File In Time Software User s Guide Copyright TimeValue Software, Inc. (a California Corporation) 1992-2010. All rights Pearl Echo Installation Checklist Pearl Echo Installation Checklist Use this checklist to enter critical installation and setup information that will be required to install Pearl Echo in your network. For detailed deployment instructions, Web-Access Security Solution WavecrestCyBlock Client Version 2.1.13 Web-Access Security Solution UserGuide Copyright Copyright 1996-2014, Wavecrest Computing, Inc. All rights reserved. Use of this product and this Step-by-Step Guide for Microsoft Advanced Group Policy Management 4.0 Step-by-Step Guide for Microsoft Advanced Group Policy Management 4.0 Microsoft Corporation Published: September 2009 Abstract This step-by-step guide describes a sample scenario for installing Microsoft Things I wish I d known when I started using PowerShell PowerShell Day 1 Things I wish I d known when I started using PowerShell John D. Cook First released 9 April 2009, last updated 1 February 2010 Introduction This booklet captures Exclaimer Mail Archiver Deployment Guide - Outlook Add-In Contents About This Guide... 3 System Requirements... 4 Software... 4 Installation Files... 5 Deployment Preparation... 6 Installing the Add-In Manually... Spector 360 Deployment Guide. Version 7 Spector 360 Deployment Guide Version 7 December 11, 2009 Table of Contents Deployment Guide...1 Spector 360 DeploymentGuide... 1 Installing Spector 360... 3 Installing Spector 360 Servers (Details)... OneStop Reporting 3.7 Installation Guide. Updated: 2013-01-31 OneStop Reporting 3.7 Installation Guide Updated: 2013-01-31 Copyright OneStop Reporting AS Table of Contents System Requirements... 1 Obtaining the Software... 2 Obtaining Your Integrated Virtual Debugger for Visual Studio Developer s Guide VMware Workstation 8.0 Integrated Virtual Debugger for Visual Studio Developer s Guide VMware Workstation 8.0 This document supports the version of each product listed and supports all subsequent versions until the document
http://docplayer.net/1841231-To-learn-more-about-this-book-visit-microsoft-learning-at-http-www-microsoft-com-mspress-books-9541-aspx.html
CC-MAIN-2017-17
en
refinedweb
MediaPlayer with HLS doesn't switch resolution on OSX.... Hello, Doing some tests with HLS and MediaPlayer. Here a small test : import QtQuick 2.8 import QtQuick.Window 2.2 import QtMultimedia 5.9 Window { visible: true width: 1280 height: 720 title: qsTr("test") MediaPlayer { id: mediaplayer source: "" } VideoOutput { anchors.fill: parent source: mediaplayer } MouseArea { id: playArea anchors.fill: parent onPressed: mediaplayer.play(); } } The player stays on the same resolution on OSX ( the smaller one ). On iOS, it's switching, but above the native screen resolution of the device.... ( on iPhone 6 I reach to 1920x1080 ) Am I doing something wrong ? Thanks for your help. Best Regards. Scoob' same here +1 Is there some changes in Qt5.10 ?
https://forum.qt.io/topic/84133/mediaplayer-with-hls-doesn-t-switch-resolution-on-osx
CC-MAIN-2018-39
en
refinedweb
import socket import thread def handle(client_socket, address): while True: data = client_socket.recv(512) if data.startswith("exit"): # if data start with "exit" client_socket.close() # close the connection with the client break client_socket.send(data) # echo the received string # opening the port 1075 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((socket.gethostname(),1075)) server.listen(2) while True: # listen for incoming connections client_socket, address = server.accept() print "request from the ip",address[0] # spawn a new thread that run the function handle() thread.start_new_thread(handle, (client_socket, address))And now we can use telnet to communicate with the server application: $ telnet localhost 1075 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. hi hi echo this! echo this! exit Connection closed by foreign host.
https://glowingpython.blogspot.com/2011/04/how-to-implment-multithread-echo-server.html
CC-MAIN-2018-39
en
refinedweb
This is a more complex version of my previous example. This time in addition to making the Alert control’s text non-selectable, we use an embedded font for the Alert title, message, buttons, as well as edit the drop shadow, remove the rounded corners, and remove the button skins. Since this example uses the mx_internal namespace, you can't always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk. <?xml version="1.0" encoding="utf-8"?> <!-- --> <mx:Application <!-- Used by the ApplicationControlBar control. --> <mx:String <mx:String <!-- Used by the Alert control. --> <mx:StringThe quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.</mx:String> <mx:StringThe quick brown fox jumped over the lazy dog?</mx:String> <mx:Script> <![CDATA[ import mx.controls.Alert; private var a:Alert; private function init():void { var appInfo:LoaderInfo = Application.application.loaderInfo; /* Just grab the filename from the SWF URL. */ fileName = (appInfo.url).split("/").pop(); /* Convert bytes to kilobytes. */ fileSize = (appInfo.bytesTotal / 1024).toFixed(2); } private function showAlert():void { Alert. <mx:Label </mx:ApplicationControlBar> <!-- Click to launch Alert control. --> <mx:Button </mx:Application> View source is enabled in the following application. [Base02] 17 thoughts on “Styling the Flex Alert control” I tried compiling this example and it does work fine except for the button face which still have the rounded borders. The same thing happened when i tried another example from this site. i’m not sure, but i think it’s the line skin: ClassReference(null); that does not work. any idea? I’m using the flex sdk 2.0.1 with hotfix 1. I’d like to be able to use the button class without the standard face so i’d really like this to work. nl, I believe the “skin” style is new to Flex 3. (Flex 2.0.1) (Flex 3 beta) In Flex 2 you may need to set the various skin states (disabledSkin, downSkin, overSkin, upSkin, and the various selected*Skin styles) separately. Sorry for the confusion, I primarily do all these entries in Flex 3 and don’t do much backwards compatibility testing (as you probably discovered). Peter ok! That makes sense. Thanks for the info. Hi, I was wondering if there is a way to change the blur en transparant white effect of the Alert class… nocturnalfrog, modalTransparencyBlur, modalTransparency, modalTransparencyColor, and modalTransparencyDuration. For more information, and an example, see “Changing a modal Alert control’s blur, transparency and transparency color”. Hope that helps, Peter How do you switch the yesButton/noButton actions ? I solved as following: How and why we can not be able to resize the Alert popup. It is set to a certain size and i still couldnt find a way to resize it. If you use large typeface everything is overlaping. It is just really anoying. Ali Tan Ucer, Does something like this work for you? Peter How did you know about all proprerties to Style Alert Class? Nivaldo, By reading the docs, of course! :) Peter? Thanks in advance, C Hi .. all anyone can tell me how to accept input from user through AlertBox, i am trying but m not getting the way .. pls help Hi guys, How can I include HTML formatted message in my Alert? I’ve tried to use myAlert.mx_internal::alertForm.mx_internal::textField.htmlText=”text here”; or something like this, but the Alert box doesn´t adapt itself according to the text. Any idea? Thanks in advance, AToyansk Does anyone has an idea about “ciacob’s” question? (2 question/replies above this post) I hav e the same problem. Any help? ==================== Following is “ciacob’s” problem for ur reference. — ciacob May 8, 2009 at 6:14 am? Peter, Would you consider updating this for Flex 4? I cannot get it to work… thanks @Mark, This isn’t exactly the same, but fairly close: Peter
http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/
CC-MAIN-2018-39
en
refinedweb
Công Nghệ Thông Tin Quản trị mạng Tải bản đầy đủ - 0 (trang) Drip: A Stream-Based Storage System Drip: A Stream-Based Storage System Tải bản đầy đủ - 0trang 182 • • • • • Chapter 9. Drip: A Stream-Based Storage System Middleware for batch processing Wiki system storage and full-text search system Twitter timeline archiving and its bot framework Memos while using irb Is this still too vague? Starting with the next section, I’ll introduce how to use Drip by comparing it with other familiar data structures: Queue as a process coordination structure and Hash as an object storage. 9.2 Drip Compared to Queue Let’s first compare Drip with Queue to understand how process coordination works differently. We use the Queue class that comes with Ruby. Queue is a FIFO buffer in which you can put any object as an element. You can use push to add an object and pop to take it out. Multiple threads can pop at the same time, but an element goes to only one thread. The same element never goes to multiple threads with pop. If you pop against an empty Queue, then pop will block. When a new object is added, then the object reaches to only the thread that acquired the object. Drip has an equivalent method called read. read will return an element newer than the specified cursor. However, Drip doesn’t delete the element. When multiple threads read with the same cursor, Drip returns the same element. Both Drip and Queue can wait for the arrival of a new element. The key difference is whether the element is consumed. Queue#pop will consume the element, but Drip#read doesn’t consume elements. This means multiple people can read the same element repeatedly. In Rinda, if you lose a tuple because of an application bug or system crash, it means that the entire system could go down. In Drip, you never need to worry about the loss of an element. Let’s see how this works in Drip with code. Basic Operations with Read and Write Methods You can use two methods to compare with Queue. Drip#write(obj, *tags) Drip#write adds an element to Drip. This is the only operation to change the state of Drip. This operation stores an element obj into Drip and returns the report erratum • discuss Drip Compared to Queue • 183 key that you use to retrieve the object. You can also specify tags to make object access easier, which I’ll explain in Using Tags, on page 187. Another method is read. Drip#read(key, n=1, at_least=1, timeout=nil) This is the most basic operation for browsing Drip. key is a cursor, and this method returns n number of arrays that consist of key and value pairs added later than the requested key. n specifies the number of matched pairs to return. You can configure it so that the method is blocked until at_least number of elements arrive with timeout. In short, you can specify “Give me n elements, but wait until at_least elements are there.” Installing and Starting Drip Oops, we haven’t installed Drip yet. Drip depends on an external library called RBTree. If you use gem, it should install the dependency as well. gem install drip Next, let’s start the Drip server. Drip uses a plain-text file as a default secondary storage. To create a Drip object, you need to specify a directory. The next script generates Drip and serves via dRuby. drip_s.rb require 'drip' require 'drb' class Drip def quit Thread.new do synchronize do |key| exit(0) end end end end drip = Drip.new('drip_dir') DRb.start_service('druby://localhost:54321', drip) DRb.thread.join The quit method terminates the process via RMI. The script waits until Drip doesn’t write to any secondary storage using synchronize (see Locking Single Resources with Mutex, on page 88 for more detail). report erratum • discuss 184 • Chapter 9. Drip: A Stream-Based Storage System Start Drip like this: % ruby drip_s.rb It won’t print out anything; it simply runs as a server. MyDrip I prepared a single-user Drip server called MyDrip. This works only for POSIXcompliant operating systems (such as Mac OS X), but it’s very handy. It creates a .drip storage directory under your home directory and communicates with the Unix domain socket. Since this is just a normal Unix domain socket, you can restrict permission and ownership using the file system. Unlike TCP, a Unix socket is handy, because you can have your own socket file descriptor on your own path, and you don’t have to worry about port conflict with other users. To use MyDrip, you need to require my_drip (my_drip.rb comes with Drip gem, so you don’t have to download the file by yourself). Let’s invoke the server. # terminal 1 % irb -r my_drip --prompt simple >> MyDrip.invoke => 51252 >> MyDrip.class => DRb::DRbObject MyDrip is actually a DRbObject pointing to the fixed Drip server port, but it also has a special invoke method. MyDrip.invoke forks a new process and starts a Drip daemon if necessary. If your own MyDrip server is already running, it finishes without doing anything. Use MyDrip.quit when you want to stop MyDrip. MyDrip is a convenient daemon to store objects while running irb. In my environment, I always have MyDrip up and running to archive my Twitter timeline. I also use it to take notes or to use as middleware for a bot. I always require my_drip so that I can write a memo to MyDrip while running irb. You can insert the following line in .irbrc to include it by default: require 'my_drip' Going forward, we’ll use Drip for most of the exercises. If you can’t use MyDrip in your environment, you can create the following client: drip_d.rb require 'drb/drb' MyDrip = DRbObject.new_with_uri('druby://localhost:54321') You can use drip_d.rb and drip_s.rb as an alternative to MyDrip. report erratum • discuss Drip Compared to Queue • 185 Peeking at Ruby Internals Through Fixnum Speaking of a Fixnum class in a 64-bit machine, let’s find out the range of Fixnum. First let’s find out the largest Fixnum. Let’s start from 63 and make it smaller. (2 ** 63).class (2 ** 62).class (2 ** 61).class #=> Bignum #=> Bignum #=> Fixnum It looks like the border of Bignum and Fixnum is somewhere between 2 ** 62 and 2 ** 61. Let’s try it with 2 ** 62 – 1. (2 ** 62 - 1).class #=> Fixnum Found it! 2 ** 62 - 1 is the biggest number you can express with Fixnum. Let’s convert this into Time using Drip’s key generation rule. Time.at(* (2 ** 62 - 1).divmod(1000000)) #=> 148108-07-06 23:00:27 +0900 How about the smallest Fixnum? As you may have guessed, it is -(2 ** 62). This is equivalent to a 63-bit signed integer, not 64-bit. Fixnum in Ruby has a close relationship with object representation. Let’s find out the object_id of an integer. 0.object_id #=> 1 1.object_id #=> 3 2.object_id #=> 5 (-1).object_id #=> -1 (-2).object_id #=> -3 The object_id of Fixnum n is always set to 2 * n + 1. Inside Ruby, objects are identified by pointer width. Most objects show the allocated area, but that won’t be very efficient to allocate memory for Fixnum. To avoid the inefficiency, Ruby has a rule of treating objects as integers if the last 1 bit is 1. Because this rule takes up 1 bit, the range of Fixnum is a 63-bit signed char rather than 64-bit. By the way, it will be a 31-bit signed integer for a 32-bit machine. There are also objects with a special object_id. Here’s the list: [false, true, nil].collect {|x| x.object_id} #=> [0, 2, 4] And that’s our quick look into the world of Ruby internals. Comparing with Queue Again Let’s experiment while MyDrip (or the equivalent drip_s.rb) is up and running. Let’s add two new objects using the write method. As explained earlier, write is the only method to change the state of Drip. The response of write returns the key that’s associated with the added element. The key is an integer generated from a timestamp (usec). The number will be a Fixnum class in a 64-bit machine. report erratum • discuss 186 • Chapter 9. Drip: A Stream-Based Storage System # terminal 2 % irb -r my_drip --prompt simple >> MyDrip.write('Hello') => 1312541947966187 >> MyDrip.write('world') => 1312541977245158 Next, let’s read data from Drip. # terminal 3 % irb -r my_drip --prompt simple >> MyDrip.read(0, 1) => [[1312541947966187, "Hello"]] read is a method to read n number of elements since the specified cursor, and it returns an array consisting of a key and value pair. To read elements in order, you can move the cursor as follows: >> => >> => >> => k = 0 0 k, v = MyDrip.read(k, 1)[0] [1312541947966187, "Hello"] k, v = MyDrip.read(k, 1)[0] [1312541977245158, "World"] So far, you’ve read two elements. Let’s try to read one more. >> k, v = MyDrip.read(k, 1)[0] It will be blocked since there are no elements newer than k. If you add a new element from terminal 2, it will unblock and be able to read the object. # terminal 2 >> MyDrip.write('Hello, Again') => 1312542657718320 >> k, v = MyDrip.read(k, 1)[0] => [1312542657718320, "Hello, Again"] How did it go? Were you able to simulate the waiting operation? Let’s increase the number of the listener and start reading from 0. terminal 4 % irb -r my_drip --prompt simple >> k = 0 => 0 >> k, v = MyDrip.read(k, 1)[0] => [1312541947966187, "Hello"] >> k, v = MyDrip.read(k, 1)[0] => [1312541977245158, "World"] >> k, v = MyDrip.read(k, 1)[0] => [1312542657718320, "Hello, Again"] report erratum • discuss Drip Compared to Hash • 187 You should be able to read the same element. Unlike Queue, Drip doesn’t consume elements, so you can keep reading the same information. Instead, you need to specify where to read, every time you request. Let’s try to restart MyDrip. The quit method terminates the process when no one is writing. Call invoke to restart. MyDrip.invoke may take a while to start up if the log size is big. # terminal 1 >> MyDrip.quit => # >> MyDrip.invoke => 61470 Let’s call the read method to check whether you recovered the previous state. # terminal 1 >> MyDrip.read(0, 3) => [[1312541947966187, "Hello"], [1312541977245158, "World"], [1312542657718320, "Hello, Again"]] Phew, looks like it’s working fine. Let’s recap what we’ve learned so far. Drip is similar to Queue, where you can retrieve data in a time order, and also you can wait for new data to arrive. It’s different because data does not decrease. You can read the same elements from different processes, and the same process can read the same element again and again. You may have experienced that batch operations tend to stop often while developing them as well as running them in a production environment. With Drip, you can work around this if you make use of the functionality because you can restart from the middle many times. So far, we’ve seen two basic operations, write and read, in comparison with Queue. 9.3 Drip Compared to Hash In this section, you’ll learn advanced usage of Drip by comparing it to KVS or Hash. Using Tags Drip#write will allow you to store an object with tags. The tags must be instances of String. You can specify multiple tags for one object. You can read with tag names, which lets you retrieve objects easily. By leveraging these tags, you can simulate the behavior of Hash with Drip. report erratum • discuss 188 • Chapter 9. Drip: A Stream-Based Storage System Let’s treat tags as Hash keys. “write with tags” in Drip is equivalent to “set a value to a key” in Hash. “read the latest value with the given tag” is equivalent to reading a value from Hash with the given tag. Since “the latest value” in Drip is equivalent to a value in Hash, “the older than the latest value” in Drip is similar to a Hash with version history. Accessing Tags with head and read_tag Methods In this section, we’ll be using the head and read_tag methods. Drip#head(n=1, tag=nil) head returns an array of the first n elements. When you specify tags, then it returns n elements that have the specified tags. head doesn’t block, even if Drip has fewer than n elements. It only views the first n elements. Drip#read_tag(key, tag, n=1, at_least=1, timeout=nil) read_tag has a similar operation to read, but it allows you to specify tags. It only reads elements with the specified tags. If elements newer than the specified keys don’t have at_least elements, then it will block until enough elements arrive. This lets you wait until elements with certain tags are stored. Experimenting with Tags Let’s emulate the behavior of Hash using head and read_tag. We’ll keep using the MyDrip we invoked earlier. First, let’s set a value. This is how you usually set a value in a Hash. hash['seki.age'] = 29 And here is the equivalent operation using Drip. You write a value 29 with the tag seki.age. >> MyDrip.write(29, 'seki.age') => 1313358208178481 Let’s use head to retrieve the value. Here is the command to take the first element with a seki.age tag. >> MyDrip.head(1, 'seki.age') => [[1313358208178481, 29, "seki.age"]] The element consists of [key, value, tags] as an array. If you’re interested only in reading values, you can assign key and value into different variables as follows: report erratum • discuss Drip Compared to Hash >> => >> => • 189 k, v = MyDrip.head(1, 'seki.age')[0] [[1313358208178481, 29, "seki.age"]] v 29 Let’s reset the value. Here is the equivalent operation in Hash: hash['seki.age'] = 49 To change the value of seki.age to 49 in Drip, you do exactly the same as before. You write 49 with the tag seki.age. Let’s try to check the value with head. >> => >> => MyDrip.write(49, 'seki.age') 1313358584380683 MyDrip.head(1, 'seki.age') [[1313358584380683, 49, "seki.age"]] You can check the version history by retrieving the history data. Let’s use head to take the last ten versions. >> MyDrip.head(10, 'seki.age') => [[1313358208178481, 29, "seki.age"], [1313358584380683, 49, "seki.age"]] We asked for ten elements, but it returned an array with only two elements, because that’s all Drip has for seki.age tags. Multiple results are ordered from older to newer. What happens if you try to read a nonexistent tag (key in Hash)? >> MyDrip.head(1, 'sora_h.age') => [] It returns an empty array. It doesn’t block either. head is a nonblocking operation and returns an empty array if there are no matches. If you want to wait for a new element of a specific tag, then you should use read_tag. >> MyDrip.read_tag(0, 'sora_h.age') It now blocks. Let’s set up the value from a different terminal. >> MyDrip.write(12, 'sora_h.age') => 1313359385886937 This will unblock the read_tag and return the value that you just set. >> MyDrip.read_tag(0, 'sora_h.age') => [[1313359385886937, 12, "sora_h.age"]] Let’s recap again. In this section, we saw that with tags we can simulate the basic operation of setting and reading values from Hash. report erratum • discuss 190 • Chapter 9. Drip: A Stream-Based Storage System The difference is as follows: • You can’t remove an element. • It has a history of values. • There are no keys/values. You can’t remove an element like you do in Hash, but you can work around by adding nil or another special object that represents the deleted status. As a side effect of not being able to remove elements, you can see the entire history of changes. I didn’t create keys and each methods on purpose. It’s easy to create them, so I created them once but deleted them later. There are no APIs in Drip at this moment. To implement keys, you need to collect all elements first, but this won’t scale when the number of elements becomes very big. I assume this is why many distributed hash tables don’t have keys. There are also some similarities with TupleSpace. You can wait for new elements or their changes with read_tag. This is a limited version of read pattern matching in Rinda TupleSpace. You can wait until elements with certain tags arrive. This pattern matching is a lot weaker than Rinda’s pattern matching, but I expect that this is enough for the majority of applications. When I created Drip, I tried to make the specification narrower than that of Rinda so that it’s simple enough to optimize. Rinda represents an in-memory, Ruby-like luxurious world, whereas Drip represents a simple process coordination mechanism with persistency in mind. To verify my design expectations, we need a lot more concrete applications. In the previous two sections, we explored Drip in comparison with Queue and Hash. You can represent some interesting data structures using this simple append-only stream. You can stream the world using Drip because you can traverse most of the data structures one at a time. 9.4 Browsing Data with Key In this section, we will learn multiple ways to browse the data stored in Drip. In Drip, all the elements are stored in the order they were added. Browsing data in Drip is like time traveling. Most browsing APIs take the cursor as an argument. Let’s first see how keys are constructed and then see how to browse the data. report erratum • discuss Browsing Data with Key • 191 How Key Works Drip#write returns a key that corresponds to the element you stored. Keys are incremented integers, and the newly created key is always bigger than the older ones. Here’s the current implementation of generating a key: def time_to_key(time) time.tv_sec * 1000000 + time.tv_usec end Keys are integers generated from a timestamp. In a 64-bit machine, a key will be a Fixnum. The smallest unit of the key depends on μsec (microsecond), so it will collide if more than one element tries to run within the same μsec. When this happens, the new key will increment from the latest key by one. # "last" is the last (and the largest) key key = [time_to_key(at), last + 1].max Zero becomes the oldest key. Specify this number as a key when you want to retrieve the oldest element. Browsing the Timeline So far, we’ve tried the read, read_tag, and head methods for browsing. There are other APIs: read, read_tag, newer Browsing to the future head, older Browsing to the past In Drip, you can travel the timeline forward and backward using these APIs. You can even skip elements by using tags wisely. In this section, you’ll find out how to seek for certain elements using tags and then browse in order. The following pseudocode takes out four elements at a time. k is the cursor. You can browse elements in order by repeatedly passing the key of the last element to the cursor. while true ary = drip.read(k, 4, 1) ... k = ary[-1][0] end report erratum • discuss 192 • Chapter 9. Drip: A Stream-Based Storage System To emulate the preceding code, we’ll manually replicate the operation using irb. Is your MyDrip up and running? We also use MyDrip for this experiment. Let’s write some test data into Drip. # terminal 1 % irb -r my_drip --prompt simple >> MyDrip.write('sentinel', 'test1') => 1313573767321912 >> MyDrip.write(:orange, 'test1=orange') => 1313573806023712 >> MyDrip.write(:orange, 'test1=orange') => 1313573808504784 >> MyDrip.write(:blue, 'test1=blue') => 1313573823137557 >> MyDrip.write(:green, 'test1=green') => 1313573835145049 >> MyDrip.write(:orange, 'test1=orange') => 1313573840760815 >> MyDrip.write(:orange, 'test1=orange') => 1313573842988144 >> MyDrip.write(:green, 'test1=green') => 1313573844392779 The first element acts as an anchor to mark the time we started this experiment. Then, we wrote objects in the order of orange, orange, blue, green, orange, orange, and green. We added tags that corresponded with each color. # terminal 2 % irb -r my_drip --prompt simple >> k, = MyDrip.head(1, 'test1')[0] => [1313573767321912, "sentinel", "test1"] >> k => 1313573767321912 We first got a key of the anchor element with the “test1” tag. This is the starting point of this experiment. It’s a good idea to fetch this element with the fetch method. Then, we read four elements after the anchor. >> ary = MyDrip.read(k, 4) => [[1313573806023712, :orange, "test1=orange"], [1313573808504784, :orange, "test1=orange"], [1313573823137557, :blue, "test1=blue"], [1313573835145049, :green, "test1=green"]] Were you able to read as expected? Let’s update the cursor and read the next four elements. report erratum • discuss Tài liệu liên quan 699 the druby book Pass by Reference, Pass by Value Drip: A Stream-Based Storage System 699 the druby book -0 (trang) Tải bản đầy đủ ngay(0 tr) ×
https://toc.123doc.org/document/2692928-drip-a-stream-based-storage-system.htm
CC-MAIN-2018-39
en
refinedweb
That would definitely be useful for me. My game will have quite a few characters. Discuss audio games! You are not logged in. Please login or register. AudioGames.net Forum → Developers room → Heat Engine, a game engine for BGT games That would definitely be useful for me. My game will have quite a few characters. The map editor will able you to place actors on the map. A contextual menu will then be added to edit actors and modify every configurable attributes that they have. As soon as you will set a new attribute for your own actors, the editor will be able to place them and let you edit all its attributes. What around calling a "character editor"? Characters are normal actors, they just have more attributes, including footstep sounds, moving speed and all. If you are talking about dialogs, you have to know that H.E. has currently no dialog system implemented (I can't do anything by myself in just some weeks!). I'm currently struglling with opening/saving dialog boxes; no one made a correct system, at least correct enough to be included. Ah okay. So we code the actors, but the map editor is something like the interface builder of HE, when completed. That will be awesome, if it eventually gets to that point. Menus design is already done, I have been slowed by the need to program dialog boxes like choosing a file/dir to open/save. I have almost finished to make them. After that, I'll finish to rework the geometry system (quite simple in fact), and then I'll be able to release a simple version of the editor with updated engine Hi, Just wondering how things are going. You've been pretty quiet for the past couple months. Hope the project isn't giving you too much trouble! How i can use the inventory function in my game, include with the Heatengine? Someone help-me. Hi! Sorry Imaginatrix, I've been very busy theses days (I'm programing other games and I have to work ), and yes, Heat Engine is giving me troubles. For a lot of reasons, including: - the geometry representation (maps and all) is taking more time than expected to rework - i'm seriously planning to port Heat Engine on Java and stop BGT support Why? Because Java is fully object oriented, quite easy to understand (classes and interface, all that stuff), much more powerful, cross platform, providing a huge standart library, etc. My only problem is the sound and screen readers support, an d rewriting everything in another language (even if the code will be much simpler to understand for everyone). BGT limits me. Right now, this projects looks like a dead end if I don't change the language I think. Heat Engine has been designed to be powerful and for more complex games, and BGT isn't made for that. I may keep the editor in BGT and make the @pedrowille : this engine is quite complex, but you can dive inside the files and try to adapt the Inventory actor for your own game. If you want to make a game with the engine itself, given the help you asked in other threads, I don't think it is adapted for a complete beginner That's a shame. BGT seemed to do about everything I wanted it to, but it apparently struggles with certain things. Even so, I love it simply for the screen-reader support and will try and work out how to code things by hand and get them working. Python's still an option for me but I just want to make games, not learn everything there is to know about programming and get bored. It's ok Genroa, not problem. i think i''m sade, but i have trying make a game with my codes. but i need some help, and i not have it in my country or my languagem, and in english languagem, i need a help... Bgt is far from the only option for screen reader support. The Tolk library provides this functionality and has bindings available for numerous languages, including pure basic, c/c++, java, c# etc. Imaginatrix, Heat Engine in Java (if I do it) will provide the same built-in screen reader support and sound support So I'd have to learn Java? I started learning the basics of Python but that got boring fast. If I get bored learning how to do something, I won't be motivated to keep at it. That's why I like BGT so much—it focuses on gaming and gaming alone. BGT has a C/C++/Java like syntax. The syntax is almost the same, juste a little more simple (there's no handle system). and a lot of ready to use classes and tools will be available, far more than the current BGT version BGT version (Robots Factory main file): #include "HeatEngine\\Game.bgt" Game game("Robot Factory Demo"); void main() {!"); game.scene.setSoundEnvironment(); if(file_exists("Saves\\save.hemap")) game.config.setMapFile("Saves\\save.hemap"); else game.config.setMapFile("Maps\\level1.hemap"); game.load(); game.setListener("player"); [email protected] c1 = FactoryControler("player", true); int player1 = game.addLocalControler(c1); game.scene.generateGeometry(); game.run(); [email protected] score = cast<Score>(game.scene.getActorByName("score")); [email protected] rb = cast<RobotBuilder>(game.scene.getActorByName("rb")); alert("Score", score.getGoodEscaped()+" good robots were left intact on "+(rb.maxRobots-rb.totalFaulty)+"\n"+score.getBadEscaped()+" bad robot escaped on "+rb.totalFaulty+"!!"); } Java version of the same file: import HeatEngine.Game; class MyGame extends Game { public void static mainString[] args) { Game myGame = new MyGame("Robot Factory Demo"); GameSystem!"); myGame.load("Saves"+File.separator+"save.hemap"); myGame.setListener("player"); myGame.addController(new FactoryController("player", "c1", true)); myGame.run(); FactoryScore score = (FactoryScore) myGame.getScoreObject(); RobotBuilder rb = (RobotBuilder) myGame.getScene().getActorByName("rb"); alert("Score", score.getGoodEscaped()+" good robots were left intact on "+(rb.maxRobots-rb.totalFaulty)+"\n"+score.getBadEscaped()+" bad robot escaped on "+rb.totalFaulty+"!!"); } } There's not much changes! And one other cool thing, for people who may have tried to use the BGT version of the engine : creator a new custom actor required to override a lot of functions. In the Java version, there won't be anything else to do instead, thanks to reflection! Just finished a little Java lib using lwjgl JOAL, providing 3D sound based on the openAL technology, allowing to play sounds in two lines. Easier than I thought, I'm asking myself why I used BGT so much time! ...I am now considering going to Java. A little main method playing a looping sound, using my little lib: SoundSystem.initialize(); Sound testSound = new Sound("sounds\\good_robot.wav"); testSound.playLooped(); Thread.sleep(10000); SoundSystem.destroy(); There are methods letting you choosing the sound position and velocity (for doppler effet) with 3d vectors; one line for each method. Hey all. I am trying to learn the actual BGT language, but it looks like this, the BGT toolkit, is just something to compile with. How can I actually learn the language? There's a tutorial in the manual I thought this thing was dead. Where can I download it? The site in post #1 is down. how can i download this thing,all the links are not work Well help time. I got this one a static download link. Let's go downloading! I'm actually impressed anyone tried to use my project. When I released it, I almost never had any feedback. If someone still want to use it, I still have the latest up to date demos and archives. I would be interested in trying this, if it is easy to write. Although, I am looking to create an interactive-fiction type audio game, but yeah, I would give this a shot. I've actually been trying to find a working link to this project for a while now. I'd love to try and see what i can make with it. If anyone has it uploaded somewhere, that would be great. This engine is far from finished, but to prove you can already do quite some things with it in BGT, I built one little demo game and another demo showing a first person controller with firearms to use and test. The demo is complete with weapon's ammunition, reloading behavior and all. Here are new links for every broken link: Link to the engine: Link to engine source Link to the engine documentation: Link to engine doc Link to the factory game demo: Link to factory game demo Link to the weapon demo: Link to weapon demo i will post here more informations about the demos and the engine, if you want. If you decide to use it, even though it's written in BGT and the current stable version hasn't implemented full 3D sound with FMOD yet, I can help you in your project. But I would love to build a project with the people on this forum to build a new engine, on a more moderne and maintained language... AudioGames.net Forum → Developers room → Heat Engine, a game engine for BGT games
http://forum.audiogames.net/viewtopic.php?id=15395&p=4
CC-MAIN-2018-39
en
refinedweb
We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks. CCGL.h include error header file on iOS CCGL.h include error header file on iOS Bug #1453 [Closed] walzer@cocos2d-x.org 2012-09-10 08:52 - Status changed from New to Resolved - % Done changed from 0 to 100 Applied in changeset commit:04596d1bb5c75cd3bf24a8c73c41fba53618a1b5. walzer@cocos2d-x.org 2012-09-13 07:05 - Status changed from Resolved to Closed #include <OPenGLES/ES2/glext.h> should be changed to #include <OpenGLES/ES2/glext.h>
http://www.cocos2d-x.org/issues/1453
CC-MAIN-2018-39
en
refinedweb
Writing a custom viewer for glue¶ Motivation¶ The simple way of defining new custom viewers described in Writing a simple custom data viewer are well-suited to developing new custom viewers that include simple Matplotlib plots, and for now is limited to Qt-based viewers. But in some cases, you may want to write a data viewer with more customized functionality, or that doesn’t depend on Matplotlib or Qt and may use an existing third-party widget. In this tutorial, we will take a look at the pieces needed to build a data viewer. The sections here are relevant regardless of whether you are building a data viewer for e.g. Qt or Jupyter. If you are interested in building a Qt-based viewer, you can then proceed to Writing a custom viewer for glue with Qt. If you are interested in building a Matplotlib-based Qt viewer, you can then also make use of the glue.viewers.matplotlib sub-package to simplify things as described in Writing a custom viewer for glue with Qt and Matplotlib. Terminology¶ When we talk about a data viewer, we mean specifically one of the visualizations in glue (e.g. scatter plot, histogram, network diagram, etc.). Inside each visualization, there may be multiple datasets or subsets shown. For example, a dataset might be shown as markers of a certain color, while a subset might be shown in a different color. We refer to these as layers in the visualization, and these typically appear in a list on the left of the glue application window. State classes¶ Overview¶ The first piece to construct when developing a new data viewer are state classes for the data viewer and layers, which you can think of as a conceptual representation of the data viewer and layers, but doesn’t contain any code specific to e.g. Qt or Jupyter or even the visualization library you are using. As an example, a scatter viewer will have a state class that indicates which attributes are shown on which axes, and what the limits of the axes are. Each layer then also has a state class which includes information for example about what the color of the layer should be, and whether it is currently visible or not. Viewer state¶ To create a viewer, we import the base ViewerState class, as well as the CallbackProperty class: from glue.viewers.common.state import ViewerState from echo import CallbackProperty The latter is used to define properties on the state class and we can attach callback functions to them (more on this soon). Let’s now imagine we want to build a simple scatter plot viewer. Our state class would then look like: class TutorialViewerState(ViewerState): x_att = CallbackProperty(docstring='The attribute to use on the x-axis') y_att = CallbackProperty(docstring='The attribute to use on the y-axis') Once a state class is defined with callback properties, it is possible to attach callback functions to them: >>> def on_x_att_change(value): ... print('x_att has changed and is now', value) >>> state = TutorialViewerState() >>> state.add_callback('x_att', on_x_att_change) >>> state.x_att = 'a' x_att has changed and is now a What this means is that when you are defining the state class for your viewer, think about whether you want to change certain properties based on others. For example we could write a state class that changes x to match y (but not y to match x): class TutorialViewerState(ViewerState): x_att = CallbackProperty(docstring='The attribute to use on the x-axis') y_att = CallbackProperty(docstring='The attribute to use on the y-axis') def __init__(self, *args, **kwargs): super(TutorialViewerState).__init__(*args, **kwargs) self.add_callback('y_att', self._on_y_att_change) def _on_y_att_change(self, value): self.x_att = self.y_att The idea is to implement as much of the logic as possible here rather than relying on e.g. Qt events, so that your class can be re-used for e.g. both a Qt and Jupyter data viewer. Note that the ViewerState defines one property by default, which is layers - a container that is used to store LayerState objects (see Layer state). You shouldn’t need to add/remove layers from this manually, but you can attach callback functions to layers in case any of the layers change. Layer state¶ Similarly to the viewer state, you need to also define a state class for layers in the visualization using LayerState: from glue.viewers.common.state import LayerState The LayerState class defines the following properties by default: layer: the Dataor Subsetattached to the layer (the naming of this property is historical/confusing and may be changed to datain future). visible: whether the layer is visible or not zorder: a numerical value indicating (when relevant) which layer should appear in front of which (higher numbers mean the layer should be shown more in the foreground) Furthermore, layer.style is itself a state class that includes global settings for the data or subset, such as color and alpha. Let’s say that you want to define a way to indicate in the layer whether to use filled markers or not - this is not one of the settings in layer.style, so you can define it using: class TutorialLayerState(LayerState): fill = CallbackProperty(False, docstring='Whether to show the markers as filled or not') The optional first value in CallbackProperty is the default value that the property should be set to. Multi-choice properties¶ In some cases, you might want the properties on the state classes to be a selection from a fixed set of values – for instance line style, or as demonstrated in Viewer State, the attribute to show on an axis (since it should be chosen from the existing data attributes). This can be done by using the SelectionCallbackProperty class, which should be used as follows: class TutorialViewerState(ViewerState): linestyle = SelectionCallbackProperty() def __init__(self, *args, **kwargs): super(TutorialViewerState).__init__(*args, **kwargs) MyExampleState.linestyle.set_choices(['solid', 'dashed', 'dotted']) This then makes it so that the linestyle property knows about what valid values are, and this will come in useful when developing for example Qt widgets so that they can automatically populate combo/selection boxes for example. For the specific case of selecting attributes from the data, we also provide a class ComponentIDComboHelper that can automatically keep the attributes for datasets in sync with the choices in a SelectionCallbackProperty class. Here’s an example of how to use it: class TutorialViewerState(ViewerState): x_att = SelectionCallbackProperty(docstring='The attribute to use on the x-axis') y_att = SelectionCallbackProperty(docstring='The attribute to use on the y-axis') def __init__(self, *args, **kwargs): super(TutorialViewerState, self).__init__(*args, **kwargs) self._x_att_helper = ComponentIDComboHelper(self, 'x_att') self._y_att_helper = ComponentIDComboHelper(self, 'y_att') self.add_callback('layers', self._on_layers_change) def _on_layers_change(self, value): # self.layers_data is a shortcut for # [layer_state.layer for layer_state in self.layers] self._x_att_helper.set_multiple_data(self.layers_data) self._y_att_helper.set_multiple_data(self.layers_data) Now whenever layers are added/removed, the choices for x_att and y_att will automatically be updated. Layer artist¶ In the previous section, we saw that we can define classes to hold the conceptual state of viewers and of the layers in the viewers. The next type of class we are going to look at is the layer artist. Conceptually, layer artists can be used to carry out the actual drawing and include any logic about how to convert data and subsets into layers in your visualization. The minimal layer artist class looks like the following: from glue.viewers.common.layer_artist import LayerArtist class TutorialLayerArtist(LayerArtist): _layer_artist_cls = TutorialLayerState def clear(self): pass def remove(self): pass def redraw(self): pass def update(self): pass Each layer artist class has to define the four methods shown above. The clear() method should remove the layer from the visualization, bearing in mind that the layer might be added back (this can happen for example when toggling the visibility of the layer property), the remove() method should permanently remove the layer from the visualization, the redraw() method should force the layer to be redrawn, and update() should update the appearance of the layer as necessary before redrawing – note that update() is called for example when a subset has changed. By default, layer artists inheriting from LayerArtist will be initialized with a reference to the layer state (accessible as state) and the viewer state (accessible as _viewer_state). This means that we can then do the following, assuming a layer state with the fill property defined previously: from glue.viewers.common.layer_artist import LayerArtist class TutorialLayerArtist(LayerArtist): _layer_artist_cls = TutorialLayerState def __init__(self, *args, **kwargs): super(MyLayerArtist, self).__init__(*args, **kwargs) self.state.add_callback('fill', self._on_fill_change) def _on_fill_change(self): # Make adjustments to the visualization layer here In practice, you will likely need a reference to the overall visualization to be passed to the layer artist (for example the axes for a Matplotlib plot, or an OpenGL canvas). We will take a look at this after introducing the data viewer class in Data viewer. Note that the layer artist doesn’t have to be specific to the front-end used either. If for instance you are developing a widget based on e.g. Matplotlib, and are then developing a Qt and Jupyter version of the viewer, you could write the layer artist in such a way that it only cares about the Matplotlib API and works for either the Qt or Jupyter viewers. Data viewer¶ We have now seen how to define state classes for the viewer and layer, and layer artists. The final piece of the puzzle is the data viewer class itself, which brings everything together. The simplest definition of the data viewer class is: from glue.viewers.common.viewer import Viewer class TutorialDataViewer(Viewer): LABEL = 'Tutorial viewer' _state_cls = TutorialViewerState _data_artist_cls = TutorialLayerArtist _subset_artist_cls = TutorialLayerArtist In practice, this isn’t enough, since we need to actually set up the main visualization and pass references to it to the layer artists. This can be done in the initializer of the TutorialDataViewer class. For example, if you were building a Matplotlib-based viewer, assuming you imported Matplotlib as: from matplotlib import pyplot as plt you could do: def __init__(self, *args, **kwargs): super(TutorialDataViewer, self).__init__(*args, **kwargs) self.axes = plt.subplot(1, 1, 1) Note however that you need a way to pass the axes to the layer artist. The way to do this is to add axes as a positional argument for the TutorialLayerArtist class defined previously then to add the following method to the data viewer: def get_layer_artist(self, cls, layer=None, layer_state=None): return cls(self.axes, self.state, layer=layer, layer_state=layer_state) This method defines how the layer artists should be instantiated, and you can see that we added a self.axes positional argument, so that the layer artist classes should now have access to the axes. With this in place, what will happen now is that when a data viewer is created, and when a new dataset or subset is added to it, the layers attribute of the viewer state class will automatically be updated to include a new LayerState object. At the same time, a LayerArtist object will be instantiated. The main task is therefore to implement the methods for the LayerArtist (in particular update()). You can then add any required logic in the state classes if needed. Further reading¶ If you are interested in building a viewer for the Qt front-end of glue, you can find out more about this and see a complete example in Writing a custom viewer for glue with Qt. Even if you want to develop a viewer for a different front-end, you may find the Qt example useful.
http://docs.glueviz.org/en/latest/customizing_guide/viewer.html
CC-MAIN-2021-17
en
refinedweb
Hello, How can I access, in the JAVA API, the Bonita Version where the code is running? I see this information is available in the PlatformAPI, but to get this object, it's mandatory to have a PlatformSession ( :-( ) In the MonitoringAPI, there are information on the JVM, but not Bonita itself. And in the portal, Setting : you have it! I saw a REST API here, but the version is not in the return (it's seem the version in in the HTML only? Strange). It will be super to have more explanation in the Bonita API. I search to clone a process to a new one. i'm looking to clone the form Mapping; 1/ How to process the current list of form? I believe this is : SearchOptionsBuilder search = new SearchOptionsBuilder(0,100); search.filter(FormMappingSearchDescriptor.PROCESS_DEFINITION_ID, processDesign.processDefinitionId); SearchResult searchFormMapping = processAPI.searchFormMappings(search.done()); Then we can loop on the form Mapping Hi, I need to get de value of transitions that was in the conditions of the gateways via Engine Api. After doing a search i found the methods getOutgoingTransitions() and getIncommingTransitions() in Engine API. Can someone help me to use this methods? Regards, Diana Can a process created programmatically using Engine API (reference) be exported programmatically into a bar file so that the process diagram can be viewed in BPM Studio? If yes, pls share engine APIs for exporting the created process. Hey, I'm trying to find a way in groovy through which, I can get all the groups that are allowed to execute a task. I am trying to write a script at the "connector in" of a station that gets me this data. Even the actor's API takes processDefinitionId as an argument, and not taskId/activityId. I want the actors with respect to that instance, could you help me out? Thanks! I have a process in which each process instance has a BDM object associated with it. If a process has started with a BDM object, I want to prevent users from being able to start another process using the same object as the existing process. If I use a unique constraint on the ID field of my BDM object, users are prevented from ever being able to start a process using an object that was used in the past, which is not what I want. I only want to ensure that a process cannot be started using an object that is being used in an active process.. Bonjour, Je veux executer une tache partir de l'engine API avec des données définies dans un contrat. Mon problème viens du contrat qui contient une entrée de type date (LOCALDATE) et je ne sais pas exactement quoi envoyer dans la HashMap. Détail de l'erreur : org.bonitasoft.engine.bpm.contract.ContractViolationException: USERNAME=walter.bates | Error while validating expected inputs: [2018-04-04 cannot be assigned to LOCALDATE] all I want to pass a complex type to my process while I want to call the processAPI.startProcess but I totally don't know how to do this, I thought that maybe below code could help me but it couldn't.
https://community.bonitasoft.com/tags/engineapi
CC-MAIN-2021-17
en
refinedweb
random_string_generator An easy to use, customizable and secure random string generator. Can also be used as a password generator by using: mustHaveAtLeastOneOfEach = true Usage Import import 'package:random_string_generator/random_string_generator.dart'; Basic usage var generator = RandomStringGenerator( fixedLength: 10, ); print(generator.generate()); This will generate a random string of length 10 which contains: - random uppercase and lowercase alpha characters - random digits - random symbols You can change the properties on the generator object var generator = RandomStringGenerator( fixedLength: 10, ); generator.fixedLength = 5; print(generator.generate()); WARNING: The call to .generate() will throw RandomStringGeneratorException with a String message property when the parameters are logically wrong! You should try-catch and print the message to see what was wrong. Examples when it will throw: - If you set minLength > maxLength. - If you set only minLength or maxLength, but you do not set the other one. - If you set both fixedLength and minLength + maxLength. - If you set hasDigits = true, hasSymbols = true and mustHaveAtLeastOneOfEach = true, but you set the length to be 1 instead of minimum 2. Advanced usage var generator = RandomStringGenerator( hasAlpha: true, alphaCase: AlphaCase.UPPERCASE_ONLY, hasDigits: false, hasSymbols: true, minLength: 10, maxLength: 25, mustHaveAtLeastOneOfEach: true, ); print(generator.generate()); This will generate a random string of length between 10 (included) and 25 (included) which is guaranteed to contain at least one of below: - random uppercase-only alpha characters - random digits - random symbols Note: In order for the at least one of each feature to work, you must provide a minimum length at least equal to the sum of the true boolean values (hasAlpha, hasDigits, hasSymbols) and the alphaCase. Examples, assuming mustHaveAtLeastOneOfEach = true: If hasAlpha, hasDigits, hasSymbols are all set to true and alphaCase is set to AlphaCase.LOWERCASE_ONLY, the total length must be 3 in order to cover all cases. If hasAlpha, hasDigits, hasSymbols are all set to true and alphaCase is set to AlphaCase.MIXED_CASE, the total length must be (3 + 1 from MIXED_CASE, which means both lower and upper) = 4 in order to cover all cases. You can also provide custom lists of characters var generator = RandomStringGenerator( hasAlpha: true, alphaCase: AlphaCase.MIXED_CASE, hasDigits: true, hasSymbols: false, minLength: 5, maxLength: 10, mustHaveAtLeastOneOfEach: false, customUpperAlphabet = ['A', 'B', 'X', 'Z'], customLowerAlphabet = ['w', 'n', 'h'], customDigits = ['1', '2', '3'], // digits as String customSymbols = ['?', '@'], ); print(generator.generate()); For more information, please see the documentation.
https://pub.dev/documentation/random_string_generator/latest/
CC-MAIN-2021-17
en
refinedweb
Small auxiliary class for controlling MC weight. It provides certain measure of the "maximum weight" depending on small user-parameter "epsilon". It creates and uses 2 histograms of the TH1D class. User defines no. of bins nBin, nBin=1000 is recommended wmax defines weight range (1,wmax), it is adjusted "manually" Definition at line 12 of file TFoamMaxwt.h. #include <TFoamMaxwt.h> Constructor for streamer. Definition at line 23 of file TFoamMaxwt.cxx. Principal user constructor. Definition at line 34 of file TFoamMaxwt.cxx. Explicit COPY CONSTRUCTOR (unused, so far) Definition at line 48 of file TFoamMaxwt.cxx. Destructor. Definition at line 60 of file TFoamMaxwt.cxx. Filling analyzed weight. Definition at line 93 of file TFoamMaxwt.cxx. Calculates Efficiency= aveWt/wtLim for a given tolerance level epsilon<<1 using information stored in two histograms. To be called at the end of the MC run. Definition at line 120 of file TFoamMaxwt.cxx. Calculates Efficiency= aveWt/wtLim for a given tolerance level epsilon<<1 To be called at the end of the MC run. Definition at line 104 of file TFoamMaxwt.cxx. substitution = Definition at line 80 of file TFoamMaxwt.cxx. Reseting weight analysis. Definition at line 70 of file TFoamMaxwt.cxx. No. of bins on the weight distribution. Definition at line 15 of file TFoamMaxwt.h. No. of MC events. Definition at line 14 of file TFoamMaxwt.h. Maximum analyzed weight. Definition at line 16 of file TFoamMaxwt.h. Histogram of the weight wt. Definition at line 18 of file TFoamMaxwt.h. Histogram of wt filled with wt. Definition at line 19 of file TFoamMaxwt.h.
https://root.cern/doc/master/classTFoamMaxwt.html
CC-MAIN-2021-17
en
refinedweb
How to use RTI Connext DDS to Communicate Across Docker Containers Using the Host Driver When using the “host” Docker driver, all network interfaces of the host machine are accessible from the Docker container. Furthermore, there is no networking namespace separation between the Docker containers and the host machine. To run a container in host mode, run the following command: $ docker run --network="host" -ti <Docker image> <Program> Possible scenarios Communication within a host machine (Docker container to Docker container, or Docker container to host machine): The configuration of the Docker container can affect the ability of RTI Connext DDS to communicate using the Docker "host" driver if shared memory is enabled. This is due to how the GUID that identifies every DDS Entity is generated. By default, RTI Connext DDS generates the GUID as follows (for more information, see section “8.5.9.4 Controlling How the GUID is Set” of the RTI Connext DDS User’s Manual): 32 bits for the Host ID (rtps_host_id). The Host ID is currently based upon the IP address by default (although this might change in future versions). This will allow you to determine the node having the GUID problem. - 16 low bits for the Application ID ( rtps_app_id). If the originating node is a Windows system, the relevant Process ID will be the value of GetCurrentProcessId(). On a VxWorks system, it will be the Task ID of a specific task. - On a Linux system, it will be the Process ID that you can see as the output of the command ps -ef. 8 bits for an Internal Counter. This counter allows an application to create multiple DomainParticipants in the same domain. 8 bits containing a Constant Value (0x01). As we mentioned before, the host Docker driver mode could affect this generation process as follows: All the containers in host driver mode will have the same IP address; therefore, they will have the same Host ID. - Due to the way process IDs are generated, two applications in two containers could have the same Process ID; therefore, they could have the same Application ID. In this case, RTI Connext DDS will interpret that both applications are in the same machine and will try to communicate using shared memory. This is an optimization done by our Shared Memory transport. To resolve this, there are three possible solutions: Disabling the Shared Memory transport, as explained in Section "8.5.7 TRANSPORT_BUILTIN QosPolicy (DDS Extension)" of the RTI Connext DDS Core Libraries User’s Manual. Configuring your RTI Connext DDS applications and Docker containers to enable communication using shared memory, as explained in this Knowledge Base article. - Changing how the GUID is set, as explained in Section “8.5.9.4 Controlling How the GUID is Set” of the RTI Connext DDS Core Libraries User’s Manual. Communication across machines (Docker to Docker, or Docker to a remote host) In this case, you should get out-of-the-box communication. That is, you should be able to communicate with RTI Connext DDS applications running on other machines (whether they are running on Docker containers or not). This happens because a Docker container behaves just like any other regular process, despite having some resource isolation. With the host driver, the container will use the same network stack that any other process would use.
https://community.rti.com/kb/how-use-rti-connext-dds-communicate-across-docker-containers-using-host-driver
CC-MAIN-2021-17
en
refinedweb
#include <url.h> Urls consist of three parts: a scheme, an authority and a path. The readable text-representation is "scheme://authority/path". The scheme defines which handler is used, e.g. "http" for web-based connections or "file" for the regular file system. The authority defines the machine, which can be empty for "localhost", a network drive or a webserver. It can also refer to an embedded file, e.g. a ZIP. To distinguish that case the readable text representation contains brackets: "scheme://[authority]/path". Nesting is possible repeatedly. Finally the path component defines the unique location of a file or directory on the target machine. In most schemes paths are a combination of the directory path and file path, but the path could also be a network query or database entry. Path components are always separated by a forward slash and the forward slash is a reserved character that cannot be used for names. Urls are always case-sensitive, independent of the used scheme handler. Under Windows the backslash is automatically replaced and converted to a forward slash when you use SetPath or SetSystemPath. Note that backslashes passed to SetUrl or Url() will not be converted. One note about constructing Url paths: if you use Append or + there is a big difference whether you add a String or a Url. If you add a String you can only add a single name component. With a relative Url you can add multiple path components at once (however this must be a relative Url, any other type will fail). E.g. allowed is Url a = Url(""_s) + "test"_s + "image.tif"_s; Url b = Url(""_s) + Url("test/image.tif"_s); whereas this will fail: Url a = Url(""_s) + "test/image.tif"_s; Url a = Url(""_s) + Url(""_s); Here an overview over different types of Urls: If the Url class is used, it should always be clear what the object can be - a file, a directory, a path (file or directory) or a relative path. Therefore the naming convention is very strict and refers to RFC1738. The path component of a Url typically consists of a directory and a name. Name is the term for a simple filename like test.abc or picture.png. Its placed at the end of a Url. A directory is a set of strings, split by the forward slash-delimiter, in which other directories are kept, e.g. \/Users/MyUser/Desktop. Path is the combination of directory and name. Following this convention helps the maintainers and users of a function to keep track of what is accepted. If the Url parameter name of a saving function contains for example path it's always clear that the function needs the directory and a name. If the user is allowed to pass everything to the function (a file or directory) the documentation should clarify that (and if the behavior differs from what is passed it must also be documented). Examples: Functions starting with "Io" operate directly on the object behind the Url (e.g. a file or directory). @MAXON_ANNOTATION{reflection} UrlScheme constructor. Get data stored under a specific key. If the key is not found an error will be returned. This functions offers 2 possible calls. First using an FId "dict.Get(MAXCHINEINFO::COMPUTERNAME)" or second using any type directly together with the result type "dict.Get<String>(Int32(5))". The data type needs to be registered. Get data stored under a specific key. If the key is not found the given default value will be returned. This functions offers 2 possible calls. First using an FId "dict.Get(MAXCHINEINFO::COMPUTERNAME, String())" or second using any type directly together with the result type "dict.Get(Int32(5), String())". The data type needs to be registered. Set data under a specific id. this function is template to allow implicit Set calls for each data type. This functions offers 2 possible calls. First using an FId "dict.Set(MAXCHINEINFO::COMPUTERNAME, "data"_s)" or second using any type directly "dict.Set(Int32(5), "data"_s)". The data type needs to be registered.
https://developers.maxon.net/docs/Cinema4DCPPSDK/html/classmaxon_1_1_url.html
CC-MAIN-2021-17
en
refinedweb
Neptune-Matplotlib Integration¶ This integration lets you log charts generated in matplotlib, like confusion matrix or distribution, in Neptune. Follow these steps: Create an experiment: import neptune neptune.init(api_token='ANONYMOUS',project_qualified_name='shared/showroom') neptune.create_experiment() Create a matplotlib figure: For example: # matplotlib figure example 2 from matplotlib import pyplot import numpy numpy.random.seed(19680801) data = numpy.random.randn(2, 100) figure, axs = pyplot.subplots(2, 2, figsize=(5, 5)) axs[0, 0].hist(data[0]) axs[1, 0].scatter(data[0], data[1]) axs[0, 1].plot(data[0], data[1]) Log figure into Neptune: Log as static image experiment.log_image('diagrams', figure) Log as interactive plotly chart from neptunecontrib.api import log_chart log_chart(name='matplotlib_figure', chart=figure) Note This option is tested with matplotlib==3.2.0 and plotly==4.12.0. Make sure that you have correct versions installed. In the absence of plotly, log_chart silently falls back on logging the chart as a static image. Explore the results in the Neptune dashboard: Static image is logged into the logs section: Interactive figure is logged as artifact into the charts folder. Check out this experiment in the app. Note Not all matplotlib charts can be converted to interactive plotly charts. If conversion is not possible, neptune-client will emit a warning and fall back on logging the chart as an image.
https://docs-legacy.neptune.ai/integrations/matplotlib.html
CC-MAIN-2021-17
en
refinedweb
tango 0.1.2+1 tango: ^0.1.2+1 copied to clipboard Tango is a flexible build configuration tool that is the perfect partner for your Flutter project. Tango copies files, scales images and injects code or constants. Use this package as an executable 1. Install it You can install the package from the command line: $ dart pub global activate tango Use it The package has the following executables: $ tango Use this package as a library Depend on it Run this command: With Dart: $ dart pub add tango With Flutter: $ flutter pub pub add tango This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get): dependencies: tango: ^0.1.2+1 Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more. Import it Now in your Dart code, you can use: import 'package:tango/tango.dart';
https://pub.dev/packages/tango/install
CC-MAIN-2021-17
en
refinedweb
The objective of this post is to illustrate how to chain two SN74HC595 ICs and controlling them, using SPI, with the ESP8266. Introduction The objective of this post is to illustrate how to chain two SN74HC595 ICs and controlling them, using SPI, with the ESP8266. Naturally, the working principle is the same for using the shiftOut function instead of the SPI interface. Working principle The working principle of this method consists basically in putting the two shift registers of each IC in sequence. As we seen in the previous post, when we transfer the serial data and a shift occurs, the last bit is discarded.But, if we use this last bit as the input of the shifting process of the second shift register, then this bit will not be lost and will be stored there. This process is illustrated in figure 1. Figure 1 – Propagation of 1 bit between two chained SN74HC595. So, if we start with a 8 bit sequence in the first IC and no values set in the second and then we transfer a new 8 bit block to the first, the previous sequence will be pushed, bit by bit, to the second IC, as can be seen in figure 2. Figure 1 – Propagation of 8 bits between two chained SN74HC595. Naturally, if we want to define the 16 bits (8 per IC) in one operation, we just send them uninterruptedly from the microcontroller and only in the end we send the load signal to both ICs. This way, the internal operation to transfer the bits from the shift registers to the storage registers will occur in parallel. This approach scales if we want to add more ICs to extend the number of bits. For the generic case where we have N shift registers, we send N*8 bits uninterruptedly and, in the end, we send the load signal for each IC, in parallel. As before, the first byte that is transferred ends in the last IC of the chain and the last byte in the first IC. Hardware Figure 3 shows the connection diagram for chaining 2 SN74HC595 ICs and controlling them with the ESP8266. Figure 3 – Diagram for chaining two SN74HC595 ICs. As can be seen, we use exactly the same number of pins from the microcontroller we used before for controlling just one SN74HC595. So, we also connect the RCLK and SRCLK pins of the second IC to the Slave Select and clock pins of the ESP8266. The only exception is that now we connect the QH’ of the first IC to the SER (corresponding to the Serial data input) pin of the second IC. If we remember what was explained in this previous post, the QH’ outputs the bit of the shift register that is discarded when the shift procedure occurs, when we are transferring the serial data. So, like was explained in the previous section, if we transfer 16 bits instead of just 8, the first 8 bits will get propagated to the second IC. Naturally, this design can be extended to include more SN74HC595 ICs, controllable with just 3 pins of the microcontroller. Nevertheless, we need to take in consideration that as we add more ICs to the chain, some propagation problems may occur, mainly related to noise. Also, since we would use 2 of the pins to control all of the ICs, the fan-out would need to be considered. Check this interesting discussion about the effects of chaining 40 of these devices. Setup The setup will be exactly the same as in the previous post and will allow the initialization of the SPI bus and of the Slave Select pin. #include <SPI.h> const int SSpin = 15; void setup() { pinMode(SSpin, OUTPUT); SPI.begin(); } Main loop The code for the main loop of this tutorial is basically the same as the previous one, with just an extra line of code to transfer the second block of 8 bits. The code is shown below. byte firstByte = 1; byte secondByte = 2; SPI.transfer(firstByte); SPI.transfer(secondByte); Just remember that the first 8 bits (variable firstByte) will end in the second IC and the second 8 bits (variable secondByte) will stay in the first IC. If we had more ICs chained, we would just need to add more SPI.transfer calls. A slightly more interesting main loop function is shown bellow. In this case, we will do a for loop to set all the possible combinations of LEDs on/off for both ICs in parallel. So, the same sequence will occur in both. void loop() { for (int i= 0; i<=7; i++){ digitalWrite(SSpin, LOW); //Disable any internal transference in the SN74HC595 SPI.transfer(i); //Transfer first byte SPI.transfer(i); //Transfer second byte digitalWrite(SSpin, HIGH); //Start the internal data transference in the SN74HC595 delay(3000); //Wait for next iteration } } You can check the final result in the video below. Just note that if we use the same code of the previous post, which corresponds to commenting one of the SPI.transfer methods, the second IC would show the same sequence of the first with a lag of one iteration. The video bellow shows this case. Final notes The possibility of extending the number of controlled bits (and thus output pins) by simply chaining these ICs offers great flexibility and helps solving many constraints when pins of a microcontroller are limited. On top of that, the possibility of using SPI allows for using the same clock and MOSI pins for controlling other SPI devices (naturally, more Slave Select pins are needed). One interesting combination consists on using this approach to control a led matrix, allowing for controlling an huge number of LEDs with a minimal number of pins of a microcontroller. Related Posts Resources - Datasheet from Texas Instruments - SPI library implementation for the ESP8266 - Discussion about chaining 40 74HC595 Technical details - ESP8266 libraries: v2.3.0. Pingback: ESP8266: Connection to SN74HC595 via SPI | techtutorialsx Pingback: ESP8266: Connection to SN74HC595 | techtutorialsx Pingback: SN74HC595: Shift Register | techtutorialsx Pingback: Buying cheap electronics at eBay: part 3 | techtutorialsx Pingback: ESP8266: Controlling a LED matrix with the 74HC595 ICs | techtutorialsx
https://techtutorialsx.com/2016/09/04/esp8266-controlling-chained-sn74hc595-ics/
CC-MAIN-2017-26
en
refinedweb
Smart Room project is aim to make a technology room for Parents,child's or for someone special. in this era we are able to watch every things in our room on internet by camera but still we are unable to feel the room status/condition like what's the temperature in our room or want to control the fan or heater according to room temperature. so this project aim is to make our traditional room into to smart room. Smart Room project will use Genuino MKR1000 Wifi Enabled Board for controlling room hardware and we will use blynk app to control or view the room controls and thingspeak will store the room sensors & modules statics into cloud for future analysis. Hardware List: - 1x Arduino MKR1000 - 1x DHT22 Sensor For Temperature & Humidity - 1x LDR - 1x MQ2 Gas Sensor - 1x 10K Resistor - 1x 220 ohm Resistor - 1x 5V 4 Channel Relay Module - 1x Bread Board - 1x Male-Femalre Jumpier Cables Set - 1x Male-Male Jumpier Cables Set - 1x Fan - 1x Heater - 1x Power Bank for MKR1000 Power Step 1: Start With LDR & MQ2 This step will demonstrate the use of LDR (Light dependent resistor) & MQ2 Gas Sensor. these both sensor are very important for our room. LDR will update us with Light Level and MQ2 indicate us if sensor sense the LPG Gas or any smoke in our room. Please follow the fritizing digram and assemble the sensors on bread board according to diagram. LDR Range >400 indicate the enough amount of light is available in room. MQ2 Range <290 indicate the normal level of room if it exceeds the 400 then there is a problem in a room. Code: #define LDRPin A0 #define MQ2Pin A1 float GasValue; float LDRValue; void setup() { Serial.begin(9600); } void loop() { GasValue=analogRead(MQ2Pin); Serial.print("Gas Value:"); Serial.print(GasValue); LDRValue=analogRead(LDRPin); Serial.print("\t Light%:"); Serial.print(LDRValue); Serial.print("\r\n"); delay(1000); } Step 2: Getting Room Temperature & Humidity With DHT22 This step will demonstrate a simple example of DHT22 and show you your room temperature & humidity on Serial Monitor. It's Humidity Range is 0-100% and Temperature range is -40 - 125°C that's why I prefer DHT22 as compared to DHT11. Code: #include <DHT.h> //Constants #define DHTPIN 7 // what pin we're connected to #define DHTTYPE DHT22 // DHT 22 (AM2302) DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino //Variables int chk; float hum; //Stores humidity value float temp; //Stores temperature value void setup() { Serial.begin(9600); dht.begin(); } void loop() { delay(2000); //Read data and store it to variables hum and temp hum = dht.readHumidity(); temp= dht.readTemperature(); //Print temp and humidity values to serial monitor Serial.print("Humidity: "); Serial.print(hum); Serial.print(" %, Temp: "); Serial.print(temp); Serial.println(" Celsius"); delay(10000); //Delay 2 sec. } Step 3: Blynk & Thingspeak This step will demonstrate the basic understanding about Blynk App & Thingspeak. Blynk App: Blynk App is a drag-n-drop interface for IOT Devices. This is specially designed for those engineers who don't know who to code android app. just install this app and add the controls by drag-n-drop. please view the above video for basic demonstration of Blynk app utilization. ThingSpeak: Thingspeak is a cloud for IOT devices to send & receive message from and to devices. For thingspeak just goto and create an account and login to ThingSpeak and after that click on Channel Menu in the Top and Select My Channels and then Click on New Channel and Enter the Details of Channels Like Name, Description, Fields Like Temperature,Humidity,Gas Level, Light Level and then Click on Save button. now take the Channel ID and put into Code. after that click on API Keys Tab and get the Write API Key and put into code. for particle demonstration of thing-speak please visit the Next Step. Step 4: Finished Project Assemble the sensors and Modules according to Diagram. Update the Pin Numbers in code according to your design. Blynk App: Download the Blynk app from play store or apple store and don't worry about design just scan the QR Code in blnk app and you will be done. Note: Carefully handle the rely module as it's connected to 220V. try to enclose the Relay Module in Box as above visible in Pictures. Code is available at Git Hub Click here Now Setup has been Completed and now you are able to feel and control your room. - View the Temperature & Humidity of Room - Gas Level Indication - Light Level Indication - Control the Light, Heater, Fan, other electronics of room For Live Demo watch this video I hope many of guys will implement this project in more easy & convenient way. best wishes for all of geeks. I will be happy if any of you guys will ask questions.
http://www.instructables.com/id/Smart-Room-Using-MKR1000-Blynk-App-ThingSpeak/
CC-MAIN-2017-26
en
refinedweb
How to Create a Simple Android Game with AndEngine This: import org.andengine.ui.activity.SimpleBaseGameActivity; import org.andengine.engine.options.EngineOptions; import org.andengine.entity.scene.Scene;: public class TowerOfHanoiActivity extends Activity { To something like this: public class TowerOfHanoiActivity extends SimpleBaseGameActivity {): @Override public EngineOptions onCreateEngineOptions() { // TODO Auto-generated method stub return null; } @Override protected void onCreateResources() { // TODO Auto-generated method stub } @Override protected Scene onCreateScene() { // TODO Auto-generated method stub return null; } Next, create a few static variables. These will be private to our class. So add the following code right below the class definition line: private static int CAMERA_WIDTH = 800; private static int CAMERA_HEIGHT = 480;: import org.andengine.engine.camera.Camera; import org.andengine.engine.options.ScreenOrientation; import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; Now, add the following code for the onCreateEngineOptions function, replacing the placeholder conent which is in there at the moment: final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); return new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);: import org.andengine.opengl.texture.ITexture; import org.andengine.opengl.texture.bitmap.BitmapTexture; import org.andengine.util.adt.io.in.IInputStreamOpener; import org.andengine.util.debug.Debug; import java.io.IOException; import java.io.InputStream; Now, replace the placeholder content in onCreateResources with the following: try { // 1 - Set up bitmap textures ITexture backgroundTexture = new BitmapTexture(this.getTextureManager(), new IInputStreamOpener() { @Override public InputStream open() throws IOException { return getAssets().open("gfx/background.png"); } }); ITexture towerTexture = new BitmapTexture(this.getTextureManager(), new IInputStreamOpener() { @Override public InputStream open() throws IOException { return getAssets().open("gfx/tower.png"); } }); ITexture ring1 = new BitmapTexture(this.getTextureManager(), new IInputStreamOpener() { @Override public InputStream open() throws IOException { return getAssets().open("gfx/ring1.png"); } }); ITexture ring2 = new BitmapTexture(this.getTextureManager(), new IInputStreamOpener() { @Override public InputStream open() throws IOException { return getAssets().open("gfx/ring2.png"); } }); ITexture ring3 = new BitmapTexture(this.getTextureManager(), new IInputStreamOpener() { @Override public InputStream open() throws IOException { return getAssets().open("gfx/ring3.png"); } }); // 2 - Load bitmap textures into VRAM backgroundTexture.load(); towerTexture.load(); ring1.load(); ring2.load(); ring3.load(); } catch (IOException e) { Debug.e(e); }: import org.andengine.opengl.texture.region.ITextureRegion; import org.andengine.opengl.texture.region.TextureRegionFactory; Now, to hold the TextureRegions, add private variables to our class (again, at the top of the file, below the previous private variables): private ITextureRegion mBackgroundTextureRegion, mTowerTextureRegion, mRing1, mRing2, mRing3; Finally, add these lines of code to onCreateResources, right after the end of section #2 where you load the bitmap textures into VRAM: // 3 - Set up texture regions this.mBackgroundTextureRegion = TextureRegionFactory.extractFromTexture(backgroundTexture); this.mTowerTextureRegion = TextureRegionFactory.extractFromTexture(towerTexture); this.mRing1 = TextureRegionFactory.extractFromTexture(ring1); this.mRing2 = TextureRegionFactory.extractFromTexture(ring2); this.mRing3 = TextureRegionFactory.extractFromTexture(ring3); The above code initializes your TextureRegions using the textures that you already loaded into VRAM. Creating the Game Scene It’s finally time to create the game scene! Of course, we need another new import: import org.andengine.entity.sprite.Sprite; Next, replace the placeholder content in onCreateScene with the following: // 1 - Create new scene final Scene scene = new Scene(); Sprite backgroundSprite = new Sprite(0, 0, this.mBackgroundTextureRegion, getVertexBufferObjectManager()); scene.attachChild(backgroundSprite); return scene;: private Sprite mTower1, mTower2, mTower3; Next add the following lines of code to onCreateScene, right before the final return statement: // 2 - Add the towers mTower1 = new Sprite(192, 63, this.mTowerTextureRegion, getVertexBufferObjectManager()); mTower2 = new Sprite(400, 63, this.mTowerTextureRegion, getVertexBufferObjectManager()); mTower3 = new Sprite(604, 63, this.mTowerTextureRegion, getVertexBufferObjectManager()); scene.attachChild(mTower1); scene.attachChild(mTower2); scene.attachChild(mTower3);): private int mWeight; private Stack mStack; //this represents the stack that this ring belongs to private Sprite mTower; public Ring(int weight, float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager) { super(pX, pY, pTextureRegion, pVertexBufferObjectManager); this.mWeight = weight; } public int getmWeight() { return mWeight; } public Stack getmStack() { return mStack; } public void setmStack(Stack mStack) { this.mStack = mStack; } public Sprite getmTower() { return mTower; } public void setmTower(Sprite mTower) { this.mTower = mTower; }: import java.util.Stack; import org.andengine.opengl.texture.region.ITextureRegion; import org.andengine.opengl.vbo.VertexBufferObjectManager; Now that we have the Ring class, to create and add the rings, add the following lines of code to onCreateScene, right before the return statement: // 3 - Create the rings Ring ring1 = new Ring(1, 139, 174, this.mRing1, getVertexBufferObjectManager()); Ring ring2 = new Ring(2, 118, 212, this.mRing2, getVertexBufferObjectManager()); Ring ring3 = new Ring(3, 97, 255, this.mRing3, getVertexBufferObjectManager()); scene.attachChild(ring1); scene.attachChild(ring2); scene.attachChild(ring3);: import java.util.Stack; Next, declare the stack variables below the other private variables: private Stack mStack1, mStack2, mStack3; You’ll initialize these variables in onCreateResources. Add the following lines of code after the end of section #3: // 4 - Create the stacks this.mStack1 = new Stack(); this.mStack2 = new Stack(); this.mStack3 = new Stack(); When the game starts, all three rings should be in the first stack. Put the following code in onCreateScene right before the return statement: // 4 - Add all rings to stack one this.mStack1.add(ring3); this.mStack1.add(ring2); this.mStack1.add(ring1); // 5 - Initialize starting position for each ring ring1.setmStack(mStack1); ring2.setmStack(mStack1); ring3.setmStack(mStack1); ring1.setmTower(mTower1); ring2.setmTower(mTower1); ring3.setmTower(mTower1); // 6 - Add touch handlers scene.registerTouchArea(ring1); scene.registerTouchArea(ring2); scene.registerTouchArea(ring3); scene.setTouchAreaBindingOnActionDownEnabled(true);): private void checkForCollisionsWithTowers(Ring ring) { } You also need to add the following import in order for the ring movement code to be able to identify the relevant classes: import org.andengine.input.touch.TouchEvent; Now, replace the first three lines of section #3 in onCreateScene (where you defined the rings) with the following: Ring ring1 = new Ring(1, 139, 174, this.mRing2 = new Ring(2, 118, 212, this.mRing3 = new Ring(3, 97, 255, this.mRing; } };: private void checkForCollisionsWithTowers(Ring ring) { Stack stack = null; Sprite tower = null; if (ring.collidesWith(mTower1) && (mStack1.size() == 0 || ring.getmWeight() < ((Ring) mStack1.peek()).getmWeight())) { stack = mStack1; tower = mTower1; } else if (ring.collidesWith(mTower2) && (mStack2.size() == 0 || ring.getmWeight() < ((Ring) mStack2.peek()).getmWeight())) { stack = mStack2; tower = mTower2; } else if (ring.collidesWith(mTower3) && (mStack3.size() == 0 || ring.getmWeight() < ((Ring) mStack3.peek()).getmWeight())) { stack = mStack3; tower = mTower3; } else { stack = ring.getmStack(); tower = ring.getmTower(); } ring.getmStack().remove(ring); if (stack != null && tower !=null && stack.size() == 0) { ring.setPosition(tower.getX() + tower.getWidth()/2 - ring.getWidth()/2, tower.getY() + tower.getHeight() - ring.getHeight()); } else if (stack != null && tower !=null && stack.size() > 0) { ring.setPosition(tower.getX() + tower.getWidth()/2 - ring.getWidth()/2, ((Ring) stack.peek()).getY() - ring.getHeight()); } stack.add(ring); ring.setmStack(stack); ring.setmTower(tower); }.
https://www.raywenderlich.com/12065/how-to-create-a-simple-android-game
CC-MAIN-2017-26
en
refinedweb
Hi, I just found that if I use fstream to write to a file under nonexistent directory, it will not report any error or do any thing you want during execution. For example, where there is no directory called "tmp" under current directory, How to specify in code to create a directory if it is not existent ? Thanks!How to specify in code to create a directory if it is not existent ? Thanks!Code:#include <fstream> using namespace std; int main() { ofstream fout( "./tmp/results.txt", ios::app ); fout << 2 <<endl; return 0; }
https://cboard.cprogramming.com/cplusplus-programming/112264-write-file-nonexistent-path.html
CC-MAIN-2017-26
en
refinedweb
Android Drawing App Tutorial — Pt. 1 their Android devices using their fingers. You can get the source code for this tutorial from here. The core features of this app will include: - Draw — Users will be able to draw on a blank canvas (whiteboard) . - Erase — Users will be able to erase what has been drawn. - Undo — Users will be able to undo and redo drawing paths. - Color — Users will be able to draw using a color of their choice from at least these colors: black, dark gray, light gray, blue, red, and green, orange, yellow . - Share — Users will be able to capture a screen shot and email it to a friend. Create New Project Create Custom View. <?xml version="1.0" encoding="utf-8"?> <com.okason.drawingapp.CustomView xmlns:android="" xmlns:app="" xmlns:tools="" android:id="@+id/custom_view" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context=".MainActivity" tools:. Implement Drawing components, first the official definition of the Canvas. The). - Canvas — as the name implies, the Canvas is what you draw upon. It is the drawing surface for what you are drawing and it knows how to transfer that drawing to the actual View. The Canvas is your convenient middle man that abstracts away the nuances of writing directly to the underlying view. The Android developer guide calls it an “interface” which pretends to be “the actual surface upon which your graphics will be drawn” while in reality , it holds all of your “draw” calls and then places them into the window for you. The TwoToasters development team gave a good description of a Canvas and the other two core components in this blog post. - Paint — after you obtain the surface to draw upon — the Canvas, you also need something to draw with — the Paint. As the name implies the Paint object “holds the style and color information”. It defines the “color, style, font, and so forth of each shape you draw”. - Path — now that you have the surface to draw upon and the drawing object to use to draw upon that, you need to decide what direction that you want to draw. Do you want to go up, down, left or right. This direction is know as the Path as in a path. It provides “geometric paths consisting of straight line segments, quadratic curves, and cubic curves.” To help you better understand the concept of Path, remember that at the beginning of this post I mentioned that we will implement “Undo” which is a common feature in most drawing apps. The way we will implement it is to keep a history of every path we draw, which is anytime we go from point A to point B. So if the user want to “Undo” their last drawing all we have to do is to remove the last entry in our list of Paths, wipe the screen clean and then re-draw everything again in that list except this time we will not re-draw that Path which have been removed. This happens at a blazing speed giving the user the illusion that we just erased the last thing they draw. Let us now proceed to apply the concepts we learned above to our drawing. Before we start drawing, it is recommended by the Android developer guide to create. //drawing path private Path drawPath; //defines what to draw private Paint canvasPaint; //defines how to draw private Paint drawPaint; //initial color private int paintColor = 0xFF660000; //canvas - holding pen, holds your drawings //and transfers them to the view private Canvas drawCanvas; //canvas bitmap private Bitmap canvasBitmap; //brush size private float currentBrushSize, lastBrushSize;. private void init(){ currentBrushSize = getResources().getInteger(R.integer.medium_size); lastBrushSize = currentBrushSize; drawPath = new Path(); drawPaint = new Paint(); drawPaint.setColor(paintColor); drawPaint.setAntiAlias(true); drawPaint.setStrokeWidth(currentBrushSize); drawPaint.setStyle(Paint.Style.STROKE); drawPaint.setStrokeJoin(Paint.Join.ROUND); drawPaint.setStrokeCap(Paint.Cap.ROUND); canvasPaint = new Paint(Paint.DITHER_FLAG); } Step 3 — Update Constructor — with the init method in place, we can now call it from the constructor like this public CustomView(Context context, AttributeSet attrs) { super(context, attrs); init(); }. @Override protected void onDraw(Canvas canvas) { canvas.drawBitmap(canvasBitmap, 0 , 0, canvasPaint); canvas.drawPath(drawPath, drawPaint); } You can get the source code for this Tutorial from here. be match parent, well the height and width of that parent. @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { //create canvas of certain device size. super.onSizeChanged(w, h, oldw, oldh); //create Bitmap of certain w,h canvasBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); //apply bitmap to graphic to start drawing. drawCanvas = new Canvas(canvasBitmap); }: @Override public boolean onTouchEvent(MotionEvent event) { float touchX = event.getX(); float touchY = event.getY(); //respond to down, move and up events switch (event.getAction()) { case MotionEvent.ACTION_DOWN: drawPath.moveTo(touchX, touchY); break; case MotionEvent.ACTION_MOVE: drawPath.lineTo(touchX, touchY); break; case MotionEvent.ACTION_UP: drawPath.lineTo(touchX, touchY); drawCanvas.drawPath(drawPath, drawPaint); drawPath.reset(); break; default: return false; } //redraw invalidate(); return true; } Here is what was going on in the above code: - We are passed an object of type MotionEvent - Using this MotionEvent we get the X and Y coordinates of where the touch occurred in the screen. We store these coordinates in touchX and Y variables - We then run a switch statement on the event.getAction() method which return a result of an int. - If this action evaluates to a ACTION_DOWN constant of the MotionEvent class, we know that the user just touched the screen so we move to that point. - If the int action evaluates to ACTION_MOVE, then we know that the user intents to draw, and we use our Path object to draw a line from point X to point Y - If the action avaluates to ACTION_UP, then we know that the user is done, so time to transfer the drawing from the surface (Canvas) which we are drawing upon to the actual screen. And then we reset the Path object (drawPath) so that we can start afresh next time the screen is touched. - When we are done, we have to notify the view that the content of what it is currently displaying has changed by calling invalidate(), this will call the onDraw() method and the screen will be repainted. Go ahead and give it a try at this point, you should be able to draw to the screen using your finger or any other input. Implement Erase Drawing There are two ways we can implement erasing our drawing: we can wipe off everything in the screen and start afresh or we can manually erase our drawing line by line. When we erase everything in the screen at once, what we are doing is essentially starting fresh and when we erase our drawing manually what we are doing in a nutshell is painting white color over our existing drawing to give it a resemblance of being “erased” . There are three steps in implementing either types have a top toolbar, now we want to add another toolbar to the bottom and then we will add the icons to it. Add Button Toolbar Follow the steps below to add another material design toolbar to the bottom of your app. Step 1: Update Your Layout — currently your MainActivity layout file is using Cordinator. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="" xmlns:app="" xmlns:tools="" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools: <android.support.design.widget.AppBarLayout android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android: <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app: </android.support.design.widget.AppBarLayout> <com.okason.drawingapp.CustomView android:id="@+id/custom_view" android:layout_below="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="match_parent" android: <android.support.v7.widget.Toolbar android:id="@+id/toolbar_bottom" android:layout_width="match_parent" android:layout_alignParentBottom="true" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app: </RelativeLayout> Step 2: Add Icons — you will need to choose the icons you want to represent the actions you want to perform in your app. There are few sites where you can get great looking Android Icons and I will list a few below. - - Android Asset Studio - - - Google Material Icons The icons included in this tutorial’s source code are from all of the above options are fine, choose which ever one you like and the color you like. After you choose your icons you have to download them and then add them to your res/resource folder. Step 3: Add Menu — now that you have your icons you actually need to add them to a menu which will then inflate into our bottom toolbar. Add a menu to your res/menu folder and call it menu_drawing.xml and here is the content of the menu with entries covering the drawing operations that we want to cover. <menu xmlns:android="" xmlns:app="" xmlns:tools="" tools: <item android:id="@+id/action_erase" android:title="@string/action_erase" android:icon="@drawable/ic_eraser_white_24dp" app: <item android:id="@+id/action_delete" android:title="@string/action_delete" android:icon="@drawable/ic_delete_white_24dp" app: <item android:id="@+id/action_undo" android:title="@string/action_undo" android:icon="@drawable/ic_undo_variant_white_24dp" app: <item android:id="@+id/action_brush" android:title="@string/action_brush" android:icon="@drawable/ic_brush_white_24dp" app: <item android:id="@+id/action_color" android:title="@string/action_color" android:icon="@drawable/ic_eyedropper_variant_white_24dp" app: <item android:id="@+id/action_save" android:title="@string/action_save" android:icon="@drawable/ic_sd_white_24dp" app:. public class MainActivity extends AppCompatActivity { private Toolbar mToolbar_top; private Toolbar mToolbar_bottom; private FloatingActionButton mFab; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mToolbar_top = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar_top); mToolbar_bottom = (Toolbar)findViewById(R.id.toolbar_bottom); mToolbar_bottom.inflateMenu(R.menu.menu_drawing); mToolbar_bottom.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { handleDrawingIconTouched(item.getItemId()); return false; } }); mFab = (FloatingActionButton) findViewById(R.id.fab); mFab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mToolbar_bottom.setVisibility(View.VISIBLE); mFab.setVisibility(View.GONE); } }); } private void handleDrawingIconTouched(int itemId) { switch (itemId){ } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); return super.onOptionsItemSelected(item); } } Code Walkthrough — in the above code block, what we did was: - Declare class instance variables for our top and button Toolbars as well as the Floating Action Button (FAB) - You may want to change the Floating Action Button icon to a “+” instead of the main in XML layout - We instantiated our bottom tool, added an OnMenuItemClicked listener but do not do anything with it at the moment - When the FAB is clicked instead of showing the Snackbar that was added by the template we hide FAB and show our bottom toolbar If you run your app now, it should look like this. In the next tutorial we will pick up from where we left. If you like tutorial, please share with anyone that can benefit from it and do use the comment box to leave me a comment, ask questions or provide feedback. Keep Coding! Originally published at Val Okafor.
https://medium.com/@valokafor/android-drawing-app-tutorial-pt-1-1927f11456ed
CC-MAIN-2017-26
en
refinedweb
Sorry I screwed up, corrected NMU diff is attatched. Again please don't upload/Sorry I screwed up, corrected NMU diff is attatched. Again please don't upload/The NMU diff is attatched to this mail (note: please do not upload/commit thisThe NMU diff is attatched to this mail (note: please do not upload/commit thischange yet, I want to see if it actually solves the problem first). commit until I confirm that this solves the problem.-28 00:09:42.000000000 +0000 @@ -16,6 +16,11 @@ export LDFLAGS = -Wl,--no-relax endif +ifeq ($(DEB_HOST_ARCH), armhf) + export CFLAGS = -marm +endif + + # warning: if the --with autoreconf is removed then # the patch debian/patches/debian-no-linked-scripts # must be adapted to also patch the Makefile.in!
https://lists.debian.org/debian-arm/2012/06/msg00069.html
CC-MAIN-2017-26
en
refinedweb
Engagement and co-production will grow only out of a deeper, richer understanding of how services relate in practice to people s everyday lives - Lindsay Malone - 2 years ago - Views: Transcription 1 The Journey to the Interface How public service design can connect users to reform From cleaning the streets to checkouts, from looking after our elderly parents to selling us holidays, more than 20 million people in the UK work in service. The service economy now accounts for 72 per cent of our gross domestic product. Most of us work in service; all of us depend on it. But expansion of the service sector has not heralded a service revolution. Too often people s experiences of service are alienating and frustrating. Drawing on the principles and practices of the emerging discipline of service design, this pamphlet argues that the common challenge that all service organisations face is how to create more intimate and responsive relationships with their users and customers. Drawing on over 50 interviews with service innovators from the public, private and voluntary sectors, Journey to the Interface makes the case for a fresh approach to public service reform an approach that is less about competition and contestability and more about closing the gap between what people want and need, and what service organisations do. This pamphlet argues that service design can offer policy-makers and practitioners a vision for the transformation of public services, as well as a route to get there. It outlines an agenda for action that spells out how service design approaches can be applied systemically. Sophia Parker is deputy director of Demos. Joe Heapy is a director of Engine. The Journey to the Interface Sophia Parker and Joe Heapy Engagement and co-production will grow only out of a deeper, richer understanding of how services relate in practice to people s everyday lives The Journey to the Interface How public service design can connect users to reform Sophia Parker Joe Heapy 2 Acknowledgements We are very grateful to PricewaterhouseCoopers LLP for supporting this project. Thanks in particular go to Nick Jones, Andrew Knott, Duncan Lampard, Ed Straw and Seema Malhotra for making it such a fruitful collaboration, and for offering invaluable advice, constructive criticism and research leads throughout the project. There are countless individuals in the many organisations we visited who gave generously of their time and thoughts. Our conversations with them have provided the backbone to this piece of work. A full list of contributors can be found on pages , and we are indebted to them for the time they spent talking to us and participating in our workshops. For now, thanks to Joel Levy, Jim Maxmin and Deborah Szebeko for their support in framing the project. Their insights, ideas and inspiration made all the difference in the early stages of the research. Also to Lynne Maher, John Proctor and Isobel Rickard for providing us with the rich material for our extended case studies. They helped us to see how powerful service design principles can be when put into practice. Alison Miller and Paul Rigg made it possible to bring together the fantastic group of local authorities that we worked with. At Engine, huge thanks to Oliver King for his advice and reassurance, and to Kate Dowling for her ongoing support and good humour. Elena Oliva deserves a very special mention for her patience. At Demos, we would have been lost without the research and coordination effort of Sophie Middlemiss. Her cool and calm approach kept us going throughout an intensive phase of research. As ever, Tom Bentley, John Craig, Catherine Fieschi and Simon Parker made incredibly valuable contributions to the writing of the report and we feel very lucky to have such a stellar cast of colleagues. Lastly, thanks to Claudia Boldt, Julie Pickard and Martin Vowles for working with us to turn a lot of words into the good-looking pamphlet you are now holding in your hands. As ever, all errors and omissions remain our own. Sophia Parker Joe Heapy July 2006 Sophia Parker, deputy director of Demos Sophia is deputy director at Demos. She works on organisational strategy and business development, which involves developing new partnerships and research priorities. She has a specific interest in service design looking at ways in which public services such as education and health can be designed from the user outwards, and Demos s families and parenting work, which she leads on. Before joining Demos, Sophia was development manager with the Design Council s learning programme, which used design-based participatory methodologies to engage with practitioners and policy-makers. She has also worked as a civil servant at the Cabinet Office, where her projects included the consultation Equality and diversity: making it happen and the development and bringing to fruition of the Sex Discrimination (Election Candidates) Act. Sophia is co-author of Disablism: How to tackle the last prejudice (Demos, 2004), Strong Foundations: Why schools must be built on learning (DfES, 2006) and The Other Glass Ceiling: The domestic politics of parenting (Demos, 2006). Joe Heapy, director of Engine Service Design Joe is a co-director of the service design consultancy, Engine, and is an advocate of the social value of design in improving people s lives. As a strategist, he looks at how best to marry business objectives with evolving consumer expectations and needs. Joe has worked with many of Engine s clients including Orange, MSN, BUPA, Visa, BT and the Guardian newspaper. Founded in 2000, Engine has approached the design of services by using design-led methodologies that put users at the centre of the process. Engine recently helped Orange to develop a European customer experience strategy for its retail operations and has been working with Virgin Atlantic on its development at Heathrow s Terminal 3. Engine has worked with Demos and DfES and 30 headteachers to develop Picture This!, a workshop toolkit for use by schools in planning for a future of more personalised learning. Joe has also worked with six schools in the UK to instigate design projects involving staff and students in improving their experiences of being at school. 3. 4 First published in 2006 Demos Some rights reserved see copyright licence for details ISBN X Copy edited by Julie Pickard Design by Ispeaktoyou Illustrations by Claudia Boldt Printed by Upstream, London For further information and subscription details please contact: Demos Magdalen House 136 Tooley Street London SE1 2TU telephone: web: About this pamphlet This pamphlet grew out of a series of conversations about projects in our respective organisations. We realised that many of the organisations we were working with Demos in the public sector and Engine in the private sector faced a similar set of challenges around the provision of great service. This led us to explore whether or not there are some common principles of service innovation. The Journey to the Interface brings together what Demos and Engine have learnt from working with service organisations, along with the contributions of over 50 professionals from private, public and voluntary organisations and a number of independent experts in service design. The purpose of the pamphlet is to bring together and organise some of the language and concepts of user-centred service. We have couched this work in the context of the priorities for public service reform in coming years. We hope that the pamphlet provides a useful resource for service organisations, as well as a conceptual framework for approaches to reform. In that spirit, each of the core chapters (1, 2 and 3) concludes with a set of challenges questions people can ask to test the extent to which their organisation is focused on creating deep relationships with their users and some shared language for service innovation. After each of these chapters you will find case studies of public service organisations that are putting some of the principles described here into practice. And at the end of the pamphlet there is a glossary a shared language of service that summarises the new concepts we introduce here. Although many of the tools and concepts described here can be applied to existing organisations, the transformative potential of service design as an approach really comes to life only if it is applied at a systemic level. After the concluding chapter, which explores this in more depth, you will also find an agenda for action that describes what service design principles and practice might might mean for people operating at different levels of the system. We welcome your contributions to this work as it develops. Do get in touch. Sophia Parker Joe Heapy 5 Contents Introduction The common challenge of service Chapter 1 Seeing services as people do Chapter 2 Professionals and practitioners Chapter 3 Measuring success Chapter 4 The politics of service design An agenda for action The shift to a service economy has not necessarily heralded a service revolution. Often as recipients of services we feel that someone else is benefiting. Services need to be understood as a journey or a cycle a series of critical encounters that take place over time and across channels. Find ways of enabling professionals and people to work together: create spaces for simultaneous empowerment. Find ways of measuring experiences as well as systems: life is more complicated than a key performance indicator. If applied systemically, service design can offer a vision for the transformation of public services, as well as a route to get there. Just as outcomes need to be co-produced, so does transformation: how service design principles can be applied at every level of the system, from local authorities and policy-makers to politicians. Pages 6 17 Pages Pages Pages Pages Pages Learning to have more intimate relationships with people and seeing service as support rather than as a commodity may not only generate the outcomes we are looking for, but also offer the route to securing the legitimacy that public services in the twenty-first century so desperately need. See services from the vantage point of the interface, and constantly seek to understand more about how services relate to people s everyday lives how we use them and how we relate to them rather than simply focusing on the internal workings of service organisations. Treat professionals and practitioners as explorers working things out with users and customers but rather than doing this in isolation, they should do it on behalf of the system. Put the frontline centre stage through designing recruitment, appraisal, professional development and feedback channels that empower staff. Measure success obsessively, but not through operational efficiency alone. Two other crucial dimensions include success in terms of reducing failure demand (the cost of not getting things right the first time), and success in harnessing the underused resource of people s energy and commitment. Don t let existing organisational boundaries limit demand. Find new ways of supporting and investing in the in-between spaces through the formation of partnerships and social enterprises where new models of service have a chance to develop. Make the systemic challenge one of scaling up these approaches. A shared language of service There is a small but growing discipline of service design. This glossary brings together key tools and concepts of this discipline to create a shared language of service that cuts across all sectors. Pages 6 6/7 Introduction Introduction The common challenge of service From cleaning the streets to checkouts, from looking after our elderly parents to selling us holidays, more than 20 million people in the UK work in service. The so-called service economy now makes up 72 per cent of our GDP. 1 Most of us work in service; all of us depend on it for many aspects of our existence. The giving of service and the receiving of it is an unmistakable part of everyday life. Yet the shift to a service economy has not necessarily heralded a service revolution. Many of our interactions with service organisations are characterised by profound frustration, hanging on the end of a phone, arguing over our consumer rights, feeling ignored and misunderstood, worrying about the working conditions of those who serve us. Too often as recipients of services we feel that someone other than us is benefiting. Too often it feels like producer interests or profit incentives matter more than how we feel. Public services are not exempt from this sense of frustration. Since 1997, the public sector has expanded. Public service jobs have grown, as have the levels of investment being poured into our schools, hospitals, cultural institutions and security infrastructure. NHS spending will be 90 per cent higher in 2007/08 when compared with 1996/97. Schools spending will be 65 per cent higher and transport will be 60 per cent higher. 2 Yet these 7 investments are doing little to shift the stubborn figures which indicate that we still have low levels of satisfaction and trust in public services overall. Two problems lie at the heart of this disconnect between people and services. First, people are changing faster than organisations are. Decades of expanding choice and growing wealth have left people looking for more than simply quality products and services. The search for meaning and recognition, autonomy and control is a defining part of our collective psyche in the twenty-first century. The second problem is that service is still seen as a commodity rather than as something deeper, a form of human interaction. Many large organisations still seek to provide service for the lowest cost and maximum profit. This, we argue, eats away at the fundamental purpose of service: to provide support and to help people live their lives to their full potential. This pamphlet makes the case for acknowledging the common challenge of service in thinking about how to transform public services. Starting here leads to a different diagnosis of the problem. It is not that public services need to be more like commercial service providers. It is that all service organisations need to find new ways of connecting intimately with their users and customers, of listening and responding in ways that reassure us all that we are being understood. In order to develop our thinking we spent time with a wide range of organisations from all sectors: public, private and voluntary that appear to be making inroads in building strong relationships with customers and users. Drawing on the interviews, workshops and case studies we conducted, we have generated a set of service design principles practical tools and concepts that offer fresh approaches to organisations seeking to close the gap between what they do and what people want and need. The current managerialist narrative about public service reform is out of sync with what people want and need from services at precisely the time that a febrile political environment is awakening a fresh debate about how people and services should relate to one another. Progressive politicians urgently need to create a vision for public services that puts people and places, not targets and key performance indicators (KPIs), at its heart. But if people are going to believe this vision, equally urgent is the need to refresh and renew the approaches that are taken to public service transformation. In this pamphlet we argue that this common challenge, facing all service organisations, leads to two major consequences. First, learning how to create deeper forms of satisfaction and wellbeing through service is the long-term priority for public service reform. Second, a distinctive approach to service design, which seeks to shape service organisations around the experiences and interactions of their users, presents a major opportunity for the next stages of public service reform: a route to get there. The search for real meaning For many people, relative material comfort is no longer enough. Twenty years ago, when asked what people looked for when making purchases, the most common response was quality of product. In 2004 the most common answer was honesty. 3 The result of the massive expansion in material wealth is that, in Ulrich Beck s words, people demand the right to develop their own perspective on life and to be able to act upon it. 4 The search for meaning, for authenticity, amid a world of brands, competing messages and demands, now characterises the lives of many people in affluent western economies. As one of the interviewees for this project put it, we are tired of being treated as nobodies with no personality by monolithic institutions, we want to be recognised and understood. And as Michael Willmott and William Nelson argued in their book Complicated Lives, the self is now something we seek to understand and express, not something we simply accept. This raises difficult issues for individuals as well as our companies and public services who are still struggling to escape the historical legacy of mass provision. 5 8/9 Introduction 8 As employees and citizens, we re tired of working and want our work life balance; as consumers we re impatient of being nameless and faceless, fighting for our needs; we want relationships not transactions; we want real voice not meaningless choice. Shoshana Zuboff and Jim Maxmin have argued that the sheer scale of the social and economic shifts of the last century, combined with the new possibilities offered by technology, add up to a wholly new enterprise model. 6 In this model, it is not products or services that we value most: it is support. Support that helps people to lead their own lives as they wish, and support that helps us to navigate an increasingly complex and information-laden world where it is hard to know who to trust. The commodification of service Imagine signing up to a luxury sports and leisure club. In exchange for a significant monthly fee, you are able to attend unlimited sessions, use as many large soft towels as you wish, pick and choose from a range of treatments and relax in the social area. Imagine if, one day, you visit to find a large notice limiting each customer to just one towel each. When you go to the reception desk to enquire about something, you notice a printout charting profits per month over the last quarter. The prices of refreshments have suddenly gone up and you notice that a treatment that had once lasted a luxurious hour now takes only 40 minutes. Good service cannot be reduced to nothing more than an efficient operation: its value lies in the less tangible sense that the service is supporting you, meeting your needs, working for and on behalf of you. The real problem with service is that it is still treated as a commodity as Will Hutton has argued, a commodity to be produced at the lowest cost by the most sweated workers. 7 This mental model of service has a long and deep legacy that colours attitudes in both the commercial and the public sectors. This legacy began when the first cars rolled off Henry Ford s production line. Although his business was focused on products, his particular model of mass production the greatest number of goods for the lowest cost and the largest number of people has become a defining feature of how we see service. Ford s model had three characteristics that are particularly significant for modern public services. First, costs were lowered through standardising the customer or their needs. Second, it drew a firm line between production and consumption. Goods were created out of the right combination of raw materials, machines and people; these goods were then marketed and sold to the consumers whose interests and needs had little impact on any activity within the firm. In other words, the value chain was linear, and the recipients of the products were placed firmly at one end of the chain. Third, this separation of production and consumption created demand for managers professionals whose primary role was to match supply and demand in the most efficient way, and whose positions were defined through access to expert knowledge and insight not otherwise available to the customers. For a long time, businesses sought to import this manufacturing model of mass production into service provision. More recently, as these organisations discerned a shift in consumer expectations, there has been a greater emphasis on personalised services and products. But when personalisation and manufacturing models collide, a very particular form of personalisation is created. This differentiation is based at best on mass customisation the breaking down of a particular service or product into modules which customers can then pick and choose from, or add and subtract elements of. Despite the best efforts of public service innovators up and down the country, our public services continue to be defined by a mass production model. This has created a system that works against professional desires to provide service in the form of support and dialogue to people. Although there are pockets of success 10/11 Introduction 9 around the country in genuinely providing service to people, these successes are more often thanks to professionals circumnavigating the formal system, rather than working with it. This government has not been blind to the limitations of mass production in creating public services fit for the twenty-first century. Since 1997 their approach to breaking out of this particular model has been guided by an emphasis on the diversification of providers, finding ways of increasing competition and contestability and combining them with central targets and pressure to perform. The almost continuous re-engineering of services that has taken place has been driven in part by a belief that creating a market will bring the consumer values of customer focus, responsiveness and efficiency into a public sector drowning in bureaucracy and paternalism. But all the evidence suggests that our commercial service experiences are, in general, not much better (and arguably far worse) than our public service experiences. According to research by the National Consumer Council, 81 per cent of people had a bad experience purchasing services last year. Words that came up frequently in relation to commercial service transactions included distant, clinical and uncaring. 8 There is no guarantee whatsoever that introducing private providers and market disciplines into the public sector will close the gap between what service organisations do and what it is that people are looking for. There remains a common challenge of service: that large organisations struggle on a daily basis to build genuine and meaningful interactions with their customers and users, and frequently fail to build any kind of responsiveness, flexibility or ability to adapt into their organisational forms. Why this agenda matters for public service organisations Commercial service organisations that are unable to connect with their customers risk losing business and profits. However, the risks for public service organisations are far higher. To achieve the desired outcomes, public services need people to get involved. The notion of co-production, initially dismissed as jargon that featured only in the lexicon of aspiring ministers and seasoned thinktankers, has become part of the new consensus about future approaches to public service reform. Contrary to Ford s model, co-production demands that production and consumption are brought together, so that both can take place simultaneously. As Sue Goss has argued: Many of the new priorities respect, an end to binge drinking, recycling, improved public health cannot be achieved by a smart government delivery machine; they require changes in behaviour from the public. This means not simply reconsidering how to deliver using public or even private resources, but how to access the free resources of public energy, engagement and action. 9 common enterprise of generating positive outcomes. In many ways the concept of co-production is not new: our children are not the first generation of students who need to be engaged in order to learn. More, what has shifted is our understanding of the role of the state. The five giants of the postwar welfare state saw the role of the state as being limited to developing systems that would help to avoid crises such as destitution, and provide cures and treatments for problems such as illness and unemployment. There was a powerful sense that with benefits came duties, built into a stable institutional and social framework that has now unravelled. In many ways, debates over the balance between individual responsibilities and state 12/13 Introduction 10 intervention was the leitmotif of twentieth-century politics, generating huge debates within political parties as well as cutting across party divides. The current emphasis on influencing the behaviour of individuals and engaging them in the co-production of outcomes could be seen simply as the latest chapter in a very long book. However, it also reflects an unsung triumph of New Labour. Even if they have not succeeded in transforming public services, they have succeeded in turning the tide of public opinion away from low taxation. A significant majority of the population now positively expects investment in public services. Politicians owe it to all of us to respond to these expectations, and frame a new story about what public services are for, and why they matter. The search for a narrative: people, places and service Despite the government s attempts to engage people in conversations about why public services matter for example, through 2003 s Big Conversation or this year s Let s Talk campaign it has in practice put managerialism over vision when considering how to improve and transform public service provision. Performance management, targets and public service agreements became the levers in the rather mechanistic world view of new public management for improvements. Alongside the regular spending reviews, commissions such as Gershon and Lyons have been set up to consider how to improve operational efficiencies and service processes. 10 Driving out bureaucracy, inspections, regulation and audits simultaneously indicated that this government meant business, and that it believed efficiency could be wrought from a combination of digitisation, process re-engineering, back-office rationalisation and restructuring. But in all the flurry of activity that has characterised the last ten years, we appear to have forgotten that a reform programme designed to improve the existing safety net was never likely to connect to the challenge of meeting the needs of a society in a state of perpetual change. As Peter Taylor-Gooby has argued, the rational incentive-based system that has driven New Labour s approach [to public service reform] risks neglecting the relationships that are so very important in forging trust. 11 This pamphlet offers some practical tools and insights from the small but growing discipline of service design as a first step towards re-balancing the emphasis that has been placed on managerialism. Service designers do not see service as something that can be reduced to a commodity. They focus on how people actually experience services, in order to understand how large service organisations can create better relationships with their users and customers. Experiences and relationships are the recurring themes of this pamphlet. In chapter 1 we argue that engaging people in co-production does not happen through consultations, on citizens juries or at council meetings: it needs to happen at the point of delivery and through conversation and dialogue rather than choice alone. Therefore, learning to understand and map how people experience the point of delivery, the interface between a service and their lives, is essential for creating the conditions for co-production. As we discuss, although smart use of data is important, spreadsheets are no substitute for people. Chapter 2 explores the pivotal position played by professionals in building relationships between people and services, and understanding how people experience services. We argue that two shifts one in professional identity and one in the shape of the organisational hierarchy need to take place if service organisations are to take a relational approach to service design. Chapter 3 looks at how service innovators are learning to understand these experiences through the eyes of many different and equally complex people, and how they can connect such a diversity of need to the design and evaluation of services without resorting to the mass production model of standardisation. It describes how the most successful service organisations are 14/15 Introduction 11 complementing the ways they measure overall service performance with experience metrics to build up a much richer picture of what really matters to people, and therefore where there is room for improvement. The fiction writer William Gibson once said, the future s already here, it s just unevenly spread. 12 Throughout this pamphlet you will find a handful of near future case studies of the public service innovators up and down the country who are demonstrating the impact of relational approaches to service reform. By starting with experiences at the interface, these case studies demonstrate that relational approaches combine personalisation and efficiency, at the same time as challenging our current understanding of what these terms mean. Finally, in chapter 4, we set out the main elements of a different approach to reform led by the service design principles of this pamphlet as it applies to the whole system of public services, with different changes occurring simultaneously at different levels. In doing this we pose some questions and challenges for politicians and policy-makers working on public service reform in coming years, and make some suggestions about where they might look to learn more about relational approaches to service. None of these arguments are about throwing away the positive aspects of current approaches to public service management and reform. But engagement and co-production will grow only out of a deeper, richer understanding of how services relate in practice to people s everyday lives. And in learning more about these interface spaces, it is possible that we could also uncover the seeds of a renewed sense of legitimacy for public services. People s level of trust in services is far higher when they are asked about their local secondary school rather than the education system as a whole: we trust that which we know. Learning to have more intimate relationships with people and seeing service as support rather than as a commodity may not only generate the outcomes we are looking for, but also offer the route to securing the legitimacy that public services in the twenty-first century so desperately need. Photo by Frank Baron 16/17 Introduction 12 Service stories In order to improve their UK business, BUPA relies heavily on the concept of the end-to-end patient journey. Every quarter, senior staff at BUPA Hospitals work with a handful of their customers to trace what happens from the moment someone begins to feel unwell often some time before that person gets in touch with BUPA. As Alison Platt, head of BUPA Hospitals, says: Doing this exercise immediately colours how you think you ll treat that person the language, the anxiety, the bureaucracy. Having traced this, BUPA then maps its own processes, technology and interventions to the end-to-end journey. Senior staff ask themselves what each interaction looks like, what transactions are possible, what information any patient really needs. Finally, they add a third line one that looks at behaviours. As Alison says: A call isn t just a transaction, we need to ask: How do I want to make you feel? A tangible change that has emerged from doing this exercise regularly is that customers calling to discuss their hospital visit are now offered a checklist of things that other people in similar situations have asked. This was introduced after BUPA realised that people often didn t know what to ask when the call finished with the question is there anything else I can help you with? Alison, again: You have to do as much as possible to manage getting into people s shoes psychologically, emotionally, physically. 1 Seeing services as people do Services need to be understood as a journey or a cycle a series of critical encounters that take place over time and across channels. The biggest mistake that large organisations can make is to assume that they know what their service users and customers want. The common challenge of service the emotional distance between the board and its customers, between local authorities and their citizens is reflected in low levels of trust and satisfaction. People in general do not often believe that their needs are met by large service organisations in either the commercial or the public sector. If the primary cause of dissatisfaction people have with service organisations is that they feel misunderstood, ignored, and treated as faceless and nameless, then service organisations need to find new ways of getting to know their users, in all their messy complexity. The attitude here at BUPA about customer research used to be like that of the interested spectator now we use it to drive decisions. In recent years, public sector organisations have demonstrated a growing interest in the tools of the marketing and advertising industries in a quest to learn more about how insights about people 18/19 People 13 can be used to improve what public services offer and how they offer it. The service innovators we met dedicate people and teams to worrying about the question of what it is that people need and want. They constantly search for ways of gaining more and deeper insights about their customers. They are alive to the fact that these needs, expectations and desires are subject to change over time and across circumstances. And most importantly they constantly strive to connect the insights they gather to organisational strategy, product development, communications and priority-setting. Alongside the focus on contestability and competition, measures of customer satisfaction and the increasing use of segmentation techniques are seen as the routes by which public services can close the gap between what they do and what people want. In this chapter, we begin by exploring the most innovative practice around the use of customer insight. However, the service innovators we spoke to as part of this project recognised that, while vital, customer insight alone will not generate solutions to the common challenge all large-scale service organisations face. People, in all their complexity and unpredictability, can never be reduced to data. In the latter part of this chapter we look at how successful service organisations keep a steady focus on experiences as a means of guarding against the temptation to put people into boxes or reduce them to a spreadsheet. Knowing your users, part one Humans are complex beings. Our organisations are constantly trying to catch up. An ongoing commercial research study 13 now segments all 24 million UK households into 11 groups, 61 types and 243 segments. The study describes each household type in terms of its values, patterns of consumption, likely financial situation and where in the country they are likely to live. This level of complexity can easily feel daunting, but if public service organisations are going to close the gap successfully between what they do and who people are, this complexity needs to be explored and engaged with rather than driven out. Responsive, relational models of service must find ways of visualising users and understanding their needs, fears, aspirations and preferences. Between them, all the local authorities across the country probably hold more data than the commercial study noted here. The question is how these data are being used. There has been a growing interest in segmentation, and in understanding how to turn raw data into useful insight that improves and targets particular forms of service. For example, the London Borough of Hammersmith & Fulham recently cross-referenced detailed census data with information about the use of services in the borough to target services and communications in each neighbourhood. Their Customer First programme has identified seven customer types including childfree prosperous young adults renting from private landlords, and older people in poorer health with moderate prosperity. Some remain cautious about the value of demographic or social class segmentation. Any approach to dividing down large numbers of people into subgroups is limited by the assumption of homogeneity within each segment. Certainly social class is a likely indicator of the types of services someone may or may not use but used alone it provides little information about how to design the experience of that service for that group. The real richness comes from cross-referencing multiple sources of data. Beyond the basics The immutable complexity of people needs to be seen as a source of insight for innovation rather than a productivity headache. New approaches to the design of services use segmentations to break down the more complex dimensions of need, belief and behaviour that shape peoples responses to service. Such models are developed more rapidly through smaller-scale qualitative studies that are designed to inform service re-design and innovation and indirectly to derive customer-value metrics from which performance can be measured. 20/21 People 14 Attitudinal segmentation seeks to understand the meaningful distinctions between the values and beliefs of users with respect to a particular service. This type of segmentation might identify subgroups by statements such as, I m fiercely independent and want to be treated so, or I ve paid for this service I m entitled, or I don t want to be a bother. Behavioural segmentation groups the practical reasons why people are using a service or channel as the basis for understanding what is required. A behavioural segmentation model might group users by statements such as, I need help, I need some support, I need to complain. Journey segmentation recognises that there may be many routes to a single destination such as achieving a healthy body weight. As a nation we need to eat less and do more exercise but simply reminding people of the consequences of not doing this is not going to have a huge impact. Services need to be accessible, but the designers of services also need to have understood the breadth of starting points and the complex emotional journeys that people will need to be motivated to embark on. 22/23 People These responses to the challenge of complexity reveal new insights that go beyond what to provide? and begin to answer how to provide? Increasingly service providers are using what they know about their users to create segmented service propositions based loosely around customer types but inviting customers to self-segment to choose from a small number of similar offers and channels based on what they think best matches their own needs. The same offer may be packaged in a number of different ways so that it is not about the choice of which service but the choice of which experience. The customer takes control of the choice. Self-segmentation is one response to the realisation that people increasingly defy segmentation and do not like to be told who they are by big organisations. People exhibit what marketers call multiple personas. We can be professionals, parents, pleasure-seekers and Photo by Graham Turner 15 NIMBYs all in the same afternoon. Elderly people are no longer just elderly. Teenagers are no longer a homogenous group all buying the same music and clothes at the same time. People are constantly shifting or are shifted between the segmentation models of different service providers. A bank identifies someone as one type of person and a phone company identifies them as another. Generally this is not a problem: as consumers, people are in control of these relationships and they are not looking for their bank to sell them phones or their phone company to look after their money. It suits people to be seen and treated differently by different providers when each is offering different things. The frustration begins when an individual wants to be seen as a whole person and the system can view them only as a collection of isolated segmented subgroups across multiple segmentation models. Speaking at Demos, Jim Murphy MP highlighted the difficulty government has in seeing citizens as individuals. 14 As he pointed out, a single mother is viewed as being at least seven different people across government agencies, including a parent, an employee, a road user, a taxpayer and so on. The limits of the model In other words, models of segmentation in the private sector do not necessarily translate wholesale to the more complex service systems in the public sector. In fact the focus on customer segments disguises the system of relationships that impact on people s experiences and outcomes. Used in isolation, customer segmentation carries the risk of reducing service interactions to a series of one-to-one transactions and reinforcing the provider knows best paradigm. Such use of data and insight works best when used alongside some of the techniques and methodologies outlined in the next section techniques designed to prevent service designers from reducing real and complex people to statistics or segments, and to keep a constant focus on the lived experience of the user journey. Data and insight will never replace people. As systems get larger, management levels increase... but the visibility of the consumer or user is critical. This isn t to do with focus groups, but real involvement and development. The consumers need to stay as real individuals, not just statistics. 15 Knowing your users, part two Using customer insight to tailor services both in terms of what is offered and how it is offered does not necessarily shift the stubborn legacy of mass production services. Using data to tailor products and services is similar to drawing information out of users, re-calibrating and responding. The people represented by this goldmine of data are still kept at arm s length from the operations and decision-making processes of the organisation. Similarly, for people working in those organisations, insights turn people into numbers, making them two-dimensional. In the end, your success will depend less on customer segmentation and more on your ability to describe the needs of your customer with great vividness. 16 Many of the service innovators we spoke to have recognised the limitations of customer insight models, even at their most sophisticated. As a result, they have begun to make the long, slow and difficult journey to the interface themselves. Rather than sucking data in, they are experimenting with tools and techniques that take them to the points at which people actually experience services. Making this journey enables organisations to understand in much greater richness how people and services relate in practice. For public services, we believe these tools and techniques are of particular interest. The desire to empower users and involve them in co-producing outcomes is now so common it is almost a truism. Yet, even with the most determined staff and leaders, the legacy of mass production makes it almost impossible for such service organisations to escape their own vantage point on services as functional institutions and episodes that interrupt people s lives to look afresh at what they are doing from the eyes of users. 24/25 People 16 And it is hard to escape these prisms. The mobile phone company, Orange, knows from experience that making the journey [to see services from a customer s eyes] is very hard, as people have a job within an organisation. Their concern is usually with delivering their part of the service, not putting themselves in the position of the user. Experiencing services from a person s viewpoint is very difficult. Seeing your services as your users do is not, unfortunately, a route to simplifying the picture, but it enables organisations to see a different kind of complexity, a complexity that sheds new light on how best to prioritise operational, organisational and policy change. For service designers, the building blocks of service are not episodes and institutions. They are the touchpoints, channels, architectures and journeys that describe services from the starting point of the interface. It is those concepts that the following sections explore. The tangible elements of service: touchpoints Touchpoints are the people and tangible things that shape the experience of services (see pages 28 29). The interest in touchpoints originally grew out of organisations seeking to reinforce their brand in ways that went well beyond marketing and mass advertising campaigns. In practice, this recognises that as customers of an airline, we are more likely to remember something about the brand from our interactions with cabin staff, for example, than we are from looking at the design work on the tailfin. Everything we do should be characterised by obsessive and uncompromising attention to detail. We know that any journey is made up of many little experiences and that it doesn t take much to turn a happy customer into an unhappy one. We cannot afford this and we must not let this happen. 17 Although branding may not be the top priority for many public service organisations, there is a crucial principle here. Touchpoints are the places and spaces where people experience services. The extent to which their brand invites people in or frustrates them determines the extent to which those people are engaged. And the level of dissonance between what an organisation says it cares about (for example, personalisation or user empowerment) and how people experience that organisation lies at the heart of whether or not people trust such services. People become suspicious if experiences do not match the expectations created by rhetoric, customer charters and organisational commitments. The need to map public service touchpoints and explore the extent to which they support the commitment to personalisation and co-design is illustrated by the comment of one of our interviewees about a recent hospital experience he had: You get the feeling they don t want you there, that they think you re the problem... they seem to be saying my life running this hospital would be so much easier if you weren t here.... My experience is that hospitals perpetuate my anxiety; when I find myself in this system I feel helpless. There is nothing you can do to ease your anxiety. Information provision is appalling there s no hand-holding. You find yourself asking several dumb-sounding questions to various people behind desks it seems as though the system somehow requires you to do so. In this comment, it is possible to identify a whole range of touchpoints people, desks, information provision, the hospital building itself that together combine to disempower the person needing the service. The forgotten touchpoint: service environments Almost all public services have an implicit association with a designed and built environment. Some of the most profound and emotionally charged interactions with public services happen between four walls where furniture, fixtures, fittings and the design of information play a significant role in shaping people s experiences. Yet so often, they are treated as neutral spaces where stuff happens. In fact, our behaviour is shaped by the environment. Chris Gerry, head of New Line Learning Federation in Kent, told us that the kids behave differently in here [the school] to out there and yet the rules aren t written up, they re embedded. 26/27 People 17 28/29 Touchpoints 18 Intuitively it s impossible to ignore the impact the built environment has on people s sense of self and agency. For example, one student participating in a Guardian book about experiences of school 18 commented that the basic aspects of the buildings we are taught in do not promote learning, but instead, enhance feelings of negativity. Spaces are not empty vessels; they are socially constructed and as such can communicate powerful messages about value, the importance of users and the extent to which they can play an active role in service. One of our commercial interviewees commented: 30/31 People People get psychologically managed by rooms and corridors to adopt behaviours that suit the organisations and support its systems the spaces are not configured to the needs of those people. There is unprecedented capital investment going into the re-design of public service environments at the moment, across schools, hospitals and other public buildings. While such high levels of investment are welcome, there will be a return only if the construction of new buildings grows out of a focus on how spaces can be designed to empower users. This is not about re-creating modernised versions of old buildings. We need to turn the focus to how these buildings relate to the services enacted within them, and communicate to people that they are in control. In turn, this requires that public services considering new builds start with architectures, rather than architecture. This is a term borrowed from the world of web development. It means the complex and dynamic arrangements of objects, dialogues, information, content, processes and navigation that they work with online. By focusing on architectures, service providers start by considering customer behaviour first, and built architecture second. For example, many shops and leisure venues create a range of personas to imagine the needs and preferences of people using a space. From this they are able to explore how to respond through the design of the environment to the various motivations of their 19 customers. Service blueprints are developed alongside building blueprints. In this way organisations can design environments that are both instructional and inspirational to a diverse group of users. Greater access through the proliferation of service channels In the past, the customers of services tended to stick to a single channel. People booked holidays by sitting in front of a desk in a travel agents, they bought bread from a baker and got their milk from the doorstep. Public services have in recent years begun to expand the number of ways in. Andy Carroll, a strategy manager at the Pensions Service, told us that we ve made a huge investment in moving from a local paper-based organisation to a national contact organisation. The goal for the Pensions Service is to move away from office-based services, instead supporting people over the phone, or via one of the 2500 outreach workers who are now working to support such a major channel migration. The story of the Pensions Service is mirrored all over the public sector. To access health support people can attend a medical drop-in centre, go online or call NHS Direct which now receives 600,000 calls per month in addition to making an appointment with their general practitioner (GP). This trend is likely to grow: last year, the Cabinet Office published Transformational Government where they argued: Over the next decade, the principal preferred channels for the delivery of information and transactional services will be the telephone, internet and mobile channels as well as increasingly important channels within the digital home... government will innovate its services to take swift advantage of new technologies as they emerge. 19 In this proliferation of channels, of ways-in to services, there are two key questions all service organisations need to address. First, how can they understand the different channel needs and preferences of a diverse set of users; and second, how can they understand the different interactions and relationships between different channels. Any attempt to create an integrated channel strategy (as set out in the Budget earlier this year) needs to start with people s experiences and preferences for different channels, rather than efficiencies alone. Today, it is no longer possible to assume how a user will access and use a service once many channels are available for them to do so. Therefore every channel needs to some degree to accommodate every kind of user and must be joined-up so that users can move easily between them. Orange, for example, uses a single customer account, which enables them to provide a consistent experience regardless of whether customers decide to call up, go online or visit a store on the high street. This is important because channels are not simply new routes for delivering services. They remain ways of engaging users, of drawing them in, of helping people to look after themselves. Therefore individual channels and the relationships between them need to be mapped onto people s lives. As a member of the Transformational Government team told us, solutions need to be about services, not IT. To make this real, the government is going to need to do more than promote responsible channel choice by telling people how much the use of more efficient channels saves, and what that saving could achieve in terms of reinvestment elsewhere in the public services. 20 Building the functionality of e-government must not distract government or users from the more difficult challenges of improving services. Technology is of course part of this, but it is by no means the only part. The interaction of different touchpoints: journeys Greg Nugent from Eurostar told us: Mapping the customer journey brings together services, products and experiences... it s the only way you can see how they interact and how the brand adds up to more than the sum of its parts. Doing the journey made people admit where it was going wrong, because they could see it all in front of them. 32/33 People 20 Earlier in this chapter we noted that often service experiences are treated as episodes interruptions to people s everyday lives. By starting with people and asking them to describe their experiences as BUPA does, in the example that began this chapter the focus shifts from looking at episodes, to thinking about journeys: how all the touchpoints and channels come together over a period of time and interact with people s lives, needs, interests and attitudes. When someone enters prison, they are assessed seven times in the first three days for level of risk, for health, for learning and development and so on. Each of these assessment touchpoints could be perfectly designed; however, for many prisoners it is frustrating to provide the same information time and time again. It serves to disempower them, to leave them as little more than a figure on an assessment sheet. Focusing on individual touchpoints and exploring the extent to which they live the brand of user empowerment is a vital part of a relational approach to public service transformation. However, equally important is the need to understand the interactions between different touchpoints and channels. Equally, if the information taken about these different needs is not pulled together by the organisation, how can it ever provide an integrated service to the prisoner? Services need to be understood as a journey or a cycle a series of critical encounters that take place over time and across channels. This is key to integrating the organisation of services around their user, and to combining distributed organisational resources to create experiences and outcomes. The concept of service journeys is familiar to designers. As a technique it was pioneered and trialled extensively in Scandinavia; it has been used to design everything from aeroplane cockpits to financial trading systems and is increasingly being applied to services in the public and private sectors. As a method, it enables people to create a rich picture of how service experiences play out in the context of everyday life. The objective here is not to understand and optimise operational processes but to determine the best experiential journey for the users of a service. As the example of BUPA demonstrates, mapping a user journey is a far more powerful way of understanding where services could be improved and how engagement could be better encouraged than any kind of large-scale customer satisfaction survey. But journeys can be used for more than simply identifying problems or points in the service where there is room for improvement. As the users of services are given more choice, and are empowered to make decisions that may previously have been made by experts, it will become more important to include tools to help people manage the uncertainty associated with choice. Talking about equipoised choices in healthcare, Bernard Crump, chief executive of the NHS Institute for Innovation and Improvement argued: We need tools to help what need to be sophisticated and paced conversations about decisions to be made these decisions don t lend themselves well to the seven-minute outpatient model... we need to surround that consultation with tools to help people decide what to do. 34/35 People 21 A service journey is often characterised by a series of choices, which in some instances may have life-changing consequences. Well-designed service journeys should first anticipate and designout the likely errors that users could make when using services many of which can be put down to poor information design and reduce the negative effects of any errors that are made. When possible, service users should be able to undo choices and re-choose without incurring penalties. Another strategy to reduce the uncertainty of choosing is to provide the means for users to simulate choices to play out scenarios and to experiment with the options available. Through the simulation of future journeys the likelihood of making the right choices increases, and the risk and inefficiencies associated with making the wrong choices are reduced. The new building blocks of service Insights, segmentation, touchpoints, channels, environments, journeys. It is these, not data, functional institutions and episodes, that constitute the building blocks of services from a user s perspective. If the commitment to creating user-centred services is going to add up to any more than hollow rhetoric, then service organisations need to become experts in the methods, tools and ways of seeing service that ensure they can genuinely make the journey to the interface, and see their services as their users do. The picture of service is no less complex from the interface as it is from a systemic perspective. What is different, however, is that the interface focuses on how people and services relate, not simply the shape of existing services. In tackling the common challenge of service that this pamphlet is focused on, we need to recognise that generating positive outcomes requires engagement, and real engagement comes through experiences. Therefore, being able to map and shape those experiences is the only way that public service organisations will be able to create strategies for genuine improvement and ultimately the transformation of services. Challenges How are you segmenting your users? What combinations of data do you use to create insights? Who is responsible for user intelligence? How are they connected to the management of your organisation? Are you genuinely looking at your services from the vantage point of the interface? Can you map all the touchpoints of your service? Do you know how people feel about these touchpoints? How do the different channels of online, phone and face to face interact for different kinds of service users? How are you designing in deliberation, dialogue and opportunities for co-creation to the touchpoints and channels of delivery? A shared language of service Journeys Channels Segmentation Proposition Touchpoints Architectures Service environments Personas Definitions on page /37 People 22 Luton and Dunstable Head and Neck Cancer Services 38/39 Case study Photo by thinkpublic The multidisciplinary team meeting at the Head and Neck Cancer Clinic starts at 8.30am where some patients cases are discussed by the team to make decisions on treatment and care. At the same time patients start to arrive at the clinic waiting room. This is an anxious time for patients and sometimes parts of the clinic process heighten that anxiety rather than reduce it. The way the chairs are arranged in the waiting room leaves patients facing a wall full of official notices or looking directly at others; the number of different professionals that seem to be around can be bewildering as are some of the processes. This often leads to a feeling of helplessness, and thinking if only the experience could be different : You have to get there early to claim a seat otherwise you re standing... by the time the consultants arrive at the clinic it is already busy as the clinic shares its waiting area. There are patients and carers standing all over the place, waiting quietly to be seen. The consulting rooms at the clinic are much like a dentist s; the patient sits in the chair and stares upwards, surrounded by an average of seven members of staff, and it is in this situation that most patients are given their diagnosis. Across the NHS patients are rarely involved in healthcare improvement beyond mechanisms such as focus groups and questionnaires. Luton and Dunstable Hospital Head and Neck Cancer Services has been taking an innovative approach to the ongoing re-design of their service, which is putting patients and staff right at the centre of the process. 23 The project has been sponsored and supported by the NHS Institute for Innovation and Improvement and is co-produced with the service design consultancy, thinkpublic, anthropological researchers from University College London and, importantly, patients and staff from the hospital. The objective has been not to solve any specific problem of service delivery, but to achieve an improved experience of the service by involving staff and patients in the process of re-design. To do this, a range of techniques has been used to help patients and staff describe their experiences with a specific focus on the touchpoints. A project team was brought together that comprised patients, carers, healthcare staff, researchers and improvement leaders. The core project team knew that the initial engagement with patient carers and staff would be critical, so in the build-up to the project they engaged with their audience through a range of communication media including posters, leaflets and a low-tech newspaper to create interest. Patients and staff were invited to become involved in examining the service in ways that were unfamiliar to most of them. A participatory design project like the one at Luton and Dunstable is not something that staff can be coerced or targeted to get involved in. Vital to its success is that those who take part are willing and energised participants. As a subtle mechanism of recruitment onto the project, all staff were invited to keep log books and to note their own thoughts, frustrations and ideas about the service they were providing. Deborah Szebeko, a member of the service design team, told us: We had a strong sense that patients wanted to get involved because they felt that they wanted to give something back to the service. Staff were excited to work with patients in a way that was different from their usual relationship with patients. Insight was generated in a number of ways including further work with the log books and patient interviews. The patients and staff mapped a set of touchpoints that they felt formed their experience of Head and Neck Cancer Services and re-played their emotional journeys through the service. These touchpoints then formed the key focus for re-design. Many of the touchpoints that were identified can be re-designed very easily and would make a huge difference to the patient experience. For example, staff moved weighing scales out of sight of the waiting room they hadn t noticed how embarrassing patients found it to be weighed in front of everyone. Film was also used as a way to encourage involvement literally handing over the lens through which the service was viewed to patients and bringing their lived experiences to life for others. Patients found this process to be an incredibly powerful way to share their stories and be heard. When patient s films were shown during working sessions it immediately created a shared understanding and a new empathy for the deeper needs of patients. The effect was to connect and energise the group towards a common purpose to improve the patient, carer and staff experience. As Deborah told us: While we did have some concerns that re-living and sharing these types of experiences might be difficult for patients, the majority felt that it was invaluable in helping them to move forward and in building relationships with other patients, carers and staff. Many patients suggested that the project methodology of filmmaking that they had been invited to work on should become part of the patient journey itself an example of how handing control over to users in the context of a designed methodology becomes an aspect of service in its own right: We ve had one patient working closely with us and visiting our studio to edit his film; he has helped bridge a gap and get staff on board with film. He is extremely passionate and just really wanted to help; he has taken time off work to get involved with the project. He also feels he is learning new skills. 40/41 Case study 24 In this example, service design, service delivery and insight generation happen simultaneously and collaboratively at the interface. As one patient of the service said: I enjoyed meeting everyone feeling I was eating properly for the first time, possibly because I was in company. This type of participatory design intervention led the team to conclude that the principle of building continuous service improvement mechanisms into the everyday experience for both patients and staff rather than being an independent activity can add an incredible amount of value to the service. And importantly, it helps to improve communication between patients and those staff who are providing care. Through mapping user journeys, patients articulated clearly that this clinic represented a pinprick in comparison to their whole journey, which involved many other departments and hospitals as well as touchpoints outside of the formal system. This demonstrates the wider challenge for health services in working together across the whole patient journey. The process so far has opened up a new dialogue between staff and patients. The project which now has its own active blog has connected people with the same interest in improving the touchpoints of the service and has given permission and a structure to make small but significant changes happen. Lynne Mahar at the NHS Institute for Innovation and Improvement commented: The process so far has challenged traditional views and experiences of service improvement, giving patients and staff a new energy and commitment for change. Together they are trialling how the clinic s space is used; instead of the consultants having rooms, which patients move in and out of, patients now have rooms and staff move to see them. The clinic is now building a closer relationship with neighbouring Mount Vernon Hospital, which provides radiotherapy, to build a better understanding of the wider patient experience. The project is still work in progress but staff appear to be more motivated to work with patients. Patients are calling staff to arrange times to meet; they appear to be mobilised and active in co-designing and trialling ideas. The perceived risk expressed by some staff that involving patients in this way would unfairly raise their expectations and lead to disappointment has not transpired. As one member of the team pointed out: Patients and staff are not asking for gold taps, in fact most of their suggestions are quite achievable with a little budget. I would say one of the most important things is providing space for relationships to build and supporting that with communication. The experience of connecting patients and staff in this way has proved to be extremely valuable in changing beliefs about what they can achieve. This combination of experience and belief has led to positive action, resulting in change that will actually improve experiences. 42/43 Case study 25 Service stories Peter Gilroy, now chief executive of Kent County Council, told us that the quality of interactions is my obsession... relationships are the glue that hold everything together. In his previous job, as strategic director of Kent Social Services, his first step towards achieving 3-star status was to work on improving the experiences of his staff working at the council: If we can t look after our staff, they are not going to look after our customers. He produced a ten-point plan that focused on two dimensions: people s work on the job and their quality of life overall. Training and career progression was a major focus, as was work life balance and staff health. But Peter s approach went beyond simply making life better for his frontline professionals: he took that focus and used it to demand that people re-imagined the shape of the organisation: I wanted to create a paradigm shift to show that the front of our business was more important... you ve got to take very seriously the behavioural and care aspects of the workforce and I don t mean of your senior people, your priority must be the front of the business... transformation isn t just about things, it s about behaviours and mindsets. High expectations are rewarded with recognition and validation for good work. Kent has regular Oscar ceremonies for frontline staff, and employees from any area of the council can qualify for exchange trips around the world if they have performed excellently. Under Peter s leadership, Social Services reached 3-star status and Kent is now one of four 4-star councils suggesting that his determination to put the frontline centre stage reaps powerful benefits not only for the people working there but also for the citizens of Kent. 2 Professionals and practitioners Find ways of enabling professionals and people to work together: create spaces for simultaneous empowerment. Richard Elliot, former manager of a drugs action team in Bristol, found himself dealing with a tangle of 44 different funding streams, nine planning grids and 82 different objectives. By his estimation, he and his team spent little more than 40 per cent of their time actually working to tackle drug issues. Unsurprisingly he resigned, writing that monitoring has become almost religious in status, as has centralised control... the demand for quick hits and early wins is driven by a central desire analogous to the instant gratification demands made by drug users themselves. 21 Richard s story is echoed in a wider complaint about the impact of targets of professional autonomy and identity. Public service professionals and practitioners are growing increasingly vocal about the unintended consequences of targets, arguing that their cumulative impact adds up to disengaging, frustrating and alienating experiences for service users. Practitioners recognise that many people approach a service organisation and are made to jump through a set of complicated hoops in order to meet an apparently 44/45 Professionals 26 straightforward request. The agents they are interacting with are not doing what seems obvious to meet the request, because they are instead driven to focus on doing whatever they need to do in order to meet the target. Those who work at the frontline of public services argue that this runs entirely counter to why they took their jobs in the first place, and that targets from central government undermine their professional autonomy. Their frustrations stem in the main from the sense that the system prevents them from providing the support they want to give as professionals. But this is not a straightforward story about oppression by target. At the start of this pamphlet we described the notion of mass production services, a model where one of the most distinctive features is a particular form of professional identity. This identity is characterised by access to expert knowledge and insight not otherwise available to people and users: the primary job of the professional is to match supply and demand in the most efficient way through acting as gatekeepers to services. The impact of this on people s experiences of services is just as profound as the target culture about which professionals complain: such models of professionalism create an unequal distribution of power. Sitting in the consulting room as a patient is a very different experience from sitting in that same room as the doctor. Over the years organisations have tried to improve the quality of interactions between staff and customers through introducing behaviour guides such as requiring staff to look customers in the eye, wishing them a good day with a pleasant smile. These are all important, but only if they stem from a deeper, more profound shift in how staff and customers understand their relationship. In this chapter we explore the place of people-facing professionals in organisations that are innovating services. Drawing on our case study organisations we argue that two themes need to be put at the heart of approaches to reform. The first is the task of shifting notions of professional identity from being about expertise and knowledge to being about building capacity to cope. The second is to design in a focus on the frontline, the interface space between people and services. The zero-sum game of professional and public autonomy Ninety-one per cent of people with long-term health conditions report a desire for a greater say in decisions about their treatment. 22 Every week, 52 million Americans go online to find out about health. 23 Parents overwhelmingly see other parents, not professionals such as health visitors and parent practitioners, as the experts. 24 In searching for meaning and recognition, people are looking for greater autonomy and an understanding that they want the right to make decisions about their own lives, as the people who best know the social, cultural and economic context of such decisions. The rhetoric of user-led public services put forward by this government risks polarising professional and user empowerment as if it were a zero-sum game. For example, in autumn 2005, the Prime Minister made a speech in which he argued that public service reforms [in health and education] must be driven by the wishes of the users not the producers. 25 There is a sense that if users need to be put at the heart of public services, then providers, producers, departments, agencies and councils must step back, cede power and stop pursuing their own interests and preferences. Yet advocating user empowerment in this way will not resolve the tension that characterises debates about the place of people-facing professionals in public services. Relational public services require dialogue, empathy and understanding. Over 30 years ago, Ivan Illich wrote passionately about the need to go beyond existing models of professional user relationships. In Deschooling Society he argued that good institutions encourage self-assembly, re-use and repair. They do not just serve people but create capabilities in people, support initiative rather than supplant it. 26 Far from seeking to set 46/47 Professionals 27 user interests and producer interests at odds, future approaches to reform need to focus on how people and service staff can work together to create outcomes. When Richard Duvall founded the online bank Egg, he set out to create a bank that could dance with its customers a bank that could respond to changing needs, expectations and preferences. Similarly, the most successful service organisations are finding ways of recognising people s professionalism through being experts in designing support collaboratively with people. Professional expertise continues to exist, but it is deployed differently: rather than solving problems or telling people what to do, this expertise is used to uncover needs and help people navigate a complex network of possible support. 48/49 Professionals The professional as expert but not as we know it The collective good is made up of millions of different, sometimes intimate decisions and experiences about the way people lead their lives. These decisions depend on relationships more or less equal, more or less deep, more or less extended, but always a two-way exchange between public and professional. 27 The tension that on the one hand, professionals feel disempowered by targets, and on the other, dominant models of professional identity keep the power on the side of the service organisations, not the users, will not be resolved through setting staff and users against one another. The challenge, instead, is to focus on how professionals and people can work together to create outcomes. Service innovators have focused on creating spaces where professional and personal autonomy can grow simultaneously. They have done this through fostering a form of professional identity, vested less in expert knowledge and more in capabilities to provide deep support to individuals, to motivate them to help themselves. As Charles Leadbeater has argued, professionals should serve people in a way that builds up distributed capacity for coping. 28 Photo by Linda Nylind 28 If outcomes are more likely to be achieved when reform to public services starts with the experiences and interfaces between people and services, it is clear that frontline workers are an essential part of the jigsaw puzzle. Despite expanding options for self-service, many of the most complex problems people face go beyond the boundaries of DIY service. However, the insights put forward in this chapter apply just as much to the fleeting interactions between people and service professionals as they do to longer-term relationships. Relational approaches to reform are not all about forming long-term relationships over time; instead they are about a set of qualities empathy, recognition and understanding and a consequent focus on dialogue. As one participant from a local authority said to us: We aspire to create relationships with our customers but at the moment we barely give them a one night stand. What s important isn t the length of the relationship but the extent to which I feel understood and listened to at that moment. Putting the frontline centre stage Chapter 1 has already described how hard it can be for large organisations to genuinely see their services from their users perspectives. Equally, making the case for empowering staff to work collaboratively with users is far easier than creating organisations where all the surrounding systems and processes align with those professional values and expectations. A common theme in all the organisations we met is that an unerring focus on creating highly satisfying customer experiences has to be sponsored from the top. Similarly, such a focus can sometimes lead to short-term losses in order to make long-term gains. For example, in 2005, BUPA processed 90 million of ineligible claims. It did so because its frontline staff had worked with the customers and decided that, for whatever reason, there was a good case to process the claim. By doing this, BUPA is effectively communicating to its staff that listening to the customer is more important than enforcing the rule book. Customer satisfaction and loyalty, rather than immediate profit, is an important part of BUPA s long-term commercial position and the management communicates this effectively to staff and customers alike when it goes ahead and deals with those ineligible claims. The remainder of this chapter outlines how successful service organisations have taken a simple principle that professionalism needs to be rooted in empathy, support and dialogue and threaded it through every layer of their business, from individual accountability, to shared values, to organisational systems, benefits and processes. It is this Russian doll approach that ensures that this is about far more than simply overlaying old models of service with new indicators of customer service. Instead these organisations demand a lot from their people-facing professionals; but in return they put the frontline the interface centre stage and shape the organisation around the pursuit of high-quality interactions between people and services. Accountability for experiences: defining professionalism for individuals Recruiting for empathy first direct, judged to be the number one bank in terms of customer service, explicitly hires empathetic people and interestingly, many former nurses and teachers can be found on the payroll. John Lewis Partnership speaks of the importance of recruiting partners who are experts but as Patrick Lewis, their supply chain manager pointed out, we need to be careful that people are experts in customers not products. They recruit predominantly on attitude rather than experience; this is reflected not only in how they bring in new recruits, but also by the fact that many of their senior positions are filled through internal promotions. Large organisations need to find new ways, not only of encouraging, but of making inevitable a focus on the extent to which staff respond to and support people seeking service. The dialogue and conversation that sits at the heart of relational approaches is about more than listening. It requires staff to be empathetic, to have an intuitive unity with people that is driven by their recognition of the emotional, social and cultural context of service experiences. 50/51 Professionals 29 Guardians of the customer experience Many of the organisations we met over the course of this research had introduced performance frameworks that evaluated every member of staff on the basis of their contribution to positive customer experiences, in addition to some other more traditional measures of job performance. For example, at Virgin Atlantic staff are appraised on the extent to which they perform as guardians of the customer experience. Angus Struthers told us: Staff have to remember that they are not just working for Virgin Atlantic, but they re working for the passenger and they have got to be able to put themselves in the shoes of the passenger, and ensure that passengers receive the kind of experience they would like to receive, as corny as that may sound. And as Alex Popple at MSN UK said: We re incentivised around doing things that are ground-breaking... everybody is supposed to have an objective around improving the customer experience. Open and shared professional values and behaviours The most successful service organisations have understood that they cannot simply legislate for how staff relate to customers through performance frameworks. These organisations have also focused on how to keep relational values alive, to stop them from ossifying in company mission statements or job descriptions that get buried in human resources folders. They are experimenting with new ways of distributing capacity for holding staff to account on responding to people s needs. They are permanently looking for new ways of fostering a sense of mutual accountability. BUPA and Tesco have invested considerable company time in working with staff to develop the values that guide relationships with customers. For example, at BUPA Hospitals, the senior management team worked with all staff to answer the question: If you were doing your job brilliantly, what would it look like? Significant organisational time was put aside to consider the question. The result is not a fixed set of job descriptions, but rather a series of excellence profiles for all staff, ranging from catering managers to consultants, that represent a shared set of values to which people can be held to account. Everyone is able to access any excellence profile they wish through a central system. Rather than defining a specific set of activities, the profiles are aspirational and are firmly grounded in the organisation s mission to take care of the lives in our hands. Similarly, about five years ago, Tesco held a series of day-long seminars for literally thousands of staff. The purpose of these sessions was to start a conversation about what Tesco stood for, and what it should stand for. The results were boiled down into two simple, memorable lists: four things we do for customers and six things we do for each other. In developing these lists, Tesco successfully created a shared agenda, used and owned by staff up and down the country. Pret a Manger uses its recruiting process to remind staff of its values and encourage them to own them. Every applicant who wants to work at Pret is invited to an experience day a day where they go and work in the store to which they have applied. At the end of the day, the rest of the staff vote on whether or not the applicant met the criteria of customer focus that all Pret employees are held to account on. If fewer than 90 per cent of staff believe that this is the case, then the person does not get offered the job. Experiences at the interface drive organisational priorities too The story of Peter Gilroy s ten-point staff plan outlined at the start of this chapter illustrates another common theme from the organisations we spoke to over the course of this research. All had high expectations of staff. But they also tried to provide a lot in return, both in terms of recognition and support. As Peter Simpson, former commercial director at first direct, said, people are people 52/53 Professionals 30 the only difference between a person working here and a person not working here is that we re paying one of them. Another important characteristic of these organisations is that they sought to learn from their staff about how organisational systems and processes stood in the way of being able to provide support, or about which rules worked against positive experiences between services and people. Good service organisations treat their staff as the eyes and ears, able to advocate powerfully for how things can be improved for users or customers. 54/55 Professionals Photo by David Mansell Training and celebrating The organisations we spoke to spent disproportionate amounts of time and money on supporting staff to achieve more. For example, Pret spends virtually nothing on advertising. Instead, they take the 6 7 per cent revenue that would normally be spent on marketing activities, and reinvest it in training and fun. Pret staff are offered free English lessons and regular parties. For Pret, as with many other good service organisations, they do not believe it is possible to ask staff to focus on empathy and relationships with customers without building in a people-centric culture to the organisation itself. Similarly, Peter Gilroy in Kent fought hard to invest 2 per cent gross every year on training and research despite widespread concerns about deficits. He remained firm, however, arguing that such investments always bring better returns. He backed up this investment by insisting on regular celebrations of and rewards for staff success. The awards celebrations they hold, which senior staff are expected to attend, celebrate staff who have been judged excellent by users. High-performing teams and individuals are rewarded by funding for study trips around the world. As Peter argued, the total cost of these activities adds up to little more than a single national advertisement for a new post, and yet they are key to empowering, enthusing and ultimately retaining his staff, who he regards as his most valuable asset. In his words, the training and mentoring schemes, as well as the parties, became part of the ether, part of the gold dust that have contributed to the organisation improving its services so successfully in recent years. 31 Such anecdotal evidence about the impact of training is supported by larger-scale studies. Bassi Investments charted the performance of a share portfolio of companies with high investments in training over five years, against the Standard & Poor s 500 (a US equivalent of the FTSE 100). The findings were clear: the US firms that made the largest investments in employee skills made the largest returns (16.3 per cent per annum) compared with the average return (10.7 per cent) across the index. In other words, investors received a 52 per cent higher return over five years from shares in companies that make high investments in training. 29 Quality of work Professionals should be paid fairly for their work, but not at the expense of the working conditions themselves. Increasingly, we are recognising that control over working time and conditions, self-management and forms of democratic control over the workplace are as important as the traditional trade union agenda of pay and conditions. Research in the UK has found, for example, that autonomy ranks higher than hours and pay as a factor in determining job satisfaction. 30 Building lateral capacity Ask most people-facing staff who they could learn from most and the response will usually be other people doing their jobs elsewhere. For too long, public service workers have been trapped within their own zones of practice whether that s the classroom, the district or the GP s surgery. The continuous process of professionals learning how to respond, and taking on a mantle of solutions-assemblers or advocates as part of the shift in professional identity described above (see page 48), can be sped up and supported by a focus on fostering lateral connections through the development of communities of practice or action learning groups. Organisations that seek to facilitate and support such lateral networks are effectively communicating to their staff that they recognise that knowledge, ideas and expertise are not located in the central office, but instead at the frontline. In spelling out and backing up this message, organisations can demonstrate their support for staff from whom they are demanding high levels of empathy and entrepreneurialism in meeting people s needs. One respondent said to us: Organisations need to give people mirrors to compare themselves to others. This is the only way you ll overcome the temptation of command and control. There are two further benefits to fostering peer networks of people-facing staff. First, innovation no longer happens in isolation, but instead through teams. Encouraging people to work together and experiment with fresh approaches to meeting people s needs can increase staff satisfaction and create more positive service experiences. Second, finding ways of sharing knowledge can create efficiencies and prevent people from inventing the same wheel many times over. Learning from people-facing professionals Our success is built on insights from individuals on the frontline. Chapter 1 discussed the importance of opening out the channels by which data and insight can be used to drive organisational priorities and development. Alongside gathering insights from users and customers directly, the service organisations we spoke to created the time, space and expectation that staff insights would also drive the process of priority-setting and problem-solving for the organisation. For example, John Lewis Partnership holds weekly consultation half-hours where staff are able to share insights about what s working well and what is working less well in each of the stores. These are discussed at the individual store level as well as at the national office. Last month, Peter Gilroy sent out a message via payslips to all his employees, asking them each to take five to think for five minutes about new ways that Kent could generate income for its work. Insights about service improvements are valuable by-products of interactions between professionals and users, and organisations need to ensure that they develop the mechanisms and channels 56/57 Professionals 32 that are able to capture and use these insights. Just as setting up communities of practice underlines to staff that they are the ones likely to have the best ideas, creating these opportunities for feedback and demonstrating that this feedback can have an impact on strategy is a crucial part of creating a culture that puts activity at the interface centre stage. Relational approaches to service put frontline professionals at the centre stage, alongside users, as key characters at the interface between people and services. This has implications both for the professionals themselves and for the way in which the frontline is connected to the rest of the organisation. For the successful service organisations that feature in this report, professionals their roles and identities play a crucial role in focusing on experiences and engaging people. The challenge, in their terms, is to create the space and capacity for people and professionals to grow their autonomy simultaneously and to shape an organisation that actively supports this. Challenges What are the key aspects of professional identity in your organisation? Do your job descriptions, recruitment strategies and performance frameworks reflect a firm commitment to improving user experiences of service? How have you invested in training and recognition for your staff? How are you connecting frontline professionals to each other? What are the natural points of common interest and social contact? Which aspects of organisational routine offer opportunities for garnering staff feedback? What connections to organisational structure and strategy need to be made in order for staff ideas to flow into corporate priorities? Where does your organisation learn its collective lessons? 58/59 Professionals A shared language of service Guardians of the customer experience Mutual accountability Excellence profiles Communities of practice Definitions on pages 33 Birmingham OwnHealth 60/61 Case study Pfizer Health Solutions is working with NHS Direct and two primary care trusts (PCTs) in Birmingham to create an innovative approach to service. Launched earlier this year, Birmingham OwnHealth will support up to 2000 people with diabetes, heart failure and/or cardiovascular disease. It draws on health prevention models used in the USA where the focus is less on efficiency of existing services, and more on changing projections and trends. John Procter, who leads the Pfizer Health Solutions team working on the scheme, argues that there is a need to invest in the value of health, and move beyond simply looking at the costs. He sees the work in Birmingham as an opportunity to demonstrate what this looks like in practice: Innovative partnerships such as this one can play a crucial role in helping the NHS shift from being a sick care system towards being a patient-centred health care system. It will deliver benefits to all individuals and their families, clinicians and healthcare professionals, and the wider NHS. At the heart of Birmingham OwnHealth is the ambition to reduce the number of non-scheduled visits to secondary care by far the most expensive element of health services through enabling people to better manage their conditions and prevent them from escalating: Photo by Duncan Phillips Programmes like this don t save money immediately but they do reduce the growth of trends over time... it s as much about what you don t spend as what you do. 34 Birmingham OwnHealth has innovated in terms of the channel they use: it is a service delivered entirely over the telephone, on the basis that phones are in people s homes and part of their everyday lives, even if they are not very mobile. To make the service as accessible as possible, it is offered in two languages (English and Punjabi) and all supporting patient information has two versions one for high literacy and one for low literacy. The scheme s success also rests on how the frontline professionals are trained: the focus is on their professional role and interactions with the patient and the need to build relationships with the people they are supporting and the surrounding services that each patient may wish to access. Rather than using their clinical expertise to instruct people, the NHS Direct nurses are trained to use that expertise to guide people to reach their own conclusions instead: It s totally different to an inbound system that uses algorithms... it s about coaching and support and conversation. This alternative model of professionalism is supported by the design of the scheme s knowledge management and needs assessment system a digital platform developed by Pfizer Health Solutions. In the first conversation, the care manager will ask some simple questions for example about diet, exercise and so on and the system will highlight areas where the patient needs to do some work. Together, the care manager and the patient will talk in order to understand which issues are relatively straightforward to tackle, and those where the patient feels they need more support to tackle. They then set some targets not based on system performance but instead on the goals that the patient feels they can achieve through the conversations and coaching offered by the nurses. The ultimate goal is for each individual to begin to have a positive impact on their health and wellbeing through taking action built on the confidence, knowledge and understanding they have gained through working with their care manager. In time people will eventually graduate from the programme, with the graduation criteria being focused on capacity to self-manage, rather than a pre-defined set of outcomes that may mean different things to different individuals. Birmingham OwnHealth has also begun to knit together the whole range of local services for their users. They are mapping what they call the local service ecology noting the locations for specific services to help guide users towards what they are looking for. In time this map will help the PCT in collaboration with GP surgeries to ensure that services are evenly distributed. Staff work with people from specific GP surgeries to enable them to build up relationships and provide regular feedback on the patients on the scheme to help ensure continuity across different service channels. John talks about how hard it can be to measure the impact of their work, particularly for the handful of patients at risk of developing cardiovascular disease who are not yet suffering but are highly likely to have an incident in the next ten years. Using Prochaska s model of behaviour change, 31 he says, moving someone from pre-contemplation to contemplation to action over the course of the year or more may represent real progress towards prevention, but there s nothing in it that can be reflected on a balance sheet. Yet, as he rightly points out, the savings generated by reducing the impact from these kinds of diseases, even by 1 per cent, are far higher than any figure saved through rationalising existing services. It s early days yet for the scheme but John tells us that local staff in the PCT are already excited: Birmingham OwnHealth is not about replacing services at a local level, it s about enhancing and improving what s already there. We ve learnt that you should just start somewhere, anywhere, and let the rest of it grow and develop over time... it s the hardest thing to get started, but once you have it s possible to see what else could grow from it. 62/63 Case study 35 64/65 Measurement 3 Measuring success Find ways of measuring experiences as well as systems: life is more complicated than a key performance indicator. Photo by David Levene Seeing service as a delivery mechanism rather than a transformative experience has led to a particular form of information gathering and system measurement. Existing targets have tended to focus energy on underperformance in operational efficiency, at the expense of underperformance in the transformation of people s lives. Being able to assess the quality of the experience is as important as knowing the efficiency of the operations: both are necessary forms of measurement. As Patrick Lewis from John Lewis Partnership told us, you ve got to run the organisation at a more complex level than that of KPIs. Chapter 1 explored the sorts of insights successful organisations gather from their customers and users. The insights these organisations seek to collect go beyond demographics and even attitudes they are also interested in what people think about something, how they felt about a particular experience or product. What this reveals, therefore, is that by gathering information about customers and what matters to them, service organisations also begin to gather a form of feedback, which itself provides measures 36 of success. Rather than this success being measured at a systemic level (such as progress against targets), such insights represent the measurement of success from an experiential perspective from the vantage point of the user themselves on the service they are accessing. This matters because, when it works, users themselves experience success directly, with obvious consequences for their sense of satisfaction and trust. In other words, successful service organisations have found ways of measuring success and improvement at more than the systemic level. The information flow between users and the organisation is far more dynamic, and customer insights are treated as a form of measurement for assessing performance at the same time as determining priorities. The service innovators we spoke to understand that unless they can see what is working and what is going wrong from the perspective of the user, they have little hope in engaging that person, or (in the case of commercial organisations) keeping their custom. Measuring impact and success by experience metrics can be revealing. Take, for example, the civil justice system. In recent research for the Department for Constitutional Affairs, as many as a third of people felt that the experience of sorting out the issue was at least as stressful as the issue itself. A further third felt that both were equally stressful. And the knock-on effect of these experiences on other issues that relate to other public service provision is telling as well: respondents highlighted illness, as well as employment and relationship issues as side effects of their problems and the experiences of trying to resolve them. 32 Don t let a key performance indicator get in the way of doing what s right: measuring experiences There are tensions between the need to look at a single customer view and the overview. We need to do both. The two together can be very revealing, and can expose deep structural problems. Not only do measures of experience add a richness to existing approaches to system measurement, in some cases they illuminate the unintended consequences of targets and efficiency metrics. A number of people we interviewed as part of this project spoke of the detrimental impact system measures can have on people s experiences of service, and warned against placing too much value on a single view of performance information. For example, one representative of John Lewis Partnership said to us that he doesn t let a KPI stand in the way of doing what s right. This was supported by the views of many of the local authority representatives we spoke to. As one respondent said: The problem is the monitoring. Targets are increasingly driving provision. Councils are now learning sophisticated ways of playing the game, pouring resources into those things on the boundaries of target levels. This distorts the relationship with customers. The actual experiences of people, rather than the detached measurements of customer satisfaction and proxy measures of performance such as waiting times, should be used as drivers for service transformation. The trick is to measure performance in ways that illuminate the quality of the experience rather than focusing solely on operational performance. Organisations need to measure what users value, as well as what organisations and service systems value. The public sector has already begun to adopt many of the customer research techniques that are used in the private sector. Focus groups are used to test ideas and support service planning. Some service providers are commissioning mystery shopping research to directly assess the quality of customer service. Pret s mystery shoppers assess not only the range of products on offer, but also the quality of service. They have turned apparently soft measures of human interaction into harder metrics: did the barista look you in the eye and smile? Did they tell you how much change you were receiving? 66/67 Measurement 37 The government has until recently advocated a unified cross-service measure of customer satisfaction as a means of adding experiential measures to the system metrics already in place. However, the problem with satisfaction as a measure is that it is highly subjective if viewed from the perspective of the users. People bring different expectations often shaped by their own circumstances and backgrounds to service experiences; all satisfaction measures is the extent of the gap between those expectations and perceptions. Expectations and perceptions are highly individual and changeable. So, more needs to be done to identify ways of measuring actual service experiences. The service organisations we spoke to are pioneering a number of experience metrics, all of which could be applied to public service organisations as a way of enriching the means by which system performance is understood. Tesco has developed a management and measurement tool that they call the Steering Wheel. The wheel is based on the theory of the balanced scorecard that prompts businesses to consider not only the financial performance, but the impact on the bottom line of the happiness of employees, the efficiency of operations and the satisfaction of customers. Tesco has five customer-value metrics derived from customer research a notably small number that they believe are the five aspects of the supermarket experience that are most important to customers: the aisles are clear, I can get what I want, the prices are good, I don t want to queue, the staff are great. Tesco believes that things need to be simple if they are to be applied at every level of the organisation, from boardroom to stockroom. Alex Cheatle from TEN UK, a lifestyle management and concierge business, explained: 68/69 Measurement We measure ourselves based on what they [our clients] want. We ask each member, exactly what/when/how do you want? and our system then tracks everything we do against that expectation, using time tracking and feedback loops. We haven t come across a single call centre that can deal with this level of complexity. 38 This form of measurement in customer terms, not universal standards set centrally and sometimes arbitrarily based on what users might judge to be good can be called my-metrics. My-metrics are also an important part of Birmingham OwnHealth, the case study described at the end of chapter 2. Paul Bello from Orange described the current high point of success measures in the commercial sector as the propensity to recommend. Would you recommend this service to someone else? has become the only question worth asking customers for some organisations in assessing success. The theory is that most customer surveys are inherently inaccurate as questions can be asked in ways that lead to positive responses. But ask people if they would recommend a plumber, for example, and they are forced to put their own reputation on the line. 33 The current approach to inspecting schools and hospitals at periodic intervals is one of the most stressful elements of any public service manager s job. Staff sickness increases in schools around the time of Ofsted inspections as school staff feel under tremendous pressure to perform against the criteria set by the system. Chris Gerry, head of New Line Learning Federation in Kent, might therefore be regarded as a glutton for punishment in deciding to invite Ofsted in on a much more regular basis. He supplements their inspections with his own feedback system. Every month students are asked to provide feedback on teacher performance against a number of metrics that the students themselves were involved in devising. These metrics are focused on things like whether the lessons were boring or engaging, whether homework was marked on time, and so on, rather than student grades. As Chris puts it, we know that the best way of creating lifelong learners is to engage them, so measuring the success or otherwise of this engagement is crucial. What Chris is doing is measuring service experiences as they unfold. Not only does this provide him with a much more constant flow of information and feedback that enables him to pinpoint in more detail where work is needed, it also reduces the levels of stress associated with measuring success. Feedback is not used to punish people; it is used to prioritise the activity of Chris and his senior colleagues. It creates an atmosphere of continuous improvement. Furthermore it makes small-scale experimentation and innovation less risky: teachers at Chris s school can get almost immediate feedback on the impact of any changes they make to their teaching practice all the data is available for everyone to see and use. Feedback, measurement and information at the interface Closing the gap between the interface and the boardroom User insights can be challenging, demanding and uncomfortable for organisations. However, the most innovative service organisations see beyond this. They view their service users as a resource or specialist network to draw on for development ideas. For example, BUPA seeks out the things that are not working about its service. As Alison Platt, head of BUPA Hospitals said, the challenge is always to get people to believe that the service on offer can be improved. As well as investing significant time and money in following user journeys and evaluating how touchpoints and channels can be improved, BUPA s customer intelligence team focuses on the four elements of BUPA s service that customers like least. These are identified through focus groups and customers are then invited to work with senior management to make a plan of action to tackle these issues. Progress is assessed and fed back. What is significant is the dynamic nature of the flow of information through BUPA. This process is repeated quarterly, so that, like at Chris s federation of schools, the feedback loops between action and learning are much tighter. It is not only users whose shared wisdom and insight is being used to drive service improvement. John Lewis Partnership, among others, also treat their staff as the eyes and ears of their organisation. They are the people closest to customers, and from their interactions in store they can offer deep insights into how to improve performance from the perspective of people s experiences. Staff are encouraged to share what they learn about customers and 70/71 Measurement 39 their responses to products with colleagues locally, and their views are fed back to product development teams. BUPA also worked to underline the importance of employees providing feedback as they developed their excellence profiles. Alison Platt told us: We had to get away from the culture of I just want to do my job. Well actually, feedback is your job. Service innovators do not ask only people-facing staff to offer insights back to the organisation. They also ensure that managers and senior staff have a direct line to the interface. This is not about visits or inspections ; to be effective these organisations have looked for ways of putting the customer squarely on the board s agenda. As one respondent told us, they ve got to feel it. BUPA involves all senior staff in the work around user journeys. In addition, every week the directors take on ten customer complaints and have to sort them out. This is about real exposure, not visits. Closing the gap between information and users Paul Hodgkin is a practising GP who has a sideline in an exciting new social enterprise. In 2005 he founded the website It is a brilliant example of how service innovators are creating new channels at the interface that bring together feedback, service measurement and user information simultaneously. The website invites people who have recently experienced hospital treatment to swap stories. Other people preparing to go to hospital can use the site to help them make decisions about where to go for their treatment; the information is far more accessible and immediate than any star rating or performance report. Paul also sells full access to the information on the site to primary care trusts, to enable them to get a better feel for system performance from a different perspective. In effect, looking at the website gives the trusts continuous access to collective wisdom across the system. Patient Opinion s strapline is this is our NHS... let s make it better. Like Chris Gerry s feedback tools, it is not possible to separate out insight, measurement, feedback and information on Paul s website. Chris s and Paul s work illustrates a wider pattern that we detected across other successful service organisations we spoke to. Increasingly, feedback, insight and ideas are things that are not only gathered, but also offered back to users of services. Service innovators are looking for ways to open up and break down the barriers between customers and organisations. They see every interaction between a person and the service as an opportunity to learn something new. Requesting and sharing information and insight on a regular basis offers an effective new channel of honest dialogue that can benefit service organisations and users in equal measure. Presenting system information and measurement back to users in accessible and usable ways is an important element of building trust and putting people in control. For example, if district-level data suggests that crime is going down, but a person knows that burglaries have gone up on their street, they are unlikely to believe the figures. Providing street-level data on crime would help people to close the gap between service experiences and system measures. It would give people the confidence that their local police force had enough data and insight to target specific problem areas. Improved technology should make this kind of very local information and insight gathering possible in a way it would not have been 20 years ago. These organisations are pioneering an approach that combines service delivery, service design and insight generation at the point of the interface, to inform policy and ongoing system re-design. There is much that can be learnt here for future public services. Politicians and policy-makers are searching for a new way of looking at performance that takes in trust and satisfaction. It seems unlikely that ever more fine-grained system measurements (eg customer satisfaction, value added) will provide the solution. Instead, we need to look at how experiences are measured and assessed, and put these insights alongside some of the more abstract measures already in existence. Adding in experience metrics and reducing feedback loops will help to tackle the deep problems of mistrust and dissatisfaction. There is an additional benefit too. As this chapter has outlined, 72/73 Measurement 40 smaller feedback loops are a key element in creating a culture of experimentation and innovation. The service innovators we spoke to learnt from getting it wrong, but they learnt quickly and were able to adapt and improve quickly thanks to their deeper understanding of the impact of particular decisions and approaches. For these organisations, a formalised service design development methodology mitigates the risk of failure by managing incremental levels of service prototyping. Involving users at every stage also enables service designers to spot flaws not just in terms of operational systems, but also in terms of the experience of users. Challenges How are you measuring the experience of different kinds of users? How frequently are you assessing performance against experience metrics? Is your organisation ready to use feedback, even if it is negative? What access do your users and staff have to performance information? Is it presented in an accessible format that communicates to people at their level of interest? Are you benefiting from the collective wisdom of your customers? 74/75 Measurement A shared language of service Experience metrics My-metrics Collective wisdom Prototyping Definitions on pages 41 Young people in Kensington and Chelsea It s unusual to find good working relationships at this level, says Isobel Rickard, who lives in Lincolnshire but spends her working week running housing management services for Kensington and Chelsea Tenant Management Organisation. She is pioneering a new approach to tackling anti-social behaviour that stands out from the rest. For one thing, her view of rolling out is not about determining how things should be and telling others to deliver services differently: It s hard to sit round as managers and say it needs to happen it needs to come from the bottom up. Instead, Isobel is working with the council s Youth and Education Welfare Services, and the local police, to build the crucial relationships estate by estate. Together they are creating estate-level partnerships, based on trust and a shared sense of purpose, which take in voluntary organisations, registered social landlords and the numerous other agencies that play some part in tackling anti-social behaviour: you ve got to look at the whole picture. You get the sense that much has been learnt from the perspectives of different professions on the same sets of issues. This understanding has been crucial to orchestrating the integrated service that Isobel and her team are working to create. The Tenant Management Organisation (TMO) got involved in training the community police support officers, and they have played a huge part in some of the local successes. The TMO also works very closely with the youth service, which provides outreach work in some of the problem areas. This has created a sense of common endeavour... bringing all those people together made it possible to see how they could all make some changes. Photos with permission of Kensington and Chelsea TMO An important turning point was the success of the collaboration between the police and the TMO in pinpointing and closing down a number of crack houses in the borough. In one area this joint working saw the successful removal of five major dealers and massive reductions in crime car theft by 50 per cent, street violence by 60 per cent and burglary by 30 per cent. The police found that there was a huge pay-off in working with us, and that s really important. There s got to be a pay-off; everyone s got to get something out of it. However, it is not just partnerships that have made the model so successful. Isobel has also stressed the importance of giving a voice to young people, so often demonised in discussions of anti-social behaviour. For example the TMO, youth service and police carried out a consultation exercise on one estate to gain a better understanding of the perspective of young people. The result was a series of activities delivered by all the different agencies, which enabled staff to get to know the kids by name and build relationships with them. This is about involving young people in designing services. We have to fit around them even if we don t always agree, says Isobel. They need to know the estates, know where the trouble will be. 76/77 Case study 42 Although this approach may sound like common sense, Isobel has clearly fought hard: Selling the idea of financing bad behaviour will always be hard. Nevertheless, she has stood firm. She sees anti-social behaviour orders (ASBOs) as impossible to enforce so what s the point? and as a result there are only three ASBOs in the borough. There s so much money out there being spent on anti-social behaviour but it s all going on the punitive stuff. Why don t we put some into prevention as well? This belief does not stop intervention, far from it: Of course we intervene as soon as we identify a problem but we re not heavy handed, we let the voluntary workers do their work first. Working at an estate level has enabled the teams to see the importance of improving relationships on estates, building the capacity to manage and co-exist peacefully, rather than simply trying to tackle or contain anti-social behaviour. It is an approach that has been applied across the TMO s estates for example a recent exercise at World s End saw older people gathering in hoods and baseball caps while young people tried getting about with canes and walking frames. The professionals involved and the attitudes they bring with them really matter: The quality of individuals in tackling this stuff is paramount. This does not necessarily mean working only with experienced or fully trained staff: the TMO has introduced a graduate trainee scheme, taking on people with no housing experience and giving them the opportunity to study for an MA in housing while working. Four young people have been trained through the scheme in the last two years and one has just become an area manager. What s also striking about Kensington and Chelsea s approach is the emphasis it places on regular feedback, which is regarded as crucial and is firmly focused on operations. Every week the agencies involved registered social landlords, the police, environmental health, the TMO, mediation services, victim support, the youth offending team and the domestic violence team meet for a quick-fire exchange of information. This is vital, according to Isobel, so that nothing s happening that no one knows about. The meetings offer a way of exchanging information early and making connections. They also enable staff to track particular young people, wherever they are and whoever is dealing with them. In the past, says Isobel, the partnership was good at doing things initially, but not very good at following through. Isobel is adamant about the need for this meeting to be kept to staff at an operational level and has resisted the temptation to use the gathering for training sessions or other activities: As soon as things go up into the strategic level then things stop happening and these meetings have done more for anti-social behaviour than anything else in the last three years. It is clear that the TMO s approach is having a dramatic impact, not only on the lives of the young people but also on the overall quality of life on the estates where this approach is being used. For Isobel, this is all that matters: Performance indicators have no relevance or meaning at all to what s actually going on here we d spend so much time counting that we wouldn t be able to do anything! It s very hard to measure how many people haven t gone on to be in gangs. 78/79 Case study 43 80/81 Politics 4 The politics of service design If applied systemically, service design can offer a vision for the transformation of public services, as well as a route to get there. Photo by Don McPhee The principles of the previous chapters could be used to great effect to improve existing service organisations. But only if they are applied systemically will service design principles have the potential to transform public services as we know them. Service design approaches help to close the gap between what people want and need, and what organisations do. It helps to generate a shared, single view of system priorities that connects actual experiences with the setting of those priorities. Service design focuses minds on the deeper purpose of service to generate deep forms of satisfaction and wellbeing. And it builds the capacity of organisations and groups of organisations to adapt and morph as people s needs change. In these terms, service design can offer a vision for transformation, as well as a set of tools and a model of change for bringing it about. 44 Current models of service have created a distinctive set of building blocks for public services functional institutions, episodes and abstract system or output measurements. The approach taken to reform is itself driven by these building blocks: they produce an agenda that is focused on very particular models of the core elements that any political party in power would need to address in thinking about public services. For example, a view of services as commodities encompasses the following assumptions: Efficiency is seen to be primarily about increasing the capacity of the existing system to do more. It is about operations, driving out bureaucracy and tightening existing processes and supply chains. For example, the Gershon review of 2004 indicates that cuts of 20 billion are going to be achieved through a combination of cutting inputs (mainly jobs) and increasing productive time. 34 Personalisation is equated most often with consumer models of mass customisation, where particular services are modularised and people are able to choose but not always co-design services. For example, the education white paper of 2005 made proposals about school choice, and the creation of choice advisers to help parents navigate a complex and hard-to-read system. 35 Patients can now choose from a range of treatment centres (not all state-run) for where they access their treatment. Devolution to the frontline is accompanied by checks and measures to ensure that the local authorities and service organisations are responding to an agenda that remains predominantly set by the centre. Peter Taylor-Gooby has characterised this kind of devolution as a principal agent relationship. 36 For example, inspections are carried out by semi-independent organisations such as Ofsted on behalf of the centre, and local authorities continue to be measured primarily against systemic targets. Limited metrics of customer satisfaction have been introduced as a counterweight but, in the main, central targets still drive assessments of performance. Service design re-frames the central tenets of any reform agenda The language and frameworks that we use determine the parameters of the debate, and limit the kinds of organisational and service innovations that we can imagine. Service designers do not see service as something that can be reduced to a commodity: they understand it instead as being a form of support, a kind of scaffolding to help people live their lives as they wish. By offering a fresh set of building blocks the touchpoints, journeys, channels, service environments and architectures that together form the drivers for change in every service organisation we spoke to service design re-frames the ways in which the main elements of reform can be understood. In focusing on the interaction between people and services, rather than services alone, service design enables policy-makers and practitioners to see new possibilities. Far from simply offering incremental improvements to existing services, these possibilities could add up to radical new models of service, organisations and value. Efficiency Systems thinkers, health economists and others have for a long time argued that we need a wider view of efficiency than current models allow for. It is not that achieving operational efficiency is not desirable: it s just that it is not the whole picture. Two further forms of efficiency that service design focuses on include: designing out waste. It has been estimated that between 30 per cent and 70 per cent of any organisation s time is spent on failure demand the cost of getting it wrong the first time. 37 These costs are measurable not only in terms of time, but also in staff morale. Finding that the system works against being able to focus fully on meeting people s needs has obvious implications for levels of staff motivation and satisfaction. 82/83 Politics 45 harnessing and unleashing the untapped resources of users time, energy and motivation. By focusing on relationships and experiences, good service design enables policy-makers to create services that engage people, services that invite them in to participate in the creation of positive outcomes. Service design maximises existing resources and brings new resources into the equation, as well as seeking to minimise costs. Challenges How can prevention be measured meaningfully the things that don t happen for example, a teenager resisting pressure to join a gang, or someone eating healthily? Can we develop efficiency metrics that consider efficiency over a lifecycle rather than through specific service episodes? We have developed lifetime costings for everything from photocopiers to weapons to cars and washing machines and yet we do not do the same for vital public services. Can politicians find the courage to tell a story about efficiency that extends beyond the current political cycle? Can they make the case for investing in public services for the long term, rather than a story that simply focuses on getting the most out of them in the here and now? Personalisation and co-production Choice has become the primary mechanism by which this government is seeking to personalise services. It is seen as a means of enabling greater user autonomy, and a way of engaging people in the creation of outcomes. Of course it is true that the freedom to choose is a crucial part of feeling in control. But making stressful, potentially life-changing choices requires that those decisions are surrounded by dialogue, useful and accessible information, recognition and support. Being asked to choose from a menu of options, none of which appear to reflect your needs and the kinds of social and cultural contexts you are operating within, can be as disengaging and frustrating as a situation where there is no choice at all. Service design helps policy-makers and service providers to counter this choice bias through opening up new mechanisms and channels for engaging people not only in choosing between services, but also in shaping those services in the first place: Service designers use methodologies that start with people, not existing services or institutions. The lifestyle management company TEN UK begins by asking its customers three simple questions: Who are you? What do you want or need (and when, how and where)? How can we help? The organisations, partnerships and forms of support flow from a deep understanding of what those support needs are in the first place. For good service designers, the unit of service is always the person, not the institution, patient, disease, or, worse still, the bed. Service design offers both a conceptual framework and a set of tools for politicians and policy-makers seeking to create deeply personalised services. Service designers focus on a specific kind of engagement: engagement at the interface. Deliberation has to take place at the point of delivery to create the kind of engagement required for co-production that where people are mobilised, coached, and encouraged to participate in the common enterprise of generating positive outcomes. The current emphasis on public engagement in policy-making circles fails to see and reinforce the vital connection between engagement for co-production and experiences. Whether it is the setting up of foundation hospital boards, the creation of community representative posts on local strategic partnerships, or the current education bill s emphasis on parental involvement in school governance (rather than their children s learning), too often such engagement is seen to happen in town halls, school gyms or conference centres, away from the real action of service experiences. In contrast, service design offers a powerful set of tools by which experiences can be shaped to meet the goal of genuine engagement. 84/85 Politics 46 By starting with people themselves, not organisational norms or institutional parameters, and by focusing on engagement at the interface, service design shapes an agenda for personalisation that is about co-design and co-creation rather than mass customisation. 86/87 Politics Challenges By starting with people, it will not always be the case that a single organisation can meet that person s needs. What cultural, professional and technological environments and incentives are needed for genuine partnership working? What forms of governance can be developed to enhance a sense of collective endeavour across services and between services and citizens? How can the many ways in to services the range of channels be designed to engage and enhance people s experiences of services, as well as simply being seen as a route to more efficient delivery mechanisms? What kinds of data sharing and people-centred knowledge management systems are needed to underpin these more fluid, federating forms of support? Where are the opportunities to learn from the most innovative technological developments in this area? Photo by Martin Godwin Devolution The commitment to devolving power from the centre to the local has been part of the reform agenda since More recently, the notion of double devolution where power is devolved from the town hall to the neighbourhood has become popular in policy-making circles, further emphasising a commitment to create flexible, responsive services appropriate for specific communities and localities. Devolution and frontline empowerment was certainly a crucial characteristic of all the innovative service organisations we visited; however, it was a very different kind of devolution that we uncovered. For organisations like John Lewis Partnership or BUPA or places like Kensington and Chelsea, the relationship between the centre and the local or the frontline is characterised by trust andMoreMore information Research report May 2014. Leadership Easier said than done Research report May 2014 Leadership Easier said than done WORK WORKFORCE WORKPLACE Championing better work and working lives The CIPDs purpose is to champion better work and working lives by improvingMoreveMore,More information MAKING IT. BiG. Strategies for scaling social innovations MAKING IT BiG Strategies for scaling social innovations Madeleine Gabriel July 2014 ACKNOWLEDGEMENTS Thanks to all the Nesta staff and associates who helped develop the ideas and frameworks in this document:More information Joanne Evans Office for National Statistics Findings from the National Well-being Debate Joanne Evans Office for National Statistics July 2011 Supplementary Paper: Findings from the National Well-being Debate Official Statistics ONS official statisticsMore informationMore information CREATING AN ENGAGED WORKFORCE Research report January 2010 CREATING AN ENGAGED WORKFORCE CREATING AN ENGAGED WORKFORCE FINDINGS FROM THE KINGSTON EMPLOYEE ENGAGEMENT CONSORTIUM PROJECT This report has been written by: Kerstin Alfes,More information Schools for All. Schools for All. Including disabled children in education. Including disabled children in education. guidelines. practice guidelines Schools for All Including disabled children in education Experience from Save the Children and partners globally demonstrates that improvements in education quality go hand-in-handMore information Leading Business by Design Why and how business leaders invest in design Leading Business by Design Why and how business leaders invest in design ARE YOU MISSING SOMEONE? Design Council Design Council champions great design. For us that means design which improves lives andMore informationMore information Patient empowerment: for better quality, more sustainable health services globally A report by the All Party Parliamentary Groups on Global Health; HIV/AIDs; Population, Development and Reproductive Health; Global Tuberculosis; and Patient and Public Involvement in Health and Social Education. The Need for Social Work Intervention Education The Need for Social Work Intervention THE NEED FOR SOCIAL WORK INTERVENTION A DISCUSSION PAPER FOR THE SCOTTISH 21 st CENTURY SOCIAL WORK REVIEW Don Brand, Trish Reith and Daphne Statham (Consultants)More A simple guide to improving services NHS CANCER DIAGNOSTICS HEART LUNG STROKE NHS Improvement First steps towards quality improvement: A simple guide to improving services IMPROVEMENT. PEOPLE. QUALITY. STAFF. DATA. STEPS. LEAN. PATIENTS.More:More information
http://docplayer.net/12509-Engagement-and-co-production-will-grow-only-out-of-a-deeper-richer-understanding-of-how-services-relate-in-practice-to-people-s-everyday-lives.html
CC-MAIN-2017-26
en
refinedweb
Can anyone please show me whats going wrong here. I'm trying to access a structure from within another structure but am recieving errors. Structures are global and are as follows: The 'stock' array is already populated.The 'stock' array is already populated.Code:struct StockItem { int code; char desc[20]; float price; }stock[NUM_OF_ITEMS]; struct BillLine { StockItem stock; float weight; float cost; }bill_line[50]; My code is as follows: MY compile log is as follows:MY compile log is as follows:Code:BillLine bill_item(void) { BillLine bill; int item; cls(); cout << "Enter item number purchased: "; cin >> item; item -= 1; /*line 213*/ bill.stock = stock[item]; cout << "Weight: "; cin >> bill.weight; bill.cost = stock[item].price * bill.weight; return (bill); } void print_bill ( BillLine bill_line[50], int num_bill_items ) { for (int i=0; i<num_bill_items; ++i) { /*line 240*/ cout << "Name = " << bill_line[i].stock.desc << endl; cout << "Weight = " << bill_line[i].weight << endl; cout << "Cost = " << bill_line[i].cost << endl; } } Compiler: Default compiler Executing g++.exe... g++.exe "C:\Ged\code\assignment\best.cpp" -o "C:\Ged\code\assignment\best.exe" -g3 -O0 -g3 -I"C:\Ged\Dev-Cpp\include\c++" -I"C:\Ged\Dev-Cpp\include\c++\mingw32" -I"C:\Ged\Dev-Cpp\include\c++\backward" -I"C:\Ged\Dev-Cpp\include" -L"C:\Ged\Dev-Cpp\lib" C:/Ged/code/assignment/best.cpp: In function `BillLine bill_item()': C:/Ged/code/assignment/best.cpp:213: incompatible types in assignment of ` StockItem' to `StockItem[125]' C:/Ged/code/assignment/best.cpp: In function `void print_bill(BillLine*, int)': C:/Ged/code/assignment/best.cpp:240: request for member `desc' in `(bill_line + (+(i * 3508)))->BillLine::stock', which is of non-aggregate type ` StockItem[125]' Execution terminated
https://cboard.cprogramming.com/cplusplus-programming/49277-accessing-structure-issues.html
CC-MAIN-2017-26
en
refinedweb
Friday, November 07, 2008 Games: Little Big Planet I won't bore you with the details about "Sackboy" since the main character and his possible customizations are covered very well in depth by the many gaming rags on the market. I will say he is cute and clever, as is the control scheme for him. I can't help myself but to have him disco dance ala Saturday Night Fever after every level. The stock levels showcase the games physics and themes really well. It has a very animatronic theme going, with characters being voiced by little speakers, and movements being done by something right out of a Rube Goldberg invention. They are challenging, with a very silly backstory behind many of the different levels. Once the gremlins with the network, be in on my end or Sonys end finally cleared up and I was able to update, I got to see where LBP really shines. User created content always ends up enhancing a game, and showcasing possibilities that the developers couldn't imagine. In this case there is no exception. I played around with user levels, some of which were mere mechanisms to earn trophies, but others were clever, challenging platformers that brought me back to the yesteryears of the NES. I had one level where I was doing a mock prison break, another where I was going through the American Gladiators obstacle course, and one where I played basketball while wearing a rocketpack. So, those are the facts, so whats my opinion. I can openly say this, and all naysayers be damned. This is the first game where I have actually smiled and enjoyed playing. I haven't even gotten into level creation, just playing, and this is easily one of the most enjoyable gaming experiences I have had in a long time. Finally, something that breaks away from the tired first person shooters, dystopian futures, survival horrors, and the getting very thin rhythm games (although I did pick up Gears of War 2, Guitar Hero World Tour, and Rock Band 2, so apparently I still have some demand for these games). Easily the best game for the PS3, and I look forward to seeing what else the community can cook up. Thursday, November 06, 2008 GWT: Calling GWT Classes and Methods from Regular Javascript My current project involves us working with a group who uses a custom built web framework that works on top of Dojo. Since I prefer to use GWT, even for strictly client side Javascript due to the debugger, I needed something that would allow me to create a somewhat functional Javascript based library. Out of the box, doing so in GWT is a bit of a pain, involving the need to create native JSNI mappings to the GWT methods. This is ugly, and one of the reasons I like GWT is because the code can be much prettier in development, even if it is not in deployment. I would prefer a much more efficient way, where the creation of the publically exposed methods are hidden for the most part during the development. This would normally take some function of the compiler to do this, but the clever folks behind the GWT Chronoscope project figured out a way to do this using Generators. They were even nice enough to release the fruits of that work free of charge. Now, I will give you fair warning, download the sample code from the SVN repository. The documentation for this is non-existent, and the only way you can figure anything out is by looking at the samples. Here I will try to give you a good idea how to implement this in your own code by using a real simple proof of concept. In the following example, I am going to create a new GWT module that will expose a simple Hello World return to a DOM object whose ID will be passed in. I will be doing so in a GWT project in Eclipse, and my runtime stuff will be done using the Instantiations GWT Designer, although you can do this in any GWT IDE you like. This will be compiled against GWT 1.5.2. The first thing you need to do is add the library for GWT-Exporter into your projects classpath. In my case, I am using the Alpha release for version 2. Once added, I create a simple module with a blank onModuleLoad. Normally in the onModuleLoad, we want to load and prepare out Ajax based stuff, but in this case, I don’t want anything yet, I will add a little code to jumpstart the export process in a bit. First, I want to create a class that looks like so: package com.digiassn.blogspot.client; import org.timepedia.exporter.client.Export; import org.timepedia.exporter.client.ExportPackage; import org.timepedia.exporter.client.Exportable; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Window; @Export @ExportPackage("helloworld") public class UpdateWithHelloWorld implements Exportable { @Export public void UpdateMyDomObject(String id) { DOM.getElementById(id).setInnerHTML("Hello World"); } } Also note the annotations for package and Export. This tells the generator that this class is to be exported, and that it is accessible by that package name. With that class there is a slight problem. The Exportable class is not set up properly in the GWT Modules XML file. So I need to modify my ExporterExample.gwt.xml file to contain the Exportable class. Be sure to add in the option to export, otherwise it won't export your classes. <module> <inherits name="com.google.gwt.user.User"/> <inherits name='com.google.gwt.user.theme.standard.Standard'/> <entry-point <inherits name="org.timepedia.exporter.Exporter"/> <set-property </module> Now I can go ahead and update my onModuleLoad to tell the GWT-Export to export UpdateWithHelloWorld for outside Javascript to use. package com.digiassn.blogspot.client; import org.timepedia.exporter.client.Exporter; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Button; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class ExporterExample implements EntryPoint { public void onModuleLoad() { try { Exporter export = (Exporter)GWT.create(UpdateWithHelloWorld.class); export.export(); } catch (Exception e) { Window.alert("Exception " + e.toString()); } } } For now, I want to open my public HTML page, and create two things, the DIV tag that will be updated, and a small Javascript method that will call my GWT class. I use the following as a small test. <html> <head> <title>Wrapper HTML for ExporterExample</title> <link type="text/css" rel='stylesheet' href='ExporterExample.css'/> <script language="javascript" src="com.digiassn.blogspot.ExporterExample.nocache.js"></script> <script language="javascript"> function updateText() { var hello = new helloworld.UpdateWithHelloWorld(); hello.UpdateMyDomObject("updateMe"); } </script> </head> <body> <div id="updateMe">I show nothing right now</div> <input type="button" onclick="updateText();"> </body> </html> And whala, when I click on my button, it will update my DOM code using the GWT. This demonstrates that a GWT based class and method are called from and outside Javascript. You got to hand it to the guys over at Timepedia, this is a pretty cool little library. Now it is possible for me to do any Javascript based development, debugging, and re-use of components with my development in GWT for reliability and cross-browser support, and use in non-GWT based calls.
http://digiassn.blogspot.com/2008_11_01_archive.html
CC-MAIN-2017-26
en
refinedweb
It is religion which tells us how to spend life in every aspects of life. It has proved each and every thing that the modern science has proved now in 21st century but it has proved that aspects 1400 years before. ================================= attorney directory If Islam is the religion of peace why is this? I once believed that, unfortunately, it now shoves planes through Buildings killing many many innocent people. I have no belief that that was the work of Allah, but rather a Human being.......Islam has become controlled just as Western religion has, it holds back people, whereas it should move them forward. Islam is most definitely a religion of peace. No true Muslim condones terrorism, violence and murder of innocent men, women and children. A true Muslim does not put down other religions either. I read some of the comments made about Islam and I was really shocked. I was shocked that all these people who are artistic and eloquent with their writing could be so harsh and ignorant. I say ignorant because you must truly read an Islamic teaching to understand Islam not watch FoxNews or CNN. Do not let the people who do perpetrate disgraceful acts give you your opinion of Islam. Talk to a Muslim, read a book, look up Islamic sites. Learn about the religion before you spew hatred. Those who throw hatred toward an entire religion for what some have done are just as bad because you are spreading the dislike. And nothing good comes from spreading hatred. Well - thanks for the input. Religion = good. People who do not suck up to religion = bad. very eloquent. You join just to tell us how awesome Islam is? Or was there a point here? I sure as hell do not watch CNN or Fox. I make my decisions based on what people say and do. Not what your TV tells me to thanks. Well I'm sorry that you feel the way that you do. I did not join HubPages to promote Islam. But I let my light shine by just being the best Muslimah I can be. I have opinions, thoughts, and truths about many subjects. You will see this in my writing. I am who I am and you are who you are. Insha Allah(God willing) we learn from each other. I look forward to reading your hubs and I invite you to read mine. Much luck to you in your endeavors. Well - seeing as you have no hubs yet....... But feel free to read mine. And I am quite happy making my own decisions thank you. But - you go ahead and repeat what you have been told to. I totally agree that Islam is the religion of Peace and i was reading the 1st page post of this forum and some claimed it to be proved that Islam is the religion of Peace I have some Own Points to discuss here 1. Every Religion teaches us good things and if any of the follower doesn't obey the religion then who is to be called wrong, the religion or the followers? 2. I'm a Muslim and my religion prohibits me to rape a girl yet i do then who is wrong, me or my religion? Of course it's my fault because Islam doesn't teach us these things !!! Here i would say, That Beard is known as Symbol of Muslims, Christ also kept beard and all the other Prophets did so and It to be obeyed by all the Christan, they must keep beard because they are following Christ, but they don't; here if i say the Christianity is not good religion, it would hurt the feelings of Christan and i don't want this to do, Look Dear, USA is victim country where so much rapes happen (you may get the statistics) who lives in USA, Muslims? who do those rapes? MUSLIMS? Their crime rate is high, who do this? obviously those who live there - and Their religion stops them to do all these, yet they do, it's their fault not of the religion. Allah sent Prophets time to time on earth and Muhammad is the Last Prophet of Allah with a Book Qur'an, which not only tell you what to do and what no to do but also tell you how to do ... when to do, what to think, how to live, what you should wear, who you can talk to, when you can talk to them, etc etc. June 16 2009." (The Asian News) Sorry, what was that comment you made? Lady I am with you on this..... Pakistan has too many fundamentalists... I did rate them as the most dangerous.... you gotta read this … post234449 This report of ICC was not showed in any of the local or international newspapers or news channels and if so please give me the reference. Also Pakistan is not the caliphate-islamic state. It's rulers are Honorary Freemasons. Secondly, what will you say about Freemasonry and Zionism who is killing and butchering 1000s of innocents world wide, for instance, Paletine, Lebenon, Kashmir, Iraq, Afghanistan, Pakistan, Vietnam (in the past), Japan (past), Kosovo, chechnya, Bosnia ... and the list goes on and on ... what will you say about Atheist White Americans killing Black ones, the last century faced horrific tragedies against BLACKS of USA. dear friend, lets talk about the solution please. you are muslim i respect for that but why are we here marketing our religion. this is why religion got poluted, because the way each of you spread. are every one of you racing with each other in the name of religion. WHY? The Lady_E started it, i did'nt Lol - you've been marketing your religion through so many threads here. So - at least be honest about that dont defend, it will make you weaker, the more you defend the more you weaker will be, let it go, both of you not bad person indeed. how about starts to work on it, how? make others love islam and for that islam must show their love first, i love you, it does not mean i can allow you put yourself into HELL. I will atleast present you the right way. Then it's your choice to follow or not, no obligation at all. Have you gone to heaven ? How can you guide others? Sure he has gone to heaven....in his dreams to enjoy the heavenly virgins...LOL Of course - he hasn't, but he would like to think that he has!! That thinking of course comes from the arrogance of feeling superior in some way to other human beings - solely based on the relgion that he comes from!!! Lol - so you want to save us all! I don't see any reason for converting. If I believe in God, I believe in God. I don't see any reason why I should subscribe to what one person's interpretation of God was or is. I don't see the Quran as anything special or unique. It hasn't imbibed in its followers nonviolence or tolerance of other faiths. It has promoted dictatorial tendencies and regressive methods in parts of the world that have chosen to implement Shariah Law in its "purest form." it's not implemented in it's purest form. Regarding tolerance, sorry, we can not tolerate so many rapes per day in USA or any other part of the world and we can not forgive them. ONLY DEATH PENALTY for rapists. God forbid, We can not watch you be raped again and again The purest form = chopping off limbs/heads, stoning women for adultery, etc. Can you deny that? What's your preference - you would like to see implementation of such laws across the Muslim world? As for "rapes in the USA" - that's a different topic. Maybe you can open another thread to discuss that. As far as I can see, this thread is named "Islam" - so stick to the topic. who stonned women for adultry ??? Perhaps you need to Google some. What's the punishment for adultery in Islam? 1 - When an unmarried man and woman caught in adultery - they get 100 lashes each Evidence 1: 4 sane persons scrutinized them having sexual intercourse. Evidence 2: Acknowledgment of both guilty. Evidence 3: DNA Tests. 2 - When a married man and woman caught in adultery - they get death penalty Evidence 1: 4 sane persons scrutinized them having sexual intercourse Evidence 2: Acknowledgment of both guilty. Evidence 3: DNA Tests 3 - When a rapist rapes a woman - the rapist gets the death penalty not the woman. Evidence 1: Acknowledgment of the victim only. Evidence 2: Physical evidence of bodily scar/bruise/mark/damage, torn clothing etc of the victim. Evidence 3: DNA Tests Ouch!! I don't know what to say!!! Btw, are you saying that stoning of married adulterous women does not happen or is not prescribed by the Quran? @Shil In case you haven't noticed... he keeps copy pasting the same thing.... He feels Allah has drilled a direct pipe into his brain.... Oops.... Usman's mind is closed for anything and everything that doesn't revolve around Freemasons or Zionists...LOL how can you love me? when even your love for your family is not TRUE and how can you make me believe that you love me when there is no realisation of YOUR TRUE SELF, till you realise the word LOVE never exist within us. PLEASE understand it, i am not get you down. appreciate you OK Usman. This was all over the news and the source I used above was Asian news. As for your second paragraph, lets not drift from the thread topic which was simply "Islam is the Religion of Peace". So, if you say that comment was not shown in any local newspaper, how about this one. I even heard it on the news: Oct 2008 Female British Aid worker killed ‘because of Religion’ A female British aid worker has been killed by gunmen in Kabul because she was 'spreading Christianity,' it has been confirmed. Two unidentified hitmen on motorbikes attacked Gayle Williams as she walked alone at 8am, the Foreign and Commonwealth Office said. An FCO spokeswoman said: "We can confirm that a British national was shot dead in Kabul today. Next of kin have been informed." Metro.co.uk News May I add that this woman was helping the Country. Dear Lady who were the motorbikers ??? does any one know ??? If you figure them as Muslims, why can't they be Freemasons as the soldiers of Zionists are also there in Afghanistan. Moreover, Afghanistan has got no Caliphate - Islamic State or Caliph rather an American Govt. Thoese Americans whose half population is born out of wedlock (illegitimate). For reference please take the following. Mmmh. OK Usman. I think I’ll leave it here for now. Thanks for your responses. The world would just be a better and happier place if innocent lives are not cut short in the name of Religion. A Salaam alei-kun. @LadyE Don't even try reasoning with this guy.... he sees the whole universe infested with Freemasons and Zionists....LOL Yes Islam is the Best religion in the world. There has always been the concept of black sheep. So there aRE SOME BLACK SHEEP in the Islamic countries but not all muslims are wrong and they dont want to blow them up. those people whichdo this are being misguided about Islam. Islam Is the Best Religion. It is religion which tells us how to spend life in every aspects of life. It has proved each and every thing that the modern science has proved now in 21st century but it has proved that aspects 1400 years before. It has given the rights of women but other religion they dont give as such rights for them which islam gives them ,specially in the 19th centuy they have not given the right of vote in the 17th century they have not the authority to touch the Holy book Do you have any idea how stupid you sound saying islam is a religion of peace and then picking a fight with all the other religionists? The sooner we get your religion back in the bronze ages where it belongs, the better. there is no fight with others; why do u think if someone say christianity or islam.. religion of peace would bring fight; any religion should bring peace inside yourself and others; and this is so clear. and also for your knowledge muslems believe in all books ( Torah, bible , Quran) came from one God within different stages; and because islam it's the last stage in God messages; and that's the reason many believers from jews and christian enter islam happy because they understood the messages. if you believe in God, and you were jews believe in moses and torah; then, if you deny jesus and bible; God-the father- will never accept youbecause you deny God message. and also if you are christian you belive in jesus and bible; then, you hear about Muhammad and the last book from God-Quran- and you deny it; God will not accept you. islam just name equal the meaning of christianity; only because islam the last stage of God messages and islam present all of them. but For God wisdom you believe or not- it's your choice no body will choose for you; and no body to blame except you-.. in the end ; i ask God to guide us to His right way all of you my brothers... And I say the Torah Quoran and the bible all worship an abhorant, by-polar and hysterical sociopathic entity who scares the bloody daylights out of god-botherers who were indoctrinated at an early age, then bought up listening to this crap. Kudos! let us see, what happens. Mark does have a point, your religion does have more extremist than any other religion. I would say if any religion is peaceful it is Buddhism or such. I just wrote a hub on the terrorism that comes forth from Islam. Your holy book does state a jihad or holy war against all infidels..and that would be me since i don't agree with your religion. I am not saying all muslims are violent...just your extremists and those who support extremists. Dear Jew! Qur'an does not state any holy war against infidels, it's your misconception which you got from international media. Jihad means to strive and struggle, it does not mean HOLY WAR. On the other hand, In some books of the Old Testament (for example, Joshua) commandments are given to commit horrible violence against non-Jewish peoples. Mass murder is commanded, with no regard for women, children or the elderly. This merciless savagery is totally against God's justice. Take for instance, the black history of CRUSADERS. Also the hisotory of SALAH UDIN AYUBI who when entered Jerusalam pardoned each and every non muslsim whether Jews or Christians and let them with the fair choice of stay in peace or leave in peace. That also is a misconception God only required the complete annihilation of the race after they tried to destroy Israel. For example, they did not kill a pregnant woman once but had mercy on her. Later in life her child grew to hate israel and seek its destruction. If not for Esther asking the king of persia to spare the lives of the jews, they would have been killed. It was for this reason God had commanded it. Yes, I do remember the black history of the crusade...but it is not commanded once in our bible to do that...it was wrong but history cannot be changed...only the future can be changed. Extremist factions of Islam declare that Qu'ran state they must die in the name of allah to go to heaven killing an infidel...I don't know if the Qu'ran states this or not, but i do know this is what the extreme factions are saying. I having nothing against peaceful Islam. I had many friends in Israel who were Muslim. But I do not agree at all with such groups as Hamas, Hezbollah, Fatah, etc. You see when Muslim governments are not doing their job to resist Israeli unjust invasion then these kind of groups develped to fill up the gape. Have a look at the maps of Israel in 1948 and now in 2009, it will become crystal clear how the Jews illegally captured Palestine despite the fact these Jews were welcomed by Muslims as guests in 1947 after being kicked out by Hitler. So, now what these guests did to the innocents of Palestine and their territory, the judgment is completely yours now. may be because muslim countries are oppressed very much either by western leaders or by their friends (local leaders) there is no problem with making Jihad aginst those who fight Muslims to change thier ideals or take their wealth don't you think ? altough , most wetern people are nice but there are also many have been fooled by the leaders to engage in what called good wars. very obvious ? Very obvious. And one of the tools they use is religion. so , is there anything in Quran encourges Muslims to kill people just because they are infidels according to Islam ? (by the way I am an infidel too according to other religions , it is not a bad word) To be honest - I do not know the book that well. There are certainly muslimists who think it does. And I am an infidel according to all religions except FSMism. or may be they don't understand what in it so do you pray in the kitchen for the great FSM or enjoying his sons is enough to be grateful No - It Is Written That We Must Toast Him With Red Wine. No question. Oddly enough He Commands all the same things I agree with. Strange how Perfect His Noodlyness is. And of course, He Came after all the other minor religions to Unite Mankind in Friendship and Pasta. Ramen Where is the famous christian acceptance and brotherhood? You are kidding right? Did you just join HubPages to propagate this. If so, stay on and try and prove all that you are saying with FACTS. Also, try and explain what is going on in the SWAT area of Pakistan, where the Taliban have gone on a school-buring spree. IMHO, I don't see Islam evolving - only regressing with time. It seems the followers just want to follow the Book that was written 1400 years before. Apparently, Islam can't be adapted to modern times. So, we have Shariah Law being asked for by the Taliban and being grated by the Pakistani Govt in Pakistan. Kinda gives you an idea of where Islam is headed. name one law in Shariah prevents modern life evolution you would say; some muslims show me where it says in Islam to do so. I don't know if its an error or anything. Frankly, I wouldn't care less, and I'm not making fun of anyone either. I just like the phrase...spend life in every aspects of life. It means it can be spent on killing, butchering, rapeing, sex, loot, raid, plunder, gamble, drink, decieve .................. If islam is the religion of peace, why do all the islam church members love to blow themselves and other people up? Huh? It is definitely NOT the religion of "peace". Christianity is! --John \ "all the islam church members"?? Well hey! It's my good buddy oh boy everybody. Did you go back an eat your words yet? Do I hear an apology? John, You have a complete misconception of Islam and I am Christian you need to study World Religions and study the Ka'ran as that is not true. Christianity is a branch of religion and Jesus was originally a Jew , who became Christianities Lord and Saviour. True Christians would not blasphemy other religions when you are holding your head high as a Christian you have to ask yourself WWJD? Can you lead others to Christ by acting the way you do? Christianity is not the religion of Peace either as look at what you are doing you are yelling, shame on you. And I dont mean to yell. Im not actually yelling. Im typing like im yelling but im not yelling. I dont even mean to yell. Well, type like i am yelling. John- I can't even get a retraction from you? Whats your deal? Too immature? Or are you really that dumb? \ Hmm, I dont know. I guess we just like to post on the same forum topics. Something wrong? Immature? How??? John, Be nice WWJD??? you do owe her an apology, that would be the right thing to do. you are welcome ... but try to be nice please fix yourself Of course, if i am doing something wrong, then obviously it's not the fault of the religion. Consider, someone gets a latest BMW and he/she can not drive and sits on the driving seat and just bangs up the car. Now, who will be blamed. The car or the driver. If you want to test Islam then judge it by the best person who is Prophet Muhammad (pbuh). C'mon let's get real and admit that he's right... again;... The ones who blow themselves up are name sake muslims, acting as mercenaries, constantly fed by Zionists. Look around it's happening all over the world, Sudan, Pakistan, SriLanka, Palestine. They use to buy these kind of people from both sides, government and non - government (rebells / taliban etc) and make them fight, spread terror and demoralize Islam or any other system which itches their beloved systems of capitalism, zionism, freemasonary etc. dear Islam is the religion of peace. what you are saying is not the way of Islam but different reasons are behind that, those may be psychological, economical or racial etc.I'm a hindu by religion but I have a belief and faith On Islam because Islam gives Complete and better solution to our life as well as hereafter. Better for who? I feel confident in saying not many muslims follow the idea of blowing anything up. It is those who insist that others follow their doctrine who are to blame on all sides of the argument including self proclaimed christians and others as well who are indoctrinated with hatred and fear. Islam is a great religion. But so is Christianity, Hinduism, Buddhism, Jewism et al. What is your point anyway? You have a point. Sadly, the majority of the Western wall has a bad view of Islam because of only a small number of them. I know some people who are Islamic, none of them want to blow themselves up. It's the extremists we need to worry about, and of course we do. Due to the media, we fear the man on the train with the rucksack, if he is of a certain ethnic persuasion. Personally, I believe that one of the largest and most successful terrorist groups in the world, is the media. The definition of a terrorist "a radical who employs terror as a political weapon; usually organizes with other terrorists in small cells" Hmm, kind of sums up the media. If they stopped making everything sound so "Hollywood" and stopped making it seem like it's much worse than it actually is, then it might quieten down the extremists. Sadly, the only thing that's likely to stop all of this, is a couple of 20 megaton Nukes served up about 5am. I'll give you that one. "Western wall has a bad view of Islam because of only a small number of them"? The Truth is the extremist are not true Muslim but are brain washed Muslim who think they are acting in the name of Ala. The 99.9999999999% of Muslim are good law abiding citizens and not a threat to society. You know, I have a question. I am a Christian and when come across Christians in my personal life who try to oppress other people I will say something about it. So do Muslims who are against violence know other Muslims who are for violence? And if so, what do they do about it? I always wondered about that? Because I know 2 Muslim people who are great ambassadors for their culture and I feel really bad for them because of the rep their religion has. If I needed it they would give me the shirt off their back. So I always wondered about this. I am really coming to the conclusion that it was neither them, or Christians or any other religion that put enmity between us, but more like a snake who puts words in to confuse and set people against each other. I know some Muslims too and I went to a Mosque and just asked them myself. She women there said, (and she was very kind and lovey person) something to the effect of, now they aren't really of God are they? It actually blew my mind. I was thinking doyee, how did I miss that one. The most obvious answer. I also asked her why Muslims are fighting Christians. She said, no what they do is what they do but for us in Islam, it means peace and we love Jesus. Then she asked me if believe Jesus is God. I said no, she said do you believe Jesus is the son of God. I said sure, that is what they call him. And she said, no God does not have a son but Jesus is a prophet. I said ok, doesn't bother me none, then I asked why they are fighting over that. She said they are not. But some people want to make you think that they are. I also asked her, if we are all God's Children then how come Jesus cannot be the son of God. And she said, when you put it that way, then yes he is but this isn't something that people understand. - and of course there was a lot more to understand about it but it's for me to say- Agreed. I'll be back in a few hours. We could chat. ciao please sandra! dont make confussions. Son or sons of God refers to the phenomenon which directs towards the affection and love between the relationship of a father and son. Son or Sons of God does not refer to be begotted son or sons of God. Ask any christian pope, he will also give you this theme for the father and son/sons mentioned in Bibles. Hope you are getting the points in my replies. Any given religion has extreme people, Christians had David Koresh the muslims have the radical imams that propagate bombs to get their point across. You cannot condemn all muslims based on the actions of a few. Their Koran does advocate killing unbelievers in a couple of verses that the radicals base their whole philosophy on. They get adherents because they are much more active in their communities than others. The loudest voice gets heard not necesarily the right voice. Non radical muslims just live their lives like anyone else Muslim does not mean suicide bomber. Radical muslim can mean suicide bomber but we must know there is a difference. We don't have to approve of thier religion but we have to not condemn all muslims based on the actions of the radicals. The Christian bible says judge not and you will not be judged, it also says the measuer you use will be used against you. Christ will hold us accountable for everything we say and do that does not line up with His will. Yes, this includes hating other religions. We are not called to hate them. Sorry, your info is very unrealistic. For more detailed authentic references, please click on the following Hey I like this comment very much..... I like your name and avatar, I am going to be your fan,.... do you like Cat Stevens.. Every religion was great and were for the people of their respective times. Islam is the last and final religion rather a complete way of life for the whole of human kind. Christianity, Judaism, Hinduism, almost all the religions teach to follow only ONE God - ALLAH but their followers DONT. All these religions prophecised the comming of Prophet Muhammad (peace be upon him) as the last and final messenger from Allah and instructed to follow him but their followers DONT. So it's the duty of a Muslim to inform them, next, it's their choice. Nobody can force you. i dont think that islam is a religion of peace. THOSE MUSLIM people must prove to all that they are true muslim by there deeds.. The criteria for judging Islam is not Muslims. It's Qur'an and the last and final messenger Prophet Muhammad (peace be upon him) I haven't seen many but here's an Islamic web site that denounces terrorism. … alism.html Not many know that tens of thousands, both Muslims and Christians witnessed sightings of the Blessed Virgin Mary in Cairo, Egypt in the 1960s. I very much like the similarities between Islam and Christianity. Muslims recognize the virgin birth of Jesus by Mary, they give reverence to Jesus and Mary, they believe the antichrist (they call it the dajjal) has to come before Jesus returns to do away with the antichrist and a lot of other similarities. What I don't get about Islam is the fact that they do believe that Jesus will return and do away with the antichrist to make everything perfect, but they believe Jesus is just a prophet and not God. No other prophet has done anything similar. That is quite the job for just a prophet, isn't it? Mike Someone explained it to me this way... because God (Allah) is above All. or like Jesus said, "A pupil is not above his teacher, but everyone that is perfectly instructed will be like his teacher. So while they revere Mohammad as the last ( I believe) prophet, it is not fair or right to place one above the other because God is Above all and no one, even in perfection is better than the other. Though I may have it wrong so maybe someone from the Islamic faith can come and explain it better for us. Eng M. maybe? Where you at Eng.M? I like what you said here Sandra and is very much part of my faith where none of the prophets is better than the other. In fact none of the prophets ever denigrated another. They come at a different time and place, but always from the same source, with the same inherent principles like the Golden Rule which is present in every religion, but with different social teachings that reflect the needs of the day as part of an ongoing progressive revelation. We might call it Monday, Tuesday, Wed etc but its the light from the same Sun. So correct-The Prophets are One . The stages of life are man then God -man or prophet and then God-when man no longer exists. Yes, light from the same sun but light consists of rays and different type of rays (in terms of their intensity and reach) for different times and differnt people. The last ray is ISLAM which is for the last group of people until the end of universe. Islam confirms and respects all the previous Prophets and their respective revelations. All of those prophets and revelations prophecised about the coming of the last and final Messenger Prophet Muhammad (pbuh) and instructed to follow him. Even hinduism has got this information. So, please go back to your scriptures and read them in context. I will try to give the direct references if someone wants. My dear! Allah is the greatest. All are equal in the eyes of God. I am glad you are getting the stuff. And what does Allah say about homosexuals? totally forbidden, NOT ALLOWED The act is forbidden or the person who is homosexual is forbidden? How can a person be forbidden? No it doesn't. If you mean homosexual persons are unwelcome then why not say so? And presumably this is what you mean when you say "love."? What does the word "love" mean? Same as unwelcome and forbidden? I see you have now dropped your other persona in favor of this one. Why? Dear Make! Your question is absolutly valid and relevent. You are just one click away to find out your answer. If you have time then click on But Sandra there is lots of proof in the Bible that Jesus is God though. Not just from His apostles but from Jesus Himself. In John 10:30 Jesus says "I and the Father are one." It would be nice to see us come together. Yeah I wouldn't mind getting Eng M. to answer my question. I'll post it again. What I don't get about Islam is the fact that they do believe that Jesus will return and do away with the antichrist (dajjal) to make everything perfect, but they believe Jesus is just a prophet and not God. No other prophet has done anything similar. That is quite the job for just a prophet, isn't it? Mike But in this passage Jesus is not saying he is God, but rather that he is of God's equal in heaven, by his grace and that he, Christ's rite of passage comes about his duty to forgiveness. Mike not remembering where this quote is isn't there also a reference to Jesus saying that He also comes from God. We often take one thing in isolation but its the complete revelation of the prophets, the indicators of their station and the transformations they brought to the world that are the 'fruits' we should examine. Mohammed for example infused huge developments in mathematics and was responsible for many advancements. Prophets have been characterised by their innate knowledge and their ability to transform hearts which is why there are huge numbers of followers of the major religions (not the denominations per se). If people don't recognise the prophet, or follow His teachings -I'm talking in general- its not the fault of the prophet but our own inability to examine without judgement and with clear eyes, yeh? That is very insightful LBD. These Zionists (not ordianry christians, jews or hindus) have vanished the whole history from their text books which deals with the contributions of Muslims in the field of science specially when europe was indulged in its DARK AGES. Please refer to the following infamous web site DISCOVER THE 1000 YEARS OF MISSING HISTORY I certainly understand Jesus said this but these are my thoughts on my acceptance of Christ as god but not God. Either way I really want us to come together as well. Jesus is Mohammad----- Mohammad is Jesus= Buddha, Zaratushtra,Krishna, Mahavira, Guru Nanak. \ I respectfully disagree. I don't know what I believe to be the truth, but this doesn't seem reasonable. Too broad perhaps. Its is the truth all humans should understand-its high time these foolish wars in the name of One god stops. No Sir Jesus (pbuh) = Jesus (pbuh) Muhammad (pbuh) = Muhammad (pbuh) The prophets came one after another as successors. Every thing is not God Every thing is God's, He is the creator, the ultimate one. He created humans, the ultimate machine (creation) from God and Prophets are specially appointed personel for delivering the message of God to others and give them guidance John 10:30, I and the Father are one. For context,. So, God and Jesus(pbuh) were one in profession, not one in person. No RKHenry Jesus is clearly saying He is God in John 10:30. John 1:1, Matthew 11:27, Luke 10:22 are just some verses that speak of the Divinity of Jesus and the whole chapter of John 14 talks about the Trinity. Matthew 28:19 says "Going therefore, teach ye all nations; baptizing them in the name of the Father, and of the Son, and of the Holy Ghost." You got me. I'm not familiar with those verses. I am just familiar with what my parents always said. I don't think they were bible readers either. Who knows where they got the crazy idea that Christ was the son of God and not God himself. Confused. But hey thanks. I think what is best for us to be together and worlds apart is to start looking for all the things that are good. To start focusing on the good instead of looking to snuff out what is bad because by looking for what is good, we are snuffing out what is bad. I think we can already see what is bad and that it has been there so long and in some ways we have become acclimated to looking for those things to, I guess, protect ourselves from it and all along we have been against each other who are for the same. It doesn't make sense. Like what Jesus said about pulling the straw from your brothers eyes when you have a rafter in your own eye. I came to the conclusion that the "rafter" in my own eye is that for every straw drawn from another is yet another in my own. I don't have just one straw in my eye but I have many that I can see in my brothers. So when I see it in my brothers I need only to remove it from myself. And I believe it is a continual process. I believe I will always be a seeker and I will find many things and I will understand many things but when it comes to the last straw the only one who can remove this from my eye is God. Because, what you cannot see in me, I also cannot see in myself. I hope this makes some sense. So why did Jesus when he was on the cross say" why have you forsaken me? " Everything is God-this entire cosmos is God-Jesus understood himself and so he made the statement that he is the son of God or he is God. The little finger is part of the body,the same way is man part of the cosmos or gods body. Like Hindus have On Namo Shiva- I bow to god Shiv ho hum- I am God. Please correct your understanding related to Hindism books. Refer to the following for One God who has got no image, no partner (world, universe etc) Do understand Hindu philosophy has both concepts.The Muslim concept that even the prophet cannot be compared to god and the Christian concept where the prophet is equated with god.Both are correct Om namo shiva -I bow to god and Shiv ho hum- I am god are both true. All is Allah so you and everything are a part of him.The essence pervades everything. Please read the verses you mentioned in context, then you will realize what does it actually mean. There is a hell of difference between God (Caps G) and god (small g). I am a knower of god or Allah.I write on him as he has instructed me to,the very purpose I am here on this planet right now, to spread his message And what is the difference for you as I don't see any difference. I guess I addressed what you said in my previous post Lifebydesign (nice name by the way). See Lifebydesign there is just way too much proof in the Bible, both in the Old and New Testaments for a Christian to not recognize Jesus as God. Maybe Eng M. will try to answer my question. I've tried many times to get an answer to my question from a Muslim but I don't believe I have got one yet. happy days to you makemany , Sandra and all the others I hope I could answer your question Makemoney about why we think Jesus is just a prophet, yet he is still alive and would come in the end of days to kill the antichrist First, muslims don't differentiate between any prophet we have to believe on all of them as equal prophets sent by God God Quran YUSUFALI translation But, each prophet was better than others in some area and so all humans ex: some people have special skills and other people have others. Moses had many miracels and was a very strong man Jesus was very nice ,soft and a man with special capabilities like bringing some dead to life Suliman could deal with jins and control them and Mohammed had the Quran ,the preserved book on earth In addition to Jesus abilities, God has given him miraculous birth and death to test people in some way his death comes after thousands of years fom his born which was a miracle in itsself So, God is capable of doing everything he has many characteristics described by his 99 names and his characteristics appear in his actions thanx Thanks Eng.M My next question was going to be "but why will it be Jesus that kills the antichrist and not Moses, Isaiah, Jeremias, Daniel or even Mohamed?" But it looks like you have already answered that by saying "each prophet was better than others in some area." Belief in the divinity of Jesus and in the Trinity, the Father, the Son and the Holy Ghost is a fundamental belief of all Christians. So it looks like we are at an impasse as to coming together as one for the time being. But we can continue to try to foster an open dialogue and peace. Thanks again Eng.M Mike Make Money how do you know that it won't be Muhammed? The bible? Do you have any other resource other than that? Curious. Yeah from the Bible but also from Muslims RKHenry. See, that was the reason for my original question. Muslims also believe that Jesus will return to do away with the antichrist. I think it's pretty cool that both Muslims and Christians believe that. Also, he is making this role because God knows there will be a big controversy at the end of days about who really Jesus was ? there is one prayer in Islam says: thanks God who didn't have a son you know why ? because I don't know either may be because that will confuse us and let many enities control us what you think ? we don't need to we need to learn from each other all the time, with love No thank you MakeMoney Your question is again very valid. Yes, Jesus (peace be upon him) is alive and was not killed. The three major misconceptions which we see around in the Christian world, Jesus (pbuh)’s death, his claim to be God and the concept of TRINITY, were merely developed by the Christian elders and due to this very reason Jesus (pbuh) will return to earth before the end of time for proving them to be wrong and killing the Antichrist (Dajjal) for the peace to prevail on earth. Jesus (pbuh) is the only messenger of Allah from the total of 124 thousand messengers in the history of mankind, whose followers, majority of them consider him to be divine, the begotten son of God and was killed by Jews on the cross ruthlessly. All these type of things, attributed to Jesus (pbuh) are unique in the sense because none of the other messengers of Allah faced these types of allegations which the Christians attribute to Jesus Christ (pbuh). His return is also mentioned in Bible without any doubt.. For other detailes please click on Sandra asked this question and I have answered it for her- make money can look it up. Makemoney believe me , I read the holy bibel and I found that Jesus didn't say 'I am God' or 'worship me' they were all interpretations made after his death by the monks he could be his son as we are his sons but he is one of the best sons (if son means that God has crated us from him) is it from perfection of God to have a son as we have sons? does he need to show us his love this way? aren't there other ways ? God says: (Say: He is Allah, the One and Only; Allah, the Eternal, Absolute; He begetteth not, nor is He begotten; And there is none like unto Him. ) 112 Quran YUSUFALI translation There is no God but the one who gave everything regards Yes but they don't believe in the divinity of Jesus Christ. They think He was just a prophet. Muslims show reverence to both Jesus and Mary, which is also cool I think. How do you feel about the fact that Christ was both? Is that a possibility? If not why? I like this - both. Why does it have to be 'either/or' it can be 'and' in some instances. I've always thought divinity was related to being a prophet? Baha'is by the way believe in the divine station of all the prophets - or Manifestations of God as we call them. I still don't understand why can't Christ be both. You mean man and Prophet? He can, and from what I remember he alludes to it Himself. Absolutely. In fact Moses if I remember correctly was the 'Friend' of God. It is a progressive revelation after all. [As an aside: we go to the next class of school with a different teacher, but that doesn't mean we say the one before was wrong or ignorant, or couldn't teach us about more advanced things. They teach us what is relevant for the social and spiritual needs of the time that they appear and to our capacity to get it. Not that we always do, or want to ] Where ever I go, I cant escape you, can I RK? LOL AEvans, your right. I apologize. But Islam is not the religion of peace, everyone knows that. Thats all Ill say! lol I was actually just thinking that Misha. RKHenry, are you a guy or a girl? lol I would respectfully disagree with you, RK, These figures are all symbols of the enlightened human being/God throughout various cultures. It is a universal mythos I believe he is suggesting. Broad enough for me to be able to handle it--if you know what I'm saying. Yeah, and I'm happy for you. But still its too broad for me. I wish somebody would of thought to ask me why. Maybe then the problem could've been address. I don't know, but food for thought. I did leave an open ended statement. I was looking for answers not rebuttals. Respectfully speaking. Rosa Parks isn't Ghandi and Ghandi wasn't Rosa Parks, but they still wanted the same thing. That's what I'm saying. They were different men for a reason. To pretend to know that reason is something different. And Lita was looking for a spiced up intellectual flirt. Adjust accordingly Now, Misha! Don't be jealous! That's bad. RK--Ignore Misha, please. He really doesn't know what he's saying half the time, So, OK, open ended. What do you think? (It really wasn't a rebuttal. Just my thoughts.) I think that there can be universals with cultural specifics--especially in regard to these 'enlightened being/ Christ figures.' Rosa & Ghandi I see as a bit different... Lita Girl, you crack me up. When you say "universals"- do you mean universal meaning? Principles? Ideas? Beliefs? All of the above. Can be found in almost any realm--a la Joseph Campbell, idea of "Mythos," if you have read him. I didn't read the beginning of this thread, so... I see now your question about Christ being both God and Prophet. And really see no reason why not. I would view that as transcendence in stages....and perhaps we all are doing that. I do think mohitmisra makes a lot of sense. Concerning religion, I personally do not like a lot of specifics or organization, either--this is what all that Old World fighting and killing was/is about, in my eyes. Some, like Mark Knowles, would say get rid of God all together. I'd say, people--stop being so stupid and by all means practice a measure of decency and tolerance all around. They taught exactly the same thing.Here the essence is the same in all of them. taught the same thing, that does not mean i am you and you are me. Here in this dimension we split up but we come from the one and will always be one. You are me and I am you. All is me from my view point.One. "Nothing really belongs to me, At the same time all is mine as far as I can see " I read this somewhere...you are God in the form of (mohitmisra, in this case) and I am the same God in the form of Capable Woman. We are the same God in different forms... I dunno, I find this quite beautiful and it helps me empathize with others. Happy you can relate with this truth you are indeed a goddess. But dear, what about the verses from veda which directs Hindus to worship only ONE God and do not add partners, images or idols to Him. Have a look at Also Hinduism have prophesized about the Qur’an and Muhammad (pbuh) and instructed to follow Muhammad (pbuh) when you find him or become aware of him. You are only looking at on part of the philosophy as it matches the Muslim philosophy.if you read more you will understand more . Aham Bhramasmi-- I am Brahma, Om Namo Shiva- I am Shiva exist i Hindu philosphy. Tat Tvam Asi -"Thou art that," "That thou art," or "You are that," An idol is a physical manifestation of the divine and its okay to start with it but one needs to go beyond to the formless. The Hindus also believe Muhammad is not the last prophet .The last prophet will be born into a bhramin family, will write and unite the religions. Age of Aquarius will witness a great prophet from the east has been prophecised. - that means NOW. And apart from yourself, Mohit, who do you think might be the One???? Comming to the Prophet Muhammad (peace be upon him) issue. Please refer to the following which clearly prophecise Prophet Muhammad (pbuh)??? Both these philosophies are correct.Be open minded. If you contradict the second part then you are saying , all is not Allah. I never said Muhammad is not a great prophet ,he is very, very great.What I am saying is Jesus is equally great and Islam is not greater than Christianity because of the difference in philosophy.They had exactly the same message of oneness and love to humanity from God. Prophet Muhammad- "salla allahu alayhi wa sallam" meaning “To your be your religion, to me be mine.” He taught tolerance between religions and never said his was the true and greatest religion which some Muslims do today.Some foolish Christians also say Jesus is the greatest and this ego only leads to stupid wars which needs to stop. I need to add its a pleasure debating with you. Dear Mohit, you are a very logical person, i like your style. Now, i want to say something about this greatness issue which you explained. You see when some muslims compare a prophet with another, they do not do it on the basis of their personalities, physical strengths or miracles as the missionaries do rather the comparison is on the overall achievements of the delivered message, the final goals and their effects. In the same way, certain well known non muslim historians have done the same job and put Prophet Muhammad (peace be upon him) number ONE like The Hundred by Michael H. Hart. Here, if you ponder, famous non muslim professionals praising a being, implies that there is something very special in it. Imagine, non-muslims, doing research and writing books to remove the misconceptions related to Allah, Muhammad (pbuh) and Islam, those misconceptions which are immensly created by Zionits on daily basis as they only fear ISLAM to be the only remaining ideology which can remove their evil machinations to rule the world with one eyed Antichrist-Dajjal and under the new world order against which laymen of the world over specially europians and americans have staged a large number of protests and are staunch opposers to this evil system. In addition, i agree that Islam, christianity, hinduism and others are great religions but the greatest of them, if someone calls Islam to be the greatest way of life bears a valid reason and the foremost is that God who gave religions to His people is the same in all religions THE ONE GOD. He Himself told his followers in several scriptures that there will be a final great Messenger Prophet Muhammad (pbuh) and a final great word Qur'an for you to come. Who so ever finds it, starts following it. Now, tell me what's the big deal in that.??? At last, i never claimed any superiority or close mindedness You informed me that there is nothing in Hinduism which is related to Muhammad (pbuh), in response, my job was to agree with you BUT the problem is that there are some verses in hindu scriptures which deals with this subject and i simply quoted them, you can check it up. Now, after getting the evidence, you agree with it or not, it's totally up to you, neither i am forcing you nor will i kill you . RELAX Dear usmanali81 I enjoy debating with scholars Hinduism believes in a few maha avatars or prophets and amongst them are Jesus and Muhammad who are also know as avatars of Vishnu.Some texts say there will be one more and some there will be two more avatars. Now, after getting the evidence, you agree with it or not, it's totally up to you, neither i am forcing you nor will i kill you . RELAX neither am I or will I Like I said before the Buddhists expect the return of Buddha, Christians the return of Christ, some Muslims the Mahdi, Parsee the twins, Hindus the Vishnu avatar.This will be the tenth and final maha avatar. Here, if you ponder, famous non muslim professionals praising a being, implies that there is something very special in it. Imagine, non-muslims, doing research and writing books to remove . I am half a Hindu and half Parsee meaning part of my ancestors were from Iran.I praise all the prophets Praised all religions in my book. ??? My book Ponder Awhile is ranked over The Holy Quran on Franklin but that doesn't make me the greater prophet. Like I said before god sends the prophets when this earth is in a mess and he spreads god knowledge in the language of that time.The Essence is the same right from Zarathustra the first recorded prophet or from the Holy hindu texts like the Vedas which you quoted earlier one. I am trying to answer you - Respectfully speaking. Sorry,. So, if there are any avaters in Hinduism whose return (come back) is expected does not include Muhammad (pbuh). Muhammad (pbuh) has alread come to this earth and will never return. Regarding Mahdi, Muslims do not believe he will return or he will be the Prophet, no, not at all. It's only a prediction about a Muslim man among others named Mahdi who will lead the people of the world as a just Muslim leader / Caliph near the end of time and during this time Jesus (pbuh) will also return (come back). In my example of the medical books, i tried to explain the Qur'an outdates previous religious scriptures. It's not that Qur'an outdates a medical book or a philosophy book and vice versa Prophets represent the Light or Allah. Have you been one with the Light or Allah- I have. You do believe Christians, Hindus and Parsee expect another prophet so for many Muhammad is not the last prophet. One holy hindu texts say there will be an unlimited amount of prophets. Many believe he is eminent. Sikhs believe Guru Nanak was a prophet and the tribe of Baha'i believes Baha'ullah was a prophet . All three were great masters. Mohit! I do not have to believe the Muslims, Christians, Hindus, Sikhs about their believes and practices. What i need to believe is the one which is written in their scriptures and it's totally opposite what they practice and preach, i dont know why but it's STRANGE. You are talking about unlimited amount of prophets to come in these scriptures, i wonder where is that??? Regarding Guru Nanak and others, i did not say they were wrong or not great. What i am talking about is related to the LAST Prophet ... LAST (Prophet Muhammad (pbuh))... mentioned and predicted in almost all of the religious scriptures whether it be Bible, Hindu or Sikh scriptures and instructed very well to follow him when you find him. What i am talking about is worshiping ONE God and none other which is mentioned in almost all of these religeous scriptures. So now tell me, do i need to follow what's written in these scriptures or i have to follow the false notions and practices of their followers??? The scriptures Hindu and Parsee say there will be one more prophet who is expected now .I repeat Hindu philosophy - he will be born onto a Brahman family,will write and unite the religions- Kalki. The age of Aquarius will start with this prophet from the East. The Buddhists Expect the return of Buddha- The laughing Buddha,Maetriya and the Dalai Lama is supposedly gaurding the universe and he will take over. The Parsees expect the twins as the present day avatars. Christians the return of Christ. Recently many believed Sai Baba and Meher Baba to be avatars or prophets. Both were supreme masters. Then like I said before you had the great Guru Nanak. Many Mulsims converted to Sikhs because they felt the ideology of Islam has been corrupted over a period of time.They felt Islam considered themselves as the best which is not true and that all religions are equal and god is one.Something Guru Nanak and Muhammad taught. Muhammad himself said to your religion be true and me to mine. Live and let live - Mahavira, So according to you Muhammad was the last prophet and so the greatest.? You are not following the scriptures. Hinduism is not confined to Brahmins only. The new "prophet" may also be born in a harijan or dalit family. The main draw-back in Hinduism is the ego problem among the religious-sects. Hinduism shrinks because of the Brahmin atrocities. Unless and until there is equality and liberalism, no one will stick to Hindu religious thoughts. As for Budha, he should have come by now and he should have visited the Srilankan Tamil camps where lakhs of people are herded like cattle in a small area, ready to be sent for the kill. More than a lakh Tamils have been killed, in the last 5 months, their habitations reduced to ashes and there is now there is no sign of any habitation. What is the meaning of religion and Budha laughing after allowing such a holocaust. All were done on the pretext of Budhist supremacy in Srilanka. Who are you to decide what the Buddha should be doing? It is prophecised that he will be born into a Brahman family. Brahman- knower of Brahma- an awakened or enlightened one .Anyone can become a Brahman.Most of the masterpieces from India have been written by Brahmans who have showed mankind the way to god.A harijan or dalit can become a Brahman. Death is happening in all parts of the world and not just in Sri Lanka, its your ego towards the Tamils and Sri Lankans which makes you make such statement. The laughing Buddha symbolizes someone who understand the cosmic joke- all is he- he is the one dying. How a dalit can become brahman??? A Brahman is a knower of Brahma-Allah, an enlightened one.Anyone irrespective of their caste can become a Brahman. But Hinduism does not consider him / her as a brahman. Hindu scriptures catagorically divide people in 4 castes on the basis of their net worth of family, education, finance, economics, politics etc. Take for example the following. Bhagavad-Gita, Ch.18, verse 40 The Lord says: “There is no being on earth, or again in heaven among the gods, that is liberated from the three qualities born of Nature.” Bhagavad-Gita, Ch.18, verse 41 “Of Brahmans, Kshatriyas and Vaishiyas, as also the Shudras, O Arjun, the duties are distributed according to the qualities born of their own nature.” Bhagavad-Gita, Ch.18, verse 42 “Serenity, self-restraint, austerity, purity, forgiveness and also uprightness, knowledge, realization and belief in God are the duties of the Brahmans, born of their own nature.” Bhagavad-Gita, Ch.18, verse 43 “Prowess, splendour, firmness, dexterity and also not fleeing from battle, generosity and lordliness are the duties of Kshatriyas, born of their own nature.” Bhagavad-Gita, Ch.18, verse 44 “Agriculture, cattle-rearing and trade are the duties of the Vaishiyas merchant class), born of their own nature; and action consisting of service is the duty of the Shudras (servant class), born of their own nature.” Bhagavad-Gita, Ch.18, verse 45 “Each man devoted to his own duty, attains perfection.” Here one is talking about an a enlightened society where all castes are needed in order to function properly.Perform your duty whatever it is , is the meaning of the above passage.Understand what you are made for, the reason you are here on this planet and do it, this will burn your desires, the reason you have materialized and you can attain Moksha. This is why Krishna chided Arjuna on the battle field saying, "you are a shatriya, your job is of a warrior and you must do your job, the outcome of the battle has already been decided." A person born into a sudra or shatriya family may have the qualities of a Brahman in him, takes interest in spiritual subjects.An enlightened one a knower of Brahma is called a Brahmin.You may be born intro a Brahman family but you become one upon gaining enlightenment. My surname is "Misra "- "the name given to the Brahmins-enlightened ones who settled by the river Ganges." This is from my fathers side who lived in Allahabad the confluence of the Ganga, Jamuna and mystical Sraswati, but I became a Brahmin , a knower of Brahma or Allah at the age of twenty four when I came in contact with god, got enlightened. Brahmin is the class of educators, law makers,] Dvija "twice-born"-- reborn is what Christianity calls these saints. Or what Jesus meant by saying one must be reborn Here one is absolutly not talking about the enlightened society rather the text is talking about the NATURE of different kinds of people divided into different classes. Yes, Shudras may have the qualities of Brahmans and can think of becoming Brahmans BUT can not actually become Brahmans, Kshatriyas or Vaishiyas..” There are thousands of verses of Vedas and other books of Sanatan Dharm, which talk, about Caste system and Vedantist agree with it totally as mentioned the statements above. Now turn towards the Glorious Qur’an: Alhamdulillah, Allah clearly states in the glorious Qur’an in Surah Hujuraat (49:13) that, “O mankind! We created you from a single pair of a male and a female and made you into nations and tribes that ye may know each other not that ye may despise each other. Verily the most honored among you in the sight of Allah (God) is (he who is) the most righteous of you. And Allah has full knowledge and is well acquainted (with all things).” Here one is absolutly not talking about the enlightened society rather the text is talking about the NATURE of different kinds of people divided into different classes. Only an enlightened society can see this. It is similar to what some of the Greek philosophers proposed. In early age let the child play, then with time we can observe as elders who care as to what the child is inclined and tutor him as such.Is he inclined to spirituality, towards a warrior or towards the arts. The folly happens when the wrong person is in the wrong field. Yes, Shudras or sudras may have the qualities of Brahmans and can think of becoming Brahmans smile BUT can not actually become Brahmans, Kshatriyas or Vaishiyas. This is wrong ego which we have in India today and what some believe, someone born into a Brahmin family calls himself a Brahmin.No he comes from a family of Brahmins, Kabir the weaver - a Vaishiyas gained enlightenment, became a Brahmin or knower of god. Enlightenment is the criteria for being called Brahmin. "Verily the most honored among you in the sight of Allah (God) is (he who is) the most righteous of you. And Allah has full knowledge and is well acquainted (with all things).”[/b]" -this person will be called a Brahmin. The Qur'anic quotation which i mentioned was for showing you that Islam / Qur'an does not support this kind of seperative classes which Hinduism believes in. It's not the matter of Indians rather it's the matter of Hindu scriptures who themselves support and encourage this class system. You did not go through the other two verses from Hindu Scriptures. I am mentioning them here again..” These is metaphorical usmanali, don't take them literally. The undercurrent of an enlightened society is that all is one.The Brahmin cannot live without the Kshatriya or vashiya or sudra.Neither can the Kshatriya live without the Brahmin or vaishya or sudra and similarly the rest.There was respect for each , when the respect got lost is when the injustice started.. The meaning of this is that all these different parts make up god. He cant function properly if any one is missing. He needs all to become whole. But feet can not become mouth so people in the feet are suppressed and degraded all the time. Consult a celebrated history for that. Moreover, as per science brain has got a higher class than feet Can you be able without your feet? Are feet not important? There are many passages in spirituality which you cannot take literally or you miss out on the meaning . There is a passage in the Quran which says something like" you will have 7 virgins when you go to heaven." If you take this literally you are totally missing the point.The point being heaven is a far greater and happier dimension then we are in. Some would say what a ridiculous thing to say.What need of virgins when one is with Allah.There is no two in the dimension of god, all is One- Allah, so who can have sex with who? Then you have the third eye in hinduism, if you actually think there is one more eye needed on your body , again you are missing out on the depth. You have "when thy eye be single" Jesus. Now if you think only a person with one eye can enter heaven again you are missing out on the depth of these words. This is not metaphorical at all. Look at the verses again, very plain to understand. Also if you read the verses before and after them in context, it becomes even more clear that human beings are degraded and divided religiously in Hinduism. Now that you say Brahman cannot live without the Kshatriya; this thing is absolutly not mentioned in any of the Hindu religious scriptures. Infact it's your own philosophy to be kept in DARK. Do you know Shudras (merchant class) are not entitled to the study of the Vedas as you said they can think of it and can become enlightened but are not actually allowed to do it. Do not take it personal. It's the fact which Hindu scriptures itselves are evident on it. Take one more in the following Translation and explanations by Swami Vireswarananda Advaita Ashrama, Mayavati, Himalayas Brahma-Sutras 1-3-36: Because purificatory ceremonies are mentioned (in the case of the twice born) and their absence are declared (in the case of the Shudras). [Note: Purificatory ceremonies like Upanayana (Sacred Thread) etc. are declared by the scriptures to be a necessary condition of the study of all kinds of knowledge or Vidya; but these are meant only for the higher castes (Brahmins, Kshatriyas and Vaishiyas). Their absence in the case of the Shudras is repeatedly declared in the scriptures. "Shudras do not incur sin (by eating prohibited food), nor have they any purificatory rights " etc. (Manusmrti 10-12-6). Consequently they are not entitled to the study of the Vedas.] When you are not looking at it in an enlightened way, you are corrupting it.Its your outlook. Purificatory ceremonies like Upanayana (Sacred Thread) etc. are declared by the scriptures to be a necessary condition of the study of all kinds of knowledge or Vidya- I never had the thread ceremony and got enlightened without it. Like I said before the Greek philosophers also proposed this as an enlightened way of society. Sir, You have a remarkable in depth understanding of the Vedic scriptures. Seriously, not many Hindus I have met are as well versed about Hindu texts like you are. Are you a Theology major expert(especially comparative religions)? Coming to your observations about Hinduism I humbly admit that some of my fore fathers might have practiced discrimination of others based on caste(because even I belong to the priestly community). But thankfully our generation in India is slowly rising above caste based distinctions (but sadly politicians like Mayawati still persist on playing the caste based politics as if two wrongs make a right). It is really a pleasure to meet such a scholar who has such a vast knowledge of other religions. In fact the need of the hour is to come together as one. We seem to have all the religions in the world to divide each other but not enough to love each other. He doesn't understand the scriptures. Like Mark mentioned earlier you need to be castrated in order to enter heaven according to the Quran.This is totally absurd if you take it literally, the depth means one needs to be pure.One needs to be stripped of his ego and attachments. Ridiculing is too easy, try and see the truth, the beauty in a spiritual passage. A couplet form "Ponder Awhile" "We are constantly fighting like cats ad dogs, Reality is covered by some strange fog." This is metaphorical, please don't go looking for a fog to go through. Be practical Mohit , may be the class system can do something for Philosophers but for Practitioners this system can do nothing accept INJUSTICE. Dont Muslims have different people in different jobs,dont you have scholars, artists ,warriors and workers? Which society in the world doesn't? Like the passage you mentioned says man cannot function properly without his legs, arms, stomach and mind, all are needed. Oh no dont think muslims are to back positions..they are very cleaver as so many I mate in my class.. and I found so many muslims are very helpful, thay are very honest with their God -allah..and I dont know why in India people fights for the Hindu Muslim issue...they dont thinks that this issue was made by British to split india in to parts n so pakistan came to born... many people have respects for Hinduism .... I request u all Hindus and Muslima who r in Hubpages try to write on this issue and plz end up the wor.... thanks ..for nice subject... All the prophets and religions are equal Apeksha ,is my point. u people go on writing big posts so some times many diverts from main subjects... same thing wan tell to people... I get very irritated when anyone praises their own prophet or religion and tries to put down other prophets or religions i did not do it at all, go back and have a look again. You were saying old medicine and new medicine and like I said the message is the same since the beginning, god doesn't get old.He is beyond time "You are made of such fine light ,love tissue, No beginning , no end an ageless issue. " For your kind information, the most cleaver and genious people of the world are JEWS. QUR'AN praised them , so astonishing. You see the maximum number of phd in the world are produced by Israel. Saints or god men are have been produced in every nook and corner of this planet. My dear friend! Yes, every family, group, society, country has got these distributions BUT Hinduism is the only religion who catagorically documented the forcefull division of people and assigned classes to them on the basis of their family background, social, financial and political status, color, caste etc. The text in Hindu scriptures clearly describes that the people working under different classes can not join another class no matter if a Shudar can do the job of Brahman, they are simply not allowed by Hinduism to do so. Corrupted minds corrupted the ideal yet the essence or philosophy is correct.This corruption took place with time due to the greed of man ,it was not always there. My ancestors being Parsees had to flee Iran because Muslims were chopping of their heads if they didn't convert to Islam, Hinduism doesn't force anyone into their belief.The Parsees couldn't live in peace in Iran and so came to India which is know all over the world for its religious tolerance. Hindus accept both Jesus and Muhammad as great prophets but sadly its not the other way around, the great Hindu prophets are not given the respect they deserve by Christians and Muslims. For your kind info brother! Iran has got more than 6,000 jews living peacfully with Muslims, even Israel invited them for permanent residency but they refused and preferred to live with Muslims, why ??? Iran has got a considerable amount of Parsee as well. For confirmation, you can watch several documentries built by BBC and other channels and get amazed. Now comming to the religion of your ancestors, it's just to amaze you, do not misundertand me. The Zorastrians… the Parsis, they call Almighty God as ‘Ahora Mazda’. ‘Ahora’ means ‘the Lord’ … ‘God’, ‘Mazda’ means ‘Wise’. ‘Ahora Mazda’ means ‘the Wise Lord’ or ‘the Wise God’, and He has been given several attributes and names in the ‘Dasatir’. For example, - ‘He is the only One, He has no beginning, no origin, and no end - He has no father, no mother, no wife, no son. He has got no image - He is beyond imagination. There is nothing like Him - No vision can see Him. He is beyond comprehension. He is closer to you than yourself’. There are also other attributes given to Almighty God, in the ‘Awastha’. The other Sacred Scripture of the Parsis. It is mentioned in the ‘Awastha’, in the ‘Kathas’, and the ‘Yasnas’, He is called as the Creator, in Yasna, Ch. No.31, Verse No.7 and 11, and also in other places in Yasna, Ch. No. 44, Verse No.7, Ch. No. 50, Verse No.11, Ch.No. 51, Verse No.7. In several places He is called as the ‘Creator’. Peace be upon you Buddy its common truth the Parsees fled from Iran and came to India as they were being persecuted by the Muslims. So now is the prophet Muhammad greater than the prophet Zarathustra,? they taught exactly the same thing. Some Parsees also have this foolish ego that since Zarataushtra is the first prophet he is the greatest ,it is as absurd as some Mulsims saying Muhammad being the last prophet is the greatest or some Christians saying because Jesus was crucified he is the greatest prophet. He is closer to you than yourself- I am a knower of god ,try to understand I have spent the last few years of my life as a poet spreading gods message. You may not like it but many do call me prophet. CW, he doesn't have the "remarkable in depth understanding of the Vedic scriptures" as you think. He is one among many Muslims out there, who resort to copy-n-paste to further their propaganda. Their only goal is to prove that Islam is the perfect religion and all non-Muslims should convert to Islam because of that. He's not a theologian - just a humble copy-n-paster of texts. He wouldn't have read most of what he's copying and pasting himself. Correctly said, if he did have the understanding he would never try and ridicule it and say Islam is a superior philosophy.. Exactly. Those not familiar with this copy-n-paste mechanism would mistake this guy as having vast knowledge of other religions but what he really is - is a guy with lot of spare time on his hands and lots of cut-n-paste material!! Posting those is being passed off as debate!! Dont worry, will defeat him in a debate Ha ha - I know you will. But, problem is he won't oblige. He knows what he is good at --- that is copying and pasting verses from the Internet Let him try, will explain those verse to him, the real meaning. But, he doesn't have an open mind - does he? If one comes to a debate (in the real sense), one comes with an open mind. Yes, you take a position, but are also willing to consider other views. If you come with the sole intention of proving that your way is the right way - you seek to only prove your superiority. Its a self-fulfilling prophecy situation!!! Will open up his mind.He has limited understanding right now, will teach him. Dear! If some one knows the correct formula for making a nuclear bomb and he / she comes and show you, then what's wrong in taking the correct formula. Any way, you love to be on the wrong formula, go ahead, it's your choice. But i am still here, so you can ask for the formula any time Have a look at this link please you will understand I have the correct knowledge or formula. not you. … r/ebooks/0 where did i say that??? Your own Hindu Scripture is saying that. Your own Hindu Scripture is dividing people in classes. The class issue was started by YOU and VENUGOPAL SIVAGNA. i just mentioned some of the verses from Hindu Scriptures, i from my ownself said nothing. Like I said if you are not thinking in an enlightened way you will corrupt whats written. For example if it's written, "Go and rape the the poor girl". How can you get enlightenment from this sentence. Enlightenment which you are talking about can work in Philosophy. So dont mix it up with religious scriptures as these are meant for ordianry people and thus are written in easy languages whose chapters and verses must be read in context. Do you know what a CONTEXT is ??? Also explain the enlightenment which you are talking about. Enlightenment-in light-one with Allah-Shiva-The Holy Spirit. So its true to enter heaven one needs to be castrated? Its true you will have 7 virgins when you go to heaven? Enlightenment is religious.Making contact with the creator, god, Allah, Brahma, Shiva, Ahura Mazda, The Holy Spirit. Can you tell me in which text its mentioned go rape the poor girl? The enlightened ones write religious scriptures. Why have you not answered my question "don't Muslims have holy men, warriors, artists and manual laborer.? Dont you need all in order to function properly.? Can you function properly without your hands or feet? Stop making the great prophet Muhammad into a fanatic. So what I am getting from your present statements is that what Shil/Mohit suggested earlier about you copy/pasting without understanding seems to be possible in your case. Well then there are countless writings written by others who have found discrepancies in Islam and even on Prophet Muhammad (PBUH) and for the sake of a discussion I can also include them but then it won't be me who is talking to you(but some other writer). Btw every religion will have some strengths and weaknesses. If we only selectively read/understand(that too with a preset mindset) then we will only "see" what we want to see. I hope my friend you will understand what I am trying to say. Have a good day. Dear, I quote from the religious scriptures not from the books of other folks. The countless writings against Islam are from other people not from the religious scripture-Qur'an. Let me help you with this if you want to malign Islam. Buy the book by the name of Satanic Verses by Salman Rushdie and push your limits to degrade Islam. The more you degrade Islam the more it prevails. Do you know after 911, ISLAM became the most searched word in GOOGLE. Do you know ISLAM is the fastest growing religion in Europe and America after 911, which SWORD is forcing them to become Muslims??? SWORD- I just told you many of my ancestors fled Iran because they didn't want to convert. The others stayed back and converted as they didn't want their heads chopped off in the name of Allah. What is your Taliban about? This is why when the great Guru Nanak came on this planet, many converted from Islam to become Sikhs where there is no distinction between religons. Taliban is the political game plan of Zionist Jews, Zionist Christians, Zionist Hindus and Zionist Muslims to gain full control of the most important parts of the world, to sweep away the hurdles for the awaited Antichrist by Freemasons, New Conservatives and Zionists. Talibans are mercenaries just like the Tamil Tigers taking money, food and weapons from their Zionist God Fathers just for promoting chaos, killing of innocents and dome the the whole territories with evil clouds, this same thing was also prophecized by Prophet Muhammd (peace be upon him) as a sign of the arrival of Antichrist-Dajjal. Talibans have got no businesses, no bank balances, no jobs, they are getting their stuff from Zionists and their agents. Even when some Talibans were caught dead by Pakistan Army or Tribal Elders, they were found un circumcised bearing enough evidence for these people to be mercenaries bought from different locations of the world like Russia, India, Arab, Pakistan etc., AMAZING HA, for conformation have a look at some of those videos on YouTube (if they are not banned). Circumcision is compulsory in ISLAM. I understand the frustration by the Muslims, no one wants an outsider coming to their country and dictating terms. What we were talking about is tolerance and Parsees fled to India because Muslims in that part had no tolerance and were converting people with the sword, with force.What sort of philosophy is this? Why are people so against the Freemasons? They were founded on the teachings of the first prophet Zarathustra and do a lot for charity. Come on dear, get some more info. According to Freemasons themselves, their roots start from Ancient Egypt. For the history of Freemasons, you have to study the chain of Ancient Egypt--Crusaders--Knights Templars--Kabbalah--Freemasons Freemasons believe on Kabbalah which is a secret mystical book full of black magic and things like these which were also preached and practiced by the Ancient Egyptian Council of Magicians to Pharaoh. And it's the common practice of magicians to hide behind the black deeds and concepts by making use of charity, donations, gifts and things like that on the front end. Please go through and get enlightened what God did with one of the greatest deniers. Some of the most respectable men in India are Freemasons, you do understand magic can be black when misused and white when used correctly or for good.The first known inscripition for Jesus was on a bowl where he was called magician.I joined the Freemasons but was too busy to go to their meetings.The Kabbalah is a mystical book , meant to reach god,this universe is magic. A couplet for "Ponder Awhile" "Either you can see the magic, Or your life is indeed tragic." "If you can see the magic in just one flower, your life will change drastically" Buddha I am enlightened. hhmmm, so you are a Freemason, a Hindu, a Parsi at the same time ... Kindly put your legs in one boat other wise your legs will tear apart. All is Allah , all is Shiva. Who will tear my legs apart? Only a sadist, fanatic. Like the ones who attacked Jesus and Muhamamad. I belong to all. No one will tear your legs apart. This will be done automatically. Have some practical on two real boats in a river. So what can I do if my dad is a Hindu and mother is a Parsee ? Disown both or one of them or embrace both. ? God is the same for all of humanity, all religions.Are his legs torn apart? Give me the evidence to back up your claims. How and in which way is the Taliban the "political game plan of Zionist Jews, Zionist Christians, Zionist Hindus and Zionist Muslims"? Prior to 9/11 most Muslims were praising the Taliban for being the "ideal Muslims" by following the Koran perfectly. Now, they've become creations of other people? You've got quite the imagination to come up with this. Not me, these are your own religions, proving that ISLAM is the perfect religion, i am just compiling up the information and presenting it to you. Now if you dont like it, through it away. Even Atheists are comming towards Islam. Do you know something about Pragmatism; a new form of Atheism in which people agreed upon One God concept but further they say "ok fine, yes, there is One God but He has nothing to do with our lives". May be in future they say "ok fine, let's bring God in our lives as we can not clear up our own created mess, oh God please Guide us" This is not the meaning of these words, and you are speaking with a forked tongue. I understand your religion encourages you to lie in order to push your irrational beliefs on everyone else, but please....... A new atheism that believes in one god. I can recommend the Oxford English dictionary if you are having difficulty understanding these words. It will help a lot. Dictionary gives word by word meaning not the explaination. There is a whole world behind Capitalism, dictionary can not take it all too small. So for you, consult some Pragmatist scholar. LOL What do you think atheism and pragmatism mean then? LOL Making up your own BS definitions is not helping your cause. In fact - thank you very much for reminding me why I am not interested in following your religion. I do not like liars and cheats. It is against my moral code. You clearly have none. Thank you once again. how old are you ??? Please answer the questions. I do not like to see people lying, stealing other's word and spreading deliberate misinformation. Thank you once again for reminding me why I do not like religionists. Do you even know what "atheist" and "pragmatist," mean? Yes, of course, it means that USA alone has got the maximum number of prisons and prisoners in the world. In USA alone, maximum number of rapes take place per day (almost 2000 rapes per day). USA alone, has got the maximum number of registered cases of Depression, Hypertension, Obesity, Breast Cancer, Aids ....... (a long list of diseases) despite the fact that they are leading a top notch facilitated life. In 2009, from USA alone, the credit crunch started and ate the whole world, imagine their auditors did not knew about what's happening in their own sleeves . USA alone, is under the debt of 7.0 Trillion Dollars bought most of it from Rothchilds (they are Jews not Muslims ). USA alone, has deposited the maximum number of soldiers in different territories of the world, just for killing and butchering innocents in order to fulfull their SADIST desires. Danmark and Greenland alone, has got the maximum number of suicide cases despite the fact, these are the safest places and considered as heavens on earth. EUROPE and USA alone, have got the maximum number of old age houses, where the open minded Atheists and Zionists dump their innocent and loving parents single-handedly. UK alone, awarded the honor of SIR to Salman Rushdi for his book Satanic Verses in which he merely used slang language and abused Christianity, Islam and the Prophets. Do you want some more explaination for any of the ISMs ??? Yes please. This is extremely funny. Do it some more. You are beautifully demonstrating MUSLIMISM for all to see. amazingly you keep going out of the topic of discussion stop being childish please , you know the figures he provided could be right it has nothing to do with Islam why do you insist to attack people having fun doing that or just killing some time None of which address the question I asked. that's right but I mean that you don't have to disagree with the other part of discussion all the time to make your point Mark I know that he might wanted to tell you results of the two but not what they mean regardless of their meanings he and I also don't think your proposal is better for humanity What other part of the discussion? That is meaningless garbage thrown out to confuse the fact that this muslimist does not know the meaning of the words "atheist" or "pragmatist." What does the amount of depression in the US have to do with the meaning of these words? Yes, it addresses very clearly but may be not for funny people like you No it doesn't mr muslimist. You may think raping women and stoning adulterers to death is the answer to American depression but I do not see what that has to do with atheism. Perhaps you could explain. Country Woman has explained why you are very, very wrong. Perhaps you could reply to her also? Muslimist is the term invented by you in this forum. You can call me a Muslim. You people asked a list of questions one after another. Now you tell me if a rapist comes and rapes your mother, daughter, sister, wife or spouse, which punishment will you prefer for him??? You are demonstrating the term muslimist right now. In fact, I would say you invented it yourself - not me. Please answer the question instead of going off on another tangent. What does depressed people in Denmark or America have to do with atheism? read my answer in detail which i gave to CW I have read your rantings. Oddly enough, I do not see the rape, child abuse and depression statistics for any muslim countries on your list. Neither do I see what this has to do with atheism. I am not depressed, not do I rape women or abuse children - and I am offended that you suggest the fact that I do not believe your fairy tail will make me do these things. You do not understand what atheism means - it means I do not believe in a god - any god - yours or any of the other thousands that people claim to believe in. That is all. It does not mean I am a rapist, child molester or depressed or ill. You are muslimist with a one-sided, bigoted, irrational viewpoint. As far as I recall - your prophet had a nine year old wife and rape is legal in Muslim countries is it not? 1- it was normal at that time ( people have different judgments at different eras ) 2- she is one of the most tradition(the prophet says)teller , around 5000 right one , she used to teach men and women their religion (young people are more willing to remember) 3- to strengthen relation with the prophet , his best companion Abu Bakor asked to do so 4-other wives the prophet had were mostly old , divorced or widows ( he could have better if it's only about women) and no mr.Marksist , it is illegal All right - let's deal with this one for now. The legal age for women to be married was 9 years old - or at least to consummate a marriage. This is what your book says. I often hear the argument that the word of god as written in your book is never-changing and is the same today as it was when it was written. In Iran the legal age for marriage is still nine for girls. So are you now saying that the word of god can now be changed to suit modern day ethics? no I didn't say that Quran or sunnah don't mention anything about this aspect there are many things are left according to different eras the word doesn't need to change it is written to suit all times .. it is flexible .. Dear Mark! I respect you as an elderly man. Kindly put off your glasses to see the whole picture of Atheism. I am not saying that all atheists are bad. You are a good atheist but over all if you analyse this ideology leads to destruction as for an atheist there is No God, No Heaven, No Hell, No Life after death, so there is no compliance and audit for him / her that is why they make use of this materialistic world in any way which suites them. Now,: third-world non-Muslim and Muslim countries. See the following examples: A 9-year old Thai girl gave birth: The news item can be obtained from New Straits Times, 10/3/2001. Activists condemn Gypsy girl's arranged wedding in Romania? Child brides as young as 8 (eight) were common among the Byzantine emperors and nobility!. Threrefore, Prophet Muhammad's marriage with Aisha was 100% legal and acceptable by all laws and Divine Religions! This is rubbish. Muslims are just as likely as anyone else to make use of this materialistic world. In fact, where slavery is still in operation - it is in muslim countries. How dare you tell me what my standards are. I have seen you lie and steal other people's words and now you are telling me what atheists do and do not do? This is the problem with having an irrational belief such as yours - you start behaving like this - and wars ensue. I do not need to believe in your invisible super being to lead a moral life. I am quite capable of making my own judgments as to what is acceptable behavior and what is not. Interesting argument in favor of having sex with children you put forward. Odd that you were castigating the West for child abuse and promiscuity, yet in your culture it is still acceptable for a man to have several wives and have sex with 10 year olds. As for the respect - you have not shown me any respect - so please do not lie about that as well. You sir, are a muslimist through and through. I DARED as it's an attitude of LIONS to rip off the evils like Hyena. I don't understand. You favor sex with children and lie and steal other's work. You also claim to respect me and show disrespect. Are these things not evil? Is this what your religion is all about? I am confused. LOL - what was that again? That's the most ridiculous statement I've come across anywhere!!! Are you justifying child marriage? Also, in Saudi Arabia, you have cases of old men marrying young girls. CNN reported one such instance just a while back. Hmm, so what does one make of that? When an Arab marries a young lady, it comes on CNN headlines and when a white son of a bitch rapist rapes a breast feeding baby or juveniles it comes as a small news on CNN, WHY??? Take for example the following from Washington post which came as a small news. MOUNTWOOD DR., 9500 block, Dec. 9. A man allegedly had sexual contact with a female juvenile. A 33-year-old Manassas man was arrested. Also, no one is talking about legality here - what about the morality of it? Did he feel comfortable marrying a child? You talk as if all men around that time were marrying children - was that the case? may be she was happy to be married to the best man ever on earth he died on her lap and yes , it was the case people mustn't marry young girls now especially as there are no reasons for that as Muslims , we are sure that the prophet didn't oppress anyone by anyway we believe this marriage as it was for reasons , it was also performed to have this contraversory issue in our days Yes, she was comfortable and very happy. How do you know -- were you a witness? Did you interview her? If i did'nt then why are you promoting misinterpretations as i am dead shure you also did'nt interviewed her, why are you misrepresenting her??? What misinterpretation are you talking about --- its a fact. He did marry that girl -- so what is the misinterpretation? Did non-muslims manufacture her? how much you get from Zionists??? It seems you are compiling up my replies and posts and preparing a book or a hub to right, very BAAD, you are stealing my stuff. The misrepresentation from her side by you that she is not happy with that man Oh yes - would she have thought of him as daddy. I am sure she would have been happy to have a father figure --- that would have made it alright, would it? Its a question of age and the morality of it and the correctness of it. A little girl wouldn't know - but a grown up adult should've known better!!! Their is a trend by the old men of westerners to have juvenile mistresses aside from their so called wife / spouse / girl friend. So what's wrong if an old Muslim man marries a juvenile and gives her complete rights and respect as that of a wife. If you can't see anything wrong in this you are one sick puppy! Your past was just a creepy sperm and your future is dry clay. Whay are you so arrogant??? Fear ALLAH He's blind. How can he see imperfection in his prophet. He's drowning in his own propaganda!! Mr Usman- The "westerners" if they have any inappropriate relationships then they can be charged with bigamy/adultery hence punishable by a court of law. But in this case no matter even if given "rights" and "respect" the core issue of the subject being a minor makes even her consent(for consummation of marriage) inadmissible in any court of law and goes completely against all principles of natural justice. Hope you can understand my rationale and not take this as a personal attack on any individual. I am talking more from a principle point of view. principles of natural justice, what a joke. Mark- It is not funny at all for me. He is having a terrible misconception and if he is a young guy then please try to inform guys like him that there is more to it than what meets the eye. Usman- First I thought you are an elderly person but after reading couple of posts I feel you may be a young guy who is just not getting the so called "facts" from the right sources. I have studied in US and also presently working in US. It is fair to say that there are good people and not so good people in every religion or even with no religion. And also my earlier point is there would be people always trying to prove others as bad to show themselves as good. A case in point is a guy called Zakir Naik who distorts and misrepresents facts to suit his particular point of view. Personally I have many wonderful Muslim friends and I have a pretty good opinion about Islam my friend. Have a good day. Be my guest CW. I have a feeling you will be talking to deaf ears though. He is on a number of other discussion forums pushing his religion in much the same fashion. Looking forward to the ensuing conversation actually. not pushing just presenting, by the way right now you are in the forum of ISLAM presenting yourself as a funny guy Mark- Maybe you are right about the "deaf" ears. PS: I just read his response and wouldn't like to further engage in pointless conversations on this thread. Have a good day. You give up too easy. Just remember - these are open, public forums that anyone can see. I am not really talking to him. Well there should be some give and take in fruitful discussions otherwise we would be going in circles. I am open to listen and discuss but when somebody doesn't want to listen then there is no point. I actually wanted to write a hub. Do you think there is anything to be gained in pouring water on desert sand when rather I could be watering a thirsty plant. I prefer to direct my energies where it might be of some use either to me(enjoying/learning) or others. But I admire you for your resolve. Have a good day and a wonderful weekend ahead. Btw I preferred my last post in this thread to be the last one but now I don't know(but I still hope I don't have to come back here) Well, as I said - I am not really talking to these people. I am well aware that they have the information they need piped directly into their heads by their god, so I don't really expect them to listen. But - other people can see and read these forums and make their own mind up. Usman- 1) This point is correct. But it is also due to two factors one is that US has the third largest population in the world and also many a times many of the prisoners in 1st/2nd in population i.e., China/India have quasi judicial lockups more so in .)" (copied from the source). Also many of the jails are full of drug dealers and other illegal activities for which the US still has a Judicial remedy unlike some countries where there "quick" justice meted out to such folks. Source:- … -prisoners 2) About rapes there is no clear evidence but South Africa seems to have the highest incidence of rapes in the world. And also out of personal experience I felt much much safer both in the university campus and also around my present work place/home in US. Personally I have never heard of any incidences of rape in my brief stay in US so far(except in news sometimes). Source: … 452C553558 3) Diseases and depressions: Many nations don't even acknowledge mental conditions as disorders to even seek treatment hence it is highly commendable that US and other western countries not only identify but also seek to redress the disorders. 4) US does have treasury bonds which are held by China/Japan(but no way any private family owns substantial stake in the US to control its decision making). And also Rothchild's total wealth i.e., there own wealth is no where near to "7.0 Trillion Dollars". Although reading further about family wealth folks like Rothchild's I found lot of conspiracy theories abound around them:- Source: (For individual wealth) … _land.html 5) US does have its presence everywhere when the central agency like UN isn't adequate and I do agree it sometimes needlessly goes into war. But there purpose can be termed more profit motive rather than "sadism" which might seem with abu ghraib/guatanamo incidents. Sadly Bush spoiled the US image a lot and Obama is trying to redeem the US image. And also US is one of the first countries to mobilize relief/aid when and where it is needed hence they might be profit seekers but not "sadists". 6) Countries like Greenland which are in the arctic circle have half the year in total darkness and that might have a lot to do with the detrimental psychological effects although I have not researched this piece further. 7) Europe/US societies differ but at least everyone has an equal shot towards retirement pensions from government agencies like Social security where as in many Asian countries if the kids don't look after the parents then they have no other go. And more ever US does have a very strong Christian influence (especially in Midwest and deep south) hence not all are atheists and also all atheists aren't people with no human emotions of empathy or love as it seems to be from that statement. 8) "SIR" is a title award given by the British Monarchy as much as Bharat Ratna by India or Nishan-e-Imtiaz/Nishan-e-Pakistan by Pakistan hence it is up to the respective countries internal decision making body to take that call. PS: Hope I did ok in my attempt, Mark Dear CountryWomen (1) USA and China have got separate ideologies, no matter based on the Darwin’s Theory of Evolution, yet their development and structures are different that is why China claims to be a Socialist state where as USA a Capitalist. Now if you analyze the history, the cry of Atheism originated from USA and has got the maximum number of Atheists. USA’s ordinary as well as elite classes were very much influenced by Atheism over the past hundred years, no matter Freemasons and Zionists supported Atheism as it takes people away from religion very easily. Take for example the support for the song of Lennon-Imagine there is no religion, recently, even Obama promoted the same very song in a gathering. That’s the reason I mentioned the causes and effects of following the doctrine of Atheism by USA and Europe especially as an answer to Marks immature question. (2) Sexual assault Statistics • 1 in 3 girls and 1 in 4 boys will be sexually assaulted before age 18. (Office of Criminal Justice Planning) • 80% of all rapes that occur are committed by a date or acquaintance. (Office of Criminal Justice Planning) • 1.3 women in the United States are forcibly raped each minute. (Rape in America: A Report to the Nation) • 68% of rapes occur between the hours of 6pm and 6am. (U.S. Dept of Justice) • Only 2% of rapists are convicted and imprisoned. (U.S. Senate Judiciary Committee) (3) You did not read my point carefully, read it again in the following especially the bold letters, also remember, USA claims to be the Super Power of the World. USA alone, has got the maximum number of registered cases of Depression, Hypertension, Obesity, Breast Cancer, Aids ....... (a long list of diseases) despite the fact that they are leading a top notch facilitated life. (4) Please do not give me wikipedia reference because it’s easily changeable, any body, you and me as well, can change the information on wikipedia. Just create a user account (free) and see how you can play with wikipedia You call them conspiracy theories but for your kind information these have now become facts as thousands of evidences and chain of actions and reactions are recorded in this regard as well as in support of 911-that the job was not done by Afghanistan or Obama sorry Osama (5) Thanks for agreeing but killing and butchering is not allowed whether it be for profit or for filling up the UN gape. (6) Research it again. (7) The true Christians are believed to be the nuns and popes in churches, the Christians you see around are merely name sake Christians just as there are name sake Muslims. Majority of the world whether be Muslims or Non Muslims are greatly influenced and submerged by materialistic gains which supports Atheism and this in turn supports Freemasons and Zionists. (8) But spoiling an award on a book whose supporting material is slang, abusive and violent, how ridiculous. A proud English nation giving award for a pathetic book. Hhmmm …. Oh I see … May be it’s the effect of repeated marriages with cousins for generations that is why the Queen did it unintentionally as she blinks her eyes unintentionally. Lol - you are a funny guy. You quote all those statistics as if that's supposed to mean anything. Well - news for you - it means nothing. In democratic countries, you have free access to information, you can gather data from people and people are open to sharing information. How many Islamic countries around the world can match that. You make it seem as if sexual assualts don't happen in Islamic countries. Lol - read up some. In Pakistan, incest is common place. Now of course they don't show up in offical numbers - why? Obviously, because talking about the subject is taboo in countries like that. Also, the repercussions for the girl/woman involved is huge - could even mean death. So, why would a sexual abuse victim speak up in Islamic countries and how would that show up in statistics. Statistics mean zilch. Fact is a lot worse happens in closed Muslim societies that go unreported because of fear, as I've stated above. Just who are you kidding with those lame numbers. Stop pretending you live in an ideal society. Your house is just as dirty (if not more). Stop deluding yourself. Just another thing, I know sodomy of young kids is commonplace in Afghanistan. You ain't proving anything quoting statistics!!! These Muslim countries which you see around are name sake Muslim countries divided in 1920s after the destruction of Khilafa. Caliphate(Khilafa) is the true Islamic State System. Read The Last Mughal by a non muslim historian to clear your misconceptions. For an overview of the book You forgot, Mark is a funny guy not me Zakir Naik distorts and misrepresents ... hhmmm ... like for example ??? My friend only folks who want to believe in people like him actually like him. Oh by the way here is one link among many links which state some of his assertions to be incorrect. If you want more links then let me know. PS: I do admire that man for his memory in trying to remember the quotes/verse numbers but alas it is his agenda that keeps others from taking him seriously(unless for those who want to believe him). i told you not to mention the wikepedia references as their text can be changed by anyone. Therefore it's not authentic. The sentence in the very first paragraph in your wikipedia reference "human males are polygamous by nature and that a man is less likely to cheat if he has more than one wife." proves wikipedia to be RUBBISH promoting falsehood against Islam as they get heavy payments from their Zionit God fathers. This sentence was never ever told by Zakir Naik. Take a look at the videos for clarification. The media takes verses as well as speeches of scholars out of context. So if you want to have the clear picture watch the whole videos not the edited portions of that as the wikipedia is presenting just to degrade Islam. I guess you will only believe in what you want to believe. You feel the whole world is a "Zionist" conspiracy and Islam is 100% right and all others are 100% wrong. No matter myself or anybody else provides any amount of proof it will be discredited since they don't align to your views. It is ok for Dr.Zakir Naik and others to degrade other religions but not ok if there is any criticism of Islam in anyway by others. Grow up my friend. Anyway here is another link just search online and you will find may links like this. PS: Thanks for inspiring me to write this hub: … rn-Nations I hate to say "I told you so," but.... Out of experience comes good judgement. Please give me some more time to learn(maybe a few decades)..LOL Edit: Dingdong even if religious I now feel reason only works with "reasonable" people. LOL Well, I have given up with people like him. Now - I just make fun of them and subscribe to the view that I am 100% certain there is no such thing as whatever it is they are 100% certain is right. Drives them insane... as you have seen. Well his initial post where he compared different religions (including verses) seemed like a scholar but later his inability to understand other view points started making me doubt whether even the original posts were based on his own reading/understanding. Anyway I guess by the time I get wise like you I would have people cracking these jokes at me. That would be me actually lol I did point out earlier that he had been cutting and pasting arguments that he had taken from elsewhere - these were not his own thoughts or words. But I guess that is OK if you are doing it in allah's name..... Well I got into the thread from the middle and maybe I should have gone back couple of pages where you had already mentioned. I know you have a lot more experience and must have dealt with many folks to figure out by now. Btw it was meant to be me(how long it will take for me to become wise since I am 26 now) and not meant for you or anyone. you can laugh as much you want because you are funning guy at all Isn't it one thing all religious people do alike? No one is degrading other religions, rather we are just showing the both sides of the picture. If i am standing on a cliff and getting amazed by the beautiful landscape and suddenly an innocent child comes near the edge while running unknowingly what a cliff is, what the edge is, what the pain is and what the death is??? You tell me is'nt it my duty to hold the child right there, is'nt it my duty to correct the child. If i let the child fall off the cliff, does not his parents blame me for not stopping him. So, the clear pictures are presented to you and now if you want to jump off the cliff and die then go ahead, your choice. The clear picture is that all the prophets are messengers of god, all are equal and no person should try and convert someone into his religion as both bow to the same one god. Their message has been the same and you have quoted these before. Even if I change the name from the Vedas to the Zen Avistha to the Quran - the message is identical. Ekam evaditiyam “He is One only without a second” -The Holy Quran Na casya kasuj janita na cadhipah “Of Him there are neither parents nor Lord” - The Holy Vedas Na tasya pratima asti “There is no image of Him - The Holy Avistha Have changed the names, can you find a difference or are these truths identical. God does not age with time as we humans do, his message is the same from the beginning of time as he is timeless.The prophets or messenger come to reiterate the same truth . Prophet Muhammad- "salla allahu alayhi wa sallam" meaning “To your be your religion, to me be mine.” Message is by the same ONE God-Allah and Message itself bears some similarities at certain points but not at all points. Take for example the message of following the final prophet which is there in all other religious scriptures and not in Qur'an as Qur'an itself was revealed on the last Prophet. The message of all prophets is that there is this super entity which is all powerful, exists in everything and has all knowledge. Being one with this entity is our true nature and it is a state of absolute bliss which we all can experience and is our true home , from where we and everything has come and will go back to. Agreed, but the message does not stop here. It goes on and commands you to follow Prophet Muhammad (peace be upon him). I am called prophet by many and my book is even ranked over editions of the Holy Quran.No one commands me except god. For me all the prophets are very great and equal and they have exactly the same message. This is going back to the finger pointing to the moon or the message and the messenger . Stop focusing on the finger or you miss out on the glory of the moon, similarly stop focusing more on the messenger than the message.You miss the point. Please show me the difference in the philosophy of different religions or even saints? must be many gods according to you. The biggest difference is related to the implementation. ISLAM gives you the right path as well as a way to implement that right path. No other religion on earth gives you these amazing details, take for instance. THEFT which is forbidden in Christianity, Islam and Hinduism (that's the right path). Now further only goes Islam and teaches you the way how to stop theft indivisually and globally. The step wise explaination is as follows. (1) Islam guides and instructs not to become thief and do not steal. (2) Islam guides and instructs about ZAKAT (charity) which is a minimum amount, 2.5% of the prescribed quantity of Gold or cash equivalent accumulated for one year. This amount must be given to poors and needy (a list of these kind of people are also mentioned) per lunar year by each and every rich person of community. The collection and distribution of Zakat can be done on government level if there exists CALIPHATE and CALIPH. (3) After getting ZAKAT, if someone steals then comes the punishment of chopping off hands (the punishment is so sever that if a thief hears about it, at once starts thinking thousand times before robbery) Imagine, if you implement these steps today, the poverty will be eradicated from the whole world. Even if only the 10 richest of the world, whose budget is more the the 3rd world countries all over, start giving ZAKAT there will be no poor on the face of this earth. Why aren't muslim countries doing well then - in fact, why are they doing so terribly? You'd think life would be a paradise in your brotherhood countries, since you seem to make it sound as if following Islam is a cure-all. What's the state of education, status of women, poverty in islamic countries? these Islamic countries are name sake Islamic countries, built after the destruction of Caliphate in 1922 by the hands of Christian Zionists. Now each of these countries were then given agents as Prime Ministers and Presidents which are called HONORARY MASONS in the language of Freemasony. Look at Africa in the world map. The irony is that they have divided the Muslim territory of Caliphate merely by using a ruler and pencil, drawing straight lines. So, these countries do not possess the complete Islamic law as a whole and the foremost evidence in this regard is that these countries are divided. In contrast, Caliphate (Islamic state), has got no division and all the territories are run under one governing body; Caliph, which we do not find today. These are very minor philosophies.I am talking about God here.Do different religions worship different gods? Do good is the message of all religions- wake up. No religions tells you to steal or injure someone.All religions are equally good is what you need to understand.They are teachings of great masters who represent the Light or God. Dear! I am not trying to convert you at all, rather i am presenting you the things. I agree all the prophets (peace be upon them all) are equal and except the last prophet all the other prophets emphasized upon following the last Prophet Muhammad (peace be upon him) as he comes. So, when your Hindu Scriptures is saying that and you do not follow this commandment of your scripture it's your fault, not mine. I think it's very clear to you now and needs no further clarification I am enlightened and take direct guidance and orders from God, don't need any prophet or any religion. The prophets are guides who guide you on the path to walk, one must become like them. Now Allah told me to write and show humanity the oneness in all religion and his prophets as ugly wars are happening in his name which really irritates him. Allow me to stop you from falling over the cliff. Open your eyes, let go your ridiculous notions of muslimism and avoid the inevitable conflict with the other religionisms. You can stop yourself from falling. It is not too late. It seems there is some magic in your glasses which is not letting you see the clear pictures and kept you in delusion for years but i think there is a little spark in your heart which will ultimatley revert you back to ISLAM you will be welcomed. It can be argued that you are the one living in delusion and self-propaganda. How many humans are there in the world and how many of them happen to be muslims? It seems the "truth" wasn't so true. Wouldn't all this time (1400 years) have been enough to have made non-muslims see and accept the "truth." The fact that, they continue to follow their own religions -- proves the point that there is no such thing as "the truth" that you speak of. I don't agree that just because all have not accepted "the truth" then it goes to reason that it (truth) does not exist. If that were the case ALL would accept it. Or,conversely, ALL would reject it. The reality is, that the "truth IS out there", and it's up to each individual to find it. Unfortunately, today, truth has become relative for most people. Absolute truth is just that, absolute.In other words it stands alone. Being believed, accepted, rejected, denied or ignored does not change a thing. It just IS. Of course, I am not speaking of, (or for), Islam. Whether the "truth" exists or not --- no one belonging to any one religion can state with certainty that his/her way is the "only true way." That attitude has cost many lives in the past, would continue to cost lives in the future. All for what? God? Why is it that goodness isn't limited to one group of people if they are the only ones to whom "truth" has been revealed? To me religion is my own personal matter -- and I don't like someone preaching to me and sitting in judgment on my religion. Its none of their business. They've been given no divine right to do that. Who is preaching to you? You mean outside of HP? As I often say, these are mere words on a screen. You read them with your own prejudices. What one writes as a light hearted comment, another will take deep offence to. Others opinions/beliefs are just as valid as your own, and vice-versa. Take what you want, and give what you want.Don't blame others for that. I wasn't talking to you - if your response was based on my post. Are you a Muslim??? not even for Atheism ? religious response at many times come as a result of the certain language Atheists use. it is like religious people are trying to stop the revolutionary movement of absolute materialism thinking regardless of who is right and what are the intentions of both sides , if a side uses the certainty language he must expect a similar response (which applies for both) LOL Absolute materialism thinking? Yeah right. The only reason you say you have the truth is because some atheist said there was no god first. Oh - wait a minute - that is not possible. Guess you must have started by saying you had the truth. Why do you guys always resort to semantics? Atheists are no more or less materialistic than anyone else. So - best to try a new argument. Mark- That often seems to be the issue. I have seen the moment I say I am not sure if there is a God and I don't even say this with a certainty and lo behold I get lectures in ethics/morality. Somehow not being "religious"(according to them) makes me less of a human or lacking in the ability to spiritually progress. Isn't it possible that a human being can internalize what is universally good or bad and what is relatively good or bad with/without religion? Even in this thread there are certain people who start with the assumption that there way of thinking/beliefs is the only way and then somehow there idea of only one life makes it imperative on all of us to choose there "only" way right here right now. I mean they feel that this is the only important religion or way to be followed as of now or for eternity. And then there are others who feel they have been listening to "God" and somehow have a different take but then there own idea of "self importance" seems equally inadequate. Anyway each to his/her own. As long as somebody doesn't tell me that "you will go to hell" I am fine with there beliefs. Have a good day everyone I said absolute referring to atheism as part of it people in some aspect are two groups : those who have some religious or spiritual thinking and those who completely deny them I know materialism could include a lot of religious people I might be material in some ways so don't get everything wrong , would you ? The attitude which you are talking about cost many lives in the past, present and future as well BUT not from Muslims' side. It was, is and will be from the side of Freemasons, Zionists, Fascists. The World War III will be initiated by Zionists (with Christian allies) against Muslims just as they did in WWI and WWII and Muslims will face sever caualties and losses. RIGHT man, you are DAMN right! It seems that you will also become a Muslim in the near future because as prophecised both in Christianity and Islam; after the ARMAGEDDON-WORLD WAR III, the world will become totally aware of the hidden agendas and propagandas of Freemasons and Zionists against ISLAM and innocent human beings and there will not be a single human who will be a Non-Muslims, everyone will happily accept ISLAM as the ULTIMATE ART OF LIVING ON EARTH. So, get ready, if you survive in WWIII, you will find yourself as a Muslim after that. Regarding the CIA references given by CIA for gender population is totally wrong and tottally oposite to authentic sources. Sources like U.S. Department of Justice Federal Bureau of Investigation U.S. Senate Judiciary Committee and some others EXCLUDING CIA because CIA has got the worst reputation for their false reports. Take for example, the report of nuclear weapons in Afghanistan and Iraq, after invasion no nuclear weapons found and the CIA reports were just used to invade for killing and buthcering innocents. Also at the end when Bush admitted his faults in his last speach (during an interview), the CIA did not publish any report for Bush to be the number one terrorist as they did with Osama. Where is CIA now??? why Bush is not trialed for fullfilling his sadist desires in Iraq. Bush admitted and was sorry that there were no weapons of mass destrucition in Iraq. That's how CIA misreportS and is used for Zionists agendas agains innocents. There are hundreds of other examples on false and bogus CIA reports. they are two different Physicological attitude toward people , life , religionists and religions as well as what is happening generally in life and congrats for the 100 by the way That's a question that should be asked of you - how old are you seriously?? Most of the muslims I've encountered spouting this BS are 16 - 18 year old kids. You must be one of them - lol!! please dont call me sir, i am not a scholar. I am just an ordinary Muslim. When we see religions are dividing us, it's not the religions rather some mischief mongors who do it for personal gains. I repeatidly tell people to read your scriptures in context and then you will realize what's true and what's false. For comming together ther must be a central point around which all religions can sit together. There must be some points (not all) to which all religions must agree. Now if you analyse, there are many things which are common in all the religions like "dont be adultrous, dont rape, dont loot, dont decieve, dont gamble, dont drink, dont have pork, dont have clothes of opposite sex, maintain modesty in clothes as well as hearts etc etc BUT the most basic commonality in all the religions is worship only ONE God and Prophet Muhammad is the last and final Messenger of God. This bottom line is as important as 2+2=4. If you do not agree with 2+2=4 then you can not become a good mathematician or engineer. Similarly the ONE God and the final Messenger concept is there in all the religious scriptures whether it be Christianity, Hinduism, Sikhism or Islam. Please have a look at my prevous posts for valid references from Bibles and vedas. Also. Now at least, come to this very basic commonality that all the religions have. All the religions agree that there is none worthy of worship accept ONE God and Prophet Muhammad (pbuh) will be the last and final Messenger, so whoever finds him, follow him. If there own religions are directing them towards ISLAM, QUR'AN, ALLAH, MUHAMMAD (PBUH) then what's the matter, why they deny this very basic and clear cut directions of their scriptures??? Even though Bibles, Hindu and other religious scriptures have been altered so many times in history yet the players were unable to remove these facts from these altered scriptures, is it not amazing, is it not a miracle of Qur'an, still preserved for the last 1400 years in it's orginal language, letter by letter. Qur'an is not the property of any Muslim rather it's a way of life for the whole of mankind as the previous scriptures were for the people of that time that is why the prophecy of following the last Messenger Muhammad (pbuh) is mentioned in all the previous scriptures. After this intimation, you agree or not, that's totally upto you and them. No body can force you. again what you are saying are related to the ideologies of the followers which are not there in their scriptures Prophet Muhammad (pbuh) did not say your religion be true and me to mine rather he said to the whole of mankind "OBEY ALLAH (One God) AND OBEY HIS MESSENGER (Muhammad pbuh)" Read different philosophies in order to understand whats in their scriptures. Prophet Muhammad- "salla allahu alayhi wa sallam" What do you think this means.Muhammad was not a fanatic, none of the prophets are fanatics.They understand the oneness of all. Someone who thinks "HIS PROPHET-HIS RELIGIONS IS THE BEST." = FANATIC. Drop the my in order to see the truth. "Behold but one in all things, It is the second that leads you astray" Kabir. So you are entermingling the subject of Philosophy and Religious Scriptures. For your kind information, none of the religious scriptures state to learn / read this scripture according to this particular philosophy. Scriptures are self explainatory. Take for example the following famous verse from Bible. ". Regarding me, i am nothing, i am just a lay man, my past was just a drop of sperm and my future is in the clay, you know very well i am not a fanatic as i am showing you the verses from these scriptures (forget about Qur'an and Islam) which themselves testify that there is no god but God (ONE) and Prophet Muhammad (pbuh) is the final Messenger of God. So where is fanatisim??? In me or in these scriptures. These scriptures themselves ordering you to follow Prophet Muhammad (pbuh) and take what he gives you. I quoted several verses from Bible as well as Hindu Scriptures mentioning clearing what i am explaining you. So if some Christian, Hindu, Sikh, Atheist or Zionist does not agree with this basic notion of ONE God and the LAST Messenger (Muhammad (pbuh)) then it means they also do not agree with their own scriptures and just practice and preach the falsehood. In my whole replies especially to you and Sandra i did not quoted any Qur'anic verse or Hadith rather i quoted your own scriptures and showed how these Popes and Pandits hide these kind of verses from their scriptures and only preach what they like for some penny gains. The biggest problem in this context is that the ordianary muslims, christians, hindus, sikhs do not read their scriptures at all, most of them have'nt read even a single translated verse ever in their whole lives. So now, if i or some one else comes and delivers the true context based interpretations, this becomes inacceptable for some of them and label us as fanatics If you believe in Popes, Pandits or Mullas OR that you believe in what the scriptures tell you to do, the choice is totally yours. ". Thay are one ,what you call the right expantion- then i come to the right explaination of the the above mentioned verse that Jesus (pbuh) was saying that he and Allah are one in profession, the profession of delivering the true message. Is very wrong, you do not understand Jesus or Allah . I do no 'stringing.' lol. I simply am not that mean. (And if it seems like it--keep in mind it is always only done with slight humor attached with those I think can handle it.) But doubt I have 'answers' anyway, so OK! I dont belive on religions so I cant write anyting..Islam ,Hindu.... You have to have a reason for not believing but if you do not believe on religions then i must present ISLAM to you as the ultimate way of life as ISLAM at first, claims to be the ultimate way of life which encompasses Islam as a religion as well. Usmanali81 - you have clearly come here to 'prove' that your religion is the only true one and that all others are either wrong or superseded by yours. Just so we know the benefits of your religion, please provide a brief description of what awaits a christian, a hindu and an atheist or agnostic after death. Please contrast this with what awaits a muslim after death. Please tell us in your own words, without reference to scripture. Thank you for your time. For Both, Muslims and Non-Muslims alike, there is another life which is eternal and that's the thing which awaits us. Death is actually a transition to another life. There, to live eternally, are two places, Hell and Heaven. So, after getting the message and signs from Allah, we are bound to follow him and his given way of life - ISLAM which was also the way of life for all the preceding prophets and their companions. And how do you know this is true, except by reference to the Quran? hi Paraglider , I hope Usman would execuse me because as I muslim you simply submit to the creator you start by pondering creatures , believe in a power you read the books and have faith faith is something you believe but without seeing God this faith becomes as a reality as much as you ponder the world , study it and think about it best reagrds In other words you can't do it without begging the question. You can't simply submit to the creator if you don't think there's a creator. In other words, you can't start without having already started. Therein lies the irrationality. Dear Paraglider, Qur'an speaks about future in several places, off which almost 80% have become proved now, by established science, for instance, consider the following scientific facts in accordance with Qur'anic Verses. Regarding the origin of the universe: happening by “chance” is nill. “Do not the Unbelievers see that the heavens and the earth were joined together (as one unit of Creation), before We clove them asunder?” Qur’an Ch 21:V30 Regarding the impermanence of the sun’s existence:. “And the Sun runs its course for a period determined for it; that is the decree of (Him) the exalted in Might, the All-Knowing.” Qur’an Ch 36:V38 Regarding the nature of the universe: Edwin Hubble, provided observational evidence that all galaxies are moving away from one another, which implies that the universe is expanding. The expansion of the universe is now an established scientific fact. “With power and skill did We construct the Firmament: For it is We Who create the vastness of Space.” Qur’an Ch51:V47 Now, if a logical person ponders then he / she will come to the conclusion that "If Qur'an is 80% in complete accordance with established science then the remaining 20% which are not yet proved by science, for example, Heaven, Hell, Life after Death, will also be proved as correct and perfect in future where science becomes more advance. Dude - it is really bad form to cut and paste arguments taken from other websites word for word. … 71844.html Yes, of course but it's good to copy from a website which has no copy rights, for example, I was more talking about you trying to pass these off as your own arguments rather than the copyright aspect. I know your religion does not encourage you to think for yourself, but still...... Very bad form. And rude. Mark - there are a group of guys like him on another forum I know of. They have lots of such cut-n-paste items saved on their PC. They spend all their time trying to prove Islam as the greatest religion ever, the one and only truth, etc. Its best to ignore folks like him. I know - I started a thread about this recently after finding a christian website that suggested people cut and paste from their site to use as arguments against people who choose not to believe their stuff: Which goes to one of my core arguments against most religions in that they discourage people from thinking for themselves. Not really sure what one would hope to achieve by doing this. Mark! what a funny guy you are For your kind info religions have books which are to be followed. Only in ISMs you can do and think anything you want, whether kill, butcher, rape, sex, loot, raid, plunder, gamble, decieve drink, ............ the list does not seem to end LOL - Yours is just another ISM - which allows lying apparently. For your kind information - I do not lie. I do not take other people's words and pretend they are my own. You mean you have had an original thought? Here I thought there was nothing new under the sun! How wrong I was. Seriously though, none of us can claim uniqueness when it comes to language. Everything we know we learned from others.In that sense, we don't own our thoughts/words as its originators. Speak for yourself dj. I am not a religionist so I am allowed independent thoughts once in a while. That is not the point I was making though. Yes, agreed. Even in creation, no body is able to create a unique thing that we have never seen before, for instance, scientists create robots which resembles humans, insects or animals already created by ALLAH. hhmmm, i did not pretend the references are my own. I openly admit it and giving an authentic reference is a good practice. You seem to be an atheist. Now if i say something against atheism, even with valid proof, it will not matter at all because i am a lay man and if i give you some valid references of some well known personalities with their vast vision, experiance and supporting evidences then it matters a slight. Now, if have something nice to say on it then come to You cut and pasted something and gave no reference. Only after I pointed this out did you admit they were not your words. I have nothing nice to say about your ridiculous statements on the other thread.I am not even sure what you are saying here either. "valid proof"? What is that exactly? consult dictionary for it I don't have access to the dictionary you appear to be using. Your ignorance of science and language is quite astounding. First of all, i do not cut rather copy and paste. This action is done only for the valid references. It's very legall and you can also do it. Adding a link to make a point of reference is not what you are doing. Legality has nothing to do with it. This is a moral issue. You are cutting and pasting other people's words and attempting to pass them of as your own. This is lying. Isn't that a punishable offense against Allah? I've seen all that pseudo-scientific stuff before, in a printed book claiming to prove that Islam predicted modern science. Unfortunately, vague phrases that can be interpreted retrospctively to have been prophecies carry no weight as argument. What you are saying is that the Quran can be said to be in accordance with rigorous scientific discoveries, therefore where it diverges completely even from the field of scientific study, it should be taken to be absolutely true. Sorry, but your argument doesn't stand up. If there is a choice between two things to eat A and B. And you have to choose only one of them to survive. A is 80% pure B is 20% pure Which one will you prefer ??? Pure what? Pure drivel, maybe. Look - if have a box of clock parts and I shake them all together, will they turn into a clock? No of course they won't. But that, and all other baby metaphors, do not constitute sensible argument. Apart from quoting scripture and other people's leavings, you've not said anything yet to support your case. Imagine, without typical metaphores, how boring the lecture of a teacher will be, how boring will be the speach of Obama, how difficult to make a child understand, how difficult to explain the theory of reletivity Therefore, relevant metaphores are a MUST to use for a good writing and speach How pompous and arrogant of you to claim that. No wonder tolerance of other religions doesn't come naturally to people like you. i am very tolerant, i did'nt kill you yet Rajabilil and others on here who are supposed to understand Islam, please check this out: and tell me what you think. Thanks Also click on Please refer to the books written by NON MUSLIM celebrated Historians. I stressed on Non Muslims because most of the readers do not agree with the Muslim Hisorians. In the near future i will be writing a hub (INSHA ALLAH) mentioning some of the beautiful, informative websites worth visiting because most of the non muslims and muslims alike access some wrong websites which does clearly delivers the true message of Islam and these kind of sites are just injected into the NET for maligning and degrading ISLAM and promoting PRAGMATISM (successor of ATHEISM), CAPITALISM AND ZIONISM. I appreciate the good side of Islam, Christianity & Judaism. I understand the hypocracy, violence and hatred that have occured, and will continue to occur--there is only so much I can do. I just want to save a life, help others out, and maybe teach someone peace (once I learn that abstract concept myself, in it's most pure state [but even then, what is that?]) Religion is how you translate it, I don't think there is any "religion of peace", since humans are all different, translate religion different, and thus violence may occur (sometimes on global, genocidal levels). I'm not understating the seriousness of religious violence, I just understand why it occurs, and the psychology behind it. A calm mind acts quicker, swifter and more precisely. Selam what do u mean there is no religion of peace...as far as i'm concern there is no religion that does not promote peace...all religion promotes freedom, kindness and good deeds...it's just us as an individual take this thing for granted which explains the violence and hatred amongst each other I fail to understand why people fight in the name of God and religion. God must be laughing at all of us thinking what kind of jokers HE has created. Religion is nothing but a road map to reach the Almighty and there is nothing wrong in having different road maps. We have all the time in the world to say our map is better than his road map. Time we all grow up. Too many roads to choose from. Trouble is, they are ALL dead ends. Even if they could reach the "gate", they will find it shut. Jesus is that gate, and many will not be able to go through. (for obvious reasons). Jay sometimes it might be the case but sometimes people need to discuss with love to have a strong faith both cases may coexist , I hope we would be from the last type thanx Yes, it's time to grow up and do not count 2+2=5. Dear, If ISLAM claims to be the final word of God and Prophet Muhammad (pbuh) is the final messenger of God whom each and every human being must follow then their is a reason for that and the foremost reason is that the same message is prophecised in alimost all ohter religious scriptures and they instruct their followers to start following ISLAM if you find it. So now, what's the problem in accepting ISLAM if your own religions are directing you. But FSM came after islam. Surely this is the true religion to follow? Did you try what I suggested? You will feel much better afterwards. You probably won't be afraid of gay people any more either. We dont get affraid. Remember, we dont join army to earn homosexuality and more more of course some diseases are not only becauce of homosexuality And therein lies the ridiculous contradiction of your irrational beliefs. Islam is another religion of hate and intolerance. That is why I asked the original question. You said the people were forbidden. Don't see how you can do that. Do you think homosexuals should be punished? you may need to read more and write less do not just repeat what people say where did I say that qute me please no if they didn't do it in public and for myself , honestly , I don't either love or hate them i thought that up all by myself thanks. Unlike yourself - I can think for myself instead of parroting stuff from a 1600 year old hate manual. Try thinking for yourself instead of just repeating the stuff in your book. You might see how irrational you are being. If you come to my country (Indonesia), you'll see the majority of Indonesians are Muslims, many of the Muslim women wear veils, with variety of clothes; long pants, skirts, or long dresses. We go to school, study in university, get married, and raise our children. We do what other people all around the world do everyday; go to work and earn some money. None of my family members thinks of blowing him self or hurts others who aren't Muslims, what for? It's busy enough taking care of our own families, why bother doing irrational things such as hurting others? About homosexuality, actually that is not the only thing forbidden in Islam. Muslims are also not allowed to drink alcohol, pork meat, or engaged in sexual relationship unless they are married. Whether one likes it or not, when one embraces Islam, he must follow the rules. That way, he can show God (Allah) that he has become the good follower. BUT, God (Allah) says in Quran that there's no force for anyone to embrace Islam. Being a Muslim or not is a man's choice, even those who have embraced Islam the first time must never force others to do the same, let alone hurt them. About some Muslims who prefer do the 'harsh' ways, I think the problem is not as easy as calling them 'terrorists'. Even us Indonesians had to fight over our freedom for 350 years before the first president proclaimed Indonesia's Independence in 1945. Long before the year, we fought Portuguese, Netherlands, UK, and Japan's colonial governments and troops who came to Indonesia and tried to rule us. I think the same thing may be happening to the Muslims in Iraq, Pakistan, or Afghanistan right now. Maybe it's because we're seeing the battle now, that we address them as terrorists. Perhaps, hundreds of years later, our grandsons don't even recognize any battle that has ever happened there because the countries have become a safe, prosperous, free places to live. All in all, I think it's very rude to accuse and generalize that all Muslims are 'terrorists' and Islam is 'another religion of hate and intolerance'. Muslims are just like any other people in the world who want peaceful life to live (so are the Christians, Buddhists, Hindus). The rules in Islam are set only for the followers, when you're a Muslim you should obey them but you don't have to if you're not. NONETHELESS, being a Muslim is choice, not a force. Forgive my lack in English. I think you should read a few of the other posts and threads - see how many of them are clearly showing hatred and intolerance towards gay people. They do not seem to have a problem with people eating bacon sandwiches, but the gay thing is obviously intolerant. And your English is fine. Just like your attitude towards religion in general, 'twin.' Like I said - if you have nothing to say why bother? I mean - I am up for a good argument, but your inane one liners are unlikely to do much for me. Try saying something - go ahead - I will argue with you. Or does your religion rely solely on antagonizing people? Do you even have any opinions that are not negative one liners? When the Creator wants you to have women then why you run after GAYISM ????????????????????????????????????? Maybe your creator is a homophobe like you? so much people say islam is old and intolerate,here I found not that evidence but people who never know islam itself Posting in an epic trainwreck thread, as per usual. See you guys next week! Aren't you glad you suggested a religion forum? I am, there are gems in this forum, mostly threads that don't have ten pages of back and forth arguments! It never ceases to kill me how muslim extremists are so eager to blow themselves up. I mean, here's the rest of the world taking medical checkups, eating low carb diets, exercising, doing therapy, yoga and all what not just to keep alive, and these guys just go along, strapping their chests with loads of C4, and blowing themselves into smithereens. It gets me all the time. Those who blow themselves up killing innocents can not be justified at all in Islam. But now consider the case of those whose, innocent mothers, daughters, sisters and wives were raped, tortured and killed ruthlessly in front of them after tying them up, whose respectfull fathers were beaten to death in front of their eyes, properties and belongings looted, houses captured and destroyed, tell me what will be their state of mind??? Do you expect them to roast a lamb and distribute candies to Israeli and American soldiers???????????????????????????????????????? I belong to a Muslim family, never once has my parents disapproved my being friends with people belonging to other religions or castes. I may not be the perfect Muslim, but I do pray & read the Quran & I have yet to come across any statements that encourages killing, hurting or even verbally abusing any individual be it Muslims, Jews, Hindus, Christians etc. The Quran states that humans hold the most prestigious position among all living beings. The extremist groups who are spoiling the name of Islam are not Muslims in any sense of the word! They are just against humanity and they will duly suffer the consequences in life or at the day of judgment. It saddens me when people compare & fight over religions and nationalities. No religion promotes such profanities, it is the people who hav wrong perceptions & we are all accountable for what is happening in the world today. If we hope for world peace, we all need to join hands & come together for fighting against extremism and all the causes that are promoting differences among all. I challenge that we can not fight extremism by ignoring the fact and influence of Zionism the world over. Do you know what Zionism is??? The extremists which people talk about do not have any businesses, jobs or bank accounts then who is providing them MONEY, FOOD and WEAPONS??? Think about it. Now we are getting to what your religion is really all about. Just another ISM. I did not ever say to become ignorant of these issues, i was merely stating my opinion regarding the religious debate. People everywhere hold wrong perceptions about our religion, If we start calling them names as well, wat would be the difference among us all? Our religion teaches us the msg of peace & patience. The same qualities among many were practiced by Mohammad PBUH. He did not seek revenge from his enemies even after He gained victory over Makkah. I am well aware of these extremists & the propaganda surrounding the whole Islamic teaching concept. either way we Muslims are being targeted in the name of war against terror, wat about those poor innocent people who have been deprived of their homes, properties, even their basic needs. People have lost their relatives, family members etc. Its not that easy to start fighting or conducting a war against anyone, everyone overlooks the after effects of such issues. you are most welcome and by the way i or other muslims did not created the names like ZIONISM, ZIONISTS, FREEMASONS, NEW CONSERVATIVES etc. These names were given by themselves. If you have any beautiful names for them, do not hasitate to suggest them . smile And here comes the megalomaniac again, mohit get back on your pills! Truth doesn't change because you cannot handle it. No truth here to handle. Give it time, you will understand. Typically condescending. You started your crap again. Just pointing out your propensity to let your ego run the race. Speaking the truth.If you had written a book got ranked over Holy Bibles, Holy Qurans,top 10 poetry, top philosophy-Religious, top 10 spiritualism and mentioned it - it would be called truth.Only a foolish megalomaniac , zealot would come and abuse you in case you were really that person. Here we go with the megalomania again. You are the meglomaniac, the idiot, the zealot, the fool, the swine. He he! You are as weak as piss mohit. You lose your cool pretty easy ay? ASSHOLE go tell this to your pop. Beautiful. Glad you liked a dose of your own medicine- hope it feels really nice. Nothing going on here.You speak, you say who you are! i just want to laugh here (not on any particular) ... please let me ... Mohit and Earnest! Can't you two bear with each other. Earnest really have some big problem with Mohit. I don't know what's that??? You don't? Try reading this. mohitmisra wrote: earnestshub wrote: mohitmisra wrote: Speaking the truth.If you had written a book got ranked over Holy Bibles, Holy Qurans,top 10 poetry, top philosophy-Religious, top 10 spiritualism and mentioned it - it would be called truth. Here we go with the megalomania again. You are the meglomaniac, the idiot, the zealot, the fool, the swine. The list grows... usmanali81 and me are having a nice debate, kindly stay out of it as you don't understand what we are talking about. Just letting you see yourself! Have I lied about my book rankings that you call me names? If I had not written a book and got ranked and then you called me names I would accept it but why should I take your abuse when I am speaking the truth? I have never come to your business forum and abused you. This is a religious forum, i don't believe that has anything to do with business, unless you are trolling here for sales of your book. And I am a very highly ranked religious poet/philosopher is simple truth.Means I am very qualified to be here and express my views and I do not lie. Your ranking is negligible except on two sites, your poetry is infantile, and how much you know about nothing astounds me. anyway you wanna take the discussion to some place and he wants to take it to another don't you get it he is saying , I dont need to know what they mean because they don't worth that and we are called Muslims ya Marksist My thought is that Islam is as good as any other religion. It is only a group of people who are earning bad name to this religion. Recently there was some "Racial Discrimination" against Indians in the US and Australia. We cannot say all Americans or Australians are IDEOTS or Terrorists because of these incidents. South Africa and even the US have witnessed the war of supremacy between the BLACK and the WHITE. It is only a group of people. Dear Mark! You are really a funny guy Leaving right now as i have to do some shooting practice Wa salam ( Peace be upon you) You shall not murder!!! and brain wash kids to die for you.. Thats all Ive got to say about that only if some one wanted to kill or control you violence is solved with love but with violence sometimes "These wars are justified or are they lame? It is with love and not terror does the One get tame." Don't click on the picture. It is a spam journalism site. If you don't want any unwanted cookies or bugs- I would stay away! What a crappy move Guidebaba!! Many wars have, and still being fought in the name of God. Who-evers name it is done is still wrong! Any god Any man Wrong Probably you are right about others reading and making up there minds(if not the intended target). I will see about how I feel and decide whether to participate. I sometimes feel drained when the point I am trying to make doesn't seem to go through. Thanks for the encouragement. My pleasure - he will be back tomorrow after terrorist training school. usmanali80 Wrote the following Dear Mark! I respect you as an elderly man. usmanali81 why respect someone only because they are elderly, which Mark is not by the way. I agree with Mark, you are rude in the extreme! Not all people are controlled by some invisible entity so that they will behave out of fear. Some of us have the capacity to control and deal with our own processes and do not need to be told that we are somehow less than you because we have chosen to think for ourselves. I have nothing against any religion including Islam. In fact I do not believe in Religion. It is the single most destructive institution that man has ever created.It has divided people and most of the religious leaders are nothing but criminals. we don't need religion to guide us.. we need perfect rules to guide us , don't we ? people are not perfect Religion isn't perfect either - in fact, some religions are more dangerous than people themselves. People who blow up other people state they do so because of their religion and its teachings - don't they? Why is it that they interpret their religion differently than some others following the same religion? it might be because they would act bad with or without religion interpretations it is their nature , don't you think ? they may fight for the ideology if religions'v never existed I agree, some would fight for the sake of fighting. If it is in their nature and religion doesn't have to do anything with it --- then why claim one religion is better / perfect / the true religion / etc ? Just accept that they are good and bad people in all religions and the good shall go to Heaven and the bad shall go to Hell (if you believe in God). Why categorize some as "infidels" and condemn them and say they will go to Hell, etc? That's intolerance - don't you think?? I think may be because God wanted us to worship him by his way (simply not having partners with him) he may wanted to test us to know whether we would think our religion is better because of ego or because we are grateful to him a true religion is approached by loving God & people without seeking fame or anything else people should love eachother and show others the way of good we do this as we are grateful to whom created us and guided us to good people don't judge who is in hell or heaven as we don't know what in the hearts people have rights to God their rights to other people is included in these of God everything goes back to him And this apparently includes the right to F*** 10 year old girls. well , some aspects in life can't be taken , understood alone don't you think ? discuss the points I wrote before tell me where I am wrong instead of repeating specific points for your own purposes it is about faith no one of us was alive at the time of the prophet A TRUTH = TRUTH AND FALSE = FALSE So do not mix them, when Islam claims to be the final truth now, then their is a reason for that. The foremost reason is the other religions themselves prophecised Muhammad (peace be upon him) and instructed to follow him. So, now following the outdated religions like Christianity, Judaism, Hinduism etc is itself keeping our selves in DARK. Now you must come towards the light; ISLAM-The Final Art of Living for Mankind. So everyone should convert to Islam correct? They are obviously worshiping some other god and false prophets -correct? The prophets spoke different truths according to you-correct? If this is not called fanatical behavior-what is? This like god telling his left arm to chop his right arm off- madness. Please do understand all other religions believe there will be one more prophet after Muhammad if not a few prophets after him. Bingo. After getting the real true picture, everyone SHOULD accept ISLAM and if they don't, then it's their own choice and no body can force them. Now that's BINGO Not in this lifetime. Not even in the next though I'm very open and receptive to muslim people. Everyone can worship whatever they want and that's A-Ok with me. Not interested in your religion for myself. Sorry. It's ok, certainly you can but the next stage of life will be based on punishment and reward. No second chance will be given in the form of new life from scratch. Not according to your prophet who was a wise man. Prophet Muhammad- "salla allahu alayhi wa sallam" meaning “To your be your religion, to me be mine.” Please listen to your prophet and stop making up your own stories and in the process make him out to be some fanatic. You are ruining the prophets name, he taught tolerance and not fanaticism. God belongs to all and not only to those who call themselves Muslims. For your kind info, "salla allahu alayhi wa sallam" means peace be upon him. It's not to your be your religion, to me be mine. And yes, God belongs to all and the message of ISLAM is for the whole of mankind not only for Muslims Qur'an, Ch 2-THE COW, V." Peace is what he wants , what all the prophets want. Live and let live-Mahavira So if god belongs to all of humanity including every religion then let people follow the religion they want to . Some Parsees say Zaratushtra was the first recorded prophet-does that make their religion greater than any other? Before that you had Hinduism which simply engulfed all philosophies-Hindus-Indus -the people residing by the river Indus. When you say one cannot compare Jesus with god then you cannot say all is Allah.In your case all is not Allah. Poor god no longer omnipresent. Bramha, Allah, Jevovah, Vishnu, Ahuramazda, Shiva... What’s in a name? A way to identify the same, Geography, language is mainly to blame. Your glory is such, Man asks for too much. Meditation or one pointed concentration is the key, But who says there is no fee? Names does not matter but when a name refers to a God with 10 heads and 50 hands and sun shining behind it, that really irritates as Hinduism itself is against creating images of God so why do these Hindus do it, it's their fault not mine. The first and the last prophet of the world does not make some one great. The greatness comes where all the religious scriptures of the world mentioned the comming of Prophet Muhammad (peace be upon him) in Arabia and instructed to follow him when you find him. That's GREATNESS, that's where the elders of other religions start personal jealousy and hide behind these verses by misquoting, misinterpreting the scriptures out of context to ordianary people. WAKE UP ... the world is near to end So why have mosques, aren't they equated with idols? The hands and heads are symbolic. You will have to remove All is Allah from your philosophy which is something you cannot do.If all is Allah then not only the prophets but every humans, animal ,thing is Allah. You have this philosophy but turn a blind eye to it and discredit other religions. How many times do I repeat that all other religions expect their prophet, do you really think Muhammad was Jesus who had returned or that Muhammad was a twin which the Parsees expect or that he was born into a Brahmin family, wrote and united the religions according to Hindu philosophy? NO Look at the one in all in order to understand truth, your religion or prophets is the best is non sense. Masjid represents the unity and disipline. It's not that we have idols there. Even some people have houses on top of Masjids and live there. Tell me which idol worshiper stands or sleeps on top of his / her idol??? So, Masjid is not an idol If the whole world were to be dominated by Islamists then, I'd guess the top priority would be to destroy statues of Buddha and other such idols. I am not advocating Taliban but the fact is if Bhudda was alive today, even he had destroyed these statues Nonsense it stand for the ideal man every human can become. Isn't it something physical? The Buddhas statues become idols but the mosques do not- how convenient. We enter the Masjid, the followers of Bhuddas could not enter a statue. Any way Bhudda also forbidden statues but their followers built them and worshiped, it's not my fault rather the followers' Its called respect and its just fine. So you are saying is all is not Allah who is limited in space and does not encompass everything.Buddha was great prophet like Muhammad , how would you feel if someone had torn or blown him up.? This my religion is the best attitude has and is only leading to ugly wars and it is not what Allah wants .This is your greed and your ego power trip which makes you say this. "Unto Allah is your return and he is able to do all things" The Holy Quran. Everything including every human comes and goes back to Allah and not only those who call themselves Muslims.Allah or Shiva or Jevovah is juts a name symbolizing the same great entity or God. This is as foolish as fighting over ma or mata or mai or mater or mother saying no only ma is correct all others are wrong. All stand for mother , its just a different name used by different languages. Yes, every one will return to Allah but Allah will not forgive those who associated partners with Him, who made images of Him, who did not followed the fullfilled prophecies regarding Prophet Muhammad (peace be upon him) mentioned in Bibles, Hindism, Bhuddism, Sikhism, Parsiism .......... list goes on and on The last prophet is yet to appear accordoing to the Christians, Hindus and Parsees ,why cant you understand that.? Sikhism was founded on the teachings of Guru Nanak who was considered as a great prophet by many and does not say Guru Nanak is not a prophet and that Muhammad was the last prophet.Which crappy books are you reading? They have The Holy Guru Granth Sahib considered as the word of god and is a compilation of different spiritual poets who praised the light and these poets belonged to different religions- Omkara- God is one, so beautiful, no fanaticism. Images and idols are a mark of respect for that particular saint or prophet who represent the light.They are guides who take you beyond to Allah -the Light. Mohit, Refer to the following which clearly prophecise Prophet Muhammad (pbuh) catagorically in Hinduism and Christianity (major religions) Guru Nanak, Guru Garanth Sahib, Osho and many others are not dwellers of Arabia but Prophet Muhammad (pbuh) is. So bored with this copy-n-paste. Are you typographically challenged my friend? Come on - use your own mind for a change. My mind is deadly sure about what is written in your books but the problem is you are not getting it. when you will get rid of saying 2+2=5 Lol - you don't have a mind to speak of. This thread is filled with reams of material you've copied from other forums/sites. So, where does that leave you? All that you've done on this thread is to display muslims in bad light to all those who've read this thread. You've come across as being intolerant and dismissive of anything and everything different from Islam. Hinduism does consider Muhammad as one of the great prophets but believes there will be one more who will be born into a Brahmin family will write and unite the religions something Muhammad doesn't fit into. a both in the ‘Panchgavya’ and the Ganges water (i.e. purging him of all time) Did the prophet Muhammad bathe in the river Ganges? Do you really belie people who follow the teachings of the Great Buddha or the Great Jesus Christ are wrong? Is Jesus Christ not going to return? Is the Maetrya or Buddhs not expected now? The prophet Muhammad has simply repeated these philosophies which were written a long time before he came on this planet and you have quoted from the Vedas and Avestha, truth does not change over time but is timeless like god. The prophets come and repeat the same truth when humanity has gone astray, when people abuse religions and stop following the correct path to walk. Guru Granth Sahib is the Sikh Holy book and not a saint or prophet like Guru Nanak or Osho. It includes great Mulsim poets saints like Kabir and Farid. Now tell me these great mystics were foolish ?. Dear Mohit, The Prophet Muhammad (pbuh)’ as described by Qur'an. Further if you read Bhavishya Purana: Prati Sarag Parv III: Khand 3: Adhyay 3: Shalokas 10 to 27 “The Malechha have spoiled the well-known land of the Arabs. Arya Dharma is not to be found in the country. Before also there appeared a misguided fiend [enemy] whom I had killed; he has now again appeared being sent by a powerful enemy. To show these enemies the right path and to give them guidance the well-known Mahmada .” This Prophecy states: : Surah Al Fi’l: 105: 1 – 5) (iv) Prophet Muhammad (pbuh) has been given the responsibility to guide the opponents of Divine Truth. Allah testifies the same responsibility in the Qur’an. (Al Qur’an: Surah Al Ma’idah: 5: 67) (v) The Indian Raja need not go to Arab land since his purification will take place in India after the ‘Musalmaan’ meaning the Muslims will arise in India . This is what is promised by Allah that Islam will not just reach India but will prevail all over the world. (Al Qur’an: Surah Tauba: 9: 32, 33; Surah Fata’h: 48: 28; Surah Saff: 61: 9). Muhammad [pbuh] too commanded in His last sermon to all those present in the sermon to spread on earth wherever possible, in order to convey the Message of Islam in the Light of Qur’an and Authentic hadiths as mentioned in a Hadith recorded in Sahih Bukhari: vol: 4 H: 667 (vi) The coming Prophet Muhammad [pbuh] will attest the Truth of the Aryan faith i.e. Monotheism and will reform the misguided people. This is what the purpose of Muhammad [pbuh] being sent to mankind as Messenger was and as is testified in: (Al Qur’an: Surah Ambiya: 21: 25; Surah An’am: 161 to 165) (vii) The Prophet’s followers will be circumcised. They will be without a tale on their heads, they will keep beards and they will create a great revolution. A similar message is mentioned in a Hadith recorded in Sahih Bukhari: vol: 7 H: 780, 781 (viii) They will announce the adhan i.e. ‘call for prayer’. Al Qur’an: Sura Ma’idah: 5: 58; Sura Jumu’ah: 62: 9 AND Sahih Bukhari: vol: 1 H: 578 (ix) He will only eat lawful things and animals, but will not eat pork. The Qur’an confirms this in no less than 4 different places: “Forbidden for you for food are dead meat, blood, flesh of swine and that on which had been invoked the name of other than Allah…”. In Surah Al-Baqarah: 2: 173; Sura Al-Ma’idah: 5: 3; Surah Al-An’aam: 6 : 145; Surah Nahl: 16: 115 (x) They will not purify with grass like the Hindus, but by means of sword they will fight the evil-doers. The Qur’an confirms this in Surah Baqarah: 2: 191, 192; Surah Nisa: 4: 74 – 78; Surah Taubah: 9: 111 (xi) They will be called Musalmaan. Similar Message is in Surah Aal-e-Imran: 3: 64; Surah An’aam: 6: 163; Surah Fussilat: 41: 33 (xii) They will be a meat-eating nation. The Qur’an permits humans to eat herbivorous animals in Surah Ma’idah: 5: 1 and in Surah Mu’minoon: 23: 21 =============================================================== Now,. For Mahdi, Muslims do not believe he will return or he will be the Prophet, no, not at all. It's only a prediction about a Muslim man among others named Mahdi who will lead the people of the world as a just and honest Muslim leader / Caliph near the end of time and during this time Jesus (pbuh) will also return (come back). Please do a search on avatars and you will understand Kalki is supposed to come now and and not fifteen hundred years ago. You are saying Jesus will return and at te same time Muhammad is the last prophet. so what will Jesus be when he returns. Of the ten universally recognized avatars, nine have already manifested whereas the tenth is yet to appear. It is important to note that the all the Avatars are earthly form of Lord Vishnu , who himself is eternal, unchangeable and immutable. specially popes and priests Didn't Muhammad repeat what had been said many thousands of years before him.The prophets come to reiterate the same truth.The truth doesn't change, its timeless like god. Yes, the truth remains the same. What you are talking about is the basic truth: Follow only ONE God-Allah. In addition to that there are several other things, there are several other does and don'ts which were somewhat same as well as different from book to book. For example, the prophecy as an instruction to follow the last and final Messenger Prophet Muhammad (peace be upon him) when he comes is there in almost all the religious scriputes of the world but is not there in Qura'n because Qur'an itself was revealed on Prophet Muhammd (pbuh). So, the basic message is the same but depending upon different situations, circumstances and mental levels of the people of different times the particular books were revealed and for the people who are near the end of time, the book is QUR'AN, for you as well as for me. Follow the truth of the messengers which is the same.Have respect for the all the prophets and religions equally. For example, the prophecy as an instruction to follow the last and final Messenger Prophet Muhammad -how many times do I have to repeat that most geat relgions are waiting for the last prophet who will unite the religions as all are children of god. You agree he spoke nothing new so live and let live. Would you try and teach Muhammad about god? My work is being ranked in the same league as the Holy Quran, dont you think you can learn the truth about god from me? Muslims respect all the prophets more than any other. Regarding the prophecy, it had been fullfilled more than 1400 years ago, i mentioned the verses of Hindu Scriptures to you in detail. So what are you waiting for, Antichrist??? You are very thick skinned and fanatical.Please read what I have written about different religions expecting their prophet now as I am sick and tired of repeating it. Why don't you write a book and get ranked over the Holy Quran since you believe you have a better understanding about god than I do.? Since all the prophets spoke the same truth why in the world should everyone follow Muhammad? You agree they spoke the same truth so what sense does it make? Is it because he is your prophet and you belong to Islam? Oh sure -- the most important thing to God is to punish those who've made images of him - ridiculous!! You cannot respect his prophets, he gets angry and doesn't allow you to come home. Usmanali has changed the philosophy to all is not Allah who has suddenly become limited in his capacity. Poor god is no longer omnipresent. I think from your point of view, the punishment must first be given to the naked on the beaches. Why are you irritated by differences? That's intolerant - if you can't accept another way of life, being lived by another group of people. How does that affect you? Why should you be bothered by any of that? They are not telling you how you should live - so why are you so affected by it? The answer is your perceived superiority about your religion and about yourselves as a people. "Wake up" - you say -- are we all asleep according to you Well, speaks volumes for the arrogant attitude of Muslims like you. Intolerance seems to be in-built in Islam, if I were to go by your utterances. there are a lot of similarities between your religion and mine even i am following the prophecies regarding Qur'an, Islam, Muhammad (peace be upon him) mentioned in your religions. The differences which you have got with me are the same as you have got with your own religion, i think it's Hinduism. You are not following the fulfilled prophecies but i do and yes that's the difference Lol - I have got no differences with my own religion. My religion isn't rigid and unflexible. I don't have to take literally even word and phrase written in my books - unlike you. Beheadings and chopping off hands need not be practiced in my religion to conform to the book. And I glad it is that way hhmmm, your religion is flexible, go ahead, STEAL Doesn't seem to stop you does it? I have watched you stealing other people's words and pretending they are your own. THIEF! nice head Mark, you seem to visit the shoe maker frequently ... ha ... m i right Its the same message by all prophets, religions are brothers and should not fight with each other as to which is the superior one. i am just defending . The attacks are from your side You say "no body can force." Unfortunately (from your perspective) muslims don't have the power to enforce Islam on others in this age. If they had the power, such intolerance as shown by you, would ensure that they did use power to convert. where did i show intolerance in my sentence. Infact, i said "and if they don't, then it's their own choice and no body can force them." Who are you to sit in judgment of "truth" and "false?" Who gave you and your co-religionists the right to sit in judgment of that? You just prove the fact by your postings - the fact that you are an intolerant lot. You and others like you are just like the Taliban in mindset -- you have just covered yourselves with a veneer of apparent modernity. It is funny to see people like you drown in your own propaganda. Please yourself and believe in your grand delusions -- for you have nothing better to do than to try and prove the "greatness" of your own religion. And people wonder why Islam breeds intolerance? With an attitude like that - should one wonder why the Taliban destroyed the Buddha statues in Afghanistan? Its intolerance and it seems to be a hallmark of much of your co-religionists. may be Taliban was trying to teach Bhudhas, not to worship statues as Bhudism also denounces images of God. Regarding judgments, i did not made it, these are the judgments made by your own scriptures, you don't believe it, go ahead, enjoy! ISLAM is the only perfect way of life remained to be followed. Islam does not promote killing. "There is no need to change your faith, And on your old religion lay a wreath." Like I said before only someone who is ignorant about god will try and convert someone and only an equally ignorant person will convert. Also you mentioned the Parsees living in Iran , they escaped into caves and mountains when the massacre was taking place and came out of hiding years later when the madness had stopped. No religion in the world promotes killing , all promote peace and oneness. The prophet has understood the oneness of this entire cosmos and shares this message . God exists in everything. There is no such thing as a "perfect way." Such words indicate an arrogant mindset that says --- my way is the only way, the only true way and all other ways are trash, etc, etc. Which is what you have been trying to prove unsuccessfully here. If Islam does not promote killing: 1. Why are so many of those who carry out terrorist attacks Muslims? 2. Why do they justify their actions in the name of Islam --- obviously some verses are open to interpretation - aren't they? You may say it does not promote killing -- however, what is the ground reality? Are they not killing and don't they expect to be rewarded by Allah? There are some things which are perfected by Allah, your Lord and my Lord Ch 3-The Table, V." Those who blow themselves up killing innocents can not be justified at all in Islam.. Regarding ground realities. Read this "we found genetically engineerd dates alomst equals the lenght of a hand and burgers in a foreign packing." Lol - is that the best you've got to explain the Taliban? So, let me see. What you are saying is that the Taliban was created and air-dropped into Pakistan/Afghanistan? Is it? Where did these enlightened Taliban gain their education from? Which madrassas were they? Do I hear madrassas in Pakistan? Oh wait - but I can see another Zionist conspiracy theory being put forward to that as well Shill1987, i am really very sorry about your mental condition, any way, there are 100s of more methods to drop them in Pakistan, for example, by road, 100s of roads lead to Pakistan from IRAN, INDIA, CHINA, AFGHANISTAN, RUSSIA and there are 100s of no mans lands in these territories where these mercenaries get their training from Zionits. Further, there are different tribes and groups in some of these areas. Zionists also use to buy the elders of some trouble making groups, train them, feed them with dumps of food, weapons, money, ideas. These things then automatically distributed to the people under a group lead by it's elder. Now you will ask how Zionits come in these territories??? They come via HONARARY MASONS most of whom work as PMs and Presidents of the countries involved. Also some of the leading businessmen, diplomats, higher officials are hired as honarary masons who help them achive their goals. Ultimatly, Zionts buy people from both sides and watch them fighting, killing and butchering and that's the prerequisite of the awaited Antichrist-One eyed Dajjal By the way how you got your training for degrading Islam by making such foolish replies. Lol - who are you kidding? The Taliban were neither air-dropped from the skies not transported via roads. They studied in madrassas in Pakistan. Face facts, instead of living in denial. come on, go ahead, right a book on my replies, the book will get best sellers award I see that you've run out of copy-n-paste stuff. Oh dear - why don't you visit some of your favorite Islamist forums for some inspiration. You are at a complete loss for words aren't you? i think you are in the wrong place, go to a beach and count the number of naked people there. This forum's title is ISLAM. I have written a book and its got ranked over the Holy Quran so what advice do you have for me? immediatly go to a Psychiatirist You need a visit for sure. But, I wonder if the psychiatrist would remain sane after a Q&A session with you Franklin-top spiritual and religion sorted by popularity … r/ebooks/0 4. $1.50 [Add to Cart] Ponder Awhile Model Number: BBAL1419646729DLDA Author: Misra, Mohit.K., ... more » 11. $12.95 [Add to Cart] The Qur'an Model Number: BBAL9780192831934DLDA Author: Haleem (Translator), M. A. S. Abdel ... more » eBooks : Spiritual & Religion : Mobipocket Reader - Download Truth is arrogant for the common man but simply truth for the awakened one. You should visit a doctor for trying to teach me about god or Allah or Jevovah or Shiva. Muslims have told me your book is so easy to understand god but the Quran is too complicated. Couldn't understand god after reading the Quran but got a better understanding after reading your book. This is true for almost all spiritual books, they are just too complicated for the common man and can very easily be misunderstood. For better understanding of Qur'an you have to read the traditions of Prophet Muhammad (pbuh). I understand the Quran or Allah better than you do.I have read about the prophet.Dont you think a spiritual writer ranked over the Quran would have a better understanding than most humans or at least you.? Do you think you can write on god and get ranked over the Quran, be one the same page as the Holy Quran and Holy Bible ? students of Madrassas are still studying there. In other words - they were not air-dropped or transported via road by Zionists but are the creation of your own madrassas - that brainwash young kids to hate all things Western, to hate music, to hate modernity, etc. Just to add ---- there are no "perfect rules." That's a myth. And no religion can claim to have laid down "perfect rules" for people to follow!!! may be you are right but people can't know the perfect rules when they see it because they are not perfect Myths are ISMs bassed on Pagan ideologies. hhmmm...World War I and II were not the product of relgions rather the ideologies were from ISMs and none of the ISMs believe in the ONE God-Allah. So, look at the history, even today and then make your decision again. If Islam is the religion of peace then what religion do the 'taliban' follow? .....yea right! Doesn't quite answer the question --- don't you think? You know the time when the Taliban were ruling Afghanistan, I came across so any muslims on online discussion forums (all educated ones) who were praising the Taliban for implementing the "true Islamic way." Now, I ask you this --- were they all wrong? Now, of course, a lot of them shy away from owning up to the Taliban openly -- because they've gotten so much bad press. But, still they argue that they were essentially good people --- and still are good people. So, there seems to be a confusion amongst muslims as to what to make of the Taliban. Why this confusion. Why don't they all share unqualified outrage at what they Taliban did and still do? I don't know I am just trying to say that some people act due to their religions but in fact they are not told anywhere to kill innocents I don't really know them to judge them but it could be just the case of chosing between two bad alternatives I think the Taliban were very extreme in implementing Islam you are right it is so much contraversial I haven't really met one of the Taliban but if they are killing innocents people then I am completely against them and I am more against those who kill more innocents than the Taliban do (The US army) what do the Taliban still do ? best regards All I got to say is obviously "rajabilal" posted this forum to create a strong debate and stir up controversy. Are you joking... ranked over Quran and Bible in Sales/Popularity? How come I have never heard of you?114 years ago Jesus was considered false messiah by majority among people who had heard about jesus till romans accepted christianity...then he became accepted saviour,god by majority who heard about him etc...then came muhammad who... Claire Evans17anesix4 years ago That Jesus is Real?Please, only serious answers. I'd really like to know. by Kashif Habib2 years ago Is there something you really dislike most in islamic teachings?Please be brief.
http://hubpages.com/religion-philosophy/forum/12053/islam
CC-MAIN-2017-26
en
refinedweb
CodePlexProject Hosting for Open Source Software Hello all I have blogengine.net running in a separate application in a subdirectory of the root application, and I was glad to learn about inheritInChildApplications to solve the web.config problem, but now I am struggling with the following: <urlMappings enabled="true"> <add url="Default.aspx" mappedUrl="Blog/Default.aspx" /> … When I navigate to the root application, I want to show the blog by default. The above urlmapping, however, results in a server error "The type or namespace name 'BlogEngine' could not be found". Does anyone know how to accomplish the mapping in a maintainable and SEO friendly way? Are you sure you want to delete this post? You will not be able to recover it later. Are you sure you want to delete this thread? You will not be able to recover it later.
http://blogengine.codeplex.com/discussions/208254
CC-MAIN-2017-26
en
refinedweb
Intro As I promised in my previous blog post, I would write about how I created the floating audio player designed to easily demonstrate how to download and play audio files in Mixed Reality (or actually, just Unity, because the code is not MR specific). I kind of skipped over the UI side. In this post I am going to talk a little more about the floating audio player itself. This code is using the Mixed Reality Toolkit and so actually is Mixed Reality specific. Dissecting the AudioPlayer prefab The main game object The AudioPlayer consists out of two other prefabs, a SquareButton and a Slider. I have talked about this button before, so I won’t go over that one in detail again. The main game object of the AudioPlayer has an AudioSource and two extra scripts. The simple version of the Sound Playback Controller was already described in the previous blog post, and will be handled in great detail here. The other script is a standard Billboard script from the Mixed Reality toolkit. It essentially keeps the object rotated towards the camera, so you will never see it from the side of the backside where it’s hard to read and operate. Note I have restricted pivot axis to Y, so it only rotates over a vertical axis. The button It’s a fairly standard SquareButton, and I have set the text and icon as I described here. Now that button only shows in the editor, the runtime text and the icon are set by a simple script that toggles icon and text, so that the button cycles between being a “Play” and a “Pause” button. That script is pretty easy: using HoloToolkit.Unity.InputModule; using UnityEngine; public class IconToggler : MonoBehaviour, IInputClickHandler { public Texture2D Icon1; public Texture2D Icon2; public string Text1; public string Text2; private TextMesh _textMesh; private GameObject _buttonFace; void Awake () { _buttonFace = gameObject.transform. Find("UIButtonSquare/UIButtonSquareIcon").gameObject; var text = gameObject.transform.Find("UIButtonSquare/Text").gameObject; _textMesh = text.GetComponent<TextMesh>(); SetBaseState(); } public void SetBaseState() { _textMesh.text = Text1; _buttonFace.GetComponent<Renderer>().sharedMaterial.mainTexture = Icon1; } private float _lastClick; public void OnInputClicked(InputClickedEventData eventData) { if (Time.time - _lastClick > 0.1) { _lastClick = Time.time; Toggle(); } } public void Toggle() { var material = _buttonFace.GetComponent<Renderer>().sharedMaterial; material.mainTexture = material.mainTexture == Icon1 ? Icon2 : Icon1; _textMesh.text = _textMesh.text == Text1 ? Text2 : Text1; } } It has four public properties, as already is visible in the image: Image1 and Text1 for the default image and text (“Play”), Image 2 and Text 2 for the alternate image and text (“Pause”). The Awake method grabs some objects within the button itself, then sets the base state – which is, the default icon and text. It also implements IInputClickHandler, so the user can tap it. In OnInputClicked it calls the Toggle method. That then toggles both text and image. Notice there’s simple time based guard OnInputClicked. This is to prevent the button from sending a burst of click events. In the Unity editor, I mostly get two clicks every time I press the XBox controller A button, and then nothing happens. Annoying, but easily mitigated this way. The Slider I can be short about that one. I did not create that, but simply nicked it from the Mixed Reality Toolkit Examples. It sits in HoloToolkit-Examples\UX\Prefabs. I like making stuff, but I like stealing reusing stuff even better. The extended Sound Playback Controller Let’s start at Start ;). Note: the BaseMediaLoader was handled in the previous blog post, public class SoundPlaybackController : BaseMediaLoader { public AudioSource Audio; public GameObject Slider; public GameObject Button; private SliderGestureControl _sliderControl; private IconToggler _iconToggler; public AudioType TypeAudio = AudioType.OGGVORBIS; void Start() { _sliderControl = Slider.GetComponent<SliderGestureControl>(); _sliderControl.OnUpdateEvent.AddListener(ValueUpdated); Slider.SetActive(false); Button.SetActive(false); _iconToggler = Button.GetComponent<IconToggler>(); } } In the Start method, we first grab a bunch of stuff. Note the fact that we not only turn off the slider control but also actually attach an event handler to that. We continue with StartLoadMedia and LoadMediaFromUrl protected override IEnumerator StartLoadMedia() { Slider.SetActive(false); Button.SetActive(false); yield return LoadMediaFromUrl(MediaUrl); } private IEnumerator LoadMediaFromUrl(string url) { var handler = new DownloadHandlerAudioClip(url, TypeAudio); yield return ExecuteRequest(url, handler); if (handler.audioClip.length > 0) { Audio.clip = handler.audioClip; _sliderControl.SetSpan(0, Audio.clip.length); Slider.SetActive(true); Button.SetActive(true); _iconToggler.SetBaseState(); } } The override from StartLoadMedia in this version turns off the whole UI while we are actually loading data, and turns it on when we are done loading. Since that fails when we load MP3, the MP3 player in the demo project disappears and on startup. The others one disappear too, in fact, but immediately appear again since we are loading small clips. This goes so fast you can’t even see it. LoadMediaFromUrl not only executes the request and sets the downloaded clip to the Audio Souce, as we saw before, but we also set the span of the Slider Control between 0 and the length of the AudioClip in seconds. Easy, right? Now the Update method, which as you know is called 60 times per second, is the trick to keeping the slider equal to the the current time of the clips that’s now playing: protected override void Update() { base.Update(); if (Audio.isPlaying) { _sliderControl.SetSliderValue(Audio.time); } if (Mathf.Abs(Audio.time - _sliderControl.MaxSliderValue) < 0.1f) { Audio.Stop(); Audio.time = 0; _iconToggler.SetBaseState(); _sliderControl.SetSliderValue(0); } } Thus if the audio clip plays, the slider moves along. It’s not quite rocket science. If the clip has nearly finished playing, it is stopped and everything is set to the base state: the icon, the time of the audio clip, and the slider is set to 0 again. And finally – remember that event handler we added to the OnValueUpdated event of the slider? Guess what: private void ValueUpdated() { Audio.time = _sliderControl.SliderValue; } It’s the opposite of the third line of Update – now we set the Audio time to the Slider value. Conclusion And that’s it. You can simply use some out-of-the-box components in the Mixed Reality Toolkit and/or it’s examples to build a simple but effective control to play audio. You can grab the demo project (it’s still the same) from here.
http://dotnetbyexample.blogspot.com/2018/02/
CC-MAIN-2019-04
en
refinedweb
CSE Homework 1 - Cecily Merritt - 2 years ago - Views: Transcription 1 CSE 00 - Homework.8 (a) Give a precise expression for the minimum number of nodes in an AVL tree of height h. (b) What is the minimum number of nodes in an AVL tree of height? (a) Let S(h) be the minimum number of nodes in an AVL tree T of height h. The subtrees of an AVL tree with mimimum number of nodes must also have minimum number of nodes. Also, at least one of the left and right subtrees of T is an AVL tree of height h. Since the height of left and right subtrees can differ by at most, the other subtree must have height h. Then, we have the following recurrence relation: S(h) = S(h ) + S(h ) +. () We also know the base cases: S(0) = and S() =. One method to solve a recurrence relation is to guess the solution and prove it by induction. Observe that the recurrence relation in () is very similar to the recurrence relation of Fibonacci numbers. When we look at the first a few numbers of the sequence S(h), it is not difficult to guess S(h) = F(h + ). Now, let s prove that S(h) = F(h + ) by induction. Base cases: S(0) =, F() =. So, S(0) = F(). S() =, F() =. So, S() = F(). Induction hyprothesis: Assume that the hypothesis S(h) = F(h + ) is true for h =,,k. Inductive step: Prove that it is also true for h = k +. S(k + ) = S(k) + S(k ) + = F(k + ) + F(k + ) + = F(k + ). We replace S(k) and S(k ) with their equivalence according to the hypothesis. S(k + ) = F(k + ). Hypothesis is also true for h = k +. Thus, it is true for all h. Then, we get (b) S() = F(8).. Show the result of inserting,,,,,,, 7. See Figure..0 The keys,,, k are inserted in order into an initially empty AVL tree. Prove that the resulting tree is perfectly balanced. We will prove the following more general statement by induction on k: The result of inserting any increasing sequence of k numbers into an initially empty AVL tree results in a perfectly balanced tree of height k. 2 Base case: k =. Tree has only one node. This is clearly perfectly balanced. Induction hypothesis: Assume hypothesis is true for k =,,...,h. Inductive step: Prove that it is true for k = h +, i.e. for the sequence,,, h+. After the first h insertions, by the induction hypothesis, the tree is perfectly balanced, with height h. h is at the root; the left subtree is a perfectly balanced tree of height h, and the right subtree is a perfectly balanced tree containing the numbers h + through h, also of height h. Each of the next h insertions ( h through h + h ) are inserted into the right subtree, and the entire sequence of numbers in the right subtree (now h + through h + h ) were inserted in order and are a sequence of h nodes. By the induction hypothesis, they form a perfectly balanced tree of height h. See Figure. The next insertion, of the number h + h, imbalances the tree at the root. The subsequent RR rotation forms a tree with root h at the root, and a perfectly balanced left subtree of height h. The right subtree consists of a perfectly balanced tree (of height h ), with the new node (containing h + h as the right child of its biggest element. Thus, the right subtree is as if the numbers h +, h + h had been inserted in order. By the induction hypothesis, subsequently inserting the numbers h + h + through h+ nodes form a perfectly balanced subtree of height h. Since the left and right subtrees are perfectly balanced (height h ), the whole tree is perfectly balanced.. Write a method to generate a perfectly balanced binary search tree of height h with keys through h+. What is the running time of your method? One way to implement is the following: public BSTNode genperfecttree (int h) { return genpefecttree (, Math.pow(, h + ) - ); } private BSTNode genperfecttree (int low, int high) { } if (low==high) return new BSTNode(low, null, null); int root = (low + high) / ; BSTNode left = genperfecttree (low, root - ); BSTNode right = genperfecttree (root +, high); return new BSTNode(root, left, right); The running time of this is O( h ) = O(n), where n is the number of nodes in the generated tree. Every node is visited just one time when it is generated..7 Teo trees T and T are isomorphic if T can be transformed into T by swapping left and right children of (some of) nodes in T. (a) Give a polynomial time algorithm to decide if two trees are isomorphic. (b) What is the running time of your program? One way to implement is the following: 3 public boolean areisomorphic (BinaryTreeNode root, BinaryTreeNode root) { /* If both are null trees, they are isomorphic. */ if (root == null && root == null) return true; /* If one is null and the other not, they are not isomorphic. */ if (root == null root == null) return false; /* If the elements at the roots are not the same, they are not isomorphic. */ if (root.element.compareto(root.element)!= 0) return false; /* Now, to be isomorphic, root.left must be isomorphic to root.left AND root.right must be iosmorphic to root.right, OR root.right must be isomorphic to root.left AND root.left must be iosmorphic to root.right. */ } return (areisomorphic(root.left, root.left) && areisomorphic(root.right, root.right)) (areisomorphic(root.right, root.left) && areisomorphic(root.left, root.right)); Worst case time complexity, as a function of the height of the smaller of the two trees, can be written by the following recurrence relation. T( ) = c // height of - means an empty tree. T(h) = T(h ) + c// up to four recursive calls for trees smaller in height by. We can solve this recurrence relation by back substitution. T(h) = T(h ) + c = ( T(h ) + c) + c = ( ( T(h ) + c) + c) + c = T(h ) + c ( + + ) i = i T(h i) + c k=0 k = i T(h i) + c ( i )/( ) = i T(h i) + (c/) ( i ) 4 Stop when h i = (the base case), i.e. i = h +. T(h) = h+ T( ) + (c/) ( h+ ) = c h+ + (c/) ( h+ ) = (c + c/) (h+) (c/) Thus, the running time T(h) is exponential in h, i.e. O( h ). However, if h = O(logn), then it is O(n ). Extra Problem Prove that insertion into a binary search tree that is complete while maintaining completeness can not be done in O(logn) time. We will show that for any tree height, we can create a perfectly balanced binary search tree that can not be inserted into in O(logn) time, while leaving the tree perfectly balanced. For this problem, our perfectly balanced binary tree is a tree completely filled in, except possibly for the bottom level, which is filled from left to right. First, we show that if a sequence of consecutive integers of length k starting at x is in a perfectly balanced tree, then the leaves of the tree are numbered x,x +,x +,,x + k. So, for example, if k =, and x =, the leaves are numbered,,, and 7. See figure. We will prove this by induction on k. Base case: k = Since there is just one integer x in the sequence, it must be a leaf. Induction hypothesis: Assume it is true for k =,,h. Induction step: Prove that it is true for k = h +. The numbers stored in the tree are x,x +,,x + h+. The root stores the integer ((x + ( h + ) ) + x)/ = x + h. The left subtree stores the numbers x,x +,,x + h. This tree has (x + h ) x + = h nodes, so the induction hypothesis applies, and the leaves of this tree are x,x +,,x + h. The right subtree stores the numbers x + h,x + h +,,x + ( h + ). This tree has (x + ( h + ) ) (x + h ) + = h nodes, so the induction hypothesis applies, and the leaves of this tree are x + h,x + h +,,x + ( h + ). Thus, the sequence of the leaves in the entire tree is x,x+,,x+ h,x+ h,x+ h +,,x+ h+ and we have proven the statement for k = h +. Now consider the perfectly balanced tree containing the numbers,,..., h. Its leaves will be numbered,,,, h. Now remove the bottom right node from this tree (the one numbered h ), and insert into the tree the number 0. The numbers stored will be 0,,,, h. Since there are still h nodes, the above proof applies, and the leaf nodes will be numbered 0,,,, h. Since the leaf nodes are the only ones that have null pointers in a perfectly balanced tree, and since all of the leaf nodes are changing during the process of inserting 0, whatever algorithm does the insertion will have to visit all of the leaf nodes. Since there are O(n) leaf nodes, the algorithm must have worst case O(n) time complexity. 5 Insert Insert Insert Insert Insert Insert Insert Insert 7 7 Figure : Problem. 6 h- h- h- h- h- after inserting,,..., h -. h- h- after inserting,,..., h -,..., h + h- -. h h h- h- h- h- h- h- h- h- after inserting,,..., h -,..., h + h-. after inserting,,..., h -,..., h + h-,... h+ -. Figure : Problem.0 From Last Time: Remove (Delete) Operation CSE 32 Lecture : More on Search Trees Today s Topics: Lazy Operations Run Time Analysis of Binary Search Tree Operations Balanced Search Trees AVL Trees and Rotations Covered in Chapter of the text Full and Complete Binary Trees Full and Complete Binary Trees Binary Tree Theorems 1 Here are two important types of binary trees. Note that the definitions, while similar, are logically independent. Definition: a binary tree T is full: Binary Search Trees (BST) Binary Search Trees (BST) 1. Hierarchical data structure with a single reference to node 2. Each node has at most two child nodes (a left and a right child) 3. Nodes are organized by the Binary Search: with Ordered Lists and Binary Trees Data Structures and Algorithms Ordered Lists and Binary Trees Chris Brooks Department of Computer Science University of San Francisco Department of Computer Science University of San Francisco p.1/62 6-0:) Section IV.1: Recursive Algorithms and Recursion Trees Section IV.1: Recursive Algorithms and Recursion Trees Definition IV.1.1: A recursive algorithm is an algorithm that solves a problem by (1) reducing it to an instance of the same problem with smaller Trees CMPSC 122 Binary Search Trees CMPSC 122 Note: This notes packet has significant overlap with the first set of trees notes I do in CMPSC 360, but goes into much greater depth on turning BSTs into pseudocode than Heaps. CSE 373 Data Structures Binary Heaps CSE Data Structures Readings Chapter Section. Binary Heaps BST implementation of a Priority Queue Worst case (degenerate tree) FindMin, DeleteMin and Insert (k) are all O(n) Best case (completely Symbol Tables. Introduction Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The Binary Trees and Huffman Encoding Binary Search Trees Binary Trees and Huffman Encoding Binary Search Trees Computer Science E119 Harvard Extension School Fall 2012 David G. Sullivan, Ph.D. Motivation: Maintaining a Sorted Collection of Data A data dictionary and Algorithms Data Structures and Algorithms CS245-2016S-06 Binary Search Trees David Galles Department of Computer Science University of San Francisco 06-0: Ordered List ADT Operations: Insert an element in the list 2-3 Trees: The Basics CS10: Data Structures and Object-Oriented Design (Fall 2013) November 1, 2013: 2-3 Trees: Inserting and Deleting Scribes: CS 10 Teaching Team Lecture Summary In this class, we investigated 2-3 Trees in Lecture 1: Course overview, circuits, and formulas Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swast Lecture Notes on Binary Search Trees Lecture Notes on Binary Search Trees 15-122: Principles of Imperative Computation Frank Pfenning Lecture 17 March 17, 2010 1 Introduction In the previous two lectures we have seen how to exploit the structure Lecture Notes on Binary Search Trees Lecture Notes on Binary Search Trees 15-122: Principles of Imperative Computation Frank Pfenning André Platzer Lecture 17 October 23, 2014 1 Introduction In this lecture, we will continue considering associative Persistent Binary Search Trees Persistent Binary Search Trees Datastructures, UvA. May 30, 2008 0440949, Andreas van Cranenburgh Abstract A persistent binary tree allows access to all previous versions of the tree. This paper presents Binary Heap Algorithms CS Data Structures and Algorithms Lecture Slides Wednesday, April 5, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks CHAPPELLG@member.ams.org 2005 2009 Glenn G. Chappell Rotation Operation for Binary Search Trees Idea: Rotation Operation for Binary Search Trees Idea: Change a few pointers at a particular place in the tree so that one subtree becomes less deep in exchange for another one becoming deeper. A sequence of An Immediate Approach to Balancing Nodes of Binary Search Trees Chung-Chih Li Dept. of Computer Science, Lamar University Beaumont, Texas,USA Abstract We present an immediate approach in hoping to bridge the gap between the difficulties of learning ordinary binary PES Institute of Technology-BSC QUESTION BANK PES Institute of Technology-BSC Faculty: Mrs. R.Bharathi CS35: Data Structures Using C QUESTION BANK UNIT I -BASIC CONCEPTS 1. What is an ADT? Briefly explain the categories that classify the functions TREE BASIC TERMINOLOGIES TREE Trees are very flexible, versatile and powerful non-liner data structure that can be used to represent data items possessing hierarchical relationship between the grand father and his children and Big Data and Scripting. Part 4: Memory Hierarchies 1, Big Data and Scripting Part 4: Memory Hierarchies 2, Model and Definitions memory size: M machine words total storage (on disk) of N elements (N is very large) disk size unlimited (for our considerations) Mathematical Induction. Lecture 10-11 Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach Data Structures CSC212 (1) Dr Muhammad Hussain Lecture - Binary Search Tree ADT (1) Binary Search Tree ADT 56 26 200 18 28 190 213 12 24 27 (2) Binary Search Tree ADT (BST) It is a binary tree with the following properties 1. with each node associate a key 2. the key of each node Sample Induction Proofs Math 3 Worksheet: Induction Proofs III, Sample Proofs A.J. Hildebrand Sample Induction Proofs Below are model solutions to some of the practice problems on the induction worksheets. The solutions given 6 Creating the Animation 6 Creating the Animation Now that the animation can be represented, stored, and played back, all that is left to do is understand how it is created. This is where we will use genetic algorithms, and CS 103X: Discrete Structures Homework Assignment 3 Solutions CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering Data Structures and Algorithms(5) Ming Zhang Data Structures and Algorithms Data Structures and Algorithms(5) Instructor: Ming Zhang Textbook Authors: Ming Zhang, Tengjiao Wang and Haiyan Zhao Higher Education Press, 2008.6 (the "Eleventh Laboratory Module 4 Height Balanced Trees Laboratory Module 4 Height Balanced Trees Purpose: understand the notion of height balanced trees to build, in C, a height balanced tree 1 Height Balanced Trees 1.1 General Presentation Height balanced GRAPH THEORY LECTURE 4: TREES GRAPH THEORY LECTURE 4: TREES Abstract. 3.1 presents some standard characterizations and properties of trees. 3.2 presents several different types of trees. 3.7 develops a counting method based on a bijection Class Overview. CSE 326: Data Structures. Goals. Goals. Data Structures. Goals. Introduction Class Overview CSE 326: Data Structures Introduction Introduction to many of the basic data structures used in computer software Understand the data structures Analyze the algorithms that use them Know Union-Find Problem. Using Arrays And Chains Union-Find Problem Given a set {,,, n} of n elements. Initially each element is in a different set. ƒ {}, {},, {n} An intermixed sequence of union and find operations is performed. A union operation combines Binary Search Trees. basic implementations randomized BSTs deletion in BSTs Binary Search Trees basic implementations randomized BSTs deletion in BSTs eferences: Algorithms in Java, Chapter 12 Intro to Programming, Section 4.4 1 Elementary Algorithms and Data Structures Written Exam Proposed SOLUTION Algorithms and Data Structures Written Exam Proposed SOLUTION 2005-01-07 from 09:00 to 13:00 Allowed tools: A standard calculator. Grading criteria: You can get at most 30 points. For an E, 15 points are 12 Abstract Data Types 12 Abstract Data Types 12.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Define the concept of an abstract data type (ADT). A Comparison of Dictionary Implementations A Comparison of Dictionary Implementations Mark P Neyer April 10, 2009 1 Introduction A common problem in computer science is the representation of a mapping between two sets. A mapping f : A B is a Introduction to data structures Notes 2: Introduction to data structures 2.1 Recursion 2.1.1 Recursive functions Recursion is a central concept in computation in which the solution of a problem depends on the solution of smaller copies Outline. Introduction Linear Search. Transpose sequential search Interpolation search Binary search Fibonacci search Other search techniques Searching (Unit 6) Outline Introduction Linear Search Ordered linear search Unordered linear search Transpose sequential search Interpolation search Binary search Fibonacci search Other search techniques Mathematics for Algorithm and System Analysis Mathematics for Algorithm and System Analysis for students of computer and computational science Edward A. Bender S. Gill Williamson c Edward A. Bender & S. Gill Williamson 2005. All rights reserved. Preface search algorithm Binary search algorithm Definition Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than Introduction to Learning & Decision Trees Artificial Intelligence: Representation and Problem Solving 5-38 April 0, 2007 Introduction to Learning & Decision Trees Learning and Decision Trees to learning What is learning? - more than just memor
http://docplayer.net/29024241-Cse-homework-1.html
CC-MAIN-2019-04
en
refinedweb
Creating a Modular Application in Laravel 5.1 Instead of having a giant mammoth of code, having your application divided into small meaningful modules can make the development of a giant site more manageable and enjoyable. I have just started working upon a new project in Laravel 5.1 that is going to be huge in terms of functionality. Considering the scale of application, the different modules that it was going to have, instead of jumbling every thing up (controllers, models and views etc) in the existing directories that Laravel provides, I decided to implement modules such that each of the modules will have everything, (it’s controllers, models, views, middlewares, any helpers etc) separated. Now there might be several ways to approach this, but here is how I structured it. config\ module.php ... ... app\ ... ... Modules\ ModuleOne\ Controllers\ Models\ Views\ routes.php ModuleTwo\ Controllers\ Models\ Views\ routes.php ModulesServiceProvider.php ... You can follow the steps stated below to achieve a similar structure: Setting up the Structure Create a file called module.php inside the config directory. This file is going to hold the module names that we want to load and other configuration related to the modules. For now, lets keep it simple and just have the module names that we want to load. The file might look like below. (Note that the User, Employee are the module names that we want to load. And for every new module that you would want to create, you will have to add the name for it in this modules array.) # config/module.php return [ 'modules' => [ 'User', 'Employee', ] ] Create a directory called Modules inside the app directory. This directory is going to have a separate folder for each of the modules. For example, there can be a folder called User, one called Employee so on and so forth. Let’s say that we want to create an Employee module. In that case, create an Employee directory at app\Modules\. And in this new directory create three directories namely Controllers, Models and Views and a file called routes.php. There is nothing special with the module, I mean the routes.php file is going to be used exactly how we use the outer routes.php file, controllers and models will be same as well. The only thing that you will have to take care about is the namespacing. You will have to make sure that you give proper namespaces to each controller/model that you create. In this case, the controllers will be having the namespace of App\Modules\Employee\Controllers and for any model, it would be App\Modules\Employee\Models. The final directory structure may look like the following: app\ Modules\ Employee\ Controllers\ Models\ Views\ routes.php User\ Controllers\ Models\ Views\ routes.php Please note that you are not bound to have only the above stated directory structure, you are free to structure it however you want (but you have to make sure that you use proper namespacing). Without any doubt, you can add anything related to your module here as well for example form requests, helpers etc. Creating the Service Provider Now again, head to the Modules directory and add a file called ModulesServiceProvider. What we are going to do is make this Service provider inform Laravel that we are going to use these modules and you have to load each of the module’s routes and views from these modules as well. So that when a route or view will be looked up, Laravel will look into these folders as well. Below is how the service provider might look like: <?php namespace App\Modules; /** * ServiceProvider * * The service provider for the modules. After being registered * it will make sure that each of the modules are properly loaded * i.e. with their routes, views etc. * * @author Kamran Ahmed <kamranahmed.se@gmail.com> * @package App\Modules */ class ModulesServiceProvider extends \Illuminate\Support\ServiceProvider { /** * Will make sure that the required modules have been fully loaded * @return void */ public function boot() { // For each of the registered modules, include their routes and Views $modules = config("module.modules"); while (list(,$module) = each($modules)) { // Load the routes for each of the modules if(file_exists(__DIR__.'/'.$module.'/routes.php')) { include __DIR__.'/'.$module.'/routes.php'; } // Load the views if(is_dir(__DIR__.'/'.$module.'/Views')) { $this->loadViewsFrom(__DIR__.'/'.$module.'/Views', $module); } } } public function register() {} } Now the next thing is registering this service provider with the Laravel. And for that, open up the file config/app.php and add ‘App\Modules\ModulesServiceProvider’ to the end of the providers array. #config/app.php 'providers' => [ ... ... App\Modules\ModulesServiceProvider::class, ] Adding Modules Everything is setup now. In order to add a new module, all you have to do is create a folder for the module inside the App\Modules\ directory, place your controllers, models, views and routes in this directory, register this module name in the config\module.php and your module has been registered with Laravel. Using the controllers and models is the same that is how you use any outer controller or model i.e. by specifying the correct namespace. But for loading views, what you have to do is call a view like: ModuleName::viewname e.g. return view('Employee::dummy'); And that sums it up. Do you have any techniques of your own? How do you structure your modules in Laravel? Do not forget to share it with everyone in the comments section below. Note: Please note that, during the process, if you come across any Class not found exceptions and you haven’t done anything wrong, just run composer dump-autoload. Source code can be found through this Github repository
https://kamranahmed.info/blog/2015/12/03/creating-a-modular-application-in-laravel/
CC-MAIN-2019-04
en
refinedweb
I posted a similar question and the problem could not be replicated. I also though it might have been the workstation and all the libraries, controls, et. al. installed on the machine. Problem exists with a new Windows 10 workstation. Using Infragistics ASP.NET 2017.2; controls used in set Infragistics45.Web.v17.2, Version=17.2.20172.2095 This is the problem (see image) - created a web application in VS 2017. Open a new Web Form and place a WebTab on the form. Expand the webtab to almost the size of the screen and you can see a blank footer / empty space at the bottom of tab. Nothing done removes or resizes this dead area. Environment : Windows 10 Professional .NET Code 2.0.8 Windows Hosting .NET Core Runtime - 2.0.7 (x64) .NET Core Runtime - 2.0.7 (x32) .NET Framework 4.5 Multi-Targeting Pack .NET Framework 4.5.1 Multi-Targeting Pack .NET Framework 4.5.2 Multi-Targeting Pack Visual Studio 2008 Professional - ENU Visual Studio 2017 Visual Studio Tools for Application 2015 Visual Studio Tools for Application 2015 Language Support Hello Mark, Thank you for posting in our community. I noticed that the service release that you are using is not the latest one for version 17.2. At this point, the latest SR available for download is 20172.2123. Can you please try downloading the latest version and let me know whether you are still experiencing the same behavior? The latest version can be downloaded from our web site. You need to log in with your credentials and navigate to "My Keys &Downloads" section. Click the product of your choice and under "Service Releases" tab you will find all service releases for this product If you need any assistance do not hesitate to contact me. Looking forward to hearing from you. Hello Vasya, I had a production release and was holding off on upgrading until the next dev cycle, but will try the update and see. Will post back with results. Mark Upgrade to the latest version and the results are exactly the same. Instead of using the existing application, created an empty project and added to web tabs (inside a DIV and another outside); the results are the same and there is still a footer - I cannot get the tab to be the size of the actual tab container. Here is the source for the form: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %> <%@ Register assembly="Infragistics4.Web.v17.2, Version=17.2.20172.2123, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.LayoutControls" tagprefix="ig" %> <!DOCTYPE html> <html xmlns="">"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <ig:WebTab <tabs> <ig:ContentTabItem </ig:ContentTabItem> <ig:ContentTabItem </ig:ContentTabItem> </tabs> </ig:WebTab> </div> <ig:WebTab <tabs> <ig:ContentTabItem </ig:ContentTabItem> <ig:ContentTabItem </ig:ContentTabItem> </tabs> </ig:WebTab> </form></body></html> Designer View with the footer: Vasay, Posted 2 hours ago new results - same as before. You will have to wait for you over over the top content filters to see the results. Thank you for getting back to me. Take your time, test with the latest service release and let me know whether the described behavior still persists. Please feel free to contact me if you need any further assistance.
https://www.infragistics.com/community/forums/f/ultimate-ui-for-asp-net/119293/footer-dead-space-bottom-of-webtab
CC-MAIN-2019-04
en
refinedweb
TIMKEN 19150-903A2 Information|19150-903A2 bearing in Sudan Timken 19150 Tapered Roller Bearing, Single Cone, Standard Timken 19150 Tapered Roller Bearing, Single Cone, Standard Tolerance, Straight Bore, Steel, Inch, 1.5000" ID, 0.6500" Width: Amazon.com: Industrial & ScientificContact M88048 Axle Bearing | Leader Bearing TIMKEN 19150-903A2 Timken M88048 Axle Bearing. Timken M88048 Axle Bearing. Timken Axle Bearings are designed to help the wheels of the vehicle spin smoothly andContact us Timken Company /wiki/Timken_Company The Timken Company is a global manufacturer of bearings, and in 1899 incorporated as The Timken Roller Bearing Axle Company in St. Louis. In 1901,Contact us TIMKEN 19150-903A2 What's New. Boston Gear Bear-N-Bronz Plain Cylindrical Sleeve Bearing, SAE 660 Cast Bronze, Inch ; NU205M Cylindrical Roller BearingContact us Timken 513188 Lowest Price - Free Shipping, Buy now Find Our Lowest Possible Price! Cheapest Timken 513188 For Sale.Contact Timken Roller Bearings On Sale /Timken Roller Bearings Find our Lowest Possible Price! Search for Timken Roller Bearings Prices.Contact us import ina rt622 bearing | Product Leading bearing of high quality and including INA RT622 McGill CAMROL Cam Followers fag nsk skf timken ina koyo bearing. Open, INA TCJ35-N TIMKEN 19150-903A2.Contact us Timken CAD Browse All Product Types in the The Timken Company catalog including Housed Unit Bearings,Spherical Roller Bearings,Cylindrical Roller Bearings,Tapered RollerContact us Timken - T2520-903A2 - Motion Industries Buy Timken Tapered Roller Thrust Bearings T2520-903A2 direct from Motion Industries. Your proven service leader with reliable delivery since 1972.Contact us TIMKEN 19150-903A2 | Leader Bearing Bearings>Roller Bearings>Tapered Roller Bearing Assemblies>19150-903A2Bearing, Tapered Standard Precision Basic Number 19150Leader Singapore isContact us TIMKEN T135-903A2 Leader Singapore is authorized dealers in interchange all bearing types, including TIMKEN T135-903A2 McGill CAMROL Cam Followers fag nsk skf timken ina koyo bearingContact us T441 903a2 | Timken | Dalton Bearing PHONE: 706.226.2022; FAX: 706.226.2032; Products Brands Services Worldwide Industries News Contact Us Request Quote. Browse By ManufacturerContact us Energy efficient timken 3mmvc9107hxvvdumfs934 bearing in timken 3mmvc9107hxvvdumfs934 timken 19150-903a2 skf 205szzc timken t201 bearing koyo jr25x30x26,5 skf 6009 2rs, deep groove ball. Contact us. NTN 566 | Leader Beari.Contact us Timken Company - Bearings & Mechanical Power Transmissions The Timken Company engineers and manufactures bearings and mechanical power transmission components. We use our knowledge to make industries across the globe work better.Contact us timken hm256846td-903a2 bearing high quality in South Africa TIMKEN 19150-903A2 SKF Bearing all bearing types, including TIMKEN HM256846TD-3 McGill CAMROL Cam Followers fag nsk skf timken ina koyo bearing. Contact usContact us Timken Engineered Bearings | The Timken Company Timken® engineered bearings deliver strong performance, consistently and reliably. Our products include tapered, spherical, cylindrical, thrust, ball, plainContact us Timken – Browse Results Instantly find.com/Timken Search for Timken. Find Quick Results and Explore Answers Now!Contact us Timken Roller Bearings On Sale /Timken Roller Bearings Find our Lowest Possible Price! Search for Timken Roller Bearings Prices.Contact us - NTN F619/2 Material|F619/2 bearing in Mumbai - SKF K 25X31X17 Wholesalers|K 25X31X17 bearing in Ecuador - FAG 51210 Outside Diameter|51210 bearing in Dominique - NSK 23248CC/W33 Seals|23248CC/W33 bearing in Tamilnadu - NSK 6013-Z Seals|6013-Z bearing in Bermuda - SKF C 3076 KM OH 3076 H Manufacturers|C 3076 KM OH 3076 H bearing in Mozambique
http://welcomehomewesley.org/?id=6352&bearing-type=TIMKEN-19150-903A2-Bearing
CC-MAIN-2019-04
en
refinedweb
Feel free to just use getRedisPusher so you won’t have to re-configure your native redis. Yes, this idea can work nicely. I would solve it elegantly like keep all the redis messages in a queue, and then have ability to flush them them, but that would require additional work on the redis-oplog codebase. Meteor Scaling - Redis Oplog [Status: Prod ready] diaconutheodor #606 koticomake #607 @diaconutheodor, Thanks for reply I was already using getRedisPusher but at the same time I have also namespace on the collection. When there is a namespace it is not getting pushed to redis and when I remove namespace then it is working fine. How to deal with it when we have namespace ?? I have namespace something like Collection.configureRedisOplog({ mutation(options, { event, selector, modifier, doc }) { var companyId = selector && selector.companyId; if (event === Events.INSERT) { companyId = doc.companyId; } Object.assign(options, { namespace: `company::${companyId}` }); }) }) My request to correct / update outside mutation documentation w.r.t to getRedisPusher usage because getRedisPusher is a function and not a object, I think it should be getRedisPusher().publish('tasks', EJSON.stringify({ [RedisPipe.DOC]: {_id: taskId}, [RedisPipe.EVENT]: Events.UPDATE, [RedisPipe.FIELDS]: ['status'] });
https://forums.meteor.com/t/meteor-scaling-redis-oplog-status-prod-ready/30855?page=31
CC-MAIN-2019-04
en
refinedweb
by Zoran Horvat Mar 23, 2013 There are N cards in the deck. Write the program which shuffles the deck so that all cards are evenly distributed over multiple shuffles. Example: Deck consists of four cards (1, 2, 3 and 4). One possible shuffling is: 3, 1, 2, 4. Keywords: Cards, shuffling, probability, Fisher-Yates algorithm. When speaking of shuffling a sequence of numbers, we can come to a difficulty to explain what does the shuffling mean in terms of distinguishing "well shuffled" from "poorly shuffled" sequence. Take two numbers: 1 and 2. Is the sequence [1, 2] shuffled? Or is the sequence [2, 1] shuffled better? Don't be tempted to believe that the latter one is, so to say, better than the previous. Better stance for comparing sequences would be to ask the following question: How often does the shuffling process produce sequence [1, 2] compared to sequence [2, 1]? Basically, it is not the sequence that is considered shuffled or not, it is the algorithm which produces proper or improper shuffling. So we are now stepping aside and looking at the sequence of sequences produced by the shuffling algorithm. It should be obvious that both sequences are legal when shuffling two numbers. It only remains to see whether shuffling algorithm produces these sequences in a sufficiently random manner. For example, we could test whether both sequences appear equally often when algorithm is run many times. Observe this sequence of sequences: [[1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1]]. Each of the sequences appears three times in six runs of the algorithm. Looks perfect, does it? But on the second look, it appears that sequence [1, 2] always precedes sequence [2, 1]. Let's take a look at Markov chains of sequences, i.e. to analyze how often transitions are made between the two sequences produced on the output. The result goes like this: Out of 5 transitions, we have [[1, 2], [2, 1]] occurring 3 times and [[2, 1], [1, 2]] occurring 2 times. There is no trace of transitions [[1, 2], [1, 2]] and [[2, 1], [2, 1]]. Like this algorithm is utterly unable to repeat any of the sequences twice in a row, although truly random algorithm would have to produce the same sequence on the output once on every two attempts on average. So this algorithm doesn't seem to be a proper shuffling algorithm after all. But now again, we could write an algorithm that produces this sequence of sequences: [[1, 2], [1, 2], [2, 1], [2, 1], [1, 2], [1, 2], [2, 1], ... ]. That algorithm would become perfect on both accounts: Appearances of particular sequences and appearances of particular transitions. But still it's obviously flawed as we always know the next sequence when previous two sequences are known. And there goes the idea: If we take Markov chains of length 2, we would quickly find that sequences [[1, 2], [2, 1], [1, 2]] and [[2, 1], [1, 2], [2, 1]] never appear on the output (sic!). So yes, the algorithm is flawed and it can be demonstrated formally. Now we have seen three criteria for analyzing the shuffling produced by an arbitrary algorithm. We can devise an enhanced algorithm that performs perfectly on all three criteria, but then still find out yet another test on which it fails, namely to find one particular property of perfect shuffling (whatever should it be) that the algorithm does not satisfy. So what should we do? The answer is quite simple: Proper shuffling algorithm should not bother about conditions and criteria that sequences should meet, but it should better think of how to satisfy distribution of numbers within each particular sequence. Should this distribution be "honest", or in formal terms: unbiased, then we would rest assured that all sequences produced by such an algorithm would natively be well shuffled. In literature, you will find definitions of proper shuffling that range from trivial to very general, so general that they cannot be fully applied in practice. For example, consider this criterion: A sequence is random if it has every property that is shared by all infinite sequences of independent samples of random variables from the uniform distribution. Well, this sounds as if it has embodied all the possibilities. Should the theoretically perfect sequence have any property that it satisfies, then well formed algorithmically-produced sequence should definitely pass the test of that particular property. But alas, this definition is so broad that it cannot possibly be applied in practice in its full extent. (On a related note, this statement was given by Joel N. Franklin in a paper published in Mathematics of Computation journal back in 1963.) To bridge the gap between theory and practice, different authors have devised quite an impressive suite of tests that can be applied to sequences in order to measure their "properness". It is beyond the scope of this article to discuss these tests. Further on we will focus on devising an unbiased algorithm and hope for the best when its output comes to the testing phase. In the previous section we have identified pitfalls that threaten the shuffling algorithms. Simple conclusion on how to avoid the pitfalls is to code a simple unbiased algorithm. Whichever bias is introduced in order to avoid problems regarding some sequence test, that bias will become the root cause to falling another sequence test. So it's best to avoid them as a whole. Shuffling algorithm that does not introduce any bias is the one that attempts to place numbers to positions in the array in such way that for any given position all the numbers are equally (and independently!) likely to be placed on that position. So let's start with the first position. We have N numbers awaiting to be shuffled, we need to pick one to place it on position 1. If we pick any of them at random and place it on position 1, then position 1 is filled in an unbiased manner. This leaves us with N-1 numbers remaining and N-1 positions to be filled. If first position was filled properly with this algorithm, then why not to apply the same thinking to the second position? Let's pick up another random number out of N-1 and place it on the second position. Now we should stop at this point to think again - is there any dependency induced between the two numbers that were picked up? Does the first number somehow affect the selection of the second one, because if it does then our algorithm is bound to fail. To see whether shuffling of the first two positions is really random, we should calculate probabilities that any numbers out of N are placed on the first two positions. We start from the stance that random numbers generator used to pick one out of N and then one out of N-1 numbers is unbiased - this is actually a fundamental requirement. Probability that any number out of N is picked for the first position is 1/N. Probability that any other number is picked up for the second position is then determined by a sequence of two events: first, that this number was not picked up in the first draw out of N and second, that the number was picked in the second draw out of N-1. We could write these two probabilities as following: These expressions show probability that any given number occupies position p after shuffling has taken place. Note that we could multiply the probabilities for p=2 because these probabilities are independent - it shows how important is the prerequisite that random number generator produces independent numbers. Now we can extend the analysis to any particular position k between 1 and N: a number is not picked in any of the steps before k, and then it is picked up in step k when only N-k+1 numbers remain to be shuffled: From this analysis we can conclude that the proposed algorithm indeed shuffles numbers in an independent way - any number is equally likely to be placed on any position in the output sequence and its placing there does not depend on placing of any other number in the sequence. Now that we have all the elements, we can write down the algorithm. Only one small modification will be made, dictated by the technology - we will first solve the number at position N, then at N-1, and so on until position 1 is resolved. The reason is quite simple - we're dealing with random number generators that generate numbers between 0 and K for any given K, which then saves one arithmetic operation that would be required to shift the range into N-K thru N. Here is the algorithm: a[1..n] - array of numbers that should be shuffled for i = n downto 2 begin k = random number between 1 and i Exchange a[i] and a[k] end That is all. Note that there is no need to shuffle the number at position 1 in this implementation because that is the only number remaining - it is already shuffled by definition, so to say. For further reference, this algorithm is known as Fisher-Yates shuffle. There are some other algorithms available, some of them meeting other needs (e.g. to generate two arrays - non-shuffled and shuffled), but this one presented above is quite sufficient in most of the practical settings. It shuffles an array of numbers in time proportional to length of the array and also shuffles it in-place so that no additional space is needed. Implementation of the Fisher-Yates shuffling algorithm is straight-forward and we will step into it without further deliberation. using System; namespace Cards { class Program { static void Shuffle(int[] cards) { for (int i = cards.Length - 1; i > 0; i--) { int index = _rnd.Next(i + 1); // Generates random number between 0 and i, inclusive int tmp = cards[i]; cards[i] = cards[index]; cards[index] = tmp; } } static void Main(string[] args) { while (true) { Console.Write("Enter number of cards (0 to quit): "); int n = int.Parse(Console.ReadLine()); if (n <= 0) break; int[] cards = new int[n]; for (int i = 0; i < n; i++) cards[i] = i + 1; Shuffle(cards); for (int i = 0; i < n; i++) Console.Write("{0,4}", cards[i]); Console.WriteLine(); } } static Random _rnd = new Random(); } } Below is the output produced by the shuffling code. Enter number of cards (0 to quit): 10 2 1 9 4 8 5 7 10 3 6 Enter number of cards (0 to quit): 5 5 4 1 3 2 Enter number of cards (0 to quit): 3 3 1 2 Enter number of cards (0 to quit): 14 10 7 8 4 1 13 14 12 9 6 11 3 5 2 Enter number of cards (0 to quit): 20 10 2 20 11 3 16 5 17 14 19 1 15 9 8 12 13 6 18 7 4 Enter number of cards (0 to quit): 0 On the first glance arrays indeed seem to be shuffled. But to be more certain we would have to apply several randomness tests, which is full heartedly suggested as a stand-alone exercise. Now that we have completed an initial run of the algorithm and obtained a few shuffled sequences out of it, the reader is suggested to turn attention to analyzing the results produced..
http://codinghelmet.com/exercises/card-shuffling
CC-MAIN-2019-04
en
refinedweb
Pistachio HTTP push middleware for Rack powered by Stash. Need events delivered to an HTTP client in realtime? Perhaps you've investigated solutions like Comet/Bayeux, BOSH, or WebSockets. Not happy with those solutions and just want something simple? Pistachio provides a simple HTTP long polling middleware for Rack, which is backed by the Stash gem. Stash provides an abstract interface to data structures servers, namely Redis. Servers like Redis provide a list data type, which can easily be used as a message queue. Redis also supports a “blocking pop” from a list, where clients will either receive the next message in the list immediately, or if the list is empty Redis will block until the next message is available (or a timeout occurs). Pistachio combines this all into a single, easy-to-use Rack middleware for delivering realtime push notification events to HTTP clients like web browsers. Using Pistachio in your Rack application Add the following to your config.ru file: Pistachio.setup :default, :adapter => :redis, :namespace => 'myapp_name', :path => '/message_path' use Pistachio::Middleware This will configure Pistachio to talk to Redis, store its messages in the 'myapp_name' Redis namespace, and mount the Pistachio Rack middleware under the /message_path path. All messages must be sent to a given named endpoint. To send a message via Pistachio within your Rack application, do: Pistachio[:foobar] << "my totally awesome message" Messages sent to the 'foobar' endpoint can be retrieved by making an HTTP GET request to /message_path/foobar. This will return one of two HTTP statuses: 200: a message was retrieved successfully 504: the request timed out before a message was received By default Pistachio uses a 30 second timeout. You can adjust this with the ':timeout' parameter to Pistachio.setup. It's the responsibility of the client to hit the given message endpoint in a loop. If the client gets a 504 response it should retry. Any other HTTP responses should be considered errors, in which case it'd be good if the client utilized exponential backoff to avoid hammering Pistachio when errors are occurring. No reference clients are presently available. Pull requests happily accepted! Copyright © 2010 Tony Arcieri. See file LICENSE for further details.
https://www.rubydoc.info/gems/pistachio/0.9.1
CC-MAIN-2021-25
en
refinedweb
nghttp2_option_set_peer_max_concurrent_streams¶ Synopsis¶ #include <nghttp2/nghttp2.h> - void nghttp2_option_set_peer_max_concurrent_streams(nghttp2_option *option, uint32_t val)¶ This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of remote endpoint as if it is received in SETTINGS frame. Without specifying this option, the maximum number of outgoing concurrent streams is initially limited to 100 to avoid issues when the local endpoint submits lots of requests before receiving initial SETTINGS frame from the remote endpoint, since sending them at once to the remote endpoint could lead to rejection of some of the requests. This value will be overwritten when the local endpoint receives initial SETTINGS frame from the remote endpoint, either to the value advertised in SETTINGS_MAX_CONCURRENT_STREAMS or to the default value (unlimited) if none was advertised.
https://nghttp2.org/documentation/nghttp2_option_set_peer_max_concurrent_streams.html
CC-MAIN-2021-25
en
refinedweb
TLSSocket is a wrapper around TCPSocket for interacting with TLS servers. More... #include <TLSSocket.h> TLSSocket is a wrapper around TCPSocket for interacting with TLS servers. TLSSocket uses the TLSSocketWrapper with internal TCP socket. This is a helper for creating commonly used TLS connections over TCP. Definition at line 47 of file TLSSocket.h. Transport modes. Definition at line 62 of file TLSSocketWrapper.h. Create an uninitialized socket. Must call open to initialize the socket on a network stack. Definition at line 53 of file TLSSocket.h. Accepts a connection on a socket. The server socket must be bound and set to listen for connections. On a new connection, returns connected network socket to call close() that deallocates the resources. Referencing a returned pointer after a close() call is not allowed and leads to undefined behavior. By default, accept blocks until incoming connection occurs. If socket is set to non-blocking or times out, error is set to NSAPI_ERROR_WOULD_BLOCK. Connect the transport socket and start handshake. See Socket::connect and start_handshake Get CA chain structure. Get own certificate directly from Mbed TLS. Get internal Mbed TLS configuration structure. Get internal Mbed TLS context structure. Get the remote-end peer associated with this socket. Copy the remote peer address to a SocketAddress structure pointed by address parameter. Socket must be connected to have a peer address associated. Get socket options. getsockopt() allows an application to retrieve stack-specific options from the underlying stack using stack-specific level and option names, or to request generic options using levels from nsapi_socket_level_t. For unsupported options, NSAPI_ERROR_UNSUPPORTED is returned and the socket is unmodified. Opens a socket. Creates a network socket on the network stack of the given network interface. Definition at line 70 of file TLSSocket.h. Receive a data from a socket. Receives a data and stores the source address in address if address is not NULL. Returns the number of bytes written into the buffer. If socket is connected, only packets coming from connected peer address are accepted. By default, recvfrom blocks until a datagram is received. If socket is set to non-blocking or times out with no data, NSAPI_ERROR_WOULD_BLOCK is returned. Send a message on a socket. The sendto() function sends a message through a connection-mode or connectionless-mode socket. If the socket is a connectionless-mode socket, the message is sent to the address specified. If the socket is a connected-mode socket, address is ignored. By default, sendto blocks until data is sent. If socket is set to non-blocking or times out, NSAPI_ERROR_WOULD_BLOCK is returned immediately. CA chain directly to Mbed TLS. Sets client certificate, and client private key. Sets client certificate, and client private key. Set hostname. TLSSocket requires hostname used to verify the certificate. If hostname is not given in constructor, this function must be used before starting the TLS handshake. Set own certificate directly to Mbed TLS. Override Mbed TLS configuration.) Set socket options. setsockopt() allows an application to pass stack-specific options to the underlying stack using stack-specific level and option names, or to request generic options using levels from nsapi_socket_level_t. For unsupported options, NSAPI_ERROR_UNSUPPORTED is returned and the socket is unmodified..
https://os.mbed.com/docs/mbed-os/v6.8/mbed-os-api-doxy/class_t_l_s_socket.html
CC-MAIN-2021-25
en
refinedweb
Three Tips to Improve your Streamlit App Environment and prerequisites Streamlit is installable on - Google colaboratory , or - Virtual environment on your local computer (Windows/ MacOS / Linux) Three tips to tweak your Streamlit app Streamlit is handy to run with dashboards or machine learning models. Here are a lists of tips on improving your app experience on Streamlit. 1. Streamlit caching Using Streamlit caching mechanism is handful to improve speed performance and to suppress warnings in certain cases. Here is an example of using Streamlit cache: @st.cache(suppress_st_warning=True, allow_output_mutation=True) – Suppress warnings via cache Warnings will pop out when your code contains some bugs. While it is always handy to see the errors, at times when the warnings does not halt app performance, it is good to hide them on the frontend (users see it!) An example of warning on streamlit (this case will affect running the app though) – Allow Output Mutations Streamlit always performs an Output Mutation Check, where a fresh hash of the output is computed and compared to the stored output_hash. If the two hashes are different, Streamlit will show a Cached Object Mutated warning. This may occur when the function arguments or body change. Setting allow_output_mutation=True disables this step. 2. Customize fonts using Inline CSS Adding inline CSS can help us apply different font family, color, or even size to a single HTML element Below is an example to customize font family, size, and even the color to orange by including in streamlit markdown. Below is the example code: import streamlit as stst.markdown(""" <style> .font {font-size:50px ; font-family: 'Cooper Black'; color: #FF9633;}</style> """, unsafe_allow_html=True)st.markdown('<p class="font">Guess the object Names</p>', unsafe_allow_html=True) Before and after using CSS to customize text: Alert : Be aware of argument `unsafe_allow_html=True’ When you set unsafe_allow_html to ‘True’ to allow customized CSS, this can be making users’ security on the webpage to become unsafe, particularly on handling cookies. 3. Caution while dealing with large image pixels. DecompressionBombError pops up when the image contains high pixels. When the image pixels pre-set limit is exceeded, Streamlit creates a warning to notify and prevent possible decompression bomb DOS attack. What you can do: - Compress your image to a smaller sizes before upload it, or - Remove pixel limit by setting Image.MAX_IMAGE_PIXELS = None AI/ML Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot
https://ramseyelbasheer.io/2021/06/04/three-tips-to-improve-your-streamlit-app/
CC-MAIN-2021-25
en
refinedweb
ASP.NET core applications in visual studio code and deploy the same on Alibaba cloud. This is a parallel article from my previous article Developing ASP.NET core. . Docker is a very popular container platform that lets you easily package, deploy, and consume applications and services. Run the following commands to install .net core sdk wget -q -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install dotnet-sdk-2.2 Note: If you have a different linux version than Ubuntu 16.04 - x64, go to and change linux version Docker 'C# for Visual Studio Code (powered by OmniSharp)' and install the extension. You can learn more on the extension at Search for 'Docker' and install the extension. You can learn more on the extension at Select Open Folder and go to documents directory. This is where we will be creating our project. VS Code has an integrated terminal which you can use to run shell commands. You can run .NET Core command-line interface (CLI) commands directly from there. Open Terminal by selecting Terminal -> New Terminal from Visual Studio Code top menu. Let's get a list of all available templates. dotnet new –l From the many different project template types, let's create a new ASP.NET Core MVC App. dotnet new mvc -n dotnetcore-alibaba-docker-tutorial --no-https The above command will create the base application and scaffold an ASP.NET Core 2.2 MVC application in a folder called dotnetcore-alibaba-docker-tutorial. The '--no-https' command option enables us to opt out of https during project creation. You can learn more on the command and other available options at From Visual Studio Code top menu, select File -> Close folder to close application in VS Code. This is where one would add their own development code. We are going to make a couple of simple changes. Select Open Folder and go to dotnetcore-alibaba-docker-tutorial folder under documents folder and open application. You'll be prompted to add some missing assets ( Require assets to build and debug are missing). This is the .vscode folder and in the same launch.json and task.json that allows you to launch and debug the application with F5, just click the Yes button. From left hand pane, select Views -> Home->index.cshtml Update the word 'Welcome' to 'Welcome to Docker on Simple Application Server'. Select Views -> Shared->layout.cshtml Update all instances of 'dotnetcore_alibaba_docker_tutorial' to 'Alibaba Cloud'. There would be three instances, one in title, one in Navbar and the last in the footer. Press the F5 button to run the application. The application will run and you would see the web application at Note: In the latest .NET Core, the development application runs over https. So, if the project was created without the ''--no-https' command option and when application was run, you would receive a warning that your connection is not private. In such cases, click the Advanced button and click Proceed to localhost (unsafe) to see the web application at.. Alibaba Cloud also provides a fast, reliable, secure, and private container registry available at . We make our images available by publishing it to this private repository. If you do not have Alibaba Cloud Account get one free at Go to Console and select Container Registry under Products. Activate the Alibaba Cloud Container Registry by providing a password and confirming the same. This password is for the container registry which is not the same as of the cloud account. Now you should be viewing the Container Registry console as shown below. A namespace is a collection of repositories and repository is a collection of images. Have a Namespace for each application and a repository for each Image. All versions of one image goes in one repository. Select Namespaces from left menu under Default Instance and in the ensuing screen click on Create Namespace button. Provide a Namespace and click on Confirm as shown in image below. A Namespace gets created. Switch off the Automatically create repository option. Go back to Repositories from left menu and select Create Repository. Provide the repository name, leave the repository type as private and provide a summary text. In the next screen select local repository as Code Source and click on Create Repository. Container Registry also allows the automatic build creation of images using a source code repository, such as Alibaba Cloud Code, Github, or Bitbucket. In the repository created, click on the Repository Name. Go through this screen and learn the commands necessary to login, pull and push images to the repository. Select Open Folder and go to dotnetcore ASP.NET Core In the next command palette screen select linux as operating system. Also provide the port that your application listens on -5000 This will add certain files to your project along with Dockerfile which describe the environment for your app including the location of the source files and the command to start the app within a container. DockerIgnore file helps keep the build context as small as possible. Let's understand what is happening in the dockerfile. At first restore the packages and dependencies application requires to build. Next, build the application and then publish the same in /app directory. At this stage .NET Core SDK available at Microsoft Container Registry (MCR) is used as base image. Next, use the .NET Core Runtime as base image and copy the binaries from /app directory, generated in the previous stage. Assembly name in ENTRYPOINT is case-sensitive and must match with assembly name in binDebug folder. In the Command Palette run Docker: Build Image to build the image. If asked for a name, accept the default one. It tags the image as [projectname]:latest. Terminal panel will open and the Docker command will be executed. Once built, the image will show up in the DOCKER explorer under Images. In the command palette type docker run and select Docker:Images run to build containers In the command palette, select the Image Group 'dotnetcore-alibaba-docker-tutorial' In the command palette, select the Image 'latest' The generated command shown in terminal and executes. The command is 'docker run' with two flags -p : This publishes the port on the container and maps it to a port on our host. The mapped port on host here is 5000 as well. -d: This runs the container in the background. You can learn more at View your application by navigating your browser to or . Unfortunately the website does not come up. Inspect running containers Docker ps Inspect container logs Docker logs [CONTAINER ID] Replace the [CONTAINER ID] with your own CONTAINER ID that you get on the command Docker ps. The logs show it is listening on port 80 by default. The mcr.microsoft.com/dotnet/core/aspnet:2.2 image sets the ASPNETCORE_URLS to port 80 which overrides other settings. Stop the running application container by right clicking on the running container and selecting stop in the DOCKER explorer under Containers . OR you could run the below command in terminal. docker stop [CONTAINER ID] Update the Dockerfile as below to explicitly specify the urls we want the kestrel web server to listen on. FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base WORKDIR /app ENV ASPNETCORE_URLS EXPOSE 5000 FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build WORKDIR /src COPY ["dotnetcore-alibaba-docker-tutorial.csproj", "./"] RUN dotnet restore "./dotnetcore-alibaba-docker-tutorial.csproj" COPY . . WORKDIR "/src/." RUN dotnet build "dotnetcore-alibaba-docker-tutorial.csproj" -c Release -o /app FROM build AS publish RUN dotnet publish "dotnetcore-alibaba-docker-tutorial.csproj" -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "dotnetcore-alibaba-docker-tutorial.dll"] Build the container and run the same as before and this time you will be able to view your application by navigating your browser to or . Open Terminal by selecting Terminal -> New Terminal from Visual Studio Code top menu Follow the commands that were available in Alibaba Cloud Container Registry Repository Guide. Login to Container Registry sudo docker login --username=arnab@xyz.abc registry-intl.ap-southeast-1.aliyuncs.com View the images available sudo docker images Tag the image sudo docker tag 183d85283e0b registry-intl.ap-southeast-1.aliyuncs.com/alibaba-docker-tutorial/dotnetcore:0.1 Push the image to Container Registry sudo docker push registry-intl.ap-southeast-1.aliyuncs.com/alibaba-docker-tutorial/dotnetcore:0.1 Verify in the Alibaba Cloud Container Registry Console under the specified repository and tags section that the image exists. Please look at the parallel article Developing ASP.NET core Login to Container Registry docker login --username=arnab@xyz.abc registry-intl.ap-southeast-1.aliyuncs.com Pull image from the registry docker pull registry-intl.ap-southeast-1.aliyuncs.com/alibaba-docker-tutorial/dotnetcore:0.1 Run Application docker run -d -p 80:5000 registry-intl.ap-southeast-1.aliyuncs.com/alibaba-docker-tutorial/dotnetcore an ASP.NET Core application using visual code on a Ubuntu linux, create a Docker image for the application, create a Alibaba Cloud Container Registry and push the image to Container Registry and finally deploy the Container Registry image on Alibaba Cloud's Simple Application Server with CentOS. Developing Node.js Apps Using Visual Studio Code with Docker on Simple Application Server Features about Internet of Things (IoT) Network 2,599 posts | 594 followersFollow Alibaba Clouder - March 6, 2019 Alibaba Clouder - September 16, 2019 Alibaba Clouder - August 17, 2020 Alibaba Clouder - September 3, 2018 Alibaba Clouder - November 27, 2018 Alibaba Clouder - September 16, 2019 Learn MoreLearn More
https://www.alibabacloud.com/blog/developing-asp-net-core-apps-using-visual-studio-code-with-docker-on-simple-application-server_595353
CC-MAIN-2021-25
en
refinedweb
In certain cases, it can make sense to make sure that a customer return is first approved by a sales manager before the return and refund clerk can process it further. You could, for example, define that a customer return with a net value that is higher than USD 1,000 or for a specific customer always need to be sent to an approver. Since CE2008, approval workflow for accelerated return is available. Now Accelerated return is integrated with My Inbox App and Notification for initiator and approver to take workflow actions. There are some special points to address for accelerated return workflow. Two Approval control collaboration For accelerated return, previously there is already a manual release (approval) control before flexible workflow introduced. The release/rejection action and status at item and document level are available. · With Mange Customer Returns App, it uses ‘SAVE & RELEASE’ to release a customer return · With WEBGUI VA01 App, the approval field at item level is available for end user to set. When a return is released (approved), the further process continues and it also auto generates follow up document, like return delivery document. With flexible workflow for accelerated return, the approval control and status are available at document level currently. Approval status is newly introduced in Manage Customer Returns App, together with the previous release status and reject status. · if flexible workflow is not used, or even workflow solution is used, but a return is workflow not relevant, the previous release and reject status still apply as before. · If a return is workflow relevant, then approval status is used, and have influence on release status and rejection status accordingly. Example (one item in each document): 60001639: it is workflow not relevant: return and refund clerk manually rejects and releases it. 60001642: workflow relevant, approver rejects it: Approval status Rejected, Release Status Not released, Rejection Status Rejected. 60001644: workflow relevant, approver releases it: Approval status Released, Release Status Released, Rejection Status Nothing Rejected. Change Released accelerated return after inspection at customer site. Normally, for a released customer return (by workflow), it is not allowed to change. But for return scenario, inspection at customer site, this is an exception. With accelerated return, it has return scenario: inspection at customer site. It might need approval from manager before sending someone to customer site for inspection. After inspection, further change on released customer return is needed to input the inspection result and final logistical follow up activity. in such case, the change on Released (by workflow) customer return is allowed, and after change, no second approval request needed. Check more customer return workflow details at help portal (CE2008)
https://blogs.sap.com/2020/09/08/accelerated-returns-approval-workflow/
CC-MAIN-2021-25
en
refinedweb
I'm having a huge problem trying to learn how to export classes from a DLL. I can do some functions just fine but the classes are mangled :S I've tried from .def file, I've used extern "C" but when I did, it threw errors and won't export the class at all. In codeblocks it won't create a .lib file so I tried linking the .a file but that still doesn't work. I'm not sure what to do. I'd probably prefer either loadlibrary or .lib but I want to learn how to do it via a .def file. Exports.hpp #ifndef EXPORTS_HPP_INCLUDED #define EXPORTS_HPP_INCLUDED #define EXPORT __declspec(dllexport) class EXPORT Point; //Forward declaration of a class I want to export. This is all I did. #endif // EXPORTS_HPP_INCLUDED Systems.hpp #ifndef SYSTEM_HPP_INCLUDED #define SYSTEM_HPP_INCLUDED #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0500 #include <Windows.h> #include <TlHelp32.h> #include <iostream> #include "Strings.hpp" #include <Time.h> #include <vector> #include "Exports.hpp" EXPORT DWORD SystemTime(); EXPORT DWORD GetTimeRunning(); EXPORT DWORD TimeFromMark(int TimeMarker); EXPORT std::string TheTime(); EXPORT int AddOnTermination(void(*function)(void)); EXPORT std::string GetEnvironmentVariables(const std::string Variable); EXPORT void SetTransparency(HWND hwnd, BYTE Transperancy = 0); #endif // SYSTEM_HPP_INCLUDED Then in the CPP file I just have the definitions of each of those functions. They don't have the EXPORT infront of them. For classes I just forward declare them in the Exports header and put export betwee class and the classname. My Main file looks like: #include "System.hpp" //File that includes the exports. BOOL WINAPI } I have around 200 classes to export and about 300 functions. I don't mind exporting the functions one by one or using a def file with ordinal exportation but I have no clue how to do the classes. Any idea? How do I write the typedef for a class? Am I exporting them right?
https://www.daniweb.com/programming/software-development/threads/427330/export-classes-and-functions-in-a-dll
CC-MAIN-2021-25
en
refinedweb
Part 1: Boost python with c/c++ bindings. Beginners’ friendly guide to start embedding c/c++ shared libraries in python. Python is a very easy, but versatile programming language used almost everywhere. Being an interpreted language it naturally lags behind in terms of speed of execution. In this tutorial you will learn on how to make your python program faster using c/c++ code. Let’s start. Note: here are the requirements you need to meet:- Visual Studio 2019 (don’t confuse it with Visual Studio Code)- installed python- pycharm community edition- OS: windows 10 There are 3 things we need to do: - create a c/c++ shared library in Visual Studio - create python module to consume the c/c++ code (shared library) - run and check how program works 1: create c/c++ shared library in Visual Studio - Add new DLL (Dynamic-Link Library) project in Visual Studio Note: in windows shared library has extension .dll whereas on Linux it’s .so — here more info. Now create two files with implementation given below: - test.h (header file) - test.cpp (cpp file) Note: This is just an example of sum function implemented in c++ and used in python. In later tutorials we’re going to have more advanced use cases. // test.h#pragma once #include <string>int sum(int, int); Let’s analyse what’s in the test.h: - pragma once makes sure that the file is loaded only once at a precompiling step. Simply, c/c++ merge all source files into one file before compilation to binary code, and it makes sure there is only one copy of this file. - #include <string> this is a header from the source code. Simply, it allows using strings and its corresponding functions. - int sum(int, int) this is a very simple function declaration that returns integer value as a sum of two other integers. //test.cpp#include “pch.h” #include <string>#define DLLEXPORT extern “C” __declspec(dllexport)DLLEXPORT int sum(int a, int b) { return a + b; } Let’s analyse what’s in the test.cpp: - #include “pch.h” this is auto generated precompiled header needed for shared library (dynamic library) using Visual Studio. An explanation is far beyond this tutorial. One thing to remember is to make sure that #include “pch.h” is at the top of the file cause everything above will not compile (this is just how compilation works :) ) - #include <string> please look above - #define DLLEXPORT extern “C” __declspec(dllexport) — define means that DLLEXPORT == extern “C” __declspec(dllexport) and now it may be used below in the code. extern c means that our function sum will have the same name in python program (in a nutshell). __declspec(dllexport) makes sure that the function will be visible to python. - int sum(int a, int b){ return a+b} this is just a function implementation of our function. And now let’s compile our simple program. You need to click a green triangle at the middle top in Visual Studio. We are done with c++! Note: when you build your project make sure to have the same build configuration as python. For example if you have python 64 bit you need to build c/c++ on 64 bit as well. You can check your python build version on a python console at the bottom of the Pycharm: 2: create python module to consume the c/c++ code (shared library) - create new python project in the IDE - create python file example_1.py with below implementation from ctypes import * if __name__ == "__main__": mydll = cdll.LoadLibrary(r"C:\Users\PC\PycharmProjects\shared_library_example\your_project_name.dll") print(mydll.sum(10, 10)) Let’s analyse what’s in the example_1.py: - from ctypes import * — is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python. - cdll.LoadLibrary — this function loads our shared library. - print(mydll.sum(10, 10)) — here we’re printing the sum of 10 and 10 defined in the shared library we’ve just loaded. 3: run and check how program works To run python program we have two options: - from IDE (example shown in pycharm) - from terminal - run python program from a pycharm IDE At the right top bottom there should a green triangle. Click it, and you will see the script output at the bottom of the pycharm IDE. - from a terminal Open a terminal (search for PowerShell in the windows). Then type cd location/of/your/python/program like: Then type python ./example_1.py In the next tutorial I will show a reverse — how to run python from c/c++ program. Wish you best!
https://maciejzalwert.medium.com/part-1-boost-python-with-c-c-bindings-d68245bc08f2?source=---------8----------------------------
CC-MAIN-2021-25
en
refinedweb
The Build an Array With Stack Operations Leetcode Solution problem provides us with an integer sequence and an integer n. The problem states that we are given a sequence of integers from 1 to n. Then we use a stack to produce an integer sequence that is given to us as input. We can only use “Push” and “Pop” operations to obtain the given sequence. So, let us see a few examples before moving ahead with the solution. target = [1,3], n = 3 ["Push","Push","Pop","Push"] Explanation: The operations given in the output can be verified on the sequence from 1 to n (=3). First, we push the first integer(=1) to the stack. Then since we can not ignore the integer (=2), we first push it into the stack, then pop it. Because the integer 2 is not in the output sequence. In the end, we push the third integer (=3) into the stack. Thus the required output is obtained. target = [1,2,3], n = 3 ["Push","Push","Push"] Explanation: Since we have all the integers from the given sequence of 1 to n in the stack. We push all the integers into the stack. Thus we have 3 “Push” operations as output. Approach for Build an Array With Stack Operations Leetcode Solution The problem Build an Array With Stack Operations Leetcode Solution, as previously stated asked us to output the operations that a stack should act upon to produce the required output. The question is purely ad-hoc. And requires us to formulate an algorithm that can somehow find the stack operations. For solving the problem, we create a variable “should_ve” that is initialized with 1. Then we proceed with a for loop that starts from 1 and stimulates the process of traversing over the sequence from 1 to n. We keep the variable should_ve to keep track of Push and Pop operations for the elements that do not find their place in the output sequence. So, to summarise the algorithm, we push each element but simply pop the elements that we don’t need. Code for Build an Array With Stack Operations Leetcode Solution C++ code #include <bits/stdc++.h> using namespace std; vector<string> buildArray(vector<int>& target, int n) { vector<string> output; int should_ve = 1; for(int i=1;i<=target.size();i++){ if(target[i-1] != should_ve){ int cnt = target[i-1]-should_ve; while(cnt--) output.push_back("Push"), output.push_back("Pop"); } output.push_back("Push"); should_ve = target[i-1] + 1; } return output; } int main(){ vector<int> target = {1, 3}; int n = 3; vector<string> output = buildArray(target, n); for(auto x: output) cout<<x<<" "; } Push Push Pop Push Java code import java.util.*; import java.lang.*; import java.io.*; class Main { public static List<String> buildArray(int[] target, int n) { List<String> output = new ArrayList<String>(); int should_ve = 1; for(int i=1;i<=target.length;i++){ if(target[i-1] != should_ve){ int cnt = target[i-1] - should_ve; while(cnt-- > 0){ output.add("Push"); output.add("Pop"); } } output.add("Push"); should_ve = target[i-1] + 1; } return output; } public static void main (String[] args) throws java.lang.Exception { int[] target = {1, 3}; int n = 3; List<String> output = buildArray(target, n); for(String x: output) System.out.print(x+" "); } } Push Push Pop Push Complexity Analysis Time Complexity O(N), since we traverse over each of the elements from 1 to n. Thus the time complexity is linear. Space Complexity O(N), because we need to use an intermediate vector/array to store the output.
https://www.tutorialcup.com/leetcode-solutions/build-an-array-with-stack-operations-leetcode-solution.htm
CC-MAIN-2021-25
en
refinedweb
Unit testing in Python (IDE) or you can use CLI Install Xcode or the alternative is installing Command Line Tools in Mac (less in size compared to Xcode) How to Install Command Line Tools in Mac OS X (Without Xcode) you got go to this site If it still gives errors try this //taken from stack overflow xcode-select — print-path # in my case /Library/Developer/CommandLineTools # the next line deletes the path returned by the command above sudo rm -rf $(xcode-select — print-path) # install them (again) if you don’t get a default installation prompt xcode-select — install Or go to this site Unit testing is a software testing method which determines the quality of your code. Generally, when the development process is complete, the developer codes criteria, or the results that are known to be potentially practical and useful, into the test script to verify a particular unit’s correctness. During test case execution, various frameworks log tests that fail any criterion and report them in a summary. The developers are expected to write automated test scripts, which ensures that each and every section or a unit meets it’s design and behaves as expected. The Python unit testing framework, sometimes referred to as “PyUnit,” is a Python language version of JUnit, by Kent Beck and Erich Gamma. JUnit is, in turn, a Java version of Kent’s Smalltalk testing framework. The unit test framework in Python is called unittest, which comes packaged with Python. Unit testing makes your code future proof since you anticipate the cases where your code could potentially fail or produce a bug. Though you cannot predict all of the cases, you still address most of them. Knowing how to write assert statements in Python allows you to easily write mini-tests for your code. Generally unit tests are written with assert statements. There are Many types of assert statements. Here I have shown only a few. Here I have two stocks and written tests on the ratio of two stock prices and test if the ratio is less than one, equal to one or greater than one. I have given the price of two stocks for testing the condition and the ratio = price_a/price_b . //also import the specific function from the file on which the tests are run //from file import functions or * for importing all //we are testing on the getRatio function which is in another file //Self here is the instance of the class import unittest class ClientTest(unittest.TestCase): def test_getRatio_priceBZero(self): price_a = 119.2 price_b = 0 self.assertIsNone(getRatio(price_a, price_b)) assertIsNone(expr, msg=None) This function will take two parameters as input and return a boolean value depending upon assert condition. If input value is equal to None assertIsNone() will return true else return false. def test_getRatio_priceAZero(self): price_a = 0 price_b = 121.68 self.assertEqual(getRatio(price_a, price_b), 0) assertEqual(first, second, msg=None) Test that first and second are equal. If the values do not compare equal, the test will fail. def test_getRatio_greaterThan1(self): price_a = 346.48 price_b = 166.39 self.assertGreater(getRatio(price_a, price_b), 1) assertGreater(first, second, msg=None) This function will take three parameters as input and return a boolean value depending upon the assert condition. This function checks that if the first given value is greater than the second value and returns true if it is so, else returns false if the first value is not greater than the second value. def test_getRatio_LessThan1(self): price_a = 166.39 price_b = 356.48 self.assertLess(getRatio(price_a, price_b), 1) assertLess(first, second, msg=None) This function will take three parameters as input and return a boolean value depending upon the assert condition. This function checks that if the first given value is less than the second value and returns true if it is so, else returns false if the first value is not less than the second value. def test_getRatio_exactlyOne(self): price_a = 356.48 price_b = 356.48 self.assertEqual(getRatio(price_a, price_b), 1) if __name__ == ‘__main__’: unittest.main() Resources unittest — Unit testing framework — Python 3.9.2 documentation
https://arpita-dutta.medium.com/unit-testing-in-python-be44a86f02f4
CC-MAIN-2021-25
en
refinedweb
flutter_gh_fetch 0.0.3 flutter_gh_fetch: ^0.0.3 copied to clipboard flutter_gh_fetch # Minimal package for fetching GitHub user info and paginated list of repositories. The project is similar to my NPM library github-repo-fetch, with the exception that, obviously, it's written in Dart, and that it supports pagination, as well as filterning of private and public repositories. Installation # Depend on the package dependencies: flutter_gh_fetch: ^0.0.3 and then import it inside your Dart code import 'package:flutter_gh_fetch/flutter_gh_fetch.dart'; Usage # This library uses GitHub GraphQL API in order to fetch data related to the user and their repositories. The authentication is conducted through the use of Personal Access Token, which you need to generate. First, you need to create an instance of FlutterGHFetch class and call init() method. final FlutterGhFetch ghFetch = FlutterGHFetch('token'); await ghFetch.init(); To fetch user details, call queryUserData() method Map<String, dynamic> userData = await ghFetch.queryUserData(); For fetching repositories, you have three options: you can simply query first n repositories final reposData = await ghFetch.queryRepositoryData(n); or use a cursor to achieve pagination, so first n repositories after cursor final reposData = await ghFetch.queryRepositoryData(n, after: cursor); Lastly, you can filter out private repositories (so you only display public ones) by setting filterPrivate optional argument to true final reposData = await ghFetch.queryRepositoryData(n, filterPrivate: true); In order to fetch the total repository count for the user (both public and private repositories, you can call queryTotalRepoCount method final totalCount = await ghFetch.queryTotalRepoCount(); Development and License # The library is not gonna get any additional development after the last version, but feel free to fork the project and work on it. Upon cloning it, install necessary dependencies with flutter pub get. The test directory holds a single test file which tests all public methods of the FlutterGHFetch class. You will need to hardcore your Personal Access Token, and cursor string. This project is licensed under the MIT license.
https://pub.dev/packages/flutter_gh_fetch
CC-MAIN-2021-25
en
refinedweb
With respect of a given array of positive integers, we replace each element in the array so that the difference between adjacent elements in the array is either less than or equal to a given target. Now, our task to minimize the adjustment cost, that is the sum of differences between new and old values. So, we basically need to minimize Σ|A[i] – Anew[i]| where 0 ≤ i ≤ n-1, n is denoted as size of A[] and Anew[] is denoted as the array with adjacent difference less than or equal to target. Let all elements of the array is smaller than constant M = 100. arr = [56, 78, 53, 62, 40, 7, 26, 61, 50, 48], target = 20 Minimum adjustment cost is 35 For minimizing the adjustment cost Σ|A[i] – Anew[i]|, for all index i in the array, we remember that |A[i] – Anew[i]|should be as close to zero as possible. It should be noted that also, |A[i] – Anew[i+1] ]| ≤ Target. Here, this problem can be solved by dynamic programming(DP). Assume dp1[i][j] represents minimal adjustment cost on changing A[i] to j, then the DP relation is defined by – dp1[i][j] = min{dp1[i - 1][k]} + |j - A[i]| for all k's such that |k - j| ≤ target In this case, 0 ≤ i ≤ n and 0 ≤ j ≤ M where n is number of elements in the array and M = 100. So, all k values are considered in this way such that max(j – target, 0) ≤ k ≤ min(M, j + target) At last, the minimum adjustment cost of the array will be min{dp1[n – 1][j]} for all 0 ≤ j ≤ M. // C++ program to find minimum adjustment cost of an array #include <bits/stdc++.h> using namespace std; #define M1 100 //Shows function to find minimum adjustment cost of an array int minAdjustmentCost(int A1[], int n1, int target1){ // dp1[i][j] stores minimal adjustment cost on changing // A1[i] to j int dp1[n1][M1 + 1]; // Tackle first element of array separately for (int j = 0; j <= M1; j++) dp1[0][j] = abs(j - A1[0]); // Perform for rest elements of the array for (int i = 1; i < n1; i++){ // Now replace A1[i] to j and calculate minimal adjustment // cost dp1[i][j] for (int j = 0; j <= M1; j++){ // We initialize minimal adjustment cost to INT_MAX dp1[i][j] = INT_MAX; // We consider all k such that k >= max(j - target1, 0) and // k <= min(M1, j + target1) and take minimum for (int k = max(j-target1,0); k <= min(M1,j+target1); k++) dp1[i][j] = min(dp1[i][j], dp1[i - 1][k] + abs(A1[i] -j)); } } //Now return minimum value from last row of dp table int res1 = INT_MAX; for (int j = 0; j <= M1; j++) res1 = min(res1, dp1[n1 - 1][j]); return res1; } // Driver Program to test above functions int main(){ int arr1[] = {56, 78, 53, 62, 40, 7, 26, 61, 50, 48}; int n1 = sizeof(arr1) / sizeof(arr1[0]); int target1 = 20; cout << "Minimum adjustment cost is " << minAdjustmentCost(arr1, n1, target1) << endl; return 0; } Minimum adjustment cost is 35
https://www.tutorialspoint.com/find-minimum-adjustment-cost-of-an-array-in-cplusplus
CC-MAIN-2021-25
en
refinedweb
#include <PcapDevice.h> An abstract class representing all libpcap-based packet capturing devices: files, libPcap, WinPcap/Npcap and RemoteCapture. This class is abstract and cannot be instantiated Clear the filter currently set on device Implements pcpp::IFilterableDevice. A static method for retreiving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for pcap_lib_version() Get statistics from the device Implemented in pcpp::PcapLiveDevice, pcpp::PcapNgFileWriterDevice, pcpp::PcapFileWriterDevice, pcpp::PcapNgFileReaderDevice, pcpp::PcapFileReaderDevice, and pcpp::PcapRemoteDevice. Match a raw packet with a given BPF filter. Notice this method is static which means you don't need any device instance in order to perform this match Match a raw packet with a given BPF filter. Notice this method is static which means you don't need any device instance in order to perform this match Set a filter for the device. When implemented by the device, only packets that match the filter will be received. Please note that when the device is closed the filter is reset so when reopening the device you need to call this method again in order to reactivate the filter Implements pcpp::IFilterableDevice. Reimplemented in pcpp::PcapNgFileWriterDevice, and pcpp::PcapNgFileReaderDevice. Verify a filter is valid
https://pcapplusplus.github.io/api-docs/classpcpp_1_1_i_pcap_device.html
CC-MAIN-2021-25
en
refinedweb
Specifying a Culture The RadTimePicker control supports. RadTimePicker supports all the cultures in the System.Globalization namespace that are based on the Gregorian calendar. For East Asian, Middle Eastern and other similar cultures, which have an alternative standard for a different Calendar implementation, RadTimePicker supports their localization and native date and time value representation, but automatically uses the Gregorian calendar internally. CultureInfo The CultureInfo class " All RadTimePicker control lets you associate a CultureInfo object with the control to govern the formatting and parsing of date and time values. To do this you need to set the Culture property of RadTimePicker. On RadTimePicker you can assign a separate CultureInfo object to the embedded popup time view control by setting the Culture property for it. The associated CultureInfo object controls: The default format for date and time values that the control displays. You can override this pattern by specifying a date format pattern as the value of the following properties: On RadTimePicker - the DateFormat and DisplayDateFormat properties of the embedded RadDateInput control (accessed through the DateInput property). On RadTimePicker - the TimeFormat property of the embedded RadTimeView control (accessed through the TimeView property). The way RadTimePicker parses values that the user types into the input area. Assigning the culture declaratively You can assign the culture of a RadTimePicker control declaratively in the source: <telerik:RadTimePicker </telerik:RadTimePicker> Assigning the culture in the code-behind You can assign a culture property in the code-behind as well: protected void Page_Load(object sender, EventArgs e) { RadTimePicker1.Culture = new System.Globalization.CultureInfo("fr-FR", true); } Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load RadTimePicker1.Culture = New System.Globalization.CultureInfo("fr-FR", True) End Sub
https://docs.telerik.com/devtools/aspnet-ajax/controls/timepicker/accessibility-and-internationalization/specifying-a-culture
CC-MAIN-2018-39
en
refinedweb
Hi there, I was reading the AS7.1 JNDI Reference when I encountered the following interesting fragment under the headings Binding entries to JNDI / Using a deployment descriptor: {code:xml} <env-entry> <env-entry-name>java:global/mystring</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>Hello World</env-entry-value> </env-entry> {code} This looks like a useful thing to do (binding stuff into the global JNDI namespace from a deployment descriptor) and the docs imply that this is spec compliant behaviour. However, I've trawled through both the "Java™ Platform, Enterprise Edition (Java EE) Specification, v6" and "Java™ Servlet Specification Version 3.0 Rev a" and they both say that the specified env-entry-name is a component relative name (ie. relative to java:comp/env/). So, is this a JBoss extension? Or is this behaviour specified somewhere that I've not looked? Stephen Coy wrote: So, is this a JBoss extension? Or is this behaviour specified somewhere that I've not looked? It's a spec mandated behaviour. Section EE.5.2.1 of Java EE 6 spec has the details which includes: By default, environment entries declared by application components are created in the java:comp/env namespace. Environment entries may be declared in any one of the defined namespaces by explicitly including the namespace prefix before the name. My document search for "env-entry-name" was a miserable failure here . After reading this content I can see that the example in the documentation should probably read: {code:xml} <env-entry-name>java:global/env/mystring</env-entry-name> {code} so I can fix that if there's no objections.
https://developer.jboss.org/thread/195735
CC-MAIN-2018-39
en
refinedweb
Flask-SQLAlchemy Unittest Runs Twice I've set up my project up like this: - proj/ - proj.py - views.py - tests.py - models.py - settings.py - setup.py In proj.py I defined app and db: from flask import Flask from flask_sqlalchemy import SQLAlchemy from proj import settings app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = settings.DATABASE db = SQLAlchemy(app) views just contains the hooks for the app. models contains the SQLAlchemy models. The relevant portions of test: from flask import Flask from flask_testing import ( TestCase, LiveServerTestCase, ) class SqlalchemyUnittest(TestCase): SQLALCHEMY_DATABASE_URI = "sqlite://" TESTING = True def create_app(self): proj.app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' proj.app.config['PRESERVE_CONTEXT_ON_EXCEPTION'] = False proj.app.config['TESTING'] = True proj.app.config['DEBUG'] = True proj.app.testing = True proj.app.debug = True return proj.app def setUp(self): proj.db.create_all() def tearDown(self): proj.db.session.remove() proj.db.drop_all() class TestSomething(SqlalchemyUnittest): def test_something(self): self.assertEqual(1, 1) And then in the actual execution... test_something (proj.tests.TestSomething) ... ok test_something (proj.tests.TestSomething) ... ok ---------------------------------------------------------------------- Ran 2 tests in 0.010s OK The odd thing is that on some of the tests they pass one one of the runs, but fail on another, though the tests are independent of the environment (e.g. the database state). It almost seems as though there are .pyc files hanging around, but I've deleted all the .pyc files and __pycache__ directories and still get the same result. Any ideas why? Thanks. tl;dr Python unit tests run twice, and sometimes give varying results.! - patching while testing flask app causes AssertionError: View function mapping is overwriting an existing endpoint function I am trying to write tests for a Flask app. Currently I have a test that looks like this in a file called test.py. import mock from test_helpers import mock_volume_views_setup class UserTest(unittest.TestCase): def setUp(): <some set up> def tearDown(): <some tear down> @mock.patch('brain_db.views.volume_views_setup') def test_labeled_scan(self, mock_volume_views_setup): # test that if path to atlas exists in the container, self.register_and_commit_user() self.login_profile_consent() self.upload('static/test.nii.gz', 1, '04/04/2008', 'GE', '1.5T') rv = self.app.get('/label_view/1', follow_redirects=True) response = str(rv.data) assert "MRI not labeled yet" not in response test.py lives a top level directory, flask_brain_db. In flask_brain_db/brain_db/views.py lives the route I'm trying to test. A highly simplified version: from brain_db_helpers import volume_views_setup @app.route('/surface_test') def surface_test(): return render_template('brain_db/surf_view.html') @app.route('/label_view/<int:scan_number>') @login_required def label_view(scan_number): a, b, c, d = volume_views_setup(scan_number, resource_type='atlas') if os.path.exists(a): return render_template('brain_db/scan_view.html') When I try to run my test, I get FAIL: test_labeled_scan (test.UserTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 1297, in patched arg = patching.__enter__() File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 1353, in __enter__ self.target = self.getter() File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 1523, in <lambda> getter = lambda: _importer(target) File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 1210, in _importer thing = _dot_lookup(thing, comp, import_path) File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 1199, in _dot_lookup __import__(import_path) File "/usr/src/app/flask_brain_db/brain_db/views.py", line 36, in <module> @app.route('/surface_test') File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1250, in decorator self.add_url_rule(rule, endpoint, f, **options) File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 66, in wrapper_func return f(self, *args, **kwargs) File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1221, in add_url_rule 'existing endpoint function: %s' % endpoint) AssertionError: View function mapping is overwriting an existing endpoint function: surface_test I understand what this error is trying to communicate. Somehow my patch decorator is, in an import, re-executing code that defines the routes in views.py, leading to the error. (The error doesn't appear without the patch decorator and mock function). But I don't understand why, or how I am supposed to patch my helper method. I have really struggled with understanding the correct way to refer to the method that needs patching, but looking at this question for example I think I'm doing it right. - Setting environment variables inside PHP unit tests I'm doing some basic unit testing on a utility function I made years ago but it involves accessing the $_SERVERarray. Since my unit tests are run from the command line, I have to manually set the values of the array myself. This works well using GitLab Runners because on the .gitlab-ci.ymlfile I just do something like: before_script: - export SERVER_PORT="80" - export SERVER_NAME="gitlab" My test is currently unable to test all statements from that function as it checks for the $_SERVER['SERVER_NAME']value. Unit Test public function testGetEnvironment() { shell_exec('set SERVER_NAME="localhost"'); $this->assertEquals("localhost", $this->util->get_environment()); shell_exec('set SERVER_NAME="gitlab"'); $this->assertEquals("gitlab", $this->util->get_environment()); } NOTE: I had to use setas I am on a Windows machine while our GitLab Runner is on a Linux machine so I used exporton the gitlab-ci.ymlfile. I was expecting this test to pass but it seems like the command to set the environment variable using shell_execisn't changing the value at all. I still get the value from what was defined from the YAML file. Update Here's the failure message: 1) UtilTest::testGetEnvironment Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'localhost' +'gitlab' - How can I correctly set the local currency when testing with Jest? When testing an IntL money conversion inside Jest, I don't get the correct conversion. My test: expect(new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(50.00)).toBe('R$ 50,00'); // Expected value to be: // "R$ 50,00" // Received: // "R$ 50.00" My command: jest --config test/unit/jest.conf.js How can I set the correct locale configuration to Jest? - Unable to send.a put request with a header in Rspec Here's my PUT request: put :my_action123, params: { var1: var1, var2: var2, var3: var3 }, headers: { "X-My-Header" => "something" } And here's an error: Failure/Error: put :my_action123, params: { var1: var1, var2: var2, var3: var3 }, headers: { "X-My-Header" => "something" } ArgumentError: unknown keyword: headers Despite the fact that this what's suggested to use to set headers. - "Path cannot be found" Pester Test Results Im testing out a script on Pester. I keep getting a Path cannot be found error. Apparently something is wrong with some of my lines. $userFolders = Get-ChildItem C:\Users -Directory foreach($folder in $userFolders) { Get-ChildItem C:\Users\$folder\AppData\Local\Temp -Recurse | Remove-Item -Recurse -Force Get-ChildItem C:\Users\$folder\AppData\Local\Google\Chrome\User Data\Default\Cache -Recurse | Remove-Item -Recurse -Force } Get-ChildItem C:\Windows\Temp -Recurse | Remove-Item -Recurse -Force I can't seem to find what is wrong, but I know it is somewhere here. Any help would be greatly appreciated. - Flask linking to home page best practice I have a flask application which has a route like below: @app.route('/', defaults={'page': 'front'}) @app.route('/<page>') def static(page): return render_template(page + '.html') So I can access URLs like / or /about. in my layout and some other route, I used to link the front page. in my templates: <a href="{{ url_for('static', page_name='front') }}">Home</a> or Home Which one is more reliable to changes later. For example, if I built a news section for my website and make it my front page. Which one is easier? - Passing Flask WTForms validations to Bootstrap Alerts via Flask-Bootstrap new Flask user here...I am building a pretty file upload button for my flask app. The button essentially makes use of WTForms to validate that only csv and txt files can be uploaded. The upload works, but how can I pass validation errors to the screen as a bootstrap alert? For example: - pressing the upload button will generate an alert "no file selected" - pressing upload with a jpeg will generated "wrong file format" any suggestions will be appreciated! My forms.py: class UploadForm(FlaskForm): validators = [FileRequired(message='There was no file!'), FileAllowed(['csv', 'txt'], message='Must be a csv file!')] input_file = FileField('', validators=validators) submit = SubmitField(label="Upload") my route.py: @app.route('/upload', methods=['GET', 'POST']) def upload(): form = UploadForm() if request.method == 'POST' and form.validate_on_submit(): input_file = request.files['input_file'] # Do stuff filename = secure_filename(input_file.filename) # save file to disk to some folder defined in a separate config file.... data = os.path.join(SOME_UPLOAD_FOLDER, filename) input_file.save(data) return redirect(url_for('upload')) else: return render_template('upload.html', form=form) and finally the HTML/CSS/JS: {% extends "bootstrap/base.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block html_attribs %} <meta http- {% endblock %} {% block styles %} <!--"> <style> #browsebutton { background-color: white; } #my-file-selector { display: none; } </style> {% endblock %} {% block content %} <div class="container"> <div class="jumbotron"> <h3>File Uploader Example</h3> <div class="row"> <form class="form-inline center-block" action="/upload" method="POST" enctype="multipart/form-data"> {{ form.hidden_tag() }} <div class="input-group"> <label id="browsebutton" class="btn btn-default input-group-addon" for="my-file-selector"> {{ form.input_file(<> <!-- pretty upload button --> <script> $(function() { // We can attach the `fileselect` event to all file inputs on the page $(document).on('change', ':file', function() { var input = $(this), numFiles = input.get(0).files ? input.get(0).files.length : 1, label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); input.trigger('fileselect', [numFiles, label]); }); // We can watch for our custom `fileselect` event like this $(document).ready( function() { $(':file').on('fileselect', function(event, numFiles, label) { var input = $(this).parents('.input-group').find(':text'), log = numFiles > 1 ? numFiles + ' files selected' : label; if( input.length ) { input.val(log); } else { if( log ) alert(log); } }); }); }); </script> {% endblock %} - where() does not process parameters as expected in sqlalchemy table = engine.getFTable(); dBtable = table; query = select([dBtable.c.id]).where( dBtable.c.FName == 'F1' ); print(query); This gets the right table but for some reason the query constructed is not the what one would expect. The following is the query constructed SELECT "FList".id FROM "FList" WHERE "FList"."FName" = ? instead of SELECT "FList".id FROM "FList" WHERE "FList"."FName" = 'F1' - Have SQLAlchemy-Continuum Add New Version Only When Certain Columns are Updated I am currently using SQLAlchemy-Continuum to implement a version control system for templates created by users of my app. Is there any way to prevent SQLAlchemy-Continuum from adding entries to the version table when only certain fields are updated? I tried using the excludeparameter in my configuration, but this didn't seem to work. The columns were removed from the version table, but new versions were being created when only the fields in question were modified. - SQLAlchemy defers loading updated_at column when using mapper events I have a SQLAlchemy model defined which contains an updated_at attribute: updated_at = db.Column(db.DateTime, default=db.func.now(), onupdate=db.func.now()) I have a couple of mapper events defined on the model as well: @listens_for(Drive, 'after_insert') def insert_listener(mapper, connect, self): from api.drive import operations operations.after_create(self) @listens_for(Drive, 'after_update') def update_listener(mapper, connect, self): from api.drive import operations operations.after_update(self) I am uploading the model as a json to a document store in the after_createand after_updateroutines. I am noticing that SQLAlchemy doesn't load the update_at attribute unless explicitly queried for in the after_*routines, and as a result, the updated_at timestamp never makes it to the document store. If I log model.updated_atright before uploading the object, it works fine. I haven't configured deferred loading of this attribute in the model definition, but SQLAlchemy seems to be doing so under the covers.
http://quabr.com/47296999/flask-sqlalchemy-unittest-runs-twice
CC-MAIN-2018-39
en
refinedweb
SCDJWS Study Guide: WSDL Printer-friendly version | Mail this to a friend WSDL Document Structure A WSDL document is an XML document that adheres to the WSDL XML schema. The WSDL schema is available at. Theoretically, WSDL can be used to describe any kind of Web service. In this document, only Web services that are SOAP based and compliant with the WS-I Basic Profile 1.0. are described. The WSDL document is divided into six major elements which come from the “” namespace. The <definitions> element MUST be the root element of all WSDL documents. It defines the name of the web service, declares multiple namespaces used throughout the remainder of the document, and contains all the service elements described here. The <types> element describes all the data types used between the client and server. WSDL is not tied exclusively to a specific typing system, but it uses the W3C XML Schema specification as its default choice. If the service uses only XML Schema built-in simple types, such as strings and integers, the types element is not required. The <message> element describes a one-way message, whether it is a single message request or a single message response. It defines the name of the message and contains zero or more message <part> elements, which can refer to message parameters or message return values. The <portType> element combines multiple message elements to form a complete one-way or round-trip operation. For example, a portType can combine one request and one response message into a single request/response operation, most commonly used in SOAP services. Note that a portType can (and frequently does) define multiple operations. The <binding> element describes the concrete specifics of how the service will be implemented on the wire. WSDL includes built-in extensions for defining SOAP services, and SOAP-specific information therefore goes here. The <service> element defines the address for invoking the specified service. Most commonly, this includes a URL for invoking the SOAP service. In addition to the six major elements, the WSDL specification also defines the following utility elements: The <documentation> element is used to provide human-readable documentation and can be included inside any other WSDL element. The <import> element is used to import other WSDL documents or XML Schemas. This enables more modular WSDL documents. For example, two WSDL documents can import the same basic elements and yet include their own service elements to make the same service available at two physical addresses. Note, however, that not all WSDL tools support the import functionality as of yet. NOTE: The WSDL schema requires that all sections appear in a specific order: import, types, message, portType, binding, and service. Each abstract section may be in a separate file by itself and imported into the main document.
http://xyzws.com/scdjws/SGS21/2
CC-MAIN-2018-39
en
refinedweb
A series that displays data as individual bars stacked using the StackedGroup value and grouped by arguments. public class SideBySideStackedBarSeries extends StackedBarSeries The height of each bar is determined by the data value. The following image demonstrates Stacked Side-by-Side Bar series: Initializes a new SideBySideStackedBarSeries class instance with default parameters. public SideBySideStackedBarSeries() Returns the stack index identifying what values should be combined into one bar. public int getStackedGroup() Specifies the stack index identifying what values should be combined into one bar. public void setStackedGroup(int id)
https://docs.devexpress.com/NativeCharts/com.devexpress.dxcharts.SideBySideStackedBarSeries
CC-MAIN-2018-39
en
refinedweb