Wednesday, 21 September 2011

Gears of War 3 guide


Found this guide accidentally today. Looks to be just to my liking, not too detailed, not too brief. The only dowside is they want $9.99 if I want to mark as I get collectables but I can do without that, for now anyway.
 
http://www.gamerguides.com/guides/gears-of-war-3/table-contents/


Thursday, 30 June 2011

Scanning to PDF using .NET

I had a request recently to modify a .NET application I wrote years ago. The application was scanning letters and store them in SQL database linked with specific record. The new requirement was to allow saving these scanned documents as Acrobat Reader (.pdf) files.

First time I used iText API - http://www.itextpdf.com/itext.php

After I scan the document I save it as pdf like this:

public static bool SavePDFAs(string picname, IntPtr bminfo, IntPtr pixdat)
        {
            SaveFileDialog sd = new SaveFileDialog();

            sd.FileName = picname;
            sd.Title = "Save file as...";
            sd.Filter = "PDF file (*.pdf)|*.pdf";
            sd.FilterIndex = 1;
            if (sd.ShowDialog() != DialogResult.OK)
                return false;
            
            Document doc = new Document(PageSize.A4);

            try
            {
                FileStream PDFfs = new FileStream(sd.FileName, FileMode.Create); 

                PdfWriter.GetInstance(doc, PDFfs);

                doc.Open();

                Bitmap bmp = BitmapFromDIB(bminfo, pixdat);
                
                bmp.SetResolution(300, 300);

                byte[] imageBytes;

                using (MemoryStream ms = new MemoryStream())
                {
                    // Convert Image to byte[]
                    bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                    imageBytes = ms.ToArray();
                }

                bmp.Dispose();

                iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance(imageBytes);
                
                png.ScalePercent(24f);
                png.SetAbsolutePosition(0, 0);

                doc.Add(png);
            }
            catch (DocumentException dex)
            {
                MessageBox.Show(dex.Message);
            }
            catch (IOException ioex)
            {
                MessageBox.Show(ioex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return false;
            }
            finally
            {
                doc.Close();
            }

            return true;
        }

Wednesday, 29 June 2011

Some great free iPhone apps

I've been doing a research for apps I can install on iPhone 4 before ordering one.I’ve had my iPhone for couple of weeks so I could try those apps that I could not try on the iPod and find some new ones in the process. This is the list of free apps I have installed and find quite useful:

GooCal (Google Calendar™ sync) By

Tuesday, 28 June 2011

Office SharePoint Server Search crashing

I've had Office SharePoint Server Search service crash several times in the past couple of years. Normal service restart made it hang and crash completely. Service status got stuck in Stopping and there was no way to restart it.
.

A quick server reboot would bring things back to normal but apparently there is a quicker way to solve this problem:

You can kill the service using this command:

taskkill /F /IM mssearch.exe /T
 or you can open the task manager in the MOSS box and end 'mssearch.exe' process.

After you kill the service using any of the two methods above, make sure you start the service and in few minutes MOSS search will be fully functional.

Wednesday, 22 June 2011

Network Attached Storage (NAS) for home use


After several little scares that I recently had with my family photos and videos, I decided I need to shift and get some backup sorted.

First I looked into external USB drive but soon realised that Network Attached Storage (NAS) would suit me much better. In my household there are 2 desktop PCs, one notebook, one llaptop and one MacBook. Consuming LAN also are 2 xbox consoles, Wii console, 2 DS handhelds, 2 iPods and 2 smartphones too. So rather than sorting out the backup manually from each device into external USB drive, I decided to get a server sorted so I can backup and share data.

So I looked and searched anything I could find available for home use and in the end settled for QNAP TS-210 and 2 x 2Tb Seagate ST2000DL003 drives.Full package just under £260. Two external USB drives of 2Tb each would cost me in the region of £140 so almost half of what I paid for NAS but I felt that USB drives would just end up like extra storage and that's it - fragmented backup, poor file sharing, etc.

Here are some of the factors that made me decide to go for NAS:

Backup, backup, backup. With 2Gb (in Raid 1) should be able to backup all devices (not just one or two PCs). I should be able to sleep much better knowing that all my computers are backed up. Also organising backups will be much simpler since all devices will have hassle free access to NAS.

Streaming. Big bonus is the option to watch family videos from any device in the house. Or stream music to any device. Or build the DVD library easily accessible. I plan to use the main Sony Bravia TV, iPod, iPhone and Notebooks as and when needed.

Access. I want to be able to drop files in and get them out when ever and where ever I am. I can think of several times when I could do with this feature when I was at work, shopping, on holiday, etc.

Convenience. All devices can connect to it directly without having to have any particular PC switched on. Sharing the printer as well is a great bonus as I was getting really annoyed having to switch on the PC connected to the printer.Also having all photos, all videos and all music in one place is a great bonus too. With NAS all photos, videos will go in the same place. Same for music we buy online. It is going to be easier to organise too. Documents will be stored on it centrally too, so it won't matter any more which PC we were using last time we worked on a document.