Showing posts with label misc. Show all posts
Showing posts with label misc. Show all posts

Sunday, March 3, 2013

International shipping to India





Services



1. iShopInternational.com


Description source: http://forum.xda-developers.com/showpost.php?p=36983040&postcount=2

Try ishopinternational.com
You have to provide them with amazon link and they will give you quotation price which includes product cost from amazon, shipping to india and customs (<10%). You have to pay them in their Indian account and they will purchase from amazon and deliver to you at your doorstep. You can use coupon code amazon200 or amazon250 to get 250 rs discount.


2. www.ppobox.com

Tuesday, January 15, 2013

Create sample input using windows batch file


Script that did my job

-------------------------------------------

@echo off

setlocal EnableDelayedExpansion

for /L %%F IN (1,1,100) DO (
set /a year = !RANDOM! %% 12+2000
echo !year! !RANDOM!
)

endlocal
-------------------------------------------

Generates random numbers. First column contains year between 2000 to 2012 second column contains a random number. You would have to tweak for your requirement.

Did your day just got saved? ! :)

Oh and by the way you can direct your output to a text file as
<filename>.cmd > mysampleinput.txt

:p


References

  1. http://ss64.com/nt/set.html
  2. http://www.bish.co.uk/forum/index.php?topic=58.0
  3. http://stackoverflow.com/questions/3439626/windows-batch-file-calculating-filename-from-current-date

Sunday, January 13, 2013

Bus Vs Broker



Bus and Broker Pub/Sub Differences

Source: http://www.udidahan.com/2011/03/24/bus-and-broker-pubsub-differences/


One of the things which often confuses people using NServiceBus for the first time is that it only allows an endpoint to subscribe to a given event from a single other publishing endpoint. The rule that there can only be a single publisher for a given event type is one of the things that differentiates buses from brokers, though both obviously allow you to have multiple subscribers.

Brokers

Message brokers, more broadly known and used on the Java platform, don’t come with this constraint. For example, when using ActiveMQ, you can have any number of endpoints come to the broker and publish a message under a given topic.
So where’s the problem?
It’s all about accountability.
Let’s say you’ve subscribed to a given topic, and have received two events – one telling you that the price of bananas next week will be $1/kg and another telling you that it’ll be $2/kg.
Which one is right?
Especially given that those events may have been published by any other endpoint via the broker.
Is it first one wins? Last one wins? How about first one sent vs. first one received? Ditto for last. As a subscriber, can you really be held accountable for having the logic to choose the right one? Shouldn’t this responsibility have fallen to the publishing side?
This is one of the big drawbacks of the broker, hub and spoke architecture. No responsibility. No single source of truth – unless everybody’s going to some central database, in which case – what’s the point of all this messaging anyway?

Buses

The Bus Architectural Style is all about accountability. If you are going to publish an event, you are accountable for the correctness of the data in that event – there is no central database that a subscriber can go to “just in case”. And the only way that you can be held accountable, is if you have full responsibility – ergo, you’re the only one who can publish that type of event.
If you say bananas are going to cost $1/kg next week, that’s that. Subscribers will not hear from anybody else on that topic.
Now, this is not to say that you can’t have more than one physical publishing endpoint.
You see, buses differentiate between the logical and the physical. Brokers tend to assume that the physical hub-and-spoke topology is also the logical.
In a bus, while there can only be one logical endpoint publishing a given type of event, that endpoint can be physically scaled out across multiple machines. It is the responsibility of the bus to provide infrastructure facilities to allow for that to happen in such a way that to subscribers, it still appears as if there is really only one publishing endpoint.
The same is true about the subscriber – one logical subscribing endpoint may be scaled out across multiple machines.

Product Mix-ups

Unfortunately, there are many broker-style technologies out there that are being marketed under the banner of the Enterprise Service Bus. While some products have the ability to be deployed in both a centralized and distributed fashion (sometimes called “federated” or “embedded” mode), many do not enforce the “single publishing endpoint per event-type” rule.
Without this constraint, it is just too easy to make mistakes.

NServiceBus

By enforcing this constraint, we see the same kind of question appear on the discussion group time and time again:
“I have an Audit event that I’d like all of my machines to publish, and have one machine subscribe to them all, but NServiceBus won’t let me. How do I make NServiceBus support this scenario?”
And the answer is the same every time:
“You should have all the machines Send the Audit message (configured to go to the single machine handling that message), and not Publish. It is not an event until its been handled by the endpoint responsible for it.”
The semantics of the message matter a lot.
When looking at Service-Oriented Architecture, these messages are the contract and, as any lawyer will tell you, contracts need to be explicit and the intentions really need to be spelled out – otherwise the contract is practically worthless.

In closing

Friction is sometimes a good thing – it prevents us from making mistakes. It keeps cars on the road. And because that’s not enough friction, we introduce curbs as well.
If you’re looking for a service bus technology for your next project, check that it’ll give you the friction that you need to keep everybody safe. Really check what it is that the vendors are offering you – more often than not, it’s some ESB lipstick on a broker pig.
To learn more about how NServiceBus supports this kind of publish/subscribe, click here.

Wednesday, January 2, 2013

Extending laptop battery life


Taken from: http://batterycare.net/en/guide.html

Memory Effect

First of all it's necessary to unfold a myth that persists in many peoples head.
The battery memory effect.
In lithium-based batteries this is in fact a myth, it only applies to older Nickle-based batteries. So fully discharging and charging the battery is completely useless and even harmful as we will see below.
The modern lithium battery can be charged regardless of its current percentage, given that it has absolutely no negative effect in its performance.

Should I remove the battery when A/C is plugged in?

Many laptop users have this question and we will answer it right now:
The answer is: YES and NO, it depends on the situation.
Having a battery fully charged and the laptop plugged in is not harmful, because as soon as the charge level reaches 100% the battery stops receiving charging energy and this energy is bypassed directly to the power supply system of the laptop.
However there's a disadvantage in keeping the battery in its socket when the laptop is plugged in, but only if it's currently suffering from excessive heating caused by the laptop hardware.
So:
- In a normal usage, if the laptop doesn't get too hot (CPU and Hard Disk around 40ºC to 50ºC) the battery should remain in the laptop socket;
- In an intensive usage which leads to a large amount of heat produced (i.e. Games, temperatures above 60ºC) the battery should be removed from the socket in order to prevent unwanted heating.
The heat, among the fact that it has 100% of charge, is the great enemy of the lithium battery and not the plug, as many might think so. 

Battery discharges

Full battery discharges (until laptop power shutdown, 0%) should be avoided, because this stresses the battery a lot and can even damage it. It's recommended to perform partial discharges to capacity levels of 20~30% and frequent charges, instead of performing a full discharging followed by a full charging.
Laptop batteries contain a capacity gauge that allows us to know the exact amount of energy stored. However, due to the charging/discharging cycles, this sensor tends to be inaccurate overtime.
Some laptops include in their BIOS, tools to recalibrate this battery gauge, which is nothing more than a full discharge followed by a full charge.
So to calibrate the gauge, it should be performed, in every 30 discharge cycles, a full discharge non-stop , followed by a also, non-stop, full charge.
An inaccurate gauge can lead to the fact that the the battery capacity values are are wrong. The battery may report that it still has 10% of capacity when in fact it has a much lower value, and this causes the computer to shutdown unexpectedly.
gráfico 3Discharge (or charge) cycles consist of using all that battery charge (100%) but not necessarily all at once.
For example, you can use the laptop for some minutes in a day, using half its capacity e then fully charge it. If you did the same thing in the next day, it would be counted a discharge cycle and not two, so it may take several days until a full discharge cycle is completed.

How to perform a calibration (full discharge)?

The most adequate method to do a full discharge (100% to a minimum of 5%) consists of the following procedure:
  1. Fully charge the battery to its maximum capacity (100%);
  2. Let the battery "rest" fully charged for 2 hours or more in order to cool down from the charging process. You may use the computer normally within this period;
  3. Unplug the power cord and set the computer to hibernate automatically at the minimum percentage possible as described by the image sequence below (click images to enlarge);
            
  4. Leave the computer discharging, non-stop, until it hibernates itself. You may use the computer normally within this period;
  5. When the computer shuts down completely, let it stay in the hibernation state for 5 hours or even more;
  6. Plug the computer to the A/C power to perform a full charge non-stop until its maximum capacity (100%). You may use the computer normally within this period.
After the calibration process, the reported wear level is usually higher than before. This is natural, since it now reports the true current capacity that the battery has to hold charge. Lithium Ion batteries have a limit amount of discharge cycles (generally 200 to 300 cycles) and they will retain less capacity over time.
Many people tend to think "If calibrating gives higher wear level, then it's a bad thing". This is wrong, because like said, the calibration is meant to have your battery report the true capacity it can hold, and it's meant to avoid surprises like, for example, being in the middle of a presentation and suddenly the computer shuts down at 30% of charge.

Prolonged storage

To store a battery for long periods of time, its charge capacity should be around 40% and it should be stored in a place as fresh and dry as possible. A fridge can be used (0ºC  - 10ºC), but only if the battery stays isolated from any humidity.
One must say again that the battery's worst enemy is the heat, so leaving the laptop in the car in a hot summer day is half way to kill the battery.

Purchasing a replacement battery

If you intend to purchase another battery, it's recommended that you do it only when the current battery is very degraded. If it's not the case, the non usage of a battery leads to its degradation.
If a spare battery is purchased and won't be used for a long time, the above storage method should be used.
Besides that, when purchasing a battery you must pay attention to the manufacturing date.

Advantages in using BatteryCare

BatteryCare allows you to have the control over the discharge cycles number, and when this reaches 30 (or other configured value), it notifies you that it's time to perform a full discharge in order to keep the battery gauge calibrated.
Like this, it's guaranteed to always have the correct capacity values reported by the battery.
Besides, when using the battery, there's the possibility to suspend some Operating System features that help degrading the autonomy (only in Windows Vista or higher):
 - Windows Aero, the theme that allows for visual effects like window transparency, requires graphics card acceleration, which obviously will help decreasing the battery lifetime;
SuperFetch, ReadyBoost and SearchIndexer are three Windows Vista (and higher) services that, even in battery mode, are using the hard disk a lot and increase total power consumption, thus decreasing battery lifetime. Suspending these services has absolutely no negative impact on the performance or security of the system.
These features are resumed once the laptop is plugged in to A/C power.

External links:


Tuesday, October 16, 2012