Wednesday, September 2, 2009

How to Copy PDF Table to Excel

I have a pdf file with a bunch of tables that I need to grab the content of and paste into an excel spreadsheet. One way to do this is to upgrade to Adobe Acrobat Professional and use the copy as table command. Who wants, or is able, to pay $450 for that though? Certainly not me.
Adobe Reader is free and came installed on my computer, so I was poking around a bit and discovered a work around. In Adobe Reader 7.0, first make sure the select tool is chosen. Next, move the cursor over the column header until a rectangle appears. Then highlight the column elements and press Ctrl+C to copy the column elements, paste into Excel with Ctrl+V.
If you are using Adobe Reader 9.0, press Ctrl+Alt while moving the cursor over the column header until a rectangle appears. Then highlight the column elements and press Ctrl+C to copy the column elements, paste into Excel with Ctrl+V.
Copying each column one at a time isn't quite as nice as the copy as table command. It takes a little bit more time, but it is definitely better than spending a couple hundred dollars if you really don't need to.


More Adobe Acrobat

Wednesday, August 19, 2009

Batch Convert SVG to PNG Raster

Need to batch convert svg to png? I have a few thousand .svg files that I need to convert to raster, namely .png. I ended up using ImageMagick. Apparently it is the standard tool to use. However, Inkscape and Apache Batik are also capable of converting svg to a raster format.
ImageMagick has a convert tool and a mogrify tool which can convert svg to png.
What I want to do is covert my few thousand .svg files to .png files using the same file name as the .svg files, only with the .png extension.
For some reason, I couln't do that with the convert command. All of the output files needed to have part of the file name given, so that numbers could be appended to it, or a full file name given, in which case only one output file was created.
I poked around a bit and discovered the mogrify command would use the input file names to create the output file names, only with the .png extension instead of the .svg extension. I also needed the .png files to be a certain size, which mogrify also allows.
Here is the command I used:

mogrify -resize widthxheight -format png *.svg

where width is the desired width of the .png, ex: 100, and height is the desired height of the .png, ex: 100.
Worked great and I now have my batch of .svg files converted to .png files in the size I need.


More SVG

More ImageMagick

More Inkscape

More Apache Batik





Apple iTunes

Friday, July 24, 2009

Consumer Reports Top Security Software

Security software was a topic in the June 2009 issue of Consumer Reports.
The top security software was Eset Smart Security. It costs a little bit more than other software but it offered the best possible virus detection. It's good if you have a computer user who clicks on suspicious email links or downloads files from unfamiliar sites.
McAfee Internet Security is next on the list. It offers good performance and the most features.
Symantec Norton Internet Security was the third recommendation. It was the best at finding badware. It also gives you information on possible threats.
No computer should go without security software. If someone hacks into your computer, personal information could be taken which could lead to identity theft. A hacker could also delete your files, take control of your computer, or render your computer useless. Hackers these days are very sophisticated, so installing good, trustworthy security software is an absolute must.


Consumer Reports Back Issues

Thursday, July 9, 2009

Vector of pointers crashes on delete

I have a java gui which calls a C++ dll which in turn calls another C++ dll. Both dlls are built using Microsoft Visual C++ 6.0;
Both dlls contain functions which take in 4 vectors. The first dll function calls the second dll function.
The first 2 vectors are source parameters and the last 2 are result vectors. All vectors contain the same number elements.
The function call in the first dll looks something like this:

convert(std::vector& firstVector, std::vector& secondVector, std::vector& thirdVector, std::vector& fourthVector)
{
thirdVector.reserve(10);
fourthVector.reserve(10);

C2DLL* c2dll = new c2dll();
c2dll->convert(firstVector, secondVector, thirdVector, fourthVector);

.
.
.
.
.
.
.

for(int i = 0; i < 10; i++)
{
delete firstVector[i];
}
firstVector.clear();

for(int i = 0; i < 10; i++)
{
delete secondVector[i];
}
secondVector.clear();

for(int i = 0; i < 10; i++)
{
delete thirdVector[i];
}
thirdVector.clear();

for(int i = 0; i < 10; i++)
{
delete fourthVector[i];
}
fourthVector.clear();
}


void C2DLL::convert(std::vector& firstVector, std::vector& secondVector, std::vector& thirdVector, std::vector& fourthVector)
{
for(int i = 0; i < 10; i++)
{
thirdVector.push_back(new Class2()); /// Class2 is a subclass of Class1
fourthVector.push_back(new ClassA());
}
}


Everything was running great until I would get to deleting each element of the fourthVector. The application would crash. For the life of me I could not figure out why. I finally did some Google searching and figured out it was the compiler settings.
Each dll needs to be built with the /MD option. To set this, go to the project settings, C/C++ tab, Code Generation Category. Select Debug Multithreaded DLL.
Apparently this allocates the memory used in each dll on the local heap. Before changing this setting, I was using Debug Mutithreaded. Since the memory for the fourth vector was allocated in the second C++ dll, the memory was not on the local heap for the first dll, which was where the memory was being deallocated.
C++ Memory, what a pain in the butt.


More C++

Sunday, February 1, 2009

Wireless dial up internet, Wiflyer disappears

Looks like bad news for fans of the Wiflyer. The company, Always On Wireless, website was down for a while and is now completely gone. I did a little research on the web and others have tried to email or call the company/support with no response. No statement from the company as to why they are gone, just speculation they were another casualty of the bad economy. Too bad. I use my Wiflyer every day and just hope it never dies. For those of us stuck with dial up internet, the wiflyer made wireless internet possible. If you want wireless dialup and can find a Wiflyer, grab it. Apparently there is also a similar device called nebo wireless. It connects wirelessly like a cordless phone using microwave radio, while the wiflyer was a wireless router. Not sure if there are any other wireless dial up alternatives to the wiflyer out there. If anyone knows, please leave me a comment.


More Wireless