{C++ etc.}

Latest Posts
 
Home | C++ Posts | Linux Posts | Programming Posts | Issue Tracking Posts

Sunday, July 29, 2012

CleaCase on Windows 7 - Resolving slow checkin/checkout times

If you're using a ClearCase version between 7.1.1.1 and 7.1.1.5, you might have experienced extremely slow speeds when checking out files. Personally, I noted that this ran to ~7s per file when downloading an image via a custom script. I'm running CC 7.1.1.3 on Windows 7 Professional (64 bit).

Initially I blamed this on our corporate network but, since this wasn't occurring in Windows XP machines running the same script, I had to conclude that the issue was with the CC client. I came across this post in the IBM support portal and decided to give it a go (although this wasn't for the exact problem that I had).

I put the following in a .reg file:

Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Mvfs\Parameters]
"MiniFilterMask"=dword:0000020d


double clicked it to merge the entry and restarted my laptop.

Then when I ran my (previously excruciatingly slow!!) script, everything worked fine. I was getting the same speeds as on Windows XP. The purpose of the reg value is to make Mvfs service work in the same way as it would under XP.

Just to emphasize, this is not an officially announced fix and it might not solve everyone's problems. But if you're stuck with having to wait two days to get a checkout of the latest build images, it might be worth giving a try.

Tuesday, September 06, 2011

Burning Bootloader of an Arduino Uno with Another Arduino Uno

If you but a new ATMEGA 328P chip and plan to use it as a stand alone Arduino (with the proper wiring), you'll have to burn a boot loader on to it. This is easy if you have two Arduino boards. I'll outline how to achieve this using two Arduino Uno boards, since that's what I had at hand. I tried to get the boot loader on to the chip using an AVR JTAGICE MK2 but it didn't go well. This process is a bit of a hassle to set up but the actual burning process is very easy.

The main instructions for this are given here. Just follow them to the point and you could get a new bootloader on to your Uno in several minutes.

The only thing that I did differently to the above article, was to use the arduino IDE instead of using AVRDude. I'l give the steps for the complete process below:

1. Connect your two Arduinos according to the above schematic




2. Open the Arduino IDE. Select the correct COM port and set the board to Arduino Uno

3. Load the Arduino ISP sketch on to the programmer board. This sketch is located at [Arduino istallation folder]->Examples->ArduinoISP

4. In the IDE, select Tools->Burn Bootloader->w/ Arduino as ISP

This will begin the burning process. It'll take about a minute for writing to finish. After that, you could disconnect the two boards and use the newly programmed board as a stanalone Arduino Uno

Thursday, June 09, 2011

HC-SR04 Rangefinder (with Arduino)

Setup:
Connect digital pin 13 to Trigger.
Connect digital pin 12 to Echo.
5V of Arduino to Vcc.
Ground of Arduino to Gnd of SR04

Note: The 5V out from Arduino might not be enough for the range finder to work. If it's not giving proper values, try giving power from an external source (like 4 AA batteries).

Code: (This consists of a sample that I got off the net. I don't remember the exact page but I want to give credit to the original creator)


int pingPin = 13;
int inPin = 12;

long duration, inches, cm;
 
void setup() {
  //pinMode(13, OUTPUT);
  pinMode(pingPin, OUTPUT);
  pinMode(inPin, INPUT);
  Serial.begin(9600);
}
 
void loop()
{
  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  //pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(pingPin, LOW);
  //delayMicroseconds(2);
 
  // a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
 
  duration = pulseIn(inPin, HIGH);
 
  // convert the time into a distance
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);
 
  Serial.print("Distance: [");
  Serial.print(inches);
  Serial.print("]inches. [");
  Serial.print(cm);
  Serial.print("]cm\n");
  delay(1000);
}
 
long microsecondsToInches(long microseconds)
{
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  return microseconds / 74 / 2;
}
 
long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}


Monday, January 31, 2011

How to extract the contents of HXF files

The .HXF extension is used in a variety of applications. The one that's being referred to in this case are the HXF files which come bundled with firmware upgrades for some Chinese PMPs.

I bought an Onda VX575 FHD (Full HD) recently and wanted to customize some of the images and text which come with the original firmware. This is reletively easy to do. You only have to extract the contents of the HXF file, make the changes to the files that you want, repack it and burn it to the device. There's a great tool which has been written to unpack and repack HXF files. It's called HXF extract (what else :)) and could be downloaded here.

Once it's downloaded, all you have to do is run it, click the "Unpack HXF" button and point it to the HXF file. It's extract it's contents to a folder named "out_hxf". Make changes to the files in the out_hxf folder, run the tool, select "Repack HXF" and select a file name for the new file and you're done.
Sometimes you might encounter an error (can't remember the exact message) which would most likely be due to a missing COMDLG32.OCX file. Download it from a valid site (you could find it via google search) and type:

regsvr32  \comdlg32.ocx

at a command prompt to register it. The tool should work fine after that.


Resources:
http://www.mp4nation.net/forum/viewtopic.php?f=63&t=13184
http://dingoo-digital.com

Thursday, December 30, 2010

Finding the Right Domain Name for your New Website

Coming up with a short, catchy and relevant domain name can be a difficult task. Specially because most of the top domain names have already been registered by someone else. It's always good to know the setting and context of the website before you purchase a domain in order to make this process a lot easier.

The Newbie Toolkit: How To Register And Host Your First Domain 

The ideal domain name should be:
  1. Short
  2. Relevant
  3. Memorable

It's best to avoid:
  • Under scores and dashes
  • Numbers (when not relevant to the subject)
  • Alternate (but incorrect) spellings

Then we need to go to a domain look up service such as http://www.checkdomain.com/ to see whether the domain that we want is available. Be ready for disappointment because most of the time you will find that the particular domain is unavailable. Check to see whether pre or post fixing words like "hot", "best", "all", "the", "top" and "get" would work. If not, you will have to move on to the next phase.

This is when your domain knowledge comes in to play. Try to pair words which are relevant to the site's content to come up with a catch name. This might not directly reflect the subject matter but should be easy to relate to it.
eg.
  • rottentomatoes.com
  • stackoverflow.com
  • gsmarena.com

Keep at it till you find something that you really like. Do not get discouraged and get yourself a domain like "the-best-music-online-10.com". It's a hard and time consuming process but it's better to be patient and register the right domain name than end up with something that you will realize to be unusable after a few hours.

I have purchased several domains in the past and some of them proved to be fruitless and a waste of time and money (such as amazon40.com). But the one's that I purchased after doing my research and trying patiently, have been very successful (e.g. steamsigs.com, theduffel.com). So be patient and keep trying. You will not regret the extra effort.





Case Study:

As a small exercise, I decided to try coming up with a good name for an arbitrary web site, just to see the effectiveness of the given guidelines. The subject I selected is (I'm thinking of one right now ;)) menswear. It could be a site which sells menswear or reviews them. Doesn't really matter.
The obvious key word would be menswear. Let's come up with some domain names to check (I'm only considering .com for now because its the one used the most):
menswear.com
topmenswear.com
hotmenswear.com
allmenswear.com
bestmenswear.com
totalmenswear.com

All are registered. Let's come up with a list of relevant terms:
man, clothes, garb,look,smart,free,handsome(too long), charmer,hunky, perfect, fit, apparel, attire

First find, hunkgarb.com. Short and catchy but let's keep on looking for something a bit more formal.
Second find, hunkattire.com.. hmm...
Third time's the charm!! manattire.com is still available. It's catchy with a bit of sophistication. Should be perfect.

I haven't given details of the last phase of the process but it's pretty straight forward. Come up with keywords and look for synonyms. This is very important. You'd most probably find a word that's more befitting to your purpose. This is how I ended up with the word "attire"... by looking for a synonym for "clothes".

So this concludes the case study. Most probably the domain "manattire.com" would not be available in a few months but I think it served to detail the process involved in coming up with the perfect domain name.

Good resources:

Website Design and Development: 100 Questions to Ask Before Building a Website Creating a Web Site: The Missing ManualWeb Design and Marketing Solutions for Business WebsitesBuild Your Own Web Site The Right Way Using HTML & CSS, 2nd EditionBuild a Website for Free (2nd Edition)