http://www.mitbbs.com/article_t/JobHunting/31969293.html
发信人: yangcheng (牛魔王), 信区: JobHunting
标 题: 用topcoder准备cs 面试
发信站: BBS 未名空间站 (Mon Oct 17 13:26:01 2011, 美东)
这一段时间面试下来觉得topcoder对coding面试的帮助很大。昨天回帖提到topcoder后
,收到一些站内信询什么是topcoder,怎么用,
我也不是大牛(topcoder绿色,算刚刚入门)。希望抛砖引玉,
topcoder 是一个公司, 网址http://www.topcoder.com/ ,有很多商业开发。当然对面试帮助最大的我觉得是它的算法竞赛还有很多人写tutorial
google recruiter的email里面都会包括topcoder tutorial的地址:)
tutorial 地址:
http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=
其中很多经典比如binary search http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearch.
除了tutorial 还可以免费注册会员,在arena中参加他们的online contest(10天左右
一次), 更方便的则是大量的练习题。
这里有一个很详细的arena quickstart
http://blog.theroyweb.com/topcoder-quickstart-tutorial
topcoder的好处有
1 提供大量的test case,有助于发现代码中的bug。看其他资源往往没有如此多的test
case。很可能过了一两个简单case就以为代码对了。
2 可以看其他人的code,实在想不出来可以知道怎么解答
3 题目分难度,其他online judge 比如acm.zju.edu.cn 中难以判断题目的难度。
topcoder上 div2 level 1的题目应该要能秒杀。 div2 level 2/div 1 level1 的题目
大概是面试题目的级别的。 div2 level3 / div2 level2 算面试的难题了
不足:
1 可以使用语言的标准库,面试时候往往是不行的。
2 为了速度,很多人代码的可读性不好,
3 同样为了速度,当题目的数据量不大的时候,多数人采取的解法是最容易code的暴力
。同样的题目拿来面试显然不能暴力
Labels
- Linux (22)
- QT (7)
- HTML (6)
- Algorithms (4)
- Python (3)
- SVN (3)
- interview questions (3)
- MySql (2)
- OO design (2)
- Perl (2)
- XML (2)
- brain Teaser (2)
- C++ (1)
- CSS (1)
- Debug (1)
- IPhone开发 (1)
- Math (1)
- Recursion (1)
- ShellScript (1)
- VM (1)
- Windows (1)
- programming (1)
- 业界动态 (1)
Monday, October 17, 2011
How to Share folders with your Ubuntu Virtual Machine (guest)
How to Share folders with your Ubuntu Virtual Machine (guest)
http://www.howtogeek.com/howto/ubuntu/how-to-share-folders-with-your-ubuntu-virtual-machine-guest/
The only problem: I cannot share the folders which is not at the same disk as VM is.
http://www.howtogeek.com/howto/ubuntu/how-to-share-folders-with-your-ubuntu-virtual-machine-guest/
The only problem: I cannot share the folders which is not at the same disk as VM is.
Thursday, October 13, 2011
CSS--1
What is CSS?
•CSS stands for Cascading Style Sheets
•Styles define how to display HTML elements
•Styles were added to HTML 4.0 to solve a problem
•External Style Sheets can save a lot of work
•External Style Sheets are stored in CSS files
CSS Syntax
A CSS rule has two main parts: a selector, and one or more declarations:
The selector is normally the HTML element you want to style.
Each declaration consists of a property and a value. The property is the style.
A CSS comment like this: /*This is a comment*/
The id Selector
The id selector defined with a "#" is used to specify a style for a unique element with id attribute i.e. id="para1".
| <html> <head> <style type="text/css"> #para1 { text-align:center; color:red; } </style> </head> <body> <p id="para1">Hello World!</p> <p>This paragraph is not affected by the style.</p> </body> </html> |
Tips: Do NOT start an ID name with a number! It will not work in Mozilla/Firefox.
The class Selector
The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.
This allows you to set a particular style for many HTML elements with the same class.
The class selector uses the HTML class attribute, and is defined with a "."
| Example
|
You can also specify that only specific HTML elements should be affected by a class.
In the example below, all p elements with class="center" will be center-aligned:
| Example
|
Three Ways to Insert CSS
There are three ways of inserting a style sheet:
- External style sheet
- Internal style sheet
- Inline style
External Style Sheet
An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
| < head> < link rel="stylesheet" type="text/css" href="mystyle.css" /> < /head> |
An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. An example of a style sheet file is shown below:
| hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} |
Internal Style Sheet
An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
| < head> < style type="text/css"> hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} < /style> < /head> |
Inline Styles
An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:
| < p style="color:sienna;margin-left:20px">This is a paragraph.</p> |
Cascading order
Number 4 has the highest priority:
- Browser default
- External style sheet
- Internal style sheet (in the head section)
- Inline style (inside an HTML element)
DOCTYPE
A doctype declaration refers to the rules for the markup language, so that the browsers render the content correctly.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/XHTML11/DTD/XHTML11.dtd">
HTML Development Tools
- Firefox
- As of this writing, Firefox still has the best developer plugins available, though Google Chrome is quickly catching up. Chrome ships with a pretty impressive Firebug-like set of developer tools.
-
- Firebug: http://getfirebug.com/
- An invaluable plugin for Firefox that allows you to, among other things
- view and manipulate the HTML, CSS, and DOM of your page in real time
- debug javascript
- enter and execute javascript in a console on the fly in the context of the current page
- inspect all the HTTP requests and responses made by the current page in real time - a life-saver for AJAX work.
-
-
- HTML Validator: http://users.skynet.be/mgueury/mozilla/download.html
- Integrates W3C validation with the view source window.
- Validates internal server pages that are not accessible by the public W3C web service.
- Might require the installation of the libstdc++5 and/or libxul-dev packages on some Linux platforms. See special instructions on http://users.skynet.be/mgueury/mozilla/faq.html.
- In the plugin's options, set the algorithm to SGML Parser not HTML Tidy.
-
Wednesday, October 12, 2011
Style and Link
1. Style
The HTML <font> Tag Should NOT be used
The <font> tag is deprecated in HTML 4, and removed from HTML5.
Styling HTML with CSS
CSS was introduced together with HTML 4, to provide a better way to style HTML elements.
CSS can be added to HTML in the following ways:
- in separate style sheet files (CSS files), The preferred way.
- in the style element in the HTML head section
- in the style attribute in single HTML elements
2. HTML Link Syntax
- Links are specified in HTML using the <a> tag.
The <a> tag can be used in two ways:
To create a link to another document, by using the href attribute
To create a bookmark inside a document, by using the name attribute
- The HTML code for a link is simple. It looks like this:
| < a href="url">Link text</a> |
The href attribute specifies the destination of a link.
Tip: The "Link text" doesn't have to be text. It can be an image or any other HTML element.
- HTML Links - The name attribute to create a bookmark inside an HTML document
The name attribute specifies the name of an anchor.
Note: The upcoming HTML5 standard suggest using the id attribute instead of the name attribute for specifying the name of an anchor. Using the id attribute actually works also for HTML4 in all modern browsers.
Bookmarks are not displayed in any special way. They are invisible to the reader.
Example
A named anchor inside an HTML document:
<a name="tips">Useful Tips Section</a>
Create a link to the "Useful Tips Section" inside the same document:
<a href="#tips">Visit the Useful Tips Section</a>
Or, create a link to the "Useful Tips Section" from another page:
<a href="http://www.w3schools.com/html_links.htm#tips">
Visit the Useful Tips Section</a>
Basic Notes - Useful Tips
Note: Always add a trailing slash to subfolder references. If you link like this: href="http://www.w3schools.com/html", you will generate two requests to the server, the server will first add a slash to the address, and then create a new request like this: href="http://www.w3schools.com/html/".
URL
URL - Uniform Resource Locator
When you click on a link in an HTML page, an underlying <a> tag points to an address on the world wide web. A Uniform Resource Locator (URL) is used to address a document (or other data) on the world wide web.A web address, like this:http://www.w3schools.com/html/default.aspfollows these syntax rules:
| scheme://host.domain:port/path/filename |
- scheme - defines the type of Internet service. The most common type is http
- host - defines the domain host (the default host for http is www)
- domain - defines the Internet domain name, like w3schools.com
- :port - defines the port number at the host (the default port number for http is 80)
- path - defines a path at the server (If omitted, the document must be stored at the root directory of the web site)
- filename - defines the name of a document/resource
Common URL Schemes
| Scheme | Short for.... | Which pages will the scheme be used for... |
|---|---|---|
| http | HyperText Transfer Protocol | Common web pages starts with http://. Not encrypted |
| https | Secure HyperText Transfer Protocol | Secure web pages. All information exchanged are encrypted |
| ftp | File Transfer Protocol | For downloading or uploading files to a website. Useful for domain maintenance |
| file | A file on your computer |
HTML 4.01 Quick List
HTML Basic Document
<html>
< head>
< title>Title of document goes here</title>
< /head>
< body>
Visible text goes here...
< /body>
</html>
<h2> . . . </h2>
< h3> . . . </h3>
< h4> . . . </h4>
< h5> . . . </h5>
<h6>Smallest Heading</h6>
< br /> (line break)
< hr /> (horizontal rule)
< pre>This text is preformatted</pre>
< strong>This text is strong</strong>
< code>This is some computer code</code>
< i>This text is italic</i>
Image-link:< a href="http://www.example.com/"><img src="URL" alt="Alternate Text" /></a>
Mailto link:< a href="mailto:webmaster@example.com">Send e-mail</a>
A named anchor:
< a name="tips">Tips Section</a>
< a href="#tips">Jump to the Tips Section</a>
< li>Item</li>
< li>Item</li>
< /ul>
< li>First item</li>
< li>Second item</li>
< /ol>
< dt>First term</dt>
< dd>Definition</dd>
< dt>Next term</dt>
< dd>Definition</dd>
< /dl>
< tr>
<th>Tableheader</th>
<th>Tableheader</th>
< /tr>
< tr>
<td>sometext</td>
<td>sometext</td>
< /tr>
< /table>
<frame src="page1.htm" />
<frame src="page2.htm" />
< /frameset>
<input type="text" name="email" size="40" maxlength="50" />
< input type="password" />
< input type="checkbox" checked="checked" />
< input type="radio" checked="checked" />
< input type="submit" value="Send" />
< input type="reset" />
< input type="hidden" />
< select>
< option>Apples</option>
< option selected="selected">Bananas</option>
< option>Cherries</option>
< /select>
<textarea name="comment" rows="60" cols="20"></textarea>
< /form>
& gt; is the same as >
& #169; is the same as ©
<blockquote>
Text quoted from a source.
< /blockquote>
<address>
Written by W3Schools.com<br />
< a href="mailto:us@example.org">Email us</a><br />
Address: Box 564, Disneyland<br />
Phone: +12 34 56 78
< /address>
Source : http://www.w3schools.com/html/html_quick.asp
<html>
< head>
< title>Title of document goes here</title>
< /head>
< body>
Visible text goes here...
< /body>
</html>
Heading Elements
< h1>Largest Heading</h1><h2> . . . </h2>
< h3> . . . </h3>
< h4> . . . </h4>
< h5> . . . </h5>
<h6>Smallest Heading</h6>
Text Elements
< p>This is a paragraph</p>< br /> (line break)
< hr /> (horizontal rule)
< pre>This text is preformatted</pre>
Logical Styles
< em>This text is emphasized</em>< strong>This text is strong</strong>
< code>This is some computer code</code>
Physical Styles
< b>This text is bold</b>< i>This text is italic</i>
Links
Ordinary link:< a href="http://www.example.com/">Link-text goes here</a>Image-link:< a href="http://www.example.com/"><img src="URL" alt="Alternate Text" /></a>
Mailto link:< a href="mailto:webmaster@example.com">Send e-mail</a>
A named anchor:
< a name="tips">Tips Section</a>
< a href="#tips">Jump to the Tips Section</a>
Unordered list
< ul>< li>Item</li>
< li>Item</li>
< /ul>
Ordered list
< ol>< li>First item</li>
< li>Second item</li>
< /ol>
Definition list
< dl>< dt>First term</dt>
< dd>Definition</dd>
< dt>Next term</dt>
< dd>Definition</dd>
< /dl>
Tables
<table border="1">< tr>
<th>Tableheader</th>
<th>Tableheader</th>
< /tr>
< tr>
<td>sometext</td>
<td>sometext</td>
< /tr>
< /table>
Iframe
<iframe src="demo_iframe.htm"></iframe>Frames
<frameset cols="25%,75%"><frame src="page1.htm" />
<frame src="page2.htm" />
< /frameset>
Forms
< form action="http://www.example.com/test.asp" method="post/get"><input type="text" name="email" size="40" maxlength="50" />
< input type="password" />
< input type="checkbox" checked="checked" />
< input type="radio" checked="checked" />
< input type="submit" value="Send" />
< input type="reset" />
< input type="hidden" />
< select>
< option>Apples</option>
< option selected="selected">Bananas</option>
< option>Cherries</option>
< /select>
<textarea name="comment" rows="60" cols="20"></textarea>
< /form>
Entities
& lt; is the same as <& gt; is the same as >
& #169; is the same as ©
Other Elements
<!-- This is a comment --><blockquote>
Text quoted from a source.
< /blockquote>
<address>
Written by W3Schools.com<br />
< a href="mailto:us@example.org">Email us</a><br />
Address: Box 564, Disneyland<br />
Phone: +12 34 56 78
< /address>
Source : http://www.w3schools.com/html/html_quick.asp
Friday, October 7, 2011
set up QT with Visual Studio environment
http://qtnode.net/wiki/Qt4_with_Visual_Studio#Setting_up_your_environment
how to set windows environment variablehttp://www.itechtalk.com/thread3595.html
Environment Variables
In order to successfully use Qt three environment variables have to be setup: QTDIR, PATH and QMAKESPEC.In order to compile Qt, the QTDIR has to be set to point at the directory containing the Qt distribution.
i.e. C:\Source\Qt\4.7.3\
To be able to invoke the Qt tools from the command line the PATH variable needs to be set. Simply include %QTDIR%\bin at the end of your PATH on windows.
In order to use qmake properly, QMAKESPEC points at a directory holding file qmake.conf which describes the target environment to qmake. i.e. C:\Source\Qt\4.7.3\mkspecs\win32-msvc2008 (for visual studio 2008).
QMAKESPEC
qmake requires a platform and compiler description file which contains many default values used to generate appropriate Makefiles. The standard Qt distribution comes with many of these files, located in the mkspecs subdirectory of the Qt installation.The QMAKESPEC environment variable can contain any of the following:
- A complete path to a directory containing a qmake.conf file. In this case qmake will open the qmake.conf file from within that directory. If the file does not exist, qmake will exit with an error.
- The name of a platform-compiler combination. In this case, qmake will search in the directory specified by the mkspecs subdirectory of the data path specified when Qt was compiled (see QLibraryInfo::DataPath).
In summary, a cross-platform Qt project consists of the following files:
- A .vcproj file containing Windows-specific settings and listing the files in the project.
- A .pro file containing Unix and/or Mac OS X specific settings.
- A .pri file (a qmake include file) listing the files in the project.
qmake -tp vc -r xxxxxx.pro
Subscribe to:
Comments (Atom)