text:
Ben Braber
Copywriter, journalist and historian
Workshop comments
People and words
The colt bolts
Post author By Ben Braber
There's an aspect that has been overlooked in the reactions to Dominic Cummings' 2020 blog "'Two hands are a lot' — we're hiring data scientists, project managers, policy experts, assorted weirdos …" The Special Adviser to the Prime Minister uses tired language.
Cummings employs phrases such as "low hanging fruit", "truly awesome", "absolutely cutting edge", "wild cards" and "see what bounces back". This is tired language – figures of speech that once rang in our ears but are now cracked through overuse.
We all use clichés when we speak, but they're best avoided when you're writing to appeal to your readers, notably in copywriting.
Why avoid such phrases? Simply because many readers will recognise them for what they are, as George Orwell noted in Why I Write (1946): dying metaphors, pretentious diction and meaningless words.
And their appearance puts the reader to sleep. Or while yawning, your reader quickly decides there's nothing new, skips to the next full stop and misses what you have to say.
Better still
In my experience, to get people's attention, deepen their interest and help them develop their thoughts, it's better to keep it simple or invent a new metaphor that conjures up a vibrant image.
For example, instead of "fresh as a daisy" (used since 1780), write "healthy and full of energy" (what it means).
Or use your imagination, as Emily Flake did in 2018 when she wrote in The New Yorker about Jubilee Street being performed by Nick Cave and the Bad Seeds: "the song bolts out from under him like a half-broken colt and explodes."
By the way, Flake's words may well have been intended as an inventive adaptation of The Colt Bolts, the title of a composition by Bad Seed Warren Ellis from 2015, which you can hear in the film Mustang.
The photo in this post, like most pictures on my website, is by Norma Braber-McKinney.
How to build trust with words
Saying that words are building blocks is stating a commonplace. But it's true. Words are the building blocks of language. Written and spoken, they can connect and elevate people. Words can also build trust. Here's how.
Cognitive scientist Steven Pinker writes in The Sense of Style:
[…] style earns trust. If readers can see that a writer cares about consistency and accuracy in her prose, they will be reassured that the writer cares about those virtues in conduct they cannot see as easily.
In other words, if a text used to sell a product or service is – in the eyes of the reader – written in an even manner and without mistakes, the reader will probably feel more confident that the product or service does what the text says it will do. A similar case can be made for text to promote a company, brand, person, policy or simply an idea. Or scripts for video, tv and radio commercials.
The choice of words
Some words are good at conveying trust. Pinker, above, is well aware of this and he uses words like trust, consistency, accuracy and reassured. He also appeals to our feelings about fairness by saying that style earns trust. Many of us think that if we earn something, we deserve it, and therefore it's fair that we get it.
Trust is a precious commodity in marketing and corporate communication. Good copywriters build trust by using words that convey trust, and by writing with clarity. However, that's often not enough to persuade a sceptical consumer or doubtful purchase manager. For copy to be successful, it also has to appeal to the heart, and make a convincing argument.
A convincing argument
An argument can be different things. I'm not talking about a shouting match or assertions like "We're the best" and "Probably the best" – they don't convince anybody.
A convincing argument presents clear and honest evidence and its conclusion follows logically from that proof. Here's a classical example:
All men are mortal.
Socrates is a man.
Therefore, Socrates is mortal.
Humans sometimes make mistakes.
Writers are human.
A writer can make a mistake.
Sometimes it's unnecessary to spell out the argument – it can be implied or suggested, and then the trick is to create a line of reasoning in the reader's mind.
Using words that convey trust and making a convincing argument are only two aspects of building trust with words. Other tools of successful copywriting include showing empathy, conjuring up mental images and evoking the right emotion.
If you're interested in the features of building trust with words, my workshops may be something for you.
Taste in rule's clothing
The British Academy of Medical Royal Colleges has told hospital doctors to write to patients in plain English and avoid the use of Latin, acronyms and technical terms.
There's nothing wrong with asking doctors to be clear, but the Academy's guidance also says doctors should avoid the passive voice. Now, that's wrong. Here's why.
English grammar has rules.
For example, adjectives should come in distinct arrangements. The Cambridge Dictionary states: "When more than one adjective comes before a noun, the adjectives are normally in a particular order." For example, the 'little white lamb', not 'white little lamb' because an adjective denoting size comes before colour.
If you don't want to emphasise any one of the adjectives, the usual sequence of adjectives is:
opinion, for example magnificent
size, for example tall
physical quality, for example lean
shape, for example muscular
age, for example young
colour, for example grey
origin, for example Canadian
material, for example tough
type, for example lively
purpose, for example predatory
That makes 'a magnificent, tall, lean, muscular, young, grey, Canadian, tough, lively and predatory wolf'.
There are also misconceptions about grammar rules. For example, the idea that 'fewer' must always be used with count nouns, as in 'fewer than five sheep'. But almost everyone uses 'less' with singular count nouns, for example 'one less wolf'. And many people say 'less than five lambs'. It's not grammatically wrong, but some people don't like it. It's a matter of taste or preference, not a rule.
The reasoning that for clarity purposes the passive voice should be avoided is also a misconception based on taste or preference. The passive cannot be ruled out. One of the reasons for using it occurs when you don't want or are unable to describe who's undertaking the action.
So, my advice to the Academy is to change their guidelines – the suggestion to avoid the passive voice can be removed painlessly.
Why do we have so many accents?
This post about language and identity was written by linguist Natalie Braber, Associate Professor in the School of Arts & Humanities of Nottingham Trent University. Versions of this article have also been published by The Conservation and The Scotsman.
Where we come from matters. Our origins form an important part of a distinctive personality, which can become a group identity when we share these origins. More often than not, our use of language, especially our dialect, is an expression of that distinctiveness. In addition to using distinctive words and grammatical patterns, which may not follow the rules of Standard English, people have accents, related to their pronunciation when they speak, which can articulate their identity.
Where they come from
Dialects and accents developed historically when groups of language users lived in relative isolation, without regular contact with other people using the same language. This was more pronounced in the past due to the lack of fast transport and mass media. People tended to hear only the language used in their own location, and when their language use changed (as language by its nature always evolves) their dialect and accent adopted a particular character, leading to national, regional and local variation.
Invasion and migration also helped to influence dialect development at a regional level. Just take the Midlands in England, for example. The East Midlands were ruled by the Danes in the ninth century. This resulted, for instance, in the creation of place names ending in "by" (a suffix thought to originate from the Danish word for "town"), such as Thoresby and Derby, and "thorpe" (meaning "settlement"), such as Ullesthorpe. The Danes, however, did not rule the West Midlands, where the Saxons continued to hold sway, and words of Danish origin are largely absent from that region.
Where they appear
Dialects and accents are not restricted to English or UK English for that matter. In the US, Australia and New Zealand, where English has been spoken for a much shorter period of time than in the UK, you would expect less variation as English has been spoken there for a shorter period of time. But even there, dialects and accents occur and the linguistic influence of settlers who came from certain parts of the UK such as Scotland or Lancashire helped to determine local varieties.
A similar phenomenon appears in the UK. During the 1930s, Corby in Northamptonshire received a big influx of Scottish steelworkers. Here, there are features in the local language – for example, pronunciation of vowels in words such as "goat" or "thought" – which we think of as typically Scottish that are still used even by townsfolk who have never been to Scotland.
Other influences on language use
Other factors influence language use, too. One of them is social class. Very many local accents are now associated with working-class speakers, while middle and upper-class speakers tend to use a more standardised English. But this is a relatively recent development. Indeed, until the standardisation of English from the 16th century – when one variety of English came to be used in official situations and by printing presses for the wider publication of books – it was acceptable for speakers of different social classes to speak and write in their own dialects. Then, Latin and French were regarded as prestigious languages, applied by the elite in education, law and literature.
Changes, for example through music
Dialects and accents are changing and will continue to change. After all, language never stands still. Some traditional dialects are disappearing, but new urban and multicultural varieties continue to arise. Some accents are deemed "better" than others and certain features may become fashionable.
This can be influenced by music. At the moment, linguistic features of "black English", associated with hip hop, grime, R&B and rap music – such as "bae", "blood" or "brother", which can all be used as forms of address – are regarded as "cool" and are adopted by other speakers.
Why people vary their language use
In addition, people change the language they use depending on who they are talking to, and why they are talking, for example formally in a job interview or casually to friends and family at home. People also change the way they speak to make themselves understood more easily, a phenomenon called linguistic accommodation.
Ethnicity, class, gender, sexuality and age can all affect language usage. And there are also personal reasons for using dialects and accents to identify yourself. I have lived in England for 16 years, but you can still hear my Scottish accent and that is unlikely to change.
Or will we speak all the same?
Speakers' language varieties can converge (become more similar) or diverge (become more different). And as the modern world becomes increasingly connected, linguists have wondered whether dialects and accents in general are bound to disappear.
There is certainly such a thing as "dialect levelling" – differences between dialects appear to be vanishing, which could be a consequence of the rise of mass and social media. But while there is much discussion about the disappearance of dialects and accents, public interest in the subject is growing.
They are here to stay
A consensus has not yet been reached. In UK English, some features may be spreading like wildfire through the country, such as people saying "free" instead of "three" – a linguistic change known as th-fronting. But differences persist, and speakers in Liverpool still sound very different to speakers in Plymouth.
In my opinion, dialects and accents are here to stay. Humans enjoy being part of groups, and we can consider language as a key means of expressing the perceived differences between "us" and "them".
Guiding lights
Style manuals – who needs them? Well, I do. I want to write better and I've found that some style guides help me improve my writing.
One of the most helpful guides is Steven Pinker's The Sense of Style. I also rely regularly on Fowler's Dictionary of Modern English Usage, edited by Jeremy Butterfield.
An old-time favourite is Essential English for Journalists, Editors and Writers by Harold Evans. It was published in 1972. Nowadays, I use the 2000 edition of this book, which was revised by Crawford Gillan.
Evans was Editor of the Sunday Times and The Times. Following this lead, I also look for guidance in The Times English Style and Usage from 1992, edited by Simon Jenkins, and the present-day The Times Style Guide, edited by Ian Brunskill.
The joy of mere words
One of the reasons for liking these guides is that they set out the standards in a positive and inspiring way. It's obvious that their authors have, like George Orwell, "discovered the joy of mere words" (Why I Write, 1946).
This is how the guide authors, coming from different generations, express that joy.
The cognitive scientist and linguist Pinker (born 1954) writes: "Style […] adds beauty to the world."
Henry Watson Fowler (1858-1933) was a teacher turned writer. Discussing formal language, he wrote that we weigh our words like we choose our clothes: "We tell our thoughts, like our children, to put on their hats and coats before they go out."
The journalist Evans (born 1928) adds three practical points: "[…] every word must be understood by the ordinary reader, every sentence must be clear at one glance, and every story must say something about people."
Constant change
A more mundane reason for using style manuals is that living languages like English change all the time. For example, new words come into use and old ones change meaning. Good guides keep me informed of these changes, so that I know what my reader understands when I use a specific word.
Finally, these manuals advise me on how to compose phrases, clauses, sentences, paragraphs and stories. I hope you find them useful too.
The photo in this post was taken by Norma Braber-McKinney.
Short and simple
In my copywriting workshops I urge people to write in a style that's short and simple. For example, by using small and clear words rather than long and complex ones. Why write "commence" when you can use "start" or simply "go"?
I also invite workshop participants to challenge me if they think I've got it wrong. For one reason: I'm human and I do make mistakes.
So, recently a participant told us that he felt that longer and more complex words made a textual argument stronger, because the reader would judge the writer as being intelligent, and therefore more convincing.
Is clever better?
His remark ignited a discussion about whether being clever makes a text better.
I recalled a study by Daniel Oppenheimer from Princeton University called "Consequences of Erudite Vernacular Utilized Irrespective of Necessity: Problems with Using Long Words Needlessly".
It concludes: "When obvious causes for low fluency exist that are not relevant to the judgement at hand, people reduce their reliance on fluency as a cue; in fact, in an effort not to be influenced by the irrelevant source of fluency, they over-compensate and are biased in the opposite direction."
In other words, "write clearly and simply if you can, and you'll be more likely to be thought of as intelligent."
Is there ever?
Oppenheimer's conclusion leads also to a further question. Is there ever a need in copywriting for long and complex words, or jargon for that matter?
In my view, this depends on the reader of the text. When you want to adopt the language the reader is using in order to get the message across, you may need to include the difficult words they're using. For example, and provided you understand them, you can use technical terms when writing for technicians or scientific phrases for academics.
But even in these situations, you could bear in mind what the Dutch agency BureauTaal has found, namely that people with higher education levels give a document written in simple language a much higher quality mark than a difficult one.
Perhaps this is caused by most well-educated people, who tend to be strapped for time, appreciating a text more when it's quick and easy to read rather than a piece they've got to plough through.
The long and short of it in copywriting is that if you, like me, are somebody who can write but isn't a genius, you better make it snappy.
What's the right sentence length?
A friend once asked me how many words to use per sentence. An awkward question. Usually, he was a man of many words, so I told him: "Better keep it short."
But he had been commissioned to write an article and insisted on an exact answer: "How many words per sentence? On average?" I suggested 18 – the devil is in the detail.
Useful advice?
To my surprise I later saw this suggestion in a plain English guide. It didn't explain how they had reached the figure of 18. Other writing manuals give similar advice, sometimes providing a number, often between 10 and 22, and sometimes offering suggestions such as "try to keep sentences short and succinct".
Is this advice useful for marketing and corporate communications? I don't think so. Keeping sentences short speeds the text up. That may be useful, but unfortunately a sequence of short sentences can sound like "Ta, ta, ta. Ta, ta, ta. Ta, ta, ta." A machine gun. It gets boring quickly and turns your reader off.
The spice of life
Variation is the spice that makes your words come alive. For example, you can write in the style of the opening of Beethoven's Fifth: short-short-short-long, sounding like "Ta, ta, ta, dah."
Writing is composing. You need rhythm. You need melody. It's classical, but if you prefer music hall, you can go for "Ta-ra-ra Boom-de-ay!"
So, what to do when your sentence gets too long, too wordy? Perhaps it's caused by you trying to cram too many thoughts in one sentence. If that happens, you could follow one of my guidelines:
One thought per sentence. Get quickly to the point.
Active or passive?
If you were typing this sentence, you'd probably get told off by your word processor.
The reason is that the makers of applications such as Microsoft Word don't like the passive voice. And Word shows its dislike by underlining the sentence with a green squiggly line. It wants you to use the active voice: your word processor probably doesn't tell you off for this sentence.
Before you ask, the passive voice is a language construction in which the usual object appears as the subject, and the usual subject is an object or absent altogether. For example, 'the ball is caught by Joe' is passive and 'Joe caught the ball' is active.
Much maligned
The passive voice is much maligned. Only yesterday I read in a manual that prescribes writers what to do: 'Change passive sentence constructions to active.' Other style manuals give similar advice.
There are good reasons for following this advice. To name just a few – an active construction is usually shorter than a passive one, and using a series of short and swift sentences can help the reader, especially when it makes the text easier and quicker to read. It can also render your words more direct and powerful.
The way we talk
A final reason for using the active voice is that it's more like the way we talk. When we speak, most people use an active voice rather than a complicated passive construction. Apparently, because when speaking, we have less time to think about what we want to say.
But that raises a paradox, because the passive tense tends to be overused by people who rush into writing without thinking through what they want to write.
The reader's attention
In any case, there are equally good reasons for ignoring the manual that forbids the use of the passive voice.
One reason is that you can use it to direct the reader's attention. For example, in 'Joe catches the ball' the reader's mental eye sees Joe first, but in 'the ball is caught by Joe' the image in your mind shows the ball whizzing through the air before Joe catches it.
Sometimes the passive helps you stage an event, moving effortlessly between subject and object. For example, 'the ball was caught by Joe. He threw it back.'
Finally, you can use it when you don't want or are unable to describe who's undertaking the action – the usual subject – as in in 'we were robbed'.
How history is brought to life
In my research project on German immigrants in Nottingham during the First World War I'm working with the Trent Academy Group, which consists of Rushcliffe School, The Farnborough Academy and Arnold Hill Academy.
Students and teachers from these schools collaborate in defining research questions and conduct aspects of the research activity and dissemination of the research findings. Furthermore, they are engaged in the production of lasting learning materials on this subject.
So far, ten Year 11 and 12 and thirty Year 9 students from the three schools have taken part in the research work. Below you can read what one of the students wrote in the July issue of their school magazine, the Rushcliffe Post.
We found out what happened to German individuals
"World War One is on our collective conscience currently as we are in the middle of the 100 year anniversary; with soldiers rightly remembered. However, what about the people left behind? What about the residents of Nottingham? In particular, what if, like the poet and First World War soldier Siegfried Sassoon- you had German ancestry, or were German? The three schools of the Trent Academy Group have been given an excellent opportunity to work with an historian on a project that will try to answer this question.
The first part of the project entailed us spending a day in Nottingham Central Library and Nottinghamshire Archives, under the direction of historian Ben Braber. The students were given a framework to work in, but were using their research skills to find out about what happened to German individuals. Ultimately, their research will help develop knowledge and understanding about the impact of the war on the people involved and the wider community.
On Tuesday 12th July we went to the Nottinghamshire Archives. Our task was to find out as much information about Germans/Austrians living in Nottingham in WW1.
Our person was a German man called Alexander Seelig. We shared what we had found out through looking through an accounting book and various old letters about Seelig to the other people at the event. Seelig was accused of trading with the enemy and found guilty. Before he was imprisoned he had his own export trading company called "Seelig & Company" which were an extremely wealthy company.
We then researched different people who were German/Austrian who lived in Nottingham using online records. After researching two different people we came to the conclusion that they must've been visiting or imprisoned as nothing came up for them. However we then were given a final person to look at called "Isaac Bowmer" and we found out that he was of Austrian heritage. We found a newspaper article showing that he'd committed suicide because he was so fearful of what might happen so him as an immigrant living in Britain.
Overall the day was extremely enjoyable and we learnt a lot about German and Austrian immigrants in Nottingham from 1910 onwards and how they lived there life."
Hidden history brought to life
My current research project is on German immigrants in Nottingham during the First World War. It's a collaborative undertaking for academics, teachers and students.
This project breaks new ground, because it examines a subject that has been somewhat overlooked.
The examination focuses on: German migrant numbers and ethnic coherence; their participation in the wider society; prisoners of war, implementation of national measures such as arrest, internment and deportation of German nationals; hostile attitudes such as Germanophobia; riots and disturbances, for example in May 1915 following the sinking of the passenger ship Lusitania; and German reactions and support for the German migrants in Nottingham throughout the period.
This is new research, because the subject has not only often been ignored in academic research, but it has also largely disappeared from the collective (public) memory.
Furthermore, whereas other research and publications on Germans in the UK during this period are usually limited studies on other localities or general countrywide overviews lacking local detail, the findings of this local examination are reviewed in a UK context.
For these purposes the project uses primary sources on the history of Nottingham, available in local and national depositories such as Nottinghamshire Archives and the National Archives, and secondary sources on the history of the UK in this period.
I'm conducting this project with academics at Nottingham Trent University and the University of Nottingham, and we are working with the Trent Academy Group (TAG) – a multi-academy trust that supports schools in providing outstanding education for their pupils. The members of the Group are: Rushcliffe School – An Academy specialising in Science; The Farnborough Academy; and Arnold Hill Academy. All three are based in Nottinghamshire, and teach the First World War as part of the curriculum.
TAG students and their teachers are collaborating in defining research questions as well as conducting aspects of the actual research activity and dissemination of the research findings. Furthermore, they are engaged in the production of lasting learning materials on this subject.
In addition to the focus of examination mentioned above, the students are questioning differences and similarities between the period of the First World War and today when it comes to the position and treatment of foreigners such as immigrants, refugees and asylum seekers, and the development and maintenance of British values in times of conflict, terrorist attack and war.
This assists them in broadening and deepening their historical and social knowledge and developing and honing their research and dissemination skills, and it helps them and their fellow students to identify with historical personalities and events in order to gain a greater understanding of past and present.
Thus, the project brings to life a hidden history of integration and segregation, and makes it relevant for young contemporary audiences through involvement, collaboration and dissemination, leaving a legacy in terms of experiences and learning materials that can be applied in future education and training.
benbraber@btinternet.com
© 2020	Ben Braber


text:
Q: permutations of a string algorithm analysis I have two algorithms for printing the permutations of a string
Here is the 1st one.
#include<iostream>

int fact(int f)
{
   if(f == 0)
      return 1;
  return f*fact(f-1);
}
int main()
{
   char A[] = "abc";
   int size = strlen(A);
   int per = fact(size);  // per is the number of permutations we will get

   int j = 0;   // j is the index of the elements of A we will swap

   // this is the algorithm
   for(int i=1;i<=per;i++)
   {
      cout << A << endl;
      if(j == size-1)
         j = 0;
      swap(A[j],A[j+1]);
      j++;
   }

    return 0;
}

Here is the 2nd one.
// C program to print all permutations of the input string

#include <stdio.h>
#include <string.h>

// Function to swap values at two pointers
void swap(char *x, char *y)
{
   char temp = *x;
   *x = *y;
   *y = temp;
}

// Function to print permutations of string
This function takes three parameters:
1. String
2. Starting index of the string or sub-string
3. Ending index of the string

void permute(char *a, int l, int r)
{
  int i;
  if (l == r)
     printf("%s\n", a);
  else
  {
     for(i = l; i <= r; i++)
     {
        swap((a+l), (a+i));
        permute(a, l+1, r);
        swap((a+l), (a+i)); //backtrack to retain the original string
     }
  }
}

int main()
{
  char str[50];

  gets_s(str);

  int n = strlen(str);
  permute(str, 0, n-1);

  return 0;
}

According to me...both should perform the same....and they in fact do....but only for small inputs..eg: "abc" , "abcd".But when the string becomes large..eg:
"abcdefghi"..the first one takes a hell of a lot of time as opposed to second one.
Im having a tough time analysing why the second one performs better than the first.Can anybody explain this to me?

A: Just add below statement in you main function before you start printing:
std::cout.sync_with_stdio(false);

This disables the synchronization with the standard C-streams for every IO operation.
Read more about it here

redpajama_set_name: RedPajamaStackExchange


text:
Do Dogs Really Eat Homework?
By Renee Colvert| October 6, 2017
Awww, "the dog ate my homework." It's an ironclad alibi. The dog was there, he saw it, he just can't say he saw it, and no one wants to take a close look at the "evidence" once it's "presented." This delightful excuse has been used for decades. But how did it begin, and do dogs really eat homework?
credit: Barna Tanko/iStock/GettyImages
How the excuse began.
The origin story of "the dog ate my homework" is pretty charming. In 1905, the music critic for a Welsh magazine called The Cambrian wrote about a minister temporarily filling in at a country church in Wales. After the service, he asked the clerk if his sermon had been long enough. The minister was relieved to hear that it was and admitted to the clerk that his dog had eaten some of the paper the sermon was written on just before the service. The two had a good laugh and mused about whether the dogs might suffer indigestion from consuming paper.
"The dog ate my homework" in pop culture.
The phrase was used in various other publications over the following decades but became widely popular in the 1970s. Young adult author, Paula Danziger paid homage to it with the title of her 1974 novel, The Cat Ate My Gymsuit. And in 1976 Eugene Kennedy described Richard Nixon as "working on the greatest American excuse since 'the dog ate my homework'" in the Watergate tapes.
According to popular TV shows, dogs were the No. 1 reason homework wasn't getting turned in the '80s and '90s.
In a 1991 Simpsons episode, Bart muses "I didn't know dogs really did that" when he finds his dog, Santa's Little Helper, chomping up his math assignment.
And Saved by the Bell cites the dog as the reason the homework didn't get done in the lyrics of its theme song: "If the teacher pops a test I know I'm in a mess And my dog ate all my homework last night"
Do dog really eat homework?
So is this all just a convenient excuse or do dogs really eat homework? Turns out, they do! NPR found two actual accounts homework hungry hounds.
credit: JStaley401/iStock/GettyImages
The first is Jacqueline Moss, from Cumberland, Maine. Her beloved Labrador, Dusty, turned out to have a taste for history. Moss remembers, "When I was in sixth grade, we had to make a project for ancient civilization, and it was a Sumerian brick. I made it, and I left it on the radiator overnight. I came downstairs in the morning, and it had disappeared. And my dog - my Labrador was looking very guilty." Dusty was fine, the formula her teacher gave her for Sumerian brick, was more like a recipe for a historically big dog biscuit. Graciously, Jacqueline's teacher accepted her excuse.
And in an interesting twist, teacher, Linda Becker from Williamstown, Massachusetts, reports her dog ate her students' homework. She explains, "I came home from teaching one day, and left my bag on the floor in the kitchen; went about my business. When I returned to the kitchen, my puppy - with his little, needle-like teeth - had pulled some student papers out of my bag, and chewed them up. Imagine the embarrassment of having to tell students, my dog ate your homework."
Looks like this tried and true excuse isn't going anywhere. So long as there's homework, there will be dogs to eat it.
Guy Asks For A "Lawyer Dog" & The Courts Take His Request Literally
My Dog Doesn't Like His Crate Anymore
What Dog Breed Is Winn-Dixie?
You'll Never Be As Jealous As This Pug Watching A Mutt Climb BFF For Treats
Mark Zuckerberg Gave His Dog A 3D Clone Of Himself, Presumably For Facebook Selfie Purposes
110 French Pet Names Because Everything Sounds Better in French

redpajama_set_name: RedPajamaCommonCrawl


In March 2013, 34 residents of the Pittsburgh area were brought up on charges for violating narcotics and firearms laws as the DEA and FBI dismantled a major heroin ring. Much of the trafficking of heroin involved in this ring took place in the Homestead, PA area of Pittsburgh's suburbs.
Another drug trafficking bust occurred in April 2013 in Hancock County, PA. During this bust, 19 individuals were charged with 94 counts of the distribution of methamphetamine, heroin, cocaine, marijuana and oxycodone. The persons charged in this bust were from the Hancock County towns of New Cumberland, Newell, East Liverpool, Wellsville, Colliers, Weiton, McKees Rocks, Georgetown and Aliquippa.
In March 2011, the FBI announced that 38 persons from the Pittsburgh area had been charged in three separate drug trafficking busts. Charges ranged from possession and intent to distribute heroin to the possession of firearms and narcotics.
With the massive amounts of drug use, trafficking and distribution in the Pittsburgh area, many community organizations have formed to combat the city's growing drug problem. They include the Pittsburgh Police Department's U-Can Program (United Citizens Against Narcotics), which is a group of Pittsburgh residents fighting drugs on their streets; the Reality Tour, hosted by the Norwin Lions Club and Candle, Inc. that provides lectures to school students from real people whose lives have been affected by drugs and alcohol; and Parents of Teenage Alcohol and Drug Abusers (POTADA), a support group for parents of teenage drug and alcohol abusers in the Pittsburgh area.
Pittsburgh is located within the DEA's Philadelphia Division. A Resident Office exists in Pittsburgh. For those looking into how to become a DEA agent in Pittsburgh by meeting requirements, it is important to note that a college degree of some type is usually necessary. Which degree one possesses depends upon other specialized skills and experience. The exception to this rule is made for specialized experience in drug investigations – in which case the possession of a college degree is unnecessary. For more information on qualifications necessary before one can become a DEA agent in Pittsburgh through training, see this link.


text:
APIs and SDKs
Pricing & Support
Pricing & Implementation
Looker-BI & Analytics
Google Maps Consulting
How to Use Interactive Maps in Your Marketing
How can businesses reach their target groups or inspire a broader audience in times of media overkill and rising customer expectations? Here you can get a bunch of ideas about how to engage your customers by using interactive maps.
Content and Context: Storytelling with maps
How can companies stand out in times of media overkill? Traditional campaigns have short-term effects. Better provide added value for your customers. Build trust and loyalty with a little extra, for example with interactive maps that make content tangible. Most data have a geographical reference. You add a photo to your Instagram account? Pin it to your photo map. Are your products available in different stores? Locate them on a map. And there are way more options to use location information.
Storytelling on a map: inspiration for travel & leisure
There are lots of fascinating spots in the world that are worth seeing. But a lot of them are in remote areas or you need special skills to reach them (for instance, climbing). Wouldn't it be wonderful to provide access to those places for a worldwide audience? That's the aim of the Google Street View Treks. Ubilabs has developed four Google Street View Treks in the last two years.
Google Street View Treks: visit remote areas and unseen worlds
One of the Street View Treks unintentionally became a historic document: The Google Street View Trek Khumbu, a region close to the Mount Everest, that got devastated by an earthquake in April 2015. In the year 2014, Google mapped and photographed the region, created new Street View images and improved its maps in order to develop this Street View Trek. In addition, videos and interviews have been taken to ensure a holistic experience. Users can visit a German Bakery and listen to its owner about how to run a business in this region. They can follow a small plane landing at the Lukla airport at a steep airstrip, which is the first of many adventures for visitors to the region.
Interactive features liven up websites of renowned brands
Treks like this can also be used by businesses in the tourism and leisure sector to inspire customers. Each trek is developed individually – and imply different challenges: For example, the trek to the top of El Capitan has been the first vertical trek, which is a much greater technical feat than standard horizontal treks. This meant that new ways had to be found for taking the photos and for programming. In order to improve the user experience, very high-resolution Street View photos were put to use. Versions of this microsite have been used by The New York Times and Patagonia to enhance their websites with a high-quality, interactive feature. The well-known Google Street View Trek Miniatur Wunderland was the most challenging Trek until now: we needed a lot of special techniques and hardware to take pictures in these small dimensions. The effort has paid off: With a range of more than 2 billion, this unique project inspired people on five continents – and recently won the Webby People's Voice Award 2016.
Inspire your customers: Kia Surprise Drive
For the relaunch of the Kia cee'd in fall 2015, the automotive company started a new campaign according to the claim "The surprising machine". To inspire their spontaneous and curious customers, a new application has been developed: The Kia Surprise Drive. It's the first online experience ever that creates an interesting route with surprising places along the trip. Users can enter preferences based on information from Tripadvisor and start their journey.
DB Mobil: Mapping Germany's most beautiful places
Another way to create an interactive map to inspire customers is the interactive photographic guide, Mein liebstes Stück Deutschland from DB MOBIL, that allows readers an opportunity to share their favorite images. A graphically appealing map of Germany gives users an initial overview and whets their appetite to discover the various regions. Posts come from both DB MOBIL readers and DB MOBIL editors. As a special extra, the site features contributions from celebrities, who present their favorite places in the virtual guide. All entries can be found via a map of Germany and by using the menu option "In meiner Nähe". The site is compatible with smartphones and enables users to access places in their immediate vicinity.
Development Design Maps Marketing Street View Google Travel Project
Thanks for all in 2020!
CAPinside – more successful thanks to Google Cloud
ESA: Storytelling makes climate change tangible
Design Development Google Data Visualization Maps Project event team
A Map Helps Gambling Addicts to Stay Clean
Ubilabs & Miniatur Wunderland win Internet Oscar 2016
Map up
Ubilabs is a long-time Google Cloud Premier Partner and creates interactive maps applications.
Ubilabs GmbH
Heidi-Kabel-Platz 2
ham@ubilabs.com
+49 40 60 94 661-0
Herzogspitalstraße 24
muc@ubilabs.com
Ubilabs, Inc.
1390 Market St, Ste 200
sfo@ubilabs.com
© 2021 Ubilabs


Migration is one of the major challenges facing the world in the twenty-first century. This phenomenon plays a key role in the natural movement of the population and is gaining impetus in the country and the region. International migration is a growing phenomenon which could make a positive contribution to the development of both the migrant sending and receiving economies. Macedonia is characterized as a migration area, with intensive internal migration, but lately the process of international migration is also increased. The most common reasons for such movements are economical. Economic consequences of migrations and remittances are hardly recognized.
There is a connection between the unemployment and migration rates. The unemployment often is a reason why people decide to migrate. People often are leaving in other countries seeking for better living conditions. When it comes to Macedonia, the most common situation in the households is that one member from the family; usually the father is the migrant who sends money to the family members left behind. Public statistics about the number of migrants are incomplete. Remittances have become frequent income in the households. It is assumed that remittances may impact on education and health of the family members left behind and thus that they increase the education level and quality of life of the citizens of receiving country. With detecting the precise reasons for migration, actions for reducing it may be created; also guidelines for decreasing the level of migration can be provided. The aim of Analytica will be to examine the impact of migration on the standards of living in the country and to provide comprehensive analysis to the public with guidance on some of the issues likely to be faced in measuring international migration. Research from this field would enable us to connect all findings into one entirety and to present Analytica as primary source of information to the public.
1. Migration and development in Albania and Macedonia: the effects of remittances on education and health of family members left behind", a project funded by the Regional Research Promotion Programme of the Swiss Federal Department of Foreign Affairs for the period of 2012-2013, in cooperation with ACSER – Albanian Centre for Socio-Economic Research in Albania.
2. Impact of migration on women empowerment in Western Balkan countries. This project is funded by the Regional Research Promotion Programme for the Western Balkans (RRPP) of the Swiss Agency for Development and Cooperation. The project will be implemented in period of 12 months.


text:
Q: NodeJS Timeout a Promise if failed to complete in time How can I timeout a promise after certain amount of time?
I know Q has a promise timeout, but I'm using native NodeJS promises and they don't have .timeout function.
Am I missing one or its wrapped differently?
Alternatively, Is the below implementation good in means of not sucking up memory, actually working as expected?
Also can I make it somehow wrapped globally so I can use it for every promise I create, without having to repeat the setTimeout and clearTimeout code?
function run() {
    logger.info('DoNothingController working on process id {0}...'.format(process.pid));

    myPromise(4000)
        .then(function() {
            logger.info('Successful!');
        })
        .catch(function(error) {
            logger.error('Failed! ' + error);
        });
}

function myPromise(ms) {
    return new Promise(function(resolve, reject) {
        var hasValueReturned;
        var promiseTimeout = setTimeout(function() {
            if (!hasValueReturned) {
                reject('Promise timed out after ' + ms + ' ms');
            }
        }, ms);

        // Do something, for example for testing purposes
        setTimeout(function() {
            resolve();
            clearTimeout(promiseTimeout);
        }, ms - 2000);
    });
}

Thanks!

A: Native JavaScript promises don't have any timeout mechanism.
The question about your implementation would probably be a better fit for http://codereview.stackexchange.com, but a couple of notes:

*

*You don't provide a means of actually doing anything in the promise, and

*There's no need for clearTimeout within your setTimeout callback, since setTimeout schedules a one-off timer.

*Since a promise can't be resolved/rejected once it's been resolved/rejected, you don't need that check.
So continuing your myPromise function approach, perhaps something like this:
function myPromise(timeout, callback) {
    return new Promise((resolve, reject) => {
        // Set up the timeout
        const timer = setTimeout(() => {
            reject(new Error(`Promise timed out after ${timeout} ms`));
        }, timeout);

        // Set up the real work
        callback(
            (value) => {
                clearTimeout(timer);
                resolve(value);
            },
            (error) => {
                clearTimeout(timer);
                reject(error);
            }
        );
    });
}

Used like this:
myPromise(2000, (resolve, reject) => {
    // Real work is here
});

(Or possibly slightly less complicated, see under the divider below.)
I'd be slightly concerned about the fact that the semantics are different (no new, whereas you do use new with the Promise constructor). But the bigger issue with it is that it assumes you're always creating a promise from scratch, but you usually want to be able to use a promise you already have.
You can deal with both issues by subclassing Promise:
class MyPromise extends Promise {
    constructor(timeout, callback) {
        // We need to support being called with no milliseconds
        // value, because the various Promise methods (`then` and
        // such) correctly call the subclass constructor when
        // building the new promises they return.
        const haveTimeout = typeof timeout === "number";
        const init = haveTimeout ? callback : timeout;
        super((resolve, reject) => {
            if (haveTimeout) {
                const timer = setTimeout(() => {
                    reject(new Error(`Promise timed out after ${timeout}ms`));
                }, timeout);
                init(
                    (value) => {
                        clearTimeout(timer);
                        resolve(value);
                    },
                    (error) => {
                        clearTimeout(timer);
                        reject(error);
                    }
                );
            } else {
                init(resolve, reject);
            }
        });
    }
    // Pick your own name of course. (You could even override `resolve` itself
    // if you liked; just be sure to do the same arguments detection we do
    // above in the constructor, since you need to support the standard use of
    // `resolve`.)
    static resolveWithTimeout(timeout, x) {
        if (!x || typeof x.then !== "function") {
            // `x` isn't a thenable, no need for the timeout,
            // fulfill immediately
            return this.resolve(x);
        }
        return new this(timeout, x.then.bind(x));
    }
}

Usage (if constructing a new promise):
let p = new MyPromise(300, (resolve, reject) => {
    // ...
});
p.then((value) => {
    // ...
})
.catch((error) => {
    // ...
});

Usage (if using a promise you already have):
MyPromise.resolveWithTimeout(100, somePromiseYouAlreadyHave)
.then((value) => {
    // ...
})
.catch((error) => {
    // ...
});

Live Example:

"use strict";

class MyPromise extends Promise {
    constructor(timeout, callback) {
        // We need to support being called with no milliseconds
        // value, because the various Promise methods (`then` and
        // such) correctly call the subclass constructor when
        // building the new promises they return.
        const haveTimeout = typeof timeout === "number";
        const init = haveTimeout ? callback : timeout;
        super((resolve, reject) => {
            if (haveTimeout) {
                const timer = setTimeout(() => {
                    reject(new Error(`Promise timed out after ${timeout}ms`));
                }, timeout);
                init(
                    (value) => {
                        clearTimeout(timer);
                        resolve(value);
                    },
                    (error) => {
                        clearTimeout(timer);
                        reject(error);
                    }
                );
            } else {
                init(resolve, reject);
            }
        });
    }
    // Pick your own name of course. (You could even override `resolve` itself
    // if you liked; just be sure to do the same arguments detection we do
    // above in the constructor, since you need to support the standard use of
    // `resolve`.)
    static resolveWithTimeout(timeout, x) {
        if (!x || typeof x.then !== "function") {
            // `x` isn't a thenable, no need for the timeout,
            // fulfill immediately
            return this.resolve(x);
        }
        return new this(timeout, x.then.bind(x));
    }
}

// Some functions for the demonstration
const neverSettle = () => new Promise(() => {});
const fulfillAfterDelay = (delay, value) => new Promise((resolve) => setTimeout(resolve, delay, value));
const rejectAfterDelay = (delay, error) => new Promise((resolve, reject) => setTimeout(reject, delay, error));

const examples = [
    function usageWhenCreatingNewPromise1() {
        console.log("Showing timeout when creating new promise");
        const p = new MyPromise(100, (resolve, reject) => {
            // We never resolve/reject, so we test the timeout
        });
        return p.then((value) => {
            console.log(`Fulfilled: ${value}`);
        })
        .catch((error) => {
            console.log(`Rejected: ${error}`);
        });
    },

    function usageWhenCreatingNewPromise2() {
        console.log("Showing when the promise is fulfilled before the timeout");
        const p = new MyPromise(100, (resolve, reject) => {
            setTimeout(resolve, 50, "worked");
        });
        return p.then((value) => {
            console.log(`Fulfilled: ${value}`);
        })
        .catch((error) => {
            console.log(`Rejected: ${error}`);
        });
    },

    function usageWhenCreatingNewPromise3() {
        console.log("Showing when the promise is rejected before the timeout");
        const p = new MyPromise(100, (resolve, reject) => {
            setTimeout(reject, 50, new Error("failed"));
        });
        return p.then((value) => {
            console.log(`Fulfilled: ${value}`);
        })
        .catch((error) => {
            console.log(`Rejected: ${error}`);
        });
    },

    function usageWhenYouAlreadyHaveAPromise1() {
        console.log("Showing timeout when using a promise we already have");
        return MyPromise.resolveWithTimeout(100, neverSettle())
        .then((value) => {
            console.log(`Fulfilled: ${value}`);
        })
        .catch((error) => {
            console.log(`Rejected: ${error}`);
        });
    },

    function usageWhenYouAlreadyHaveAPromise2() {
        console.log("Showing fulfillment when using a promise we already have");
        return MyPromise.resolveWithTimeout(100, fulfillAfterDelay(50, "worked"))
        .then((value) => {
            console.log(`Fulfilled: ${value}`);
        })
        .catch((error) => {
            console.log(`Rejected: ${error}`);
        });
    },

    function usageWhenYouAlreadyHaveAPromise3() {
        console.log("Showing rejection when using a promise we already have");
        return MyPromise.resolveWithTimeout(100, rejectAfterDelay(50, new Error("failed")))
        .then((value) => {
            console.log(`Fulfilled: ${value}`);
        })
        .catch((error) => {
            console.log(`Rejected: ${error}`);
        });
    },

    async function usageInAnAsyncFunction1() {
        console.log("Showing timeout in async function");
        try {
            const value = await MyPromise.resolveWithTimeout(100, neverSettle());
            console.log(`Fulfilled: ${value}`);
        } catch (error) {
            console.log(`Rejected: ${error}`);
        }
    },

    async function usageInAnAsyncFunction2() {
        console.log("Showing fulfillment in async function");
        try {
            const value = await MyPromise.resolveWithTimeout(100, fulfillAfterDelay(50, "worked"));
            console.log(`Fulfilled: ${value}`);
        } catch (error) {
            console.log(`Rejected: ${error}`);
        }
    },

    async function usageInAnAsyncFunction3() {
        console.log("Showing rejection in async function");
        try {
            const value = await MyPromise.resolveWithTimeout(100, rejectAfterDelay(50, new Error("failed")));
            console.log(`Fulfilled: ${value}`);
        } catch (error) {
            console.log(`Rejected: ${error}`);
        }
    },
];

(async () => {
    for (const example of examples) {
        try {
            await example();
        } catch (e) {
        }
    }
})();
/* Shows the cosole full height in the snippet */
.as-console-wrapper {
    max-height: 100% !important;
}

The code above actively cancels the timer when either resolving or rejecting the promise. That may not be necessary depending on your use case, and complicates the code a bit. It's not necessary for the promise part of things; once a promise is resolved or rejected, that cannot be changed, calling the resolve or reject function again has no effect on the promise (the spec is clear about that). But if you don't cancel the timer, the timer is still pending until it fires. A pending promise will keep Node.js from exiting, for instance, so if you did this with a long timeout on the last thing you were doing, it could pointlessly delay exiting the process. Browsers don't delay leaving the page with pending timers, so that doesn't apply to browsers. So again, your mileage may vary and you may be able to simplify a bit by not cancelling the timer.
If you didn't care about the pending timer, MyPromise would be a simpler:
class MyPromise extends Promise {
    constructor(timeout, callback) {
        // We need to support being called with no milliseconds
        // value, because the various Promise methods (`then` and
        // such) correctly call the subclass constructor when
        // building the new promises they return.
        const haveTimeout = typeof timeout === "number";
        const init = haveTimeout ? callback : timeout;
        super((resolve, reject) => {
            init(resolve, reject);
            if (haveTimeout) {
                setTimeout(() => {
                    reject(new Error(`Promise timed out after ${timeout}ms`));
                }, timeout);
            }
        });
    }
    // Pick your own name of course. (You could even override `resolve` itself
    // if you liked; just be sure to do the same arguments detection we do
    // above in the constructor, since you need to support the standard use of
    // `resolve`.)
    static resolveWithTimeout(timeout, x) {
        if (!x || typeof x.then !== "function") {
            // `x` isn't a thenable, no need for the timeout,
            // fulfill immediately
            return this.resolve(x);
        }
        return new this(timeout, x.then.bind(x));
    }
}

A: To add a timeout to any existing promise, you can use:
const withTimeout = (millis, promise) => {
    const timeout = new Promise((resolve, reject) =>
        setTimeout(
            () => reject(`Timed out after ${millis} ms.`),
            millis));
    return Promise.race([
        promise,
        timeout
    ]);
};

Then later:
await withTimeout(5000, doSomethingAsync());

A: An Extension Method is a convenient solution:
fetch("/example")
    .withTimeout(5000);

This is implemented by adding a method to the prototype of the Promise global object.
promiseWithTimeout.js:
/** Adds a timeout (in milliseconds) that will reject the promise when expired. */
Promise.prototype.withTimeout =
    function (milliseconds) {
        return new Promise((resolve, reject) => {
            const timeout = setTimeout(() => reject(new Error("Timeout")), milliseconds);
            return this
                .then(value => {
                    clearTimeout(timeout);
                    resolve(value);
                })
                .catch(exception => {
                    clearTimeout(timeout);
                    reject(exception);
                });
        });
    };

export {}; // only needed if imported as a module

For TypeScript support, add the following declare block before defining Promise.prototype.withTimeout:
declare global {
    interface Promise<T> {
        /** Adds a timeout (in milliseconds) that will reject the promise when expired. */
        withTimeout(milliseconds: number): Promise<T>;
    }
}

A: While maybe there's no support for a promise timeout, you could race promises:

var race = Promise.race([
  new Promise(function(resolve){
    setTimeout(function() { resolve('I did it'); }, 1000);
  }),
  new Promise(function(resolve, reject){
    setTimeout(function() { reject('Timed out'); }, 800);
  })
]);

race.then(function(data){
  console.log(data);
  }).catch(function(e){
  console.log(e);
  });

A generic Promise.timeout:
Promise.timeout = function(timeout, cb){
  return Promise.race([
  new Promise(cb),
  new Promise(function(resolve, reject){
    setTimeout(function() { reject('Timed out'); }, timeout);
  })
]);
}

Example:

    Promise.timeout = function(timeout, cb) {
      return Promise.race([
        new Promise(cb),
        new Promise(function(resolve, reject) {
          setTimeout(function() {
            reject('Timed out');
          }, timeout);
        })
      ]);
    }

    function delayedHello(cb){
      setTimeout(function(){
        cb('Hello');
        }, 1000);
      }

    Promise.timeout(800, delayedHello).then(function(data){
      console.log(data);
      }).catch(function(e){
      console.log(e);
      }); //delayedHello doesn't make it.

    Promise.timeout(1200, delayedHello).then(function(data){
      console.log(data);
      }).catch(function(e){
      console.log(e);
      }); //delayedHello makes it.

Might be a little bit costly, because you are actually creating 3 promises instead of 2. I think it's clearer this way though.
You might want to setup a promise instead of having the function construct it for you. This way you separate concerns and you are ultimately focused on racing your promise against a newly built promise that will reject at x miliseconds.
Promise.timeout = function(timeout, promise){
  return Promise.race([
  promise,
  new Promise(function(resolve, reject){
    setTimeout(function() { reject('Timed out'); }, timeout);
  })
]);
}

How to use:
var p = new Promise(function(resolve, reject){
    setTimeout(function() { resolve('Hello'); }, 1000);
});

Promise.timeout(800, p); //will be rejected, as the promise takes at least 1 sec.

A: This is slightly old question, but I stumbled upon this when I was looking how to timeout a promise.
Whilst all the answers are great, I found using bluebird implementation of Promises as the easiest way of handling timeouts:
var Promise = require('bluebird');
var p = new Promise(function(reject, resolve) { /.../ });
p.timeout(3000) //make the promise timeout after 3000 milliseconds
 .then(function(data) { /handle resolved promise/ })
 .catch(Promise.TimeoutError, function(error) { /handle timeout error/ })
 .catch(function(error) { /handle any other non-timeout errors/ });

As you can see this is so much less work than the other proposed solutions. I thought I will put it here to make it easier for people to find it :)
Btw I am not by any means involved in bluebird project, just found this particular solution very neat.

A: While the answers here are valid, you should not try to reinvent the wheel and just use one of the dozens available packages on NPM for the self-resolving promise.
Here's one example from NPM:
const { TimeoutResolvePromise, TimeoutRejectPromise } = require('nodejs-promise-timeout');
const TIMEOUT_DELAY = 2000;

// This promise will reject after 2 seconds:
let promise1 = new TimeoutRejectPromise(TIMEOUT_DELAY, (resolve, reject) => {
  // Do something useful here, then call resolve() or reject()
});

A: If your code is placed in a class you could use a decorator for that. You have such decorator in the utils-decorators library (npm install --save utils-decorators):
import {timeout} from 'utils-decorators';

class SomeService {

   @timeout(3000)
   doSomeAsync(): Promise<any> {
    ....
   }
}

or you could use a wrapper function:
import {timeoutify} from 'utils-decorators';

const withTimeout = timeoutify(originalFunc, 3000);

A: A wrapper would be convenient in this situation
usage
const result = await withTimeout(() => doSomethingAsync(...args), 3000)();

or
const result = await withTimeout(doSomethingAsync, 3000)(...args);

or even
const doSomethingAsyncWithTimeout = withTimeout(doSomethingAsync, 3000);
const result = await doSomethingAsyncWithTimeout(...args);

implementation
/**
 * returns a new function which calls the input function and "races" the result against a promise that throws an error on timeout.
 *
 * the result is:
 * - if your async fn takes longer than timeout ms, then an error will be thrown
 * - if your async fn executes faster than timeout ms, you'll get the normal response of the fn
 *
 * ### usage
 * ```ts
 * const result = await withTimeout(() => doSomethingAsync(...args), 3000);
 * ```
 * or
 * ```ts
 * const result = await withTimeout(doSomethingAsync, 3000)(...args);
 * ```
 * or even
 * ```ts
 * const doSomethingAsyncWithTimeout = withTimeout(doSomethingAsync, 3000);
 * const result = await doSomethingAsyncWithTimeout(...args);
 * ```
 */
const withTimeout = <R, P extends any, T extends (...args: P[]) => Promise<R>>(logic: T, ms: number) => {
  return (...args: Parameters<T>) => {
    // create a promise that rejects in <ms> milliseconds; https://italonascimento.github.io/applying-a-timeout-to-your-promises/
    const timeout = new Promise((resolve, reject) => {
      const id = setTimeout(() => {
        clearTimeout(id);
        reject(new Error(`promise was timed out in ${ms} ms, by withTimeout`));
      }, ms); // tslint:disable-line align
    });

    // returns a "race" between our timeout and the function executed with the input params
    return Promise.race([
      logic(...args), // the wrapped fn, executed w/ the input params
      timeout, // the timeout
    ]) as Promise<R>;
  };
};


Built for both the Sahara and the Himalayas, the Mountain Hardwear Chiller Wide Brim Hat offers excellent sun protection with 360 degrees of coverage.
Your browser isn't supported for displaying eBay items. Go to eBay to search for Mountain Hardwear Womens Chiller Wide Brim Hat.


text:
Q: datatable excel export button not working properly when header contain select menu im using datatable with its extension buttons for exporting excel. im having select menu filter on some columns. when data is exported to excel , it contains all options in select menu in header. i just want the header name and dont know what to do
here is the code:jsfiddle
i test multi header like this

 data without select menu

 data with select menu

but it did not work ;
.


Present this quick, effective method for assessing and managing common medical conditions! The central tool of this text is the decision tree, a simple flowchart that helps students quickly determine the optimal massage therapy approach for specific medical conditions. A Decision Tree is included for each of the more than 50 conditions discussed in the book, with massage considerations listed for numerous additional conditions in brief. Also unique to this text are questions therapists can ask clients during the interview process to help the therapist understand not just the medical condition, but how it presents in a particular client.


Comments on the role of technology in providing security to the dwellers of New York City and other cities in the United States from terrorist attacks. Effects of the September 11, 2001 terrorist attacks on the people in the U.S.; Chemical weapon sensors installed in the subway system of D.C. Metro; Technological responses to September 11.
The article reports updates on the local residents in Tatum, Texas including Jean Williams, Dee Nell Swanner and Joyce Daniels.
Discusses the significance of California state. Characteristics of California residents; Issues that are opposed by people in the state.
The reports on developments on the residents of Beckville City, Texas.
The article reports on developments in Tatum City area in Texas related to its economy and residents.
The article cites news items related to residents of Malakoff, Texas as of January 2007.


Beaumonde Catering has been announced as this year's sponsor for the Fashions of the Field.
The Sunday Times is giving one lucky winner a chance to be a VIP for the day at the Toodyay Picnic Race Day on September 28. Plus there are some exciting runner up prizes to be won!
Return bus transfers will be running from Belmont Racecourse to Toodyay Racecourse on the day.
Tickets can now be booked through Moshtix.com.
Sunday, 28 September 2014 marks the 149th Toodyay Picnic Race Day and as always, the day promises to be a fun filled extravaganza with this year's event offering even more excitement.


Car rentals from Centauro in Livorno were reviewed by 1000+ customers with a rating of 6.8/10. The cheapest car from Centauro in Livorno is Fiat 500X of SUV, Pickup, Jeep, 4x4 car rental class. Its price is just $28.31 per day.
Most of our customers usually book vehicles of Economy car rental class in Italy. The cheapest Economy car from Centauro in Livorno is presented by Volkswagen Polo for $45.40 per day.
Autoclick is the car rental company with highest customers' rank in Livorno with a rating average score of 8/10, based on 250+ customer reviews. The cheapest vehicle from Autoclick is Ford Fiesta of Economy car rental class for $40.20 per day.
As for the most popular in Italy car rental group, which's Economy, the cheapest car from Autoclick in Livorno is Ford Fiesta, priced at $40.20 per day.
The cheapest car rental in Livorno is Smart Fortwo from Autovia. Its price is only $9.43 per day. Autovia was reviewed by 100+ customers with a rating average score of 7.2/10.


We've been wanting something like this for ages; a fast, simple way of tracking the progress of your golfing mates.
We can't help but let everyone know about this simple, little app that lets you track the handicaps for all your golfing mates. It's exactly the sort of thing we've been wanting for a long time.
While available just for Android users at the moment, Handy Cap allows you to add a golfer's name and GolfLink number, allowing you to track their official Golf Australia handicap and competition round results.
A list view of your golfing mates gives a quick view of each players handicap and a 'dot representation' of which of the 8 previous rounds are contributing to the handicap.
Tapping on the golfer's name gives a more detailed history of each of the last 20 competition rounds including a graph of the 'played to' handicap plotted along with the official GA handicap. Competition par, result and overall winner for the round is also provided for each round.
And that's it. And that's why we love it. Simple, easy to use and a fast way to keep up to date with how your mates are fairing on the golf course.
Reportedly a notification feature is in the works so that you get a notification when a mate shoots a good score. We're told that more features will be added if the need is there and they can be easily implemented.
Handy Cap is available for Android users only via the Google Play store.
VIDEO / Barnbougle featured on Golfing World Traveller VIDEO / Golfing World walk the course with Marc Leishman Are these the 15 best mini golf courses in Australia?
How do I delete a player from the Handy Cap app?
swipe the player's name to the left and that will bring up the option to edit/delete.