Friday, 23 May 2014

How to Clear Error 5200 / P08 & Reset Printer Hardware (Canon Pixma MG2100 MX and S series printers)


Perform these steps to reset most Canon Printers. It works with MG / MX / M / PIXMA series and many more!

Step 1) Unplug the printer from Power and wait 5 sec then Plug it back in.
Step 2) Press "Stop/Reset" button for 2 sec and hold it.
Step 3) Now Press and hold the "Power" button also with "Stop/Reset" for 5 sec.
Step 4) Release only "Stop/Reset" and wait for 2 sec (still holding "Power" button)
Step 5) Now press and release "Stop/Reset" 5 times.
Step 6) After 5 sec release "Power" button also (No LCD only power light seen).
Step 7) Wait for a minute (after the printer resetting).
Step 8) Now power off the printer by pressing "Power" button.
Step 9) After 30 Seconds press "Power" button again. Now you're ready to print !!!

All printer errors should be cleared!

Wednesday, 6 March 2013

Evasi0n - iOS 6.1.2 Untethered Jailbreak [v1.5 Released!]


Evasi0n is an untethered jailbreak for iOS 6.1.2! Download and view below! View and Download

Sunday, 10 February 2013

CSS - Web Safe Font Stacks


Found a really good site that provides web-safe CSS font stacks for the font-family property. They provide serif, sans-serif (no tails!) and monospace font stacks.

Enjoy!

Link Here: CSS Friendly Font Stacks

Wednesday, 30 January 2013

C#: Send a simple E-Mail via. Google Gmail SMTP Server



Here's a code snippet which allows you to send an E-Mail using Gmails SMTP server...



Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Net.Mail;
  6. using System.Text;
  7.  
  8. /// <summary>
  9. /// Simple Emailer class for sending a simple email.
  10. /// </summary>
  11. public class Emailer
  12. {
  13.     /// <summary>
  14.     /// Takes a users email and item name and generates an email
  15.     /// </summary>
  16.     /// <param name="recipient">Recipients e-mail address</param>
  17.     public static void SendMail(string recipient)
  18.     {
  19.         try
  20.         {
  21.             // Setup mail message
  22.             MailMessage msg = new MailMessage();
  23.             msg.Subject = "Email Subject";
  24.             msg.Body = "Email Body";
  25.             msg.From = new MailAddress("FROM Email Address");
  26.             msg.To.Add(recipient);
  27.             msg.IsBodyHtml = false; // Can be true or false
  28.  
  29.             // Setup SMTP client and send message
  30.             using (SmtpClient smtpClient = new SmtpClient())
  31.             {
  32.                 smtpClient.Host = "smtp.gmail.com";
  33.                 smtpClient.EnableSsl = true;
  34.                 smtpClient.Port = 587; // Gmail uses port 587
  35.                 smtpClient.UseDefaultCredentials = false; // Must be set BEFORE Credentials below...
  36.                 smtpClient.Credentials = new NetworkCredential("Gmail username", "Gmail Password");
  37.                 smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
  38.                 smtpClient.Send(msg);
  39.             }
  40.         }
  41.         catch (SmtpFailedRecipientsException sfrEx)
  42.         {
  43.             // TODO: Handle exception
  44.             // When email could not be delivered to all receipients.
  45.             throw sfrEx;
  46.         }
  47.         catch (SmtpException sEx)
  48.         {
  49.             // TODO: Handle exception
  50.             // When SMTP Client cannot complete Send operation.
  51.             throw sEx;
  52.         }
  53.         catch (Exception ex)
  54.         {
  55.             // TODO: Handle exception
  56.             // Any exception that may occur during the send process.
  57.             throw ex;
  58.         }
  59.     }
  60. }
End of Code Snippet

Thursday, 22 November 2012

Facebook Developer: Debugger


Not sure how many of you know about this, but check out the Facebook Debugger!

You can enter an Input URL, Access Token, or Open Graph Action ID!

View Here: http://developers.facebook.com/tools/debug

Error when saving a table in SQL Server: "Saving changes is not permitted"


Error Message
Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

Why?
This problem occurs when the Prevent saving changes that require the table re-creation option is enabled, and you make one or more of the following changes to the table:
  • You change the Allow Nulls setting for a column.
  • You reorder columns in the table.
  • You change the column data type.
  • You add a new column.
When you change a table so that you alter the metadata structure of the table, and then you save the table, the table must be re-created based on these changes. This may result in the loss of metadata and in a direct loss of data during the re-creation of the table.

Fixing the Problem

OPTION 1 - Using the ALTER SQL keyword to change the table definition.

Code Snippet
  1. ALTER TABLE NameOfTable ALTER COLUMN ColumnToAlter INT NOT NULL
End of Code Snippet

Option 2 - Turning off the "Prevent saving changes that require table re-creation" option. NOT RECOMMENDED!. This may cause data loss due to changes with the meta structure of the table. A good example of potential data loss is if you enable Change Tracking.

If you only have the table structure set up and/or data loss isn't an issue (Test Data for example), then here are the following steps to turn off this data protection feature.

1. Open SQL Server Management Studio (SSMS).
2. On the Tools menu, click Options.
3. In the navigation pane of the Options window, click Designers.
4. Select or clear the Prevent saving changes that require the table re-creation check box, and then click OK.




Joining MP4 Files together without Re-Encoding (Windows and MAC)


OPTION 1 - MP4Join (Cross Platform) [RECOMMENDED!]

VERY simple cross platform solution to join MP4 files. Just add them to the lit, re-order them, and it will simply copy the next video on to the previous at the end of the last frame. It will output the final MP4 without loss of quality or re-encoding.

Download Here: http://www.mp4joiner.org/en


OPTION 2 - Quicktime (7 or X at time of writing). Windows users must use Quicktime PRO ONLY.

1. Open the two H264 videos in Quicktime 7. Let's suppose they are named video1.mp4 and video2.mp4.

2. Working on video1.mp4, Select All, then Copy.

3. Switch to video2.mp4, make sure the "cursor" is at the beginning of the video, then Paste. This inserts the content of video1.mp4 at the front of video2.mp4.

4. This step is probably optional. "Save As" the modified video2.mp4. You will be able to save in .mov format only. I saved as a self-contained movie, but I suppose a reference movie would work too. I used the filename "video.mov".

5. Select "Export" in the file menu to export video.mov to the joined H264 file. The "Export" to select is "Movie to MPEG-4". The preset is not important, I chose "LAN/Intranet". The preset is not important because we override it in the next step.

6. Click on "Options" to reach the settings dialog. In the Video pane, "Video Format" is selected to be "H.264". Click on the menu, select "Pass Through". As expected, all the other options will get disabled.

7. Click OK, then Save, and watch your joined file be saved at the speed of your hard disk.


OPTION 3 - MAC Users Only!

SimpleMovieX, a shareware video editor which exactly advertises this as a feature. Requires OS X 10.6 or later.

Download Here: http://simplemoviex.com/SimpleMovieX/download.html

Thursday, 26 July 2012

iPhone - Free 3G tethering


Applications like MyWi and PDANet are not allowed on the Apple App Store due to getting around user's data network data usage plans (Which networks charge a lot for!)

Check out this app, very simple, lightweight and free!

http://www.junefabrics.com/desktop/

Tuesday, 17 July 2012

JDBC - Calling an Oracle Stored Procedure with CURSOR output


This article explains how to call an Oracle Stored Procedure that returns a Cursor as an output parameter with Java using JDBC.


Things to note:
- JDBC begins it's index's at 1, not 0. I.e. The CallableStatement object's methods such as: getObject must have a parameter with a value of at least 1.
- Once the Connection or CallableStatement objects are closed, the ResultSet will be empty. This is because it only exists as long as the database connection is open. Ensure you take your results before these objects are destroyed.
- oracle.jdbc.OracleCallableStatement and java.sql.CallableStatement offer the same outcome in this example. Therefore, I have opted to use the java.sql library.
- The '?' within the prepareCall parameter is a place holder for a parameter. This is populated (in this example) using the registerOutParameter method, declaring it's expected type.


Oracle Stored Procedure
Code Snippet
  1. CREATE OR REPLACE PROCEDURE PACKAGENAME.GET_ACCOUNTS
  2. (
  3.     l_cursor OUT sys_refcursor
  4. )
  5.     OPEN l_cursor FOR SELECT ACCOUNT_NAME FROM Accounts ORDER BY ACCOUNT_NAME;
  6. END GET_ACCOUNTS;
End of Code Snippet


Java Code
Code Snippet
  1. // Establishes and returns a new connection to the database
  2. private Connection GetConnection() throws SQLException
  3. {
  4.     // Load and register Oracle driver
  5.     DriverManager.registerDriver(new OracleDriver());
  6.    
  7.     // Establish a connection
  8.     return DriverManager.getConnection("jdbc:oracle:thin:@SERVER:PORT:SID", "USERNAME", "PASSWORD");
  9. }
  10.  
  11.  
  12. // Gets a collection of all accounts within the database
  13. public Collection<Account> GetAccounts() throws SQLException
  14. {  
  15.     Connection conn = null;
  16.     CallableStatement cstmt   = null;
  17.     Collection<Account> accounts = new ArrayList<Account>();
  18.  
  19.     try
  20.     {
  21.         // Connect
  22.         conn = this.GetConnection();
  23.  
  24.         // Get ResultSet
  25.         cstmt = conn.prepareCall("{call PACKAGENAME.GET_ACCOUNTS(?)}");   // '?' is a template for our Cursor OUT parameter
  26.         cstmt.registerOutParameter(1, OracleTypes.CURSOR);
  27.         cstmt.execute();
  28.  
  29.         // Index starts at 1, so we want our first result, which is the Cursor
  30.         ResultSet rs = (ResultSet) cstmt.getObject(1);
  31.  
  32.         // process results one row at a time
  33.         while(rs.next())
  34.         {
  35.             Account acc = new Account(rs.getString(1)); // Account name is the first (and only) result in our Cursor.
  36.             accounts.add(acc); // Add account to our collection of accounts to return
  37.         }
  38.     }
  39.     catch (SQLException e)
  40.     {
  41.         System.err.println(e.getErrorCode() + e.getMessage());
  42.     }
  43.         catch(Exception e)
  44.         {
  45.             e.printStackTrace();
  46.         }
  47.     finally
  48.     {
  49.         conn.close();
  50.         cstmt.close();
  51.     }
  52.    
  53.     return accounts; // Return collection of accounts to caller
  54. }
  55.  
  56.  
  57.  
  58. // Account POJO
  59. public class Account
  60. {
  61.     private String accountName;
  62.  
  63.     public Account(String accName)
  64.     {
  65.         this.accountName = accName;
  66.     }
  67.    
  68.     public String getAccountName() {
  69.         return this.accountName;
  70.     }
  71.  
  72.     public void setAccountName(String accountName) {
  73.         this.accountName = accountName;
  74.     }
  75. }
End of Code Snippet

java.lang.IllegalAccessError: oracle/jdbc/driver/OracleCallableStatement


I received this error when attempting to cast the result of a Connection object's prepareCall method.

Solution
Try altering the application to not refer to oracle.jdbc.driver.OracleCallableStatement. It should be oracle.jdbc.OracleCallableStatement.

Reason
For Oracle 9i onwards you should use oracle.jdbc.OracleDriver rather than oracle.jdbc.driver.OracleDriver as Oracle have stated that oracle.jdbc.driver.OracleDriver is deprecated and support for this driver class will be discontinued in the next major release.