All in a day
Friday, April 22, 2016
Tuesday, September 20, 2011
How to Find a Cheap Flight via http://www.nomadicmatt.com/travel-tips/how-to-find-a-cheap-flight/
How to Find a Cheap Flight
The world is in an economic crisis, and tourism is down all over the world. Airlines have slashed fees and costs in order to fill some of the empty seats. Yet flights — especially on the major airlines — are still expensive. Rising oil costs, increased personal costs, and material costs have all added to rising ticket fares. Bankruptcy has also meant that airlines, which are under pressure to make a profit, can’t reduce fares that much.The era of dirt-cheap travel is over, and, when the flight can represent the biggest part of your trip expenses, finding that hidden cheap deal can be just as important as finding the right location, the right tour, the right backpack, or the right hotel. However, there are still plenty of ways to find a cheap ticket. Here are a few tips that can help you find cheap flights and flight deals:
Be Flexible with Your Travel Dates
If you’re rigid with your dates, you won’t be able to capture any of the pricing variations airlines use. Ticket prices always fluctuate depending on day and time of the week. For example, t’s always cheaper to fly mid-week than on a weekend. It’s cheaper to fly out after major holidays rather than before. That week after Christmas? No one ever flies because they are with their families – and prices drop. Fight prices also drop a bit on Tuesday nights. Since more people fly and book during the weekend, airlines raise prices, then drop them down mid-week as they all compete for weekend fliers. Additionally, this is when they release new seating information. Early morning or late-night flights are also usually cheaper, as fewer people want those flights. When searching for flights, be flexible – you will catch better deals. I often fly out early in the morning, not because I like waking up early, but because it can save me a few hundred dollars. Moreover, give yourself some wiggle room on the dates. The difference of a day can be the difference of a few hundred dollars.
Fly to Secondary Airports with Low-Cost Carriers
Most major cities have a smaller, secondary airport. This is the airport most low-cost carriers (LCC) fly into because it’s cheaper and helps keep costs down. Airports charge landing fees, and smaller airports charge smaller fees, which helps keep prices down for you. Check out which airlines fly into these smaller airports. For example, you can take JetBlue to Long Beach, an airport close to Los Angeles, instead of flying into LAX, and save some money. In America, there are over 20 different LCCs. In Europe, there are even more, and competition has kept prices there very low. In Asia, Air Asia has led to a huge drop in fares and is a great budget airline to fly. For example, you can find tickets from Bangkok to Kuala Lumpur for $40 USD. Many times, these low-cost airlines offer no-fare tickets — you pay just the taxes. Flying the budget airlines is a good alternative to flying the “majors” whenever possible. You get less “perks,” but you can save a bundle in ticket costs. But be sure to check out how far the airports are from the city center — sometimes transportation from the airport to the city can actually make a budget airline more expensive. However, in general, these low-cost carriers are a good deal (even though cheap flights sometimes aren’t the best).
Try Alternative Routes
Not only does it help to be flexible with dates, but try being flexible with the route you take, too. Sometimes it’s cheaper to fly to London and take a LCC to Amsterdam rather than flying direct to Amsterdam. There are so many low-cost carriers around the world that taking advantage of a good deal to another city and then hopping on a LCC to your destination is sometimes the best way to go. Moreover, direct flights are always more expensive than connecting ones. Just by picking a connecting flight route, you will save money. If you do the infamous Saturday night stay, you’ll also save money. By working various airlines and special offers, you can save a lot. This method is not for everyone, however. It is more work, as you have to figure out lots of different routes and check different airlines. But it will shave some money off your flight, giving you more to spend at your destination.
Know What You Want to Pay for a Flight
People always try to get the lowest price online, wait too long, and then pay too much. We all know airline prices always bounce up and down, yet in our quest to hold out just a little longer, most of us miss the lowest price. Therefore, it’s important to know what you want to pay, not what you hope to pay. What’s the lowest price for YOU? Is $200 from NY to Miami what you want? Don’t want to pay more than $900 to go from LA to Tokyo? Then don’t. Don’t wait for the perfect price — wait for YOUR price. Wait until prices get close to, at, or lower than your desired price, and then buy. Then you will never have buyer’s remorse. Prices always fluctuate, so you’ll never know if you did good or bad. No two people on a flight pay the same price, so all you can do is hope you get the price you are comfortable paying. Sites like Farecast can help you predict when to buy.
Remember Not All Search Engines are Equal
Whenever most Americans do a Web search for airline tickets, they search Expedia or Orbitz. That’s a big mistake. These sites either work with or are owned by the airline companies and don’t offer unbiased fares. Moreover, sites like these don’t list LCC carriers because those airlines don’t want to pay a booking commission. The best search engines are the ones that have no affiliation with any airline and make their money via advertising, not bookings. Skyscanner is great for low-cost carriers, and they now search a few of the majors as well. Kayak is great for those flying out of the United States. Momondo is also a good search engine. Make sure you check a few sites before you book, as you’ll often see variations in prices.
Search an Airline’s International Websites
Don’t forget to search the international websites of all major airlines, too. You might think that prices will be the same across the board, but remember that all sites and prices are not the same. I have found Air New Zealand tickets from Tokyo to LA hundreds of dollars cheaper when searching the NZ version of the website instead of the US. I found tickets to and from Europe cheaper by searching the Canadian version of the British Airways website. Many times, these tickets are also priced in foreign denominations, which can also make the prices slightly cheaper depending on your currency. You are allowed to book your flight from a website located in a different country. You will just be charged in the local currency. (Note: The recent fall of the US dollar has made this hard to work for Americans, but easier for people on the Euro, Pound, or Yen!)
Take Advantage of Student Discounts
If you are a student, there are many, many discounts available to you. Check out STA Travel and their search engine. You can find flexible student tickets on their website and at agency stores. I used them for a $400 ticket from Athens to Bangkok. That wasn’t even the cheapest flight, either, just the cheapest direct flight. There are many student codes out there, and many of the tourist agencies in backpacker areas can help find you a cheap ticket.
Sign Up for a Frequent Flier Program
Frequent flier programs are a great way to get points towards cheap flights, discount fares, free upgrades, and free companion tickets. Join one!! Even if you do not fly a lot, miles usually take a few years to expire, and, with sign-up bonuses, in that time you can probably earn at least one free upgrade or domestic ticket. In joining a frequent flier program, you will have to sign up with one of the major airlines. These airlines usually cost more than low-cost carriers, so, in the short run, you’ll pay more money. However, the long-term benefits you’ll get are worth it. I used to just go for the cheapest flight, but had I stuck to one airline or airline network, I would have been a high-tier member now, flying first class instead of in the back of coach. You can click here to find out about choosing a rewards credit card or joining a frequent flier program.
Join Mailing Lists
No one likes to clutter up their inbox, but by signing up for mailing lists from airlines and search engines, you’ll be able to get updates about all the last-minute or special deals that are happening. Many times, the cheap flights are only available for 24 hours, and if you aren’t always checking the Web for them, you will miss out on many of the great and super-cheap deals that occur. I would have missed out on a round trip ticket to Japan for $700 USD (normally $1,500) if I wasn’t on American Airlines’ mailing list. Additionally, they offer frequent flier bonuses, and those deals have also gotten me free business class tickets. Mailing lists are essential, especially as you get closer to booking your flight.
Book Early
With oil prices going up, airlines are raising fees. They have been raised 7 times this year alone (and it’s only April!!). It used to be that the best booking window was 6 to 8 weeks before your flight, but now, I would say book as soon as you know when you’re going. My laziness cost me $200 USD because, even though I knew when I wanted to fly, I didn’t book before the price increase. You can bet that if oil keeps going up, fares will keep rising, too. It’s important to book as soon as you know when you want to go instead of playing the waiting game. You can also read this interview with George Hobica, the head of Airfarewatchdog.com (an airline monitoring website), to learn more about the current state of airline ticket prices and where things are going.
Monday, September 12, 2011
STL Breaking Changes in Visual Studio 2010 Beta 1
25 May 2009 11:49 AM
Visual Studio 2010 Beta 1
is now available for download. I've recently blogged about how Visual
C++ in VS 2010 Beta 1, which I refer to as VC10 Beta 1, contains
compiler support for five C++0x core language features: lambdas, auto, static_assert, rvalue references, and decltype.
It also contains a substantially rewritten implementation of the C++
Standard Library, supporting many C++0x standard library features. In
the near future, I'll blog about them in Part 4 and beyond of "C++0x
Features in VC10", but today I'm going to talk about the STL changes
that have the potential to break existing code, which you'll probably
want to know about before playing with the C++0x goodies.
Problem 1: error C3861: 'back_inserter': identifier not found
This program compiles and runs cleanly with VC9 SP1:
C:\Temp>type back_inserter.cpp
#include
#include
#include
#include
using namespace std;
int square(const int n) {
return n * n;
}
int main() {
vector v;
v.push_back(11);
v.push_back(22);
v.push_back(33);
vector dest;
transform(v.begin(), v.end(), back_inserter(dest), square);
for (vector::const_iterator i = dest.begin(); i != dest.end(); ++i) {
cout << *i << endl;
}
}
C:\Temp>cl /EHsc /nologo /W4 back_inserter.cpp
back_inserter.cpp
C:\Temp>back_inserter
121
484
1089
But it fails to compile with VC10 Beta 1:
C:\Temp>cl /EHsc /nologo /W4 back_inserter.cpp
back_inserter.cpp
back_inserter.cpp(19) : error C3861: 'back_inserter': identifier not found
What's wrong?
Solution: #include
The problem was that back_inserter()
was used without including . The C++ Standard Library
headers include one another in unspecified ways. "Unspecified" means
that the Standard allows but doesn't require any header X to include any
header Y. Furthermore, implementations (like Visual C++) aren't
required to document what they do, and are allowed to change what they
do from version to version (or according to the phase of the moon, or
anything else). That's what happened here. In VC9 SP1, including
dragged in . In VC10 Beta 1,
doesn't drag in .
When
you use a C++ Standard Library component, you should be careful to
include its header (i.e. the header that the Standard says it's supposed
to live in). This makes your code portable and immune to
implementation changes like this one.
There
are probably more places where headers have stopped dragging in other
headers, but is overwhelmingly the most popular header
that people have forgotten to include.
Note: Range Insertion and Range Construction
By the way, when seq is a vector, deque, or list, instead of writing this:
copy(first, last, back_inserter(seq)); // Bad!
You should write this:
seq.insert(seq.end(), first, last); // Range Insertion - Good!
Or, if you're constructing seq, simply write this:
vector seq(first, last); // Range Construction - Good!
They're not only slightly less typing, they're also significantly more efficient. copy()-to-back_inserter() calls push_back() repeatedly, which can trigger multiple vector
reallocations. Given forward or better iterators, range insertion and
range construction can just count how many elements you've got, and
allocate enough space for all of them all at once. This is also more
efficient for deque, and you may as well do it for list too.
Problem
2: error C2664: 'std::vector<_Ty>::_Inside' : cannot convert
parameter 1 from 'IUnknown **' to 'const ATL::CComPtr *'
This program compiles and runs cleanly with VC9 SP1:
C:\Temp>type vector_ccomptr.cpp
#include
#include
#include
#include
#include
using namespace std;
int main() {
vector> v;
v.push_back(NULL);
}
C:\Temp>cl /EHsc /nologo /W4 vector_ccomptr.cpp
vector_ccomptr.cpp
C:\Temp>vector_ccomptr
C:\Temp>
But it fails to compile with VC10 Beta 1:
C:\Temp>cl /EHsc /nologo /W4 vector_ccomptr.cpp
vector_ccomptr.cpp
C:\Program
Files\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(623) : error
C2664: 'std::vector<_Ty>::_Inside' : cannot convert parameter 1
from 'IUnknown **' to 'const ATL::CComPtr *'
with
[
_Ty=ATL::CComPtr
]
and
[
T=IUnknown
]
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(622) :
while compiling class template member function 'void
std::vector<_Ty>::push_back(_Ty &&)'
with
[
_Ty=ATL::CComPtr
]
vector_ccomptr.cpp(9) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
with
[
_Ty=ATL::CComPtr
]
C:\Program
Files\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(625) : error
C2040: '-' : 'IUnknown **' differs in levels of indirection from
'ATL::CComPtr *'
with
[
T=IUnknown
]
What's wrong?
Solution: Use CAdapt
The Standard containers prohibit their elements from overloading the address-of operator. CComPtr overloads the address-of operator. Therefore, vector> is forbidden (it triggers undefined behavior). It happened to work in VC9 SP1, but it doesn't in VC10 Beta 1. That's because vector now uses the address-of operator in push_back(), among other places.
The solution is to use 's CAdapt, whose only purpose in life is to wrap address-of-overloading types for consumption by Standard containers. vector>> will compile just fine. In VC10 Beta 1, I added operator->() to CAdapt, allowing v[i]->Something() to compile unchanged. However, typically you'll have to make a few other changes when adding CAdapt to your program. operator.() can't be overloaded, so if you're calling CComPtr's member functions like Release(), you'll need to go through CAdapt's public data member m_T . For example, v[i].Release() needs to be transformed into v[i].m_T.Release() . Also, if you're relying on implicit conversions, CAdapt
adds an extra layer, which will interfere with them. Therefore, you
may need to explicitly convert things when pushing them back into the vector.
Problem
3: error C2662: 'NamedNumber::change_name' : cannot convert 'this'
pointer from 'const NamedNumber' to 'NamedNumber &'
This program compiles and runs cleanly with VC9 SP1:
C:\Temp>type std_set.cpp
#include
#include
#include
#include
using namespace std;
class NamedNumber {
public:
NamedNumber(const string& s, const int n)
: m_name(s), m_num(n) { }
bool operator<(const NamedNumber& other) const {
return m_num < other.m_num;
}
string name() const {
return m_name;
}
int num() const {
return m_num;
}
void change_name(const string& s) {
m_name = s;
}
private:
string m_name;
int m_num;
};
void print(const set& s) {
for (set::const_iterator i = s.begin(); i != s.end(); ++i) {
cout << i->name() << ", " << i->num() << endl;
}
}
int main() {
set s;
s.insert(NamedNumber("Hardy", 1729));
s.insert(NamedNumber("Fermat", 65537));
s.insert(NamedNumber("Sophie Germain", 89));
print(s);
cout << "--" << endl;
set::iterator i = s.find(NamedNumber("Whatever", 1729));
if (i == s.end()) {
cout << "OH NO" << endl;
} else {
i->change_name("Ramanujan");
}
print(s);
}
C:\Temp>cl /EHsc /nologo /W4 std_set.cpp
std_set.cpp
C:\Temp>std_set
Sophie Germain, 89
Hardy, 1729
Fermat, 65537
--
Sophie Germain, 89
Ramanujan, 1729
Fermat, 65537
But it fails to compile with VC10 Beta 1:
C:\Temp>cl /EHsc /nologo /W4 std_set.cpp
std_set.cpp
std_set.cpp(55)
: error C2662: 'NamedNumber::change_name' : cannot convert 'this'
pointer from 'const NamedNumber' to 'NamedNumber &'
Conversion loses qualifiers
What's wrong?
Solution: Respect set Immutability
The problem is modifying set/multiset elements.
In C++98/03, you could get away with modifying set/multiset
elements as long as you didn't change their ordering. (Actually
changing their ordering is definitely crashtrocity, breaking the data
structure's invariants.)
C++0x
rightly decided that this was really dangerous and wrong. Instead, it
flat-out says that "Keys in an associative container are immutable"
(N2857 23.2.4/5) and "For [set and multiset], both iterator and const_iterator are constant iterators" (/6).
VC10 Beta 1 enforces the C++0x rules.
There are many alternatives to modifying set/multiset elements.
· You can use map/multimap, separating the immutable key and modifiable value parts.
· You can copy, modify, erase(), and re-insert() elements. (Keep exception safety and iterator invalidation in mind.)
· You can use set/multiset, comparator> , being careful to preserve the ordering and proving once again that anything can be solved with an extra layer of indirection.
· You can use mutable members (weird) or const_cast (evil), being careful to preserve the ordering. I strongly recommend against this.
I should probably mention, before someone else discovers it, that in VC10 Beta 1 we've got a macro called _HAS_IMMUTABLE_SETS . Defining it to 0 project-wide will prevent this C++0x rule from being enforced. However, I should also mention that _HAS_IMMUTABLE_SETS is going to be removed after Beta 1. You can use it as a temporary workaround, but not as a permanent one.
Problem 4: Specializing stdext::hash_compare
If you've used the non-Standard or and specialized stdext::hash_compare for your own types, this won't work anymore, because we've moved it to namespace std. and are still non-Standard, but putting them in namespace stdext wasn't accomplishing very much.
Solution: Use or
TR1/C++0x
and are powered by the same
machinery as and , but the unordered
containers have a superior modern interface. In particular, providing
hash and equality functors is easier.
If you still want to use and , you can specialize std::hash_compare, which is where it now lives. Or you can provide your own traits class.
By the way, for those specializing TR1/C++0x components, you should be aware that they still live in std::tr1 and are dragged into std with using-declarations. Eventually (after VC10) this will change.
This
isn't an exhaustive list, but these are the most common issues that
we've encountered. Now that you know about them, your upgrading
experience should be more pleasant.
Stephan T. Lavavej
Visual C++ Libraries Developer
Thursday, March 3, 2011
Wednesday, March 2, 2011
Christened in Fables
Found this interesting info in a Mumbai daily.....
Mumbai’s place names tell us a fascinating story of the city’s life and times. Byculla, for example, takes its name from a bhaya, or yellow laburnum tree, that once stood here, apparently in a khala, or threshing ground. Charni Road, equally pastorally, takes its name from charna, or a place where cattle grazed. And Chinchpokhli suggests a grove of chinch, or tamarind, trees—difficult to believe today. Pydhonie was a place where the tide washed inland and, receding, left behind a stream of water near a temple, where people washed their feet—hence pai dhoni. Matharpacady, bewildering as it may sound at first, can be deciphered as Mhatre pakhadi, or place where a community of Mhatres lived.
Some place names are obvious. Cooperage, for example, was just that: a shed where coopers plied their trade, making wooden casks for the East India Company. The original Church Gate, near St Thomas’s Church, was one of the three gates of Mumbai’s fort (the other two being the Bazaar Gate in the north and Lion’s Gate in the south). One of the tougher names to crack, however, is Breach Candy. The story is this: there was apparently a great breach in the rocks here, through which the sea historically flooded into the low-lying lands between Mahalaxmi and Worli. That breach was finally closed, circa 1780, by the building of a vellard, or khind—which was duly anglicised to ‘Candy’. There was also an English missionary, Mr Candy, whose bungalow was by the breach, and it’s possible that his name too somehow became intertwined with the place over the years. That’s the way it happens, sometimes.
Mumbai’s place names tell us a fascinating story of the city’s life and times. Byculla, for example, takes its name from a bhaya, or yellow laburnum tree, that once stood here, apparently in a khala, or threshing ground. Charni Road, equally pastorally, takes its name from charna, or a place where cattle grazed. And Chinchpokhli suggests a grove of chinch, or tamarind, trees—difficult to believe today. Pydhonie was a place where the tide washed inland and, receding, left behind a stream of water near a temple, where people washed their feet—hence pai dhoni. Matharpacady, bewildering as it may sound at first, can be deciphered as Mhatre pakhadi, or place where a community of Mhatres lived.
Some place names are obvious. Cooperage, for example, was just that: a shed where coopers plied their trade, making wooden casks for the East India Company. The original Church Gate, near St Thomas’s Church, was one of the three gates of Mumbai’s fort (the other two being the Bazaar Gate in the north and Lion’s Gate in the south). One of the tougher names to crack, however, is Breach Candy. The story is this: there was apparently a great breach in the rocks here, through which the sea historically flooded into the low-lying lands between Mahalaxmi and Worli. That breach was finally closed, circa 1780, by the building of a vellard, or khind—which was duly anglicised to ‘Candy’. There was also an English missionary, Mr Candy, whose bungalow was by the breach, and it’s possible that his name too somehow became intertwined with the place over the years. That’s the way it happens, sometimes.
Friday, July 16, 2010
Query DNS Server to resolve host and IP
http://www.zoneedit.com/lookup.html
nslookup - command line
DnsQuery - Win32 command
nslookup - command line
DnsQuery - Win32 command
Tuesday, February 2, 2010
Subscribe to:
Posts (Atom)