Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
// I call EncodeSpeech() with a byte array containing PCM-encoded audio data that I get from the
// microphone (with len being the number of encoded bytes in the buffer, in case this is the
// last chunk and the buffer is only partially filled).
// In my app I send the returned byte array to a service for processing - hence I prefix the
// encoded Speex data it with length information.
// The reason that I prefix the data with both the original PCM buffer size as well as the
// the size of the encoded chunk is that the DECODER needs to know the original buffer size,
// otherwise it does not decode properly. Of course the size of the encoded chunk is to "frame"
// the chunks for the service, which may read multiple chunks off a stream.
@rodmanwu
rodmanwu / gist:4490320
Created January 9, 2013 03:27
windows phoen: Pop Unwanted page
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
var lastPage = NavigationService.BackStack.FirstOrDefault();
if (lastPage != null && lastPage.Source.ToString() == "/MainPage.xaml")
{
NavigationService.RemoveBackEntry();
}
<!doctype html>
<html>
<head></head>
<body>
<div>
<table>
<tr>
<th>df</th>
<th>d</th>
<td>d</td>
@rodmanwu
rodmanwu / dragAnddrop.html
Created January 4, 2013 06:37
HTML: Darg and drop
<!doctype html>
<html>
<head>
<style type="text/css">
#div1 {width: 350px;height: 200px;padding: 10px;border: 2px solid #FFFFFF;}
</style>
<script >
function allowDrop(ev)
{