Binary Search
Recursion or While-Loop?
In general, it’s never a good idea to do binary search with recursion, because that’ll make the interview too boring.
Template
This template is able to locate the first (or last) occurance of an element when array contains duplications.
If item too small/large, left/right boundary is returned.
Read Question “Search for a Range” for more details.
int binarySearch(vector<int> &A, int target) {
if (A.size() == 0) {
return -1;
}
int start = 0;
int end = A.size() - 1;
int mid;
while (start + 1 < end) {
mid = start + (end - start) / 2;
if (A[mid] < target) {
start = mid;
} else {
end = mid;
}
}
if (A[start] == target) {
return start;
}
if (A[end] == target) {
return end;
}
return -1;
}
Keypoints
- start + 1 < end
- start + (end-start)/2
- A[mid] ==, <, >
- A[start/end] == target
Question list
Binary search
Additional
Search a 2D Matrix II - A tricky question
Find the First Bad Version
The code base version is an integer and start from 0 to n. One day, someone commit a bad version in the code case, so it caused itself and the following versions are all failed in the unittests. You can determine whether a version is bad by the following interface:
boolean isBadVersion(int version);
Find the first bad version.
Find a peek
There is an array which we can assume the numbers in adjcent positions are different. and A[0] < A[1] && A[A.length - 2] > A[A.length - 1]. We consider a position P is a peek if A[P] > A[P-1] && A[P] > A[P+1]. Find a peek in this array.
Code
All following code are written with the template provided above.
Search Insert Position
public int searchInsert(int[] A, int target) {
// 6 minutes
if (A == null || A.length == 0) {
return 0;
}
int left = 0, right = A.length - 1;
int mid;
while (left + 1 < right) {
mid = left + (right - left) / 2;
if (A[mid] < target) {
left = mid;
}
else {
right = mid;
}
}
if (target <= A[left]) {
// equal or less than first element
return left;
}
else if (A[left] < target && target <= A[right]) {
return right;
}
else {
// bigger than largest element
return right + 1;
}
}
Search for a Range
public int[] searchRange(int[] A, int target) {
// 6 minutes
int[] result = new int[2];
result[0] = -1;
result[1] = -1;
if (A == null || A.length == 0) {
return result;
}
// find the start point of target
int left = 0, right = A.length - 1, mid;
while (left + 1 < right) {
mid = left + (right - left) / 2;
if (A[mid] < target) {
left = mid;
}
else {
right = mid;
}
}
if (A[left] == target) {
result[0] = left;
}
else if (A[right] == target) {
result[0] = right;
}
else {
return result;
}
// find the end point of target
left = 0;
right = A.length - 1;
while (left + 1 < right) {
mid = left + (right - left) / 2;
if (A[mid] <= target) {
left = mid;
}
else {
right = mid;
}
}
if (A[right] == target) {
result[1] = right;
}
else if (A[left] == target) {
result[1] = left;
}
return result;
}
Search in Rotated Sorted Array
Note: this is an high-freq qeustion. Every company will ask this question.
The solution is using 4 if-conditions. It takes long time first, because I compare A[mid] with target. It become complex.
We should compared A[left] and A[mid] first, then it’ll be much easier for coding.
public int search(int[] A, int target) {
// this is the 4th time that I do this question
// 7 minutes
if (A == null || A.length == 0) {
return -1;
}
int left = 0;
int right = A.length - 1;
int mid;
while (left + 1 < right) {
mid = left + (right - left) / 2;
if (A[mid] == target) {
return mid;
} else if (A[left] < A[mid]) {
if (A[left] <= target && target < A[mid]) {
right = mid;
} else {
left = mid;
}
} else {
if (A[mid] < target && target <= A[right]) {
left = mid;
} else {
right = mid;
}
}
}
if (A[left] == target) {
return left;
} else if (A[right] == target) {
return right;
}
return -1;
}
Search in Rotated Sorted Array II
There are multiple ways to remove duplications. My previous solution is removing duplicate before entering the while-loop, which is a very good idea.
Binary can’t be used, because there might be: value of start = mid = end. In this case, the entire list needs to be search. Impossible!
The worse case will anyway take O(n) time. To indicate the time complexity is regardless of binary search, Mr. Huang suggests the following code:
public boolean search(int[] A, int target) {
for (int i = 0; i < A.length; i ++) {
if (A[i] == target) {
return true;
}
}
return false;
}
Search a 2D Matrix
my code (2D search):
public boolean searchMatrix(int[][] matrix, int target) {
// 13 miniutes
if (matrix == null || matrix.length == 0 || matrix[0].length == 0) {
return false;
}
int m = matrix.length;
int n = matrix[0].length;
// find target vertically from matrix[0] to matrix[m-1]
int top = 0, bottom = m - 1;
int mid;
while (top + 1 < bottom) {
mid = top + (bottom - top) / 2;
if (matrix[mid][0] < target) {
top = mid;
}
else {
bottom = mid;
}
}
// locate the row number
int row = -1;
if (matrix[top][0] <= target && target <= matrix[top][n-1]) {
row = top;
}
else if (matrix[bottom][0]<=target && target <= matrix[bottom][n-1]) {
row = bottom;
}
else {
return false;
}
// now find target from matrix[row]
int left = 0, right = n - 1;
while (left + 1 < right) {
mid = left + (right - left) / 2;
if (matrix[row][mid] < target) {
left = mid;
}
else {
right = mid;
}
}
return (matrix[row][left] == target || matrix[row][right] == target);
}
better code (1D search):
public boolean searchMatrix(int[][] matrix, int target) {
int rows = matrix.length;
int cols = matrix[0].length;
int start = 0;
int end = rows * cols - 1;
while (start <= end) {
int mid = (start + end) / 2;
// Tricks to treat it as a 1-D array
int digit = matrix[mid / cols][mid % cols];
if (target == digit) {
return true;
} else if (target > digit) {
start = mid + 1;
} else {
end = mid - 1;
}
}
return false;
}
Search a 2D Matrix II
Read my new post for details.
Find the First Bad Version
A simple binary search.
Find a peek
A binary search, and for each ‘mid’ point, judge weather it’s a peek, or it’s upward sloping, or downward sloping.
Code skipped.


--- layout: default title: About DEVit description: Thank you for being part of DEVit. Learn here all about your favorite Web Development Conference. permalink: /about --- {% include blocks/header.html page="about" %}
Every year we are setting the bar higher and deliver a world-class conference on web development.
DEVit started in 2015 and it takes place every year in Thessaloniki, Greece. It is known for its top speaking talent, a mixture of world-class and world-renowned developers, highly specialized technology niches and developers who are on the edge of technology frontiers.
The attendees of the conference are mostly highly trained and motivated web developers, representing the cream of the crop in talent South East Europe has to offer. DEVit, now in its fourth year, has become the defacto meeting point of all seasoned web development professionals.
Whether it’s Frontend, UI/UX, Backend, DevOps or Mobile that you care about, join us to learn about the most modern practices and techniques.
DEVit is a non-profit conference organized by volunteers. All proceeds are used to bringing top-tier speakers and organizing advanced workshops on all trending web technologies.
DEVit is a collective effort of a number of people, professionals and students, technical and not.
Without them, DEVit would never have happened. A big thank you to all people that offer their time, their knowledge and their energy to help organizing and run DEVit. In alphabetical order:
{{ site.data.team.volunteers.current | join: ', ' }}
And even a bigger thanks to our past volunteers! In alphabetical order:
{{ site.data.team.volunteers.old | join: ', ' }}


= Sessions Controller
This class manages user sign-in and sign-out using a chosen identity provider. It works in conjunction with the OmniAuth, OmniAuth OpenID Connect, and Rack-OAuth2 gems to perform the authentication.
GET /auth/:provider/callback
Acts as the callback routine from the identity provider and creates and initializes the session for signin. Information about the user is provided as part of the callback request, which we store in the session variable.
# File app/controllers/sessions_controller.rb, line 39
def create
Rails.logger.debug "========== Begin callback redirection from identity provider =========="
%w(auth origin params strategy).each do |attribute|
Rails.logger.debug "------ #{attribute}, #{request.env["omniauth.#{attribute}"].inspect} ------"
end
omniauth = request.env['omniauth.auth']
Rails.logger.debug "------ omniauth = #{omniauth.inspect} ------"
session[:email] = omniauth['info']['email']
Rails.logger.debug "------ email = #{omniauth['info']['email']} ------"
Rails.logger.debug "========== End callback redirection from identity provider =========="
redirect_to root_url, notice: "Signed in!"
end
DELETE /signout
Clears out the session information, effectively signing the user out.
# File app/controllers/sessions_controller.rb, line 87
def destroy
session[:email] = nil
redirect_to root_url, notice: "Signed out!"
end
GET /signin
Provides the list of identity providers to choose from to signin.
# File app/controllers/sessions_controller.rb, line 19
def new
@identity_providers = IdentityProvider.all
if @identity_providers.size > 0
render
else
redirect_to root_path,
alert: "Sorry, but no trusted identity providers are available."
end
end
GET /auth/:provider/setup
# File app/controllers/sessions_controller.rb, line 62
def setup
Rails.logger.debug "========== Begin setup =========="
options = request.env['omniauth.strategy'].options
Rails.logger.debug "------ private_key = #{Application.private_key} ------"
jws = jwt_token(options)
Rails.logger.debug "------ jws = #{jws} ------"
options[:client_options][:client_assertion] = jws
Rails.logger.debug "------ omniauth.strategy = #{request.env['omniauth.strategy'].options.inspect} ------"
render :text => "Omniauth setup phase.", :status => 200
Rails.logger.debug "========== End setup =========="
end


Draw the plan of your space. Click on the canvas to create the corners.
Hit
Enter
to close shape! Hit
Backspace
to delete the shape. Hit
Arrow Left
to Undo.
Continue
Close Shape
Delete Shape
Undo


Home Page (as appears in the Internet version)
Foreword
Overview of Remote Sensing
Introduction: Theoretical, and Technical Perspectives of Remote Sensing; Special Applications
Geophysical Remote Sensing: External Fields; Magnetics / Geophysical Remote Sensing: Gravity / Geophysical Remote Sensing: Crustal Dynamics; Seismology
The Electromagnetic Spectrum: The Photon / Transmittance, Absorptance, and Reflectance / The Electromagnetic Spectrum: Distribution of Radiant Energies / Spectral Signatures
History of Remote Sensing; Remote Sensing Systems:
In the Beginning; Launch Vehicles / Table: History of Remote Sensing into the 1970s/ Multispectral Images / Film as a Recording Medium / Color & False Color Composites / Apollo 9 Multispectral Images / Earth Resources Technology Satellite (ERTS-1) / Multi-Spectral Scanner (MSS) / A Landsat Image / MSS Histograms / Table: Best MSS Bands for Identifying Surface Features / Thematic Mapper (TM) / Examples of TM Imagery / Other Remote Sensing Systems: MOMS and SPOT / IRS-1, JERS, RESURS, OKEAN, CBERS, and MicroSat (AlSat-1) Series / Hyperspectral Imaging / Radar and Thermal Systems / Meteorological, Oceanographic, and Earth Systems Satellites
/ Humans in Space: Long Term Mobile and Fixed Stations / The Commercialization of Space / The Systems (Multisource) Approach to Remote Sensing / Military Intelligence Satellites / Medical Applications of Remote Sensing
Concluding Remarks
Maps and Attributes / Data Elements and Models / GIS Defined / A GIS Case Study in Africa / Decision Making; Suitability Determination / Conducting a GIS Analysis / The PP&L Siting Problem / A GIS/Remote Sensing Case Study in Archaeology: Burgundy, France / References
Distribution of Craters / Cratering Mechanics / Shock Metamorphism / Crater Morphology; Major Impact Structures / Remote Sensing of Craters
Preface (including a review of Relativity and Quantum Physics) / Origin and Early Development of the Universe; Big Bang Eras; Expansion of Space / The Hubble Space Telescope; Galaxies / Images of Galaxies and Stars outside the Visible Light Range. / Special Features of Galaxies: Colliding Galaxies; Galactic Gases; Starbursts and Active Galactic Nucleus / Birth, Life, and Death of Stars / The Genesis Mission / Novae and Supernovae; Pulsars, Quasars, and Black Holes; Gamma Ray Bursts; and Colliding Stars / Spectral Analysis of Star Composition; Element Synthesis in Stars / Space-Time and Expansion / Evidence for the Big Bang; the Redshift; Galactic Distances; Age of the Universe; Cosmic Background Radiation; Expansion Models; Dark Matter and Energy / Recent Innovations about the Concept of "Universe": Dark Energy and an Accelerating Universe?; Varieties of Universes (Multiverses); Philosophical Implications / Origin of Planetary Systems / Origin and Nature of Life on Planetary Bodies; Some Additional (Metaphysical) Comments / Letters by N.M. Short regarding Creationism and Intelligent Design
The 1970's
Introduction / American Space Policy / American Civilian Space Program (NASA) / American Military Space Program: Initial Military Operations / Russian Space Program / European, Asian, and Commercial Space ProgramsThe 1980's
Introduction / American Space Policy / American Civilian Space Program (NASA) / American Military Space Program: Initial Military Operations / Russian Space Program / European, Asian, and Commercial Space ProgramsThe 1990's
Introduction & American Space Policy/ American Civilian Space Program (NASA) / American Military Space Program: Initial Military Operations / Russian Space Program / European, Asian, and Commercial Space Programs
Introduction / The Nature of Satellite Digital Data / Digitization / Image Processing / Introduction to PIT / Installing PIT from the Internet / Installing PIT from the CD-ROM / General Overview of PIT / Displaying Images / Histograms and Scatter Plots / Ratioing and Principal Components / Unsupervised Classifications / Supervised Classifications / Conclusion
Introduction / Linear Combinations / Singular Matrices / Space / Standardizing Sets
Last Updated: July 15, 2004
The Tutorial is hosted by the EOS-Goddard Program Office (Code 420). Please direct any questions or comments regarding the Website to John Bolton of that office.


We just like to. We like logos and enjoy sharing our love with other people. We also hate seeing people without a custom profile picture and hopefully this website can help remedy that issue.
Most of them are just a matter of copy pasting an image of the logo into Adobe Illustrator and tracing it into a vector format so that we can put it on that backgrounds that we've also made in Illustrator in the colors that we want so that it matches all our other logos. But that only works for logos that already exist in the world like video game or superhero logos, every single logo found in Abstract, Animals, Objects, Food, Other, Sports, and Symbols pages were handmade by us. Most of those logos are pretty easy logos that you could find just about anywhere though, so don't be too impressed.
"We" are actually just me, there's currently only one person on the team that made this website, Nathanael Jacobsma, and I go by the username of Blockhead. I have worked to make all of the images, the website flow and layout, absolutely eveything was done by me so far. I do however use my friends for suggestions on what logos I should add, since my knowledge of the world doesn't encompass everything.


| Solar System | |
|---|---|
| Mercury |
Uranus is the seventh planet from the Sun. It has the third-largest planetary radius and fourth-largest planetary mass in the Solar System. Uranus is similar in composition to Neptune, and both have bulk chemical compositions which differ from that of the larger gas giants Jupiter and Saturn. |
| Venus | |
| Earth | |
| Mars | |
| Jupiter | |
| Saturn | |
| Uranus | |
| Neptune | |
| Pluto |


As part of the application process for the Fresh Tilled Soil User Experience Apprenticeship program, a select group of finalists were asked to attend a daylong bootcamp focused on UX design sprints. During the course of the day, we were told that we would have one week to complete a design sprint that would result in a product aimed at solving a problem related to travel.
Before breaking off to work independently for the week, we partook in a whiteboarding brainstorming session around problems individuals and companies face when it comes to travel. We then broke off and were given the week to focus ona specific problem and create a product solution to solve it.
I chose to focus on commuting, specifically how it relates to, and can be eased via, the sharing economy. I structured my week around Google Venture’s five day design sprints, each day given a specific task (Understand, Diverge, Decide, Prototype, Validate).
My competitive analysis, user tests, personas, empathy maps, problem/solution sets, and sketches led me to create a mobile application to marry drivers willing to give rides with passengers willing to pay for transportation to and from work.
Once the research phase was completed, I created low fidelity wireframes which ultimately were input into an Invision prototype for further user testing of my hypotheses.
Key findings concluded that safety and ease of use would be the most important factors for application adoption for users, and next steps would surely have been testing on a larger sample.
The Invision prototype can be view, and interacted with, by copying and pasting the below url into your browser.
http://invis.io/FQ1YHF0ZN


pywinauto.tests.repeatedhotkey¶
Repeated Hotkeys Test
What is checked This test checks all the controls in a dialog to see if there are controls that use the same hotkey character.
How is it checked A list of all the hotkeys (converted to uppercase) used in the dialog is created. Then this list is examined to see if any hotkeys are used more than once. If any are used more than once a list of all the controls that use this hotkey are compiled to be used in the bug report.
When is a bug reported If more than one control has the same hotkey then a bug is reported.
Bug Extra Information The bug contains the following extra information Name Description RepeatedHotkey This is the hotkey that is repeated between the 2 controls converted to uppercase, String CharsUsedInDialog This is a list of all the hotkeys used in the dialog, String AllCharsInDialog This is a list of all the characters in the dialog for controls that have a hotkeys, String AvailableInControlS A list of the available characters for each control. Any of the characters in this list could be used as the new hotkey without conflicting with any existing hotkey.
Is Reference dialog needed The reference dialog does not need to be available. If it is available then for each bug discovered it is checked to see if it is a problem in the reference dialog. NOTE: Checking the reference dialog is not so exact here! Only when the equivalent controls in the reference dialog all have the hotkeys will it be reported as being in the reference also. I.e. if there are 3 controls with the same hotkey in the Localised software then those same controls in the reference dialog must have the same hotkey for it to be reported as existing in the reference also.
False positive bug reports There should be very few false positives from this test. Sometimes a control only has one or 2 characters eg “X:” and it is impossible to avoid a hotkey clash. Also for Asian languages hotkeys should be the same as the US software so probably this test should be run on those languages.
Test Identifier The identifier for this test/bug is “RepeatedHotkey”
pywinauto.tests.repeatedhotkey.
GetHotkey
(text)¶Return the position and character of the hotkey
pywinauto.tests.repeatedhotkey.
ImplementsHotkey
(win)¶checks whether a control interprets & character to be a hotkey
pywinauto.tests.repeatedhotkey.
RepeatedHotkeyTest
(windows)¶Return the repeated hotkey errors


Will you release a DSi Hacking Guide?
Yes, in the future. Currently, RocketLauncher and HiyaCFW are in development, meaning there's no real need to create a guide.
Creating a guide at this point is completely pointless and simply misleads people.
What is Homebrew?
Homebrew usually refers to software that is not authorized by Nintendo. Installing a homebrew exploit will allow you to run homebrew games, use tools like save editing and backup, and use emulators for various older systems.
Homebrew will be 100% free using the DSi Browser Application or the DSi Flipnote Application, however that has not been released yet.
What is RocketLauncher?
RocketLauncher is a DSi exploit on the firmware version 1.4. It will only ever work on 1.4. Firmwares below or above 1.4 do not work.
This is because on the version 1.4, Nintendo forgot to reimplement RSA checks on the DS card whitelist.
What is HiyaCFW?
HiyaCFW is the first CFW (Custom Firmware) for the DSi. It runs using RocketLauncher, meaning that only version 1.4 is compatible.
The custom firmware includes RSA and signature patchers, has a custom launcher, and is region-free. You will be able to install free DSiWare as well as custom applications and homebrew into the DSi Menu.
Further guides and info


Linked Lists¶
Original Source:
Linked lists are like a lesser-known cousin of lists. They’re not as popular or as cool, and you might not even remember them from your algorithms class. But in the right context, they can really shine.
Linked lists are an ordered collection of objects. So what makes them different from normal lists? Linked lists differ from lists in the way that they store elements in memory. While lists use a continuous memory block to store references to their data, linked lists store references as part of their own elements.
Main Concepts¶
Before going more in depth on what linked lists are and how you can use them, you should first learn how they are structured. Each element of a linked list is called a node, and every node has two different fields:
Data contains the value to be stored in the node.
Next contains a reference to the next node on the list.
Here’s what a typical node looks like:
A linked list is a collection of nodes. The first node is called the head, and it’s used as the starting point for any iteration through the list. The last node must have its next reference pointing to None to determine the end of the list. Here’s how it looks:
Practical Applications¶
Linked lists serve a variety of purposes in the real world. They can be used to implement queues or stacks as well as graphs. They’re also useful for much more complex tasks, such as lifecycle management for an operating system application.
Queues or Stacks¶
Queues and stacks differ only in the way elements are retrieved. For a queue, you use a First-In/First-Out (FIFO) approach. That means that the first element inserted in the list is the first one to be retrieved:
In the diagram above, you can see the front and rear elements of the queue. When you append new elements to the queue, they’ll go to the rear end. When you retrieve elements, they’ll be taken from the front of the queue.
For a stack, you use a Last-In/Fist-Out (LIFO) approach, meaning that the last element inserted in the list is the first to be retrieved:
In the above diagram you can see that the first element inserted on the stack (index 0) is at the bottom, and the last element inserted is at the top. Since stacks use the LIFO approach, the last element inserted (at the top) will be the first to be retrieved.
Because of the way you insert and retrieve elements from the edges of queues and stacks, linked lists are one of the most convenient ways to implement these data structures.
Graphs (WIP)¶
Graphs can be used to show relationships between objects or to represent different types of networks. For example, a visual representation of a graph—say a directed acyclic graph (DAG)—might look like this:
There are different ways to implement graphs like the above, but one of the most common is to use an adjacency list. An adjacency list is, in essence, a list of linked lists where each vertex of the graph is stored alongside a collection of connected vertices:
Vertex |
Linked List of Vertices |
|---|---|
1 |
2 → 3 → None |
2 |
4 → None |
3 |
None |
4 |
5 → 6 → None |
5 |
6 → None |
6 |
None |
In the table above, each vertex of your graph is listed in the left column. The right column contains a series of linked lists storing the other vertices connected with the corresponding vertex in the left column. This adjacency list could also be represented in code using a dict:
graph = {
1: [2, 3, None],
2: [4, None],
3: [None],
4: [5, 6, None],
5: [6, None],
6: [None]
}
The keys of this dictionary are the source vertices, and the value for each key is a list. This list is usually implemented as a linked list.
Note
In the above example you could avoid storing the None
values, but we’ve retained them here for clarity and consistency with later examples.
In terms of both speed and memory, implementing graphs using adjacency lists is very efficient in comparison with, for example, an adjacency matrix. That’s why linked lists are so useful for graph implementation.
Performance Comparison: Lists vs Linked Lists (WIP)¶
In most programming languages, there are clear differences in the way linked lists and arrays are stored in memory. In Python, however, lists are dynamic arrays. That means that the memory usage of both lists and linked lists is very similar.
Since the difference in memory usage between lists and linked lists is so insignificant, it’s better if you focus on their performance differences when it comes to time complexity.
Insertion and Deletion of Elements¶
In Python, you can insert elements into a list using .insert()
or .append()
. For removing elements from a list, you can use their counterparts: .remove()
and .pop()
.
The main difference between these methods is that you use .insert()
and .remove()
to insert or remove elements at a specific position in a list, but you use .append()
and .pop()
only to insert or remove elements at the end of a list.
Now, something you need to know about Python lists is that inserting or removing elements that are not at the end of the list requires some element shifting in the background, making the operation more complex in terms of time spent.
With all this in mind, even though inserting elements at the end of a list using .append()
or .insert()
will have constant time, O(1), when you try inserting an element closer to or at the beginning of the list, the average time complexity will grow along with the size of the list: O(n).
Linked lists, on the other hand, are much more straightforward when it comes to insertion and deletion of elements at the beginning or end of a list, where their time complexity is always constant: O(1).
For this reason, linked lists have a performance advantage over normal lists when implementing a queue (FIFO), in which elements are continuously inserted and removed at the beginning of the list. But they perform similarly to a list when implementing a stack (LIFO), in which elements are inserted and removed at the end of the list.
Retrieval of Elements¶
When it comes to element lookup, lists perform much better than linked lists. When you know which element you want to access, lists can perform this operation in O(1) time. Trying to do the same with a linked list would take O(n) because you need to traverse the whole list to find the element.
When searching for a specific element, however, both lists and linked lists perform very similarly, with a time complexity of O(n). In both cases, you need to iterate through the entire list to find the element you’re looking for.
Introducing collections.deque
¶
In Python, there’s a specific object in the collections module that you can use for linked lists called deque
(pronounced “deck”), which stands for double-ended queue.
collections.deque
uses an implementation of a linked list in which you can access, insert, or remove elements from the beginning or end of a list with constant O(1) performance.
How to Use collections.deque¶
There are quite a few methods that come, by default, with a deque object. However, here you’ll only touch on a few of them, mostly for adding or removing elements.
'''First, you need to create a linked list.
You can use the following piece of code to
do that with deque:'''
from collections import deque
deque()
'''The code above will create an empty linked list.
If you want to populate it at creation, then you can
give it an iterable as input:'''
deque(['a','b','c'])
deque('abc')
deque([{'data': 'a'}, {'data': 'b'}])
Output:
deque([])
deque([‘a’, ‘b’, ‘c’])
deque([‘a’, ‘b’, ‘c’])
deque([{‘data’: ‘a’}, {‘data’: ‘b’}])
When initializing a deque object, you can pass any iterable as an input, such as a string (also an iterable) or a list of objects.
Now that you know how to create a deque object, you can interact with it by adding or removing elements. You can create an abcde
linked list and add a new element f
like this:
from collections import deque
'''Creating the linked list'''
linkedlist = deque("abcde")
print(linkedlist)
'''Appending f to the right'''
linkedlist.append('f')
print(linkedlist)
'''Removing f from the right'''
linkedlist.pop()
print(linkedlist)
'''Appending x to the left'''
linkedlist.appendleft('x')
print(linkedlist)
'''Removing x from the right'''
linkedlist.popleft()
print(linkedlist)
'''Just the popped element'''
print(linkedlist.popleft())
print(linkedlist.pop())
Output:
deque([‘a’, ‘b’, ‘c’, ‘d’, ‘e’])
deque([‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’])
deque([‘a’, ‘b’, ‘c’, ‘d’, ‘e’])
deque([‘x’, ‘a’, ‘b’, ‘c’, ‘d’, ‘e’])
deque([‘a’, ‘b’, ‘c’, ‘d’, ‘e’])
a
e
How to Implement Queues and Stacks#¶
As you learned above, the main difference between a queue and a stack is the way you retrieve elements from each. Next, you’ll find out how to use collections.deque to implement both data structures.
Queues¶
With queues, you want to add values to a list (enqueue), and when the timing is right, you want to remove the element that has been on the list the longest (dequeue). For example, imagine a queue at a trendy and fully booked restaurant. If you were trying to implement a fair system for seating guests:
from collections import deque
queue = deque()
'''Add people as they come to the restaurant
most recent being last element'''
queue.append("Rahul")
queue.append("Gayle")
queue.append("Shelly")
print(queue)
'''Once a table is empty you can quickly check
who should it be ssigned to and remove them from queue(FIFO)'''
print(queue.popleft())
'''Updated queue'''
print(queue)
Output:
deque([‘Rahul’, ‘Gayle’, ‘Shelly’])
Rahul
deque([‘Gayle’, ‘Shelly’])
Stacks¶
What if you wanted to create a stack instead? Well, the idea is more or less the same as with the queue. The only difference is that the stack uses the LIFO approach, meaning that the last element to be inserted in the stack should be the first to be removed.
Imagine you’re creating a web browser’s history functionality in which store every page a user visits so they can go back in time easily. Assume these are the actions a random user takes on their browser:
Visits Real Python’s website
Navigates to Pandas: How to Read and Write Files
Clicks on a link for Reading and Writing CSV Files in Python
If you’d like to map this behavior into a stack, then you could do something like this:
from collections import deque
'''Store History most recent being first element'''
history = deque()
history.appendleft("https://realpython.com/")
history.appendleft("https://realpython.com/pandas-read-write-files/")
history.appendleft("https://realpython.com/python-csv/")
print(history)
'''Now suppose user presses the back button
then the last page should open up not the first page(LIFO)'''
print(history.popleft())
print(history.popleft())
print(history)
Output:
deque([‘https://realpython.com/python-csv/’, ‘https://realpython.com/pandas-read-write-files/’, ‘https://realpython.com/’])
https://realpython.com/python-csv/
https://realpython.com/pandas-read-write-files/
deque([‘https://realpython.com/’])
From the examples above, you can see how useful it can be to have collections.deque in your toolbox, so make sure to use it the next time you have a queue- or stack-based challenge to solve.
Implementing Your Own Linked List¶
Now that you know how to use collections.deque for handling linked lists, you might be wondering why you would ever implement your own linked list in Python. There are a few reasons to do it:
Practicing your Python algorithm skills
Learning about data structure theory
Preparing for job interviews


LOGGED IN AS
Mike Greene
Your session is timed out. Please enter your password to proceed.
Not you?
Login as a different user


public static final int |
BASH_RADIUS_SQUARED |
2 |
public static final double |
BEAVER_MINE_MAX |
2.0 |
public static final int |
BEAVER_MINE_RATE |
20 |
public static final int |
BROADCAST_MAX_CHANNELS |
65535 |
public static final int |
BYTECODES_PER_SUPPLY |
1000 |
public static final double |
DIAGONAL_DELAY_MULTIPLIER |
1.4 |
public static final double |
DRONE_VOID_DELAY_MULTIPLIER |
2.0 |
public static final int |
EXCEPTION_BYTECODE_PENALTY |
500 |
public static final int |
FLASH_COOLDOWN |
20 |
public static final double |
FLASH_MOVEMENT_DELAY |
1.0 |
public static final int |
FLASH_RANGE_SQUARED |
10 |
public static final int |
FREE_BYTECODES |
2000 |
public static final double |
HEAVY_HANDS_ATTACK_DELAY |
3.0 |
public static final double |
HEAVY_HANDS_MOVEMENT_DELAY |
3.0 |
public static final int |
HQ_BUFFED_ATTACK_DELAY |
1 |
public static final int |
HQ_BUFFED_ATTACK_RADIUS_SQUARED |
35 |
public static final double |
HQ_BUFFED_DAMAGE_MULTIPLIER_LEVEL_1 |
1.5 |
public static final double |
HQ_BUFFED_DAMAGE_MULTIPLIER_LEVEL_2 |
10.0 |
public static final double |
HQ_BUFFED_DAMAGE_RATIO_LEVEL_1 |
0.8 |
public static final double |
HQ_BUFFED_DAMAGE_RATIO_LEVEL_2 |
0.5 |
public static final double |
HQ_BUFFED_DAMAGE_RATIO_LEVEL_3 |
0.3 |
public static final int |
HQ_BUFFED_SPLASH_RADIUS_SQUARED |
2 |
public static final double |
HQ_BUFFED_SPLASH_RATE |
0.5 |
public static final int |
HQ_ORE_INCOME |
5 |
public static final double |
IMPROVED_LEADERSHIP_DAMAGE_BONUS |
2.0 |
public static final double |
LEADERSHIP_DAMAGE_BONUS |
1.0 |
public static final int |
LEADERSHIP_RANGE_SQUARED |
24 |
public static final int |
MAP_MAX_HEIGHT |
120 |
public static final int |
MAP_MAX_WIDTH |
120 |
public static final int |
MAP_MIN_HEIGHT |
30 |
public static final int |
MAP_MIN_WIDTH |
30 |
public static final double |
MINER_MINE_MAX |
2.5 |
public static final int |
MINER_MINE_MAX_UPGRADED |
4 |
public static final int |
MINER_MINE_RATE |
4 |
public static final double |
MINIMUM_MINE_AMOUNT |
0.2 |
public static final int |
MINING_LOADING_DELAY |
1 |
public static final int |
MINING_MOVEMENT_DELAY |
2 |
public static final int |
MISSILE_LIFESPAN |
5 |
public static final int |
MISSILE_MAX_COUNT |
5 |
public static final double |
MISSILE_MAXIMUM_DAMAGE |
1.0 |
public static final int |
MISSILE_RADIUS_SQUARED |
2 |
public static final int |
MISSILE_SPAWN_FREQUENCY |
8 |
public static final int |
NUMBER_OF_INDICATOR_STRINGS |
3 |
public static final int |
NUMBER_OF_TOWERS_MAX |
6 |
public static final int |
ORE_INITIAL_AMOUNT |
500 |
public static final double |
REGEN_RATE |
1.0 |
public static final int |
ROUND_MAX_LIMIT |
3000 |
public static final int |
ROUND_MIN_LIMIT |
2000 |
public static final double |
SUPPLY_DECAY |
0.0 |
public static final double |
SUPPLY_GEN_BASE |
100.0 |
public static final double |
SUPPLY_GEN_EXPONENT |
0.6 |
public static final double |
SUPPLY_GEN_MULTIPLIER |
2.0 |
public static final int |
SUPPLY_TRANSFER_RADIUS_SQUARED |
15 |
public static final int |
TEAM_MEMORY_LENGTH |
32 |
public static final int |
XP_RANGE |
24 |
public static final int |
XP_REQUIRED_FLASH |
0 |
public static final int |
XP_REQUIRED_HEAVY_HANDS |
1500 |
public static final int |
XP_REQUIRED_IMPROVED_LEADERSHIP |
2000 |
public static final int |
XP_REQUIRED_LEADERSHIP |
1000 |


library(tidyverse)
library(ggdist)
library(brms)
library(insight)
library(performance)
theme_set(theme_light())
<- read_csv(here::here("data", "births_and_under_five_by_county_2022_09_17.csv"))
model_data <- read_csv(here::here("data", "under_five_by_tract_2022_09_19.csv")) tract_data
Intro
In my previous post, I estimated risk of sudden unexpected infant death in census tracts while acknowledging that I was using the wrong denominator. I should have been using the count of live births in each census tract, but I have not been able to find counts of live births at such a fine geographic scale. The data we do have available from the U.S. Census is the count of children under five years old (5yo) per census tract, so I was using that as a proxy for the count of live births over a five year period. In the future, I want to be more accurately approximate the true denominator.
My objective for this blog post is to fit models of counts of live births regressed from counts of children under 5yo at the county level so I can estimate counts of live births at the census tract level.
Sidenote: Despite my enthusiasm for Bayesian statistics, I have little practice with fitting models using MCMC methods, so this is also a chance for me to explore doing so with the R package {brms}. Section 6.2 of “Bayes Rules” describes MCMC methods more in detail if interested, but if not, just note that when Bayesian models get sufficiently complex, you use MCMC sampling to approximate a model solution when it would otherwise be too mathematically difficult.
Data Exploration
Let’s start with some exploration of the variables and their relationships in the model data: Here’s a glimpse at what we’re working with:
Code
glimpse(model_data)
Rows: 3,142
Columns: 3
$ GEOID <chr> "01099", "01079", "01077", "01097", "01009", "01067", "…
$ pop_under_five <dbl> 20733, 32924, 92729, 413210, 57826, 17205, 164542, 2970…
$ births <dbl> 1052, 1804, 4652, 27790, 3318, 837, 9488, 1513, 6555, 1…
Univariate
Here is the distribution of our county-level target parameter, counts of live births:
Code
|>
model_data ggplot(aes(x = births)) +
stat_dotsinterval() +
labs(
title = "Counts of Live Births in Each County of the USA from 2015-2019",
x = "Count of Live Births",
y = "Density"
)
This distribution is highly skewed right, so it’s hard to intuit visually. As a couple of supplements, here’s a table of percentiles:
Code
quantile(model_data$births)
0% 25% 50% 75% 100%
0 612 1481 3931 623037
And here is the same distribution on a log-transformed x-axis:
Code
|>
model_data ggplot(aes(x = births + 1E-10)) +
stat_dotsinterval() +
labs(
title = "Counts of Live Births in Each County of the USA from 2015-2019",
x = "Count of Live Births on Log Scale",
y = "Density"
+
) scale_x_log10()
Notice the one county with an outlier of purportedly zero births.
Perhaps unsurprisingly, we observe similar trends from our predictor variable, the count of children under 5yo (pop_under_five):
Code
ggplot(model_data, aes(x = pop_under_five)) +
stat_dotsinterval() +
labs(
title = "Counts of Children Under 5yo in Each County of the USA from 2015-2019",
x = "Count of Children Under 5yo",
y = "Density"
)
Code
quantile(model_data$pop_under_five)
0% 25% 50% 75% 100%
86.00 10902.50 25726.00 68072.75 10039107.00
Code
ggplot(model_data, aes(x = pop_under_five)) +
stat_dotsinterval() +
labs(
title = "Counts of Children Under 5yo in Each County of the USA from 2015-2019",
x = "Count of Children Under 5yo on Log Scale",
y = "Density"
+
) scale_x_log10()
Bivariate
Let’s test whether our target variable and predictor have a linear relationship:
Code
|>
model_data ::cor_test(x = "pop_under_five", y = "births") |>
correlationplot() +
labs(
x = "Count of Children Under 5yo",
y = "Count of Live Births"
)
Awesome, the correlation coefficient is extremely high and the p value is below 0.01, let’s make a linear model! Not so fast, as noted earlier, it’s hard to assess these relationships visually, because they are so skewed. Indeed, if you log transform either axis, you start to see how the relationship breaks down:
Code
|>
model_data ::cor_test(x = "pop_under_five", y = "births") |>
correlationplot() +
labs(
x = "Count of Children Under 5yo on a Log Scale",
y = "Count of Live Births"
+
) scale_x_log10()
It looks like a linear line describes the relationship well in the middle range, but not so much at small or large values of the predictor variable. To get a better understanding, let’s go ahead and fit a linear model and check its assumptions:
Code
<- lm(births ~ pop_under_five, data = model_data)
freq_linear_model
check_model(
freq_linear_model, check = c("qq", "homogeneity"),
panel = FALSE
|> plot() )
$HOMOGENEITY
$QQ
I won’t claim to be an expert at reading model diagnostics, but these plots pretty demonstrably suggest that the model is violating assumptions of homogeneity of variance as well as normality. As suggested by our previous scatterplot, this translates to the model poorly predicting birth counts at extreme values of the predictor variable. That’s not to say a linear model isn’t useful. I think especially if you were to subset it to data within a certain order of magnitude, it would perform decently well. But let’s see if we can do better than that!
Bayesian Modeling Using MCMC
As mentioned in the intro, I’m using this post as an opportunity to practice regression modeling under a Bayesian MCMC framework rather than the traditional Frequentist approach. Refer back to my last post on what makes Bayesian methods unique and when you might choose to use them. Long story short, they allow you to incorporate your prior knowledge into a model and they perform better when data is limited by small sample sizes or rare events. In this particular use case (predicting counts of live births from counts of children under 5yo), we have a large robust data set to draw upon, so I don’t expect Bayesian methods to perform that differently from Frequentist ones, but I figure that will make it easier to practice without the modeling process being too finicky.
Packages like {brms} and {rstanarm} make it easy to take a pre-existing Frequentist model and drop it into a Bayesian framework. For example you can take our previous linear model:
<- lm(births ~ pop_under_five, data = model_data) freq_linear_model
And wrap it in the function brm() instead:
<- brm(births ~ pop_under_five, data = model_data) bayesian_linear_model
If you’re following along at home, try not to be alarmed by long output produced by the code above. Basically, the software back-end is just sending you regular updates as it approximates the model solution.
To find a better fit for the data than that from linear regression, let’s try modeling the outcome as a negative binomial distribution. I expect this to be more accurate because it is designed to describe discrete, count variables and it is flexible enough to fit the data even when it is very right skewed. For an improved fit, I will also log transform the predictor variable to make it more closely approximate a normal distribution:
<- brm(
negbinomial_model ~ log(pop_under_five),
births data = model_data,
family = negbinomial()
)
Let’s compute some metrics comparing relative performance between the two models:
Code
compare_performance(bayesian_linear_model, negbinomial_model, rank = TRUE) |> print_html()
| Comparison of Model Performance Indices | ||||||
| Name | Model | R2 | RMSE | WAIC weights | LOOIC weights | Performance-Score |
|---|---|---|---|---|---|---|
| bayesian_linear_model | brmsfit | 0.99 | 2479.34 | 0.00e+00 | 0.007 | 50.00% |
| negbinomial_model | brmsfit | 0.98 | 2650.21 | 1.00 | 0.993 | 50.00% |
| NA |
The compare_performance() function’s ranking algortihm is a little confused because the linear model does better with the data at hand; it accounts for variance in the outcome slightly better (higher R2 metric) and has slightly smaller residuals from its predictions (smaller RMSE metric). However, its important to note that both R2 and RMSE are in similar orders of magnitude for both models. More importantly for us, the WAIC and LOOIC metrics strongly favor the negative binomial model. LOOIC and WAIC try to balance between accurately fitting the data at hand while maintaining generalizability to new data. Before we generalize though, let’s visualize what the negative binomial model’s fit looks like with the data at hand:
Code
pp_check(negbinomial_model) +
scale_x_log10() +
scale_color_manual(
values = c("red", "blue"),
labels = c("Observed", "Predicted")
+
) labs(
title = "Predictions Vs. Observations for Negative Binomial Model \n Predicting Counts of Live Births from Counts of Children Under 5yo",
x = "Live Birth Count",
y = "Density"
)
The predicted blue distributions closely trace the observed red distribution, visually supporting the strong fit suggested by our metrics.
New Predictions
The differences in generalizability between the two models will become more apparent when we turn to the original goal and predict counts of live births at the census tract level. Remember that the U.S. Census provides estimates of the counts of children under 5yo in census tracts, but does not provide estimates of counts of live births. Here is the distribution of our predictor variable at the new geographic level:
Code
|>
tract_data ggplot(aes(x = pop_under_five)) +
stat_dotsinterval() +
labs(
title = "Counts of Children Under 5yo in \n Each Census Tract of Cook County Illinois from 2015-2019",
x = "Count of Children under 5yo",
y = "Density"
)
Notice that the counts of children under 5yo at the tract level are distributed at much lower values than those at the county level (makes sense). This should make us cautious since we’ll be extrapolating our models to a new range of data. Let’s start with what the linear model predicts:
Code
$lm_predicted_births <- get_predicted(bayesian_linear_model, newdata = tract_data)
tract_data
|>
tract_data ggplot(aes(x = lm_predicted_births)) +
stat_dotsinterval() +
labs(
title = "Counts of Live Births Predicted Using Linear Regression \n in Each Census Tract of Cook County, Illinois from 2015-2019",
x = "Linear Predicted Count of Live Births",
y = "Density"
)
Uh oh, every single count is predicted by the linear model to be negative. You can’t have a negative count!
Let’s see how the negative binomial model does:
Code
$nbinom_predicted_births <- get_predicted(negbinomial_model, newdata = tract_data)
tract_data
|>
tract_data ggplot(aes(x = nbinom_predicted_births)) +
stat_dotsinterval() +
labs(
title = "Counts of Live Births Predicted Using Negative Binomial Regression \n in Each Census Tract of Cook County, Illinois from 2015-2019",
x = "Negative Binomial Predicted Count of Live Births",
y = "Density"
)
That makes much more sense, the predicted counts go no lower than zero, and these predictions correspond to tracts where the counts of children under 5yo were also zero:
Code
bind_rows(
head(arrange(tract_data, pop_under_five), 3),
slice_sample(tract_data, n = 3),
slice_max(tract_data, order_by = pop_under_five, n = 3)
)
# A tibble: 9 × 4
GEOID pop_under_five lm_predicted_births nbinom_predicted_births
<dbl> <dbl> <gt_prdct> <gt_prdct>
1<PHONE_NUMBER>0 0 -344.9329 0.000000
2<PHONE_NUMBER>0 0 -344.9329 0.000000
3<PHONE_NUMBER>0 0 -344.9329 0.000000
4<PHONE_NUMBER>2 88 -339.3627 4.739437
5<PHONE_NUMBER>1<PHONE_NUMBER> 8.508460
6<PHONE_NUMBER>0<PHONE_NUMBER> 14.497711
7<PHONE_NUMBER>6<PHONE_NUMBER> 53.554069
8<PHONE_NUMBER>2<PHONE_NUMBER> 50.985029
9<PHONE_NUMBER>0<PHONE_NUMBER> 50.650037
The negative binomial model generalizes better and creates more sensible predictions in a new range of predictor values. In future work, I’ll use these estimated counts of live births to estimate the underlying risk process for sudden unexpected infant death. Thanks for reading!


SUBMIT
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhere


This is the link to download and see Team One's project for Matematic Remedial. Read more for details!
Read moreRafli Jaskandi official channel, soon there will be new video comming up, don't forget to subscribe so you don't miss any new videos. Read more for details!
Read moreToday, much of user is complaining about their problem of an unwanted program showing at their pc, and we have the solution for it. Read more for details!
Read moreHere, I'll explain whre I learn coding in these months, there is so much choices, but for you that find a free courses and place for train your skills. You can found it here! Read more for details!
Read moreHere, I'll explain you from my investigation that served for you to prevent from entering fake official website. Right now, we can found much phishing attempt , and here, I'll show you the difference between fake and the real one from much side, this can be understanable for novice, intermediate, or even advanced on Internet. Read more for details!
Read More


I am Mitch Muhu.I am a simple, creative, enthusiastic and fun-loving person. I always like to create something which will be helpful to others.
I have vast knowledge in HTML5, CSS3, Javascript, JQuery, and Python.
Name: Mitch Muhu
Age: 18 years
Phone: +254704941404
Email: mitchndungu21@gmail.com


2 people, including 1 teen, shot in South Los Angeles, police search for suspects
LOS ANGELES (KABC) -- Two people were shot near 84th and Hoover Streets in South Los Angeles Friday afternoon.
Initial reports said two teenage boys, ages 15 and 13, were shot in front of an apartment complex.
Officers said the 15-year-old was hit in the arm and then took off.
The 13-year-old was shot in the abdomen and taken to a hospital in unknown condition.
There was no suspect description available.


APC condemns Dickson's appointment of 35 permanent secretaries
- The All Progressives Congress (APC) in Bayelsa state has kicked against the recent appointment of 35 permanent secretaries done by Governor Seriake Dickson
- According to the party, the appointment does not follow the rules and regulations of the civil service
- The party also wondered why the governor waited till three months before the end of his tenure before taking the move
The All Progressives Congress (APC) in Bayelsa state, has condemned the decision of the state governor, Seriake Dickson, to appoint 35 permanent secretaries just few months to the end of his tenure.
APC in a statement signed by its state secretary, Alabo Martins, took the governor to the cleaners, saying the party is quite aware of the illegal employment scheme going on in the state, The Nation reports.
The opposition party said it is, however, not against the appointments if they were done according to the civil service rules, adding that the timing of the appointment was very wrong and in a bad taste.
Bayelsa election: Dickson asks INEC to cancel election in Nembe, Southern Ijaw
“If the outgoing administration was aware of the existence of these vacancies in the top echelon of the public service of the state and that the situation was creating a lull in the service, why were the vacancies left unfilled until the eventide of the administration.
“No doubt, the appointments are in bad taste just as the motive is clearly political and an effort to put the popular in coming government on a bad light by ensuring that we are financially transgulated,” the party said.
Martins therefore urged the governor to focus more on completing ongoing projects in the state, asking indigenes of the state to hold his government responsible if nothing is done on them.
The APC’s state secretary also faulted how the Dickson has been approving the covert employment of some people in the state.
“The government did not lift embargo on employment until January this year when one thousand graduates were employed. But, pockets of employment were carried out from time to time with names directly forwarded by His Excellency the outgoing governor”.
This judgement is strange - Lokpobiri's lawyer in shock over disqualification of APC in Bayelsa
“The rules and procedures do not allow applicants to apply for employment directly to the Governor. But, this is practice in the state. Integration of officers from the plastic industry was haphazardly done. It created avenue for irregularities in the system which allows illegal employments into the civil service,” he said.
PAY ATTENTION: Download our mobile app to enjoy the latest news update
Meanwhile, Legit.ng earlier reported that 60 new special advisers were appointed by the governor The governor’s chief press secretary, Fidelis Soriwei, made the development public in a statement released on Thursday, October 10.
Soriwei said the appointees, who were drawn from the state’s eight local government areas, would help the government finish well.
NAIJ.com (naija.ng) -> Legit.ng. We have upgraded to serve you better
Unemployed graduates are too many in my ghetto | Legit TV


The sun still stood more than its own height above the jagged western horizon when Rhuarc said that Imre Stand, where he intended to stay for the night, lay only a mile or so ahead.
“Why are we stopping already?” Rand asked. “There are hours more daylight left.”
It was Aviendha, walking along on the other side of Jeade’en from the clan chief, who answered, in the scornful tone he had come to expect. “There is water at Imre Stand. It is best to camp near water when the chance presents itself.”
“And the peddlers’ wagons cannot go much farther,” Rhuarc added. “When the shadows lengthen, they must stop or begin breaking wheels and mules’ legs. I do not want to leave them behind. I cannot spare anyone to watch over them, and Couladin can.” Rand twisted in his saddle. Flanked now by Jindo Duadhe Mahdi’in, Water Seekers, the wagons were making heavy going a few hundred paces off to the side, lurching along, raising a tall plume of yellow dust. Most gullies were too deep or too steep-walled, forcing the drivers to go around, so the train twisted like a drunken snake. Loud curses floated from the wavering line, most blaming the mules for it all. Kadere and Keille were still inside their white-painted wagons.
“No,” Rand said, “you don’t want to do that.” He laughed softly in spite of himself.
Mat was looking at him oddly from under the broad brim of his new hat. He smiled in what he hoped was a reassuring way, but Mat’s expression did not change. He’s going to have to take care of himself, Rand thought. Too much is riding on this.
Speaking of taking care, he became aware of Aviendha studying him, her shawl wrapped around her head much like a shoufa. He straightened himself again. Moiraine might have told her off to nurse him, but he had the impression the woman was waiting to see him fall. Doubtless she would find that funny, Aiel humor being what it was. He would have liked to think she simply resented being stuffed into a dress and set to watch him, but the glitter in her eyes seemed too personal for that.
For once Moiraine and the Wise Ones were not watching him. Halfway between the Jindo and the Shaido, Moiraine and Egwene were walking with Amys and the others, all six women looking at something in the Aes Sedai’s hands. It caught the light of the falling sun, sparkling like a gem; they certainly seemed as intent as any girl on a pretty. Lan rode back among the gai’shain and packhorses, as though they had sent him away.
The scene made Rand uneasy. He was used to being the center of attention for that lot. What had they found more interesting? Surely nothing he could be happy about, not with Moiraine, likely not with Amys or the others. They all had their plans for him. Egwene was the only one of them he really trusted. Light, I hope I can still trust her. The only one he could really trust was himself. When the boar breaks cover, there’s only you and your spear. His laugh was a touch bitter this time.
“You find the Three-fold Land amusing, Rand al’Thor?” Aviendha’s smile was the merest flash of white teeth. “Laugh while you can, wetlander. When this land begins to break you, it will be a fitting punishment for your treatment of Elayne.”
Why would the woman an not let up? “You didn’t show any respect for the Dragon Reborn,” he snapped, “but you could try finding a little for the Car’a’carn.”
Rhuarc chuckled. “A clan chief is not a wetlander king Rand, nor is the Car’a’carn. There is respect—though women generally show as little as they can get away with—but anyone can speak to a chief.” Even so, he sent a frown in the direction of the woman on the other side of Rand’s horse. “Some do push the bounds of honor.”
Aviendha must have known that last was meant for her ears; her face went stony. But she strode along without saying another word, fists clenched at her sides.
A pair of the scouting Maidens appeared, coming back at a dead run. They were plainly not together; one headed straight for the Shaido, the other for the Jindo. Rand recognized her, a yellow-haired woman named Adelin, handsome but hard-faced, with a scar making a fine white line across her sun-dark cheek. She was one of those who had been in the Stone, though older than most of the Maidens there, perhaps ten years more than he. The quick look she gave Aviendha before falling in beside Rhuarc, an equal blend of curiosity and sympathy, made Rand bristle. If Aviendha had agreed to do the Wise Ones’ spying, she certainly did not deserve sympathy. His company was not so onerous as that. Him, Adelin ignored altogether.
“There is trouble at Imre Stand,” she told Rhuarc, her speech quick and clipped. “There is no one to be seen. We have kept hidden and not gone close.”
“Good,” Rhuarc replied. “Inform the Wise Ones.” Unconsciously hefting his spears, he dropped back to the main body of Jindo. Aviendha muttered to herself, plucking at her skirts, obviously wanting to join him.
“I think they already know,” Mat said as Adelin sped toward the Wise Ones’ party.
From the agitation among the women around Moiraine, Rand thought he was right. They all appeared to be talking at once. Egwene was shading her eyes, staring at either Adelin or him, her other hand to her mouth. How they knew had to be a question for later.
“What kind of trouble might it be?” he asked Aviendha. Still muttering to herself, she did not answer. “Aviendha? What kind of trouble?” Nothing. “Burn you, woman, you can answer a simple question! What kind of trouble?”
She flushed, but her reply came in a level tone. “It is most likely to be a raid, for goats or sheep; either could be herded at Imre for pasture, but most likely goats, because of the water. Probably it was the Chareen, the White Mountain sept or the Jarra. They are closest. Or it might be a sept from the Goshien. The Tomanelle are too far, I think.”
“Will there be fighting?” He reached out for saidin; the sweet rush of the Power flooded him. The rancid taint oozed through him, and fresh sweat burst from every pore. “Aviendha?”
“No. Adelin would have said if the raiders were still there. The herd and the gai’shain are miles gone by now. We cannot recover the herd because we must accompany you. ”
He wondered why she did not mention recovering the captives, the gai’shain, but he did not wonder long. The effort of staying upright while holding on to saidin, of not folding up and being swept away, left little room for thought.
Rhuarc and the Jindo swept ahead at a run, already veiling their faces, and Rand followed more slowly. Aviendha shot him impatient frowns, but he kept Jeade’en to a brisk walk. He would not go galloping into someone else’s trap. At least Mat was in no hurry; he hesitated, looking at the peddlers’ wagons, before cantering Pips up. Rand never glanced at the wagons.
The Shaido fell behind, slowing until the Wise Ones began to move again. Of course. This was Taardad land. Couladin would not care if someone raided here. Rand hoped the clan chiefs could be gathered at Alcair Dal quickly. How could he unite a people who seemed to fight each other all the time? The least of his worries, now.
When Imre Stand finally came in sight, it was something of a surprise. A few widely scattered clumps of long-haired white goats browsed on patches of tough grass and even the leaves of thorny bushes. At first he did not see the crude stone building set against the base of a tall butte; the rough stonework blended in perfectly, and several thornbushes had taken root on the dirt covered roof. Not very big, it had arrowslits for windows and only one door that he could see. After a moment he spotted another building, no larger, tucked onto a ledge some twenty paces higher. A deep crevice ran up to the ledge and beyond from behind the stone house at the base; there was no other evident way to reach the ledge.
Rhuarc, standing openly four hundred or so paces from the butte with his veil lowered, was the only Jindo in sight. That did not mean the others were not there, of course. Rand reined in beside him and dismounted. The clan chief continued to study the stone buildings.
“The goats,” Aviendha said, sounding troubled. “Raiders would not have left any goats behind. Most are gone, but it almost looks as if the herd has just been allowed to wander.”
“For days,” Rhuarc agreed, not taking his eyes from the buildings, “or more would remain. Why does no one come out? They should be able to see my face, and know me.” He started forward, and made no objection when Rand joined him leading Jeade’en. Aviendha had one hand on her belt knife, and Mat, riding behind, carried that black-hafted spear as if he expected to need it.
The door was rough wood, pieced together from short, narrow planks. Some of the stout bracing was broken, hacked by axes. Rhuarc hesitated a moment before pushing it open. He hardly glanced inside before turning to run his eyes over the surrounding country.
Rand put his head in. There was no one there. The interior, light streaming in bars through the arrowslits, was all one room and plainly not a dwelling, just a place for herdsmen to shelter, and defend themselves if attacked. There were no furnishings, no tables or chairs. A raised open hearth stood beneath a sooty smoke hole in the roof. The wide crevice at the back had steps chiseled into the gray rock. The place had been ransacked. Bedding, blankets, pots, all lay scattered across the stone floor amid slashed cushions and pillows. Some liquid had been splashed over everything, the walls, even the ceiling, and had dried black.
When he realized what it was, he jerked back, the Power-wrought sword coming into his hands before he even thought. Blood. So much blood. There had been slaughter done here, as savage as anything he could imagine. Nothing moved out there except the goats.
Aviendha backed out as fast as she went in.  “Who would do this? Where are the dead?”
“Trollocs,” Mat muttered. “It looks like Trolloc work to me.”
She snorted contemptuously. “Trollocs do not come into the Three-fold Land, wetlander. No more than a few miles below the Blight, at least, and then seldom. I have heard they call the Three-fold Land the Dying Ground. We hunt Trollocs, wetlander; they do not hunt us.”
Nothing moved. Rand let the sword go, pushed saidin away. It was hard. The sweetness of the Power was nearly enough to overcome the feel of filth from the taint, the sheer exhilaration almost enough to make him not care. Mat was right, whatever Aviendha said, but this was old, the Trollocs gone. Trollocs in the Waste, at a place he had come to. He was not fool enough to think it coincidence. But if they think I am, maybe they’ll grow careless.
Rhuarc signaled the Jindo to come in—they seemed to rise out of the ground—and some time later the others appeared, the Shaido and the peddlers’ wagons and the Wise Ones’ party. Word spread quickly of what had been found, and among the Aiel, tension became palpable. They moved as if they expected momentary attack, perhaps from each other. Scouts fanned out in every direction. Unharnessing their mules, the wagon drivers looked around jerkily, and seemed ready to dive under their wagons at the first shout.
For a time all was a stirred hive of ants. Rhuarc made sure the peddlers lined their wagons up on the edge of the Jindo camp. Couladin glowered, since it meant any Shaido who wanted to trade had to go to the Jindo, but he did not argue. Perhaps even he could see that might lead to dancing the spears, now. The Shaido tents went up a scant quarter-mile away, with the Wise Ones, as usual, in between. The Wise Ones examined the inside of the building, and Moiraine and Lan did, as well, but if they reached any conclusions, they told no one.
The water at Imre Stand turned out to be a tiny spring at the back of the crevice, feeding a deep, roughly round pool—what Rhuarc called a tank—less than two paces across. Enough for herdsmen, enough for the Jindo to fill some of their waterskins. No Shaido went near; in Taardad land, the Jindo had first claim on water. It seemed the goats got their moisture purely from the thick leaves of the thorny bushes. Rhuarc assured Rand there would be much more water at the next night’s stop.
Kadere produced a surprise while the wagon drivers were unhitching their teams and fetching buckets from the water-wagons. When he came out of his wagon, a dark-haired young woman accompanied him, in a red silk gown and red velvet slippers more suited to a palace than to the Waste. A filmy red scarf wound almost like shoufa and veil provided no protection from the sun, and certainly did nothing to hide a palely beautiful heart-shaped face. Clinging to the peddler’s thick arm, she swayed enticingly as he took her to see the blood-splashed room; Moiraine and the others had gone off to where the gai’shain were erecting the Wise Ones’ camp. When the pair came back out, the young woman shuddered delicately. Rand was sure it was pretense, just as he was sure she had asked to view that butcher’s workroom. Her show of revulsion lasted all of two seconds, and then she was peering about interestedly at the Aiel.
It appeared that Rand himself was one of the sights she wanted to see. Kadere seemed ready to take her back to the wagon, but she guided him to Rand instead, the alluring smile on her full lips plain behind her diaphanous veil. “Hadnan has been telling me of you,” she said in a smoky voice. She might have been hanging on the peddler, but her dark eyes traced Rand boldly. “You are the one the Aiel talk of. He Who Comes With the Dawn.” Keille and the gleeman came out of the second wagon and stood together at a distance, watching.
“It seems I am,” he said.
“Strange.” Her smile became wickedly mischievous. “I thought you would be handsomer.” Patting Kadere on the cheek, she sighed. “This dreadful heat is so wearing. Do not be too long.”
Kadere did not speak until she had climbed the steps back inside. His hat had been replaced by a long white scarf tied atop his head, the ends handing down his neck. “You must forgive Isendre, good sir.  His voice was mollifying, but his eyes belonged on a bird of prey. He hesitated, then went on. “I have heard other things. I have heard that you took Callandor out of the Heart of the Stone.”
The man’s eyed never changed. If he knew about Callandor, he knew Rand was the Dragon Reborn, knew he could wield the One Power. And his eyes never changed. A dangerous man. “I have heard it said,” Rand told him, “that you should believe nothing you hear, and only half of what you see.”
“A wise rule,” Kadere said after a moment. “Yet to achieve greatly, a man must believe something. Belief and knowledge pave the road to greatness. Knowledge is perhaps the most valuable of all. We all seek the coin of knowledge. Your pardon, good sir. Isendre is not a patient woman. Perhaps we will have another opportunity to talk.”
Before the man had taken three steps, Aviendha said in a low, hard voice, “You belong to Elayne, Rand al’Thor.   You belong to Elayne!”
He had forgotten she was there. “I don’t belong to anyone, Aviendha. Elayne? She cannot seem to make up her mind what she thinks.”
“Elayne laid her heart bare to you, Rand al’Thor. If she did not show you in the Stone of Tear, did her two letters not tell you what she feels? You are hers, and no other’s.”
Rand threw up his hands and stalked away from her. At least, he tried. She followed on his heels, a disapproving shadow in the sun’s glare.
Swords. The Aiel might have forgotten why they did not carry swords, but they had kept the contempt for them. Swords might make her leave him alone. Seeking out Lan in the Wise Ones’ camp, he asked the Warder to watch him work the forms. Bair was the only one of the four in view, and a scowl surely deepened the creases on her face. Egwene was not to be seen either. Moiraine wore calm like a mask, dark eyes cool; he could not say whether she approved.
He was not out to offend the Aiel, so he set up with Lan between the Wise Ones’ tents and the Jindo’s. He used one of the practice swords Lan carried in his baggage, a bundle of loosely tied lathes in place of a blade. The weight and balance were right, though, and he could forget himself in the dance-like flow from form to form, the practice sword alive in his hands, a part of him. Usually it was that way. Today the sun was a furnace in the sky baking out moisture and strength. Aviendha squatted off to one side, hugging her knees to her chest and staring at him.
Finally, panting, he let his arms drop.
“You lost concentration,” Lan told him. “You must hold on to that even when your muscles turn to water.  And it will probably be a farmboy who has his hands on a sword for the first time who does it.” His smile was sudden, odd on that stony face.
“Yes. Well, I’m not a farmboy any longer, am I?” They had gained an audience, if at a distance. Aiel lined the edge of both the Shaido and Jindo camps. Keille’s cream-wrapped bulk stood out among the Jindo, the gleeman beside her in his cloak of colored patches. Which one did he choose? He did not want them to see him watching them. “How do Aiel fight, Lan?”
“Hard,” the Warder said dryly. “They never lose concentration. Look here.” With his sword he drew on the hard, cracked clay, a circle and arrows. “Aiel change tactics according to circumstances, but here is one they favor. They move in a column, divided into quarters. When they meet an enemy, the first quarter rushes in to pin them. The second and third sweep wide to either side, hitting the flanks and rear. The last quarter waits in reserve, often not even watching the battle, except for their leader. When a weakness opens—a hole, anything—the reserve strikes there. Finish!” His sword stabbed into a circle already pierced with arrows.
“How do you beat that?” Rand asked.
“With difficulty. When you make first contact—you’ll not spot Aiel before they strike unless you are lucky—immediately send out horsemen to break up, or at least delay, their flanking attacks. If you keep most of your strength back and defeat the holding attack, then you can wheel on the others in turn and defeat them, too.”
“Why do you want to learn how to fight Aiel?” Aviendha burst out. “Are you not He Who Comes With the Dawn, meant to bind us together and return us all to old glories? Besides, if you want to know how to fight Aiel, ask Aiel, not a wetlander. His way will not work.”
“It has worked well enough with Bordermen from time to time.” Rhuarc’s soft boots made very little sound on the hard ground. He had a waterskin under his arm. “Allowances are always made when someone suffers a disappointment, Aviendha, but there is a limit to sulking. You gave up the spear for your obligation to the people and the blood. One day no doubt you will be making a clan chief do what you want instead of what he wants, but if instead you are Wise One to the smallest hold of the smallest sept of the Taardad, the obligation remains, and it cannot be met by tantrums.”
A Wise One.  Of course that was why she had gone to Rhuidean. But he would never have thought Aviendha would choose to give up the spear. It certainly explained why she had been chosen to spy on him, though. Suddenly he found himself wondering if she could channel. It seemed Min had been the only woman in his life since that Winternight who could not.
Rhuarc tossed him the sloshing waterskin. The lukewarm water slid down his throat like chilled wine. He tried not to splash any over his face, not to waste it, but it was hard.
“I thought you might like to learn the spear,” Rhuarc said when Rand finally lowered the half-empty skin. For the first time Rand realized the clan chief was carrying only two spears, and a pair of bucklers. Not practice spears, if there were any such; a foot of sharp steel tipped each.
Steel or wood, his muscles cried out for rest.  Keille and the gleeman were gone, but Aiel were still watching from both camps. They had seen him practicing with a despised sword, if a wooden one. They were his people. He did not know them, but they were his, in more senses than one. Aviendha was still watching him, too, glowering as though blaming him for Rhuarc having set her down. Not that she had anything to do with his decision, of course. The Jindo and Shaido were watching; that was it.
“That mountain can grow awfully heavy sometimes,” he sighed, taking a spear and buckler from Rhuarc. “When do you find a chance to put it down awhile?”
“When you die,” Lan said simply.
Forcing his legs to move—and trying to ignore Aviendha—Rand squared off with Rhuarc. He did not mean to die just yet. No, not for a long time yet.
Leaning against a tall wheel in the shade of one of the peddlers’ wagons, Mat glanced at the line of Jindo watching Rand. All he could see now was their backs. The man was a pure fool, leaping about in this heat. Any sensible man would find a bit of protection from the sun, something to drink. Shifting his seat in the shade, he peered into the mug of ale he had bought from one of the drivers and grimaced. Ale just did not taste right when it was as warm as soup. At least it was wet. The only other thing he had bought, aside from the hat, was a short-stemmed pipe with a silver-worked bowl, snuggled now in his coat pocket with his tabac pouch. Trading was not on his mind. Unless it was for passage out of the Waste, a commodity the peddlers’ wagons did not seem to be offering at the moment.
They were doing a steady business, if not for ale. The Aiel did not mind the temperature, but they seemed to think it too weak. Most were Jindo, but there was a steady stream of Shaido from the other camp. Couladin and Kadere had their heads together for a long time, though they came to no agreement, since Couladin left empty-handed. Kadere must not have liked losing the trade; he stared after Couladin with those hawk’s eyes, and a Jindo who wanted his attention had to speak three times before he was heard.
The Aiel did not show much in the way of coin, but the peddlers and their people were quick to accept silver bowls or gold figurines or fine wall hangings looted from Tear, and Aiel pouches produced raw nuggets of gold and silver that made Mat sit up. But an Aiel who lost at dice might well reach for his spears. He wondered where the mines were. Where one man could find gold, another could. It was probably a lot of work, though, mining gold. Taking a long drink of warm ale, he settled back against the wagon wheel.
What sold and what did not, and at what price, was interesting. The Aiel were no simple fools to hand over a gold saltcellar, say, for a bolt of cloth. They knew the value of things and bargained hard, though they had their own wants. Books went immediately; not everyone wanted them, but those who did took every last one the wagons held. Laces and velvets vanished as soon as they were brought out, for astonishing quantities of silver and gold, and ribbons for not much less, but the finest silks just lay there. Silk was cheaper in trade to the east, he overheard a Shaido tell Kadere. A heavy-set, broken-nosed driver tried to talk a Jindo Maiden into a carved ivory bracelet. She pulled one wider, thicker and more ornate from her pouch and offered to wrestle him for the pair. He hesitated before refusing, which showed Mat he was even dumber than he looked. Needles and pins were snapped up, but the pots, and most of the knives, earned sneers; Aiel smiths did better work. Everything changed hands, from vials of perfumes and bath salts to kegs of brandy. Wine and brandy fetched good prices. He was startled to hear Heirn ask for Two Rivers tabac. The peddlers had none.
One driver kept trying to interest the Aiel in a heavy, gold-worked crossbow with no success. The crossbow caught Mat’s eye, all those inlaid gold lions with what seemed to be rubies for eyes. Small, but still rubies. Of course, a good Two Rivers longbow could shoot six arrows while a crossbowman was still cranking back the bowstring for his second shot. A longer range for a crossbow that size, though, by a hundred paces. With two men doing nothing but keeping a crossbow with bolt in place in the hands of each crossbowman, and stout pikemen to hold the cavalry off . . .
Wincing, Mat let his head fall back against the spokes. It had happened again. He had to get out of the Waste, away from Moiraine, away from any Aes Sedai. Maybe back home for a while. Maybe he could get there in time to help with this Whitecloak trouble.  That would not solve his problems anyway. For one thing, there were no answers in Emond’s Field to what those snaky folk had meant about marrying the Daughter of the Nine Moons, or dying and living again. Or Rhuidean.
Through his coat he rubbed the silver foxhead medallion, hung around his neck again. The pupil of the fox’s eye was a tiny circle split by a sinuous line, one side polished bright, the other shaded in some way. The ancient symbol of Aes Sedai, before the Breaking. The black-hafted spear, sword-blade point marked with two ravens, he took from where it was leaning beside him and laid it across his knees. More Aes Sedai work. Rhuidean had provided no answers, only more questions, and . . .
Before Rhuidean his memory had been full of holes. Casting back in his mind then, he would be able to remember walking up to a door in the morning and leaving in the evening, but nothing between. Now there was something in between, filling all those holes. Waking dreams, or something very like. It was as if he could remember dances and battles and streets and cities, none of which he had ever really seen, none of which he was sure had ever existed, like a hundred pieces of memory from a hundred different men. Better to think of them as dreams, maybe—a little better—yet he was as sure in them as in any of his own remembrances. Battles numbered the most, and sometimes they crept up on him in a way, as with the crossbow. He would find himself looking at a piece of ground and planning how to set an ambush there, or defend against one, or how to set an army for battle. It was madness.
Without looking, he traced the flowing script carved into the black spear shaft. He could read it as easily as any book now, though it had taken him the whole trip back to Chaendaer to realize it. Rand had not said anything, but he suspected he had given himself away, there in Rhuidean. He knew the Old Tongue now, sifted whole out of those dreams. Light, what did they do to me?
“Sa souvraya niende misain ye,” he said aloud. “I am lost in my own mind.”
“A scholar, for this day and Age.”
Mat looked up to find the gleeman looking at him with dark, deep-set eyes. The fellow was taller than most, somewhere in his middle years and likely attractive to women, but with an oddly apprehensive way of holding his head cocked as if trying to look at you sideways.
“Just something I heard once,” Mat said. He had to be more careful. If Moiraine decided to pack him off to the White Tower for study, they would never let him out of there again. “You hear scraps of things and remember them. I know a few phrases.”
“I am Jasin Natael. A gleeman,” Natael did not flourish his cloak the way Thom would; he could have been saying he was a carpenter or a wheelwright. “Do you mind if I join you?” Mat nodded to the ground next to him, and the gleeman folded his legs, tucking his cloak under to sit on. He seemed fascinated by the Jindo and Shaido milling around the wagons, most still carrying their spears and bucklers. “Aiel,” he murmured. “Not what I would have expected. I can still hardly credit it.”
“I’ve been with them for weeks now,” Mat said, “and I don’t know that I believe them myself. Odd people. If any of the Maidens ask you to play Maidens’ Kiss, my advice is to refuse. Politely.”
Natael frowned at him questioningly. “You lead an intriguing life, it seems.”
“What do you mean?” Mat asked cautiously.
“Surely you do not think it is a secret? Not many men travel in company with . . . an Aes Sedai. The woman Moiraine Damodred. And then there is Rand al’Thor. The Dragon Reborn. He Who Comes With the Dawn. Who can say how many prophecies he is supposed to fulfill? An unusual traveling companion, certainly.”
The Aiel had talked, of course. Anyone would. Still, it was a little unsettling to have a stranger calmly talk about Rand this way. “He suits well enough for now. If he interests you, talk to him. Myself, I’d just as soon not be reminded.”
“Perhaps I will. Later, perhaps. Let us talk of you. I understand you went into Rhuidean, where none save Aiel have gone in three thousand years. You got that there?” He reached for the spear on Mat’s knees, but let his hand fall when Mat drew it away slightly. “Very well. Tell me what you saw.”
“Why?”
“I am a gleeman, Matrim.” Natael had his head cocked to one side in that uneasy manner, but his voice held irritation at having to explain. He lifted a corner of his cloak with its colorful patches as though for proof. “You have seen what none have, save a handful of Aiel. What stories can I make with the sights your eyes have seen? I will even make you the hero, if you wish.”
Mat snorted.
Yet there was no reason to keep silent. Amys and that lot could chatter about not speaking of Rhuidean, but he was no Aiel. Besides, it might pay to have somebody with the peddlers who had a little goodwill toward him, somebody who could put in a word when it was needed.
He told the story from reaching the wall of fog to coming out, leaving out selected bits. He had no intention of telling anyone else about that twisted-doorway ter’angreal, and he would rather forget the dust gathering into creatures that tried to kill him. That strange city of huge palaces was surely enough, and Avendesora.
The Tree of Life Natael passed over quickly, but he took Mat through the rest again and again, asking more and more detail, from exactly what it felt like walking through that fog and how long it took to the color of the shadowless light inside, to descriptions of every last thing Mat could remember seeing in the great square in the heart of the city. Those Mat gave reluctantly; a slip, and he would find himself talking about ter’angreal, and who knew where that might lead? Even so he drained the last of the warm ale, and still talked until his throat was dry. It sounded rather dull the way he told it, as though he had just walked in and waited while Rand went off, then walked out again, but Natael seemed intent on digging out every last scrap. He did remind Mat of Thom then; sometimes Thom concentrated on you as though he meant to wring you dry.
“Is this what you are meant to be doing?”
Mat jumped in spite of himself at the sound of Keille’s voice, hard under its mellifluous tones. The woman put him on edge, and now she looked ready to rip his heart out, and the gleeman’s as well.
Natael scrambled to his feet. “This young man has just been telling me the most fascinating things about Rhuidean. You will not believe it.”
“We are not here for Rhuidean.” The words came out as sharp as her hatchet of a nose. At least she was only glaring at Natael now.
“I tell you—”
“You tell me nothing.”
“Do not try to silence me!”
Ignoring Mat, they moved off down the wagons, arguing in low voices, gesticulating fiercely. Keille seemed to have been browbeaten into a grim silence by the time they disappeared into her wagon.
Mat shivered. He could not imagine sharing living quarters with that woman. It would be like sharing with a bear with a sore tooth. Isendre, now . . . That face, those lips, that swaying walk. If he could get her away from Kadere, maybe she would find a young hero—the dust creatures could be ten feet tall, for her; he would give her every detail he could remember or invent—a handsome young hero more to her liking than a stuffy old peddler. It was worth thinking about.
The sun slid below the horizon, and small fires of thorny branches made pools of yellow light among the tents. The smells of cooking filled the camp; goat, roasting with dried peppers. Cold filled the camp, too, the cold of night in the Waste. It was as if the sun had taken all the heat with it. Mat had never expected he would wish for a stout cloak when he packed to leave the Stone. Maybe the peddlers had one. Maybe Natael would dice for his.
He ate at Rhuarc’s fire with Heirn and Rand. And Aviendha, of course. The peddlers were there, and Natael close by Keille, and Isendre all but wrapped around Kadere. It might be harder separating Isendre from the hook-nosed man than he had hoped—or easier. Twined around the fellow or not, she had smoky eyes for Rand and no one else. You would have thought she already had his ears clipped, a sheep marked for its owner’s flock. Neither Rand nor Kadere seemed to notice; the peddler hardly took his eyes off Rand. Aviendha noticed, and glared at Rand. At least the fire gave off some warmth.
When the roast goat was finished—and some sort of flecked yellow mush that was spicier than it looked—Rhuarc and Heirn filled short-stemmed pipes, and the clan chief asked Natael for a song.
The gleeman blinked. “Why, of course. Of course. Let me bring a harp.” His cloak billowed on the dry, cold breeze as he vanished toward Keille’s wagon.
The fellow certainly was different from Thom Merrilin. Thom hardly got out of bed without flute or harp or both. Mat thumbed his silver-worked pipe full of tabac, and was puffing contentedly by the time Natael returned and struck a pose suitable for a king. That was like Thom. With a strummed cord, the gleeman began.
“Soft, the winds, like springtime’s fingers.
Soft, the rains, like heaven’s tears.
Soft, the years roll by in gladness,
never hinting storms to come,
never hinting whirlwinds’ ravage,
rain of steel and battle thunder,
war to tear the heart asunder.”
It was “Midean’s Ford.” An old song; of Manetheren, oddly enough, and war before the Trolloc Wars. Natael did a fair job of it; nothing like Thom’s sonorous recitals, of course, but the rolling words drew a crowd of Aiel thick around the edge of the fire’s light. Villainous Aedomon led the Saferi down on unsuspecting Manetheren, pillaging and burning, driving all before them until King Buiryn gathered Manetheren’s strength, and the men of Manetheren met the Saferi at Midean’s Ford, holding, though heavily outnumbered, through three days of unrelenting battle, while the river ran red and vultures blacked the sky. On the third day, numbers dwindling, hope fading, Buiryn and his men fought their way across the ford in a desperate sortie, driving deep into Aedomon’s horde, seeking to turn the enemy back by killing Aedomon himself. But forces too great to overpower swept in around them, trapping them, driving them ever in on themselves. Surrounding their king and the Red Eagle banner, they fought on, refusing surrender even when their doom became clear.
Natael sang how their courage touched even Aedomon’s heart, and how at last he allowed the remnant to go free, turning his army back to Safer in honor of them.
“Back across the blood-red water,
marching back with heads held high.
No surrender, arm or sword,
no surrender, heart or soul.
Honor be theirs, ever after,
honor all the Age shall know.”

It had not been that way, of course. Mat could remember—Light, I don’t want to! But it came anyway—he remembered counseling Buiryn not to accept the offer, being told in return that the smallest chance was better than none. Aedomon, glossy black beard hanging below the steel mesh that veiled his face, drew his spearmen back, waited until they were strung out and nearly to the ford before the hidden archers rose and the cavalry charged in. As for turning back to Safer . . . Mat did not think so. His last memory at the ford was trying to keep his feet, waist-deep in the river with three arrows in him, but there was something later, a fragment. Seeing Aedomon, gray-bearded now, go down in a sharp fight in a forest, toppling from his rearing horse, the spear in his back put there by an unarmored, beardless boy. This was worse than the holes had been.
“You did not like the song?” Natael said.
It took Mat a moment to realize the man was speaking to Rand, not him. Rand rubbed his hands together, peering into the small fire, before answering. “I’m not certain how wise it is, depending on an enemy’s generosity. What do you think, Kadere?”
The peddler hesitated, glancing at the woman clinging to his arm. “I do not think of such things,” he said at last. “I think of profits, not battles.” Keille laughed coarsely. At least, until she saw Isendre’s smile, condescending to a woman who could make three of her; then her dark eyes glittered dangerously behind those rolls of fat.
Suddenly warning cries rose in the dark beyond the tents. Aiel snatched veils across their faces, and a moment later Trollocs poured in out of the night, snouted faces and horned heads, towering over the humans, howling and swinging scythe-curved swords, stabbing with hooked spears and barbed tridents, hacking with spiked axes. Myrddraal flowed with them, like deadly eyeless snakes. A heartbeat it took, but the Aiel fought as if they had had an hour’s warning, meeting the charge with their own flickering spears.
Mat was vaguely aware of Rand with that fiery sword suddenly in hand, but then he was sucked into the maelstrom himself, wielding his spear as spear and quarterstaff both, slash and thrust, haft whirling. For once he was glad of those dream memories; the way of this weapon seemed familiar, and he needed every scrap of skill he could find. It was all chaotic madness.
Trollocs rose up in front of him and went down to his spear, or an Aiel spear, or spun away into the confusion of shouts and howls and clanging steel. Myrddraal faced him, black blades meeting his raven-marked steel with flashes of blue light like sheet lightning, faced him and were gone in the tumult. Twice a short spear streaking by his head took Trollocs about to run him through the back. He thrust the short-sword blade into a Myrddraal’s chest and knew he was going to die when it did not fall, but grinned with those bloodless lips, eyeless stare shivering fear into his bones, and drew back its black sword. An instant later the Halfman jerked as Aiel arrows pincushioned it, jerked for the moment Mat needed to leap back from the thing as it fell still trying to stab at him, stab at anything.
A dozen times the spear’s iron-hard black haft barely deflected a Trolloc thrust. It was Aes Sedai work, and he was glad of it. The silver foxhead on his chest seemed to pulse with cold as if to remind him that it, too, bore the mark of Aes Sedai. Right then, he did not care; if it took Aes Sedai work to keep him alive, he was ready to follow Moiraine like a puppy.
He could not have said if it went on for minutes or hours, but suddenly there was not a Myrddraal or Trolloc still standing in sight, though cries and howls from the darkness spoke of pursuit. Dead and dying littered the ground, Aiel and Shadowspawn, the Halfmen still thrashing. Groans filled the air with pain. Suddenly he realized his muscles felt like water, and his lungs were afire. Panting, he slid down to his knees, leaning on his spear. Flames made bonfires of three of the peddlers’ canvas-topped wagons, one with a driver pinned to the side by a Trolloc spear, and some of the tents were burning. Shouts from the direction of the Shaido camp, and glows too large for campfires, said they had been attacked, too.
Fiery sword still in hand, Rand came to where Mat knelt. “Are you all right?” Aviendha shadowed him. Somewhere she had found a spear and buckler, had tucked up a corner of her shawl to veil her face. Even in skirts she looked deadly.
“Oh, I am fine,” Mat muttered, struggling to his feet. “Nothing like a little dance with Trollocs to ready you for sleep. Right, Aviendha?” Uncovering her face, she gave him a tight smile. The woman had probably enjoyed it. He was sweat all over; he thought it might freeze on him.
Moiraine and Egwene had appeared with two of the Wise Ones, Amys and Bair, circulating among the wounded. The convulsion of Healing followed the Aes Sedai, though sometimes she merely shook her head and moved on.
Rhuarc strode up with a grim face.
“Bad news?” Rand said quietly.
The clan chief grunted. “Aside from Trollocs here where they should not be, not by two hundred leagues or more? Perhaps. Some fifty Trollocs attacked the Wise Ones’ camp. Enough to overwhelm it, had it not been for Moiraine Sedai and luck. However, it seems the Shaido were hit by fewer than struck us, though since they are the larger camp the reverse should have been true. I might almost think they were attacked only to keep them from coming to our aid. Not that that would be certain, with Shaido, but Trollocs and Nightrunners might not know that.”
“And if they knew an Aes Sedai was with the Wise Ones,” Rand said, “that attack could have been meant to keep her away, too. I bring enemies with me, Rhuarc. Remember that. Wherever I am, my enemies are never far.”
Isendre poked her head out of the lead wagon. A moment later Kadere climbed down past her, and she ducked back inside, shutting the white-painted door behind him. He stood looking around at the carnage, the light of his burning wagons painting rippling shadows across his face. The group around Mat held his attention most. The wagons seemed to interest him not at all. Natael got down from Keille’s wagon, too, speaking up the stairs to her still inside, his eyes on Mat and the others.
“Fools,” Mat muttered, half to himself. “Hiding inside the wagons, as if that would make any difference to a Trolloc. They could all have roasted alive, easy as not.”
“They are still alive,” Rand said, and Mat realized he had seen them, too. “That is always important, Mat, who stays alive. It’s like dice.  Who can say what game the peddlers play?” He laughed quietly, and the fiery sword vanished from his hands.
“I am going to get some sleep,” Mat said, already turning away. “Wake me if the Trollocs show up again. Or better, let them kill me in my blankets. I am too tired to wake up again.” Rand was definitely going over the edge. Maybe tonight would convince Keille and Kadere to turn back. If they did, he intended to be with them.
Rand let Moiraine look at him, muttering to herself, though he had taken no wound. With so many who had, she could not spare the strength to wash away his fatigue with the One Power.
“This was aimed at you,” she told him, surrounded by the moans of the injured. The Trollocs were being dragged away into the night, by packhorses and the peddlers’ mules. The Aiel apparently intended to leave the Myrddraal where they lay until they stopped moving, to make sure they were really dead. The wind gusted up, like ice with no moisture in it.
“Was it?” he said. Her eyes glittered in the firelight before she turned back to the wounded.
Egwene came to him, too, but only to say in a low, fierce whisper, “Whatever you are doing to upset her, stop it!” The glance she shot past him at Aviendha left no doubt who she meant, and she went off to help Bair and Amys before he could say he had done nothing. She looked ridiculous with those two braids twined with ribbons. The Aiel seemed to think so, too; some of them grinned at her back.
Stumbling, shivering, he sought his tent. He had never been this tired before. The sword had almost not come. He hoped that was the tiredness. Sometimes there was nothing there when he reached for the Source, and sometimes the Power would not do what he wanted, but almost from the first the sword had come practically without thought. Now of all times . . . It had to be the tiredness.
Aviendha insisted on following him as far as the tent, and when he woke the next morning she was sitting outside cross-legged, though without the spear and buckler. Spy or not, he was glad to see her. At least he knew who and what she was, and what she felt for him.


Metroid Prime Door Randomizer (also known as MPDR) is a tool to change the types (colors) of doors in Metroid Prime, essentially requiring other Beams to open them.
It also supports adding other patches to the game to help with the flow of the game, mainly for speedrunners and random runners.


New #MAGACHALLENGE videos flood internet as Trump dangles White House visit as prize
by Brie StimsonPresident Trump announced Friday he will select the winners in the months’ old #MAGACHALLENGE as he retweeted a video posted by a supporter who rapped his love for the president and challenged others to do likewise.
Trump supporters got to work right away. Below are some samples.
Of course, the challenge also sparked a bit of mockery from the left.


| Premier League Standings | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| # | Team | MP | W | D | L | F | A | D | P |
| {{standing['position']}} | {{standing['teamName']}} | {{standing['playedGames']}} | {{standing['wins']}} | {{standing['draws']}} | {{standing['losses']}} | {{standing['goals']}} | {{standing['goalsAgainst']}} | {{standing['goalDifference']}} | {{standing['points']}} |
| Premier League Results | ||||||
|---|---|---|---|---|---|---|
| Home Team | Score | Away Team | Matchday | |||
| {{fixtures['homeTeamName']}} | {{fixtures['result']['goalsHomeTeam']}} - {{fixtures['result']['goalsHomeTeam']}} | {{fixtures['awayTeamName']}} | Matchday {{fixtures['matchday']}} |
| Premier League Fixtures | |||||
|---|---|---|---|---|---|
| Home Team | vs | Away Team | Matchday | ||
| {{fixtures['homeTeamName']}} | vs | {{fixtures['awayTeamName']}} | Matchday {{fixtures['matchday']}} |


PortableApps.com Launcher Manual
your PAL in making portable apps
This document has been superseded by the new
Manual
(also available
online
).