GVNotifier tutorial video

January 22, 2010 by Dave · Leave a Comment

Here’s a great video that gives an overview of GVNotifier’s features.

If you can’t see the video, try here.

C# Threading Shorthand

January 22, 2010 by Dave · Leave a Comment

As the complexity of an application increases, often so does the threading complication.  I have two snippets which often come in useful when dealing with threads in C#.

Quickly execute code in the background:

new Thread((ThreadStart)delegate()
    {
        // code here is executed on a new thread
        // blocking operations will not block the calling thread
    }).Start();

Note that if this code is to be called often, a ThreadPool may be the better choice. ThreadPools’ have less overhead for instances when many threads would be created and destroyed.

Execute code that manipulates UI:

if (Control.IsHandleCreated)
{
   Control.Invoke((MethodInvoker)delegate()
   {
        // code here is safe to interact with Control
   });
}

Replace ‘Control’ with ‘this’ inside the Form class. Control may refer to any control created on the UI thread.

Search Urban Dictionary with C#

January 22, 2010 by Dave · Leave a Comment

Here’s a quick example of how one might scrape the search results from Urban Dictionary.  This shows some nice use of Regular Expressions and WebClient.

(View Text)

Thankfully Urban Dictionary is a very scrape-friendly site, finding results is as easy as locating two div’s and extracting the contents.

UrbanDictionary.Search(string); will return a list of key-value pairs which contain the word as the key, and the Urban Dictionary definition as the value.

WhosOnline has been deprecated

January 17, 2010 by Dave · 1 Comment

WhosOnline was an application that would scour the offline buddies of an AIM screename and attempt to discover those which were invisible. This software is long since non-working.

WhosOnline used a simple bug in AIM that would allow the presence information of someone invisible to be available through their profile.  Simply requesting the profile and examining the response would allow one to determine whether someone was invisible or offline.

AOL has long since patched this bug, and WhosOnline is no more.  There is no available download–but it wouldn’t discover invisible buddies anyway.  This website is linked to, and I receive many requests for this application, but it simply doesn’t exist anymore.

TraceListener to a textbox

January 16, 2010 by Dave · Leave a Comment

Trace, in System.Diagnostics is useful for determining where an application failed. .NET has build-in support for writing to the console or a file on disk, but it’s a little bit more complicated to direct this output to a TextBox on a windows form.

Here’s the class you need to get the trace information.

    class FormTracer : TraceListener
    {
        public delegate void OnTextHandler(string msg, bool newLine);
        public event OnTextHandler OnText;
 
        public override void Write(string message)
        {
            if (OnText != null)
                OnText.Invoke(message, false);
        }
 
        public override void WriteLine(string message)
        {
            if (OnText != null)
                OnText.Invoke(message, true);
        }
 
        public FormTracer()
        {
            Trace.Listeners.Add(this);
        }
 
         ~FormTracer()
        {
            Trace.Listeners.Remove(this);
        }
    }

When created, FormTracer will add itself to the tracers collection and start receiving messages. To add these messages to your form, create a FormTracer object like so:

        public Form1()
        {
            InitializeComponent();
 
            FormTracer ft = new FormTracer();
            ft.OnText += new FormTracer.OnTextHandler(ft_OnText);
        }

The event handler may be called on threads outside the UI, so you’ll want to make the OnText handler look something like this

        void ft_OnText(string msg, bool newLine)
        {
            if (this.IsHandleCreated)
            {
                this.Invoke((MethodInvoker)delegate()
                {
                    textBox1.Text += msg;
                    if (newLine) textBox1.Text += "\r\n";
                });
            }
        }

Add a button and handle the Click event for a test Trace message.

          private void button1_Click(object sender, EventArgs e)
        {
            Trace.WriteLine("Button Pressed!");
        }

GVNotifier 1.1.0.110

January 8, 2010 by Dave · 4 Comments

Small release today, including a few bugfixes.

- Duplicate protection – this option only needs to be used if constant duplicate messages are seen.

- Show accepted calls – added an option for this feed.

- various other updates.

GVNotifer 1.1.0.106 is live, fixes Phone’s not appearing.

December 11, 2009 by Dave · 9 Comments

Google made a change today that caused an issue that blocked Phone numbers from loading correctly in GVNotifier.  Restart twice(!) for the auto-update system to download the update.

You can install GVNotifier if you don’t already have it.

This update includes two changes only:

- Fix for Google’s change.

- Auto-Update change:  Updates will be discovered BEFORE launch each time.

GVNotifier 1.1 adds Google Contacts, Sorting, Search

December 1, 2009 by Dave · 14 Comments

Screenshots for GVNotifier 1.1:


New Features:

- Small Font Option

- Hide ‘406′ area code numbers (Google Voice SMS numbers)

- Enter to send Message.

- Google Contacts integration

- Recent contacts are at the top of the contact list, other contacts are sorted alphabetically at the bottom.

- Callback number may be selected from the Message window.

- Performance improvements

Let me know what you think in the comments, or join the beta team!

GVNotifier.net requires the .NET Framework 3.5 and Windows XP, Windows Vista or Windows 7.  Aero recommended.

If you’re already using GVNotifier, just restart for the update. (Try restarting twice if it doesn’t pop up)

GVNotifier.net 1.1 [ClickOnce Install]

GVNotifier 1.1 Beta Download (Google Contacts, Search)

November 29, 2009 by Dave · 3 Comments

This build introduces an updated GV API that includes support for Google Contacts.  The Recent list in this build will include all Google Contacts that have an assigned phone number.  Please report any new issues, as eventually this will be pushed to everyone.

Update:  This version has been released, get it here.

Future Betas will not be distrobuted on the blog.  Please Join the Google Group.

Some points -

- A contact is created for each phone number in Google Contacts.

- Contacts are downloaded first and sorted as more feeds load (Calls, Voicemail, SMS).

- Contacts are awarded points for participation in feeds.  A contact you converse with often should have a higher number of points, and come up at the top of the Contact List

- No Search, No Sorting.  I’m working on both, but taking my time so it’s as usable as possible.

- BugFix: Deleting/Arching messages in GV should NOT prompt old messages to show up again.

- Don’t like animations?  Start the app with –no-animation.

- Don’t want to register?  Start the app with –no-reg

- Don’t want logging?  Start the app with –no-logging

Update (11/29/09 3:20PM EST Build 5)

- Message Window now has a character count, and the ability to change the Callback number.  No longer is it needed to enter the Callback number manually.  Zip Updated.

Update (11/29/09 4:40PM EST Build 6)

- Added Search box to Contact List, removed ‘Send Or Call’ dialog.  Zip Updated.

Update (11/30/09 Build 11)
- Performance Improvements
Update (11/30/09 Build 12)
- Bug/feature reporter

Reasons to jailbreak iPhone: LockLight

November 22, 2009 by Dave · Leave a Comment

LockLight is now one of the top reasons I jailbreak.  This awesome tweak will allow you to open the iPhone Flashlight with full screen brightness right from the lock screen–without even looking!

The tweak is called LockLight, and is in the ModMyI repository in Cydia.  Searching for LockLight should bring up the application.

LockLight uses the Cydget platform, which allows for multiple lock screen views. Cydget is configurable in Settings.

Configure Cydget such that AwayView is first, and LockLight is lower down in the list.  Unfortunately this tweak works best with just LockLight and AwayView, but there are other cool Cydget views that are worth looking at, such as CyCalc.

Once you’ve configured Cydget, Respring your device and enjoy using LockLight!

LockLight Activation:

To start using LockLight, press the power or home button to view the lock screen.  Tap the home button to cycle through your enabled Cydgets.  If just LockLight and AwayView are enabled, tapping the home button will alternate between the two.

« Previous PageNext Page »