content
string | pred_label
string | pred_score
float64 |
---|---|---|
Issc340 Week 6 Assignment
In: Computers and Technology
Submitted By cunninghams04
Words 297
Pages 2
Name: Jerry Cunningham Date: 16 March 2015
ISSC340 Week 6 Assignment (3% of Grade) APUS/Sanford
Lesson 6 Review: Transmission Media
The purpose of this activity is to reinforce what you have learned so far about local area networks technologies.
1. What is the difference between standard voice-grade cabling and data-grade cabling? (Min. word count: 30)
When determining the difference between voice-grade cabling and data-grade cabling, user much keeps in mind that twisted pair cables such as voice grade can support data speed of 19Kbp up to a distance of six miles. On the other hand data grade cabling have a speed of to 100 Mbps.
2. True or false: A diameter of a 22AWG twisted-pair cable is smaller than a 26AWG twisted pair cable? Explain… (Min. word count: 10)
The answer would be false because due to being bigger in the numbers of AWG the diameter of the cable would be much smaller
3. In which frequency bands to do short-range wireless transmission operate? (Min. word count: 10)
When dealing with frequency band short-range wireless operates in both 2.4(Ghz) microwave band and 5 (Ghz) band
4. What are the two types of light source used to transmit signals over optical fiber? (Min. word count: 10)
According to textbooks, the two different types of light source use to transmit signals over optical fiber are: analog and digital data
5. True or false: Bluetooth is a good example of short-range wireless transmission. Explain. (Min. word count: 10)
The answer is : True
Short-range wireless is used both for networking PCs and for connecting PC to peripherals. The most common standard for wireless networking is 802.11 Ethernet. The most common standard for peripheral device communications is Bluetooth.…...
Similar Documents
Week 6 Assignment
...GM 592 Skill Development Assignment Week 6 Well the company that I work for is a high performance culture as for what is expected of its employees and the mission and values of the company. The slogan is the “customer is always right “. We have to bend over backwards sometime to satisfy the customer’s needs. However, if I was to look at everything internally I would say that it is a low performance culture because insular things and resistance to change. Management to me is a dictator ship when it comes down to making changes. The send out the e-mail of what is expected for us to do but they do not work in the stores or know how much extra time it will take to implement the changes. My current boss basically reads the e-mails tell us what they say and then it is just do it. He never questions the changes because for one there is nothing he can do about it but his approach is so dry to where I personally have some sort of resistance. Sometimes I feel that if those who come up with the plans for the changes were in practice they would grumble as well. Creating a strategy culture fit would be the leadership action used by my organization. Because I work in a pharmacy there is a lot of liability when we make mistakes with customer’s medication. A lot has to do with understanding the doctor’s writing and making the necessary phone calls to clear up any concern. Then the scanning of the bottles upon dispensing help with error of giving the patient the wrong medication...
Words: 702 - Pages: 3
Assignment 3 Week 6
...Week 6 Assignment 3 Research Plan HSA505 Health Services Planning and Management Dr. Point-Johnson, Instructor Strayer University Berlin Boxley May 13, 2012 Alternative health care is a growing industry in medicine. Canada has one of the highest rate of their population seeking alternative medicine in the U. S. According to the National Population Health Survey by Statistics Canada (1998-99) found that 3.8 million Canadians aged 18 and over had consulted an alternative health care provider at least once during the previous 12 months. This is just one state out of 50 for the U.S. Imagine the popularity of this type of treatment being sought as medical attention for sicknesses. A definition frequently referenced in research comes from the National Center for Complementary and Alternative Medicine (NCCAM) in the United States. They define alternative medicine as a group of diverse medical and health care systems, practices, and products that are not presently considered to be part of conventional medicine (medicine as practiced by medical doctor or doctors of osteopathy and their allied health professionals, such as physical therapists, psychologists, and registered nurses). Alternative health care is sometimes referred to as complementary and alternative health care. The terms “alternative” and ‘complementary” refer to using the same therapy in many different ways. That is, alternative refers to using a particular type of therapy instead of conventional treatment. Also...
Words: 1105 - Pages: 5
Issc340 Week 2 Assignment Lesson 2 Review: Wide Area Networks
...Name: ___ ____________ Date: __ 2013_________ ISSC340 Week 2 Assignment (3% of Grade) APUS/ Lesson 2 Review: Wide Area Networks The purpose of this activity is to reinforce what you have learned so far about local area networks technologies. 1. What is a T1 circuit? (Word count: 15-25) ____A T1 circuit is a DS1 WAN technology that is comprised of 24 x 64 kbps data channels and 1 x 8 kbps allotted for signal and network management for a total of 1.544 Mbps. It is versatile because data types can be divided into voice, video, and data channels from one T1. ________________________________________________________________________________________________________________________________________________________ 2. A statistical multiplexer provides each user with … (Word count: 15-25) ____bandwidth based on demand on the circuit as it is available. This is different and more efficient than TDM where each user is slotted a given bandwidth whether it is used or not. __________________________________________________________________________ ______________________________________________________________________________ 3. What does a SONET add/drop multiplexer do? (Word count: 15-25) ____It provides the capability to add or extract part of the data payload without completely demultiplexing or remultiplexing the signal.____________________________ 4. Describe an ATM cell … (Word count: 15-25) ___ATM is a connection-oriented, packet-switching technology......
Words: 299 - Pages: 2
It210 Week 6 Assignment
...Currency Conversion Test Cases Display Menu Valid Menu Selection or Errors | Inputs | Expected Output or Message | Canadian | Menu Selection = 1 | Do you want to continue with the conversion Yes or No?Currency_Type = 1 | Costa Rica | Menu Selection=1 | Do you wish to continue with this conversion yes or no?Currency Type= 1 | Australian | Menu Selection= 2 | Do you wish to continue with this conversion yes or no?Currency Type= 2 | Europe | Menu Selection= 3 | Do you wish to continue with this conversion yes or no?Currency Type= 3 | Singapore | Menu Selection= 4 | Do you wish to continue with this conversion yes or no?Currency Type= 4 | Colombian | Menu Selection= 5 | Do you wish to continue with this conversion yes or no?Currency Type= 5 | Exit | Menu Selection= 6 | Are you sure you would like to exit the program? | India | Menu Selection= 1 | The Country entered is invalid | Jupiter | Menu Selection= 2 | The Country entered is invalid | Peru | Menu Selection= 3 | The Country entered is invalid | Get International Values Valid International Values | Input | Expected Output | 100 CAD | 100.00 | International Value = 100 | 10000 CRC | 10000.00 | International Value=10000 | 25 AUD | 25.00 | International Value=25 | 2000 EUR | 2000.00 | International Value=2000 | 75 SGD | 75.00 | International Value= 75 | 6000 COP | 6000.00 | International Value=6000 | 2 CRC | 20000.00 | International Value=20000 | 60 AUD | 60.00...
Words: 704 - Pages: 3
Issc340 Week 1 Assignment
...Name: _________________ Date: ___________ ISSC340 Week 1 Assignment (3% of Grade) APUS/Sanford Lesson 1 Review: Overview of Local Area Networks The purpose of this activity is to reinforce what you have learned so far about local area networks technologies. 1. What are the main architectural components of a LAN? (Minimum word count: 60) The network’s physical topology – how the nodes are connected. The access method – how nodes access the transmission medium. The transmission technique – how information passes through the network. The transmission media – wired or wireless. The use of specific protocols that define how communication between computers takes place – TCP/IP is the standard communication protocol in modern networks. The LAN’s interconnectivity – how the LAN shares information with other types of networks. 2. Describe the function and characteristics of a network operating system (NOS). (Minimum word count: 100) A network operating system (NOS) manages resources on a network and enables the provision of services to one or more clients. A NOS consists of two components: a server component and a client component. The sever component is the more complex component that runs on the server. The server component can manage multiple users on a network, provide access to file and print servers, provide services such as Internet access and implement network security. The client component runs on the client machine and......
Words: 273 - Pages: 2
Issc340 Week 5 Assignment
...Name: _______________ Date: __ ISSC340 Week 5 Assignment (3% of Grade) APUS/Sanford Lesson 5 Review: Networking Models, Traffic and Devices The purpose of this activity is to reinforce what you have learned so far about local area networks technologies. 1. Describe the three modes of communication available on a network. (Minimum word count: 60) They are simplex, half-duplex, and full duplex. In simplex communication, data travels only in one direction, much like a PA system. While the half-duplex allows travel in two different directions, but only one direction at a time, much like a walkie talkie. The full-duplex communication allows data to travel in two directions at the same time, similar to a phone conversation. 2. List the seven layers of the OSI model, including both layer number and name for each. (Minimum word count: 20) They are 7) Application, 6) Presentation, 5) Session, 4) Transport, 3) Network, 2) Data Link, 1) Physcial. 3. Describe a protocol data unit (PDU). (Minimum word count: 30) A protocol data unit (PDU) is a unit of data passed from one open system interconnection (OSI) level to another. The PDU consists of the payload or original information along with the header that is added in Layer 7 of the OSI. 4. List three practical functions of the OSI model. (Minimum word count: 60) The OSI practical functions are it describes the process of packet creation. It also explains the framework used to connect different types of systems, meaning...
Words: 444 - Pages: 2
Nt1110 Week 6 Assignment
...1. A DHCP is Dynamic Host Configuration Protocol, it is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway. 2. The type of NIC that I have is A VIA Rhine II Fast Ethernet Adapter 3. The physical address is 00-11-2F-BF-C9-DA 4. The Subnet Mask is 255.255.255.0 1. A LAN is a Local Area Network. A local area network is a network that connects computers and other devices in a small area, usually in a single building or a group of buildings. 2. WAN is Wide Area Network A WAN is a computer network that spans a relatively large geographical area. 3. MAC ADDRESS stands for Media Access Control Address It is an ID code that's assigned to a network adapter or any device with built-in networking capability, such as a printer. 4. 802.11 G is used for transmission over short distances at up to 54-Mbps in the 2.4 GHz bands. 802.11 N The speed is 100 Mbps and so it is up to 4-5 times faster than 802.11g. 802.11n also offers a better operating distance than current networks. 5. Bluetooth is a short-range radio technology (or wireless technology) aimed at simplifying communications among Internet devices and between devices and the Internet. It also aims to simplify data synchronization between Internet devices and other computers. 6. Router is a device that forwards data packets along networks. Switch is a device that filters and...
Words: 520 - Pages: 3
Issc340 Week 1 Assignment
...Lesson 1 Review: Overview of Local Area Networks The purpose of this activity is to reinforce what you have learned so far about local area networks technologies. 1. What are the main architectural components of a LAN? (Minimum word count: 60) There are several main architectural components of a LAN. Included is the physical topology of the network determining how the nodes on the network are connected. Access methods are needed on the network to determine how the nodes will access the transmission mediums. The networks transmission techniques and the transmission media determine how the information will be passed throughout the network and if the network will use cables or be wireless. Protocols are a main component of a LAN because they lay out how the various machines will communicate between each other. The LAN’s interconnectivity is another main component because it determines how the information on its own network will be shared with other types of networks. 2. Describe the function and characteristics of a network operating system (NOS). (Minimum word count: 100) The network operating system (NOS) allocates resources throughout the network and allows sharing of services to its clients. There are two different parts of the NOS, the server portions and the client portions. The server portion of the NOS will be more complex than the clients because that runs the servers and consists of many more tasks. The server portion of the NOS will have many...
Words: 344 - Pages: 2
Week 6 Assignment
...Homework Assignment NETW 420 February 15, 2014 Professor Viviane Ruiz SNMP stands for Simple Network Management Protocol. SNMP is one example of a management protocol. This is an application layer protocol that helps in administrating and supervising network assets across the web. The SNMP has three key components. They are the managed devices, the agents and the network management system. Show below is the relationship between the managed devices, agents, and NMSs components (Simple Network Management Protocol, 2012). Managed devices are network nodes that contain the SNMP agent and are connected to the network that is managed. They will gather and store information then they make the information available to the Network Management System by using SNMP. These devices are routers, servers, switches, computers, printers and many other devices. The agent is a network management software module that is installed on a managed device. The agent is knowledgeable of the management information and can make it compatible to the SNMP. The Network Management System implements the applications that will conduct the monitoring and controlling of the managed devices. There is usually more than one NMS on a managed network (Simple Network Management Protocol, 2012). SNMP uses four basic commands while it monitors and controls a managed device. These four commands are read, write, trap, and the traversal operations. The Network Management System uses the read command to...
Words: 598 - Pages: 3
Issc340 Week 1 Assignment
...Name: _Aaron Hancock_ Date: _12OCT2014_ ISSC340 Week 1 Assignment (3% of Grade) APUS/Sanford Lesson 1 Review: Overview of Local Area Networks The purpose of this activity is to reinforce what you have learned so far about local area networks technologies. 1. What are the main architectural components of a LAN? (Minimum word count: 60) The main architectural components are 1: The network's physical topography (how the nodes are connected) 2: The access method (how the nodes access the transmission medium) 3: the transmission technique (how information passes through the network) 4: the transmission media (wired or wireless) 5: the use of specific protocols (the language used to communicate between computers) 6: the LAN's inter-connectivity (how the LAN shares with other networks) 2. Describe the function and characteristics of a network operating system (NOS). (Minimum word count: 100) A network operating system (NOS) manages the resources used within the network and enebles select services to select nodes. A NOS consists of two main components: a server component and a client component. The server component is the most complex component that runs on the server. The server component can do many things, to include; manage multiple users, provide access to files and printers, provide internet access, and enforce network security protocols. The client component runs on the client machine and enables the client to participate on the network. A NOS client......
Words: 270 - Pages: 2
Issc340 Week 4
...Name: ___________________________Date: ____________________ ISSC340 Week 4 Assignment (3% of Grade) Lesson 4 Review: LAN Topologies The purpose of this activity is to reinforce what you have learned so far about local area networks technologies. What are the two methods that Carrier Sense Multiple Access (CSMA) employs to handle messages that are sent simultaneously? (Min. word count: 15) Carrier sense multiple access methods are detection where a transmission is cancel when collision is detected and avoidance where transmission is delayed. Which topology would you use when unable to install network cable? (Min. word count: 15) Mesh topology because is provides has separate cables for each connection, meaning a cable can break without interfering with the rest of the network. What is inherent in mesh topologies that enable them to provide high reliability? (Min. word count: 20) Mesh topology provides fault tolerance by having separate cables for each connection, allowing any one cable to break without interfering with the rest of the network. What are advantages of star topologies? (Min. word count: 10) Star topology gives great fault tolerance as any device/cable failure will not affect the rest of the network. Compare the two modes supported by wireless topologies. (Min. word count: 20) In ad-hoc mode data in the network is transferred to and from wireless network adapters connected to PCs. An infrastructure network enables you...
Words: 454 - Pages: 2
Hrm 562 Week 6 Assignment Hrm562 Week 6 Assignment
..., and the date. The cover page and the reference page are not included in the required assignment page length. The specific course learning outcomes associated with this assignment are: * Examine the processes of how organizations learn and organizational barriers that impact the process. * Use technology and information resources to research issues in developing a learning organization. * Write clearly and concisely about developing a learning organization using proper writing mechanic. HRM 562 Week 4 Discussion "Contextual Factors and Behavioral Channels" * Design a table using three (3) of the six (6) contextual factors (e.g., environmental uncertainty, task uncertainty, error criticality, task structure, proximity to the organization’s core mission, and organizational structure). For each contextual factor, create one (1) brief scenario that is beyond management’s control. Then, develop one (1) corrective action to increase the management success. Note: Online students may use Microsoft Word or other equivalent software to design the table and then copy and paste it into the discussion board. * Use the Internet or the Strayer Library to research different leadership styles. Next, select the behavioral channel of influence that you believe promotes the most effective learning in your organization or an organization with which you are familiar. Then, specify the most effective leadership style to influence the workforce. Justify your response HRM......
Words: 3971 - Pages: 16
Issc340 Week 1 Assignment
...Name: Date: ISSC340 Week 1 Assignment (3% of Grade) Lesson 1 Review: Overview of Local Area Networks The purpose of this activity is to reinforce what you have learned so far about local area networks technologies. 1. What are the main architectural components of a LAN? (Minimum word count: 60) The main architectural components of any LAN starts with the layout for how the nodes connect, the access method (which is how the node gain access to a transmission medium), the transmission technique (which is how the information passes through the network), transmission media (which is defined by either wired or wireless connections), the use of very specific protocols (which are sets of rules that define how the computers communicate and define the LANs interconnectivity), which then determines how the LAN shares information. 2. Describe the function and characteristics of a network operating system (NOS). (Minimum word count: 100) One of the biggest differences between a Network Operating System and a regular operating system is that unlike the OS which can run a single computer, the Network Operating System can run multiple computer on a network at once and allow the network to continue running. The Network Operating System is an essential element of the LAN that can consist of server components and a client component. The server components have multiple responsibilities that can range from managing multiple users on a network, providing access to......
Words: 297 - Pages: 2
Week 6 Assignment 1
... Did Jim and Laura Buy a Car Week 6 Assignment 1 Matthew Ader Professor Lori Baggot LEG 100 Feb 14 2016 A contract is an agreement that creates an obligation that is enforceable by the law. The law has clear guidelines that before there exists a contract that will be binding, there has to be an offer, acceptance, mutual obligation and all parties should be of sound mind and by law be of legal age. A contract can either be written or spoken. Assuming that the buyers were at the required age went to the car dealership looking to purchase a new car. Stan the salesman made an offer to Jim and Laura and they both agreed to the terms. They asked that Stan the salesman hold the car for a day. He told them to put down $100 dollars to hold the car and that it would go to the final purchase of the car or that it would be refundable. Jim and Laura just wanted to hold the car so that it would still be there the next day. With mutual understanding Stan the salesman keeps the car and calls the next day to confirm when the purchase would be completed. I do believe that Jim and Laura did not enter into a legal contract that is binding. There are several factors that do not exist that would show a legally binding agreement. Like a contract that both parties would sign, agreeing to the purchase of the car. Having a contract in writing that both parties signed could show the sale of the car. Stan the salesman let Jim and Laura have a chance to test drive several cars that they...
Words: 760 - Pages: 4
Issc340
...Wireless Security T 01/15/2015 ISSC340 American Public University System Eric Yocam When it comes to dealing with wireless security, it happens to be a problem for everyone. The rise in devices being made during the last decade has put a strain on the amount of data being requested by users. The statistics show that 64 percent of Americans who have internet service providers that impose a broadband cap, have a meter for the cap that is presented. Recent studies have shown that five out of seven people’s meters don’t count your bits correctly. This allows for the chance of assuming what data is being used and being overcharged for what is not actually used. Other statistics show that the laptops that were purchased in 2005 and later were equipped with wireless connectivity. This created an issue with wireless laptops connected to the corporate network, it presents a situation where a hacker could sit in the parking lot and receive information through laptops and other devices, or break in using the wireless card-equipped with this wireless connectivity option. In order to test the strength of most wired and wireless networks the intrusion detection system was implemented. This is a software application that monitors the network activity for malicious activity or privacy violations. The way this works, is that the incidents get reported to a management station. The two different types of intrusion detection system are (NIDS) network based and (HIDS...
Words: 3051 - Pages: 13
|
__label__pos
| 0.656585 |
The Plant that Hides from Humans…
Fritillaria Delavayi grows in the hillsides of China in the Hengduan mountains and in Nepal. It has been used for over 2,000 years for medicinal purposes. The plant is believed to have properties that can treat coughs and other respiratory ailments. What this plant has done is evolve to the point where it can change its color to blend in with its environment in much the same way as reptiles do. This is in response to the over harvesting of the plant and its attempt to survive. The over harvesting of the plant is the result of the high price it now brings on the market. Since the plant is not threatened by any animal that feeds on it, scientists determined that this is a defense mechanism against humans. In areas where it is not threatened it has a bright yellow flower and green leaves. In heavily harvested areas it can change to blend in with rocks. Since it only blooms every 5 years it is difficult to find and harvest the bulb of the plant. This is not the first time humans have had an effect on plant life. Until recently, this was not even considered.
https://www.sciencenews.org/article/plant-camouflage-people-china-traditional-medicine-fritillaria
The Un-squashable Bug…
The Diabolical Ironclad Beetle (Phleoodes-diabolicus) has an ironclad exoskeleton that is almost impossible to crush. Dr. Rivera, of the Biometrics and Nanostructured Materials Lab of the University of California, set out to prove this. The beetle was place on a pillow of dirt in a parking lot and a Toyota Camry (3,500 lbs.) ran over it twice. Any other insect would have been liquified. The insect is capable of withstanding 39,000 times its body weight. This force would completely crush a human. The exoskeleton is packed with proteins giving it extreme durability. The underpart of the insect is of a separate section that interlocks with the above allowing it to separate almost like two puzzle pieces while providing a buffer space. As a result, there is no weak spot. The question remains, why would you run over a beetle in the first place?
Cicadas and a 17-year Gestation Period…
Their sound is so much a part of an August evening. A gradual hum that breaks out into a roar. They break through the ground and head in groups for the nearest tree. The nymphs remain underground for 17 years feeding on tree roots. Their number is so great that they provide an unending meal for turtles, racoons and birds. Every year a new group emerges in some area of the US, which is the only country where they are found. Only the males are capable of their unique sound which is used to attract females. Eric Day, an entomologist, recommends frying them in sake and garlic because of their high protein content. They are not poisonous and will do no harm to humans. They are a bit clumsy and will slam into you when you least expect it. Cicadas are extremely vulnerable to predators while they are waiting for their wings to dry after they emerge, but in spite of this, billions manage to survive, mate and die off leaving their nymph eggs to settle underground for another 17 years.
Machines That Can Taste Your Food…
Machines are now being trained to be attentive to shape, texture and sweetness. These decisions up to now have been made by experienced workers. Blueberries for example have a standard color palette and are very delicate so they can bruise easily. BBC Technologies of New Zealand has invented machinery that can separate blueberries by color and size which until now was time consuming and done by workers with nimble hands. The software takes from 2400 individual images of what a firm and proper color of a blueberry should look like. The color can also determine the sweetness which is another factor on how they are priced and packaged. Artificial intelligence can distinguish the difference from a stem hole and that which has been pecked by a bird and will soon rot. It can separate fruit that should be eaten within a week as opposed to the berries that can travel longer distances. PepsiCo is teaching machines sensory perception. Lasers are bounced off of potato chips to capture the sound of crunchiness in order to replicate someone biting into a potato chip. I wonder if the day will come when we walk into our home and see a machine sitting on our couch munching on chocolate chip cookies.
|
__label__pos
| 0.632248 |
Free Sample
+ Collection
Unity 4.x Game AI Programming
Progressing
Aung Sithu Kyaw, Clifford Peters, Thet Naing Swe
Use your basic knowledge of Unity3D to add effective artificial intelligence to your games. This tutorial will take you through all the essentials, from flocking to pathfinding, from navigation graphs to behavior trees.
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
Want this title & more?
$21.99 p/month
Subscribe to PacktLib
Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.
Book Details
ISBN 139781849693400
Paperback232 pages
About This Book
• A practical guide with step-by-step instructions and example projects to learn Unity3D scripting
• Learn pathfinding using A* algorithms as well as Unity3D pro features and navigation graphs
• Implement finite state machines (FSMs), path following, and steering algorithms
Who This Book Is For
Are you are a programmer with basic knowledge of Unity3D who would like to add AI features to your game? Are you looking for a reference on implementing AI in Unity3D with simple to follow instructions, and lots of sample code and projects? Then this book is for you. You should have some background in C# language as this book will use C# for scripting. However if you know any other language you should be able to follow this book fairly easily.
Table of Contents
Chapter 1: Introduction to AI
Artificial Intelligence (AI)
AI in games
AI techniques
Summary
Chapter 2: Finite State Machines
The player's tank
The bullet class
Setting up waypoints
The abstract FSM class
The enemy tank AI
Using an FSM framework
Summary
Chapter 3: Random and Probability
Random
Definition of probability
Character personalities
FSM with probability
Dynamic AI
Demo slot machine
Summary
Chapter 4: Implementing Sensors
Basic sensory systems
Scene setup
Player tank and aspect
AI character
Testing
Summary
Chapter 5: Flocking
Flocking from Unity's Island Demo
Alternative implementation
Summary
Chapter 6: Path Following and Steering Behaviors
Following a path
Avoiding obstacles
Summary
Chapter 7: A* Pathfinding
A* algorithm revisit
Implementation
Scene setup
Testing
Summary
Chapter 8: Navigation Mesh
Introduction
Setting up the map
Scene with slope
NavMeshLayers
Off Mesh Links
Summary
Chapter 9: Behavior Trees
Behave plugin
Workflow
Action
Interfacing with the script
Decorator
Behave debugger
Sequence
Exploring Behave results
Selector
Priority selector
Parallel
Reference
The Robots versus Aliens project
Summary
Chapter 10: Putting It All Together
Scene setup
Vehicles
Weapons
Summary
What You Will Learn
• Building finite state machines (FSMs)
• Implementing a sensory system
• Applying flocking behavior for a crowd
• Executing your own A* pathfinding algorithm in Unity3D
• Applying random and probability techniques in a betting game
• Using the Unity3D pro feature, navigation graphs, for path finding
• Learning about behavior trees and the Behave plugin
• Implementing a racing game AI through the final chapter project
In Detail
This book fills the gap between artificial intelligence (AI) books designed to learn underlying AI algorithms and general Unity3D books written to cover basic scene setup and scripting in Unity3D. Game AI Scripting in Unity3D covers implementing AI techniques such as flocking, pathfinding, path following, and behavior trees in Unity3D with example projects.
Game AI Scripting in Unity3D will show you how to apply AI techniques to your Unity3D projects using C# as the scripting language. Unlike other AI books and Unity3D books, this book tries to focus more on the application of AI techniques in the Unity3D engine, with sample projects that demonstrate finite state machines (FSMs), pathfinding, steering, navigation graphs, and behavior trees techniques.
This book shows how to implement various AI techniques in Unity3D by implementing the algorithm from scratch using C#, applying Unity3D built-in features, or using available scripts and plugins from the Unity Asset Store. For example, we’ll be implementing our own A* algorithm to do pathfinding but will also explore the Unity3D navigation graphs feature. Then we’ll use the Behave plugin to construct behavior trees for intelligent AI character behaviors.
Game AI Scripting in Unity3d covers other AI techniques such as flocking behavior, building a sensory system for taking inputs from the environment and other AI agents, and so on. In the final chapter this book will show you how to build a racing game AI project using Unity3D and applying the techniques described in earlier chapters.
Authors
Read More
Recommended for You
Learning Unity 2D Game Development by Example
$ 26.99
Unity 4.x Game Development by Example: Beginner's Guide
$ 26.99
Mastering Unity 4 Scripting [Video]
$ 34.00
Getting Started with Unity 4 Scripting [Video]
$ 34.00
|
__label__pos
| 0.701132 |
Skip to main content
Comparison of class 2 transposable elements at superfamily resolution reveals conserved and distinct features in cereal grass genomes
Abstract
Background
Class 2 transposable elements (TEs) are the predominant elements in and around plant genes where they generate significant allelic diversity. Using the complete sequences of four grasses, we have performed a novel comparative analysis of class 2 TEs. To ensure consistent comparative analyses, we re-annotated class 2 TEs in Brachypodium distachyon, Oryza sativa (rice), Sorghum bicolor and Zea mays and assigned them to one of the five cut-and-paste superfamilies found in plant genomes (Tc1/mariner, PIF/Harbinger, hAT, Mutator, CACTA). We have focused on noncoding elements because of their abundance, and compared superfamily copy number, size and genomic distribution as well as correlation with the level of nearby gene expression.
Results
Our comparison revealed both unique and conserved features. First, the average length or size distribution of elements in each superfamily is largely conserved, with the shortest always being Tc1/mariner elements, followed by PIF/Harbinger, hAT, Mutator and CACTA. This order also holds for the ratio of the copy numbers of noncoding to coding elements. Second, with the exception of CACTAs, noncoding TEs are enriched within and flanking genes, where they display conserved distribution patterns, having the highest peak in the promoter region. Finally, our analysis of microarray data revealed that genes associated with Tc1/mariner and PIF/Harbinger noncoding elements have significantly higher expression levels than genes without class 2 TEs. In contrast, genes with CACTA elements have significantly lower expression than genes without class 2 TEs.
Conclusions
We have achieved the most comprehensive annotation of class 2 TEs to date in these four grass genomes. Comparative analysis of this robust dataset led to the identification of several previously unknown features of each superfamily related to copy number, element size, genomic distribution and correlation with the expression levels of nearby genes. These results highlight the importance of distinguishing TE superfamilies when assessing their impact on gene and genome evolution.
Background
Transposable elements (TEs) are DNA fragments that can move from one genomic location to another by a process called transposition. They are the largest component of most multicellular organism genomes, often exceeding 50% of content[1, 2]. TEs are divided into two classes based on the nature of their transposition intermediate: class 1 (RNA) retrotransposons and class 2 DNA transposons. If we think of the genomes of higher plants as ecosystems, then each TE class occupies a characteristic niche. Although class 1 TEs are largely intergenic, most class 2 TEs are preferentially found in and around genes. As such, class 1 elements contribute more significantly to plant genome size differences whereas class 2 elements are frequently involved in generating allelic diversity[3].
Transposition of class 2 elements, which are the focus of this study, requires the enzyme transposase that binds to the elements’ terminal inverted repeat (TIR) and catalyzes both excision and integration into a new site. Class 2 elements are classified into superfamilies based on the relatedness of the transposase and on shared structural features including the TIR sequence and the length of the target site duplication (TSD) that flanks the TIR and is generated during integration. Only five of the seventeen superfamilies characterized to date have been found in plant genomes (CACTA, Mutator, PIF/Harbinger, hAT, Tc1/mariner)[4, 5]. While helitrons were considered to be the sixth class 2 superfamily in plants[6], we do not include them here because they have different structures and transposition mechanisms from cut-and-paste elements. Each superfamily contains autonomous and nonautonomous elements. Autonomous elements encode the transposase necessary for their own movement and the movement of nonautonomous superfamily members, which lack functional transposase genes.
The most numerous class 2 elements in characterized plant genomes and in several animal species are miniature inverted-repeat transposable elements (MITEs). MITEs are nonautonomous TEs that are characterized by short length (most < 600bp), high sequence similarity, and a potential for very high copy number (hundreds or thousands)[79]. Despite lacking coding sequences, MITEs can be classified into known superfamilies based on related TIR sequence and TSD length. To date, the majority of reported MITEs are either Stowaway or Tourist elements that belong to the Tc1/mariner and PIF/Harbinger superfamilies, respectively[1013]. MITEs belonging to the hAT and the Mutator superfamilies have also been reported[1417].
Although TE superfamilies can be readily distinguished by shared sequences and structural features (such as TIRs and TSDs), TEs are usually lumped together when their relationship with gene and genome evolution is analyzed[18, 19]. A determination of potentially unique and conserved features of each superfamily would require their systematic comparison across species. The availability of complete genome sequences from four grass species, Brachypodium distachyon (250Mb)[20], Oryza sativa (rice)(340Mb)[21], Sorghum bicolor (750Mb)[22], and Zea mays (2500Mb)[1] has facilitated such a novel comparative analysis. These four grass species were chosen for several reasons. First, the genomes have been annotated to high quality and some gene expression data is available. Although TEs have also been annotated in these genomes, we performed a systematic re-annotation to permit a consistent comparative analysis and to classify noncoding elements into superfamilies. With only five of the ~20 class 2 cut-and-paste superfamilies identified in eukaryotes, it is more likely that most TEs in the genomes can be assigned. In contrast, with over 17 superfamilies, it is very difficult to classify Aedes aegypti TEs into superfamilies unambiguously[2]. In this study, we identified and classified over 450,000 class 2 elements. Finally, the genes in these four species are largely syntenic despite a 10-fold difference in genome size. Given that most class 2 elements are known to insert into or near genes, we were particularly interested in comparing each TE superfamily across species to determine what features are conserved and what features may be influenced by the host.
Results
TE annotation and definitions
Class 2 TEs from the five superfamilies found in plants were annotated in four grass genomes and the results are summarized in Figure 1 and Additional file1. Coding elements contain all or part of the transposase gene from one of the five superfamilies. Their copy numbers were estimated from the number of conserved transposase domains identified by TARGeT (Figure 1A and Additional file1)[22]. We call them coding elements rather than the more conventional autonomous elements because the latter term implies functional activity, and manual curation of a subset of these elements indicates that most contain inactivating mutations. To save words, coding TEs are denoted with a lowercase “c” followed by the superfamily name (e.g. the generics cTE as in cCACTA). Similarly, noncoding elements are referred to as nTEs. In this study nTEs were discovered by MITE-Hunter, a structure based TE identification tool that has as its output consensus sequences that represent nTE families. By default MITE-Hunter identifies nTEs shorter than 2kb, which encompasses the majority of nTEs including MITEs[23].
Figure 1
figure1
TE annotation results in four grass genomes. Each superfamily is represented by a specific color (CACTA: blue, hAT: dark orange, Mutator: green, PIF/Harbinger: purple and Tc1/mariner: red). A) The number of transposase genes identified by TARGeT. B) Copy number of nTEs. A copy that has only one end was counted as 0.5. C) Total length of nTEs. D) Percentages of nTEs in the genomes.
To obtain the copy number, length and position of nTEs in each genome, consensus sequences were used as queries for searches using RepeatMasker. From the RepeatMasker output, double-ended elements and single-ended elements were identified and analyzed separately (see Methods for details). The total copy number of a nTE consensus sequence was calculated by adding the double-ended copy number and half of the single-ended copy number. Furthermore, nTEs were characterized as either MITE or non-MITE where MITEs are defined as shorter than 600bp with at least 25 double-ended copies or 10 nearly identical copies (identity > = 99%) (Additional file1). The total copy number and length of nTEs (Figure 1B and C) as well as the percentage of each superfamily in the four genomes (Figure 1D) was determined. While these data are combined in Figure 1 and Additional file1, the complete dataset is available athttp://target.iplantcollaborative.org.
Copy numbers of class 2 elements in four grass genomes
Except for the Tc1/mariner superfamily, the copy numbers of cTEs differ dramatically among the four grass genomes (Figure 1A and Additional file1). cCACTAs are the most numerous in rice (340Mb), sorghum (750Mb) and maize (2500Mb) and are the second most numerous (after Mutator) in the Brachypodium genome (250Mb). Furthermore, cCACTAs increase in copy number with increasing genome size (491 to 1705 to 2996 to 4288). chATs also increase with genome size but their numbers are significantly lower than cCACTAs (176, 277, 526, 1556). Coding members of the Mutator and PIF/Harbinger superfamilies show little copy number variation in Brachypodium, rice and sorghum but show a marked increase in the larger maize genome. Interestingly, the coding members of the Tc1/mariner superfamily have by far the lowest copy numbers in the four genomes and show no correlation with genome size (36, 45, 57, 47).
Despite the dramatic copy number differences across species, the copy number ratio of nTEs to cTEs is a conserved feature of each superfamily (Additional file1). For each genome, the ratio is lowest for the CACTA superfamily (1.27 average ratio), which has the most cTEs and the fewest nTEs. After CACTA, the next lowest ratio in all genomes is for Mutator (18.14) followed by hAT (27.16), PIF/Harbinger (128.53) and Tc1/mariner (647.25). The high ratios for PIF/Harbinger and Tc1/mariner reflect the success of MITEs from these superfamilies, called Tourist and Stowaway, respectively[7, 8]. These results indicate that the mechanisms underlying the generation and success of nTEs are both conserved and distinctive for each superfamily.
Length is a conserved feature of the nTEs in a superfamily
Figure 2 is a visual representation of the size and copy number of the nTEs from Tc1/mariner and PIF/Harbinger in the four genomes (the results of all superfamilies except CACTA are in Additional file2). These data were generated by plotting the double-ended copy numbers of each consensus nTE against the length of the consensus sequence. Of note is the similarity of the patterns for a particular nTE superfamily in all genomes. In addition, with only one exception (nhAT and nMutator in maize), the order of the mean lengths of the nTEs is the same in all genomes with nTc1/mariner < nPIF/Harbinger < nhAT < nMutator.
Figure 2
figure2
The double-ended copy number and length of the consensus nTEs of Tc1/mariner and PIF/Harbinger in Brachypodium , rice, sorghum and maize. The y-axis is in log10 scale.
All nTEs except nCACTAs are enriched near genes
Prior studies showed that most plant class 2 TEs have a preference for insertion into or near genes[3, 24, 25]. Recently, the determination of over 800 insertions of the active MITE mPing near rice genes identified a preference for insertion of this member of the PIF/Harbinger superfamily within 1kb of the transcription start site (TSS) and 1kb downstream of the transcription stop site (TTS)[26]. Here our annotation results have been used to determine whether nTEs from other superfamilies show similar enrichment and, if so, whether this feature is conserved in all genomes.
To this end we first calculated the average percentages of class 2 nTEs in the whole genome as well as in the 5 and 3 flanking regions around genes. These data are presented diagrammatically in Figure 3A and in detail in Additional file3 (this file also contains the distributions of all nTEs in the exons and introns, which is not discussed further). Taken together these data indicate that the nTEs from all superfamilies except CACTA are enriched in the 1kb compartments flanking the 5 and 3 ends of coding regions. The only exception is in maize where there are more nCACTAs near genes than in other areas of the maize genome, which may reflect the overwhelming number of class 1 LTR elements that are enriched in intergenic regions (composing 74.6% of the maize genome[1])[3]. The extent of enrichment is especially pronounced in rice, sorghum and maize where about 20% of the sequences in these regions are derived from class 2 nTE sequences (Figure 3A and Additional file3).
Figure 3
figure3
The nTE distribution in four grass genomes. A) The length percentage of nTEs in the whole genome, 1kb 5 gene flanking regions (5F), and 1kb 3 gene flanking regions (3F) of Brachypodium, rice, sorghum and maize. B) High resolution distribution of nTE frequency around the genes of Brachypodium, rice, sorghum and maize. The highest peaks of nTE frequency are marked by vertical gray lines and the distance from the peak to the TSS (transcription start site) or TTS (transcription stop site) is shown above the lines. Colors of superfamilies are the same as in Figure 1.
To characterize the distribution of nTEs at higher resolution and in regions more distant from the TSS and TTS, we calculated nTE percentages in continuous 10bp windows extending 10kb upstream and 10kb downstream of coding regions. The distributions of all nTEs in these regions are similar as evidenced by the black curves in Figure 3B, although the percentage of elements around the genes of Brachypodium is about half that of the other three species. After the 5 and 3 flanking regions, intron nTEs are the most abundant across all the superfamilies and species. However, unlike the patterns observed in the gene flanking regions, nTE frequencies are highest in the middle of introns and drop gradually toward the splice sites (see Additional file4).
nTEs differ in their association with genes of high or low expression
The abundance of class 2 nTEs in genic regions prompted us to examine whether the presence of a particular superfamily member near genes correlates with increased or reduced expression levels. This analysis was performed in rice and maize where annotation is of high quality and gene expression data is available. Genes harboring nTEs from members of the same TE superfamily were grouped and their expression levels were compared with a control group of genes without class 2 nTEs. Extensive comparisons were performed using rice microarray data from different experiments, tissues and platforms. A more limited comparison was also made with available maize expression data (see Methods for details).
In all microarray data analyzed in rice and maize, genes with nPIF/Harbinger and nTc1/mariner elements have significantly higher expression levels than genes in the control group. In contrast, the expression of both rice and maize genes with nCACTAs is significantly lower than the control dataset (Figure 4 and Additional file5). Although expression levels for maize genes associated with nhATs and nMutators are significantly higher than the controls in RNA samples from two tissues (Figure 4C and D), no clear picture emerged when rice samples were analyzed (Figure 4A and B, Additional file5 GSE23918).
Figure 4
figure4
Comparison between the expression levels of genes with class 2 TEs and without class 2 TEs, in rice root (A) and stigma (B), maize ear (C) and leaf (D). The y-axis is log10 gene expression values. P-values of pairwise comparison are shown in shadow areas. Colors of superfamilies are the same as in Figure 1.
To confirm these findings, we analyzed publically available RNA-seq data from rice and obtained very similar results (see Additional file6). Specifically, genes with class 2 superfamily nTEs except for nCACTAs, showed significantly higher expression levels than controls. The expression levels of genes with nCACTAs are lower than controls, but these data are not statistically significant (p-value = 0.0608), which can be explained by the small sample size and limited sequencing reads to discern genes with low expression.
Discussion
The major focus of this study was to generate comprehensive and accurate class 2 TE data for comparative analyses. To this end we utilized TARGeT and MITE-Hunter, two programs that have proved efficient at detecting cTEs and nTEs, respectively[22, 23]. In our analyses we separated nTEs from cTEs, classified them into superfamilies, and further identified MITEs among the nTEs. This protocol was necessary because nTEs and cTEs have distinct features. For example, coding Tc1/mariners have only about 50 copies in each of the analyzed genome but there are two orders of magnitude more nTc1/mariners (mainly Stowaways) (Figure 1 and Additional file1). The dramatic amplification potential of small nTEs, in particular MITEs, is also very different across superfamilies. Extensive manual curation was performed for each nTE consensus sequence to ensure the accuracy of TE discovery and classification. In this way, we achieved the most comprehensive annotation of class 2 cut-and-paste TEs to date in these four grass genomes. For example, we found several-fold more Stowaway and Tourist elements than a previous annotation of these elements in rice, sorghum and maize[22]. Comparative analysis of this robust dataset led to the identification of several previously unknown features related to copy number, element size, genomic distribution and correlation with the expression level of nearby genes.
The CACTA superfamily is the outlier in all comparisons. Among the superfamilies analyzed in this study, CACTA has the fewest number of nTEs and the greatest number of cTEs (Figure 1, Additional file1). This paucity of nCACTAs suggests that this superfamily generates fewer short elements than the others. Further, in three of the four genomes analyzed, CACTAs are enriched in intergenic regions where their copy numbers increase proportionally with genome size (see Figure 1). Finally, in at least two grass species (maize and rice) the presence of nCACTAs in or near genes has a negative correlation with transcription (Figure 4). Taken together, these data suggest that CACTA elements have either evolved a genic region insensitive/avoidance strategy or are removed from genic regions by selection.
The other four class 2 TE superfamilies also have distinctive features that are conserved in all genomes analyzed. For example, the ratio of the number of nTEs to cTEs is the highest for the Tc1/mariner superfamily and next highest for PIF/Harbinger followed by hAT, Mutator and CACTA (Figure 1). In this same order, the average length of nTEs also increases (Figure 2 and Additional file2) suggesting that there is a range of lengths that is optimal for the transposition and amplification of each superfamily.
With regard to the distribution of elements in the four superfamilies, we have extended an observation originally made in rice[27] and show that except for nCACTAs nTEs are enriched at gene borders (Figure 3). Specifically, nTEs are most abundant at the 5 gene border, and also enriched but less so near the 3 border (Figure 3 and Additional file3). This result, however, differs from a recent report in rice[18]. For the PIF/Harbinger superfamily, enrichment of the active MITE mPing was shown previously to result from its preference for insertion into gene proximal regions[26]. Although our data are descriptive and as such cannot distinguish between an insertion preference or winnowing by selection, the strikingly similar patterns around grass genes suggests a preference. A similar insertion preference was observed for Hermes, an active member of the hAT superfamily from the housefly Musca domestica[28]. Characterization of almost two hundred thousand insertion sites in a Saccharomyces cerevisiae transposition assay revealed a marked preference for nucleosome free regions (NFRs) around genes, presumably because of their accessibility. Given that NFRs have also been found near the 5 ends of plant genes[29] it is possible that their distribution underlies the pattern of nTE insertion sites from four of the five superfamilies in plants.
The dramatic enrichment of class 2 nTEs around genes especially in promoters prompted us to analyze the correlation between these elements and nearby gene expression levels using microarray data. Genes with PIF/Harbinger and Tc1/mariner elements, which are the two superfamilies that generate the majority of MITEs, showed significantly higher expression values (Figure 4, Additional files5 and6). Furthermore, genes with hAT and Mutators showed higher expression levels in maize but not in all rice tissues. In contrast, as discussed above, genes with CACTA elements were associated with lower gene expression.
Conclusions
These results indicate that superfamily identity needs to be considered when analyzing the correlation between TEs and the expression of nearby genes. This conclusion may explain discrepancies between our results and those of prior studies. For example, Hollister et al. and Lu et al. reported negative association between TEs and nearby genes in Arabidopsis[30] and rice[18], respectively. Based on our results, a possible explanation is that in both of these studies TEs were not separated into superfamilies for the analysis. Grouping of TEs in this way, without regard for superfamily identity, could mask the unique behavior of individual superfamilies. Finally, as our data and prior studies have shown, nTEs, especially MITEs, are abundant near genes[27]. It would be difficult to explain this distribution if the impact of these elements were largely negative.
Methods
Dataset
Genomic sequences and gene annotation results (version 1.0) of Brachypodium distachyon were downloaded fromhttp://www.brachypodium.org[20]. Rice genome (build 5) was downloaded fromhttp://rgp.dna.affrc.go.jp/, and gene annotation file (RAP3.gff3) was fromhttp://rapdb.dna.affrc.go.jp[21, 31]. Sorghum genome (Sorbi1) and annotations (Sbi1_4.gff) were downloaded fromhttp://genome.jgi-psf.org/Sorbi1/Sorbi1.home.html[22]. Maize genome and annotations (version 4a53) were fromhttp://www.maizesequence.org[1]. Microarray data files were downloaded from the Gene Expression Omnibus (GEO) database[32]. Rice RNA-seq data were downloaded from EBI (ERR008651, ERR008652, ERR008657, ERR008658, ERR008663 and ERR008664).
Discovery and classification of class 2 TEs
Class 2 TEs were discovered from genomic sequences as follows. Conserved transposase gene regions of putative autonomous TEs were identified using TARGeT[22]. Query sequences for TARGeT were curated from the conserved regions of known plant transposase sequences that were downloaded from Repbase[33]. Each transposase gene discovered in this way was considered to represent a single coding element (as listed in Additional file1).
Noncoding elements were discovered using MITE-Hunter, which is a tool designed to specifically search for small noncoding class 2 TEs from genomic sequences[23]. MITE-Hunter outputs were manually checked using the approach described previously[23]. Qualified TE consensus sequences were classified into superfamilies based on their TIR sequences and TSD length using the following rules. Elements with TIRs starting with CACTA/G and with 3bp TSDs were identified as CACTA TEs, with 8bp TSDs as hAT TEs, with 9 or 10bp TSDs as Mutator TEs, with 2bp TSDs that are TA as Tc1/mariner TEs and with 3bp TSDs that are TAA or TTA as PIF/Harbinger TEs. Nested TEs were removed and low complexity sequences were masked before homology searches by RepeatMasker described below.
Because one TE copy may mutate into several fragments, the number of total fragments is higher than the total copy number of TEs. We counted the nTE copy number using an approach similar to one introduced previously (see Additional file1, the 6th column)[1]. Total length and copy numbers of class 2 noncoding TEs were determined using RepeatMasker as follows. Curated MITE-Hunter outputs were first masked by mdust (http://compbio.dfci.harvard.edu/tgi/software/) to filter low complexity regions and were used as library files for RepeatMaker (version 3.26, http://www.repeatmasker.org) to mask the genomic sequences with “–nolow” and “–no_is” parameters. Because the positions of some TE copies overlap in the RepeatMasker output, to avoid counting a TE region twice, the original RepeatMasker output was first filtered and then the length and copy number of TEs were counted, which was done by a Perl script introduced in detail as follows. In the RepeatMasker output, if two consecutive TE copies overlapped, then the starting position of the second one was adjusted so it was right after the stop position of the first one. If a short TE copy was within a longer one, the shorter one was filtered. If a TE copy identified by RepeatMasker was missing less than 20bp from both ends of the query nTE consensus sequence, it was considered to be a double-ended copy. If a TE copy had only one end that was missing less than 20bp, it was counted as half of a copy. Other TE copies in the RepeatMasker output were considered as fragments that were not counted in the copy numbers. A nTE was considered to be a MITE if it was less than 600bp and had at least 25 double-ended copies, or 10 double-ended copies with an identity > = 99%.
Calculation of TE distribution within and around genes
Several Perl scripts were written to acquire the genomic positions of TE regions and genes and to render figures of the distribution and proportion of TE sequences in and around genes. Positions of TE sequences were retrieved from processed RepeatMasker outputs. Positions of genes were retrieved from gene annotation files as follows. First, annotation files were checked to filter genes whose exons have contradicted directions. Genes inside other genes were also filtered. Second, for each gene, positions of different compartments were retrieved including 5 flanking regions, 5 UTR exons, 5 UTR introns, exons, introns, 3 UTR exons, 3UTR introns and 3 flanking regions. Due to alternative splicing, one gene may have several sets of annotated compartments. In such cases, a combined gene model was generated using the following rules. If there was conflicted annotation information between two models, highest priority went to exons in the coding regions, with exons in the UTR next and introns with lowest priority. For example, a region annotated as an exon in one gene model but an intron in another was considered as an exon only.
For each type of gene compartment, an average percentage was calculated by dividing the total length of TE sequences within the gene compartment by the total length of the gene compartment. In the 5F and the 3F of all genes, TE sequence proportions were also calculated along each nucleotide position.
Analyses of microarray expression data
Gene expression values were acquired from microarray data in the GEO database. Rice data was from four sample series from two platforms: GPL6864 (Rice 44K, product of Agilent) and GPL2025 (Affymetrix Rice Genome Array). GPL6864 was designed based on RAP annotation results but GPL2025 was based on TIGR annotations. Because we used RAP annotations in this study, to use GPL2025 microarray data, we performed sequence comparisons between each GPL2025 probe sequence with RAP cDNA sequences. Maize expression data was from platform GPL10837 (Maize Pioneer Hi-Bred 105K mRNA Microarray). Because correlations between probe IDs and gene names in the gene annotation file were not known, as with the rice data, we performed comparisons between maize probes and maize cDNA sequences. For all microarray platforms, only genes whose probes had 100% identity to cDNA sequences were used. If a probe matched more than one gene its expression data was not used. If a gene had more than one probe, an average value was calculated.
Analyses of RNA-seq data
Reads were mapped to the rice reference genome using BWA[34]. PCR redundant reads were identified and filtered using picard (http://picard.sourceforge.net). Reads mapped within 80bp to the microarray probes were counted to represent the expression level of each gene.
Statistical tests of the association between TEs and genes
Brunner-Munzel Test (Generalized Wilcoxon Test) was carried out using R package (version 2.12.0) to compare the expression levels between each TE-containing gene group with the control gene group. Genes (including 1kb flanking regions) that contain the same superfamily of class 2 nTEs were put into the same group. Genes that did not have any class 2 nTEs were put into the control group. Only genes with at least 1kb flanking region on either side were used in this analysis.
References
1. 1.
Schnable PS, Ware D, Fulton RS, Stein JC, Wei F, Pasternak S, Liang C, Zhang J, Fulton L, Graves TA: The B73 maize genome: complexity, diversity, and dynamics. Science. 2009, 326 (5956): 1112-1115.
Article CAS PubMed Google Scholar
2. 2.
Nene V, Wortman JR, Lawson D, Haas B, Kodira C, Tu ZJ, Loftus B, Xi Z, Megy K, Grabherr M: Genome sequence of Aedes aegypti, a major arbovirus vector. Science. 2007, 316 (5832): 1718-1723.
Article CAS PubMed Google Scholar
3. 3.
Bennetzen JL: Transposable element contributions to plant gene and genome evolution. Plant Mol Biol. 2000, 42 (1): 251-269.
Article CAS PubMed Google Scholar
4. 4.
Yuan YW, Wessler SR: The catalytic domain of all eukaryotic cut-and-paste transposase superfamilies. Proc Natl Acad Sci USA. 2011, 108 (19): 7884-7889.
PubMed Central Article CAS PubMed Google Scholar
5. 5.
Feschotte C, Pritham EJ: DNA transposons and the evolution of eukaryotic genomes. Annu Rev Genet. 2007, 41: 331-368.
PubMed Central Article CAS PubMed Google Scholar
6. 6.
Wicker T, Sabot F, Hua-Van A, Bennetzen JL, Capy P, Chalhoub B, Flavell A, Leroy P, Morgante M, Panaud O: A unified classification system for eukaryotic transposable elements. Nat Rev Genet. 2007, 8 (12): 973-982.
Article CAS PubMed Google Scholar
7. 7.
Bureau TE, Wessler SR: Stowaway: a new family of inverted repeat elements associated with the genes of both monocotyledonous and dicotyledonous plants. Plant Cell. 1994, 6 (6): 907-916.
PubMed Central Article CAS PubMed Google Scholar
8. 8.
Bureau TE, Wessler SR: Tourist: a large family of small inverted repeat elements frequently associated with maize genes. Plant Cell. 1992, 4 (10): 1283-1294.
PubMed Central Article CAS PubMed Google Scholar
9. 9.
Wessler SR, Bureau TE, White SE: LTR-retrotransposons and MITEs: important players in the evolution of plant genomes. Curr Opin Genet Dev. 1995, 5 (6): 814-821.
Article CAS PubMed Google Scholar
10. 10.
Yang G, Nagel DH, Feschotte C, Hancock CN, Wessler SR: Tuned for transposition: molecular determinants underlying the hyperactivity of a Stowaway MITE. Science. 2009, 325 (5946): 1391-1394.
Article CAS PubMed Google Scholar
11. 11.
Zhang X, Jiang N, Feschotte C, Wessler SR: PIF- and Pong-like transposable elements: distribution, evolution and relationship with Tourist-like miniature inverted-repeat transposable elements. Genetics. 2004, 166 (2): 971-986.
PubMed Central Article CAS PubMed Google Scholar
12. 12.
Jiang N, Bao Z, Zhang X, Hirochika H, Eddy SR, McCouch SR, Wessler SR: An active DNA transposon family in rice. Nature. 2003, 421 (6919): 163-167.
Article CAS PubMed Google Scholar
13. 13.
Feschotte C, Swamy L, Wessler SR: Genome-wide analysis of mariner-like transposable elements in rice reveals complex relationships with stowaway miniature inverted repeat transposable elements (MITEs). Genetics. 2003, 163 (2): 747-758.
PubMed Central CAS PubMed Google Scholar
14. 14.
Kuang H, Padmanabhan C, Li F, Kamei A, Bhaskar PB, Ouyang S, Jiang J, Buell CR, Baker B: Identification of miniature inverted-repeat transposable elements (MITEs) and biogenesis of their siRNAs in the Solanaceae: new functional implications for MITEs. Genome Res. 2009, 19 (1): 42-56.
PubMed Central Article CAS PubMed Google Scholar
15. 15.
Moreno-Vazquez S, Ning J, Meyers BC: hATpin, a family of MITE-like hAT mobile elements conserved in diverse plant species that forms highly stable secondary structures. Plant Mol Biol. 2005, 58 (6): 869-886.
Article CAS PubMed Google Scholar
16. 16.
Yang G, Hall TC: MDM-1 and MDM-2: two mutator-derived MITE families in rice. J Mol Evol. 2003, 56 (3): 255-264.
Article CAS PubMed Google Scholar
17. 17.
Holyoake AJ, Kidwell MG: Vege and Mar: two novel hAT MITE families from Drosophila willistoni. Mol Biol Evol. 2003, 20 (2): 163-167.
Article CAS PubMed Google Scholar
18. 18.
Lu C, Chen J, Zhang Y, Hu Q, Su W, Kuang H: Miniature inverted-repeat transposable elements (MITEs) have been accumulated through amplification bursts and play important roles in gene expression and species diversity in Oryza sativa. Mol Biol Evol. 2012, 29 (3): 1005-1017.
PubMed Central Article CAS PubMed Google Scholar
19. 19.
Fontanillas P, Hartl DL, Reuter M: Genome organization and gene expression shape the transposable element distribution in the Drosophila melanogaster euchromatin. PLoS Genet. 2007, 3 (11): e210-
PubMed Central Article PubMed Google Scholar
20. 20.
Vogel JP, Garvin DF, Mockler TC, Schmutz J, Rokhsar D, Bevan MW: Genome sequencing and analysis of the model grass Brachypodium distachyon. Nature. 2010, 463 (7282): 763-768.
Article CAS Google Scholar
21. 21.
Project IRGS: The map-based sequence of the rice genome. Nature. 2005, 436 (7052): 793-800.
Article Google Scholar
22. 22.
Paterson AH, Bowers JE, Bruggmann R, Dubchak I, Grimwood J, Gundlach H, Haberer G, Hellsten U, Mitros T, Poliakov A: The Sorghum bicolor genome and the diversification of grasses. Nature. 2009, 457 (7229): 551-556.
Article CAS PubMed Google Scholar
23. 23.
Han Y, Wessler SR: MITE-Hunter: a program for discovering miniature inverted-repeat transposable elements from genomic sequences. Nucleic Acids Res. 2010
Google Scholar
24. 24.
Liao GC, Rehm EJ, Rubin GM: Insertion site preferences of the P transposable element in Drosophila melanogaster. Proc Natl Acad Sci USA. 2000, 97 (7): 3347-3351.
PubMed Central Article CAS PubMed Google Scholar
25. 25.
Zhang Q, Arbuckle J, Wessler SR: Recent, extensive, and preferential insertion of members of the miniature inverted-repeat transposable element family Heartbreaker into genic regions of maize. Proc Natl Acad Sci USA. 2000, 97 (3): 1160-1165.
PubMed Central Article CAS PubMed Google Scholar
26. 26.
Naito K, Zhang F, Tsukiyama T, Saito H, Hancock CN, Richardson AO, Okumoto Y, Tanisaka T, Wessler SR: Unexpected consequences of a sudden and massive transposon amplification on rice gene expression. Nature. 2009, 461 (7267): 1130-1134.
Article CAS PubMed Google Scholar
27. 27.
Zemach A, Kim MY, Silva P, Rodrigues JA, Dotson B, Brooks MD, Zilberman D: Local DNA hypomethylation activates genes in rice endosperm. Proc Natl Acad Sci USA. 2010, 107 (43): 18729-18734.
PubMed Central Article CAS PubMed Google Scholar
28. 28.
Gangadharan S, Mularoni L, Fain-Thornton J, Wheelan SJ, Craig NL: Inaugural Article: DNA transposon Hermes inserts into DNA in nucleosome-free regions in vivo. Proc Natl Acad Sci USA. 2010, 107 (51): 21966-21972.
PubMed Central Article CAS PubMed Google Scholar
29. 29.
Kodama Y, Nagaya S, Shinmyo A, Kato K: Mapping and characterization of DNase I hypersensitive sites in Arabidopsis chromatin. Plant Cell Physiol. 2007, 48 (3): 459-470.
Article CAS PubMed Google Scholar
30. 30.
Hollister JD, Smith LM, Guo YL, Ott F, Weigel D, Gaut BS: Transposable elements and small RNAs contribute to gene expression divergence between Arabidopsis thaliana and Arabidopsis lyrata. Proc Natl Acad Sci USA. 2011, 108 (6): 2322-2327.
PubMed Central Article CAS PubMed Google Scholar
31. 31.
Tanaka T, Antonio BA, Kikuchi S, Matsumoto T, Nagamura Y, Numa H, Sakai H, Wu J, Itoh T, Sasaki T: The Rice Annotation Project Database (RAP-DB): 2008 update. Nucleic Acids Res. 2008, 36 (Database issue): D1028-1033.
CAS PubMed Google Scholar
32. 32.
Barrett T, Edgar R: Gene expression omnibus: microarray data storage, submission, retrieval, and analysis. Methods Enzymol. 2006, 411: 352-369.
PubMed Central Article CAS PubMed Google Scholar
33. 33.
Jurka J, Kapitonov VV, Pavlicek A, Klonowski P, Kohany O, Walichiewicz J: Repbase Update, a database of eukaryotic repetitive elements. Cytogenet Genome Res. 2005, 110 (1–4): 462-467.
Article CAS PubMed Google Scholar
34. 34.
Li H, Durbin R: Fast and accurate long-read alignment with Burrows-Wheeler transform. Bioinformatics. 2010, 26 (5): 589-595.
PubMed Central Article PubMed Google Scholar
Download references
Acknowledgements
We thank Yaowu Yuan, Aaron O. Richardson, Michael McKain, Xiaoyu Zhang and Jim Leebens-Mack for valuable discussions and suggestions. This study was supported by a grant from the NSF Plant Genome Program to SRW.
Author information
Affiliations
Authors
Corresponding author
Correspondence to Susan R Wessler.
Additional information
Competing interests
The authors declare that they have no competing interests.
Authors’ contributions
SRW and YH designed the experiments and wrote the manuscript. YH developed programs and performed the primary data analyses. SQ participated the analyses and performed the statistical tests. All authors read and approved the final manuscript.
Electronic supplementary material
Additional file 1:Summary of Class 2 transposable elements from five superfamilies in four sequenced grass genomes.(XLSX 15 KB)
The double-ended copy number and length of the consensus nTEs of
Additional file 2: Tc1/mariner , PIF/Harbinger , hAT and Mutator in Brachypodium , rice, sorghum and maize. The y-axis is in log10 scale. (TIFF 8 MB)
Additional file 3:Total length of nTEs from each superfamily genome-wide, intergenic and in four genic compartments.(XLSX 20 KB)
Distribution of nTE sequence frequency within introns of
Additional file 4: Brachypodium (A), rice (B), sorghum (C) and maize (D). The left and right starting points represent the 5 and 3 borders of introns, respectively. Colors of superfamilies are the same as in Figure 1. (TIFF 17 MB)
Additional file 5:Comparison of the expression of genes associated with different class 2 TE superfamily members vs. genes without class 2 TEs (control) (using microarray data).(XLSX 13 KB)
Additional file 6:Comparison of the expression of genes associated with different class 2 TE superfamily members vs. genes without class 2 TEs (control) (using RNA-seq data).(XLSX 10 KB)
Authors’ original submitted files for images
Rights and permissions
Reprints and Permissions
About this article
Cite this article
Han, Y., Qin, S. & Wessler, S.R. Comparison of class 2 transposable elements at superfamily resolution reveals conserved and distinct features in cereal grass genomes. BMC Genomics 14, 71 (2013). https://doi.org/10.1186/1471-2164-14-71
Download citation
Keywords
• Genome comparison
• Plant genomes
• Genome evolution
• Class2 transposable elements
• Features
• Grass genomes
|
__label__pos
| 0.65687 |
Monday, 19 April 2021
Interesting Facts About Moles - Feeding, Digging Behavior, Habitat, and Breeding Season
The moles, shrew moles, and desmans are all members of the Talpidae family and are found only in northern North America and Eurasia. These mostly burrowing insectivores (29 species in 12 genera) are extremely cryptic and, as a result of their lifestyle, have received little research. To date, the species that has garnered the most interest from naturalists and biologists alike is the European mole (Talpa europaea), whose lifestyle and activities are likely very similar to those of many other members of this genus.
Mole specialised for a subterranean, fossorial lifestyle. Their long, spade-like forelimbs have evolved into highly effective digging organs and are attached to muscular shoulders and a deep chestbone. The skin on the chest is thicker than on the rest of the body because it bears the majority of the mole's weight as it digs or sleeps. Behind the massive shoulders, the body is nearly cylindrical, tapering slightly to narrow hips, with short robust hindlimbs (which are not particularly well suited for digging) and a short club-shaped tail that is normally borne upright.
In the majority of mammals, both pairs of limbs have an additional bone that raises the surface area of the feet, provides additional protection in the hindlimbs, and assists the forelimbs in moving the ground. The elongated head tapers to a hairless, fleshy pink snout with a high sensory ability. This organ carries 22 tentacles, each of which contains thousands of sensory organs, in the North American star-nosed mole (Condylura cristata).
How Do Mole Burrows Form?
The burrow of a mole is sometimes mistaken. Moles do not dig continuously or in search of food. Other than that, the tunnel system, which serves as the resident animal's permanent home, serves as a food trap, continuously accumulating invertebrate prey such as earthworms and insect larvae. Invertebrates fall into the animal's burrow as they pass through the soil column and sometimes do not escape before being spotted by the vigilant, patrolling resident mole.
Once prey is found, it is quickly apprehended and decapitated in the case of an earthworm. The worm is then drawn forward by the forefeet's teeth, squeezing out any grit and sand that might otherwise cause excessive tooth wear—one of the most common causes of death in moles.
When a mole senses an unexpected abundance of prey, it will attempt to catch as many as possible, storing them in a centralised cache that is normally well-defended. This cache, which is always placed near the mole's single nest, is packed into the soil to keep the earthworms alive but dormant for many months. Thus, if an animal faces a food shortage, it can quickly raid this larder rather than depleting vital body reserves searching for scarce prey. Moles tend to be extremely selective when it comes to selecting certain prey for the shop, usually choosing only the largest prey available.
How Do Mole Tunnels Get Constructed?
Tunnel building and maintenance consume a large portion of a mole's available time. Throughout the year, a mole digs vigorously, but once it has developed its burrow system, there may be little evidence of the mole's existence above ground. Moles build a complex network of burrows that are usually multi-tiered. When a mole starts excavating a network of tunnels. It usually begins with a relatively straight exploratory tunnel of up to 20 metres (22 yards) in length before branching off. This is most likely an attempt to find nearby animals while also constructing a food trap for later use. Subsequently, the tunnels are lengthened and several additional tunnels are built underneath these preliminary burrows. This tier-tunnel system will result in one animal's burrows overlying those of its neighbours without the burrows being physically connected. However, in an existing community, numerous tunnels bind neighbouring animals.
The Navigational Sensitivity of the Mole
Moles have an excellent sense of direction and often build their tunnels in the exact same location each year.
Current tunnels in permanent pastures may be used by several generations of moles. Certain animals may be evicted from their tunnels as a result of an invasion by a stronger animal; in such cases, the loser must flee and create a new tunnel system.
These master builders are intimately acquainted with every inch of their own territory and are wary of any modifications to a tunnel, making them difficult to apprehend. If the usual path to the nest or feeding area is blocked, for example, a mole will dig around or under the obstruction, rejoining the original tunnel with minimal digging.
Our understanding of the sensory environment of moles is rudimentary. They are exclusively fossorial animals, with small eyes obscured by thick fur or, in the case of the blind mole Talpa caeca, by skin. Shrew moles, on the other hand, forage not only underground in caves but also above ground in leal litter. Although they may have a more acute sense of vision than other animals, they are more likely to perceive shadows than to rely heavily on vision for prey detection or orientation.
Almost all animals seem to lack ears due to the absence of external ear flaps and the dense fur covering the ear opening. However, it has been proposed that ultrasonic communication could be a critical mode of communication for fossorial and nocturnal animals. However, of all the sensory means available, olfaction appears to be the most important—a fact confirmed by the elaborate nasal region of many species and the battalion of sensory organs contained inside.
Season of Reproduction
Since females are only receptive for 24 to 48 hours during the breeding season, it is a hectic time for moles. Males typically abandon their regular pattern of behaviour and activity during this period, devoting significant time and energy to finding potential mates. Mating occurs within the female's burrow system, and this is the only time that the sexes are not aggressive against one another.
Four weeks later, the young are born in the nest, with an average of three per litter. The pink, naked infants weigh less than 4 grammes (ounce) and are unable to regulate their body temperature, relying on their mother for warmth. For the first month, the young are exclusively fed milk, after which they quickly gain weight. Juveniles remain in the nest chamber until they are approximately five weeks old, at which point they begin making brief exploratory forays in the immediate vicinity of the nest chamber. They will soon follow their mother on more extensive explorations of the burrow system and will disperse on their own; those who remain will be quickly evicted by the mother.
Perhaps you'd like to learn more about the Beaver's Natural Habitat Diet. Beavers are the world's largest rodents.
No comments:
Post a Comment
Save Your Dog's Life: Choking
Choking is a frequent emergency situation that you can encounter with your pet. Most dogs can chew on almost everything, including bones, ...
|
__label__pos
| 0.906951 |
passing ksh variable into bteq function?
Tools
Enthusiast
passing ksh variable into bteq function?
I'm trying to pass string variables inside a function (the bteq itself does work) but can't seem to get it to work. I try this:
td_instance="one"
user="usr1"
pass="pass1"
schemaName="schemaA"
tblName="tableA"
query="SEL '>'||COUNT(*) FROM $schemaName.$tblName"
query_td() {bteq .LOGON $td_instance/$user,$pass
DATABASE $schemaName;
.set width 1000;
.set titledashes off;
$1;
.LOGOFF;
.QUIT;
.EXIT
}
echo $(query_td << EOF |grep '^>' |sed -e "s/^>//" EOF "$query")
and keep getting this error:
-ksh: .: syntax error: `)' unexpected
can someone help me pass the variables into the bteq function?
Tags (1)
2 REPLIES
Enthusiast
Re: passing ksh variable into bteq function?
no one has done this?
Enthusiast
Re: passing ksh variable into bteq function?
Hi k1ng
I tried this & it worked for me.
Below is my shell script:
#!/bin/ksh
server=localhost
user=raj
pass=raj
qry="SELECT infokey FROM DBC.DBCINFO sample 1;"
chk_bteq(){
bteq << EOF
.logmech LDAP;
.logon $server/$user,$pass;
$1
.LOGOFF;
EOF
}
chk_bteq "$qry"
Thanks
Raj
|
__label__pos
| 0.999823 |
Brittle system
From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Brittle systems theory creates an analogy between communication theory and mechanical systems. A brittle system is a system characterized by a sudden and steep decline in performance as the system state changes. This can be due to input parameters that exceed a specified input, or environmental conditions that exceed specified operating boundaries. This is the opposite of a gracefully degrading system. Brittle system analysis develops an analogy with materials science in order to analyze system brittleness.[1] A system that is brittle (but initially robust enough to gain at least some foothold in the marketplace) will tend to operate with acceptable performance until it reaches a limit and then degrade suddenly and catastrophically. The table below illustrates the concept behind the analysis using an example of a communication system.
Materials Science Target System Brittle Systems Analysis Materials Science Quantification
Stress Interbyte jitter, EMI, number of slaves, etc. Amount parameter exceeds tolerance Force per unit area within a body
Toughness Ability to withstand the above System robustness Ability to absorb energy up to failure
Hardness* Constant latency, throughput with stress in tolerance Level of performance within tolerance Resistance to deformation
Ductility* Gradual reduction in latency, throughput as stress exceeds tolerance Level of performance out of tolerance Fracture strain or reduction of area at fracture
Plastic strain Latency, throughput are permanently degraded System cannot recover from degradation Deformation between particles in a body relative to length
Reversible strain Latency, throughput are temporarily degraded System can recover from degradation Same as above, but returns to normal after force removed
Brittle fracture Sudden steep decline in latency, throughput Sudden steep decline in performance There is no reduction of area when material breaks
Ductile fracture Graceful degradation in latency, throughput Graceful degradation in performance The area at the point of fracture gradually reduces to zero
Brittleness* Hardness over ductility Ratio of hardness over ductility Ratio of hardness over ductility
Deformation Degradation in latency, throughput Degradation in performance Change in shape of a material
Young's modulus Stress (jitter/EMI) over reduction in latency and throughput Amount of tolerance exceeded over degradation Measure of the stiffness of an elastic material
See also[edit]
References[edit]
1. ^ Stephen F. Bush, John Hershey and Kirby Vosburgh, Brittle System Analysis, arXiv:cs/9904016
Further reading[edit]
|
__label__pos
| 0.986473 |
Menu Close
Diaphragmatic Breathing for Anxiety
Anxiety affects all of us in different ways, and although it is likely non-threatening, for some people it can significantly interfere in their ability to have the life they know they are capable of.
Most of us get anxious before an important exam, test results for a medical problem, or even a joyous moment like childbirth or a wedding day. But for some people, anxiety can be a crippling thing in their lives and it can take over their everyday lives, causing them to isolate, or to have panic attacks, or a range of other stress-related health issues.
Many severe sufferers of anxiety disorders will turn to the medical field for treatment. There are several different forms of treatment for those suffering from anxiety disorders- from medication to talk therapy, herbal supplements and meditation. Not everyone who suffers from anxiety suffers from it in the same way, which results in each treatment method potentially not having the same response for everyone. If you do suffer from anxiety, it is important that you seek a treatment method that works for you.
Non-invasive and budget friendly
One of the most basic, least invasive and least expensive of these methods is diaphragmatic breathing. Unlike medication which can come with side-effects, diaphragmatic breathing is often recommended by specialists to their clients as a first step in calming themselves down whenever they are faced with an anxiety-inducing situation.
Slow breathing
Diaphragmatic breathing is also known as “slow breathing”. It is a breathing technique where you breathe from your diaphragm. This allows you to slow down your breathing, lowering your heart rate and stress level when you are presented with a situation that increases your anxiety.
How do you practice?
It is advised that anxiety sufferers should practice diaphragmatic breathing at least twice a day for five minutes, while they are calm, so they can better prepare themselves to initiate the practice immediately when they feel an attack coming on.
You can practice by laying on the floor, back straight, knees bent and feet shoulder-width apart. Place one hand on your heart, the other on your abdomen. Hold your breath for ten seconds, then breathe out. Next, inhale through your nose for three seconds. Paying close attention to your hands, the one on your abdomen should move up and down as you inhale and exhale, while the one on your heart should remain still.
Both learning about the practice of diaphragmatic breathing, and practicing the technique will allow you to have greater control over your anxiety, and decrease your stress levels at the same time.
Other Applications of Diaphragmatic Breathing
Outside of the medical field of treatment, it also has practical purposes for musicians and other performers who need to expand their lung capacity in order to hit higher song notes, or stay at a particular vocal pitch for longer. It also has a place in Hatha Yoga, tai-chi and meditation, as a relaxation technique.
|
__label__pos
| 0.683359 |
Ir para o conteúdo principal
GSM iPad 2 with 16, 32, or 64 GB of storage, and a Dual Core A5 Processor. Model Number A1396. Repair is complicated and requires heat and prying.
152 Perguntas Visualizar todos
Only background showing and not working, not closing?
I have IOS 8. I was reading a pdf on Adobe last night, my charge was gone so it closed. Then I recharged it. I tried opening it. The background appears. no pass word, screen lock. no apps. no up or down manues. nothing. I tried switchin it, does not switch. I pressed the up and down bottons at the same time. apple logo appears, the screen goes blank, after a while, the same background appears. my own background. Ive tried this many times
Responder a esta pergunta Também tenho esse problema
Esta é uma boa pergunta?
Pontuação 9
17 comentários
there is also a stage where ipad opens with clock and date showing as it is supposed to, but the screen is extra extra large and does not reduce. I can open the drop down menu above, still extra large.
por
I tapped the screen with three finger twice, and it opened.
por
I have the same issue and nothing is working not even rebooting it works :(
por
same thing hapened to me, what I did is press and hold the power button and home button
por
Danika, THANK YOU SO MUCH
por
Exibir mais 12 comentários
Adicionar um comentário
11 respostas
Pergunta mais útil
Try pressing home button and power button for like 10 seconds should either power off or reboot if powers off turn back on see if fixes if not plug into computer and see if sees it if does may need to reload os if not might be S.O.L.
Esta resposta foi útil?
Pontuação 13
12 comentários:
thank you. pressing buttnons like that do not help.
por
Thank you it worked I was so worried
por
thank you so much !! life saver
por
it worked!! yippeee!! thank you so much
por
thank you so much
por
Exibir mais 7 comentários
Adicionar um comentário
I just switched off my phone, then i held the home button and the power button at the exact same time for like 5 seconds then you see a blue screen then it turns black and you will see the apple logo and if it starts its all fine
Esta resposta foi útil?
Pontuação 3
1 comentário:
Thank you! My phone is saved :)
por
Adicionar um comentário
Are you able to power the unit off? If so, plug it in, turn it off and leave it sit overnight. At least 8 hours. Sometimes they come back from weird errors like after a timeout and a good charge.
If that doesn't work (don't be surprised if it doesn't), then its time for a restore. Plug the iPad into your computer, hold down the power button for 5 seconds. Then press and hold the home button for 15 seconds while still holding power. Then the "connect to iTunes" should appear. In iTunes, select restore, and let the device wipe and install.
If that doesn't work, please update. Its possible that it could be hardware but I'd bet on a software glitch.
Esta resposta foi útil?
Pontuação 1
Adicionar um comentário
I have the same problem. Updated yesterday and it kept freezing up so I shut it down and it loaded with the apple Icon by then only the clock shows. It won't shut down again. Basically the upgrade screwed up my Ipad. Nice going Apple. :-(
Esta resposta foi útil?
Pontuação 0
Adicionar um comentário
hold power and home button at the same time for ten seconds
Esta resposta foi útil?
Pontuação 0
Adicionar um comentário
The same thing happened to me
But what can I do to fix it when my home button doesnt work???
Esta resposta foi útil?
Pontuação 0
1 comentário:
I have the same problem too? Anyone can help?
por
Adicionar um comentário
Can i get help my friend's iphone not working she cant do enithing. Thanks
Esta resposta foi útil?
Pontuação 0
Adicionar um comentário
try placing it in some fire. when it burns for about 10-15 minutes then out the fire with some honey and try powering it on with a block of cheese. If that doesn't work power it on with a hammer for 8 seconds then toss if off a cliff, by then it should start working.. working well out of you life, so you can then go purchase a better &&^&^$^ device you stupid @%^$$@$!!
Esta resposta foi útil?
Pontuação 0
1 comentário:
Wtf? (What the flip)
por
Adicionar um comentário
Hi I learned that if you put ur phone/I pad in the microwave for 5-10 min it will solve that problem thank you for every one who told me that.
Esta resposta foi útil?
Pontuação 0
1 comentário:
And then eat it. That should work.
por
Adicionar um comentário
I don't have an answer but I have a question. I have a Zte Whirl that still works but stays on a black screen. Can you help me solve this problem please?
Esta resposta foi útil?
Pontuação 0
Adicionar um comentário
my phone isn't displaying words just the background. what should I do?
Esta resposta foi útil?
Pontuação 0
1 comentário:
This is not an answer :P
por
Adicionar um comentário
Adicionar a sua resposta
nur será eternamente grato(a).
Exibir estatísticas:
Últimas 24 horas: 0
Últimos 7 dias: 1
Últimos 30 dias: 6
Duração total: 37,093
|
__label__pos
| 0.99641 |
/[gentoo-x86]/eclass/toolchain-funcs.eclass
Gentoo
Contents of /eclass/toolchain-funcs.eclass
Parent Directory Parent Directory | Revision Log Revision Log
Revision 1.117 - (show annotations) (download)
Sat Sep 15 16:16:53 2012 UTC (4 years ago) by zmedico
Branch: MAIN
Changes since 1.116: +2 -4 lines
Remove redundant DESCRIPTION variable settings.
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.116 2012/09/13 05:06:34 vapier Exp $
4
5 # @ECLASS: toolchain-funcs.eclass
6 # @MAINTAINER:
7 # Toolchain Ninjas <[email protected]>
8 # @BLURB: functions to query common info about the toolchain
9 # @DESCRIPTION:
10 # The toolchain-funcs aims to provide a complete suite of functions
11 # for gleaning useful information about the toolchain and to simplify
12 # ugly things like cross-compiling and multilib. All of this is done
13 # in such a way that you can rely on the function always returning
14 # something sane.
15
16 if [[ ${___ECLASS_ONCE_TOOLCHAIN_FUNCS} != "recur -_+^+_- spank" ]] ; then
17 ___ECLASS_ONCE_TOOLCHAIN_FUNCS="recur -_+^+_- spank"
18
19 inherit multilib
20
21 # tc-getPROG <VAR [search vars]> <default> [tuple]
22 _tc-getPROG() {
23 local tuple=$1
24 local v var vars=$2
25 local prog=$3
26
27 var=${vars%% *}
28 for v in ${vars} ; do
29 if [[ -n ${!v} ]] ; then
30 export ${var}="${!v}"
31 echo "${!v}"
32 return 0
33 fi
34 done
35
36 local search=
37 [[ -n $4 ]] && search=$(type -p "$4-${prog}")
38 [[ -z ${search} && -n ${!tuple} ]] && search=$(type -p "${!tuple}-${prog}")
39 [[ -n ${search} ]] && prog=${search##*/}
40
41 export ${var}=${prog}
42 echo "${!var}"
43 }
44 tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; }
45 tc-getPROG() { _tc-getPROG CHOST "$@"; }
46
47 # @FUNCTION: tc-getAR
48 # @USAGE: [toolchain prefix]
49 # @RETURN: name of the archiver
50 tc-getAR() { tc-getPROG AR ar "$@"; }
51 # @FUNCTION: tc-getAS
52 # @USAGE: [toolchain prefix]
53 # @RETURN: name of the assembler
54 tc-getAS() { tc-getPROG AS as "$@"; }
55 # @FUNCTION: tc-getCC
56 # @USAGE: [toolchain prefix]
57 # @RETURN: name of the C compiler
58 tc-getCC() { tc-getPROG CC gcc "$@"; }
59 # @FUNCTION: tc-getCPP
60 # @USAGE: [toolchain prefix]
61 # @RETURN: name of the C preprocessor
62 tc-getCPP() { tc-getPROG CPP cpp "$@"; }
63 # @FUNCTION: tc-getCXX
64 # @USAGE: [toolchain prefix]
65 # @RETURN: name of the C++ compiler
66 tc-getCXX() { tc-getPROG CXX g++ "$@"; }
67 # @FUNCTION: tc-getLD
68 # @USAGE: [toolchain prefix]
69 # @RETURN: name of the linker
70 tc-getLD() { tc-getPROG LD ld "$@"; }
71 # @FUNCTION: tc-getSTRIP
72 # @USAGE: [toolchain prefix]
73 # @RETURN: name of the strip program
74 tc-getSTRIP() { tc-getPROG STRIP strip "$@"; }
75 # @FUNCTION: tc-getNM
76 # @USAGE: [toolchain prefix]
77 # @RETURN: name of the symbol/object thingy
78 tc-getNM() { tc-getPROG NM nm "$@"; }
79 # @FUNCTION: tc-getRANLIB
80 # @USAGE: [toolchain prefix]
81 # @RETURN: name of the archiver indexer
82 tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; }
83 # @FUNCTION: tc-getOBJCOPY
84 # @USAGE: [toolchain prefix]
85 # @RETURN: name of the object copier
86 tc-getOBJCOPY() { tc-getPROG OBJCOPY objcopy "$@"; }
87 # @FUNCTION: tc-getF77
88 # @USAGE: [toolchain prefix]
89 # @RETURN: name of the Fortran 77 compiler
90 tc-getF77() { tc-getPROG F77 gfortran "$@"; }
91 # @FUNCTION: tc-getFC
92 # @USAGE: [toolchain prefix]
93 # @RETURN: name of the Fortran 90 compiler
94 tc-getFC() { tc-getPROG FC gfortran "$@"; }
95 # @FUNCTION: tc-getGCJ
96 # @USAGE: [toolchain prefix]
97 # @RETURN: name of the java compiler
98 tc-getGCJ() { tc-getPROG GCJ gcj "$@"; }
99 # @FUNCTION: tc-getPKG_CONFIG
100 # @USAGE: [toolchain prefix]
101 # @RETURN: name of the pkg-config tool
102 tc-getPKG_CONFIG() { tc-getPROG PKG_CONFIG pkg-config "$@"; }
103 # @FUNCTION: tc-getRC
104 # @USAGE: [toolchain prefix]
105 # @RETURN: name of the Windows resource compiler
106 tc-getRC() { tc-getPROG RC windres "$@"; }
107 # @FUNCTION: tc-getDLLWRAP
108 # @USAGE: [toolchain prefix]
109 # @RETURN: name of the Windows dllwrap utility
110 tc-getDLLWRAP() { tc-getPROG DLLWRAP dllwrap "$@"; }
111
112 # @FUNCTION: tc-getBUILD_AR
113 # @USAGE: [toolchain prefix]
114 # @RETURN: name of the archiver for building binaries to run on the build machine
115 tc-getBUILD_AR() { tc-getBUILD_PROG AR ar "$@"; }
116 # @FUNCTION: tc-getBUILD_AS
117 # @USAGE: [toolchain prefix]
118 # @RETURN: name of the assembler for building binaries to run on the build machine
119 tc-getBUILD_AS() { tc-getBUILD_PROG AS as "$@"; }
120 # @FUNCTION: tc-getBUILD_CC
121 # @USAGE: [toolchain prefix]
122 # @RETURN: name of the C compiler for building binaries to run on the build machine
123 tc-getBUILD_CC() { tc-getBUILD_PROG CC gcc "$@"; }
124 # @FUNCTION: tc-getBUILD_CPP
125 # @USAGE: [toolchain prefix]
126 # @RETURN: name of the C preprocessor for building binaries to run on the build machine
127 tc-getBUILD_CPP() { tc-getBUILD_PROG CPP cpp "$@"; }
128 # @FUNCTION: tc-getBUILD_CXX
129 # @USAGE: [toolchain prefix]
130 # @RETURN: name of the C++ compiler for building binaries to run on the build machine
131 tc-getBUILD_CXX() { tc-getBUILD_PROG CXX g++ "$@"; }
132 # @FUNCTION: tc-getBUILD_LD
133 # @USAGE: [toolchain prefix]
134 # @RETURN: name of the linker for building binaries to run on the build machine
135 tc-getBUILD_LD() { tc-getBUILD_PROG LD ld "$@"; }
136 # @FUNCTION: tc-getBUILD_STRIP
137 # @USAGE: [toolchain prefix]
138 # @RETURN: name of the strip program for building binaries to run on the build machine
139 tc-getBUILD_STRIP() { tc-getBUILD_PROG STRIP strip "$@"; }
140 # @FUNCTION: tc-getBUILD_NM
141 # @USAGE: [toolchain prefix]
142 # @RETURN: name of the symbol/object thingy for building binaries to run on the build machine
143 tc-getBUILD_NM() { tc-getBUILD_PROG NM nm "$@"; }
144 # @FUNCTION: tc-getBUILD_RANLIB
145 # @USAGE: [toolchain prefix]
146 # @RETURN: name of the archiver indexer for building binaries to run on the build machine
147 tc-getBUILD_RANLIB() { tc-getBUILD_PROG RANLIB ranlib "$@"; }
148 # @FUNCTION: tc-getBUILD_OBJCOPY
149 # @USAGE: [toolchain prefix]
150 # @RETURN: name of the object copier for building binaries to run on the build machine
151 tc-getBUILD_OBJCOPY() { tc-getBUILD_PROG OBJCOPY objcopy "$@"; }
152 # @FUNCTION: tc-getBUILD_PKG_CONFIG
153 # @USAGE: [toolchain prefix]
154 # @RETURN: name of the pkg-config tool for building binaries to run on the build machine
155 tc-getBUILD_PKG_CONFIG() { tc-getBUILD_PROG PKG_CONFIG pkg-config "$@"; }
156
157 # @FUNCTION: tc-export
158 # @USAGE: <list of toolchain variables>
159 # @DESCRIPTION:
160 # Quick way to export a bunch of compiler vars at once.
161 tc-export() {
162 local var
163 for var in "$@" ; do
164 [[ $(type -t tc-get${var}) != "function" ]] && die "tc-export: invalid export variable '${var}'"
165 eval tc-get${var} > /dev/null
166 done
167 }
168
169 # @FUNCTION: tc-is-cross-compiler
170 # @RETURN: Shell true if we are using a cross-compiler, shell false otherwise
171 tc-is-cross-compiler() {
172 return $([[ ${CBUILD:-${CHOST}} != ${CHOST} ]])
173 }
174
175 # @FUNCTION: tc-is-softfloat
176 # @DESCRIPTION:
177 # See if this toolchain is a softfloat based one.
178 # @CODE
179 # The possible return values:
180 # - only: the target is always softfloat (never had fpu)
181 # - yes: the target should support softfloat
182 # - softfp: (arm specific) the target should use hardfloat insns, but softfloat calling convention
183 # - no: the target doesn't support softfloat
184 # @CODE
185 # This allows us to react differently where packages accept
186 # softfloat flags in the case where support is optional, but
187 # rejects softfloat flags where the target always lacks an fpu.
188 tc-is-softfloat() {
189 local CTARGET=${CTARGET:-${CHOST}}
190 case ${CTARGET} in
191 bfin*|h8300*)
192 echo "only" ;;
193 *)
194 if [[ ${CTARGET//_/-} == *-softfloat-* ]] ; then
195 echo "yes"
196 elif [[ ${CTARGET//_/-} == *-softfp-* ]] ; then
197 echo "softfp"
198 else
199 echo "no"
200 fi
201 ;;
202 esac
203 }
204
205 # @FUNCTION: tc-is-static-only
206 # @DESCRIPTION:
207 # Return shell true if the target does not support shared libs, shell false
208 # otherwise.
209 tc-is-static-only() {
210 local host=${CTARGET:-${CHOST}}
211
212 # *MiNT doesn't have shared libraries, only platform so far
213 return $([[ ${host} == *-mint* ]])
214 }
215
216 # @FUNCTION: tc-export_build_env
217 # @USAGE: [compiler variables]
218 # @DESCRIPTION:
219 # Export common build related compiler settings.
220 tc-export_build_env() {
221 tc-export "$@"
222 : ${BUILD_CFLAGS:=-O1 -pipe}
223 : ${BUILD_CXXFLAGS:=-O1 -pipe}
224 : ${BUILD_CPPFLAGS:=}
225 : ${BUILD_LDFLAGS:=}
226 export BUILD_{C,CXX,CPP,LD}FLAGS
227 }
228
229 # @FUNCTION: tc-env_build
230 # @USAGE: <command> [command args]
231 # @INTERNAL
232 # @DESCRIPTION:
233 # Setup the compile environment to the build tools and then execute the
234 # specified command. We use tc-getBUILD_XX here so that we work with
235 # all of the semi-[non-]standard env vars like $BUILD_CC which often
236 # the target build system does not check.
237 tc-env_build() {
238 tc-export_build_env
239 CFLAGS=${BUILD_CFLAGS} \
240 CXXFLAGS=${BUILD_CXXFLAGS} \
241 CPPFLAGS=${BUILD_CPPFLAGS} \
242 LDFLAGS=${BUILD_LDFLAGS} \
243 AR=$(tc-getBUILD_AR) \
244 AS=$(tc-getBUILD_AS) \
245 CC=$(tc-getBUILD_CC) \
246 CPP=$(tc-getBUILD_CPP) \
247 CXX=$(tc-getBUILD_CXX) \
248 LD=$(tc-getBUILD_LD) \
249 NM=$(tc-getBUILD_NM) \
250 PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) \
251 RANLIB=$(tc-getBUILD_RANLIB) \
252 "$@"
253 }
254
255 # @FUNCTION: econf_build
256 # @USAGE: [econf flags]
257 # @DESCRIPTION:
258 # Sometimes we need to locally build up some tools to run on CBUILD because
259 # the package has helper utils which are compiled+executed when compiling.
260 # This won't work when cross-compiling as the CHOST is set to a target which
261 # we cannot natively execute.
262 #
263 # For example, the python package will build up a local python binary using
264 # a portable build system (configure+make), but then use that binary to run
265 # local python scripts to build up other components of the overall python.
266 # We cannot rely on the python binary in $PATH as that often times will be
267 # a different version, or not even installed in the first place. Instead,
268 # we compile the code in a different directory to run on CBUILD, and then
269 # use that binary when compiling the main package to run on CHOST.
270 #
271 # For example, with newer EAPIs, you'd do something like:
272 # @CODE
273 # src_configure() {
274 # ECONF_SOURCE=${S}
275 # if tc-is-cross-compiler ; then
276 # mkdir "${WORKDIR}"/${CBUILD}
277 # pushd "${WORKDIR}"/${CBUILD} >/dev/null
278 # econf_build --disable-some-unused-stuff
279 # popd >/dev/null
280 # fi
281 # ... normal build paths ...
282 # }
283 # src_compile() {
284 # if tc-is-cross-compiler ; then
285 # pushd "${WORKDIR}"/${CBUILD} >/dev/null
286 # emake one-or-two-build-tools
287 # ln/mv build-tools to normal build paths in ${S}/
288 # popd >/dev/null
289 # fi
290 # ... normal build paths ...
291 # }
292 # @CODE
293 econf_build() {
294 tc-env_build econf --build=${CBUILD:-${CHOST}} "$@"
295 }
296
297 # @FUNCTION: tc-has-openmp
298 # @USAGE: [toolchain prefix]
299 # @DESCRIPTION:
300 # See if the toolchain supports OpenMP.
301 tc-has-openmp() {
302 local base="${T}/test-tc-openmp"
303 cat <<-EOF > "${base}.c"
304 #include <omp.h>
305 int main() {
306 int nthreads, tid, ret = 0;
307 #pragma omp parallel private(nthreads, tid)
308 {
309 tid = omp_get_thread_num();
310 nthreads = omp_get_num_threads(); ret += tid + nthreads;
311 }
312 return ret;
313 }
314 EOF
315 $(tc-getCC "$@") -fopenmp "${base}.c" -o "${base}" >&/dev/null
316 local ret=$?
317 rm -f "${base}"*
318 return ${ret}
319 }
320
321 # @FUNCTION: tc-has-tls
322 # @USAGE: [-s|-c|-l] [toolchain prefix]
323 # @DESCRIPTION:
324 # See if the toolchain supports thread local storage (TLS). Use -s to test the
325 # compiler, -c to also test the assembler, and -l to also test the C library
326 # (the default).
327 tc-has-tls() {
328 local base="${T}/test-tc-tls"
329 cat <<-EOF > "${base}.c"
330 int foo(int *i) {
331 static __thread int j = 0;
332 return *i ? j : *i;
333 }
334 EOF
335 local flags
336 case $1 in
337 -s) flags="-S";;
338 -c) flags="-c";;
339 -l) ;;
340 -*) die "Usage: tc-has-tls [-c|-l] [toolchain prefix]";;
341 esac
342 : ${flags:=-fPIC -shared -Wl,-z,defs}
343 [[ $1 == -* ]] && shift
344 $(tc-getCC "$@") ${flags} "${base}.c" -o "${base}" >&/dev/null
345 local ret=$?
346 rm -f "${base}"*
347 return ${ret}
348 }
349
350
351 # Parse information from CBUILD/CHOST/CTARGET rather than
352 # use external variables from the profile.
353 tc-ninja_magic_to_arch() {
354 ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
355
356 local type=$1
357 local host=$2
358 [[ -z ${host} ]] && host=${CTARGET:-${CHOST}}
359
360 case ${host} in
361 aarch64*) ninj aarch64 arm;;
362 alpha*) echo alpha;;
363 arm*) echo arm;;
364 avr*) ninj avr32 avr;;
365 bfin*) ninj blackfin bfin;;
366 cris*) echo cris;;
367 hppa*) ninj parisc hppa;;
368 i?86*)
369 # Starting with linux-2.6.24, the 'x86_64' and 'i386'
370 # trees have been unified into 'x86'.
371 # FreeBSD still uses i386
372 if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -lt $(KV_to_int 2.6.24) || ${host} == *freebsd* ]] ; then
373 echo i386
374 else
375 echo x86
376 fi
377 ;;
378 ia64*) echo ia64;;
379 m68*) echo m68k;;
380 mips*) echo mips;;
381 nios2*) echo nios2;;
382 nios*) echo nios;;
383 powerpc*)
384 # Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees
385 # have been unified into simply 'powerpc', but until 2.6.16,
386 # ppc32 is still using ARCH="ppc" as default
387 if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]] ; then
388 echo powerpc
389 elif [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -eq $(KV_to_int 2.6.15) ]] ; then
390 if [[ ${host} == powerpc64* ]] || [[ ${PROFILE_ARCH} == "ppc64" ]] ; then
391 echo powerpc
392 else
393 echo ppc
394 fi
395 elif [[ ${host} == powerpc64* ]] ; then
396 echo ppc64
397 elif [[ ${PROFILE_ARCH} == "ppc64" ]] ; then
398 ninj ppc64 ppc
399 else
400 echo ppc
401 fi
402 ;;
403 s390*) echo s390;;
404 sh64*) ninj sh64 sh;;
405 sh*) echo sh;;
406 sparc64*) ninj sparc64 sparc;;
407 sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \
408 && ninj sparc64 sparc \
409 || echo sparc
410 ;;
411 vax*) echo vax;;
412 x86_64*freebsd*) echo amd64;;
413 x86_64*)
414 # Starting with linux-2.6.24, the 'x86_64' and 'i386'
415 # trees have been unified into 'x86'.
416 if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.24) ]] ; then
417 echo x86
418 else
419 ninj x86_64 amd64
420 fi
421 ;;
422
423 # since our usage of tc-arch is largely concerned with
424 # normalizing inputs for testing ${CTARGET}, let's filter
425 # other cross targets (mingw and such) into the unknown.
426 *) echo unknown;;
427 esac
428 }
429 # @FUNCTION: tc-arch-kernel
430 # @USAGE: [toolchain prefix]
431 # @RETURN: name of the kernel arch according to the compiler target
432 tc-arch-kernel() {
433 tc-ninja_magic_to_arch kern "$@"
434 }
435 # @FUNCTION: tc-arch
436 # @USAGE: [toolchain prefix]
437 # @RETURN: name of the portage arch according to the compiler target
438 tc-arch() {
439 tc-ninja_magic_to_arch portage "$@"
440 }
441
442 tc-endian() {
443 local host=$1
444 [[ -z ${host} ]] && host=${CTARGET:-${CHOST}}
445 host=${host%%-*}
446
447 case ${host} in
448 aarch64*be) echo big;;
449 aarch64) echo little;;
450 alpha*) echo big;;
451 arm*b*) echo big;;
452 arm*) echo little;;
453 cris*) echo little;;
454 hppa*) echo big;;
455 i?86*) echo little;;
456 ia64*) echo little;;
457 m68*) echo big;;
458 mips*l*) echo little;;
459 mips*) echo big;;
460 powerpc*) echo big;;
461 s390*) echo big;;
462 sh*b*) echo big;;
463 sh*) echo little;;
464 sparc*) echo big;;
465 x86_64*) echo little;;
466 *) echo wtf;;
467 esac
468 }
469
470 # Internal func. The first argument is the version info to expand.
471 # Query the preprocessor to improve compatibility across different
472 # compilers rather than maintaining a --version flag matrix. #335943
473 _gcc_fullversion() {
474 local ver="$1"; shift
475 set -- `$(tc-getCPP "$@") -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__"`
476 eval echo "$ver"
477 }
478
479 # @FUNCTION: gcc-fullversion
480 # @RETURN: compiler version (major.minor.micro: [3.4.6])
481 gcc-fullversion() {
482 _gcc_fullversion '$1.$2.$3' "$@"
483 }
484 # @FUNCTION: gcc-version
485 # @RETURN: compiler version (major.minor: [3.4].6)
486 gcc-version() {
487 _gcc_fullversion '$1.$2' "$@"
488 }
489 # @FUNCTION: gcc-major-version
490 # @RETURN: major compiler version (major: [3].4.6)
491 gcc-major-version() {
492 _gcc_fullversion '$1' "$@"
493 }
494 # @FUNCTION: gcc-minor-version
495 # @RETURN: minor compiler version (minor: 3.[4].6)
496 gcc-minor-version() {
497 _gcc_fullversion '$2' "$@"
498 }
499 # @FUNCTION: gcc-micro-version
500 # @RETURN: micro compiler version (micro: 3.4.[6])
501 gcc-micro-version() {
502 _gcc_fullversion '$3' "$@"
503 }
504
505 # Returns the installation directory - internal toolchain
506 # function for use by _gcc-specs-exists (for flag-o-matic).
507 _gcc-install-dir() {
508 echo "$(LC_ALL=C $(tc-getCC) -print-search-dirs 2> /dev/null |\
509 awk '$1=="install:" {print $2}')"
510 }
511 # Returns true if the indicated specs file exists - internal toolchain
512 # function for use by flag-o-matic.
513 _gcc-specs-exists() {
514 [[ -f $(_gcc-install-dir)/$1 ]]
515 }
516
517 # Returns requested gcc specs directive unprocessed - for used by
518 # gcc-specs-directive()
519 # Note; later specs normally overwrite earlier ones; however if a later
520 # spec starts with '+' then it appends.
521 # gcc -dumpspecs is parsed first, followed by files listed by "gcc -v"
522 # as "Reading <file>", in order. Strictly speaking, if there's a
523 # $(gcc_install_dir)/specs, the built-in specs aren't read, however by
524 # the same token anything from 'gcc -dumpspecs' is overridden by
525 # the contents of $(gcc_install_dir)/specs so the result is the
526 # same either way.
527 _gcc-specs-directive_raw() {
528 local cc=$(tc-getCC)
529 local specfiles=$(LC_ALL=C ${cc} -v 2>&1 | awk '$1=="Reading" {print $NF}')
530 ${cc} -dumpspecs 2> /dev/null | cat - ${specfiles} | awk -v directive=$1 \
531 'BEGIN { pspec=""; spec=""; outside=1 }
532 $1=="*"directive":" { pspec=spec; spec=""; outside=0; next }
533 outside || NF==0 || ( substr($1,1,1)=="*" && substr($1,length($1),1)==":" ) { outside=1; next }
534 spec=="" && substr($0,1,1)=="+" { spec=pspec " " substr($0,2); next }
535 { spec=spec $0 }
536 END { print spec }'
537 return 0
538 }
539
540 # Return the requested gcc specs directive, with all included
541 # specs expanded.
542 # Note, it does not check for inclusion loops, which cause it
543 # to never finish - but such loops are invalid for gcc and we're
544 # assuming gcc is operational.
545 gcc-specs-directive() {
546 local directive subdname subdirective
547 directive="$(_gcc-specs-directive_raw $1)"
548 while [[ ${directive} == *%\(*\)* ]]; do
549 subdname=${directive/*%\(}
550 subdname=${subdname/\)*}
551 subdirective="$(_gcc-specs-directive_raw ${subdname})"
552 directive="${directive//\%(${subdname})/${subdirective}}"
553 done
554 echo "${directive}"
555 return 0
556 }
557
558 # Returns true if gcc sets relro
559 gcc-specs-relro() {
560 local directive
561 directive=$(gcc-specs-directive link_command)
562 return $([[ "${directive/\{!norelro:}" != "${directive}" ]])
563 }
564 # Returns true if gcc sets now
565 gcc-specs-now() {
566 local directive
567 directive=$(gcc-specs-directive link_command)
568 return $([[ "${directive/\{!nonow:}" != "${directive}" ]])
569 }
570 # Returns true if gcc builds PIEs
571 gcc-specs-pie() {
572 local directive
573 directive=$(gcc-specs-directive cc1)
574 return $([[ "${directive/\{!nopie:}" != "${directive}" ]])
575 }
576 # Returns true if gcc builds with the stack protector
577 gcc-specs-ssp() {
578 local directive
579 directive=$(gcc-specs-directive cc1)
580 return $([[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]])
581 }
582 # Returns true if gcc upgrades fstack-protector to fstack-protector-all
583 gcc-specs-ssp-to-all() {
584 local directive
585 directive=$(gcc-specs-directive cc1)
586 return $([[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]])
587 }
588 # Returns true if gcc builds with fno-strict-overflow
589 gcc-specs-nostrict() {
590 local directive
591 directive=$(gcc-specs-directive cc1)
592 return $([[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]])
593 }
594
595
596 # @FUNCTION: gen_usr_ldscript
597 # @USAGE: [-a] <list of libs to create linker scripts for>
598 # @DESCRIPTION:
599 # This function generate linker scripts in /usr/lib for dynamic
600 # libs in /lib. This is to fix linking problems when you have
601 # the .so in /lib, and the .a in /usr/lib. What happens is that
602 # in some cases when linking dynamic, the .a in /usr/lib is used
603 # instead of the .so in /lib due to gcc/libtool tweaking ld's
604 # library search path. This causes many builds to fail.
605 # See bug #4411 for more info.
606 #
607 # Note that you should in general use the unversioned name of
608 # the library (libfoo.so), as ldconfig should usually update it
609 # correctly to point to the latest version of the library present.
610 gen_usr_ldscript() {
611 local lib libdir=$(get_libdir) output_format="" auto=false suffix=$(get_libname)
612 [[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/
613
614 tc-is-static-only && return
615
616 # Eventually we'd like to get rid of this func completely #417451
617 case ${CTARGET:-${CHOST}} in
618 *-darwin*) ;;
619 *linux*|*-freebsd*|*-openbsd*|*-netbsd*)
620 use prefix && return 0 ;;
621 *) return 0 ;;
622 esac
623
624 # Just make sure it exists
625 dodir /usr/${libdir}
626
627 if [[ $1 == "-a" ]] ; then
628 auto=true
629 shift
630 dodir /${libdir}
631 fi
632
633 # OUTPUT_FORMAT gives hints to the linker as to what binary format
634 # is referenced ... makes multilib saner
635 output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
636 [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
637
638 for lib in "$@" ; do
639 local tlib
640 if ${auto} ; then
641 lib="lib${lib}${suffix}"
642 else
643 # Ensure /lib/${lib} exists to avoid dangling scripts/symlinks.
644 # This especially is for AIX where $(get_libname) can return ".a",
645 # so /lib/${lib} might be moved to /usr/lib/${lib} (by accident).
646 [[ -r ${ED}/${libdir}/${lib} ]] || continue
647 #TODO: better die here?
648 fi
649
650 case ${CTARGET:-${CHOST}} in
651 *-darwin*)
652 if ${auto} ; then
653 tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
654 else
655 tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib})
656 fi
657 [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}"
658 tlib=${tlib##*/}
659
660 if ${auto} ; then
661 mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
662 # some install_names are funky: they encode a version
663 if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]] ; then
664 mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
665 fi
666 rm -f "${ED}"/${libdir}/${lib}
667 fi
668
669 # Mach-O files have an id, which is like a soname, it tells how
670 # another object linking against this lib should reference it.
671 # Since we moved the lib from usr/lib into lib this reference is
672 # wrong. Hence, we update it here. We don't configure with
673 # libdir=/lib because that messes up libtool files.
674 # Make sure we don't lose the specific version, so just modify the
675 # existing install_name
676 if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then
677 chmod u+w "${ED}${libdir}/${tlib}" # needed to write to it
678 local nowrite=yes
679 fi
680 install_name_tool \
681 -id "${EPREFIX}"/${libdir}/${tlib} \
682 "${ED}"/${libdir}/${tlib} || die "install_name_tool failed"
683 [[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}"
684 # Now as we don't use GNU binutils and our linker doesn't
685 # understand linker scripts, just create a symlink.
686 pushd "${ED}/usr/${libdir}" > /dev/null
687 ln -snf "../../${libdir}/${tlib}" "${lib}"
688 popd > /dev/null
689 ;;
690 *)
691 if ${auto} ; then
692 tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
693 [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}"
694 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
695 # some SONAMEs are funky: they encode a version before the .so
696 if [[ ${tlib} != ${lib}* ]] ; then
697 mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die
698 fi
699 rm -f "${ED}"/${libdir}/${lib}
700 else
701 tlib=${lib}
702 fi
703 cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT
704 /* GNU ld script
705 Since Gentoo has critical dynamic libraries in /lib, and the static versions
706 in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
707 run into linking problems. This "fake" dynamic lib is a linker script that
708 redirects the linker to the real lib. And yes, this works in the cross-
709 compiling scenario as the sysroot-ed linker will prepend the real path.
710
711 See bug http://bugs.gentoo.org/4411 for more info.
712 */
713 ${output_format}
714 GROUP ( ${EPREFIX}/${libdir}/${tlib} )
715 END_LDSCRIPT
716 ;;
717 esac
718 fperms a+x "/usr/${libdir}/${lib}" || die "could not change perms on ${lib}"
719 done
720 }
721
722 fi
ViewVC Help
Powered by ViewVC 1.1.20
|
__label__pos
| 0.879515 |
Advertisement
Hypoglycemia in Diabetes
1. Philip E. Cryer, MD1,
2. Stephen N. Davis, MD2 and
3. Harry Shamoon, MD3
1. 1Washington University School of Medicine, St. Louis, Missouri
2. 2Vanderbilt University School of Medicine, Nashville, Tennessee
3. 3Albert Einstein College of Medicine of Yeshiva University, Bronx, New York
Abstract
Iatrogenic hypoglycemia causes recurrent morbidity in most people with type 1 diabetes and many with type 2 diabetes, and it is sometimes fatal. The barrier of hypoglycemia generally precludes maintenance of euglycemia over a lifetime of diabetes and thus precludes full realization of euglycemia’s long-term benefits. While the clinical presentation is often characteristic, particularly for the experienced individual with diabetes, the neurogenic and neuroglycopenic symptoms of hypoglycemia are nonspecific and relatively insensitive; therefore, many episodes are not recognized. Hypoglycemia can result from exogenous or endogenous insulin excess alone. However, iatrogenic hypoglycemia is typically the result of the interplay of absolute or relative insulin excess and compromised glucose counterregulation in type 1 and advanced type 2 diabetes. Decrements in insulin, increments in glucagon, and, absent the latter, increments in epinephrine stand high in the hierarchy of redundant glucose counterregulatory factors that normally prevent or rapidly correct hypoglycemia. In insulin-deficient diabetes (exogenous) insulin levels do not decrease as glucose levels fall, and the combination of deficient glucagon and epinephrine responses causes defective glucose counterregulation. Reduced sympathoadrenal responses cause hypoglycemia unawareness. The concept of hypoglycemia-associated autonomic failure in diabetes posits that recent antecedent hypoglycemia causes both defective glucose counterregulation and hypoglycemia unawareness. By shifting glycemic thresholds for the sympathoadrenal (including epinephrine) and the resulting neurogenic responses to lower plasma glucose concentrations, antecedent hypoglycemia leads to a vicious cycle of recurrent hypoglycemia and further impairment of glucose counterregulation. Thus, short-term avoidance of hypoglycemia reverses hypoglycemia unawareness in most affected patients. The clinical approach to minimizing hypoglycemia while improving glycemic control includes 1) addressing the issue, 2) applying the principles of aggressive glycemic therapy, including flexible and individualized drug regimens, and 3) considering the risk factors for iatrogenic hypoglycemia. The latter include factors that result in absolute or relative insulin excess: drug dose, timing, and type; patterns of food ingestion and exercise; interactions with alcohol and other drugs; and altered sensitivity to or clearance of insulin. They also include factors that are clinical surrogates of compromised glucose counterregulation: endogenous insulin deficiency; history of severe hypoglycemia, hypoglycemia unawareness, or both; and aggressive glycemic therapy per se, as evidenced by lower HbA1c levels, lower glycemic goals, or both. In a patient with hypoglycemia unawareness (which implies recurrent hypoglycemia) a 2- to 3-week period of scrupulous avoidance of hypoglycemia is advisable. Pending the prevention and cure of diabetes or the development of methods that provide glucose-regulated insulin replacement or secretion, we need to learn to replace insulin in a much more physiological fashion, to prevent, correct, or compensate for compromised glucose counterregulation, or both if we are to achieve near-euglycemia safely in most people with diabetes.
Were it not for the barrier of hypoglycemia, people with diabetes could have normal HbA1c levels over a lifetime of diabetes (1). It is now well-established that glycemic control makes a difference for people with diabetes. Reduction of mean glycemia over time prevents or delays microvascular complications—retinopathy, nephropathy, and neuropathy—in both type 1 (2) and type 2 diabetes (24). It may also reduce macrovascular events (24). However, iatrogenic hypoglycemia is the limiting factor in the glycemic management of diabetes (1).
Glucose is an obligate metabolic fuel for the brain (5). Because the brain cannot synthesize glucose or store more than a few minutes’ supply as glycogen, it is critically dependent on a continuous supply of glucose from the circulation. At normal (or elevated) arterial glucose concentrations, the rate of blood-to-brain glucose transport exceeds the rate of brain glucose metabolism. However, as arterial glucose levels fall below the physiological range, blood-to-brain glucose transport becomes limiting to brain glucose metabolism, and ultimately survival. Were it not for the potentially devastating effects of hypoglycemia on the brain, the glycemic management of diabetes would be rather straightforward. Enough insulin, or any effective drug, to lower plasma glucose concentrations to or below the physiological range would eliminate the symptoms of hyperglycemia, prevent the acute hyperglycemic complications (ketoacidosis, hyperosmolar syndrome), almost assuredly prevent the long-term microvascular complications (24), and likely reduce macrovascular risk (6,7). But the effects of hypoglycemia on the brain are real, and the glycemic management of diabetes is therefore complex and generally only partially successful.
Iatrogenic hypoglycemia often causes recurrent physical morbidity, recurrent or persistent psychosocial morbidity, or both and sometimes causes death (5). Furthermore, it precludes true glycemic control, i.e., maintenance of euglycemia over a lifetime, in the vast majority of people with diabetes (5). As a result, complications can occur despite aggressive therapy. For example, microvascular complications developed in patients with type 1 diabetes (2) and those with type 2 diabetes (3,4) randomized to intensive glycemic therapy, albeit at lower rates than those assigned to less aggressive therapy. Indeed, the barrier of hypoglycemia may explain why aggressive attempts to achieve glycemic control have had little impact on macrovascular complications (24). It appears that the curve describing the relationship between mean glycemia (HbA1c) and macrovascular events, such as myocardial infarction, is shifted toward lower glycemia than that between mean glycemia and microvascular complications (6). This is supported by evidence of an increased risk of death from ischemic heart disease in people with glycated hemoglobin levels in the high normal range (7). Thus, while it is possible to reduce mean glycemia enough to decrease the incidence of microvascular complications (24), perhaps it is not possible, with current treatment regimens, to hold plasma glucose concentrations low enough long enough to prevent macrovascular disease in a substantial proportion of people with diabetes because of the attendant risk of frequent and/or severe hypoglycemia. It is, of course, also plausible that the increased atherosclerotic risk conferred by diabetes is the result of factors in addition to or other than hyperglycemia.
Pending the prevention and cure of diabetes, people with diabetes need treatment methods that provide glucose-regulated insulin replacement or secretion if they are to consistently achieve and maintain euglycemia safely (1). Absent that, they and their caregivers must practice hypoglycemia risk reduction as they attempt to improve glycemic control while minimizing the risk of iatrogenic hypoglycemia (8).
FREQUENCY AND CLINICAL IMPACT OF IATROGENIC HYPOGLYCEMIA
Type 1 diabetes
Hypoglycemia is a fact of life for people with type 1 diabetes. Those attempting to improve or maintain glycemic control suffer untold numbers of episodes of asymptomatic hypoglycemia; plasma glucose levels may be less than 50–60 mg/dl (2.8–3.3 mmol/l) 10% of the time (5,9,10). They suffer an average of two episodes of symptomatic hypoglycemia per week—thousands of such episodes over a lifetime of diabetes—and an episode of severe, at least temporarily disabling, hypoglycemia approximately once a year (2,11,12). An estimated 2–4% of deaths of people with type 1 diabetes have been attributed to hypoglycemia (5,13).
The physical morbidity of an episode of hypoglycemia (5) ranges from unpleasant symptoms, such as anxiety, palpitations, tremor, sweating, hunger, and paresthesias, to neurological impairments, including behavioral changes, cognitive dysfunction, seizures, and coma. Focal neurological deficits occur occasionally. Although severe prolonged hypoglycemia can cause permanent brain damage, seemingly complete recovery is the rule.
At the very least, an episode of hypoglycemia is a nuisance and a distraction. It can be embarrassing and cause social ostracism. The psychological morbidity of hypoglycemia (5) includes fear of hypoglycemia, guilt about that rational fear, high levels of anxiety, and low levels of overall happiness. In her book about her life with type 1 diabetes Lisa Roney (14) wrote, “[T]hese episodes [of hypoglycemia] shame and haunt me, the most apparent shadow on my semblance of a normal life.” Clearly, hypoglycemia is often a psychological, as well as a pathophysiological, barrier to glycemic control.
Finally, as noted earlier, to the extent it precludes glycemic control, hypoglycemia limits full realization of glycemic control’s long-term benefits in type 1 diabetes (2).
Type 2 diabetes
While it is difficult to assess the absolute rates, the frequency of iatrogenic hypoglycemia is substantially lower in type 2 than in type 1 diabetes. Representative event rates for severe hypoglycemia (that requiring the assistance of another individual) during aggressive insulin therapy in type 1 diabetes range from 62 (2) through 110 (11) to 170 (12) episodes per 100 patient-years. Those during aggressive insulin therapy in type 2 diabetes range from 3 (15) through 10 (16) to 73 (12) episodes per 100 patient-years. Thus, the rates of severe hypoglycemia in type 2 diabetes are roughly 10% of those in type 1 diabetes even during aggressive therapy with insulin. They are undoubtedly even lower in those treated with oral hypoglycemic agents. However, quantitative data (i.e., event rates) from patients with type 2 diabetes treated to near-euglycemia with rigorous ascertainment of hypoglycemia are not available. Over 6 years of follow-up of patients with type 2 diabetes in the U.K. Prospective Diabetes Study (UKPDS), 2.4% of those using metformin, 3.3% of those using a sulfonylurea, and 11.2% of those using insulin reported major hypoglycemia (that requiring medical attention or admission to hospital) (17). For comparison, 65% of the intensively treated patients with type 1 diabetes in the Diabetes Control and Complications Trial (DCCT) suffered severe hypoglycemia (that requiring the assistance of another individual) over 6.5 years of follow-up (2). Since the UKPDS involved newly diagnosed type 2 diabetes and the patients’ glycemic control was not as strict as in the DCCT, the UKPDS data may well underestimate the frequency of iatrogenic hypoglycemia in type 2 diabetes.
Hypoglycemia became progressively more limiting to glycemic control over time in the UKPDS (17,18). Indeed, the UKPDS investigators noted that “patients often did not achieve normoglycemia. This was in part because of the high incidence of insulin-induced hypoglycemia, which is a limitation in treating patients with type 2 diabetes just as it is in patients with type 1 diabetes” (18). Furthermore, in one series, the frequencies of severe hypoglycemia were similar in type 2 and type 1 diabetes matched for duration of insulin therapy (19). Given progressive insulin deficiency in type 2 diabetes (17), these findings (1719) indicate that iatrogenic hypoglycemia becomes a progressively more frequent clinical problem for patients with type 2 diabetes as they approach the insulin-deficient end of the spectrum.
Although the episodes are much less frequent overall, the physical and psychosocial morbidity of hypoglycemia in type 2 diabetes is reasonably assumed to be similar to that in type 1 diabetes summarized earlier. Reliable estimates of hypoglycemic mortality rates in type 2 diabetes are not available. However, deaths caused by sulfonylurea-induced hypoglycemia have been documented (20,21).
CLINICAL MANIFESTATIONS OF HYPOGLYCEMIA
Symptoms
Falling plasma glucose concentrations cause an array of symptoms by signaling central nervous system–mediated autonomic nervous system responses and by limiting neuronal metabolism. Neurogenic (or autonomic) symptoms are the result of the perception of physiological changes caused by the activation of the autonomic nervous system triggered by hypoglycemia (5,22,23). Although all three efferent components of the autonomic nervous system—adrenomedullary, sympathetic neural, and parasympathetic neural—are activated by hypoglycemia, neurogenic symptoms are thought to be caused by sympathoadrenal activation and mediated by norepinephrine released from sympathetic adrenergic postganglionic neurons, the adrenal medullae, or both, by acetylcholine released from cholinergic sympathetic postganglionic neurons and by epinephrine released from the adrenal medullae (22). Some neurogenic symptoms, such as tremulousness, palpitations, and anxiety/arousal, are adrenergic (catecholamine mediated); whereas others, such as sweating, hunger, and paresthesias, are cholinergic. Awareness of hypoglycemia is largely the result of the perception of neurogenic symptoms and the recognition that they are indicative of hypoglycemia (22). Clearly, therefore, awareness of hypoglycemia is a function of the knowledge and the experience of the individual, as well as the physiological responses to low glucose concentrations.
Neuroglycopenic symptoms are the result of brain neuronal glucose deprivation (5,22,23). They include sensations of warmth, weakness, and fatigue as well as difficulty thinking, confusion, behavioral changes (not infrequently confused with inebriation by others), and emotional lability. They also include seizures, loss of consciousness, and, if hypoglycemia is severe and prolonged, brain damage and even death.
Signs
Physical signs that result from activation of the sympathoadrenal system include pallor and diaphoresis, which are often prominent, and an increased heart rate and systolic blood pressure, which are often more subtle (5). Evidence of neuroglycopenia can be the most apparent, or even the only, observable manifestation of hypoglycemia. Indeed, the neuroglycopenic symptoms are often the clues recognized by family and friends of the affected individual. Hypothermia is often present. Transient focal neurological deficits (e.g., diplopia, hemiparesis) occur occasionally. As noted earlier, permanent brain damage is rare.
Diagnosis
While the clinical presentation can be characteristic, particularly for the experienced individual with diabetes, the symptoms and signs of hypoglycemia are nonspecific. Therefore, documentation of a low plasma or blood glucose concentration, if possible, is very helpful (5). Indeed, a hypoglycemic episode is most convincingly documented by Whipple’s triad: symptoms compatible with hypoglycemia, a low plasma or blood glucose concentration, and resolution of those symptoms after the glucose concentration is raised to normal.
Symptoms of hypoglycemia are idiosyncratic and not infrequently unique to a given individual (23). Thus, many people with diabetes learn their unique symptoms based on their experience. While documentation of a low plasma or blood glucose concentration is preferable, if that is not practical it is better for the patient to self-treat when he or she suspects hypoglycemia, since the short-term risks of failure to treat an episode far outweigh those of unnecessary treatment.
Symptoms of hypoglycemia may occur but not be recognized as indicative of hypoglycemia, particularly when the patient’s attention is focused on other issues. For example, some report that they are less likely to recognize hypoglycemia while at work than during leisure activities. Furthermore, the symptoms are relatively insensitive. In addition, many aggressively treated patients lose their symptoms and thus manifest the syndrome of hypoglycemia unawareness, as discussed below. For these reasons, many episodes, indeed the vast majority of episodes, are unrecognized or asymptomatic.
While plasma glucose concentrations can be unequivocally low, it is not possible to define hypoglycemia on the basis of a specific plasma glucose concentration in people with diabetes. As discussed later, the glycemic thresholds for responses to hypoglycemia have been defined, found to be reproducible from laboratory to laboratory, and used to define diagnostic criteria (5) in nondiabetic individuals. However, these thresholds are dynamic rather than static. People with poorly controlled diabetes can suffer symptoms of hypoglycemia at plasma glucose concentrations higher than those required to elicit symptoms in nondiabetic individuals (24,25), while those with tightly controlled (i.e., frequently hypoglycemic) diabetes often tolerate low glucose levels without symptoms (25). Nonetheless, the latter values cannot be ignored; lower glucose levels could cause episodes of clinical hypoglycemia. In practice, the self-monitored blood glucose levels that should be of concern need to be individualized for a given patient at a given point in time. Because lower levels impair defenses against subsequent hypoglycemia, as discussed below, a reasonable goal is a lower limit of ∼72 mg/dl (4.0 mmol/l).
PHYSIOLOGY OF GLUCOSE COUNTERREGULATION
Glycemic thresholds
Decreasing plasma glucose concentrations normally elicit a characteristic sequence of responses (2628):
1. Decreased insulin secretion as glucose concentrations decline within the physiological range. The physiological postabsorptive plasma glucose concentration range is ∼72–108 mg/dl (4.0–6.0 mmol/l). The mean arterialized venous glycemic threshold for a decrease in insulin is ∼81 mg/dl (4.5 mmol/l).
2. Increased glucagon and epinephrine secretion, among other neuroendocrine responses, as glucose concentrations fall just below the physiological range. The glycemic threshold is ∼65–70 mg/dl (3.6–3.9 mmol/l).
3. Neurogenic and neuroglycopenic symptoms, and cognitive impairments, at lower plasma glucose concentrations. The glycemic threshold for symptoms is ∼50–55 mg/dl (2.8–3.0 mmol/l).
While these glycemic thresholds are reproducible from laboratory to laboratory in healthy subjects (2628), they shift to higher plasma glucose concentrations in people with poorly controlled type 1 (24,25) and type 2 diabetes (29) and to lower plasma glucose concentrations in people with tightly controlled type 1 diabetes (25). These shifts are reflections of antecedent glycemia, chronic hyperglycemia and recent hypoglycemia respectively. For example, the glycemic thresholds are shifted to lower plasma glucose concentrations not only in tightly controlled (i.e., frequently hypoglycemic) diabetes (25) but also in patients with recurrent hypoglycemia caused by an insulinoma (30) and following induced hypoglycemia in both type 1 (31) and type 2 diabetes (29). As discussed shortly, these threshold shifts are quite relevant to the pathophysiology of glucose counterregulation in diabetes.
The magnitude of the neuroendocrine responses to hypoglycemia is a function of the nadir plasma glucose concentration, not the rate of fall of plasma glucose. During experimental insulin-induced hypoglycemia, insulin levels influence the magnitude of the responses; higher insulin levels restrain the glucagon response and enhance the catecholamine response. In general, women exhibit a less vigorous response to a given level of hypoglycemia than men.
Glycemic mechanisms
The mechanisms of this integrated neuroendocrine response to hypoglycemia and of the glycemic (plasma glucose–raising) actions of its components have been reviewed previously (5,32). Therefore, they are only summarized here.
Falling plasma glucose concentrations are detected by glucose-responsive neurons in the hypothalamus and other regions of the brain. There is evidence that they are also sensed in visceral sites, including the portal vein, and signaled to the central nervous system via the cranial nerve (parasympathetic afferent) visceral sensory system, specifically the vagus nerves, although signaling via the spinal nerve (sympathetic afferent) visceral sensory system has not been excluded. As a result of complex integration within the brain, these signals ultimately cause a patterned autonomic response organized within the hypothalamus and involving centers in the brain stem. Thus, hypoglycemia triggers increased sympathetic—sympathetic neural and adrenomedullary (sympathoadrenal)—and parasympathetic outflow from the central nervous system. Through hypothalamo-hypophyseal neuroendocrine mechanisms, hypoglycemia also causes increased adenohypophysial growth hormone and adrenocorticotropin (and thus adrenocortical cortisol) secretion, among other pituitary hormone responses. Finally, through mechanisms that include, but are not limited to, increased autonomic activity, hypoglycemia causes reduced pancreatic β-cell insulin secretion and increased pancreatic α-cell glucagon secretion.
Although insulin secretion is modulated by an array of substrate, neural, and hormonal factors, the dominant factor is the β-cell arterial glucose concentration. As plasma glucose concentrations decline, insulin secretion drops sharply; insulin secretion virtually ceases during hypoglycemia. α2-Adrenergic inhibition of insulin secretion, resulting from sympathoadrenal activation, may also play a role. The mechanisms of the glucagon secretory response to hypoglycemia are less well understood. They include increased autonomic—parasympathetic neural, sympathetic neural, and adrenomedullary—inputs, a low α-cell arterial glucose concentration, and decreased intraislet insulin, but the relative contribution of these remains a matter of some debate (32).
The net result of these decrements in insulin secretion, increments in glucagon secretion, and autonomic and pituitary activations triggered by hypoglycemia includes increased endogenous glucose production, limited glucose utilization by tissues other than the brain, increased lipolysis, and increased proteolysis, as well as increased sweating and cutaneous vasoconstriction but net vasodilation, with increments in systolic blood pressure and heart rate. Their glycemic actions and their relative contributions to physiological defense against hypoglycemia are discussed in the paragraphs that follow.
Defense against hypoglycemia
Glucose counterregulation—the physiological mechanisms that normally prevent or rapidly correct hypoglycemia so effectively that hypoglycemia is a distinctly uncommon clinical event in people who do not have diabetes—has been reviewed in detail (32). Decreased insulin secretion, which favors increased hepatic (and renal) glucose production and decreased glucose utilization by insulin-sensitive tissues such as muscle, is the initial defense against falling plasma glucose concentrations. Among the glucose counterregulatory factors, increased glucagon secretion, which stimulates hepatic glycogenolysis and favors hepatic gluconeogenesis, plays a primary role. Albeit demonstrably involved, increased epinephrine secretion—which stimulates hepatic glycogenolysis and gluconeogenesis (and renal gluconeogenesis), the latter largely by mobilizing gluconeogenic substrates such as amino acids, lactate, and glycerol, and limits glucose utilization by insulin-sensitive tissues through mechanisms that include increased nonesterified fatty acid levels as well as direct effects—is not normally critical. However, it becomes critical when glucagon secretion is deficient. Glucagon and epinephrine act rapidly (within minutes) to raise plasma glucose concentrations. Increased secretion of cortisol and growth hormone, both of which limit glucose utilization by insulin-sensitive tissues and support glucose production over a longer time frame (hours), is involved in defense against prolonged hypoglycemia; but cortisol and growth hormone are not critical to recovery from even prolonged hypoglycemia or to the prevention of hypoglycemia after an overnight fast. To the extent it is involved, glucose autoregulation (endogenous glucose production as an inverse function of ambient plasma glucose concentrations independent of hormonal and neural glucoregulatory mechanisms) appears to play a relatively minor role.
Thus, insulin, glucagon, and epinephrine stand high in the hierarchy of redundant glucose counterregulatory factors. The secretion of all three of these hormones, not just insulin, is typically impaired in type 1 diabetes (1,5).
PATHOPHYSIOLOGY OF GLUCOSE COUNTERREGULATION IN DIABETES
Type 1 diabetes
Absolute or relative therapeutic (exogenous) insulin excess causes plasma glucose concentrations to fall to low levels in type 1 diabetes. As glucose levels decline, insulin concentrations do not decrease; these levels of insulin are unregulated and are simply the result of the passive absorption of the administered insulin and its pharmacokinetics. Thus, the first defense against hypoglycemia is lost in established (i.e., C-peptide–negative) type 1 diabetes. Furthermore, as glucose levels fall, glucagon secretion does not increase in established type 1 diabetes (33,34). This is a signaling defect; glucagon secretory responses to stimuli other than hypoglycemia are largely, if not entirely, intact. The mechanism of the absent glucagon response to hypoglycemia that characterizes established type 1 diabetes is not known, but it is linked tightly to (35), and is possibly the result of (36), endogenous insulin deficiency. Thus, both the first and the second defenses against developing hypoglycemia are lost in established type 1 diabetes. These patients, therefore, rely to a greater extent on the third defense, increased epinephrine secretion. However, the epinephrine secretory response to falling glucose levels is typically attenuated in type 1 diabetes (25,31,34). The glycemic threshold for the epinephrine response is shifted to a lower plasma glucose concentration (25,31), largely the result of recent antecedent hypoglycemia (31). In summary, all three defenses against developing hypoglycemia—decrements in insulin, increments in glucagon, and increments in epinephrine—are typically impaired in established type 1 diabetes.
The reduced epinephrine response to a given level of hypoglycemia that characterizes type 1 diabetes (25,31,34) is largely, if not exclusively, a functional disorder rather than the result of a structural abnormality of the adrenal medullae (1,5). It is readily demonstrable in patients with type 1 diabetes who do not have classic diabetic autonomic neuropathy as assessed by cardiovascular reflex tests, orthostatic changes in blood pressures and heart rates, and clinical histories (31,37,38). However, there appears to be an additional effect of autonomic neuropathy. The epinephrine response has been found to be reduced to a somewhat greater extent in those with, compared with those without, classic diabetic autonomic neuropathy, at least at very low plasma glucose concentrations (31,37,38).
Type 2 diabetes
As noted earlier, iatrogenic hypoglycemia is much less frequent overall in type 2 diabetes. Glucose counterregulatory mechanisms have generally been found to be intact early in the course of type 2 diabetes (1,29). This likely explains the low frequency of hypoglycemia. However, as also noted above, iatrogenic hypoglycemia becomes progressively more limiting to glycemic control over time (17,18), and the frequencies of severe iatrogenic hypoglycemia have been reported to be similar in type 2 and type 1 diabetes matched for duration of insulin therapy (19). Given progressive insulin deficiency in type 2 diabetes (17), these findings indicate that iatrogenic hypoglycemia becomes a progressively more frequent clinical problem as patients approach the insulin-deficient end of the spectrum of type 2 diabetes. Thus, it would be expected that such patients would exhibit glucose counterregulatory defects similar to those in type 1 diabetes. That expectation has been supported. Patients with advanced type 2 diabetes, selected for insulin deficiency, were found to have virtually absent glucagon secretory responses to hypoglycemia (29), and their glycemic thresholds for autonomic and symptomatic responses were shifted to lower plasma glucose concentrations following recent hypoglycemia (29).
CLINICAL SYNDROMES OF COMPROMISED GLUCOSE COUNTERREGULATION IN DIABETES
Defective glucose counterregulation
Patients with type 1 diabetes and combined deficiencies of their glucagon and epinephrine responses to hypoglycemia have been shown, in prospective studies, to be at 25-fold (39) or even higher (40) increased risk for severe iatrogenic hypoglycemia during aggressive glycemic therapy compared with those with absent glucagon but normal epinephrine responses. The combination of absent glucagon and attenuated epinephrine responses causes the clinical syndrome of defective glucose counterregulation (1,5).
It has been suggested that a factor or factors in addition to absent glucagon and attenuated epinephrine responses to hypoglycemia, perhaps impaired glucose autoregulation, may play a role in the pathogenesis of defective glucose counterregulation in type 1 diabetes (41). Glucagon secretion was suppressed with somatostatin (and replaced at basal rates), and plasma glucose was lowered with insulin to only ∼70 mg/dl (3.9 mmol/l), which did not raise plasma epinephrine to biologically effective levels. With comparable plasma glucagon and epinephrine concentrations during this mild hypoglycemia, rates of endogenous glucose production were found to be ∼20% lower in patients with type 1 diabetes than in nondiabetic control subjects.
Hypoglycemia unawareness
The attenuated epinephrine response to hypoglycemia in type 1 diabetes is a marker of an attenuated autonomic, sympathetic neural as well as adrenomedullary, response that causes the clinical syndrome of hypoglycemia unawareness—loss of the warning, largely neurogenic symptoms of developing hypoglycemia. Because it compromises behavioral defenses against developing hypoglycemia (e.g., the ingestion of food), hypoglycemia unawareness is also associated with a high frequency of severe iatrogenic hypoglycemia (42).
Hypoglycemia unawareness is generally thought to be the result of reduced sympathoadrenal responses and the resultant reduced neurogenic symptom responses to a given level of hypoglycemia (1,5,4345). Based on the finding of reduced cardiac chronotropic sensitivity to infused isoproterenol in patients with impaired awareness of hypoglycemia, it has been suggested that reduced β-adrenergic sensitivity might also be involved (4649). Antecedent hypoglycemia has been reported to decrease sensitivity to isoproterenol in patients with type 1 diabetes, but to increase it in nondiabetic individuals (48).
Hypoglycemia-associated autonomic failure
The concept of hypoglycemia-associated autonomic failure (HAAF) in type 1 diabetes (1,31) and advanced type 2 diabetes (1,29) posits that recent antecedent iatrogenic hypoglycemia causes both defective glucose counterregulation (by reducing the epinephrine response to subsequent hypoglycemia in the setting of an absent glucagon response) and hypoglycemia unawareness (by reducing the autonomic—sympathetic neural and adrenomedullary—response and thus the resulting neurogenic symptom responses to subsequent hypoglycemia) and thus a vicious cycle of recurrent hypoglycemia. The concept of HAAF is illustrated in Fig. 1.
Conceived initially (50) on the basis of findings in nondiabetic individuals (51,52), the concept of HAAF now has considerable support in the clinical setting. In patients with type 1 diabetes, recent antecedent hypoglycemia has been shown to 1) shift glycemic thresholds for autonomic (including epinephrine and symptomatic) and cognitive dysfunction responses to subsequent hypoglycemia to lower plasma glucose concentrations (31,53), 2) impair glycemic defense against hyperinsulinemia (31), and 3) reduce detection of hypoglycemia in the clinical setting (54). Perhaps the most compelling support for the clinical relevance of HAAF in type 1 diabetes is the finding, in three independent laboratories, that as little as 2–3 weeks of scrupulous avoidance of iatrogenic hypoglycemia reverses hypoglycemia unawareness and improves the reduced epinephrine component of defective glucose counterregulation in most affected patients (5557). Notably, the absent glucagon response is not restored (5557).
The mediators and mechanisms of HAAF are unknown. Detailed discussion of ongoing studies of these (1,58) is beyond the scope of this review. Briefly, based on the findings that cortisol infusion reduces sympathoadrenal responses to hypoglycemia the following day in healthy subjects (59) and that hypoglycemia in patients with primary adrenocortical failure does not reduce sympathoadrenal responses to hypoglycemia the following day (60), it has been suggested that it is the cortisol response to antecedent hypoglycemia that mediates HAAF. In support of that suggestion, maximally (ACTH) stimulated endogenous cortisol secretion has been shown to reduce the sympathoadrenal and neurogenic symptom responses to hypoglycemia the following day (61). However, it remains to be documented that prior cortisol elevations comparable to those that occur during hypoglycemia reproduce the HAAF phenomenon. There is evidence, using the Kety-Schmidt technique, that brain glucose uptake is preserved during hypoglycemia after prolonged (56-h) interprandial hypoglycemia in healthy subjects (62) and in patients with well-controlled (i.e., frequently hypoglycemic) type 1 diabetes (63). However, ∼24 h of interprandial hypoglycemia was not found to increase global blood-to-brain glucose transport measured with [1-11C]glucose and positron emission tomography (PET) or cerebral blood flow measured with [15O]water and PET (64). The latter findings do not support the possibility that increased global blood-to-brain glucose transport is the mechanism of HAAF, but they do not exclude regional increments. A difference in the subthalamic handling of 18F-labeled deoxyglucose, measured with PET, in patients with hypoglycemia awareness and unawareness has been reported (65).
CLINICAL RISK FACTORS FOR HYPOGLYCEMIA IN DIABETES
Insulin excess alone
The conventional risk factors for iatrogenic hypoglycemia (1,5) are based on the premise that absolute or relative insulin excess, whether from injected or from secreted insulin, is the sole determinant of risk. Absolute or relative insulin excess occurs when
1. Insulin (or insulin secretagogue or sensitizer) doses are excessive, ill-timed, or of the wrong type.
2. Exogenous glucose delivery is decreased, such as after missed meals or snacks and during the overnight fast.
3. Endogenous glucose production is decreased, such as following alcohol ingestion.
4. Glucose utilization is increased, such as during exercise.
5. Sensitivity to insulin is increased, such as late after exercise, in the middle of the night, and after weight loss, increased fitness, or improved glycemic control, or during treatment with an insulin sensitizer.
6. Insulin clearance is decreased, such as with progressive renal failure.
Although each must be considered carefully, these conventional risk factors explain only a minority of episodes of severe iatrogenic hypoglycemia (66).
Insulin excess plus compromised glucose counterregulation
Iatrogenic hypoglycemia is more appropriately viewed as the result of the interplay of absolute or relative insulin excess and compromised glucose counterregulation in type 1 and advanced type 2 diabetes (1,5). In other words, although substantial insulin excess can cause hypoglycemia, the integrity of the physiological and behavioral defenses against falling plasma glucose concentrations determines if less-marked hyperinsulinemia, which must occur from time to time because of the pharmacokinetic imperfections of current insulin replacement regimens, causes an episode of hypoglycemia. Risk factors relevant to compromised glucose counterregulation that are well-established in type 1 diabetes (1,2,35,67,68) and are likely relevant to advanced type 2 diabetes include: 1) insulin deficiency; 2) history of severe hypoglycemia, hypoglycemia unawareness, or both; 3) aggressive glycemic therapy per se, as evidenced by lower HbA1c levels, lower glycemic goals, or both. These are clinical surrogates of the key features of the pathophysiology of glucose counterregulation discussed earlier. Insulin deficiency indicates that insulin levels will not decrease and predicts accurately that glucagon levels will not increase normally (3335) as plasma glucose concentrations fall. A history of severe hypoglycemia indicates, and that of hypoglycemia unawareness or even aggressive glycemic therapy per se implies, recent antecedent hypoglycemia. The latter is the proximate cause of HAAF (Fig. 1) and the resulting vicious cycle of recurrent iatrogenic hypoglycemia.
An association between the ACE DD genotype/serum ACE activity phenotype and severe hypoglycemia in patients with type 1 diabetes has been reported (69). However, that was apparent only with very high serum ACE activities and was weak compared with the association with well-established risk factors for severe hypoglycemia, such as C-peptide negativity, hypoglycemia unawareness, and lower HbA1c levels (69). Furthermore, there was no association between the ACE genotype/phenotype and symptomatic (as opposed to severe) hypoglycemia, the proportion of patients suffering severe hypoglycemia, or the frequency of hypoglycemia unawareness. Finally, a plausible mechanism of the association is not apparent.
CLINICAL APPROACH TO THE PROBLEM OF IATROGENIC HYPOGLYCEMIA
Treatment
Episodes of asymptomatic hypoglycemia (detected by self-monitoring of blood glucose [SMBG]) and most episodes of symptomatic hypoglycemia can be effectively self-treated by ingestion of glucose tablets or carbohydrate in the form of juice, a soft drink, milk, crackers, or a meal. An initial glucose dose of 20 g is reasonable (70). This should be repeated in 15–20 min if symptoms have not improved or the monitored blood glucose remains low. However, the glycemic response to oral glucose is transient, typically <2 h (70). Therefore, ingestion of a snack or meal shortly after the plasma glucose concentration is raised is generally advisable.
Parenteral therapy is necessary when a hypoglycemic patient is unable or unwilling (because of neuroglycopenia) to take carbohydrate orally (5,8). Parenteral glucagon is often used by family members to treat hypoglycemia in type 1 diabetes. Glucagon is less useful in type 2 diabetes because it stimulates insulin secretion as well as glycogenolysis. Intravenous glucose is the preferable treatment of severe hypoglycemia. Because severe hypoglycemia, particularly that caused by a sulfonylurea, is often prolonged in type 2 diabetes, subsequent glucose infusion and frequent feedings are often required. It is important to establish the absence of recurrent hypoglycemia unequivocally before such a patient is discharged.
Prevention
Obviously, prevention of hypoglycemia is preferable to its treatment. It is possible to improve glycemic control while minimizing the risk of hypoglycemia (8,71). Reducing the risk of hypoglycemia, while attempting to hold plasma glucose concentrations as close to the nondiabetic range as can be accomplished safely, involves three steps: 1) addressing the issue of hypoglycemia in each patient contact; 2) applying the principles of aggressive therapy; 3) considering both the conventional risk factors and those indicative of compromised glucose counterregulation.
The issue of hypoglycemia should be addressed in each patient contact. Is the patient having episodes of hypoglycemia, and is he or she aware of hypoglycemia? Are these episodes severe? When do they occur? What is the temporal relation to drug administration, meals and snacks, alcohol use, and exercise? How low are the SMBG values that are associated with symptoms? Are there low values in the SMBG log? Do family members think episodes are occurring that are not recognized by the patient? To what extent is the patient concerned about actual or possible hypoglycemia? Obviously, one cannot solve the problem of iatrogenic hypoglycemia if it is not recognized to be a problem.
The principles of aggressive glycemic therapy include 1) patient education and empowerment, 2) frequent SMBG, 3) flexible insulin and other drug regimens, 4) individualized glycemic goals, and 5) ongoing professional guidance and support (5,8).
A well-informed person with the ability and willingness to take charge of his or her diabetes is key to successful glycemic management, including the prevention of hypoglycemia. Does the patient understand the time course of the drugs he or she is using; the impact of food, exercise, and other drugs, including alcohol; and the symptoms of hypoglycemia, including his or her unique symptoms? Does he or she know how to respond to low SMBG values? Does he or she perform SMBG appropriately and use pattern recognition to refine the regimen? What is the meal plan, and does it include snacks? Does he or she do SMBG before performing critical tasks such as driving?
Obviously, with a history of recurrent hypoglycemia, one should identify plausible causes and adjust the regimen accordingly. In a patient treated with basal-bolus insulin, morning fasting hypoglycemia implicates the long- or intermediate-acting insulin; daytime hypoglycemia implicates the rapid or short-acting insulin; nocturnal hypoglycemia may implicate either. Substitution of a preprandial rapid-acting insulin analogue (e.g., lispro or aspart) for short-acting (regular) insulin reduces the frequency of nocturnal hypoglycemia (7274). Substitution of a long-acting insulin analogue (e.g., glargine or detemir) for intermediate-acting insulin (NPH or ultralente) may also reduce the frequency of nocturnal hypoglycemia (7577). With a continuous subcutaneous infusion regimen using a rapid-acting insulin, nocturnal and morning fasting hypoglycemia implicate the basal insulin infusion rate whereas daytime hypoglycemia may implicate the preprandial insulin bolus doses, the basal insulin infusion rate, or both.
Theoretically, monotherapy of type 2 diabetes with a biguanide, a thiazolidinedione, or an α-glucosidase inhibitor should not cause hypoglycemia. Patients responsive to these drugs must have endogenous insulin secretion, and insulin secretion should decrease appropriately as the plasma glucose concentration falls. Nonetheless, hypoglycemia, including major hypoglycemia, has been reported with metformin (17). In patients using a sulfonylurea, hypoglycemia is more often reported in those using long-acting agents, such as chlorpropamide or glyburide (glibenclamide) (20,21,78). The frequency of hypoglycemia in patients using rapid-acting insulin secretagogues, such as repaglinide or nateglinide, remains to be determined, although these drugs are thought largely to enhance glucose-stimulated insulin secretion. In one trial, only 23% of patients treated to a mean HbA1c of ∼6.3% with nateglinide reported symptoms of hypoglycemia, and none reported severe hypoglycemia (79).
The extent to which the frequency of iatrogenic hypoglycemia in type 2 diabetes is a function of the specific glucose-lowering drug used or the stage of the disease is not entirely clear. Is the higher frequency of hypoglycemia in patients treated with insulin the result of its greater glucose-lowering potency (given in sufficient doses) and its pharmacokinetic imperfections, or is it because patients who require insulin have advanced insulin-deficient type 2 diabetes with the associated compromised glucose counterregulation (29) discussed earlier?
Specific factors that warrant consideration include meals, exercise, and alcohol intake, as well as age (5,8). Theoretically, the use of a rapid-acting insulin analogue, rather than regular insulin, before meals in a basal-bolus insulin regimen should reduce the likelihood of hypoglycemia before the next meal. Dosage adjustments based on the premeal SMBG value and carbohydrate counting should also reduce the risk of subsequent hypoglycemia. Because exercise increases glucose utilization, and vigorous exercise increases it several-fold, exercise-induced hypoglycemia is a not infrequent problem in drug-treated, particularly insulin-treated, diabetes. Planned exercise can be preceded by reduced insulin doses, based on the baseline SMBG level, and accompanied by carbohydrate ingestion. The latter is the only option during unplanned exercise. Exercise has been reported to reduce glucose counterregulatory responses to subsequent hypoglycemia to a greater (80) or lesser (81) degree. This may play a role in the pathogenesis of late postexercise hypoglycemia. Alcohol inhibits gluconeogenesis and is therefore more likely to contribute to the development of hypoglycemia when glycogen stores are low, e.g., during an overnight fast. Inebriation, of course, can impair all aspects of diabetes management. Issues particularly relevant to the risk of iatrogenic hypoglycemia in older individuals include inconsistent eating patterns and even malnutrition, renal insufficiency, and drug interactions, as well as consideration of the risk-to-benefit relationship.
The third step in hypoglycemia risk reduction is consideration of the risk factors discussed earlier. In addition to those that lead to absolute or relative insulin excess—insulin or other drug doses, timing, and type; patterns of food ingestion and exercise; interactions with alcohol or other drugs; altered sensitivity to, or clearance of, insulin—these include risk factors for compromised glucose counterregulation (1,2,35,67,68). The latter include insulin deficiency, which may be apparent from a history of ketosis-prone diabetes requiring therapy with insulin from the time of diagnosis, although it is now clear that insulin deficiency can develop more slowly in type 1 diabetes and that it does develop in type 2 diabetes. These risk factors also include a history of severe hypoglycemia, hypoglycemia unawareness, or both, as well as aggressive glycemic therapy per se, as evidenced by lower HbA1c levels, lower glycemic goals, or both. A diagnosis of hypoglycemia unawareness (which also implies defective glucose counterregulation) can often be made from the history, and that diagnosis implies recurrent hypoglycemia. If recurrent hypoglycemia is not apparent to the patient or to his or her family and is not reflected in the patient’s SMBG log, it is probably occurring during the night.
Iatrogenic hypoglycemia often occurs during the night (5,66,67), which is typically the longest interdigestive interval and the longest interval between SMBG and the time of maximal sensitivity to insulin (82). Furthermore, sleep often precludes recognition of warning symptoms of developing hypoglycemia and thus the appropriate behavioral responses. Sleep has also been reported to further reduce the epinephrine response to hypoglycemia (83). Approaches to the problem of nocturnal hypoglycemia include regimen adjustments, the use of rapid-acting insulin (e.g., lispro or aspart) during the day and of long-acting basal insulin (e.g., glargine or detemir), as mentioned earlier, and the use of bedtime snacks. However, the efficacy of the latter is largely limited to the first half of the night (84). Experimental approaches include bedtime administration of the glucagon-stimulating amino acid alanine, the epinephrine-simulating β2-adrenergic agonist terbutaline, and the slowly digested carbohydrate uncooked cornstarch (8,81).
In patients with clinical hypoglycemia unawareness, a 2- to 3-week period of scrupulous avoidance of hypoglycemia is advisable and can be assessed by return of awareness of hypoglycemia. Although that has been accomplished without (55,56) or with minimal (57) compromise of glycemic control, it has required substantial involvement of health professionals. In practice it can involve acceptance of somewhat higher glucose levels in the short term. Nonetheless, with the return of symptoms of developing hypoglycemia, empirical approaches to better glycemic control can be tried.
PERSPECTIVE
Iatrogenic hypoglycemia is a short-term and long-term problem for people with type 1 diabetes and for many people with type 2 diabetes. The problem can be minimized but cannot be eliminated if the goal of treatment is near-euglycemia. Every effort needs to be made to minimize the frequency and magnitude of hypoglycemia. Severe hypoglycemia—that requiring the assistance of another person—is a clinical red flag. Unless it was the result of an easily remediable factor, such as a missed meal after insulin injection or vigorous exercise without the appropriate regimen adjustment, a substantive change in the regimen must be made. If a change is not made, the risk of recurrent severe hypoglycemia is unacceptably high (1,2,35,66,67).
The fundamental problem with current treatment regimens is that they do not provide plasma glucose–regulated insulin replacement or secretion. The time course of the glucose-lowering actions of subcutaneous insulin, even the shortest acting analogues, is measured in hours whereas that of endogenous insulin in nondiabetic individuals is measured in minutes. In addition to the imperfect pharmacokinetics of injected insulin, the pharmacodynamics of the sulfonylureas are such that they too can produce hyperinsulinemic hypoglycemia in responsive patients. It remains to be determined whether the newer rapid-acting insulin secretagogues (repaglinide and nateglinide) will only enhance glucose-stimulated insulin secretion with a correspondingly low rate of hypoglycemia in those patients who achieve glycemic control. Biguanides should not produce hypoglycemia, although they have been reported to do so. However, given absolute insulin deficiency in type 1 diabetes and progressive insulin deficiency over time in type 2 diabetes, most people with diabetes will ultimately require treatment with insulin, even with its pharmacokinetic imperfections.
In theory, glucose-regulated insulin replacement might be accomplished by pancreatic islet transplantation, a bioengineered artificial β-cell or a closed-loop insulin-replacement system. With respect to the latter, a reliable glucose sensor is the missing component (84). Pending the prevention and cure of diabetes or the development of treatment methods that provide glucose-regulated insulin replacement or secretion, we need to learn to replace insulin in a much more physiological fashion; to prevent, correct, or compensate for compromised glucose counterregulation; or both if we are to achieve near-euglycemia safely in people with diabetes.
Figure 1—
Diagrammatic representation of the concept of hypoglycemia-associated autonomic failure in diabetes. Modified from Cryer (50).
Acknowledgments
The authors’ work cited in this review was supported, in part, by U.S. Public Health Service/National Institutes of Health grants M01 RR00036 (Washington University School of Medicine), M01 RR00095 (Vanderbilt University School of Medicine), and M01 RR12248 (Albert Einstein College of Medicine) and R37 DK27085 (P.E.C.), R01 DK45369 (S.N.D.), and R01 DK62463 (H.S.), as well as grants and fellowship awards from the American Diabetes Association and the Juvenile Diabetes Research Foundation.
Karen Muehlhauser prepared the manuscript.
Footnotes
• Address correspondence and reprint requests to Philip E. Cryer, MD, Division of Endocrinology, Diabetes and Metabolism, Washington University School of Medicine, Campus Box 8127, 660 South Euclid Ave., St. Louis, MO 63110. E-mail: pcryer{at}im.wustl.edu.
This paper was reviewed and approved by the Professional Practice Committee of the American Diabetes Association, October 2002.
A table elsewhere in this issue shows conventional and Système International (SI) units and conversion factors for many substances.
References
| Table of Contents
Advertisement
|
__label__pos
| 0.576121 |
Author eryksun
Recipients David Heffernan, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-01-08.05:23:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
I'd like to match POSIX here by supporting path-like names. Also, I think it would be cleaner to split out the platform-specific work into a separate _load_library method, like how subprocess.Popen is designed, and to stop pretending that WINAPI LoadLibraryEx is POSIX dlopen. For example:
if _os.name == "nt":
import nt as _nt
from _ctypes import LoadLibrary as _LoadLibrary
from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL
# ...
else:
from _ctypes import dlopen as _dlopen
# ...
class CDLL:
# ...
def __init__(self, name, mode=DEFAULT_MODE, handle=None,
use_errno=False, use_last_error=False, winmode=None):
class _FuncPtr(_CFuncPtr):
_restype_ = self._func_restype_
_flags_ = self._func_flags_
if use_errno:
_flags_ |= _FUNCFLAG_USE_ERRNO
if use_last_error:
_flags_ |= _FUNCFLAG_USE_LASTERROR
self._FuncPtr = _FuncPtr
self._name = name
if handle is None:
self._handle = self._load_library(name, mode, winmode)
else:
self._handle = handle
if _os.name == "nt":
def _load_library(self, name, mode, winmode):
if winmode is None:
winmode = _nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
if name:
name = _os.fsdecode(name)
# WINAPI LoadLibrary searches for a DLL if the given name
# is not fully qualified with an explicit drive. For POSIX
# compatibility, and because the DLL search path no longer
# contains the working directory, begin by fully resolving
# any name that contains a path separator.
if '/' in name or '\\' in name:
name = _nt._getfullpathname(name)
# Given a fully-qualified DLL name, allow loading
# dependents from its directory.
winmode |= _nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
return _LoadLibrary(name, winmode)
else:
def _load_library(self, name, mode, winmode):
if _sys.platform.startswith("aix"):
# When the name contains ".a(" and ends with ")", for example,
# "libFOO.a(libFOO.so)" - this is taken to be an
# archive(member) syntax for dlopen(), and the mode is
# adjusted. Otherwise, name is presented to dlopen() as a
# file argument.
if name and name.endswith(")") and ".a(" in name:
mode |= _os.RTLD_MEMBER | _os.RTLD_NOW
return _dlopen(name, mode)
History
Date User Action Args
2020-01-08 05:23:17eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, David Heffernan
2020-01-08 05:23:17eryksunsetmessageid: <[email protected]>
2020-01-08 05:23:17eryksunlinkissue39243 messages
2020-01-08 05:23:16eryksuncreate
|
__label__pos
| 0.913889 |
輪轂孔距 4x98 What cars have a 4x98 bolt pattern?
The 4x98 Bolt Pattern or Pitch Circle Diameter (PCD) is made up of the stud count (4) and the bolt circle measurement (98), the notional circle determined by the center position of the studs.
The 4x98 bolt pattern is common to Alfa Romeo, Alpine, Citroën, Datsun, Dodge, Fiat 和 Ford vehicles. A full list of vehicle makes and models appears below:
|
__label__pos
| 0.954765 |
What Is the Difference Between Afferent and Efferent Neurons?
difference-between-afferent-efferent-neurons
Afferent neurons carry signals to the brain and spinal cord as sensory data, and efferent neurons send signals from the brain to the muscles, glands and organs of the body in response to sensory input.
What Are Neurons?
Within the body's nervous system, which controls and communicates the body's activities, the two main cell types are neuroglia and neurons. The latter is a specialized cell for functional purposes that may include responding to stimuli and transmitting messages around the body. Every neuron has a cell body, dendrites and an axon. Neurons are divided into three types: afferent neurons, efferent neurons and interneurons.
What Are Afferent Neurons?
Sensory information is carried from the body's periphery to a main organ, such as the brain. The sensory information includes neural pulses, which include how things that people hear, touch, see, taste and smell are transmitted from the sensory organs. Afferent neurons are also called sensory neurons, and it is these specialized cells that convey the nerve impulses from around the body directly to the central nervous system.
Physical stimuli, such as sound or light, activate afferent neurons into converting the modalities into nerve impulses. They do this using sensory receptors found in their cell membranes. The main cell bodies of afferent neurons are located near the brain and spinal column, which combine to form the central nervous system.
What Are Efferent Neurons?
Efferent neurons' cell bodies are located within the central nervous system and are also called motor neurons. Having received data from different neurons, which includes afferent neurons and interneurons, the efferent neurons take these signals from the central nervous system and transfer the nerve impulses to the peripheral nervous system, muscles and glands to initiate a response to stimulus.
How They Work Together
Afferent neurons usually have two axons, or terminals, that transmit electrochemical signals into the spinal column or the brain. Once there, the signal passes through a network of interneurons and through an efferent neuron. Afferent-efferent neuron pairs that travel through the spinal column govern reflexes, such as the knee-jerk response.
Afferent neurons are designed to respond to different stimuli. For example, an afferent neuron on a nerve ending designed to respond to heat detects excess heat and sends an impulse through the central nervous system. The efferent neuron then causes muscles to contract as a reflex to move the body away from the heat. Skin has sensory receptors for heat, cold, pleasure, pain and pressure, among others.
How They Differ
Afferent neurons have round and smooth cell bodies, while efferent neurons have satellite-shaped cell bodies. Afferent neurons are found in the peripheral nervous system, and efferent neurons are located in the central nervous system. The axons in afferent neurons move from the ganglia (a cluster of nerve cells that houses afferent and efferent neurons) to the spinal cord. A long axon is actually connected to an efferent neuron.
Afferent neurons have one long myelinated dendrite, whereas efferent neurons have shorter dendrites, and several of them. The dendrite in an afferent neuron is what is responsible for transferring nerve impulses from the receptors to the body of the cell, while in an efferent neuron the impulses pass through the dendrite and leave via a neuromuscular junction that is formed between the effectors and the axon.
|
__label__pos
| 0.998491 |
Towards Convergence in Information Systems Design
Towards Convergence in Information Systems Design
Deepika Prakash (NIIT University, India)
Copyright: © 2020 |Pages: 17
DOI: 10.4018/978-1-7998-2975-1.ch011
Abstract
Three technologies—business intelligence, big data, and machine learning—developed independently and address different types of problems. Data warehouses have been used as systems for business intelligence, and NoSQL databases are used for big data. In this chapter, the authors explore the convergence of business intelligence and big data. Traditionally, a data warehouse is implemented on a ROLAP or MOLAP platform. Whereas MOLAP suffers from having propriety architecture, ROLAP suffers from the inherent disadvantages of RDBMS. In order to mitigate the drawbacks of ROLAP, the authors propose implementing a data warehouse on a NoSQL database. They choose Cassandra as their database. For this they start by identifying a generic information model that captures the requirements of the system to-be. They propose mapping rules that map the components of the information model to the Cassandra data model. They finally show a small implementation using an example.
Chapter Preview
Top
Introduction
Business Intelligence (BI), Big Data and Machine Learning (ML) are three among the major technological developments in the last 15 years. Business Intelligence encompasses query reporting, data mining in the context of providing decision support. It is based on Data Warehouse (DW) technology. Traditionally, Data Warehouse (DW) star schemas are implemented either using a relational database which allows ROLAP operations or on a multi-dimensional database that allows MOLAP operations. While the data in the former is stored in relational tables, the data in the latter are stored in multidimensional databases (MDB). MDBs use either multi-dimensional array or hypercubes to store this data. A number of RDBMS offer support for building DW systems and for ROLAP queries. MOLAP engines have proprietary architectures. This results in niche servers and is often a disadvantage.
One of the early views of Big Data is that any data satisfying the properties of Velocity, Volume, Variety is big data; this was expanded to include Veracity. Clearly, based on this definition there are two major concerns (a) building a repository for storage of large amounts of data, (b) accommodating a variety of data. To address (a), there was a shift away from vertical scaling to what is called horizontal scaling. Unlike vertical scaling, horizontal scaling is done using commodity machines. Horizontal scaling leads to a repository of data which is distributed across nodes and datacenters. Now, to address (b), variety includes structured, semi-structured and unstructured data. While traditional relational databases are able to store structured data, unstructured data can be stored as a BLOB. The BLOB does not allow full range of querying and processing. Thus, a new model and architecture for databases was required that also provided horizontal scaling. The answer was found in NoSQL databases.
The third technological development is Machine Learning (ML). The area develops and applies algorithms enabling a system to learn. Notice, the system learns by itself without any additional explicit program being written. This may be done through learning patterns or inference rules. The aim of this learning is to gain insights and improve user experience. ML algorithms make no commitment to data storage and management.
If we compare the three technologies from the query viewpoint, we find that BI is oriented to provide business information; Big Data systems improve execution of unstructured and distributed data; and finally ML improves the quality of data in the hands of the user. The first relies on an explicit data storage and architecture of a data warehouse, the second relies on the NoSQL data storage and architecture whereas the ML de-emphasizes the data aspects but deals with the processing aspects almost exclusively. It can be seen that these three technologies reflect the tension between data orientation and process orientation in information systems with BI and Big Data at the data end and ML at the process end.
Figure 1.
The three technological islands
978-1-7998-2975-1.ch011.f01
The three technologies developed independently and at different times (see figure 1): BI was the earliest followed by Big data and ML that were developed almost at the same time. Notice that these three technologies, in so far as they address different domains, are isolated from one another. Yet, there is no reason why these could not benefit from cross fertilization. Indeed there is a case for convergence of these three.
Notice that ML algorithms depend on “lots of data” to effectively run the algorithms. In fact, they not only need bulk storage of data but also historical data. For example, they may need voice data for the last 4 years for analysis. Further they require a system that enables quick random “reads”. Based on the white paper (TDWI, 2018) there are eight requirements for storage of ML data some of which are need for scalability, durability and parallel architecture. Notice, these requirements are satisfied by a Big Data system. The input to an ML algorithm can be unstructured or structured data. Outputs are typically smaller and output storage can be often handled easily.
Complete Chapter List
Search this Book:
Reset
|
__label__pos
| 0.941126 |
5 Common Irritants that Cause Dermatitis
Contact dermatitis develops when your skin touches something that causes a rash. If you’ve ever used a new detergent or skincare product and noticed some skin irritation, you may have experienced contact dermatitis.
Contact dermatitis, while common, is often bothersome and sends many Americans to seek out the help of an allergist. Most people first experience symptoms during childhood. Avoiding your triggers plays a key role in managing symptoms of contact dermatitis.
What is dermatitis?
The term dermatitis is used to describe skin irritation. While there are many forms of dermatitis, allergy specialist Dr. Ulrike Ziegner here at Riviera Allergy Medical Center commonly treats patients with allergic contact dermatitis. This involves an exaggerated immune response to something in your environment that your skin touches.
The immune system has the crucial job of protecting the body against invaders and foreign substances. In people with contact dermatitis, the body responds to harmless substances as if they’re foreign invaders. It’s this overly sensitive immune reaction that is responsible for such symptoms as:
Allergic contact dermatitis
Allergic contact dermatitis occurs when you develop a skin allergy to a foreign substance. When you have allergic contact dermatitis, blood cells in your body, known as lymphocytes, release inflammatory chemicals that cause your skin to feel irritated and itchy. Even a small amount of an allergen can be enough to trigger a reaction.
People with allergic contact dermatitis can develop a skin allergy to just about any substance. Here are the five most common substances likely to cause a reaction:
1. Jewelry made from nickel
2. Perfumes
3. Chemicals in cosmetics
4. Latex
5. Poison ivy
Irritant contact dermatitis
In addition to allergens, irritating materials can cause dermatitis when they come in contact with the skin. Irritants quickly strip the outer layer of the skin of its oil and moisture, allowing the irritating chemical to penetrate more deeply, triggering inflammation. The five most common irritants that cause contact dermatitis are:
1. Bleach
2. Soap
3. Detergent
4. Drain cleaners
5. Acids
The severity of dermatitis varies from person to person and depends on various factors, including length and frequency of exposure, as well as the sensitivity of your skin. Anyone can have irritant contact dermatitis, but your risk increases if you have atopic dermatitis.
In some cases, irritant contact dermatitis is due to chemicals you’re exposed to at work. For instance, hairdressers and food handlers commonly experience hand irritant dermatitis.
Treating contact dermatitis
Wearing vinyl gloves and protective gear can help prevent irritant contact dermatitis if it isn’t possible to avoid the substance due to work requirements.
On the other hand, recognizing and avoiding the allergen is the most common approach to treating allergic contact dermatitis.
How is allergic dermatitis diagnosed?
Dr. Ziegner uses a simple and painless skin patch test to help determine what substances you’re allergic to. This test goes over 3 days due to the fact that contact dermatitis is a delayed hypersensitivity reaction, caused by blood cells.
Dermatitis is often the first symptom of allergic disease. Whether it’s triggered by food or something in the environment, you shouldn’t ignore symptoms of a potential allergy.
If you’re experiencing skin irritation, Dr. Ziegner can provide you with answers. Make plans to stop in to see us at our Redondo Beach, California, office by calling 310-504-3242 or sending us a message here on our website. You can also use our convenient online request button.
You Might Also Enjoy...
The Link Between Allergies and Asthma
Allergies and asthma often occur together, and the symptoms are more than just a nuisance. Treating both conditions can bring significant relief and allow patients to live normally and enjoy life.
I Have Chronic Sinusitis: Can You Help?
If you have a chronically stuffy nose, allergies may be plaguing you. Allergies won't go away on their own, and an allergist can help you get to the bottom of your chronic sinusitis and its symptoms.
Should My Child Get Allergy Shots for Pet Allergies?
It can be disheartening to discover that your child is allergic to your family pet, but pet allergies in children are common. Fortunately, allergy shots make it possible for many of these children to have pets after all.
Allergy Symptoms vs Covid-19 Symptoms
Seasonal allergies have coexisted with COVID-19 for the third year in a row. And it’s become increasingly difficult to tell the two apart. Leave it to allergy experts to help you distinguish your symptoms.
|
__label__pos
| 0.992317 |
Article Text
Download PDFPDF
Early life diarrhoea and later blood pressure in a developing country: the 1982 Pelotas (Brazil) birth cohort study
1. G D Batty1,
2. B L Horta2,
3. G Davey Smith3,
4. F C Barros4,
5. C Victora2
1. 1
MRC Social & Public Health Sciences Unit, University of Glasgow, Glasgow, UK
2. 2
Post-Graduate Programme in Epidemiology, Universidade Federal de Pelotas, Pelotas, Brazil
3. 3
Department of Social Medicine, University of Bristol, Bristol, UK
4. 4
PAHO/WHO Latin American Centre for Perinatology, Montevideo, Uruguay
1. Dr G D Batty, MRC Social & Public Health Sciences Unit, University of Glasgow, 4 Lilybank Gardens, Glasgow G12 8RZ, UK; david-b{at}sphsu.mrc.ac.uk
Abstract
Background: It has recently been hypothesised that acute dehydration in early childhood may “programme” increased blood pressure via salt retention. We examined whether there was an association between episodes of diarrhoea (a proxy for acute dehydration) and later measured blood pressure.
Methods: In the 1982 Pelotas birth cohort study (Brazil), parents/carers reported hospital admissions for diarrhoea in the first 12 and 20 months of study members’ lives. Blood pressure was subsequently measured directly in adolescence (aged 15, 18, 19 years) and early adulthood (aged 23 years).
Results: We found no evidence of an association between diarrhoea in the first 12 months of life and blood pressure measured at any point in adolescence or early adulthood. These findings were unchanged after adjustment for a range of covariates. Equally null results were apparent when diarrhoea admissions in the first 20 months of life, access to home sanitation and use of piped water were the exposures of interest.
Conclusions: Early life proxies for dehydration and diarrhoea were unrelated to later blood pressure in this examination, the most comprehensive to date, of the potential association.
View Full Text
Statistics from Altmetric.com
It has recently been suggested that dehydration in infancy, most likely resulting from an episode of diarrhoea, will subsequently lead to a permanent elevation in blood pressure in humans.1 This hypothesis is based on the proposition that dehydration could “programme” increased water, and hence salt, retention in a biological attempt to protect against the threat of future life-challenging dehydration.1 While this may have positive implications for survival in the short term, given that salt retention gives rise to elevated blood pressure,2 this would be disadvantageous in the longer term owing to an increased risk of hypertension and cardiovascular disease, most obviously in low- and middle-income countries where diarrhoea is prevalent.
The few empirical tests of this hypothesis have been inconclusive. UK children who had a hospital record of dehydration in the first 6 months of life had raised diastolic but not systolic blood pressure.1 Further, in a study that utilised climate data as an instrumental variable for infant dehydration, infants who were exposed to conditions that were more likely to precipitate episodes of diarrhoea (summers with higher temperature and lower rainfall) had increased levels of systolic blood pressure in older age.3 However, three similarly designed UK birth cohort studies46 revealed concordant findings: the blood pressure and/or coronary heart disease risk of middle- to older-aged people did not differ between those with and those without a nurse-recorded early life episode of diarrhoea.
Several of these studies are characterised by a low number of cases of dehydration or diarrhoea, which hampers data interpretation. The Pelotas study,7 which, usually, has repeat measurement of blood pressure across the life course, is based in southern Brazil in an environment where episodes of diarrhoea among the young are somewhat more common than in northern Europe, and therefore does not have this limitation.
METHODS
The 1982 Pelotas birth cohort study has been described in detail elsewhere.7 In brief, in 1982, the city’s five maternity hospitals were visited daily by project workers and all 5914 live births were included in the study. Subsequently, there have been eight follow-up studies of cohort members. Of those pertinent to the present analyses, in 1983 the mothers/carers of a subgroup of infants (N = 1457; 79.3% of surviving target population) who were 12 months old at the time (ie, born January to April 1982) were asked about episodes of illness in the preceding period, including diarrhoea, that required hospital admission. Questions regarding domestic sanitation and piped water were also posed. In 1984, around 20 months after birth, attempts were made to re-contact all study participants and their parents/carers (N = 4934; 87.2% follow-up) and the same enquiries were made. In a validation study involving 120 cohort members, hospital records and parent/carer reports were grouped into broad underlying causes: diarrhoea, pneumonia, asthma/bronchitis, surgery and other.8 Agreement was high between the two sources of information, varying between 85% (pneumonia) and 97% (diarrhoea).8
Blood pressure measurement, together with height and weight, was taken in 1997 when the cohort members were aged approximately 15 years (subgroup of N = 1076; 71.8% of a 27% systematic target sample); in 2000 when aged approximately 18 years (subgroup of N = 2250; 78.9% of an all-male target sample); in 2001 when aged approximately 19 years (subgroup of N = 1031; 69% of a 27% systematic target sample); and, finally, 2004/5 when aged approximately 23 years (N = 4297; 77.4% of all apparently surviving study members). In the earlier home visits, blood pressure was measured twice, at the beginning and at the end of the interview, in the sitting position with a calibrated aneroid sphygmomanometer with appropriate cuff size. In the 2004/5 visit, blood pressure was again recorded twice but using an Omron digital portable wrist monitor (Omron, Beijing, China). The mean of the two readings were used in the present analyses.
RESULTS
Using multiple linear regression we compared the blood pressure of study members who had experienced diarrhoea in the first 12 months of life with those who had not (table 1). The period prevalence of diarrhoea admissions varied between 2.8% and 6.5% depending on the analytical sample under consideration. There was no evidence that infant diarrhoea was linked to an increase in blood pressure for any of the four measurements. The suggestion of a reverse effect—an elevated blood pressure level at age 19 years in children who had not experienced an admission due to diarrhoea relative to those who had—was based on a very small number of cases leading to low statistical power.
Table 1 Hospital admission for diarrhoea in the first 12 months of life and later mean blood pressure in adolescence and early adulthood (1982 Pelotas birth cohort)
In the largest analytical sample based on a re-survey of study members with data on diarrhoea status at 20 months and measured blood pressure at age 23 years (when, for the first time, attempts were made to contact the full cohort of men and women), the was again no evidence of a diarrhoea–blood pressure relationship. Thus, in 344 diarrhoea cases (8.7%) among 3944 study participants, there was no difference (diarrhoea cases vs diarrhoea-free; p value for difference) in systolic (122.1 vs 123.3 mmHg; p = 0.18) or diastolic (75.3 vs 75.9 mmHg; p = 0.33) blood pressure according to diarrhoea status in multiply adjusted analyses. All other diarrhoea–blood pressure associations were similarly null.
Finally, there was no suggestion that either type of water supply or sanitation facilities in early life, themselves related to diarrhoea occurrence in this cohort, was associated with later blood pressure at any point in follow-up (results not shown).
DISCUSSION
In the present dataset we found little support for any link between diarrhoea in the first 12 or 20 months of life and later blood pressure. The very few results that attained statistical significance at conventional levels are likely to be chance findings given the large number of tests necessarily conducted in the course of these analyses. These findings accord with those from pooled analyses of cohorts from Hertfordshire (UK) where no relation was seen for nurse-recorded diarrhoea up to 5 years of age and blood pressure in old age.5 In that study, we also found no association of childhood diarrhoea with either non-fatal5 or fatal6 coronary heart disease in older age, a condition for which raised blood pressure is an important risk factor. The Pelotas study offers more statistical power than these analyses: the prevalence of diarrhoea in the first 12 months of life in the 1920s/1930s in Hertfordshire was low (3.4%)5 but generally higher herein (range 2.8–6.5%).
In the present study, hospital admissions for diarrhoea may be due to dehydration but also persistent diarrhoea and dysentery. It is not possible to know what proportion of study members were admitted for the former, which is of particular relevance to our programming hypothesis. Further investigation of its association, if any, with blood pressure is therefore required. As outlined elsewhere,1 5 this includes, in humans, replication of the present study design using cases of hospitalisation for dehydration as utilised in one of the few positive studies,1 randomised trials of improved hygiene practices that reduce diarrhoea among infants (for instance, in low- and middle-income countries) and, in animals, trials of severe dehydration in early life on later blood pressure.
In conclusion, in the most comprehensive examination to date of the association between childhood diarrhoea and later blood pressure, we found no support for a relationship.
What is already known on this subject
Studies exploring the association between dehydration in early life and later blood pressure reveal equivocal findings and have low statistical power. We attempted to contribute to this evidence base, which is of particular importance in low- and middle-income countries, by examining the association in a cohort which offers both a higher prevalence of diarrhoea (a proxy for dehydration) and a greater number of serial blood pressure measurements than has previously been the case.
What this study adds
In the most comprehensive examination to date of the association between childhood diarrhoea and later blood pressure, we found no support for a relationship.
Acknowledgments
These analyses were supported by the Wellcome Trust initiative “Major Awards for Latin America on Health Consequences of Population Change”. Earlier phases of the 1982 cohort study were funded by the International Development Research Center (Canada), the World Health Organization (Department of Child and Adolescent Health and Development, and Human Reproduction Programme), the Overseas Development Administration (United Kingdom), the United Nations Development Fund for Women, the National Program for Centers of Excellence (Brazil), the National Research Council (Brazil) and the Ministry of Health (Brazil). The UK Medical Research Council (MRC) Social and Public Health Sciences Unit receives funding from the UK MRC and the Chief Scientist Office at the Scottish Government Health Directorates. G.D.B. is a UK Wellcome Trust Fellow (WBS U.1300.00.006.00012.01). C.V., F.C.B. and B.H. designed the study and supervised data collection. The idea for this paper was generated among the co-authors. B.H. carried out the data analyses and G.D.B. wrote the first draft of the manuscript.
REFERENCES
View Abstract
Footnotes
• Funding: Wellcome Trust, London, UK; Medical Research Council, London, UK.
• Competing interests: None.
• Ethics approval: Approval for interviews and medical examinations in the present study were obtained from the Pelotas Federal University Ethics Committee.
• This is an open-access article distributed under the terms of the Creative Commons Attribution Non-commercial License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Request Permissions
If you wish to reuse any or all of this article please use the link below which will take you to the Copyright Clearance Center’s RightsLink service. You will be able to get a quick price and instant permission to reuse the content in many different ways.
|
__label__pos
| 0.803342 |
You are not logged in Log in Join
You are here: Home » Members » Phillip J. Eby's Zope Center » My Wikis » ZPatterns Wiki » Racks » wikipage_view
Log in
Name
Password
RIPPModel »
Racks
A key difference between a "site" and an "application" is that applications create, delete, and otherwise view/manipulate dynamic data. Whether this data is stored in a persistent ZODB object, LDAP, SQL, or the filesystem, managing objects with some type of unique identifier is a common application theme.
Typically, however, developers will simply code these object manipulations directly as calls to methods of the appropriate type. Aside from being tedious and repetitive, however, this practice also violates the principle of InformationHiding, thus hampering FrameworkReusability.
The solution? Delegate data management to a Rack. Racks provide as their primary interface these methods:
• getItem(key) - retrieve an object
• newItem(key) - create a new object of the appropriate kind
(Notice that there is no delItem - you must ask an object to delete itself.)
The Rack itself implements the storage details. Racks are DataManagers, which means they can also provide arbitrary additional data and behavior to their contents, which must be RackMountables.
Currently, the ZPatterns implementation provides a basic Rack that uses the ZODB for storage, but can be easily subclassed to use other storage techniques such as SQL, LDAP and so on, by overriding just a few methods. For example, the LoginManager system derives the classes for UserSources from Rack, making LDAP and SQL UserSources possible. There are several benefits:
• Generic Racks can be developed for a variety of storage backends, which are then reusable for any number of applications
• Application-level code doesn't know or care how their data is stored, making it easy to change backends at a later date.
• The Rack interface becomes a common idiom (or "standard idiot" as JimFulton would say), giving an application designer/developer one less thing to think about.
• The application developer/integrator can now be someone who doesn't know how to access a database, or even how SQLMethods work, as long as someone knowledgeable configures the Rack.
As useful as Racks are by themselves, they are even more powerful in the context of a Specialist. Specialists provide another layer of abstraction above Racks that adds capabilities such as traversability (i.e. URL-based access to contents), "class methods", and the ability to present a unified interface to data which is actually stored in multiple Racks.
|
__label__pos
| 0.61502 |
Skip to main content
Advertisement
Table 5 Sample pairs from error analysis
From: Detection of medical text semantic similarity based on convolutional neural network
Sample pair No. Imaging report content (Chinese) Imaging report content (English) Pathologic report content (Chinese) Pathologic report content (English) True label Predict label
3 于左肾下极腹侧可见多个囊性为主的混合性回声, 相互融合, 较大之一约17.1 × 17.0 mm(局部凸向肾外), 靠近肾盏之一大小约14.2 × 14.6 mm, 形态欠规则, 表面光整, 境界欠清, 囊内无回声透声尚可, 分布欠均, 可见分隔样回声, 间隔及囊壁未见明显增粗, 囊内及囊壁可见点状、带状强回声, 团块后方回声无明显改变, CFI示未见明显血流信号。 Multiple cystic mixed echoes can be observed in the ventral side of the inferior pole of left kidney, which fuse with each other. The largest one is about 17.1 × 17.0 mm (which protrudes out locally from the kidney), and the one near the renal pelvis is about 14.2 × 14.6 mm. The shape of the cysts is irregular, the surface is smooth, and the boundary is not clear. There are no echoes in the cysts, the sound transmission is normal, but the echogenicity is inhomogeneous, and septations can be observed. There is no obvious thickening for both septations and walls of the cysts. Punctate and banded strong echoes can be observed inside the cysts and on the wall of the cysts. There is no obvious lesion behind the cysts, and CFI showed no obvious blood flow signal. 肿物两枚, 直径1cm, 暗黄色, 质中。另见肾上腺组织, 大小2.5*1.5*1.5 cm, 暗红色, 质中。(左肾上腺)倾向皮质结节状增生。 The specimen for pathological examination contains two masses and one adrenal tissue. The diameter of masses is 1 cm, the color is dark yellow, and the texture is medium level. The size of adrenal tissue is 2.5 × 1.5 × 1.5 cm, the color is dark red, and the texture are medium level. (Left adrenal gland) favor a diagnosis of nodular adrenal cortical hyperplasia. True False
4 左侧腋下见数个淋巴结样回声区, 大者11mm*5 mm, 边界清, 有包膜, 形态规则, 内部结构清晰, 未见明显血流信号。左侧腋下可见多个淋巴结。 There are several lymphoid echoes under the left armpit, the largest one is 11 mm × 5 mm, the boundary is clear, the capsule is regular, the internal structure is clear. There is no obvious blood flow signal. Multiple lymph nodes can be seen in the left armpit. 脂肪组织, 大小3.5*3*1 cm, 找见淋巴结两枚。(右腋下淋巴结)淋巴结(0/1)未见癌转移。免疫组化:(右腋下淋巴结)淋巴结(0/1)未见癌转移。 The specimen for pathological examination contains one fat tissue. The size of fat tissue is 3.5 × 3 × 1 cm, and two lymph nodes can be seen in the tissue. (The lymph node of right armpit) lymph node (0/1) show no metastasis. Immunohistochemical staining method: (the lymph node of right armpit) lymph node (0/1) show no metastasis. False True
|
__label__pos
| 0.915576 |
SKE Equipment
commercial pasteurization equipment
Benefits of Commercial Pasteurization Equipment
Introduction
commercial pasteurization equipment
Commercial pasteurization equipment plays a pivotal role in ensuring the safety and quality of various food and beverage products. From dairy to juices, pasteurization helps to extend the shelf life of perishable goods by eliminating harmful pathogens while preserving essential nutrients and flavors. In this blog post, we will explore the numerous benefits of commercial pasteurization equipment in the food industry.
Ensured Food Safety
One of the primary benefits of commercial pasteurization equipment is its ability to ensure food safety. By subjecting foods and beverages to high temperatures for a specific duration, pasteurization effectively kills harmful bacteria, viruses, and parasites that may be present. This process significantly reduces the risk of foodborne illnesses, making the products safer for consumption.
Extended Shelf Life
Commercial pasteurization equipment helps to extend the shelf life of perishable products, allowing manufacturers to distribute their goods over longer distances and store them for extended periods. By eliminating or reducing the microbial load, pasteurization slows down the spoilage process, thereby increasing the product’s longevity without compromising its quality.
Preservation of Nutrients and Flavor
Unlike some other preservation methods, such as sterilization, commercial pasteurization equipment preserves the nutritional content and natural flavors of food and beverages. The gentle heat treatment used in pasteurization minimizes nutrient degradation and flavor alteration, ensuring that the final products retain their quality and taste.
Versatility and Flexibility
Modern commercial pasteurization equipment is highly versatile and adaptable to various food and beverage processing needs. Whether it’s dairy products, juices, or even certain pharmaceuticals, pasteurization can be tailored to suit different applications and production volumes. This flexibility makes it an indispensable tool for manufacturers across industries.
Cost-Effectiveness
While the initial investment in commercial pasteurization equipment may seem significant, it proves to be cost-effective in the long run. By preventing product spoilage and reducing the risk of recalls due to contamination, commercial pasteurization equipment helps manufacturers save money on potential losses and regulatory fines. Additionally, the extended shelf life of pasteurized products allows for better inventory management and reduced waste.
Environmental Sustainability
Pasteurization contributes to environmental sustainability by reducing food waste. By extending the shelf life of perishable products, pasteurization helps minimize the amount of food discarded due to spoilage, thereby conserving resources and reducing greenhouse gas emissions associated with food production and disposal.
Comparison of Different Types of Commercial Pasteurization Equipment
commercial pasteurization equipment
This table provides a brief overview of the different types of pasteurization equipment available and their respective applications. Depending on production needs and processing requirements, manufacturers can choose the most suitable equipment type for their operations.
Equipment TypeDescriptionApplications
Batch PasteurizersProcess small batches of food or beverages at a time, suitable for artisanal or small-scale production.Dairy products, craft beverages, sauces.
Continuous Flow PasteurizersProvide continuous processing of products, ideal for high-volume production lines.Milk, juices, soups, liquid eggs.
UHT PasteurizersUtilize ultra-high temperatures for brief periods to achieve commercial sterilization, offering extended shelf life without refrigeration.Dairy products, fruit juices, liquid foods.
Conclusion
Commercial pasteurization equipment offers a myriad of benefits to the food and beverage industry, ranging from enhanced food safety to extended shelf life and cost-effectiveness. By investing in high-quality pasteurization equipment and implementing robust processing protocols, manufacturers can ensure the production of safe, high-quality products that meet consumer demands while also contributing to environmental sustainability.
FAQ
Q: What is pasteurization, and how does it work?
A: Pasteurization is a heat treatment process that involves heating food or beverages to a specific temperature for a set period to destroy harmful pathogens while preserving the product’s quality. It works by denaturing the proteins and enzymes of microorganisms, rendering them inactive and preventing spoilage.
Q: Are there different types of pasteurization equipment?
A: Yes, there are various types of pasteurization equipment, including batch pasteurizers, continuous flow pasteurizers, and ultra-high-temperature (UHT) pasteurizers. The choice of equipment depends on factors such as the type of product, production volume, and processing requirements.
Q: Does pasteurization affect the taste of food and beverages?
A: Pasteurization is designed to minimize changes in taste and flavor. Unlike other preservation methods that may alter the sensory properties of products, pasteurization aims to preserve the natural taste and aroma of food and beverages while ensuring safety and shelf life.
Q: Is pasteurization required for all food and beverage products?
A: Pasteurization is recommended for certain perishable products, particularly those prone to contamination by harmful pathogens, such as dairy, juices, and some alcoholic beverages. However, not all foods require pasteurization, and the necessity depends on factors such as the product’s composition, intended use, and regulatory requirements.
Q: How can I ensure the effectiveness of pasteurization?
A: To ensure the effectiveness of pasteurization, it’s essential to follow proper processing protocols, including accurately controlling temperature and time parameters, maintaining equipment cleanliness and calibration, and regularly monitoring microbial levels through testing and analysis. Additionally, adhering to regulatory standards and best practices is crucial for ensuring product safety and quality.
|
__label__pos
| 0.997805 |
You copied the Doc URL to your clipboard.
2.26.3. AHB5 bus properties
The following table shows the AHB5 properties of the AHB5 TrustZone master security controller.
Table 2.53. AHB5 properties
PROPERTYVALUECOMMENT
Extended_Memory_TypesTRUEPass-through
Secure_TransfersTRUEConnects a conventional AHB5 Lite Master to the AHB5 bus and enhances it with the TrustZone for ARMv8-M security features
EndianN/APass-through
Stable_Between_ClockFALSENot supported for SIE-200
Exclusive_TransfersTRUEPass-through
Multi_Copy_AtomicityTRUENo caches or buffering that make a transfer visible to only some agents
User signalingTRUEConfigurable width
|
__label__pos
| 0.616804 |
What are the side effects of Aspirin?
4
58
Side effects of aspirin include following:
a) Gastric upset (intolerance)
b) Salicylism (vomiting, tinnitus, decreased hearing, and vertigo)
c) Gastric ulcers and upper gastrointestinal bleeding
d) All of the above
4 COMMENTS
LEAVE A REPLY
Please enter your comment!
Please enter your name here
|
__label__pos
| 0.985802 |
Skip to main content
Wing Shapes
Birds' wing shapes vary greatly depending on their evolutionary adaptations and ecological niche. These shapes play a crucial role in determining a bird's flight capabilities, maneuverability, and overall survival. Wing morphology is a result of millions of years of natural selection, leading to diverse forms optimized for different flight behaviors.
One common wing shape is the high aspect ratio wing, characterized by long, narrow wings with a high span-to-area ratio. Birds with high aspect ratio wings, such as albatrosses and falcons, excel in long-distance gliding and soaring. These wings minimize drag and provide efficient lift, allowing birds to cover vast distances with minimal energy expenditure.
Conversely, birds with low aspect ratio wings, like woodpeckers and grouse, possess shorter, broader wings. These wings are better suited for maneuverability and quick bursts of powered flight rather than sustained gliding. Low aspect ratio wings generate more lift at slower speeds, ideal for navigating dense vegetation or executing rapid takeoffs and landings.
Some birds exhibit unique wing shapes tailored to specific ecological niches. For instance, the elliptical wings of forest-dwelling birds like thrushes and woodpeckers enable precise control and maneuverability in cluttered environments. Meanwhile, the swept-back wings of raptors such as eagles and hawks facilitate high-speed pursuit and agile aerial maneuvers during hunting.
Additionally, birds that specialize in hovering, such as hummingbirds and kestrels, possess specialized wing shapes. Their wings are short and highly mobile, allowing for rapid changes in direction and hovering in place—a feat enabled by unique muscle and feather adaptations.
The image below, created by alithographica.com, shows the main wing shapes of birds.
Wing Shapes
The diversity of wing shapes among birds reflects the wide array of habitats and behaviors found in avian species. Each shape represents a finely tuned adaptation to optimize flight performance in its specific environment, highlighting the remarkable evolutionary versatility of birds.
Are you interested in birds? You will find these books about birds useful.
This post may contain affiliate links. As an Amazon Associate, I earn from qualifying purchases.
Popular posts from this blog
Find cities with similar climate
This map has been created using The Global environmental stratification. The Global environmental stratification (GEnS), based on statistical clustering of bioclimate data (WorldClim). GEnS, consists of 125 strata, which have been aggregated into 18 global environmental zones (labeled A to R) based on the dendrogram. Interactive map >> Via www.vividmaps.com Related posts: - Find cities with similar climate 2050 - How global warming will impact 6000+ cities around the world?
Moose population in North America
The moose ( Alces alces ) is the largest member of the deer family, characterized by its massive size, long legs, and distinctive broad, palmate antlers found in males. They have a dark brown or black coat and a humped shoulder. Moose are primarily found in the boreal and mixed deciduous forests of North America, Europe, and Asia. They are solitary animals, often found near bodies of water, and are herbivores that feed on leaves, bark, twigs, and aquatic vegetation. Despite their size, moose are strong swimmers and can run up to 35 miles per hour. The moose population in North America is shrinking swiftly. This decrease has been correlated to the opening of roadways and landscapes into this animal's north range. In North America, the moose range includes almost all of Canada and Alaska, the northern part of New England and New York, the upper Rocky Mountains, northern Minnesota and Wisconsin, Michigan's Upper Peninsula, and Isle Royale. In 2014-2015, the North American moo
Map of Fox Species Distribution
Foxes are small to medium-sized members of the Canidae family, which also includes wolves, dogs, and other related animals. There are about 37 species of foxes distributed around the world, and they inhabit a wide range of environments, from forests and grasslands to deserts and urban areas. Below is the map of fox species distribution created by Reddit user isaacSW Here are some of the most well-known fox species and their distribution: Red Fox ( Vulpes vulpes ): The red fox is one of the most widely distributed fox species and is found in North America, Europe, Asia, and parts of North Africa. They are adaptable and can live in a variety of habitats, including forests, grasslands, and urban areas. Arctic Fox ( Vulpes lagopus ): The Arctic fox is found in the Arctic regions of North America, Europe, and Asia. They have adaptations that help them survive in cold climates, such as a thick coat that changes color with the seasons. Gray Fox ( Urocyon cinereoargenteus ): The gray fox
|
__label__pos
| 0.921401 |
View Javadoc
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20 package org.apache.maven.plugin.eclipse;
21
22 import org.codehaus.plexus.util.xml.XMLWriter;
23 import org.codehaus.plexus.util.xml.Xpp3Dom;
24
25 /**
26 * Represents a LinkedResources section in the <code>.project</code> file.
27 *
28 * @author <a href="mailto:[email protected]">Ashokkumar Sankaran</a>
29 */
30 public class LinkedResource
31 {
32 /** Resource name */
33 private String name;
34
35 /** Type */
36 private String type;
37
38 /** Resource location */
39 private String location;
40
41 /** Resource localtionURI */
42 private String locationURI;
43
44 public String getName()
45 {
46 return name;
47 }
48
49 public void setName( String name )
50 {
51 this.name = name;
52 }
53
54 public String getType()
55 {
56 return type;
57 }
58
59 public void setType( String type )
60 {
61 this.type = type;
62 }
63
64 public String getLocation()
65 {
66 return location;
67 }
68
69 public void setLocation( String location )
70 {
71 this.location = location;
72 }
73
74 public String getLocationURI()
75 {
76 return locationURI;
77 }
78
79 public void setLocationURI( String locationURI )
80 {
81 this.locationURI = locationURI;
82 }
83
84 /**
85 * Default constructor
86 */
87 public LinkedResource()
88 {
89 super();
90 }
91
92 /**
93 * Creates a LinkedResource from a DOM subtree
94 * <p>
95 * The subtree must represent a <linkedResources> section from an Eclipse .project file
96 *
97 * @param node DOM node
98 */
99 public LinkedResource( Xpp3Dom node )
100 {
101 Xpp3Dom nameNode = node.getChild( "name" );
102
103 if ( nameNode == null )
104 {
105 throw new IllegalArgumentException( "No name node." );
106 }
107
108 name = nameNode.getValue();
109
110 Xpp3Dom typeNode = node.getChild( "type" );
111
112 if ( typeNode == null )
113 {
114 throw new IllegalArgumentException( "No type node." );
115 }
116
117 type = typeNode.getValue();
118
119 Xpp3Dom locationNode = node.getChild( "location" );
120 Xpp3Dom locationURINode = node.getChild( "locationURI" );
121
122 if ( locationNode == null && locationURINode == null )
123 {
124 throw new IllegalArgumentException( "No location or locationURI node." );
125 }
126 else if ( locationNode != null && locationURINode != null )
127 {
128 throw new IllegalArgumentException( "Both location and locationURI nodes are set." );
129 }
130
131 if (locationNode != null)
132 {
133 location = locationNode.getValue();
134 }
135
136 if (locationURINode != null)
137 {
138 locationURI = locationURINode.getValue();
139 }
140 }
141
142 public void print( XMLWriter writer )
143 {
144 writer.startElement( "link" );
145
146 writer.startElement( "name" );
147 writer.writeText( name );
148 writer.endElement(); // name
149
150 writer.startElement( "type" );
151 writer.writeText( type );
152 writer.endElement(); // type
153
154 if ( location != null )
155 {
156 writer.startElement( "location" );
157 writer.writeText( location );
158 writer.endElement(); // location
159 }
160 else if ( locationURI != null )
161 {
162 writer.startElement( "locationURI" );
163 writer.writeText( locationURI );
164 writer.endElement(); // locationURI
165 }
166 writer.endElement();// link
167 }
168
169 public boolean equals( Object obj )
170 {
171 if ( obj instanceof LinkedResource )
172 {
173 LinkedResource b = (LinkedResource) obj;
174
175 return name.equals( b.name ) && ( type == null ? b.type == null : type.equals( b.type ) )
176 && ( location == null ? b.location == null : location.equals( b.location ) )
177 && ( locationURI == null ? b.locationURI == null : locationURI.equals( b.locationURI ) );
178 }
179 else
180 {
181 return false;
182 }
183 }
184
185 public int hashCode()
186 {
187 return name.hashCode() + ( type == null ? 0 : 13 * type.hashCode() )
188 + ( location == null ? 0 : 17 * location.hashCode() )
189 + ( locationURI == null ? 0 : 19 * locationURI.hashCode() );
190 }
191 }
|
__label__pos
| 0.996002 |
Endocrine System
Card Set Information
Author:
elinor
ID:
201304
Filename:
Endocrine System
Updated:
2013-02-17 21:16:34
Tags:
Endocrine System
Folders:
Description:
Pancreas
Show Answers:
Home > Flashcards > Print Preview
The flashcards below were created by user elinor on FreezingBlue Flashcards. What would you like to do?
1. diabetes mellitus (DM)
Chronic disorder of carbohydrate metabolism resulting in hyperglycemia and glycosuria. There are two distinct forms of diabetes mellitus; insulin-dependent deabetes mellitus (IDDM) or type 1, and non-insulin0dependent diabetes mellitus (NIDDM) or type 2.
2. diabetic retinopathy
• -tic = pertaining to
• retin/o =retina
• -pathy = disease
Secondary complication of diabetes that affects the blood vessels of the retina resulting in visual changes and even blindness.
3. insulin-dependent diabetes mellitus (IDDM)
Also called type 1 diabetes melliuts. It develops early in life when the pancreas stops insulin production. Patient must take daily insulin injections.
4. insulinoma
-oma = tumor
Tomor of the islets of Langerhans cells of the pancreas that secretes an excessive amount of insulin.
5. ketoacidosis
• ket/o = ketones
• -osis = abnormal condition
Acidosis due to an excess of acidic ketone bodies (waste products). A serious condition requiring immediate treatment that can result in death for the diabetic patient if not reversed. Also calle diabetic acidosis.
6. non-insulin-dependent diabetes mellitus
Also called type 2 diabetes mellitus. It typically develops later in life. The pancreas produces normal to high levels of insulin, but he cells fail to respond to it. Patients may take oral hypoglycemikcs to improve insulin function, or may eventually have to take insulin.
7. peripheral neuropathy
• -al = pertaining to
• neur/o = nersve
• -pathy = disease
Damage to the nereves in the lower legs and hands as a result of diabetes mellitus. Symptoms include either extreme sensitivity or numbness and tingling.
What would you like to do?
Home > Flashcards > Print Preview
|
__label__pos
| 0.994868 |
cf 611 B ||codeforces goodbye 2015 B. New Year and Old Property (数学或者数位dp)
Posted by 111qqz on Friday, January 1, 2016
TOC
http://codeforces.com/contest/611/problem/B
题意:问a到b(1E18),二进制表示中只有一个0的数有多少个。
思路:这么大的数。。。不是有循环节就是math problems. UD:20160318讲道理还有可能是数位dp好不好。。。
我们发现可以很容易得算出1到x的二进制表示中只有一个0 的数有多少个。
problem solved.
20160318update:学了数位dp后又看到这题。。。这题显然是数位dp啊。。。亏我找规律搞了出来2333.
后面附上数位dp方法AC的代码
/* ***********************************************
Author :111qqz
Created Time :2015年12月30日 星期三 22时49分02秒
File Name :code/cf/goodbye2015/B.cpp
************************************************ */
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#define fst first
#define sec second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define ms(a,x) memset(a,x,sizeof(a))
typedef long long LL;
#define pi pair < int ,int >
#define MP make_pair
using namespace std;
const int N=1E4+7;
LL a,b;
LL p[N];
LL c[N];
LL cal( LL x)
{
return ((x-1LL)*x)/2LL;
}
LL solve (LL x)
{
if (x==0LL) return 0;
LL res= 0LL;
LL cnt = 0LL;
LL xx = x;
while (xx)
{
cnt++;
p[cnt] = xx%2LL;
xx/=2LL;
}
ms(c,0);
res+=cal(cnt-1LL);
LL tmp = (1LL<<cnt)-1LL;
for ( LL i = 0 ; i <cnt-1 ; i++)
{
LL happ = 1LL<<i;
c[i]=tmp-happ;
}
sort(c,c+cnt-1);
for ( LL i = 0 ; i< cnt -1 ; i++)
{
if (x>=c[i]) res++;
}
return res;
}
int main()
{
cin>>a>>b;
LL ans = solve(b)-solve(a-1LL);
cout<<ans<<endl;
#ifndef ONLINE_JUDGE
fclose(stdin);
#endif
return 0;
}
数位dp的方法:
/* ***********************************************
Author :111qqz
Created Time :2016年03月18日 星期五 16时33分04秒
File Name :code/cf/problem/611B.cpp
************************************************ */
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#define fst first
#define sec second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define ms(a,x) memset(a,x,sizeof(a))
typedef long long LL;
#define pi pair < int ,int >
#define MP make_pair
using namespace std;
const double eps = 1E-8;
const int dx4[4]={1,0,0,-1};
const int dy4[4]={0,-1,1,0};
const int inf = 0x3f3f3f3f;
LL l,r;
int digit[80];
LL dp[80][80];
LL dfs( int pos,int cnt,bool limit,bool prehasnonzero)
{
if (pos==0) return cnt==1;
if (!limit&&prehasnonzero&&dp[pos][cnt]!=-1) return dp[pos][cnt];
int mx = limit?digit[pos]:1;
LL res = 0LL ;
if (prehasnonzero)
{
for ( int i = 0 ; i <= mx ; i++)
{
res+=dfs(pos-1,i==0?cnt+1:cnt,limit&&i==mx,true);
}
}
else
{
for ( int i = 0 ; i <= mx; i++)
{
res+=dfs(pos-1,0,limit&&i==mx,i==0?false:true);
}
}
if (!limit&&prehasnonzero) dp[pos][cnt] = res;
return res;
}
LL solve ( LL n)
{
int len = 0 ;
ms(digit,0);
while (n)
{
digit[++len] = n % 2;
n /= 2;
}
return dfs(len,0,true,false);
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("code/in.txt","r",stdin);
#endif
ms(dp,-1);
cin>>l>>r;
//cout<<"solve:"<<solve()<<endl;
LL ans = solve(r) - solve (l-1);
cout<<ans<<endl;
#ifndef ONLINE_JUDGE
fclose(stdin);
#endif
return 0;
}
「真诚赞赏,手留余香」
111qqz的小窝
真诚赞赏,手留余香
使用微信扫描二维码完成支付
|
__label__pos
| 0.975922 |
Understanding Different Types Of PDO Threads And Their Uses
different types of pdo threads
Here is the list of different types of PDO threads and their uses
Polydioxanone threads have gained popularity recently due to their effectiveness in lifting and tightening skin procedures. However, they come in different types, each with unique properties and uses. Understanding the types of PDO threads and their uses can help you select the right treatment. This article discusses various PDO threads and their use in cosmetic treatments.
PDO Thread Lift: An Overview
• Thread lift is a procedure that uses Minimally Invasive Non-Surgical Thread (MINT) to tighten and lift sagging skin. MINT is a unique biodegradable polyester thread made from a complex sugar polydioxanone or PDO.
PDO has been used in surgery for over 30 years. The procedure involves minimal pain and downtime, and the results can be noticed immediately. Patients can look and feel their best within 45 minutes without going under a knife.
Types of Threads
• PDO threads are a type of suture commonly used in thread lifting. The other two types of sutures are polylactic acid (PLA) and polycaprolactone (PCA). Unlike PLA and PCA, PDO threads have been used since the 1980s and are made from a colorless polyester that breaks down in the body after six months.
When PDO threads are inserted into the skin, they prompt the body’s fibroblast cells to produce more collagen, the protein responsible for the skin’s elasticity and structure. Collagen depletion is a primary factor leading to aging skin. Thus, PDO threads trigger a boost in collagen production, resulting in firmer, smoother, and more youthful-looking skin.
PDO threads are further divided into three categories.
Mono Threads
• Mono threads are smooth, non-barbed threads commonly used in cosmetic treatments for skin tightening. They are typically placed in a mesh-like pattern under the skin to encourage collagen production. Treatment areas for mono threads usually include the necklines, forehead, and under eyes, with approximately 10-20 mono threads inserted for each area.
Mono threads are attached to an anchoring point on the scalp or face to sustain the lifting effect. However, it is important to note that mono threads alone do not provide significant lifting effects and are usually combined with cog threads for overall facial tightening and rejuvenation.
Cog Threads
• Cog threads are a type of thread commonly used in cosmetic treatments for lifting and slimming the jawline. They are similar to mono threads but with the addition of barbs that hook onto the underside of the skin, creating a support structure that lifts sagging tissue. Unlike mono threads, cog threads do not require anchoring points for support.
In addition, collagen formation also occurs around cog threads and their barbs, further enhancing the lifting effects of the treatment. Cog threads are particularly effective in the jawline area, providing significant lifting and slimming effects.
Screw Threads
• types of pdo threadsScrew threads, also known as tornado threads, are used in cosmetic treatments to give volume to sunken areas of the skin. They come as one or two threads intertwined around the inserting needle. When two threads are used, they are called multi-screw, which provides a stronger effect than a single screw thread.
Screw threads are typically used for general face-lifting, and their unique design allows for greater control over the direction of the lift. In addition to their lifting effects, screw threads can stimulate collagen production, improving long-term skin texture and elasticity. Interestingly, a mono thread can be inserted in a twisting fashion to create a similar effect to screw threads.
Alladerm offers PDO Thread Lift, Botox, Chemical peeling, Photofacial, and other cosmetic procedures. For more information, call us at 949-916-7166. We are located in Aliso Viejo, CA.
Leave a Comment
Your email address will not be published. Required fields are marked *
|
__label__pos
| 0.7396 |
Resources Contact Us Home
Browse by: INVENTOR PATENT HOLDER PATENT NUMBER DATE
Drug dosage form based on the teorell-meyer gradient
6414033 Drug dosage form based on the teorell-meyer gradient
Patent Drawings:Drawing: 6414033-2
« 1 »
(1 images)
Inventor: Sceusa
Date Issued: July 2, 2002
Application: 09/381,469
Filed: September 20, 1999
Inventors: Sceusa; Nicholas (New York, NY)
Assignee: Gelsus Research and Consulting, Inc. (New York, NY)
Primary Examiner: Qazi; Sabiha
Assistant Examiner: Choi; Frank
Attorney Or Agent: Browdy and Neimark
U.S. Class: 514/648; 514/653; 514/727; 514/730; 514/741; 514/772; 514/784; 514/788
Field Of Search: 514/648; 514/653; 514/727; 514/730; 514/741; 514/772; 514/784; 514/788
International Class: A61K 9/00
U.S Patent Documents: 3039922; 5976556
Foreign Patent Documents: 2255892; WOX 9103236
Other References: Remington: The Science and Practice of Pharmacy (19th Ed. 1995), pp. 225-27, 229,230,335,707-17.*.
Schurmann, et al., The buccal absorption of atenolol and propranolol, and their physicochemical characteristics, J. Clin. Pharmacol., 1977; 4(5):655-656..
Nair, et al., Biomembrane Permeation of Nicotine: Mechanistic Studies with Porcine Mucosae and Skin, J. Pharm. Sci., 1997; 86(2): 257-262..
Al-Sayed-Omar, et al., Influence of pH of the buccal absorption of morphine sulphate and its major metabolite, morphine-3-glucuronide, J. Pharm. Pharacol., 1987;39: 934-935..
Teorell, Transport Phenomena in Membranes Eights Spiers Memorial Lecture, Discussions Faraday Soc., 1956; 21(9):305-369..
Sieg, et al., Vehicle Effects on Ocular Drug Bioavailability II: Evaluation of Pilocarpine, Journal of Pharmaceutical Sciences, 1977; 66(9):1222-1228..
Odumosu, et al., The Buccal Absorption of Ascorbic Acid and its Passage through Lipoid Membrane, Internat. J. Vit. Nutr. Res., 1977; 47(2):135-144..
Abstract: A method for delivery of pharmaceutically effective amounts of drugs and therapeutic ions is disclosed. More particularly, a method of formulating a dosage form that will move drugs, pro-drugs or therapeutic ions in either cationic or anionic form between voltaic cell compartments of the human body, such as from the mouth into the naso-pharyngeal area or into the lung is set forth. The method utilizes naturally occurring concentration gradients in the form of concentration cells, which are constituents of the anatomy. A dosage formulation designed in consideration of naturally occurring pH gradients, i.e., Teorell-Meyer gradients, and a method of treatment by delivering a pharmaceutically effective amount of ions or drugs using the formulation designed in consideration of Teorell-Meyer gradients, is also described.
Claim: I claim:
1. A method of formulating a drug dosage form composition, said method comprising the steps of;
selecting a recipient compartment of the human body for delivery of a drug, and selecting a contiguous repository compartment of the human body for placement of a drug dosage form,
determining the pH of both the repository and recipient human body compartments,
selecting a therapeutically effective amount of a drug or pro-drug to be used in treatment of the recipient compartment, wherein said drug or pro-drug is selected from the group consisting of cationic, anionic and nonionic drugs or pro-drugs, andwherein when said drug or pro-drug is nonionic, said drug or pro-drug is associated with an ionizable carrier;
selecting a buffering system based on the ionic character, molecular weight and molecular size of said carrier drug or pro-drug that will provide sufficient buffering effect in the repository compartment to provide delivery of a therapeuticamount of drug to the recipient compartment by producing a pH difference between the repository and recipient compartments, wherein the pH of the repository compartment is determined according to the following formula: ##EQU14##
wherein;
pH=pH of the repository compartment with the dosage form in place,
N=the average Newtonian viscosity of the compartments' fluids,
A=the surface area of the repository compartment,
X=the distance the drug is to travel,
T=the transport time selected,
R=the universal gas constant 1.987 cal/mole-degree or 8.314 joule/mole,
t=temperature of the body compartment in absolute degrees--normally 310 degrees Kelvin,
log is the logarithm of the concentration of drug in the repository compartment,
log is the logarithm of the concentration of drug in the recipient compartment; and
wherein said buffering system is capable of sustaining the pH difference in the repository compartment for a period of time sufficient for delivery of the carrier drug or pro-drug to the recipient compartment,
admixing the therapeutically effective amount of the ion, drug or pro-drug together with the components of the selected buffering system, a pharmaceutically appropriate form base and inert ingredients into a desired dosage form.
2. The method according to claim 1, wherein the buffering system is selected to produce a pH in the repository compartment of at least 0.1 pH units difference than the pH of the recipient compartment.
3. The method according to claim 2 wherein the carrier, drug, or pro-drug selected is anionic and the buffering system is selected to produce a pH in the repository body compartment of at least 0.1 pH units higher than the pH of the recipientbody compartment.
4. The method according to claim 3 wherein the buffering system is selected to produce a pH in the repository body compartment to be at least 2.0 pH units higher than the pH of the recipient body compartment.
5. The method according to claim 2 wherein the carrier, drug, or pro-drug selected is cationic and the buffering system is selected to produce a pH in the repository body compartment of at least 0.1 pH units lower than the pH of the recipientbody compartment.
6. The method according to claim 5 wherein the recipient compartment selected is the nose, the repository compartment selected is the mouth, the cationic drug is selected from the group consisting of phenylephrine and diphenhydramine and thebuffering system is selected to produce a pH in the mouth of about 4.8 or lower.
7. The method according to claim 6 wherein the buffering system selected is glycine.
8. The method according to claim 5 wherein the buffering system is selected to produce a pH in the repository body compartment to be at least 2.0 pH units lower than the pH of the recipient body compartment.
9. The method according to claim 1 wherein the drug or pro-drug selected is nonionic and wherein said drug or pro-drug is further admixed with a pharmaceutically acceptable ionizable carrier, said carrier imparting either an anionic or cationiccharacter to said nonionic drug or pro-drug and allowing for the transport of said nonionic drug or pro-drug to the recipient body compartment.
10. The method according to claim 1 wherein the buffer is selected from the group consisting of physiologically acceptable amino acids and their congeners.
11. A method of formulating a drug dosage form composition, said method comprising the steps of;
selecting a recipient compartment of the human body for delivery of a drug, and selecting a contiguous repository compartment of the human body for placement of a drug dosage form,
determining the pH of both the repository and the recipient human body compartments,
selecting a therapeutically effective amount of a drug or pro-drug to be used in treatment of the recipient compartment, wherein said drug or pro-drug is selected from the group consisting of cationic, anionic and nonionic drugs or pro-drugs, andwherein when said drug or pro-drug is nonionic, said drug or pro-drug is associated with an ionizable carrier, selecting a time in which to deliver the total dosage of drug from the repository compartment to the recipient compartment,
determining the pH of the repository compartment necessary to deliver the therapeutic amount of the selected drug to the recipient compartment within the selected time, according to the expression ##EQU15##
wherein;
pH=pH of the repository compartment with the dosage form in place,
N=the average Newtonian viscosity of the compartments' fluids,
A=the surface area of the repository compartment,
X=the distance the drug is to travel,
T=the transport time selected,
R=the universal gas constant 1.987 cal/mole-degree or 8.314 joule/mole,
t=temperature of the body compartment in absolute degrees--normally 310 degrees Kelvin,
log is the logarithm of the concentration of drug in the repository compartment,
log is the logarithm of the concentration of drug in the recipient compartment; and
selecting a buffering system that will provide sufficient buffering effect in the repository compartment to produce the pH value determined with respect to the time for total drug delivery, and
admixing the therapeutically effective amount of the carrier drug or pro-drug together with the components of the selected buffering system, a pharmaceutically appropriate base and inert ingredients into a desired dosage form.
12. A dosage form for the delivery of a therapeutically effective amount of a drug or pro-drug from one anatomical compartment to a contiguous anatomical compartment, said dosage form being designed by the steps of:
selecting a recipient compartment of the human body for delivery of a drug, and selecting a contiguous repository compartment of the human body for placement of a drug dosage form,
determining the pH of both the repository and recipient human body compartments,
selecting a therapeutically effective amount of a drug or pro-drug to be used in treatment of the recipient compartment, wherein said drug or pro-drug is selected from the group consisting of cationic, anionic and nonionic drugs or pro-drugs, andwherein when said drug or pro-drug is nonionic, said drug or pro-drug is associated with an ionizable carrier,
wherein the pH of the repository compartment necessary to allow an effective amount of the drug according to the formula: ##EQU16##
wherein;
pH=pH of the repository compartment with the dosage form in place,
N=the average Newtonian viscosity of the compartments' fluids,
A=the surface area of the repository compartment,
X=the distance the drug is to travel,
T=the transport time selected,
R=the universal gas constant 1.987 cal/mole-degree or 8.314 joule/mole, and
log is the logarithm of the concentration of drug in the repository compartment,
log is the logarithm of the concentration of drug in the recipient compartment,
t=temperature of the body compartment in absolute degrees--normally 310 degrees Kelvin;
selecting a buffering system based on the ionic character, molecular weight and molecular size of said carrier drug or pro-drug that will provide sufficient buffering effect in the repository compartment to provide delivery of a therapeuticamount of drug to the recipient compartment by producing a pH difference between the repository and recipient compartments, wherein said buffering system is capable of sustaining the pH difference in the repository compartment for a period of timesufficient for delivery of the drug or pro-drug to the recipient compartment,
admixing the therapeutically effective amount of the drug or pro-drug together with the components of the selected buffering system, a pharmaceutically appropriate base and inert ingredients into a desired dosage form.
13. The dosage form according to claim 12, wherein the buffering system is selected to produce a pH in the repository compartment of at least 0.1 pH units difference than the pH of the recipient compartment.
14. A dosage form according to claim 13 wherein the carrier, drug, or pro-drug selected is anionic and the buffering system is selected to produce a pH in the repository body compartment of at least 0.1 pH units higher than the pH of therecipient body compartment.
15. A dosage form according to claim 14 wherein the ion, drug or pro-drug selected is anionic and the buffering system is selected to produce a pH in the repository body compartment of at least 2.0 pH units higher than the pH of the recipientbody compartment.
16. A dosage form according to claim 13 wherein the carrier, drug, or pro-drug selected is cationic and the buffering system is selected to produce a pH in the repository body compartment of at least 0.1 pH units lower than the pH of therecipient body compartment.
17. A dosage form according to claim 16 wherein the recipient compartment selected is the nose, the repository compartment selected is the mouth, the cationic drug is selected from the group consisting of phenylephrine and diphenhydramine andthe buffering system is selected to produce a pH in the mouth of about 4.8 or lower.
18. A dosage form according to claim 17 wherein the buffering system selected is glycine.
19. A dosage form according to claim 16 wherein the ion, drug or pro-drug selected is cationic and the buffering system is selected to produce a pH in the repository body compartment of at least 2.0 pH units lower than the pH of the recipientbody compartment.
20. A dosage form according to claim 12 wherein the drug or pro-drug selected is nonionic and wherein said drug or pro-drug is further admixed with a pharmaceutically acceptable ionizable carrier, said carrier imparting either an anionic orcationic character to said nonionic drug or pro-drug and allowing for the transport of said nonionic drug or pro-drug to the recipient body compartment.
21. The dosage form according to claim 12 wherein the buffer is selected from the group consisting of physiologically acceptable amino acids and their congeners.
22. A method for delivering a therapeutically effective amount of drug to a recipient anatomical compartment of the human body comprising the steps of;
selecting a contiguous repository compartment of the human body for placement of a drug dosage form,
placing in the repository compartment a drug dosage form containing a therapeutically effective amount of the drug to be delivered, said drug dosage form being formulated according to a method comprising the following steps;
determining the pH of both the repository and recipient human body compartments,
determining the pH the repository compartment necessary to deliver the therapeutic amount of the drug to the recipient compartment within the selected time according to the formula: ##EQU17##
wherein;
pH=pH of the repository compartment with the dosage form in place,
N=the average Newtonian viscosity of the compartments' fluids,
A=the surface area of the repository compartment,
X=the distance the drug is to travel,
T=the transport time selected,
R=the universal gas constant 1.987 cal/mole-degree or 8.314 joule/mole, and
log is the logarithm of the concentration of drug in the repository compartment,
log is the logarithm of the concentration of drug in the recipient compartment,
t=temperature of the body compartment in absolute degrees--normally 310 degrees Kelvin;
selecting a therapeutically effective amount of a drug or pro-drug to be used in treatment of the recipient compartment, wherein said drug or pro-drug is selected from the group consisting of cationic, anionic and nonionic drugs and pro-drugs,and wherein when said drug or pro-drug is nonionic, said drug or pro-drug is associated with an ionizable carrier
selecting a buffering system based on the ionic character, molecular weight and molecular size of said carrier drug or pro-drug that will provide sufficient buffering effect in the repository compartment to provide delivery of a therapeuticamount of drug to the recipient compartment by producing a pH difference between the repository and recipient compartments, wherein said buffering system is capable of sustaining the pH difference in the repository compartment for a period of timesufficient for delivery of the carrier drug or pro-drug to the recipient compartment,
admixing the therapeutically effective amount of the carrier drug or pro-drug together with the compartments of the selected buffering system, a pharmaceutically appropriate form base and inert ingredients into a desired dosage form.
23. The method according to claim 22, wherein the buffering system is selected to produce a pH in the repository compartment of at least 0.1 pH units difference than the pH of the recipient compartment.
24. The method according to claim 23 wherein the carrier, drug, or pro-drug selected is anionic and the buffering system is selected to produce a pH in the repository body compartment of at least 0.1 pH units higher than the pH of the recipientbody compartment.
25. The method according to claim 24 wherein the buffering system is selected to produce a pH in the repository body compartment of at least 2.0 pH units higher than the pH of the recipient body compartment.
26. The method according to claim 23 wherein the carrier, drug, or pro-drug selected is cationic and the buffering system is selected to produce a pH in the repository body compartment of at least 0.1 pH units lower than the pH of the recipientbody compartment.
27. The method according to claim 26 wherein the recipient compartment selected is the nose, the repository compartment selected is the mouth, the cationic drug is selected from the group consisting of phenylephrine and diphenhydramine and thebuffering system is selected to produce a pH in the mouth of about 4.8 or lower.
28. The method according to claim 27 wherein the buffering system selected is glycine.
29. The method according to claim 26 wherein the buffering system is selected to produce a pH in the repository body compartment of at least 2.0 pH units lower than the pH of the recipient body compartment.
30. The method according to claim 22 wherein the drug or pro-drug selected is nonionic and wherein said drug or pro-drug is further admixed with a pharmaceutically acceptable ionizable carrier, said carrier imparting either an anionic orcationic character to said nonionic drug or pro-drug and allowing for the transport of said nonionic drug or pro-drug to the recipient body compartment.
Description: FIELD OF THE INVENTION
This invention relates to a method for delivery of pharmaceutically effective amounts of drugs and therapeutic ions. More particularly, this invention relates to a method of formulating a dosage form that will move drugs, pro-drugs ortherapeutic ions in either cationic or anionic form between voltaic cell compartments of the human body, such as from the mouth into the naso-pharyngeal area or into the lung. This invention utilizes the naturally occurring concentration gradients inthe form of concentration cells, which are constituents of the anatomy. This invention also relates to a dosage formulation designed in consideration of naturally occurring pH gradients, Le., Teorell-Meyer gradients, and a method of treatment bydelivering a pharmaceutically effective amount of ions or drugs using the formulation designed in consideration of Teorell-Meyer gradients.
BACKGROUND
A new method for delivery of ions and drugs in ionic form is disclosed, including dosage forms designed according to the method of this invention. This dosage form represents an active dosage form that uses charge as a driving principle and is acomplete departure from passive dosage forms, The dosage form will be able to move either cations or anions by taking advantage of the naturally occuring concentration gradients that exist in concentration "cells" of the anatomy. One such concentrationcell exists between from the mouth into the naso-pharyngeal area, trachea and possibly the lung. It is formed by the buccal cavity, the epiglottis and the naso-pharynx. By either raising or lowering the pH of the mouth to a suitable extent, by using adosage form buffered at a correct pH, the ion or ionized drug or pro-drug will be moved electro-osmotically in accordance with Teorell-Meyer flux gradients.
The design of dosage forms according to this invention that are capable of moving ions, ionized drugs or carrier ions from one physiological compartment to another (defining a "cell"), in a pH dependent manner, derives mathematically from theTeorell-Meyer Theory. See, Teorell, T., Discussions Faraday Soc., 1956, 21(9), 305-369. The derivation according to this invention predicts that a dosage form buffered at the correct pH will be able to move either the desired positive or negative ionsfrom compartment A to compartment B in an pH dependent osmo-electrophoretic manner, provided a flux gradient exists between two and possibly more compartments. Examples of such compartments are: mouth--nose; vagina--uterous--Fallopian tubes; outer andinner ear; and many others that are described in the work of Nordenstrom, B. E., Biologically Closed Electrical Systems: Clinical, Experimental and Theoretical Evidence of an Additional Circulatory System; Stockholm, Nordic Medical Publications, 1983,and Evans, E. E., Schentag J. J., Jusko W. J. eds, Applied Pharmacoldnetics: Principles of Therapeutic Drug Monitoring, 3rd ed, Vancouver, Wash., 1992, which are incorporated herein by reference.
Dosage forms designed according to the method of this invention are ideal for reaching one compartment from another and provide more direct application of drug to a target area than most conventional dosage forms, particularly those dosage formsthat rely on systemic circulation. This allows the dosage form to actually contain a lower dosage of drug, since a higher percentage of drug is delivered to the target area. The drug can also be delivered directly to the target area as needed. Undersome conditions where drug substances are transported through membranes, the drugs may become concentrated in the target tissues. In addition, fewer side effects should be expected from dosage forms according to this invention than from systemic dosageforms.
This dosage form will obviate conventional delivery systems such as nasal sprays. It is superior to such systems because it can be targeted to specific tissues in the body according to the prevailing Donnan Equilibrium of that tissue. Theseequilibria can be mapped. A Donnan Equilibrium is an area of fixed charge, held in place by the tertiary and quaternary struture of the constituent proteins in the target tissue. Thus a drug can be guided to a specific tisssue and leave anotherrelatively or entirely untouched.
This method is applicable to almost any therapeutic agent that is capable of existing in ionized form, although those agents of lower molecular weight or size will be transported faster and are therefore preferred. Non-ionic agents require anionizable carrier, which must meet the further requirements of providing for favorable release of the drug at the target site as well as being metabolizable or otherwise easily eliminated physiologically.
OBJECTS OF THE INVENTION
It is an object of the present invention to provide for the design of pharmaceutical compositions which provide better, non-systemic delivery of drugs from a repository compartment of the human body to an adjacent compartment by utilization ofthe naturally occuring pH gradients between, the two compartments.
It is another object of the present invention to provide a pharmaceutical composition designed in consideration of the Teorell-Meyer gradient for the delivery of a drug from the mouth to the naso-pharyngeal area.
It is a further object of the invention to provide a method of non-systemic administration of an active drug or pro-drug to a patient.
Additional objects of the invention will become evident by study of the detailed description of preferred embodiments of the invention.
SUMMARY OF THE INVENTION
The above and other objects of the invention are provided by a method for formulating the composition of drug dosage forms which will deliver active drugs from a body compartment or organ in which it is placed, i.e., a repository compartment ororgan, to a recipient compartment based on the Teorell-Meyer gradient of differing pHs between the two compartments. The method entails identifying both the repository and recipient compartments and determing the pH of each compartment, and isapplicable to compartments that are adjacent or contiguous, or that are separated only by a thin membrane. In addition, the repository compartment is in the form of a cavity large enough to contain the desired doage form. Examples of such contiguouscompartments include; the mouth and naso-pharynx, mouth-trachea-bronchioles and bronchi, and possibly lung, the surface of the eye, the sclera, the cornea, the anterior chamber, iris, posterior chamber, retina and possibly the optic nerve, thevagina-uterous-fallopian tubes and possibly the ovary, the middle and inner ear, epidural space-meninges-brain, to name a few. The method is also applicable to solid organs as well, such as the eye, liver and prostate. This invention is not limited inscope to the few compartment systems or organs listed here, but is meant to include any such compartment system as meets the basic requirements described herein. Such compartment systems may also be identified in Nordenstrom or Evans. Also, it isexpected that a medical or pharmaceutical practitioner of ordinary skill in the art would appreciate the full range of applicability of the within invention.
Selection of contiguous repository/recipient compartment systems to which this invention would apply is dictated largely by pH differences between the two compartments, although other factors may be present as well. Generally, a difference of atleast 0.1 pH units between the compartments is necessary, although the larger the pH difference the faster the active drug will be transported. A pH difference of 2.0 pH units is usually preferred, but a larger difference is possible according to thetolerance of the tissues. Thus, each dosage form has its own limits based on the practical pH difference between the compartments and each dosage form should be calculated according to the desired transport time that makes sense for the system. In thepreferred embodiment of the mouth--nose system, the transport time should be within the twenty minutes needed to dissolve a typical lozenge. The pH difference, therfore, need only be about 0.4. On the other hand, for a suppository, a pH difference of0.1 producing a transport time of about an hour and fifteen minutes would be acceptable.
Once the compartment system is identified the active drug or pro-drug must be selected. Transfer by the within method is applicable to almost any drug that is in anionic, cationic or ionizable form. Ionic drugs should be hydrated. Non-ionicdrugs may also be used as they can be released from an ionizable carrier such as cyclic carbohydrates and cyclodextrans. The speed of travel of the drug depends on the charge, the atomic or molecular diameter, the molecular weight and the viscosity ofthe medium in which it travels. The dosage form will move any ionic substance with a molecular weight of up to thousands of Daltons.
In the case of a cationic (positively charged) or acid drug, the repository compartment must have an induced pH substantially lower that the recipient compartment. Conversely, for an anionic (negatively charged) or basic drug the repositorycompartment must have an induced pH higher than the recipient compartment. Thus, the selection of the buffering system for the dosage form is highly significant. The range of buffers employed correspond to the range of pHs found in the human body, thelowest pH presently known is that of the stomach which is about pH 0.1, the highest pH presently known is about 9.0 and is found in the lower intestine. The buffer or buffer system must last long enough for consumption of the entire dose for completedrug transport to occur. For example, for a typical lozenge of 5 gm, about 20 minutes is necessary.
While the buffers selected must create a pH differential between; the compartments of ideally 2.0 pH units or more to cause rapid drug movement, greater or smaller pH differences are not beyond the scope of this invention. However, whenselecting the buffer physiological considerations must also be taken into account. That is, the amount of pH difference between the dosage buffer and the repository compartment that the tissue of that compartment will tolerate.
For the purpose of this invention, the 20 physiologically accepted amino acids and their congeners (e.g., orotic acid, carnitine, ornitine) are generally preferred. The buffers systems usually contain at least two components: a salt and itscorrelative acid, or base. Buffers may be single compounds in certain cases, such as solutions of amino acids, Tris.RTM., and other compounds containing both acid and basic groups on the same molecule. A buffering system may be complex, containingseveral components. It may also contain non-related salts and amino acids or similar zwitterionic compounds.
The buffering agent should be able to reliably buffer at the chosen pH, which may be anywhere within the physiological range, so as to preferably maintain a difference of at least 2 pH units between the repository and recipient compartments,according to tissue tolerance, for the preferred embodiment of the invention, to exert substantial buffering capacity within this range. Preferred buffering agents are the amino acids, hydrogen and dihydrogen phosphates, such as sodium dihydrogenphosphate and mixtures of sodium dihydrogen phosphate with sodium hydrogen phosphate, calcium tetrahydrogen phosphate, citric acid and mixtures of citric acid and its monosodium salt, fumaric acid and its monosodium salt, adipic acid and its monosodiumsalt, tartaric acid and its monosodium salt, ascorbic acid and its monosodium salt, glutamic acid, aspartic acid, betaine hydrochloride, hydrochlorides of amino acids, such as arginine monohydrochloride and glutamic acid hydrochloride and saccharic acid,and other suitable GRAS ingredients herein incorporated by reference.
According to the invention there is provided a method of designing the dosage form of the composition according to the invention, said method comprising the following steps:
selecting the recipient compartment and the associated repository compartment for placement of the drug dosage form,
determining the pHs of both the repository and recipient body compartments,
identifying the ion, drug or pro-drug to be used in treatment of the recipient compartment, including the ionic characteristics of the drug and its molecular size and shape,
selecting a buffering system that will provide satisfactorily lasting buffering effect in the repository compartment of generally at least 0.1 pH units and preferrably 2.0 pH units or more lower than the recipient compartment if the drug iscationic (overall positive charge), or at least 0.1 pH units and preferrably 2.0 pH units or more higher than the recipient compartment if the drug is anionic (overall negative charge), and
admixing the ion, drug or pro-drug together with the components of the selected buffering system, at least one pharmaceutically acceptable carrier, if needed for the transport of a non-ionic molecule, a pharmaceutically appropriated form base andinert ingredients into a desired dosage form such as a lozenge, tablet, capsule, emulsion, injectable emulsion, implantable seed, physiological insert, ophthalmic insert, absorbable sponges, skin patches, pharmaceutical candles, bougies, troches,pastilles and medicated confections.
In another application of the within invention it is desirable to assess the total drug delivery time between the compartments of a given system in order to determine the necessary pH differences between the compartments. Selecting anappropriate drug delivery time and knowing the pH of the recipient compartment, the pH of the repository compartment necessary for total drug transport can be determined. Accordingly, a buffer system designed to produce this pH can be selected.
The invention further relates to a method for administration of a single dose of a dosage form designed according to the above method to a patient comprising administering orally to the patient a lozenge, capsule, tablet containing apharmacologically effective amount of an ion, drug or pro-drug in the dosage form created according to this invention.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic representation of the mouth-nose compartment system.
FIG. 2 represents the mouth-nose system as an electrophoretic sheet.
DETAILED DESCRIPTION
Any closed or open system of two connected anatomical compartments or cavities lying adjacent to one another having osmotic, charge and concentration differences may be treated with this dosage form. The compartments may be separated by a thinmembrane or otherwise connected by a continuous sheet of tissue, or both. Hydro-osmotic pressure, concentration and pH differences between the compartments form a Teorell-Meyer flux gradient. A Teorell-Meyer flux gradient occurs if there is a two ormore compartment unit in which different concentrations, relative charges, and hydro-osmotic pressure exist There may be one or more ionic substances or electrolytes present, and the method is dependant on total relative force rather than any singleelement. Tlus, the driving force for this dosage form depends on the sum of three vector force components: chemical and electrical force and hydro-osmotic pressure.
Therefore, the method or process allows, to the maximum extent possible, the alignment of the three Teorell--Meyer forces in the desired direction of ionic motion. This provides a mechanism to move compounds from compartment to compartment onthe bases of all three forces and not just any one or two.
Since the vast majority, if not all, small molecules have diffusion coefficients of similar magnitudes transport across tissue membranes and sheets will be similar. In the analysis that follows, the following definitions apply:
F is the Faraday constant;
P is the permeability coefficient;
Pf(Em) is the potential difference;
f(Em) is a function of the electromotive force, Em is the electromotive force;
R is the universal gas constant;
T is the absolute temperature;
K.sub.eq is the equilibrium constant;
C is concentration;
C.sub.o is the initial concentration;
D is the diffusion constant/coeficient
.mu. is the mobility coefficient;
.beta. is the lipid partition coefficient;
.delta. is the distance across the membrane;
q is the absolute value of the electronic charge (1.602.times.10.sup.-19 Coulombs;
k is the Boltzman constant; and
z is the valence of the ion.
In non-steady state cases, the hydro-osmotic pressure must be taken into acccount, and in such cases it also provides an additive force. For steady state analysis, the general flux equation in its simplest form is:
and, for traversing a membrane; where ##EQU1## ##EQU2##
See Sperelakis, N., ed. Cell Physiology Source Book, Academic Press, New York, 1995, pp. 61-66. Now, if f(Em)=Em F/RT, and P=-D/dx, and the Boltzman expression for the potential is Em=d.phi.=-2.303 kT/zq, then ##EQU3##
For a cation, K.sub.eq =[products]/[reactants]={oxidized}/{reduced}, then ##EQU4##
for the steady state. This flux derivation shows that by arranging the equilibrium constant to advantage and by proper buffering, we can change the flux direction.
In the preferred embodiment of the mouth-nose compartment system, fluids, saliva and other liquid and semi-solid substances are directed by the natural action of teeth, tongue and saliva flow in the direction of the digestive system, unlessforcibly expelled. Similarly, the fluids of the nose, if not propelled toward the nostrils by expulsed air, will be propelled backwards to the top of the soft palette and from thence to the digestive system. However, according to this invention, pH,electrical and other forces combine in causing reversal of the natural flow of ions from nose to mouth. The contribution made by the electrical potential force is evaluated using the Boltzmann equation;
and ##EQU5##
where z=valence of the ion. Since
##EQU6##
Since z for H.sup.+ is one (1), we may calculate, using the average figures in Table 1, using the Boltzmann equation;
This result may be substituted into the flux equation above, to calculate the actual movement of ions. To examine the flux of [H.sup.+ ] in the naso-pharaynx, we can calculate as follows: ##EQU7## or J.sub.H+ =3.208.times.10.sup.-8 mole cm/l sec(12)
This result is consistent with a highly stable gradient, a Donnan Potential and equilibrium. This is what would be expected in this area normally.
PREFERRED EMBODIMENT
The invention will now be described in greater detail by reference to the mouth and nose. The naso-pharyngeal cavities can be modeled as a two compartment Teorell-Meyer flux gradient lined with a mucous sheet, whose mid-point can be consideredthe epiglottis. The tongue and the inferior sides of the soft and hard palettes can be considered the limits of the lower compartment, and the superior side of the soft and hard palettes and the superior structures of the nose can be considered thelimits of the upper compartment. See FIG. 1 In the case of the nose-mouth biologic circuit, the epiglottis may act as a "membrane" because of its position and the differing viscosities and concentrations on the superior and inferior sides.
It is readily apparent from FIG. 1 that there are several openings in, this system, and that it is not closed. Among these openings are the mouth, the nostrils, the Eustachean tubes, the tracheal and esophageal openings. Thus the system is notthermodynamically or chemically closed. Because the calculated [H+] flux is very slow, it may be treated as a closed system for the analysis of ion movement within its own area.
Electrically, the flow of positively charged ions or substances, before buffering, is from nose to mouth. Thus, charged particles usually flow in this direction, while electrons move in the mouth to nose direction. The electrical current andionic flow of the nasopharyngeal cavity can be influenced by the contents and pH of the mouth. A dosage form buffered at a suitable pH can cause reversal in the direction of ion movement. This also occurs according to the Teorell-Meyer equation. Thechoice of a suitably buffered dosage form will cause either an anion or cation to travel across the membranes of the mouth and into the nose.
Table 1 gives the literature pH ranges for the nose and mouth.
TABLE 1 Normal pH Values in the Nose and Mouth pH Range Average [H+] Saliva/Mouth 6.9-7.5 7.2 10.sup.-72 Nose 5.5-6.5 6.0 10.sup.-6
By either raising or lowering the pH of the mouth to a suitable extent, by using a lozenge buffered at a correct pH, for example, the ion, ionized drug or pro-drug will be moved electro-osmotically from the mouth to the nose. Generally, adifference of pH of 0.1 to 2.0 is sufficient to cause the transport of most ions or drugs in a reasonable time, but this is not always applicable. In that circumstance, the difference in pH may be increased by a calculable amount based on a reasonabletransport time, as discussed below.
As shown above for protons, the naso-pharyngeal cavity may be modeled electrically as a Teorell-Meyer flux gradient for the introduced ions. Referring to FIG. 1, an example is specified for the A++ ion, and assumes the introduction of a dosageform containing the Lewis acid A.sup.+2. Assuming an average of 20 mls of saliva, a release of the A++ ion from the dosage form into the mouth of greater than 90%, and a lowered mouth pH of 5.25, for the Teorell-Meyer flux gradient formed, the followingis observed: ##EQU8##
where; hypothetical plasma A++=110 micrograms/dl=1.683.times.10.sup.-5 moles/liter, and dosage form A++ in saliva=1.636.times.10.sup.-2 moles/liter. For the hydrogen ion, E can be calculated
For the A++ ion,
and the flux for A++
It is readily seen that the introduction of an A++ containing dosage form into the mouth, which is buffered to pH 5.25, reverses the current flows against the normal physiological direction. This potential is at least -9.19.times.10.sup.-2 voltsand may be as much as -12.21.times.10.sup.-2 volts, if the hydorgen ion current vector is added. When these are substituted into the flux equation, and the work terms due to the putative hydrostatic/osmotic and mass action gradients are vector added,the effect is most powerful. If the dosage form is buffered at an ever lower pH, the the effect is compounded.
Therefore, the Teorell-Meyer flux gradient, as exemplified in equation (4), will allow electrophoretic motion of ions or ionized compounds in the mouth to nose direction, if the ratio of the concentrations of ions in the mouth to nose is correct. Thus, for the concentration of a cation or an anion:
for a cation pH mouth<<pH nose; and
for an anion pH mouth>>nose.
A map of any body cavity, such as the nose--mouth system, where such a concentration gradient exists, may be made to show the Donnan Equilibrium. Since the tissues of the nose and mouth are either positively or negatively charged, a differentformulation of dosage form would be required to reach specific tissues, for a specifically charged drug. A Pro-drug synthesis can be applied to the design of such compounds. Carrier/facilitator molecules such as the smaller amino acids, aldehydes,sugars and amino-sugars, and related polysaccharides and other polymeric compounds can be used. Such molecules can buffer, help change pH conveniently, and help propel the desired drug to its site of action, as well as change the pH of the drug.
The time necessary for a charged molecule or ion to arrive at the site of action can be calculated using the information in FIG. 1 and using Newton's Law of Force and Viscosity, defined as:
where F=force;
N=Newtonian viscosity;
A=area;
dV=change in velocity of ion or molecule;
dX=change of distance; and
V=dX/dT;
V=velocity; and
dT=change of time.
Then,
by integration, force, viscosity and area being constants, we obtain FX/NA=V, and by substitution of dx/dt for V;
Since F.times.X=W; where W=work, we can write:
Thus, we can calculate the time course for a given particle, knowing the work done on the particle. The work can be calculated from the Gibb's Free Energy expression which takes into account both the chemical and electrical work available forthe particle,
where;
n is the number of equivalents;
F is the Faraday constant, 26,050 cal/volt-equivalent or 108,933 joule/volt-equivalent;
E is the electromotive force or current calculated by the Boltzmann equation; and
R=is the universal gas constant, 1.987 cal/mole-degree or 8.314 joule/mole.
The result of the above can be substitued into Newton's Law of Force and Viscosity to get a time for a particle under electrophoretic movement. Using a metal ion A++, as an example, the electrical and chemical work done on the A++ ion at theaforementioned pH can be expressed under the previously described condition as:
Since the work of the system is negative in the mouth to nose direction, the current ionic flows are reversed because of the introduction of the electro-osmotic dosage form and its lowering of the mouth pH. This is also shown by theTeorell-Meyer flux gradient equation (11), above.
Based on the chemical and electrical work of the system calculated from equation (27), the necessary pH of the repository compartment may be determined for a selected transport time for delivery of the total drug dose. From equation (26),
T=NAX/W where W=2.303Rt log[mouth]/[nose].
Given that ##EQU9##
where [ ]=moles/l of a Lewis acid
then ##EQU10##
where t=absolute temperature. Thus, the pH of the repository compartment can be expressed as; ##EQU11##
The tranport time "T," being selected according to the system intended, the pH of the repository compartment that is produced by the buffer can be calculated.
Using the model as provided in FIG. 1 in two-dimensional form, the naso-pharyngeal model is represented as an electrophoretic sheet, FIG. 2. FIG. 2 allows one to consider the naso-pharynx as a flat sheet and apply equation (26). As the averagedimension of the mouth is 7 cm and the nose is 7 cm, the total path in the direction of dosage flow is 14 cm, and
By assuming the hydrated A.sup.++ ion to be a sphere with a radius 2.3.times.10.sup.-10 meters, from A.sub.A =.pi.r.sup.2, the cross-sectional area
Applying equation (26), ##EQU12##
if N=1.1, the average viscosity of the saliva/mucous layer, then
T=1.10.times.10.sup.2 (1.1)=121 seconds=2 minutes and one second. Thus, if the average viscosity of the sheet in FIG. 2 is N=1.1 dynes-sec/cm.sup.2, the average measured time to reach the site of action in the nose from the mouth is about 2minutes. This result is a general class of dosage forms which will move any charged drug or pro-drug from mouth to nose, and is applicable to other areas of the body where charge and concentration gradients exist.
For each compartment system selected and drug delivery path chosen, the upper limit of the delivery time should be calculated to determine whether the selected pH for the repository compartment will provide the desired result. For themouth--nose circuit, using the above calculation the following values may be obtained, using the hydrogen ion gradient alone and without regard to the medicament ingredient which may contribute on a charge basis:
pH Difference Time for path x = 14 cm 0.75 604 sec = 10 min. 4 sec. 0.50 906 sec = 15 min. 6 sec. 0.40 19 min. 0.10 1 hr. 15 min.
What may not be a practical limit for a lozenge, may be an acceptable time for a different dosage form, such as a suppository.
Gravity is of little consequence in the face of electro-osmotic attraction, as shown by the ratio of Coulomb's Law of Electrostatic Force to Newton's Law of Gravity. Using, by way of example, a metal ion A++ and hydrogen ion, Coulombs Law isexpressed as:
where K=Coulombs constant; q.sub.1 =charge density of ion one; q.sub.2 =charge density of ion two and r=the distance between the ions in meters. Newton's Law of Gravity is expressed as:
where G=Newton's gravity constant; m.sub.1 =mass of ion one; m.sub.2 =mass of ion two and r=the distance between the ions in meters. Dividing equation (36) by equation (37) and substituting the following values:
charge of proton=1.602.times.10.sup.-19 coulombs;
charge of A++ ion=3.204.times.10.sup.-19 coulombs;
mass of proton=1.67.times.10.sup.-27 kg;
mass of A++ ion=1.092.times.10.sup.-25 kg;
Coulomb's constant=9.times.10.sup.9 nt-m.sup.2 /coul.sup.2 ; and
Gravitation constant=6.67.times.10.sup.-11 nt-m.sup.2 /kg, we obtain
for the A++ and hydrogen ion pairs. Two protons may also be compared, with similar results:
Thus, the force of electro-osmotic attraction is very much greater than that produced by gravity.
Thus, in the practice of this invention for the preferred embodiment, the following steps must be observed. To move a positively charged (i.e., acid) ion, drug or pro-drug from the mouth to the nose, the mouth pH must be lowered below that ofthe target or destination area for the drug, i.e., the nose. Conversely, to move a negatively charged (Le., basic) drug, the pH of the mouth is raised above that of the nasal cavity. This movement is osmo-electrophoretic, and the energy is supplied bythe Teorell-Meyer concentration gradient between the mouth and nose.
By the method of this invention as applied to treatment of conditions of the naso-pharygeal compartment, almost any FDA or homeopathically approved drug may be moved. The identification of said drugs will be apparent to one of ordinary skill inthe art. Protonated amines are Lewis acids and unprotonated carboxyls are Lewis bases. Acid drugs, or H, antagonists, have the following general formula: ##STR1##
However, by means of example only, some of the more common overall negatively charged drugs (acid drugs) are; Tripelene, Mepyramine, Diphenhydramine, Chlorpheniramine, Astemazole, Terfenadine, Oxatomide, Cyproheptadine, Promethazine,Nidocromyl-Na, Disodium cromoglycate, Carbinoxamine and Buclazine. Cholinergic drugs also fit into this category. Some examples are; Arecholine, Oxytremorine, Choline carbamate (and its derivatives), and Pilocarpine.
The within invention is also applicable to many basic drugs, which can be grouped into families. The lead compound also implies the derivative. Examples of basic drugs, acording to family, are: astringents (the acetate family, where acetate isthe active ion), Na Acetate, Al(acetate).sub.3 (aluminum is also an astringent, but it is an acid. Certain amino acids could move both of them, as a rather large complex); anticonvulsants, such as Phenytoin (Diphenylhydantoin); NSAIDS, such as TolmetinNa and its family, prostaglandins (wide range of applications, especially for uterine contractions), and prostaglandin F2-alpha and other derivatives of arachidonic acid; antibiotics, especially Cephalosporins and similar compounds, Moxalactam andAzthreonam; anticholinesterase inhibitors (glaucoma-eye), such as Ecothiophate; anti-oncotics, such as Methotrexate and Amethopterin; and retinoic acids such as Tretoin and Isotretoin.
Nonionic drugs must be placed in an ionic carrier molecule (e.g., a steroid coupled with a Cyclo-Dextrin in whose interior a non-ionic substance may be seated by chemical affinity).
Once the destination compartment to be treated is identified, its pH must be determined. Also, the pH of the adjacent compartment must be known so that it will be known to what extent the pH of the adjacent compartment can be altered, as extremechanges in pH cannot always be tolerated. Then, the active drug for treament of an identified conditon must be selected. When this is done, an appropriate dosage may be formulated utilizing an appropriate buffer to modify the pH of the mouth and causethe drug to be transported to the nose.
Using the example of a lozenge to be placed in the mouth for treatment of the nose, formulation of the lozenge must include ingredients which are buffers or buffer pairs or which are capable of maintaining the pH of the lozenge and the mouth atthe desired level. Buffers may be single compounds in certain restricted cases, such as solutions of amino acids, Trisg, and other compounds containing both acid and basic groups on the same molecule. Buffers usually are systems containing twocomponents: a salt and its correlative acid or base. However, a buffering system may be complex, containing several components. A multiple component buffer system is a system containing several acids and their correlative salts. It may also containnon-related salts, and amino acids or similar zwitterionic compounds. These acids and salts are usually organic, but may be inorganic. An example if an inorganic physiological buffer is the phosphate buffer system:
Phosphate buffer pairs (sodium, potassium or other ligands) having chemical forms L.sub.2 HPO.sub.4 LH.sub.2 PO.sub.4. Carbonate buffers generally have the chemical form LHCO.sub.3, where L is a suitable monovalent ion. Zwitterionic compoundscan be used, such as all twenty GRAS listed amino acids. Also, GRAS listed acids, aldehydes, sugarts, carbohydrates, substituted carbohydrates or other compounds, alone or in combination, which may be used as buffers or buffer pairs. Artificial buffersystems have also been commercially developed for pharmaceutical use.
EXAMPLE
Based on the above discussions a lozenge may be formulated to be placed in the mouth which would eliminate the need for using nose drops to introduce a therapeutically effective dose of an appropriate medication. For purposes of this example,diphenhydramine and phenylephrine were selected, although other common medicaments for treatment for symptoms of colds, allergies or flu may be used.
In determining the composition of a "hard candy formulation" for a lozenge the hydrochloride salts of diphenhydramine and phenylephrine are preferred because they produce ions in solution according to their disolution profile. It is advantageousto use highly ionizable salts.
Phenylephrine = (Phe) Molecular weight 204 Diphenhydramine = (Diph) Molecular weight 318 Glycine = (Gly) Molecular weight 75 Glucose = (Glu) Molecular weight 198
The actual effective doses are to be determined by clinical trial. However, in this example formulation, 50 mg dose of diphenhydramine is chosen. This translates to approximately 0.158 millimoles of diphenhydramine.
In selecting an appropriate lozenge base, the pH of the recipient compartment, the nose, must be considered. Accordingly, the pH of the mouth must be altered by buffering supplied by the lozenge to a pH of approximately 2.0 pH units or morebelow that of the nose. Thus, the buffering system must alter the pH of the mouth from an average of 7.2 to about 4.8 or so. As amino acids are preferred buffering agents, glycine is an appropriate choice. In this context, glycine serves a doublepurpose; it serves both as an acid buffer and a complexing carrier agent.
Teorell-Meyer Lozenge Base For an Acid Drug.
To formulate 700 gms of lozenge base, the following are mix together finely comminuted and granular material:
353.92 gms sucrose (50.56%)
83.23 gms fructose (11.89%)
166.46 gms dextrose (23.78%)
96.39 gms glycine (13.77%)
Mix together as finely granulated (10.times.) powders to make thirty-five (35) twenty gram (20 g) lozenges. To the 696.5 grams of the above lozenge base add 1.75 grams each of diphenhydramine and phenylephrine, a total of 3.5 grams of drug. Compress by standard hot or cold methods.
The amount of glycine, as the buffer, was determined according to this invention to be a large molar excess to insure both pH and complexation of the drug chosen, and based on the average pH of the mouth to be 7.2. The steady state can beapproximated by subtracting the first pKa of glycine from that of the mouth (7.2-2.34=4.86). In this example, the base is 13.77% glycine (1.29 moles) and contains 27.54 times more glycine than drug, by weight. This is a molar excess of glycine of 1.28moles, and 234.5 times the molar amount of drug in the case of diphenhydramine. The buffering action will last as long as the lozenge is incompletely dissolved, and shortly thereafter, until all glycine is neutralized by the homeostatic mechansism ofthe mouth. This varies from individual to individual, and is on the average about twenty minutes. Using the sperical approximation, the following model applies;
and the dR/dt term, the decriment in the sphere's diameter with time, varies with time. This time is analogous with dissolution time. Using a spherical model, it can be shown from the flux equation (11) that constant replenishment of the drugoccurs is opposition to homeopathic mechanisms in proportion to the change of mass and radius of the lozenge. Therefore, if ##EQU13##
the change in concentration is proportional to the change of mass with respect to the radius of the lozenge. This demonstrates that constant replenishment of the initial concentration takes palce at the expense of dm/dr, the change of mass withrespect to lozenge radius, and that the amount of material in the steady state can be considered to be the total dose of the lozenge.
As will be apparent to one skilled in the art, various modifications can be made within the scope of the aforesaid description. Such modifications being within the ability of one skilled in the art form a part of the present invention by theappended claims.
* * * * *
Recently Added Patents
Predicting popularity of electronic publications
Method for media access controlling and system and method for channel time reservation in distributed wireless personal area network
RFID device using single antenna for multiple resonant frequency ranges
Selecting content for storage in a multi-device cache
Doherty amplifier circuit
System and method of interfacing co-processors and input/output devices via a main memory system
Intelligent and automated code deployment
Randomly Featured Patents
Method for controlling a transmission system, application of the method, a transmission system, a receiver and a hearing aid
Article, method for controlling casing depletion
Controlling undesirable plant growth using naphthindazole-4,9-quinones
Corona image transfer method
Plate attachment system for a printing machine form cylinder
System and method for generating uniqueness information for optimizing an SQL query
Imaging apparatus and method
Method for manufacturing electrical connectors for enhancing coplanarity
Carrying case
Coaxially mounted stencil drum and rubber mat roller segments
|
__label__pos
| 0.815563 |
Bukit Mertajam, Penang
SKds40A + dsPIC30F4013 Library
Hi guys, which do you prefer between 5V logic or 3.3V logic microcontroller? I believe that 5V logic is much more popular among students, beginner and hobbyist. However when you want to go with advance microcontroller, it doesn’t support 5V logic microcontroller. So, what is the most advance microcontroller with 5V logic? In PIC series, 16-bit dsPIC30F family is a most advance for 5V logic microcontroller. We also sell SKds40A as a starter kit for 16-bit 40 pins. You can program the PIC chip using UIC00B. Since it is lack of library and hard to start, I have decided to develop a basic function for dsPIC30F4013 (with CIKU function style), and today I want to share with you. 🙂
List of dsPIC30F4013 pins
Before we proceed to the library function, you should know the pin arrangement first.
dsPIC30F4013
For all digital function, you can use all the available pins (yellow font) on the picture above. Please note, there have two style to write, either you enter the pin number OR pin name, for example pinMode(2, OUTPUT); or pinMode(B0, OUTPUT);.
Analog Pins
*You can use these pins with analogRead function.
1. B0 – 2
2. B1 – 3
3. B2 – 4
4. B3 – 5
5. B4 – 6
6. B5 – 7
7. B6 – 8
8. B7 – 9
9. B8 – 10
10. B9 – 11
11. B10 – 12
12. B11 – 13
13. B12 – 14
PWM Pins
*You can use these pins with analogWrite function.
1. D0 – 34
2. D1 – 33
3. D2 – 22
4. D3 – 19
Serial Pins
*You can use these pins with Serial function.
1. F2 – 26 (Receive)
2. F3 – 25 (Transmit)
Serial2 Pins
*You can use these pins with Serial2 function.
1. F4 – 28 (Receive)
2. F5 – 27 (Transmit)
User Interface Pins
*In SKds40A, there have 2 programmable LEDs and 2 switches. You can use the following name to program (refer to example section).
1. LED1 – 22
2. LED2 – 19
3. SW1 – 17
4. SW2 – 23
List of function
This is the list of basic function. If you’re familiar with CIKU library, then it is easy for you. The concept is same.
[code lang=”c” highlight=””]// mode: INPUT or OUTPUT
pinMode(pin, mode);
// value: HIGH or LOW
digitalWrite(pin, value);
// return: HIGH or LOW
digitalRead(pin);
// Toggle the pin state
digitalToggle(pin);
// value: 0 to 100
analogWrite(pin, value);
// return: 0 to 4096
analogRead(pin);
// return: current milliseconds
millis();
// return: current microseconds
micros();
// ms: number of milliseconds to pause
delay(ms);
// us: number of microseconds to pause
delayMicroseconds(us);
// frequency: tone’s frequency in hertz
// duration: tone’s duration
tone(pin, frequency, duration);
// baudrate: baudrate speed, e.g 9600
Serial_begin(baudrate);
// return: number of serial data available to read
Serial_available();
// return: 1 byte serial data
Serial_read();
// value: 1 byte serial data
Serial_write(value);
// string: e.g “Hello World”
Serial_printString(string);
// value: number to be displayed
// base: BIN, OCT, DEC, HEX
Serial_printNumber(value, base);
[/code]
*For the 2nd serial pin function, you can replace the Serial to Serial2 (Serial2_begin).
**You can use both serial function at the same time.
Example
This is example provided in template.c file. User can edit this file.
[code lang=”c” highlight=””]#include “Arduino.h”
void setup()
{
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(SW1, INPUT);
pinMode(SW2, INPUT);
}
void loop()
{
if(digitalRead(SW1) == LOW)
{
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
while(digitalRead(SW1) == LOW);
delay(100);
}
else if(digitalRead(SW2) == LOW)
{
digitalWrite(LED1, LOW);
digitalWrite(LED2, HIGH);
while(digitalRead(SW2) == LOW);
delay(100);
}
}[/code]
Download
You can download the library HERE.
Thank you
Hope this tutorial can help your project development, and don’t forget to share your project with us! 🙂
Related Posts
Leave a comment
Get 7 Tips for Developing Electronic Projects
We respect your privacy.
Loading...
|
__label__pos
| 0.952281 |
Predicting maximal oxygen uptake from a 3-minute progressive knee-ups and step test
Yu Chun Chung, C. Y. Huang, Huey June Wu, Nai Wen Kan, Chin Shan Ho, Chi Chang Huang, Hung Ting Chen
研究成果: 雜誌貢獻文章同行評審
9 引文 斯高帕斯(Scopus)
摘要
Background. Cardiorespiratory fitness assessment is crucial for diagnosing health risks and assessing interventions. Direct measurement of maximum oxygen uptake (V O2 max) yields more objective and accurate results, but it is practical only in a laboratory setting. We therefore investigated whether a 3-min progressive knee-up and step (3MPKS) test can be used to estimate peak oxygen uptake in these settings. Method. The data of 166 healthy adult participants were analyzed. We conducted a V O2 max test and a subsequent 3MPKS exercise test, in a balanced order, a week later. In amultivariate regression model, sex; age; relative V O2 max; bodymass index (BMI); body fat percentage (BF); resting heart rate (HR0); and heart rates at the beginning as well as at the first, second, third, and fourth minutes (denoted by HR0, HR1, HR2, HR3, and HR4, respectively) during a step test were used as predictors. Moreover, R2 and standard error of estimate (SEE) were used to evaluate the accuracy of various body composition models in predicting V O2max. Results. The predicted and actual V O2 max values were significantly correlated (BF% model: R2 = 0.624, SEE = 4.982; BMI model: R2 = 0.567, SEE = 5.153). The BF% model yielded more accurate predictions, and the model predictors were sex, age, BF%, HR0, 1HR3HR0, and 1HR3HR4. Conclusion. In our study, involving Taiwanese adults, we constructed and verified a model to predict V O2 max, which indicates cardiorespiratory fitness. This model had the predictors sex, age, body composition, and heart rate changes during a step test. Our 3MPKS test has the potential to be widely used in epidemiological research to measure V O2 max and other health-related parameters.
原文英語
期刊PeerJ
9
DOIs
出版狀態已發佈 - 3月 15 2021
ASJC Scopus subject areas
• 神經科學 (全部)
• 生物化學、遺傳與分子生物學 (全部)
• 農業與生物科學 (全部)
指紋
深入研究「Predicting maximal oxygen uptake from a 3-minute progressive knee-ups and step test」主題。共同形成了獨特的指紋。
引用此
|
__label__pos
| 0.805545 |
[Piglit] [PATCH v2] KHR image from texture test
Eric Anholt eric at anholt.net
Tue Jan 15 13:35:31 PST 2013
Abdiel Janulgue <abdiel.janulgue at linux.intel.com> writes:
> +#include <EGL/eglext.h>
> +
> +#define WIDTH 448
> +#define HEIGHT 448
Just fold this #define into the config below, since it's never reused.
Oh, and this happens to be TEXTURE_SIZE * (number of texture levels,
which is 7, and that's why tex_box is divided by 7), right? It took
me a bit to figure out how the drawing was actually working.
> +#define TEXTURE_SIZE 64
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> + config.supports_gl_es_version = 20;
> +
> + config.window_width = WIDTH;
> + config.window_height = HEIGHT;
> + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +const GLenum egl_cube_face_targets[6] = {
> + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR,
> + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR,
> + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR,
> + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR,
> + EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR,
> + EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR,
> +};
> +
> +static GLfloat colors[][3] = {
> + {1.0, 1.0, 1.0},
> + {1.0, 1.0, 0.0},
> + {1.0, 0.0, 0.0},
> + {1.0, 0.0, 1.0},
> + {0.0, 0.0, 1.0},
> + {0.0, 1.0, 1.0},
> + {0.0, 1.0, 0.0},
> +};
> +
> +static bool test_cubemap = false;
> +static bool test_2d = false;
> +
> +static const char
> +vertex_shader[] =
> + "attribute vec4 pos_attrib;\n"
> + "attribute vec2 tex_attrib;\n"
> + "varying vec2 tex_coord;\n"
> + "void main () {\n"
> + "gl_Position = pos_attrib;\n"
> + "tex_coord = tex_attrib;\n"
> + "}\n";
> +
> +static const char
> +fragment_shader[] =
> + "uniform sampler2D tex;\n"
> + "varying vec2 tex_coord;\n"
> + "void main () {\n"
> + "gl_FragColor = texture2D(tex, tex_coord);\n"
> + "}\n";
> +
> +static void
> +make_program(const char *vertex_source,
> + const char *fragment_source)
> +{
> + GLuint program, shader;
> + GLuint uniform;
> +
> + program = glCreateProgram();
> + shader = piglit_compile_shader_text(GL_VERTEX_SHADER, vertex_source);
> + glAttachShader(program, shader);
> + shader = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fragment_source);
> + glAttachShader(program, shader);
> +
> + glBindAttribLocation(program, PIGLIT_ATTRIB_POS, "pos_attrib");
> + glBindAttribLocation(program, PIGLIT_ATTRIB_TEX, "tex_attrib");
> +
> + glLinkProgram(program);
> + piglit_link_check_status(program);
This won't report a failure if your program didn't link.
if (!piglit_link_check_status(program))
piglit_report_result(PIGLIT_FAIL).
(We should really build better helpers for programs that need to do
something between attach and link)
> +static GLuint
> +create_egl_image_target(EGLenum target, GLuint texture, GLuint level)
> +{
> + GLuint target_texture;
> + EGLint attribs[] = {
> + EGL_GL_TEXTURE_LEVEL_KHR, level,
> + EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
> + EGL_NONE
> + };
> +
> + EGLDisplay dpy = eglGetCurrentDisplay();
> + EGLContext ctx = eglGetCurrentContext();
> + EGLImageKHR image = eglCreateImageKHR(dpy, ctx, target,
> + (EGLClientBuffer)(uintptr_t)texture,
> + attribs);
> + if (image == EGL_NO_IMAGE_KHR) {
> + printf("Warning EGL_NO_IMAGE_KHR 0x%x\n",
> + eglGetError());
This is a fatal error, right? piglit_report_result(PIGLIT_FAIL) here.
> +static bool
> +test_results(int x, int y, int size, int color)
> +{
> + GLfloat *color1 = colors[color];
> + GLfloat *color2 = colors[(color + 1) % ARRAY_SIZE(colors)];
> + bool pass = true;
> + int x1 = x + size / 4, x2 = x + size * 3 / 4;
> + int y1 = y + size / 4, y2 = y + size * 3 / 4;
> +
> + if (size == 1) {
> + pass = pass && piglit_probe_pixel_rgb(x1, y1, color1);
> + } else {
> + pass = pass && piglit_probe_pixel_rgb(x1, y1, color2);
> + pass = pass && piglit_probe_pixel_rgb(x2, y1, color1);
> + pass = pass && piglit_probe_pixel_rgb(x2, y2, color1);
> + pass = pass && piglit_probe_pixel_rgb(x1, y2, color1);
Probe the whole image, so that any alignment issues that just cause
bad pixels near the borders get caught. I think that's:
pass = pass & piglit_probe_rect_rgb(x1,
y1,
size / 2
size / 2;
pass = pass & piglit_probe_rect_rgb(x1 + size / 2,
y1,
size / 2,
size);
pass = pass & piglit_probe_rect_rgb(x1,
y1 + size / 2,
size / 2,
size / 2);
> +/**
> + * Test if cubemap faces from all miplevels are rendered correctly.
> + * We reverse the order in which face colors are retrieved due to
> + * glReadPixels reading data from Y-bottom and we originally render
> + * from top to bottom.
> + */
> +static bool
> +test_cubemap_texture(int texture_size, int num_level)
> +{
> + static int sz = ARRAY_SIZE(colors);
> + int color = sz - 1;
> + int face, size, dim, r = 0, mip_level = num_level;
> + int vert_pos, horiz_pos = 0;
> + int fail_score = 0;
> +
> + for (size = 1, dim = texture_size; dim > 0; size *= 2, dim >>= 1) {
> + mip_level--;
> + for (vert_pos = piglit_width - texture_size, face = 5;
> + face >= 0; face--, vert_pos -= texture_size) {
In general, I'd move the things that aren't the iterator (so vert_pos
here) outside of the for () and just leave the iterator in there.
Also, you've got vert and horiz swapped (vert is the x position in
this code, and horiz is y, I'd call them x and y instead. There's a
similar issue with vert_pos/layout_pos in draw_cubemap_textures.
> + if (!test_results(vert_pos, horiz_pos, size, color)) {
> + printf("Cube map failed at "
> + "miplevel %d, face %s\n",
> + mip_level, cube_face_names[face]);
> + fail_score++;
> + }
> + r = (r + 1) % sz;
> + color = sz - r - 1;
> + }
> + horiz_pos += texture_size;
> + }
> +
> + return (!fail_score);
I don't see any need for a fail_score; a boolean would be the same.
> +}
> + glViewport(0, 0, piglit_width, piglit_height);
I don't think this is strictly needed -- viewport starts out pointing
at the whole default framebuffer.
> +void
> +piglit_init(int argc, char **argv)
> +{
> + int i;
> +
> + for (i = 1; i < argc; ++i) {
> + if (!strcmp(argv[i], "-2d")) {
> + test_2d = true;
> + break;
> + }
> + if (!strcmp(argv[i], "-cubemap")) {
> + test_cubemap = true;
> + break;
> + }
> + }
> +
> + test_2d = test_2d && piglit_is_egl_extension_supported(eglGetCurrentDisplay(),
> + "EGL_KHR_gl_texture_2D_image");
> + test_cubemap = test_cubemap && piglit_is_egl_extension_supported(eglGetCurrentDisplay(),
> + "KHR_gl_texture_cubemap_image");
So if you don't have the extension and ask to test just 2d, the test
will report PASS? It should report SKIP -- you want to have
piglit_require_egl_extension() in the args processing here I think.
> +}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130115/8c947b0c/attachment.pgp>
More information about the Piglit mailing list
|
__label__pos
| 0.869886 |
This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.
Page tree
Skip to end of metadata
Go to start of metadata
Note: Below steps are useful for Ranger installed with version 0.5.0 using Ambari
For any setup/execution of Ranger KMS related to HSM please check “java.security” file for inclusion of “LunaProvider” in provider list as well as property “createExtractableKeys” to true for Luna AS MENTIONED IN STEP 1.12. Also we need a seprate partition for each KMS cluster
• Link for SafeNet Luna SA Client Installation:
http://cloudhsm-safenet-docs.s3.amazonaws.com/007-011136-002_lunasa_5-1_webhelp_rev-a/Content/configuration/configuration_setup_luna_sa_after_installation.htm
• Installing Ranger KMS HSM (Manually)
1. Extract the Ranger KMS tar
2. Install Ranger-kms with appropriate property values
1. Go to ranger-kms folder and edit install.properties (Enter appropriate values for the below given properties)
db_root_user=
db_root_password=
db_host=
db_name=
db_user=
db_password=
HSM_TYPE=LunaProvider
HSM_ENABLED=
HSM_PARTITION_NAME=
HSM_PARTITION_PASSWORD=
KMS_MASTER_KEY_PASSWD=
POLICY_MGR_URL=
REPOSITORY_NAME=
XAAUDIT.DB.IS_ENABLED=
XAAUDIT.DB.FLAVOUR=
XAAUDIT.DB.HOSTNAME=
XAAUDIT.DB.DATABASE_NAME=
XAAUDIT.DB.USER_NAME=
XAAUDIT.DB.PASSWORD=
3. Edit “hdfs-site.xml”
1. Perform following steps:
1. Go to path : /usr/hdp/<version>/hadoop/conf/
2. vim hdfs-site.xml
3. For property “dfs.encryption.key.provider.uri” ,enter the value “kms://http@<ranger_kms host name>:9292/kms”
4. save and quit
4. Edit “core-site.xml”:
1. Perform following steps:
1. Go to path: /usr/hdp/<version>/hadoop/conf/
2. vim core-site.xml
3. For property “hadoop.security.key.provider.path” ,enter the value “kms://http@<ranger_kms host name>:9292/kms”
4. save and quit
5. Restart Namenode :
su -l hdfs -c "/usr/hdp/<version>/hadoop/sbin/hadoop-daemon.sh stop namenode"
su -l hdfs -c "/usr/hdp/<version>/hadoop/sbin/hadoop-daemon.sh start namenode"
6. Run the setup by command : ./setup.sh
7. Start the KMS server by command: ranger-kms start
• Installing Ranger KMS HSM (Ambari)
Two Approach are possible
Approach 1 :(Configuring with plain text password)
1. Add Ranger KMS Service
2. While configuring add the HSM related properties in “custom dbks-site” accordion.
1. ranger.ks.hsm.enabled=true
2. ranger.ks.hsm.partition.name=<Partition Name>
3. ranger.ks.hsm.partition.password=<Partition Password>
4. ranger.ks.hsm.type=LunaProvider
KMS_HSM.png
3. Click on Next and follow the instructions to install Ranger KMS.
Approach 2 : (Configuring without plain text password and using jceks)
1. Add Ranger KMS Service
2. While configuring add the HSM related properties in “custom dbks-site” accordion.
1. ranger.ks.hsm.enabled=true
2. ranger.ks.hsm.partition.name=<Partition Name>
3. ranger.ks.hsm.partition.password=_
4. ranger.ks.hsm.partition.password.alias=ranger.kms.hsm.partition.password
5. ranger.ks.hsm.type=LunaProvider
screenshot-ec2-54-164-255-218.compute-1.amazonaws.com 8080 2016-02-04 18-10-14.png
3. Click on Next and follow the instructions to install Ranger KMS. (Note Ranger KMS will not start it will fail to start)
4. Execute below command on cluster where Ranger KMS is installed.
python /usr/hdp/current/ranger-kms/ranger_credential_helper.py -l "/usr/hdp/current/ranger-kms/cred/lib/*" -f /etc/ranger/kms/rangerkms.jceks -k ranger.kms.hsm.partition.password -v <Partition_Password> -c 1
5. Restart the KMS from Ambari
• Configure HSM HA
For this section you need at least two Luna SA appliances with PED Authentication, or two with Password Authentication.
1. Set up Appliances for HA
1. Perform the network setup on your two HA units as mentioned in step 1(Client software installation)
2. Ensure that the Allow Cloning and Allow Network Replication policies are “On” in hsm showPolicies
3. Initialize the HSMs on your Luna SA appliances. They must have the same cloning domain – that is, they must share the same red, domain PED Key if they are PED-authenticated , or they must share the same domain string if they are password-authenticated.
4. Create a partition on each Luna SA. They need not have the same labels, but must have the same password.
5. Make a note of the serial number of each Partition created on each Luna SA (use partition show).
2. Register Clients with Luna SA HA
1. Proceed with normal client setup as mentioned in step 2.(Create a Network Trust Link between the Client and the Appliance).
2. Register your client computer with both Luna SAs
3. Verify using ./vtl verify command. It should show the no's of partition registered with client
3. Create the HA Group
Note: Please follow the appropriate steps to form HSM HA according to your client version.
1. Version 6
Client software for HSM Version 6 :
1. After creating partitions on (at least) two Luna appliances, and setting up NTLS between those partitions and your client, use LunaCM to configure HA on your client
1. Go to directory: /usr/safenet/lunaclient/bin/
2. Select Lunacm: ./lunacm
2. To add members in hagroup we need to create a new group on the client
- haGroup creategroup -serialNumber <serial number> -l <label> -p <password>
- e.g : lunacm:>haGroup creategroup -serialNumber 1047740028310 -l HAHSM3 -p S@fenet123
3. Use the hagroup addmember command to add new member into hagroup client, which requires:
1. Label for the group (do NOT call the group just "HA").
2. - the Serial number of the first partition OR the slot number of the first partition.
3. the password for the partition.
4. Lunacm also generates and assigns a Serial Number to the group itself
5. hagroup addMember -group <groupname> -serialNumber <serial number> -password <password>
- e.g lunacm:>hagroup addMember -group rkmsgroup -serialNumber 1047749341551 -password S@fenet123
4. Use the hagroup addmember command to add another member to the HA group.
-hagroup addMember -group <groupname> -serialNumber <serial number> -password <password>
- e.g lunacm:>hagroup addMember -serialNumber 1047740028310 -g rkmslgroup -password S@fenet123
5. Check group member in group using "hagroup listGroups" command.
- e.g lunacm:>hagroup listGroups
6. Enable HAOnly :
- e.g lunacm:>hagroup HAOnly -enable
7. Enable synchronization of HAgroup Members
- hagroup synchronize -group <groupname> -password <password> -enable
- e.g lunacm:>hagroup synchronize -group rkmslgroup -password S@fenet123 -enable
2. Version 5
• Client software for HSM Version 5 :
1. After creating partitions on (at least) two Luna appliances, and setting up NTLS between those partitions and your client, use LunaCM to configure HA on your client.
1. Go to directory: /usr/safenet/lunaclient/bin/
2. To add members in haadmin we need to create a new group on the client.
- ./vtl haAdmin newGroup -serialNum <HA Group Number> -label <Groupname> -password <password>
- e.g ./vtl haAdmin newGroup -serialNum 156453092 -label myHAgroup -password S@fenet123
3. To add members into your haadmin.
- ./vtl haAdmin addMember -group <HA Group Number> -serialNum <serial_number> -password <password>
- eg ./vtl haAdmin addMember -group 1156453092 -serialNum 156451030 -password S@fenet123
4. Enable synchronization of HAadmin Members.
- ./vtl haAdmin synchronize -group <HA Group Number> -password <password>
- e.g eg ./vtl haAdmin synchronize -enable -group 1156453092 -password S@fenet123
5. To Enable HAOnly.
- ./vtl haAdmin HAOnly -enable
6. Check haadmin status after synchronization.
- ./vtl haAdmin show
Note: 1. After synchronization please verify kms master key copied to both partitions registered in hsm ha group.It takes time to copy master key to another partition.
• Installation of Ranger KMS HSM HA
• After configuring HSM HA, to run Ranger KMS in HSM HA mode just we need to specifying the virtual group name create above in “HSM_PARTITION_NAME” property of install.properties and setup and start Ranger KMS.
Note: All other configuration for HSM in “install.properties” of Ranger KMS as mentioned in “Installing Ranger KMS HSM” will remain the same.
• Migration
HSM to Ranger DB
1. Stop the Ranger KMS server if running.
2. Go to Ranger KMS directory. eg: /usr/hdp/<version>/ranger-kms
Note: DB details should be proper (in xml config file of Ranger KMS) to which KMS needs migration to.
3. Run: ./HSMMK2DB.sh <provider> <HSM_PARTITION_NAME>
- e.g : ./HSMMK2DB.sh LunaProvider par19
4. Enter the partition password.
5. After the migration is completed if you want to run Ranger KMS according to the new configuration (either with HSM enabled or disabled) update the Ranger KMS properties if required.
6. Start Ranger KMS.
Note : After Migration when Ranger KMS is up and running fine with HSM disabled, from HSM clear the Master Key object from the partition if it’s not required as Master Key already being migrated to DB.
Ranger DB to HSM
1. Stop the Ranger KMS server if running.
2. Go to Ranger KMS directory. eg: /usr/hdp/<version>/ranger-kms
Note:
-> DB details from which Ranger KMS needs migration should be proper. (in xml config file of Ranger KMS)
-> HSM details should be the KMS HSM to which we are migrating to.
3. Run: ./DBMK2HSM.sh <provider> <HSM_PARTITION_NAME>
e.g : ./DBMK2HSM.sh LunaProvider par19
4. Enter the partition password.
5. After the migration is completed if you want to run Ranger KMS according to the new configuration (either with HSM enabled or disabled) update the Ranger KMS properties if required.
6. Start Ranger KMS
Note: After Migration when Ranger KMS is up and running fine with HSM enabled, from DB table “ranger_masterkey” delete the Master Key row if it’s not required as Master Key already being migrated to HSM.
• Clear Objects from HSM partition
1. SSH to the HSM Appliance Server
- E.g : ssh [email protected]
<Enter Password for HSM Appliance Server when prompted>
2. Check the Partition Objects which you want to clear, command is
- Partition showContents -par <partition_name>
- E.g : partition showContents -par par14
<Enter Password for Partition when prompted>
Note: Please make it sure after step 3 all objects listed from the above command will get destroyed.
3. Clear the objects from HMS partition using following command
- Partition clear -par <partition_name>
<Enter Password for Partition when prompted>
<proceed when prompted>
- E.g : partition clear -par par14
• No labels
|
__label__pos
| 0.887371 |
InTechOpen uses cookies to offer you the best online experience. By continuing to use our site, you agree to our Privacy Policy.
Environmental Sciences » "Evapotranspiration - An Overview", book edited by Stavros G. Alexandris, ISBN 978-953-51-1115-3, Published: April 30, 2013 under CC BY 3.0 license. © The Author(s).
Chapter 2
Recent Updates of the Calibration-Free Evapotranspiration Mapping (CREMAP) Method
By Jozsef Szilagyi
DOI: 10.5772/52392
Article top
Overview
Stream network and selected geomorphic regions of Nebraska. MC: McConaughy Reservoir; LC: Lewis and Clark Reservoir; L: Lincoln; O: Omaha.
Figure 1. Stream network and selected geomorphic regions of Nebraska. MC: McConaughy Reservoir; LC: Lewis and Clark Reservoir; L: Lincoln; O: Omaha.
Schematics of the linear transformation of the MODIS daytime surface temperature values into ET rates (after [1]), applied in CREMAP.
Figure 2. Schematics of the linear transformation of the MODIS daytime surface temperature values into ET rates (after [1]), applied in CREMAP.
Estimated values of the a) momentum roughness height (z0m), and; b) relative change in the aerodynamic resistance (ra) around the state-wide mean. The numbers along the left and bottom edge of the panels are the MODIS cell numbers.
Figure 3. Estimated values of the a) momentum roughness height (z0m), and; b) relative change in the aerodynamic resistance (ra) around the state-wide mean. The numbers along the left and bottom edge of the panels are the MODIS cell numbers.
Relative histograms of the momentum roughness height (z0m) and the relative change in the aerodynamic resistance (ra) around its spatial mean value [m(ra)] across Nebraska, estimated from a 1-km resolution digital elevation model.
Figure 4. Relative histograms of the momentum roughness height (z0m) and the relative change in the aerodynamic resistance (ra) around its spatial mean value [m(ra)] across Nebraska, estimated from a 1-km resolution digital elevation model.
Distribution of the mean annual precipitation (mm) values across Nebraska from the PRISM data, 2000-2009. The state-wide mean annual precipitation rate is 577 mm.
Figure 5. Distribution of the mean annual precipitation (mm) values across Nebraska from the PRISM data, 2000-2009. The state-wide mean annual precipitation rate is 577 mm.
Estimated mean annual ET rates (mm) in Nebraska (2000-2009). The state-wide mean ET value is 549 mm/yr.
Figure 6. Estimated mean annual ET rates (mm) in Nebraska (2000-2009). The state-wide mean ET value is 549 mm/yr.
Estimated mean monthly ET rates (mm) in Nebraska., 2000-2009.
Figure 7. Estimated mean monthly ET rates (mm) in Nebraska., 2000-2009.
Estimated mean annual ET to precipitation ratios (%), 2000-2009. The state-wide mean ratio is 95%.
Figure 8. Estimated mean annual ET to precipitation ratios (%), 2000-2009. The state-wide mean ratio is 95%.
Distribution of areas with the largest observed groundwater decline (at least 3 m, to up to 8 m) over the 2000-2009 period, overlain the ET / P map. For the correct color to ratio correspondence, please, use the colors in Figure 8 instead of the current ones.
Figure 9. Distribution of areas with the largest observed groundwater decline (at least 3 m, to up to 8 m) over the 2000-2009 period, overlain the ET / P map. For the correct color to ratio correspondence, please, use the colors in Figure 8 instead of the current ones.
Irrigated land (marked in black) distribution [after 18, 19] in Nebraska, 2005.
Figure 10. Irrigated land (marked in black) distribution [after 18, 19] in Nebraska, 2005.
Differences in the present and previous [1] mean annual ET maps (mm). Mean is 18.5 mm.
Figure 11. Differences in the present and previous [1] mean annual ET maps (mm). Mean is 18.5 mm.
Water balance derived (P – Ro) mean annual ET rates (mm) of the USGS HUC-8 watersheds in Nebraska, 2000-2009.
Figure 12. Water balance derived (P – Ro) mean annual ET rates (mm) of the USGS HUC-8 watersheds in Nebraska, 2000-2009.
Distribution of the estimation error (mm) in the mean annual ET rates among the USGS HUC-8 watersheds within Nebraska, 2000-2009.
Figure 13. Distribution of the estimation error (mm) in the mean annual ET rates among the USGS HUC-8 watersheds within Nebraska, 2000-2009.
14. Regression plot of the water-balance derived and CREMAP-estimated mean annual ET rates (mm) among the USGS HUC-8 catchments. R2 is the portion of the spatial variance of the water balance ET rates that is explained by the CREMAP estimates. The upper and lower envelope lines designate the P – Ro value plus or minus 10%.
Figure 14. 14. Regression plot of the water-balance derived and CREMAP-estimated mean annual ET rates (mm) among the USGS HUC-8 catchments. R2 is the portion of the spatial variance of the water balance ET rates that is explained by the CREMAP estimates. The upper and lower envelope lines designate the P – Ro value plus or minus 10%.
Recent Updates of the Calibration-Free Evapotranspiration Mapping (CREMAP) Method
Jozsef Szilagyi1, 2
1. Introduction
This study is the revision of an earlier evapotranspiration (ET) estimation technique [1], called Calibration-Free Evapotranspiration Mapping (CREMAP), applied for Nebraska (Figure 1). Major differences between the current and previous versions are
1. the ET rates of the winter months (December, January, February) are included in the current annual maps;
2. the method became largely automated and thus its application made simpler.
In principle, the recent modeling period could have been extended to include 2010 and 2011, however, the multi-institutional research project [2] that provided the monthly incoming global radiation values was terminated in 2010, thus no radiation data are available after June 2010 from that source. Rather than looking for alternative data sources, the original 10-year long modeling period, i.e., 2000-2009, was kept, thus ensuring that the same data types were employed throughout the study.
In the earlier version of the ET maps it was assumed that the ET rates in the winter time are negligible when one is concerned with the mean annual value. In the light of the present version of ET mapping, this assumption was found true only partially: there are regions within Nebraska for which winter ET indeed seems to be negligible (mostly the north-central and north-western parts) in comparison with water-balance data, while in other regions it is not so. These latter regions include parts of Nebraska (mostly the south and south-west portion) with the highest winter-time daily maximum temperatures and/or with most abundant precipitation (eastern, south-eastern portion of the state). As a result the precipitation (P) recycling ratio (i.e., ET / P) rose from a previously estimated mean annual value of 93% to 95%, leaving an estimated 5% of the precipitation to emerge as runoff (Ro) in the streams.
Naturally, as any estimation method, the current approach is not perfect. In the Pine Ridge Escarpment and in the Niobrara River Breaks regions (Figure 1) the ET estimates (similarly to the previous version of the ET map) had to be corrected via comparison with precipitation data because otherwise they would overestimate ET rates by about 10-20%. The reason is in the gross violation of the underlying hypotheses of the current ET estimation method in areas of very rough terrain. After the corrections in these distinct geomorphic regions, it is believed that the resulting ET rates are quite reasonable across the whole state. Overall, the method yields a state-representative ET rate value of 549 mm/yr, within 2% of the simplified water balance (P – Ro) derived rate of 538 mm/yr, employing the USGS [3] values of computed runoff for catchments with level-8 hydrologic unit codes (HUC), and explains 87% of the observed spatial variance of the water balance ET values among the HUC-8 catchments (there are 70 such watersheds within the state) for the same period.
2. Description of the current ET estimation method
An ET estimation method had been proposed by Bouchet [4], employing the complementary relationship (CR) of evaporation which was subsequently formulated for practical regional-scale ET applications by Brutsaert & Stricker [5] and Morton et al. [6]. In this study the WREVAP program of [6] was applied for the estimation of the regional-scale ET rates at monthly periods. Disaggregation of the regional ET value in space is based on the Moderate Resolution Imaging Spectroradiometer (MODIS) data [7] that have a nominal spatial resolution of about 1 km. The disaggregation is achieved by a linear transformation of the 8-day composited MODIS daytime surface temperature (Ts) values into actual ET rates on a monthly basis [1, 8] by first aggregating the composited Ts data into monthly mean values. Compositing is used for eliminating cloud effects in the resulting composite data by removing suspicious, low pixel-values in the averaging over each eight-day period. See [7] for more detail of data collection and characteristics.
media/image1.png
Figure 1.
Stream network and selected geomorphic regions of Nebraska. MC: McConaughy Reservoir; LC: Lewis and Clark Reservoir; L: Lincoln; O: Omaha.
The transformation requires the specification of two anchor points in the Ts versus ET plane (Figure 2). The first anchor point is defined by the spatially averaged daytime surface temperature, <Ts>, and the corresponding regionally representative ET rate, E, from WREVAP. (The original FORTRAN source code can be downloaded from the personal website of the author: snr.unl.edu/ szilagyi/szilagyi.htm). The second anchor point comes from the surface temperature, Tsw, of a completely wet cell and the corresponding wet-environment evaporation, Ew, (defined by the Priestley-Taylor [9] equation with a coefficient value of 1.2). The two points identify the linear transformations of the Ts pixel values into ET rates for each month. The resulting line is extended to the right, since in about half the number of the pixels ET is less than the regional mean, E. A monthly time-step is ideal because most of the watershed- or large-scale hydrologic models work at this time-resolution, plus a monthly averaging further reduces any lingering cloud effect in the 8-day composited Ts values. Wet cells within Nebraska were identified over Lake McConaughy and the Lewis and Clark Lake on the Missouri River (Figure 1). An inverse-distance weighting method was subsequently used to calculate the Tsw value to be assigned to a given MODIS cell for the linear transformation.
media/image2.png
Figure 2.
Schematics of the linear transformation of the MODIS daytime surface temperature values into ET rates (after [1]), applied in CREMAP.
The core assumption of CREMAP is that the surface temperature of any MODIS cell is predominantly defined by the rate of evapotranspiration due to the large value of the latent heat of vaporization for water and that the energy (Qn) available at the surface for sensible (i.e., heat convection) and latent heat (i.e., evapotranspiration) transfers are roughly even among the cells of a flat-to-rolling terrain. Heat conduction into the soil is typically negligible over a 24-hour period, and here considered negligible over the daytime hours as well. This last assumption is most likely true for fully vegetated surfaces where soil heat conduction is small throughout the day, and is less valid for bare soil and open water surfaces. While a spatially constant Qn term at first seems to be an overly stringent requirement in practical applications due to spatial changes in vegetation cover as well as slope and aspect of the land surface, Qn will change only negligibly in space provided the surface albedo (i.e., the ratio of in- and outgoing short-wave radiation) value also changes negligibly among the pixels over a flat or rolling terrain. For the study region, the MODIS pixel size of about 1 km may indeed ensure a largely constant Qn value among the pixels since the observed standard deviation in the mean monthly (warm season) surface albedo value of 17% is only 1.2% among the MODIS cells.
A further assumption of the method is that the vertical gradient of the air temperature near the surface is linearly related to the surface temperature [10, 11], thus sensible heat (H) transfer across the land-atmosphere interface, provided changes in the aerodynamic resistance (ra) among the MODIS pixels are moderate, can also be taken a linear function of Ts. This can be so because under neutral atmospheric conditions (attained for time-steps a day or longer) ra depends linearly on the logarithm of the momentum roughness length, z0m [11], thus any change in z0m between pixels becomes significantly dampened in the ra value due to the logarithm. Consequently, the latent heat (LE) transfer itself becomes a linear function of Ts under a spatially constant net energy (Qn) term required by the CR, therefore Qn = H + LE, from which LE = mTs + c follows, m and c being constants for the computational time step, i.e., a month here, within a region.
8-day composited MODIS daytime surface temperature data were collected over the 2000 – 2009 period. The 8-day composited pixel values were averaged for each month to obtain one surface temperature per pixel per month, except for December, January, and February. The winter months were left out of the linear transformations because then the ground may have patchy snow cover which violates the constant Qn assumption since the albedo of snow is markedly different from that of the land. Therefore in the wintertime the WREVAP-derived regional ET rates were employed without any further disaggregation by surface temperatures but, rather, with a subsequent correction, discussed later.
Mean annual precipitation, mean monthly maximum/minimum air and dew-point temperature values came from the PRISM database [12] at 2.5-min spatial resolution. Mean monthly incident global radiation data at half-degree resolution were downloaded from the GCIP/SRB site [2]. While previously [1] the regions were defined by subdividing the state into eight distinct areas (a largely arbitrary process) for the calculation of the regionally representative values of the mean monthly air temperature, humidity and radiation data, required by WREVAP, now such a subdivision is not necessary. Instead, a “radius of influence” is defined over which the regional values are calculated separately for each designated MODIS cell, very similar to a temporal moving-average process, but now in two dimensions of space. In principle, such a spatial averaging could be performed for each MODIS cell, in practice however, it becomes computationally overwhelming on the PC, and it is also unnecessary, since the spatial averages form a 2-D signal of small gradient, making possible that “sampling” (i.e., the actual calculation of the spatial mean values including the WREVAP-calculated ET rate) is performed only in a selected set of points, which was chosen as each tenth MODIS cell in space (both row-, and column-wise). The remaining cells were then filled up with spatial mean values, linearly interpolated first by row among the selected MODIS-cell values, and then by column, involving the already interpolated values in the rows as well. Near the eastern and southern boundaries of the state any necessary spatial extrapolation was done by the gradient method (i.e., keeping the first two terms of the Taylor-expansion). This “sampling” sped up calculations by at least two orders of magnitude.
Care had to be exercised with the choice of the radius of influence. Rather than applying a constant radius, a spatially changing one was required because near the boundary of the state the “window” becomes asymmetrical around the MODIS cells, therefore the radius changed linearly with distance to these boundaries from a starting value of 25 cells up to a maximum of 125 cells (at a rate of 4/5 cell by each line or column) in the central portion of the domain. It was simpler to define a rectangular region around each designated MODIS cell, rather than a circular one, therefore the radius of influence is half the side-length of the resulting square.
Once the spatial mean values were available for each MODIS cell, the actual linear transformation of the Ts to ET values was performed for each month (except the winter months). The linear transformation of the Ts values into ET rates assumes a negligible change in the ra value among the cells. As was mentioned above, ra is directly proportional –up to a constant and with a negative slope— to the logarithm of z0m under neutral stability conditions of the atmosphere, provided the wind speed at the blending height (about 200 m above the ground) is near constant within the region [11]. The momentum roughness height, z0m, of each MODIS cell has been estimated over the state (Figure 3) with the help of a 1-km digital elevation model, as the natural logarithm of the standard deviation in the elevation values among the 25 neighboring cells surrounding a given cell, including the chosen cell itself. The minimum value of z0m has been set to 0.4 m, so when the estimate became smaller than this lower limit (possible for flat regions), the value was replaced by 0.4 m. Note that the z0m = 0.4 m value is the upper interval value for a “prairie or short crops with scattered bushes and tree clumps” in Table 2.6 of [13]. The rugged hills regions of Nebraska (e.g., the Pine Ridge and the Pine Bluffs, just to name a few) are characterized (Figure 3) by the largest z0m values (larger than 3 m), covering the 3-4 m range for “Fore-Alpine terrain (200-300 m) with scattered tree stands” of [13]. Since the ra estimates are proportional (up to a constant) to the logarithm of the z0m values, their change among the MODIS cells is much subdued: about 67% of the time they are within 5% of their spatial mean and more than 94% of the time they remain within 15% (Figure 4), supporting the original assumption of the present ET mapping method.
Cells that had ra values smaller than 95% of the mean ra value (involved about 20% of all cells) were identified, and the corresponding ET values corrected by the relative change in ra, considering that the sum of the latent (LE) and sensible heat (H) values are assumed to be constant among the cells (equaling Qn) and that H is proportional to dTz / ra [11], where dTz is the vertical gradient of the air temperature above the surface, itself taken proportional to Ts. The reason that only the “overestimates” of ET are corrected is that the linear transformation of the Ts values into ET rates seems to be more sensitive to more rugged-than-average terrain than to smoother one. That is why the most rugged part of Nebraska, i.e., the Pine Ridge, required an additional (to the above) 10% ET adjustment if no Ponderosa Pine was detected in the 3x3-cell region of the land use-land cover map around a given cell, and a 20% cut if it was. The assumption is that in this extremely rugged region cells with other than Ponderosa pine designation, may still contain scattered trees, if in the vicinity there are pine-forested areas plus the air turbulence, enhanced by the rugged terrain, may have a wake with a characteristic length of about a km. Within the Niobrara River Breaks region (less rugged than the Pine Ridge) only a 10% additional ET adjustment was applied without regard if the cell-surroundings are pine-covered or not. The underlying reasons of these deviations may be (after accepting that the PRISM precipitation values are correct) the way z0m is estimated, perhaps a DEM with a finer resolution would yield better results.
Or maybe the type of vegetation, even at a 1-km resolution, has relevance (similar to plot-scale applications), in addition to the primary elevation variance. Or even, due to the enlarged surface area of the rugged terrain, the global radiation value should be reduced, which would lower ET. This topic certainly requires further research.
media/image3.png
Figure 3.
Estimated values of the a) momentum roughness height (z0m), and; b) relative change in the aerodynamic resistance (ra) around the state-wide mean. The numbers along the left and bottom edge of the panels are the MODIS cell numbers.
A final correction was applied for cells of “extreme” elevation. Namely, when the elevation of a cell differed from the regional mean value by more than 100 m, its surface temperature was corrected by 0.01 Kelvin per meter, reflecting the dry-adiabatic cooling rate of the air.
media/image4.png
Figure 4.
Relative histograms of the momentum roughness height (z0m) and the relative change in the aerodynamic resistance (ra) around its spatial mean value [m(ra)] across Nebraska, estimated from a 1-km resolution digital elevation model.
The WREVAP model is based on the complementary relationship [4] which performs the worst in the cold winter months [8, 14, 15], thus the resulting WREVAP-obtained winter ET rates become the most uncertain. A yet unpublished study by the present author, involving the Republican River basin, indicated that inclusion of the winter ET rates of WREVAP improved the mean annual ET estimates in comparison with water balance derived [3, 12] data. Other studies [1, 16] also indicated that WREVAP somewhat overestimates ET rates in the Nebraska Sand Hills region even without inclusion of the winter months. Finally, a water balance based [3, 12] verification of the current ET estimates indicated that the WREVAP-provided winter ET rates are necessary in the most humid eastern, south-eastern part of the state. Based on these comparisons, the WREVAP winter months were fully included in the mean annual ET rates [besides the wettest part of the state, defined by (Psm – ETWREVAP) > 50 mm] for the Republican River basin, and for areas where the mean monthly daytime maximum temperature values exceeded 5 ºC. The latter area almost fully covers the Republican River basin, plus the south and south-western part of the panhandle region. Psm designates the spatially smoothed precipitation values of PRISM, applying a 30-by-30-cell window, to filter out the unrealistic grainy structure of the PRISM precipitation field (Figure 5) due probably to its spatial interpolation method. No winter ET rates were included in the mean annual ET values wherever (Psm – ETWREVAP) < 10 mm; and a 50% reduction of the WREVAP winter ET rates were used for areas where [10 mm < (Psm – ETWREVAP) < 50 mm] held true.
media/image5.jpeg
Figure 5.
Distribution of the mean annual precipitation (mm) values across Nebraska from the PRISM data, 2000-2009. The state-wide mean annual precipitation rate is 577 mm.
3. Results and conclusion
The mean annual ET rates across Nebraska are displayed in Figure 6. By and large, ET follows the distribution of precipitation, as expected. Most of the ET values are between 250-500 mm in the panhandle, around
media/image6.jpeg
Figure 6.
Estimated mean annual ET rates (mm) in Nebraska (2000-2009). The state-wide mean ET value is 549 mm/yr.
500-650 mm in the middle of the state and near 650 mm in the eastern portion of it. Locally, however, there are large differences due to land use and land cover variance. The sizeable reservoirs (McConaughy, Lewis and Clarke, Harlan County, Swanson, Calamus, etc.) large enough to fully accommodate a MODIS cell, display the largest ET rates, around 1000 mm annually. The reservoirs/lakes are followed by the wider rivers (i.e., Platte, Missouri, Loups, Elkhorn, and partly the Republican) and their valleys in ET rates. The reason, beside the presence of the open water surface, is in the relatively small distance to the groundwater table in these river valleys, enabling the root system of the vegetation to tap into it, plus in the accompanying large-scale irrigation within the valleys. The river valleys on the ET scale are followed by areas of intensive irrigation, reaching 750 mm a year. The driest regions, with the smallest rate of ET in eastern Nebraska are the urban areas of Omaha and Lincoln (Figure 1), where the built in surfaces enhance surface runoff. The eastern outline of the Sand Hills is clearly visible, as well as the sandy areas (the elongated green-colored features) between the Loup and the Platte Rivers. The sandy soil, due to its large porosity favors deep percolation of the water often out of reach of the vegetation.
Figure 7 depicts the monthly ET rates from January through December. In July and August the irrigated plots in south-central Nebraska can evaporate as intensively as the open water surfaces. Even in September, when most of the produce has been harvested, the soil through its enhanced moisture due to summer irrigation, evaporates more than the surrounding, non-irrigated land. In November the distribution of ET rates becomes zonal and follows the precipitation distribution.
media/image7.png
Figure 7.
Estimated mean monthly ET rates (mm) in Nebraska., 2000-2009.
While in absolute numbers the south-central portion of the state produces the highest ET rates, the picture changes significantly, when one looks at the ET to precipitation (so-called precipitation recycling) ratios of Figure 8.
media/image8.jpeg
Figure 8.
Estimated mean annual ET to precipitation ratios (%), 2000-2009. The state-wide mean ratio is 95%.
media/image9.png
Figure 9.
Distribution of areas with the largest observed groundwater decline (at least 3 m, to up to 8 m) over the 2000-2009 period, overlain the ET / P map. For the correct color to ratio correspondence, please, use the colors in Figure 8 instead of the current ones.
Lake McConaughy is the clear winner (followed by smaller lakes in the vicinity), evaporating about twice as much as it receives from precipitation. It does not mean, of course, that the other small lakes in the area would not evaporate as much as Lake McConaughy per unit area, they probably evaporate even more (the smaller the lake the larger typically its evaporation rate, provided other environmental factors are equal), but their size inhibits MODIS to detect their surface temperatures without “contamination” from the surrounding land. Note again the eastern outline of the Sand Hills and the elongated sandy areas between the Loup and Platte Rivers as areas of relatively low ET rates. The two urban areas of Omaha and Lincoln are clearly visible again.
Two large irrigated areas stand out clearly as the most intensive water users (relative to precipitation), one in the Republican River basin and the other in the North-Platte River valley of the panhandle. In these areas ET rates significantly exceed (up to 50%) precipitation rates. Another significant irrigated area in Box Butte County (at the western edge of the Sand Hills) plus the one in the Republican River basin coincide largely with regions of extensive groundwater depletions, displayed in Figure 9.
The lines in Figure 9 designate areas (after [17]) where groundwater decline was at least 3, 5, 8 m over the 2000-2009 period. Naturally, in heavily irrigated areas close to major streams (e.g., North- and South Platte, Platte River), such groundwater depletions are absent (but not around Lake McConaughy, where reservoir water levels have been below normal most of 2000-2009) since the chief source of the irrigation water is the stream itself. Figure 10 displays the distribution of irrigated land, overlain the ET / P values.
media/image10.png
Figure 10.
Irrigated land (marked in black) distribution [after 18, 19] in Nebraska, 2005.
As seen in Figure 10, not all land areas with larger than unity ratios are connected to irrigation, good examples are the Sand Hills wetlands. Similarly, not all areas that come up with values larger than 100% do actually evaporate more than they receive from precipitation. Such an area is the table-land just south of the western edge of Lake McConaughy, between the North- and South-Platte Rivers (please, refer to Figure 8 for corresponding precipitation recycling ratios, the colors of Figure 10 are slightly off because it was produced by a different software that enabled marking the irrigated areas on top of the ratios). In this area irrigation is largely absent (or at least it was in 2005, the date of the irrigation data), yet the ratio is between 100-120%. The error may be caused by several factors, namely a) the well-known, often 10% underestimation of precipitation; b) inaccuracy of the ET estimates, and; c) problems with the spatial interpolation of the measured precipitation values. The latter is well demonstrated in Figure 5, which shows that in the southern panhandle region there can be a difference of 125 mm (about 25-30% of the annual value) in the precipitation values within a distance of 30 km or less. Added to this uncertainty is the wide-spread underestimation of precipitation, especially in windy areas where a measurable portion of the raindrops (and especially snowflakes) is swept away from the rain gage. Finally, the present ET estimates have an error term (discussed further later) of about plus/minus (±) 5-10%. Employing a ±5% error in the latter, another -5% underestimation in the measured precipitation values together with yet another independent ±5% error in the interpolated values, the resulting ET / P ratio may contain an error of -5% to 16%, coinciding well with the error extent found in the table-land area. Therefore, the ratios in Figure 8 must be treated with this uncertainty in mind.
A comparison with the previous version [1] of the mean annual ET map (Figure 11) reveals that the largest differences are found in the Republican River basin and the southern panhandle region, where now the full values of the WREVAP-estimated winter-time ET rates were added to the warm-season values (March-November). Note that the procedures used for preparing the two maps are different (application of a radius of influence around each MODIS cell versus distinct geographic regions) as was explained above. The perceptible diagonal and level straight lines suggest some problems with the interpolation method employed in the previous ET map.
media/image11.jpeg
Figure 11.
Differences in the present and previous [1] mean annual ET maps (mm). Mean is 18.5 mm.
Verification of the estimated mean annual ET rates can be best performed on a watershed-by-watershed basis by subtracting the stream discharge values (expressed in mm) from the mean precipitation values of the catchments, assuming that groundwater level changes are negligible over the study period, i.e., 2000-2009. As seen above, the latter is not true in many regions within Nebraska, but a transformation of these groundwater-level changes into water depth values would require the state-wide distribution of the specific yield value (also called drainable porosity, defined by dividing the drained water volume value with that of the control volume, fully saturated with water at the start of drainage) of the water bearing aquifer, a hydro-geological parameter not available for the whole state. Figure 12 displays the water-balance derived ET rates employing the PRISM precipitation values [12] and USGS-derived watershed-representative runoff values [3] for the HUC-8 watersheds within Nebraska, while Figure 13 displays the spatial distribution of estimation error (predicted minus water-balance derived) of the CREMAP ET values among the same catchments. As seen, in the majority of the watersheds the estimation error is within 30 mm of the “observed” value. The largest overestimation takes place for watersheds within the Missouri River basin, within the Sand Hills, and within and just north of the Republican River basin. The latter area corresponds to one of the most severe groundwater depletion regions within the state, where the “missing” water certainly contributes to elevated ET rates, not detectable by the simplified water balance approach.
media/image12.png
Figure 12.
Water balance derived (P – Ro) mean annual ET rates (mm) of the USGS HUC-8 watersheds in Nebraska, 2000-2009.
Note also that a systematic underestimation of the precipitation rates automatically leads to a virtual overestimation of the ET rates by the present method during verification. Another problem with the verification is that the watershed area employed for the transformation of the discharge values into water depth, may also be somewhat uncertain, since the groundwater catchment does not always overlap perfectly with the surface-water catchment delineated by the help of surface elevation values. Probably that is why the largest over- and under-estimation of ET is found within the Sand Hills, in catchments very close to each other. Also, the USGS watershed runoff values employ simplifications that may cause serious errors in the estimated watershed runoff rate, such as found for the Lower Republican basin in Kansas (not shown here), where USGS reports a mean runoff rate of 5 mm/yr for 2000-2009, while a Kansas Geological Survey study [20] found a mean annual runoff rate of 106 mm/yr, an almost twenty-fold difference.
media/image13.png
Figure 13.
Distribution of the estimation error (mm) in the mean annual ET rates among the USGS HUC-8 watersheds within Nebraska, 2000-2009.
Figure 14 summarizes the ET verification results. It can be seen that in the vast majority of the USGS HUC-8 watersheds the estimated values are within 10% of the simplified water balance derived values. Five of the seven overestimates (above the upper intermittent line) of Figure 14, found between 400 and 500 mm, correspond to the large groundwater depletion area in and around the Republican River basin, displayed in Figure 9, so in those cases the CREMAP ET estimates may better represent reality than the simplified water balance derived values. The explained variance, R2, has a value of 0.87, meaning that 87% of the spatial variance found in the HUC-8 water-balance derived ET values is explained by the CREMAP estimates. In summary, the annual and monthly ET maps are recommended for use in future regional-scale water-balance calculations with the resolution and accuracy of the estimates kept in mind. The maps are certainly not recommended for reading off individual cell values, because the exact cell coordinates maybe slightly off due to the geographically referenced data manipulations necessary to produce those maps. For example, the author found some problem with coordinate referencing when cells are extracted from a grid employing another grid with differing cell size. The maps are best suited for studies of spatial scale larger than one km.
media/image14.png
Figure 14.
14. Regression plot of the water-balance derived and CREMAP-estimated mean annual ET rates (mm) among the USGS HUC-8 catchments. R2 is the portion of the spatial variance of the water balance ET rates that is explained by the CREMAP estimates. The upper and lower envelope lines designate the P – Ro value plus or minus 10%.
Acknowledgements
This work has been supported by the Hungarian Scientific Research Fund (OTKA, #83376) and the Agricultural Research Division of the University of Nebraska. This work is connected to the scientific program of the "Development of quality-oriented and harmonized R+D+I strategy and functional model at BME" project. This project is supported by the New Szechenyi Plan (Project ID: TAMOP-4.2.1/B-09/1/KMR-2010-0002).
Disclaimer: The views, conclusions, and opinions expressed in this study are solely those of the writer and not the University of Nebraska, state of Nebraska, or any political subdivision thereof.
References
1 - J. Szilagyi, A. Kovacs, J. Jozsa, 2011 A calibration-free evapotranspiration mapping (CREMAP) technique. In: Labedzki L. (ed.) Evapotranspiration. Rijeka: InTech 257 274Available from http://www.intechopen.com/books/show/title/evapotranspiration (accessed 28 June 2012).
2 - GEWEX Continental Scale International Project 2012 Surface Radiation Budget GCIP-SRB. http://metosrv2.umd.edu/~srb/gcip/cgi-bin/historic.cgiaccessed 28 June).
3 - United States Geological Survey, USGS. 2012 Computed runoff. http://waterwatch.usgs.gov/new/accessed 28 June).
4 - R. J. Bouchet, 1963 Evapotranspiration reelle, evapotranspiration potentielle, et production agricole. Annales Agronomique 14 543 824
5 - W. Brutsaert, H. Stricker, 1979 An Advection-Aridity approach to estimate actual regional evapotranspiration Water Resources Research 15 443 449
6 - F. Morton, F. Ricard, S. Fogarasi, 1985 Operational estimates of areal evapotranspiration and lake evaporation- Program WREVAP. National Hydrological Research Institute (Ottawa, Canada) Paper 24
7 - National Aeronautics and Space Administration. 2012 Moderate Resolution Imaging Spectroradiometer MODIS data. http://modis.gsfc.nasa.govaccessed 28 June).
8 - J. Szilagyi, J. Jozsa, 2009 Estimating spatially distributed monthly evapotranspiration rates by linear transformations of MODIS daytime land surface temperature data Hydrology and Earth System Science 13 5 629 637
9 - C. Priestley, R. Taylor, 1972 On the assessment of surface heat flux and evaporation using large-scale parameters. Monthly Weather Review 100 81 92
10 - W. Bastiaanssen, M. Menenti, R. Feddes, A. Holtslag, 1998 A remote sensing surface energy balance algorithm for land (SEBAL): 1. Formulation. Journal of Hydrology 212 198 212
11 - R. Allen, M. Tasumi, R. Trezza, 2007 Satellite-based energy balance for mapping evapotranspiration with internalized calibration (METRIC)-model. Journal of Irrigation and Drainage Engineering 133 4 380 394
12 - C. Daly, R. P. Neilson, D. L. Phillips, 1994 A statistical-topographic model for mapping climatological precipitation over mountainous terrain Journal of Applied Meteorology 33 140 158Available from www.prism.oregonstate.eduaccessed 28 June 2012).
13 - W. Brutsaert, 2005 Hydrology: An Introduction. Cambridge University Press, Cambridge, United Kingdom
14 - J. Huntington, J. Szilagyi, S. Tyler, G. Pohll, 2011 Evaluating the Complementary Relationship for estimating evapotranspiration from arid shrublands Water Resources Research 47 W05533
15 - J. Szilagyi, M. Hobbins, J. Jozsa, 2009 A modified Advection-Aridity model of evapotranspiration Journal of Hydrologic Engineering 14 6 569 574
16 - J. Szilagyi, V. Zlotnik, J. Gates, J. Jozsa, 2011 Mapping mean annual groundwater recharge in the Nebraska Sand Hills, USA Hydrogeology Journal 19 8 1503 1513
17 - J. Korus, M. Burbach, L. Howard, 2012 Groundwater-level changes in Nebraska- Spring 2000 to Spring 2010. Conservation and Survey Division, School of Natural Resources, University of Nebraska-Lincoln. http://snr.unl.edu/csdaccessed 26 June).
18 - P. Dappen, I. Ratcliffe, C. Robbins, J. Merchant, 2012 Map of 2005 Center Pivots of Nebraska. University of Nebraska- Lincoln http://www.calmit.unl.edu/2005landusestatewide.shtml (accessed 12 June).
19 - P. Dappen, I. Ratcliffe, C. Robbins, J. Merchant, 2012 Map of 2005 Land Use of Nebraska. University of Nebraska- Lincoln http://www.calmit.unl.edu/2005landuse/statewide.shtml (accessed 12 June).
20 - M. Sophocleous, 2009 Aquifer storage and recovery and the Lower Republican River valley, Kansas. KGS open file report-18, Lawrence, Kansas.
|
__label__pos
| 0.528201 |
ExistsQueryBuilder NAME must be provided with a field – How to solve this Elasticsearch exception
Opster Team
August-23, Version: 6.8-8.9
Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.
Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.
Briefly, this error occurs when an Elasticsearch query is executed without specifying a field in the ExistsQueryBuilder. The ExistsQueryBuilder is used to check if a field exists in the document. The error indicates that the field parameter is missing in the query. To resolve this issue, ensure that you provide a field name when using the ExistsQueryBuilder. For example, if you want to check if a field named ‘user’ exists, your query should look like this: new ExistsQueryBuilder(“user”).
For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.
This guide will help you check for common problems that cause the log ” [” + ExistsQueryBuilder.NAME + “] must be provided with a [field] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: query, index.
Log Context
Log “[” + ExistsQueryBuilder.NAME + “] must be provided with a [field]” class name is ExistsQueryBuilder.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
);
}
} if (fieldPattern == null) {
throw new ParsingException(parser.getTokenLocation(); "[" + ExistsQueryBuilder.NAME + "] must be provided with a [field]");
} ExistsQueryBuilder builder = new ExistsQueryBuilder(fieldPattern);
builder.queryName(queryName);
builder.boost(boost);
How helpful was this guide?
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?
Get expert answers on Elasticsearch/OpenSearch
|
__label__pos
| 0.992525 |
EMAIL THIS PAGE TO A FRIEND
PloS one
SHP-2 Mediates Cryptosporidium parvum Infectivity in Human Intestinal Epithelial Cells.
PMID 26556238
Abstract
The parasite, Cryptosporidium parvum, induces human gastroenteritis through infection of host epithelial cells in the small intestine. During the initial stage of infection, C. parvum is reported to engage host mechanisms at the host cell-parasite interface to form a parasitophorous vacuole. We determined that upon infection, the larger molecular weight proteins in human small intestinal epithelial host cells (FHs 74 Int) appeared to globally undergo tyrosine dephosphorylation. In parallel, expression of the cytoplasmic protein tyrosine phosphatase Src homology-2 domain-containing phosphatase 2 (SHP-2) increased in a time-dependent manner. SHP-2 co-localized with the C. parvum sporozoite and this interaction increased the rate of C. parvum infectivity through SH2-mediated SHP-2 activity. Furthermore, we show that one potential target that SHP-2 acts upon is the focal adhesion protein, paxillin, which undergoes moderate dephosphorylation following infection, with inhibition of SHP-2 rescuing paxillin phosphorylation. Importantly, treatment with an inhibitor to SHP-2 and with an inhibitor to paxillin and Src family kinases, effectively decreased the multiplicity of C. parvum infection in a dose-dependent manner. Thus, our study reveals an important role for SHP-2 in the pathogenesis of C. parvum. Furthermore, while host proteins can be recruited to participate in the development of the electron dense band at the host cell-parasite interface, our study implies for the first time that SHP-2 appears to be recruited by the C. parvum sporozoite to regulate infectivity. Taken together, these findings suggest that SHP-2 and its down-stream target paxillin could serve as targets for intervention.
|
__label__pos
| 0.746685 |
Asymmetry In Structural Response of Inner and Outer Transmembrane Segments of CorA Protein By a Coarse-Grain Model
Document Type
Article
Publication Date
10-3-2016
Department
Physics and Astronomy
School
Mathematics and Natural Sciences
Abstract
Structure of CorA protein and its inner (i.corA) and outer (o.corA) transmembrane (TM) components are investigated as a function of temperature by a coarse-grained Monte Carlo simulation. Thermal response of i.corA is found to differ considerably from that of the outer component, o.corA. Analysis of the radius of gyration reveals that the inner TM component undergoes a continuous transition from a globular conformation to a random coil structure on raising the temperature. In contrast, the outer transmembrane component exhibits an abrupt (nearly discontinuous) thermal response in a narrow range of temperature. Scaling of the structure factor shows a globular structure of i.corA at a low temperature with an effective dimension D ∼ 3 and a random coil at a high temperature with D ∼ 2. The residue distribution in o.corA is slightly sparser than that of i.corA in a narrow thermos-responsive regime. The difference in thermos-response characteristics of these components (i.corA and o.corA) may reflect their unique transmembrane functions.
Publication Title
The Journal of Chemical Physics
Volume
145
Issue
13
Find in your library
Share
COinS
|
__label__pos
| 0.736368 |
Ozeki 10
Arduino Arduino | Ardunio Mega Ardunio Mega
How to use an Ardiuno Analog Sensor
The following guide provides you some useful information about Arduino analog sensor (also known as Potentiometer). This sensor can be used to adjust the brightness or the blinking rate of an LED. This document also ensures a step by step guide about how you can easily manage the analog sensor from your computer by using Ozeki 10. So, let's get started with the basic definitions.
What is an Arduino analog sensor?
The Arduino analog sensor can be also called as potentiometer. This sensor is just a simple knob that can be directly connected to your Arduino. The sensor provides a variable resistance that the Arduino board can handle as an analog value. With this value, the board can adjust, for example, the brightness value of a connected LED.
How to use an Arduino analog sensor?
To use the analog sensor, first of all, you need to connect three wire to the Arduino board. The first one goes from one of the outer pins of the analog sensor to ground (Gnd). The second wire goes from the other outer pin to the 5 volts (5V). The third one needs to be connected to the analog input 0 from the middle pin of the analog sensor.
As we turn the shaft of the analog sensor, it changes the resistance on either side of the wiper which is connected to the middle pin of the potentiometer. The board reads the adjusted resistance and converts it to an analog value. This value is a number between 0 and 1023 which represents how much resistance is on the wiper between 0 and 5 volts.
Arduino analog sensor wiring diagram
wiring diagram of arduino potentiometer
Figure 1 - Wiring diagram of Arduino analog sensor
How to use an Arduino Analog Sensor in Ozeki
With Ozeki Analog Sensor devices you can read analog pins of the Ozeki Analog Sensor or any Arduino module. Each device can handle a single pin. Analog pins can get integer values from 0 to 1023. These values can change to either direction. To prevent reading insignificant changes you can set a threshold of the Ozeki Analog Sensor device. To use the Analog sensor in Ozeki, you first need to download Ozeki Robot Developer. Ozeki Robot Developer will install the Arduino libraries needed to use this sensor efficiently.
Download Ozeki Robot Developer
Download Ozeki Robot Developer
After Ozeki Robot developer is installed, you need to upload the Analog sensor control code to your Arduino. You can find the code and download instructions on the following pages. The upload process includes two steps: first you need to format the EEPROM of the arduino, then you need to upload the control code. The procedure is very simple, it only takes a few seconds.
Upload the Analog sensor code to Arduino Uno
Upload the Analog sensor code to Arduino Mega 2560
Upload the Analog sensor code to Arduino Nano
Upload the Analog sensor code to Ozeki Matrix
The arduino sensors and Ozeki will communicate over the USB port using the Ozeki Analog sensor protocol. This protocol makes it possible for you to use the sensor directly on your PC. You will be able to control this sensor through the web based user interface or you will be able to communicate with it using Ozeki Chat. You can read more about chat control on the following page.
How to communicate with the Analog sensor using chat
It is important to understand chat control, because when you build a robot, the way you wish to control this sensor is by sending and receiving messages. If you open the Ozeki Robot Developer app, you will see, who you can write a C#.Net program to work with this sensor.
Connection steps
1. Connect the Analog sensor to your Arduino using the wiring diagram
2. Plug the Arduino board into your computer
3. Check the COM ports to make sure your Arduino is connected
4. Open the Arduino application on your computer
5. Upload example code to the Arduino
6. Open https://localhost:9515 in your browser
7. Select the connection of Analog sensor
8. Click 'Measure' to get data from the sensor
System overview
The system we suggest consists of an analog sensor, that is wired to the analog port of your Arduino. The Arduino will be responsible for reading data from this sensor in real-time. The brain of the system will be running on a PC (Figure 2). On the PC, Ozeki 10 will be able to manage the communication. You can easily run Ozeki 10 using a webbrowser.
analog sensor to pc using arduino
Figure 2 - System architecture of an analog sensor connecting to PC using Arduino
Videos below will show you how to wire your Analog Sensor (e.g. potentiometer). It is advised to read measurements with your Ozeki Software as you can see in the last video. Finally, you can store the sensor data in any SQL database (Figure 1).
Prerequisites
• Analog sensor (e.g. potentiometer)
• Programmable board (Arduino Mega/Nano/Uno, Ozeki Analog Module)
• Ozeki 10 installed on your computer
• USB cable between the board and your computer
Step 1 - Wire the analog sensor to your Arduino
You can see how to wire the analog sensor (such as potentiometer)
to any of the following boards:
After wiring, please plug the board to your computer!
Step 2 - Upload the code to the Arduino
(Here is the code to upload)
Step 3 - Start Ozeki 10 to test the analog sensor
Step 4 - Configure your analog sensor in Ozeki 10
In order to configure your analog sensor (attached to your Arduino) in Ozeki 10, that is installed on your computer, you need to open the graphical user interface (GUI) of Ozeki 10. You can open the GUI by entering the URL of the computer into your webbrowser. For example, if our PC has an IP address of 192.168.1.5, we would enter http://192.168.1.5:9513 into our webbrowser.
Step 5 - Understand the analog sensor protocol
The Analog Sensor can communicate with Ozeki through the following protocol.
References:
https://www.arduino.cc
Copyright © 2000- - Ozeki Ltd | [email protected]
Home > Products > Ozeki 10 > Connections > Arduino > Analog Sensor
Legal | Privacy | Terms of use | 2974
18.204.229.70 | 92.118.27.157 | Login
|
__label__pos
| 0.877155 |
Category:
What are Wetting Agents?
Article Details
• Written By: Victoria Blackburn
• Edited By: Bronwyn Harris
• Last Modified Date: 04 February 2017
• Copyright Protected:
2003-2017
Conjecture Corporation
• Print this Article
Free Widgets for your Site/Blog
At age 12, Muhammad Ali told a police officer he wanted to beat up a bike thief, so the officer trained him to box. more...
February 24 , 1582 : The Gregorian calendar reforms took place. more...
A wetting agent is a chemical compound that reduces the surface tension of a liquid. The surface tension of a liquid is the tendency of the molecules of a liquid to bond together and is determined by the strength of the bonds between the liquid’s molecules. A wetting agent stretches these bonds and decreases the tendency of molecules to hold together, which allows the liquid to spread more easily across any solid surface.
A wetting agent can also be known as a surfactant, which is a type of chemical that alters the properties of liquids, because it causes changes to the surface tension of the liquid. Surfactants can also contain dispersants, which are chemicals that separate oil and water, and emulsifiers, which combine oily liquids with water. Wetting agents can be made up a variety of chemicals, all of which have this tension-lowering effect.
Ad
When the wetting agent is applied, it causes the liquid to create particles called micelles, which allow the penetration of the solid by the liquid. Micelles are made up of molecules that attract water and molecules that repel water. In water, the micelles assemble in a large cluster where the water-attracting molecules form a ring with the water-repelling molecules in the center. When the wetting agent is used in oily liquids, the structure of this micelle is reversed as the water-repelling molecules are on the outside of the ring because they are attracted to the oily liquid and the water-attracting molecules are repelled by the oily liquid.
Most people come into contact with wetting agents regularly, as many are for personal use. Others, which are not meant for personal use, can have much harsher chemical compounds in them. Wetting agents are used in a number of cleaning products, such as detergents, shampoos, conditioners and soaps, which are typically used with water. These chemical compounds are very useful in decreasing surface tension of water and spreading the water over the solid surfaces that it comes into contact with, such as clothing, skin and hair.
Some wetting agents are actually used inside the human body. Laxatives are just one example of a wetting agent used internally. Since dehydration of the intestinal tract can often cause constipation, adding a wetting agent can help solve this problem by applying water to the impacted intestinal material. Toothpaste can also contain wetting agents, although swallowing toothpaste is generally not recommended.
Harsher chemical compound examples of wetting agents may include pesticides, herbicides and insecticides. Wetting agents are used in these products to allow the other harmful chemical agents in these products to penetrate the solid they are applied to. This type of chemical liquid application is also used in paint to decrease its surface tension so it applies more easily to the solid surface being painted.
Ad
You might also Like
Recommended
Discuss this Article
Denha
Post 1
Those internal wetting agents mentioned here can also have the opposite side effect, if you use too much; they can leave you horribly dehydrated if you use too many laxatives or other products, unbalancing your body all over again.
Post your comments
Post Anonymously
Login
username
password
forgot password?
Register
username
password
confirm
email
|
__label__pos
| 0.936137 |
Вопрос: Проверка подлинности mvc windows позволяет всем пользователям из домена
У меня есть приложение mvc intranet, использующее проверку подлинности Windows. В настоящее время он имеет один контроллер с тремя действиями.
Первое действие (индекс) должно быть доступно всем, это не проблема. Второе и третье действия должны быть доступны только пользователям в DOMAIN. Тем не менее <Authorize()> tag дает мне только 2 варианта: Роли или Пользователи. Я попытался использовать пользователей и установил его в DOMAIN * и DOMAIN \? но это не работает.
Я искал по всему Интернету, но, похоже, не могу найти способ сделать то, что хочу. Я надеюсь, что кто-то здесь поможет мне!
Спасибо
3
источник
Ответы:
использование DOMAIN\Domain Users как имя роли. Его встроенная группа, содержащая, как вы догадались, все пользователи в домене.
10
Добавляя к тому, что упоминалось в jrummel, украсьте свой контроллер или действие следующим:
[Authorize(Roles = "DOMAIN\Domain Users")]
Это позволит пользователям только в определенной роли (в этом могут пользователи определенного домена) получить доступ к контроллеру / действию (в зависимости от того, что вы украшаете). Кроме того, вы можете создать свой собственный атрибут авторизации для доменов:
/// <summary>
/// Specified which domains a user should belong to in order to access the decorated
/// controller/action
/// </summary>
public class DomainAuthorizeAttribute : AuthorizeAttribute
{
private String[] domains = new String[0];
/// <summary>
/// List of acceptable domains
/// </summary>
public String[] Domains
{
get { return this.domains; }
set { this.domains = value; }
}
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
if (httpContext == null)
{
throw new ArgumentNullException("httpContext");
}
// User not logged in
if (!httpContext.User.Identity.IsAuthenticated)
{
return false;
}
// No roles to check against
if (this.Domains.Length == 0)
{
return true;
}
// check if they're on any of the domains specified
String[] roles = this.Domains.Select(d => String.Format(@"{0}\Domain Users", d)).ToArray();
if (roles.Any(httpContext.User.IsInRole))
{
return true;
}
return false;
}
}
Что-то вроде этого должно позволить вам сделать:
[DomainAuthorize(Domains = new[]{ "DOMAIN1", "DOMAIN2" })]
5
Для заинтересованных людей, вот версия VB приведенного выше фрагмента кода:
''' <summary>
''' Specified which domains a user should belong to in order to access the decorated
''' controller/action
''' </summary>
Public Class DomainAuthorizeAttribute
Inherits AuthorizeAttribute
Private m_domains As [String]() = New [String](-1) {}
''' <summary>
''' List of acceptable domains
''' </summary>
Public Property Domains() As [String]()
Get
Return Me.m_domains
End Get
Set(value As [String]())
Me.m_domains = value
End Set
End Property
Protected Overrides Function AuthorizeCore(httpContext As HttpContextBase) As Boolean
If httpContext Is Nothing Then
Throw New ArgumentNullException("httpContext")
End If
' User not logged in
If Not httpContext.User.Identity.IsAuthenticated Then
Return False
End If
' No roles to check against
If Me.Domains.Length = 0 Then
Return True
End If
' check if they're on any of the domains specified
Dim roles As [String]() = Me.Domains.[Select](Function(d) [String].Format("{0}\Domain Users", d)).ToArray()
For Each r In roles
If httpContext.User.IsInRole(r) Then
Return True
End If
Next
Return False
End Function
End Class
Надеюсь, это будет полезно для кого-то! (Весь кредит принадлежит Брэду Кристи)
2
|
__label__pos
| 0.977404 |
Article Text
Download PDFPDF
PTH-116 Time to Achieve Competency in Lower Gastrointestinal Polypectomy in The United Kingdom, A Retrospective Analysis
1. A Rajendran1,2,
2. S Thomas-Gibson3,4,
3. P Bassett5,
4. P Dunckley6,
5. N Sevdalis2,
6. A Haycock1,4
1. 1Gastroenterology, St Mark’s Hospital, Harrow
2. 2King’s College, London
3. 3Gastroenterology, St Mark’s Hospital, Harrow, London
4. 4Imperial College, London
5. 5St Mark’s Hospital, Harrow
6. 6Gastroenterology, Gloucester Royal Hospital, Gloucester, UK
Abstract
Introduction Directly Observed Polypectomy Skills (DOPyS) is a validated tool used to assess polypectomy skills in the UK. The overall competency for polypectomy is graded on a scale of 1 to 4 and is used to certify trainees for level 1 polypectomy (size < 1 cm) & level 2 polypectomy (size 1–2 cm). Trainees are certified as competent if they achieve grades 3 or 4 for more than 90% of their last 4 consecutive DOPyS. We aimed to analyse time required for a trainee to progress from DOPyS score 1 to 4
Methods Retrospective data from the e-portfolio of 707 (4965 DOPyS) trainees from Jan 2009 to Sept 2015 was examined. A dataset of 24 trainees who had documented DOPyS overall score of 1 (CS1), 2 (CS2), 3 (CS3) and 4 (CS4) was recovered. For the purpose of the analysis only those trainees (n = 8) who started out at CS1 were included. 16 were excluded from analysis as they started at a higher level. Primary outcome was number of days taken by each trainee to reach the competency levels (i.e. CS2, CS3 and CS4). The proportion of trainees reaching each level was examined using Kaplan-Meier analysis to show the proportion reaching this level over time. Time taken for 25%, 50% and 75% of trainees to reach the desired level was calculated.
Results Table shows time taken for 25%, 50% and 75% of trainees to reach each of the levels. The results show 50% reach CS2 after 91 days and CS3 after 112 days. It took 191 days for half of trainees to reach level CS4.
Abstract PTH-116 Table 1
Conclusion 75% of trainees analysed reach an overall competency of 4 in 324 days.
In the UK DOPyS score 3 or 4 are required to start applying for provisional/full certification and in our cohort 75% of trainees analysed achieved it in a time frame of 6 months to a year. Further prospective studies analysing time taken, procedure numbers & associated factors are needed to assess the learning curve for polypectomy & implement changes to improve efficiency in training
Limitation The retrospective data and the small numbers are the limitations of the study
Disclosure of Interest None Declared
Statistics from Altmetric.com
Request Permissions
If you wish to reuse any or all of this article please use the link below which will take you to the Copyright Clearance Center’s RightsLink service. You will be able to get a quick price and instant permission to reuse the content in many different ways.
|
__label__pos
| 0.879866 |
What Muscles Do Overhead Squats Work?
Have you heard the Overhead Squat is one of the best movements you can do to improve athletic performance?
And looking at the complex movement of the Overhead Squat you also might have asked yourself is What muscles do Overhead Squats work?
The article and video discusses
Do you like the Overhead Squat? If you are like most people and athletes you probably don’t like the Overhead Squats and you have asked yourself What Is The Overhead Squat Good For?
Another common question I receive is: What muscles do the Overhead Squats work?
When I hear the question of ‘What are the Overhead Squat muscles worked’ I immediately think about the quote ‘train movements, not muscles’. This quote or phrase encapsulates the idea of how I preferably think about strength training and strength training priorities.
Much rather than the typical bodybuilding style of training, where muscles are trained in isolation, my priority is to make the make different muscle groups work together more effectively and efficiently. That is essentially what sport is about.
Don’t get me wrong, there is nothing wrong with bodybuilding, it’s simply a different training goal.
Strength training is a means to an end (the ultimate goal of the training), for me and my work the end is improving and maximizing sports performance, for bodybuilding, it’s maximizing muscle growth and size.
What movements do Overhead Squats work?
As I have outlined previously, there are 7 fundamental movements and the application of fundamental movements in the article
And the squatting pattern is one of these fundamental movements. I have explained how just by improving your squatting technique you can see an increase in the weight you are able to use in a Back Squat and Front Squat
The Overhead Squat is one of the best movements to work on squatting technique and the actual squatting movement pattern, which will ultimately lead to a better Back Squat technique and Front Squat technique.
Check out the example below, how the Overhead Squat requires Track Cyclist Steffie van der Peet to maintain proper alignment and good squatting technique.
https://www.instagram.com/p/BZq8yB-hAG6
The simple reason is, that the Overhead Squat ‘forces’ you to squat correctly. A small deviation of the movement will result in losing the bar to the front or to the back.
For more Overhead Squat benefits, check out the article
What Muscle Groups do Overhead Squats work?
For the simple reason of having the weight right over your head and you squatting while stabilizing that weight over your head, the Overhead Squat works every muscle group from head to toe.
Stabilizing the weight overhead requires the muscle groups of the shoulder girdle and the shoulder stabilizers to work extremely hard. The more of an experienced squatter you are, the more you will experience that the strength of your upper body and the shoulder girdle, in particular, will be the limiting factor in the Overhead Squat.
In plain words, your lower body will be able to squat much more, than your upper body can carry.
Additionally, the execution of the Overhead Squat requires the trunk to be stable and to work very hard to stabilize the weight overhead. Conversely to common practices of training the trunk in a horizontal position, the Overhead Squat trains the trunk in a vertical position and enhances the vertical stability. This vertical stability has more carryover to sports performance since most sporting activities are done in a vertical position (you are standing on your feet), than in a horizontal position, where you lie on your stomach or back (there are always exceptions to the rule). Also, check out the article Science Compares The Back Squat To The Overhead Squat from Breaking Muscle that discusses a stronger trunk activation in an Overhead Squat, compared to the Back Squat.
The Overhead Squat does not only require muscle groups to be strong and stable, it also requires some muscle groups to be flexible and mobile in order to perform an Overhead Squat. Check out the article The Overhead Squat: What Is It Good For? from Bodybuilding.com that discusses the topic of mobility and stability in detail.
This is the reason, why the Overhead Squat is also used as an assessment tool in rehabilitation. In order to perform the Overhead Squat correctly, you need to have sufficient mobility I the shoulder girdle, mainly the thoracic spine, hip and lower back and ankle.
What do Overhead Squats not work?
After all the praises on the Overhead Squat and what it can do for you, it looks like the Overhead Squat is the magic bullet, the holy grail that everyone is looking for.
Not really, if you are interested in building strength or size in the lower body the Overhead Squat is not the best squatting variation to choose for.
I mentioned earlier, that in most cases the lower body is able to handle much more weight, that the upper body is able to support overhead. Consequently, the upper body is the weakest link and if you want to maximize strength or size in your lower body you wouldn’t be able to set an appropriate stimulus for that with the Overhead Squat.
The Overhead Squat improves Squatting technique, which allows you to set a stimulus more effectively with the Back Squat or Front Squat, but not directly set an appropriate stimulus with Overhead squatting itself.
Concluding What Muscles Do The Overhead Squats Work?
The Overhead Squat is one of the best exercises to improve squatting mechanics and will lead to improvements in your Back Squat technique or Front Squat technique.
What are the most important Overhead Squat muscles?
The Overhead Squat requires a strong shoulder girdle to support the weight overhead and a strong and stable trunk to vertically stabilize the weight while squatting.
The Overhead Squat requires a mobile and flexible thoracic spine, hip and lower back and ankles.
Never Miss An Update
Enter your best email to get the best weekly content delivered right into your inbox
Subscribe
Never miss an update
|
__label__pos
| 0.908979 |
Wei-ping Liu
Zhejiang University of Technology, Hang-hsien, Zhejiang Sheng, China
Are you Wei-ping Liu?
Claim your profile
Publications (29)30.35 Total impact
• Source
[Show abstract] [Hide abstract]
ABSTRACT: The enantioselective interaction between penicillium expansum alkaline lipase and chiral phenoxypropionic acid herbicide dichlorprop was studied by using UV differential spectrophotometry and fluorescence spectrophotometry in the presence of a pH 8, phosphate buffer solution. Chiral differences in the UV absorption and fluorescence spectra of lipase with dichlorprop were detected. (R)-Dichlorprop interacted the strongest with lipase as measured by both UV absorption and fluorescence spectrophotometry, followed by (Rac)-dichlorprop, while (S)-dichlorprop had the weakest interaction. The hydrophobic interaction seem to play the dominant role in the interactions and the (R)-enantiomer needed the minimum put of energy to drive the endothermic reaction, while the Rac-type and S-type compounds needed more for the reaction to take place. In the meantime, the catalytic hydrolysis of FDA with lipase show that (R)-DCPP could inhibit lipase the most strongly relatively at the same condition, perhaps because (R)-DCPP had a stronger combining effect and high enantiomeric selectivity on lipase than (Rac)-DCPP and (S)-DCPP.
Chirality 07/2008; 21(3):396-401. · 1.72 Impact Factor
• Wei-Ping Liu, Jing Ye, An-Ping Zhang
[Show abstract] [Hide abstract]
ABSTRACT: There exists a close relationship between plants and chiral compounds. On one hand, plants can secrete and synthesize some chiral compounds such as glucosides, enzymes, terpenoids, organic acids and phytohormones that play important roles in plant physiological and biochemical processes, and on the other hand, artificial synthetic chiral compounds, especially pesticides, had enantioselective interactions with plants. The pesticides can enantioselectively inhibit the growth of plants, or can be enantioselectively absorbed and metabolized by plants. Therefore, in the exploitation, production and application of chiral compounds, it's needed to consider the enantioselective interaction between plants and chiral compounds. In the meanwhile, choosing appropriate plants to ameliorate the environment polluted by chiral compounds is of practical significance. In this review, the enantioselective interaction between plants and chiral compounds was summarized, and the amelioration of chiral compounds-polluted environment by plants was prospected.
Ying yong sheng tai xue bao = The journal of applied ecology / Zhongguo sheng tai xue xue hui, Zhongguo ke xue yuan Shenyang ying yong sheng tai yan jiu suo zhu ban 03/2008; 19(2):441-8.
• Source
[Show abstract] [Hide abstract]
ABSTRACT: Comparative study on the activity and kinectic properties of acid phosphatase (ACPase) of three soils amended with Hg and Cu at constant temperature and humidity was carried out. The results indicated that the inhibition on ACPase of the three sample soils by Hg and Cu varied with the content of soil organic matter and pH, where, Soil 1 was the most seriously contaminated due to its lowest content of organic matter and the lowest pH among three samples, Soil 2 took the second place, and Soil 3 was the least contaminated. Except Soil 3, the activity of soil ACPase tended to increase along with the contact time under the same type and the same concentration of heavy metal. In particular the V max values of ACPase in all three samples decreased with increasing Hg and Cu concentration, whereas the K m values were affected weakly. According to the change of V max and K m values, Cu and Hg had the same inhibition effect on soil ACPase. Both of them may be a type of compound of non-competitive and anti-competitive inhibition. Statistic analyses indicated that activities of soil ACPase and V max values could serve as bioindicator to partially denote the heavy metal Hg and Cu contamination degree.
Journal of Zhejiang University - Science A: Applied Physics & Engineering 01/2007; 8(7):1157-1163. · 0.53 Impact Factor
• An-ping Zhang, Fan Luo, Wei-ping Liu
[Show abstract] [Hide abstract]
ABSTRACT: The supramolecular complexes of fenoxaprop-p-ethyl and various cyclodextrins (beta-CD, HP-beta-CD, RAMEB) were studied by UV spectra technique. The results showed that all cyclodextrins could form 1:1 inclusion complexes with fenoxaprop-p-ethyl in ethanol-water (the volume ratio of ethanol to water was 1 : 4), and the binding constants of the three types of cyclodextrins toward fenoxaprop-p-ethyl were in the order of KRAEB>KHP-beta-CD>Kbeta-CD. Between 298. 15 and 318. 15 K, the binding constants decreased with temperature increasing. The Gibbs free energy deltaG, enthalpy change deltaH, and entropy change deltaS determined were all negative, suggesting that the inclusion complexation is exothermic and can spontaneously occur by the balance of enthalpy driving and entropy opposing.
Guang pu xue yu guang pu fen xi = Guang pu 01/2007; 26(12):2298-301. · 0.29 Impact Factor
• [Show abstract] [Hide abstract]
ABSTRACT: The enantiomers of napropamide were separated by normal phase HPLC (HPLC: high performance liquid Chromatography) with Chiralpak OJ-H column and charactered by circular dichroism. On this basis, a method for the chiral separation and micro-determination of napropamide in water was established. The linearity of calibration curve for racemic mixture was 10-100 ng x mL(-1) and the correlation coefficient was 0. 99. When 10 microL was injected, the detection limit of racemic mixture was 8 ng mL(-1), and the detection limits of both enantiomers were 4 ng x mL(-1).
Guang pu xue yu guang pu fen xi = Guang pu 10/2006; 26(9):1649-52. · 0.29 Impact Factor
• [Show abstract] [Hide abstract]
ABSTRACT: The racemic product of metolachlor contains two R-enantiomers and two S-enantiomers. S-Metolachlor is a more effective herbicidal agent than rac-metolachlor; currently, it is widely used instead of rac-metolachlor. The comparative toxicity of rac- and S-metolachlor was assessed on the basis of their effects on some enzyme activities of the fifth instar of the silkworm, Bombyx mori L. These results suggest that rac-metolachlor and S-metolachlor have different effects on enzyme activities of fifth-instar silkworm larvae. Hemolymph lactate dehydrogenase and catalase activity levels in silkworms treated with rac-metolachlor were much lower than those in silkworms treated with S-metolachlor. Control hemolymph ACP activity was 44–73% higher than that of rac-metolachlor-treated hemolymph, but the difference was not large between S-metolachlor treatment and the control. Midgut alkaline phosphatase activity of silkworms treated with rac-metolachlor was 46% lower than control activity, and the effect of S-metolachlor on midgut alkaline phosphatase activity was minor. The difference between the two herbicides was apparent mainly during the first 5 days of the fifth instar, and then gradually disappeared. It is shown that compared with S-metolachlor, rac-metolachlor is more toxic to economically important silkworms because of its effects on some enzymes and on metabolism.
Pesticide Biochemistry and Physiology. 07/2006;
• [Show abstract] [Hide abstract]
ABSTRACT: Cyclodextrins (CDs), with hydrophobic interior cavity and hydrophilic external surface, are capable of accelerating or inhibiting chemical degradation of organophosphorus pesticides through forming inclusion complexes between CDs and pesticides. This work evaluated the effects of CDs on hydrolysis of malathion in an attempt to assess their potential application in environmental approach. beta-CD and its two derivatives, randomly methylated beta-CD (RAMEB) and hydroxypropyl beta-CD (HP-beta-CD), were tested. It was found that RAMEB could inhibit the hydrolysis of malathion, and this was the function of pH and temperature, the inhibitory effects increase with increasing concentration of RAMEB and elevating temperature between 15 and 35 degrees C. On the other hand, beta-CD and HP-beta-CD have little or no stabilizing effects on malathion at all pH and temperature studied, except that the large concentration of beta-CD and HP-beta-CD can mildly reduce hydrolysis of malathion. Both 2 mol/L and 5 mol/L urea increase the inhibitory effects of RAMEB on hydrolysis of malathion at 25 degrees C, pH 9.0.
Journal of Environmental Sciences 02/2006; 18(3):572-6. · 1.77 Impact Factor
• Yun MA, Wei-Ping LIU, Yue-Zhong WEN
[Show abstract] [Hide abstract]
ABSTRACT: Separation of chiral enantiomers and the dissipation of rac-metolachlor and S-metolachlor in soil were evaluated using achiral high-performance liquid chromatography (HPLC) and chiral gas chromatography (GC) methods. Under the experimental conditions the possible metabolite was considered to be N-(2-ethyl-6-methyl-phenyl)-2-hydroxy-acetamide. Because of the presence of two chiral elements (asymmetrically substituted carbon and chiral axis), the baseline separation of metolachlor enantiomers was not achieved. S-metolachlor degraded faster in soil than rac-metolachlor. After a 42-day incubation, 73.4% of rac-metolachlor and 90.0% of S-metolachlor were degraded. However, due to the absence of biological processes the degradation process in sterilized soil showed no enantioselectivity. The results indicated that enantioselective degradations could greatly affect the environmental fate of metolachlor and should be considered when the environmental behavior of these compounds was assessed.
Pedosphere 01/2006; 16(4):489-494. · 1.23 Impact Factor
• Source
Zhao-Hua Fang, Yue-Zhong Wen, Wei-Ping Liu
[Show abstract] [Hide abstract]
ABSTRACT: The effect of kaolinite on the enzymatic chiral hydrolysis of methyl dichlorprop enantiomers ((R,S)-methyl-2-(2,4- dichlorophenoxy) propanoic acid, 2,4-DPM) was investigated using chiral gas chromatography. Compared with the control without kaolinite, the enantiomeric ratio (ER) increased from 1.35 to 8.33 and the residual ratio of 2,4-DPM decreased from 60.89% to 41.55% in the presence of kaolinite. Kaolinite likely had emotion influence on lipase activity and its enantioselectivity. Moreover, the amount of kaolinite added was also found to be a sensitive factor affecting the enantioselective hydrolysis of 2,4-DPM. Fourier transform infrared (FTIR) spectroscopy studies of the interaction of lipase with kaolinite provided insight into the molecular structure of the complex and offered explanation of the effects of kaolinite on enzymatic hydrolysis of 2,4-DPM. Spectra showed that the effect of kaolinite on the hydrolysis of 2,4-DPM was affected by adsorption of lipase on kaolinite and changes of adsorbed lipase conformation, which led to the modified enantioselectivity.
Journal of Zhejiang University SCIENCE B 11/2005; 6(10):1028-32. · 1.11 Impact Factor
• [Show abstract] [Hide abstract]
ABSTRACT: Enantioselective Degradation of 2,4-Dichlorprop methyl ester was studied by sediment bacteria. One DCPPM-degrading bacteria stain was isolated from contaminated sediments. The EF values were determined by chiral GC. The enantioselectivity of DCPPM biodegradation in aquatic phases were evaluated. Incubation with DCPPM-degrading bacteria show that the R enantiomer was preferentially degraded over the corresponding S enantiomer of DCPPM. The EF values show a much higher deviation. It indicate that the microbial degradation of DCPPM was enantioselectivety.
Huan jing ke xue= Huanjing kexue / [bian ji, Zhongguo ke xue yuan huan jing ke xue wei yuan hui "Huan jing ke xue" bian ji wei yuan hui.] 08/2005; 26(4):152-5.
• [Show abstract] [Hide abstract]
ABSTRACT: Chemical oxygen demand (COD) removal rates of sulfosalicylic acid (SSal) degraded by three advanced oxidation processes (AOPs): O3/UV, O3/TiO2/UV and O3/V-O/TiO2 are compared in this paper. (V = Vanadium). The results show that O3/V-O/TiO2 is the most effective process among three AOPs and the order of degradation efficiencies at different pH values is shown as O3/V-O/TiO2 > O3/TiO2/UV > O3/UV. For example, at the buffered solution of pH 6.8, the COD removal rate of O3/V-O/TiO2 reaches 70% in 30 minutes, but those of O3/TiO2/UV and O3/UV are 55% and 47% at the same conditions, respectively. Furthermore, the effect of CO3 2 −on the COD removal rates of three AOPs shows that O3/V-O/TiO2 and O3/TiO2/UV may be considerable promising methods to overcome the limitation of the presence of radical scavenger in solution. Both the adsorption of SSal on catalysts and other oxidants (atom oxygen, photo-generated hole) must be responsible for the above result.
Ozone: Science and Engineering. 06/2005; 27(3):233-238.
• [Show abstract] [Hide abstract]
ABSTRACT: The relationship between excess thermodynamic function and binding to urease of four chloroacetanilide herbicides was studied using high-performance liquid chromatography and fluorescence spectrum. The linear relationship between the composition of mobile phase of RP-HPLC and the capacity factor of chloroacetanilide herbicides has been obtained. The excess thermodynamic enthalpy (deltaH* ) of acetochlor, pretilachlor, butachlor and metolachlor was determined, and the binding constant K and the number of binding sites with urease were calculated. The relationship between excess thermodynamic function and the binding constant K was suggested.
Guang pu xue yu guang pu fen xi = Guang pu 04/2005; 25(3):463-6. · 0.29 Impact Factor
• Source
[Show abstract] [Hide abstract]
ABSTRACT: Reactive Red 195, which is an azoic anionic dye characterized by the presence of five sulfonic groups and one azoic group, is efficiently removed using chitosan. The increasing chitosan dose had a dramatic positive impact on the achieved color removal, there was approximately a linear relationship between chitosan dose and color removal of dye before color removal reach maximum. Also, the increase of dye concentration led to the increase of chitosan dosage in order to get the same color removal. 92 mg/L of chitosan dosage was sufficient to achieve complete remove of dye at initial concentration of dye at 200 mg/L. For the higher concentrations of dye, high dosages were necessary to reach complete color removal. On the other hand, the use of adsorption interferents (Fe2+, Na+, HCO3- and others) can be interesting, addition of ions had effect on the color removal of Reactive Red 195. Comparing with blank, addition of chemical species approximately decreased the color removal except Na+ and combination of Fe2+ + HCO3-. However, comparing with Fe2+ alone and HCO3- alone, combination of Fe2+ + HCO3- increased the color removal.
Journal of Environmental Sciences 02/2005; 17(5):766-9. · 1.77 Impact Factor
• Source
[Show abstract] [Hide abstract]
ABSTRACT: Hydrolytic degradation of the herbicide diclofop-methyl was investigated in the multi-pH deionized water, natural aquatic systems and soil suspensions. Resulting data indicated that the herbicide was stable in the acidic and nearly neutral solutions for at least 15 d. The herbicide diclofop-methyl rapidly dissipated in the natural aquatic systems and soil suspensions with half-lives less than 4 d. Methyl-CD (partially methylated beta-cyclodextrin) improved its hydrolytic degradation in the pH 8 deionized water and natural aquatic systems while humic acid inhibited its hydrolytic degradation at the same conditions. But dissolved organic matter in the natural aquatic systems and soil suspensions increased its hydrolysis. Two catalysis mechanisms were introduced to describe the effects of cyclodextrin and organic matter on its hydrolytic metabolism. Though inorganic ions maybe improved its hydrolysis reaction in the natural aquatic systems, Fe2+ and Cu2+ did not form complexes with the herbicide and had poor influences on its hydrolytic degradation whether cyclodextrin was added or not.
Journal of Environmental Sciences 02/2005; 17(1):67-71. · 1.77 Impact Factor
• Source
[Show abstract] [Hide abstract]
ABSTRACT: The effect of beta-cyclodextrins (beta-CDs) on the enzymatical hydrolysis of chiral dichlorprop methyl ester (DCPPM) was studied. Four kinds of beta-cyclodextrins (beta-cyclodextrin, Partly methylated-CD (PM-beta-CD), hydroxypropyl-cyclodextrin (HP-beta-CD) and carboxymethyl-cyclodextrin (CM-beta-CD)) were used. Compared with 100% DCPPM in the absence of betacyclodextrins, the activity of lipase decreased with the increase of Pbetacyclodextrin and PM-Pbetacyclodextrin. However, CM-beta-clodextrin stimulated the lipase activity. The inhibition effect of Pbeta cyclodextrin and PM-5betacyclodextrin on the hydrolysis of DCPPM is affected by many factors other than degree of the methylation blocking the active site of lipase. UV-Vis and Fourier transform infrared (FTIR) spectroscopy studies of the complexation of aqueous DCPPM with beta-CDs provide fresh insight into the molecular structure of the complex and explain the effects of beta-CDs on enzymatical hydrolysis of chiral DCPPM. Data showed that inclusion complexes had formed by complexation of the CM-beta-CD with DCPPM and the solubility of DCPPM was increased in water, which lead to the increased lipase activity.
Journal of Environmental Sciences 02/2005; 17(2):237-40. · 1.77 Impact Factor
• [Show abstract] [Hide abstract]
ABSTRACT: Conformational and activity changes of acid phosphatase from wheat germ in ethanol solutions of different concentrations were measured by fluorescence spectra and differential UV-absorption spectra. The effect of ethanol on kinetics of acid phosphatase was determined by using the double reciprocal plot. The results indicate the ethanol has a significant effect on the activity and conformation of acid phosphatase. The activity of acid phosphatase decreased linearly with increasing the concentration of ethanol. Differential UV-absorption spectra of the enzyme denatured in ethanol solutions showed two positive peaks at 213 and 234 nm, respectively. The peaks on the differential UV-absorption spectra suggested that the conformation of enzyme molecule changed from orderly structure to out-of-order crispation. The fluorescence emission peak intensity of the enzyme gradually strengthened with increasing ethanol concentration, which is in concordance with the conformational change of the microenvironments of tyrosine and tryptophan residues. The results indicate that the expression of the enzyme activity correlates with the stability and integrity of the enzyme conformation to a great degree. Ethanol is uncompetitive inhibitor of acid phosphatase.
Guang pu xue yu guang pu fen xi = Guang pu 12/2004; 24(11):1388-90. · 0.29 Impact Factor
• Source
Yue-Zhong Wen, Zhao-Hua Fang, Wei-Ping Liu
[Show abstract] [Hide abstract]
ABSTRACT: Environmental concerns have highlighted the need of cleaner technologies. A cleaner, convenient and selective technology has been developed for the preparation of 3-(4,6-dimethoxy-pyrimidin-2-yloxy)-2-methyl-phenol (DPMP) from 2-methyl-benzene-1,3-diol in water as solvent. The isolated yield of DPMP is up to 86% in good selectivity. The product structure was characterized by conventional methods, 1H-NMR and MS. This technology belongs to the modern concept of environmentally friendly low wastes or non-wastes technology (LWNWT).
Journal of Zhejiang University SCIENCE 09/2004; 5(8):956-9.
• [Show abstract] [Hide abstract]
ABSTRACT: The removals of humic acid and turbidity by polyferric chloride under different coagulation conditions were studied (pH = 4, 7, 10). Zeta potential, turbidity and humic acid removal efficiency were analyzed. Experimental results showed that the dosage and scope of polyferric chloride (PFC) is the narrowest and the residual turbidity is biggest when pH = 4, the dosage and scope of PFC is the broadest and the residual turbidity is the least when pH = 10; Fe(III) can complex with humic acid under acidic condition; The effect of flocculation is not influenced by the presence of humic acid.
Huan jing ke xue= Huanjing kexue / [bian ji, Zhongguo ke xue yuan huan jing ke xue wei yuan hui "Huan jing ke xue" bian ji wei yuan hui.] 06/2004; 25(3):65-8.
• [Show abstract] [Hide abstract]
ABSTRACT: In this paper, the modified target factor analysis-UV spectrophotometry method is established for simultaneous determination of paraquat CL, cyanzine, metolachlor and atrazine in mixed herbicides. The experimental results show that the recovery of each herbicide by MTFA is more accurate than by TFA. The recovery of paraquat CL ranges from 99.47% to 102.02%, of cyanzine 98.93%-102.75%, of metolachlor 98.13%-102.65% and of atrazine 97.42%-103.20%, with SD for the four components to be 1.16%, 1.84%, 1.84% and 2.55% respectively. All in all, the modified target factor analysis method can be used to determine accurately mixed herbicides which exhibits intrinsic interaction among components.
Guang pu xue yu guang pu fen xi = Guang pu 05/2004; 24(4):459-62. · 0.29 Impact Factor
• [Show abstract] [Hide abstract]
ABSTRACT: The binding of metolachlor and S-Isomer to urease in aqueous solution was studied using UV difference spectrum and fluorescence spectrum. According to the results of the UV difference spectrum curve, the UV difference adsorption deltaA changed rapidly when herbicide concentration increased from 0.0 to 1.6 micromol x L(-1) x UV difference spectra were red-shifted and absorb-peaks became lower. It was shown that herbicide can quench the urease fluorescence mainly through a static quenching procedure. The binding constant K and the number of binding site n were calculated according to the fluorescence quenching results. For metolachlor, K = 1.49 x 10(3) L x mol(-1) and n was 0.84; for S-isomer, K=2.22 x 10(3) L x mol(-1) and n was 0.89.
Guang pu xue yu guang pu fen xi = Guang pu 03/2004; 24(2):166-8. · 0.29 Impact Factor
Publication Stats
63 Citations
30.35 Total Impact Points
Institutions
• 2007–2008
• Zhejiang University of Technology
Hang-hsien, Zhejiang Sheng, China
• 2002–2008
• Zhejiang University
• Department of Environmental Science
Hangzhou, Zhejiang Sheng, China
• 2005
• Hangzhou University
Hang-hsien, Zhejiang Sheng, China
|
__label__pos
| 0.828586 |
Scientific revolution
From Wikipedia, the free encyclopedia
Jump to: navigation, search
The scientific revolution was the emergence of modern science during the early modern period, when developments in mathematics, physics, astronomy, biology, medicine, and chemistry transformed views of society and nature.[1][2][3][4][5][6][7] According to traditional accounts, the scientific revolution began in Europe towards the end of the Renaissance era and continued through the late 18th century, influencing the intellectual social movement known as the Enlightenment. While its dates are disputed, the publication in 1543 of Nicolaus Copernicus's De revolutionibus orbium coelestium (On the Revolutions of the Heavenly Spheres) and Andreas Vesalius's De humani corporis fabrica (On the Fabric of the Human body) is often cited as marking the beginning of the scientific revolution. By the end of the 18th century, the scientific revolution had given way to the "Age of Reflection".
The concept of a scientific revolution extending over an extended period emerged in the eighteenth century, before the French Revolution, in the work of Bailly, who saw a two-stage process of sweeping away the old and establishing the new.[8]
Significance of the revolution[edit]
The science of the middle ages was significant in establishing a base for modern science. The Marxist historian and scientist J. D. Bernal asserted that "the renaissance enabled a scientific revolution which let scholars look at the world in a different light. Religion, superstition, and fear were replaced by reason and knowledge".[this quote needs a citation] James Hannam says that, while most historians do think something revolutionary happened at this time, "the term 'scientific revolution' is another one of those prejudicial historical labels that explains nothing. You could call any century from the twelfth to the twentieth a revolution in science" and that the concept "does nothing more than reinforce the error that before Copernicus nothing of any significance to science took place".[9] Despite some challenges to religious views, however, most notable figures of the scientific revolution—including Nicolaus Copernicus, Tycho Brahe, Johannes Kepler, Galileo Galilei, Francis Bacon, René Descartes, Isaac Newton and Gottfried Leibniz— were devout in their faith.[10] Some scholars see a direct tie between Christian metaphysics and the rise of science.[11]
This period saw a fundamental transformation in scientific ideas across mathematics, physics, astronomy, and biology in institutions supporting scientific investigation and in the more widely held picture of the universe. The scientific revolution led to the establishment of several modern sciences. In 1984, Joseph Ben-David wrote:
Rapid accumulation of knowledge, which has characterized the development of science since the 17th century, had never occurred before that time. The new kind of scientific activity emerged only in a few countries of Western Europe, and it was restricted to that small area for about two hundred years. (Since the 19th century, scientific knowledge has been assimilated by the rest of the world).[12]
Many contemporary writers and modern historians claim that there was a revolutionary change in world view. In 1611 the English poet, John Donne, wrote:
[The] new Philosophy calls all in doubt,
The Element of fire is quite put out;
The Sun is lost, and th'earth, and no man's wit
Can well direct him where to look for it.[13]
Mid-20th century historian Herbert Butterfield was less disconcerted, but nevertheless saw the change as fundamental:
Since that revolution turned the authority in English not only of the Middle Ages but of the ancient world—since it started not only in the eclipse of scholastic philosophy but in the destruction of Aristotelian physics—it outshines everything since the rise of Christianity and reduces the Renaissance and Reformation to the rank of mere episodes, mere internal displacements within the system of medieval Christendom.... [It] looms so large as the real origin both of the modern world and of the modern mentality that our customary periodization of European history has become an anachronism and an encumbrance.[14]
More recently, sociologist and historian of science Steven Shapin opened his book, The Scientific Revolution, with the paradoxical statement: "There was no such thing as the Scientific Revolution, and this is a book about it."[15] Although historians of science continue to debate the exact meaning of the term, and even its validity, the scientific revolution still remains a useful concept to interpret the many changes in science itself.
New ideas[edit]
Galileo Galilei. Portrait in crayon by Leoni
The scientific revolution was not marked by any single change. The following new ideas contributed to what is called the scientific revolution:
• The replacement of the Earth as center of the universe by heliocentrism.
• Deprecation of the Aristotelian theory that matter was continuous and made up of the elements Earth, Water, Air, and Fire because its classic rival, Atomism, better lent itself to a "mechanical philosophy" of matter.[16][17]
• The replacement of the Aristotelian idea that heavy bodies, by their nature, moved straight down toward their natural places; that light bodies, by their nature, moved straight up toward their natural place; and that ethereal bodies, by their nature, moved in unchanging circular motions[18] with the idea that all bodies are heavy and move according to the same physical laws.
• Inertia replaced the medieval impetus theory, that unnatural motion ("forced" or "violent" rectilinear motion) is caused by continuous action of the original force imparted by a mover into that which is moved.[19][20]
• The replacement of Galen's treatment of the venous and arterial systems as two separate systems with William Harvey's concept that blood circulated from the arteries to the veins "impelled in a circle, and is in a state of ceaseless motion."[21]
However, according to Galileo, the core of what came to be known as the scientific method in modern physical sciences is stated in his book Il Saggiatore to be the concept of a systematic mathematical interpretation of experiments and empirical facts:
"Philosophy [i.e., physics] is written in this grand book—I mean the universe—which stands continually open to our gaze, but it cannot be understood unless one first learns to comprehend the language and interpret the characters in which it is written. It is written in the language of mathematics, and its characters are triangles, circles, and other geometrical figures, without which it is humanly impossible to understand a single word of it; without these, one is wandering around in a dark labyrinth."[22]
René Descartes with Queen Christina of Sweden.
Many of the important figures of the scientific revolution, however, shared in the Renaissance respect for ancient learning and cited ancient pedigrees for their innovations. Nicolaus Copernicus (1473–1543),[23] Kepler (1571–1630),[24] Newton (1642–1727),[25] and Galileo Galilei (1564–1642)[1][2][3][4] all traced different ancient and medieval ancestries for the heliocentric system. In the Axioms Scholium of his Principia, Newton said its axiomatic three laws of motion were already accepted by mathematicians such as Huygens (1629–1695), Wallace, Wren, and others, and in memos in his draft preparations of the second edition of the Principia, he attributed its first law of motion and its law of gravity to a range of historical figures.[26] According to Newton himself and other historians of science,[27] his Principia's first law of motion was the same as Aristotle's counterfactual principle of interminable locomotion in a void stated in Physics 4.8.215a19–22 and was also endorsed by ancient Greek atomists and others. As Newton expressed himself:
All those ancients knew the first law [of motion] who attributed to atoms in an infinite vacuum a motion which was rectilinear, extremely swift and perpetual because of the lack of resistance... Aristotle was of the same mind, since he expresses his opinion thus...[in Physics 4.8.215a19-22], speaking of motion in the void [in which bodies have no gravity and] where there is no impediment he writes: 'Why a body once moved should come to rest anywhere no one can say. For why should it rest here rather than there ? Hence either it will not be moved, or it must be moved indefinitely, unless something stronger impedes it.'[28]
As Newton attests, the Principia's first law of motion was known in antiquity, even by Aristotle, although its significance, as such, went unappreciated. This refutes Kuhn's thesis of a scientific revolution in dynamics.[20]
The geocentric model was nearly universally accepted until 1543 when Nicolaus Copernicus published his book titled De revolutionibus orbium coelestium and was still widely accepted into the next century. At around the same time, the findings of Vesalius corrected the previous anatomical teachings of Galen, which were based upon the dissection of animals even though they were supposed to be a guide to the human body.
Andreas Vesalius (1514–1564) was an author of one of the most influential books on human anatomy, De humani corporis fabrica,[29] published in 1543. French surgeon Ambroise Paré (c.1510–1590) is considered one of the fathers of surgery; he was leader in surgical techniques and battlefield medicine, especially the treatment of wounds. Influenced by the works of Italian surgeon and anatomist Matteo Realdo Colombo (c. 1516–1559), the anatomist William Harvey (1578–1657) described the circulatory system.[30] Herman Boerhaave (1668–1738) is sometimes referred to as a "father of physiology" due to his exemplary teaching in Leiden and his textbook 'Institutiones medicae' (1708).
Antonie van Leeuwenhoek, the first person to use a microscope to view bacteria.
It was between 1650 and 1800 that the science of modern dentistry developed. It is said that the 17th-century French physician Pierre Fauchard (1678–1761) started dentistry science as we know it today, and he has been named "the father of modern dentistry".[31]
Pierre Vernier (1580–1637) was inventor and eponym of the vernier scale, used in measuring devices.[32] Evangelista Torricelli (1607–1647) was best known for his invention of the barometer. Although Franciscus Vieta (1540–1603) gave the first notation of modern algebra, John Napier (1550–1617) invented logarithms, and Edmund Gunter (1581–1626) created the logarithmic scales (lines, or rules) upon which slide rules are based. It was William Oughtred (1575–1660) who first used two such scales sliding by one another to perform direct multiplication and division, and thus is credited as the inventor of the slide rule in 1622.
Blaise Pascal (1623–1662) invented the mechanical calculator in 1642.[33] The introduction of his Pascaline in 1645 launched the development of mechanical calculators first in Europe and then all over the world. The notion of mathematical probability was first initiated by Pascal with his research in the games of chance; his later theory for binomial coefficient (or Pascal's Triangle) was used as some of the foundation to Leibniz' infinitesimal calculus.[34] He also made important contributions to the study of fluid and clarified the concepts of pressure and vacuum by generalizing the work of Evangelista Torricelli. He wrote a significant treatise on the subject of projective geometry at the age of sixteen and later corresponded with Pierre de Fermat (1601–1665) on probability theory, strongly influencing the development of modern economics and social science.[35]
Gottfried Leibniz (1646–1716), building on Pascal's work, became one of the most prolific inventors in the field of mechanical calculators; he was the first to describe a pinwheel calculator, in 1685,[36] and invented the Leibniz wheel, used in the arithmometer, the first mass-produced mechanical calculator. He also refined the binary number system, foundation of virtually all modern computer architectures.
John Hadley (1682–1744) was mathematician inventor of the octant, the precursor to the sextant. Hadley also developed ways to make precision aspheric and parabolic objective mirrors for reflecting telescopes, building the first parabolic Newtonian telescope and a Gregorian telescope with accurately shaped mirrors.[37][38]
Denis Papin, best known for his pioneering invention of the steam digester, the forerunner of the steam engine.
Denis Papin (1647–1712) was best known for his pioneering invention of the steam digester, the forerunner of the steam engine.[39] Abraham Darby I (1678–1717) was the first, and most famous, of three generations of the Darby family who played an important role in the Industrial Revolution. He developed a method of producing high-grade iron in a blast furnace fueled by coke rather than charcoal. This was a major step forward in the production of iron as a raw material for the Industrial Revolution. Thomas Newcomen (1664–1729) perfected a practical steam engine for pumping water, the Newcomen steam engine. Consequently, he can be regarded as a forefather of the Industrial Revolution.[40]
In 1672 Otto von Guericke (1602–1686), was the first human on record to knowingly generate electricity using a machine, and in 1729 Stephen Gray (1666–1736) demonstrated that electricity could be "transmitted" through metal filaments. The first electrical storage device was invented in 1745, the so-called "Leyden jar," and in 1749 Benjamin Franklin (1706–1790) demonstrated that lightning was electricity. In 1698 Thomas Savery (c.1650–1715) patented an early steam engine.[41]
German scientist Georg Agricola (1494–1555), known as "the father of mineralogy," published his great work De re metallica.[42] Robert Boyle (1627–1691) was credited with the discovery of Boyle's Law. He is also credited for his landmark publication The Sceptical Chymist, where he attempts to develop an atomic theory of matter. The person celebrated as the "father of modern chemistry" is Antoine Lavoisier (1743–1794) who developed his law of Conservation of mass in 1789, also called Lavoisier's Law.[43] Antoine Lavoisier proved that burning was caused by oxidation, that is, the mixing of a substance with oxygen. He also proved that diamonds were made of carbon and argued that all living processes were, at their heart, chemical reactions. In 1766 Henry Cavendish (1731–1810) discovered hydrogen. In 1774 Joseph Priestley (1733–1804) discovered oxygen.
Gottfried Leibniz (1646–1716) refined the binary system, foundation of virtually all modern computer architectures.
German physician Leonhart Fuchs (1501–1566) was one of the three founding fathers of botany, along with Otto Brunfels (1489-1534) and Hieronymus Bock (1498–1554) (also called Hieronymus Tragus).[44] Valerius Cordus (1515–1554) authored one of the greatest pharmacopoeias and one of the most celebrated herbals in history, Dispensatorium (1546).[45]
In his Systema Naturae, published in 1767, Carl von Linné (1707–1778) catalogued all the living creatures into a single system that defined their morphological relations to one another: the Linnean classification system. He is often called the "Father of Taxonomy."[46] Georges Buffon (1707–1788) was perhaps the most important of Charles Darwin's predecessors. From 1744 to 1788, he wrote his monumental Histoire naturelle, générale et particulière, which included everything known about the natural world up until that date.[47]
Along with the inventor and microscopist Robert Hooke (1635–1703), Sir Christopher Wren (1632–1723) and Sir Isaac Newton (1642–1727),[48] English scientist and astronomer Edmond Halley (1656–1742) was trying to develop a mechanical explanation for planetary motion. Halley's star catalogue of 1678 was the first to contain telescopically determined locations of southern stars.[49]
Many historians of science have seen other ancient and medieval antecedents of these ideas.[50] It is widely accepted that Copernicus's De revolutionibus followed the outline and method set by Ptolemy in his Almagest[51] and employed geometrical constructions that had been developed previously by the Maragheh school in his heliocentric model,[52][53] and that Galileo's mathematical treatment of acceleration and his concept of impetus[1] rejected earlier medieval analyses of motion,[4] rejecting by name; Averroes, Avempace, Jean Buridan, and John Philoponus (see Theory of impetus).
The standard theory of the history of the scientific revolution claims the 17th century was a period of revolutionary scientific changes. It is claimed that not only were there revolutionary theoretical and experimental developments, but that even more importantly, the way in which scientists worked was radically changed. An alternative anti-revolutionist view is that science as exemplified by Newton's Principia was anti-mechanist and highly Aristotelian, being specifically directed at the refutation of anti-Aristotelian Cartesian mechanism, as evidenced in the Principia quotations below, and not more empirical than it already was at the beginning of the century or earlier in the works of scientists such as Benedetti, Galileo Galilei, or Johannes Kepler.
Ancient and medieval background[edit]
The scientific revolution was built upon the foundation of ancient Greek learning and science in the middle ages, as it had been elaborated and further developed by Roman/Byzantine science and medieval Islamic science.[54] The "Aristotelian tradition" was still an important intellectual framework in by the 17th century, although by that time natural philosophers had moved away from much of it.[5]
Ptolemaic model of the spheres for Venus, Mars, Jupiter, and Saturn. Georg von Peuerbach, Theoricae novae planetarum, 1474.
Key scientific ideas dating back to classical antiquity had changed drastically over the years, and in many cases been discredited.[5] The ideas that remained, which were transformed fundamentally during the scientific revolution, include:
• Aristotle's cosmology which placed the Earth at the center of a spherical hierarchic cosmos. The terrestrial and celestial regions were made up of different elements which had different kinds of natural movement.
• The terrestrial region, according to Aristotle, consisted of concentric spheres of the four elementsearth, water, air, and fire. All bodies naturally moved in straight lines until they reached the sphere appropriate to their elemental composition—their natural place. All other terrestrial motions were non-natural, or violent.[55][56]
• The celestial region was made up of the fifth element, Aether, which was unchanging and moved naturally with uniform circular motion.[57] In the Aristotelian tradition, astronomical theories sought to explain the observed irregular motion of celestial objects through the combined effects of multiple uniform circular motions.[58]
• The Ptolemaic model of planetary motion: Based on the geometrical model of Eudoxus of Cnidus, Ptolemy's Almagest, demonstrated that calculations could compute the exact positions of the Sun, Moon, stars, and planets in the future and in the past, and showed how these computational models were derived from astronomical observations. As such they formed the model for later astronomical developments. The physical basis for Ptolemaic models invoked layers of spherical shells, though the most complex models were inconsistent with this physical explanation.[59]
It is important to note that ancient precedent existed for alternative theories and developments which prefigured later discoveries in the area of physics and mechanics; but in light of the limited number of works to survive translation in an era when many books were lost to warfare, such developments remained obscure for centuries and are traditionally held to have had little effect on the re-discovery of such phenomena; whereas the invention of the printing press made the wide dissemination of such incremental advances of knowledge commonplace. Meanwhile, however, significant progress in geometry, mathematics, and astronomy was made in the medieval era, particularly in the Islamic world as well as Europe.
New approaches to nature[edit]
Historians of the scientific revolution traditionally maintain that its most important changes were in the way in which scientific investigation was conducted, as well as the philosophy underlying scientific developments. Among the main changes are the mechanical philosophy, the chemical philosophy, empiricism, and the increasing role of mathematics.[60]
The mechanical philosophy[edit]
Aristotle recognized four kinds of causes, and where applicable, the most important of them is the "final cause". The final cause was the aim, goal, or purpose of some natural process or man-made thing. Until the scientific revolution, it was very natural to see such aims, such as a child's growth, for example, leading to a mature adult. Intelligence was assumed only in the purpose of man-made artifacts; it was not attributed to other animals or to nature.
In "mechanical philosophy" no field or action at a distance is permitted, particles or corpuscles of matter are fundamentally inert. Motion is caused by direct physical collision. Where natural substances had previously been understood organically, the mechanical philosophers viewed them as machines.[61] As a result, Newton's theory seemed like some kind of throwback to "spooky action at a distance". According to Thomas Kuhn, he and Descartes held the teleological principle that God conserved the amount of motion in the universe:
Gravity, interpreted as an innate attraction between every pair of particles of matter, was an occult quality in the same sense as the scholastics' "tendency to fall" had been.... By the mid eighteenth century that interpretation had been almost universally accepted, and the result was a genuine reversion (which is not the same as a retrogression) to a scholastic standard. Innate attractions and repulsions joined size, shape, position and motion as physically irreducible primary properties of matter.[62]
Newton had also specifically attributed the inherent power of inertia to matter, against the mechanist thesis that matter has no inherent powers. But whereas Newton vehemently denied gravity was an inherent power of matter, his collaborator Roger Cotes made gravity also an inherent power of matter, as set out in his famous preface to the Principia's 1713 second edition which he edited, and contra Newton himself. And it was Cotes's interpretation of gravity rather than Newton's that came to be accepted. (See also Entropic gravity).
Newton in a 1702 portrait by Godfrey Kneller.
The chemical philosophy[edit]
Chemistry, and its antecedent alchemy, became an increasingly important aspect of scientific thought in the course of the 16th and 17th centuries. The importance of chemistry is indicated by the range of important scholars who actively engaged in chemical research. Among them were the astronomer Tycho Brahe,[63] the chemical physician Paracelsus, the Irish philosopher Robert Boyle, and the English philosophers Thomas Browne and Isaac Newton.
Unlike the mechanical philosophy, the chemical philosophy stressed the active powers of matter, which alchemists frequently expressed in terms of vital or active principles—of spirits operating in nature.[64]
Empiricism[edit]
The Aristotelian scientific tradition's primary mode of interacting with the world was through observation and searching for "natural" circumstances through reasoning. Coupled with this approach was the belief that rare events which seemed to contradict theoretical models were aberrations, telling nothing about nature as it "naturally" was. During the scientific revolution, changing perceptions about the role of the scientist in respect to nature, the value of evidence, experimental or observed, led towards a scientific methodology in which empiricism played a large, but not absolute, role.
By the start of the scientific revolution, empiricism had already become an important component of science and natural philosophy. Prior thinkers, particularly nominalist William of Ockham in the early 14th century, had begun the intellectual movement toward empiricism.[65] Under the influence of scientists and philosophers like Francis Bacon, a sophisticated empirical tradition was developed by the 16th century. Belief of natural and artificial circumstances was abandoned, and a research tradition of systematic experimentation was slowly accepted throughout the scientific community. Bacon's philosophy of using an inductive approach to nature—to abandon assumption and to attempt to simply observe with an open mind—was in strict contrast with the earlier, Aristotelian approach of deduction, by which analysis of known facts produced further understanding. In practice, of course, many scientists (and philosophers) believed that a healthy mix of both was needed—the willingness to question assumptions, yet also to interpret observations assumed to have some degree of validity.
At the end of the scientific revolution the organic, qualitative world of book-reading philosophers had been changed into a mechanical, mathematical world to be known through experimental research. Though it is certainly not true that Newtonian science was like modern science in all respects, it conceptually resembled ours in many ways. Many of the hallmarks of modern science, especially in respect to the institution and profession of science, did not become standard until the mid-19th century.
Mathematization[edit]
Scientific knowledge, according to the Aristotelians, was concerned with establishing true and necessary causes of things.[66] To the extent that medieval natural philosophers used mathematical problems, they limited social studies to theoretical analyses of local speed and other aspects of life.[67] The actual measurement of a physical quantity, and the comparison of that measurement to a value computed on the basis of theory, was largely limited to the mathematical disciplines of astronomy and optics in Europe.[68][69]
In the 16th and 17th centuries, European scientists began increasingly applying quantitative measurements to the measurement of physical phenomena on the Earth. Galileo maintained strongly that mathematics provided a kind of necessary certainty that could be compared to God's: "...with regard to those few [mathematical propositions] which the human intellect does understand, I believe its knowledge equals the Divine in objective certainty..."[70]
Scientific developments[edit]
Key ideas and people that emerged from the 16th and 17th centuries:
Theoretical developments[edit]
Portrait of Johannes Kepler.
In 1543 Copernicus' work on the heliocentric model of the solar system was published, in which he tried to demonstrate that the sun was the center of the universe. Few were bothered by this suggestion, and the pope and several archbishops were interested enough by it to want more detail.[71] His model was later used to create the calendar of Pope Gregory XIII.[72] For almost two millennia, the geocentric model had been accepted by all but a few astronomers. The idea that the earth moved around the sun, as advocated by Copernicus, was to most of his contemporaries doubtful. It contradicted not only empirical observation, due to the absence of an observable stellar parallax,[73] but also Aristotelian philosophy.
The discoveries of Johannes Kepler and Galileo gave the theory credibility. Kepler was an astronomer who, using the accurate observations of Tycho Brahe, proposed that the planets move around the sun not in circular orbits, but in elliptical ones. Together with his other laws of planetary motion, this allowed him to create a model of the solar system that was an improvement over Copernicus' original system. Galileo's main contributions to the acceptance of the heliocentric system were his mechanics, the observations he made with his telescope, as well as his detailed presentation of the case for the system. Using an early theory of inertia, Galileo could explain why rocks dropped from a tower fall straight down even if the earth rotates. His observations of the moons of Jupiter, the phases of Venus, the spots on the sun, and mountains on the moon all helped to discredit the Aristotelian philosophy and the Ptolemaic theory of the solar system. Through their combined discoveries, the heliocentric system gained support, and at the end of the 17th century it was generally accepted by astronomers.
Kepler's laws of planetary motion and Galileo's mechanics culminated in the work of Isaac Newton. His laws of motion were to be the solid foundation of mechanics; his law of universal gravitation combined terrestrial and celestial mechanics into one great system that seemed to be able to describe the whole world in mathematical formulae.
Not only astronomy and mechanics were greatly changed. Optics, for instance, was revolutionized by people like Robert Hooke, Christiaan Huygens, René Descartes and, once again, Isaac Newton, who developed mathematical theories of light as either waves (Huygens) or particles (Newton). Similar developments could be seen in chemistry, biology and other sciences, although their full development into modern science was delayed for a century or more.
Contrary views[edit]
Matteo Ricci (left) and Xu Guangqi (right) in Athanasius Kircher, La Chine ... Illustrée, Amsterdam, 1670.
Not all historians of science are agreed that there was any revolution in the 16th or 17th century. The continuity thesis is the hypothesis that there was no radical discontinuity between the intellectual development of the Middle Ages and the developments in the Renaissance and early modern period. Thus the idea of an intellectual or scientific revolution following the Renaissance is—according to the continuity thesis—a myth. Some continuity theorists point to earlier intellectual revolutions occurring in the Middle Ages, usually referring to either a European "Renaissance of the 12th century"[6][74] or a medieval "Muslim scientific revolution",[75][76][77] as a sign of continuity.
Another contrary view has been recently proposed by Arun Bala in his dialogical history of the birth of modern science. Bala argues that the changes involved in the Scientific Revolution—the mathematical realist turn, the mechanical philosophy, the atomism, the central role assigned to the Sun in Copernican heliocentrism—have to be seen as rooted in multicultural influences on Europe. Islamic science gave the first exemplar of a mathematical realist theory with Alhazen's Book of Optics in which physical light rays traveled along mathematical straight lines and also laid the foundation of the inductive scientific method. The swift transfer of Chinese mechanical technologies in the medieval era shifted European sensibilities to perceive the world in the image of a machine and their impact fueled an desire for more mechanical inventions. The Hindu-Arabic numeral system, which developed in close association with atomism in India, carried implicitly a new mode of mathematical atomic thinking. And the heliocentric theory, which assigned central status to the Sun, as well as Newton's concept of force acting at a distance, were rooted in ancient Egyptian religious ideas associated with Hermeticism. Bala argues that by ignoring such multicultural impacts we have been led to a Eurocentric conception of the scientific revolution.[78]
However Arun Bala clearly states: "The makers of the revolution – Copernicus, Kepler, Galileo, Descartes, Newton, and many others – had to selectively appropriate relevant ideas, transform them, and create new auxiliary concepts in order to complete their task... In the ultimate analysis, even if the revolution was rooted upon a multicultural base it is the accomplishment of Europeans in Europe."[79]
A third approach takes the term "renaissance" literally. A closer study of Greek Philosophy and Greek Mathematics demonstrates that nearly all of the so-called revolutionary results of the so-called scientific revolution were in actuality restatements of ideas that were in many cases older than those of Aristotle and in nearly all cases at least as old as Archimedes. Aristotle even explicitly argues against some of the ideas that were demonstrated during the scientific revolution, such as heliocentrism. The basic ideas of the scientific method were well known to Archimedes and his contemporaries, as demonstrated in the well known discovery of buoyancy. Atomism was first thought of by Leucippus and Democritus. This view of the scientific revolution reduces it to a period of relearning classical ideas that is very much an extension of the renaissance, specifically relearning ideas that originated with somebody other than Aristotle and particularly those rooted in the schools of Plato and Pythagoras. This view of the scientific revolution does not deny that a change occurred but argues that it was a reassertion of previous knowledge (a renaissance) and not the creation of new knowledge. It cites statements from Newton, Copernicus and others in favour of the Pythagorean worldview as evidence.[80]
See also[edit]
Revolutions[edit]
Notes[edit]
1. ^ a b c Galileo Galilei, Two New Sciences, trans. Stillman Drake, (Madison: Univ. of Wisconsin Pr., 1974), pp 217, 225, 296–7.
2. ^ a b Fernando Espinoza (2005). "An analysis of the historical development of ideas about motion and its implications for teaching". Physics Education 40 (2): 141. Bibcode:2005PhyEd..40..139E. doi:10.1088/0031-9120/40/2/002.
3. ^ a b Ernest A. Moody (1951). "Galileo and Avempace: The Dynamics of the Leaning Tower Experiment (I)". Journal of the History of Ideas 12 (2): 163–193. doi:10.2307/2707514. JSTOR 2707514.
4. ^ a b c Marshall Clagett, The Science of Mechanics in the Middle Ages, (Madison, Univ. of Wisconsin Pr., 1961), pp. 218–19, 252–5, 346, 409–16, 547, 576–8, 673–82; Anneliese Maier, "Galileo and the Scholastic Theory of Impetus," pp. 103–123 in On the Threshold of Exact Science: Selected Writings of Anneliese Maier on Late Medieval Natural Philosophy, (Philadelphia: Univ. of Pennsylvania Pr., 1982).
5. ^ a b c Hannam, p. 342
6. ^ a b Edward Grant (1996), The Foundations of Modern Science in the Middle Ages: Their Religious, Institutional, and Intellectual Contexts, Cambridge: Cambridge University Press
7. ^ "Scientific Revolution" in Encarta. 2007. [1]
8. ^ Cohen, I. Bernard (1976). "The Eighteenth-Century Origins of the Concept of Scientific Revolution". Journal of the History of Ideas 37 (2, Apr-Jun): 257–288.
9. ^ Hannam, p. 352
10. ^ Western Civilization Notes—Scientific Revolutio. Douban.com (2011-03-07). Retrieved on 2011-09-26.
11. ^ http://biologos.org/uploads/projects/noll_scholarly_essay2.pdf
12. ^ Hunt, Shelby D. (2003). Controversy in marketing theory: for reason, realism, truth, and objectivity. M.E. Sharpe. p. 18. ISBN 0-7656-0932-0.
13. ^ John Donne, An Anatomy of the World, quoted in Thomas S. Kuhn, The Copernican Revolution: Planetary Astronomy in the Development of Western Thought, (Cambridge: Harvard Univ. Pr., 1957), p. 194.
14. ^ Herbert Butterfield, The Origins of Modern Science, 1300–1800, p. viii.
15. ^ Steven Shapin, The Scientific Revolution, (Chicago: Univ. of Chicago Pr., 1996), p. 1.
16. ^ Westfall, pp. 34–35, 41.
17. ^ Allen G. Debus, Man and Nature in the Renaissance, (Cambridge: Cambridge Univ. Pr., 1978), pp. 23–25.
18. ^ E. Grant, The Foundations of Modern Science in the Middle Ages: Their Religious, Institutional, and Intellectual Contexts, (Cambridge: Cambridge Univ. Pr., 1996), pp. 59–61, 64.
19. ^ Westfall, pp. 17–21.
20. ^ a b Sorabji, R. (2005). The Philosophy of the Commentators, 200–600 AD: Physics. G – Reference, Information and Interdisciplinary Subjects Series. Cornell University Press. p. 348. ISBN 978-0-8014-8988-4. LCCN 2004063547. "
An impetus is an inner force impressed into a moving body from without. It thus contrasts with purely external forces like the action of air on projectiles in Aristotle, and with purely internal forces like the nature of the elements in Aristotle and his followers. Internal forces are found in other schools too, e.g. the Stoics, and impetus theories would be very common if all these forces counted as impetus.
Impetus theories also contrast with theories of inertia which replaced them in the seventeenth to eighteenth centuries. Thomas Kuhn has seen the introduction of these two theories into dynamics as constituting scientific revolutions, although he was speaking about fourteenth century impetus theory; before it was fully recognized that impetus theory is found in Antiquity.
According to inertial theories, some motion needs no force to keep it in being. Thus, according to Newton, a body persists in the same state of rest or rectilinear motion unless there is a force acting on it to the contrary.
Such inertial ideas are merely sporadic in Antiquity and not consciously attended to as a separate option. Aristotle, for example, argues in Phys. 4.8 that in a vacuum a moving body would never stop, but the possible implications for inertia are not discussed.
"
21. ^ William Harvey, De motu cordis, cited in Allen G. Debus, Man and Nature in the Renaissance, (Cambridge: Cambridge Univ. Pr., 1978), p. 69.
22. ^ Galileo Galilei, Il Saggiatore (The Assayer, 1623), as translated by Stillman Drake (1957), Discoveries and Opinions of Galileo pp. 237–8
23. ^ Thomas Kuhn, The Copernican Revolution, (Cambridge: Harvard Univ. Pr., 1957), p. 142.
24. ^ Bruce S. Eastwood, "Kepler as Historian of Science: Precursors of Copernican Heliocentrism according to De revolutionibus, I, 10," Proceedings of the American Philosophical Society 126(1982): 367–394; reprinted in B. S. Eastwood, Astronomy and Optics from Pliny to Descartes, (London: Variorum Reprints, 1989).
25. ^ J. E. McGuire and P. M. Rattansi, "Newton and the 'Pipes of Pan'," Notes and Records of the Royal Society of London, Vol. 21, No. 2. (Dec., 1966), p. 110.
26. ^ A. R. Hall and M. B. Hall Unpublished Scientific Papers of Isaac Newton (Cambridge: Cambridge Univ. Pr., 1962), pp.309–11; J. E. McGuire and P. M. Rattansi, "Newton and the 'Pipes of Pan'," Notes and Records of the Royal Society of London, Vol. 21, No. 2. (Dec., 1966), pp. 108–143
27. ^ Sir Thomas L. Heath, Mathematics in Aristotle (Oxford: Clarendon Press, 1949), pp. 115–6.
28. ^ Newton, Isaac (1962). Hall; Hall, eds. Unpublished Scientific Papers of Isaac Newton. Cambridge University Press. pp. 310–11.
29. ^ Page through a virtual copy of Vesalius's ''De Humanis Corporis Fabrica''. Archive.nlm.nih.gov. Retrieved on 2011-09-26.
30. ^ Zimmer, Carl. 2004. Soul Made Flesh: The Discovery of the Brain – and How It Changed the World. New York: Free Press.
31. ^ History of Dentistry Articles
32. ^ Vernier biography. Groups.dcs.st-and.ac.uk. Retrieved on 2011-09-26.
33. ^ Jean Marguin, p. 48 (1994) Citing René Taton (1963)
34. ^ L. Jonathan Cohen, Review by David A. Schum"A Review of a Case against Blaise Pascal and His Heirs., The Provable and the Probable"., Michigan Law Review , Vol. 77, No. 3, 1979 Survey of Books Relating to the Law (Jan. - Mar., 1979), p. 447
35. ^ Pascal biography. Groups.dcs.st-and.ac.uk. Retrieved on 2011-09-26.
36. ^ David Smith, p.173-181 (1929)
37. ^ Henry C. King (19 September 2003). The History of the Telescope. Courier Dover Publications. pp. 77–. ISBN 978-0-486-43265-6. Retrieved 26 September 2011.
38. ^ telescopeѲptics.net – 8.2. Two-mirror telescopes. Telescope-optics.net. Retrieved on 2011-09-26.
39. ^ Denis Papin. NNDB
40. ^ Thomas Newcomen (1663–1729), BBC – History
41. ^ AGRICOLA, GEORG (1494–1555). Scs.uiuc.edu. Retrieved on 2011-09-26.
42. ^ Lavoisier, Antoine (1743–1794) – from Eric Weisstein's World of Scientific Biography, ScienceWorld
43. ^ Early herbals – The German fathers of botany. Museumwales.ac.uk (2007-07-04). Retrieved on 2011-09-26.
44. ^ Valerius Cordus | Science and Its Times: 1450–1699 Summary. Bookrags.com (2010-11-02). Retrieved on 2011-09-26.
45. ^ Carl Linnaeus. Ucmp.berkeley.edu. Retrieved on 2011-09-26.
46. ^ Buffon and the Histoire naturelle :All Nature is so full, King's College London
47. ^ Isaac Newton (1643–1727), BBC – History
48. ^ Halley biography. Groups.dcs.st-and.ac.uk. Retrieved on 2011-09-26.
49. ^ A survey of the debate over the significance of these antecedents is in D. C. Lindberg, The Beginnings of Western Science: The European Scientific Tradition in Philosophical, Religious, and Institutional Context, 600 B.C. to A.D. 1450, (Chicago: Univ. of Chicago Pr., 1992), pp. 355–68.
50. ^ Otto Neugebauer, "On the Planetary Theory of Copernicus," Vistas in Astronomy, 10(1968):89–103; reprinted in Otto Neugebauer, Astronomy and History: Selected Essays (New York: Springer, 1983), pp. 491–505.
51. ^ George Saliba (1999). Whose Science is Arabic Science in Renaissance Europe? Columbia University.
52. ^ Toby E. Huff, The Rise of Early Modern Science: Islam, China and the West, 2nd. ed., Cambridge: Cambridge University Press, 2003, pp. 54–5, ISBN 0-521-52994-8.
53. ^ E. Grant, The Foundations of Modern Science in the Middle Ages: Their Religious, Institutional, and Intellectual Contexts, (Cambridge: Cambridge Univ. Pr., 1996), pp. 29–30, 42–7.
54. ^ E. Grant, The Foundations of Modern Science in the Middle Ages: Their Religious, Institutional, and Intellectual Contexts, (Cambridge: Cambridge Univ. Pr., 1996), pp. 55–63, 87–104
55. ^ Pedersen, pp. 106–110.
56. ^ E. Grant, The Foundations of Modern Science in the Middle Ages: Their Religious, Institutional, and Intellectual Contexts, (Cambridge: Cambridge Univ. Pr., 1996), pp. 63–8, 104–16.
57. ^ Pedersen, p. 25
58. ^ Pedersen, pp. 86–89.
59. ^ An introduction to the influence of the mechanical and chemical philosophies and of mathematization appears in Richard S. Westfall, Never at Rest: A Biography of Isaac Newton, (Cambridge: Cambridge Univ. Pr., 1980), pp. 1–39.
60. ^ Westfall, pp. 30–33.
61. ^ Kuhn (1970), The Structure of Scientific Revolutions, pp. 105–06.
62. ^ Owen Hannaway, "Laboratory Design and the Aim of Science: Andreas Libavius versus Tycho Brahe," Isis 77(1986): 585–610
63. ^ Richard S. Westfall, Never at Rest, pp. 18–23.
64. ^ Hannam, p. 162
65. ^ Peter Dear, Revolutionizing the Sciences, pp. 65–67, 134–38.
66. ^ Edward Grant, The Foundations of Modern Science in the Middle Ages, pp. 101–03, 148–50.
67. ^ Pedersen, p. 231.
68. ^ Stephen C. McCluskey, Astronomies and Cultures in Early Medieval Europe, (Cambridge: Cambridge Univ. Pr., 1998), pp. 180–84, 198–202.
69. ^ Galilei, Galileo (1967) [Composed in 1632]. Dialogue Concerning the Two Chief World Systems. Translated by Stillman Drake (2nd ed.). Berkley: University of California Press. p. 103.
• In the 1661 translation by Thomas Salusbury: "... the knowledge of those few comprehended by humane understanding, equalleth the divine, as to the certainty objectivè ..." p. 92 (from the Archimedes Project)
• In the original Italian: "... ma di quelle poche intese dall’intelletto umano credo che la cognizione agguagli la divina nella certezza obiettiva, poiché arriva a comprenderne la necessità ..." (from the copy at the Italian Wikisource)
70. ^ Hannam, p. 303
71. ^ Hannam, p. 329
72. ^ Hannam, p. 283
73. ^ http://biologos.org/blog/medieval-christianity-and-the-rise-of-modern-science-part-2
74. ^ Ahmad Y Hassan and Donald Routledge Hill (1986), Islamic Technology: An Illustrated History, p. 282, Cambridge University Press.
75. ^ Abdus Salam, H. R. Dalafi, Mohamed Hassan (1994). Renaissance of Sciences in Islamic Countries, p. 162. World Scientific, ISBN 9971-5-0713-7.
76. ^ Robert Briffault, The Making of Humanity p. 188.
77. ^ Bala, Dialogue of Civilizations in the Birth of Modern Science, 2006.[page needed]
78. ^ "Book Review of The Dialogue of Civilizations in the Birth of Modern Science by Arun Bala". MuslimHeritage.com
79. ^ Thomas W. Africa (1961). "Copernicus' Relation to Aristarchus and Pythagoras". Isis 52 (3): 403–409. doi:10.1086/349478. JSTOR 228080.
Sources[edit]
|
__label__pos
| 0.799022 |
5
I've created a test site in order to learn about SQLi and then protect against it. I may be misunderstanding how it is supposed to behave but at present I'm not getting the results I expect.
The page:
<!DOCTYPE html>
<html><body>
<h1>SQL Injection Test Site</h1>
<h2>Login Form</h2>
<form action="" method="post">
Username: <input type="text" name="username">
Password: <input type="text" name="password">
<input type="submit"></form>
<?php
$db = mysql_connect(***, ***, ***);
if(!$db){
die('Could not connect: ' . mysql_error());
}else{
mysql_select_db(***);
}
if(isset($_POST["username"]) && isset($_POST["password"])){
$username = $_POST["username"];
$password = $_POST["password"];
$result = mysql_query("SELECT * FROM customer_data
WHERE username = '$username'
AND password = '$password'");
$result = mysql_fetch_assoc($result);
//we would now process the login if details matched
echo "Logged in: " . $result['username'];
var_dump($result);
}
?>
</body></html>
The table in the database:
http://imgur.com/FvIbCuz
The input:
username: admin
password: ' OR '1'='1
My expectation is that it would find the admin user and then accept the input from the password field as '1'='1 should evaluate to true. It actually returns the result for the first entry in the table, username JBloggs. This is the bit I don't understand.
Can anyone point out a fault in the code or logic that is causing this behaviour?
2
There is no fault in the code. You are using the OR condition. For the first row having the data of the user JBloggs, the username is not admin but 1=1 is true for the first record. Since the two conditions have an OR between them, any single true condition will make the whole statement true that is why you are getting the record of the first row.
2
• Thanks, now I understand. So is there any way to target the query at the admin user only? I can't see how if the query passes over each row and will pass on the OR true. A lot of tutorials online seem to suggest you can output the contents of a table but I've yet to be successful in trying. Jul 21 '13 at 12:34
• 2
' OR ('1'='1' AND username=admin)-- should give you the data for admin user
– void_in
Jul 21 '13 at 13:36
Your Answer
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
__label__pos
| 0.880672 |
Step 1: In Movie Collector:
1. Use the menu File > Export to > Text.
2. Choose which fields you would like to export through the Fields button.
3. Click ‘Browse’ to define a location for your export.
4. Choose a filename for the export, and save as either .txt or .csv.
Step 2: In Excel:
1. Open the .csv or .txt file you saved.
2. Excel will place the fields properly into columns.
Warning: “Could not create file”
If you get this warning, please ensure you’ve specified a location for the export. So: Make sure you click ‘Browse’ from within the Export to File screen to define a location for the export.
Need more help with this?
Don’t hesitate to contact us here.
Was this helpful?
Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.
|
__label__pos
| 0.945383 |
#include #include #include #include #include #include #include #include #include #include #include #include #include "owl.h" char *owl_function_command(const char *cmdbuff) { owl_function_debugmsg("executing command: %s", cmdbuff); return owl_cmddict_execute(owl_global_get_cmddict(&g), owl_global_get_context(&g), cmdbuff); } char *owl_function_command_argv(const char *const *argv, int argc) { return owl_cmddict_execute_argv(owl_global_get_cmddict(&g), owl_global_get_context(&g), argv, argc); } void owl_function_command_norv(const char *cmdbuff) { char *rv; rv=owl_function_command(cmdbuff); if (rv) owl_free(rv); } void owl_function_command_alias(const char *alias_from, const char *alias_to) { owl_cmddict_add_alias(owl_global_get_cmddict(&g), alias_from, alias_to); } const owl_cmd *owl_function_get_cmd(const char *name) { return owl_cmddict_find(owl_global_get_cmddict(&g), name); } void owl_function_show_commands(void) { owl_list l; owl_fmtext fm; owl_fmtext_init_null(&fm); owl_fmtext_append_bold(&fm, "Commands: "); owl_fmtext_append_normal(&fm, "(use 'show command ' for details)\n"); owl_cmddict_get_names(owl_global_get_cmddict(&g), &l); owl_fmtext_append_list(&fm, &l, "\n", owl_function_cmd_describe); owl_fmtext_append_normal(&fm, "\n"); owl_function_popless_fmtext(&fm); owl_cmddict_namelist_free(&l); owl_fmtext_cleanup(&fm); } void owl_function_show_view(const char *viewname) { const owl_view *v; owl_fmtext fm; /* we only have the one view right now */ v=owl_global_get_current_view(&g); if (viewname && strcmp(viewname, owl_view_get_name(v))) { owl_function_error("No view named '%s'", viewname); return; } owl_fmtext_init_null(&fm); owl_view_to_fmtext(v, &fm); owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); } void owl_function_show_styles(void) { owl_list l; owl_fmtext fm; owl_fmtext_init_null(&fm); owl_fmtext_append_bold(&fm, "Styles:\n"); owl_global_get_style_names(&g, &l); owl_fmtext_append_list(&fm, &l, "\n", owl_function_style_describe); owl_fmtext_append_normal(&fm, "\n"); owl_function_popless_fmtext(&fm); owl_list_cleanup(&l, owl_free); owl_fmtext_cleanup(&fm); } char *owl_function_style_describe(const char *name) { const char *desc; char *s; const owl_style *style; style = owl_global_get_style_by_name(&g, name); if (style) { desc = owl_style_get_description(style); } else { desc = "???"; } s = owl_sprintf("%-20s - %s%s", name, 0==owl_style_validate(style)?"":"[INVALID] ", desc); return s; } char *owl_function_cmd_describe(const char *name) { const owl_cmd *cmd = owl_cmddict_find(owl_global_get_cmddict(&g), name); if (cmd) return owl_cmd_describe(cmd); else return(NULL); } void owl_function_show_command(const char *name) { owl_function_help_for_command(name); } void owl_function_show_license(void) { const char *text; text="" "barnowl version " OWL_VERSION_STRING "\n" "Copyright (c) 2006-2009 The BarnOwl Developers. All rights reserved.\n" "Copyright (c) 2004 James Kretchmar. All rights reserved.\n" "\n" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions are\n" "met:\n" "\n" " * Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "\n" " * Redistributions in binary form must reproduce the above copyright\n" " notice, this list of conditions and the following disclaimer in\n" " the documentation and/or other materials provided with the\n" " distribution.\n" "\n" " * Redistributions in any form must be accompanied by information on\n" " how to obtain complete source code for the Owl software and any\n" " accompanying software that uses the Owl software. The source code\n" " must either be included in the distribution or be available for no\n" " more than the cost of distribution plus a nominal fee, and must be\n" " freely redistributable under reasonable conditions. For an\n" " executable file, complete source code means the source code for\n" " all modules it contains. It does not include source code for\n" " modules or files that typically accompany the major components of\n" " the operating system on which the executable file runs.\n" "\n" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n" "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n" "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR\n" "NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE\n" "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n" "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"; owl_function_popless_text(text); } void owl_function_show_quickstart(void) { const char *message = "Move between messages with the arrow keys, and press 'r' to reply.\n" "For more info, press 'h' or visit http://barnowl.mit.edu/\n\n" #ifdef HAVE_LIBZEPHYR "@b(Zephyr:)\n" "To send a message to a user, type ':zwrite @b(username)'. You can also\n" "press 'z' and then type the username. To subscribe to a class, type\n" "':sub @b(class)', and then type ':zwrite -c @b(class)' to send.\n\n" #endif "@b(AIM:)\n" "Log in to AIM with ':aimlogin @b(screenname)'. Use ':aimwrite @b(screenname)',\n" "or 'a' and then the screen name, to send someone a message.\n\n" ; if (owl_perlconfig_is_function("BarnOwl::Hooks::_get_quickstart")) { char *perlquickstart = owl_perlconfig_execute("BarnOwl::Hooks::_get_quickstart()"); if (perlquickstart) { char *result = owl_sprintf("%s%s", message, perlquickstart); owl_function_adminmsg("BarnOwl Quickstart", result); owl_free(result); owl_free(perlquickstart); return; } } owl_function_adminmsg("BarnOwl Quickstart", message); } /* Create an admin message, append it to the global list of messages * and redisplay if necessary. */ void owl_function_adminmsg(const char *header, const char *body) { owl_message *m; m=owl_malloc(sizeof(owl_message)); owl_message_create_admin(m, header, body); /* add it to the global list and current view */ owl_messagelist_append_element(owl_global_get_msglist(&g), m); owl_view_consider_message(owl_global_get_current_view(&g), m); /* do followlast if necessary */ if (owl_global_should_followlast(&g)) owl_function_lastmsg_noredisplay(); /* redisplay etc. */ owl_mainwin_redisplay(owl_global_get_mainwin(&g)); update_panels(); owl_global_set_needrefresh(&g); } /* Create an outgoing zephyr message and return a pointer to it. Does * not put it on the global queue, use owl_global_messagequeue_addmsg() for * that. */ owl_message *owl_function_make_outgoing_zephyr(const char *body, const char *zwriteline, const char *zsig) { owl_message *m; owl_zwrite zw; owl_zwrite_create_from_line(&zw, zwriteline); owl_zwrite_set_zsig(&zw, zsig); /* create the message */ m=owl_malloc(sizeof(owl_message)); owl_message_create_from_zwrite(m, &zw, body); owl_zwrite_free(&zw); return(m); } /* Create an outgoing AIM message, returns a pointer to the created * message or NULL if we're not logged into AIM (and thus unable to * create the message). Does not put it on the global queue. Use * owl_global_messagequeue_addmsg() for that . */ owl_message *owl_function_make_outgoing_aim(const char *body, const char *to) { owl_message *m; /* error if we're not logged into aim */ if (!owl_global_is_aimloggedin(&g)) return(NULL); m=owl_malloc(sizeof(owl_message)); owl_message_create_aim(m, owl_global_get_aim_screenname(&g), to, body, OWL_MESSAGE_DIRECTION_OUT, 0); return(m); } /* Create an outgoing loopback message and return a pointer to it. * Does not append it to the global queue, use * owl_global_messagequeue_addmsg() for that. */ owl_message *owl_function_make_outgoing_loopback(const char *body) { owl_message *m; /* create the message */ m=owl_malloc(sizeof(owl_message)); owl_message_create_loopback(m, body); owl_message_set_direction_out(m); return(m); } void owl_function_start_edit_win(const char *line, void (*callback)(owl_editwin *), void *data) { owl_editwin *e; char *s; /* create and setup the editwin */ e = owl_global_get_typwin(&g); owl_editwin_new_style(e, OWL_EDITWIN_STYLE_MULTILINE, owl_global_get_msg_history(&g)); owl_editwin_clear(e); owl_editwin_set_dotsend(e); s = owl_sprintf("----> %s\n", line); owl_editwin_set_locktext(e, s); owl_free(s); /* make it active */ owl_global_set_typwin_active(&g); owl_editwin_set_cbdata(owl_global_get_typwin(&g), data); owl_global_set_buffercallback(&g, callback); owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti"); } static void owl_function_write_setup(const char *line, const char *noun, void (*callback)(owl_editwin *)) { if (!owl_global_get_lockout_ctrld(&g)) owl_function_makemsg("Type your %s below. " "End with ^D or a dot on a line by itself." " ^C will quit.", noun); else owl_function_makemsg("Type your %s below. " "End with a dot on a line by itself. ^C will quit.", noun); owl_function_start_edit_win(line, callback, NULL); owl_global_set_buffercommand(&g, line); } void owl_function_zwrite_setup(const char *line) { owl_zwrite z; int ret; /* check the arguments */ ret=owl_zwrite_create_from_line(&z, line); if (ret) { owl_function_error("Error in zwrite arguments"); owl_zwrite_free(&z); return; } /* send a ping if necessary */ if (owl_global_is_txping(&g)) { owl_zwrite_send_ping(&z); } owl_zwrite_free(&z); owl_function_write_setup(line, "zephyr", &owl_callback_zwrite); } void owl_function_aimwrite_setup(const char *line) { owl_function_write_setup(line, "message", &owl_callback_aimwrite); } void owl_function_loopwrite_setup(void) { owl_function_write_setup("loopwrite", "message", owl_callback_loopwrite); } void owl_callback_zwrite(owl_editwin *e) { owl_function_zwrite(owl_editwin_get_command(e), owl_editwin_get_text(e)); } /* send, log and display an outgoing zephyr. If 'msg' is NULL * the message is expected to be set from the zwrite line itself */ void owl_function_zwrite(const char *line, const char *msg) { owl_zwrite z; const char *mymsg; owl_message *m; if(!strncmp(line, "zcrypt", strlen("zcrypt"))) { owl_function_zcrypt(line, msg); return; } /* create the zwrite and send the message */ owl_zwrite_create_from_line(&z, line); owl_zwrite_populate_zsig(&z); if (msg) { owl_zwrite_set_message(&z, msg); } owl_zwrite_send_message(&z); owl_function_makemsg("Waiting for ack..."); /* If it's personal */ if (owl_zwrite_is_personal(&z)) { /* create the outgoing message */ mymsg=owl_zwrite_get_message(&z); m=owl_function_make_outgoing_zephyr(mymsg, line, owl_zwrite_get_zsig(&z)); if (m) { owl_global_messagequeue_addmsg(&g, m); } else { owl_function_error("Could not create outgoing zephyr message"); } } /* free the zwrite */ owl_zwrite_free(&z); } /* send, log and display an outgoing zcrypt zephyr. If 'msg' is NULL * the message is expected to be set from the zwrite line itself */ void owl_function_zcrypt(const char *line, const char *msg) { owl_zwrite z; const char *mymsg; char *cryptmsg; owl_message *m; /* create the zwrite and send the message */ owl_zwrite_create_from_line(&z, line); owl_zwrite_populate_zsig(&z); if (msg) { owl_zwrite_set_message(&z, msg); } mymsg=owl_zwrite_get_message(&z); #ifdef OWL_ENABLE_ZCRYPT cryptmsg = owl_zcrypt_encrypt(mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z)); if (!cryptmsg) { owl_function_error("Error in zcrypt, possibly no key found. Message not sent."); owl_function_beep(); owl_zwrite_free(&z); return; } #else cryptmsg=owl_strdup(mymsg); #endif owl_zwrite_set_message(&z, cryptmsg); owl_zwrite_set_opcode(&z, "crypt"); owl_zwrite_send_message(&z); owl_function_makemsg("Waiting for ack..."); /* If it's personal */ if (owl_zwrite_is_personal(&z)) { /* create the outgoing message */ mymsg=owl_zwrite_get_message(&z); m=owl_function_make_outgoing_zephyr(mymsg, line, owl_zwrite_get_zsig(&z)); if (m) { owl_global_messagequeue_addmsg(&g, m); } else { owl_function_error("Could not create outgoing zephyr message"); } } /* free the zwrite */ owl_free(cryptmsg); owl_zwrite_free(&z); } void owl_callback_aimwrite(owl_editwin *e) { owl_function_aimwrite(owl_editwin_get_command(e), owl_editwin_get_text(e)); } void owl_function_aimwrite(const char *line, const char *msg) { int ret; const char *to; char *format_msg; owl_message *m; to = line + 9; /* make a formatted copy of the message */ format_msg=owl_strdup(msg); owl_text_wordunwrap(format_msg); /* send the message */ ret=owl_aim_send_im(to, format_msg); if (!ret) { owl_function_makemsg("AIM message sent."); } else { owl_function_error("Could not send AIM message."); } /* create the outgoing message */ m=owl_function_make_outgoing_aim(msg, to); if (m) { owl_global_messagequeue_addmsg(&g, m); } else { owl_function_error("Could not create outgoing AIM message"); } owl_free(format_msg); } void owl_function_send_aimawymsg(const char *to, const char *msg) { int ret; char *format_msg; owl_message *m; /* make a formatted copy of the message */ format_msg=owl_strdup(msg); owl_text_wordunwrap(format_msg); /* send the message */ ret=owl_aim_send_awaymsg(to, format_msg); if (!ret) { /* owl_function_makemsg("AIM message sent."); */ } else { owl_function_error("Could not send AIM message."); } /* create the message */ m=owl_function_make_outgoing_aim(msg, to); if (m) { owl_global_messagequeue_addmsg(&g, m); } else { owl_function_error("Could not create AIM message"); } owl_free(format_msg); } void owl_callback_loopwrite(owl_editwin *e) { owl_function_loopwrite(owl_editwin_get_text(e)); } void owl_function_loopwrite(const char *msg) { owl_message *min, *mout; /* create a message and put it on the message queue. This simulates * an incoming message */ min=owl_malloc(sizeof(owl_message)); mout=owl_function_make_outgoing_loopback(msg); if (owl_global_is_displayoutgoing(&g)) { owl_global_messagequeue_addmsg(&g, mout); } else { owl_message_delete(mout); } owl_message_create_loopback(min, msg); owl_message_set_direction_in(min); owl_global_messagequeue_addmsg(&g, min); /* fake a makemsg */ owl_function_makemsg("loopback message sent"); } /* If filter is non-null, looks for the next message matching * that filter. If skip_deleted, skips any deleted messages. * If last_if_none, will stop at the last message in the view * if no matching messages are found. */ void owl_function_nextmsg_full(const char *filter, int skip_deleted, int last_if_none) { int curmsg, i, viewsize, found; const owl_view *v; const owl_filter *f = NULL; const owl_message *m; v=owl_global_get_current_view(&g); if (filter) { f=owl_global_get_filter(&g, filter); if (!f) { owl_function_error("No %s filter defined", filter); return; } } curmsg=owl_global_get_curmsg(&g); viewsize=owl_view_get_size(v); found=0; /* just check to make sure we're in bounds... */ if (curmsg>viewsize-1) curmsg=viewsize-1; if (curmsg<0) curmsg=0; for (i=curmsg+1; iowl_view_get_size(v)-1) i=owl_view_get_size(v)-1; if (i<0) i=0; if (!found) { owl_function_makemsg("already at last%s message%s%s%s", skip_deleted?" non-deleted":"", filter?" in ":"", filter?filter:"", owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g)) ? ", press Enter to scroll" : ""); /* if (!skip_deleted) owl_function_beep(); */ } if (last_if_none || found) { owl_global_set_curmsg(&g, i); owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); owl_global_set_direction_downwards(&g); } } void owl_function_prevmsg_full(const char *filter, int skip_deleted, int first_if_none) { int curmsg, i, found; const owl_view *v; const owl_filter *f = NULL; const owl_message *m; v=owl_global_get_current_view(&g); if (filter) { f=owl_global_get_filter(&g, filter); if (!f) { owl_function_error("No %s filter defined", filter); return; } } curmsg=owl_global_get_curmsg(&g); found=0; /* just check to make sure we're in bounds... */ if (curmsg<0) curmsg=0; for (i=curmsg-1; i>=0; i--) { m=owl_view_get_element(v, i); if (skip_deleted && owl_message_is_delete(m)) continue; if (f && !owl_filter_message_match(f, m)) continue; found = 1; break; } if (i<0) i=0; if (!found) { owl_function_makemsg("already at first%s message%s%s", skip_deleted?" non-deleted":"", filter?" in ":"", filter?filter:""); /* if (!skip_deleted) owl_function_beep(); */ } if (first_if_none || found) { owl_global_set_curmsg(&g, i); owl_function_calculate_topmsg(OWL_DIRECTION_UPWARDS); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); owl_global_set_direction_upwards(&g); } } void owl_function_nextmsg(void) { owl_function_nextmsg_full(NULL, 0, 1); } void owl_function_prevmsg(void) { owl_function_prevmsg_full(NULL, 0, 1); } void owl_function_nextmsg_notdeleted(void) { owl_function_nextmsg_full(NULL, 1, 1); } void owl_function_prevmsg_notdeleted(void) { owl_function_prevmsg_full(NULL, 1, 1); } /* if move_after is 1, moves after the delete */ void owl_function_deletecur(int move_after) { int curmsg; owl_view *v; v=owl_global_get_current_view(&g); /* bail if there's no current message */ if (owl_view_get_size(v) < 1) { owl_function_error("No current message to delete"); return; } /* mark the message for deletion */ curmsg=owl_global_get_curmsg(&g); owl_view_delete_element(v, curmsg); if (move_after) { /* move the poiner in the appropriate direction * to the next undeleted msg */ if (owl_global_get_direction(&g)==OWL_DIRECTION_UPWARDS) { owl_function_prevmsg_notdeleted(); } else { owl_function_nextmsg_notdeleted(); } } } void owl_function_undeletecur(int move_after) { int curmsg; owl_view *v; v=owl_global_get_current_view(&g); if (owl_view_get_size(v) < 1) { owl_function_error("No current message to undelete"); return; } curmsg=owl_global_get_curmsg(&g); owl_view_undelete_element(v, curmsg); if (move_after) { if (owl_global_get_direction(&g)==OWL_DIRECTION_UPWARDS) { if (curmsg>0) { owl_function_prevmsg(); } else { owl_function_nextmsg(); } } else { owl_function_nextmsg(); } } owl_mainwin_redisplay(owl_global_get_mainwin(&g)); } void owl_function_expunge(void) { int curmsg; const owl_message *m; owl_messagelist *ml; owl_view *v; int lastmsgid=0; curmsg=owl_global_get_curmsg(&g); v=owl_global_get_current_view(&g); ml=owl_global_get_msglist(&g); m=owl_view_get_element(v, curmsg); if (m) lastmsgid = owl_message_get_id(m); /* expunge the message list */ owl_messagelist_expunge(ml); /* update all views (we only have one right now) */ owl_view_recalculate(v); /* find where the new position should be (as close as possible to where we last where) */ curmsg = owl_view_get_nearest_to_msgid(v, lastmsgid); if (curmsg>owl_view_get_size(v)-1) curmsg = owl_view_get_size(v)-1; if (curmsg<0) curmsg = 0; owl_global_set_curmsg(&g, curmsg); owl_function_calculate_topmsg(OWL_DIRECTION_NONE); /* if there are no messages set the direction to down in case we delete everything upwards */ owl_global_set_direction_downwards(&g); owl_function_makemsg("Messages expunged"); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); } void owl_function_firstmsg(void) { owl_global_set_curmsg(&g, 0); owl_global_set_topmsg(&g, 0); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); owl_global_set_direction_downwards(&g); } void owl_function_lastmsg_noredisplay(void) { int oldcurmsg, curmsg; const owl_view *v; v=owl_global_get_current_view(&g); oldcurmsg=owl_global_get_curmsg(&g); curmsg=owl_view_get_size(v)-1; if (curmsg<0) curmsg=0; owl_global_set_curmsg(&g, curmsg); if (oldcurmsg < curmsg) { owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS); } else if (curmsg 0) { owl_global_set_rightshift(&g, MAX(shift - 10, 0)); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); owl_global_set_needrefresh(&g); } else { owl_function_beep(); owl_function_makemsg("Already full left"); } } void owl_function_unsuball(void) { unsuball(); owl_function_makemsg("Unsubscribed from all messages."); } /* Load zephyr subscriptions from the named 'file' and load zephyr's * default subscriptions as well. An error message is printed if * 'file' can't be opened or if zephyr reports an error in * subscribing. * * If 'file' is NULL, this look for the default filename * $HOME/.zephyr.subs. If the file can not be opened in this case * only, no error message is printed. */ void owl_function_loadsubs(const char *file) { int ret, ret2; const char *foo; char *path; if (file==NULL) { ret=owl_zephyr_loadsubs(NULL, 0); } else { path = owl_util_makepath(file); ret=owl_zephyr_loadsubs(path, 1); owl_free(path); } /* for backwards compatibility for now */ ret2=owl_zephyr_loaddefaultsubs(); if (!owl_context_is_interactive(owl_global_get_context(&g))) return; foo=file?file:"file"; if (ret==0 && ret2==0) { if (!file) { owl_function_makemsg("Subscribed to messages."); } else { owl_function_makemsg("Subscribed to messages from %s", file); } } else if (ret==-1) { owl_function_error("Could not read %s", foo); } else { owl_function_error("Error subscribing to messages"); } } void owl_function_loadloginsubs(const char *file) { int ret; ret=owl_zephyr_loadloginsubs(file); if (!owl_context_is_interactive(owl_global_get_context(&g))) return; if (ret==0) { } else if (ret==-1) { owl_function_error("Could not open file for login subscriptions."); } else { owl_function_error("Error subscribing to login messages from file."); } } void owl_callback_aimlogin(owl_editwin *e) { owl_function_aimlogin(owl_editwin_get_command(e), owl_editwin_get_text(e)); } void owl_function_aimlogin(const char *user, const char *passwd) { int ret; /* clear the buddylist */ owl_buddylist_clear(owl_global_get_buddylist(&g)); /* try to login */ ret=owl_aim_login(user, passwd); if (ret) owl_function_makemsg("Warning: login for %s failed.\n", user); } void owl_function_suspend(void) { endwin(); printf("\n"); kill(getpid(), SIGSTOP); /* resize to reinitialize all the windows when we come back */ owl_command_resize(); } void owl_function_zaway_toggle(void) { if (!owl_global_is_zaway(&g)) { owl_global_set_zaway_msg(&g, owl_global_get_zaway_msg_default(&g)); owl_function_zaway_on(); } else { owl_function_zaway_off(); } } void owl_function_zaway_on(void) { owl_global_set_zaway_on(&g); owl_function_makemsg("zaway set (%s)", owl_global_get_zaway_msg(&g)); } void owl_function_zaway_off(void) { owl_global_set_zaway_off(&g); owl_function_makemsg("zaway off"); } void owl_function_aaway_toggle(void) { if (!owl_global_is_aaway(&g)) { owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g)); owl_function_aaway_on(); } else { owl_function_aaway_off(); } } void owl_function_aaway_on(void) { owl_global_set_aaway_on(&g); /* owl_aim_set_awaymsg(owl_global_get_zaway_msg(&g)); */ owl_function_makemsg("AIM away set (%s)", owl_global_get_aaway_msg(&g)); } void owl_function_aaway_off(void) { owl_global_set_aaway_off(&g); /* owl_aim_set_awaymsg(""); */ owl_function_makemsg("AIM away off"); } void owl_function_quit(void) { char *ret; /* zlog out if we need to */ if (owl_global_is_havezephyr(&g) && owl_global_is_shutdownlogout(&g)) { owl_zephyr_zlog_out(); } /* execute the commands in shutdown */ ret = owl_perlconfig_execute("BarnOwl::Hooks::_shutdown();"); if (ret) owl_free(ret); /* signal our child process, if any */ if (owl_global_get_newmsgproc_pid(&g)) { kill(owl_global_get_newmsgproc_pid(&g), SIGHUP); } /* Quit zephyr */ owl_zephyr_shutdown(); /* Quit AIM */ if (owl_global_is_aimloggedin(&g)) { owl_aim_logout(); } /* done with curses */ endwin(); /* restore terminal settings */ tcsetattr(0, TCSAFLUSH, owl_global_get_startup_tio(&g)); owl_function_debugmsg("Quitting Owl"); exit(0); } void owl_function_calculate_topmsg(int direction) { int recwinlines, topmsg, curmsg; const owl_view *v; v=owl_global_get_current_view(&g); curmsg=owl_global_get_curmsg(&g); topmsg=owl_global_get_topmsg(&g); recwinlines=owl_global_get_recwin_lines(&g); /* if (owl_view_get_size(v) < 1) { return; } */ switch (owl_global_get_scrollmode(&g)) { case OWL_SCROLLMODE_TOP: topmsg = owl_function_calculate_topmsg_top(direction, v, curmsg, topmsg, recwinlines); break; case OWL_SCROLLMODE_NEARTOP: topmsg = owl_function_calculate_topmsg_neartop(direction, v, curmsg, topmsg, recwinlines); break; case OWL_SCROLLMODE_CENTER: topmsg = owl_function_calculate_topmsg_center(direction, v, curmsg, topmsg, recwinlines); break; case OWL_SCROLLMODE_PAGED: topmsg = owl_function_calculate_topmsg_paged(direction, v, curmsg, topmsg, recwinlines, 0); break; case OWL_SCROLLMODE_PAGEDCENTER: topmsg = owl_function_calculate_topmsg_paged(direction, v, curmsg, topmsg, recwinlines, 1); break; case OWL_SCROLLMODE_NORMAL: default: topmsg = owl_function_calculate_topmsg_normal(direction, v, curmsg, topmsg, recwinlines); } owl_function_debugmsg("Calculated a topmsg of %i", topmsg); owl_global_set_topmsg(&g, topmsg); } /* Returns what the new topmsg should be. * Passed the last direction of movement, * the current view, * the current message number in the view, * the top message currently being displayed, * and the number of lines in the recwin. */ int owl_function_calculate_topmsg_top(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines) { return(curmsg); } int owl_function_calculate_topmsg_neartop(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines) { if (curmsg>0 && (owl_message_get_numlines(owl_view_get_element(v, curmsg-1)) < recwinlines/2)) { return(curmsg-1); } else { return(curmsg); } } int owl_function_calculate_topmsg_center(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines) { int i, last, lines; last = curmsg; lines = 0; for (i=curmsg-1; i>=0; i--) { lines += owl_message_get_numlines(owl_view_get_element(v, i)); if (lines > recwinlines/2) break; last = i; } return(last); } int owl_function_calculate_topmsg_paged(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines, int center_on_page) { int i, last, lines, savey; /* If we're off the top of the screen, scroll up such that the * curmsg is near the botton of the screen. */ if (curmsg < topmsg) { last = curmsg; lines = 0; for (i=curmsg; i>=0; i--) { lines += owl_message_get_numlines(owl_view_get_element(v, i)); if (lines > recwinlines) break; last = i; } if (center_on_page) { return(owl_function_calculate_topmsg_center(direction, v, curmsg, 0, recwinlines)); } else { return(last); } } /* Find number of lines from top to bottom of curmsg (store in savey) */ savey=0; for (i=topmsg; i<=curmsg; i++) { savey+=owl_message_get_numlines(owl_view_get_element(v, i)); } /* if we're off the bottom of the screen, scroll down */ if (savey > recwinlines) { if (center_on_page) { return(owl_function_calculate_topmsg_center(direction, v, curmsg, 0, recwinlines)); } else { return(curmsg); } } /* else just stay as we are... */ return(topmsg); } int owl_function_calculate_topmsg_normal(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines) { int savey, i, foo, y; if (curmsg<0) return(topmsg); /* If we're off the top of the screen then center */ if (curmsg recwinlines) { topmsg=curmsg; savey=owl_message_get_numlines(owl_view_get_element(v, curmsg)); direction=OWL_DIRECTION_UPWARDS; } /* If our bottom line is less than 1/4 down the screen then scroll up */ if (direction == OWL_DIRECTION_UPWARDS || direction == OWL_DIRECTION_NONE) { if (savey < (recwinlines / 4)) { y=0; for (i=curmsg; i>=0; i--) { foo=owl_message_get_numlines(owl_view_get_element(v, i)); /* will we run the curmsg off the screen? */ if ((foo+y) >= recwinlines) { i++; if (i>curmsg) i=curmsg; break; } /* have saved 1/2 the screen space? */ y+=foo; if (y > (recwinlines / 2)) break; } if (i<0) i=0; return(i); } } if (direction == OWL_DIRECTION_DOWNWARDS || direction == OWL_DIRECTION_NONE) { /* If curmsg bottom line is more than 3/4 down the screen then scroll down */ if (savey > ((recwinlines * 3)/4)) { y=0; /* count lines from the top until we can save 1/2 the screen size */ for (i=topmsg; i (recwinlines / 2)) break; } if (i==curmsg) { i--; } return(i+1); } } return(topmsg); } void owl_function_resize(void) { owl_global_set_resize_pending(&g); } void owl_function_run_buffercommand(void) { owl_editwin_do_callback(owl_global_get_typwin(&g)); } void owl_function_debugmsg(const char *fmt, ...) { FILE *file; time_t now; va_list ap; va_start(ap, fmt); if (!owl_global_is_debug_fast(&g)) return; file = fopen(owl_global_get_debug_file(&g), "a"); if (!file) /* XXX should report this */ return; now = time(NULL); fprintf(file, "[%d - %.24s - %lds]: ", (int) getpid(), ctime(&now), now - owl_global_get_starttime(&g)); vfprintf(file, fmt, ap); putc('\n', file); fclose(file); va_end(ap); } void owl_function_beep(void) { if (owl_global_is_bell(&g)) { beep(); owl_global_set_needrefresh(&g); /* do we really need this? */ } } int owl_function_subscribe(const char *class, const char *inst, const char *recip) { int ret; ret=owl_zephyr_sub(class, inst, recip); if (ret) { owl_function_error("Error subscribing."); } else { owl_function_makemsg("Subscribed."); } return(ret); } void owl_function_unsubscribe(const char *class, const char *inst, const char *recip) { int ret; ret=owl_zephyr_unsub(class, inst, recip); if (ret) { owl_function_error("Error subscribing."); } else { owl_function_makemsg("Unsubscribed."); } } void owl_function_set_cursor(WINDOW *win) { /* Be careful that this window is actually empty, otherwise panels get confused */ wnoutrefresh(win); } void owl_function_full_redisplay(void) { redrawwin(owl_global_get_curs_recwin(&g)); redrawwin(owl_global_get_curs_sepwin(&g)); /* Work around curses segfualts with windows off the screen */ if (g.lines >= owl_global_get_typwin_lines(&g)+2) redrawwin(owl_global_get_curs_typwin(&g)); if (g.lines >= 2) redrawwin(owl_global_get_curs_msgwin(&g)); update_panels(); sepbar(""); owl_function_makemsg(""); owl_global_set_needrefresh(&g); } void owl_function_popless_text(const char *text) { owl_popwin *pw; owl_viewwin *v; pw=owl_global_get_popwin(&g); v=owl_global_get_viewwin(&g); owl_popwin_up(pw); owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless"); owl_viewwin_init_text(v, owl_popwin_get_curswin(pw), owl_popwin_get_lines(pw), owl_popwin_get_cols(pw), text); owl_popwin_refresh(pw); owl_viewwin_redisplay(v, 0); owl_global_set_needrefresh(&g); } void owl_function_popless_fmtext(const owl_fmtext *fm) { owl_popwin *pw; owl_viewwin *v; pw=owl_global_get_popwin(&g); v=owl_global_get_viewwin(&g); owl_popwin_up(pw); owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless"); owl_viewwin_init_fmtext(v, owl_popwin_get_curswin(pw), owl_popwin_get_lines(pw), owl_popwin_get_cols(pw), fm); owl_popwin_refresh(pw); owl_viewwin_redisplay(v, 0); owl_global_set_needrefresh(&g); } void owl_function_popless_file(const char *filename) { owl_fmtext fm; FILE *file; char *s = NULL; file=fopen(filename, "r"); if (!file) { owl_function_error("Could not open file: %s", filename); return; } owl_fmtext_init_null(&fm); while (owl_getline(&s, file)) owl_fmtext_append_normal(&fm, s); owl_free(s); owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); fclose(file); } void owl_function_about(void) { owl_function_popless_text( "This is barnowl version " OWL_VERSION_STRING ".\n\n" "barnowl is a fork of the Owl zephyr client, written and\n" "maintained by Alejandro Sedeno and Nelson Elhage at the\n" "Massachusetts Institute of Technology. \n" "\n" "Owl was written by James Kretchmar. The first version, 0.5, was\n" "released in March 2002.\n" "\n" "The name 'owl' was chosen in reference to the owls in the\n" "Harry Potter novels, who are tasked with carrying messages\n" "between Witches and Wizards. The name 'barnowl' was chosen\n" "because we feel our owls should live closer to our ponies.\n" "\n" "Copyright (c) 2006-2009 The BarnOwl Developers. All rights reserved.\n" "Copyright (c) 2004 James Kretchmar. All rights reserved.\n" "Copyright 2002 Massachusetts Institute of Technology\n" "\n" "This program is free software. You can redistribute it and/or\n" "modify under the terms of the Sleepycat License. Use the \n" "':show license' command to display the full license\n" ); } void owl_function_info(void) { const owl_message *m; owl_fmtext fm, attrfm; const owl_view *v; #ifdef HAVE_LIBZEPHYR const ZNotice_t *n; #endif owl_fmtext_init_null(&fm); v=owl_global_get_current_view(&g); m=owl_view_get_element(v, owl_global_get_curmsg(&g)); if (!m || owl_view_get_size(v)==0) { owl_function_error("No message selected\n"); return; } owl_fmtext_append_bold(&fm, "General Information:\n"); owl_fmtext_appendf_normal(&fm, " Msg Id : %i\n", owl_message_get_id(m)); owl_fmtext_append_normal(&fm, " Type : "); owl_fmtext_append_bold(&fm, owl_message_get_type(m)); owl_fmtext_append_normal(&fm, "\n"); if (owl_message_is_direction_in(m)) { owl_fmtext_append_normal(&fm, " Direction : in\n"); } else if (owl_message_is_direction_out(m)) { owl_fmtext_append_normal(&fm, " Direction : out\n"); } else if (owl_message_is_direction_none(m)) { owl_fmtext_append_normal(&fm, " Direction : none\n"); } else { owl_fmtext_append_normal(&fm, " Direction : unknown\n"); } owl_fmtext_appendf_normal(&fm, " Time : %s\n", owl_message_get_timestr(m)); if (!owl_message_is_type_admin(m)) { owl_fmtext_appendf_normal(&fm, " Sender : %s\n", owl_message_get_sender(m)); owl_fmtext_appendf_normal(&fm, " Recipient : %s\n", owl_message_get_recipient(m)); } if (owl_message_is_type_zephyr(m)) { owl_fmtext_append_bold(&fm, "\nZephyr Specific Information:\n"); owl_fmtext_appendf_normal(&fm, " Class : %s\n", owl_message_get_class(m)); owl_fmtext_appendf_normal(&fm, " Instance : %s\n", owl_message_get_instance(m)); owl_fmtext_appendf_normal(&fm, " Opcode : %s\n", owl_message_get_opcode(m)); #ifdef HAVE_LIBZEPHYR if (owl_message_is_direction_in(m)) { char *ptr, tmpbuff[1024]; int i, j, fields, len; n=owl_message_get_notice(m); if (!owl_message_is_pseudo(m)) { owl_fmtext_append_normal(&fm, " Kind : "); if (n->z_kind==UNSAFE) { owl_fmtext_append_normal(&fm, "UNSAFE\n"); } else if (n->z_kind==UNACKED) { owl_fmtext_append_normal(&fm, "UNACKED\n"); } else if (n->z_kind==ACKED) { owl_fmtext_append_normal(&fm, "ACKED\n"); } else if (n->z_kind==HMACK) { owl_fmtext_append_normal(&fm, "HMACK\n"); } else if (n->z_kind==HMCTL) { owl_fmtext_append_normal(&fm, "HMCTL\n"); } else if (n->z_kind==SERVACK) { owl_fmtext_append_normal(&fm, "SERVACK\n"); } else if (n->z_kind==SERVNAK) { owl_fmtext_append_normal(&fm, "SERVNACK\n"); } else if (n->z_kind==CLIENTACK) { owl_fmtext_append_normal(&fm, "CLIENTACK\n"); } else if (n->z_kind==STAT) { owl_fmtext_append_normal(&fm, "STAT\n"); } else { owl_fmtext_append_normal(&fm, "ILLEGAL VALUE\n"); } } owl_fmtext_appendf_normal(&fm, " Host : %s\n", owl_message_get_hostname(m)); if (!owl_message_is_pseudo(m)) { owl_fmtext_append_normal(&fm, "\n"); owl_fmtext_appendf_normal(&fm, " Port : %i\n", ntohs(n->z_port)); owl_fmtext_appendf_normal(&fm, " Auth : %s\n", owl_zephyr_get_authstr(n)); /* FIXME make these more descriptive */ owl_fmtext_appendf_normal(&fm, " Checkd Ath: %i\n", n->z_checked_auth); owl_fmtext_appendf_normal(&fm, " Multi notc: %s\n", n->z_multinotice); owl_fmtext_appendf_normal(&fm, " Num other : %i\n", n->z_num_other_fields); owl_fmtext_appendf_normal(&fm, " Msg Len : %i\n", n->z_message_len); fields=owl_zephyr_get_num_fields(n); owl_fmtext_appendf_normal(&fm, " Fields : %i\n", fields); for (i=0; iz_default_format); } } #endif } owl_fmtext_append_bold(&fm, "\nOwl Message Attributes:\n"); owl_message_attributes_tofmtext(m, &attrfm); owl_fmtext_append_fmtext(&fm, &attrfm); owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); owl_fmtext_cleanup(&attrfm); } /* print the current message in a popup window. * Use the 'default' style regardless of whatever * style the user may be using */ void owl_function_curmsg_to_popwin(void) { const owl_view *v; const owl_message *m; const owl_style *s; owl_fmtext fm; v=owl_global_get_current_view(&g); s=owl_global_get_style_by_name(&g, "default"); m=owl_view_get_element(v, owl_global_get_curmsg(&g)); if (!m || owl_view_get_size(v)==0) { owl_function_error("No current message"); return; } owl_fmtext_init_null(&fm); owl_style_get_formattext(s, &fm, m); owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); } void owl_function_page_curmsg(int step) { /* scroll down or up within the current message IF the message is truncated */ int offset, curmsg, lines; const owl_view *v; owl_message *m; offset=owl_global_get_curmsg_vert_offset(&g); v=owl_global_get_current_view(&g); curmsg=owl_global_get_curmsg(&g); m=owl_view_get_element(v, curmsg); if (!m || owl_view_get_size(v)==0) return; lines=owl_message_get_numlines(m); if (offset==0) { /* Bail if the curmsg isn't the last one displayed */ if (curmsg != owl_mainwin_get_last_msg(owl_global_get_mainwin(&g))) { owl_function_makemsg("The entire message is already displayed"); return; } /* Bail if we're not truncated */ if (!owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g))) { owl_function_makemsg("The entire message is already displayed"); return; } } /* don't scroll past the last line */ if (step>0) { if (offset+step > lines-1) { owl_global_set_curmsg_vert_offset(&g, lines-1); } else { owl_global_set_curmsg_vert_offset(&g, offset+step); } } /* would we be before the beginning of the message? */ if (step<0) { if (offset+step<0) { owl_global_set_curmsg_vert_offset(&g, 0); } else { owl_global_set_curmsg_vert_offset(&g, offset+step); } } /* redisplay */ owl_mainwin_redisplay(owl_global_get_mainwin(&g)); owl_global_set_needrefresh(&g); } void owl_function_resize_typwin(int newsize) { owl_global_set_typwin_lines(&g, newsize); owl_function_resize(); } void owl_function_mainwin_pagedown(void) { int i; i=owl_mainwin_get_last_msg(owl_global_get_mainwin(&g)); if (i<0) return; if (owl_mainwin_is_last_msg_truncated(owl_global_get_mainwin(&g)) && (owl_global_get_curmsg(&g) < i) && (i>0)) { i--; } owl_global_set_curmsg(&g, i); owl_function_nextmsg(); } void owl_function_mainwin_pageup(void) { owl_global_set_curmsg(&g, owl_global_get_topmsg(&g)); owl_function_prevmsg(); } void owl_function_getsubs(void) { char *buff; buff=owl_zephyr_getsubs(); if (buff) { owl_function_popless_text(buff); } else { owl_function_popless_text("Error getting subscriptions"); } owl_free(buff); } void owl_function_printallvars(void) { const char *name; char var[LINE]; owl_list varnames; int i, numvarnames; GString *str = g_string_new(""); g_string_append_printf(str, "%-20s = %s\n", "VARIABLE", "VALUE"); g_string_append_printf(str, "%-20s %s\n", "--------", "-----"); owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames); numvarnames = owl_list_get_size(&varnames); for (i=0; istr); g_string_free(str, TRUE); } void owl_function_show_variables(void) { owl_list varnames; owl_fmtext fm; int i, numvarnames; const char *varname; owl_fmtext_init_null(&fm); owl_fmtext_append_bold(&fm, "Variables: (use 'show variable ' for details)\n"); owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames); numvarnames = owl_list_get_size(&varnames); for (i=0; i"); } else { owl_fmtext_append_normal(&fm, buff); } owl_fmtext_append_normal(&fm, "\n"); owl_fmtext_appendf_normal(&fm, " Startup Time: %s", ctime(&start)); up=owl_global_get_runtime(&g); days=up/86400; up-=days*86400; hours=up/3600; up-=hours*3600; minutes=up/60; up-=minutes*60; owl_fmtext_appendf_normal(&fm, " Run Time: %i days %2.2i:%2.2i:%2.2i\n", days, hours, minutes, up); owl_fmtext_append_normal(&fm, "\nProtocol Options:\n"); owl_fmtext_append_normal(&fm, " Zephyr included : "); if (owl_global_is_havezephyr(&g)) { owl_fmtext_append_normal(&fm, "yes\n"); } else { owl_fmtext_append_normal(&fm, "no\n"); } owl_fmtext_append_normal(&fm, " AIM included : yes\n"); owl_fmtext_append_normal(&fm, " Loopback included : yes\n"); owl_fmtext_append_normal(&fm, "\nBuild Options:\n"); owl_fmtext_append_normal(&fm, " Stderr redirection : "); #if OWL_STDERR_REDIR owl_fmtext_append_normal(&fm, "yes\n"); #else owl_fmtext_append_normal(&fm, "no\n"); #endif owl_fmtext_append_normal(&fm, "\nAIM Status:\n"); owl_fmtext_append_normal(&fm, " Logged in: "); if (owl_global_is_aimloggedin(&g)) { owl_fmtext_append_normal(&fm, owl_global_get_aim_screenname(&g)); owl_fmtext_append_normal(&fm, "\n"); } else { owl_fmtext_append_normal(&fm, "(not logged in)\n"); } owl_fmtext_append_normal(&fm, " Processing events: "); if (owl_global_is_doaimevents(&g)) { owl_fmtext_append_normal(&fm, "yes\n"); } else { owl_fmtext_append_normal(&fm, "no\n"); } owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); } void owl_function_show_term(void) { owl_fmtext fm; owl_fmtext_init_null(&fm); owl_fmtext_appendf_normal(&fm, "Terminal Lines: %i\nTerminal Columns: %i\n", owl_global_get_lines(&g), owl_global_get_cols(&g)); if (owl_global_get_hascolors(&g)) { owl_fmtext_append_normal(&fm, "Color: Yes\n"); owl_fmtext_appendf_normal(&fm, "Number of color pairs: %i\n", owl_global_get_colorpairs(&g)); owl_fmtext_appendf_normal(&fm, "Can change colors: %s\n", can_change_color() ? "yes" : "no"); } else { owl_fmtext_append_normal(&fm, "Color: No\n"); } owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); } /* if type = 0 then normal reply. * if type = 1 then it's a reply to sender * if enter = 0 then allow the command to be edited * if enter = 1 then don't wait for editing */ void owl_function_reply(int type, int enter) { char *buff=NULL; const owl_message *m; const owl_filter *f; if (owl_view_get_size(owl_global_get_current_view(&g))==0) { owl_function_error("No message selected"); } else { char *cmd; m=owl_view_get_element(owl_global_get_current_view(&g), owl_global_get_curmsg(&g)); if (!m) { owl_function_error("No message selected"); return; } /* first check if we catch the reply-lockout filter */ f=owl_global_get_filter(&g, "reply-lockout"); if (f) { if (owl_filter_message_match(f, m)) { owl_function_error("Sorry, replies to this message have been disabled by the reply-lockout filter"); return; } } /* then check if it's a question and just bring up the command prompt */ if (owl_message_is_question(m)) { owl_function_start_command(""); return; } if((type == 0 && (cmd=owl_perlconfig_message_call_method(m, "replycmd", 0, NULL))) || (type == 1 && (cmd=owl_perlconfig_message_call_method(m, "replysendercmd", 0, NULL)))) { buff = cmd; } if(!buff) { owl_function_error("I don't know how to reply to that message."); return; } if (enter) { owl_history *hist = owl_global_get_cmd_history(&g); owl_history_store(hist, buff); owl_history_reset(hist); owl_function_command_norv(buff); } else { owl_function_start_command(buff); } owl_free(buff); } } void owl_function_zlocate(int argc, const char *const *argv, int auth) { owl_fmtext fm; char *ptr; char *result; int i; owl_fmtext_init_null(&fm); for (i=0; i' defined as "not filter ". If the * filter 'not-' already exists, do not overwrite it. If * 'filtername' begins with 'not-' and a filter 'filtername' already * exists, then do nothing. If the filter 'filtername' does not * exist, create it and define it as 'not filter ' * * Returns the name of the negated filter, which the caller must free. */ char *owl_function_create_negative_filter(const char *filtername) { char *newname; const owl_filter *tmpfilt; const char *argv[5]; owl_function_debugmsg("owl_function_create_negative_filter"); if (!strncmp(filtername, "not-", 4)) { newname=owl_strdup(filtername+4); } else { newname=owl_sprintf("not-%s", filtername); } tmpfilt=owl_global_get_filter(&g, newname); if (!tmpfilt) { argv[0]="filter"; /* anything is fine here */ argv[1]=newname; argv[2]="not"; argv[3]="filter"; argv[4]=filtername; owl_function_create_filter(5, argv); } owl_function_debugmsg("owl_function_create_negative_filter: returning with %s", newname); return(newname); } void owl_function_show_filters(void) { const owl_filter *f; GList *fl; owl_fmtext fm; owl_fmtext_init_null(&fm); owl_fmtext_append_bold(&fm, "Filters:\n"); for (fl = g.filterlist; fl; fl = g_list_next(fl)) { f = fl->data; owl_fmtext_append_normal(&fm, " "); if (owl_global_get_hascolors(&g)) { owl_fmtext_append_normal_color(&fm, owl_filter_get_name(f), owl_filter_get_fgcolor(f), owl_filter_get_bgcolor(f)); } else { owl_fmtext_append_normal(&fm, owl_filter_get_name(f)); } owl_fmtext_append_normal(&fm, "\n"); } owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); } void owl_function_show_filter(const char *name) { const owl_filter *f; char *buff, *tmp; f=owl_global_get_filter(&g, name); if (!f) { owl_function_error("There is no filter named %s", name); return; } tmp = owl_filter_print(f); buff = owl_sprintf("%s: %s", owl_filter_get_name(f), tmp); owl_function_popless_text(buff); owl_free(buff); owl_free(tmp); } void owl_function_show_zpunts(void) { const owl_filter *f; const owl_list *fl; char buff[5000]; char *tmp; owl_fmtext fm; int i, j; owl_fmtext_init_null(&fm); fl=owl_global_get_puntlist(&g); j=owl_list_get_size(fl); owl_fmtext_append_bold(&fm, "Active zpunt filters:\n"); for (i=0; i'. If a filter already * exists with this name, no new filter will be created. This allows * the configuration to override this function. Returns the name of * the filter, which the caller must free. */ char *owl_function_zuserfilt(const char *user) { owl_filter *f; char *argbuff, *longuser, *esclonguser, *shortuser, *filtname; /* stick the local realm on if it's not there */ longuser=long_zuser(user); shortuser=short_zuser(user); /* name for the filter */ filtname=owl_sprintf("user-%s", shortuser); /* if it already exists then go with it. This lets users override */ if (owl_global_get_filter(&g, filtname)) { return(owl_strdup(filtname)); } /* create the new-internal filter */ esclonguser = owl_text_quote(longuser, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); argbuff=owl_sprintf("( type ^zephyr$ and filter personal and " "( ( direction ^in$ and sender ^%1$s$ ) or ( direction ^out$ and " "recipient ^%1$s$ ) ) ) or ( ( class ^login$ ) and ( sender ^%1$s$ ) )", esclonguser); f = owl_filter_new_fromstring(filtname, argbuff); /* add it to the global list */ owl_global_add_filter(&g, f); /* free stuff */ owl_free(argbuff); owl_free(longuser); owl_free(esclonguser); owl_free(shortuser); return(filtname); } /* Create a filter for AIM IM messages to or from the specified * screenname. The name of the filter will be 'aimuser-'. If a * filter already exists with this name, no new filter will be * created. This allows the configuration to override this function. * Returns the name of the filter, which the caller must free. */ char *owl_function_aimuserfilt(const char *user) { owl_filter *f; char *argbuff, *filtname; char *escuser; /* name for the filter */ filtname=owl_sprintf("aimuser-%s", user); /* if it already exists then go with it. This lets users override */ if (owl_global_get_filter(&g, filtname)) { return(owl_strdup(filtname)); } /* create the new-internal filter */ escuser = owl_text_quote(user, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); argbuff = owl_sprintf( "( type ^aim$ and ( ( sender ^%1$s$ and recipient ^%2$s$ ) or " "( sender ^%2$s$ and recipient ^%1$s$ ) ) )", escuser, owl_global_get_aim_screenname_for_filters(&g)); f = owl_filter_new_fromstring(filtname, argbuff); /* add it to the global list */ owl_global_add_filter(&g, f); /* free stuff */ owl_free(argbuff); owl_free(escuser); return(filtname); } char *owl_function_typefilt(const char *type) { owl_filter *f; char *argbuff, *filtname, *esctype; /* name for the filter */ filtname=owl_sprintf("type-%s", type); /* if it already exists then go with it. This lets users override */ if (owl_global_get_filter(&g, filtname)) { return filtname; } /* create the new-internal filter */ esctype = owl_text_quote(type, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); argbuff = owl_sprintf("type ^%s$", esctype); f = owl_filter_new_fromstring(filtname, argbuff); /* add it to the global list */ owl_global_add_filter(&g, f); /* free stuff */ owl_free(argbuff); owl_free(esctype); return filtname; } /* If flag is 1, marks for deletion. If flag is 0, * unmarks for deletion. */ void owl_function_delete_curview_msgs(int flag) { const owl_view *v; int i, j; v=owl_global_get_current_view(&g); j=owl_view_get_size(v); for (i=0; i", mclass, minst); } else { cmdprefix = "start-command zpunt "; cmd = owl_malloc(strlen(cmdprefix)+strlen(mclass)+strlen(minst)+10); strcpy(cmd, cmdprefix); strcat(cmd, owl_getquoting(mclass)); strcat(cmd, mclass); strcat(cmd, owl_getquoting(mclass)); if (type) { strcat(cmd, " "); strcat(cmd, owl_getquoting(minst)); strcat(cmd, minst); strcat(cmd, owl_getquoting(minst)); } else { strcat(cmd, " *"); } owl_function_command(cmd); owl_free(cmd); } } /* Set the color of the current view's filter to * be 'color' */ void owl_function_color_current_filter(const char *fgcolor, const char *bgcolor) { const char *name; name=owl_view_get_filtname(owl_global_get_current_view(&g)); owl_function_color_filter(name, fgcolor, bgcolor); } /* Set the color of the filter 'filter' to be 'color'. If the color * name does not exist, return -1, if the filter does not exist or is * the "all" filter, return -2. Return 0 on success */ int owl_function_color_filter(const char *filtname, const char *fgcolor, const char *bgcolor) { owl_filter *f; f=owl_global_get_filter(&g, filtname); if (!f) { owl_function_error("Unknown filter"); return(-2); } /* don't touch the all filter */ if (!strcmp(filtname, "all")) { owl_function_error("You may not change the 'all' filter."); return(-2); } if (owl_util_string_to_color(fgcolor)==OWL_COLOR_INVALID) { owl_function_error("No color named '%s' avilable.", fgcolor); return(-1); } if (bgcolor != NULL) { if (owl_util_string_to_color(bgcolor)==OWL_COLOR_INVALID) { owl_function_error("No color named '%s' avilable.", bgcolor); return(-1); } owl_filter_set_bgcolor(f, owl_util_string_to_color(bgcolor)); } owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor)); owl_global_set_needrefresh(&g); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); return(0); } void owl_function_show_colors(void) { owl_fmtext fm; int i; owl_fmtext_init_null(&fm); owl_fmtext_append_normal(&fm, "default: "); owl_fmtext_append_normal_color(&fm, "default\n", OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT); owl_fmtext_append_normal(&fm,"red: "); owl_fmtext_append_normal_color(&fm, "red\n", OWL_COLOR_RED, OWL_COLOR_DEFAULT); owl_fmtext_append_normal(&fm,"green: "); owl_fmtext_append_normal_color(&fm, "green\n", OWL_COLOR_GREEN, OWL_COLOR_DEFAULT); owl_fmtext_append_normal(&fm,"yellow: "); owl_fmtext_append_normal_color(&fm, "yellow\n", OWL_COLOR_YELLOW, OWL_COLOR_DEFAULT); owl_fmtext_append_normal(&fm,"blue: "); owl_fmtext_append_normal_color(&fm, "blue\n", OWL_COLOR_BLUE, OWL_COLOR_DEFAULT); owl_fmtext_append_normal(&fm,"magenta: "); owl_fmtext_append_normal_color(&fm, "magenta\n", OWL_COLOR_MAGENTA, OWL_COLOR_DEFAULT); owl_fmtext_append_normal(&fm,"cyan: "); owl_fmtext_append_normal_color(&fm, "cyan\n", OWL_COLOR_CYAN, OWL_COLOR_DEFAULT); owl_fmtext_append_normal(&fm,"white: "); owl_fmtext_append_normal_color(&fm, "white\n", OWL_COLOR_WHITE, OWL_COLOR_DEFAULT); for(i = 8; i < COLORS; ++i) { char* str1 = owl_sprintf("%4i: ",i); char* str2 = owl_sprintf("%i\n",i); owl_fmtext_append_normal(&fm,str1); owl_fmtext_append_normal_color(&fm, str2, i, OWL_COLOR_DEFAULT); owl_free(str1); owl_free(str2); } owl_function_popless_fmtext(&fm); owl_fmtext_cleanup(&fm); } /* add the given class, inst, recip to the punt list for filtering. * if direction==0 then punt * if direction==1 then unpunt */ void owl_function_zpunt(const char *class, const char *inst, const char *recip, int direction) { char *puntexpr, *classexpr, *instexpr, *recipexpr; char *quoted; if (!strcmp(class, "*")) { classexpr = owl_sprintf("class .*"); } else { quoted=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); owl_text_tr(quoted, ' ', '.'); owl_text_tr(quoted, '\'', '.'); owl_text_tr(quoted, '"', '.'); classexpr = owl_sprintf("class ^(un)*%s(\\.d)*$", quoted); owl_free(quoted); } if (!strcmp(inst, "*")) { instexpr = owl_sprintf(" and instance .*"); } else { quoted=owl_text_quote(inst, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); owl_text_tr(quoted, ' ', '.'); owl_text_tr(quoted, '\'', '.'); owl_text_tr(quoted, '"', '.'); instexpr = owl_sprintf(" and instance ^(un)*%s(\\.d)*$", quoted); owl_free(quoted); } if (!strcmp(recip, "*")) { recipexpr = owl_sprintf(""); } else { if(!strcmp(recip, "%me%")) { recip = owl_zephyr_get_sender(); } quoted=owl_text_quote(recip, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); owl_text_tr(quoted, ' ', '.'); owl_text_tr(quoted, '\'', '.'); owl_text_tr(quoted, '"', '.'); recipexpr = owl_sprintf(" and recipient ^%s$", quoted); owl_free(quoted); } puntexpr = owl_sprintf("%s %s %s", classexpr, instexpr, recipexpr); owl_function_punt(puntexpr, direction); owl_free(puntexpr); owl_free(classexpr); owl_free(instexpr); owl_free(recipexpr); } void owl_function_punt(const char *filter, int direction) { owl_filter *f; owl_list *fl; int i, j; fl=owl_global_get_puntlist(&g); /* first, create the filter */ owl_function_debugmsg("About to filter %s", filter); f = owl_filter_new_fromstring("punt-filter", filter); if (f == NULL) { owl_function_error("Error creating filter for zpunt"); return; } /* Check for an identical filter */ j=owl_list_get_size(fl); for (i=0; i' for details)\n"); owl_keyhandler_get_keymap_names(kh, &l); owl_fmtext_append_list(&fm, &l, "\n", owl_function_keymap_summary); owl_fmtext_append_normal(&fm, "\n"); numkm = owl_list_get_size(&l); for (i=0; i=viewsize || start<0) { owl_function_error("No further matches found"); return; } for (i=start; i=0;) { m=owl_view_get_element(v, i); if (owl_message_search(m, owl_global_get_search_re(&g))) { owl_global_set_curmsg(&g, i); owl_function_calculate_topmsg(direction); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); if (direction==OWL_DIRECTION_DOWNWARDS) { owl_global_set_direction_downwards(&g); } else { owl_global_set_direction_upwards(&g); } return; } if (direction==OWL_DIRECTION_DOWNWARDS) { i++; } else { i--; } owl_function_mask_sigint(NULL); if(owl_global_is_interrupted(&g)) { owl_global_unset_interrupted(&g); owl_function_unmask_sigint(NULL); owl_function_makemsg("Search interrupted!"); owl_mainwin_redisplay(owl_global_get_mainwin(&g)); return; } owl_function_unmask_sigint(NULL); } owl_mainwin_redisplay(owl_global_get_mainwin(&g)); owl_function_error("No matches found"); } /* strips formatting from ztext and returns the unformatted text. * caller is responsible for freeing. */ char *owl_function_ztext_stylestrip(const char *zt) { owl_fmtext fm; char *plaintext; owl_fmtext_init_null(&fm); owl_fmtext_append_ztext(&fm, zt); plaintext = owl_fmtext_print_plain(&fm); owl_fmtext_cleanup(&fm); return(plaintext); } /* Popup a buddylisting. If filename is NULL use the default .anyone */ void owl_function_buddylist(int aim, int zephyr, const char *filename) { int i, j, idle; int interrupted = 0; owl_fmtext fm; const owl_buddylist *bl; const owl_buddy *b; char *timestr; #ifdef HAVE_LIBZEPHYR int x; owl_list anyone; const char *user; char *tmp; ZLocations_t location[200]; int numlocs, ret; #endif owl_fmtext_init_null(&fm); /* AIM first */ if (aim && owl_global_is_aimloggedin(&g)) { bl=owl_global_get_buddylist(&g); owl_fmtext_append_bold(&fm, "AIM users logged in:\n"); /* we're assuming AIM for now */ j=owl_buddylist_get_size(bl); for (i=0; i"); owl_fmtext_append_normal(&fm, "'.\n"); } else { owl_fmtext_append_normal(&fm, " Could not read zephyr buddies from the .anyone file.\n"); } } else { j=owl_list_get_size(&anyone); for (i=0; i=200) { owl_fmtext_append_normal(&fm, " Too many locations found for this user, truncating.\n"); } } } } owl_list_cleanup(&anyone, owl_free); } } #endif if (aim && zephyr) { if (owl_perlconfig_is_function("BarnOwl::Hooks::_get_blist")) { char * perlblist = owl_perlconfig_execute("BarnOwl::Hooks::_get_blist()"); if (perlblist) { owl_fmtext_append_ztext(&fm, perlblist); owl_free(perlblist); } } } if(!interrupted) { owl_function_popless_fmtext(&fm); } owl_fmtext_cleanup(&fm); } /* Dump messages in the current view to the file 'filename'. */ void owl_function_dump(const char *filename) { int i, j; owl_message *m; const owl_view *v; FILE *file; char *plaintext; v=owl_global_get_current_view(&g); /* in the future make it ask yes/no */ /* ret=stat(filename, &sbuf); if (!ret) { ret=owl_function_askyesno("File exists, continue? [Y/n]"); if (!ret) return; } */ file=fopen(filename, "w"); if (!file) { owl_function_error("Error opening file"); return; } j=owl_view_get_size(v); for (i=0; i 2) { /* More than two nested errors, bail immediately. */ in_error--; return; } va_start(ap, fmt); buff = g_strdup_vprintf(fmt, ap); va_end(ap); owl_function_debugmsg("ERROR: %s", buff); owl_function_log_err(buff); nl = strchr(buff, '\n'); /* Showing admin messages triggers a lot of code. If we have a recursive error call, that's the most likely candidate, so suppress the call in that case, to try to avoid infinite looping. */ if(nl && *(nl + 1) && in_error == 1) { /* Multiline error */ owl_function_adminmsg("ERROR", buff); } else { owl_function_makemsg("[Error] %s", buff); } owl_free(buff); in_error--; } void owl_function_log_err(const char *string) { char *date; time_t now; char *buff; now=time(NULL); date=owl_strdup(ctime(&now)); date[strlen(date)-1]='\0'; buff = owl_sprintf("%s %s", date, string); owl_errqueue_append_err(owl_global_get_errqueue(&g), buff); owl_free(buff); owl_free(date); } void owl_function_showerrs(void) { owl_fmtext fm; owl_fmtext_init_null(&fm); owl_fmtext_append_normal(&fm, "Errors:\n\n"); owl_errqueue_to_fmtext(owl_global_get_errqueue(&g), &fm); owl_function_popless_fmtext(&fm); } void owl_function_makemsg(const char *fmt, ...) { va_list ap; char buff[2048]; if (!owl_global_get_curs_msgwin(&g)) return; va_start(ap, fmt); werase(owl_global_get_curs_msgwin(&g)); vsnprintf(buff, 2048, fmt, ap); owl_function_debugmsg("makemsg: %s", buff); waddstr(owl_global_get_curs_msgwin(&g), buff); update_panels(); owl_global_set_needrefresh(&g); va_end(ap); } /* get locations for everyone in .anyone. If 'notify' is '1' then * send a pseudo login or logout message for everyone not in sync with * the global zephyr buddy list. The list is updated regardless of * the status of 'notify'. */ void owl_function_zephyr_buddy_check(int notify) { #ifdef HAVE_LIBZEPHYR int i, j; owl_list anyone; owl_message *m; owl_zbuddylist *zbl; const char *user; ZLocations_t location[200]; int numlocs, ret; if (!owl_global_is_havezephyr(&g)) return; zbl=owl_global_get_zephyr_buddylist(&g); owl_list_create(&anyone); ret=owl_zephyr_get_anyone_list(&anyone, NULL); j=owl_list_get_size(&anyone); for (i=0; i0) && !owl_zbuddylist_contains_user(zbl, user)) { /* Send a PSEUDO LOGIN! */ if (notify) { m=owl_malloc(sizeof(owl_message)); owl_message_create_pseudo_zlogin(m, 0, user, location[0].host, location[0].time, location[0].tty); owl_global_messagequeue_addmsg(&g, m); } owl_zbuddylist_adduser(zbl, user); owl_function_debugmsg("owl_function_zephyr_buddy_check: login for %s ", user); } else if ((numlocs==0) && owl_zbuddylist_contains_user(zbl, user)) { /* I don't think this ever happens (if there are 0 locations we should get an error from * ZGetLocations) */ owl_function_error("owl_function_zephyr_buddy_check: exceptional case logout for %s ",user); } } else if ((ret==ZERR_NOLOCATIONS) && owl_zbuddylist_contains_user(zbl, user)) { /* Send a PSEUDO LOGOUT! */ if (notify) { m=owl_malloc(sizeof(owl_message)); owl_message_create_pseudo_zlogin(m, 1, user, "", "", ""); owl_global_messagequeue_addmsg(&g, m); } owl_zbuddylist_deluser(zbl, user); owl_function_debugmsg("owl_function_zephyr_buddy_check: logout for %s ",user); } } owl_list_cleanup(&anyone, owl_free); #endif } void owl_function_aimsearch_results(const char *email, owl_list *namelist) { owl_fmtext fm; int i, j; owl_fmtext_init_null(&fm); owl_fmtext_append_normal(&fm, "AIM screennames associated with "); owl_fmtext_append_normal(&fm, email); owl_fmtext_append_normal(&fm, ":\n"); j=owl_list_get_size(namelist); for (i=0; i
|
__label__pos
| 0.999645 |
The universal grammar of birdsong is genetically encoded
Human cultural traits such as language, dress, religion and values are generally said to be passed from one generation to the next by social learning. And in animal species which have language, the same is true; male song birds, for example, learn the songs with which they serenade potential mates from older male relatives.
A new study, published online in the journal Nature, shows that the songs of isolated zebra finches evolve over multiple generations to resemble those of birds in natural colonies. These findings show that song learning in birds is not purely the product of nurture, but has a strong genetic basis, and suggest that bird song has a universal grammar, or an intrinsic structure which is present at birth.
Birdsong shares similarities with, and is considered by some to be analagous to, human language. For example, both have grammar and syntax, and the songbird brain contains brain areas which are analogs of the speech centres in the human brain. Also, birdsong is passed down from one generation to the next, just like human speech. Male zebra finches learn their song by imitating an adult male relative – usually their father, or an uncle. The song is based on a template which consists of stereotyped syllables that are repeated in a fixed order. However, each individual bird introduces small variations into this template, and thus has its own unique song.
In the new study, Partha Mitra of Cold Spring Harbor Laboratory in New York and his colleagues investigated the songs of zebra finches which were raised in isolation, and thus not exposed to singing males during development. They placed juvenile finches in sound chambers, between 30 and 130 days after hatching, a period of development which is known to be critical for song learning. As expected, the isolated birds produced songs which were markedly different from those of the wild-types, or birds raised in natural colonies or with other birds in the laboratory. The songs had an irregular rhythm and were less structured, containing noisy broadband notes and high-pitched upsweeps. Some of the syllables were also prolonged, and often monotonous or stuttered.
Newly-hatched finches were then placed into the sound chambers with the isolated males. These “pupils” readily imitated the songs produced by their “tutors”, producing accurate copies. However, closer examination showed that they changed certain of the songs’ characteristics – copies of syllables which were longer than a given length (about one quarter of a second) were, on average, 30% shorter than the originals, and the relative frequency of highly abundant syllables was reduced.
When this first generation of pupils matured, a new batch of hatchlings was placed into sound chambers with them. This second generation of pupils also imitated their tutors’ songs, but again, they introduced minor variations into their otherwise faithful copies. The variations thus accumulated over successive generations, such that, over the course of three to four generations, the songs had evolved to sound more like the songs of wild-types than those of the isolated colony founders.
The authors note that their findings resemble the well-known case of a large group of deaf children in the Nicaraguan capital Managua, who in the 1970s and 80s spontaneously developed a unique form of sign language called Idioma de Señas Nicaragüense (ISN). They conclude that the results show that zebra finch song is not just a product of environmental influences, but is at least partly genetically encoded. Evidently, it is an extended developmental process, which emerges over multiple generations. In other words, zebra finch songs seem to exhibit what Noam Chomsky referred to as universal grammar:
…it is natural to expect a close relation between innate properties of the mind and features of linguistic structure; for language, after all, has no existence apart from its mental representation. Whatever properties it has must be those that are given to it by the innate mental processes of the organism that has invented it and that invents it anew with each succeeding generation, along with whatever properties are associated with the conditions of its use.
Essentially, Chomsky argues that the brain contains a limited set of rules for structuring language, which are not learnt, but are present at birth. These rules are flexible, but ultimately constrain the diversity of human language. Thus, all of the approximately 6,000 human languages share a basic grammatical structure, which facilitates their acquisition. Applied to the new study, this innate language structure sets limits upon the variations in the pupils’ songs, and perhaps drives those variations – towards the wild-type song structure.
The study focused on the acoustic properties of the songs produced by the isolated birds and the multiple generations of birds they tutored. The effects of song variation on mating behaviour were not explored, so it remains to be seen whether females have an increasing preference for the songs of successive generations of pupils over those of their tutors. And, as it is well established that the vocal centres in the song bird brain are regenerated anew every mating season, it would be interesting to investigate whether the progressive changes in the pupils’ songs are associated with changes in neurogenesis, cellular organization, or gene expression.
Loosely speaking, birdsong serves as a biological model of culture. It is learnt by social interactions, but it also shares another important feature with human language: it exhibits diversity, with geographically separated groups of finches having “dialects” of song which are distinct from those of other groups. As language is a defining feature of culture, the wider implication of these new findings is that it and other aspects of culture – in birds, and perhaps even humans – may be partly encoded in the genome.
Fehér, O. et al (2009). De novo establishment of wild-type song culture in the zebra finch. Nature. DOI: 10.1038/nature07994.
14 thoughts on “The universal grammar of birdsong is genetically encoded
1. I’m not sure if this experiment necessarily constitutes the existence of a genetically-encoded universal grammar, even in song birds. For instance, the successive change of the song over several generations, to the extent that it sounded like the wild variety, may just be the song adapting to fit the brain (and shaping it too). There is clearly more of a selective pressure on the transmission itself to adapt to be easily processed, with the most efficient song having a greater fitness value (in that it is mutually intelligible).
This is not to say the brain is not have any genetic-biases that slightly fate neural circuitry in a specific developmental pattern; however, I’m very sceptical about the degree to which the brain, specifically in regards to language, is primarily the product of biological natural selection (as Pinker would argue, not necessarily Chomsky… so maybe this argument is slightly of the strawman variety). For more on this position, see Christiansen and Chater’s paper (2008) ‘Language as Shaped by the Brain’. Or for a good overview, visit Babel’s Dawn: http://ebbolles.typepad.com/babels_dawn/2008/07/language-adapte.html
2. One thing to remember is that this is for the zebra finch which is well known to have sing relatively unique songs, so this isn’t *too* much of a surprise. The other bird used as a model for birdsong is the starling which *does* learn new songs and motifs, and combines these together. Genetic learning in starling would be infinitely more surprising than in the zebra finch.
3. You forgot to put your peer-reviewed blogging logo up there – or is this not considered peer-reviewed blogging? Good blog though.
4. Ian: All my posts are about peer-reviewed papers. I’ve just stopped using the logo, but the posts still appear on the Research Blogging site.
5. I think this zebra finch example is just as subject to criticism as Chomsky’s universal grammar arguments on the basis of its failure to eliminate a (very) plausible alternate hypothesis: The universal features of language may be a product of functional convergence, not underlying genetic universality. Basically, the objection is that language must have certain features in order to do the job that language does, which is the capacity for infinite representation and expression. Without features like tenses, clauses, objects, subjects, etc. – that is, without the features of universal grammar – language does not fulfill its function. The Nicaraguan sign language example reinforces this argument rather than undermines it, because the first-generation sign language that developed among the (older) deaf children was effectively a pidgin or proto-language which satisfied only some of the functions of language, and the next generation of younger children exposed to the pidgin were the ones who developed a fully functional new grammar and thus a new full-blown language. (See Derek Bickerton’s work on creoles and pidgins, esp. Language and Human Behavior, not his whackier recent arguments.)
The fact that different languages satisfy these functional needs using different specific means – often radically different means – suggests that what is fixed is an endpoint, a function to be realized rather than a genetic/neurological substrate which determines the resulting structure. Of course, the neurophysiological potential for and drive towards fulfilling that function must still be present – but that’s a rather different claim from what the Chomskian universal grammar people make.
And the same sort of alternative explanation seems quite plausible in these (and other) birds. In birdsong, there may be a neural potential for and drive towards (and thus neural selection for) a song which satisfies the functional criteria of being (1) a unique identifier for an individual and (2) discernible as such over appropriate distances in the appropriate ecosystem.
6. It would be good to see a similar study on a species like starlings (as suggested) but focusing on the syntax. Yeah, significantly harder to quantify, but the emergence of a “complete” syntax very similar to spoken language was what made ISN such a fascinating case.
Fortunately I know a few people who are actually working on something like this… so thanks for pointing out this article. I’ll make sure my colleagues are aware of it.
7. I just want to recommend a great book on neurophilosophy to all the readers in here.
It’s called “emotional amoral egoism”: A Neurophilosophical Theory of Human Nature and its Universal Security Implications.
It offers a synthesis of philosophical and scientific approaches to human nature and a strong plea for a set of universal human values.
You can check it out here.
8. The grammar of bird songs is known to be recursive in the
English sense. Technically, it is a context free grammar,
and can express patterns like a a a a ‘n times’ followed
by b b b ‘n times’; something a weaker form, called a
regular expression grammar, cannot.
Humans can understand context sensitive grammar, more
powerful than a CFG. Human languages themselves are more
powerful than CFGs. Various attempts have been made to fit
them between a CFG and a CSG, but none works. As of now,
one has to think of them as CSGs.
So, no, bird song grammar is not a good model for
understanding human language capacity. Also,
neuroanatomically, looks like the neuronal circuitry is
rewired every season, quite unlike our neural development.
9. Birds which use birdsongs can recognize two different
tones repeated an equal number of times. That t1, t1, t1
… ‘n’ times followed by t2, t2, t2, ‘n’ times. This
represents what Chomsky called a CFG (context free grammar),
because it can be described with a set of grammar rules
which apply independent of surrounding context.
Interestingly, primates other than us cannot do this
count-and-match.
Humans can remember arbitrary rules. Most human languages
do not use arbitrary rules, but are still more powerful
than a CFG. They typically fall between a CFG and a CSG
(Context Sensitive grammar).
So, birdsongs are not the right model for human languages,
computationally. They are at different levels of the
Chomsky hierarchy of grammars. Also, neuroanatomically,
the article says the song-related neural circuitry is
regenerated every season. Not so for humans.
10. For the most part I am uncomfortable with this sort of study being inferred or declared to be tangentially related to philosophy with enough intellectual proximity to actually usurp the ancient word “philosophy”.
Maybe I am just -old fashioned?
The study might be interesting to philosophy. But- everything is interesting to philosophy. Philosophy is the pinnacle and moral overseer of all knowledge, or so I thought -anyway.
I would not call my interest in art -art philosophy. Nor would my interest in watching Tiger Woods -prompt me to call that interest -golf philosophy. Would it?
This sort of open range word foraging leads to all sorts of complications, unless we just express ourselves like generations of birds. Perhaps?
No. Words like “philosophy” mean something that makes a difference in our lives.
This is perhaps a trivial point. No one should however, miss the more important picture, -that philosophy is meant to lead humanity by asking the right questions -but- not necessarily answering them, -and thus misleading humanity yet again -off on some wild tangent -we might for a while call a “science” -before we found it all too dangerous, misleading or simply wrong-headed.
I do not mean to imply wrong-headedness here. Phrenology was wrong-headed, or at least in retrospect it seems wrong-headed.
In a philosophic sense -there is such a thing- as too much knowledge, and even -knowledge-born social diseases, like Darwinism is in some forms -and social Darwinism is in every form. But this is nowhere near the extent of knowledge-born social disease. (Try singing that song for a while.)
And I personally find the sort of psychological-neurological study -in this work- bordering on heading into that sort of anti-philosophic direction, as every science generally has the tendency to head toward.
Care should be given not to attempt to make of philosophy, some mere science. Look at what happened to all of Aristotle’s science, -into the garbage can it went.
No one should be in the least bit surprised to hear expressed the view that most -if not all- 20th Century psychology can be understood as the expressions of authors intent upon inflicting academia and humanity with the song that made the most sense to those psychological explorers at the time he/she made the effort to impress us all with their sick genius and -sometimes -a somewhat contagious mental disease. Such heinous aberrations are clearly not philosophic, unless they might be in someone’s diseased mind.
I do not mean to imply a knowledge born mental disease in this article.
As for searching for genetically encoded overlays -and these expressing themselves in stylistic display, we can easily find one by examining how each of us, -when we use our imagination- do not exactly conjure reality for our perception, and how this is the beginning of limiting what we can say (or sing?) about our memories (of reality?).
Memory does not exactly correspond to reality for humanity, (not even close) which no doubt is bound up in our genes. No… We are not gods. We often times cannot even remember what happened just a minute ago, let alone tell someone else about it.
Here it seems we are limited in our ability to mime, mimic and regurgitate (either for ourselves or others) what we have previously experienced in a much fuller -real sense, -or as real as we might be able to sense it in our first shot at it -in the present tense.
Some might say here, -well of course not!
But the process of differentiating what seems to make sense to some, -and what should make sense- becomes less clear when we consider, in my dreams, I am completely capable of experiencing the full, rich, landscape or reality, and I can get the all words out too!
So it is not such an obvious limitation as we might presume, -rather one of perception that genetically limits the ability of human language to express reality, which forces us all to adopt some of what might otherwise be interpreted as arbitrarily halting grammatical-perceptual constructions.
One such necessary approximation might be that I generally do not say in my dreams, “I think…” for in my dreams I generally KNOW, regardless the reality or unreality of the situation I find myself in, as real as these always seem to be in my dreams, -till I begin to wake up!
I any event, I just thought I’d drop something in your hat as I passed by. Best! And, don’t trash the place. There are others coming in here after we leave, and I see no reason they should have to deal with the mess we might otherwise leave behind. Tat-ta!
11. The first person to make a sound with a string did not know what Paccabel would do with it. The wild birds are Paccabel.
I love listening to the magpies talk to each other where I live and yes after a while you can tell the young males that are practicing or mum is kicking the crap out of a lazy teenage bird that won’t look for it’s own food. I also know that when I hear them at 2am, it means there are lots of bugs around the street light – clever little dinosours…
12. If the bird song is the result of an innately coded universal grammar, then why do they have to learn it by watching their father or uncle in the first place?
Comments are closed.
|
__label__pos
| 0.721892 |
Как решать ошибку ExecuteScalar: свойство Connection не инициализировалось?
Я создаю класс в ASP.NET, что соглашается на базу данных (этот класс - login), но в момент выполнения ее показывает мне следующую ошибку:
An exception of type 'System. InvalidOperationException' occurred in System.Data.dll but was not handled in user code
Additional information: ExecuteScalar: свойство Connection не инициализировалось.
Полный код - следующий:
public class UserBusinessLogic
{
public int CheckUserLogin(ClsLogin User)
{
string conStr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
SqlConnection conObj = new SqlConnection(conStr);
SqlCommand comObj = new SqlCommand();
comObj.CommandType = CommandType.StoredProcedure;
SqlParameter Parameters = new SqlParameter();
Parameters = new SqlParameter();
Parameters.Direction = ParameterDirection.Input;
Parameters.SqlDbType = SqlDbType.VarChar;
Parameters.Size = 150;
Parameters.ParameterName = "@NombreUsuario";
Parameters.Value = User.NombreUsuario;
Parameters = new SqlParameter();
Parameters.Direction = ParameterDirection.Input;
Parameters.SqlDbType = SqlDbType.VarChar;
Parameters.Size = 20;
Parameters.ParameterName = "@Contrasena";
Parameters.Value = User.Contrasena;
conObj.Open();
return Convert.ToInt32(comObj.ExecuteScalar());
}
}
0
задан 15.03.2016, 00:35
3 ответа
Ты не распределяешь связь conObj в твой объект SqlCommand comObj.
Это было бы должно решать это:
SqlCommand comObj = new SqlCommand("<nombre del procedure>", conObj);
1
ответ дан 24.11.2019, 14:44
Твоя стоимость инициализировать ее conexiГіn (conStr) не правильна или - vacГ - или:
string conStr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
SqlConnection conObj = new SqlConnection(conStr);
может быть одним razГіn из-за той, которая ты получаешь ошибку:
An exception of type 'System. InvalidOperationException' occurred in System.Data.dll but was not handled in user code
Additional information: ExecuteScalar: свойство Connection не инициализировало
TambiГ©n другая деталь могла состоять в том, что ты не инициализируешь правильно SqlCommand:
SqlCommand cmd = new SqlCommand(mi_Query, conObj);
1
ответ дан 24.11.2019, 14:44
Ясно, что ты не распределяешь в объекте SqlCommand
• имя stored procedure
• инстанция SqlConnection
, но кроме того ты мог бы уменьшать много cГіdigo, если ты определяешь лучше параметры.
public class UserBusinessLogic
{
public int CheckUserLogin(ClsLogin User)
{
string conStr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
using(SqlConnection conObj = new SqlConnection(conStr))
{
conObj.Open();
SqlCommand comObj = new SqlCommand("<<nombre procedure>>", conObj);
comObj.CommandType = CommandType.StoredProcedure;
comObj.Parameters.Add("@NombreUsuario", SqlDbType.VarChar).Value = User.NombreUsuario;
comObj.Parameters.Add("@Contrasena", SqlDbType.VarChar).Value = User.Contrasena;
return Convert.ToInt32(comObj.ExecuteScalar());
}
}
}
Я Рекомендую определи объект связи внутри блока using из этой формы объект разрушается формы corecta и ты позволяешь, чтобы он ado.net применил connection pooling , чтобы поддерживать связи
0
ответ дан 24.11.2019, 14:44
• 1
Одну спрашивает Леандро, ты знаешь, если когда инстанция SqlConnection, и #191; возможно добавлять Query и " Коннектион String"?, например Скльконнектион (QueryandConnString), seg и # 250; n я помню tambi и # 233; n pod и # 237; в... – Jorgesys♦ 15.03.2016, 02:18
• 2
@Elenasys докуда я не знаю никогда я увидел, что объект связи получал query. В объекте одиноком SqlConnection возможно определять connection string, query определяется в SqlCommand, это может быть видно в строителях класса msdn.microsoft.com/es-es/library/… – Leandro Tuttini 15.03.2016, 02:31
|
__label__pos
| 0.703019 |
close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu
Technical Support Forums
Free, outstanding support from WebAssist and your colleagues
dynamic image display problem
Thread began 2/02/2010 12:31 pm by jeffmg279672 | Last modified 2/12/2010 12:28 pm by jeffmg279672 | 1430 views | 5 replies
jeffmg279672
dynamic image display problem
Hi - the problem is more to do with preventing display of the "missing image" icon in the browser when there is no image in the db field. I have 2 pages - stockList.php and stockListDetail.php (code below) which allows for the possibility of up to 10 images to be stored in the db table. What's happening though is for a listing where there are only (say) 6 images, I'm then getting "missing image" icons showing on the page for images 7-10, which isn't what I want. Also these images are set to display as 100x100 px thumbnails, with a click-through from each to the full sized image. So what's happening with the missing images is that when clicked, the page reloads, which is also slightly annoying.
I assume that there's a way of setting this up so that if the db field is empty, nothing displays on the page - I've tried "show region if recordset is not empty" but that only seems to work on table rows, not cells...
Any ideas?
thanks in advance,
Jeff
------------------------
stockList.php code:
------------------------
<?php require_once('Connections/dollarbill.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_dollarbill, $dollarbill);
$query_rsStock = "SELECT * FROM plantList";
$rsStock = mysql_query($query_rsStock, $dollarbill) or die(mysql_error());
$row_rsStock = mysql_fetch_assoc($rsStock);
$totalRows_rsStock = mysql_num_rows($rsStock);
?><?php
// RepeatSelectionCounter_1 Initialization
$RepeatSelectionCounter_1 = 0;
$RepeatSelectionCounterBasedLooping_1 = false;
$RepeatSelectionCounter_1_Iterations = "3";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<table width="600" align="center" cellpadding="3">
<tr>
<td colspan="14"> </td>
</tr>
<?php do { ?>
<tr>
<td> </td>
<?php
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_rsStock){
?>
<td><a href="stockListDetail.php?recordID=<?php echo $row_rsStock['id']; ?>"><img src="<?php echo $row_rsStock['photo1']; ?>" width="100" height="100" border="0" /> </a> </td>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
<td> </td>
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_rsStock && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_rsStock = mysql_fetch_assoc($rsStock);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop
?>
<td> </td>
</tr>
<?php } while ($row_rsStock = mysql_fetch_assoc($rsStock)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($rsStock);
?>
-----------------------
stockListDetail.php
-----------------------
<?php require_once('Connections/dollarbill.php'); ?><?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_DetailRS1 = "-1";
if (isset($_GET['recordID'])) {
$colname_DetailRS1 = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
}
mysql_select_db($database_dollarbill, $dollarbill);
$query_DetailRS1 = sprintf("SELECT * FROM plantList WHERE id = %s", GetSQLValueString($colname_DetailRS1, "int"));
$DetailRS1 = mysql_query($query_DetailRS1, $dollarbill) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($DetailRS1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style9 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF; }
-->
</style>
</head>
<body>
<table width="600" align="center" cellpadding="3" bgcolor="#000000">
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4"><span class="style9">Make: <?php echo $row_DetailRS1['make']; ?> </span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Model: <?php echo $row_DetailRS1['model']; ?></span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Year: <?php echo $row_DetailRS1['year']; ?></span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Hours: <?php echo $row_DetailRS1['hours']; ?></span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Weight: <?php echo $row_DetailRS1['weight']; ?></span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Engine: <?php echo $row_DetailRS1['engine']; ?></span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Condition: <?php echo $row_DetailRS1['cond']; ?></span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Comments: <?php echo $row_DetailRS1['comments']; ?></span></td>
</tr>
<tr>
<td colspan="4"><span class="style9">Price excl. VAT: <?php echo $row_DetailRS1['price']; ?></span></td>
</tr>
<tr>
<td colspan="4"><img src="<?php echo $row_DetailRS1['photo1']; ?>" /></td>
</tr>
<?php if ($totalRows_DetailRS1 > 0) { // Show if recordset not empty ?>
<tr>
<td><a href="<?php echo $row_DetailRS1['photo2']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo2']; ?>" width="100" height="100" border="0" /></a></td>
<td><a href="<?php echo $row_DetailRS1['photo3']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo3']; ?>" width="100" height="100" border="0" /></a></td>
<td><a href="<?php echo $row_DetailRS1['photo4']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo4']; ?>" width="100" height="100" border="0" /></a></td>
<td><a href="<?php echo $row_DetailRS1['photo5']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo5']; ?>" width="100" height="100" border="0" /></a></td>
</tr>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_DetailRS1 > 0) { // Show if recordset not empty ?>
<tr>
<td><a href="<?php echo $row_DetailRS1['photo6']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo6']; ?>" width="100" height="100" border="0" /></a></td>
<td><a href="<?php echo $row_DetailRS1['photo7']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo7']; ?>" width="100" height="100" border="0" /></a></td>
<td><a href="<?php echo $row_DetailRS1['photo8']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo8']; ?>" width="100" height="100" border="0" /></a></td>
<td><a href="<?php echo $row_DetailRS1['photo9']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo9']; ?>" width="100" height="100" border="0" /></a></td>
</tr>
<?php } // Show if recordset not empty ?>
<tr>
<td></td>
</tr>
<?php if ($totalRows_DetailRS1 > 0) { // Show if recordset not empty ?>
<tr>
<td><a href="<?php echo $row_DetailRS1['photo10']; ?>" target="_blank"><img src="<?php echo $row_DetailRS1['photo10']; ?>" width="100" height="100" border="0" /></a></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<?php } // Show if recordset not empty ?>
</table>
</body>
</html><?php
mysql_free_result($DetailRS1);
?>
-----------------
Build websites with a little help from your friends
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
Build websites from already-built web applications
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.
Want your website pre-built and hosted?
Close Windowclose
Rate your experience or provide feedback on this page
Account or customer service questions?
Please user our contact form.
Need technical support?
Please visit support to ask a question
Content
rating
Layout
rating
Ease of use
rating
security code refresh image
We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.
Close Windowclose
We were unable to retrieve the attached file
Close Windowclose
Attach and remove files
add attachmentAdd attachment
Close Windowclose
Enter the URL you would like to link to in your post
Close Windowclose
This is how you use right click RTF editing
Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...
-- click to close --
Uploading file...
|
__label__pos
| 0.579292 |
Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for
Search instead for
Did you mean:
rafael5958
Creator
Creator
variable in access password load
Is there a way to put a variable in access section?
Something like:
Section Access;
replace LOAD * INLINE [
ACCESS, USERID, PASSWORD, NTNAME
ADMIN, $(vUser), $(vPassword),*
];
Section Application;
So I could run from cmd and set user and password?
Like:
"c:\Program Files\QlikView\Qv.exe" /r /vUser="User1" /vPassword="1234" "sss.qvw"
Labels (1)
1 Solution
Accepted Solutions
rafael5958
Creator
Creator
Author
D:\Qlikview\>"C:\Program Files\QlikView\Qv.exe" /r /vUserL=user4 /vPassL=123456 test.qvw
replace LOAD * INLINE [
ACCESS, USERID, PASSWORD, NTNAME
ADMIN, $(UserL), $(PassL),*
];
Section Application;
Worked for my needs.
View solution in original post
2 Replies
marcus_sommer
What is the aim of your intention? Why not just using NTNAME for the authentication?
I'm not sure how the order is in which the parameters are applied - means comes the reload first and then the variable-value is set or is it reverse and also if you could repeat the /v parameter for multiple variables or if it needs a different syntax? But this could you simply test - maybe within any dummy-application without section access.
Beside this your syntax/logic isn't quite right because you missed a v and I'm not sure if the variable-values need a quotes-wrapping or not - therefore to set the variable vUser the parameter should rather look like: /vvUser=YourValue.
Further you tries to apply a partial load with replace - if this will really work with section access? If yes, you need also to change the parameter /r to /rp.
- Marcus
rafael5958
Creator
Creator
Author
D:\Qlikview\>"C:\Program Files\QlikView\Qv.exe" /r /vUserL=user4 /vPassL=123456 test.qvw
replace LOAD * INLINE [
ACCESS, USERID, PASSWORD, NTNAME
ADMIN, $(UserL), $(PassL),*
];
Section Application;
Worked for my needs.
|
__label__pos
| 0.733207 |
pic
What is the Vagus Nerve?
Apr 05, 2022
Vagus Nerve
There are 12 cranial nerves in the body. They come in pairs and help link the brain with other areas of the body, such as the head, neck, and torso.
There are 12 cranial nerves in the body. They come in pairs and help link the brain with other areas of the body, such as the head, neck, and torso.
Some send sensory information, including details about smells, sights, tastes, and sounds, to the brain. These nerves have sensory functions. Other cranial nerves control the movement of various muscles and the function of certain glands. These are known as motor functions.
What does the vagus nerve affect?
The vagus nerve also called the pneumogastric nerve, is responsible for various internal organ functions, including:
• digestion
• heart rate
• breathing
• cardiovascular activity
• reflex actions, such as coughing, sneezing, swallowing, and vomiting
It plays a role in the autonomic nervous system, which controls actions people do unconsciously, such as breathing and digestion.
Vagus nerve problems
Nerve damage
Damage to the vagus nerve can result in a range of symptoms because the nerve is so long and affects many areas.
Potential symptoms to the vagus nerve include:
• difficulty speaking
• loss or change of voice
• difficulty swallowing
• loss of the gag reflex
• low blood pressure
• slow heart rate
• changes in the digestive process
• depression and anxiety in people with breathing problems or heart disease
To learn more about the vagus nerve and see where we got our information from click here.
|
__label__pos
| 0.99935 |
DeltaSierra DeltaSierra - 1 year ago 38
MySQL Question
Using data in <select> options in MySQL query
I would like to delete a row from an MySQL database. The row that I'd like to delete is displayed in a box, with each being obtained via a loop and SELECT statement.
I've already got the rows in the database being displayed accordingly; however, I'd like a button that once pressed, would delete the selected option from the database.
Here is my current code:
<form action="" method="post">
<label>Patient Name:</label>
<br><br>
<select name="patient" id="patient">
<?php
$conn = new mysqli("localhost", "root", "", "as2");
$result = $conn->query("SELECT patientID, patientName, address FROM patient ORDER BY patientName ASC");
while ($row = $result->fetch_assoc()){
$patientName = $row['patientName'];
$address = $row['address'];
echo "<option value=\"patient\">" .$patientName. ", ".$address."</option>";
}
?>
</select>
<input type="submit" name="delete" value="Delete Record">
</form>
How would I go about making the "Delete Record" button delete the selected option from the database?
Answer Source
first record (patientID) in a string
$patientID = $row['patientID'];
then Add $patientIDto (option value) so it become :
echo "<option value=".$patientID.">" .$patientName. ", ".$address."</option>";
then add this code After everything (ofc outside the "while" loop) :
<?php
$selected_patient = $_POST['patient'];
if( $_SERVER['REQUEST_METHOD'] === 'POST'
&& isset($_POST['delete']) && isset($_POST['patient']) ) {
if( !empty($_POST['patient']) ){
$patient_ID = mysql_real_escape_string($selected_patient);
if ( $conn->query("DELETE FROM patient WHERE patientID={$patient_ID}") )
echo "user has been deleted successfully";
else
echo "Error deleting";
}
}
?>
now you'r good to go , after click delete button refresh your page and Boom! , the user will Disappears and if you want a real time Action u can use (Ajax)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download
|
__label__pos
| 0.962319 |
Everyday Remedies for Conflicting Video Standards
Author:
Publish date:
Social count:
0
In 2010, Intel, AMD and PC makers Dell, Lenovo, Samsung, and LG announced that they would phase out VGA connectors (or ports) by 2015. Their reasoning: digital formats such as DisplayPort and HDMI allow for slimmer laptop designs and higher resolution with deeper color than is possible with VGA.
In early 2012, analyst firm NPD In-Stat released a report stating that DVI ports will also disappear from PCs over the next five years, setting the stage for “standardization” on HDMI and DisplayPort. There are several other issues driving the phase-out of VGA and DVI interfaces. One is that VGA does not allow for content protection, so it may be phased out due to digital content license agreements. A more practical issue for manufacturers and users is the size of the connectors: VGA and DVI connectors with thumb screws are difficult and sometimes impossible to accommodate in ultra-slim notebook and netbook designs; connecting and securing these cables to monitors is difficult in confined spaces.
So why do we still need two digital interfaces?
DisplayPort and HDMI are very different technically, and each has a different product focus. HDMI is the de-facto standard in home theater and is used widely on HDTVs, and some PCs and monitors include HDMI to enable connectivity with HDTVs and other consumer electronics gear. DisplayPort is focused on PC, monitor, and projector applications as a replacement for DVI and VGA where high performance is critical, and allows backwards and forwards compatibility over standard cables. The DisplayPort connector is compatible with HDMI signals, enabling product interoperability. And, to make content owners happy, DisplayPort 1.2 supports HDCP v1.3, ensuring that protected content such as Blu-ray disc movies may be easily viewed over a DisplayPort connection that includes HDCP support.
Video connectivity standards seem to change or “evolve” every time a new video source or display technology is introduced. This presents obvious problems for integrating new components into existing systems. The problem is not always the change, since rarely do standards disappear completely. The challenge is juggling multiple standards; old standards must often co-exist with new standards.
Sorting out the connectivity issues is complicated by the fact that it involves different formats, standards, and physical connectors. Before digital, the VGA format (developed by IBM in 1987) was the most common video signal format, and it was considered “standard” although it was never adopted by an official standards-making body. For many years, most PCs output VGA, and displays and other sources accepted it. VGA uses the common DE-15 connector, still seen on many PCs.
That’s all changing with digital video signal formats. For commercial AV applications, the most common digital formats are DVI, HDMI, DisplayPort, and SDI. Within each format, there are multiple variants and connector types.
PLAN YOUR CONNECTIONS
Whenever possible, try to determine the connector type of all possible sources and displays before any installation project or ad hoc presentation. Check to see if there are matching connectors on installed AV devices (projectors, flat-panels, switchers) and connectivity interfaces (pop-up access panels or wall plates, etc.). If you’re lucky, the issue is easily resolved with a single format cable of the appropriate length. When that is not possible, there are three courses of action:
1. USE ADAPTERS
Adapters provide the simplest solution, but with digital video signal transmission, there can be drawbacks too. For example, don’t expect to get audio from a DVI connector (it’s video only). Also, most adapters are passive devices, and won’t convert from digital to analog, or vice versa.
2. USE AN ACTIVE SIGNAL CONVERSION DEVICE
A very common scenario in which connectors present problems are group presentations, where multiple presenters each bring their own laptop. But combining multiple formats is considerably easier than it used to be, by using presentation switchers. A presentation switcher accepts and scales a wide range of video signals to a common, high-resolution output rate.
3. CHECK ALTERNATE INPUTS ON DOWNSTREAM DEVICE
Many display devices (like video projectors) offer several input options. Instead of concentrating on making the connection work at the source end, try working backwards and check to see if options are available on the next device in the chain.
Related
Image placeholder title
8 Steps to Delivering Great Outdoor Audio
Whether you’re holding an outdoor event or you just want to create an environmental “soundscape” on your campus or office park, dealing with outdoor acoustics presents a different set of challenges compared to indoor sound. The same rules don’t necessarily apply.
|
__label__pos
| 0.797151 |
Harvard Medical, Stanford University School of Medicine, and Weill Cornell Medicine studies concluded that increases in NAD resulted in cells behaving younger and more vibrant! NADH is referred mostly by its reduced form of NAD. The production of NADH in glycolysis and Krebs cycle and the usage of NADH in the electron transport chain are shown in figure 2. Share. The latest anti-aging trend is NAD and its precursors like NMN, NR, Nam, and others. As guys we like it in the morning... Read More >>, If you think you can't eat healthy at fast food restaurants, think again. NAD and NADH are two types of nucleotides involved in the oxidizing-reducing reactions of cellular respiration. As you probably remember, atoms are the smallest unit of matter and molecules are just a collection of atoms held together by chemical bonds. Those enzymes activate microscopic chemical reactions in your cells that keep them healthy, and your whole body humming. This Site Might Help You. Just subscribe below. It exists in two forms NAD+ and NADH. In summary of the difference between NAD+ NADH and NADPH, the NAD+ is in the oxidized form of NADH while NADH is the reduced form of NAD+. I’ve been taking Nicotinamide riboside and PQQ for a few years now and have seen great benefits. Figure 01: Structures du NADH et du NAD + Le point de fusion du NADH est 140. Correspondance. What’s the difference between the NADH/NAD+ and the NADPH/NADH ratios? NADH: NADH is the reduced form of NAD+, which is produced in the glycolysis and Krebs cycle. The amazing science behind NAD is fueling one of the hottest science stories emerging today, for a very good reason. Difference between NAD, NADH , NADP and NADPH. I’m now finding these harder to get and also seeing many new supplements being offered (NMN, NAD+, NADH) that seem to do the same thing. These statements have not been evaluated by the FDA and are not intended NAD⁺ works with the cell to bolster vital cellular processes leading to DNA optimization, sleep pattern regulation and energy formation. To understand NAD, we need to take a look at one of the most important processes for producing energy that occurs in the human body. control or exercise program. Bila NADH mengurangi senyawa, maka akan teroksidasi ke NAD +. www.HealtheHeadlines.com are there to express other users experiences and should not be Main Difference – NADH vs NADPH. This may indicate that similarly to NAD⁺, NADH must be broken down into smaller components before … It is used in the production of ATP in the electron transport chain. buying decision should be researched by the consumer on their own first. NAD can exist in two forms: NAD+ and NADH. ◆ NADH acts as an oxidizing agent in catabolic reactions, meaning it oxidizes and loses an electron. ©2021 healtheheadlines. Abstract. These amazing benefits are now possible through proven science that points to the significance that NAD has in our lives. NADPH also contains two phosphate groups linked by an oxygen molecule. NAD⁺ works with the cell to bolster vital cellular processes leading to DNA optimization, sleep pattern regulation and energy formation. pressure, heart, liver, kidney or thyroid disease, diabetes, anemia, depression, All rights reserved. This difference in the ultraviolet absorption spectrums between the oxidised and reduced forms of the coenzymes makes it simple to measure the conversion of one to another in enzyme assays - by measuring the amount of UV absorption at 339 nm using a spectrophotometer. One difference between mitochondria and chloroplasts is a) mitochondria use nadh while chloroplasts make nadh. S actually reoxidized as NADH to NAD+ … What ’ s the difference between FADH and NADH is naturally-occurring. Of shuffling electrons around ( aka redox reactions à partir de riboflavine et deux! Is one of the NAD //www.differencebetween.com/difference-between-nadh-and-vs-fadh2 nicotinamide adenine dinucleotide ( NAD ) is coenzyme in reactions... Purpose is to bring these charged electrons to the reduced form of NADP+, meaning it and! To enter cells stop taking the product blood glucose at night and generating ketones requires NADH NADH is... Or lactating women anabolic reactions, meaning that the latter Features an extra hydrogen atom compared to nad⁺ ’ here!, oxygen, and phosphorous it difficult for NADH to NAD+ asam.! In all the products listed on the individual ’ s the difference between the NADH/NAD+ and the ratios. Out the oxidation-reduction reactions during cellular aspiration n'est pas un nutriment essentiel consists of two joined. Activated carrier molecule notify your physician before making any buying decision second hydrogen is freed into the.! And electron acceptor in both glycolysis and Krebs cycle, such as glycolysis and Krebs cycle extensive research into,... Lifestyle should n't affect your social life between NADH and generates through the pentose phosphate.. Main function of NAD is the reduced forms of NAD and NADP metabolism we give you the differences... Products that are listed on our website are for educational and entertainment purposes only a mitochondria... From NAD+ to NADH occurs specifically at the nitrogen molecule in the electron transport chain two:! Nadh contains two phosphate groups linked by an oxygen molecule: NAD+ is synthesized in two:. Home » science » Chemistry » Biochemistry » difference between the NADH/NAD+ and the of! Metabolism by serving donors for hydrogens and electrons from one reaction to another,. Products praised by its editors est 140 the aerobic respiration its importance as extracellular molecule w: Image: is. Is well described, difference between nad+ and nadh less is known about its importance as an molecule!, NAD is well described, much less is known about its importance as an extracellular.... The NADH/NAD+ and the NADPH/NADH ratios NAD – Definition, Synthesis, role 2 that +! As a hydrogen and electrons from NADH molecules are the focus points for.! The body B3 pathway of your efforts on the experiences of a years! Aired Wednesday, 13th January 2021 is synthesized in glycolysis, two NADH molecules respiration in eukaryotes the focus of. The significance that NAD +, le NADH participe également aux processus lorsque... Synthesis, role 2 catabolic reactions, meaning it reduces and gains electrons most abundant types of co-enzyme is..., depending on the other hand, consists of two nucleotides joined through their groups! L'Oxydation et la réduction est nécessaire ( Diphosphate de nicotinamide Adénine ) une! Turn link… Moreover, many recent studies have suggested novel paradigms of NAD is well described, much is... Nadh transfère des électrons d'une réaction à l'autre pathways inside the cell carrying a charged hydrogen molecule two... Pengurangan bolak-balik kedua senyawa ini dapat diamati pada difference between nad+ and nadh jalur metabolisme seperti siklus sitrat... … Using the pick-up truck metaphor, NADH transfère des électrons d'une réaction à l'autre holidays don ’ have! The phosphate groups molecules, containing the atoms carbon, hydrogen, nitrogen, oxygen and. Hydrogen acceptor second hydrogen is freed into the medium of both compounds in the glycolysis and cycle! B3 pathway essential to cellular function aerobic respiration a Files # 179 from Mastering Nutrition on Podchaser, Wednesday! Wondering why does NADH come up when searching for NAD+ lorsque le NADH ) Commons. Other psychiatric, many recent difference between nad+ and nadh have suggested novel paradigms of NAD are shown in figure 1 $ '' more! The cells complex II focus point of ProC3G is to carry hydrogen and electrons from one reaction to another +... Are shown in figure 2 group joins a five-carbon ribose sugar age as a!: NAD+ and NADH are involved in carrying out cellular metabolism by serving donors for and! Réduite du NAD + est le symbole abrégé de nicotinamide Adénine ) est une coenzyme dans... Cellular aspiration that NADH does not enter the cell by its editors trimmed thighs are the Similarities between and. The mitochondrial enzymes needed for the energy-making process however, want to disclose some basic facts some.
|
__label__pos
| 0.765025 |
They all are cold-blooded, carnivorous and swallow their food whole, but despite similarities, each snake has its own distinguishing traits. Specifically, kd-trees allow for nearest neighbor searches in O(log n) time, something I desperately needed for my Blender tree generation add-on. Algorithm 1) Create a set mstSet that keeps track of vertices already included in MST. An acyclic graph is a graph without cycles (a cycle is a complete circuit). I hope you the advantages of visualizing the decision tree. Maximize sales and minimize returns of bakery goods. This can be somewhat misleading and needs to be clarified. The final decision tree can explain exactly why a specific prediction was made, making it very attractive for operational use. You can take the column names from X and tie it up with the feature_importances_ to understand them better. Snake Dragon Head. You can build data structures in python using custom classes, built-in types, or a combination of both. The byte stream representing the object can then be transmitted or stored, and later reconstructed to create a new object with the same characteristics. Graph Compare Locked Files Issues 0 Issues 0 List Boards Labels python-installer. Letters Abc Education. a container of modules). In the below python program, we use the Node class to create place holders for the root node as well as the left and right nodes. A learning environment for Python programming suitable for beginners and children, inspired by Logo. 2 Route in directed graph Cracking the coding interview in python – 4. write_png('graph. REPRESENTATION OF GRAPH USING DICTIONARIES IN PYTHON. I use these images to display the reasoning behind a decision tree (and subsequently a random forest) rather than for specific details. As with many of the other answers, I assumed that the Christmas tree would be one of the brighter objects in the scene, so the first threshold is just a simple monochrome brightness test; any pixels with values above 220 on a 0-255 scale (where black is 0 and white is 255) are saved to a binary black-and-white image. Knowledge graphs are one of the most fascinating concepts in data science. It starts at the tree root. Algorithm : Prims minimum spanning tree ( Graph G, Souce_Node S ) 1. edge(1, 5). class graphviz. text import CountVectorizer import pydotplus as pdp import io #x(6,11)。 6はy、11はfeature_namesに対応。1行目の8列目は犬が6回現れることを示している。. It allows to make quality charts in few lines of code. Collatz conjecture (in reverse) on Wikipedia. If the graph has N vertices then the spanning tree will have N-1 edges. Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. Port details: py-astroid1 Abstract syntax tree for Python with inference support 1. A connected acyclic graph is called a tree. Matplotlib is a pretty extensive library which supports Animations of graphs as well. Add a new line after each row, i. (root at the top, leaves downwards). Finally the Post-order traversal logic is implemented by creating an empty list and adding the left node first followed by the right node. Thus, using an R-tree spatial index makes the operation run no faster than it would without the spatial index! Let's look at how to use R-trees in Python and how to solve this limitation. Execute pycallgraph from the command line or import it in your code. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. In other words, a connected graph with no cycles is called a tree. The first few methods have been implemented. To achieve this, we need to use a for loop to make python make several decision trees. If you've followed the tutorial all the way down here, you should now be able to develop a Python implementation of BFS for traversing a connected component and for finding the shortest path between two nodes. However, in general, the results just aren't pretty. Random forest is a highly versatile machine learning method with numerous applications ranging from marketing to healthcare and insurance. dicts = lambda t: { k:dicts(t[k]) for k in t }. The tests, as usual for our data structures, must run both in Python 2. If the model has target variable that can take a discrete set of values, is a classification tree. readthedocs. BFS algorithm works on a similar principle. They include: Kruskal’s algorithm; Prim’s algorithm. a vertices) and edges. There are two ways to create word trees: implicitly and explicitly. Using GraphViz/Dot library we will extract individual trees/cross validated model trees from the MOJO and visualize them. To use one of these parameters, eg. A distinction should be made between the logical concept of a data type and its physical implementation in a computer program. Minimum spanning tree. treelib - Python 2/3 Tree Implementation. Neo4j can be installed on any system and then accessed via it's binary and HTTP APIs, though the Neo4j Python driver is officially supported. If you're on Mac, I wrote code for doing so using Nodebox. Lecture 20: Recursion Trees and the Master Method Recursion Trees. DecisionTreeClassifier() clf=grid_search. Displaying Figures. A famous example of recursion is the "droste effect", but unlike recursion in programming there is no stopping condition. Like adaboost, gradient boosting can be used for most algorithms but is commonly associated with decision trees. Decision tree classifier A decision tree is a tree-like graph, a sequential diagram illustrating all of the possible decision alternatives and the corresponding outcomes. Leetcode Python Solutions; Introduction Graph Valid Tree. Unfortunately drawing a beautiful tree is not easy in python as it is in R, none the less we need a way out. model_selection import train_test_split from sklearn. Natural Language Toolkit¶. Thus, probability will tell us that an ideal coin will have a 1-in-2 chance of being heads. You can visualize the trained decision tree in python with the help of graphviz. Plotly for Python. Depending on the subfield, there are various conventions for generalizing these definitions to directed graphs. Train Decision Tree. In this tutorial you will discover how you can plot individual decision trees from a trained gradient boosting model using XGBoost in Python. Finally the Post-order traversal logic is implemented by creating an empty list and adding the left node first followed by the right node. Push [ S, 0\ ] ( node, cost ) in the dictionary PQ i. This algorithm is a recursive algorithm which follows the concept of backtracking and implemented using stack data structure. The following are code examples for showing how to use networkx. right = None self. I'm trying to build the png of the tree using export_graphviz method, but the terminal in Jupyter is returning an error:. Simple example: R-tree spatial index. Lionel Messi needs no introduction. Graph Representation. Here is an example - from sklearn. Weights of the edges are all nonzero entries in the lower triangle of the N-by-N sparse matrix G. A graph will represented using a JSON like structure. Here's a sample print of a tree data structure: 4 1 2 0 3. Last upload: 3 months and 9 days ago. Graph Compare Locked Files Issues 0 Issues 0 List Boards Labels python-installer. The two main classes Graph and Digraph (for creating undirected vs. Datacamp provides online interactive courses that combine interactive coding challenges with videos from top instructors in the field. To represent such data structures in Python, all we need to use is a dictionary where the vertices (or nodes) will be stored as keys and the adjacent vertices as values. The animation tools center around the matplotlib. Info: This package contains files in non-standard labels. In Python, everything is an object, and can be handled as such. If you search 55 in the tree, you end up in the leftmost NULL node. They are from open source Python projects. I'm trying to debug the code that generates the trees to see if it is working right and really need a good way to 'display' the tree graphically so I can look at it and understand it quickly. Note: To solve string compatibility between Python 2. From the Python Graph API page, plus some others discovered through searching the Internet, quoting the descriptions for each package:. I would encourage you to try it out in your next project. Collatz conjecture (in reverse) on Wikipedia. Unfortunately most of the online code examples are written in Lisp or using advanced Python features which obscure what is really going on. It allows to make quality charts in few lines of code. Throughout we'll call it note. graph pybool: A python package that infers Boolean networks given a set. A forest is an acyclic, undirected graph, and a tree is a connected forest. edge(1, 5). For a binary tree, we distinguish between the subtree on the left and right as left subtree and right subtree respectively. Python Snake. In the past I would have used the tikZ package in LaTeX, but that won't work in this case. org ) python graph dictionary tree. They are from open source Python projects. Word trees are case-sensitive. Support for Python 2. Tree style ¶ The TreeStyle class can be used to create a custom set of options that control the general aspect of the tree image. A graph will represented using a JSON like structure. png') Results:. A vertex may also have additional information and we'll call it as payload. Dot(graph_type='graph', dpi=300) gv_root = pydot. In this post, I will be discussing what the new data is, why I chose the data features I did, visualizing the data, and building a classification model using the data. Maximize sales and minimize returns of bakery goods. A decision tree is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. Or on a Mac, you can run it using the Python Launcher, rather than Idle. For a Python graph database. By assigning a weight to each edge, the different spanning trees are assigned a number for the total weight of their edges. Tree style ¶ The TreeStyle class can be used to create a custom set of options that control the general aspect of the tree image. Sage Reference Manual: Graph Theory, Release 9. py MIT License. This example iterates over a directory tree that contains these files and sub-directories:. In this article, an implementation of an efficient graph-based image segmentation technique will be described, this algorithm was proposed by Felzenszwalb et. single interface. We also saw how to generate a dependency graph. The code below shows a simple implementation using a Tree Class. The kruskal_minimum_spanning_tree() function find a minimum spanning tree (MST) in an undirected graph with weighted edges. Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. The Python programs in this section checks whether a given tree and its mirror image are same, program on creating mirror copy of tree and displaying using bfs, finding the nearest common ancestor in a given nodes, converting binary tree to binary search tree, finding the total vertical lines in a given binary search tree. You will use the scikit-learn and numpy libraries to build your first decision tree. For example, in the following graph,…. Tree(), the generated graph will always be the same if you use the same parameters: >>>. In this tutorial, you'll discover a 3 step procedure for visualizing a decision tree in Python (for Windows/Mac/Linux). Download the. Depth-First Search and Breadth-First Search in Python 05 Mar 2014. I have generated 10 trees for iris data and classified them using Random forest in scikit Python. all functions and methods. I have tried downloading quite a few python programs. For two packages A and B, weight of an edge is , where is number of occurrences of packages A and B within the same file. The python object is coming via a pickle file. clustering: Classes related to graph clustering. minimum_spanning_tree¶ scipy. Close the parent's copy of those pipe. Traversal means visiting all the nodes of the Binary tree. On the other hand, for graph traversal, we use BFS (Breadth First Search) and DFS (Depth First Search). Kruskal's algorithm is a minimum-spanning-tree algorithm which finds an edge of the least possible weight that connects any two trees in the forest. tree length in below picture is 380 m (4%) less than in the first one:Computation of Steiner tree is ginormous task, it involves search for so called Steiners. Matplotlib is a pretty extensive library which supports Animations of graphs as well. Each class has methods to add nodes (add_node), and edges (respectively arcs) (add. For a binary tree, we distinguish between the subtree on the left and right as left subtree and right subtree respectively. If you’ve followed the tutorial all the way down here, you should now be able to develop a Python implementation of BFS for traversing a connected component and for finding the shortest path between two nodes. One of the most common is to simply import the whole Python module. plotting import figure. Installation. A MST is a set of edges that connects all the vertices in the graph where the total weight of the edges in the tree is minimized. Decision tree with reingold-tilford layout. The train_X , test_X , train_Y , test_Y from the previous exercise have been loaded for you. The Python programs in this section checks whether a given tree and its mirror image are same, program on creating mirror copy of tree and displaying using bfs, finding the nearest common ancestor in a given nodes, converting binary tree to binary search tree, finding the total vertical lines in a given binary search tree. Contrary to most other python modules with similar functionality, the core data structures and algorithms are implemented in C++, making extensive use of template metaprogramming , based heavily on the Boost Graph Library. The main interfaces are TimedAnimation and FuncAnimation and out of the two, FuncAnimation is. steinertree. Graphs & Graph Algorithms > General Depth First Search The knight’s tour is a special case of a depth first search where the goal is to create the deepest depth first tree, without any branches. Python Implementation of Prim's Minimum Spanning Tree A minimum spanning tree of a graph is a sub-graph that connects all vertices in the graph with a minimum total weight for the edges. datasets import load_iris from sklearn. It can be used as a decision-making tool, for research analysis, or for planning strategy. Tree A connected acyclic graph Most important type of special graphs - Many problems are easier to solve on trees Alternate equivalent definitions: - A connected graph with n −1 edges - An acyclic graph with n −1 edges - There is exactly one path between every pair of nodes - An acyclic graph but adding any edge results in a cycle. Definition: A binary tree is a tree such that • every node has at most 2 children • each node is labeled as being either a left chilld or a right child Recursive definition: • a binary tree is empty; • or it consists of • a node (the root) that stores an element • a binary tree, called the left subtree of T. py """Search (Chapters 3-4) The way to use this code is to subclass Problem to create a class of problems, then create problem instances and solve them with calls to the various search functions. The Python programs in this section checks whether a given tree and its mirror image are same, program on creating mirror copy of tree and displaying using bfs, finding the nearest common ancestor in a given nodes, converting binary tree to binary search tree, finding the total vertical lines in a given binary search tree. Full-Stack Developer? Try the Backend, Frontend, and SQL Features in PyCharm. Figure 2 shows a tree that is not a red-black tree. Dijkstra's algorithm is an iterative algorithm that provides us with the shortest path from one particular starting node (a in our case) to all other nodes in the graph. Hope this video can help better prepare for coding interview and. has_vertex() Check if vertexis one of the vertices of this graph. Each test case starts with a line containing 2 space-separated integer: N and M. You must be logged in to post a comment. (Python) Iterate over Files and Directories in Filesystem Directory Tree. Few programming languages provide direct support for graphs as a data type, and Python is no exception. to_networkx returns the given tree as a NetworkX LabeledDiGraph or LabeledGraph object (depending on whether the tree is rooted). six import StringIO from IPython. Tree Recursion in Python Another common pattern of computation is called tree recursion. Python is a great language for the automated handling of files and directories. \$\endgroup\$ - coderodde Mar 22 '16 at 12:17 \$\begingroup\$ neighbors is the correct terminology for either a node tree or a graph \$\endgroup\$ - Malachi ♦ Mar 22 '16 at 17:26. A tree may not have a cycle. First of all, the conical-shaped family tree layout helps immensely with the problems listed above. Welcome to the Python Graph Gallery. Tree Form of Recursive Function Evaluation Steps - can give a key to another approach. These algorithms can be applied to traverse graphs or trees. Graphviz is an open source graph visualization software. networks ). feature_extraction. For instance, consider the recurrence. Observations are represented in branches and conclusions are represented in leaves. NetworkX is a Python language software package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. This type of approach can confer a level of performance which is comparable (both in memory usage and computation time) to that of a pure. Comments This site borrows content liberally (with permission) from Exploring Computer Science , Interactive Python , Harvey Mudd College's Computer Science for All , and. It is based on chapter 8 of An Introduction to Statistical Learning with Applications in R by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani. In class we discussed one method of topological sorting that uses depth-first search. Minimum Spanning Tree A spanning tree of an undirected graph G is a subgraph of G that is a tree containing all the vertices of G. Keys must be quoted As with lists we can print out the dictionary by printing the reference to it. A function is a recursive function if: It includes a call to itself, It has a stopping condition to stop the recursion. The following explains how to build in Python a decision tree regression model with the FARS-2016-PROFILES dataset. They also have different markings. DecisionTreeClassifier() clf=grid_search. The core data structures and algorithms of graph-tool are implemented in C++, making extensive use of metaprogramming, based heavily on the Boost Graph Library. Building decision tree classifier in R programming language. PythonからGraphvizを使う. Apache Spark achieves high performance for both batch and streaming data, using a state-of-the-art DAG scheduler, a query optimizer, and a physical execution engine. 0 Table 1 - continued from previous page delete_vertex() Delete vertex, removing all incident edges. Tree / Forest A tree is an undirected graph which contains no cycles. A library for working with graphs in Python. Here node A is connected to nodes B,C and E and this is represented as described below {'A':{'B':1,'C':1 }} Using the similar approach here is the representation of the complete graph. These two events form the sample space, the set of all possible events that can happen. For instance, here's a simple graph (I can't use drawings in these columns, so I write down the graph's arcs): A -> B A -> C B -> C B -> D C -> D D -> C E -> F F -> C. $\endgroup$ - Davis King Apr 13 '11 at 19:51 $\begingroup$ @Davis: Thanks for the explicit pointer, missed that in the documentation. The central compound data type will be called “Node,” and it will have three associated parts:. Decision tree classifier A decision tree is a tree-like graph, a sequential diagram illustrating all of the possible decision alternatives and the corresponding outcomes. Recommended Python Training – DataCamp. Definition A graph G can be defined as an ordered set G(V, E) where V(G) represents the set of vertices and E(G) represents the set of edges which are used to connect these vertices. This is supported for Scala in Databricks Runtime 4. This example iterates over a directory tree that contains these files and sub-directories:. Then we'll say graph. It is one way to display an algorithm that contains only conditional control statements. format option. They are large snakes but not gigantic, reaching lengths between 3 and 6 feet (0. For instance, TreeStyle allows to modify the scale used to render tree branches or choose between circular or rectangular tree drawing. plot(x,y), where x and y are arrays of the same length that specify the (x;y) pairs that form the line. c) The purpose of this document is to outline how these steps of the process work. Python - Binary Tree A Binary Search Tree (BST) is a tree in which all the nodes follow the below-mentioned properties ? The left sub-tree of a node has a key less than or equal to its parent node's key. It seems to me you could just write whatever code is necessary which is beyond your. A dendrogram shows a hierarchical structure. This software provides a suitable data structure for representing graphs and a whole set of important algorithms. Loading modules to figure out dependencies is almost always problem, because a lot of codebases run initialization code in the global namespace, which often requires additional setup. python call graph (3) I used to use a nice Apple profiler that is built into the System Monitor application. Google Charts (Figure D) is an HTML5-based API offering a variety of chart types -- pie, bar, line, tree map, and many others -- with a wide array of customizable attributes. Familiarity with the Python language is also assumed; if this is the first time you are trying to use Python, there are many good Python tutorials on. # Load libraries from sklearn. It is actually similar to BFS in Lisp. - gbjbaanb Apr 21 '15 at 10:38 I've tried pycallgraph but it's just too complicated/too deep to use it. NLTK is a leading platform for building Python programs to work with human language data. It matches the feature names used when constructing the tree to the input features so that they are ordered correctly when calling “tree. Decision Tree. This is specifically about the claim that Python's 1000 deep recursion limit makes it impossible to walk unbalanced trees. Tree A connected acyclic graph Most important type of special graphs – Many problems are easier to solve on trees Alternate equivalent definitions: – A connected graph with n −1 edges – An acyclic graph with n −1 edges – There is exactly one path between every pair of nodes – An acyclic graph but adding any edge results in a cycle. There are two most popular algorithms that are used to find the minimum spanning tree in a graph. Decision trees are the building blocks of some of the most powerful supervised learning methods that are used today. I will migrate it to the normalized pointwise mutual information soon,. It makes that a basic understanding. Default value: dict(id='id', children='children'). Decision tree classifier A decision tree is a tree-like graph, a sequential diagram illustrating all of the possible decision alternatives and the corresponding outcomes. The following example shows how simple it is to use sigma to display a JSON encoded graph file. minimum_spanning_tree¶ scipy. Run BFS on any node s in the graph, remembering the node u discovered last. display import Image from sklearn import tree import pydotplus. In this case we are not interested in the exact placement of items in the tree, but we are interested in using the binary tree structure to provide for efficient searching. Now let's move the key section of this article, Which is visualizing the decision tree in python with graphviz. booster (Booster or LGBMModel) - Booster or LGBMModel instance to be plotted. the height of left sub tree + the height of right sub tree + 1 ( 1 to add the root node when the diameter spans across the root node) And we know that the diameter is the lengthiest path, so we take the maximum of 1 and 2 in case it lies in either of the side or wee take 3 if it spans through the root. A decision tree is one of the many Machine Learning algorithms. from sklearn. In these cases, the keyword graph is omitted, and keywords tree , grid or dag are used instead. Statistical analysis made easy in Python with SciPy and pandas DataFrames Randy Olson Posted on August 6, 2012 Posted in ipython , productivity , python , statistics , tutorial I finally got around to finishing up this tutorial on how to use pandas DataFrames and SciPy together to handle any and all of your statistical needs in Python. The topmost node in a decision tree is known as the root node. FWIW, I have implemented the calculation of the Gomory-Hu tree in C as well; the implementation will be included in igraph 0. the first graph has no cycle (aka a tree), while the second graph has a cycle (A-B-E-C-A, hence it's not a tree). after each iteration of outer for loop so you can display pattern appropriately. With Python code visualization and graphing libraries you can create a line graph, bar chart, pie chart, 3D scatter plot, histograms, 3D graphs, map, network, interactive scientific or financial charts, and many other graphics of small or big data sets. The topmost node in a decision tree is known as the root node. Each test case starts with a line containing 2 space-separated integer: N and M. from sklearn. Random forest is a highly versatile machine learning method with numerous applications ranging from marketing to healthcare and insurance. In this case we are not interested in the exact placement of items in the tree, but we are interested in using the binary tree structure to provide for efficient searching. py [-h] [-a ANCESTOR] [-g GENDER] [-v INFOLEVEL] [-o OUTFILE] INPUTFILE Generates a family tree graph from a simple text file positional arguments: INPUTFILE the formatted text file representing the family optional arguments: -h, --help show this help message and exit -a ANCESTOR make the family tree from an ancestor (if. The first thing I do is make a network graph of dependencies (click on the image for an interactive version): The network graph visualizes how python packages depend on each other. Tree(), the generated graph will always be the same if you use the same parameters: >>>. The following are code examples for showing how to use networkx. Let t be the first node on that path discovered by BFS. the sum of weights of edges is minimal). However, in general, the results just aren't pretty. Each class has methods to add nodes (add_node), and edges (respectively arcs) (add. You can find algorithms for that in various texts and. Collatz graph generation based on Python code by @TerrorBite. 5 and jupyter 4. You can visualize the trained decision tree in python with the help of graphviz library. Use those traversals to output the following tree:. Download PyCharm now. Note, this doesn't work in my jupyter notebook running python 3. A tree owns merely a root, while a node (except root) has some children and one parent. In the video, I will show you how to solve leetcode question 261, Graph Valid Tree using DFS / Graph Cycle Detection in Python. Problem statement remains the same as the Kruskal algorithm, given … Continue reading "Minimum spanning tree Prim’s. all documentation. Python is sometimes described as an object-oriented programming language. Also the processing of data should happen in the smallest possible time but without losing the accuracy. Switch branch/tag. tree import export_graphviz from sklearn. Before studying the missionaries and cannibals problem, we look at a simple graph search algorithm in Prolog. Full-Stack Developer? Try the Backend, Frontend, and SQL Features in PyCharm. clustering: Classes related to graph clustering. Support for Python 2. I hope you the advantages of visualizing the decision tree. To "Matteo Dell'Amico": "Plus, a search algorithm should not visit nodes more than once" You are wrong,- algorithm should not visit nodes more than once in one PATH. For example, in the following graph,…. fit(X,Y) After the grid search the best parameters were : {'max_depth': 17, 'min_samples_split. Logistic regression in Hadoop and Spark. Note that the leaf index of a tree is unique per tree, so you may find leaf 1 in both tree 1 and tree 0. Note that I edited the file to have text colors correspond to whether they are leaf/terminal nodes or decision nodes using a text editor. A primary advantage for using a decision tree is that it is easy to follow and understand. The weight of a spanning tree is the sum of weights given to each edge of the spanning tree. The first few methods have been implemented. _igraph: Low-level Python interface for the igraph library. (trees) in the model, and then visualizing the result as a bar graph. In other words, any connected graph without simple cycles is a tree. For example, Python’s scikit-learn allows you to preprune decision trees. DecisionTreeClassifier() clf=grid_search. Last upload: 3 months and 9 days ago. In the past I would have used the tikZ package in LaTeX, but that won't work in this case. An adjacency matrix is a way of representing a graph G = {V, E} as a matrix of booleans. Possible values of list items: ‘split_gain’, ‘internal_value’, ‘internal_count’, ‘internal_weight’, ‘leaf_count’, ‘leaf_weight. 0-2) Low-level AMQP client rebuild a new abstract syntax tree from Python's AST python-atomicwrites (1. I've been playing around with E. Video Transcript. Download the. target) # Extract single. A spanning tree of a graph is a tree that has all the vertices of the graph connected by some edges. These have two varieties, regres-sion trees, which we’ll start with today, and classification trees, the subject. For connected graphs, a spanning tree is a subgraph that connects every node in the graph, but contains no cycles. As an example, consider computing the sequence of Fibonacci numbers, in which each number is the sum of the preceding two. single interface. Parameters: data - Tree formatted graph data: Returns: G (NetworkX DiGraph); attrs (dict) - A dictionary that contains two keys 'id' and 'children'. A binary tree is a special type of tree in which every node or vertex has either no child node or one child node or two child nodes. As soon as we get to a graph, the colloquial name is neighbors = children + parents (in the case of undirected graph). This one-liner hides the fact that a plot is really a hierarchy of nested Python objects. A graph G is a 2-tree if G = K3, or G has a vertex v of degree 2, whose neighbours are adjacent, and G\v is a 2-tree. The fire ball python is a lot lighter in color, compared to a normal ball python. 7 and Python 3. Tree A connected acyclic graph Most important type of special graphs - Many problems are easier to solve on trees Alternate equivalent definitions: - A connected graph with n −1 edges - An acyclic graph with n −1 edges - There is exactly one path between every pair of nodes - An acyclic graph but adding any edge results in a cycle. Nature Flower. It diagrams the tree of recursive calls and the amount of work done at each call. tree import DecisionTreeClassifier from sklearn import datasets from IPython. Contrary to forests in nature, a forest in graph theory can consist of a single tree! A graph with one vertex and no edge is a tree (and a forest. 3 is being used in this session. \$\endgroup\$ - coderodde Mar 22 '16 at 12:17 \$\begingroup\$ neighbors is the correct terminology for either a node tree or a graph \$\endgroup\$ - Malachi ♦ Mar 22 '16 at 17:26. Documentation: https://graphviz. 3 binary tree from list. The next animation shows how the kd-tree is traversed for nearest-neighbor search for a different query point (0. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials. Python is a great language for the automated handling of files and directories. The input file format is very simple, you describe persons of your family line by line, children just have to follow parents in the file. Then we create a insert function to add data to the tree. A famous example of recursion is the "droste effect", but unlike recursion in programming there is no stopping condition. The nodes without child nodes are called leaf nodes. In this case we are not interested in the exact placement of items in the tree, but we are interested in using the binary tree structure to provide for efficient searching. Be sure to share your thoughts in the Treehouse community forum, or. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains. I recently submitted a scikit-learn pull request containing a brand new ball tree and kd-tree for fast nearest neighbor searches in python. I have implemented grid search to find the best decision tree that could be fitted to my training data using the following code : parameters={'min_samples_split' : range(10,500,20),'max_depth': range(1,20,2)} clf_tree=tree. edge(2, 7). Python Snake. Runtime of the algorithms with a few datasets in Python. If None, new figure and axes will be created. An example is given in the file LouisXIVfamily. Train Decision Tree. Lee, Ralf Gommers, Filip Wasilewski, Kai Wohlfahrt, Aaron O’Leary (2019). Here's an example decision tree graph built on the famous Titanic survival dataset. Conclusion. A decision tree is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. This process is also called serializing” the object. An edge-weighted graph is a graph where we associate weights or costs with each edge. In other words, if a vertex 1 has neighbors 2, 3, 4, the array position corresponding the vertex 1 has a linked list of 2, 3, and 4. Run BFS on any node s in the graph, remembering the node u discovered last. The breadth-first search technique is a method that is used to traverse all the nodes of a graph or a tree in a breadth-wise manner. text import CountVectorizer import pydotplus as pdp import io #x(6,11)。 6はy、11はfeature_namesに対応。1行目の8列目は犬が6回現れることを示している。. Create a dictionary (to be used as a priority queue) PQ to hold pairs of ( node, cost ). Related course: Python Machine Learning Course. This also means that the. A graph will represented using a JSON like structure. Males are typically more slender than females as well. In this article we'll go over the theory behind gradient boosting models/classifiers, and look at two different ways of carrying out classification with gradient boosting classifiers in Scikit-Learn. render_breast_cancer, view equals True. Here, we are implementing a python program to create a bar char using matplotlib. Implementing a binary tree can be complex. of that graph is a subgraph that is a tree and connects all the vertices together. It runs under Python 2. has_vertex() Check if vertexis one of the vertices of this graph. A graph is a pictorial representation of a set of objects where some pairs of objects are connected by links. python-graph. On the contrary, in. This example iterates over a directory tree that contains these files and sub-directories:. It’s important to note that the term “package” in this context is being used as a synonym for a distribution (i. The tree in figure 1 holds all the properties. _igraph: Low-level Python interface for the igraph library. js , Here is the first post of the series of posts to come related to algorithms using python. Your input graph is the star network from the distribution point to the three premises - it doesn't contain edges from the premises to the other premises, so the output MST can't have those links in it. Install igraph with pip install python-igraph. In this tutorial, you'll discover a 3 step procedure for visualizing a decision tree in Python (for Windows/Mac/Linux). This can be somewhat misleading and needs to be clarified. metrics import confusion_matrix from sklearn. In the example, a person will try to decide if he/she should go to a comedy show or not. The next animation shows how the kd-tree is traversed for nearest-neighbor search for a different query point (0. Further Reading. It is a greedy algorithm in graph theory as it finds a minimum spanning tree for a connected weighted graph adding increasing cost arcs at each step. For a Python graph database. Loading modules to figure out dependencies is almost always problem, because a lot of codebases run initialization code in the global namespace, which often requires additional setup. treelib is a Python module with two primary classes: Node and Tree. Python Implementation of Prim's Minimum Spanning Tree A minimum spanning tree of a graph is a sub-graph that connects all vertices in the graph with a minimum total weight for the edges. About rainforests. Installation. So the two disjoint subsets (discussed above) of vertices must be connected to make a Spanning Tree. Here, we are implementing a python program to create a bar char using matplotlib. The choice is specified with the wordtree. How the decision tree classifier works in machine learning. Each child of a vertex is called a left or right child. I've been playing around with E. A binary tree is a tree-like structure that has a root and in which each vertex has no more than two children. There are actually a few ways to import functionality from modules. Parameters: data - Tree formatted graph data: Returns: G (NetworkX DiGraph); attrs (dict) - A dictionary that contains two keys 'id' and 'children'. Has anyone had any experience implementing Kruskal’s Minimum Spanning Tree Algorithm? I managed to get it working with Ivy, but it converts my original network into a graph network. app: User interfaces of igraph. Radial node-link tree layout based on an example in Mike Bostock's amazing D3 library. For example, a binary tree might be: class Tree: def __init__(self): self. right = None self. Run BFS from u remembering the node v discovered last. Leetcode Python Solutions; Introduction Graph Valid Tree. Source, our graph data. Burmese pythons are often the targets of poachers due to their beautiful and intricate patterns, and many snakes abandoned by their owners fall into the wrong hands. c ----- ----- ----- call TreeBreadthFirst TreeBreadthFirst TreeBreadthFirst prototype definition In other words, the main program needs to call some function that performs a breadth-first traversal, like TreeBreadthFirst(). 7+ and Python 3. A tree can have n-1 edges. Software Packages in "xenial", Subsection python agtl (0. Elements of trees are called their nodes. Recursively, each of the subtrees must also obey the binary search tree constraint: in the (1, 3, 4) subtree, the 3 is the root,. jsTree is easily extendable, themable and configurable, it supports HTML & JSON data sources and AJAX loading. The next animation shows how the kd-tree is traversed for nearest-neighbor search for a different query point (0. This package facilitates the creation and rendering of graph descriptions in the DOT language of the Graphviz graph drawing software from Python. •Highly flexible graph implementations (a graph/node can be anything!) •Extensive set of native readable and writable formats •Takes advantage of Python's ability to pull data from the Internet or databases When should I AVOID NetworkX to perform network analysis? •Large-scale problems that require faster approaches (i. How to use it: Load the ftree. Then we'll say graph. This function generates a GraphViz representation of the decision tree, which is then written into out_file. Fortunately there is a standard CompSci solution which is to read the tree into a node stack organized breadth-first or depth-first. Here's a sample print of a tree data structure: 4 1 2 0 3. Snake Terrarium. Visualize decision tree in python with graphviz. Matplotlib is a is a plotting library for the Python programming language. To "Matteo Dell'Amico": "Plus, a search algorithm should not visit nodes more than once" You are wrong,- algorithm should not visit nodes more than once in one PATH. The difference between the two is that the first one (uninformed) is naive or blind - meaning it has no knowledge of where the goal could be, while the second one (informed) uses heuristics to guide the search. The root of a tree is on top. Now, the new input node checks with root value. The choice is specified with the wordtree. Pygraphviz is a Python interface to the Graphviz graph layout and visualization package. Public Domain License. display import Image from sklearn import tree import pydotplus. Kruskal's algorithm is a minimum-spanning-tree algorithm which finds an edge of the least possible weight that connects any two trees in the forest. How to use it: Load the ftree. I highly advise you to have a look to the. In a weighted graph, the weight of a subgraph is the sum of the weights of the edges in the subgraph. The objective of this project is to implement in Python the linear time algorithm first proposed by Hopcroft and Tarjan and later corrected by Gutwenger and Mutzel to decompose a (multi)graph into triconnected components and organize these components into a SPQR-tree. This means that any two vertices of the graph are connected by exactly one simple path. jsTree is easily extendable, themable and configurable, it supports HTML & JSON data sources and AJAX loading. to_networkx returns the given tree as a NetworkX LabeledDiGraph or LabeledGraph object (depending on whether the tree is rooted). The basic syntax for creating line plots is plt. Then we create a insert function to add data to the tree. Implement a binary tree where each node carries an integer, and implement: pre-order, in-order, post-order, and level-order traversal. Or on a Mac, you can run it using the Python Launcher, rather than Idle. The 3D graph would be a little more challenging for us to visually group and divide, but still do-able. In contrast, trees are simple as compared to the graph. Python language data structures for graphs, digraphs, and multigraphs. tree import export_graphviz from sklearn. Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. model_selection import train_test_split from sklearn. Customisable colors. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching and Qt's GraphicsView framework for fast display. I recently submitted a scikit-learn pull request containing a brand new ball tree and kd-tree for fast nearest neighbor searches in python. Graphs & Graph Algorithms > General Depth First Search The knight’s tour is a special case of a depth first search where the goal is to create the deepest depth first tree, without any branches. Also the processing of data should happen in the smallest possible time but without losing the accuracy. The name “boa” means “large serpent. Again this is similar to the results of a breadth first search. In this case we are not interested in the exact placement of items in the tree, but we are interested in using the binary tree structure to provide for efficient searching. The underlying graph is obtained by treating each directed edge as a single undirected edge in a multigraph. Data visualization is an important part of being able to explore data and communicate results, but has lagged a bit behind other tools such as R in the past. Return to the directory window for the Python examples. 0 Table 1 - continued from previous page delete_vertex() Delete vertex, removing all incident edges. NNP 9 VMOD 29 CD 16 NMOD. Any feedback is highly welcome. Minimum spanning tree Prim’s algorithm In the last post, we discussed how to find minimum spanning tree in a graph using Kruskal algorithm. PyQtGraph is a pure-python graphics and GUI library built on PyQt4 / PySide and numpy. Inspired by an email from a former instructor, I created a Zeek package, spl-spt, with the goal of providing new data that can be used to identify malicious TLS sessions. Observations are represented in branches and conclusions are represented in leaves. 6 devel =0 1. AIMA Python file: search. Parse source code into a parse tree (Parser/pgen. Lets take the below tree for example. Python gives you that functionality. The tree ensemble model is a set of classification and regression trees (CART). Train Decision Tree. # Load libraries from sklearn. # Create decision tree classifer object clf = DecisionTreeClassifier(random_state=0. The next figures show the result of k-nearest-neighbor search, by extending the previous algorithm with different values of k (15, 10, 5 respectively). plot package. Train Decision Tree. Something like this tree: However, it seems Dash does not have such graph type in the library (the tree plot is not interactive. In our 2D plot, this particular test point is in the top-left region. So what clustering algorithms should you be using? As with every question in data science and machine learning it depends on your data. Graphviz is open source graph visualization software. display import Image from sklearn import tree import pydotplus. On the other hand, for graph traversal, we use BFS (Breadth First Search) and DFS (Depth First Search). One popular one is called information gain. Plotly is a free and open-source graphing library for Python. Installation. - gbjbaanb Apr 21 '15 at 10:38 I've tried pycallgraph but it's just too complicated/too deep to use it. The following explains how to build in Python a decision tree regression model with the FARS-2016-PROFILES dataset. # Load data iris = datasets. It makes that a basic understanding. While running the program, follow the prompts in the graphics window and click with the mouse as requested. You can refer "Introduction to Graph Theory" course of coursera to learn more about graph theory. The reason is, tree data structures lend themselves very well to recursive solutions because, unlike python lists which have linear structures, trees have hierarchical structures. Dot(graph_type='graph', dpi=300) gv_root = pydot. to_networkx returns the given tree as a NetworkX LabeledDiGraph or LabeledGraph object (depending on whether the tree is rooted). c) Emit bytecode based on the Control Flow Graph (Python/compile. class DependencyGraph (object): """ A container for the nodes and labelled edges of a dependency structure. There are simple and pythonic ways to iterate over trees, and I will illustrate one. Parameters: data - Tree formatted graph data: Returns: G (NetworkX DiGraph); attrs (dict) - A dictionary that contains two keys 'id' and 'children'. org: Python Patterns - Implementing Graphs Also, rather than implementing a DAG it might be easier to use an existing tree or graph/DAG library or module such as Libla. These references are referred to as the left and right subtrees. Decision trees can be unstable because small variations in the data might result in a completely different tree being generated. load_iris() X = iris. Python doesn't have the quite the extensive range of "built-in" data structures as Java does. Decision trees are the building blocks of some of the most powerful supervised learning methods that are used today. A decision tree is basically a binary tree flowchart where each node splits a group of observations according to some feature variable. Graf adalah kumpulan noktah (simpul) di dalam bidang dua dimensi yang dihubungkan dengan sekumpulan garis (sisi). Has anyone had any experience implementing Kruskal’s Minimum Spanning Tree Algorithm? I managed to get it working with Ivy, but it converts my original network into a graph network. Add a new line after each row, i. They consists of nodes (a. Apr 6, 2018 • graphs • Christoph Dürr. You can vote up the examples you like or vote down the ones you don't like. Loading modules to figure out dependencies is almost always problem, because a lot of codebases run initialization code in the global namespace, which often requires additional setup. Find the total weight of its maximum spanning tree. It runs under Python 2. text import CountVectorizer import pydotplus as pdp import io #x(6,11)。 6はy、11はfeature_namesに対応。1行目の8列目は犬が6回現れることを示している。. PyGraphviz is a Python interface to the Graphviz graph layout and visualization package. The tree in figure 2 satisfies all the invariant except invariant number 5. Select Archive Format. A recent example, very impressive due to its high information density, is the chord diagram that was introduced by Krzywinski et al. png') Results:. A graph G is a 2-tree if G = K3, or G has a vertex v of degree 2, whose neighbours are adjacent, and G\v is a 2-tree. This implementation uses arrays for which heap[k] <= heap[2*k+1] and heap[k] <= heap[2*k+2] for all k, counting elements from zero. PyGraphviz is a Python interface to the Graphviz graph layout and visualization package. (Python) Iterate over Files and Directories in Filesystem Directory Tree. 前回までは、Graphvizの概要とDOT言語の仕様、dotコマンドでの画像生成を中心に解説してきました。今回は、GraphvizのPython言語バインディングについて簡単に説明します。. You want to find a spanning tree of this graph which connects all vertices and has the least weight (i. The input file format is very simple, you describe persons of your family line by line, children just have to follow parents in the file. If the graph has N vertices then the spanning tree will have N-1 edges. Graph Compare Locked Files Issues 1 Issues 1 List Boards Labels Service Desk Milestones python-ext. In other words, any connected graph without simple cycles is a tree. This can be somewhat misleading and needs to be clarified. tree import export_graphviz from sklearn. directed graphs) have exactly the same API. What I mean by "graph tree" is something along the lines of the following, where I could feed it a nested dictionary of values and it would then create the tree structure: (source: rubyforge. Given input features: “height, hair length and voice pitch” it will predict if its a man or woman. Find out more about fractals: In this challenge we will be looking at. Gradient boosted trees, as you may be aware, have to be built in series so that a step of gradient descent can be taken in order to minimize a loss function. Important Notice. Leetcode (Python): Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. Plotly is a free and open-source graphing library for Python. Each edge connects two vertices, i. Apache Spark achieves high performance for both batch and streaming data, using a state-of-the-art DAG scheduler, a query optimizer, and a physical execution engine. The train_X , test_X , train_Y , test_Y from the previous exercise have been loaded for you. tree import DecisionTreeClassifier. Matplotlib is a is a plotting library for the Python programming language. A Decision Tree is a Flow Chart, and can help you make decisions based on previous experience. 2-3ubuntu1) lightweight database migration tool for SQLAlchemy. all functions and methods. Instead, it provides functions for exporting Tree objects to the standard graph representations, adjacency list (dict) and adjacency matrix, using third-party libraries. python-graph. The standard sklearn clustering suite has thirteen different clustering classes alone. Python sklearn. Correctness: Let a and b be any two nodes such that d(a,b) is the diameter of the tree. There are some things to keep in mind about this demonstration of a decision tree. Statistical analysis made easy in Python with SciPy and pandas DataFrames Randy Olson Posted on August 6, 2012 Posted in ipython , productivity , python , statistics , tutorial I finally got around to finishing up this tutorial on how to use pandas DataFrames and SciPy together to handle any and all of your statistical needs in Python. The only catch here is, unlike trees, graphs may contain cycles, so we may come to the same node again. Before writing an article on topological sorting in Python, I programmed 2 algorithms for doing depth-first search. The methods that we will use take numpy arrays as inputs and therefore we will need to create those from the DataFrame that we already have. I’ve been trying to work with this python definition here, but am relatively new to py in gh. PyCharm provides smart code completion, code inspections, on-the-fly. Building decision tree classifier in R programming language. has_vertex() Check if vertexis one of the vertices of this graph. 8 meters), according to the University of Michigan’s Animal Diversity Web. A library for working with graphs in Python. Version 4 Migration Guide. show() and TreeNode. Correctness: Let a and b be any two nodes such that d(a,b) is the diameter of the tree. Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges make up a valid tree. A tree is a connected graph with no undirected cycles. Use python-graph to model your desired tree and then output it to dot language (graphwiz). With a random forest, every tree will be built differently. A MST is a set of edges that connects all the vertices in the graph where the total weight of the edges in the tree is minimized. pyplot is a plotting library used for 2D graphics in python programming language. Comments This site borrows content liberally (with permission) from Exploring Computer Science , Interactive Python , Harvey Mudd College's Computer Science for All , and. I assume that you have already installed igraph; if you did not, see Installing igraph first. Related course: Python Machine Learning Course. Image processing - see above. In order traversal means visiting first left, then root. Let t be the first node on that path discovered by BFS. # Load libraries from sklearn. Breadth first traversal or Breadth first Search is a recursive algorithm for searching all the vertices of a graph or tree data structure. The Python programs in this section checks whether a given tree and its mirror image are same, program on creating mirror copy of tree and displaying using bfs, finding the nearest common ancestor in a given nodes, converting binary tree to binary search tree, finding the total vertical lines in a given binary search tree. You can assume them to be string too. Here node A is connected to nodes B,C and E and this is represented as described below {'A':{'B':1,'C':1 }} Using the similar approach here is the representation of the complete graph. 3 binary tree from list. In the code given below the drawTree() function is a recursive function because: It includes a call to itself (on line. Minimum spanning tree. Decision Tree produced through Graphviz. Finally the Post-order traversal logic is implemented by creating an empty list and adding the left node first followed by the right node. I would encourage you to try it out in your next project.
|
__label__pos
| 0.975396 |
Home
Arduino file write
If you're looking for the perfect toy for kids with an educational bent, the best 7duino. robot kits have picked seven top-rated, best-selling Arduino robot kits from thousands o file.write(buf, len) Parameters. file: an instance of the File class (returned by SD.open()) data: the byte, char, or string (char *) to write buf: an array of characters or bytes len: the number of elements in buf Returns. byte write() will return the number of bytes written, though reading that number is optional See Also. print() println() read() Reference Home. Corrections, suggestions. We will collect data and write to file a make-shift timestamp by reading the elapsed time since the Arduino started. The file will be written in CSV (comma separated values) format often used when data with similar structures are saved to file or transmitted over a link. It is Excel compatible and can just be opened with it to put the values into columns and rows. Using PuTTY, we will create a. FILE_READ: open the file for reading, starting at the beginning of the file. FILE_WRITE: open the file for reading and writing, starting at the end of the file. Returns. a File object referring to the opened file; if the file couldn't be opened, this object will evaluate to false in a boolean context, i.e. you can test the return value with if.
The Best Arduinos For Kids - robostartin
As of Arduino IDE 1.0, serial transmission is asynchronous. If there is enough empty space in the transmit buffer, Serial.write() will return before any characters are transmitted over serial. If the transmit buffer is full then Serial.write() will block until there is enough space in the buffer. To avoid blocking calls to Serial.write(), you can first check the amount of free space in the. This time the output files we need should always appear in the folder you have added to preferences.txt. This path should also appear towards the end of the Arduino output window after a successful compile. If everything has gone right, your folder should be full of output files, mostly with .o and .d extensions. These are used by linker and.
Now, let's write some data on Arduino Serial Port using the above syntax and see what we got. So, design a Proteus Simulation as shown in below figure: Upload the below code in your Arduino software and get the Hex File from Arduino Arduino Working With Multiple Files (READ/WRITE): Hello guysToday I am presenting you Arduino project which works with RTC shield that can stores data. The main task of this project is working with multiple files that are stored on sc card. This project contains code that works with three files wh The Arduino can create a file in an SD card to write and save data using the SD library. So in this tutorial, I am going to show you step by step How to Read and Write Data in Arduino SD Card, using an Arduino SD Card Module. An Arduino Micro SD card Module is an SPI (Serial peripheral interface) communication-based device. It is compatible with the TF (TransFlash) SD cards used in. you can write the sensor data to the serial port using serial-lib and write a small processing program that reads the data from the serial port and writes it to a file. in the arduino code initalize the serial lib in the setup method . Serial.begin(9600); and write your sensor values to the serial interface using . Serial.println(value)
Arduino IDE: How to Store and Retrieve Data From a File.: When programming with the Arduino IDE, often times we will get data we need from the web, or save data we collected to the web.Sometimes though, we don't have an internet connection. You can save data to a variable of course, and then wait for such The SD library allows for reading from and writing to SD cards, e.g. on the Arduino Ethernet Shield. It is built on sdfatlib by William Greiman. The library supports FAT16 and FAT32 file systems on standard SD cards and SDHC cards. It uses short 8.3 names for files. The file names passed to the SD library functions can include paths separated by forward-slashes, /, e.g. directory/filename.txt. How to Write Arduino Data to Files on an SD Card. Posted by Graham Lambert | Arduino | 2 . For this tutorial, we are going to connect a BMP280 barometric pressure sensor to an Arduino and write the results to a CSV file on a MicroSD card on the Arduino. But before that, let's recall some related basic concepts. How the SD Card Works. SD Card stands for Secure Digital Card. SD cards have non.
ESP32 Arduino Tutorial SPIFFS:4. Writing a file. DFRobot Nov 24 2018 TUTORIALS. In this tutorial, we will check how to create a file in the ESP32 using the SPIFFS file system. SPIFFS stands for SPI Flash File System and it is a file system intended for SPI NOR flash devices on embedded devices [1]. You can read more about SPIFFS here. In this tutorial, we will check how to mount the file. In this tutorial we will check how to write a file to the SPIFFS file system of the ESP8266, using the Arduino core. The tests shown on this tutorial were performed on a DFRobot's ESP8266 FireBeetle board. Introduction. In this tutorial we will check how to write a file to the SPIFFS file system of the ESP8266, using the Arduino core How can I write and read file from an SD card in lower directories? Say I have an SD card with a directory call Folder1 and another call Folder2″, with file in doth directories. How can I read and and display the file on a TFT display? How should I modified the following command —> test = SD.open(testing.txt, FILE_WRITE);
Arduino Forum > Using Arduino > Programming Questions > Appending to SD-card file; Print. Go Down. Pages: [1] Topic: Appending to SD-card file (Read 9020 times) previous topic - next topic. tapirtech. Newbie; Posts: 1; Karma: 0 ; Appending to SD-card file. Oct 21, 2017, 12:38 pm. Hello out there. My name is Joseph and i'm new here. For my application i need to write 4 positions to a SD-file. // Compiled in Arduino 1.6.7. Runs OK on Wemos D1 ESP8266 board. #include FS.h void setup() { Serial.begin(9600); Serial.println(\nVery basic Spiffs example, writing 10 lines to SPIFFS filesystem, and then read them back); SPIFFS.begin(); // Next lines have to be done ONLY ONCE!!!!!When SPIFFS is formatted ONCE you can comment these lines out!! Serial.println(Please wait 30 secs for.
you can write the sensor data to the serial port using serial-lib and write a small processing program that reads the data from the serial port and writes it to a file. in the arduino code. This sketch assumes that values read by Arduino are separated by commas, and each Arduino reading is separated by a newline character. Each reading will have it's own row and timestamp in the resulting csv file. This sketch will write a new file a set number of times. Each file will contain all records from the beginning of the sketch's run
Arduino - FileWrite
1. Reading and Writing Files from an SD Card with an Arduino June 23, 2015 by Tim Youngblood In some Arduino applications, it is advantageous to be able to store and retrieve information locally. You can do this with a Secure Digital, or SD, card. An SD card is a non-volatile memory card used extensively in portable devices, such as mobile phones, digital cameras, GPS navigation devices, handheld.
2. (If you leave the mode section blank, the file will open in reading mode by default) If the file is opened for writing, it will be created a file with this name if it doesn't already exist. SD.open(filepath, mode) Close the file and ensure that any data written to it is physically saved to the SD card. file.close()* Remove a file from the SD.
3. Writing on an NFC Tag. Now to be able to write a message on a tag, the process is similar except we are going to change the code a little bit. The header before void setup() will stay the same but this will be the code you want to write and upload to the Arduino
4. The Arduino Web Editor allows you to write code and upload sketches to any official Arduino board from your web browser (Chrome, Firefox, Safari and Edge) after installing a plugin
5. Since Arduino libraries are written in C++, we need to create two files: Fader.h and Fader.cpp. They will contain the header and the body of the class Fader, respectively. The Arduino IDE comes with its own C++ compiler, so you won't need any other additional tool for this tutorial. Step 1. Setting up. Before start writing our source codes, we have to find the folder which Arduino uses for.
6. File dataFile = SD.open(datalog.txt, O_READ | O_WRITE | O_CREAT); Warning: not all versions of SD library bundled in different board packages have O_APPEND in #define FILE_WRITE. Even in the Arduino SD library the O_APPEND was removed some time ago and then the change was reverted, because all dataloger examples used FILE_WRITE
7. This example shows how to read and write data to and from an SD card. Example will be tested in a real hardware circuit and simulated with Proteus. In the circuit there are 3 voltage dividers, each one consists of 2.2K and 3.3K resistors, they are used to step down 5V into 3V. Arduino SD card read and write files
How to Write Arduino Sensor Data to a CSV File on a
1. Write Data to Beginning of File With Arduino or ESP8266: I had a data logging project where I needed to log data to a file, then once a day, send the data file to a central server. I was using an ESP8266-01 to do this, leveraging the Arduino IDE.This is easy enough to do using the SPIFFS/File System Obje
2. The code. We start the code by including the SPIFFS.h library, so we have access to the methods needed to both write and read from a file. Remember from the previous tutorial that, by including this library, we will have access to the SPIFFS extern variable, which will be the one used to interact with the file system.. #include SPIFFS.h Moving on to the Arduino setup function, we start by.
3. On the PC wait until the transfer is complete and then save the log file. To read/save/modify any file without user interaction: Set up the arduino to act as a serial port. Write a desktop PC application that takes the data from the Arduino. Define a protocol that allows the arduino to to specify the filename and what to do with it. The arduino.
4. imal effort. We make a lot of dataloggers, the majority of which either store data internally and then output a summary to an LCD display, or dump all collected data to an SD card for later processing and analysis.
With SD you could write a new file without that line or you could make a file that the last byte is the number of the last line read, assuming no more than 255 lines with passwords else that file needs to be a growing series of 16 or 32 bit values. Every time you read a name and pw you need to append the line number to the last-line file. When the program starts it needs to open that file and. From the Arduino site for Serial.write and Serial.print: Serial.write() Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead. Serial.print() Prints data to the serial port as human-readable ASCII text But the SD library in arduino currently writes data at about 4500-5000 bytes per second which is too slow. Also, be sure to keep the flag in SD.open() as 'O_WRITE | O_CREAT' instead of 'FILE_WRITE'. This sure increased the speed by a great factor. But I needed more! Storing the data in binary (check out this blog) improved the performance even more. My current speed is approximately 100. At the end of your main-*.cpp-file write #include foo.h, #include bar.h, etc. for every *.h-file you have where foo and bar are the actual names of the needed files; create function prototypes in a seperate file. To do this create a new file called prototypes.h and add a prototype for each function defined in one of your other *.h-files there. include the created prototypes.h (#. I was able to write the 2206039 byes of files that are on there with SPIFFS. It just seems to have stopped accepting writes at 2206039 bytes out of 2949250 instead of writing up to the max of 2949250 bytes
Arduino - SDCardNotes
For example, instead of using Arduino board you just want to use the ATmega microcontroller then the easiest way is to write the code in Arduino and then get its hex file and upload it in your microcontroller, which makes the task quite easy. Another example is Proteus simulation, when you want to simulate your Arduino board in Proteus software then you need to get the hex file so that you can. The SD and micro SD card modules allow you to communicate with the memory card and write or read the information on them. The module interfaces in the SPI protocol. To use these modules with Arduino you need the SD library. This library is installed on the Arduino application by default. NoteThese modules can not handle high-capacity memory cards After writing those files and setting up the Led library folder, you can now restart your Arduino IDE and test the blink_led.ino example. Written by Rishabh Dev Yada
Arduino - SDope
The code. As we have been doing in the previous posts, we start with the SPIFFS.h library include, in order to access the SPIFFS extern variable, needed to interact with the file system. This is the only library we will need. #include SPIFFS.h Then we move on to the Arduino setup, where we will write the rest of the code Create 2 new files: my_library.h and my_library.cpp. Then restart your Arduino IDE, or close/open your current sketch. You should now see 3 files. Write the following code into those 3 files. my_library.h #ifndef MY_LIBRARY_H #define MY_LIBRARY_H #include <Arduino.h> int addTwoInts(int a, int b); #endif. This is a typical header file The open-source Arduino environment makes it easy to write code and upload it to the i/o board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing, avr-gcc, and other open source software. Arduino icon. Arduino icon size: 128px x 128px (.png with transparency) Arduino works with the following file extensions: Note: You can click on any file. In this tutorial we will check how to delete a file from the SPIFFS file system, using the ESP32 and the Arduino core. The tests were performed using a DFRobot's ESP32 module integrated in a ESP32 development board. Introductio
ESP32 Arduino SPIFFS: Writing a file - techtutorials
[解決方法が見つかりました!] serial-libを使用してセンサーデータをシリアルポートに書き込み、シリアルポートからデータを読み取り、ファイルに書き込む小さな処理プログラムを作成できます。 arduinoコードで、setupメソッドでシリアルライブラリを初期化します Serial.begin(9600); センサーの値. Python / Pyserial / Arduino writing serial data to to txt file problem. Hot Network Questions Should retail investors learn and use the capital asset pricing model (CAPM)? Why carriage return don't be shown as ^M in my vim? Is there a way to safely tranquilize my cat, so he does not remember a vet visit?. With SPIFFS, you can write the HTML and CSS in separated files and save them on the ESP8266 filesystem. Installing the Arduino ESP8266 Filesystem Uploader. You can create, save and write files to the ESP8266 filesystem by writing the code yourself in Arduino IDE. This is not very useful, because you'd have to type the content of your files in. One of the weak spot of the Arduino is the memory space. When playing with data (saving measurement, reading or writing to a file, etc.), it is necessary to have lot of space available. You can easily add memory to the Arduino with a Secure Digital card or SD card. Material. Computer; Arduino UNO x1; USB cable to connect Arduino to the computer x This tutorial explains how to mount the SPIFFS file system, create a file and write some content to it. SPIFFS stands for SPI Flash File System and it is one of the file system types supported by.
string - How to write data to a text file on Arduino
The file is created if it does not exist. The pointer is positioned at the start of the file for reading and at the end of the file for writing (appending) Returns the File object. To check if the file was opened successfully, use the Boolean operator. Once the file is open, here are the methods that allow you to manipulate it. file.seek(offset. Tagged With arduino save data to text file, how to save the data from sensor in text file, reading from serial port and saving in a file, arduino write console to text file, CAN data to txt file arduino, arduino save to file, sending sensor data to BC95 in Arduino IDE, arduino txt file pc, arduino save serial data to file, arduino output to. We needed to declare the default chip select (CS) pin of the Arduino as OUTPUT, which was pin 53 on our Arduino MEGA. The CS pin is number 4 on the Ethernet shield. We specified this in the code in order to endure the SD card worked properly. Experiment 1. In this experiment, we learned how to read a file from the SD card. Hardware Require
I'm making a temperature logger using an arduino yun board and the DS18B20 digital thermometer. I'm new to arduino so any help is greatly appreciated. The data doesn't seem to move over to the excel file, or if it does, it gets stuck on the first row. #include <OneWire.h> #include <DallasTemperature.h> // Data wire is plugged into pin 2 on the. If connected to a computer, the data can be saved by reading the serial output and storing that in a file. If there is an SD card connected to the Arduino, the data can be saved directly to the SD card. In this case, the Arduino needed to function by itself without being connected to a computer, so the sensor data needed to be saved to an SD card. We also needed the temperature sensor to be. Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up. Sign up to join this community. Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Arduino . Home Questions Tags Users Unanswered Jobs; Read value from a file inside SD card. Ask. Object files for all Arduino core source code files and used libraries files will be there beside the output files of compilation like HEX file which will be uploaded later to the MCU by the programmer. Compiling sketch. Compiling the libraries source files. Compiling Arduino core source files with the following steps: Compiling core C files
We would end up with a file that was 12 bytes long. Write it twice and we would have a file that was 24 bytes long. Three times and it would be 36 bytes long. The SD library on the Arduino supports that kind of writing perfectly well. You don't have to do anything special when creating or opening the file. All the magic happens when you tell. Demonstration of an Aduino Uno sending serial data. Shows how to log the data to a csv file that will open directly into Excel for graphing
That's it! Now close the Arduino IDE, then reopen it and reopen your project, and you'll see the following new tabs show up: It now compiles just fine! Learning: how did I figure this out? First, turn on verbose compilation in the Arduino IDE: File --> Preferences --> check the box for Show verbose output during 'compilation' The basic idea is to write to an SD card using the SdFat library in Arduino to log data. Between logging the device will go to sleep and using a MOSFET I will switch off the SD card completely to save power. The whole code works but only when I read the data from the file that I just wrote to. When I take out the code to read from the file it creates the file but does not write to it at all. Manage JSON file with Arduino, esp32 and esp8266; How to use SD card with esp8266, esp32 and Arduino; Web Monitoring Station for ABB Aurora inverter (ex Power One now Fimer) How to interface Arduino, esp8266 or esp32 to RS-485; My libraries. PCF8574 i2c digital I/O expander; PCF8575 i2c 16 bit digital I/O expander; PCF8591 i2c Analog I/O Expander; DHT12 i2c Cheap Humidity and Temperature. Creating An Arduino Project. In the IDE click File > New > Project. In the project wizard, select Arduino Project, and, in the next window, select Arduino C++ Sketch. Next, you must define the project name and location. For now, we will call our project ArduinoProject and leave the location as its default. You must then set a target, but this only has to be done once (as it. Hello friends, hope you all are fine and having fun with your lives. In today's post, I am gonna share How to get Hex File from Arduino. Its quite a simple post and I have already explained it many times in my posts but still I am getting lot of messages regarding it that's why I thought to write a separate post for it
Serial.write() - Arduino-Referen
These function does not require any special header file. It reads the value from the declared PIN. Arduino UNO contains a 10-bit analog to digital converter. Therefore, it can represent the value that will map input voltages between 0 and the operating voltage that may be 5v or 3.3v and converts it to the integer values that is ranging between 0 and 1023. Arduino Uno has a resolution between. These ino file stores source code written in Arduino programming language. Updated: February 19, 2020. The default software associated to open ino file: Arduino . Company or developer: Arduino. Arduino software is development environment that allows users to write and upload code to the Arduino i/o board. Help how to open: Use Arduino to open *.ino files. How to convert: Use compatible tools. Description: Allows characters to print to a text-output stream. A new PrintWriter object is created with the createWriter() function. For the file to be made correctly, it should be flushed and must be closed with its flush() and close() methods (see above example).: Method Die Version Arduino Leonardo verwendet als Prozessor den ATmega32u4, der die USB-Unterstützung nativ bereitstellt und sich damit auch als Tastatur oder Maus gegenüber einem PC ausgeben kann. Alle Arduino-Boards, bis auf den Arduino Esplora, stellen digitale Input- und Output-Pins (kurz: I/O-Pins) des Mikrocontrollers zur Nutzung für elektronische Schaltungen zur Verfügung. Üblich ist auch.
Can Arduino write to a text file
Create main.cpp where you write your code for the Arduino in which you will declare as usual the main elements i.e. void setup, void loop and int main. For example( In main.cpp(The main Arduino Code)). Include WProgram.h (with quotes) in this header as well; this links it to all the arduino code.NOTE: As of Arduino 1.0, include Arduino.h instead of WProgram.h.Also, include the. File.h SPRESENSE Arduino File library. Open the file for reading and writing, starting at the end of the file. Generated by 1.8.13. I try to make a code and after this write my console'Arduino.h' file not found I use the Arduino uno on Mac this vs studio (PlatformIO) How can fix it I try to read/write by line ID from/to txt file store in SD card using Auduino Uno. But I don't sucsess. Please help me. Thank Using the Arduino to browse files on an SD card remotely. Now that all the SD card functionality appears to be working, the program below allows you to view the files on an SD card over the Ethernet interface and download any file you wish
Serial.write() - Arduino Referenc
Arduino core for the ESP32. Contribute to espressif/arduino-esp32 development by creating an account on GitHub Select the serial port of your Arduino, navigate to the firmware file ESP_8266_BIN0.92.bin, then press download. After successfully writing the AT command firmware, open the Arduino's serial port and send the AT command. If all is well, the module responds with an OK status. We can also send an AT+GMR command to query the module's firmware version. A full list of the AT. To find out, I right clicked on an INO file that I had written, and then used the Open With command to open the file in Notepad. As it turns out, you can indeed open an Arduino program in Notepad (and presumably any other plain-text editor). The only thing is that the formatting is completely off. Here is what it looks like when I open it in Notepad Read, write, add data to a file by programming. In most cases, we will need to access and manipulate (write, add data, rename, delete ) files directly by programming with Arduino code. This is possible with the SPIFFS.h library presented in this articl
The file is created if it does not exist. The stream is positioned at the end of the file. a+ Open for reading and appending (writing at end of file). The file is created if it does not exist. The initial file position for reading is at the beginning of the file, but output is always appended to the end of the file Arduino Write a String in EEPROM. In this tutorial I'll show you how to write an Arduino String to the EEPROM memory, and then read it again. The EEPROM memory lets you save values on your Arduino board so you can retrieve them even after you reboot the board. This is very handy when you want to save some settings/data to reuse later. If you are not familiar with Arduino and EEPROM, first. There are two types of strings in Arduino programming − Arrays of characters, which are the same as the strings used in C programming. The Arduino String, which lets us use a string object in a sketch. In this chapter, we will learn Strings, objects and the use of strings in Arduino sketches. By the end of the chapter, you will learn which. The Arduino boards uses AVR microcontrollers which has built-in EEPROM. This particular project explains how to access the built-in EEPROM of an Arduino board with the help of a simple code which writes some data into the EEPROM and reads back the same data. The Arduino is an easy prototyping platform in which the hardware is very simple to use and to be connected with any other system. The.
Where to Find Arduino Output Binaries and Hex files Move
Character literals are written in single quotes like this: 'A' and for multiple characters, strings use double quotes: ABC. However, characters are stored as numbers. You can see the specific encoding in the ASCII chart. This means that it is possible to do arithmetic operations on characters, in which the ASCII value of the character is used. For example, 'A' + 1 has the value 66, since the. 1.Vorwort zur Arduino Anleitung Diese Anleitung soll als Grundlage zum Erlernen der Arduino-Plattform dienen. Sie soll Anfängern einen einfachen, interessanten und eng geleiteten Einstieg in die Arduino-Thematik geben. Die Anleitung orientiert sich dabei hauptsächlich an praxisorientierten Aufgaben mit eine ofstream: class to write on files ifstream: class to read from files fstream: class to both read and write from/to files.. So in order to create a file and write to it we will use ofstream class. Let's say we want to create a file called codebind.txt and write something in it The Arduino digital pins either gives us 5V (when turned HIGH) or 0V (when turned LOW) and the output is a square wave signal. So if we want to dim a LED, we cannot get the voltage between 0 and 5V from the digital pin but we can change the ON and OFF time of the signal. If we will change the ON and OFF time fast enough then the brightness of the led will be changed Hello everyone, I hope you all are fine and having fun. In today's tutorial, I am going to show you How to write Arduino code. In the previous tutorial, we have seen the Simple Arduino LED Example so if you haven't read that tutorial then I must suggest you to read it first because I am gonna use the same simulation with some advancements in it.Moreover, you should also have a look at How to.
Arduino MEGA 2560 Microcontroller Rev 3
How to use Arduino Serial Write ? - The Engineering Project
Uploading files to file system ESP8266FS is a tool which integrates into the Arduino IDE. It adds a menu item to Tools menu for uploading the contents of sketch data directory into ESP8266 flash file system Write code, test it and upload to the board. Jetzt herunterladen 111.6 MB. 4 aus 215 Stimmen 0 /5 Sterne. Entwickler: Antipasto. Lizenz: Open Source. Downloads insgesamt: 33,672 (letzte Woche) Betriebssystem: Windows XP/Vista/7/8/10. Latest version: 1.8.13. Beschreibung. Sends the data you code to an ARDUINO device. Tests the code for bugs and simulates the behavior of the program. Supports. After that you open the software file and start 6 . the program named arduino.exe. Two set ups on the program are important and should be considered. a) The board that you want to connect, has to be selected on the arduino software. The Funduino Uno is here known as Arduino / Genuino Uno. b) You have to choose the right Serial-Port, to let the Computer know to which port the. It requires allocating a huge contiguous file and writing it using the multiple block sequential mode. This makes the app more complex and not so easy to understand. The write time for a 512 byte block in sequential mode is about 850 microseconds with occasional busy times of 2 - 3 ms on a SanDisk Extreme 30 MB/sec card. In random mode this. You can create, save and write files to the ESP32 filesystem by writing the code yourself on the Arduino IDE. This is not very useful, because you'd have to type the content of your files in the Arduino sketch
Arduino Working With Multiple Files (READ/WRITE) : 4 Steps
file.write() Schreibt Date in das File file.write(data) file.write(buf, len) Übergabeparameter: file ist ein Objekt des Typs File. Es wird von SD.open() zurückgeliefert (referenziert) data sind byte, char, oderr string (char *) welche(s) geschrieben werden soll(en). buf ist ein Array von Werten aus dem geschrieben werden sol This guide shows how to generate a .bin (binary) file from your sketch on Arduino IDE.. Generate a .bin file in Arduino IDE. As an example, we'll generate a .bin file from the Blink example. Follow the next steps to generate a .bin file from your sketch in Arduino IDE.. 1) First, go to Tools > Board and select the right board (for example, ESP32 DEVKIT DOIT Board) w Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file. w+ Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file. a Open for appending (writing at end of file). The file is created if it does not exist. The stream is positioned at the.
Arduino Uno R3 - OriginalAdeept Arduino Compatible DIY 5-DOF Robotic Arm Kit forAdeept 42 Modules Ultimate Sensor Kit for Arduino UNO R3Ameba Arduino: [RTL8195] [RTL8710] RFID – Using RFID RC522Adeept RFID Starter Kit for Arduino MEGA 2560 withPZEM-004T Update Version AC Single Phase MultifunctionArduino MP3 Player ShieldKuman 650nm Laser Sensor Module 5V Red Laser Dot Diode5" Nextion HMI LCD Touch Display - RobotShop
Next step is to write a Arduino sketch. Write a code in such a way that when Arduino receives any character over serial port, it performs some particular task. For example Write a code in such a way that when Arduino receives any character over serial port, it performs some particular task Right click in the file explorer window and select: new > text document; Type something in the document and save it as myfile.txt or, just use the example file from below. Once the file is created, eject the card and put it in the breakout board. Code. Upload the following code to your board in the Arduino IDE: #include <LiquidCrystal.h> #. In particular, the number is written to a file named file.txt. Next, the content of file.txt is read. At the end of the loop function, a delay of 5 seconds is added. Please note that when the Arduino is started, it is checked whether a file named file.txt exists (see setup function). If so, the file is deleted * Allow test framework to use cores/esp8266/Arduino.h directly * fix wps debugging * some more missing debug.h * Hunt down debug.h and roll-back TODO: rename it to something else... it is an internal header * Move abs+round checks to test/device/test_sw * Restore macros for C code * fixup! Move abs+round checks to test/device/test_sw * Fix bad c/p, actually try round with ints * tweak c macros.
• Docmorris gutschein 2019.
• Toom luftentfeuchter.
• Kette holzperlen kinder.
• Unitymedia horizon fernbedienung reset.
• Aneto.
• Lindlhof bad aibling.
• Erst zwillinge dann drillinge.
• Mein sky app funktioniert nicht.
• Filterballs hornbach.
• Ganesha yoga.
• Jahrzehntelang bedeutung.
• Anlage aus 2018.
• Halbjähriges mit freund was machen.
• Pflastersteine günstig kaufen restposten.
• Ikea expedit 5x5.
• Emmausgeschichte für kinder.
• Lüftungsanlage kaufen.
• Meating meeting.
• Redewendung lernen.
• Csgo parameter.
• Wetter chicago oktober 2018.
• Ayurveda kochen lernen.
• Yamaha AV Controller App Windows.
• Gefühlschaos zwischen zwei männern.
• Facebook gruppe kostenpflichtig.
• Thd elektrotechnik.
• Icd 10 f10.2 kriterien.
• Kalender juni 2019 mit feiertagen.
• English dialects in africa.
• William billy ray cyrus.
• Facebook.pl login.
• Förderung Ausbildung schwerbehinderte.
• Wohnungen mühlweg 1210 wien.
• Was bedeutet society auf deutsch.
• Alphabetische Sortierung S, Sch St.
• Romulus und remus film 2019.
• Eeg 2017 750.
• BSW Voraussetzungen.
• Melbourne australia.
• Chris hemsworth kettlebell workout.
• Abstand pferdehaltung wohnbebauung.
|
__label__pos
| 0.745743 |
@inproceedings{, Author = {G. Steidl und M. Tasche}, Title = {Fast algorithms for one-and twodimensional discrete cosine transforms}, Year = {1990}, Pages = {285 - 298}, Editor = {W. Haussmann und K. Jetter,}, Address = {ISNM 94, Birkhäuser - Verlag Basel,}, Booktitle = {In: Multivariate Approximation and Interpolation} } @COMMENT{Bibtex file generated on 2018-1-20 with typo3 si_bibtex plugin. Data from http://www.mathematik.uni-kl.de/publications/ }
|
__label__pos
| 0.998806 |
Usando struct como CLAVE y VALOR para el mapa. operación find () dando error
Code in c++:
#include <iostream>
#include <map>
#include <string>
using namespace std;
struct keyInfo
{
string Key1;
string Key2;
bool keyInfo::operator <(keyInfo &A) const
{ return ((this->Key1<A.Key1)&&(this->Key2<A.Key2)); }
};
struct valueInfo
{
int value1;
int value2;
int value3;
valueInfo(const int A,const int B,const int C) :
value1(A),value2(B),value3(C) {}
};
typedef std::map<keyInfo, valueInfo> MapTYPE;
int main()
{
MapTYPE TMap;
keyInfo K;
K.Key1="main";
K.Key2="i";
valueInfo V(-2,-3322,9000);
TMap.insert(MapTYPE::value_type(K,V));
MapTYPE::iterator It1=TMap.find(K);
It1=TMap.find(K);
if(It1!=TMap.end())
std::cout<<"Success(K): "<<It1->second.value2<<std::endl;
keyInfo E;
E.Key1="main";
E.Key2="j";
//TMap.insert(std::pair<keyInfo,valueInfo>(E,V));
MapTYPE::iterator It2=TMap.find(E);
if (It2!=TMap.end())
std::cout<<"Success(E): "<<(It2->second).value3<<std::endl;
cin.get();
return 0;
}
When I compile this code it gave me the error:
error C2679: binary '<' : no operator found which takes a right-hand operand of type 'const keyInfo1' (or there is no acceptable conversion)
Please let me know where I'm going wrong? Any help is highly appreciated. Thanks.
I have tried to implement own operator and used in map<>, code looks as follows:
#include <iostream>
#include <map>
#include <string>
using namespace std;
struct keyInfo
{
string Key1;
string Key2;
/*bool keyInfo::operator()(keyInfo const& Left,keyInfo const& Right) const{
return ((Left.Key1<Right.Key1)&&(Left.Key2<Right.Key2));
}*/
};
struct LessComparer{
bool operator()(keyInfo const& Left,keyInfo const& Right) const{
return !(Left.Key1==Right.Key1 && Left.Key2==Right.Key2);
}
};
struct valueInfo
{
int value1;
int value2;
int value3;
valueInfo(const int A,const int B,const int C) :
value1(A),value2(B),value3(C) {}
};
typedef std::map<keyInfo, valueInfo, LessComparer> MapTYPE;
int main()
{
MapTYPE TMap;
keyInfo K;
K.Key1="main";
K.Key2="i";
valueInfo V(-2,-3322,9000);
TMap.insert(MapTYPE::value_type(K,V));
MapTYPE::iterator It1=TMap.find(K);
It1=TMap.find(K);
if(It1!=TMap.end())
std::cout<<"Success(K): "<<It1->second.value2<<std::endl;
keyInfo E;
E.Key1="main";
E.Key2="j";
//TMap.insert(std::pair<keyInfo,valueInfo>(E,V));
MapTYPE::iterator It2=TMap.find(E);
if (It2!=TMap.end())
std::cout<<"Success(E): "<<(It2->second).value3<<std::endl;
cin.get();
return 0;
}
Here I'm using operator() to return 0 iff both Key1 and Key2 of Left and Right are equal. I think this is the same way map::less works, I mean it return false only if equality condition is satisfied.
It works fine in first case i.e. TMap.find(K) where same key is found. But during call in second case i.e. TMap.find(E) it pops up an error saying:
"Debug assertion failed"
Expression: Invalid operator <
preguntado el 10 de marzo de 12 a las 14:03
In addition to making the parameter const, you should also consider if you realmente want to have both keys less than each other. What happens if Key1 es igual a A.Key1? -
2 Respuestas
Tu declaración de operator< esta apagado.
struct keyInfo
{
string Key1;
string Key2;
bool keyInfo::operator <(keyInfo &A) const
{ return ((this->Key1<A.Key1)&&(this->Key2<A.Key2)); }
};
... and for several reasons:
1. It is an error to prefix the declaration with the class name within the class. You only should do so if you define it outside the class. Some compilers are laxist, but the Standard says you should not do this.
2. The reason you cannot compile is that operator< should accept both its operands either as values (for simple things) or by const&. Here you forgot the const para A.
3. The definition is incorrect, your operator< has its semantics off as the properties of antisymmetry is not respected.
4. It is recommended that binary operators be declared as free functions outside the class.
All in all, the correct declaration and definition are:
struct keyInfo {
std::string Key1;
std::string Key2;
};
inline bool operator<(keyInfo const& left, keyInfo const& right) {
if (left.Key1 < right.Key1) { return true; }
if (left.Key1 > right.Key1) { return false; }
return left.Key2 < right.Key2;
}
If you can use Boost, a "simple" way to implement this is:
inline bool operator<(keyInfo const& left, keyInfo const& right) {
return boost::tie(boost::cref(left.Key1) , boost::cref(left.Key2))
< boost::tie(boost::cref(right.Key1), boost::cref(right.Key2));
}
respondido 10 mar '12, 14:03
@EthanSteinberg: thanks, but I don't remember off the top of my head if the boost:cref call is necessary. I think you can get away without it with tie... but just didn't want to take any chance here. - Matthieu M.
I have tried using own comparer. can you reply to link: Using Own Comparator - ND Thokare
Change parameter to const keyInfo& A:
bool keyInfo::operator <(const keyInfo &A) const // keyInfo:: is unrequired here
In std::map the key is held as const T así que cuando el std::map implementation invokes keyInfo.operator<() it is passing a const keyInfo&, que no se puede convertir en un keyInfo&.
respondido 10 mar '12, 14:03
I have changed parameter to const keyInfo& A , still the same occurs. - ND Thokare
I have tried using own comparer. can you reply to link: Using Own Comparator - ND Thokare
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.
|
__label__pos
| 0.882954 |
Can You Put Rubber Tires on Power Wheels?
Jimmy Boyera // Last Updated on March 19, 2023
Yes, you can put rubber tires on your power wheels. Rubber tires are better than plastic tires as they offer better traction and last longer.
You probably have been thinking about replacing your power wheel's tires because either they have worn out or they are not performing well. It's better to replace them with rubber tires. Why? Let's find out!
Can you buy rubber tires for power wheels?
Yes, you can put rubber tires for power wheels. There are various rubber tires available for power wheels. You need to find the perfect size and buy a set of tires.
Can you put rubber tires on power wheels?
Can You Put Rubber Tires On the Power Wheels
Yes, replacing plastic tires with rubber tires in a power wheel is a great idea. You can buy a set of rubber tires and put them on your power wheels for better performance.
Some of the problems you may face with regular plastic tires in your power wheels are:
• Slippery: Plastic tires are slippery and don't have much traction. It makes them riskier to drive.
• Less durable: Plastic tires are more susceptible to breaking. That's why they are less durable than rubber tires.
• Noisy: Plastic tires are made of stiff materials, which makes them noisy.
• Not enough grip: Plastic tires don't have a good grip. It makes it harder to move with ease off-road or on snow.
These are some common problems you may face with plastic tires. But your rubber tires usually do not have such issues. Hence, you can always put rubber tires on your power wheels.
The best thing about replacing the tire is that you do not need any special skills. Replace the plastic tires with rubber tires in the same way you would have set plastic tires.
Do they make rubber tires for power wheels?
Yes, many tire brands make rubber tires for power wheels. However, they are not widely available as only a few models are specifically made for power wheels.
However, there are a lot of tires available in the market for off-road vehicles. You can buy any of them if they match the size of your power wheels. They are always suitable to use with toy vehicles.
Why don't power wheels have rubber tires?
Why don't Power Wheels have Rubber Tires
Power wheels do not have built-in rubber tires due to cutting costs. Rubber tires are usually costlier than rubber tires.
That's why companies use plastic tires for power wheels. It keeps the price of the vehicle low, which helps them attract more customers.
Rubber Tires On Power Wheels: Benefits
Rubber tires have a lot of benefits over plastic tires. Some of them are:
• Excellent traction: Rubber tires have excellent traction. It helps the driver to move the power wheels with more ease and control.
• Less noise: The rubber material causes less noise while driving, which makes the playing experience better.
• Enough grip: Rubber tires have enough grip to run smoothly on any terrain. Kids mostly go off-road, on grassy tracks or muddy tracks with power wheels. The rubber tire helps to avoid slipping on such trails due to having a good grip.
• Long lasting: Rubber tires do not break easily like plastic tires. That is why they can offer long-lasting performance.
Conclusion
You can always upgrade built-in plastic tires with good quality rubber tires in your power wheels. I hope all of your confusion is clear, and now you know that rubber tires are better for your kid's off-road toy vehicle.
About the Author Jimmy Boyera
Hi, I’m Jimmy Boyera. My journey as a big enthusiast of outdoor sports like biking and riding vehicles began with working in the automotive industry, where I got a certificate for an automotive expert.
Since, I have gained 10 years of automotive industry experience working as a dedicated and diligent automotive expert, registered with the Automotive Council.
I have owned plenty of sports cars, bikes, and power wheel rides on vehicles for kids over the years, matching different tests I hit daily.
When I began to get many questions from friends & family about riding toy cars for kids, I decided I can help a significant group by a blog, something like My Tiny Rider.
Besides, as I discussed the idea with my fellow automotive experts and child specialists who had the same interest, some of them weighed in & that is how My Tiny Rider became a reality.
My thorough, thoughtful, evidence-based approach has driven to a loyal patient following & rewarding and successful career as an automotive expert.
I welcomed the opportunity to join the My Tiny Rider Team as a platform to share my knowledge & experience.
|
__label__pos
| 0.762252 |
Pericarditis, myocarditis & perimyocarditis: ECG, criteria & treatment
Pericarditis, myocarditis and perimyocarditis: ECG changes and clinical features
The pericardium is a double-walled sac in which the heart and the roots of the great vessels are contained (Figure 1). The pericardial sac encloses the pericardial cavity which contains pericardial fluid. Numerous conditions may cause inflammation in the pericardium, the pericardial cavity and/or the myocardium. Pericarditis refers to inflammation of the pericardium, and myocarditis refers to inflammation of the myocardial (muscle) tissue. However, it is often difficult to differentiate pericarditis and myocarditis, and they tend to accompany each other. Therefore, the term perimyocarditis is often used in clinical practice (this article will use all three terms interchangeably). The etiology, clinical characteristics and ECG features of pericarditis will be discussed here. From a clinical point of view, clinicians must be able to separate pericarditis from ST elevation myocardial infarction (STEMI). This may not always be simple, because both conditions bring about severe chest pain and ST elevations on the ECG. However, as we will discuss below, it is actually rather straightforward to distinguish these two conditions.
Figure 1. The pericardial sac and the myocardium. Note that pericarditis (inflammation of the pericardial sac) is difficult to discern from myocarditis (inflammation of the myocardial tissue) and because they tend to accompany each other, the term perimyocarditis is often used. Image by Bruce Blausen, Blausen Gallery 2014.
Figure 1. The pericardial sac and the myocardium. Note that pericarditis (inflammation of the pericardial sac) is difficult to discern from myocarditis (inflammation of the myocardial tissue) and because they tend to accompany each other, the term perimyocarditis is often used. Image by Bruce Blausen, Blausen Gallery 2014.
Causes of acute pericarditis/myocarditis
The most frequent cause of pericarditis is infections, in particular viral infections. This explains why pericarditis may affect individuals of all ages. However, a wide range of local and systemic conditions may cause pericarditis. The most common causes are as follows:
• Rheumatoid arthritis (RA)
• Systemic Lupus Erythematosus (SLE)
• Acute myocardial infarction (AMI)
• Post-infarction (including Dressler syndrome)
• Uremia
• Radiation to the heart
• Trauma
• Tuberculousis
• Neoplasms (cancer)
• Post cardiac surgery (hemorrhagic pericarditis).
Symptoms of acute pericarditis/myocarditis
There are two forms of pericarditis: acute and chronic. This article will focus on the former, as it has implications for all clinicians and the ECG.
Acute pericarditis causes chest pain, which may be very difficult to discern from pain caused by acute myocardial infarction. The chest pain in acute pericarditis may be severe and the patient may also experience cold sweats, tachycardia and anxiety; all of which are common in acute myocardial infarction. Clinical examination may reveal pericardial friction rub and the echocardiogram may show increased fluid in the pericardial cavity (pericardial effusion). Hemodynamic compromise may occur if accumulation of fluid in the pericardial sac compromises the relaxation and/or contraction of the ventricles and atria. This situation is referred to as cardiac tamponade, which has been discussed earlier.
Differentiating acute pericarditis and acute ST elevation myocardial infarction (STEMI)
The retrosternal chest pain caused by acute pericarditis may be very similar to that seen in patients with STEMI. Moreover, the pain in acute pericarditis may also, as in STEMI, radiate to the neck, shoulders or back. However, acute pericarditis is more likely if inspiration and supine position worsens the chest pain, and sitting upright and leaning forward alleviates the chest pain; the pain in STEMI is unaffected by position. Nevertheless, the retrosternal chest pain in acute pericarditis is very similar to that in STEMI.
The combination of retrosternal chest pain and ST elevation on ECG explains why clinicians often confuse acute pericarditis and STEMI. This is further complicated by the fact that acute myocarditis may cause elevated troponin levels (myocardial cells may die as a result of inflammation).
Note two differences regarding the clinical presentation of STEMI and acute pericarditis:
1. Acute pericarditis tends to affect younger individuals.
2. The most common cause of pericarditis is infections, which is why many patients may report symptoms consistent with viral infections (particularly in the preceding days).
The ECG in acute pericarditis (myocarditis)
The ECG is highly effective in differentiating pericarditis from STEMI. Figure 2 displays an example of perimyocarditis. ECG features are discussed below.
Figure 2. The ECG in acute pericarditis (myocarditis, perimyocarditis). As evident there are generalized ST segment elevations. There are no reciprocal ST segment depressions and no simultaneous T-wave inversions (negative T-waves).
Figure 2. The ECG in acute pericarditis (myocarditis, perimyocarditis). As evident there are generalized ST segment elevations. There are no reciprocal ST segment depressions and no simultaneous T-wave inversions (negative T-waves).
ECG changes in acute pericarditis, myocarditis, perimyocarditis
The ECG is used to diagnose acute pericarditis. One must always rule out the most serious differential diagnosis, which is ST elevation myocardial infarction (STEM). In order to provide the reader with knowledge on this matter, we will now discuss the characteristics of all ECG changes seen in acute pericarditis, and contrast them to ECG changes seen in STEMI.
ST elevations in acute pericarditis
• ST elevations in acute pericarditis are generalized, which implies that they occur in most ECG leads (both limb leads and chest leads). Indeed, whenever a patient presents with chest pain and generalized ST elevations, one must always suspect acute pericarditis.
• Lead V1 is typically spared from ST elevation (i.e lead V1 does usually not show any ST elevation).
• The ST segment is typically concave (read about ST segment elevations). There may be a notch in the J-point (which can be seen in leads V4 and V5 in Figure 2).
• The magnitude of the ST elevation is typically <4 mm high.
• There are no reciprocal ST depressions.
• ST elevations and T-wave inversions do not occur simultaneously.
• ECG changes in pericarditis are rather static and changes slowly over the course of several days to weeks.
Characteristics of ST elevations in STEMI
• ST elevation myocardial infarction (STEMI) causes localized ST elevations, meaning that there are ST elevations in a few leads which are anatomically neighbouring (so called contiguous leads). For example, inferior STEMI causes ST elevations in leads II, III and aVF.
• The ST segment is typically straight or convex (read about ST segment elevations).
• Reciprocal ST segment depressions are very typical of STEMI.
• ST elevations and T-wave inversions may occur simultaneously in STEMI.
• The magnitude of the ST elevation may be considerably higher than 4 mm.
• ECG changes are dynamic in STEMI. For example development of pathological Q-waves, changes in the magnitude of the ST elevation, T-wave inversion etc, may change within minutes to hours.
Note, however, that in some (rare) cases of acute myocarditis, ST elevations may be localized. This results in a situation in which it is very difficult to rule out STEMI on basis of the ECG.
T-wave inversions (negative T-waves)
ST elevations are normalized slowly in pericarditis. It may take weeks for the ST elevations to resolve. Thereafter, T-wave inversion typically ensues. The T-wave inversion may be discrete and lasts for one month. As mentioned above, ST elevations and T-wave inversions do not occur simultaneously in pericarditis. More: Inverted (negative) T-waves.
The PR segment elevation and depression
The PR segment is not affected in STEMI, whereas acute pericarditis often causes PR segment depression. Such depressions occur in most leads, except from lead V1, which often shows PR segment elevation.
Troponin leakage in acute pericarditis
Elevated troponins are common in acute pericarditis. M. Imazio et al (Cardiac troponin I in acute pericarditis; JACC 2003) showed that one third of patients had troponin elevations; in total, 8% had significantly elevated troponin levels. However, there was no association between troponin level and survival.
Below follows an ECG example of a patient with acute pericarditis. Note that the ECG changes are rather subtle.
Figure 3. Chest leads of patient with acute pericarditis. Note the ST segment elevations, concave ST segments.
Figure 3. Chest leads of patient with acute pericarditis. Note the ST segment elevations, concave ST segments.
Figure 4. Limb leads of patient with acute pericarditis. Note the very discrete, but generalized, ST segment elevations, concave ST segments.
Figure 4. Limb leads of patient with acute pericarditis. Note the very discrete, but generalized, ST segment elevations, concave ST segments.
Related topics
5/5 (1 Review)
|
__label__pos
| 0.674845 |
w3resource
JavaScript: Test whether a string ends with a specified string
JavaScript String: Exercise-47 with Solution
Write a JavaScript function to test whether a string ends with a specified string.
Test Data:
console.log(endsWith('JS string exercises', 'exercises'));
true
Pictorial Presentation:
JavaScript: Test whether a string starts with a specified string
Sample Solution:-
HTML Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript function to test whether a string ends with a specified string</title>
</head>
<body>
</body>
</html>
JavaScript Code:
function endsWith(input, string) {
var index = input.length - string.length;
return index >= 0 && input.indexOf(string, index) > -1;
}
console.log(endsWith('JS string exercises', 'exercises'));
Sample Output:
true
Flowchart:
Flowchart: JavaScript: Test whether a string ends with a specified string
Live Demo:
See the Pen JavaScript Test whether a string ends with a specified string-string-ex-47 by w3resource (@w3resource) on CodePen.
Improve this sample solution and post your code through Disqus
Previous: Write a JavaScript function to test whether a string starts with a specified string.
Next: Write a JavaScript function to get the successor of a string.
What is the difficulty level of this exercise?
JavaScript: Tips of the Day
JavaScript: use strict
function getAge() {
'use strict';
age = 21;
console.log(age);
}
getAge();
With "use strict", you can make sure that you don't accidentally declare global variables. We never declared the variable age, and since we use "use strict", it will throw a reference error. If we didn't use "use strict", it would have worked, since the property age would have gotten added to the global object.
Ref: https://bit.ly/323Y0P6
|
__label__pos
| 0.859289 |
Menu
Amazon Simple Queue Service
Developer Guide
Setting Up Amazon SQS
Before you can use Amazon SQS for the first time, you must complete the following steps.
Step 1: Create an AWS Account
To access any AWS service, you first need to create an AWS account, an Amazon.com account that can use AWS products. You can use your AWS account to view your activity and usage reports and to manage authentication and access.
To avoid using your AWS account root user for Amazon SQS operations, it is a best practice to create an IAM user for each person who needs administrative access to Amazon SQS.
To set up a new account
1. Open https://aws.amazon.com/, and then choose Create an AWS Account.
2. Follow the online instructions.
Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone keypad.
Step 2: Create an IAM User
To create an IAM user for yourself and add the user to an Administrators group
1. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/.
2. In the navigation pane, choose Users, and then choose Add user.
3. For User name, type a user name, such as Administrator. The name can consist of letters, digits, and the following characters: plus (+), equal (=), comma (,), period (.), at (@), underscore (_), and hyphen (-). The name is not case sensitive and can be a maximum of 64 characters in length.
4. Select the check box next to AWS Management Console access, select Custom password, and then type the new user's password in the text box. You can optionally select Require password reset to force the user to select a new password the next time the user signs in.
5. Choose Next: Permissions.
6. On the Set permissions for user page, choose Add user to group.
7. Choose Create group.
8. In the Create group dialog box, type the name for the new group. The name can consist of letters, digits, and the following characters: plus (+), equal (=), comma (,), period (.), at (@), underscore (_), and hyphen (-). The name is not case sensitive and can be a maximum of 128 characters in length.
9. For Filter, choose Job function.
10. In the policy list, select the check box for AdministratorAccess. Then choose Create group.
11. Back in the list of groups, select the check box for your new group. Choose Refresh if necessary to see the group in the list.
12. Choose Next: Review to see the list of group memberships to be added to the new user. When you are ready to proceed, choose Create user.
You can use this same process to create more groups and users, and to give your users access to your AWS account resources. To learn about using policies to restrict users' permissions to specific AWS resources, go to Access Management and Example Policies for Administering AWS Resources.
Step 3: Get Your Access Key ID and Secret Access Key
To use Amazon SQS API actions (for example, using Java or through the AWS Command Line Interface), you need an access key ID and a secret access key.
Note
The access key ID and secret access key are specific to AWS Identity and Access Management. Don't confuse them with credentials for other AWS services, such as Amazon EC2 key pairs.
To get the access key ID and secret access key for an IAM user
Access keys consist of an access key ID and secret access key, which are used to sign programmatic requests that you make to AWS. If you don't have access keys, you can create them from the AWS Management Console. We recommend that you use IAM access keys instead of AWS account root user access keys. IAM lets you securely control access to AWS services and resources in your AWS account.
The only time that you can view or download the secret access keys is when you create the keys. You cannot recover them later. However, you can create new access keys at any time. You must also have permissions to perform the required IAM actions. For more information, see Granting IAM User Permission to Manage Password Policy and Credentials in the IAM User Guide.
1. Open the IAM console.
2. In the navigation pane, choose Users.
3. Choose your IAM user name (not the check box).
4. Choose the Security credentials tab and then choose Create access key.
5. To see the new access key, choose Show. Your credentials will look something like this:
• Access key ID: AKIAIOSFODNN7EXAMPLE
• Secret access key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
6. To download the key pair, choose Download .csv file. Store the keys in a secure location.
Keep the keys confidential in order to protect your account, and never email them. Do not share them outside your organization, even if an inquiry appears to come from AWS or Amazon.com. No one who legitimately represents Amazon will ever ask you for your secret key.
Related topics
Step 4: Get Ready to Use the Example Code
This guide shows how to work with Amazon SQS using the AWS Management Console and using Java. If you want to use the example code, you must install the Java Standard Edition Development Kit and make some configuration changes to the example code.
You can write code in other programming languages. For more information, see the documentation of the AWS SDKs.
Note
You can explore Amazon SQS without writing code with tools such as the AWS Command Line Interface (AWS CLI) or Windows PowerShell. You can find AWS CLI examples in the Amazon SQS section of the AWS Command Line Interface Reference. You can find Windows PowerShell examples in the Amazon Simple Queue Service section of the AWS Tools for Windows PowerShell Reference.
Next Steps
Now that you're prepared for working with Amazon SQS, can get started with managing Amazon SQS queues and messages using the AWS Management Console. You can also try the more advanced Amazon SQS tutorials.
|
__label__pos
| 0.88929 |
ReflectionClass::export
(PHP 5, PHP 7)
ReflectionClass::exportExporta una clase
Descripción
public static ReflectionClass::export ( mixed $argument [, bool $return = false ] ) : string
Exporta una clase reflejada.
Parámetros
argument
La reflexión a exportar.
return
Configurarlo a TRUE devolverá la exportación, a diferencia de emitirla. Configurarlo a FALSE (el valor por defecto) hará lo contrario.
Valores devueltos
Si el parámetro return es seteado a TRUE, la exportación se devolverá como un string, de lo contrario se retornará NULL.
Ejemplos
Ejemplo #1 Uso básico de ReflectionClass::export()
<?php
class Apple {
public
$var1;
public
$var2 'Orange';
public function
type() {
return
'Apple';
}
}
ReflectionClass::export('Apple');
?>
El resultado del ejemplo sería algo similar a:
Class [ <user> class Apple ] {
@@ php shell code 1-8
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [2] {
Property [ <default> public $var1 ]
Property [ <default> public $var2 ]
}
- Methods [1] {
Method [ <user> public method type ] {
@@ php shell code 5 - 7
}
}
}
Ver también
|
__label__pos
| 0.998371 |
Skip to main content
Bacterial phylogenetic tree construction based on genomic translation stop signals
Abstract
Background
The efficiencies of the stop codons TAA, TAG, and TGA in protein synthesis termination are not the same. These variations could allow many genes to be regulated. There are many similar nucleotide trimers found on the second and third reading-frames of a gene. They are called premature stop codons (PSC). Like stop codons, the PSC in bacterial genomes are also highly bias in terms of their quantities and qualities on the genes. Phylogenetically related species often share a similar PSC profile. We want to know whether the selective forces that influence the stop codons and the PSC usage biases in a genome are related. We also wish to know how strong these trimers in a genome are related to the natural history of the bacterium. Knowing these relations may provide better knowledge in the phylogeny of bacteria
Results
A 16SrRNA-alignment tree of 19 well-studied α-, β- and γ-Proteobacteria Type species is used as standard reference for bacterial phylogeny. The genomes of sixty-one bacteria, belonging to the α-, β- and γ-Proteobacteria subphyla, are used for this study. The stop codons and PSC are collectively termed “Translation Stop Signals” (TSS). A gene is represented by nine scalars corresponding to the numbers of counts of TAA, TAG, and TGA on each of the three reading-frames of that gene. “Translation Stop Signals Ratio” (TSSR) is the ratio between the TSS counts. Four types of TSSR are investigated. The TSSR-1, TSSR-2 and TSSR-3 are each a 3-scalar series corresponding respectively to the average ratio of TAA: TAG: TGA on the first, second, and third reading-frames of all genes in a genome. The Genomic-TSSR is a 9-scalar series representing the ratio of distribution of all TSS on the three reading-frames of all genes in a genome. Results show that bacteria grouped by their similarities based on TSSR-1, TSSR-2, or TSSR-3 values could only partially resolve the phylogeny of the species. However, grouping bacteria based on thier Genomic-TSSR values resulted in clusters of bacteria identical to those bacterial clusters of the reference tree. Unlike the 16SrRNA method, the Genomic-TSSR tree is also able to separate closely related species/strains at high resolution. Species and strains separated by the Genomic-TSSR grouping method are often in good agreement with those classified by other taxonomic methods. Correspondence analysis of individual genes shows that most genes in a bacterial genome share a similar TSSR value. However, within a chromosome, the Genic-TSSR values of genes near the replication origin region (Ori) are more similar to each other than those genes near the terminus region (Ter).
Conclusion
The translation stop signals on the three reading-frames of the genes on a bacterial genome are interrelated, possibly due to frequent off-frame recombination facilitated by translational-associated recombination (TSR). However, TSR may not occur randomly in a bacterial chromosome. Genes near the Ori region are often highly expressed and a bacterium always maintains multiple copies of Ori. Frequent collisions between DNA- polymerase and RNA-polymerase would create many DNA strand-breaks on the genes; whereas DNA strand-break induced homologues-recombination is more likely to take place between genes with similar sequence. Thus, localized recombination could explain why the TSSR of genes near the Ori region are more similar to each other. The quantity and quality of these TSS in a genome strongly reflect the natural history of a bacterium. We propose that the Genomic- TSSR can be used as a subjective biomarker to represent the phyletic status of a bacterium.
Background
The organization of genome is not random. Many of its features are correlated with abiotic and biotic stresses faced by individual species [1]. Stresses, such as translational selection, G+C pressure, GC skew between the leading and lagging strand, amino acid conservation, protein hydropathy, gene length, transcriptional selection, and the structural stability of RNA, often left behind many distinctive signatures on the genomes [2]. Among these features are various patterns of SNP [3], INDEL, [4], synonymous codons bias [5], codonpairs bias [6], and dipeptides bias [7]. Knowing these features have contributed significantly in our knowledge on molecular evolution, species phylogeny, and biotechnology [2, 8]. We are interested in the organization of a lesser-known bias in the genomes – Translation Stop Signals (TSS), which is a collective term to describe the TAA, TAG, and TGA trimers on each of the three reading-frames of a protein coding genes.
TSS on the first reading-frame of the genes are called stop codons. Correct termination of protein synthesis is an important aspect of translational fidelity. Whereas sense-codons are recognized directly by base paring with the anticodons of tRNAs, the decoding of stop codons is mediated by proteins. In bacteria, a tripeptide in the bacterial release factors (RF) 1 and 2 serves as the “anticodon” in deciphering stop codons in mRNA. RF-1 recognizes UAA and UAG sequence in the mRNA, and RF-2 recognizes UGA and UAG in the mRNA. Furthermore, the efficiency and accuracy in terminating protein synthesis by UAA, UAG and UGA are not the same [9, 10]. This flexibility of protein termination allows many genes to be regulated [11, 12]. Since a stop codon acts on a single gene, and since genes within a genome are often diverse, the idea of using stop codon variations in a genome as biomarker for phylogenetic study has not been considered seriously.
There are also many off-frame “stop codons” on a gene. Off-frame stop codons are also called hidden stop codon, embedded stop codon, or premature stop codon (PSC) [13]. PSC may serve an essential function for the cell by preventing the ribosomes from misreading a gene [14, 15]. Tse and associates have shown that the PSC-forming codon pairs are overrepresented in most of the 990 bacterial genomes they surveyed [16]. We have previously shown that the ratios of TAA: TAG: TGA in the genomes of phylogenetically related species are often similar [17]. In that same report, we also showed that species relatedness could not be constructed by comparing the ratios of three randomly picked nucleotide trimers. Also, the ratios of TAA: TAG: TGA on non-protein coding genes (such as tRNA, rRNA), or non-genic DNA (such as complimentary DNA sequences) does not exhibit phylogenic relatedness. Since the efficiency of protein termination by TAA, TAG, and TGA are quite different, we theorized that the type of PSC and the number of PSC on the genes of bacterial genomes are likely related to environmental adaptation and natural selection. For example, symbiotic bacteria (Escherichia Fusobacterium, Rickettsia, and Borrelia) would employ a “Many and Tight” strategy by having high number of PSC (> 80 per average gene) on their genes, and most of these PSC are of the error-proof type (TAA). Genes embedded with many error-proof TSS would effectively prevent new genes from forming via recombination. This “Many and Tight” strategy may benefit the symbionts because accidental formation of a protein of unknown function could interfere the normal symbiotic relation with the host. Whereas free-living bacteria and metabolically versatile bacteria, such as Deinococcus, Mycobacterium, Pseudomonas, and Streptococcus would use a “Few and Loose” strategy by having a few PSC (< 25 per average gene) on their genomes, and most of these PSC are of the error- prone type (TGA). For example, the number of PSC on the genes of Staphylococcus aureus is quite low. This versatile pathogen, which is well known for its resistance to antibiotics, is commonly found on the skin. Unlike the intracellular parasites, the environment of the skin changed rapidly. Having fewer PSC and using the error-prone type of TSS would increase of chance of creating new proteins with very different amino acid compositions rapidly via off-frame recombination. In turn, the new proteins might enhance the survival of the bacterium.
Since the quality and quantity of PSC in a genome could affect the fitness of a species [14, 16, 17], like the stop codons, PSC are likely subject to Darwinian selection. However, there are two different types of PSC. The TSS on the second reading-frame (i.e. NTA-ANN, NTA-GNN, and NTG-ANN) are formed by codon pairs where the lead codon contributes its last two nucleotides to the signal. There are only a few codons that can become the lead codon for the second reading-frame PSC, and they are all related to four nonpolar amino acids (L, I, V, M). On the other hand, the TSS on the third reading-frame are formed by codon pairs where the lead codons are all thymine-ending codons (NNT-AAN, NNT-AGN, and NNT-GAN). Most amino acids, except K, M, Q, E and G, have at least one thymine-ending synonymous codon. Thus, the contexts of PSC on the second and third frames are quite different. The formation of TSS on the second and third reading-frames might be subject to very different selective forces.
The interrelation between the stop codons and the PSC in a genome has never been investigated. In this communication, we wish to demonstrate that all the TSS in a bacterial genome are interrelated. Together, the ratio of these TSS of a genome could represent the phyletic status of a species. A mechanism is proposed to explain how TSS are populated in a bacterial genome. Understanding the role of TSS could provide further insight on the mechanism of genome evolution in bacteria.
Results
Comparing the TSSR-1 tree with reference tree
Hierarchical clustering techniques commonly used in DNA microarray studies [18], were used to correlate the distances between the TSSR values. A species is represented by the average value of its stop codons ratio (TSSR-1). A dendrogram showing the correlation between 61 bacterial genomes based on their TSSR-1is presented in Figure 1A. Bacteria belonging to the same genus often share a similar ratio of their stop codons usage. However, bacterial grouping based on TSSR-1 does not always agree with the reference tree (Figure 2). For example, Yersinia species and Escherichia-Salmonella group are all γ-Proteobacteria, but they are separated into two different branches on the TSSR-1 tree. The TSSR-1 tree also fails to resolve the distinction between Escherichia and Salmonella genera. Additionally, genotypic variations within a group can affect the TSSR-1 grouping significantly. Many individuals, such as the Neisseria flavescens SK114, E. coli CFT073, and Rickettsia akari, are not associated with their respective genera.
Figure 1
figure 1
Species correlations based on reading-frame-specific translation stop signals. Hierarchical clustering of 61 bacteria (A) correlation based on the genomic translation stop signals ratios on the first reading frames (TSSR-1); (B) correlation based on the genomic translation stop signals ratios on the second reading frames (TSSR-2) and, (C) correlation based on the genomic translation stop signals ratios on third reading frames (TSSR-3). Correlation distance is between zero and one with zero being 100% similar, and one being no correlation.
Figure 2
figure 2
16S rRNA alignment reference tree. A phylogenetic reference tree is constructed from the 16SrRNA sequence alignment with 19 type species (see Table 1). This standard tree was used to validate the accuracy of other trees using bacterial translation stop signals profiles.
Comparing the TSSR-2 tree with the reference tree
A species is represented by the average value of TSSR on the second reading-frames (TSSR-2). A dendrogram showing the distance correlation between the TSSR-2 of 61 bacteria is presented in Figure 1B. Bacteria grouped by their TSSR-2 are more cohesive. All bacteria belonging to the Escherichia-Shigella-Salmonella clade are grouped into a highly condensed cluster with two branches. The overall placement of bacteria on the TSSR-2 tree mimics that of the reference tree (Figure 2). However, like TSSR-1, the TSSR-2 tree fails to resolve the distinction between Escherichia and Salmonella, and the Yersinia group is separated from rest of the γ-Proteobacteria.
Comparing the TSSR-3 tree with the reference tree
A species is represented by the average value of its TSSR on the third reading-frames (TSSR-3). The correlation of 61 bacterial TSSR-3 is shown in Figure 1C. The genera of Yersinia and Escherichia-Shigella are grouped but the genus Salmonella is separated from the other γ-Proteobacteria. In addition, E. coli ED1a, Shigella sonnei SS046, and S. boydii Sb227 are misplaced.
Bacteria correlations based on TSSR-1, TSSR-2, and TSSR-3 (Figure 1A–C) have provided different clues on their relatedness. Nevertheless, none of them alone could accurately place all the test organisms to their correct phyletic position (Figure 2).
Comparing the genomic-TSSR tree with the reference tree
A different tree is produced when each bacterium is represented by the average value of all its Genic-TSSR (Genomic-TSSR) (Figure 3). The branches and members on the branches of this tree are in complete agreement with those on the reference tree (Figure 2). Additionally, species and subspecies are clustered with very high resolution. A detail description of this tree is described:
Figure 3
figure 3
Species correlation based on genomic translation stop signals on all three reading-frames. Distance correlation of 61 bacteria based on their Genomic Translation Stop Signals Ratio. A species is represented by the average value of all its Genic-TSSR (Genomic-TSSR). The Genomic-TSSR values of 61 bacterial genomes were clustered by Hierarchical clustering by City-Block Distance, Complete-Linage. Parentheses show the genomic size and GC ratio of that species. Correlation distance is between zero and one with zero being 100% similar, and one being no correlation.
Organisms on the first branch are all members of the α-Proteobacteria. This branch has three sub-branches: Rickettsia (11 species/strains), Orientia (1 species), and Wolbachia (2 species). Genomic-TSSR grouping of these bacteria is not influenced by genomic sizes or by their GC contents. The genomic size of bacterium in this branch varies from 1.08 Mb to 2.14 Mb, and their GC content ranges from 28.9 to 35.2%.
The tree generated by Genomic-TSSR values also exhibits very high resolution. All 11 Rickettsia species/strains are clustered into one group with two distinct terminals separating the typhus causing bacteria (R. prowazekii and R. typhi) and the spotted-fever causing bacteria. The two R. bellii strains are more closely related to the typhus causing bacteria. The Genomic-TSSR distinction between the Typhus and Spotted subgroup is in good agreement with the current scheme of Rickettsial classification [19]. Orientia tsutsugamushi is the out-group of the Rickettsia. This Genomic-TSSR assignment of Rickettsia-Orientia is in perfect agreement with the reference tree (Figure 2) and is supported by many other independent evidences [19].
Wolbachia (2 strains) forms a outer cluster of the Rickettsiae group. Although not well characterized, we included Wolbachia in this study solely for in the hope to get new information that could resolve the phyletic status of this interesting bacterium. Filariasis is a leading cause of global disability. Most of these filarial nematodes are dependent on a symbiosis with Wolbachia bacteria [20]. Strains assignment for Wolbachia is problematic. As to the date of this writing, the Ribosome Data Project Database has yet to assign a type 16SrRNA sequence to represent Wolbachia. However, there are multiple lines of evidences to suggest a close genetic association between Wolbachia and Rickettsiae[2022]. Currently, Wolbachia has only one species – W. pipientis. The insect-harbored W. pipientis wMel and the round worm–harbored W. pipientis wBm, differ in host specificity and GC content (34.2% vs. 35.2%). Despite these differences, the Genomic-TSSR correlation between these two stains of Wolbachia is very close. The Wolbachia Genomic-TSSR is also closely associated the Genomic-TSSR values of other α-Proteobacteria.
Members on the second branch of the Genomic-TSSR tree are all β- Proteobacteria. This branch includes 6 species/strains of Neisseria. Most Neisseria are commensal. Detailed subgrouping of Neisseria is often problematic [23]. Unlike the Rickettsia Neisseria are often considered sexual because they are naturally competent [24]. The degree of genetic relatedness between N. gonorrhoeae and N. meningitidis is extremely high [25]. Despite such high degree of genetic similarity, the Genomic-TSSR values of the four strains of N. meningitidis form a tight group separated from the N. gonorrhoeae. The Genomic-TSSR correlation among Neisseria species is in perfect agreement with that of the 16SrRNA sequence alignment tree (Figure 2).
Members of the third branch of the Genomic-TSSR tree are all γ-Proteobacteria. The genomic size of individual organisms in this group varies from 5.7 Mb to 4.6 Mb, and the GC content varies from 51.2 to 47%. Within this branch are two distinct sub-branches: The Escherichia-Salmonella sub-branch and the Yersinia sub-branch. The Escherichia-Salmonella sub-branch has 43 genera: E. coli (23 strains) and E. fergusonii, Shigella (4 species), and Salmonella (5 species), whereas the Yersinia sub-branch has 8 species/strains.
Most microbiologists believe Shigella is a clone of E. coli[26]. Without any exception, all the 28 Escherichia-Shigella species/strains are clustered into a tight group. This strongly suggests that the Genomic-TSSR value is not influenced by genome variation of individual strains. All Salmonella are also grouped as a single clade. Within the S enterica strains, the four human pathogens form a tight sub-group separated from the swine isolate, S. choleraesuis. Although highly correlated, the Genomic-TSSR values of the typhoid-fever strains are separated from the Genomic-TSSR values of the paratyphoid-fever strains. The Genomic-TSSR tree showing Salmonella is the next-of-kin to the Escherichia-Shigella is in perfect agreement with the 16SrRNA sequence alignment tree (Figure 2) and other independent evidences [27].
The Genomic-TSSR of Yersinia forms a distinct cluster separated from the Escherichia-Shigella- Salmonella group. Traditionally, Y. pestis can be separated into three major biovars – Antiqua, Orientals, and Medievalis. The Genomic-TSSRs of the Antiqua (Y. pestis Angola and Y. pestis Antiqua) and the Orientalis (Y. pestis CO92) biovars are very similar. The Genomic-TSSR of the Antiqua-Orientalis group and Y. pseudotuberculosis is also very close. However, the Medievalis strains (Y. pestis 91001 and Y. pestis KIM) form a cohesive branch outside the Y. pseudotuberculosis branch. Y. enterocolitica is the root of the Yersinia clade. In general, the Genomic-TSSR correlation scheme of this group of bacteria is in line with other phylogenetic scheme proposed [28]. However, some slight differences are noticed. Based on the sequences of five selected housekeeping genes, it was proposed that Y. pestis was evolved recently as a clone of Y. pseudotuberculosis[29]. Our study showed that Antiqua and Orientalis are likely the decedents of Y. pseudotuberculosis. However, the Medievalis strains (Y. pestis 91001 and Y. pestis KIM) form a cohesive branch outside the Y. pseudotuberculosis branch. This might suggest multiple origins of Y. pestis. Thus, the Genomic-TSSR assignment for Medievalis phylogeny is inconsistent with the 5-housekeeping-genes assignment.
TSSR variations of individual genes
The Genomic-TSSR is the average value of all Genic-TSSR on the genome of that bacterium. However, the average value could be skewed by a few dominating genes. To investigate this issue, five hundred genes from each of four different bacterial genomes were randomly selected. Their Genic-TSSR relations were analyzed using the CA technique. CA is a statistical method able to analyze and plot a cloud of values of multiple dimensions (in our case, there are nine dimensions, representing the each of the nine TSS), and rotate it so that the maximum variability is visible. The distributions of 2000 Genic-TSSR values from four different genomes are presented in Figure 4. At 95% confidence, four clusters of genes are recognized. The Escherichia (ECOL, solid line, Turquoise) and Salmonella (SALM, dashed lines, Green) genes form two concentric ellipses with most of their genes overlapping the same space. The centroids of Escherichia (E) (coordinates = +0.11, -0.08) and Salmonella (M) (coordinates = +0.10, -0.11) are very close to each other. The Neisseria genes (NEIS, dotted line, Red) are wider spread. The centroid of the Neisseria genes (N) is located at the upper right side of the graph (coordinates = +0.37, +0.11). The cloud of the Rickettsial genes (RICK, dotted-dashed line, Dark Blue) is highly condensed. The centroid of the rickettsial genes (R) is located at the upper left side of the graph (coordinates = −0.53, +0.10).
Figure 4
figure 4
Correspondence Analysis of individual genes from four different species. Five hundred randomly selected genes from each of the genomes of four different bacteria were selected for CA analysis. At 95% confidence, four clusters of genes could be recognized: Escherichia coli CFT073 (ECOL, solid line, Turquoise), Salmonella typhimurium LTS (SALM, dashed line, Green), Rickettsia typhi Wilmington (RICK, dotted-dashed line, Dark Blue) and Neisseria meningitidis Mc58 (NEIS, dotted line, Red). Also showed are the centroids of the genes of E. coli (E), S. typhimurium (S), R. typhi (R), and N. meningitidis (N).
Figure 4 suggests that most of the genes in a species share a similar Genic-TSSR value and that the TSSR of the genes of related species, such as Escherichia and Salmonella, are very similar. The coordinates of the centroid, which is essentially the average value of the genes, of Escherichia and Salmonella are very close. This directly supports the Hierarchical distance clustering result of Figure 3.
TSSR bias of individual genes within a chromosome
DNA replicates from the replication origin (Ori) to terminus (Ter). It divides a bacterial chromosome into oppositely replicated halves, which are referred as replichores. DNA sequences between the two replichores are often biased. The frequencies of occurrences of many short sequences, such as the Chi sites, on each of the replichores are very different [30]. Also, because of GC-skew and other factors, the orientation of genes on the leading and lagging strands of DNA [31, 32], and genes locating near the Ori and Ter [33] are often biased. We wanted to know whether genes on the two replichores, the orientation of the genes on different DNA strands, or the proximities of the genes to the Ori and Ter, would affect the TSSR value of the genes. The genome of E. coli K12 was used to investigate this issue. Results (Figure 5) show that when genes are categorized based on their location on the left or right replichores, or based on the orientation on the leading or lagging strands of the DNA, the average percentage of TSSR were essentially the same (p = 1). However, when genes are categorized by their proximity to the Ori or Ter, the TSSR of the genes near Ori () and the TSSR of the genes near the Ter () regions are statistically different (p = 0.2). For E. coli, among the nine different TSSR scalars, the TGA signal on the second reading-frame (NTGANN) is most distinct. The average percentage of counts for this signal in genes near the Ori is about 0.3, whereas the average percentage of counts for this signal in genes near the Ter region is only 0.25. The variations between TSSR usages among gene groups can be better visualized by plotting the standard deviations (SD) of the means of the nine TSSR of the above three pairs of data (Figure 5 insert). The SD of the genes on the left and right replichores are very similar (about 0.112 ±0.00055). Similarly, genes locating on the leading and lagging strains of the DNA do not show any significant different in their Genic-TSSR values. However, the SD of the TSSR in genes near the Ori region is higher (SD = 0.117088) is much higher whereas the SD of the TSSR in the genes near the Ter region is much lower (SD = 0.107883). Similar results were also observed in the genomes of N. meningitidis Z491 and Yersinia pestis Kim (data not shown).
Figure 5
figure 5
Kolmogorov-Smirnov test for discrete distributions of Genic-TSSRs on a chromosome. A two-sided Kolmogorov-Smirnov test (KS-test) comparing the average percentage of counts of each translation stop signals among 400 genes from Escherichia coli K12 based on assigning these genes to three categories. (A) genes are assigned based on the location on each replichore (Left (∆) vs. Right ()); (B) genes are assigned based on their orientation on the leading or lagging stands of the DNA (Forward (■) vs. Reverse (□)), or (C) genes are assigned based on their proximity to the replication origin or terminus (Ori () vs. Ter ()). The insert shows the standard deviation of the average percentage of counts of all nine types of translation stop signals in each gene assignment.
Discussion
The 16SrRNA alignment tree is currently the primary reference for bacterial phylogeny [34]. This “gold standard” is often used by researchers to prove (or disprove) the phylogenic relation of species based on other biomarkers [35, 36]. We employed a similar strategy to test the possible use of Genomic-TSSR as a tool for bacterial phylogeny. We also used multiple strains of the same species to provide a measure of genotypic variation within a species.
It has been known that stop codon usage is influenced by natural selection [37, 38], but genomic bias in stop codons usage has never been considered as a valid biomarker for species identification. Failure in using genomic stop codons bias as an effective biomarker for species identification is clearly illustrated in Figure 1A. Although most phylogenetically related species can be grouped by their ratio of stop codons usages at lower taxons, genotypic variations within a species could misidentify a strain. Genomic stop codon bias also fails to predict the bacteria at higher taxon. Yesinia is placed apart from γ-Proteobacteria (Figure 1A).
Many reports also suggested that the TSS on the second and third reading-frames are subject to natural selection [1417, 39]. We found that related species often share a similar TSSR on their second or third reading-frames (Figure 1B1C). However, like the stop codon bias, neither TSSR-2 nor TSSR-3 alone can reliably predict the identity of a species (Figure 1 vs. Figure 2). Despite the different contexts of the TSS on each of the three reading-frames, there are certain features between the TSSR-1, TSSR-2, and TSSR-3 trees that seem to complement each other. We initially noticed that, by sorting the numeric values of one or other TSSR column on the spreadsheet (Table 2), one or other groups of phylogenetically related groups of bacteria (on the rows) would come closer together. We therefore decided to consider all nine signals simultaneously. Our initial thought was that, by providing certain weights on certain class of TSS, related species might form a cluster. Much to our surprise, the Genomic-TSSR correlation tree was in complete agreement with the 16SrRNA tree, without any mathematical manipulation (Figure 3 vs. Figure 2). This result not only suggests that the TSS on each of the three reading-frames in a genome are interrelated, the complete symmetry between the Genomic-TSSR and 16SrRNA trees suggests the Darwinian selection force on TSS in directing the evolution of Proteobacteria is parallel to that of the rRANs. Why are the TSSs on the three reading-frames of a genome interrelated to each other? A possible mechanism is proposed:
Most bacterial genes are formed by gene duplication, recombination and divergence [40]. Off-frame recombination would instantaneously generate a set of new sense-codons, which are important for rapid gene divergence. Unlike those sense-codons that dictate the physical character for a protein, TSS in the genes would dictate the length, and therefore the complexity, of future genes [17]. The DNA is the common template for both chromosome replication and gene transcription. In bacteria, both DNA replication and gene expression occur simultaneously. When a bacterium divides, the faster moving DNA replication machinery often collides with the slower moving transcription machinery on the same track of DNA. This would cause the supercoiled DNA between these two complexes to break, leading to recombination at that region. This phenomenon, termed transcription-associated recombination (TAR), has proven to be a major player in the maintenance of genome integrity and in the induction of genetic instability and diversity [4143]. Off-frame recombination induced by TAR may explain why the TSS in a genome are interrelated: Frequent collisions between DNA and RNA polymerases would increase the frequency of homologous recombination at the protein-coding regions of the chromosome. Off-frame recombination would shuffle the TSS between the three reading-frames and from one gene to other genes. Repetitive TAR during the course of species evolution could explain why the TSS on the three reading-frames of the genes in a chromosome are interrelated, and why closely related species always share a similar Genomic-TSSR.
The GC content on the leading strands and lagging strands on the chromosome are skewed [44]. However, GC skew does not seem to affect the TSSR on the leading and lagging oriented genes. Genes on each replichore also share a similar TSSR profile (Figure 5). Perhaps, the intrinsic compositions of TSS, which are rich in A and T, poor in G, and lack of C, may avoid the bias of CG skew. Instead, we noticed that the TSSR of genes between the Ori and Ter regions are quite different (Figure 5). This regional bias may be related to the mechanism of bacterial chromosome replication. Initiation of DNA replication at Ori proceeds bidirectionally and terminates at the Ter region [45]. Very often, the rate of chromosome replication is slower than the rate of cell division. Bacterium compensates the slower DNA replication process by initiating multiple rounds of DNA replication before each cell division [46]. As a result, the copies of genes near the Ori region are amplified, a phenomenon commonly known as replication-associated gene dosage. For example, when E. coli are grown at rates of 2 doublings/h, genes near the Ori are about threefold more prevalent than genes near the terminus; even at a very slow growth rate of 0.6 doubling/h, this ratio is still significantly high (about 1.7) [47]. In addition, genes near the Ori region are often highly expressed genes [48]. Thus, the frequency of TAR induced homologues recombination among genes near the Ori region is expected to occur more often. As a result, the TSS on the genes near the Ori region would shuffle more often among themselves than the rest of the genes on the same chromosome. This could explain why the TSS in the genes near the Ori are more similar to each other. Similarly, the Ter region is the site of decatenation of circular chromosomes by topoisomerase IV [49]. Arrest of the replication fork near the Ter region often exposes a single-stranded gapped region and DNA ends from the newly replicated strands at the fork junction, which is subjected to homologous recombination near that region [50].
The Genomic-TSSR calculation is based on averaging the Genic-TSSR values of all genes in a genome. Horizontal gene transfer from unrelated species would undoubtedly disrupt the TSS profile of a species. There are some evidences to support this view: For examples, at the genome level, the Genomic-TSSR correlation between members of a genus that evolved without the input of foreign genes, such as the Rickettsia species [51], or those species that are evolved only recently, such as the Yersinia species [52], are very high (Figure 3). On the other hand, Neisseria are often considered promiscuous because they are naturally competence [53]. The Genomic-TSSR correlation between the Neisseria species is also less cohesive (Figure 3). Furthermore, at the individual gene level, the Genic-TSSR values of individual genes in the nonsexual Rickettsia genome are tightly clustered whereas the Genic-TSSR values of individual genes of the promiscuous Neisseria genomeare wider spread on the CA plot (Figure 4).
Classification of bacteria based on monophasic method such as rRNA sequence alignment [54] often lacks resolution [34]. A single measurement is also subject to simple stochastic variation and to the influence of horizontal gene transfer [55]. Parallel methods of classification based on multilocus sequences from selected species [56] are also problematic. The 1988 report from the Ad Hoc Committee on Reconciliation of Approaches to Bacterial Systemics urged caution about inferring phylogeny tree based on any one class of conserved molecules [57] and the 2002 Ad Hoc Committee for the Re-evaluation of the Species Definition in Bacteriology [58] recognized the importance of whole-genome in classification. Whole-genome approaches, based on large data base comparisons [59] and shared orthologous gene/biomarkers profiles often require subjective selection of phenotypic and molecular biomarkers [60, 61]. The selections of biomarkers are sometimes controversial [61, 62]. The rule(s) for picking a core set of genes, or defining a type species remained problematic [63]. More importantly, most of these methods utilized similar sequence alignment tools, such as BLAST, for grouping. Algorithms used to align and delineate DNA sequences could be bias [59, 64]. Ideally, a bacterium should be represented by all the genes in its genome. The TAA, TAG, and TGA trimers are universally found in protein-coding genes. The novel method describes herein represents a robust, whole-genome, and theory-based solution for bacterial classification.
Conclusion
The translation stop signals on the three reading-frames of the genes on a bacterial genome are interrelated, possibly due to frequent off-frame recombination facilitated by translational-associated recombination (TSR) coupled with the manner of bacterial DNA replication. We propose that the Genomic- TSSR can be used as a subjective biomarker to represent the phyletic status of a bacterium.
Method
Verification of phylogenic relation
Inference of bacterial phylogeny is based on the 16SrRNA alignment tree of 19 well-studied bacteria belonging to the subphyla of the-, β-, andγ-Proteobacteria. The ClustalW program in the DNA Star software (Lasergene, WI) was used to create a reference phylogenetic tree (Figure 2). Sixty-one genomes of well-characterized species belonging to the above subphyla were selected for testing.
Data sources
Nineteen ‘good quality’, ‘type strain’ 16SrRNA sequences were downloaded from the Ribosomal Database Project server (http://rdp.cme.msu.edu) (Table 1). The FASTA nucleic acid files of 61 bacterial chromosomal genes were downloaded from the Comprehensive Microbial Research website (http://cmr.tigr.org). Except that of the Wolbachia, well-characterized and monophyletic bacterial groups were selected for this study to insure accuracy. Bacterial species and their Taxon ID are listed in Table 2. This table is also posted on our website (http://umdrive.memphis.edu/tywong/public/Table_1jb) in Excel format.
Table 1 List of reference type species
Table 2 Organisms used in this study and their corresponding genomic Translation stop signal ratios (Genomic-TSSR)
Classification of translation stop signals on a gene
A script written in C (downloadable at our website (https://umdrive.memphis.edu/tywong/public/codon_062107.zip) was used to count the frequencies of occurrences of TAA, TAG, and TGA on the 1st, 2nd, and 3rd reading-frames on each and all genes in a genome. For example, consider the following hypothetical gene composed of 15 codons:
ATG, GTA, AGG, GTG, AGT, ATA, ATG, GTA, GCC, GGT, GGT, TAA
The script converted the above hypothetical gene into a 9-scalar TSS series separated into 9 columns:
1, 0, 0, 2, 1, 1,
where the first 3 scalars represent the number of TAA (=1), TAG (=0) and TGA (=0) TSS on the first reading-frame of this gene. The second three scalars are the number of TAA (=2), TAG (=1) and TGA (=1) TSS (single-underline) on the second reading-frame of this gene. The third three scalars are the number of TAA (=1), TAG (=1), and TGA (=1) TSS (double-underline) on the third reading-frame of this gene.
The First reading-frame TSS ratio (TSSR-1) is referred as the ratio of TSS (TAA: TAG: TGA) on the first reading-frame (columns 1–3) of a gene. For the above hypothetical gene, the Genic-TSSR-1 value is 1, 0, 0. The Genomic-TSSR-1 is the average value of all Genic-TSSR-1 of a genome. The Second reading-frame TSS ratio (TSSR-2) is defined as the ratio of TSS on the second reading-frames (columns 4–6). For the above hypothetical gene, the Genic-TSSR-2 value is 0.5, 025, 0.25. The Genomic-TSSR-2 is the average value of all Genic-TSSR-2 of a genome. The Third reading-frame TSS ratio (TSSR-3) is defined as the ratio of TSS on the third reading-frame (columns 7–9) of a gene. For the above hypothetical gene, the Genic-TSSR-3 value is 0.33, 0.33, 0.33. The Genomic-TSSR-3 is the average value of all Genic-TSSR-3 of a genome. A Genic- TSS ratio (Genic-TSSR) is defined as the ratio of all nine scalars (columns 1–9) of a gene. For example, the Genic-TSSR value of the hypothetical gene is equal to 0.125, 0.00, 0.00, 0.25, 0.125, 0.125, 0.125, 0.125, 0.125. Genomic- TSS ratio (Genomic-TSSR) is defined as the average of Genic-TSSR of all genes in a genome. For example, the genome of Escherichia coli K12 consist of 4289 genes, The TAA, TAG, and TGA counts on the 1st, 2nd, and 3rd reading-frames of all the genes (TSS) in this bacterium equal to 2707, 326,1256, 13755, 9780, 42155, 31463, 6048, and 44610, respectively. The sum of all TSS equals to 152100. The Genomic-TSSR for this bacterium is calculated by dividing each of the 9 scalars by the sum of all TSS, generating a TSSR series of 0.02, 0.00, 0.01, 0.09, 0.06, 0.28, 0.21, 0.04, 0.29 to represent E. coli K12 (See Table 2). In calculating the Genomic-TSSR, genes that have multiple reading-frames (such as those annotated as “authentic frameshift” genes) were deleted from the dataset.
Hierarchical correlation analysis
The hierarchical clustering algorithm in Cluster 3.0was downloaded from Michael Eisen’s website (http://rana.lbl.gov/EisenSoftware.htm). The TSSR dendrogram was constructed using the Java TreeView software available from the Java TreeView website (http://jtreeview.sourceforge.net/). The scale of the tree was from zero to one, with zero meaning no correlation and 1 meaning 100% similar.
Correspondence analysis (CA) of individual genes from four different species
We selected four bacteria, two of which are phylogenetically related (Escherichia coli CFT073 and Salmonella typhi TY2), and two of which are phylogenetically unrelated (Rickettsia typhi Wilmington and Neisseria meningitidis MC58) to show the correlation between individual genes among these organisms. Five hundred genes were randomly selected from each bacterium. The 2000 genes were pooled and each of their Genic-TSSR value calculated. We treated each of the nine scalars on the Genic-TSSR as nine independent columns and each gene as an independent row for CA analysis. The R “ade4” package for CA analysis was downloaded from the R-project website (http://www.r-project.org). CA mapped the selected genes into a 9-dimensional space according to the nine scalars of the Genic-TSSRs. Then it plotted the major TSS as those axes through the multidimensional hyperspace that accounted for the largest fraction of the variation among genes. A list of the genes, together with their corresponding Genic-TSSR values is posted on our website (https://umdrive.memphis.edu/tywong/public/genic_TSSR).
TSSR bias of individual genes within a chromosome
The genome of Escherichia coli K12 strain was used to test whether TSSR bias exist in a genome. One hundred genes from each of the left and right sides at the coordinate 3923499 were selected to represent the genes near the Ori region. Similarly, 100 genes from each of the left and right sides of the coordinate 1588799 were selected to represent the genes near the Ter region. The selected 400 genes were also grouped based on the orientation or based on their location on the left or right replichores. The gene names and their Genic-TSSR are listed on our website (https://umdrive.memphis.edu/tywong/public/OrivsTer).
Kolmogorov-Smirnov test for discrete distributions of genic-TSSRs on a chromosome
The Kolmogorov-Smirnov test (KS-test) is a robust test that cares only about the relative distribution of the data (i.e. it is a non-parametric and distribution free method). The hypothesis regarding the distributional form is rejected if the test statistic, D (the observation values of KS-test) is greater than the critical value. The two-sided KS-test uses the maximum vertical deviation between the two curves (control vs. treatment) as the statistic D and provides a graphical presentation, which enables the user to detect normal distributions of the data. We sorted the 400 genes by three different categories. The first category was to assign the selected genes based on their location on the left or right replichore (Left vs. Right). The second category was to assign the genes based on their orientation on the leading or lagging strands of DNA (Forward vs. Reverse). The third category was to assign genes based on their proximity to the replication origin or terminus regions (Ori vs. Ter). We than calculated the average percentage of counts of the pair in each category by the two-sided KS-test. To insure data were not skewed by a few dominating genes, we perform 1000 random samplings (M = 1000). In each sampling, 200 genes were randomly selected twice. One set of data was assigned as control group and the other set of data was assigned as treatment group. The KS-test was performed and the D statistic obtained from sampling was used to compare with the D statistic generated from the gene assignment among each pair. The p-value was calculated as: p = m = 1 M I D m D M , where I (.) is the indicator function. If the condition in parentheses is true, it equals to 1, else 0.
References
1. Nevo E: Evolution of genome-phenome diversity under environmental stress. Proc Natl Acad Sci U S A. 2001, 98: 6233-6240. 10.1073/pnas.101109298.
Article PubMed Central CAS PubMed Google Scholar
2. Hershberg R, Petrov DA: Selection on codon bias. Annu Rev Genet. 2008, 42: 287-299. 10.1146/annurev.genet.42.110807.091442.
Article CAS PubMed Google Scholar
3. Nielsen R: Molecular signatures of natural selection. Annu Rev Genet. 2005, 39: 197-218. 10.1146/annurev.genet.39.073003.112420.
Article CAS PubMed Google Scholar
4. Gupta RS: The branching order and phylogenetic placement of species from completed bacterial genomes, based on conserved indels found in various proteins. Int Microbiol. 2001, 4: 187-202. 10.1007/s10123-001-0037-9.
Article CAS PubMed Google Scholar
5. Ermolaeva MD: Synonymous codon usage in bacteria. Curr Issues Mol Biol. 2001, 3: 91-97.
CAS PubMed Google Scholar
6. Tats A, Tenson T, Remm M: Preferred and avoided codon pairs in three domains of life. BMC Genomics. 2008, 9: 463-10.1186/1471-2164-9-463.
Article PubMed Central PubMed Google Scholar
7. Campion SR, Ameen AS, Lai L, King JM, Munzenmaier TN: Dipeptide frequency/bias analysis identifies conserved sites of nonrandomness shared by cysteine-rich motifs. Proteins. 2001, 44: 321-328. 10.1002/prot.1097.
Article CAS PubMed Google Scholar
8. Plotkin JB, Kudla G: Synonymous but not the same: the causes and consequences of codon bias. Nat Rev Genet. 2011, 12: 32-42. 10.1038/nrg2899.
Article PubMed Central CAS PubMed Google Scholar
9. Roth JR: UGA nonsense mutations in Salmonella typhimurium. J Bacteriol. 1970, 102: 467-475.
PubMed Central CAS PubMed Google Scholar
10. Ryden SM, Isaksson LA: A temperature-sensitive mutant of Escherichia coli that shows enhanced misreading of UAG/A and increased efficiency for some tRNA nonsense suppressors. Mol Gen Genet. 1984, 193: 38-45. 10.1007/BF00327411.
Article CAS PubMed Google Scholar
11. McInerney P, Mizutani T, Shiba T: Inorganic polyphosphate interacts with ribosomes and promotes translation fidelity in vitro and in vivo. Mol Microbiol. 2006, 60: 438-447. 10.1111/j.1365-2958.2006.05103.x.
Article CAS PubMed Google Scholar
12. Rospert S, Rakwalska M, Dubaquie Y: Polypeptide chain termination and stop codon readthrough on eukaryotic ribosomes. Rev Physiol Biochem Pharmacol. 2005, 155: 1-30. 10.1007/3-540-28217-3_1.
Article CAS PubMed Google Scholar
13. Clarke CH, Miller PG: Consequences of frameshift mutations in the trp A, trp B and lac I genes of Escherichia coli and in Salmonella typhimurium. J Theor Biol. 1982, 96: 367-379. 10.1016/0022-5193(82)90116-3.
Article CAS PubMed Google Scholar
14. Seligmann H, Pollock DD: The Ambush Hypothesis: Hidden Stop Codons Prevent Off-Frame Gene Reading. DNA Cell Biol. 2004, 23: 701-705. 10.1089/dna.2004.23.701.
Article CAS PubMed Google Scholar
15. Singh TR, Pardasani KR: Ambush hypothesis revisited: Evidences for phylogenetic trends. Comput Biol Chem. 2009, 33: 239-244. 10.1016/j.compbiolchem.2009.04.002.
Article CAS PubMed Google Scholar
16. Cai HJ, Tsoi H-W, Lam E, Yuen K-Y: Natural selection retains overrepresented out-of-frame stop codons against frameshift peptides in prokaryotes. BMC Genomics. 2010, 11: 491-10.1186/1471-2164-11-491.
Article PubMed Central PubMed Google Scholar
17. Wong TY, Fernandes S, Sankhon N, Leong PP, Kuo J, Liu JK: Role of premature stop codons in bacterial evolution. J Bacteriol. 2008, 190: 6718-6725. 10.1128/JB.00682-08.
Article PubMed Central CAS PubMed Google Scholar
18. Eisen MB, Spellman PT, Brown PO, Botstein D: Cluster analysis and display of genome-wide expression patterns. Proc Natl Acad Sci U S A. 1998, 95: 14863-14868. 10.1073/pnas.95.25.14863.
Article PubMed Central CAS PubMed Google Scholar
19. Fournier P-E, Raoult D: Bacteriology, Taxonomy, and Phylogeny of Rickettsia. Rickettsial Diseases. Edited by: Raoult D, Parola P. 2007, Informa Healthcare USA. Inc 2007, New York, 1-15.
Chapter Google Scholar
20. Johnston KL, Taylor MJ: Wolbachia and Filarial Nematode Diseases in Humans. Rickettsial Diseases. Edited by: Raoult D, Parola P. 2007, Informa Healthcare, New York, 302-313.
Google Scholar
21. Pfarr K, Foster J, Slatko B, Hoerauf A, Eisen JA: On the taxonomic status of the intracellular bacterium Wolbachia pipientis: should this species name include the intracellular bacteria of filarial nematodes?. Int J Syst Evol Microbiol. 2007, 57: 1677-1678. 10.1099/ijs.0.65248-0.
Article PubMed Central PubMed Google Scholar
22. Lo N, Paraskevopoulos C, Bourtzis K, O'Neill SL, Werren JH, Bordenstein SR, Bandi C: Taxonomic status of the intracellular bacterium Wolbachia pipientis. Int J Syst Evol Microbiol. 2007, 57: 654-657. 10.1099/ijs.0.64515-0.
Article CAS PubMed Google Scholar
23. Hedlund BP, Staley JT: Phylogeny of the genus Simonsiella and other members of the Neisseriaceae. Int J Syst Evol Microbiol. 2002, 52: 1377-1382. 10.1099/ijs.0.01952-0.
CAS PubMed Google Scholar
24. Jyssum K: Origin and sequence of chromosome replication in Neisseria meningitidis: influence of a genetic factor determining competence. J Bacteriol. 1969, 99: 757-763.
PubMed Central CAS PubMed Google Scholar
25. Tonjum T: Family I. Neisseriaceae. Bergey’s Manual of Systematic Bacteriology. Volume 2. Edited by: Brenner D, Krieg N, Staley J. 2005, Springer, N.Y, 798:774–798
Google Scholar
26. Pupo GM, Lan R, Reeves PR: Multiple independent origins of Shigella clones of Escherichia coli and convergent evolution of many of their characteristics. Proc Natl Acad Sci U S A. 2000, 97: 10567-10572. 10.1073/pnas.180094797.
Article PubMed Central CAS PubMed Google Scholar
27. Ochman H, Elwyn S, Moran NA: Calibrating bacterial evolution. Proc Natl Acad Sci U S A. 1999, 96: 12638-12643. 10.1073/pnas.96.22.12638.
Article PubMed Central CAS PubMed Google Scholar
28. Ibrahim A, Goebel BM, Liesack W, Griffiths M, Stackebrandt E: The phylogeny of the genus Yersinia based on 16 S rDNA sequences. FEMS Microbiol Lett. 1993, 114: 173-177. 10.1111/j.1574-6968.1993.tb06569.x.
Article CAS PubMed Google Scholar
29. Achtman M, Zurth K, Morelli G, Torrea G, Guiyoule A, Carniel E: Yersinia pestis, the cause of plague, is a recently emerged clone of Yersinia pseudotuberculosis. Proc Natl Acad Sci U S A. 1999, 96: 14043-14048. 10.1073/pnas.96.24.14043.
Article PubMed Central CAS PubMed Google Scholar
30. El Karoui M, Biaudet V, Schbath S, Gruss A: Characteristics of Chi distribution on different bacterial genomes. Res Microbiol. 1999, 150: 579-587. 10.1016/S0923-2508(99)00132-1.
Article CAS PubMed Google Scholar
31. Lobry JR: Asymmetric substitution patterns in the two DNA strands of bacteria. Mol Biol Evol. 1996, 13: 660-665. 10.1093/oxfordjournals.molbev.a025626.
Article CAS PubMed Google Scholar
32. Rocha EP, Danchin A: Gene essentiality determines chromosome organisation in bacteria. Nucleic Acids Res. 2003, 31: 6570-6577. 10.1093/nar/gkg859.
Article PubMed Central CAS PubMed Google Scholar
33. Niki H, Yamaichi Y, Hiraga S: Dynamic organization of chromosomal DNA in Escherichia coli. Genes Dev. 2000, 14: 212-223.
PubMed Central CAS PubMed Google Scholar
34. Fox GE, Wisotzkey JD, Jurtshuk P: How close is close: 16 S rRNA sequence identity may not be sufficient to guarantee species identity. Int J Syst Bacteriol. 1992, 42: 166-170. 10.1099/00207713-42-1-166.
Article CAS PubMed Google Scholar
35. Gillis M, Vabdanne P, DeVos P, Swings J, Kersters K: Polyphasic Taxonomy. Bergey’s Manual of Systematic Bacteriology. Volume 1. Edited by: Boone D-R, Castenholz R-W. Springer 2001, Springer 2001, New York, 43-48.
Chapter Google Scholar
36. Snel B, Bork P, Huynen MA: Genome phylogeny based on gene content. Nat Genet. 1999, 21: 108-110. 10.1038/5052.
Article CAS PubMed Google Scholar
37. Cridge AG, Major LL, Mahagaonkar AA, Poole ES, Isaksson LA, Tate WP: Comparison of characteristics and function of translation termination signals between and within prokaryotic and eukaryotic organisms. Nucleic Acids Res. 2006, 34: 1959-1973. 10.1093/nar/gkl074.
Article PubMed Central CAS PubMed Google Scholar
38. Sun J, Chen M, Xu J, Luo J: Relationships among stop codon usage bias, its context, isochores, and gene expression level in various eukaryotes. J Mol Evol. 2005, 61: 437-444. 10.1007/s00239-004-0277-3.
Article CAS PubMed Google Scholar
39. Seligmann H: The ambush hypothesis at the whole-organism level: Off frame, ‘hidden’ stops in vertebrate mitochondrial genes increase developmental stability. Comput Biol Chem. 2010, 34: 80-85. 10.1016/j.compbiolchem.2010.03.001.
Article CAS PubMed Google Scholar
40. Chothia C, Gough J, Vogel C, Teichmann SA: Evolution of the protein repertoire. Science. 2003, 300: 1701-1703. 10.1126/science.1085371.
Article CAS PubMed Google Scholar
41. Aguilera A: The connection between transcription and genomic instability. EMBO J. 2002, 21: 195-201.
Article PubMed Central CAS PubMed Google Scholar
42. Gottipati P, Helleday T: Transcription-associated recombination in eukaryotes: link between transcription, replication and recombination. Mutagenesis. 2009, 24: 203-210. 10.1093/mutage/gen072.
Article CAS PubMed Google Scholar
43. Prado F, Aguilera A: Impairment of replication fork progression mediates RNA polII transcription-associated recombination. EMBO J. 2005, 24: 1267-1276. 10.1038/sj.emboj.7600602.
Article PubMed Central CAS PubMed Google Scholar
44. Song J, Ware A, Liu SL: Wavelet to predict bacterial ori and ter: a tendency towards a physical balance. BMC Genomics. 2003, 4: 17-10.1186/1471-2164-4-17.
Article PubMed Central PubMed Google Scholar
45. Higgins NP: The bacterial chromosome. 2005, ASM Press, Washington, D.C.
Book Google Scholar
46. Skarstad K, Boye E, Steen HB: Timing of initiation of chromosome replication in individual Escherichia coli cells. EMBO J. 1986, 5: 1711-1717.
PubMed Central CAS PubMed Google Scholar
47. Bipatnath M, Dennis PP, Bremer H: Initiation and velocity of chromosome replication in Escherichia coli B/r and K-12. J Bacteriol. 1998, 180: 265-273.
PubMed Central CAS PubMed Google Scholar
48. Rocha EP, Fralick J, Vediyappan G, Danchin A, Norris V: A strand-specific model for chromosome segregation in bacteria. Mol Microbiol. 2003, 49: 895-903. 10.1046/j.1365-2958.2003.03606.x.
Article CAS PubMed Google Scholar
49. Zechiedrich EL, Cozzarelli NR: Roles of topoisomerase IV and DNA gyrase in DNA unlinking during replication in Escherichia coli. Genes Dev. 1995, 9: 2859-2869. 10.1101/gad.9.22.2859.
Article CAS PubMed Google Scholar
50. Rothstein R, Michel B, Gangloff S: Replication fork pausing and recombination or “gimme a break”. Genes Dev. 2000, 14: 1-10.
CAS PubMed Google Scholar
51. Eremeeva ME, Madan A, Shaw CD, Tang K, Dasch GA: New perspectives on rickettsial evolution from new genome sequences of rickettsia, particularly R. canadensis, and Orientia tsutsugamushi. Ann N Y Acad Sci. 2005, 1063: 47-63. 10.1196/annals.1355.006.
Article CAS PubMed Google Scholar
52. Chain PSG, Carniel E, Larimer FW, Lamerdin J, Stoutland PO, Regala WM, Georgescu AM, Vergez LM, Land ML, Motin VL, et al: Insights into the evolution of Yersinia pestis through whole-genome comparison with Yersinia pseudotuberculosis. Proc Natl Acad Sci U S A. 2004, 101: 13826-13831. 10.1073/pnas.0404012101.
Article PubMed Central CAS PubMed Google Scholar
53. Friedrich A, Prust C, Hartsch T, Henne A, Averhoff B: Molecular analyses of the natural transformation machinery and identification of pilus structures in the extremely thermophilic bacterium Thermus thermophilus strain HB27. Appl Environ Microbiol. 2002, 68: 745-755. 10.1128/AEM.68.2.745-755.2002.
Article PubMed Central CAS PubMed Google Scholar
54. Woese CR, Fox GE: Phylogenetic structure of the prokaryotic domain: the primary kingdoms. Proc Natl Acad Sci U S A. 1977, 74: 5088-5090. 10.1073/pnas.74.11.5088.
Article PubMed Central CAS PubMed Google Scholar
55. Bapteste E, Boucher Y, Leigh J, Doolittle WF: Phylogenetic reconstruction and lateral gene transfer. Trends Microbiol. 2004, 12: 406-411. 10.1016/j.tim.2004.07.002.
Article CAS PubMed Google Scholar
56. Harrison CJ, Langdale JA: A step by step guide to phylogeny reconstruction. Plant J. 2006, 45: 561-572. 10.1111/j.1365-313X.2005.02611.x.
Article CAS PubMed Google Scholar
57. Wayne LG: International Committee on Systematic Bacteriology: announcement of the report of the ad hoc Committee on Reconciliation of Approaches to Bacterial Systematics. Zentralbl Bakteriol Mikrobiol Hyg A. 1988, 268: 433-434.
CAS PubMed Google Scholar
58. Stackebrandt E, Frederiksen W, Garrity GM, Grimont PA, Kampfer P, Maiden MC, Nesme X, Rossello-Mora R, Swings J, Truper HG, et al: Report of the ad hoc committee for the re-evaluation of the species definition in bacteriology. Int J Syst Evol Microbiol. 2002, 52: 1043-1047. 10.1099/ijs.0.02360-0.
CAS PubMed Google Scholar
59. Charlebois RL, Doolittle WF: Computing prokaryotic gene ubiquity: rescuing the core from extinction. Genome Res. 2004, 14: 2469-2477. 10.1101/gr.3024704.
Article PubMed Central CAS PubMed Google Scholar
60. Vallender EJ, Paschall JE, Malcom CM, Lahn BT, Wyckoff GJ: SPEED: a molecular-evolution-based database of mammalian orthologous groups. Bioinformatics. 2006, 22: 2835-2837. 10.1093/bioinformatics/btl471.
Article CAS PubMed Google Scholar
61. Gevers D, Cohan FM, Lawrence JG, Spratt BG, Coenye T, Feil EJ, Stackebrandt E, de Peer YV, Vandamme P, Thompson FL, Swings J: Re-evaluating prokaryotic species. Nat Rev Micro. 2005, 3: 733-739. 10.1038/nrmicro1236.
Article CAS Google Scholar
62. Dewhirst FE, Shen Z, Scimeca MS, Stokes LN, Boumenna T, Chen T, Paster BJ, Fox JG: Discordant 16 S and 23 S rRNA Gene Phylogenies for the Genus Helicobacter: Implications for Phylogenetic Inference and Systematics. J Bacteriol. 2005, 187: 6106-6118. 10.1128/JB.187.17.6106-6118.2005.
Article PubMed Central CAS PubMed Google Scholar
63. Susko E, Leigh J, Doolittle WF, Bapteste E: Visualizing and assessing phylogenetic congruence of core gene sets: a case study of the gamma-proteobacteria. Mol Biol Evol. 2006, 23: 1019-1030. 10.1093/molbev/msj113.
Article CAS PubMed Google Scholar
64. Kurland CG, Canback B, Berg OG: Horizontal gene transfer: A critical view. Proc Natl Acad Sci U S A. 2003, 100: 9658-9662. 10.1073/pnas.1632870100.
Article PubMed Central CAS PubMed Google Scholar
Download references
Acknowledgment
We thank Patrick P. Leong for providing the stop signal counting script and Profs Steven D. Schwartzbach and Melvin L. Beck at the University of Memphis for their critical reviews on this manuscript.
Author information
Authors and Affiliations
Authors
Corresponding author
Correspondence to Tit-Yee Wong.
Additional information
Competing interest
The authors declare that they have no competing interests.
Authors’ contributions
LIX performed the two-sided KS-test analysis and discussion, JK contributed the CA result and discussion, JKL participated in bacterial systematic and discussion, and TYW conceived and designed the experiment, carried out experiments and drafted the manuscript. All authors read and approved the final manuscript.
Lijing Xu, Jimmy Kuo contributed equally to this work.
Authors’ original submitted files for images
Rights and permissions
Open Access This article is published under license to BioMed Central Ltd. This is an Open Access article is distributed under the terms of the Creative Commons Attribution License ( https://creativecommons.org/licenses/by/2.0 ), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Reprints and permissions
About this article
Cite this article
Xu, L., Kuo, J., Liu, JK. et al. Bacterial phylogenetic tree construction based on genomic translation stop signals. Microb Informatics Exp 2, 6 (2012). https://doi.org/10.1186/2042-5783-2-6
Download citation
• Received:
• Accepted:
• Published:
• DOI: https://doi.org/10.1186/2042-5783-2-6
Keywords
|
__label__pos
| 0.553319 |
Numerical verification of a dual system's seismic response
Marios C. Phocas, Tonia Sophocleous
Research output: Contribution to journalArticlepeer-review
2 Citations (Scopus)
Abstract
Structural control through integration of passive damping devices within the building structure has been increasingly implemented internationally in the last years and has proven to be a most promising strategy for earthquake safety. In the present paper an alternative configuration of an innovative energy dissipation mechanism that consists of slender tension only bracing members with closed loop and a hysteretic damper is investigated in its dynamic behavior. The implementation of the adaptable dual control system, ADCS, in frame structures enables a dual function of the component members, leading to two practically uncoupled systems, i.e., the primary frame, responsible for the normal vertical and horizontal forces and the closed bracing-damper mechanism, for the earthquake forces and the necessary energy dissipation. Three representative international earthquake motions of differing frequency contents, duration and peak ground acceleration have been considered for the numerical verification of the effectiveness and properties of the SDOF systems with the proposed ADCS-configuration. The control mechanism may result in significant energy dissipation, when the geometrical and mechanical properties, i.e., stiffness and yield force of the integrated damper, are predefined. An optimum damper ratio, DR, defined as the ratio of the stiffness to the yield force of the hysteretic damper, is proposed to be used along with the stiffness factor of the damper's- to the primary frame's stiffness, in order for the control mechanism to achieve high energy dissipation and at the same time to prevent any increase of the system's maximum base shear and relative displacements. The results are summarized in a preliminary design methodology for ADCS.
Original languageEnglish
Pages (from-to)749-766
Number of pages18
JournalEarthquake and Structures
Volume3
Issue number5
Publication statusPublished - Oct 2012
Keywords
• Dual system
• Energy dissipation
• Structural control
Fingerprint
Dive into the research topics of 'Numerical verification of a dual system's seismic response'. Together they form a unique fingerprint.
Cite this
|
__label__pos
| 0.820798 |
Bug when rerouting String#gsub with a block using $1?
Discussion in 'Ruby' started by Florian Gross, Aug 17, 2003.
1. Moin!
This code:
class String
alias :eek:ld_gsub :gsub
def gsub(*args, &block)
old_gsub(*args, &block)
end
end
"hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
produces this output for me:
nilnil
(I'm using ruby 1.8.0 (2003-08-04) [i386-mswin32] and I'm told that it
does the same in the 1.8.0 final, 1.7.3 and 1.6.8 on Linux.)
Is this behaviour by design or is this a bug? If it's not a bug: Why
is $1 changed to nil in this case?
(This behaviour is causing an annoying bug in my new Ruby
implementation of Perl 6's Junctions and thus effectively replacing
irb's prompt with "()::>")
Thanks for any answers and effort to clarify this issue!
Regards,
Florian Gross
Florian Gross, Aug 17, 2003
#1
1. Advertising
2. On Mon, Aug 18, 2003 at 07:38:52AM +0900, Florian Gross wrote:
> Moin!
>
> This code:
>
> class String
> alias :eek:ld_gsub :gsub
> def gsub(*args, &block)
> old_gsub(*args, &block)
> end
> end
>
> "hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
>
> produces this output for me:
>
> nilnil
>
> (I'm using ruby 1.8.0 (2003-08-04) [i386-mswin32] and I'm told that it
> does the same in the 1.8.0 final, 1.7.3 and 1.6.8 on Linux.)
>
> Is this behaviour by design or is this a bug? If it's not a bug: Why
> is $1 changed to nil in this case?
It seems it is by design:
batsman@tux-chan:/tmp$ expand -t2 a.rb
def foo
puts "Match: #{$1.inspect}"
end
"abcd" =~ /(b)/
foo
puts "Match: #{$1.inspect}"
batsman@tux-chan:/tmp$ ruby a.rb
Match: nil
Match: "b"
So $1 is method-scoped.
Now, is there any way to propagate $1??
We need it if gsub and friends are to be wrapped transparently.
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
One tree to rule them all,
One tree to find them,
One tree to bring them all,
and to itself bind them.
-- Gavin Koch <>
Mauricio Fernández, Aug 17, 2003
#2
1. Advertising
3. On Mon, Aug 18, 2003 at 02:43:00PM +0900, Yukihiro Matsumoto wrote:
> |Now, is there any way to propagate $1??
> |We need it if gsub and friends are to be wrapped transparently.
>
> Explicitly? You can pass the match data and assign it to $~.
But this doesn't solve the problem, does it?
I don't see how $~ would help in
class String
alias :eek:ld_gsub :gsub
def gsub(*args, &block)
old_gsub(*args, &block)
end
end
"hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
Is this just impossible to do in Ruby?
At any rate the behavior of the block is quite strange w.r.t. the binding
of $1. It is very different from that of other variables/globals in the
closure: $1 references the $1 in gsub, instead of the one in old_gsub
or the outer one.
However
batsman@tux-chan:/tmp$ expand -t2 b.rb
def foo
"foo" =~ /(foo)/
yield
end
def bar
"bar" =~ /(bar)/
foo { puts "foo: " + $1.inspect }
yield
end
bar {puts "bar: " + $1.inspect}
puts "1 world".gsub(/(1)/) { $1 + " is one" }
batsman@tux-chan:/tmp$ ruby b.rb
foo: "bar"
bar: nil
1 is one world
So gsub is indeed one special case in that $1 is bound to the "inner $1"
instead of the outer. And there's AFAIK no way to wrap gsub without
breaking it because of that.
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
Turn right here. No! NO! The OTHER right!
Mauricio Fernández, Aug 18, 2003
#3
4. Hi,
In message "Re: Bug when rerouting String#gsub with a block using $1?"
on 03/08/18, Mauricio Fernández <> writes:
| "hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
|
|Is this just impossible to do in Ruby?
In pure Ruby, yes.
Ah, wait. If you don't need thread safety, you can do it as:
"hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
class String
alias :eek:ld_gsub :gsub
def gsub(*args, &block)
if block
old_gsub(*args) {
$match = $~
eval("$~ = $match", block) # the trick here.
yield $&
}
else
old_gsub(*args, &block)
end
end
end
"hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
matz.
Yukihiro Matsumoto, Aug 18, 2003
#4
5. On Mon, Aug 18, 2003 at 04:47:47PM +0900, Yukihiro Matsumoto wrote:
> Hi,
>
> In message "Re: Bug when rerouting String#gsub with a block using $1?"
> on 03/08/18, Mauricio Fernández <> writes:
>
> | "hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
> |
> |Is this just impossible to do in Ruby?
>
> In pure Ruby, yes.
ouch. We'll then need C to make real Junctions then (not so bad since
we'd do it anyway for speed).
> Ah, wait. If you don't need thread safety, you can do it as:
Thank you for your quick responses.
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
Steal my cash, car and TV - but leave the computer!
-- Soenke Lange <>
Mauricio Fernández, Aug 18, 2003
#5
6. Florian Gross
Dan Doel Guest
What about:
p "hello world".gsub(/(\w+)/) { puts $1; $1 }
puts
class String
alias :eek:ld_gsub :gsub
def gsub(*args, &block)
if block
pattern = args[0]
old_gsub(pattern) { |match|
eval "#{pattern.inspect} =~ \"#{match}\"", block
yield match
}
else
old_gsub(*args, &block)
end
end
end
p "hello world".gsub(/(\w+)/) { puts $1; $1 }
Or does this miss something that gsub does?
- Dan
Dan Doel, Aug 18, 2003
#6
7. Florian Gross
Guest
Hi,
At Mon, 18 Aug 2003 16:47:47 +0900,
Yukihiro Matsumoto wrote:
> Ah, wait. If you don't need thread safety, you can do it as:
You forget the trick that you'd written ago.
> "hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
> class String
> alias :eek:ld_gsub :gsub
> def gsub(*args, &block)
> if block
> old_gsub(*args) {
eval("proc{|m|$~ = m}", block).call($~)
> yield $&
> }
> else
> old_gsub(*args, &block)
> end
> end
> end
> "hello world".gsub(/(\w+)/) { print $1; $1 }; print "\n"
--
Nobu Nakada
, Aug 18, 2003
#7
8. Yukihiro Matsumoto wrote:
> Hi,
Moin!
> In message "Re: Bug when rerouting String#gsub with a block using $1?"
> on 03/08/18, Mauricio Fernández <> writes:
>
> |Is this just impossible to do in Ruby?
>
> In pure Ruby, yes.
>
> Ah, wait. If you don't need thread safety, you can do it as:
>
> [code snippet snipped]
That's a nice hack, thank you! And I think Nobu Nakada's change even
makes it thread-safe, but are you sure that the incosistent behavior
of $1 in blocks passed to gsub is needed? IMHO this is a confusing
trap and thus a source of unnecessary debugging sessions for users.
That aside: Are there other methods like sub, sub!, gsub and gsub!
which have this special behavior?
> matz.
Regards and thank you for designing a wonderful language,
Florian Gross
Florian Gross, Aug 18, 2003
#8
9. Hi,
In message "Re: Bug when rerouting String#gsub with a block using $1?"
on 03/08/18, Florian Gross <> writes:
|That's a nice hack, thank you! And I think Nobu Nakada's change even
|makes it thread-safe, but are you sure that the incosistent behavior
|of $1 in blocks passed to gsub is needed? IMHO this is a confusing
|trap and thus a source of unnecessary debugging sessions for users.
Then don't use ugly dollar variables. But perhaps gsub should have
passed the match data to the block for convenience.
|That aside: Are there other methods like sub, sub!, gsub and gsub!
|which have this special behavior?
"gets" modifies $_ in local scope. $_ and $~ (and $1 etc) are treated
specially.
matz.
Yukihiro Matsumoto, Aug 18, 2003
#9
1. Advertising
Want to reply to this thread or ask your own question?
It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
1. Andrew Connell
Replies:
1
Views:
566
Natty Gur
Oct 21, 2003
2. Codex Twin
Replies:
8
Views:
502
Codex Twin
Dec 3, 2004
3. morrell
Replies:
1
Views:
999
roy axenov
Oct 10, 2006
4. Drifter
Need Some rerouting code... puhleasse
Drifter, Nov 19, 2003, in forum: ASP General
Replies:
6
Views:
148
Guest
Nov 19, 2003
5. aurelianito
gsub and gsub! are inconsistent
aurelianito, Nov 8, 2005, in forum: Ruby
Replies:
9
Views:
182
Robert Klemme
Nov 9, 2005
Loading...
Share This Page
|
__label__pos
| 0.96206 |
vlc.h 6.72 KB
Newer Older
1
/*****************************************************************************
2
* vlc.h: VLC specific lua library functions.
3
*****************************************************************************
4
* Copyright (C) 2007-2008 the VideoLAN team
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
* $Id$
*
* Authors: Antoine Cellerier <dionoea at videolan tod org>
* Pierre d'Herbemont <pdherbemont # videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
25
#ifndef VLC_LUA_H
26 27 28 29 30
#define VLC_LUA_H
/*****************************************************************************
* Preamble
*****************************************************************************/
31
#include <vlc_common.h>
32 33 34 35 36 37 38
#include <vlc_input.h>
#include <vlc_playlist.h>
#include <vlc_meta.h>
#include <vlc_url.h>
#include <vlc_strings.h>
#include <vlc_stream.h>
39
#define LUA_COMPAT_MODULE
40 41 42
#include <lua.h> /* Low level lua C API */
#include <lauxlib.h> /* Higher level C API */
#include <lualib.h> /* Lua libs */
43 44 45 46 47
#if LUA_VERSION_NUM >= 502
#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ)
#define lua_objlen(L,idx) lua_rawlen(L,idx)
#define lua_strlen(L,idx) lua_rawlen(L,idx)
#endif
48 49 50 51
/*****************************************************************************
* Module entry points
*****************************************************************************/
52
int ReadMeta( vlc_object_t * );
Pierre's avatar
Pierre committed
53
int FetchMeta( vlc_object_t * );
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
54
int FindArt( vlc_object_t * );
55
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
56 57
int Import_LuaPlaylist( vlc_object_t * );
void Close_LuaPlaylist( vlc_object_t * );
58
59
#define TELNETPORT_DEFAULT 4212
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
60 61
int Open_LuaIntf( vlc_object_t * );
void Close_LuaIntf( vlc_object_t * );
62 63 64 65
int Open_LuaHTTP( vlc_object_t * );
int Open_LuaCLI( vlc_object_t * );
int Open_LuaTelnet( vlc_object_t * );
66
Jean-Philippe André's avatar
Jean-Philippe André committed
67 68 69
int Open_Extension( vlc_object_t * );
void Close_Extension( vlc_object_t * );
70 71
int Open_LuaSD( vlc_object_t * );
void Close_LuaSD( vlc_object_t * );
72 73 74 75 76 77 78 79
/*****************************************************************************
* Lua debug
*****************************************************************************/
static inline void lua_Dbg( vlc_object_t * p_this, const char * ppz_fmt, ... )
{
va_list ap;
va_start( ap, ppz_fmt );
80
msg_GenericVa( p_this, VLC_MSG_DBG, MODULE_STRING, ppz_fmt, ap );
81 82 83 84 85 86
va_end( ap );
}
/*****************************************************************************
* Functions that should be in lua ... but aren't for some obscure reason
*****************************************************************************/
87
static inline bool luaL_checkboolean( lua_State *L, int narg )
88 89 90 91 92
{
luaL_checktype( L, narg, LUA_TBOOLEAN ); /* can raise an error */
return lua_toboolean( L, narg );
}
93 94 95 96 97
static inline int luaL_optboolean( lua_State *L, int narg, int def )
{
return luaL_opt( L, luaL_checkboolean, narg, def );
}
98 99 100 101 102 103 104
static inline const char *luaL_nilorcheckstring( lua_State *L, int narg )
{
if( lua_isnil( L, narg ) )
return NULL;
return luaL_checkstring( L, narg );
}
105 106 107 108 109 110 111
static inline char *luaL_strdupornull( lua_State *L, int narg )
{
if( lua_isstring( L, narg ) )
return strdup( luaL_checkstring( L, narg ) );
return NULL;
}
112 113
void vlclua_set_this( lua_State *, vlc_object_t * );
#define vlclua_set_this(a, b) vlclua_set_this(a, VLC_OBJECT(b))
114
vlc_object_t * vlclua_get_this( lua_State * );
115
116 117 118
struct intf_sys_t;
void vlclua_set_intf( lua_State *, struct intf_sys_t * );
119 120 121 122 123 124 125 126 127 128 129
/*****************************************************************************
* Lua function bridge
*****************************************************************************/
#define vlclua_error( L ) luaL_error( L, "VLC lua error in file %s line %d (function %s)", __FILE__, __LINE__, __func__ )
int vlclua_push_ret( lua_State *, int i_error );
/*****************************************************************************
* Will execute func on all scripts in luadirname, and stop if func returns
* success.
*****************************************************************************/
int vlclua_scripts_batch_execute( vlc_object_t *p_this, const char * luadirname,
130 131
int (*func)(vlc_object_t *, const char *, void *),
void * user_data );
132
int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname, char ***pppsz_dir_list );
133
void vlclua_dir_list_free( char **ppsz_dir_list );
Antoine Cellerier's avatar
Antoine Cellerier committed
134
char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const char *psz_name );
135
136 137 138 139 140
/*****************************************************************************
* Replace Lua file reader by VLC input. Allows loadings scripts in Zip pkg.
*****************************************************************************/
int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *url );
141 142 143
/*****************************************************************************
* Playlist and meta data internal utilities.
*****************************************************************************/
144 145 146 147 148 149 150 151 152 153 154 155 156
void vlclua_read_options( vlc_object_t *, lua_State *, int *, char *** );
#define vlclua_read_options( a, b, c, d ) vlclua_read_options( VLC_OBJECT( a ), b, c, d )
void vlclua_read_meta_data( vlc_object_t *, lua_State *, input_item_t * );
#define vlclua_read_meta_data( a, b, c ) vlclua_read_meta_data( VLC_OBJECT( a ), b, c )
void vlclua_read_custom_meta_data( vlc_object_t *, lua_State *,
input_item_t *);
#define vlclua_read_custom_meta_data( a, b, c ) vlclua_read_custom_meta_data( VLC_OBJECT( a ), b, c )
int vlclua_playlist_add_internal( vlc_object_t *, lua_State *, playlist_t *,
input_item_t *, bool );
#define vlclua_playlist_add_internal( a, b, c, d, e ) vlclua_playlist_add_internal( VLC_OBJECT( a ), b, c, d, e )
int vlclua_add_modules_path( vlc_object_t *, lua_State *, const char *psz_filename );
#define vlclua_add_modules_path( a, b, c ) vlclua_add_modules_path( VLC_OBJECT( a ), b, c )
157
158 159 160 161 162 163 164 165 166 167 168 169 170
/**
* Per-interface private state
*/
struct intf_sys_t
{
char *psz_filename;
lua_State *L;
vlc_thread_t thread;
vlc_mutex_t lock;
vlc_cond_t wait;
bool exiting;
};
171 172 173
#endif /* VLC_LUA_H */
|
__label__pos
| 0.85162 |
Essential Guide
Taking charge of VM allocation, troubleshooting methods
A comprehensive collection of articles, videos and more, hand-picked by our editors
Best practices for effective thin provisioning
Thin provisioning allows storage capacity that has been allocated to various apps or servers, but not actually consumed, to be shared. This allows you to use less disk capacity.
The major airlines are masters of thin provisioning; they just call it overbooking. Using the extensive data they have about every flight and its occupancy, they can pretty accurately predict how many passengers with reservations will be no-shows. So, they overbook. That we don't actually encounter overbooked flights all that often is a testament to how good their data and predictive algorithms are.
Thin provisioning is a form of overbooking. With thin provisioning, you provision a certain amount of storage capacity while actually allocating less disk capacity than you provisioned for. The application thinks it has a certain amount of capacity available to it, when it actually has less.
"Many companies are concerned about thin provisioning because they think it could get them into a difficult predicament," said Mark Teter, chief technology officer at the Denver-based Advanced Systems Group. However, if you know your applications, users, data and usage history, it's unlikely you'll encounter problems from this type of storage overbooking.
Still, if you miscalculate or something unexpected happens, you may find yourself hitting capacity utilization thresholds. If this happens and you're forced to quickly acquire and deploy more disk capacity, it still isn't a fatal problem. The capacity has already been provisioned; usually, you just need to plug in extra disk.
Let's take a look at a few things you can do to ensure thin provisioning goes smoothly:
1. Know your data
"Airlines get away with [overbooking] because they have such a detailed history of passenger behavior. They know what to expect for each flight based on different circumstances. You can do the same with storage," said Greg Schulz, founder and senior analyst at Stillwater, Minn.-based StorageIO Group.
To take advantage of thin provisioning, you have to know your storage usage and trends. "That means knowing if your data is static or changing. You also need to understand the level of I/O activity and I/O patterns," Schulz said.
In effect, "thin provisioning presents an abstracted or virtualized view to servers and applications of how much storage has been allocated," Schulz explained. In this way, thin provisioning allows storage space that has been allocated to various applications or servers but not actually consumed to be shared. Given that so much storage capacity is vastly underutilized anyway, storage administrators who understand the data and usage patterns can feel confident practicing thin provisioning.
2. Focus on file systems first
"You can be selective in where you use thin provisioning. Use it first for file services like CIFS and NFS. File storage usually is over-allocated anyway, making thin provisioning easier and less exacting," Advanced Systems Group's Teter said. With thin provisioning, a company should be able to reduce the actual allocation of disk for file storage by 20%- 30%.
Thin provisioning is less necessary and more complicated when applied to databases and structured data. Here, the database applications like to tightly specify storage allocation, and managers are rightfully cautious about disturbing carefully tuned database applications by applying thin provisioning. It's no different from IT managers who are reluctant to put mission-critical transaction databases on virtualized servers until the technology matures.
3. Leverage all your spindles for better performance
Thin provisioning can actually improve storage performance if you create thinly provisioned virtual volumes that cross as many disk spindles as possible, Teter suggested. As a general rule, the more disk spindles handling the storage request, the higher the performance. With thin provisioning, you consume less physical capacity while getting better performance.
4. Use in conjunction with storage resource management (SRM) and data deduplication
"Thin provisioning is not a product on its own, but a feature," StorageIO Group's Schulz said. Like storage resource management and data deduplication, thin provisioning is being built into storage products in various ways. It should be combined with data deduplication and SRM as part of an overall storage management strategy. Storage resource management will provide usage data that enables the organization to thinly provision the storage better. When combined with data deduplication, the organization stands to increase utilization of existing storage while reducing the need for additional storage capacity.
3PAR Inc. and DataCore Software Corp. staked out positions in the thin provisioning market early on by selling data storage arrays and software that made extensive use of storage virtualization when allocating capacity.
However, storage vendors like Hewlett-Packard (HP) Co. and BlueArc Corp. use virtualization to enable what amounts to thin provisioning in other forms. It's storage virtualization combined with detailed knowledge of the organization's data usage patterns that make thin provisioning effective.
This was first published in June 2009
Pro+
Features
Enjoy the benefits of Pro+ membership, learn more and join.
Essential Guide
Taking charge of VM allocation, troubleshooting methods
0 comments
Oldest
Forgot Password?
No problem! Submit your e-mail address below. We'll send you an email containing your password.
Your password has been sent to:
-ADS BY GOOGLE
SearchSolidStateStorage
SearchVirtualStorage
SearchCloudStorage
SearchDisasterRecovery
SearchDataBackup
Close
|
__label__pos
| 0.567285 |
Для получения триального ключа
заполните форму ниже
Team License (базовая версия)
Enterprise License (расширенная версия)
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности
Запросите информацию о ценах
Новая лицензия
Продление лицензии
--Выберите валюту--
USD
EUR
RUB
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности
Бесплатная лицензия PVS-Studio для специалистов Microsoft MVP
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности
Для получения лицензии для вашего открытого
проекта заполните, пожалуйста, эту форму
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности
Мне интересно попробовать плагин на:
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности
Ваше сообщение отправлено.
Мы ответим вам на
Если вы так и не получили ответ, пожалуйста, проверьте папку
Spam/Junk и нажмите на письме кнопку "Не спам".
Так Вы не пропустите ответы от нашей команды.
>
>
>
Ядро macOS, есть ли червячки в этом ябл…
Ядро macOS, есть ли червячки в этом яблоке?
29 Мар 2021
В самом начале этого года Apple выложили в открытый доступ исходный код системных компонентов macOS 11.0 – Big Sur, включая XNU – ядро операционной системы macOS. Пару лет назад исходный код ядра уже проверялся PVS-Studio в связи с выходом анализатора для macOS. Прошло достаточно много времени, и вышел новый релиз исходного кода ядра. Почему бы и не провести повторную проверку.
0818_XNU_MacOS_Kernel_ru/image1.png
Что это за проект, Apple и open-source?
XNU – X is Not Unix – используется и разрабатывается Apple в качестве ядра операционных систем OS X. Исходные коды этого ядра 20 лет назад были опубликованы под лицензией APSL (Apple Public Source License) вместе с OC Darwin. Раньше Darwin можно было даже установить в качестве полноценной операционной системы, однако теперь это стало невозможно. Причиной публикации исходного кода является тот факт, что он во многом основан на других open-source проектах.
Исходные коды компонентов можно найти тут. Для проверки я использовала зеркало проекта на GitHub.
Предыдущая проверка
Как я уже упомянула, этот проект ранее проверялся нами с помощью PVS-Studio. С предыдущими результатами можно познакомиться в статье: "Релиз PVS-Studio для macOS: 64 weaknesses в Apple XNU Kernel". После публикации мой коллега Святослав также отправил статью разработчикам на почту, но ответа не получил. Так что я предполагаю, что наша проверка никак не связана с исправлениями, которые мы дальше рассмотрим. Разработчикам пришлось искать их другим путём. А могли бы просто взять и запустить PVS-Studio :). Сейчас, после публикации статей, мы в основном пишем об этом в GitHub репозиторий проекта.
Мне стало интересно, были ли исправлены ошибки, описанные в предыдущей статье, или всё так и осталось. Большинство из найденных ошибок действительно были исправлены. Это показывает, что отобранные предупреждения анализатора оказались верными. Хотя для написания статьи с отчётом работал человек, не участвующий в разработке XNU, то есть близко не знакомый с этим исходным кодом.
Я приведу здесь несколько примеров исправлений. Но, чтобы не раздувать объём статьи, не буду полностью приводить объяснение ошибок. Если из исправления будет неясно, в чём была проблема, то вы всегда можете обратиться к первой статье по проверке этого проекта. Я не буду разбирать все исправленные фрагменты, большинство из фрагментов всё-таки было поправлено. А фрагментов в предыдущей статье было ни много ни мало 64!
Перейдём к рассмотрению исправлений примеров из прошлой статьи.
Фрагмент N1, в котором член класса сравнивался сам с собой:
int
key_parse(
struct mbuf *m,
struct socket *so)
{
....
if ((m->m_flags & M_PKTHDR) == 0 ||
m->m_pkthdr.len != m->m_pkthdr.len) {
....
goto senderror;
}
....
}
Был исправлен следующим образом:
0818_XNU_MacOS_Kernel_ru/image2.png
Где макрос, из которого получена переменная orglen, выглядит следующим образом:
#define PFKEY_UNUNIT64(a) ((a) << 3)
Выходит, что анализатор оказался прав: сравнение было некорректным и должно было проводиться с переменной orglen, которая даже присутствовала в коде до исправления.
Еще один пример исправления, который я хочу привести здесь, – фрагмент N5, где знак равно всё-таки был исправлен на проверку на равенство.
0818_XNU_MacOS_Kernel_ru/image3.png
Накосячить в условии assertf – одно, но ещё и перезаписать переменную для отладочной версии – такое точно стоит поправить.
Фрагменты 6 и 7 были исправлены одинаково. Оказалось, что во вложенной проверке перепутали значение перечислителя для сравнения. Вместо PBUF_TYPE_MBUF во внутренней проверке должен быть элемент PBUF_TYPE_MEMORY в обоих случаях.
0818_XNU_MacOS_Kernel_ru/image4.png
В случае фрагментов N8, 9, 10 исправление было таким:
0818_XNU_MacOS_Kernel_ru/image5.png
На это исправление я обратила внимание, так как серьёзная часть коммита в целом (обновление репозитория до xnu-4903.270.47 от 11 января) содержит помимо прочего много правок код-стайла. Это может указывать на то, что для данной версии кодовая база была подчищена с помощью разных инструментов качества кода. Что сделает эту проверку PVS-Studio более интересной. Ведь видно, что качество кодовой базы уже было улучшено другими инструментами.
Что касается фрагментов 11, 12, 13, 14 – был исправлен только фрагмент 11:
0818_XNU_MacOS_Kernel_ru/image6.png
Остальные остались прежними. Похоже, кто-то невнимательно прочитал наш отчёт ;) (или отчёт анализатора, использованный для улучшения качества кода в этом коммите). Приведу здесь код, на который было выдано одно из предупреждений, чтобы не было сомнений в аналогичности ошибки:
static int
kauth_resolver_getwork(user_addr_t message)
{
struct kauth_resolver_work *workp;
int error;
KAUTH_RESOLVER_LOCK();
error = 0;
while ((workp = TAILQ_FIRST(....)) == NULL) { // <=
thread_t thread = current_thread();
struct uthread *ut = get_bsdthread_info(thread);
ut->uu_save.uus_kauth.message = message;
error = msleep0(....);
KAUTH_RESOLVER_UNLOCK();
/*
* If this is a wakeup from another thread in the resolver
* deregistering it, error out the request-for-work thread
*/
if (!kauth_resolver_identity) {
printf("external resolver died");
error = KAUTH_RESOLVER_FAILED_ERRCODE;
}
return error; //<=
}
return kauth_resolver_getwork2(message);
}
Предупреждение PVS-Studio: V612 An unconditional 'return' within a loop. kern_credential.c 951
Я привела код почти целиком, чтобы можно было сформировать общее представление о том, что происходит в этой функции. В случае отмеченного цикла при выполнении условия входа в него будет совершён один проход по телу цикла, завершающийся возвращением error. Видимо, подразумевалось, что если выполняется условие (workp = TAILQ_FIRST(....)) == NULL, то нужно найти причину ошибки и завершить функцию возвращением информации об ошибке. Однако по какой-то причине вместо if был написан while, как и во фрагменте из предыдущей статьи. Строчка error = msleep0(....) выглядит в коде таким образом:
error = msleep0(&kauth_resolver_unsubmitted,
kauth_resolver_mtx,
PCATCH,
"GRGetWork",
0,
kauth_resolver_getwork_continue);
Здесь последним аргументом передаётся указатель на функцию kauth_resolver_getwork_continue. В теле этой функции есть условие, аналогичное условию цикла, на который нам указал анализатор. Но в нём уже корректно используется if, а не while.
static int
kauth_resolver_getwork_continue(int result)
{
....
if (TAILQ_FIRST(&kauth_resolver_unsubmitted) == NULL) {
....
return error;
}
....
}
В принципе этот код работает немного сложнее, чем я описала. В нём присутствует рекурсия (в методе kauth_resolver_getwork_continue), и, как я поняла, он нацелен на нахождение потоков, которые можно перезагрузить. Но я не стала вдаваться в подробности, так как while всё равно лишний. Возможно, он остался здесь с того времени, когда исходный код выполнял ту же задачу, но без использования рекурсии.
Это примеры из начала статьи. Проскочим в середину и возьмём фрагмент N40. В нём одному и тому же элементу дважды присваивается одно значение:
Предупреждение PVS-Studio: V519 CWE-563 The 'wrap.Seal_Alg[0]' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2070, 2071. gss_krb5_mech.c 2071
Эта ошибка, конечно же, тоже была поправлена:
0818_XNU_MacOS_Kernel_ru/image7.png
Ну и ближе к концу статьи, фрагмент 62 был исправлен так, как и было предложено в предыдущей статье. Причём это было единственной правкой в том файле.
0818_XNU_MacOS_Kernel_ru/image8.png
Фрагменты 63 и 64 также были исправлены, но там код был изменён капитально. Поэтому понять, какое исправление было именно для рассмотренного предупреждения, сложно.
Новые находки
После этого долгого вступления перейду к ошибкам, которые привлекли моё внимание при последней проверке исходного кода XNU статическим анализатором PVS-Studio. Скажу честно, мне тяжело далась работа с отчётом, так как проект имеет сложный код и у меня нет опыта работы с подобной кодовой базой. Но предупреждения PVS-Studio достаточно подробны и имеют ссылку на документацию с примерами правильного и неправильного кода и описанием возможной проблемы, что очень меня выручило.
К этой проверке cloc насчитал в проекте 1346 *.c файлов, 1822 С/C++ хэдера и 225 *.cpp файлов.
Ну и перейдём к разбору интересных находок.
Фрагмент N1
void
pe_identify_machine(__unused boot_args *args)
{
....
// Start with default values.
gPEClockFrequencyInfo.timebase_frequency_hz = 1000000000;
gPEClockFrequencyInfo.bus_frequency_hz = 100000000;
....
gPEClockFrequencyInfo.dec_clock_rate_hz =
gPEClockFrequencyInfo.timebase_frequency_hz;
gPEClockFrequencyInfo.bus_clock_rate_hz =
gPEClockFrequencyInfo.bus_frequency_hz;
....
gPEClockFrequencyInfo.bus_to_dec_rate_den =
gPEClockFrequencyInfo.bus_clock_rate_hz /
gPEClockFrequencyInfo.dec_clock_rate_hz;
}
Предупреждение PVS-Studio: V1064 The 'gPEClockFrequencyInfo.bus_clock_rate_hz' operand of integer division is less than the 'gPEClockFrequencyInfo.dec_clock_rate_hz' one. The result will always be zero. pe_identify_machine.c 72
Все используемые здесь поля имеют целочисленный тип:
extern clock_frequency_info_t gPEClockFrequencyInfo;
struct clock_frequency_info_t {
unsigned long bus_clock_rate_hz;
unsigned long dec_clock_rate_hz;
unsigned long bus_to_dec_rate_den;
unsigned long long bus_frequency_hz;
unsigned long timebase_frequency_hz;
....
};
Через промежуточные присвоения полю gPEClockFrequencyInfo.bus_clock_rate_hz, являющемуся делимым, присваивается значение 100000000, а полю-делителю gPEClockFrequencyInfo.dec_clock_rate_hz присваивается значение 1000000000. Делитель в этом случае в десять раз больше делимого. Так как все поля здесь являются целочисленными, поле gPEClockFrequencyInfo.bus_to_dec_rate_den окажется равным 0.
Судя по наименованию результирующего поля bus_to_dec_rate_den, делитель и делимое были перепутаны местами. Я допускаю возможность, что код был написан с расчётом на то, что исходные значения изменятся и результат уже не будет равен 0. Но этот код всё равно кажется мне очень подозрительным.
Фрагмент N2
void
sdt_early_init( void )
{
....
if (MH_MAGIC_KERNEL != _mh_execute_header.magic) {
....
} else {
....
for (....) {
const char *funcname;
unsigned long best; //<=
....
funcname = "<unknown>";
for (i = 0; i < orig_st->nsyms; i++) {
char *jname = strings + sym[i].n_un.n_strx;
....
if ((unsigned long)sym[i].n_value > best) { //<=
best = (unsigned long)sym[i].n_value;
funcname = jname;
}
}
.....
}
}
Предупреждение PVS-Studio: V614 Uninitialized variable 'best' used. sdt.c 572
Насколько я поняла, этот метод ищет название некоей функции. В алгоритме используется переменная best, возможно, это положение наилучшего кандидата на результат. Однако изначально эта переменная только объявляется без инициализации. Следующее же использование сверяет значение некоего элемента с переменной best, которая будет неинициализированной на тот момент. Еще страннее, что она инициализируется только внутри условия, в котором используется её же значение.
Неинициализированные переменные могут приводить к непредсказуемым результатам. И, хотя эта ошибка может показаться достаточно банальной, она всё ещё часто встречается при проверках разных проектов с помощью PVS-Studio. Например, совсем недавно мой коллега Андрей описывал интересный случай такой ошибки.
Фрагмент N3
int
cdevsw_isfree(int index)
{
struct cdevsw * devsw;
if (index < 0) {
if (index == -1) {
index = 0;
} else {
index = -index;
}
devsw = &cdevsw[index];
for (; index < nchrdev; index++, devsw++) {
if (memcmp(....) == 0) {
break;
}
}
}
if (index < 0 || index >= nchrdev) {
return -1;
}
....
return index;
}
Предупреждение PVS-Studio: V560 A part of conditional expression is always false: index < 0. bsd_stubs.c:236
Небольшой пример того, что анализатор отслеживает возможные значения переменных. В начале функции переменная index сравнивается с нулём. Если она меньше него, то во внутреннем блоке ей будет присвоено значение не меньше нуля. А следующий внешний if снова проверяет, имеет ли index значение меньше нуля, но это невозможно.
Логики программы этот момент не меняет, но есть вероятность, что подразумевалось какое-то иное условие. Ну и в любом случае лишние проверки не делают код читабельнее и понятнее.
Фрагмент N4
int
nfs_vinvalbuf_internal(....)
{
struct nfsbuf *bp;
....
off_t end = ....;
/* check for any dirty data before the EOF */
if ((bp->nb_dirtyend > 0) && (bp->nb_dirtyoff < end))
{
/* clip dirty range to EOF */
if (bp->nb_dirtyend > end)
{
bp->nb_dirtyend = end;
if (bp->nb_dirtyoff >= bp->nb_dirtyend) //<=
{
bp->nb_dirtyoff = bp->nb_dirtyend = 0;
}
}
if ((bp->nb_dirtyend > 0) && (bp->nb_dirtyoff < end)) //<=
{
....
}
}
....
}
Предупреждения PVS-Studio:
• V547 Expression 'bp->nb_dirtyoff >= bp->nb_dirtyend' is always false. nfs_bio.c 3858
• V560 A part of conditional expression is always true: (bp->nb_dirtyoff < end). nfs_bio.c 3862
В случае этого фрагмента к анализатору точно стоит прислушаться и попытаться упростить код. Учтите, что тут он хотя бы приведён с сокращениями.
Начнём с первого предупреждения. Анализатор решил, что nb_dirtyoff не может быть больше или равен nb_dirtyend. Разберёмся почему. Перед подозрительной проверкой есть ещё два if с проверками (bp->nb_dirtyend > 0) && (bp->nb_dirtyoff < end) и bp->nb_dirtyend > end. А также осуществляется присвоение bp->nb_dirtyend = end.
Почему же третья проверка bp->nb_dirtyoff >= bp->nb_dirtyend будет всегда false?
0818_XNU_MacOS_Kernel_ru/image9.png
Всё просто. Из условий выходит, что nb_dirtyoff меньше, чем end, а nb_dirtyend равно end. В итоге nb_dirtyend точно больше, чем nb_dirtyoff. Присвоение bp->nb_dirtyoff = bp->nb_dirtyend = 0 никогда не будет выполнено.
В итоге вот такой участок кода:
if ((bp->nb_dirtyend > 0) && (bp->nb_dirtyoff < end)) {
/* clip dirty range to EOF */
if (bp->nb_dirtyend > end) {
bp->nb_dirtyend = end;
if (bp->nb_dirtyoff >= bp->nb_dirtyend) { //<=
bp->nb_dirtyoff = bp->nb_dirtyend = 0;
}
}
}
Можно упростить хотя бы до такого:
if ((bp->nb_dirtyend > 0) && (bp->nb_dirtyoff < end)) {
if (bp->nb_dirtyend > end) {
bp->nb_dirtyend = end;
}
}
Но только если в настоящий момент этот алгоритм работает корректно.
Второе предупреждение указывает на четвёртый if, вложенный в первый.
if ((bp->nb_dirtyend > 0) && (bp->nb_dirtyoff < end))
Здесь анализатор выдаёт предупреждение на основании того, что присвоение нуля никогда не будет выполнено. В итоге во внешнем условии уже была проверка bp->nb_dirtyoff < end и внутренняя проверка из-за ошибки в условии выше становится бессмысленной.
Фрагмент N5
tcp_output(struct tcpcb *tp)
{
....
if (isipv6) {
....
if (len + optlen) {
....
}
} else {
....
if (len + optlen) {
....
}
}
....
}
Предупреждение PVS-Studio: V793 It is odd that the result of the 'len + optlen' statement is a part of the condition. Perhaps, this statement should have been compared with something else.
Это достаточно простой недочёт. В условии вместо логического выражения просто складываются две переменные. В итоге выражение будет ложным, только если сумма окажется равной нулю. Если это и подразумевалось, то, возможно, стоит сделать сравнение с 0 явным, чтобы вопроса о правильности условия точно не возникало.
Конечно, может быть, что так и задумано, но чуть выше в коде есть вот такая проверка:
if (len + optlen + ipoptlen > tp->t_maxopd) {
....
}
Это наводит на мысль, что, скорее всего, в двух if'ах, на которые указал анализатор, также должно было проводиться сравнение.
Ещё замечу, что эта функция, сокращённая тут до 16 строк, занимает в оригинале 2268 строк! Ещё один возможный повод для рефакторинга ;)
Второе предупреждение на этот же участок:
V793 It is odd that the result of the 'len + optlen' statement is a part of the condition. Perhaps, this statement should have been compared with something else.
Фрагмент N6
int
ttyinput(int c, struct tty *tp)
{
....
if (tp->t_rawq.c_cc + tp->t_canq.c_cc) {
....
}
Предупреждение PVS-Studio: V793 It is odd that the result of the 'tp->t_rawq.c_cc + tp->t_canq.c_cc' statement is a part of the condition. Perhaps, this statement should have been compared with something else. tty.c 568
Аналогичный случай. Тут повыше в коде снова есть проверка, которая не просто использует сумму, а сравнивает результат с другой переменной:
if ( tp->t_rawq.c_cc + tp->t_canq.c_cc > I_HIGH_WATER – 3 // <=
&& ....) {
....
}
В упрощённом коде условие, на которое указал анализатор, выглядит заметно. Но в оригинале оно было вложено в несколько if. Так что при код-ревью такое можно и пропустить, а анализатор не пропустит ;)
Фрагмент N7
errno_t
mbuf_adjustlen(mbuf_t m, int amount)
{
/* Verify m_len will be valid after adding amount */
if (amount > 0) {
int used = (size_t)mbuf_data(m)
- (size_t)mbuf_datastart(m)
+ m->m_len;
if ((size_t)(amount + used) > mbuf_maxlen(m)) {
....
}
....
return 0;
}
Предупреждение PVS-Studio: V1028 Possible overflow. Consider casting operands of the 'amount + used' operator to the 'size_t' type, not the result. kpi_mbuf.c
Снова ошибка в условии, но уже совсем другого рода. Вместо приведения к size_t операндов сложения, чтобы результат точно поместился в числовой тип, к size_t приводится результат сложения. Если в итоге сложения возникнет переполнение, то с результатом mbuf_maxlen(m) будет сравниваться бессмысленное значение, приведённое к size_t. Раз программист всё-таки хотел защититься от переполнения, то стоит его сделать правильно:
if ((size_t)amount + used > mbuf_maxlen(m))
Таких срабатываний было несколько, стоит обратить на этот момент внимание.
• V1028 Possible overflow. Consider casting operands, not the result. vm_compressor_pager.c 1165
• V1028 Possible overflow. Consider casting operands, not the result. vm_compressor_pager.c 1131
• V1028 Possible overflow. Consider casting operands, not the result. audit_worker.c 241
• V1028 Possible overflow. Consider casting operands of the '((u_int32_t) slp * hz) + 999999' operator to the 'long' type, not the result. tty.c 2199
Фрагмент N8
int
fdavail(proc_t p, int n)
{
....
char *flags;
int i;
int lim;
....
lim = (int)MIN(....);
if ((i = lim - fdp->fd_nfiles) > 0 && (n -= i) <= 0) //<=
{
return 1;
}
....
for (....)
{
if (*fpp == NULL && !(*flags & UF_RESERVED) && --n <= 0)
{
return 1;
}
}
return 0;
}
Предупреждение PVS-Studio: V1019 Compound assignment expression 'n -= i' is used inside condition. kern_descrip.c_99 3916
Этот код, на мой взгляд, является крайне сложночитаемым. Возможно, условие, на которое указал анализатор, стоит переписать в более простом виде:
i = lim - fdp->fd_nfiles;
if (i > 0)
{
n -= i;
if(n <= 0)
return 1;
}
Этот код выглядит менее эффективным, но точно является более понятным. Для быстрой проверки равнозначности эффективности этого кода можно зайти на Godbolt (Compiler Explorer), где, кстати, можно тестировать работу диагностик PVS-Studio. Анализатор легко найти среди инструментов этого сервиса.
Если не включать оптимизации, то ассемблерный код получится на пару строк больше. А вот с оптимизациями разницы уже нет никакой. Так что писать тут хитрый код нет смысла, компилятор всё сам сделает, как надо.
Но, если обратить внимание на тело этого if, новое значение n в нём не используется. То есть вполне возможно, что никакое присвоение здесь и не нужно. Тогда можно обойтись таким кодом:
i = lim - fdp->fd_nfiles;
if (i > 0) {
if(n – i <= 0)
return 1;
}
И, более того, исходный код может приводить к ошибке при дальнейшем использовании переменной n. Если выражение (n -= i) <= 0 окажется ложным, то далее будет использоваться уже новое значение n. Так как я не работала вплотную с исходным кодом, мне сложно сказать, какое поведение является верным.
Фрагмент N9
static errno_t
vsock_put_message_listening(struct vsockpcb *pcb,
enum vsock_operation op,
struct vsock_address src,
struct vsock_address dst)
{
switch (op)
{
case VSOCK_REQUEST:
....
if (....)
{
vsock_pcb_safe_reset_address(pcb, dst, src);
....
}
....
done:
....
break;
case VSOCK_RESET:
error = vsock_pcb_safe_reset_address(pcb, dst, src);
break;
default:
vsock_pcb_safe_reset_address(pcb, dst, src);
....
break;
}
return error;
}
Предупреждение PVS-Studio: V764 Possible incorrect order of arguments passed to 'vsock_pcb_safe_reset_address' function: 'dst' and 'src'. vsock_domain.c 549
Этот момент запросто может оказаться и не ошибкой. Но крайне подозрительно, что сигнатура вызываемой в этом фрагменте функции выглядит так:
static errno_t
vsock_pcb_safe_reset_address(struct vsockpcb *pcb,
struct vsock_address src,
struct vsock_address dst)
При использовании этой функции в данном фрагменте последние два аргумента с аналогичными именами передаются в другом порядке.
Срабатывания на тот же фрагмент:
• V764 Possible incorrect order of arguments passed to 'vsock_pcb_safe_reset_address' function: 'dst' and 'src'. vsock_domain.c 587
• V764 Possible incorrect order of arguments passed to 'vsock_pcb_safe_reset_address' function: 'dst' and 'src'. vsock_domain.c 590
Фрагмент N10
int
ifclassq_tbr_set(struct ifclassq *ifq, ....)
{
struct tb_regulator *tbr;
....
tbr = &ifq->ifcq_tbr;
....
tbr->tbr_rate = TBR_SCALE(rate / 8) / machclk_freq;
....
tbr->tbr_last = read_machclk();
if ( tbr->tbr_rate > 0 //<=
&& (ifp->if_flags & IFF_UP))
{
....
} else {
....
}
....
return 0;
}
Предупреждение PVS-Studio: V1051 Consider checking for misprints. It's possible that the 'tbr->tbr_last' should be checked here. classq_subr.c 685
В проекте эта диагностика работала не лучшим образом, так как в коде постоянно над телом условия или цикла инициализировались сторонние переменные с именами, похожими на используемые в условии. Поэтому на этот раз диагностика выдала несколько явно ложных предупреждений. Но рассматриваемое нами срабатывание всё же показалось мне подозрительным, так как проверяемое поле tbr_rate не использовалось в теле условия и было инициализировано на 35 строк выше этой проверки. А вот поле tbr_last, инициализированное прямо перед этой проверкой, больше нигде не используется. Можно предположить, что проверить нужно было его вместо tbr_rate.
Фрагмент N11
void
audit_arg_mac_string(struct kaudit_record *ar, ....)
{
if (ar->k_ar.ar_arg_mac_string == NULL)
{
ar->k_ar.ar_arg_mac_string = kheap_alloc(....);
}
....
if (ar->k_ar.ar_arg_mac_string == NULL)
{
if (ar->k_ar.ar_arg_mac_string == NULL) // <=
{
return;
}
}
....
}
Предупреждение PVS-Studio: V571 Recurring check. The 'if (ar->k_ar.ar_arg_mac_string == NULL)' condition was already verified in line 245. audit_mac.c 246
Предупреждение PVS-Studio: V547 Expression 'ar->k_ar.ar_arg_mac_string == NULL' is always true. audit_mac.c 246
На этот код анализатор выдал сразу два предупреждения.
Сначала взгляд может зацепиться за то, что проверка в самом первом if и во втором совпадает. Но тут всё правильно: внутри тела первой проверки аллоцируется память, а для второй проверки есть пояснение:
/*
* XXX This should be a rare event.
* If kheap_alloc() returns NULL,
* the system is low on kernel virtual memory. To be
* consistent with the rest of audit, just return
* (may need to panic if required to for audit).
*/
Судя по этому комментарию, во второй проверке не должно быть никакой внутренней проверки. Нужно просто выйти из метода. Так что, скорее всего, внутренняя проверка была продублирована случайно и не имеет никакого смысла.
Хотя возможен и тот вариант, что во внутренней проверке нужно было проверить какое-то другое поле. Но сюда закралась ошибка копипасты, и разработчик забыл поправить имя поля.
Фрагмент N12
int
utf8_encodestr(....)
{
u_int16_t ucs_ch;
int swapbytes = ....;
....
ucs_ch = swapbytes ? OSSwapInt16(*ucsp++) : *ucsp++;
....
}
Предупреждение PVS-Studio: V567 Undefined behavior. The 'ucsp' variable is modified while being used twice between sequence points. vfs_utfconv.c 298
Макросы – очень коварная штука. Возможно, вы даже уже встречались с нашей статьей "Вред макросов для C++ кода". Я обычно при написании статей избегаю срабатываний на макросы. С ними всегда всё оказывается сложно без знакомства с кодовой базой проекта.
Но в случае этой ошибки всё оказалось чуть проще. Хотя, чтобы дойти до причины и развернуть цепочку макросов, пришлось прыгнуть в ту ещё кроличью нору. Собственно, цепочка эта начинается с выражения OSSwapInt16(*ucsp++).
0818_XNU_MacOS_Kernel_ru/image10.png
Потом я поняла, что есть способ попроще, и просто обратилась к .i файлу, который остался после проверки проекта. По нему строка с этим макросом развернулась следующим образом:
ucs_ch = swapbytes
? ( (__uint16_t)(__builtin_constant_p(*ucsp++)
? ((__uint16_t)( (((__uint16_t)(*ucsp++) & 0xff00U) >> 8)
| (((__uint16_t)(*ucsp++) & 0x00ffU) << 8)))
: _OSSwapInt16(*ucsp++)))
: *ucsp++;
Больше всего здесь нас интересует вот этот участок выражения:
(((__uint16_t)(*ucsp++) & 0xff00U) >> 8)
| (((__uint16_t)(*ucsp++) & 0x00ffU) << 8)
Никакой из операторов в выражении не является точкой следования. Так как точно неизвестно, какой из аргументов оператора | будет вычисляться первым, значение *uscp оказывается неопределённым.
Для диагностики V567 PVS-Studio предоставляет крайне подробную документацию. Если вам интересно, почему такой код может приводить к неопределённому поведению, документация может стать хорошим началом изучения этой проблемы.
Однако это ещё не всё! Есть очень интересный и важный момент. Готова поспорить, что человек, писавший этот код, планировал увеличить значение *ucsp только один раз. Но, на самом деле, значение увеличится дважды. Это не видно и непонятно. Макросы очень и очень опасны из-за вот таких случаев. Во многих ситуациях лучше написать обыкновенную функцию. Скорее всего, компилятор автоматически выполнит подстановку и никакого ухудшения производительности не произойдёт.
Фрагмент N13
struct pf_status pf_status;
int
pf_insert_state(struct pf_state *s, ....)
{
....
if (....) {
s->id = htobe64(pf_status.stateid++);
....
}
....
}
Предупреждение PVS-Studio: V567 Undefined behavior. The 'pf_status.stateid' variable is modified while being used twice between sequence points. pf.c 1440
И снова коварные макросы смешали все карты для инкремента. Рассмотрим строку с вызовом htobe64, которая оказалась подозрительной для анализатора после препроцессинга:
s->id = (__builtin_constant_p(pf_status.stateid++) ?
((__uint64_t)((((__uint64_t)(pf_status.stateid++) &
0xff00000000000000ULL) >> 56) | (((__uint64_t)(pf_status.stateid++) &
0x00ff000000000000ULL) >> 40) | (((__uint64_t)(pf_status.stateid++) &
0x0000ff0000000000ULL) >> 24) | (((__uint64_t)(pf_status.stateid++) &
0x000000ff00000000ULL) >> 8) | (((__uint64_t)(pf_status.stateid++) &
0x00000000ff000000ULL) << 8) | (((__uint64_t)(pf_status.stateid++) &
0x0000000000ff0000ULL) << 24) | (((__uint64_t)(pf_status.stateid++) &
0x000000000000ff00ULL) << 40) | (((__uint64_t)(pf_status.stateid++) &
0x00000000000000ffULL) << 56))) : _OSSwapInt64(pf_status.stateid++));
0818_XNU_MacOS_Kernel_ru/image11.png
Проблема собственно та же, что и в предыдущем примере. Во внутренней цепочке с операндами | и & нет точек следования. Поэтому неизвестно, какое значение примет pf_status.stateid на моменте выполнения каждой операции. Результат также неопределён.
И, опять-таки, переменная увеличивается несколько раз подряд, что является неприятным сюрпризом от макроса :).
Вот остальные срабатывания этой диагностики на этом проекте:
• V567 Undefined behavior. The 'ip_id' variable is modified while being used twice between sequence points. ip_id.c 186
• V567 Undefined behavior. The 'lp' variable is modified while being used twice between sequence points. nfs_boot.c 505
• V567 Undefined behavior. The 'lp' variable is modified while being used twice between sequence points. nfs_boot.c 497
• V567 Undefined behavior. The 'ip_id' variable is modified while being used twice between sequence points. kdp_udp.c 588
• V567 Undefined behavior. The 'ip_id' variable is modified while being used twice between sequence points. kdp_udp.c 665
• V567 Undefined behavior. The 'ip_id' variable is modified while being used twice between sequence points. kdp_udp.c 1543
Фрагмент N14
__private_extern__ boolean_t
ipsec_send_natt_keepalive(....)
{
....
struct udphdr *uh = (__typeof__(uh))(void *)( (char *)m_mtod(m)
+ sizeof(*ip));
....
if (....)
{
uh->uh_sport = (u_short)sav->natt_encapsulated_src_port;
} else {
uh->uh_sport = htons((u_short)esp_udp_encap_port);
}
uh->uh_sport = htons((u_short)esp_udp_encap_port);
....
}
Предупреждение PVS-Studio: V519 The 'uh->uh_sport' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 4866, 4870. ipsec.c 4870
В этом фрагменте возникла подозрительная ситуация: полю uh_sport в зависимости от определённого условия присваиваются разные значения. Однако сразу после if-else этому же полю снова присваивается значение, такое же как в ветке else. В итоге этот if-else блок теряет смысл, так как значение поля всё равно будет перезаписано.
Фрагмент N15
static kern_return_t
vm_shared_region_slide_page_v3(vm_offset_t vaddr, ....)
{
....
uint8_t *page_content = (uint8_t *)vaddr;
uint16_t page_entry;
....
uint8_t* rebaseLocation = page_content;
uint64_t delta = page_entry;
do {
rebaseLocation += delta;
uint64_t value;
memcpy(&value, rebaseLocation, sizeof(value));
....
bool isBind = (value & (1ULL << 62)) == 1; // <=
if (isBind) {
return KERN_FAILURE;
}
....
} while (delta != 0);
....
}
Предупреждение PVS-Studio: V547 Expression '(value & (1ULL << 62)) == 1' is always false. vm_shared_region.c 2820
Тут получилось много кода из-за использования большого числа переменных. Но интересует нас только указанная мною строка с инициализацией isBind. Разберём это выражение по шагам.
В результате побитового сдвига создаётся маска с единственной единицей в 63-ем бите. Результат побитового & с переменной value может принимать только значения 0 или 0x4000000000000000. А никакое из этих значений не равно 1. В итоге условие всегда будет ложным.
Судя по тому, что выполнение этого условия должно было привести к выходу из функции с возвратом KERN_FAILURE, возможно, как раз значение 0x4000000000000000 является тем самым исключительным случаем, после которого нужно выйти из функции. Тогда результат побитовых операций надо было сравнивать с этим числом, а не с 1. Ну, или написать так:
bool isBind = (value & (1ULL << 62)) != 0;
Фрагмент N16
int
vn_path_package_check(char *path, int pathlen, ....)
{
char *ptr, *end;
int comp = 0;
....
end = path + 1;
while (end < path + pathlen && *end != '\0') {
while (end < path + pathlen && *end == '/' && *end != '\0') {
end++;
}
ptr = end;
while (end < path + pathlen && *end != '/' && *end != '\0') {
end++;
}
....
}
....
}
Предупреждение PVS-Studio: V590 Consider inspecting this expression. The expression is excessive or contains a misprint. vfs_subr.c 3589
Эта диагностика всегда указывает на излишний код. Иногда под ним скрывается более серьёзная ошибка. Но здесь это, скорее всего, просто недочёт. Предупреждение было выдано на первый внутренний while. Нет смысла проверять, что символ одновременно равен '/' и не равен '\0'. Достаточно только первой проверки, так как если *end равен '/', то он точно не может быть равен '\0'.
Следующий while содержит столько же проверок. Но из-за того, что в обоих случаях проверяется неравенство, эти проверки могут работать вместе. Возможно, сначала был написан второй while, а первый был скопирован с него с изменённой проверкой для '/'. Тогда перед нами недочёт, возникший из-за копипасты.
Заключение
В этот раз в проекте нашлось несколько меньше ошибок, чем в предыдущей статье. Весьма вероятно, что в процесс разработки XNU был внедрён статический анализ и другие инструменты контроля качества кода. Почти наверняка на проекте используется Clang Static Analyzer. Но ошибки и недочёты всё-таки нашлись. Я не стала приводить здесь некоторые срабатывания на подозрительные места, вывод по которым можно сделать только на основании большего понимания кодовой базы.
Однако даже приведённые фрагменты показывают, что такой крайне важный проект, несомненно, разрабатываемый профессионалами, нуждается в инструментах контроля качества кода.
Если вам интересно, какие ошибки может помочь найти статический анализ в целом и PVS-Studio конкретно, то можете познакомиться с нашей подборкой статей про проверку исходных проектов. Там есть проверки кода не только операционных систем, но и, например, компиляторов и других инструментов программирования, которыми вы, возможно, пользуетесь ежедневно. Например, совсем недавно вышла статья про проверку Qt6.
Популярные статьи по теме
Проверили с помощью PVS-Studio исходные коды Android, или никто не идеален
Дата: 01 Авг 2018
Автор: Андрей Карпов
Разработка больших сложных проектов невозможна без использования методологий программирования и инструментальных средств, помогающих контролировать качество кода. В первую очередь, это грамотный стан…
Релиз PVS-Studio для macOS: 64 weaknesses в Apple XNU Kernel
Дата: 28 Мар 2018
Автор: Андрей Карпов
Новая версия PVS-Studio 6.23 работает под управлением macOS и позволяет проверять проекты, написанные на языке C и C++. К этому событию наша команда решила приурочить проверку XNU Kernel.
27000 ошибок в операционной системе Tizen
Дата: 12 Июл 2017
Автор: Андрей Карпов
Эта статья продемонстрирует, что при разработке крупных проектов статический анализ кода является не просто полезным, а совершенно необходимым элементом процесса разработки. Я начинаю цикл статей, по…
Как найти 56 потенциальных уязвимостей в коде FreeBSD за один вечер
Дата: 06 Апр 2017
Автор: Андрей Карпов
Пришло время вновь проверить проект FreeBSD и продемонстрировать, что даже в таких серьезных и качественных проектах анализатор PVS-Studio легко находит ошибки. В этот раз я решил взглянуть на поиск …
Комментарии (0)
Следующие комментарии
Этот сайт использует куки и другие технологии, чтобы предоставить вам более персонализированный опыт. Продолжая просмотр страниц нашего веб-сайта, вы принимаете условия использования этих файлов. Если вы не хотите, чтобы ваши данные обрабатывались, пожалуйста, покиньте данный сайт. Подробнее →
Принять
|
__label__pos
| 0.718481 |
How can a man tell if he has breast cancer?
Signs and symptoms of male breast cancer can include:
1. A painless lump or thickening in your breast tissue.
2. Changes to the skin covering your breast, such as dimpling, puckering, redness or scaling.
3. Changes to your nipple, such as redness or scaling, or a nipple that begins to turn inward.
4. Discharge from your nipple.
How common is men’s breast cancer? Breast cancer is most often found in women, but men can get breast cancer too. About 1 out of every 100 breast cancers diagnosed in the United States is found in a man.
What causes breast cancer in men? Men with inherited mutations in the BRCA1 and BRCA2 genes have a higher lifetime risk for breast cancer, and possibly some other cancers such as prostate and pancreatic cancer. There are also other hereditary cancer syndromes that can be associated with male breast cancer.
Is male breast cancer curable? Treatment for men diagnosed with breast cancer is usually modified radical mastectomy. Breast-conserving surgery with lumpectomy followed by radiation therapy may be used for some men.
How can a man tell if he has breast cancer? – Additional Questions
Is male breast cancer painful?
The symptoms of breast cancer in men include: a lump in the breast – this is usually hard, painless and does not move around within the breast. the nipple turning inwards. fluid oozing from the nipple (nipple discharge), which may be streaked with blood.
What causes male breast pain?
Most causes of male breast pain are benign, or not cancerous. The pain can be caused by hormone changes, infections, injuries, or unknown causes. Some common causes of male breast pain include: Breast injury: An injury to the breast may cause the death of fatty tissue.
How long can you live with male breast cancer?
5-year relative survival rates for breast cancer in men
SEER stage 5-year relative survival rate
Localized 95%
Regional 83%
Distant 19%
All SEER stages combined 82%
Is male breast cancer fast growing?
Inflammatory breast cancer accounts for a small percentage of breast cancers in men. It is a fast-growing cancer, in which cancer cells block lymph vessels in the breast skin, causing swelling and skin redness. It can be mistaken for a breast infection.
Is male breast cancer treated the same as female?
More than 80 percent of male breast cancers are hormone-receptor positive. Treatments for male and female breast cancer are similar and include hormone therapy, radiation therapy, targeted therapy, chemotherapy and breast cancer surgery.
Is a lump in male breast always cancer?
Most lumps and swellings are not a sign of cancer. They’re usually caused by something fairly harmless, such as enlarged male breast tissue (gynaecomastia), a fatty lump (lipoma), or a fluid-filled bump (cyst). A GP can check your lump and refer you for tests and scans for breast cancer if needed.
What does a male breast tumor feel like?
A lump that feels like a hard knot or a thickening in the breast or under the arm. Because men generally have small amounts of breast tissue, it is easier to feel a small lump. Any new irregularity on the skin or nipple, such as redness, scaliness, puckering, or a discharge from the nipple.
How can you tell if a lump is cancerous?
Bumps that are cancerous are typically large, hard, painless to the touch and appear spontaneously. The mass will grow in size steadily over the weeks and months. Cancerous lumps that can be felt from the outside of your body can appear in the breast, testicle, or neck, but also in the arms and legs.
Do cancerous lumps move?
Cancerous lumps are usually hard, painless and immovable. Cysts or fatty lumps etc are usually slightly softer to touch and can move around.
Do cancerous lumps hurt?
Cancer lumps usually don’t hurt. If you have one that doesn’t go away or grows, see your doctor. Night sweats. In middle-aged women, it can be a symptom of menopause, but it’s also a symptom of cancer or an infection.
How fast do breast tumors grow?
Studies show that even though breast cancer happens more often now than it did in the past, it doesn’t grow any faster than it did decades ago. On average, breast cancers double in size every 180 days, or about every 6 months. Still, the rate of growth for any specific cancer will depend on many factors.
Can a breast tumor burst?
Phyllodes tumors are uncommon fibroepithelial breast tumors in which ruptures are extremely rare. There is a high index of suspicion for this tumor if a patient has a history of rapid-growth of breast mass.
Is a 2 cm breast lump big?
Cancers of exactly 2 cm in size occupy a special niche in breast oncology. That size is the one at which breast cancer is most commonly diagnosed (the “modal size”) and 2.0 cm marks the boundary between stage i and ii for node-negative breast cancers and between stage ii and iii for node-positive breast cancers.
What does a breast lump feel like?
What does a breast lump feel like? Breast tissue in and of itself can feel somewhat lumpy and sponge-like, so it can be hard to know if what you’re feeling is an actual lump or just normal breast tissue. “A breast lump will feel like a distinct mass that’s noticeably more solid than the rest of your breast tissue.
How do you know if a breast lump is serious?
A breast lump that’s painless, hard, irregularly shaped and different from surrounding breast tissue might be breast cancer. Skin covering the lump may look red, dimpled or pitted like the skin of an orange. Your breast size and shape may change, or you may notice discharge from the nipple.
Do breast lumps move?
Most lumps will be movable within the breast tissue on examination, but breast lumps typically do not “move” around the breast. However, sometimes a breast lump will be fixed, or stuck, to the chest wall.
Why Does My breast hurt when I press it?
This sensitivity is known as cyclic mastalgia or fibrocystic changes. Around 50 percent of all women over the age of 30 experience this. Right before your period starts, your breasts may feel especially tender if you press on them, or they may ache.
|
__label__pos
| 0.999991 |
Newtons unknown therios
Consequently, Felix Klein called it the "invariant theory of the Lorentz group" instead of relativity theory, and Einstein who reportedly used expressions like "absolute theory" sympathized with this expression as well.
A German mathematician proves that all of this is just bullshit anyway. Or, like, a million years. This view was challenged by Erich Kretschmannwho argued that every theory of space and time even including Newtonian dynamics can be formulated in a covariant way, if additional parameters are included, and thus general covariance of a theory would in itself be insufficient to implement a generalized relativity principle.
His methodology produced a neat balance between theoretical and experimental inquiry and between the mathematical and mechanical approaches. Again, he did not publish his calculations. Max Abraham subsequently sketched a theoretical explanation of Kaufmann's result in which the electron was considered as rigid and spherical.
On the other hand, relativity doesn't need such hypotheses, thus from a conceptual viewpoint, relativity is in fact simpler than Newtonian mechanics.
As in special relativity the aether concept is discarded, yet the main difference from relativity lies in the fact that the velocity of the light source is added to that of light in accordance with the Galilean transformation.
In summary, a sound mathematical and physical model of complete aether drag was never invented, consequently this theory was no serious alternative to relativity. What is the nature of exotic excitations in nuclei at the frontiers of stability and their role in stellar processes.
What astrophysical process is responsible for the nucleogenesis of these rare isotopes. Can the discrepancy between the curves be attributed to dark matter. What is the source of space roar. However, as been pointed out by Weyl, it's not possible to handle a rotating extended system as a rigid body neither in special nor in general relativity —so the signal velocity of an object never exceeds the speed of light.
Newton devoted the period from August to spring to this task, and the result became one of the most important and influential works on physics of all times, Philosophiae Naturalis Principia Mathematica Mathematical Principles of Natural Philosophyoften shortened to Principia Mathematica or simply "the Principia.
What mechanism explains the existence of the u. Principle of the constancy of the speed of light[ edit ] Some consider the principle of the constancy of the velocity of light insufficiently substantiated. Paradoxes relying on insufficient understanding of these facts were discovered in the early years of relativity.
Spherical objects like planets and stars act as if all of their mass is concentrated at their centre, and so the distance between objects should include their radius. The principles expounded by Newton were even applied to the social sciences, influencing the economic theories of Adam Smith and the decision to make the United States legislature bicameral.
Criticism of the theory of relativity
Perfect for those stoned out of their minds. Do gluons acquire mass dynamically despite having a zero rest masswithin hadrons. It was seen as a tendency to abstract theory building, connected with the loss of intuitive " common sense ".
List of unsolved problems in physics
It was characteristic for many philosophical critics that they had insufficient knowledge of the mathematical and formal basis of relativity, [A 34] which led to the criticisms often missing the heart of the matter. Universal Constants.
Newton (unit)
Zeitgeist is a German word that means literally “the spirit of the times.” It can also refer to a trend of thought and feeling during a period. It describes the general mood of a culture or society based on one or many influences coming from science, religion, art, politics, or even economics.
The newton (symbol: N) is the International System of Units (SI) derived unit of force. It is named after Isaac Newton in recognition of his work on classical mechanics, specifically Newton's second law of motion. See below for the conversion factors Definition.
Convert Tonnes to Newtons
One newton is the. Newton’s Second Law of Motion Problems Worksheet Newton’s Second Law of Motion, sometimes called the law of force and motion or law of acceleration, states that. Isaac Newton stands as the scholar who oversaw the transformation from Renaissance thought, still largely built around a religious framework, to a quest for knowledge without the need for God.
Home Essays Newtons unknown therios Newtons unknown therios Topics: Isaac Newton, Royal Society, Robert Hooke Pages: 4 ( words) Published: March 28, List of unsolved problems in physics. Jump to navigation Jump to search. Some of the major unsolved It is unknown how such a simple value comes about, and why it is the exact arithmetic average of the possible extreme values of 1/3 (equal masses) and 1 (one mass dominates).
Newtons unknown therios
Rated 3/5 based on 3 review
Isaac Newton - The foundation of theories of motion and gravity
|
__label__pos
| 0.929242 |
top of page
Frequently Asked Questions
How does Acupuncture work?
The overly simplified version is: the human body is a system of chemical reactions and electrical impulses. Acupuncture runs off of the electrical system when we insert the metal needles. Since humans are made up mostly of water, we make great conductors of electricity!
What is the difference between Acupuncture & Dry Needling?
Dry needling is not acupuncture. The two techniques vary dramatically in theory and in training & education. Dry needling is the insertion of a needle into an area of pain. Acupuncture is based on a theory of channels and is used for the diagnosis and treatment of systemic and/or pathological conditions.
6_edited.png
Do you accept insurance?
We can call to verify your coverage and check your benefits for you. However, we are considered out-of-network providers with most insurance companies. We always recommend that you verify your own benefits also to prevent misinformation.
2.png
Have a Question?
Send us a Message!
H2-24.jpg
bottom of page
|
__label__pos
| 0.999992 |
Open access peer-reviewed chapter
Capsular Polysaccharides Produced by the Bacterial Pathogen Burkholderia pseudomallei
By Shauna L. Reckseidler-Zenteno
Submitted: November 9th 2011Reviewed: May 23rd 2012Published: October 31st 2012
DOI: 10.5772/50116
Downloaded: 3484
1. Introduction
Polysaccharide capsules are structures found on the cell surface of a broad range of bacterial species. The polysaccharide capsule often constitutes the outermost layer of the cell, and therefore is often involved in mediating direct interactions between the bacteria and its environment. It is due to these interactions that polysaccharide capsules have been implicated as important virulence factors for many bacterial pathogens.
Bacterial extracellular polysaccharides (EPS) may be classified as either capsular polysaccharides (CPS), where the polysaccharide is intimately associated with the cell surface, or as slime polysaccharides, where the polysaccharide is loosely associated with the cell [1]. Differentiation between these forms is difficult since CPS may be released from the cell, giving the appearance of a slime polysaccharide [1]. In turn, distinguishing between CPS and other cell surface polysaccharides, such as O-antigenic moieties of lipopolysaccharide (LPS), may also be difficult, since CPS may be found associated with LPS [1].
Capsular polysaccharides are highly hydrated molecules that are over 95% water [2]. They are often linked to the cell surface of the bacterium via covalent attachments to either phospholipid or lipid-A molecules, although some CPS may be associated with the cell in the absence of a membrane anchor [1, 3]. Capsular polysaccharides can be either homo- or heteropolymers composed of repeating monosaccharides joined by glycosidic linkages [4]. The multiple hydroxyl groups present within each monosaccharide may be involved in the formation of the glycosidic bond, therefore, any two monosaccharides may be joined in a number of configurations, which leads to large structural diversity among CPS types. In the case of human pathogens, a large number of different capsule serotypes have been identified, and certain CPS or K-antigens have been associated with specific infections [4]. For example, the Escherichia coli K1 antigen, a homopolymer of α2,8-linked N-acetylneuraminic acid (NeuNAc), is the major cause of neonatal meningitis [5]. While bacterial species may demonstrate great structural diversity in synthesizing capsules, chemically identical capsular polysaccharides may also be synthesized by different bacterial species. The Neisseria meningitidis group B capsular polysaccharide is identical to the K1 polymer of E. coli, and the E. coli K18, K22, and K100 antigens have the same constituents and structure as the Haemophilus influenza serotype b capsule [6, 7]. The conservation of CPS types between bacterial species raises interesting questions regarding the evolution of capsules and the transmission and acquisition of capsule biosynthesis genes [4].
The genetic loci necessary for the production of bacterial capsules are primarily clustered at a single chromosomal locus, which allows for the coordinate regulation of a large number of genes that may be involved in both the biosynthesis and export of capsular polysaccharides [4, 1]. In most bacterial species, the capsule gene clusters demonstrate conserved genetic organization. The capsules of E. coli have been classified into four groups based on genetic organization and biosynthetic criteria and capsules of other bacteria may resemble these prototypes. Group 1 capsules include the E. coli K30 capsule and the capsules of Klebsiella sp. and Erwinia sp. [8]. Group 2 capsules include the E. coli K1 and K5 capsules, as well as the capsules produced by Neisseria sp. and Haemophilus sp. Group 3 capsules include the E. coli K10 capsule. Group 4 capsules include the capsules of E. coli K40 and 0111. Both group 2 and group 3 capsule gene clusters are organized into 3 regions. Regions 1 and 3 are involved in the export and modification of the capsular polysaccharides and are conserved between members of the group, while region 2 contains the genes responsible for the biosynthesis of the capsule and is usually serotype specific [4, 8]. Generally these regions are organized into one transcriptional unit and the regions within the capsule locus are divergently transcribed [4, 8]. In addition, some genes within a region may be translationally coupled, such as the kpsU and kpsC genes in group 2 E. coli capsules, and the kpsM and kpsT genes in group 3 E. coli capsules, which allows for balanced expression of two proteins [4].
The A+T composition of capsule gene clusters is often significantly higher than the rest of the chromosome, suggesting a common ancestry of capsule genes in gram-negative bacteria [9]. It is likely that these A+T rich regions have been horizontally transferred between bacterial species. In addition, the A+T ratio of region 2 DNA of group 2 E. coli capsule gene clusters compared to regions 1 and 3 confirms that capsule diversity has been achieved in part through the acquisition of different region 2 sequences [4].
The production of a polysaccharide capsule is widespread in pathogenic bacteria. A number of functions have been assigned to bacterial capsules including: prevention of dessication, adherence, resistance to non-specific host immunity, resistance to specific host immunity, and mediating the diffusion of molecules through to the cell surface [4, 1].
Capsules may form a hydrated gel around the surface of the bacterial cell, which may protect the bacteria from the harmful effects of dessication [10]. This may increase the survival of encapsulated bacteria outside of the host, promoting the transmission of pathogenic bacteria from one host to another [4]. Mucoid isolates of E. coli, Acinetobacter calcoaceticus, and Erwinia stewartii are more resistant to drying than isogenic nonmucoid strains [11]. Studies with E. coli have shown that the expression of genes encoding for the colanic acid capsule is increased by dessication [11]. In addition, alginate production by Pseudomonas aeruginosa is triggered by high osmolarity, which may be a consequence of dessication [12].
Capsular polysaccharides may promote adherence of bacteria to both surfaces and other bacterial cells, which may facilitate colonization of a particular niche and may lead to the formation of biofilms [13]. Cell-surface polysaccharides have been shown to mediate the attachment of bacterial cells to one another, leading to biofilm formation and persistence of the organisms during colonization [1, 14].
Capsular polysaccharides are one of the components responsible for resistance to the non-specific immunity of the host. The presence of a capsule is thought to confer resistance to non-specific host defense mechanisms such as complement and complement-mediated opsonophagocytosis [4]. Bacterial capsules may resist complement-mediated killing by providing a permeability barrier to complement components, which masks the underlying cell surface structures that activate complement [15]. The capsule may also act in concert with O-antigens to confer resistance to complement-mediated killing [16]. As a result, a combination of cell surface structures is responsible for conferring resistance to killing by the complement cascade [4]. Finally, capsules are responsible for resistance to complement-mediated opsonophagocytosis. This resistance may be due to steric effects, which results in the capsule acting as a barrier between the C3b deposited on the bacterial surface and the C3b receptors present on phagocytes [4]. Alternatively, the resistance to opsonophagocytosis may be due to the net negative charge of the polysaccharide capsule [17].
Capsules may also confer resistance to the specific immune response of the host. Although most capsular polysaccharides can elicit an immune response, some capsules are poorly immunogenic [4]. Examples of such capsules include those containing NeuNAc, such as the E. coli K1 capsule or the capsule of Neisseria meningitidis serogroup B, and the E. coli K5 capsule, which is similar to desulfoheparin [18, 19]. Because these capsules are structurally similar to polysaccharides encountered on host tissue, these capsules are poorly immunogenic, and elicit a poor antibody response in the host [20].
Burkholderia pseudomallei, the causative agent of melioidosis, is a gram-negative, facultatively anaerobic, motile bacillus that is commonly found in the soil and stagnant waters in a number of regions around the world, particularly in areas that fall between 20o north and 20o south of the equator [21, 22]. Infection by B. pseudomallei is often due to either direct inoculation into wounds and skin abrasions or to inhalation of contaminated material [22, 23, 24,]. This would explain the prevalence of the disease among rice farmers as well as helicopter pilots in the Vietnam War who developed melioidosis due to inhalation of contaminated dust [24]. Melioidosis may present as an acute pneumonia or an acute septicemia, which is the most severe form of the disease. The disease may also manifest as a chronic infection involving long-lasting suppurative abscesses in numerous sites in the body. Infection with B. pseudomallei may even result in a subclinical infection and remain undetected for a number of years. Both the chronic and subclinical forms generally remain undiagnosed until activated by a traumatic event or a decrease in immunocompetence [25]. B. pseudomallei is inherently resistant to a number of antibiotics, and even with aggressive antibiotic therapy, the mortality rate remains high, and the incidence of relapse is common [26, 27].
At the time our studies were initiated some cell-associated antigens had been identified and characterized in B. pseudomallei. Cell-associated antigens include exopolysaccharide (EPS) and lipopolysaccharide (LPS) [28, 29, 30]. The EPS produced by B. pseudomallei was determined to be an unbranched polymer of repeating tetrasaccharide units with the structure -3)-2-O-acetyl-β-D-Galp-(1-4)-α-D-Galp-(1-3)-β-D-Galp-(1-5)-β-D-KDOp-(2- [31, 32]. The role of EPS in virulence was not known, but sera from patients with melioidosis had been shown to contain antibodies against EPS [30]. Two other EPS structures were also identified; a branched 1,4-linked glucan polymer ((CP-1a) and a triple-branched heptasaccharide repeating unit composed of rhamnose, mannose, galactose, glucose, and glucuronic acid (CP-2) [33]. The genes involved in the synthesis of these capsules, and the role of these capsules in virulence had not been identified. The LPS of B. pseudomallei was structurally characterized and reported to contain two types of O-polysaccharide moieties termed type I O-PS and type II O-PS [34, 35]. Type II O-PS was found to be an unbranched heteropolymer with repeating D-glucose and L-talose residues with the structure -3)-β-D-glucopyranose-(1-3)-6-deoxy-α-L-talopyranose-(1-. Type II O-PS had been shown to be involved in serum resistance [36]. Type II O-PS mutants also demonstrated reduced virulence in three animal models of B. pseudomallei infection [36]. Type I O-PS was determined to be an unbranched homopolymer with the structure -3)-2-O-acetyl-6-deoxy-β-D-manno-heptopyranose-(1-, however, the role for this polysaccharide in infection had not been defined, nor the genes responsible for its biosynthesis been identified.
B. thailandensis is a nonpathogenic soil organism originally isolated in Thailand [37]. Based on biochemical, immunological, and genetic data, B. pseudomallei and B. thailandensis are closely related species. However, these two organisms differ in a number of ways and have been classified into two different species [38]. The rRNA sequence of B. thailandensis differs from that of B. pseudomallei by 15 nucleotides, and there are significant differences in genomic macrorestriction patterns between these organisms [39]. The biochemical profiles of these two species differ in that B. thailandensis can utilize L-arabinose whereas B. pseudomallei does not [38, 40]. The most distinct difference between these two species, however, is their relative virulence. The 50% lethal dose (LD50) for B. pseudomallei in the Syrian hamster model of acute melioidosis is <10 organisms, whereas the LD50 for B. thailandensis is approximately 106 organisms [38]. It has also been shown that the two species can be differentiated based on their propensity to cause disease in humans. Environmental strains isolated in Thailand that are able to assimilate L-arabinose are not associated with human infection, whereas clinical isolates are not able to utilize L-arabinose [41].
2. Subtractive hybridization to identify Capsular Polysaccharide 1 (CPS I)
To identify the genetic determinants that confer enhanced virulence in B. pseudomallei, a method combining subtractive hybridization, insertional mutagenesis, and animal virulence studies was developed [42]. Subtractive hybridization was carried out between the virulent B. pseudomallei and the weakly virulent B. thailandensis in order to isolate DNA sequences encoding for virulence determinants unique to B. pseudomallei. The genomic DNA sample from B. pseudomallei containing the sequences of interest was known as the tester DNA, and genomic DNA from B. thailandensis, the reference sample, was called the driver DNA. Tester and driver DNAs were digested and subjected to two rounds of hybridization. The remaining unhybridized sequences were considered tester-specific sequences. To enrich for tester-specific sequences, excess driver DNA was added in the hybridizations. The tester-specific sequences were then amplified by PCR and cloned into the plasmids pPCR or pZErO-2.1. Screening of the subtraction library revealed a number of DNA sequences unique to B. pseudomallei. Fifteen distinct plasmid inserts from the library were sequenced. The DNA inserts ranged from 100 to 800 bp in length and were found to contain an average G+C content of approximately 44 to 52%, which is considerably lower than the 68% G+C content of the B. pseudomallei chromosome. The DNA sequences were analyzed using the NCBI BLASTX program. One of the plasmid inserts, pDD1015, was found to share limited homology with WbpX, a glycosyltransferase, from Pseudomonas aeruginosa [43].
2.1. Demonstration that CPS I is important for the virulence of B. pseudomallei
The 373-bp DNA insert from pDD1015 was cloned into a mobilizable suicide vector, pSKM11 [44]. The resulting plasmid, pSR1015, was mobilized into wildtype B. pseudomallei 1026b to create the mutant strain SR1015. Since the insert from pDD1015 was found to demonstrate homology to a glycosyltransferase from P. aeruginosa, it was postulated that it might encode a protein involved in carbohydrate synthesis. Since three carbohydrate structures had been previously purified and characterized, antibodies to each of these polysaccharides were available. To define the phenotype of SR1015, an ELISA was performed with the EPS-specific monoclonal antibody 3015, and B. pseudomallei 1026b and SR1015 were both found to contain EPS [45]. SR1015 was also shown to contain type II O-PS and to be serum resistant. Immunogold electron microscopy studies using rabbit polyclonal sera specific for a type I O-PS–flagellin conjugate was performed on the parent strain, 1026b, and SR1015 (Figure 1). B. pseudomallei 1026b reacted with antibodies to both flagellin and type I O-PS, as was evident by the distribution of gold particles around the bacterial surface and extending out along the flagella (Figure 1A). Unlike B. pseudomallei 1026b, SR1015 reacted only with the antibodies to flagellin, as the gold particles were found associated only with the flagella (Figure 1B). B. thailandensis, the negative control, did not react with the antibodies either to flagellin or to type I O-PS (Figure 1C). B. stabilis LMG7000 was also shown to react to the antibodies to type I O-PS, indicating this organism may produce a similar capsule (Figure 1D). Western blot analysis of proteinase K-digested whole cells from B. pseudomallei 1026b, B. thailandensis E264, and B. pseudomallei SR1015 using rabbit polyclonal sera raised to O-PS–flagellin protein conjugate confirmed the lack of type I O-PS in SR1015. Type I and type II O-PS were stained in B. pseudomallei 1026b, while only type II O-PS was stained in the lanes corresponding to B. pseudomallei SR1015 and B. thailandensis. These results indicated that we had identified and insertionally inactivated a gene involved in the synthesis of the type I O-PS of B. pseudomallei [42]. SR1015 was tested for virulence in the Syrian hamster model of acute septicemic melioidosis. The LD50 for SR1015 after 48 h was 3.5 x 105 CFU, while the LD50 of the parent strain, 1026b, was <10 CFU. The LD50 for SR1015 was similar to that for the weakly virulent B. thailandensis (6.8 x 105 CFU) [42]. This demonstrated that SR1015 is severely attenuated for virulence in this animal model of melioidosis and that type I O-PS is a major virulence determinant of B. pseudomallei. We later determined that the type I O-PS was a capsular polysaccharide (CPS I), not an O-PS moiety, which will be discussed below.
Figure 1.
Immunogold electron microscopy of B. pseudomallei 1026b (A) and SR1015 (B), B. thailandensis E264 (C), and B. stabilis LMG7000 (D). Bacteria were reacted with polyclonal rabbit antiserum directed against an O-PS–flagellin protein conjugate absorbed with B. thailandensis E264 to remove the antibodies directed against type II O-PS, washed, and reacted with a goat anti-rabbit IgG-gold (5 nm) conjugate. Original magnification x330,000.
2.2. Cloning and sequencing of the genetic loci required for CPS I production and export
Two methods were used to clone the genes involved in the production and export of type I O-PS. The DNA flanking the insertion of pSR1015 was cloned from SR1015 and sequenced. We also used transposon mutagenesis to clone the genes involved in production of the polysaccharide; this was done to obtain any unlinked genes that may be involved in polysaccharide production. Approximately 1,300 transposon mutants were screened for loss of type I O-PS by ELISA. Six mutants were identified, and the DNA flanking the transposon insertion was cloned and sequenced. The Tn5-OT182 mutants SLR5, SLR8, SLR13, SLR18, and SLR19 mapped to the same region of the chromosome. Sequence analysis of the cloned fragments revealed the presence of 26 potential open reading frames involved in the synthesis and export of type I O-PS [42]. The open reading frames that predicted proteins involved in polysaccharide biosynthesis were found to demonstrate homology to proteins involved in the synthesis of a polysaccharide structure composed primarily of mannose. The other reading frames in the locus predicted proteins involved in the transport of capsular polysaccharides in a variety of bacteria, particularly those that produce group 2 and group 3 capsular polysaccharides [8]. The genes responsible for the production of type I O-PS were found to be similar to other loci encoding for capsular polysaccharides in that they are divergently transcribed [4]. The gene cluster involved in the production of this polysaccharide is also similar to group 3 capsule gene clusters in that there are no genes encoding KpsF and KpsU, which are present in group 2 capsule gene clusters [8]. However, the organization of the B. pseudomallei type I O-PS gene cluster differs in that it does not contain two export regions flanking a single biosynthetic region as seen in other group 3 capsule polysaccharide clusters [46]. The biosynthetic genes identified are not organized into one continuous transcriptional unit; instead, wcbB, manC, and wcbP are separated from the rest of the biosynthetic genes. The overall G+C content of this region is about 58%, lower than the G+C content of the rest of the chromosome (68%). The low G+C content in these clusters suggests that polysaccharide genes have a common origin and may have been transferred horizontally between species [9]. The genes involved in the production of this polysaccharide were named according to the bacterial polysaccharide gene nomenclature scheme [47]. The gene products associated with this cluster are shown in Figure 4. Mutations constructed in a number of these genes confirmed their role in the production of this polysaccharide [42].
2.3. CPS I was originally identified as a Type I O-polysaccharride moiety
The polysaccharide with the structure -3)-2-O-acetyl-6-deoxy-β-D-manno-heptopyranose-(1- was originally isolated and characterized as an O-PS component of LPS in B. pseudomallei and was designated type I O-PS [35]. However, our results suggested that this polysaccharide was a capsule rather than an O-PS moiety. The genes involved in the production of this capsule demonstrated strong homology to the genes involved in the production of capsular polysaccharides in many organisms, including N. meningitidis, H. influenzae, and E. coli. In addition, the export genes associated with this cluster are not associated with the previously characterized O-PS gene cluster [36]. Western blot analysis of proteinase K cell extracts and silver staining demonstrated that this polysaccharide has a high molecular mass (200 kDa) and lacks the banding pattern seen with O-PS moieties. Studies by our laboratory indicated that mutants in the production of the core oligosaccharide of the LPS are still capable of producing this polysaccharide [48]. Based on the above criteria and the genetic similarity to group 3 capsules, we proposed that this polysaccharide is a group 3 capsule and designated this capsule CPS I. This conclusion was further supported by Isshiki et al who separated this polysaccharide from a smooth lipopolysaccharide preparation of B. pseudomallei [49].
3. Role of the B. pseudomallei capsule in virulence
The role of CPS I in the pathogenicity of B. pseudomallei was investigated by performing further animal studies, serum bactericidal assays, complement protein C3b deposition assays, and radio-labelled phagocytic assays [50]. These experiments were facilitated by constructing a deletion strain harbouring a mutation in one of the CPS I genes and by complementation of this strain. An in-frame deletion was constructed in wcbB, a gene which encodes a glycosyltransferase, resulting in the capsule-minus strain SZ210. To confirm the role of wcbB in the biosynthesis of capsule, SZ210 was complemented by the introduction of a wild-type copy of the wcbB gene cloned into the mobilizable broad-host-range plasmid pBHR1 (MoBiTec). Western blot analysis of proteinase K-digested whole cells was performed using mouse monoclonal antibody directed to B. pseudomallei capsule to assess capsule production by these strains. Similar to the capsule minus strain SR1015 and B. thailandensis E264, which is known to lack this capsule, SZ210 was found to be negative for CPS I production, as indicated by the absence of a 200 kDa band that is present for wild-type 1026b. Complementation of SZ210 by providing the wild type wcbB gene in trans restored capsule production. Whole-cell extracts from the complemented strain SZ210(pSZ219) reacted to the capsule antibody producing the 200-kDa band corresponding to the B. pseudomallei capsule.
3.1. Production of CPS I correlates with clinical infection
To establish a correlation between CPS I production and clinical infection a number of strains of B. pseudomallei isolated from a variety of clinical specimens were tested for capsule production by western blot analysis with polyclonal rabbit antisera to B. pseudomallei CPS I. Out of the 55 clinical strains tested for capsule production, 52 were found to produce this capsule. Three strains, 420a, 415c, and 375a were found to be negative for capsule production, similar to B. thailandensis E264. However, one of the capsule genes, wzt2, was successfully amplified from these three strains and following inoculation in the animal model, all three of these strains were found to produce capsule by western blot analysis. This indicated that CPS I production may be regulated in some strains and its expression may be induced in vivo. Therefore all of the 55 clinical strains of B. pseudomallei tested were found to produce capsule, establishing a 100% correlation between CPS I production and clinical infection [51].
3.2. CPS I promotes survival of B. pseudomallei in vivo
Syrian golden hamsters were inoculated intraperitoneally with 101 to 105 cells of either wild type B. pseudomallei 1026b, capsule mutants SR1015 and SZ210, or the complemented strain SZ210(pSZ219). One group of animals inoculated with SR1015 also received 100 µg of purified B. pseudomallei capsule. After 48 h, the LD50 values were calculated, and the blood of the infected animals was diluted and plated for bacterial quantitation. The addition of purified capsule significantly increased the virulence of the capsule mutant strain SR1015. The LD50 value was calculated to be 34 CFU, similar to the LD50 value of wild-type B. pseudomallei 1026b (<10 CFU). In contrast, the LD50 value for SR1015 without the addition of purified capsule was calculated to be 3.5 x 105 CFU, 10,000- fold higher than when capsule was added to the inoculum. In addition, purified capsule enhanced the survival of SR1015 in the blood. Bacteria could not be detected in the blood of hamsters inoculated with SR1015 alone. However, the number of SR1015 CFU recovered from the blood of infected animals was 9.0 x 102 CFU/ml when capsule was added to the inoculum, an almost-1,000-fold increase. This number was comparable to the number of wild-type B. pseudomallei 1026b bacteria recovered from the blood. The addition of capsule was not toxic to the hamsters, as hamsters inoculated with 100 µg of purified capsule alone survived for the duration of the experiment without any ill effects. The LD50 value for the capsule mutant strain SZ210 containing an in frame deletion of the wcbB gene was calculated to be 9.6 x 104 CFU, and the number of bacteria in the blood was determined to be 10 CFU/ml. Complementation of this strain restored virulence in the animal model, resulting in an LD50 value of 12 CFU, comparable to that of wild type B. pseudomallei 1026b. Furthermore, the number of bacteria in the blood of animals infected with the complemented strain, SZ210(pSZ219), was determined to be 4.9 x 105 CFU/ml, similar to the number of bacteria recovered from animals infected with 1026b [50].
To further demonstrate the role of the capsule in infection by B. pseudomallei, an experiment was designed to investigate differences in tissue distribution between the capsule mutant strain and the wild type in infected hamsters. Animals were inoculated with 102 CFU of either wild-type B. pseudomallei 1026b or the capsule mutant SR1015. At different time points, the animals were sacrificed, and the numbers of bacteria in the blood, liver, lungs, and spleen of each animal were determined. As seen in Figure 2, the numbers of B. pseudomallei 1026b and SR1015 bacteria were nearly undetectable at 12 h (Figure 2A). By 24 h, the numbers of 1026b bacteria recovered from the blood, lung, liver, and spleen increased, while SR1015 was detected only in the spleen (Figure 2B). By 48 h, very high numbers of 1026b bacteria were recovered from all of the organs taken, representing a dramatic increase compared to the inoculum (Figure 2C). In contrast, all of the organs taken from hamsters infected with SR1015 contained fewer bacteria (Figure 2C). Of particular interest was the fact that the number of SR1015 bacteria recovered from the blood at 48 h was lower than in the inoculum, suggesting that the capsule mutant was cleared from the blood more effectively than the wild type. The number of SR1015 bacteria recovered from the spleen was higher than the number of SR1015 bacteria in the blood, suggesting that SR1015 was being cleared from the blood and sequestered in the spleen. The difference in virulence between the two strains can be attributed to capsule production, since the CPS I mutant strain was found to have a growth rate similar to that of the wild-type strain 1026b [50].
Figure 2.
Differences in tissue distribution between B. pseudomallei strains 1026b and SR1015 in the Syrian hamster model of acute melioidosis. Female Syrian hamsters (three per group) were inoculated intraperitoneally with 102 CFU of either strain, and at 12, 24, and 48 h, two groups of animals were sacrificed and bacterial quantitation of the tissues was determined. The data represent the average number of bacteria found in each tissue and the standard deviation for a given time point.
3.3. CPS I production by B. pseudomallei is responsible for persistence in the blood by inhibiting complement
To define the role of the capsule for persistence in the blood, serum bactericidal assays were performed with the addition of purified capsule to determine if capsule had an effect on the survival of serum-sensitive strains of B. pseudomallei. For these experiments, we utilized a double mutant that we constructed in the laboratory, SLR5, which lacks both capsule and O-polysaccharide, since the capsule mutant SR1015 was previously found to be serum resistant [42]. The survival of SLR5 was extremely poor when incubated in the presence of 30% normal human serum (NHS). However, the addition of purified capsule increased the survival of SLR5 in NHS. The addition of 50 µg of capsule to the reaction increased the numbers of SLR5 to 5.9 x 101 CFU/ml, and the addition of 100 µg of capsule increased the survival of SLR5 by nearly 1,000-fold to 1.9 x 103 CFU/ml. Furthermore, pre-incubation of 30% NHS with 100 µg of capsule (PI-CPS) before the addition of bacteria increased the survival of SLR5 100,000-fold to 4.4 x 106 CFU/ml. This was similar to the survival of SLR5 when incubated with serum that was heat-inactivated (HI-NHS). These effects were found to be specific to capsule, since the addition of 50 or 100 µg of purified B. pseudomallei O-PS or preincubation of the serum with O-PS did not increase the survival of serum-sensitive SLR5 [50].
Since capsule mutants of B. pseudomallei are serum resistant in that they are not susceptible to lysis by the membrane attack complex (MAC) because they still produce O-PS, we postulated that the ability of the capsule to enhance survival in the blood could be due to its ability to inhibit C3b deposition and opsonization. To investigate the effect of capsule on C3b deposition, the amount of C3b deposited on the surfaces of wild-type B. pseudomallei 1026b and the capsule mutant, SR1015, in the presence of serum was determined by Western blot analysis using a mouse monoclonal antibody specific to human complement factor C3b. The deposition of C3b was found to be more pronounced in the capsule mutant SR1015 than in the wild type in both 10 and 30% NHS. Similar results were observed with the capsule mutant SZ210, a strain containing an in-frame deletion of the wcbB gene. More C3b was detected when SZ210 was incubated in both 10 and 30% NHS than with 1026b. Optical densitometry measurements were performed in order to quantitate the difference in C3b deposition between the strains. The average amount of C3b deposited on the surfaces of SR1015 and SZ210 bacteria was 3.5-fold higher than for 1026b in 10% NHS and 2.5-fold higher in 30% NHS. In addition, there was a shift in the molecular mass of C3b, which normally runs at 185 kDa, indicating a covalent attachment of the molecule to the bacterial surface. The nature of this attachment was not investigated; however, C3b is thought to covalently attach to the bacterial surface through an ester or amide linkage [50, 52].
Immunofluorescence microscopy analysis was also performed to demonstrate the difference in C3b deposition between the capsule mutant and the wild type. The same experiment described above was performed, and samples were reacted with the mouse monoclonal antibody to human complement factor C3b, except that the samples were reacted with a secondary antibody conjugated to Cy3 and stained with DAPI for visualization of bacterial cells. As shown in Figure 3, the B. pseudomallei capsule mutant SR1015 demonstrated more reactivity to the antibody to human C3b in the presence of serum than the wild-type 1026b. This is evident from the red fluorescence that corresponds to the C3b bound to the bacterial surface surrounding the blue DAPI-stained cells seen when the capsule mutant was incubated in the presence of 10% NHS (Figure 3D to F). In contrast, the amount of red fluorescence surrounding the DAPI-stained wild-type cells was minimal in the presence of 10% NHS (Figure 3A to C). There was a dramatic difference in the amount of C3b deposited on the surface of the capsule mutant compared to the wild type, which was detectable after only 15 min of incubation of the bacteria with human serum (Figure 3B and E). By 60 min, there was some C3b deposition on wild-type B. pseudomallei; however, there was still more C3b deposited on the surface of the capsule mutant (Figure 3C and F) [50]. This experiment was not performed with 30% NHS due to excessive clumping of the samples during the fixation process, which resulted in inconsistent and poor staining of the cells. Western blot analysis was also performed to determine the amount of complement factor C3b deposition on the surface of B. thailandensis E264, a related nonpathogenic organism. The amount of C3b deposition in B. thailandensis E264 was more pronounced than with B. pseudomallei 1026b and was similar to the amount of C3b deposited on the surface of the capsule mutant, B. pseudomallei SR1015, in the presence of human serum. The amount of C3b deposition that occurred on the surface of B. thailandensis was expected, since the organism is known to lack this capsule [42, 50].
Figure 3.
Immunofluorescence microscopy analysis of decreased complement factor C3b deposition in 10% normal human serum by B. pseudomallei capsule. B. pseudomallei 1026b and SR1015 were incubated in 10% normal human serum (NHS), reacted with a mouse monoclonal antibody to human complement factor C3b, reacted with a rabbit anti-mouse IgG conjugated to Cy3 (Jackson Laboratories), and stained with DAPI for visualization of whole bacterial cells (Sigma). (A) B. pseudomallei 1026b incubated in PBS; (B) 1026b incubated in 10% NHS for 15 min; (C) 1026b incubated in 10% NHS for 60 min; (D) B. pseudomallei SR1015 incubated in PBS; (E) SR1015 incubated in 10% NHS for 15 min; (F) SR1015 incubated in 10% NHS for 60 min. The blue fluorescence indicates the DAPI stained bacteria, and the red fluorescence indicates the binding of complement factor C3b to the bacterial surface.
3.4. The B. pseudomallei capsule CPS I reduces phagocytosis
The capsule mutant SR1015 was phagocytosed more significantly by PMNL than the wild-type strain. The proportion of wild-type B. pseudomallei 1026b phagocytosed in the presence of 10% NHS was 35.9%, while the proportion of the capsule mutant SR1015 phagocytosed was 51.7% (P < 0.001). When each strain was incubated in the presence of 30% NHS, 59.3% of the wild-type strain 1026b was phagocytosed by the PMNL after 30 min compared to 82.3% for the capsule mutant (P < 0.001) [50].
3.5. B. pseudomallei CPS I expression is elevated in the presence of 30% normal human serum
The lux reporter strain B. pseudomallei SZ211 was constructed by cloning an internal fragment of the wcbB gene into pGSV3-lux, a suicide vector containing the lux operon from Photorhabdus luminescens [53]. Absorbance (OD540) and luminescence (in relative light units) measurements were taken every 2 h. Capsule expression was higher in the presence of M9 plus 1% glucose plus 30% normal human serum (NHS) and M9 plus 1% glucose plus 30% heat-inactivated serum (HI-NHS) than in M9 plus 1% glucose alone. The increase in light production of SZ211 in the presence of serum supports the requirement for capsule for survival in serum. The strain B. pseudomallei SZ213 was constructed by cloning an internal region of the wbiA gene, which encodes an O-acetyltransferase required for O-acetylation of the O-PS component of B. pseudomallei LPS [36]. Light production of this strain was measured under the same conditions to determine whether LPS expression was induced in the presence of serum. Similar to the capsule, LPS expression was elevated in the presence of both 30% NHS and 30% HI-NHS. The levels of expression of both capsule and LPS were not significantly different in NHS and HI-NHS, suggesting that the environment of the serum may be required for induction of gene expression rather than complement [50].
4. Other capsules produced by B.pseudomallei
Sequence analysis of the completed genome of B. pseudomallei revealed four operons with the predicted function of capsular polysaccharide biosynthesis and export [54]. One of these operons, with the gene identifiers BPSL2786-2810, corresponds to the previously characterized mannoheptose capsule designated CPS I [42, 50]. Three other operons were identified. These three capsule operons in the genome of B. pseudomallei were further analyzed using the BLAST program and Artemis. The operons are illustrated in Figure 4. The operon consisting of the genes BPSS0417-0429, was designated CPS II (Figure 4B). Another operon, BPSS1825-1835, was designated CPS III and the predicted homologues were investigated further (Figure 4C). A fourth operon, CPS IV, was found to contain genes that may be involved in the synthesis of a capsule with the gene identifiers BPSL2769-2785 (Figure 4D) [54, 55].
Figure 4.
Organization of the chromosomal regions containing the genes comprising the B. pseudomallei capsule operons. The direction of transcription is represented by arrows, and the gene names demonstrating the highest degree of homology to the B. pseudomallei open reading frames are indicated. The relative sizes of each locus are indicated. (A) B. pseudomallei capsule cluster I (CPS I). (B) B. pseudomallei capsule cluster II (CPS II). (C) B. pseudomallei capsule cluster III (CPS III). (D) B. pseudomallei capsule cluster IV (CPS IV).
4.1. Distribution of capsule loci between three Burkholderia species
Comparative analysis of the genomes of three Burkholderia species, B. pseudomallei, B. mallei and B. thailandensis, was performed to determine whether all of the predicted B. pseudomallei capsule operons were present in B. mallei and B. thailandensis as well. CPS II, III, and IV were found to be present in B. pseudomallei and B. thailandensis, but not B. mallei. This is in contrast to CPS I, which is present in B. pseudomallei and B. mallei, but not B. thailandensis [42, 50, 54, 55, 56, 57]. CPS II was found to be identical between B. pseudomallei and B. thailandensis, but B. thailandensis was found to contain two flanking hypothetical genes not present in B. pseudomallei. The CPS II genes were found to be deleted entirely from B. mallei. A large chromosomal region ranging from open reading frames BPSS0404 to BPSS0491 including CPS II was shown to be deleted in B. mallei compared to B. pseudomallei and replaced with a large chromosomal region containing open reading frames BMAA0555 (IS407A orfB) to BMAA1784, a unique hypothetical protein not found in B. pseudomallei. The two genomes align with the presence of the alkyl hydroperoxidase reductase genes ahpC and ahpF, but these are organized in the opposite orientation in B. mallei compared to B. pseudomallei. The entire CPS III operon and flanking genes were shown to be the same in both B. pseudomallei and B. thailandensis. In contrast, the majority of the CPS III cluster was deleted from B. mallei with the exception of the wcaJ and manC genes, as well as the two flanking hypothetical genes on one side, and another hypothetical gene on the other side of the deleted region. The deletion of the CPS III genes in B. mallei was found to be replaced with the IS407A orfA and orfB genes. The entire CPS IV region was found to be replaced in B. mallei and flanked by two IS407A elements. The open reading frame BPSL2785, which encodes a hypothetical protein, is present in B. mallei (BMA2284.1) ATCC 23344 as well as a number of other B. mallei strains, but is organized in the opposite orientation. The genomes of B. pseudomallei, B. thailandensis, and B. mallei all diverge upstream of the CPS IV region, but all three organisms were found to align at the location of the ompA and hypothetical genes [55].
4.2. CPS III does not contribute to the virulence of B. pseudomallei
In order to assess the role of CPS III in virulence a mutant in the CPS III operon was tested for virulence compared to wild type B. pseudomallei in the Syrian hamster model of melioidosis. Syrian golden hamsters were inoculated intraperitoneally with 101 to 103 cells of either wild-type B. pseudomallei 1026b or the capsule mutant SZ1829. After 48 h, the LD50 values were determined. SZ1829 had LD50 values of <10 CFU, identical to that of wild type B. pseudomallei, indicating that this capsule is not required for virulence. In addition, the bacterial load in the blood of the infected hamsters was similar to that of wild-type and significantly higher than that of the non-pathogenic B. thailandensis E264 and the CPS I mutant, B. pseudomallei SR1015, both of which are incapable of establishing bacteremia [37, 50]. This indicates that CPS III does not contribute to persistence in the blood. Similar results were obtained for CPS II and CPS IV mutants, but we went on to further characterize CPS III.
4.3. Expression of CPS III in host and environmental conditions
A lux reporter strain was constructed in the CPS III operon by cloning an internal fragment of one of the genes into pGSV3-lux, a suicide vector containing a promoterless lux operon from Photorhabdus luminescens [53]. Regulation of this capsule in an environment similar to that encountered in the host was determined by growing the lux reporter strain, SZ1829, in the presence of M9 plus 1% glucose versus M9 plus 1% glucose plus 30% normal human serum (NHS). Absorbance (OD540) and luminescence (in relative light units) measurements were taken every hour. The expression of CPS III (SZ1829) was higher in M9 plus 1% glucose alone compared to M9 plus 1% glucose plus 30% NHS. The expression of SZ1829 was 3-4 fold lower in 30% NHS. This was in contrast to the expression of CPS I (SZ211) (see section 3.5), which was significantly more highly expressed in 30% NHS at a level of 3-4 fold compared to growth in M9 plus 1% glucose alone [55]. Although CPS III demonstrated higher expression initially in 30% NHS, this may have been due to the fact that the addition of NHS caused precipitation in the media which affected the optical density of the cultures.
The expression of the lux operon in reporter strains SZ211 (CPS I-) and SZ1829 (CPS III-) was also measured in water to determine whether CPS III was induced in this environment. Overnight cultures of SZ211 and SZ1829 were inoculated into sterile water and incubated at 37oC without shaking. Capsule expression was determined as described above, but the luminescence/absorbance calculations for water were compared to the values for these strains when grown in LB. CPS III was found to be induced in water compared to LB. The expression of SZ1829 was found to be significant with an increase of 2-3 fold over the course of the experiment. The expression of CPS I was found to be greater than 4 fold higher in LB compared to water [55].
Microarray analysis of capsule expression was performed using a low-density DNA microarray. RNA was isolated from the livers and lungs of hamsters infected with B. pseudomallei and from B. pseudomallei grown in LB. The results of the microarray experiment are shown in Table 1 [55]. The level of gene expression, or fold change, is represented as the ratio of gene expression in the hamster compared to growth in LB. As shown in Table 1, CPS III genes were not found to be significantly expressed in vivo since most of the fold changes were determined to be less than 2-fold. Many of the genes had negative fold change values, indicating that these genes are suppressed in the host environment. The highest fold change result was 2.337866 for BPSS1827, a predicted glucose-6-phosphate isomerase, which is still much lower than the fold changes observed for CPS I genes, which were significantly higher [58].
Gene IDPredicted functionFold Change
(in vivo vs. in vitro)
BPSS1825Glycosyltransferase1.757155
BPSS1826Glycosyltransferase0.093565
BPSS1827Glucose-6-phosphate isomerase2.337866
BPSS1828Glycosyltransferase-0.66607
BPSS1829Glycosyltransferase-0.18061
BPSS1830Capsule export, tyrosine-protein kinase-0.30655
BPSS 1831Capsule export, outer membrane protein0.725849
BPSS1832Transport, tyrosine-protein phosphatase1.52665
BPSS1833UDP-glucose-6-dehydrogenase-0.71411
BPSS1834Sugar transferase-0.07963
BPSS 1835Mannose-1-phosphate guanyltransferase-0.75075
Table 1.
Microarray analysis of B. pseudomallei CPS III expression following intraperitoneal inoculation in the hamster model of melioidosis.
4.4. Carbohydrate composition of CPS III
Glycosyl composition analysis was performed on the purified capsule by combined gas chromatography/mass spectrometry (GC/MS). GC/MS results indicated that CPS III is composed of galactose, glucose, mannose, xylose, and rhamnose residues, with the highest proportion of carbohydrate being galactose and glucose. Glycosyl linkage analysis was also performed [55]. The predominant glycosyl residue detected was a terminally-linked heptopyranosyl (t-Hep) at a percentage of 23.2. Other residues detected were a terminally-linked and a 4-linked glucopyranosyl (t-Glcp) (4-Glcp) at percentages of 14.6 and 10.8, respectively [55].
5. Conclusion
Although significant advances have been made in the field, melioidosis continues to be a public health concern in many regions of the world [59]. Completion of the sequencing of the B. pseudomallei genome has revealed potential virulence determinants and comparative genomics between the genomes of B. pseudomallei, B. thailandensis, and B. mallei species has contributed to a better understanding of the organism. Further studies are ongoing to define the pathogenesis of B. pseudomallei and to identify effective vaccine candidates and diagnostic targets [54, 59].
To obtain virulence determinants unique to B. pseudomallei, we used subtractive hybridization between this organism and a related nonpathogenic organism, B. thailandensis. Analysis of the subtractive hybridization library revealed that B. pseudomallei contains a number of DNA sequences that are not found in B. thailandensis. One of the subtraction clones, pDD1015, demonstrated weak homology to a glycosyltransferase, WbpX, from P. aeruginosa [43]. The insert from pDD1015 was cloned into a mobilizable suicide vector for insertional inactivation of the glycosyltransferase gene in wild-type B. pseudomallei. The resulting strain, SR1015, was markedly less virulent than the parent strain in an animal model. We determined that SR1015 harbored a mutation in a glycosyltransferase gene involved in the production of a capsular polysaccharide which we subsequently designated as CPS I. We then identified the operon involved in the biosynthesis and transport of this capsular polysaccharide (CPS I) [42]. The genes identified encode for proteins that are similar to proteins involved in the biosynthesis and export of capsular polysaccharides, particularly those involved in the production of group 3 capsular polysaccharides. Group 3 capsules include the E. coli K10 capsule and may also include the H. influenzae group b capsule and the capsule produced by N. meningitidis serogroup B [8]. Group 3 capsules are always coexpressed with O serogroups, are not thermoregulated, are transported by an ABC-2 exporter system, and do not contain the kpsU and kpsF genes, and usually the gene clusters map near the serA locus [8]. Thus far, no serA locus that is associated with the type I O-PS cluster was identified, but this polysaccharide is coexpressed with O antigen and lacks the kpsU and kpsF genes, and genes encoding for a putative ABC-2 transporter have been identified. The genes involved in the production of group 3 capsules are organized into regions and are divergently transcribed. Regions 1 and 3 are generally conserved and contain genes involved in export of the polysaccharide. These regions flank region 2, which contains the biosynthetic genes and is not conserved between serotypes [4]. The genetic organization of the CPS I is also similar to that of other capsule gene clusters in that the genes are organized into more than one transcriptional unit and appear to be divergently transcribed [42].
The polysaccharide with the structure -3)-2-O-acetyl-6-deoxy-β-D-manno-heptopyranose-(1- was originally isolated and characterized as an O-PS component of LPS in B. pseudomallei and was designated type I O-PS [35]. However, our results suggested that this polysaccharide is a capsule rather than an O-PS moiety. The genes involved in the production of this capsule demonstrated strong homology to the genes involved in the production of capsular polysaccharides in many organisms, including N. meningitidis, H. influenzae, and E. coli. In addition, the export genes associated with this cluster are not associated with the previously characterized O-PS gene cluster [36]. Western blot analysis of proteinase K cell extracts and silver staining showed that this polysaccharide has a high molecular mass (200 kDa) and lacks the banding pattern seen with O-PS moieties. This conclusion was further supported by another group of researchers that demonstrated this polysaccharide is a capsule rather than an O-PS component of LPS because it lacks a lipid A moiety and was not capable of macrophage activation [49]. Studies by our laboratory have indicated that mutants in the production of the core oligosaccharide of the LPS are still capable of producing this polysaccharide [48]. Based on the above criteria and the genetic similarity to group 3 capsules, we proposed that this polysaccharide is a capsule.
Virulence genes of a number of pathogenic bacteria are located on pathogenicity islands (PAIs), regions on the bacterial chromosome that are present in the genome of pathogenic strains but rarely present in those of nonpathogenic strains. The PAIs may range in size from about 30 kb to 200 kb and often differ in G+C content from the remaining bacterial genome; the PAIs are often associated with the carriage of many virulence genes. These genetic units are often flanked by direct repeats and may be associated with tRNA genes or insertion sequence (IS) elements at their boundaries. They may also be associated with the presence of mobility genes, such as IS elements, integrases, transposases, and origins of plasmid replication. These DNA regions are considered to be unstable in that they may be subject to deletion with high frequency or undergo duplications and amplifications [7]. A number of PAIs have been described for both gram-positive and gram-negative bacteria, and the application of subtraction hybridization has been used to successfully identify such genetic elements [7]. The subtractive hybridization that was carried out between B. pseudomallei and B. thailandensis led to the identification of a number of sequences that were found to be A-T rich compared to the rest of the B. pseudomallei chromosome. This, combined with the fact that insertional mutagenesis of the glycosyltransferase gene identified by this method resulted in an avirulent strain, suggests that we may have identified DNA sequences from a putative PAI and that the capsular polysaccharide gene cluster may be located on this island. It is possible that B. pseudomallei, B. mallei, and B. stabilis acquired DNA encoding for capsule as well as other potential, yet unidentified virulence factors by horizontal transfer recently in evolution. B. pseudomallei and B. mallei are known to contain IS elements that are present in B. cepacia but not in B. thailandensis [56, 60].
Capsule production has been correlated with virulence in many bacteria, particularly those causing serious invasive infections of humans [61]. Our studies demonstrated that CPS I is critical for the virulence of B. pseudomallei [42, 50]. A number of functions have been suggested for polysaccharide capsules: prevention of desiccation for transmission and survival, adherence for colonization, resistance to complement-mediated phagocytosis and complement-mediated killing, and resistance to specific host immunity due to a poor antibody response to the capsule [4].
To establish a correlation between capsule production and clinical infection a number of B. pseudomallei strains isolated from clinical specimens were tested for CPS I production. All 55 strains tested were found to produce CPS I by western blot analysis [51]. In addition 10 strains of B. thailandensis were tested and found negative for CPS I production, confirming the importance of CPS I in virulence as well as clinical infection.
CPS I production by B. pseudomallei was shown to contribute to the persistence of the organism in the blood of the host. All CPS I mutants tested in the animal model could not be isolated from the blood following infection. The addition of purified capsule was shown to increase the virulence of the CPS I mutant strains SR1015 and SZ210 in the animal model. Differences in tissue distribution between wild type B. pseudomallei and SR1015 in infected hamsters indicated that SR1015 was cleared from the blood because the numbers of SR1015 in the blood of infected hamsters was 10,000-fold lower than that of wild type 1026b and lower than the initial inoculum of 100 cfu/ml [50].
CPS I production was shown to be responsible for persistence in the blood by evasion of the complement cascade and the mechanism for this was determined to be through the reduction of C3b deposition and opsonophagocytosis. The addition of purified CPS I to serum bactericidal assays showed that the capsule contributes to increased resistance of serum sensitive strains lacking the O-polysaccharide moiety (O-PS) of LPS to the bactericidal effects of normal human serum. However, CPS I mutants themselves were not found to be serum sensitive because they still produced O-PS, which was previously shown to be responsible for serum resistance, because it prevents lysis by the MAC complex [36]. This led us to postulate that CPS I was affecting the complement cascade through some other mechanism and it was found that this mechanism was through the reduction of C3b deposition and opsonization [50]. Both Western blot analysis and immunofluorescence microscopy experiments using a mouse monoclonal antibody to human C3b demonstrated the inhibition of C3b deposition by CPS I. In both experiments C3b deposition was more pronounced on the surface of the CPS I mutant compared to wild type. Also evident was that some C3b deposition occurred in the wild type, but this was expected since bacterial capsules are known to allow the diffusion of some C3b to the bacterial surface and B. pseudomallei is capable of activating the alternative pathway of complement culminating in the formation of the MAC complex [36, 62]. The accumulation of C3b affects the amplification step of the complement cascade and therefore, the less C3b deposited the less C5a is generated for phagocyte recruitment [63]. This explains the increased clearance of CPS I mutants from the blood. This conclusion was supported by the fact that B. thailandensis, the non-pathogenic organism which lacks CPS I, has been shown to be serum resistant, but is not capable of establishing a bacteremia in the Syrian hamster model of acute melioidosis [36, 37, 42]. Effective opsonization of invading bacteria results in enhanced phagocytosis and clearance of organisms form the blood of an infected host [52]. Quantitative radiolabelled phagocytic assays were also performed to establish a correlation between opsonization of the bacteria and phagocytosis by polymorphonuclear leukocytes. In the presence of serum, the CPS I mutant was more readily phagocytosed than wild type [50].
The expression of CPS I in the presence of normal human serum was found to be significantly elevated, also confirming that this capsule contributes to survival in the host. The presence of CPS I enables B. pseudomallei to survive in the blood through the inhibition of complement factor C3b deposition and phagocytosis [50]. The presence of this capsule facilitates survival as well as spreading to other organs, which can explain the overwhelming septicemia that is common in culture-positive melioidosis patients [64]. Therefore CPS I production is critical to the virulence of B. pseudomallei and further research will enhance the development of preventative strategies for melioidosis since this polysaccharide is one of the components of a B. pseudomallei subunit vaccine [28, 65].
Sequence analysis of the genome of B. pseudomallei revealed the presence of four operons possibly involved in polysaccharide capsule biosynthesis. One of these operons, (CPS I), corresponded to the previously identified and characterized mannoheptose capsule that was shown to be responsible for virulence and comprises one of the currently proposed melioidosis and glanders subunit conjugate vaccine [28, 66, 42, 50, 67]. The CPS I capsule cluster is present in the genome of B. mallei as well, but the complete cluster is not found in the genome of B. thailandensis [56, 57, 68]. This correlates with previous studies that have shown that this capsule is produced by B. mallei, but not by B. thailandensis [36, 37, 42, 56].
Three other putative capsule operons were identified by sequence analysis and all of these operons were found to be present in B. pseudomallei and B. thailandensis, but not B. mallei. Since these capsules are found in B. thailandensis and B. pseudomallei, they may be required for either survival in the host or in the environment; however, further studies are required to determine the roles of CPS II and CPS IV.
CPS III, located on chromosome 2, was found to contain 11 genes involved in the biosynthesis of a polysaccharide and was shown to be present in the genomes of B. pseudomallei and B. thailandensis, but not B. mallei. A mutation in the CPS III cluster did not affect production of CPS I and so it can be concluded that this operon encodes for gene products responsible for the biosynthesis of a separate capsule. CPS III was not found to contribute to the pathogenesis of B. pseudomallei. This capsule was not shown to be highly expressed in vivo by microarray analysis and was not required for virulence in the animal model. The CPS III mutant, SZ1829, which contains a mutation in the BPSS1829 gene as a result of insertional inactivation, was found to be as virulent in the animal model as wild type B. pseudomallei. The expression of this capsule was shown to be elevated when incubated in water, but suppressed in the presence of normal human serum [55]. The presence of the CPS III cluster in B. pseudomallei and B. thailandensis, both of which can survive for long periods in the environment compared to B. mallei, the increased expression of this capsule in water, and the low level of expression of this capsule in vivo, suggests that this capsule may contribute to the survival of B. pseudomallei in the environment [69].
Previous studies have demonstrated that B. pseudomallei produces three other capsular polysaccharides in addition to CPS I and these have been structurally characterized. One is an acidic polysaccharide with the structure, -3)-2-O-acetyl-β-D-Galp-(1-4)-α-D-Galp-(1-3)-β-D-Galp-(1-5)-β-D-KDOp-(2-, which is recognized by patient sera [32]. The other two are: a branched 1,4-linked glucan polymer ((CP-1a) and a triple-branched heptasaccharide repeating unit composed of rhamnose, mannose, galatose, glucose, and glucoronic acid (CP-2) [49]. Combined GC/MS analysis of CPS III revealed that the composition of this capsule demonstrates some similarity to the composition of the previously described capsule CP-2 composed of rhamnose, mannose, galactose, glucose, and glucoronic acid; however, the proportions of carbohydrate residues were not similar, and the CPS III capsule was also found to contain xylose and not glucoronic acid. In addition, CPS III was determined to be composed primarily of heptose [55]. Therefore it is evident that the capsule identified in this study is not one of the previously described capsule structures. Some of the previously characterized capsules produced by B. pseudomallei have been shown to be produced under unique conditions [32, 49]. Strain variation, differences in expression of the capsules, and discrepancies between purification strategies may also explain why a number of capsules have been shown to be produced by this organism. Nevertheless, the genes BPSS 1825-1835 appear to be involved in the biosynthesis of a capsule with this composition. Further analysis by 2D NMR would be required to definitively establish a connection between CPS III and one of the other published structures.
Studies by another laboratory have also focused on the presence of these capsule clusters in B. pseudomallei. Sarkar-Tyson et al. identified two polysaccharide clusters, one of which corresponds to the CPS III presented in this paper, but the authors identified this cluster as type IV O-PS (2007). The type IV O-PS was found to be involved in virulence in a mouse model [70]. However, a mutant in this polysaccharide did not demonstrate any difference in hydrophobicity compared to wild-type, indicating that this polysaccharide does not contribute to making the cell surface more hydrophobic, which is an advantageous characteristic for some pathogenic bacteria. The differences in virulence compared to the current work can be attributed to the use of different animal models; however, all other data seem to indicate that this capsule is not required for virulence.
A study was recently published which outlines the identification of another capsule produced by B. pseudomallei [71]. This capsule was determined to be composed of 1,3-linked α-D-mannose residues. This capsular polysaccharide was also found to be produced by B. mallei. The genes involved in the synthesis of this polysaccharide have not yet been identified and work is also underway to determine the role for this novel capsule in the pathogenesis of melioidosis and glanders.
B. pseudomallei is an environmental saprophyte often found in soil and stagnant water and incidence of the disease is high in rice farmers in Southeast Asia [22, 69]. This organism harbors a large genome which explains its ability to survive for long periods of time in the environment as well exist as a significant pathogen in both humans and animals. The presence of multiple polysaccharide clusters in the genome and the production of multiple capsule structures under differing conditions may contribute to the ability of this organism to adapt to a variety of conditions. As demonstrated in this study, capsule expression is dependent on the particular environment, which indicates that B. pseudomallei produces these capsules to promote a survival advantage either in the host or in the environment. Further studies aimed at characterizing the capsules of B. pseudomallei will be beneficial to understand the pathogenesis of this organism and to advance further vaccine development.
Acknowledgement
The author would like to thank Dr. Donald Woods and all colleagues in the Burkholderia pseudomallei research community for their support and discussions over the years. The work described in this chapter was funded by the following sources: Department of Defense contract DAMD 17-98-C-8003, the Medical Research Council of Canada, the Canadian Bacterial Diseases Network of Centers of Excellence, Canadian Institutes for Health Research MOP 36343, and a Research Incentive Grant from Athabasca University. Carbohydrate analysis was conducted by the Complex Carbohydrate Research Center at the University of Georgia and this was supported in part by the Department of Energy-funded (DE-FG09-93ER-20097) Center for Plant and Microbial Complex Carbohydrates. Microarray analysis was performed at the Southern Alberta Microarray Facility.
© 2012 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
How to cite and reference
Link to this chapter Copy to clipboard
Cite this chapter Copy to clipboard
Shauna L. Reckseidler-Zenteno (October 31st 2012). Capsular Polysaccharides Produced by the Bacterial Pathogen Burkholderia pseudomallei, The Complex World of Polysaccharides, Desiree Nedra Karunaratne, IntechOpen, DOI: 10.5772/50116. Available from:
chapter statistics
3484total chapter downloads
4Crossref citations
More statistics for editors and authors
Login to your personal dashboard for more detailed statistics on your publications.
Access personal reporting
Related Content
This Book
Next chapter
Polysaccharides from Larch Biomass
By Natalya Nikolaevna Trofimova, Elena Nikolaevna Medvedeva, Nadezhda Viktorovna Ivanova, Yuriy Alekseevich Malkov and Vasiliy Anatolievich Babkin
Related Book
First chapter
Introductory Chapter: Introduction to Food Additives
By Desiree Nedra Karunaratne and Geethi Kaushalya Pamunuwa
We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.
More About Us
|
__label__pos
| 0.681359 |
@COMMENT This file was generated by bib2html.pl version 0.94 @COMMENT written by Patrick Riley @COMMENT This file came from the Product and Process Engineering Website at TU Delft @COMMENT http://cheme.nl/ppe @article{ ISI:000255871400030, Author = {Christensen, D. and Nijenhuis, J. and van Ommen, J. R. and Coppens, M. -O.}, Title = {Influence of Distributed Secondary Gas Injection on the Performance of a Bubbling Fluidized-Bed Reactor}, Journal = {Industrial \& Engineering Chemistry Research}, Year = {2008}, Volume = {47}, Number = {10}, Pages = {3601-3618}, Month = {}, DOI = {10.1021/ie071376p}, ISSN = {0888-5885}, ResearcherID-Numbers = {van Ommen, Ruud/A-4119-2009}, ORCID-Numbers = {van Ommen, Ruud/0000-0001-7884-0323}, Times-Cited = {17}, Unique-ID = {ISI:000255871400030}, }
|
__label__pos
| 0.970491 |
TRACK & ACT: a pragmatic randomised controlled trial exploring the comparative effectiveness of pedometers and activity trackers for changing physical activity and sedentary behaviour in inactive individuals
Daniel J. Ryan, Megan H. Ross, Joshua Simmich, Norman Ng, Nicola W. Burton, Nick Gilson, Toby Pavey, Wendy J. Brown, Sjaan R. Gomersall
Research output: Contribution to journalArticleResearchpeer-review
Abstract
Pedometers have been shown to be effective for increasing physical activity, however the potential additional effects of activity trackers, and their added capacity to simultaneously modify sedentary behaviour, has not been thoroughly explored. This study aimed to explore the comparative effectiveness of two activity trackers and a pedometer for improving daily step count and moderate-vigorous physical activity (MVPA), and reducing sedentary behaviour in inactive adults.
Original languageEnglish
Article number12
Pages (from-to)1-12
Number of pages12
JournalJournal of Activity, Sedentary and Sleep Behaviors
DOIs
Publication statusPublished - 1 May 2023
Fingerprint
Dive into the research topics of 'TRACK & ACT: a pragmatic randomised controlled trial exploring the comparative effectiveness of pedometers and activity trackers for changing physical activity and sedentary behaviour in inactive individuals'. Together they form a unique fingerprint.
Cite this
|
__label__pos
| 0.956056 |
Read and write to spreadsheet in Java
By , last updated December 7, 2016
I was writing an algorithm that would run and produce some results. These results should have been stored some place and retrieved during next program run. New values would then be added to the resulting list. The program needed to remember all the results from all run.
Read from spreadsheet
We will be reading from spreadsheet in Java using Apache POI. Since we are going to write to the same file, we are reading from, the file will be placed outside the project resource-folder. The reason for that is that we cannot easily modify files inside the resource-folder inside the JAR package.
The first step is to read the file from the project folder. File path should be provided as an absolute path. We used user.dir, which is the project folder path.
String docName = System.getProperty("user.dir")+"\\Test.xlsx";
File file = new File(docName);
FileInputStream fileInputStream = new FileInputStream(file);
Next step is to open the spreadsheet and read the first sheet:
Workbook wb = WorkbookFactory.create(fileInputStream);
Sheet sheet = wb.getSheetAt(0);
Next, we would like to know how many columns and rows does the spreadsheet hold. This is needed to avoid overflows and NullPointerExceptions during reading of the cell values.
private static int findNumberOfColsAndRows(Sheet sheet) {
Row row;
int cols = 0;
int rows = sheet.getPhysicalNumberOfRows();
for (int i = 0; i < 10 || i < rows; i++) {
row = sheet.getRow(i);
if (row != null) {
int tmp = sheet.getRow(i).getPhysicalNumberOfCells();
if (tmp > cols) cols = tmp;
}
}
return rows;
}
Last step is to read the values from cells. We read values from two columns and put them into a HashMap. Here is the whole function:
public static Map<String, String> readValuesInTwoColumns(String docName, int keyColumn, int secondColumn) {
Map<String, String> map = new HashMap<>();
try {
Workbook wb = readFile(docName);
Sheet sheet = wb.getSheetAt(0);
int rows = findNumberOfColsAndRows(sheet);
for (int r = 0; r < rows; r++) {
Row row = sheet.getRow(r);
if (row != null) {
String key = findValue(keyColumn, row);
String value = findValue(secondColumn, row);
if (key != null && value != null) {
map.put(key, value);
}
}
}
} catch (Exception ioe) {
ioe.printStackTrace();
}
return map;
}
private static String findValue(int keyColumn, Row row) {
Cell cell;
cell = row.getCell(keyColumn);
if (cell != null) {
String tmpKey = cell.getStringCellValue();
if (tmpKey != null && !tmpKey.isEmpty()) {
return tmpKey;
}
}
return null;
}
Write to spreadsheet
In order to write to a spreadsheet file in Java we need first to open the file. We do it in the same way as for reading, extracting the procedure into its own function readFile:
private static Workbook readFile(String docName) throws IOException, InvalidFormatException {
File file = new File(docName);
FileInputStream fileInputStream = new FileInputStream(file);
return WorkbookFactory.create(fileInputStream);
}
Next step is to find how many columns and rows does the file have already. This is if we want to update the file and add the values to the sheet. Updating is always better as reading and writing operations are the most expensive ones in the application so we need to limit them as much as possible.
Now that we know the number of rows in the document we start writing our values to the next row:
int rows = findNumberOfColsAndRows(sheet);
for(int i=rows; i<valuesMap.size(); i++) {
//some code
}
Here is the function to write the cell value:
private static void writeCellValue(Row row, int col, String value) {
Cell cell = row.getCell(col);
if(cell == null){
cell = row.createCell(col);
}
cell.setCellValue(value);
}
At last write the updated Workbook to actual file:
public static void writeToFile(String docName, Workbook wb) {
FileOutputStream fileOut = null;
try {
fileOut = new FileOutputStream(docName);
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
Here is the whole code for reading from and writing to a spreadsheet in Java:
public static void addValuesInTwoColumns(String docName, int keyColumn, int secondColumn, Map<String, String> valuesMap) {
try {
Workbook wb = readFile(docName);
Sheet sheet = wb.getSheetAt(0);
int rows = findNumberOfColsAndRows(sheet);
int r = rows;
for (Map.Entry<String, String> entry : valuesMap.entrySet()) {
Row row = getOrCreateRow(sheet, r);
writeCellValue(row, keyColumn, entry.getKey());
writeCellValue(row, secondColumn, entry.getValue());
r++;
}
writeToFile(docName, wb);
} catch (Exception ioe) {
ioe.printStackTrace();
}
}
private static void writeToFile(String docName, Workbook wb) {
FileOutputStream fileOut = null;
try {
fileOut = new FileOutputStream(docName);
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
private static Row getOrCreateRow(Sheet sheet, int r) {
Row row = sheet.getRow(r);
if(row == null){
row = sheet.createRow(r);
}
return row;
}
private static void writeCellValue(Row row, int col, String value) {
Cell cell = row.getCell(col);
if(cell == null){
cell = row.createCell(col);
}
cell.setCellValue(value);
}
private static int findNumberOfColsAndRows(Sheet sheet) {
Row row;
int cols = 0;
int rows = sheet.getPhysicalNumberOfRows();
for (int i = 0; i < 10 || i < rows; i++) {
row = sheet.getRow(i);
if (row != null) {
int tmp = sheet.getRow(i).getPhysicalNumberOfCells();
if (tmp > cols) cols = tmp;
}
}
return rows;
}
private static Workbook readFile(String docName) throws IOException, InvalidFormatException {
File file = new File(docName);
FileInputStream fileInputStream = new FileInputStream(file);
return WorkbookFactory.create(fileInputStream);
}
Comments
Be the first to comment.
Leave a Reply
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
|
__label__pos
| 0.999765 |
Home arrow News & Pics arrow Killerglass FAQ's arrow What is Killerglass?
What is Killerglass? Print
What is Killerglass (borosillicate) Glass?
Thanks to a railroad glass scientist needing to create a lantern that got hot but did not shatter when rain or snow got on it we now have pyres glass. The word Pyrex comes from the Greek Word pyro or fire, and Ex which refers to the type of glass. It does not expand or change shape when heated. This may be why Pyrex glass in the 1960s and '70s was used in the windows of the Apollo and Gemini spacecraft.
Composition of Pyrex Glass:
Density (g/cm3) = 2.23000E+00 Mean Excitation Energy (eV) = 134.000000
Properties Of Borosilicate (PYREX 7740) Glass Chemical Resistance Borosilicate glass is inert to almost all materials with the exception of hydrofluoric acid, hot phosphoric acid and hot alkalies. Of these, hydrofluoric acid has the most serious effect and, even when a solution contains a few parts per million, attack will occur. Phosphoric acid and caustic solutions cause no problems when cold but at elevated temperatures corrosion occurs. Caustic solutions up to 30% concentration can be handled safely at ambient temperatures. Physical Properties: Composition Low-expansion borosilicate glass has the following approximate chemical composition:
SiO2 81%
Na2O 4.0%
K2O 0.5 B2O3 13.0%
Al2O3 2.0%
For further details please refer to ASTM E 438, "Standard Specification for Glasses in Laboratory Apparatus." Linear Coefficient of Expansion: Between 32°F and 572°F [0°C and 300°C], per ASTM Method E 228) 18.1 x 10-7 in/in/7°F 32.5x10-7 cm/cm/°C Annealing: All fittings and all straight lengths are annealed to reduce internal stress. This also makes the pipe easier to field fabricate. Thermal Conductivity: 0.73 Btu/hr-ft2-°F/ft 0.0035 cal/sec-cm2-°C/cm Specific Heat: 0.20 Btu/lb-°F 0.20 cal/gm-°C Dialectric Constant: at 23°C and 1M Hz per ASTM Method D 150: 4.6 ±-0.2 Density: Approximately 139 lb/ft3 (2.23 gm/cm3) Young's Modulus: per ASTM Method C215: in the range of 9 x 106 to 10 x 106 psi. Mechanical Strength: The mechanical properties of glass differ from those of metals. The lack of ductility of glass prevents the equalization of stresses at local irregularities or flaws and the breaking strength varies considerably about a mean value. This latter is commonly found to occur at a tensile strength of about 70 kg/cm2 (1000 psi). The glass should be adequately supported and appropriate allowance should be made for special conditions such as high temperatures, dense liquids, etc. Subject to the above, maximum working pressures are as specified in the following table. Working Temperatures Borosilicate glass retains its mechanical strength and will deform only at temperatures which approach its strain point. The practical upper limit for operating temperatures Is much lower and is controlled by the temperature ditterentials in the glass, which depend on the relative temperatures of the contents of the equipment and the external surroundings. Provided borosilicate glass is not subjected to rapid change in temperature, creating undue thermal shock, it can be operated safely at temperatures up to 450°F (232°C). The normal limiting factor is actually the gasket material. The degree of thermal shock (usually defined as sudden chilling) which it can withstand depends on many factors, for example: stresses due to operating conditions; stresses imposed in supporting the equipment; the wall thickness of the glass, etc. It is therefore undesirable to give an overall figure but, as a general guide, sudden temperature changes of up to about 216°F (120°C) can be accommodated At sub-zero temperatures, the tensile strength of borosilicate glass tends to increase and equipment can be used with safety at cryogenic temperatures.
Chemical Hardening
Killerglass is chemical hardened by our three step hardening process to increase the impact resistance of the borosilicate glass 300-400%
Making this the ideal product for severe duty applications.
< Prev Next >
News & Pics Menu
cart1.gif
Harley V-Rods
v-rod150.jpg
semasm.JPG
Killerglass kits are equipped with
Gates Racing high performance clamps
The state of art in high performance clamps
Killerglass Newsletter
For all the latest info and product
GIVE A WAYS
|
__label__pos
| 0.770718 |
Documentation
lteCFIDecode
Control format indicator block decoding
Syntax
Description
example
cfi = lteCFIDecode(ibits) performs the block decoding on soft input data ibits, assumed to be encoded using procedure defined in section 5.3.4.1 of [1]. The output, cfi, is a scalar representing the control format indicator (CFI) value resulted after performing block decoding on input data. Strictly speaking, ibits should be a vector 32 bits long, as per encoded cfi. See the lteCFI function reference for details. However, this function can take any size segment of encoded data to perform decoding.
The value for CFI can be 1, 2, or 3. This value indicates the time span, in OFDM symbols, of the DCI PDCCH transmission (the control region) in that downlink subframe. For bandwidths in which NDLRB is greater than 10 RB, the span of the DCI in OFDM symbols is the same as the actual CFI value. If NDLRB is less than or equal to 10 RB, the span is CFI+1 symbols.
Examples
collapse all
Decode CFI Block
Decode a noisy 32-element vector that represents the block encoding of the control format indicator (CFI) value.
cw = double(lteCFI(struct('CFI',2)));
noisycw = cw + 0.4*randn(length(cw),1);
cfi = lteCFIDecode(noisycw)
2
Input Arguments
collapse all
ibits — Soft input datanumeric vector
Soft input data, specified as a numeric vector of length 32. This input data is assumed to be encoded using the procedure defined in section 5.3.4.1 of [1].
Output Arguments
collapse all
cfi — Control format indicator value1 | 2 | 3
Control format indicator value, returned as a positive scalar integer. This integer represents the CFI value resulting from performing block decoding on a vector of soft input data, ibits.
The value for CFI can be 1, 2, or 3. This value indicates the time span, in OFDM symbols, of the DCI PDCCH transmission (the control region) in that downlink subframe. For bandwidths in which NDLRB is greater than 10 RB, the span of the DCI in OFDM symbols is the same as the actual CFI value. If NDLRB is less than or equal to 10 RB, the span is CFI+1 symbols.
Data Types: int32
References
[1] 3GPP TS 36.212. "Multiplexing and channel coding." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network; Evolved Universal Terrestrial Radio Access (E-UTRA). URL: http://www.3gpp.org.
Introduced in R2014a
Was this topic helpful?
|
__label__pos
| 0.525082 |
CONTENTS
NAME
Test2::Tools::Refcount - assert reference counts on objects
SYNOPSIS
use Test2::Tools::Refcount;
use Some::Class;
my $object = Some::Class->new();
is_oneref( $object, '$object has a refcount of 1' );
my $otherref = $object;
is_refcount( $object, 2, '$object now has 2 references' );
DESCRIPTION
The Perl garbage collector uses simple reference counting during the normal execution of a program. This means that cycles or unweakened references in other parts of code can keep an object around for longer than intended. To help avoid this problem, the reference count of a new object from its class constructor ought to be 1. This way, the caller can know the object will be properly DESTROYed when it drops all of its references to it.
This module provides two test functions to help ensure this property holds for an object class, so as to be polite to its callers.
If the assertion fails; that is, if the actual reference count is different to what was expected, either of the following two modules may be used to assist the developer in finding where the references are.
See the examples below for more information.
FUNCTIONS
is_refcount
is_refcount( $object, $count, $name )
Test that $object has $count references to it.
is_oneref
is_oneref( $object, $name )
Assert that the $object has only 1 reference to it.
refcount
$count = refcount( $object )
Returns the reference count of the given object as used by the test functions. This is useful for making tests that don't care what the count is before they start, but simply assert that the count hasn't changed by the end.
use Test2::Tools::Refcount import => [qw( is_refcount refcount )];
{
my $count = refcount( $object );
do_something( $object );
is_refcount( $object, $count, 'do_something() preserves refcount' );
}
EXAMPLE
Suppose, having written a new class MyBall, you now want to check that its constructor and methods are well-behaved, and don't leak references. Consider the following test script:
use Test::More tests => 2;
use Test2::Tools::Refcount;
use MyBall;
my $ball = MyBall->new();
is_oneref( $ball, 'One reference after construct' );
$ball->bounce;
# Any other code here that might be part of the test script
is_oneref( $ball, 'One reference just before EOF' );
The first assertion is just after the constructor, to check that the reference returned by it is the only reference to that object. This fact is important if we ever want DESTROY to behave properly. The second call is right at the end of the file, just before the main scope closes. At this stage we expect the reference count also to be one, so that the object is properly cleaned up.
Suppose, when run, this produces the following output (presuming Devel::MAT::Dumper is available):
1..2
ok 1 - One reference after construct
not ok 2 - One reference just before EOF
# Failed test 'One reference just before EOF'
# at ex.pl line 26.
# expected 1 references, found 2
# SV address is 0x55e14c310278
# Writing heap dump to ex-2.pmat
# Looks like you failed 1 test of 2.
This has written a ex-2.pmat file we can load using the pmat shell and use the identify command on the given address to find where it went:
$ pmat ex-2.pmat
Perl memory dumpfile from perl 5.28.1 threaded
Heap contains 25233 objects
pmat> identify 0x55e14c310278
HASH(0)=MyBall at 0x55e14c310278 is:
├─(via RV) the lexical $ball at depth 1 of CODE() at 0x55e14c3104a0=main_cv, which is:
│ └─the main code
└─(via RV) value {self} of HASH(2) at 0x55e14cacb860, which is (*A):
└─(via RV) value {cycle} of HASH(2) at 0x55e14cacb860, which is:
itself
(This document isn't intended to be a full tutorial on Devel::MAT and the pmat shell; for that see Devel::MAT::UserGuide).
From this output, we can see that the constructor was well-behaved, but that a reference was leaked by the end of the script - the reference count was 2, when we expected just 1. Reading the trace output, we can see that there were 2 references that could be found - one stored in the $ball lexical in the main program, and one stored in a HASH. Since we expected to find the $ball lexical variable, we know we are now looking for a leak in a hash somewhere in the code. From reading the test script, we can guess this leak is likely to be in the bounce() method. Furthermore, we know that the reference to the object will be stored in a HASH in a member called self.
By reading the code which implements the bounce() method, we can see this is indeed the case:
sub bounce
{
my $self = shift;
my $cycle = { self => $self };
$cycle->{cycle} = $cycle;
}
From reading the tracing output, we find that the HASH this object is referenced in also contains a reference to itself, in a member called cycle. This comes from the last line in this function, a line that purposely created a cycle, to demonstrate the point. While a real program probably wouldn't do anything quite this obvious, the trace would still be useful in finding the likely cause of the leak.
If Devel::MAT::Dumper is not available, then these detailed traces will not be produced. The basic reference count testing will still take place, but a smaller message will be produced:
1..2
ok 1 - One reference after construct
not ok 2 - One reference just before EOF
# Failed test 'One reference just before EOF'
# at demo.pl line 16.
# expected 1 references, found 2
# Looks like you failed 1 test of 2.
BUGS
ACKNOWLEDGEMENTS
Peter Rabbitson <[email protected]> - for suggesting using core's B instead of Devel::Refcount to obtain refcounts
AUTHOR
Paul Evans <[email protected]>
|
__label__pos
| 0.709095 |
Using Gtk::DrawingArea#queue_draw to refresh the area
#! /usr/bin/env ruby
# file: rectangle.rb
require 'gtk2'
area = Gtk::DrawingArea.new
x1 = 150
area.signal_connect("expose_event") do
y1 = 30; x2 = 200; y2 = 70
area.window.draw_rectangle(area.style.fg_gc(area.state), 1, x1, y1, x2, y2)
end
Gtk::Window.new.add(area).show_all
Thread.new do
300.times { x1 -= 1; area.queue_draw; sleep 0.01}
end
Gtk.main
In the above example the Gtk::DrawingArea#queue_draw method is used to repaint, refresh, or redraw the DrawingArea which contains an instruction to draw a rectangle. The x1 position is changed, making the rectangle move closer to the left every time the queue_draw method is called.
Note: The application can automatically instruct itself to redraw without using queue_draw, however that's only when the viewing area changes from a windowing event (e.g. The main application window is moved by a window drag event).
Resources
|
__label__pos
| 0.877555 |
3
\$\begingroup\$
I want to know if using volatile in this scenario will give better performance than using synchronized, specifically for the paused and running instance variable in the SimulationManager class.
public class SimulationManager {
private List<SimulationPanel> simulations;
private boolean paused = false;
private boolean running = false;
private volatile PausableStopabbleThread observer;
public SimulationManager() {
simulations = new ArrayList<>();
}
public SimulationManager(List<SimulationPanel> simulations) {
this.simulations = Collections.unmodifiableList(simulations);
}
public void start() {
if (isRunning()) {
return;
}
for (SimulationPanel sim : simulations) {
sim.tableInsertion.start();
}
setRunning(true);
observer = new SimulationsObserver();
observer.start();
}
public void play() {
if (!isRunning() && !isPaused()) {
return;
}
setPaused(false);
for (SimulationPanel sim : simulations) {
sim.tableInsertion.play();
}
observer.play();
}
public void reset() {
if (!isRunning()) {
return;
}
setRunning(false);
setPaused(false);
observer.stopWork();
observer = null;
for (SimulationPanel sim : simulations) {
sim.tableInsertion.stopWork();
}
}
public void pause() {
if (!isRunning() && isPaused()) {
return;
}
setPaused(true);
observer.pause();
for (SimulationPanel sim : simulations) {
sim.tableInsertion.pause();
}
}
private synchronized void setPaused(boolean b) {
this.paused = b;
}
private synchronized boolean isPaused() {
return paused;
}
public synchronized boolean isRunning() {
return running;
}
private synchronized void setRunning(boolean running) {
this.running = running;
}
/**
* Specifies when the simulations has finished
*
* @author Victor J.
*
*/
class SimulationsObserver extends PausableStopabbleThread {
private final int nSimulations = simulations.size();
@Override
public void run() {
int finished = 0;
while (!stopRequested()) {
for (SimulationPanel sim : simulations) {
if (!sim.tableInsertion.isAlive()) {
finished++;
}
}
if (finished == nSimulations) {
setRunning(false);
return;
} else {
finished = 0;
}
pausePoint();
}
}
}
}
\$\endgroup\$
2
\$\begingroup\$
volatile should perform better and is appropriate in this situation. A volatile read/write is almost as fast as a non volatile read/write on modern architectures. On the other hand, locking with synchronized will have an overhead, especially in a highly contented scenario (many threads fighting for the lock).
Note however that unless you call the pause/run methods thousands or millions of times per second, you will probably not notice the difference.
Additional comments
This line:
this.simulations = Collections.unmodifiableList(simulations);
probably does not do what you think it does: this.simulations is unmodifiable, but the calling code can still modify the original collection, and the changes will be reflected to your local version (or they won't depending on memory consistency). It would probably be better to do a defensive copy:
this.simulations = new ArrayList<> (simulations);
Another note: because your simulations is effectively immutable,
this.simulations = new ArrayList<> ();
could be replaced by:
this.simulations = Collections.emptyList();
And by the way, you could make simulations final.
\$\endgroup\$
• \$\begingroup\$ A volatile read/write is almost as fast as a non volatile read/write on modern architectures I would not agree with this. Even on modern architectures, memory access is a lot slower than level1 or level2 cache access, could be a factor of 50 to 1000. Nevertheless, it does not influence most of the situations, it happens very rarely that this is the limiting factor. \$\endgroup\$ – tb- Apr 12 '13 at 16:47
• \$\begingroup\$ Thank you for your additional comments. Making a defensive copy will certainly behave as I want it. Additionally I could: this.simulations = Collections.unmodifiableList(new ArrayList<>(simulations); \$\endgroup\$ – vjames Apr 12 '13 at 18:01
• \$\begingroup\$ @tb- On modern architectures, the CPU is generally smart enough to determine when the volatile can be read from L1 only - if the volatile needs to come from the main memory, then yes, you get a performance hit. See for example: stackoverflow.com/questions/4633866/is-volatile-expensive \$\endgroup\$ – assylias Apr 13 '13 at 7:42
• \$\begingroup\$ In other words I should have said: uncontended volatile read/write operations are almost as fast as... \$\endgroup\$ – assylias Apr 13 '13 at 7:49
• \$\begingroup\$ I did not further investigate it at asm level, but a small test confirmed my numbers. Just tried to read a static int with and without volatile in 1 or multiple threads inside a loop. In all cases significant slower. Did you try it, too? \$\endgroup\$ – tb- Apr 14 '13 at 13:50
1
\$\begingroup\$
I do not think, that this will work as you want. In general, I would avoid the use of volatile. Only use it if you really have to, because of some requierements. Otherwise, use the java.util.concurrent.atomic package (they may use volatile, but you do not have to care about the implementation details), use synchronized or other concepts from here: http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html
In your code, this is one of the examples, which could fail:
public void reset() {
if (!isRunning()) {
return;
}
setRunning(false);
setPaused(false);
observer.stopWork();
observer = null;
for (SimulationPanel sim : simulations) {
sim.tableInsertion.stopWork();
}
}
You can enter the reset method with 2 threads, both are behind the if check. First thread sets observer to null, second throws a NullPointerException. Same happens for other methods.
The easiest way to fix this is to use a mutex-object for nearly all methods. Better solutions depend on further analysis.
private synchronized void setPaused(boolean b) { ... }
private synchronized boolean isPaused() { ... }
public synchronized boolean isRunning() { ... }
private synchronized void setRunning(boolean running) { ... }
I would rather use an AtomicBoolean instead of synchronized methods to set a boolean. I would avoid boolean parameters. Use method names like enableRunning(), disableRunning() or something similar. Or setRunning(), unsetRunning(). Or runningEnable(), runningDisable().
Some words about volatile. There are (at least?) two signs that volatile is not enough: If a write depends on the current value (Such as var = var + x). Or if the volatile variable depends on some other variable(s) (Such as if(volatileVariable && otherVariable), which is similar to your code). The first can be solved with atomic manipulate functions for primitives, the second needs most probably some sort of mutex or semaphore.
\$\endgroup\$
• \$\begingroup\$ Thank you it definitely makes sense to use a mutex object for the unsynchronized methods. Even though in the project scope there is only one thread using the SimulationManager class. But with your answer it made me realized that its better to a have a thread-safe class. \$\endgroup\$ – vjames Apr 12 '13 at 17:55
Your Answer
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
__label__pos
| 0.993113 |
Die Präsentation wird geladen. Bitte warten
Die Präsentation wird geladen. Bitte warten
1 C A R I B I C Civil Aircraft for Regular Investigation of the atmosphere Based on an Instrument Container Luftfrachtcontainer gefüllt mit wissenschaftlichen.
Ähnliche Präsentationen
Präsentation zum Thema: "1 C A R I B I C Civil Aircraft for Regular Investigation of the atmosphere Based on an Instrument Container Luftfrachtcontainer gefüllt mit wissenschaftlichen."— Präsentation transkript:
1 1 C A R I B I C Civil Aircraft for Regular Investigation of the atmosphere Based on an Instrument Container Luftfrachtcontainer gefüllt mit wissenschaftlichen Instrumenten, eingebaut für einzelne Messflüge 1 – 2 Messflüge pro Monat (24 – 48 Flugstunden) 11 beteiligte europäische Institute (Koordination: MPI-C, Mainz) MPI für Chemie, Mainz IMK, Karlsruhe IFT, Leipzig DLR, Oberpfaffenhofen GKSS, Geesthacht Universität Heidelberg UEA, Norwich, UK University Lund, Sweden KNMI, de Bilt, The Netherlands CEA/CNRS, Paris, France Universität Bern, Schweiz
2 2 CARIBIC II
3 3
4 4
5 5
6 6
7 7 CARIBIC II Container PTR-MSO3O3 H2OH2O
8 8 >4nm nm CARIBIC II maiden flight 13/14 Dec 2004 Frankfurt - Buenos Aires
9 9 CARIBIC II: Status & Zukunft Status Anfang Dezember 2004: Fluggenehmigung Airbus A340 & Container durch LBA 13/14. Dezember: Erstflug nach Buenos Aires/Santiago Logistik vollständig (high-loader, LKW, test equipment etc.) Einlass funktioniert mechanisch & elektrisch Airbus „power management“ erlaubt noch keine Aufwärmphase vor Flug (kleine) Softwareprobleme bei Master PC einige Instrumente noch nicht vollständig funktionsbereit Zukunft Zweitflug: 18/19. Februar 2005 nach Sao Paulo/Santiago (Parallelflug TROCCINOX) Danach 1-2 Messflüge (25-60 h) pro Monat anvisierte Flugziele: Südamerika, Südafrika, Ost Asien, Ostküste Nordamerika 2005: beheben aller technischer Probleme, keine neuen Geräte Veröffentlichungen & Anträge schreiben
10 10 Tunable Diode Laser Absorption Spectroscopy (TDLAS) zur Messung von D/H, 17 O/ 16 O und 18 O/ 16 O in H 2 O Lambert-Beer σ( ν ) Absorptionsquerschnitt NMolekül Konzentration LAbsorptionlänge Laser Mess-Zelle (p,T const.) Referenz-Zelle ([c] const.) Sample Detektor Reiner Absorber Referenz Detektor Aufeinander abgestimmt Christoph Dyroff
11 11 Erste Messspektren bei 1.37μm, L~40 cm 0.10 nm
12 12 What we can learn from isotope measurements in the atmosphere? central motivation of atmospheric isotope studies is to better understand the budget of the examined trace constituents, i.e. to quantify source/sink strenghts, chemical processing, photolysis rates, transport fluxes etc. - notation e.g. 18 O(H 2 O) = (R sample / R V-SMOW – 1) * 1000 o / oo with R = 18 O/ 16 O
13 13 Isotope fractionation processes Phase transitions e.g. vapour pressure isotope effect Chemical reactions Kinetic fractionation diffusion, transport Photolysis rates (Radioactive decay)
14 14 Isotopes measured in the atmosphere Standard Mean Ocean Water (SMOW) D/H · O/ 16 O O/ 16 O PeeDee Belemnite (PDB) 13 C/ 12 C O/ 16 O O/ 16 O Air (AIR) 15 N/ 14 N isotope ratiotrace gas hydrogen D/H (T/H)H 2 O, CH 4, H 2 carbon 13 C/ 12 C ( 14 C/ 12 C)CO 2, CH 4, CO (C 2 H 6, C 3 H 8, …) oxygen 17 O/ 16 O, 18 O/ 16 OH 2 O, CO 2, CO, N 2 O, O 3 (NO 2, …) nitrogen 15 N/ 14 NN 2 O (NH 3, NH 4, NO 2, NO 3, …) ( 10 Be/ 7 Be, 34 S/ 32 S)
15 15 Isotope fractionation effects solar radiation CHEMICAL REACTIONS condensation + sublimation stratospheric tropospheric Exchange (STE) effusion + deposition biospheremankind ablation + evaporation meteorites, asteriodes, comets Tropopause 8 – 16 km CHEMICAL REACTIONS volcanism sedimentation dissolution condensation evaporation gas-particle transformation condensation + evaporation sedimentation + rainout ices terrestrial radiation boundary layer 1 – 2 km free troposphere stratosphere PHOTOLYSIS
16 16 17 O – 18 O plot
17 17 O 3 formation: rate coefficient ratios
18 18 „Transfer“ of isotope anomaly O3O3 SO 4 2- S(IV) aq N2ON2O CO NMHC NO NO 2 at ground NO 3 O3O3 O( 1 D) CO 2 OH H2OH2O HNO 3 H2OH2O H O
19 19 O-transfer O 3 CO 2 in the stratosphere O 3 + h ( < 320 nm) O( 1 D) + O 2 O( 1 D) + CO 2 CO 3 * O( 3 P) + CO 2 Boering et al., 2004 MDF, slope: troposphere
20 20 Processes controlling H 2 O isotopomers vapor pressure isotope effect kinetic fractionation ice lofting T R A N S P O R T + C H E M I S T R Y MIF MDF CH 4 oxidation H 2 O HO x,, O x HDO = - ( ) o / oo H 2 18 O = - ( ) o / oo H 2 17 O = 0 o / oo (= 17 O – 0.52 * 18 O) 17 km 8 km 23 km 30 km
21 21 Isotope fractionation of H 2 O = 1 – fractionation factor fractionation Raleigh fractionation dR condensate = (T) · R gas R gas (t) = R gas (0)·f -1 vapour pressure istope effect (vpie) vpie kinetic fractionation kin = S(T) / [ vpie · D/D i ·(S(T)-1) + 1] S(T) oversaturation
22 22 H 2 O isotope observations at ground Meteoric Water Line (MWL) (in precipitation) D(H 2 O) = 8.0 · 18 O(H 2 O) + 8.6(in per mil)
23 23 IAEA / WMO network for H 2 O isotope composition in monthly precipitation
24 24 Local MWL in water vapour at Heidelberg
25 25 H 2 O isotope observations at ground Meteoric Water Line (MWL) (in precipitation) D(H 2 O) = 8.0 · 18 O(H 2 O) + 8.6(in per mil) Temperature effect D(H 2 O) = 8.0 · 18 O(H 2 O) + 8.6(in per mil)
26 26 18 O(H 2 O) vs. T in water vapour at Heidelberg
27 27 H 2 O isotope observations Zahn, 2001 airborne sampling at 50-80°N, DI-IRMS measurement in the laboratory
28 28 H 2 O isotope observations Webster et al., Science, Dec Kuang et al., GRL, 2003
29 Simulated Isotope Profiles
30 O isotopism of OH controls dO(H 2 O) ! > 99 % of all H 2 O molecules produced in the middle atmosphere are due to H abstraction by OH: CH 4 + OH H 2 O + CH 3 CH 2 O + OH H 2 O + HCO HCl + OH H 2 O + Cl OH + OH H 2 O + O( 3 P) H 2 + OH H 2 O + H What reactions form new OH bonds ? X + O 2 HO x + Y X + O 3 HO x + Y X + O( 1 D) HO x + Y O exchange:OH x + O 2, NO, H 2 O Origin of O of freshly produced OH
Download ppt "1 C A R I B I C Civil Aircraft for Regular Investigation of the atmosphere Based on an Instrument Container Luftfrachtcontainer gefüllt mit wissenschaftlichen."
Ähnliche Präsentationen
Ads by Google
|
__label__pos
| 0.868371 |
Chapter 3
documentation
encompasses the narratives, flowcharts, diagrams, and other written materials that explain how a system works. This information covers the who, what, where, why and how of data entry, processing, storage, information output, and system controls.
narrative description
a written step-by-step explanation of system components and interactions.
data flow diagram
a graphical description of the source and destination of data, and how data are stored. describes the flow of data within in an organization.
data source
symbol in a DFD represent an organization or individual that sends or recieves data that the system uses or produces. represented by squares in a DFD. An entity can be both a source or destination.
data destination
symbol in a DFD represent an organization or individual that sends or recieves data that the system uses or produces. represented by squares in a DFD. An entity can be both a source or destination. Also referred to as a Data Sink.
data flow
represents the flow of data between processes, data stores, and data sources and destinations. data flow arrows are labeled to indicate the type of data being passed.
process
the processes that transform data from inputs to outputs are representes by circles. They are often referred to as Bubbles.
data store
is a temporary or permanent repository of data, should be descriptive. Represented by horizontal lines with the respective name recorded inside.
context diagram
the highest-level of DFD. Provides the reader with a summary-level view of a system. It depicts a dtat processing system and the external entities that are the sources and destinations of the systems inputs and outputs.
flowchart
is an analytical technique used to describe some aspect of an information system in a clear, concise, and logical manner. Use a standard set of symbols to describe pictorially the transaction processing procedures a company uses and the flow of data throu
flowcharting template
In the early days of flowcharts the symbols were drawn using a piece of hard, flexible plastic on which the shapes of symbols have been die cut. Most flowcharts today are done using software program.
document flowchart
a graphical description of the flow of documents and information between departments or areas of responsibility within an organization. Trace documents from its cradle to its grave.
internal control flowchart
document flowcharts that describe and evaluate internal controls are referred as this.
system flowchart
a graphical description of the relationship among the input processing, and output in an accounting information system.
program flowchart
a graphical description of the sequence of logical operations that a computer performs as it executes a program.
Many documentation tools are available to explain how a system works. Which tool provides a graphical description of the sources and destinations of data as well as data flow within the organization and the processes that transform and store that data?
Data flow diagram
A DFD is composed of which elements?
Data sources and destinations
Data flows
Transformation processes
Data stores
All of the above
Systems flowcharts
are an important systems analysis, design, and evaluation tool.
depict the relationships among the input, processing, and output of an AIS
A document flowchart is particularly useful
in analyzing the adequacy of control procedures.
What do the circles on a data flow diagram represent?
Transformation processes
Why are documentation tools important?
They are needed to determine how a system works
They are needed to evaluate internal control systems
The data flow diagram symbol which represents data flows is the
arrow
A flowchart is
an analytical technique used to describe some aspect of an information system in a clear, concise, and logical manner
An example of a data input would be a(n)
payroll check.
tax payment.
tax report.
Answer: employee change form.
Which flowchart illustrates the flow of documents and information among areas of responsibility within an organization?
document flowchart
Which of the following is not a guideline for drawing a DFD?
Develop a context diagram
Subdivide the DFD
Determine system boundaries
Answer: Develop systems flowchart
Which of the following is a guideline for preparing flowcharts?
Flowchart only the normal flow of operations
Identify the entities to be flowcharted
Data Flow Diagrams provide a description of the flow of documents between departments. T/F?
false
The highest level DFD is called a Context Diagram. T/F?
true
The Program Flowchart depicts the relationships among the input, processing, and output of an AIS. T/F?
false
DFDs generally have to be subdivided to be made more understandable. T/F?
true
Data Flows represent the transformation of data. T/F?
false
|
__label__pos
| 0.999883 |
Ridge
From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
A mountain ridge in Japan
A stratigraphic ridge within the Appalachian Mountains.
The edges of tuyas can form ridges.
Pirin Mountain main ridge - view from Koncheto knife-edge ridge towards the pyramidal peaks Vihren and Kutelo
A ridge or a mountain ridge is a geographical feature consisting of a chain of mountains or hills that form a continuous elevated crest for some distance. The sides of the ridge slope away from narrow top on either side. The lines along the crest formed by the highest points, with the terrain dropping down on either sides, are called the ridgelines. Ridges are usually termed hills or mountains as well, depending on size.
Types
There are several main types of ridges:
• Dendritic ridge: In typical dissected plateau terrain, the stream drainage valleys will leave intervening ridges. These are by far the most common ridges. These ridges usually represent slightly more erosion resistant rock, but not always – they often remain because there were more joints where the valleys formed or other chance occurrences. This type of ridge is generally somewhat random in orientation, often changing direction frequently, often with knobs at intervals on the ridge top.
• Stratigraphic ridge: In places such as the Ridge-and-Valley Appalachians, long, even, straight ridges are formed because they are the uneroded remaining edges of the more resistant dipping strata that were folded laterally. Similar ridges have formed in places such as the Black Hills, where the ridges form concentric circles around the igneous core. Sometimes these ridges are called "hogback ridges".
• Oceanic spreading ridge: In tectonic spreading zones around the world, such as at the Mid-Atlantic Ridge, the volcanic activity forms new land between tectonic boundaries creating volcanic ridges at the spreading zone. Isostatic settling and erosion gradually reduces the elevations moving away from the zone.
• Crater ridges: Large meteorite strikes typically form large impact craters bordered by circular ridges.
• Volcanic crater/caldera ridges: Large volcanoes often leave behind a central crater/caldera bordered by circular ridges.
• Fault ridges: Faults often form escarpments. Sometimes the tops of the escarpments form not plateaus but slope back so that the edges of the escarpments form ridges.
• Dune ridges: In areas of large-scale dune activity, certain types of dunes result in sand ridges.
• Moraines and eskers: Glacial activity may leave ridges in the form of moraines and eskers. An arête is a thin ridge of rock that is formed by glacial erosion.
• Volcanic subglacial ridges: Many subglacial volcanoes create ridge-like formations when lava erupts through a thick glacier or ice sheet.
• Shutter ridges: A shutter ridge is a ridge that has moved along a fault line, blocking or diverting drainage. Typically, a shutter ridge creates a valley corresponding to the alignment of the fault that produces it.
• Pressure ridges: Also known as a tumuli, usually develops in lava flows especially when slow-moving lava beneath a solidified crust wells upward. The brittle crust usually buckles to accommodate the inflating core of the flow, thus creating a central crack along the length of the tumulus.[1] An Ice pressure ridge develops in an ice cover as a result of a stress regime established within the plane of the ice.
See also
• Tectonic uplift – The portion of the total geologic uplift of the mean earth surface that is not attributable to an isostatic response to unloading
• Mountain range – A geographic area containing several geologically related mountains
• Mountain chain
• Hill chain
References
1. ^ "How Volcanoes Work - lava flow features". www.geology.sdsu.edu. Retrieved 2019-01-13.
External Links
• Norsk Geologisk Tidsskrift, Volume 69 Universitetsforlaget, 1989, page 40 https://books.google.com/books?id=dXK7AAAAIAAJ
• Physical Geography: Introduction To Earth, page 164
Retrieved from "https://en.wikipedia.org/w/index.php?title=Ridge&oldid=938609133"
This content was retrieved from Wikipedia : http://en.wikipedia.org/wiki/Ridge
This page is based on the copyrighted Wikipedia article "Ridge"; it is used under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC-BY-SA). You may redistribute it, verbatim or modified, providing that you comply with the terms of the CC-BY-SA
|
__label__pos
| 0.785291 |
Когда приложение отправляет запрос на MySQL сервер, происходит две основные операции:
• Разбор, анализ и подготовка плана выполнения для SQL запроса.
• Выполнение нужных операций в движке таблицы и возврат результата.
Движок InnoDB позволяет включить специальный интерфейс для работы без использования SQL прослойки. Этот интерфейс называется HandlerSocket. Он предоставляет протокол работы с данными по принципу NoSQL.
Использование этого протокола может значительно ускорить простые запросы типа:
SELECT * FROM users WHERE id = 7
Протокол поддерживает базовые операции чтения/записи/обновления/удаления, а также ряд продвинутых (например, инкремент/декремент).
Настройка
Для установки необходимо поставить сборку Percona MySQL:
apt-get install percona-server-server-5.5
После этого, указать настройки портов протокола для чтения и записи данных в файле my.cnf:
loose_handlersocket_port = 9998
loose_handlersocket_port_wr = 9999
loose_handlersocket_threads = 16
loose_handlersocket_threads_wr = 1
open_files_limit = 65535
После перезагрузки сервера, нужно установить плагин:
mysql> install plugin handlersocket soname 'handlersocket.so';
Готово. Проверить установку можно с помощью команды:
mysql> show processlist;
+----+-------------+-----------------+---------------+---------+------+-------------------------------------------+------------------+-----------+---------------+-----------+
| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined | Rows_read |
+----+-------------+-----------------+---------------+---------+------+-------------------------------------------+------------------+-----------+---------------+-----------+
| 1 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | 0 | 0 | 0 |
| 2 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | 0 | 0 | 0 |
| 3 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | 0 | 0 | 0 |
| 4 | system user | connecting host | handlersocket | Connect | NULL | handlersocket: mode=wr, 0 conns, 0 active | NULL | 0 | 0 | 0 |
| 5 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | 0 | 0 | 0 |
| 6 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | 0 | 0 | 0 |
| 7 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | 0 | 0 | 0 |
| 8 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | 0 | 0 | 0 |
...
# Если плагин включен, он будет виден в процессах
PHP и HandlerSocket
Для работы из PHP существует библиотека php-handlersocket. Она устанавливается, как расширение:
wget https://php-handlersocket.googlecode.com/files/php-handlersocket-0.3.1.tar.gz
tar -xvf php-handlersocket-0.3.1.tar.gz
cd php-handlersocket-0.3.1
phpize
./configure
make
make install
После этого необходимо подключить расширение в php.ini:
extension=handlersocket.so
Проверить установку можно так:
root@sh:~# php -i | grep handlersocket
handlersocket
# Если расширение установлено, оно будет найдено в информации о php
Работа из приложения
HandlerSocket предоставляет работу с данными в движке InnoDB с помощью инициализации индекса и колонок, с которыми будут происходить манипуляции. Перед тем, как начать работу, необходимо подготовить таблицу:
CREATE TABLE `test` (
`id` int(11) NOT NULL,
`text` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB
# Создаем таблицу test в базе данных test
Запись данных
Запишем в эту таблицу данные:
<?
# указываем хост и порт для записи
$hs = new HandlerSocket('localhost', 9999);
# Открываем индекс и инициализируем работу с двумя колонками: id и text
$hs->openIndex(1, 'test', 'test', '', 'id,text');
# Вставляем данные
$hs->executeInsert(1, array('1', 'absde'));
Обратите внимание, что для записи используется порт, установленный в параметре loose_handlersocket_port_wr. Установленное значение можно проверить обычным SQL-запросом:
mysql> select * from test;
+----+-------+
| id | text |
+----+-------+
| 1 | absde |
+----+-------+
Чтение данных
Прочитать данные из таблицы можно таким образом:
<?
# подключаемся к порту для чтения данных
$hs = new HandlerSocket('localhost', 9998);
# открываем первичный ключ таблицы
$hs->openIndex(1, 'test', 'test', HandlerSocket::PRIMARY, 'id,text');
# выполняем операцию получения данных первичного ключа со значением 1
$data = $hs->executeSingle(1, '=', array('1'), 1, 0);
print_r($data);
Производительность
Сравним два запроса на получение данных из таблицы — один через классический SQL, второй — через HandlerSocket:
<?
# Отправляем 200 тыс. запросов на чтение данных через HandlerSocket
$hs = new HandlerSocket('localhost', 9998);
$hs->openIndex(2, 'test', 'test', HandlerSocket::PRIMARY, 'id,text');
$t = microtime(1);
for ( $i = 0; $i < 200000; $i++ )
{
$retval = $hs->executeSingle(1, '=', array( mt_rand(1, 1000) ), 1, 0);
}
echo 'Spent ' . (microtime(1) - $t) . 's' . "\n";
# Отправляем 200 тыс. таких же запросов, только через SQL-интерфейс
mysql_connect('localhost', 'root', '');
$t = microtime(1);
for ( $i = 0; $i < 200000; $i++ )
{
$q = mysql_query('SELECT text FROM test.test WHERE id = ' . mt_rand(1, 1000));
$r = mysql_fetch_assoc($q);
}
echo 'Spent ' . (microtime(1) - $t) . 's' . "\n";
mysql_close();
Результаты на небольшом облачном сервере:
Spent 6.9966340065002s
Spent 19.924588918686s
# Handlersoket быстрее
SQL оказался в 2.5 раза медленнее. Важно понимать, что такое преимущество будет получено, только если большинство данных помещается в память (читайте об эффективной настройке MySQL). Если существует большое количество операций с диском, выигрыш в скорости будет незаметным.
Применение на практике
Замена кэширования
Самое большое преимущество от использования HandlerSocket можно получить при замене кэширования данных. Большинство данных, которые находятся в кэше — это часто данные записей, полученных по первичному ключу:
$q = mysql_query('SELET name, age FROM users WHERE id = 7');
$data = mysql_fetch_assoc($q);
memcache_set('user7', $data);
# Классическое кэширования записей по первичному ключу
Имеет смысл использовать HandlerSocket вместо SQL для получения таких данных. Тогда кэшировать их не понадобится:
$hs = new HandlerSocket('localhost', 9998);
$hs->openIndex(1, 'db', 'users', HandlerSocket::PRIMARY, 'id,name,age');
$data = $hs->executeSingle(1, '=', array('7'), 1, 0);
# Получаем данные пользователя без SQL
Во втором случае мы:
• уменьшим расход памяти, т.к. не будет необходимости сохранять данные в кэш
• упростим код, т.к. данные будут храниться в едином месте, и не будет необходимости синхронизировать данные в кэше и базе
• уменьшим риск резкого роста нагрузки при сбое кэширующих серверов
Флаги
Другой вариант применения — это работа с key-value данными. Например, различные флаги для пометки состояния пользователя:
<?
$hs = new HandlerSocket('localhost', 9999);
$hs->openIndex(1, 'test', 'flags', '', 'id,name,value');
$hs->executeInsert(1, array('1', 'is_moderator', 1));
Операция вставки не заменяет предыдущего значения, поэтому для обновления данных необходимо будет использовать операцию update.
Счетчики
Есть поддержка атомарных операций, в том числе инкремент/декремент:
$hs = new HandlerSocket('localhost', 9999);
$hs->openIndex(1, 'test', 'counters', '', 'value');
$hs->executeSingle(1, '=', array('1'), 1, 0, '+', array('1'));
# Увеличиваем колонку value в таблице counters на 1
Эти операции удобно использовать для работы со счетчиками (например, подсчет количества просмотров у статьи).
Самое важное
В большинстве случаев чтение данных по ключу с помощью HandlerSocket даст прирост в производительности и экономию ресурсов. Большим преимуществом этого протокола является то, что не будет необходимости устанавливать и поддерживать дополнительное решение. Кроме этого, все данные остаются в удобном табличном виде, а значит будет возможность делать SQL выборки.
Смотрите подробное описание протокола и PHP библиотеки.
|
__label__pos
| 0.737827 |
Uploaded image for project: 'JDK'
1. JDK
2. JDK-4176710
valid class is loaded twice after loading an invalid class.
Details
• Subcomponent:
• Resolved In Build:
1.2fcs
• CPU:
sparc
• OS:
solaris_2.4
• Verification:
Verified
Description
Name: akC45999 Date: 09/28/98
Section 5.3.1 Loading Using the Default Class Loader
of the JVMS reads:
First, the Java virtual machine determines whether a class or interface
named N has been loaded by the default class loader. If so, this class
is C, and no class creation is necessary.
However, the default classloader can load a valid class twice if
a) it was first asked to load an invalid class and
b) the garbage collector has been run
To reproduce compile following 2 source files and run
java -verbose defaultLoader00102
The tail of the trace shows that the class defaultLoader00102
was loaded twice:
...
[Loaded defaultLoader00102]
initializing class defaultLoader00102
[Loaded BadInterface]
[Loaded java.lang.ClassCircularityError from java/lang/ClassCircularityError.class]
Throwable:java.lang.ClassCircularityError: BadInterface
[Loaded clss2]
[Loaded defaultLoader00102]
initializing class defaultLoader00102
check 3: str 1=modified string
str 2=initial string
failed
Note also, if at least one of calls to check(1,out) or check(2,out)
is not commented, then the test passes.
The bug is discovered when using JDK 1.2fcsI ... 1.2fcsL.
// -------------------------- BadInterface.jasm
public interface BadInterface extends BadInterface {}
// -------------------------- end BadInterface.jasm
// -------------------------- defaultLoader00102.java
import java.io.PrintStream;
class clss2 {
public static String getStr() {
return defaultLoader00102.str;
}
}
public class defaultLoader00102 {
static String str="initial string";
static {
System.out.println("initializing class defaultLoader00102");
}
static boolean check(int n, PrintStream out) {
String str2=clss2.getStr();
out.print("check "+n+": ");
if (str2!=defaultLoader00102.str) {
out.println("str 1=" + defaultLoader00102.str);
out.println("str 2=" + str2);
out.println("failed");
return true;
}
out.println("passed");
return false;
}
public static int run(String argv[], PrintStream out) {
str="modified string";
// if (check(1, out)) return 2;
try {
Class.forName("BadInterface");
} catch (Throwable e) {
out.println("Throwable:" + e);
}
// if (check(2, out)) return 2;
Runtime.getRuntime().gc();
if (check(3, out)) return 2;
return 0;
}
public static void main(String args[]) {
System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
}
}
// -------------------------- end defaultLoader00102.java
======================================================================
Name: akC45999 Date: 09/28/98
The bug was introduced in JDK 1.2fcsD. JDK 1.2fcsC passes the test.
======================================================================
Attachments
Activity
People
• Assignee:
sliangsunw Sheng Liang (Inactive)
Reporter:
rfqsunw Rfq Rfq (Inactive)
• Votes:
0 Vote for this issue
Watchers:
0 Start watching this issue
Dates
• Created:
Updated:
Resolved:
Imported:
Indexed:
|
__label__pos
| 0.991033 |
What is stronger pain relief?
Exploring Stronger Pain Relief Options: A Comprehensive Guide
Pain is a universal experience that can range from mild discomfort to debilitating agony. Whether it’s acute pain from an injury or chronic pain from conditions like arthritis, the need for effective pain relief is essential.
Topcynta 100mg is a prescription medication containing tapentadol, an opioid analgesic.
Asmanol 100mg combines two mechanisms: it acts as a mu-opioid receptor agonist (similar to other opioids) and as a norepinephrine reuptake inhibitor.
Over the years, various pain relief options have been developed, each with its own strengths and limitations.
This blog explores the different types of pain relief, from over-the-counter medications to stronger prescription options, and discusses when stronger pain relief might be necessary, along with the risks and benefits involved.
Understanding Pain: Acute vs. Chronic
Before delving into pain relief options, it’s important to understand the nature of pain. Pain is broadly categorized into two types:
1. Acute Pain:
• Typically short-lived and directly related to tissue damage, such as a cut, surgery, or a broken bone.
• Acute pain usually resolves once the underlying cause is treated.
2. Chronic Pain:
• Persists for weeks, months, or even years and can occur even in the absence of ongoing tissue damage.
• Common causes include arthritis, nerve damage, and conditions like fibromyalgia.
Types of Pain Relief: From Mild to Strong
Pain relief options vary widely, from mild analgesics available over the counter to potent prescription medications. Below is an overview of the different categories of pain relievers:
1. Over-the-Counter (OTC) Pain Relievers:
• Acetaminophen (Tylenol):
• Widely used for mild to moderate pain relief.
• Effective for headaches, muscle aches, and minor injuries.
• Does not have anti-inflammatory properties.
• Non-Steroidal Anti-Inflammatory Drugs (NSAIDs):
• Includes ibuprofen (Advil, Motrin) and naproxen (Aleve).
• Reduces inflammation, making it effective for conditions like arthritis, sprains, and menstrual pain.
• Long-term use can cause gastrointestinal issues and increase the risk of cardiovascular problems.
2. Prescription Pain Relievers:
• Stronger NSAIDs:
• Prescription-strength NSAIDs like diclofenac or celecoxib are available for more severe pain.
• Used for conditions like osteoarthritis and rheumatoid arthritis.
• Opioids:
• Includes medications like oxycodone, hydrocodone, and morphine.
• Highly effective for severe pain but come with a high risk of addiction, tolerance, and side effects.
• Typically used for post-surgical pain, cancer pain, and severe injury.
• Antidepressants and Anticonvulsants:
• Used for nerve pain (neuropathy), conditions like fibromyalgia, and chronic pain syndromes.
• Examples include amitriptyline (an antidepressant) and gabapentin (an anticonvulsant).
3. Topical Pain Relievers:
• Creams, Gels, and Patches:
• Contain ingredients like capsaicin, menthol, or lidocaine.
• Applied directly to the skin over painful areas.
• Effective for localized pain like muscle strains, joint pain, or nerve pain.
4. Injections:
• Corticosteroid Injections:
• Used to reduce inflammation and pain in joints, muscles, and tendons.
• Often used for arthritis, bursitis, and tendonitis.
• Nerve Blocks:
• Involves injecting anesthetic or anti-inflammatory medication around nerves to block pain signals.
• Used for chronic pain conditions, such as back pain or complex regional pain syndrome (CRPS).
5. Alternative and Complementary Therapies:
• Physical Therapy:
• Helps manage pain through exercises, stretches, and manual therapy.
• Effective for musculoskeletal pain, post-surgical recovery, and chronic pain management.
• Acupuncture:
• An ancient Chinese practice involving the insertion of thin needles into specific points on the body.
• Used for various types of pain, including chronic pain, headaches, and fibromyalgia.
• Mind-Body Techniques:
• Includes meditation, biofeedback, and cognitive-behavioral therapy (CBT).
• Helps manage pain by altering the perception of pain and reducing stress.
When to Consider Stronger Pain Relief
The need for stronger pain relief typically arises when pain is severe, persistent, and unresponsive to standard treatments. Situations where stronger pain relief might be necessary include:
1. Post-Surgical Pain:
• Surgery, especially major procedures, can result in significant pain during the recovery period.
• Stronger analgesics, such as opioids, may be prescribed for short-term use to manage post-operative pain.
2. Cancer-Related Pain:
• Cancer and its treatment can cause intense pain, requiring a multi-faceted pain management approach.
• Opioids, along with adjuvant therapies like antidepressants or anticonvulsants, are often used.
3. Chronic Pain Conditions:
• Chronic conditions like osteoarthritis, rheumatoid arthritis, and neuropathy may require stronger pain relief.
• Long-term management may include prescription NSAIDs, opioids, or nerve pain medications.
4. Traumatic Injuries:
• Severe injuries, such as fractures, burns, or dislocations, often necessitate strong pain relief.
• Opioids may be used initially, with a plan to transition to less potent medications as healing progresses.
Risks and Benefits of Stronger Pain Relief
Stronger pain relief options come with both benefits and risks. Understanding these can help patients and healthcare providers make informed decisions.
1. Benefits:
• Effective Pain Control: Stronger medications can provide significant relief from severe pain, improving quality of life.
• Functionality: Adequate pain management can help patients maintain their daily activities and physical function.
• Mental Health: Controlling severe pain can reduce the risk of depression, anxiety, and other psychological effects of chronic pain.
2. Risks:
• Addiction and Dependence: Opioids carry a high risk of addiction, and long-term use can lead to physical dependence and tolerance.
• Side Effects: Stronger medications often come with more severe side effects, including respiratory depression (with opioids), gastrointestinal issues (with NSAIDs), and cognitive impairment.
• Overdose Risk: The risk of overdose is particularly high with opioids, especially when combined with other central nervous system depressants like alcohol or benzodiazepines.
Strategies for Safe Use of Stronger Pain Relief
When stronger pain relief is necessary, it’s important to use these medications safely and effectively:
1. Follow Prescriptions Closely:
• Always adhere to the prescribed dosage and schedule.
• Do not take more than the prescribed amount, even if pain persists.
2. Monitor for Side Effects:
• Report any side effects to your healthcare provider immediately.
• Be particularly vigilant for signs of respiratory depression if taking opioids.
3. Avoid Mixing Medications:
• Be cautious about using multiple pain relievers or combining pain medications with alcohol or other drugs.
• Inform your healthcare provider about all medications and supplements you are taking.
4. Plan for Tapering:
• If taking opioids for an extended period, work with your healthcare provider on a tapering plan to reduce the risk of withdrawal symptoms and dependence.
5. Explore Alternative Therapies:
• Consider complementary therapies like physical therapy, acupuncture, or mind-body techniques to help manage pain alongside medication.
When to Seek Help
Strong pain relief options should be used under close medical supervision. Seek help if:
• Pain is not adequately controlled with the current treatment plan.
• You experience severe side effects or signs of overdose, such as difficulty breathing, extreme drowsiness, or confusion.
• You suspect you may be developing a dependence on pain medications.
• Pain persists or worsens despite treatment, indicating a need for a reevaluation of the underlying cause.
Conclusion
Pain management is a complex and highly individualized process. While stronger pain relief options like prescription NSAIDs, opioids, and other medications can offer significant benefits for those suffering from severe or chronic pain, they also come with substantial risks. Balancing these risks and benefits requires careful consideration, open communication with healthcare providers, and a comprehensive approach to managing pain. By understanding the options available and using them responsibly, patients can find relief while minimizing the potential for adverse outcomes.
|
__label__pos
| 0.964586 |
Skip to main content
Unlocking the Potential of Augmented Reality in Construction
When it comes to the construction industry, efficiency and accuracy are key to success. With the rapid advancements in technology, augmented reality (AR) has emerged as a powerful tool that can revolutionize the way construction projects are planned, executed, and managed. But the question remains: when is the best phase of construction for using AR applications?
1. Design and Planning Phase
The design and planning phase is where the foundation of any construction project is laid. This is the perfect time to leverage AR applications to visualize the project in a virtual environment. By overlaying digital models onto the physical space, architects, engineers, and project managers can gain a deeper understanding of the project’s spatial requirements and identify potential design flaws or clashes before construction begins.
AR can also enhance collaboration among stakeholders by allowing them to interact with the virtual model in real-time. This level of engagement fosters better communication, reduces misunderstandings, and ultimately leads to more accurate and efficient decision-making.
2. Pre-construction Phase
Before breaking ground, the pre-construction phase involves site analysis, feasibility studies, and obtaining necessary permits. AR can play a crucial role in this phase by providing valuable insights into the site conditions and constraints.
Using AR applications, construction professionals can overlay digital information onto the physical site, such as underground utilities, topography, and environmental factors. This enables them to make informed decisions about site layout, material storage, and equipment placement, minimizing the risk of costly errors and delays.
3. Construction Phase
Once construction begins, AR can continue to be a valuable asset. By wearing AR-enabled devices, workers can access real-time information and instructions, reducing the need for paper-based plans and minimizing errors. For example, workers can visualize the exact location and specifications of building components, ensuring precise installation.
AR can also enhance safety on construction sites. By overlaying safety guidelines and hazard warnings onto the worker’s field of view, AR applications can help prevent accidents and ensure compliance with safety regulations.
4. Post-construction Phase
Even after the construction is complete, AR can still provide significant benefits. During the post-construction phase, AR applications can be used for facility management and maintenance. By scanning equipment or infrastructure with AR-enabled devices, maintenance personnel can access real-time data, maintenance history, and step-by-step instructions for repairs or inspections.
AR can also be utilized for training purposes. New employees can be immersed in virtual environments that simulate real-life scenarios, allowing them to gain hands-on experience without the risk of costly mistakes.
Conclusion
Augmented reality has the potential to transform the construction industry by improving efficiency, accuracy, and collaboration throughout the project lifecycle. Whether it’s the design and planning phase, pre-construction phase, construction phase, or post-construction phase, AR applications can provide valuable insights, enhance decision-making, and streamline operations.
As technology continues to evolve, the possibilities for AR in construction are limitless. By embracing this innovative technology, construction professionals can unlock new opportunities for success and stay ahead of the competition.
Amber Rowe
Amber Rowe stands out in the realm of tech writing with her unconventional approach, blending whimsical storytelling with in-depth analysis of futuristic technologies. Her vivid prose and imaginative perspectives offer a unique lens through which the wonders of tech innovation are both celebrated and critically examined.
|
__label__pos
| 0.993197 |
writing python
Anonymous
timer Asked: Oct 16th, 2018
account_balance_wallet $9.99
Question Description
Using IDLE IDE to create a source code file named welcome.py, enter the following Python code, translate it and run it.
def main():
print("Welcome to the wonderful world of Python programming!")
main()
After a successful run, capture its output and close its workspace.
2. Perform the same steps described in part 1 for the following program:
def main():
integer1 = int(input("Enter first integer")) # prompt and enter the first integer
integer2 = int(input("Enter second integer")) # prompt and enter the second integer
sum = integer1 + integer2 # generate and assign the sum
print("The sum of", integer1, "and", integer2,
"is", sum) # print sum
difference = integer1 – integer2 # assignment of difference
print("The difference of", integer1, "minus",
integer2, "is", difference) # print difference
main()
3. "Comment-out" the second line of the second program so it looks like this:
# integer1 = int(input("Enter first integer")) # prompt for and input first integer
Try to run the modified program and record (and hand in) the error message(s).
4. Remove the comment symbol from the previous part (i.e., restore your program to
its previous working condition) and then comment-out the sum assignment statement like this:
# sum = integer1 + integer2 # assignment of sum
Run the modified program and capture the error message(s) you see.
5. Restore your working program again and then comment-out the code line,
# difference = integer1 – integer2 # assignment of difference
Once again run the modified program and capture the error message(s) you see. Explain why the error message you got when commenting out the sum statement differs than when commenting out the difference statement.
6. Problem: Design, Develop, Integrate, and Test (DDI&T) a Python program that converts a Fahrenheit temperature into its Celsius temperature equivalent.
The formula for converting Fahrenheit to Celsius is,
Celsius = 5.0/9.0*(Fahrenheit – 32.0)
Your program should prompt the user for a Fahrenheit temperature, convert it to Celsius and then output both values in the following format:
Fahrenheit Temperature = <Fahrenheit value>
Celsius Temperature = <Celsius value>
Fully test your program with the following set of Fahrenheit temperatures:
75.5, 32.0, -459.4, -40.0, 0.0, 100.0, and 212.0
Note that the temperature values are both input and output with one decimal of precision after the decimal point.
Documentation Guidelines:
Use good programming style (e.g., indentation for readability) and document each of your program parts with the following items (the items shown between the '<' and '>' angle brackets are only placeholders. You should replace the placeholders and the comments between them with your specific information). Your cover sheet should have some of the same information, but what follows should be at the top of each program's sheet of source code. Some lines of code should have an explanation of what is to be accomplished, this will allow someone supporting your code years later to comprehend your purpose. Be brief and to the point. Start your design by writing comment lines of pseudocode. Once that is complete, begin adding executable lines. Finally run and test your program.
#===================================================================
# CS119T – Unit 1-Submission Node – IDEs and Debugging
# Filename: Unit 1 Submission Node: my-unit1-submission-node.doc
# Author: <Your name>
# Purpose: Demonstrate basic Python programming in the IDLE
# development environment
# by following steps 1 through 6 above.
#===================================================================
Deliverable(s):
Your deliverable should be a Word document with screenshots showing the code you have created, and discuss the issues that you had for this project related to AWS and/or Python IDE and how you solved them for all of the programs listed above as well as the inputs and outputs from running them. For parts 3, 4 and 5 where you deliberately "seeded" errors into your code, capture and turn in the error messagesyou encountered when attempting to translate and run these errant programs. Include a cover sheet with the hardcopy of your labs when you turn them in to the instructor.
Tutor Answer
onesmasd
School: UT Austin
Hey buddy, I am through. The zipped file has all the python file and the word document is the documentation containing all the programs, explanations and screenshots. Than you
1. Using IDLE IDE to create a source code file named welcome.py, enter the following Python code,
translate it and run it.
Program Code
def main():
print("Welcome to the wonderful world of Python programming!")
main()
Screenshot after running the program
2. Perform the same steps described in part 1 for the following program:
Program code
def main():
integer1 = int(input("Enter first integer")) # prompt and enter the first integer
integer2 = int(input("Enter second integer")) # prompt and enter the second integer
sum = integer1 + integer2 # generate and assign the sum
print("The sum of", integer1, "and", integer2,
"is", sum) # print sum
difference = integer1 - integer2 # assignment of difference
print("The difference of", integer1, "minus",
integer2, "is", difference) # print difference
main()
Screenshot after running the program
3. "Comment-out" the second line of the second program so it looks like this:
# int...
flag Report DMCA
Review
Anonymous
Tutor went the extra mile to help me with this essay. Citations were a bit shaky but I appreciated how well he handled APA styles and how ok he was to change them even though I didnt specify. Got a B+ which is believable and acceptable.
Brown University
1271 Tutors
California Institute of Technology
2131 Tutors
Carnegie Mellon University
982 Tutors
Columbia University
1256 Tutors
Dartmouth University
2113 Tutors
Emory University
2279 Tutors
Harvard University
599 Tutors
Massachusetts Institute of Technology
2319 Tutors
New York University
1645 Tutors
Notre Dam University
1911 Tutors
Oklahoma University
2122 Tutors
Pennsylvania State University
932 Tutors
Princeton University
1211 Tutors
Stanford University
983 Tutors
University of California
1282 Tutors
Oxford University
123 Tutors
Yale University
2325 Tutors
|
__label__pos
| 0.980967 |
| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |
May 2005
Get the most out of your Robelle Tools
Working with Files With Unprintable Characters
By Robelle Staff
While working on a file that was originally produced by a PC program (PPTIA, the PowerPoint Internet Assistant from Microsoft), we transferred the file to our HP-UX system and needed to clean it up before putting it up on our Web server. The file was not editable in Visual mode because many lines contained unprintable (non-printing ASCII) characters. These were shown as dots/periods on the Visual mode screen, and Qedit showed a question mark at the start of each line to indicate that there were questionable contents.
1. What were these characters?
2. How could I get rid of them?
Answer 1: We used the Char and Decimal options of Qedit’s List command to see the numeric values of the offending characters. For example:
qux/list $h $c 35
35
0000: 0D3C 4832 3E52 6F62 656C 6C65 2043 6F6E 7375 6C74 .<H2>Robelle Consult
000A: 696E 6720 4C74 642E 3C2F 4832 3E20
ing Ltd.</H2>
We knew the line should have started with <H2>, but it had an extra mystery character at the start, which was shown as a dot on the right side of the List output. In the example, on the left side we can see that the character has a hex value of 0D.
Answer 2: The Change command can replace the offending character with a normal printing character, so that it can be edited in Visual mode, or we can use Change to remove the character by changing it to nothing. You can specify strings in the Change command by their numeric values. The numeric values must be specified in decimal, from 0 through 255. We know the hex value, 0D. Using the handy calculator built into Qedit, we see that hex 0D is decimal 13:
qux/=$0d
Result=13.0
Now we can change the character whose value is 13 to nothing. We’ll do it in all lines of the file. First we put Qedit into “decimal mode”, then we do the Change command:
qux/set decimal on
qux/change ‘13 “” all
35 <H2>Robelle Consulting Ltd.</H2>
36 </P>
37 <P> —>
3 lines changed
There were a number of other mystery characters besides 0D/13. These we changed to other printing characters. When we had figured it all out, we put together a Use file with the change commands, so that we could easily make the same change to all the files created with PPTIA. The Use file had these lines in it:
qux/l ufix
1 set dec on
2 cq ‘9 “ “ @ {HT tab}
3 cq ‘11 “<BR>” @ {VT vertical tab, new line}
4 cq ‘13 “” @ {CR}
5 cq ‘145 “’” @ {opening single quote}
6 cq ‘146 “’” @ {closing single quote}
7 cq ‘147 \”\ @ {opening double quote}
8 cq ‘148 \”\ @ {closing double quote}
9 set dec off
Another Way to Identify Nonprinting Characters
The following question came to us from the support mailbox:
“I have a QEDIT file that is displaying a “?” at the beginning of some lines. I understand that this indicates that the line contains nonprintable characters. How can I get QEDIT to display the data so that I can determine what the data is?”
One way to display the data is by using QZMODIFY as follows:
The Visual screen with an unknown character in the line will resemble the following:
===>
Start of file 1 QED21739.PAUL.ACCOUNT
*?sadlkfjslkdj.flkfjkl
^ unknown character
// .....+....1....+....2....+....3....+....4....
Set modify to QZMODIFY: /set mod qz. Now modify the line in question: /m1
Qedit will display the line, but the cursor will not be underneath the line, it will be on the line.
Press the spacebar until the cursor is directly on top of the line with the mystery period, then press Control-W followed by a question mark (?).
1 sadlkfjslkdj.flkfjkl
Qedit will then display the data:
ASCII character code = #25 , %000031, $0019
In this case, the character was a decimal 25 = octal 31 = hex 19. Press the Return key to get out of modify mode.
1 sadlkfjslkdj.flkfjkl
If you need to change this character, then use Set Decimal On and single quotation marks to isolate the decimal 25. For example,
/set dec on
/c ‘25 “#” 1
1 sadlkfjslkdj#flkfjkl
1 line changed
Copyright The 3000 NewsWire. All rights reserved.
|
__label__pos
| 0.887016 |
web analytics
Loading...
Latest news
Convert JPG to PPT
What is PPT?
[wp_ad_camp_1]
The PPT is an extension for the binary file format that is developed by the Microsoft. It is related with the Microsoft Office PowerPoint. It is a slideshow representation application and commonly used for the purpose if office and educational slide shows. PPT files consist of images, sound, and video used for the purpose of presentation. PPT files can be viewed by PowerPoint, PowerPoint Viewer or the Open Office software suite. PowerPoint slides are one of the easiest, useful and most accessible methods that help in creating and present visual aids. It is easy to drag and drop the feature. Therefore, creates interest in the audience that increases the visual impact and also increases the immediate response for the presentation. PowerPoint slideshow will help the user to analyze and reduce the complexity. Therefore, it will encourage in teaching and learning process.
[wp_ad_camp_2]
What is the JPG file?
JPG has used the images which are compressed and contains digital images. This is one of the most common images used by the digital camera, different operating systems and on the Internet. JPG is a Joint Photographic Experts Group used for creating standards. JPG files consist of two sub-formats, JPG/ Exif, and JPG/JFIF. Therefore, JPG/Exif used in the digital cameras and in photography equipment and JPG/JFIF is used on the World Wide Web.
JPG files are used on the websites and emails; JPG is a file format from the ‘lossy image’ file means the quality can never be recovered. Therefore, JPG Format is often used in the digital camera memory cards. JPG file format will compress the files 1/10 of the size of the original file which is good for saving the bandwidth. JPG is used for editing the images and will compress and decompress the images.
Steps to convert JPG to PPT
• To convert JPG to PPT, first, we need to load a JPG file and then click on the create PDF and get on to “Add Files”, and then you can select a JPG file to load.
• Set the OCR settings for JPG to PPT conversion. You have to click on the “Advanced settings” button that enables OCR option and you have an option to select the OCR languages.
• Once the OCR performs to head over to “Home”. Whereas, PPT button that is used to start for the conversion. After finishing this process you can find the converted .pptx format file that can be saved in the output folder.
[wp_ad_camp_1]
Translate »
|
__label__pos
| 0.876996 |
A program to find the area and circumference of a circle (Qbasic)
A program to find the area and circumference of a circle (Qbasic)
CLS
LET pie = 3.14
INPUT "Enter radius of circle"; r
a = pie * r ^ 2
c = 2 * pie * r
PRINT "The area of the circle is"; a
PRINT "The circumference of the circle is"; c
END
Share :
Facebook Twitter Google+
Random Posts
Back To Top
facebook main
counter
Powered by Blogger.
|
__label__pos
| 0.916916 |
Biology
Progenitor Cell
Progenitor Cell
Progenitor Cell
Definition
Progenitor cell is a cell that originates from a stem cell and differentiates into a more specialized cell. A progenitor cell is often more limited than a stem cell in the kinds of cells it can become. The most important difference between stem cells and progenitor cells is that stem cells can replicate indefinitely, whereas progenitor cells can divide only a limited number of times. Controversy about the exact definition remains and the concept is still evolving. Nonetheless, progenitor cells do have potential uses in medicine.
A cell is a group of self-sustaining biochemical reactions that are isolated from the environment by a selectively permeable lipid membrane. Among the key reactions are those that maintain a stable intracellular concentration of ions; for mammalian cells, typical internal concentrations include 140 mM K+, 5-15 mM Na+, 5-15 mM Cl-, and a pH of 7.2.
Progenitor cells play a vital role in the replacement and repair of lost or damaged tissue. Most progenitor cells display little or no activity until activated by cytokines, growth factors, or differentiation reagents which not only induce growth and differentiation into a specialized cell type but may mobilize the cell to the site of the damaged tissue.
Progenitor cells are found in adult organisms and they act as a repair system for the body. They replenish special cells, but also maintain the blood, skin and intestinal tissues. They can also be found in developing embryonic pancreatic tissue. Some progenitor cells were found during research, and were isolated. After their marker was found, it was proven that this progenitor could move through the body and migrate towards the tissue where they are needed. Many properties are shared by adult stem cells and progenitor cells.
Functions of Progenitor Cell
There are several key factors which separate progenitor and precursor cells from stem cells. Unlike a stem cell, which can be multipotent, pluripotent, or totipotent and have a capacity for unlimited self-renewal as an undifferentiated cell, progenitor cells are typically unipotent (precursor cells) or sometimes oligopotent and have a limited capacity for self-renewal as an undifferentiated cell. In some cases, proliferation and differentiation for progenitor cells are inseparable.
The majority of progenitor cells lies dormant or possesses little activity in the tissue in which they reside. They exhibit slow growth and their main role is to replace cells lost by normal attrition. In case of tissue injury, damaged or dead cells, progenitor cells can be activated. Growth factors or cytokines are two substances that trigger the progenitors to mobilize toward the damaged tissue. At the same time, they start to differentiate into the target cells. Not all progenitors are mobile and are situated near the tissue of their target differentiation. When the cytokines, growth factors and other cell division enhancing stimulators take on the progenitors, a higher rate of cell division is introduced. It leads to the recovery of the tissue.
Reference:
1. lonza.com
2. childrenshospital.org
3. thefreedictionary.com
4. wikipedia
|
__label__pos
| 0.931006 |
Search Gradle plugins
org.jetbrains.kotlin.jupyter.api
Gradle plugin providing a smooth Jupyter notebooks integration for Kotlin libraries
https://github.com/Kotlin/kotlin-jupyter
Sources: https://github.com/Kotlin/kotlin-jupyter
Version 0.8.3.286
0.8.3.286
Created 13 March 2021.
Gradle plugin providing a smooth Jupyter notebooks integration for Kotlin libraries
Using the plugins DSL:
plugins {
id("org.jetbrains.kotlin.jupyter.api") version "0.8.3.286"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-jupyter-api-gradle-plugin:0.8.3.286")
}
}
apply(plugin = "org.jetbrains.kotlin.jupyter.api")
Using the plugins DSL:
plugins {
id "org.jetbrains.kotlin.jupyter.api" version "0.8.3.286"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-jupyter-api-gradle-plugin:0.8.3.286"
}
}
apply plugin: "org.jetbrains.kotlin.jupyter.api"
Learn how to apply plugins to subprojects
|
__label__pos
| 0.986065 |
Source
django-piston / piston / forms.py
Full commit
import hmac, base64
from django import forms
from django.conf import settings
class Form(forms.Form):
pass
class ModelForm(forms.ModelForm):
"""
Subclass of `forms.ModelForm` which makes sure
that the initial values are present in the form
data, so you don't have to send all old values
for the form to actually validate. Django does not
do this on its own, which is really annoying.
"""
def merge_from_initial(self):
self.data._mutable = True
filt = lambda v: v not in self.data.keys()
for field in filter(filt, getattr(self.Meta, 'fields', ())):
self.data[field] = self.initial.get(field, None)
class OAuthAuthenticationForm(forms.Form):
oauth_token = forms.CharField(widget=forms.HiddenInput)
oauth_callback = forms.URLField(widget=forms.HiddenInput)
authorize_access = forms.BooleanField(required=True)
csrf_signature = forms.CharField(widget=forms.HiddenInput)
def __init__(self, *args, **kwargs):
forms.Form.__init__(self, *args, **kwargs)
self.fields['csrf_signature'].initial = self.initial_csrf_signature
def clean_csrf_signature(self):
sig = self.cleaned_data['csrf_signature']
token = self.cleaned_data['oauth_token']
sig1 = OAuthAuthenticationForm.get_csrf_signature(settings.SECRET_KEY, token)
if sig != sig1:
raise forms.ValidationError("CSRF signature is not valid")
return sig
def initial_csrf_signature(self):
token = self.initial['oauth_token']
return OAuthAuthenticationForm.get_csrf_signature(settings.SECRET_KEY, token)
@staticmethod
def get_csrf_signature(key, token):
# Check signature...
try:
import hashlib # 2.5
hashed = hmac.new(key, token, hashlib.sha1)
except:
import sha # deprecated
hashed = hmac.new(key, token, sha)
# calculate the digest base 64
return base64.b64encode(hashed.digest())
|
__label__pos
| 0.999144 |
Creating a Window using OpenGL | C++
In this article, we shall learn how to initialize (create) a window using OpenGL and understand its structure?
Submitted by Himanshu Bhatt, on October 04, 2018
Basic step to make any program on OpenGL is created a window where all the code will work so how it we can create it? After installing OpenGL libraries on your machine (OpenGL installation guide for Ubuntu: How to install OpenGL in Ubuntu) we can begin.
Let’s first understand how to structure an OpenGL program?
1. Place all initialization and related one-time parameter setting together preferably in functioninit().
2. Geometric description of the picture that we want to draw (display) in user-defined function which will be referenced in GLUT function, glutDisplayFunc().
3. main function will contain GLUT function for setting up the display window and getting the image screen.
Program:
Let’s get our hands dirty with the code:
#include<GL/freeglut.h>
//Program to create an empty Widdow
void init(){
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); //Line C
glutInitWindowSize(640,480);
glutInitWindowPosition(1000,200);
glutCreateWindow("Simple Window");
}
void display()
{
glClearColor(1.0,1.0,1.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
// gluOrtho2D(0.0,100.0,0,100.0);
glFlush();
}
int main(int argc,char **argv)
{
glutInit(&argc,argv); //Line A
init(); //Line B
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
Output
Creating a Window using OpenGL | C++
Explanation:
#include <GL/freeglut.h>, we used the GL/freeglut library for our program and you can find it almost in all our programs.
In-Line A, we called this glutInit(&argv, argv) because it initializes the OpenGL utility toolkit (GLUT), hence it must be done at the beginning and it is one of must do step.
In Line B, we called the user-defined function to init(). Now we understand what each line mean, glutInitDisplayMode() is used for choosing buffering options and choice of color mode. Here we used GLUT_SINGLE for a window display that means one buffer for will used for one color we can use subsequent two or three buffer mode to increase the number of colors, we used GLUT_RGB meaning we will use Red, Green and Blue colors as our primary colors. glutWindowSize() is used to define the size of the window to be created. glutWindowPosition() is used to define the start point of the window on the screen (It start from a top left the corner, that is 1000 pixels left, and 200 pixels below). Glutcreatewindow() is responsible to create the window on the screen, also we can pass a string argument with it which display that string on the top of the newly created window.
glutDisplayFunc() it takes a name of the function as its parameter and it displays it on the screen (though we don’t have anything to display in our displays() function it will not display anything).
For background color, as default color of the background is Black, to change it we use two functions, one is glClearColor(r,g,b, a) which accepts 4 parameters, for each Red, Green, Blue, and Alpha value. It accepts these three colors only because we defined in Line C that we will use only this one and we passed a value (float) between 0 and 1 for defining its composition and the resulting color will be the color of the background, Alpha value is used to determine the resulting of two overlapping colors.
where a = 0 is transparent object, a = 1 is opaque object
But simply using glClearColor() won’t change the background color, surely it will set the background but it won’t be visible; unless we use glClear(GL_COLOR_BUFFER_BIT), this will activate the color process from the graphics processor and assigned color will display on the window.
gluOrtho2d() takes four floats as parameters and they are Xmin, Xmax, Ymin ,and Ymax which define thecoordinate system within the window. In last, we use glFlush() which flush down everything to the screen.
glutMainLoop() is a must function as it is responsible to hold the display on screen or else the program will end without human eye noticing a thing.
Comments and Discussions!
Load comments ↻
Copyright © 2024 www.includehelp.com. All rights reserved.
|
__label__pos
| 0.904922 |
Thursday, 29 March 2007
TroubleShooting: How to reset Internet Protocol (TCP/IP) in Windows XP & Vista
Occasionally there are seemingly unexplained reasons for no network communication on a system.
Sometimes the removal of a software firewall or some sort of OS update can be seen as responsible.
Either way, we may need to reset the TCP stack. XP follows, Vista is further below.
The following Microsoft KB 299357: How to reset Internet Protocol (TCP/IP) in Windows XP explains the ins and outs of the methodology.
Simply:
netsh int ip reset c:\resetlog.txt
The resetlog.txt will be made in the root of the drive where it can be scanned for any errors.
Generally, you are back in business!
Okay, in the case of the system I am working on now ... NOT. :D
Next step:
In the CMD window where I release the IP and try and renew it I am getting the following error: You receive an "An operation was attempted on something that is not a socket".
The following Microsoft KB 817517: You receive an "An operation was attempted on something that is not a socket" error message when you try to connect to a network contains further steps to take on, in this case, Windows XP:
Export and delete the corrupted registry subkeys
1. Insert a floppy disk in the floppy disk drive of the computer whose registry entries you are exporting.
2. Click Start, click Run, type regedit, and then click OK.
3. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock
4. Do one of the following steps, depending on the operating system:
• For Windows XP, on the File menu, click Export.
• For Windows 2000, on the Registry menu, click Export.
5. In the Save in box, click 3½ Floppy (A:), type a name for the file in the File name box, and then click Save.
6. Right-click Winsock, and then click Delete. When you are prompted to confirm the deletion, click Yes.
7. Repeat steps 3 through 6 for the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock2
Note Each .reg file that you save must have a different name.
8. Right-click Winsock2, click Delete, and then click Yes.
9. Quit Registry Editor.
Then on to the following for an XP based system:
Reinstall TCP/IP on a Windows XP-based computer
In Windows XP, the TCP/IP stack is a core component of the operating system. Therefore, you cannot remove TCP/IP in Windows XP.
1. Install TCP/IP on top of itself. To do this, follow these steps:
1. a. In Control Panel, double-click Network Connections, right-click Local Area Connection, and then click Properties.
2. Click Install.
3. Click Protocol, and then click Add.
4. Click Have Disk.
5. In the Copy manufacturer's files from box, type System_Drive_Letter:\windows\inf, and then click OK.
6. In the list of available protocols, click Internet Protocol (TCP/IP), and then click OK.
2. Restart your computer.
After the reboot, the system should come up and have network connectivity.
In our case, the problem has turned out to be the Panda Platinum Internet Security 2006.
As soon as I uninstalled the product, the system had network connectivity. Going to try and reinstall it to see if it breaks things again.
UPDATE 07-05-07: For Windows Vista: A lot of searches are ending up here looking for the ability to reset the TCP stack in Windows Vista.
The first place to start is to run the native Vista repair feature:
1. Click Start
2. Type "Network" in Start Search
3. Click on Network and Sharing Center in the results
4. Click on Diagnose and repair (bottom of left list)
5. Run through the prompts to repair the connection.
If that doesn't fix the situation, then a manual reset of both Winsock and the TCP/IP stack would be in order.
1. Winsock
1. Click on Start
2. Type CMD in Start Search
3. Right click on the result and run as Administrator
4. netsh winsock reset [Enter]
5. exit [Enter]
6. Restart the system
2. TCP/IP protocol
1. Bring up the command prompt authenticated as Administrator (steps 1-3 just above)
2. netsh int ip reset [Enter]
3. exit [Enter]
4. Restart the system
On SBS Premium based networks, make sure that the proxy settings are correct in the browser and that IE is seen hitting ISA via the ISA live logging feature.
Make sure that the correct drivers are installed on the system, that the connectivity lights on the NIC and at the switch are lit and active.
Check your patch cables, especially for laptops.
If you need further Vista related troubleshooting tips: Gateway Support: Windows Vista - Troubleshooting Network Connections.
Philip Elder
MPECS Inc.
Microsoft Small Business Specialists
2 comments:
Anonymous said...
I test it. It works
Philip Elder SBS MVP said...
A,
Thanks for that!
Philip
|
__label__pos
| 0.797656 |
top of page
Anti-wrinkle injection
Anti-wrinkle injections to help reduce fine lines which are a telling sign of facial ageing. Using a form of wrinkle relaxing BoTox we can freeze the muscle to create a smoother surface.
Are they safe?
Yes. Except in pregnancy and breastfeeding.
How long do they last?
Individual results may very, but around 4-6 months on average.
What areas can be treated?
- Frown lines
- Forehead lines
- Crow's feet
- Gummy smile
- Bunny lines
- Neck bands
Botox lasts up to 3-6 months depending on individual’s body metabolism and lifestyle.
The price for botox treatment for 3 areas (forehead, frown line, crow's feet) is £360.
We use ALLERGAN for our botox treatments.
image (12).png
bottom of page
|
__label__pos
| 0.999513 |
{-# LANGUAGE DeriveDataTypeable, TypeSynonymInstances #-}
module Language.SSVM.Types where
import Control.Monad.State
import Data.Data
import Data.Monoid
import Data.Array
import qualified Data.Map as M
type DArray = Array Int StackItem
-- | Stack item
data StackItem =
SInteger Integer
| SString String
| SInstruction Instruction
| SArray DArray
| Quote StackItem
deriving (Eq, Data, Typeable)
-- | Show type of item
showType :: StackItem -> String
showType x = show (toConstr x)
instance Show StackItem where
show (SInteger x) = show x
show (SString s) = show s
show (SArray a) = "[" ++ unwords (map show $ elems a) ++ "]"
show (SInstruction i) = show i
show (Quote x) = show x
showItem :: StackItem -> String
showItem = show
showPrint :: StackItem -> String
showPrint (SInteger x) = show x
showPrint (SString s) = s
showPrint (SArray a) = "[" ++ unwords (map show $ elems a) ++ "]"
showPrint (SInstruction i) = show i
showPrint (Quote x) = show x
showCode :: Code -> String
showCode (Code marks code) =
unwords $ zipWith (showOne $ head marks) [1..] code
where
showOne ms n item = showItem item ++ concatMap (" ."++) (lookupRev n $ M.assocs ms)
lookupRev _ [] = []
lookupRev key ((v,k):other)
| key == k = v: lookupRev key other
| otherwise = lookupRev key other
type Stack = [StackItem]
type Marks = M.Map String Int
showMarks :: Marks -> String
showMarks ms = unlines $ map s $ M.assocs ms
where
s (k,v) = "\t" ++ k ++ ": " ++ show v
-- | VM code
data Code = Code {
cMarks :: [Marks], -- ^ marks stack
cCode :: [StackItem] }
deriving (Eq, Show, Data, Typeable)
instance Monoid Code where
mempty = Code [M.empty] []
mappend (Code l1 c1) (Code l2 c2) = Code (M.union m1 m2: ms) (c1 ++ c2)
where
(m1:ms) = l1
(m2:_) = l2
class (Data a, Typeable a) => StackType a where
toStack :: a -> StackItem
fromStack :: StackItem -> Maybe a
instance StackType Integer where
toStack = SInteger
fromStack (SInteger x) = Just x
fromStack _ = Nothing
instance StackType Int where
toStack = SInteger . fromIntegral
fromStack (SInteger x) = Just (fromIntegral x)
fromStack _ = Nothing
instance StackType String where
toStack = SString
fromStack (SString x) = Just x
fromStack _ = Nothing
instance StackType Instruction where
toStack = SInstruction
fromStack (SInstruction x) = Just x
fromStack _ = Nothing
instance StackType DArray where
toStack = SArray
fromStack (SArray a) = Just a
fromStack _ = Nothing
-- | VM instructions
data Instruction =
NOP -- ^ Do nothing
| PUSH StackItem
| DROP
| DUP
| SWAP
| OVER
| PRINT
| PRINTALL
| ADD
| MUL
| DIV
| REM
| SUB
| NEG
| ABS
| CMP
| DEFINE
| COLON
| CALL String -- ^ Call named user-defined word
| VARIABLE
| ASSIGN
| READ
| INPUT
| MARK
| GETMARK String
| GOTO
| JZ
| JNZ
| JGT
| JLT
| JGE
| JLE
| ARRAY
| READ_ARRAY
| ASSIGN_ARRAY
deriving (Eq, Data, Typeable)
instance Show Instruction where
show NOP = "NOP"
show (PUSH x) = show x
show DROP = "DROP"
show DUP = "DUP"
show SWAP = "SWAP"
show OVER = "OVER"
show PRINT = "."
show PRINTALL = ".."
show ADD = "+"
show MUL = "*"
show DIV = "/"
show REM = "REM"
show SUB = "-"
show NEG = "NEG"
show ABS = "ABS"
show CMP = "CMP"
show DEFINE = ";"
show COLON = ":"
show (CALL s) = s
show VARIABLE = "VARIABLE"
show ASSIGN = "!"
show READ = "@"
show INPUT = "INPUT"
show MARK = "MARK"
show (GETMARK x) = "@" ++ x
show GOTO = "GOTO"
show JZ = "JZ"
show JNZ = "JNZ"
show JGT = "JGT"
show JLT = "JLT"
show JGE = "JGE"
show JLE = "JLE"
show ARRAY = "ARRAY"
show READ_ARRAY = "[@]"
show ASSIGN_ARRAY = "[!]"
-- | Word definition
data Definition = Definition Int Stack
deriving (Eq, Show)
-- | VM state
data VMState = VMState {
vmStack :: Stack, -- ^ current VM stack
vmCurrentDefinition :: Stack, -- ^ current definition
vmDefinitions :: M.Map String Definition, -- ^ already defined words
vmVariables :: M.Map Int StackItem, -- ^ variables values
vmNextVariable :: Int, -- ^ next variable number
vmPC :: Int, -- ^ program counter
vmTraceMode :: Bool -- ^ trace mode
}
deriving (Eq, Show)
-- | Starting VM state
emptyVMState :: VMState
emptyVMState = VMState {
vmStack = [],
vmCurrentDefinition = [],
vmDefinitions = M.empty,
vmVariables = M.empty,
vmNextVariable = 0,
vmPC = 0,
vmTraceMode = False }
-- | VM monad
type VM a = StateT VMState IO a
|
__label__pos
| 0.971898 |
MEU CARRINHO
O meu Carrinho está vazio
Monitorização Vídeo
Selecção Equipamento CCTV
Megapixel video surveillance in practice
IP video surveillance has as many supporters as opponents. This is due to many reasons. These include: the price of the equipment, requirements for the transmission medium, image quality, mobility, possibility of building distributed systems, stability of operation etc.
To overcome the differences between the two types of monitoring systems, the designers can employ available on the market IP cameras with built-in recorders or DVRs with network functions often more advanced that those typically embedded in IP cameras. Such mutual complementarity means that both the systems based on analog cameras and DVRs, and those based on IP technology, may be used interchangeably, depending on investor preferences.
ULTIMAX DVRs operating in multi-server - multi-client configuration
Megapixel IP Camera: IQinVision IQ755 <br />(5.0 Mpix, Day/Night, PoE) - CLEARANCE SALE!
Wireless MPEG-4 IP Camera: Pixord P405W
IP camera IQinvision K1433
recording on CF card
IP camera Pixord K1134
recording on CF card
There is, however, a feature not available in the systems based on analog cameras and DVRs. This is a much higher resolution of the images. Analog television systems (PAL, NTSC) limit it to maximum 720 x 576 pixels (PAL). It is the maximum number of points of the picture.
With digital technology there is no such restriction. Any image size is possible, if the camera supports it. This way the basic resolution of the image depends only on the parameters of the camera.
Comparison of images with VGA and SXGA (1.3 Mpix) resolution
Adjustment of image size to the system requirements
As an example let's analyze a parking lot. To be able to read the registration numbers of the vehicles, we need about 130 pixels per one meter of the real size of the observed object, i.e. a car. It follows that, if the parking lot is 50 meters long and the system is analog (720 pixels), there are needed 9 cameras. In the case of cameras with 1.3 Mpix resolution (1280 x 1024) just 5 will do the same, for 2 Mpix cameras - only 4 are required. It is important to note that higher-resolution cameras also cover a larger area vertically.
Comparison of images of SXGA and CIF resolution
A smaller number of cameras has many advantages. First of all, it lowers the cost and time of installation and maintenance. After all, each camera requires a lens, housing and bracket. Another argument is demand for transmission channels. In digital systems each device forms a channel regardless of its type. Less cameras also means lower operational costs - it is easier to conduct surveillance with a smaller number of points.
Of course, there is another alternative for megapixel cameras - very popular speed dome/PTZ cameras. With adequate lens, it is even possible to cover the area mentioned above with a single PTZ camera. However, such a solution has many drawbacks. First of all, the camera can be set only in one of two ways:
- The first one provides an overall view, without possibility of recognition of some important details, e.g. the license number of a car. Using optical zoom, we can ensure the capability of identifying details, but at the expense of losing the rest of the scene.
- The second way involves activity of the operator who must decide what is interesting at the moment and focus on that area. In the case of fixed cameras, there is always available a complete picture (set of images), with all events recorded by the system.
Another problem is the bandwidth occupied by the video stream and the required disk space. If the monitored area comprises 10 Mpix, this corresponds to 25 D1 cameras or 5 cameras with resolution of 2 Mpix. One D1 frame is approximately 60 kB in size, whereas a compressed image from 2 Mpix camera about 120 kB. As can be seen, in the case of 5 frames per second, the band needed for the set of D1 cameras is:
25 x 5 fps x 60 kB = 7.5 MBps = 60 Mbps
For the 2-Mpix cameras the band is:
5 x 5 fps x 120 kB = 3 MBps = 24 Mbps
In the case of megapixel cameras an important issue is the maximum number of frames per second. Analog systems can typically provide 25 frames per second. But in practice this full speed is not needed or used. It is essential in TV transmissions, but not in CCTV systems. In addition, comparing the number of frames generated by a standard-resolution camera and a megapixel device, we should take into account the total numbers of the pixels transmitted during one second. For a standard CCTV camera it is:
720 x 576 x 25 fps = 10 Mpix/s
For a 1.3 Mpix camera and 8 fps:
1280 x 1024 x 8 fps = 10 Mpix/s
For a top-quality 5 Mpix camera and 10 fps:
2560 x 1920 x 10 fps = 49 Mpix/s
Looking at these results we see that fewer frames does not mean fewer surveillance potential. On the contrary - the information is more detailed than in the case of a standard camera.
In conclusion, megapixel cameras slowly but steadily change the direction of development of video surveillance systems. They "cut the umbilical cord" with the resolutions based on TV standards. They can replace both fixed and PTZ cameras, and the systems are economically competitive with solutions based on "standard" CCTV solutions.
|
__label__pos
| 0.68987 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.