Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Wednesday, November 23, 2011

PDF tools

PDF files are the standard document distribution format. PDF has long left other file formats in the dust. However, there are always a number of operations that people like to make to PDF's ranging from just creating them, to splitting or merging to applying a watermark or foreground stamp.

There are a number of great free tools to do all this work.

  • PDF Creator lets you create PDF files in Windows. Another popular alternative is CutePDF. For Apple Mac, under OSX you can simply print straight to PDF.

  • Splitting/bursting and merging/combining PDFs I feel is best done with a dedicated tool, PDFSAM - Split and Merge. Under OSX, you can actually use the sidebar of preview to move pages around, and drag in PDFs to merge, or pages to remove. If you have a lot of pages to do PDFSAM is a wiser choice, otherwise for smaller tasks Preview is fine.

  • Compression of PDFs under OSX is also straight forward, you just need to open the PDF in preview, and then under Quartz filter choose "Reduce File Size". Under windows, you can use PDFTK, more on this later.

  • Annotation of PDFs, again with OSX, preview gives you a small set of annotation tools. Under windows, you can use PDFTK. (Low cost / free for some-things aternatives are PDF-Xchange viewer and Foxit Reader)

  • Watermarking and Stamps are best done with PDFTK.

  • Encryption can be done with PDFTK, and under OSX, preview has an encrypt option.



  • Of course for those with cash, Adobe's tools are the best choice, but pdftk is a fantastic free alternative, if you don't mind a bit of command line typing.

    An example of putting a foreground stamp onto every PDF with pdftk:
    • Generate a PDF where you would like to apply the stamp to (i.e. the source)
    • Create a stamp PDF. This should have the stamp you wish to apply (e.g. "DRAFT") and be a transparent PDF. Microsoft Word will generate transparent PDFs by default, so you can create your stamp in Word.
    • Apply the stamp to the source PDF using pdftk, for example:
      pdftk in.pdf stamp stamp.pdf output out.pdf
      

    Enjoy!

    Friday, January 07, 2011

    Future CPU/GPU architectures and OpenCL

    For a while x86 CPUs were just aimed at getting faster, more and more ticks. Then, there was a shift from faster to more efficient (in terms of power used / heat generated vs. performance) in the Pentium 3/4 era. Then, another shift towards multiple cores. Now, the next shift has occurred: CPU and GPU fusion. (Despite AMD talking about it for longer than I can recall. I think I was talking to an AMD VP shortly before they purchased ATI about how GPU and CPU fusion was the future.)

    Recently Intel released Sandy Bridge their CPU/GPU processor, and AMD's fusion APU's have been around. Interestingly, both are targeted at laptops (the bulk of the market), and still expect discrete GPU's for high-end performance. The fusion is just a bit of a bonus.

    Interestingly all those 2009 rumours about nVidia building an x86 chip turned out to be wrong, with the real product being far more interesting. An nVidia fusion product of an ARM CPU with nVidia GPU's. This might prove to be a very interesting result considering the amount of effort being put into improving the ARM architecture and the power usage concerns in both smartphones/tablets and supercomputing. With the next version of windows running on ARM there will certainly be interesting times ahead.

    Intel/AMD aren't standing still on the CPU front and are pushing ahead with AVX but the real interesting part is that OpenCL is being pushed across the board. Recent publications from the UK GPU computing conference demonstrate that ARM are pushing OpenCL as their platform of choice (for both CPU and their Mali GPU, it is Clang/LLVM based), and AMD and Intel have been strong supporters of OpenCL too. Did you know Samsung supports OpenCL too?

    It would seem that OpenCL has a very strong support base, and is likely the platform of choice for developers on Intel, AMD, ARM, Apple, IBM, etc. What hope does CUDA stand? It seems nVidia will eventually be forced to drop CUDA, or invest heavily into CPU-based CUDA (Hello Ocelot!) or OpenCL translation. Eventually people will tire of writing and re-writing CUDA programs as they swap between platforms.

    Envision the not-so-far future where you have a workstation with multiple CPU/GPU fusion cores [non-CUDA], and a discrete fusion GPU (GPU [CUDA]/ARM [non-CUDA] core) - are you really willing to write a specific CUDA routine for just the nVidia GPU, or are you more likely to try a less optimal OpenCL routine that will then also then run on the CPU, CPU SIMD, CPU/GPU fusion and ARM cores?

    It seems that the argument being put forward by nVidia to write everything in CUDA for optimal performance will not hold as you will gain more from all the other devices helping out in the computation compared to the loss from using OpenCL over CUDA.

    Of course there are other choices out there such as Accelerator and RapidMind.

    The UK conference reveals Microsoft's GPGPU language "Accelerator" has made progress, and now is no longer only GPU limited (it now supports SSE3 on modern CPU's). I'm still not aware of anyone using this for anything practical though, which seems to be a bit of a shame. And ever since Intel bought RapidMind (now Array Building Blocks) the tech became very Intel-specific. So neither of those choices sound too promising.

    It will be interesting to see what nVidia decide to do with CUDA, how developers will adjust to fusion CPU / GPUs and what higher-level language (or language extension?) will become de-facto in the future. Stay tuned..

    Monday, June 14, 2010

    Customising Access to Windows XP

    Delivering a Windows XP system to a customer, and don't want them to fiddle with settings?

    First, you probably want to have your system log on automatically.
    The Microsoft article on enabling autologin goes through the steps in detail. Essentially, start regedit and set HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon AutoAdminLogon (SZ) to 1.

    Then add whatever you want on startup to the start menu 'Startup' folder. (Documents and Settings\USERNAME\Start Menu\Programs\Startup)

    This is also a good time to clear the startup menu of any other pesky programs. To eliminate system wide startup items easily you can try MSConfig (from run), but I prefer to edit the registry directly.
    Check HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run and RunOnce and RunOnceEx. If you just want to eliminate the taskbar icons all together you can try editing HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer and add a DWORD NoTrayItemsDisplay and set it to 1.

    You can disable the windows keys etc using HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map
    For a detailed discussion see Tim's Northcode blog post, who suggests "Scancode Map"=hex:00,00,00,00,00,00,00,00,09,00,00,00,00,00,5b,e0,00,00,5c,e0,00,00,5d,e0,00,00, 44,00,00,00,1d,00,00,00,38,00,00,00,1d,e0,00,00,38,e0,00,00,00,00.

    Note that this stops you from being able to use any of the windows special keys. So be careful!

    Finally you want to lock down the user access rights. There are many ways to do this, the easiest is with the Group Policy editor. This Microsoft article on the Group Policy Editor describes how to get there, in essence: Start,run,MMC,Add a snap-in,'Group Policy Object Editor'.

    Now you have options to edit under "User Configuration" and "Administrative Templates". Under "Start Menu and Taskbar" you can find options to disable Search, Help, etc. from the start menu. Under "Desktop" you can remove the various icons, and disable the desktop. Under "System" you can set which programs people can run. You might want to be careful not to disable regedit until you are 100% certain it is correctly setup.

    Wednesday, May 26, 2010

    Consumer Camera Streaming

    I've been looking for a decent cheap camera for a long time. Hooking into a consumer Camera is apparently close to impossible. This used to be a simple and common tasks. Almost all digital camcorders used to provide firewire ports and would feature a demo mode allowing you to get a cheap high-quality video stream for your PC. Firewire now has been abandoned, and for a while camera manufacturers (in particular Sony) provided USB streaming. This is now a thing of the past.

    One alternative is to use a standard digital camera. Again, previously Cannon provided good support for remote capture and USB streaming, but this is something they seem to have dropped again.

    There are a few options out there for those who are looking for tethered camera capturing via USB:
    • CHDK the Cannon Hack Development Kit supports a number of cannon cameras with a range of possible features. Again, difficult to find support for a current model.
    • BreezeSys provide a number of software tools for Cannon cameras, again only older models but if your really looking to do some specialized setup then this might be worth the effort.
    • Canon Official Camera SDK is a good option, but unfortunately only the older models are supported.
    • Olympus SDK supports a good range of cameras, unfortunately the only currently supported cameras are the more expensive DSLR range.
    • Pine Tree Camera Controller is a Windows GUI for the Olympus interface.
    • Nikon Camera Control (Windows) provides tethered control for Nikon DSLR cameras. (See also DIY Nikon)
    • SofortBuild is Mac OSX software for remote capture with Nikon cameras, but unfortunately only for the more expensive "D" series.

    • GPhoto is some linux software for remote capture from a wide range of Cameras. Unfortunately, none that I own. This is probably the best bet though.

    • Entangle a front end to Gphoto for Linux.
    You can sometimes still get a Camera that supports component out - so if you get yourself a frame-grabber, then that might be a good option. A cheap firewire camera can be purchased from The Imaging Source, so that might be the best option, but is still likely to be out of the range for an amateur VJ or hobby robotics project.

    If anyone has any suggestions for a cheap camcorder/camera that can provide firewire or USB streaming, please let me know!

    Thursday, February 04, 2010

    Catchup Post

    A short collection of interesting links/articles recently:
    Finally, a video of the top Tron AI from the Google AI Challenge:

    Saturday, December 19, 2009

    iRiver


    Encoding video content for the iRiver is extermely difficult, it would be better if the manafacturer wouldn't claim to support a whole bunch of file formats that they don't.

    The challenge is made more difficult if you are not using Windows. There are a few tools out there though, but all require Mplayer, and on a mac you will need Mplayer for OS X - which is rarely updated. You will need to get the old version which comes with mencoder and copy it out of the application package.

    This is the command I used, which worked fine for the iRiver Χ20:
    ./mencoder pls_sunflower.avi -quiet -vf scale=320:240,expand=320:240 -oac mp3lame -lameopts abr=128 -ovc xvid -xvidencopts bitrate=450 -of avi -af resample=44100 -srate 44100 -ofps 10 -o test3.avi
    

    Unfortunately that didn't work too well on the E10. But here are some links to help with that:

    Tuesday, October 27, 2009

    Apple Mac OS X Utilities


    Everyone needs tools to use their PC. I covered the essentials for a Windows PC previously. Some good (free) tools for your Mac:
    • StuffIt Expander, your OS X WinRAR/WinZip equivalent.
    • MacFUSE, this extension enables file systems in user space for the mac. Ever want to read NTFS?
    • NTFS 3g, the NTFS plug in for macFUSE, no more 'Items could not be moved because XXX cannot be modified'. Why OS X doesn't support NTFS is beyond me. I have been using the NTFS 3g plug in with no problems for about a year now.
    • Opera, while not a Mac-only utility, having the Opera web browser is essential. Especially when Safari acts up, or you want to use IRC, or bittorrent, or RSS, or email, or anything really. Its an all in one solution.
    • Parallels, lets you run your bootcamp Windows partition seamlessly inside the mac, and with graphics acceleration to boot. Nifty. While not free, I feel its worthwhile. The free alternative is virtualbox.
    • Nocturne, this lets you dim, and otherwise change your screen display. Very useful for late night computing.
    • Small Image, for quick image resizing.
    • Paintbrush for mac.
    • Perian and Flip4Mac WMVfor extending media file support by OS X.
    Plus the usual assortment of VLC, Mplayer, Filezilla, Adobe Reader, etc. A great place to find nifty tools is I use this, for OS X. Tools that get a lot of recommendations, but I don't use much are iStat Pro, VMware, Little Snitch and Transmission. I still haven't figured out if MacPorts or Fink is better, so far, I've had poor experiences with both.

    Sunday, August 23, 2009

    Apple Hard Drive Update

    I recently got a mac, and am just slowly starting to get used to it. One thing I noticed the other day was funny 'chirping' noises coming from my mac, and the hard drive would seem to write like crazy.. I thought it was just 'something wierd', but I wasn't the only one. Now Apple have released an update that is supposed to fix the issue. Just needed a reboot, let the firmware install, it shuts your computer down, power it back up and your up and running again. So far so good.

    Tuesday, July 07, 2009

    Simple bootloader

    Writing your own OS is something every computing person should do at some point. The first step is of course writing a boot loader. This is actually very easy to do under linux.

    With a fresh install of ubuntu, make sure you have GCC and related goodies, the other things you will probably want are nasm, and virtual machine like QEMU. Installing these in ubuntu is as simple as:

    sudo apt-get install nasm
    sudo apt-get install qemu

    (you may need to modify your /etc/apt/sources.list - any core ubuntu mirror will do, I used au.archive.ubuntu.com/ubuntu)

    Now you probably want to try qemu out before going further, so grab freedos:
    http://www.freedos.org/freedos/files/ and grab an iso, I got fdbasecd.iso

    Now we create a virtual hard drive to install freedos on to: (do this in the same dir as the iso)

    qemu-img create -f raw freedos.img 100M


    And then we just boot up qemu:

    qemu -localtime freedos.img -cdrom fdbasecd.iso -boot d

    Freedos install is a bit obtuse, you need to format the drive to FAT16, exit the formatter, then again to FAT32, but I just pretty much just went with the defaults for everything, afterall, this is just for testing. At then end, you should have a working DOS prompt.

    Now that we have QEMU working and we know it, let's try our own boot loader:

    [BITS 16] ; 16 bit code generation
    [ORG 0x7C00] ; ORGin location is 7C00

    ;Main program
    main: ; Main program label

    mov ah,0x0E ; This number is the number of the function in the BIOS to run.
    ; This function is put character on screen function
    mov bh,0x00 ; Page number (I'm not 100% sure of this myself but it is best
    ; to leave it as zero for most of the work we will be doing)
    mov bl,0x07 ; Text attribute (Controls the background and foreground colour
    ; and possibly some other options)
    ; 07 = White text, black background.
    ; (Feel free to play with this value as it shouldn't harm
    ; anything)
    mov al,65 ; This should (in theory) put a ASCII value into al to be
    ; displayed. (This is not the normal way to do this)
    int 0x10 ; Call the BIOS video interrupt.

    jmp $ ; Put it into a coninuous loop to stop it running off into
    ; the memory running any junk it may find there.

    ; End matter
    times 510-($-$$) db 0 ; Fill the rest of the sector with zeros
    dw 0xAA55 ; Boot signature


    Save the code to loader.asm, and assemble it with:

    nasm loader.asm


    Then, we can run our wonderful loader with:

    qemu loader

    Friday, July 03, 2009

    Batch files and SVN


    Batch files are useful for writing small automated scripts in windows.

    You just type any command you like into a text-file with the extension ".bat" and it will do the magic for you.

    Some extra commands/parameters will help:
    %1,%2,%3 ... will let you pass additional paramters
    echo will print something to the screen
    @echo off will stop the bat file from printing everything to the screen
    REM will make a line into a comment
    > will let you pipe the output between commands, just like on *nix.
    set /p variable= [string] will let you prompt for input
    exist will let you test if a file exists

    You also have programming constructs including 'if' and 'goto'. (For an example see this batch file sorting routine)

    That's pretty much all you could ever need.

    So a simple example, named test.bat:

    @echo off
    echo hello %1

    If I call this with "test Adrian" it will print "hello Adrian" to the screen.


    @echo off
    set /p name= What is your name?
    echo hello %name%

    This does the same, except prompts me to enter my name.

    There are more than just the %1..%n variable for commands, there is also %0 to tell you the name of the bat file. Even better, you can extract the path with %dp0
    eg:

    @echo off
    echo %~dp0


    So now you can invoke Tortoise SVN on the command line to download and install your favourite software.

    For example:

    tortoiseproc /command:checkout /path:%~dp0 pal /url:https://pal.svn.sourceforge.net/svnroot/pal/pal /closeonend:1
    tortoiseproc /command:checkout /path:%~dp0 bullet /url:http://bullet.googlecode.com/svn/trunk /closeonend:1


    Even better, we can extend this with exists to see if the code is already there, and do an update instead:

    if not exist pal\NUL goto nopal
    tortoiseproc /command:update /path:%~dp0pal /closeonend:1
    goto NEXT
    :nopal
    tortoiseproc /command:checkout /path:%~dp0 pal /url:https://pal.svn.sourceforge.net/svnroot/pal/pal /closeonend:1


    Enjoy!

    Wednesday, April 08, 2009

    Essential free utilities for setting up a new PC

    Every once in a while you get a new computer and you need to go through the usual process of setting it up.

    Here are my favorite bits of free software to install.


    First of all, a new browser. Everyone seems to like Firefox, but I prefer Chrome and Opera. Make sure you install Gears for offline gmail, and flash, etc. too. You might want FileZilla for your FTP needs, and if you want an email client, Thunderbird is a good choice.

    WinRAR, for all your unzipping needs. Archive file formats supported are ZIP, RAR, ACE, CAB, ARJ, LZH, TAR, GZ, BZ2, UUE, JAR, ISO, 7Z and Z.

    Notepad++ and OpenOffice or StarOffice or of course MS Office (if your a student) for all that document and spreadsheet work you need to do.
    Adobe Acrobat PDF reader, or FoxIt (great for mobile devices too!).
    PDF Creator to print to PDF.

    For your photo collection, Picasa and Paint.NET for image editing. Irfanview is a nice small powerful image utility.

    If your not happy with windows media player (and who is?), try
    VLC for all your media streaming needs, and MediaPlayer Classic, Mplayer, for a few more codecs. Finally, VirtualDub for video editing. foobar2000 is great as a lightweight video player that can also convert audio formats. (You might also want LAME).

    To get all those video and audio goodies there is of course µTorrent, the lighterweight BitTornado and SoulSeek.

    To stay safe, AVG antivirus, just because it happens once every three years, and then your happy you have it. (Also, install some data recovery software, for the same reason.) You can try Recuva, personally I use a commercial product.

    Then there are those additional annoyances to deal with: Disabling IE7 auto-update and Disabling IE8. Tweak UI and CMD here powertoys. Tweak UI will let you change annoying default behavior, (like autoplay) and remove additional icons.
    To remove additional annoyances, right click on the clock to customize notifications and remove some of those additional startup options, and right click properties on the start button to get the quick launch etc. Finally strip those additional start menus clean by going through your Documents and Settings\All Users\Start Menu\Programs

    Finally, Synergy will help you work effectively with your old and new PC.

    Obviously I'm not covering details for Vista, because why would anyone want to use that?