Gyrolabs

Random tools to make your life easier

Saving Silverlight Ink

July 19th, 2007 by admin

Recently I was doing a project that required a signature applet. Since silverlight has ink support it was the logical choice. However, after many hours of searching around, I couldn’t seem to figure out how to save the ink without programming in C#. So here’s a solution that can turn the ink from an InkPresenter into XAML and back into ink again.

getStrokesAsString = function(inkpresenter) {
var strokes = inkpresenter.strokes;
var buffer = "<inkpresenter .Strokes>";

for (x = 0; x < strokes.Count; x++) {
buffer += "<Stroke>" +
"<stroke .DrawingAttributes>" +
"<drawingattributes Color='#FF000000' Height='1.75' Width='1.75'/>" +
"</stroke>" +
"<stroke .StylusPoints>";
var curstroke = strokes.getItem(x);
if (curstroke) {
var sps = curstroke.StylusPoints;
for (y = 0; y < sps.Count; y++) {
buffer += "<StylusPoint X='" + sps.getItem(y).X + "' Y='" + sps.getItem(y).Y + "' />";
}
}
buffer += "</stroke>";
buffer += "";
}
buffer += "</inkpresenter>";
return buffer;
}
setStrokesFromString = function(inkpresenter, silverlightobj, strokestring) {
inkpresenter.strokes.Clear();
var allstrokes = "allstrokes";
var allstrokes = silverlightobj.content.createFromXAML(strokestring);
inkpresenter.strokes = allstrokes;
}

Sorry it’t not formatted nicely — wordpress stripped all that out.

Use the getStrokesAsString method to get a XAML string representing all the strokes; just pass it the inkpresenter element.

Use the setStrokesFromString method to transfer a XAML string representing the strokes into actual strokes on the canvas. Pass it the inkpresenter element, the silverlight object (usually window.silverLight), and the XAML stroke string.

Posted in Articles, C#/.NET, Quick Tips | 1125 Comments »

Summer Plans

April 15th, 2007 by admin

I know summer doesn’t start until the end of June, but I’m starting earlier. I’ll be spending May working at Microsoft, so updates will be limited or nonexistent.

Once I get back from the internship, I’ll be redesigning this site to be more friendly to tracking downloads and keeping them separate from blog posts. If I end up writing a custom program for this, I’ll make it available for download.

In addition to the new site, I’ll be writing a system (in collaboration with Blueshift Labs) called CompactIS which is too complicated to explain on here. The spec on the protocol will be made available as soon as possible.

Posted in Articles | 2656 Comments »

Verizon LG Phone Hack

March 4th, 2007 by admin

This has been around for awhile and a lot of people know about it, but heres a little trick to confuse your friends. This ONLY works on VERIZON LG PHONES.

  1. Go into the phone’s menu
  2. Type 0 (zero) seven times
  3. Hit #
  4. Go to ‘Motor Test’
  5. Turn it on

Then the phone will vibrate until you go back in and turn it off.

Posted in Articles, Quick Tips | 604 Comments »

Downloads Archive

February 25th, 2007 by admin

I’ve finally created a page that has a list of all downloads available on the site. The downloads are sorted in order by date added, with the most recent first.

Click here to go to the downloads archive

Posted in New Releases | 65 Comments »

Facebook Apps

February 24th, 2007 by admin

I’m thinking about writing a desktop Facebook application. If anyone has ideas let me know. Should I find a good idea, I’ll also write a custom C# client class and make that available for download.

Posted in Uncategorized | 3510 Comments »

Fake Blue Screen of Death

January 10th, 2007 by admin

Ever wanted to play a trick on friends or coworkers by making them think their computer has crashed? The easiest way is with my new Fake Blue Screen of Death (FBSOD). Just run it, enter a sleep time, and then wait for the Blue Screen of Death to appear.

Note: This is a beta, more features WILL be available soon
Another Note: You need .NET 2.0 to run this.

Sometime soon I plan on adding an easier way to change the text, and to make the error messages look more authentic, but for now, this is a good solution. Note that the FBSOD will capture all keys and key combinations (except Ctrl+Alt+Delete), so there’s no way to exit unless you know how to use the task manager, or if you know the secret.

To exit the FBSOD, move the mouse all the way to the top of the screen and click.

To change the FBSOD text, create a file called C:\windows\bsodtext.txt

Click here to download the Fake Blue Screen of Death

Total Downloads:

Posted in New Releases, C#/.NET | 467 Comments »

Internet Connection Monitor v3.1

January 6th, 2007 by admin

ICM V3.1Internet Connection Monitor version 3.1 has been released.

This version includes a few minor interface changes as well as a few changes to the backend. There are now 2 new options which allow you to hide outages if they are less than a certain length (default: 30 seconds), and another which allows you to disable the notifications when the connection goes down, so the tray icon simply changes color and writes the log. Here’s a total list of changes:

Under the hood:

  • Better error handling
  • More efficient log parser

Interface Changes:

  • Renamed a few menu items in the log viewer so they are more descriptive
  • Added an option to hide the notifications when the connection goes up or down (default: show notifications)
  • Added an option that allows the LogViewer to hide outages if the connection is down for a negligible time (default: 30 seconds)
  • LogViewer automatically scrolls to the end of the file
  • LogViewer will now open plaintext files in the viewer rather than trying to parse them out (which adds support for version 2 logs)
  • Added a menuitem that will open the options pane
  • Better icons

CLICK HERE TO DOWNLOAD ICM V3.1

Total Downloads:

Posted in New Releases, C#/.NET | 63 Comments »

Show Empty Cells in IE

January 2nd, 2007 by admin

IE doesn’t show table cells if they are empty, which can cause a lot of problems. The most obvious fix is to just put <td>&nbsp;</td>, but this isn’t a viable solution if you are generating data from a table or if your site is already created. If you are using IE, below is an example of a table that doesn’t show empty cells:

wefaew
oweifj woeifj

As you can see (if you’re using IE), the cells simply don’t show up and it looks extremely ugly. It looks even worse when using special borders. Here is a simple script that will go through all tables on your page and fill the contents of the empty cells with &nbsp;

Put this script in the <head> of your document to show empty cells in IE:

note: the <!–[if lte IE 7]> line allows this script to run only in IE browsers.

<!--[if lte IE 7]>
  <script type="text/javascript">
   window.onload = function() {
        tds = document.all.tags("td");
        for (x = 0; x < tds.length; x++) {
            if (tds[x].innerHTML == '')
                tds[x].innerHTML = "&nbsp;";
        }
   }
   </script>
<![endif]-->

Posted in Quick Tips | 70 Comments »

Coming Soon

December 11th, 2006 by admin

With the holidays approaching, I’ve been busy with a few projects. Here’s what’s coming the the (kinda) near future:

  • ICM Version 3.1 - A few bug fixes and feature adds. The most noticeable feature will be the ability to hide outages under x seconds, as well as a few other GUI interface additions and changes
  • Easythumb 1.0 - A PHP Page for quickly generating image thumbnails, with support for adding watermarks as well

Posted in Uncategorized | 61 Comments »

Internet Connection Monitor 3.0

November 6th, 2006 by admin

Just released:
Internet Connection Monitor version 3.0

Most of you have never heard of this, but it’s been a project of mine for the past 2 years, although I haven’t really actively been updating it. Just a brief history:

This was created to monitor my internet connection because it frequently cuts out for long periods of time. I needed something to show my ISP to prove to them that the service kept dropping. For this, I created a simple BASH script that would ping our ip every x seconds, and wrote a log of outages. This system was extremely limited, however, so about 6 months later, I wrote a Python version. Still, this version was buggy and inadequate. So now I release version 3.0.

It is written in C# and:

  • Puts an icon in the system tray that shows the current status of the connection (red for down, green for up)
  • Shows balloon tips when the connection drops or comes back up
  • Options for changing polling interval, port, server, and where to save the logfiles
  • A logfile viewer that parses the logfiles and tells you how long the connection was down

Click Here to Download ICM Version 3.0

Total Downloads:

Posted in Uncategorized, New Releases, C#/.NET | 63 Comments »

FilePurge Deleter and Renamer

October 8th, 2006 by admin

Released 10/8/2006:

FilePurge: Recursively search (supports regular expression search) a directory for files that match a regular expression. Then it gives you the option to delete or rename the files. Requires .NET 2.0
FilePurge Screenshot

Click here to Download FilePurge
Total Downloads:

Posted in New Releases, C#/.NET | 69 Comments »

JediConcentrate Mod

September 25th, 2006 by admin

If you are familiar with the AnAppADay project (http://www.anappaday.com’) you have probably heard of Jedi’s “Jedi Concentrate” app (Day 10: Jedi Concentrate). 2 hours after its release, I released a version with options for setting the opacity and fade speed.

UPDATE: Added Option for picking fade color (9/26/2006)

The Files are available Here:
Binary ZIP File
Source Code ZIP File

Posted in New Releases, Dugg Stories, C#/.NET, Mods | 146 Comments »

SpacerGen v1.1

September 16th, 2006 by admin

SpacerGen version 1.1 released today. Updates include

  • 3 new patterns (vertical zigzag, horizontal zigzag, grid)
  • updated documentation

Click here to read more

Download SpacerGen 1.1

Posted in New Releases, PHP | 302 Comments »

Gyrolabs Mobile BETA 1

August 27th, 2006 by admin

The Gyrolabs mobile portal is up. You can visit this link from your phone or PDA and it will save your past links and provide you with a list of the most commonly typed in links. To make sure that your URLs are saved, use a username. To get to Gyrolabs mobile:
         http://m.gyrolabs.com/
and if you want to use a username:
         http://m.gyrolabs.com/?username

Posted in New Releases, PHP | 63 Comments »

SpacerGen

August 22nd, 2006 by admin

To use the Spacer Generator:
spacergen.php?option1=value&option2=value
These are options that can be applied to any pattern

pattern The pattern of the image
Default: checkerboard

Options:
     checkerboard (A checkerboard pattern)
     diag (Diagonal Lines)
     intersect (Criss-Crossing Lines)
     grid (A grid of lines)
     vertical_zigzag (A vertically zigzagging pattern)
     horizontal_zigzag (A horizontally zigzagging pattern)

width The width of the image (in pixels)
any positive number
Default: 50
height The height of the image (in pixels)
any positive number
Default: 50
foreground the foreground of the image
6-digit hexadecimal number in RGB format
Default: 000000
background the background of the image
6-digit hexadecimal number in RGB format
Default: ffffff

New in Version 1.1


Pattern Style Examples Arguments/Options Introduced In
Grid

  • spacing=integer — spacing between lines
  • linesize=integer — width of the lines
Version 1.1
Vertical ZigZag

  • zigheight=integer — the height of the zigzag
  • spacing=integer — the distance between the zigzags
  • zigright=1 or 0 — reverse the zigzag
Version 1.1
Horizontal ZigZag

  • zigheight=integer — the height of the zigzag
  • spacing=integer — the distance between the zigzags
  • zigup=1 or 0 — reverse the zigzag
Version 1.1
Checkerboard

  • blocksize=integer — the size of the blocks
Version 1.0
Diagonal Lines

  • dir=rtl or ltr — the direction of the lines
  • spacing=integer — the spacing of the lines
Version 1.0
Crossing Lines

  • spacing=integer — the spacing between the lines
  • As of now, there is no support for changing the linesize
Version 1.0



Total Downloads:
Click here to download SpacerGen 1.1

Posted in Uncategorized | 65 Comments »

« Previous Entries