Sunday, 31 May 2015

Netbeans install

Found this video for installing netbeans for use with c++. Why is it so complicated. Because people don't want you to make programs! They want all the glory! Here's what I make of the rundown of the install:


  1. Cygwin (please make your website easier to use!)
    1. click install > setup-x86.exe
    2. Run it
    3. Download from any mirror
    4. Packages
      1. gcc-core - GNU compiler collection
      2. gcc-g++ - GNU compiler collection
      3. gdb - GNU debugger
      4. make - the GNU version of the make utility
    5. install
  2. JAVA Development Kit JDK
    1. Download JDK
  3. Netbeans
    1. just install the full package (you never know when you're going to need it all)
    2. Load up Netbeans
    3. make a new C++ app
    4. tools > Options > C++
      1. If you don't have anything in these boxes, click restore to defaults
Done

Tuesday, 7 April 2015

Google Maps overlays with mouseOver hover events

So, I've now created a map, with overlays. Now the need to create mouse over events so that people can interact with them.

Here's some places I've found information:
How to make a map with overlays
How to create an event on mouseOver -> with reference to this post
A similar post, but different solution
Not sure if relevent, but a mouseover tooltip for markers


Some docuemtnation on overlay types and Map Type registry


Sunday, 29 March 2015

Drupal security updating

Using drupal it's always good to stay up-to-date with security updates. The trouble is, how to update as it is usually a manual thing (please could you automate it Drupal?).

So, the manual process is:
  1. Backup files
    1. You really only need to backup the /Sites/All folder, but I backup all of it
    2. I use FileZilla, and simply drag the whole online folder onto my machine in an appropriately named folder - /Backups/29-03-2015/webfiles/
  2. Backup database
    1. The database is probably the most important thing to backup
    2. Log in to your myPHPadmin console
    3. click on the database
    4. Click on export
    5. I just use the simple settings
    6. When it's made the file, it'll give it to you to download
    7. Download and put it in an appropriately named folder - /Backups/29-03-2015/database/
  3. Download the latest Drupal release
  4. Upload all the files
    1. I use FileZilla, which doesn't replace folders, only files within folders. Very handy! You don't want to overwrite your /sites/ folder as this contains all your custom stuff!
  5. Run the update
    1. go to http://www.yourwebsite.com/update.php
  6. Done!

Saturday, 28 March 2015

PHP download FTP file and convert from ANSI to UTF-8

So, I have a file, and I'm using Joomla with CSVI to import the file from an ftp server into the database. The file is automatically made by a third party, and it is in ANSI format.

This file contains '£' which CSVI and Joomla do not like when it is in ANSI format. I need to convert it to UTF-8 in order to import such characters. Of course to convert, I will need to store locally as well. Here's my research:

First thing is to get the file and store on server:

Found the PHP function ftp_get

Once on the server, I found two ways to convert:
mb_convert_encoding()
iconv()

this is quite helpful for getting and writing the file:
$file = file_get_contents('file.php');
$file = iconv('greek-charset','UTF-8', $file);
file_put_contents('file.php', $file);
//ta-da!

Monday, 9 March 2015

Blender Render Farm Tutorial

This tutorial will talk you through how to use the Render Farm in S721. You will be able to submit a job, and collect the files when finished.

  1. Load up Blender 2.73a found in Applications > Blender 2.73a > Blender
  2. You will need to enable the render farm plugin
    1. Go to File > User Preferences
    2. Go to "Render" on the left hand list
    3. Enable "Network Renderer"
    4. Close this window
    5. At the top go to where it says "Blender Render" and select "Network Render":
    6. On the lower right hand panel you will see the controls for network rendering:
    7. Once a job is submitted you will have to wait until it is complete before collecting the files.
On the Master Machine (the Mac Pro teaching machine) you can log in and access the queue viewer.
  1. Open a web browser on this machine
  2. in the URL type
    1. http://localhost:8000
 Done

Basic Fabric Printer Tutorial

This tutorial will talk you through using SmartPrint to send a print to the fabric printer and controlling the 'print queue' to the printer.

  1. You will need to log into the computer with a special login:
    1. Username: .\smartprint
      1. Please put the .\ before the word 'smartprint'
    2. Password: smartprint
  2. Put your USB Pendrive into the machine
  3. Your image is best off in the .TIFF format
    1. To convert to this format (as opposed to JPEG) load Photoshop
    2. Open your image
    3. In the menu system, click on Image > Image Size
    4. resize your image to the size you would like it printed to
      1. Make sure the 'Resolution' is set to 200 Dots Per Inch (DPI) (as opposed to Dots per CM)
    5. Click OK to resize it.
    6. In the menu system click: File > Save As
    7. Select TIFF from the list of formats
    8. Click OK when asked more questions.
  4. Load up "SmartPrint"
    1. Icon is at the bottom
  5. It will present you with a set width canvas which is dark gray
    1. each fabric is a different width. Measure your fabric
    2. To resize the width of the canvas click: File > Layout
    3. Edit the 'width' to the size in mm
  6. Open up an explorer window and browse to your image. (the TIFF file you made earlier)
  7. Drag this image onto the canvas of Smartprint
  8. It should size your image how you had sized it in Photoshop
  9. You may drag more images onto the canvas to maximise use of space. Although it will only let you drag one image at a time.
  10. When you are happy, switch the printer on
  11. Load the roll you wish to print on
  12. Click the 'right' arrow to say you have loaded a roll
    1. it will measure the width of the roll
  13. Click the 'Remote' button when the printer is ready to print
  14. On the computer go to: File > Print
  15. Click OK for 1 copy
  16. The Print Queue Manager will load up
    1. Do not click on the Print Queue Manager as it will crash!
  17. If the Print Queue Manager 'crashes' you will need to close it and open it again
    1. Click on the SmartPrint software
    2. In the file menu system go to: File > Close Queue Manager
    3. In the file menu system go to: File > Open Queue Manager
    4. In the Queue Manager go to: File > Start Print Queue
 Done

Embroidery Machine basic Tutorial

The embroidery machine can take an image and convert it into lines which it can follow with a stitch, or it can fill inbetween if the area is enclosed.

This tutorial will show you how to get an image into the application and convert it into stitch lines and fills.

Finding an Image

To make your life easier, it is best to start with images that have only a few colours, and which are flat. i.e. no gradients or noise.

For demonstration purposes I have not made my life easier, I have picked this image:
Although this image has gradients, we can fix it in Photoshop to make it a flatter image

Fine-tuning the image before using PE Design

I will open the image in Photoshop. To make the image have less colours (I count the gradient as many colours) we can do a few things:
  1.  If it is just one shaded colour, you can use threshold
    1. Click on the threshold button in the Adjustments panel on the leftIt's in the bottom row of icons in the middle
    2. It will add an adjustment layer in photoshop and take you to editing it. This panel should now look like this
    3. And your image should now be black and white:
    4.  Underneath the graph there is a slider, if you slide it around you should be able to get a good black and white image:
    5. Heres where I moved the slider to:
    6. If you are happy with it, you can save as a JPEG image and move onto the next Chapter "Converting Pixel Image into Vector Image"
  2. If these last few steps didn't bode well, then we will try a different 'filter'
    1. We will use the 'Cutout' filter, accessed in the menu 'Filters > Artistic > Cutout...
    2.  You will see these sliders:
    3. Move them about until you have however many colours you need. Your image should look flat (no gradients) like this:
    4. Save your file as a JPEG image and close Photoshop.

Converting images into stitch and fills

Now we are ready to put the image into PE Design
  1. The software needs a license to run, which is on the 'disk drive' for the embroidery machine. Make sure it is plugged in.
  2. Load up PE Design Center
    1. Start menu > PE Design > PE Design Center
  3. click on the Image button to say you have an image to work from
  4. Find your image and click OK
  5. With the colour picker, choose the colours of your image that you want it to work from
  6. Click OK
  7. Now in the top right corner you will see four icons next to each other. These are the four steps to take to convert our image. The workflow is to work from left to right. We have done the first two steps of importing the image and converting it to PE Design format.
  8. Click the next image which looks like some dots with lines joining them. Here it will convert our image into lines
  9. The standard settings work well, but if it does not produce the right image, click this icon again to go back and repeat the steps, changing the settings.
  10. Your image should be converted into lines. You can edit these lines if there are not quite right using the tools on the left
  11. The final step is the last button on the right. When you click this it will covert your lines to a running stitch.
    1. To change the stitch colour click on the line tool and change the colour.
      1. Whereever you now click it will change that line to that colour
    2. To make it have no running stitch, click the button to the left of the colour to turn it off
      1. wherever you now click it will not do a running stitch
    3. To change whether it fills an area in with a fill stitch click the fill tool
      1. Where-ever you now click it will fill in areas with a fill stitch
    4. To unfill an area, click the button to the left of the 'colour' button
      1. Where-ever you now click it will NOT fill in areas.
  12. When you are happy with your image you will need to put it on the disk
    1. Don't close the PE-Design center but open PE Layout and Editing from the Start menu
      1. Start > Programs > PE Design > Layout and Editing
    2.  To import your file click File > Import > From Design Center
      1. It will ask you what size to import it as
    3. Now to save to disk
      1. Click File > Write to Disk

The Embroidery Machine

Now you are ready to put your image on the Embroidery machine.
  1. Switch the machine on at the back
  2. Click the on-screen OK button
  3. When it is booted, insert the disk
  4. Click on the icon which represents the disk
  5. Click on the file on the disk
    1. It will put your artwork on the 'canvas'
  6. You can rotate, resize your artwork here.
  7. When you are ready click the End Edit button (bottom right)
  8. Load your Embroidery frame in
  9. Click the To Sew button (bottom right)
  10. Thread the machine
  11. Click the Sew button (bottom right)
  12. Click the safety button and then the green button to begin.