11-7's profile11-7PhotosBlogLists Tools Help

11-7 Huang

Occupation
Location
There are no music lists on this space.
There are no photo albums.

11-7

只此一间 绝无分店 全年无开
May 14

busy time again

It's the middle of May again, I got lots of stress from school work and everything else AGaiN~

I stayed up the whole night to make the poster for Combinatorics last night. Dr.Hanusa advised me nicely "Don't leave it to the last day, you may not get the poster out if there is a bug in your program that you can't fix". He is right, I was still debugging my "English Premier League Season Simulator" at 11pm yesterday after I rushed to staple and wallgreen to buy color pens and posterboard. He is right, but I made my poster, by giving up sleep for a night. It is a nice poster, except it is not "English Premier League" stylish.. at all. I couldn't make my printer print league and soccer logoes that fit on the poster, so all I have is hightlighting team names and other words with pink, red, purple, blue, green pens. Yeah, it looks like a little girl art homework.

I am sitting in the lab, very very sleepy. Come on hogzilla, work faster, let me go home early.


January 13

perl note

1. $_  , perl default variable
 
print "I want to print $_ . \n";  
$> I want to print  .
 
my $temp = $_;
print "I want to print $temp . \n";
$> I want to print  .
 
2. shift
 
shift @Array == popFront (@Array)
 
however,
my $temp = shift;
print "I want to print $temp . \n";
$> I want to print  .
 
3 $perl++ and ++$perl
$i = 0; $j = 0;
 
print "$i++ \n";      # pre-increment
$>0
 
print "++$j \n";      # pos-increment
$>1
 
print "$i ++ \n"';    # so, a space and no space makes a difference
$> 0 ++
 
print "++ $j \n";
$> ++ 0
 
apply pre-increment and pos-increment on string in range /^[a-zA-Z]*[0-9]*\z/
(not prooved my sasquatch-h1.bio.qc.cuny.edu yet)
print ++($foo = '99');   # prints '100'
print ++($foo = 'a0');   # prints 'a1'
print ++($foo = 'Az');   # prints 'Ba'
print ++($foo = 'zz');   # prints 'aaa'
#           z z
    +         1
    -----------
               a(with 1 carried on) 
             a
          a
    -----------
          a a a
 
 3. to make a perl file a executable file
 
chmod a+x test.pl
 
 4. tmpnam

  Returns a name for a temporary file.

	$tmpfile = POSIX::tmpnam();

 
October 01

How I wasted my time beause of carelessness

 
A char made a big differece, the difference is at least 3 hours:
 
fprintf(stderr, "resultSS->Sx = %ld, resultSS->Sy = %lf, resultSS->Sxy = %lf, resultSS->JW_Psi = %lf\n", resultSS->Sx, resultSS->Sy, resultSS->Sxy, resultSS->JW_Psi);
 
The above line prints out GARBAGE in the memory for all 4 values, and took me 3 hours to debug... #@!$#@&*@
September 24

whatever

今天都Cindy突然而来的关心不知所措. 她测验题早胶卷却在外面等我, 但是我能和她说的唯一就是 "our brains work differently". 她问我 "if you tell me yours problem, is it not going to help but hurt ?", 我从来没有想过这个问题,但是马上给她一个答案,我回答 "yes",  然后虽然很depressed, 但是我心里认同。 
 
其实我还没有放弃,应该说是永远不可以放弃。如果我看得起自己,是因为一直以来无论多受伤我一直不放弃,那现在就是一场硬仗,敌人已经在可见范围之内。有时候觉得,我以前的生命是一个玩笑。道理很多,选不适合自己的道理来说服自己和骗也没什么两样。 如果正如有些人所说,人就像苹果,上帝喜欢你所以咬了你一口,当你来在世界上的时候才有缺陷。那么上帝这样编排我的基因又是什么用心?
 
 
 
I was shocked that you were aware that I was mad at you. I was mad at you because I fought so hard with myself to talk to you, then  you were not listening. Since I confused you, we are tied.
September 09

JavaScript, onClientClick

<asp:Button ID="Button_JavaScriptTest" runat="server"
        OnClientClick="return confirm('Are you sure you want to delete this record')"  Text="JavaScript Test"
        Width="133px" onclick="Button_JavaScriptTest_Click" />
 
OnClientClick on html becomes OnClick
 
??
 
August 24

致亲爱的松鼠

松鼠,
 
很抱歉昨天深夜一小时的怨气, 又很感谢你耐心的聆听.
 
人要长大一定有阶段, 有时觉得随着年龄增长, 离终点反而越来越远, 从前清晰的眼界, 自信而且有条理的思维不知不觉变得很模糊.
但是我知道,你总是在那里,陪我走过很多路。
 
我每次听“我们相爱六年”,总是会想起你
 

I am searching for jobs today

I am searching for a part time developer position on dice/monster/experience today. This is one of the example, I got very frustrated that I am still going to school so that I can't work full time but meanwhile I still want to go to school
 
 
Location: 
New York - Brooklyn 
                                                                               
// reachable distance

Compensation Details/Other Benefits: 
$90,000.00 
                                                                                              // wah, huge $$

Description: 
We are looking for a quality-minded Software Developer to help build out our platform
.
Typical projects include creating rich interactive applications,                       // I have a clue how to do it 
scaling up large transactional systems,                                                       // I have a clue how to do it
building a state of the art web-based reporting and data analysis system,      // the "art" part may be a problem for me
and developing web 2.0 collaboration tools.                                                 // I have done it before

If you want to work with cutting edge technologies and consider yourself a star programmer, we want to hear from you!     //well, anyway I am interested

Requirements of Software Developer:
* BS/MS in Computer Science or equivalent.                                               // Damn, I am still going to school and I am enjoying it 
* 1 to 5 years of experience with OO programming in Java.                          // I have 1 year of real job experience and programmed in Java for 2 years
* Fluency in at least another OO or scripting language such as Ruby, Python, C++ or C#.    // C++ and C# are ok
* Familiarity with UNIX tools.                                                                      // also do C in Unix
* Strong fundamentals (OO, Algorithms, Data structures).                            // took courses of all three, designed algorithm at old jobs then implemented in the old job
* Taste for simplicity and elegance in technical design.                                 // it depensed on your standard of simplicity and elegance
* Appreciation for test-driven development, and building software *the right way*.   // I did this many many times

Bonus points for:

* Experience with Oracle. SQL and PL/SQL wizardry.
                                            // ok with SQL
* Experience with server-side java technologies and major application servers.      // it sounds complicated, but I think I have done it
* Experience developing with / extending Drupal.                                                 // I admit I don't know Drupal, but it is additional requirement
* Advanced front-end and Ajax skills.                                                                  // I also program in ASP.Net and SQL, I think they are to do with Ajax
 
 
I am surprised that I have the skills for a $90,000 position, meanwhile I am frustrated because almost all jobs posted require a degree in computer science. Searching for jobs in very tiring and frustracted, people more likely to concern about what they don't qualify than what they quality. Hope everybody stand stronly on it. I am looking for a part time software developer position with no more than 25 hours/week, ideally between 20 to 25 hours, reasonable pay. My life of the past year was crazily busy, but it is good to go to school, meet with friends, program (something I can't not do) and always know that there is space for improvement.

August 15

count lines in a text file, C

#include <stdio.h>
#include <stdlib.h>
 
int main(int argc, char *argv[])
{
   int lineCount = 0;
   FILE* fp = fopen(argv[1], "r");
 
  if (fp == NULL)
  {
       // post an message;
  }
 
  int c ;
 
   do
   {
        c = getc(fp);
        if(c == '\n')  // is c is the int representing new line char
           lineCount ++;   
   }while(c != EOF);
 
   fclose(fp);
   printf("File contains %d lines \n", lineCount);
 
   return 0;
 
}
 

A not very smart way to combine 30 files

 
Mike said sasquatch-05 has 6 G of memories, so it should be ok to run a 2,000,000 simulations. However, it even could not run 10000, we may have a problem to fix here. So, alternatively, I ran the simulated 30 times with 5000 each time, got 30 files with each 5001 lines, the first line is the header. I needed to delete the headers of 29 files and combine all 30 into one big prior. (150000 is not very big). I planed to make a write a R script to do it, but ... it is hard.
 
So,
 
in Unix/emac,
Ctrl+k to delete the header
 
in R
file.append("./BigPrior", "./PriorZ"), Z in 2:29
 
 

R : incomplete final line found by readTableHeader on './fileName'

 
put a line break at the last row of the file
August 14

compile C

 
compile and make an execution
cc something.c -o something
 
run
something
 
with main parameter /* int main(int argc, char* argv[] )
something param
 
param is read as argv[1], is not command line argument is given, argc = 1
 
 
June 30

string tokenizer/ parsing / truncate .net C#

 
/* tokenize string */
string[] tokens = new string[3];
tokens = lineRead.Split("\t".ToCharArray()); // tab, gotta be char[]
 
/*parsing*/
int i = Int32.Parse("12"); \\ i = 12
double d = Double.Parse("3.66"); \\ d = 3.66
 
/*truncate*/
d = Math.Truncate(d); \\ d = 3.0;

c++ vs ++c

 
/* verified by Visual Studio 6.0 and venus.cs.qc.edu unix complier*/
int c = 0;
 
cout << ++++c << endl; \\ 2
cout << (++c)++ << endl; \\ 3
 
cout << ++c++ << endl; \\ illegal, c++ has higher presidency than ++c, apparently
cout << c++++ << endl; \\ illegal, c++ does not return an l-value
 
 
/* C++  pos-increment*/
int operator++(int unused)
{
      int i = c;
      c = c+1;
      return i;
}
 
/* ++C pre-increment*/
int& operator++ ()
{
    c = c+ 1;
    return c;
}
 
 

Timer .net C#

 
 
timer1.Interval = 10000;  \\ 10 seconds
timer1.Enabled = true; \\ active timer1
timer1.Start();  \\start timer1
timer1.Stop(); \\stop timer1
timer1.Enabled = false; \\ deactive timer1
 
private void timer1Tick(object sender, EvenrArgs e);
 

Read/Write file with .net2.0 C#

// Pseodu code, something like this
 
using System;
using System.Text;
using System.IO;
 
class something
{
    public static void Main()
    {
        string inFile = "in.txt"; \\file in the working dir
        string outFile = "out.txt"; \\ write to working dir
 
        readFileAndWriteException(inFile, outFile); 
    }
 
    private void readFileAndWriteException(string inFile, string outFile)
    {
        try
        {
           FileInfo f = new FileInfo(inFile); 
           FileStream s = f.Open(FileMode.Open/*If file not exsiting, throw exception*/, FileAccess.Read );
           TextReader tr = new StreamReader(s);
           string lineRead = tr.ReadLine();
           s.Close();
           tr.Close();
           Console.WriteLine(lineRead);
         }
        catch
        {
            TextWriter tw = new StreamWriter(outFile);
            tw.WriteLine("exception reading file");
            tw.Close();
        }
 
    }
}