由买买提看人间百态

topics

全部话题 - 话题: float
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
w****r
发帖数: 245
1
大侠,分类都分好了,求神签
# Basic Materials, Agricultural Chemicals
AGU Agrium Inc.
AVD American Vanguard Corp.
CAGC China Agritech Inc.
CF CF Industries Holdings, Inc.
CGA China Green Agriculture, Inc.
CMP Compass Minerals International
COIN Converted Organics Inc.
IPI Intrepid Potash, Inc.
MON Monsanto Co.
MOS Mosaic Co.
NOEC New Oriental Energy & Chemical
POT Potas... 阅读全帖
t***q
发帖数: 418
2
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 天,如何能让程序转得快点?有包子。
发信站: BBS 未名空间站 (Fri Feb 27 23:26:22 2015, 美东)
天,如何能让程序转得快点?
原帖在这里:
http://www.mitbbs.com/article_t0/Programming/31381809.html
主要是要做 title matching.
有两个 file, file A 162283 行 X 12 列。 File B 3695 行 X 6 列。用 A 的 第五
列和 B的第四列进行比较, 对 B 的第四列的每一行, 从 A的 那 162283 行中 找出
与之最相似的那一行。A 的第五列和 B 的第四列都是些影视作品的 title, 是一些长
短不一的 string. 我用的是 Levenshtein algorithm 算每一对string 的相似度,再
把相似度排序,从高到低,找出相似度最大的那一个 string, 也就是影视作品的
title, ... 阅读全帖
t***q
发帖数: 418
3
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 天,如何能让程序转得快点?有包子。
发信站: BBS 未名空间站 (Fri Feb 27 23:26:22 2015, 美东)
天,如何能让程序转得快点?
原帖在这里:
http://www.mitbbs.com/article_t0/Programming/31381809.html
主要是要做 title matching.
有两个 file, file A 162283 行 X 12 列。 File B 3695 行 X 6 列。用 A 的 第五
列和 B的第四列进行比较, 对 B 的第四列的每一行, 从 A的 那 162283 行中 找出
与之最相似的那一行。A 的第五列和 B 的第四列都是些影视作品的 title, 是一些长
短不一的 string. 我用的是 Levenshtein algorithm 算每一对string 的相似度,再
把相似度排序,从高到低,找出相似度最大的那一个 string, 也就是影视作品的
title, ... 阅读全帖
b*******e
发帖数: 6920
4
Mardi Gras! Galveston Parade Schedule
Texas’ Largest Mardi Gras Celebration Comes With Parades, Family Gras and
More!
[January 10, 2013] - The 102nd celebration of Mardi Gras! Galveston will
take place February 1-12, 2013 with 24 parades, several of which are new.
The majority of parades will be held in Galveston's downtown Mardi Gras
entertainment district while others will travel along the beachfront on
Seawall Boulevard.
Friday, February 1, 2013
Party Gras! Parade, 5 p.m. (Entertainment Distr... 阅读全帖
r**********n
发帖数: 3914
5
这种FLOATS只有很少的鱼具店出售. 多数都是自家做的货. 价钱要$5/个, 不便宜. 关
键是买来的FLOATS不耐用, 甩几次就裂开了. 我的FLOATS都是自己加工的. 买Comal 4"
Pear Foam Floats, 自己加WEIGHTS, 2.5 或 3 OZ INLINE SINKERS, 视自己的需要.
我用16 GAUGE 铁线. 我做的FLOATS不会裂开, 砸到墙上石头上都不会裂开. 你可以从
下面的LINK 上买到这种FLOATS, 不要买WEIGHTED FLOATS.
http://www.crucialtackle.com/catalog/item/6851215/6807645.htm
R*****s
发帖数: 41236
6
☆─────────────────────────────────────☆
forestking (life is beautiful) 于 (Tue Jun 7 14:44:49 2011, 美东) 提到:
以前是跑长跑的,不带劲。
后来发现反复冲刺体会肌肉横飞脚下有劲儿的感觉也很爽啊。
☆─────────────────────────────────────☆
whxhm1 (whxhm) 于 (Tue Jun 7 14:58:40 2011, 美东) 提到:
听上去是牛人,分享一下以前的训练吧。

☆─────────────────────────────────────☆
Rodimus (变叔- 阳光总在风雨后) 于 (Tue Jun 7 15:05:55 2011, 美东) 提到:
很多跑5K的啊, 你5K成绩多少?
☆─────────────────────────────────────☆
forestking (life is beautiful) 于 (Tue Jun 7 15:17:23 2011, 美东)... 阅读全帖
H****w
发帖数: 1632
H****w
发帖数: 1632
8
来自主题: Swimming版 - 学自由泳,如何开始?
BASIC FRONT CRAWL/FREESTYLE. LESSON
The pool water level should be between waist high and chest high
This informal lesson plan should be adjusted according to the skill and
progress of each individual
Please ensure playing/practice time at the end of lesson for the
children so
it is not all work and no play
Google any terms that you are not familiar with so you know what it
looks it.
Holding Breath:
Both arms holding on the side of the pool
>Blow bubbles with lips in the water (5 times)
>Blow bu... 阅读全帖
h*******s
发帖数: 3932
9
来自主题: TexasHoldem版 - [合集] 讨论一手以前打的live 牌
☆─────────────────────────────────────☆
player (Hope is the best thing) 于 (Mon Nov 21 15:26:29 2011, 美东) 提到:
5/10 NL. Very loose game and lots of action. A few guys sat down with 10+
K.
I played a super nitty game with shortstack(starting with 1k) at the table
and tried to not getting involved with many pots.
Then this hand came out: I was at SB with 1.8k, there were two limpers,
including button with very big stack. I looked my hand and I got KK. So I
made 100$ to go out of SB, B... 阅读全帖
l********a
发帖数: 1154
10
来自主题: Programming版 - 请教一道c/c++题
谢谢回复.我的问题是这样的,例如一个文件写了
10 5表示是10*5的矩阵
下面是50个float
读取的时候先getline得到10和5,然后调用我的函数
float **initMat(int m, int n)生成10*5的二维矩阵,返回指针**
这个函数内部大概是:
float **initMat(int m, int n)
{
float **mat = new float*[m];
for (int i=0;i {
m[i] = new float[n];
for (int j=0;j m[i][n] = 0.0;
}

return mat;
}
然后这个返回的数组我整个程序都有用,在程序结束有个专门的free函数
void freeMat(float **mat, int m)
{
for (int i=0;i if(mat!=NULL) d... 阅读全帖
t***q
发帖数: 418
11
天,如何能让程序转得快点?
原帖在这里:
http://www.mitbbs.com/article_t0/Programming/31381809.html
主要是要做 title matching.
有两个 file, file A 162283 行 X 12 列。 File B 3695 行 X 6 列。用 A 的 第五
列和 B的第四列进行比较, 对 B 的第四列的每一行, 从 A的 那 162283 行中 找出
与之最相似的那一行。A 的第五列和 B 的第四列都是些影视作品的 title, 是一些长
短不一的 string. 我用的是 Levenshtein algorithm 算每一对string 的相似度,再
把相似度排序,从高到低,找出相似度最大的那一个 string, 也就是影视作品的
title, 加到 file B 对应的那一个title 那一行。再加入一个从file A 出来的对应的
一个id, 到 file B 里。算相似度前,我先对每个title 组成的string做预处理,去掉
“:”,”-“,”season”,”episode “ , 等一些词。... 阅读全帖
a********r
发帖数: 92
12
来自主题: Computation版 - numeric recipe code amotry(), bug or not
in function amotry() for downhill simplex minimization,
why fac2=fac2=fac1-fac; instead of fac2=-fac;
then this may not be a reflection or extrapolation, because
ytry[j] = center * (1-fac) + p[ihi][j]*face - (1-fac)/ndim * p[ihi][j]
the first two terms is the extrapolation, what's the point for the 3rd term?
It will be incorrect in some case, reflection will not be reflection anymore.
float amotry(float **p, float y[], float psum[], int ndim,
float (*funk)(float []), int ihi, float fac)
Extrapo
g****t
发帖数: 31659
13
我记错了,应该是1/sqrt(x)的算法. 2005年Quake III源代码放出来之后传开的.
这个代码,(按wiki上说的),我感觉最神奇的地方:
(1)0x5f3759df怎么来的? 现在还是不清楚.
(2)具体谁写的,不清楚
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point
bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ... 阅读全帖
B********n
发帖数: 7009
14
哥免费教育你一下,希望你看得懂英文。
Floating Rate
A currency whose value is determined by the free market. That is, the value
of a floating currency changes constantly depending on the supply and demand
for that currency, as well as the amount of the currency held in foreign
reserves. An advantage to a floating currency is that it tends to be more
economically efficient. However, floating exchange rates tend to be more
volatile depending on the particular currency. A floating currency may
undergo currency apprec... 阅读全帖
D***n
发帖数: 6804
15
那破代码算鸟,这个呢?
float InvSqrt(float x)
{
float xhalf = 0.5f * x;
int i = *(int*)&x; // get bits for floating value
i = 0x5f375a86 - (i >> 1); // gives initial guess y0
x = *(float*)&i; // convert bits back to float
x = x * (1.5f - xhalf * x * x); // Newton step, repeating increases
accuracy
return x;
}
f*******t
发帖数: 7549
16
来自主题: JobHunting版 - 写了个sqrt,请点评
float sqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point
bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can
be rem... 阅读全帖
g**e
发帖数: 6127
17
来自主题: JobHunting版 - Amazon onsite 面经
重新再学习一下
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can
be removed
#ifndef Q3_VM
#ifdef __linux__
assert( !isnan(y) )... 阅读全帖
p*****p
发帖数: 379
18
来自主题: JobHunting版 - 这题就够凶残的了吧
刚写了个,上个部分代码
private enum Direction {LEFT, RIGHT, UP, DOWN};
private static float getCurrentPathMax(int currentRow, int currentCol, int[]
[] maze, int[][] visited, Direction lastStep) {
int rows = maze.length, cols = maze[0].length;

if (currentRow < 0 || currentRow >= rows || currentCol < 0 || currentCol
>= cols) {
return -1;
}

if (maze[currentRow][currentCol] == 0) {
// blank
if (visited[currentRow][currentCol] == 3) {
return 0;
... 阅读全帖
w*******2
发帖数: 35
19
题目是这样的:You are required to use loops, decision making constructs and
static functions to write your program. Depreciation to a salvage value of 0
For tax purposes an item may be depreciated over a period of several years,
n. With the straight line method of depreciation, each year the item
depreciates by 1/nth of its original value. With the double-declining method
of depreciation, each year the item is depreciates by 2/nths of its value
at the beginning of the year. (in the last year it is depr... 阅读全帖
a*****f
发帖数: 6
20
leetcode上ValidNumber这道题有点烦,因为它的需求不明确
试了很多次,下面的代码通过了测试,供参考
public class Solution {
enum Token {Empty, Sign, Float, Int, IntWithSign, Invalid};

int findFirst(char[] s, char c, int p1, int p2) {
for (int i = p1; i <= p2; i ++)
if (s[i] == c) return i;

return -1;
}

int findLast(char[] s, char c, int p1, int p2) {
for (int i = p2; i >= p1; i --)
if (s[i] == c) return i;

return -1;
}

Tok... 阅读全帖
S****S
发帖数: 923
21
二楼的subfloor我不知道怎么弄平,以为用那个underlayment就不会有什么问题,现在
看来效果不太好。不平的话,还是很明显。
float on和nail down的效果肯定有差,而且比较明显。我弄了半个房间float on,走
上去感觉整块地板有点会动,没有那种solid感,我现在倒是有点担心这样float on的
地板受不受得起床的重量。不知道谁家有float on 的说来听听。
一楼的水泥板也是不平的,因为是位于row house 的中间,房子中间有裂痕,很多地方
也是不平的了,但要用level compound来弄的话我又觉得太大工程了,自己未必能吃得消
原计划是二楼float on,如果效果可以,一楼也float on,但现在看来好像不太行啊,
我是不是应该做完一个房间再说呢?
I*********e
发帖数: 65
22
您的想法是对的,原因如下:
1. 现在的降幅还远不到能够float down的情况,何况有的lender就没有float down的
option。
2. 如果到了能够float down的情况而且lender又有这个option的话, 肯定会愿意给您
float down的, 这种情况下的float down 对Loan Officer没有任何损害,而对客户有
利, Loan Officer何乐而不为呢?
3. Lock利率是Loan Officer/Lender和客户之间的contract,只要Loan Officer在锁定
之前是得到客户允许的, 而且对客户讲明白了Lock后的情况, 譬如可以不可以float
down等,那么Lock以后双方都是应该遵守这个合约的。 因为没有人可以预知利率市场
是升是降,客户也不希望Loan Officer在利率上升的情况下告诉客户这个贷款没锁住吧
?所以解决这个问题很简单, 就是大家都站在对方的立场想一想, 不要为了自己的小
利而损害对方的利益。
j******e
发帖数: 294
23
These stocks have some common characteristics going into earning report:
1. Strong fundamental/earning trend.
2. Top institutional ownership
3. strong technical uptrend/near 52 wk highs
4. A rising stock market with good investor sentiment
5. high short interests - I found this is the most dangerous factor for shorts:
NFLX - 35% Short % of Float
CMG - 14% Short % of Float
RVBD - 10% Short % of Float
LCC - 18% Short % of Float
ATHN - 34% Short % of Float
BJRI - 26% Short % of Float
People(other t... 阅读全帖
r*****t
发帖数: 7278
24
CHARLOTTE, N.C., Oct 04, 2011 (BUSINESS WIRE) -- Bank of America Corporation
today announced the Board of Directors has authorized dividends on
preferred stock.
A quarterly cash dividend of $0.38775 per depositary share on the 6.204
percent Non-Cumulative Preferred Stock, Series D, is payable on December 14,
2011 to shareholders of record as of November 30, 2011.
A quarterly cash dividend of $0.255560 per depositary share on the Floating
Rate Non-Cumulative Preferred Stock, Series E, is payable ... 阅读全帖
t*******l
发帖数: 3662
25
来自主题: Stock版 - short interests
Short interests
Z: 32% short float … average 5 days to cover.
GTAT: 30.5% short float … 5 days to cover
SCTY: 30.1% short float … 1 day to cover
GOGO: 28.7% short float … 5 days to cover
GPRO: 0% short float ...
这种short float比例特别大,是不是暗示表示一旦有short squeeze
就会有段时间的pump and dump?
m*****a
发帖数: 2609
26
来自主题: Boston版 - 分享我的refinance经验
昨天房子close了,趁着新鲜写点心得,去年本来想买房后就写的,但人懒就拖得不了
了之了。本文供跟我一样第一次Refinance的参考。本文另一个动机是特别要感谢chem
。No,我不是chem排来的托,甚至她都没让我发这篇文章。但是我觉得还是要说说。
BTW, 可能让你奇怪的是我最终并没有经过chem做这次refi loan。如果你不喜欢看过程
,直接跳过去看我的结论。
去年7月底买的房子,当时利率不好,4.25%。我这里说的都是no point, no close
cost 30-yr mortgage loan,我想也是版上大部分人的自然选择。顺便说下买房时机很
不好,自从我买了房子,房价上涨就开始下降了。。。
1月初,一个跟差不多一起买房的背景类似的同事跟我谈起他在refinance,利率只有3
点几,我就心动了。先给买房的mortgage broker打,结果告知能拿到4.0%,问了一下
同事用的loan officer(一个local community bank,也是我最终选择做refinance
loan的这家,但不是一帆风顺的,接着往下看),说能拿到3.75%,确认买... 阅读全帖
s******0
发帖数: 78
27
来自主题: SanFrancisco版 - 求圣诞弯区附近驾车游建议~~

发信人: berg2007 (berg), 信区: SanFrancisco
标 题: 台胞着的,写的不错,谁有兴趣组织一一遍历? (转载)
发信站: BBS 未名空间站 (Sun Oct 31 14:19:31 2010, 美东)
11. San Francisco
San Francisco旧金山最早由西班牙人建立,快速成长于十九世纪中的淘金热中,二十
世纪初的大地震曾经对这个城市造成毁灭性的打击,后来又迅速复甦,是美国西岸最有
文化历史,被誉为世界最美丽城市之一。Skyline城市地平线是举世闻名景色。旧金山
也是被认为是最有欧洲风味的美国城市,彷彿与外界隔绝般,在山与海的环抱下,金门
大桥与环美金字塔耸立着,叮当车行驶在丘陵起伏的地面,维多利亚式房屋和中国城形
成最主要特征。
矗立在海湾的橘色Golden Gate Bridge金门大桥,背景一面是完全的山,而另一面是高
耸的城市,那样完美镶合一起,当从城市内丘陵起伏的地形,往海边俯冲而下时,忍不
住让人赞叹不已。这样一个美丽的城市,拥有独特地标建筑,半岛地形三面环海,海外
又有山,是美国最适合无车自助旅行的几个城市之一。不... 阅读全帖
t***q
发帖数: 418
28
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 如何用python web.py web service 做 multiple parameters 的 call?
发信站: BBS 未名空间站 (Sun Mar 22 23:14:33 2015, 美东)
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
import web
import csv
import difflib
import re
import operator
import Levenshtein
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
... 阅读全帖
s*****i
发帖数: 5548
29
☆─────────────────────────────────────☆
xie91 (bob) 于 (Mon Mar 4 19:12:18 2013, 美东) 提到:
发信人: kylin1996 (kylin), 信区: SanFrancisco
标 题: Re: 再谈德州经验 (转载)
发信站: BBS 未名空间站 (Mon Mar 4 17:16:16 2013, 美东)
看见有人说湾区收入高就笑了,给你们科普一下,猴子屯,13-15w年薪非常普通,20w
以上的一大把,加上公司100% match 6-12% 401k, 公司服务到退休有一次性上百万的
pension,还有一周工作四天一周工作五天,每年5周vacation,加州风景再美,这些能
比吗?
☆─────────────────────────────────────☆
delubo (I shall be your eyes!) 于 (Mon Mar 4 19:13:42 2013, 美东) 提到:
求介绍工作,我要跳槽
☆────────────────────────────... 阅读全帖
i*****s
发帖数: 15215
30
来自主题: CanadaNews版 - 温哥华断脚案新闻汇总
Canada’s Severed-Feet Mystery
Sep 4, 2011 10:00 AM EDT
Since 2007, 11 human feet have washed up on the shore near British Columbia
—and no one knows why. Winston Ross on the spooky case that has authorities
grimacing.
Just before suppertime on Tuesday, someone spotted a human foot, attached to
a leg and encased in a running shoe, bobbing in False Creek, which divides
downtown Vancouver from the rest of the city.
As the creek is made up of the four different waterways that encircle this
British C... 阅读全帖
l*******e
发帖数: 6436
31
☆─────────────────────────────────────☆
KV (从善如流,敢做敢当) 于 (Fri Apr 5 23:15:08 2013, 美东) 提到:
用什么饵比较好?
抽jerkbait?tube?soft swimbait?毛jig?
明天和几个大陆高手在upstate NY某湖切磋钓大小嘴,不想钓的糟糕,丢北美同志们的
脸,看到这个帖子,给点建议。临时磨枪,不知道灵不灵。鱼版同志们有经验的也给点
建议。
多谢。
☆─────────────────────────────────────☆
liuyanghe (老刘) 于 (Fri Apr 5 23:44:00 2013, 美东) 提到:
我附近的大湖这阵找大小嘴的基本是两类饵,一个是suspend的jerk bait,另外是
inline spinner
☆─────────────────────────────────────☆
WillyBass (微粒鲈) 于 (Fri Apr 5 23:44:11 2013, 美东) 提到:
水温低于50度是很有难度的... 阅读全帖
S**********s
发帖数: 4534
32
来自主题: GunsAndGears版 - 关于浮动枪管, 一点不解
Can't agree with that.
If that count as free float, then M14 is also free float, hell, even 1911s
will be free float.
This is a perfect example of free floating barrel. Nothing touches the
barrel, period.
This is another perfect example of free floating barrel
A folded dollar bill can be slided all the way down to the bore to confirm
that there's is space between the stock and barrel. The stock also has to be
rigid enough so that the weight of the gun will not bend the forearm to
touch the barre... 阅读全帖
j***y
发帖数: 5098
33
☆─────────────────────────────────────☆
Regina (猫宝宝) 于 (Mon Jul 4 03:04:48 2011, 美东) 提到:
体重降到110磅以内了,但是两腿膝盖都疼,是不是在水泥路上跑的缘故?
☆─────────────────────────────────────☆
dathinker (思考者) 于 (Mon Jul 4 08:29:57 2011, 美东) 提到:
每天一万二什么东西?一万两千麦?
其实膝盖痛的原因可能很多
比如跑姿不对,过劳损,受了寒凉,以及cushion不够等等
还要问问是觉得神经痛那种如针扎似的痛,还是有些肿的那种肿痛?
多说说症状比较好分析

☆─────────────────────────────────────☆
Regina (猫宝宝) 于 (Mon Jul 4 13:21:30 2011, 美东) 提到:
每天1万两千米,大约是7.5迈
是那种肿痛,腿外侧和膝盖肿痛的那种痛。
☆─────────────────────────────────────... 阅读全帖
q*c
发帖数: 17993
34
☆─────────────────────────────────────☆
qmc (qmc) 于 (Thu May 20 01:26:09 2010, 美东) 提到:
http://www.willisskiandboard.com/Wil/pages/Rocker%20Skis%20and%
Every few years an evolutionary shift happens in the world of snow sports.
When snowboarding was first born it changed the industry forever. Shaped
skis had a similar impact and now Rocker Technology has impacted the slopes
by creating a whole new way to relate to the mountain.
To fully understand Rocker Technolgy and how it has effected sk... 阅读全帖
h*******o
发帖数: 4884
35
来自主题: Apple版 - 贴个换SSD 前后的XBENCH对比吧
原来是原装的希捷的硬盘250G
换了OWC SSD Mercury Extreme Pro 的240G,总体印象是没有想像中的那么快,可能是
因为我不是clean install,用得superduper直接的硬拷贝,所以SSD上的系统不是很干
净 ,但是也提升了不少,尤其是launch illustrator/photoshop之类的时候
原来的开机,菊花转25圈半,现在是2圈半,从休眠里起来提升不明显。另外,目前为
止还没有遇到休眠以后唤醒不了的问题
换了SSD以后的374 分数和我late 2009 i7的imac一样了
374+OWC SSD
Results 210.70
System Info
Xbench Version 1.3
System Version 10.6.5 (10H574)
Physical RAM 8192 MB
Model MacBookPro7,1
Drive Type ... 阅读全帖
R*******y
发帖数: 19
36
来自主题: BuildingWeb版 -






....


CSS文件中:
#content
{
float: right;
background-color: blue;
width: 100px;
}
本意是想:content用几个
形成了float在右边的一个蓝块,既然content是嵌在
page里的,那么page也会相应的往下伸展(形成容器状包住这个蓝块)。但结果是:
page并没有往下伸展,看到的效果,是蓝块超出了page的范围,叠在它上面。
附:截图(青色即是page层,蓝色是content层)
如果我去掉了float: right这个属性,就正常了。
我觉得很纳闷,在网上看到的另一个也用了float的模板中,经实验,page的度度是会
随着content的长度而变化的,也就是page始终是包在content外面的,并且它也是用了
float的。
因为网上那个模板比较复杂,我不知道加入了什么特殊的语句,使得float之后不会出
现我说的这种情况。请
t***q
发帖数: 418
37
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 如何用python web.py web service 做 multiple parameters 的 call?
发信站: BBS 未名空间站 (Sun Mar 22 23:14:33 2015, 美东)
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
import web
import csv
import difflib
import re
import operator
import Levenshtein
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
... 阅读全帖
f***e
发帖数: 17
38
来自主题: Database版 - PL/SQL function 使用求教?
我要计算两点间距离,需要用到built-in function POWER and SQRT,
下面的code 该如何调用这些函数修改?
create or replace type Point as object(
X float,
Y float
);
/
create or replace type Line as object(
SP point,
EP point,
member function length return FLOAT, /* get line length */
pragma restrict_references(length,WNDS,WNPS)
);
/
create or replace type body Line as
member function length return FLOAT is
dx float; -- x direction distance square
dy float; -- y direction distance squa
y****n
发帖数: 15
39
来自主题: Programming版 - 一个OpenMP问题求教
有一个关于openmp的问题想请教各位大牛。原始程序(如A)需要分配一个临时数组再释
放。用OpenMP改成并行实现后(如B),不同线程不能共享这个数组,每个线程需要独立
分配这段内存。
如果在循环体内分配内存,那一共分配了nk=121次,效率很低。实际上如果存在4个线
程,只要在每个线程中分配一次就行了。不知道应该如何实现,请大牛们指点。
非常感谢。
-------------------------------------
Program A:
-------------------------------------
float* pfSdx = (float *) calloc( N );
for (int k = 0; k < nk; k++)
{
...
}
free( (float *) pfSdx );
-------------------------------------
Program B:
-------------------------------------
#pragma omp parallel for
for (int k = 0; k < ... 阅读全帖
t***q
发帖数: 418
40
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
import web
import csv
import difflib
import re
import operator
import Levenshtein
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
self.hello = "hello world"
def GET(self):
getInput = web.input(name="World")
b=[]
with open("Book1.txt","rb") as k:
for row in k:
... 阅读全帖
l**********r
发帖数: 79
41
这个跟return type 无关, 你这是典型的c思维写java代码。 但是java 有一个神器,
就是包装。
package microbenchmark;
import java.util.InputMismatchException;
import java.util.Scanner;
public class SC {
Objects obje;
public SC(){
obje=new Objects();
}
private class Objects{
float fn=0;
float sn=0;
public Objects(){
fn=0;
sn=0;
}
public void setFN(float value){
fn=value;
}
public void setSN(float value){
sn... 阅读全帖
L******f
发帖数: 5368
42
来自主题: Military版 - 美国政府会救两房债卷吗?
我给你科普一下吧。自己读吧。
翻译我就没耐心了。
Characteristics of Fannie Mae Debt Securities
Fannie Mae issues a variety of debt securities with maturities across the
yield curve to fulfill its ongoing funding and rebalancing needs for the
mortgage portfolio. Fannie Mae issues both short-term debt with maturities
of a year or less and long-term debt with maturities of over a year.
Typically, Fannie Mae debt can either be callable or noncallable. In recent
years, additional structures and features have been added in r... 阅读全帖
YX
发帖数: 21
43
Eight things to do in a sinking car
(from: http://www.wikihow.com/Escape-from-a-Sinking-Car)
http://www.howcast.com/videos/117114-How-to-Escape-a-Car-Sinkin
http://www.youtube.com/watch?v=UZuZgSQZJ9g&feature=player_embed
Any car accident is frightening, but an accident in which your vehicle is
thrown into the water, with you trapped inside, is absolutely terrifying.
Such accidents are particularly dangerous due to the risk of drowning and in
Canada alone, 10 percent of drowning deaths can be att... 阅读全帖
l******h
发帖数: 2
44
Highly reputational company with very competitive compensation for all
positions.
Please send in your resume and position/positions you like to apply to my
email address below.
h*******[email protected]
All resumes will be deliver to hiring manager directly. Act fast!
Thanks!
Silicon Engineering Group
Sr. Physical Design Timing Engineer
Timing (STA) Manager
Senior Physical Design Engineer
CAD Manager - Front-End Design and Verification
Sr. CAD Engineer - Place & Route / Physical Design Engineer
Sr. CA... 阅读全帖
p*********a
发帖数: 21
45
来自主题: JobHunting版 - 算法题求助
这个方法应该是已知的32位计算机上收敛最快的牛顿弦切法. 当然你可以多叠代几次,
不过一两次的叠代精度已经足够用了. 来自以前我在国内经常玩儿的Quake的源代码.
// Magical Square Root Implementation In Quake III
float SquareRootFloat(float number) {
long i;
float x, y;
const float f = 1.5F;
x = number * 0.5F;
y = number;
i = * ( long * ) &y;
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
y = y * ( f - ( x * y * y ) );
y = y * ( f - ( x * y * y ) );
return number * y;
}
z*********8
发帖数: 2070
46
来自主题: JobHunting版 - 问个问题 求sqrt
为什么不用迭代法呢?
看看游戏Quake里面的算法吧:
float SquareRootFloat(float number) {
long i;
float x, y;
const float f = 1.5F;
x = number * 0.5F;
y = number;
i = * ( long * ) &y;
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
y = y * ( f - ( x * y * y ) );
y = y * ( f - ( x * y * y ) );
return number * y;
}
g*********8
发帖数: 64
47
来自主题: JobHunting版 - 收到G家拒信,发面经
sqrt那道题,可以用
http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#
编程很简单
float sqrt(const float m){
float i=0;
float x1,x2;
while( (i*i) <= m )
i+=0.1f;
x1=i;
for(int j=0;j<10;j++)
{
x2=m;
x2/=x1;
x2+=x1;
x2/=2;
x1=x2;
}
return x2;
}
当然这个是float,不过改成int,应该不难
S**I
发帖数: 15689
48
来自主题: JobHunting版 - [合集] 收到G家拒信,发面经
☆─────────────────────────────────────☆
recursive (递归) 于 (Mon Apr 11 10:56:49 2011, 美东) 提到:
大半夜收到HR的thank you note。不用管什么NDA了
本人ECE fresh PhD,背景是电路/EDA,跟G业务基本没什么关系
同学内部推荐的,很简单的一次电面就给了onsite
题都不难,但是自己没把握好机会,出了一些小bug。
总的感觉,出错就是硬伤,宁可从最简单的算法写起,也不能出错。
电面:
1,Skip list, http://en.wikipedia.org/wiki/Skip_list
写code实现struct skip_list * find(struct skip_list *head, int value)
2,sorted array with repeated elements
for given element, find out its range.
e.g. A A B B B B B C C D D E F G, given B, the out... 阅读全帖
s*********s
发帖数: 140
49
贴个java recursive的吧。
float compute(String exp) {

if(exp == null || exp.length() == 0) return 0;

int plusPos = exp.indexOf('+');
int minusPos = exp.indexOf('-');

if(plusPos < 0 && minusPos < 0) return convert(exp);

if(plusPos < 0 || (minusPos > 0 && minusPos < plusPos))
return convert(exp.substring(0, minusPos)) - compute(exp.
substring(minusPos+1));
if(minusPos < 0 || (plusPos > 0 && plusPos < minusPos... 阅读全帖
s*********s
发帖数: 140
50
贴个java recursive的吧。
float compute(String exp) {

if(exp == null || exp.length() == 0) return 0;

int plusPos = exp.indexOf('+');
int minusPos = exp.indexOf('-');

if(plusPos < 0 && minusPos < 0) return convert(exp);

if(plusPos < 0 || (minusPos > 0 && minusPos < plusPos))
return convert(exp.substring(0, minusPos)) - compute(exp.
substring(minusPos+1));
if(minusPos < 0 || (plusPos > 0 && plusPos < minusPos... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)