February 2012
5 posts
2 tags
Install Java in Ubuntu
Installing Oracle Java SDK in Ubuntu is not easy as before because not so long ago Oracle decided to change licensing of Java. Which in the long run will hurt only users. Distributions can no longer make automated installs of Oracle Java, users are required to agree with the license displayed on Oracle’s web site. I googled two way to install it:
This one I haven’t tried. Source:...
Release 99 →
2 tags
Term
3GPP was originally the standards partnership evolving GSM systems towards the 3rd Generation. However, since the completion of the first LTE and the Evolved Packet Core specifications, 3GPP has become the focal point for mobile systems beyond 3G.
ITU Radiocommunication Sector (ITU-R) is one of the three sectors (divisions or units) of the International Telecommunication Union (ITU) and is...
1 tag
Alien
Alien is a program that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a package from another linux distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it. It also supports LSB packages.
Run this command to install alien and other necessary...
SQA
SQA大致上可分3大組
1.SIT Team: 負責系統整合測試, 也就是雜七雜八的都包了
每個軟體版本我們會去做BAT(Basic Acceptace Test)來判斷這個軟體版本是不是可被整個PROJECT各單位使用
也會做很多不同fUNCTION EX: WIFI, BT等的functional, IOT, stability, performance等的測試
2.CE Team: Carrier Engagement
負責LAB實驗室認證及實網Field Trial test,主要跑底層Protocol的測項
3.Logo Team: 負責Logo相關的Certification
ex: Wi-Fi, BT, MS, Android相關Logo的取得等
大致上分這三個Team,另外量產前也要負責release軟體給產線的工作
簡單來講是這樣的模式
November 2011
3 posts
2 tags
Awesome tip for traffic ticket
http://www-cs-students.stanford.edu/~eswierk/traffic-tix.html
Some more reference:
http://www.helpigotaticket.com/speed/basic.html
1 tag
时间
还车贷要三年
申绿卡要四年
买房子要几十年
所有所有年少时候的梦想都必需要用无能为力的时间去实现。而所有的梦想又会不会在无声的岁月里被吹灭吗?我想知道在等待的尽头,我会飞身雀跃,还是只是转身继续默默地生活…
1 tag
Replace IBM R52 Hard Drive
It’s hard to find an old compatible ATA Hard Drive for my beloved IBM. I bought it in 2005 as I was in the college. It still works perfectly under Linux.
http://www.thinkwiki.org/wiki/Problem_with_non-ThinkPad_hard_disks
October 2011
3 posts
1 tag
Best Red Lipstick
http://www.elle.com/Beauty/Makeup-Skin-Care/Red-Alert
1 tag
Ticket dispute
http://www.ehow.com/how_5043875_beat-speeding-ticket-california.html
1 tag
PMP certificate
http://www.preparepm.com/faq.html
http://www.articlesnatch.com/Article/How-To-Satisfy-35-Hours-Of-Project-Management-Education-For-The-Pmp/391396
CISSP
http://www.investopedia.com/articles/financial-theory/09/capm-error-problem.asp#axzz1aRy5OuuK
http://pmtips.net/
August 2011
31 posts
1 tag
Get started with 'Linux Device Drivers'
If you’re reading the book ‘Linux Device Drivers’, you probably will meet the same problem.
First, you will see this error,
error: linux/module.h: No such file or directory
I f you use your gcc with -v, you will find
#include “…” search starts here: #include <…> search starts here: /usr/local/include /usr/lib/gcc/i486-linux-gnu/4.4.3/include...
1 tag
Some Interesting Open Source Hardware Webpages
http://antipastohw.blogspot.com/2009/03/introducing-open-source-hardware.html
KiCAD: http://en.wikipedia.org/wiki/KiCAD
http://en.wikipedia.org/wiki/List_of_open_source_hardware_projects
http://www.dmoz.org/Computers/Hardware/Open_Source/
1 tag
Ex 4-1
1 tag
The Benefit of Two's Complement System
A two’s-complement system, or two’s-complement arithmetic, is a system in which negative numbers are represented by the two’s complement of the absolute value. An N-bit two’s-complement numeral system can represent every integer in the range −1×2N−1 to 2N−1−1(-128 - 127).
The two’s-complement system has the advantage:
not requiring that the addition and subtraction...
1 tag
Ex 3-6
Write a version of itoa that accepts three arguments instead of two. The third argument is a minimum field width; the converted number must be padded with blanks on the left if necessary to make it wide enough.
void itoa(int n, char s[], ) { int i, sign; sign = n; i = 0; do{ s[i++] = n % 10 + ‘0’; } while ((n /= 10) != 0); ...
1 tag
Ex 3-4
In a two’s complement number representation, our version of itoa does not handle the largest negative number, that is, the value of n equal to -(2 to the power (wordsize - 1)) . Explain why not. Modify it to print that value correctly regardless of the machine on which it runs.
In two’s complement system, the representation range is -128 ~ 127. The problem here is it cannot be simply...
1 tag
Ex 3-5
Write the function itob(n,s,b) that converts the integer n into a base b character representation in the string s . In particular, itob(n,s,16) formats n as a hexadecimal integer in s .
Idea:
Converts n to character.
Recursively, calculate it to b-based using n % b
void itob(int n, char s[], int b) { int i, sign, c; if((sign = n) < n) n = -n; i = 0;...
1 tag
Ex 3-3
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z . Arrange that a leading or trailing - is taken literally.
void expand(char s1[], char s2[]) { int i, j; i = j = 0; while((c...
1 tag
Ex 3-2
Write a function escape(s,t) that converts characters like newline and tab into visible escape sequences like \n and \t as it copies the string t to s . Use a switch . Write a function for the other direction as well, converting escape sequences into the real characters.
void escape(char s[], char t[])
{
int i, j;
for(i = 0; t[i] = ‘\0’; i++){
switch(t[i])
case...
1 tag
Ex 3-1
Our binary search makes two tests inside the loop, when one would suffice (at the price of more tests outside). Write a version with only one test inside the loop and measure the difference in run-time.
int binsearch(int x, int v[], int n)
{
int low, high, mid;
low = 0;
high = n - 1;
while(low <= high && x != v[mid]){
if(x < v[mid])
high = mid - 1;
else
low =...
1 tag
VZW LTE Test Case
https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B6q8FQgHHg66YTlhYjRmOGItOTZjNS00ZjYzLWIzYWQtZGRhZWQ2ZDE0Mzkx&hl=en_US
https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B6q8FQgHHg66Njg2OWZjNjUtNGI5Yy00MmE1LWFhY2ItYzNlOTk1MWUzZTk4&hl=en_US
1 tag
Ex 3-1
Our binary search makes two tests inside the loop, when one would suffice (at the price of more tests outside). Write a version with only one test inside the loop and measure the difference in run-time.
1 tag
Ex 2-10
Rewrite the function lower, which converts upper case letters to lower case, with a conditional expression instead of if-else .
int lower(int c) { return c >= ‘A’ && c <= ‘Z’: c + ‘a’ - ‘A’, c; }
1 tag
Ex 2-8
Write a function rightrot(x,n) that returns the value of the integer x rotated to the right by n bit positions.
unsigned rightrot(unsigned x, int n) { int rotBit; int machineLen(void); while(n— > 0){ rotBit = (x & 1) « (machineLen() - 1); x = x » 1; x = x | rotBit; } ...
1 tag
Ex 2-9
In a two’s complement number system, x &= (x-1) deletes the rightmost 1-bit in x . Explain why. Use this observation to write a faster version of bitcount .
int bitcount(unsigned x) { int i; for(i = 0; x != 0; x &= x -1) ++i; return i; }
1 tag
Ex 2-7
Write a function invert(x,p,n) that returns x with the n bits that begin at position p inverted (i.e., 1 changed into 0 and vice versa), leaving the others unchanged.
unsigned invert() { return x ^ (~(~0 « n) « (p + 1 -n)); }
** For exclusive OR,
if the original bit is 0, exclusive OR with a 1 produces a 1 - it is inverted.
if the original bit is a 1, exclusive OR...
1 tag
Ex 2-6
Write a function setbits(x,p,n,y) that returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged.
setbits(unsigned x, int p, int n, unsigned y) { return (x & (~(~(~0 « n)) « (p + 1 -n))) | (y & ~(~0 « n)) « (p + 1 -n); }
1 tag
Ex 2-5
Write the function any(s1,s2) , which returns the first location in the string s1 where any character from the string s2 occurs, or -1 if s1 contains no characters from s2 . (The standard library function strpbrk does the same job but returns a pointer to the location.)
int any(char s1[], char s2[]) { int i, j; for(i = 0; s1[i] != ‘\0’; i++){...
1 tag
Ex 2-4
Write an alternate version of squeeze(s1,s2) that deletes each character in the string s1 that matches any character in the string s2 .
void squeeze(char s1[], char s2[]) { int i, j, k; for(i = k = 0; s1[i] != ‘\0’; i++){ for(j = 0; s2[j] != ‘\0’ && s2[j] != s1[i]; j++) ; ...
1 tag
Ex 2-3
Write the function htoi(s) , which converts a string of hexadecimal digits (including an optional 0x or 0X) into its equivalent integer value. The allowable digits are 0 through 9, a through f, and A through F .
int htoi(char s[]) { int i = 0; int n = 0; int dec = 0; if(s[i] == ‘\0’){ ++i; if(s[i] == ‘X’...
1 tag
Ex 2-2
Write a loop equivalent to the for loop above without using && or || .
int i = 0; if(i < lim - 1) if((c = getchar()) != EOF) if(c != ‘\n’) s[i] = c; ++i;
1 tag
Ex 2-1
Write a program to determine the ranges of char , short , int , and long variables, both signed and unsigned , by printing appropriate values from standard headers and by direct computation. Harder if you compute them: determine the ranges of the various floating-point types.
#include<stdio.h> #include<limits.h> main() { printf(“signed char min = %d\n”,...
1 tag
Ex 1-24
Write a program to check a C program for rudimentary syntax errors like unbalanced parentheses, brackets and braces. Don’t forget about quotes, both single and double, escape sequences, and comments. (This program is hard if you do it in full generality.)
1 tag
Ex 1-23
Write a program to remove all comments from a C program. Don’t forget to handle quoted strings and character constants properly. C comments do not nest.
1 tag
Ex 1-22
Write a program to “fold” long input lines into two or more shorter lines after the last non-blank character that occurs before the n -th column of input. Make sure your program does something intelligent with very long lines, and if there are no blanks or tabs before the specified column.
The hardest part is what if there is ‘\n’ in the middle of line[MAXCOL]. How...
1 tag
MIT Athena GNU Locker →
1 tag
Cscope
More reference:
http://cscope.sourceforge.net/
1 tag
gdb →
I met Segmentation Fault several times. So, gdb is the TOOL I have to learn.
Regarding to seg fault:
At that point you should check the values of all array indices and pointers which are referenced in the line at which the error occurred. Typically you will find that either you have an array index with a value far out of range, or a pointer which is 0 (and thus unrefenceable).
Another common...
1 tag
Ex 1-21
Write a program entab that replaces strings of blanks with the minimum number of tabs and blanks to achieve the same spacing. Use the same stops as for detab . When either a tab or a single blank would suffice to reach a tab stop, which should be given preference?
#include<stdio.h> #define TABINC 8 #define MAXLINE 1000 void entab(char line[]); int Getline(char s[], int lim); main() {...
1 tag
Ex 1-20
Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a variable or a symbolic parameter?
#include<stdio.h> #define TABINC 8 main() { int c, nb, pos; nb = 0; pos = 1; while((c = getchar()) != EOF){ if(c ==...
1 tag
Ex 1-19
Write a function reverse(s) that reverses the character string s . Use it to write a program that reverses its input a line at a time.
#include<stdio.h> #define MAXLINE 1000 int Getline(char s[], int lim); void reverse(char s[]); main() { char line[MAXLINE]; int len; while((len = Getline(line, MAXLINE)) > 0){ reverse(line); ...
July 2011
21 posts
1 tag
Ex 1-18
Write a program to remove all trailing blanks and tabs from each line of input, and to delete entirely blank lines.
#include<stdio.h> #define MAXLINE 1000 int GetLine(char line[], int maxline); int RetrailLine(char s[], int len); main() { int len, lenOut; char line[MAXLINE]; while((len = GetLine(line, MAXLINE)) > 0){ lenOut =...
1 tag
Ex 1-17
Write a program to print all input lines that are longer than 80 characters.
#include<stdio.h> #define MAXLINE 1000 #define LMT 80 int Getline(char line[], int maxline); main() { int len, max; len = max = 0; char line[MAXLINE]; printf(“Following lines are great than 80 characters:\n”); while((len = Getline(line, MAXLINE)) > 0){...
1 tag
Ex 1-16
Revise the main routine of the longest-line program so it will correctly print the length of arbitrarily long input lines, and as much as possible of the text.
#include<stdio.h> #define MAXLINE 1000 int Getline(char line[], int maxline); void copy(char to[], char from[]); main() { int len; int max; char line[MAXLINE]; char longest[MAXLINE]; max = 0;...
1 tag
Ex 1-15
Rewrite the temperature conversion program of Section 1.2 to use a function for conversion.
#include<stdio.h> float tempConv(float fahr); main() { float fahr; printf(“——————\n”); printf(“Fahrenmeit Centigrade\n”); printf(“——————\n”); ...
1 tag
Ex 1-14
#include<stdio.h>
#include<ctype.h> #define ASCII 128 main() { int c, i, j, k, p; int freq[ASCII]; char * str = “A”; // Initialize frequency of each character for(i = 0; i < ASCII; i++) freq[i] = 0; while((c = getchar()) != EOF){ ++freq[c]; } //print histogram ...
1 tag
vim cheatsheet →
1 tag
Ex 1-13
Write a program to print a histogram of the lengths of words in its input. It is easy to draw the histogram with the bars horizontal; a vertical orientation is more challenging.
#include<stdio.h> #define IN 1 #define OUT 0 #define MAXLEN 10 main() { int c, state, nc; int i, j, k, p; int cnt[MAXLEN]; state = OUT; nc = 0; for(i = 0; i <...
1 tag
Ex 1-12
#include<stdio.h> #define IN 1 #define OUT 0 main() { int c, state; state = OUT; while((c = getchar()) != EOF){ if(c == ‘\n’ || c == ’ ’ || c == ‘\t’) if(state == IN){ printf(“\n”); state = OUT;...