Messages - hwtan [ switch to compact view ]

Pages: prev1 2 3 [4] 5 6 7 8 9next
16
Living Room / Re: Keeping track of software license/serial keys
« on: November 17, 2007, 10:10 PM »
I keep two copies, one in a text file in an volume encrypted by TrueCrypt on the HDD, and another in my phone.
I chose text file so that i can open it with minimum software needs when I reinstall windows.

17
Living Room / Re: Laptop or Desktop — which are you?
« on: November 17, 2007, 10:07 PM »
I use a laptop mostly. Three reasons:

1. It saves the trouble of having to move data.
2. You can use it any where you want, on the train, etc.
3. It's more powerful than my company-assigned desktop.

The only thing I missed is the ability to use certain add on cards (e.g. PCI-X)


18
Developer's Corner / Re: Implementing VoIP to a simple program...
« on: November 14, 2007, 07:39 AM »
What you probably means is to implement transmission of voice packet using ip packets, not VoIP which covers more than just that (SIP and all).

Basically, you will need some way to capture digitialized packets from the sound device and some way to regenerate received packets on the sound device. May be you might want to read up on DirectX (DirectSound). There is a project on CodeProject on this (http://www.codeproject.com/internet/VoIP_For_You.asp). For the network packet, the challenge is in the data compression and how to optimising/adjust the buffer size such that you are able to tolerate some form of jitter in the receive rate and yet acceptable latency over different network due to their bandwidth and latency characteristics.


19
I guess the problem would be to find the function.
Below is a program that encodes a number using power tables.
For some data value, you will find that in order to represent it, you would need more storage than its original form.

Code: Python [Select]
  1. class CompressionTable:
  2.     values = {}
  3.    
  4.     def __init__(self):
  5.         for b in xrange(2, 9):
  6.             CompressionTable.values[b] = [ b, b**2, b**3, b**4, b**5, b**6, b**7, b**8 ]
  7.            
  8.    
  9.     def to_func(x):
  10.         v = x
  11.         while  v > 1:
  12.             lc = 0
  13.             lb = 0
  14.             ld = v
  15.             part_found = False
  16.             for b in xrange(2, 9):
  17.                 for c in xrange(8):
  18.                     d = v - CompressionTable.values[b][c]
  19.                     if abs(d) < abs(ld):
  20.                         lb = b
  21.                         lc = c
  22.                         ld = d
  23.            
  24.             print "%d^%d -> %d" % (lb, lc+1, ld)
  25.             v = abs(ld)
  26.            
  27.         print "final value of v = %d" % v
  28.    
  29.     to_func = staticmethod(to_func)
  30.  
  31. t = CompressionTable()
  32.  
  33. while True:    
  34.     v = long(raw_input())
  35.     if v == 0:
  36.         break
  37.     t.to_func(v)
  38.  
  39. print "-End-"
257
2^8 -> 1
final value of v = 1
258
2^8 -> 2
2^1 -> 0
final value of v = 0
9999
6^5 -> 2223
3^7 -> 36
6^2 -> 0
final value of v = 0
16384
4^7 -> 0
final value of v = 0
987654
7^7 -> 164111
7^6 -> 46462
6^6 -> -194
6^3 -> -22
5^2 -> -3
3^1 -> 0
final value of v = 0
9876543
7^8 -> 4111742
7^8 -> -1653059
6^8 -> -26557
8^5 -> -6211
3^8 -> -350
7^3 -> 7
7^1 -> 0
final value of v = 0
16777216
8^8 -> 0
final value of v = 0
16777219
8^8 -> 3
3^1 -> 0
final value of v = 0
1677719
6^8 -> -1897
3^7 -> -290
2^8 -> 34
2^5 -> 2
2^1 -> 0
final value of v = 0

20
If I understand you correct, the answer is, it can.
See http://en.wikipedia.org/wiki/Huffman_coding . If I'm not mistaken, ZIP contain something similar to Huffman.

You may also want to read up on http://www.data-compression.com/theory.html about data entropy and compression.



Pages: prev1 2 3 [4] 5 6 7 8 9next
Go to full version