由买买提看人间百态

topics

全部话题 - 话题: buffered
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
h****k
发帖数: 182
1
来自主题: Chemistry版 - 请教个配置缓冲buffer 的问题
请教一下化学系的同学。配制50mM Citrate buffer (pH3.0) 的时候,网上写的是按比
例混合 50mM citric acid monohydrate (C6H8O7•H2O FW=210.14) ,and 50mM
trisodium citrate dihydrate (C6H5O7Na3•2H2O FW=294.12) . 我想问如果不
按网上写的,从citric acid monohydrate开始配,然后再加酸HCl或者碱NaOH 调到pH3
.0 这样配出来的和网上写的是一样的吗?
y*****s
发帖数: 1047
2
来自主题: Chemistry版 - 请教一个关于buffer的问题 (转载)
盐浓度是指要平衡渗透压?需要算所有的溶质
buffer strength是指缓冲的能力要足够,只算缓冲的离子 分子浓度
f*****0
发帖数: 489
3
来自主题: EE版 - unity gain buffer design疑问
you are likely experiencing slew rate limiting. essentially the amp isn't
fast enough for your singal.
if 0db is all you need, try a diamond buffer (four transistors), or buf634/
opa551 or their equivalent (buf634 is out of production i think).
s********k
发帖数: 6180
4
上下行难道buffer也是分开的?而不是shared?我主要关注的还是下行吧。我对3G不是
太熟,哪位熟悉协议的给说说。我也不知道在哪里查协议。
s****o
发帖数: 21
5
来自主题: EE版 - 请问电路中buffer的作用
It is a common way to insert the buffers in the chip design. It is used to
increase the driving capability and reduce the time delay.
d****2
发帖数: 26
6
【 以下文字转载自 Chemistry 讨论区 】
发信人: dajia2 (dajia), 信区: Chemistry
标 题: Using buffer solution to measure pH data in solutions.
发信站: BBS 未名空间站 (Sun Jul 19 21:23:28 2009, 美东)
Using the solution stabilized with 1 micro M melamine to assay the melamine
with the concentration in nano M range.
in
Hydrogen-Bonding Recognition-Induced Color Change of Gold Nanoparticles for
Visual Detection of Melamine in Raw Milk and Infant Formula
Kelong Ai, Yanlan Liu and Lehui Lu
pp 9496–9497
Publication Date (Web): June
m***z
发帖数: 166
7
【 以下文字转载自 Biology 讨论区 】
发信人: mengz (雕刻时光), 信区: Biology
标 题: 0.1 M carbonate/bicarbonate buffer (pH 8.5)怎么配
发信站: BBS 未名空间站 (Mon Mar 12 21:35:08 2007)
多谢 google不到。
R*j
发帖数: 248
8
先选缓冲对:NaHCO3 和 Na2CO3;HCO3- 的PKa是10.25;
设 NaHCO3 和 Na2CO3 的终浓度为 A 和 B;
列两个方程:
8.5 = 10.25 + log(B/A) -------------> H-H equation
0.1 = A + B
剩下该怎末办就不用再说了吧。要QS的时候用其他酸碱微调pH倒8.5
虽说你是生物专业,这点化学基础也要有吧?不过也难怪,美国实验室都买buffer.没
人配了。
r****x
发帖数: 1250
9
preparing buffer based on an equation is a theoretical way, but 95% of the
time you won't get the pH right and will have to adj the pH at the end.
one practical way, might be kind of complicated for the first time, could
get exact pH (+/-0.05) easily, as long as your pH meter is calibrated right
every time.
Example:
0.1 M Na2CO3 and 0.1 M NaHCO3, 500 mL each
measure pH of each
take 100 mL of either one (preferably the one with pH closer to your target)
start titrating with the other one, to the
w*******y
发帖数: 60932
10
Link:
http://www.mwave.com/mwave/SKUSearch_v3.asp?px=DS&scriteria=AA76289&pagetitle=TRENDNET TEG-S80G 10/100/1000Mbps GREENnet Switch 8 x RJ45 4K MAC Address Table 128KBytes Buffer Memory
w*******y
发帖数: 60932
11
Costco has the Hitachi Deskstar 1TB Internal Hard for 49.99 today.
Link:
http://www.costco.com/Browse/Product.aspx?Prodid=11599206&cm_re
General Features:
1 Terabyte (TB) formatted capacity
Serial ATA/300 interface
300 MB/s data transfer rate
7200 RPM spindle speed
32 MB buffer
3.5-inch form factor
Halogen-free design for eco-friendly footprint
Advanced power management and HiVERT technology
Thermal Fly-height Control (TFC)
ECC and CDC protection
Smart command transport
Internal thermal sensor
A... 阅读全帖
A**u
发帖数: 2458
12
import java.util.*;
import java.util.concurrent.locks.*;
public class PC_unsyn
{
public static void main(String[] args)
{
IntBuffer b = new IntBuffer();
Producer p = new Producer(b);
Consumer c = new Consumer(b);
p.setName("Producer");
c.setName("Consumer");
p.start();
c.start();
}
}
class IntBuffer
{
private int index;
private int[] buffer = new int[8];
private Lock bufferLock = new ReentrantLock();
private Cond... 阅读全帖
A**u
发帖数: 2458
13
【 以下文字转载自 Java 讨论区 】
发信人: Augu (奥古), 信区: Java
标 题: 求教一个Java问题 IllegalMonitorStateException
发信站: BBS 未名空间站 (Tue Dec 11 11:31:48 2012, 美东)
import java.util.*;
import java.util.concurrent.locks.*;
public class PC_unsyn
{
public static void main(String[] args)
{
IntBuffer b = new IntBuffer();
Producer p = new Producer(b);
Consumer c = new Consumer(b);
p.setName("Producer");
c.setName("Consumer");
p.start();
c.start();
}
}
class Int... 阅读全帖
s******y
发帖数: 28562
14
Polysome purification and fractionation
(Based on Davies & Abe, 1995, Methods in Cell Biology, Vol 50, Chapter 15)
1. Prepare 4.6ml 15-60% sucrose gradients in 5ml polyallomer tubes (Beckman
#326819) by
pipetting 2.3ml of 60% sucrose in buffer B followed by 2.3ml of 15% sucrose
in buffer B
(slowly, drop by drop, against the wall). Cap the tubes with rubber stoppers
and lay tubes
horizontally for 3h @RT for sucrose to diffuse (or for 2h if making 10-40%
gradient). Place the
tubes again vertically... 阅读全帖
s********u
发帖数: 1109
15
来自主题: JobHunting版 - ebay skype interview面经(4轮)
挖个坟,这个readline的题目,搜了一下,好像应该是这个意思吧:
用一个buffer来存字符流,如果中间有换行,那么将这一行返回成一个字符串输出,但
是这个buffer里面的东西继续保留,下次readline()再输出;
如果一行非常长,那么可能需要用到几次read(),来拼出这个完整的line。
/*Implement a function char* readLine(); which returns single lines from a
buffer.
To read the buffer, you can makes use of a function int read(char* buf, int
len) which fills buf with upto len chars and returns the actual number of
chars filled in. Function readLine can be called as many times as desired.
If there is no valid data or newline ter... 阅读全帖
a*********i
发帖数: 86
16
国人哥们主面, 小印跟班. 面Backend infra
给了一道这样的题
/*
Question Description: You are to write an abstraction layer for a persistent
buffer. Provide an implementation of the following abstract class:
*/
public abstract class pBuffer {
protected final int BLOCK_SIZE = 1024;
protected final int BLOCK_COUNT = 1024;
protected byte[] buffer = new byte[BLOCK_COUNT * BLOCK_SIZE]; // A sample
1mb buffer, to be allocated in 1k chunks.
public pBuffer() {
fillBufferFromFile(); // Reads the buffer from file an... 阅读全帖
c*********l
发帖数: 3438
17
【 以下文字转载自 JobHunting 讨论区 】
发信人: advancedhei (高级嘿), 信区: JobHunting
标 题: 刚刚和L的同胞电面完, 觉得是个很好的故事
发信站: BBS 未名空间站 (Thu May 14 14:25:31 2015, 美东)
国人哥们主面, 小印跟班. 面Backend infra
给了一道这样的题
/*
Question Description: You are to write an abstraction layer for a persistent
buffer. Provide an implementation of the following abstract class:
*/
public abstract class pBuffer {
protected final int BLOCK_SIZE = 1024;
protected final int BLOCK_COUNT = 1024;
protected byte[] buffer = new byte[BLOCK_COUNT * BLOCK_... 阅读全帖
c*********l
发帖数: 3438
18
【 以下文字转载自 JobHunting 讨论区 】
发信人: advancedhei (高级嘿), 信区: JobHunting
标 题: 刚刚和L的同胞电面完, 觉得是个很好的故事
发信站: BBS 未名空间站 (Thu May 14 14:25:31 2015, 美东)
国人哥们主面, 小印跟班. 面Backend infra
给了一道这样的题
/*
Question Description: You are to write an abstraction layer for a persistent
buffer. Provide an implementation of the following abstract class:
*/
public abstract class pBuffer {
protected final int BLOCK_SIZE = 1024;
protected final int BLOCK_COUNT = 1024;
protected byte[] buffer = new byte[BLOCK_COUNT * BLOCK_... 阅读全帖
g*********5
发帖数: 2533
19
来自主题: Biology版 - 核蛋白的Co-IP的 Protocol
Isolation of nuclei for the co-IP and whole ChIP protocols is based on the
methods of Gendrel et al. (2002, 2005), Johnson et al. (2002), and Nelson et
al. (2006).
METHOD
For extraction and co-IP of nuclear proteins, see Steps 1-39 (Fig. 1). For
the ChIP procedure, see Steps 40-69 (Fig. 2).
Figure 1.
View larger version:
In this page
In a new window
Figure 1.
Flowchart for the timeline and organization for co-IP of nuclear proteins
from Arabidopsis seedlings.
Figure 2.
View larger versio... 阅读全帖
c**y
发帖数: 73
20
来自主题: JobHunting版 - 新鲜夫家onsite面经
1. 大数乘法
给定两个非常大的数,写出一个函数返回它们的乘积。可以自己定义需要用到的数据结
构来表示每个数。我用了vector。
2. 系统设计的问题。
给定一个数据中心,如何收集statistics在给定的时间范围(t0,t1)。
这是系统设计题,没啥代表性。
3. 给定一个点,找出一百万个点中距离这个点最近的k个点。
用heap来存当前最近的k个点,然后scan这一百万个点一遍。
4. 给定一个函数fetch10k(),要求实现另外一个函数fetch()。这个题的说明比较复杂
,最后没有写完。具体说明如下。
fetch10k()是给定的,signature如下。
int fetch10k(char *buffer)
这个函数干的事情是从底层读出数据,写到传入的buffer中。这个buffer是一个默认
10k bytes大小的空buffer。返回类型int,返回写入后buffer中数据的size。
注意返回的数据大小和底层的数据大小有关。如果底层数据size是0,那么返回也是0,
因为buffer里什么也没有写。
如果底层数据是小于10k,例如5k,那么返回值是5k,因为只有5k... 阅读全帖
S***8
发帖数: 13
21
来自主题: JobHunting版 - FB 面筋
第一题,我把我当时面试的代码贴上来,可能还有问题,但面试官说可以了
class File {
static String buffer = "";
String readLine() {
if(!buffer.equals("")) { // we have characters left last time
StringBuilder sb = new StringBuilder();
int i = 0;
while(buffer.charAt(i) != '\n' && i < buffer.length()) { //
read one line
sb.append(buffer.charAt(i));
i++;
}
buffer = buffer.substring(i + 1);
if(i == buffer.length()) { // we have so... 阅读全帖
m*****k
发帖数: 731
22
来自主题: JobHunting版 - FB 面筋
private static String buffer="";
private static int start = 0;
private static String readLine(){

if (buffer == null){
return null;
}

int n = buffer.indexOf("n", start);
while(n<0){

String new4k = read4k();
if(new4k==null || new4k.length()==0){
String firstLine = buffer ;
buffer = null;
return firstLine;

}
... 阅读全帖
y*****e
发帖数: 712
23
题意我有点迷糊,不明白为啥public int read(char[] buf, int n)给出说buf是
destination buffer,
但看了答案之后半懂不懂的写了一个c++的,通过了,是这样的
int read(char *buf, int n) {
bool eof=false;
int readBytes=0;
while(!eof && readBytes<=n)
{
int sz=read4(buf);
if(sz<4) eof=true;
int bytes = min(n - readBytes, sz);
readBytes+=bytes;
buf+=bytes;
}
return readBytes;
}
大概的思路就是每次用read4从buf里读,然后指针往后挪,一直挪到eof或者n reached
,这里的buf应该和... 阅读全帖
f*******8
发帖数: 3612
24
这是一个将RFC 文件转换成 kindle格式的程序,
来自:
https://github.com/pingwin/RFC-2-Kindle
我是windows上的python 2.71, 运行完全仿照该网站的要求
结果出来是找不到font MONOSPACE, 不知道MONOspace是不是个字体库或别的什么。
running output:
D:\>rfctxt2kindlehtml.py -i rfc791.txt -o rfc791.html && ./ki
ndlegen rfc791.html
Unable to find font: /usr/share/cups/fonts/Monospace
Convert IETF RFC TXT file to HTML for kindlegen
-h --help This message
-v verbosity
-i --input input file
-o --output output file
-f --font font file to use for monospace ... 阅读全帖
h**********c
发帖数: 4120
25
gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
[root@somectshost ~]# gcc -V
[root@somectshost ~]# gcc hello.cpp -l stdc++ -o hello.exe
[root@somectshost ~]# cat hello.cpp
//refer to malloc example at cplusplus.com
#include
#include
int main() {
char * buffer;
buffer = (char*) malloc(10);
if (buffer == NULL) exit(1);
/*experiment this block, see what happens:
delete buffer;
delete buffer;
*/
if (buffer !=NULL) {
delete buffer;
buffer = NULL;
}
if (buffer !=NULL) {
delete... 阅读全帖
b*********b
发帖数: 64
26
来自主题: Biology版 - 请教:BAC Maxi Prep的问题
I use QIAGEN Plasmid Midi kit. 100ml culture could give about 30-50ug. I
tried Qiagen's large construct kit.But in my hand, the midi kit is much much
better than the large construct kit, and also takes much less time.The
following is the protocol I got from Qiagen.
User-Developed Protocol:
Isolation of BAC DNA using the QIAGEN® Plasmid Midi Kit
This procedure has been adapted by customers from the QIAGEN® Plasmid
Midi Kit Protocol.It has not been thoroughly tested and optimized by QIAG... 阅读全帖

发帖数: 1
27
Disk buffer
In computer storage, disk buffer (often ambiguously called disk cache or
cache buffer) is the embedded memory in a hard disk drive (HDD) acting as a
buffer between the rest of the computer and the physical hard disk platter
that is used for storage.[1] Modern hard disk drives come with 8 to 256 MiB
of such memory, and solid-state drives come with up to 1 GB of cache memory.
Since the late 1980s, nearly all disks sold have embedded microcontrollers
and either an ATA, Serial ATA, SCSI,... 阅读全帖
s****a
发帖数: 50
28
来自主题: JobHunting版 - FaceBook面经--第三(最后)部分
这个只能调用read每次读一个字符吧。还有什么其他trick?
4。给定int read(char *buffer, int size) api,写出int readline(char * buffer,
int size)code。举例说,输入一个字符串“abcd\nefgh”,read(buffer,3)返回3,
buffer=abc,同时指针指向字符"d"。read(buffer,7)返回7,buffer=abcd\nef,同时
指针指向字符"g"。返回值是实际读取的字符数。要求readline(buffer,3)返回3,
buffer=abc,同时指针指向字符"d"。readline(buffer,7)返回4,buffer=abcd,同时
指针指向字符"e"。
有个trick point,一开始我没注意,后来写对了。他们看上去很满意。
d****n
发帖数: 1637
29
来自主题: JobHunting版 - 昨天的F家店面
差不多用了30分钟
#define BSZ 4096
char buffer[BSZ];//buffer same size as 4096
int curr=BSZ-1; //current position read in buffer
int eof=0; //eof flag
extern char * read4096();
char *getline(){
char *s; //return string
int i, ssz=0; //size of s
for(;;){
if (!eof){
if (curr==(BSZ-1)) {
strcpy(buffer, read4096()); //read API
curr=0;
if (strlen(buffer)<4096 ) e... 阅读全帖
a*********i
发帖数: 86
30
我是楼主. 我想声明前面的回帖里没有使用马甲.
Poset你好. 既然你费了那么多笔墨来描述面试过程, 我想我也应该客观的再多说几句.
你今天是临时帮另一个面试官来救场的. 这样在开场寒暄的时候. 我其实不知道你是谁
. 我一直以为你是印度人, 原因有两个. 1. 你们L家的infra组特别多印度人. 我两轮
电话面试一共应付了三个印度人. 2. 你的语气特别严肃, 给我的感觉不是在interview
而是在interrogate. 你觉得我的态度不好, 你是不是可以中肯说一句, 我在介绍自己
背景和项目的时候一直都是比较平和的. 而你的语气是否有点太poker face?
直到打开Collabedit, 我看到你的名字才意识到你是中国人. 说实话这时候我有些不高
兴, 心想有必要这么咄咄逼人吗?
题目是事先paste在上面的. 你介绍了一下这个class, 然后就让我实现abstract class
. 但这个题目太过抽象, 而且感觉是谁拍脑袋想出来的, 非常不规范. 我举几个例子
fillBufferFromFile(); // Reads the buffer from file... 阅读全帖

发帖数: 1
31
6.6. The buffer cache
Reading from a disk is very slow compared to accessing (real) memory. In
addition, it is common to read the same part of a disk several times during
relatively short periods of time. For example, one might first read an e-
mail message, then read the letter into an editor when replying to it, then
make the mail program read it again when copying it to a folder. Or,
consider how often the command ls might be run on a system with many users.
By reading the information from di... 阅读全帖
C*I
发帖数: 4736
32
一直在误导,现在还在误导。 说说明corona virus 不可以从蝙蝠直接传染给人,必须
经过一个中间宿体性的其它动物才能传染给人。所以,病毒发生后,就故意误导全国人
民去海鲜市场找证据,找其它野生动物的麻烦。 而且还是病毒所去找的,找完了还装
模做样化验呀,分离呀什么的。最后把责任全部推给了海鲜市场的动物。可是那种动物
,一直不敢说,说了其它相关已经在人就会去早那种动物监测。 所以压根不说,打马
虎眼。
事实上,早在2013 年,就是这个武汉病毒研究所,已经从来自云南的蝙蝠身上所携带
的corona virus中分离出第一株蝙蝠SARS类似样的冠状病毒的活病毒,其中就包含了类
似于S类型的基因。从而证实这株病毒能够使其接受和SARS病毒相同的受体,并能够感
染人的细胞。对此新发现,武汉病毒所还把它以武汉病毒研究所的英文简称命名“WIV1
”,以彰显这一发现的重要价值和属于自己第一个发现的巨大研究成果。这个成果刊载
于2013年11月的《自然》杂志。
就是说,从云南弄回来的这种蝙蝠所携带的类似于sars的 corona virus, 可以不经过
其它受体/宿体,而直接传染给人。 他们... 阅读全帖
C*I
发帖数: 4736
33
一直在误导,现在还在误导。 说说明corona virus 不可以从蝙蝠直接传染给人,必须
经过一个中间宿体性的其它动物才能传染给人。所以,病毒发生后,就故意误导全国人
民去海鲜市场找证据,找其它野生动物的麻烦。 而且还是病毒所去找的,找完了还装
模做样化验呀,分离呀什么的。最后把责任全部推给了海鲜市场的动物。可是那种动物
,一直不敢说,说了其它相关已经在人就会去早那种动物监测。 所以压根不说,打马
虎眼。
事实上,早在2013 年,就是这个武汉病毒研究所,已经从来自云南的蝙蝠身上所携带
的corona virus中分离出第一株蝙蝠SARS类似样的冠状病毒的活病毒,其中就包含了类
似于S类型的基因。从而证实这株病毒能够使其接受和SARS病毒相同的受体,并能够感
染人的细胞。对此新发现,武汉病毒所还把它以武汉病毒研究所的英文简称命名“WIV1
”,以彰显这一发现的重要价值和属于自己第一个发现的巨大研究成果。这个成果刊载
于2013年11月的《自然》杂志。
就是说,从云南弄回来的这种蝙蝠所携带的类似于sars的 corona virus, 可以不经过
其它受体/宿体,而直接传染给人。 他们... 阅读全帖
C*I
发帖数: 4736
34
Published: 30 October 2013
Isolation and characterization of a bat SARS-like coronavirus that uses the
ACE2 receptor
Xing-Yi Ge, Jia-Lu Li, Xing-Lou Yang, Aleksei A. Chmura, Guangjian Zhu,
Jonathan H. Epstein, Jonna K. Mazet, Ben Hu, Wei Zhang, Cheng Peng, Yu-Ji
Zhang, Chu-Ming Luo, Bing Tan, Ning Wang, Yan Zhu, Gary Crameri, Shu-Yi
Zhang, Lin-Fa Wang, Peter Daszak & Zheng-Li Shi
Nature volume 503, pages535–538(2013)Cite this article
Abstract
The 2002–3 pandemic caused by severe acute respirator... 阅读全帖
k***t
发帖数: 276
35
自己顶一下,大拿们都不屑于写这个readLine()吗?
这道readLine()的题到底想考什么?
StackOverflow上的一个comment说要考security和memleak。
Implement a function
char* readLine();
which returns single lines from a buffer. To read the buffer, you can makes
use of a function
int read(char* buf, int len)
which fills buf with upto len chars and returns the actual number of chars
filled in. Function readLine can be called as many times as desired. If
there is no valid data or newline terminated string available, it must block
. In order to bloc... 阅读全帖
r****k
发帖数: 21
36
来自主题: JobHunting版 - 昨天的F家店面
#define MAX_BUFFER_SIZE 4096
extern char *read4096();
char buffer[MAX_BUFFER_SIZE+1];
char *readline()
{
static int EOF = 0;
static int currentPos = MAX_BUFFER_SIZE;

char *s = NULL;
int i, ssz = 0;

for(;;)
{
if (!EOF)
{
// buffer is not empty, check buffer
if (currentPos != MAX_BUFFER_SIZE)
{
for ( i = currentPos; i < MAX_BUFFER_SIZE; i++)
if (buffer[i] = '\0' || buffer[i] = '... 阅读全帖
p*********y
发帖数: 17
37
来自主题: JobHunting版 - leetcode word break II DFS 超时
优化一下就能过。
==================================================
public class Solution {
public ArrayList wordBreak(String s, Set dict) {
int N = s.length();
ArrayList result = new ArrayList();
if (N == 0) return result;
int maxLen = 0;
for (String str : dict) {
maxLen = Math.max(maxLen, str.length());
}
StringBuilder buffer = new StringBuilder();
HashSet invalid = new HashSet阅读全帖
s********u
发帖数: 1109
38
这是readline那个题我参照网上的代码写的。比这个要复杂一些,因为一个line的字符
是不确定的。
#define MAX_LEN 4096
int read(char* buf, int len);
char *readLine(){

static bool EOF = false;
char *str = NULL;
int i, size = 0;

static int currentPos = MAX_LEN;

static char* buffer = new char[MAX_LEN];

while(!EOF || currentPos != MAX_LEN ){

// buffer is not empty, handle buffer first
if(currentPos != MAX_LEN){

for(i = currentPos; i < MAX_LEN; i++)
... 阅读全帖
s********u
发帖数: 1109
39
来自主题: JobHunting版 - 请教一个fb面试问题
老题了吧,不过老要写错,尤其是那个read4写read的更恶心。
#define MAX_LEN 4096
int read(char* buf, int len);
char *readLine(){

static bool EOF = false;
char *str = NULL;
int i, size = 0;

static int currentPos = MAX_LEN;

static char* buffer = new char[MAX_LEN];

while(!EOF || currentPos != MAX_LEN ){

// buffer is not empty, handle buffer first
if(currentPos != MAX_LEN){

for(i = currentPos; i < MAX_LEN; i++)
if( buffer[i] ==... 阅读全帖
c**t
发帖数: 2744
40
来自主题: Database版 - 大虾帮忙看看MySQL的设置
[OK] Currently running supported MySQL version 5.6.30
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -----------------------------------------
------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM
+MyISAM +PERFORMANCE_SCHEMA
[--] Data in MyISAM tables: 170K (Tables: 17)
[--] Data in InnoDB tables: 28M (Tables: 107)
[!!] Total fragmented tables: 5
-------- Security Recommendations ------------------------------------------
... 阅读全帖
y****n
发帖数: 743
41
来自主题: JobHunting版 - 大家看看这道题code怎么写
扫描式,空间O(n),时间O(n),一遍扫描。
public class BracketInfo
{
public char OperatorBefore = '\0'; // Low-Pri
public char OperatorInner = '$'; // Hi-Pri
public char OperatorAfter = '\0'; // Low-Pri
public int BracketStart = -1;
public int BracketEnd = -1;
}
public class BracketChecker
{
private Dictionary operatorPriority = null;
public Dictionary OperatorPriority
{
get
{
... 阅读全帖
l****c
发帖数: 838
42
来自主题: JobHunting版 - C的fscanf的问题 (转载)
You should read in the string and parse.
You don't know how long the first part string is or how long the number is.
So if you define:
char tempprice[10];
char ticker[10];
You have the risk of buffer overflow.
Here is my solution. I debug it as I wrote it, so it is not optimized.
it is pure C. You can get result with 2 lines of perl or python code
============================
#include
#include
#include
int main()
{
char *str = "GOOD|89.34";
char *ptoken, *... 阅读全帖
x*********w
发帖数: 533
43
来自主题: JobHunting版 - GF面经
以前有写过这题,不知道对不对
========================================================
/*
有个封装好的函数int block_reader(char *buf),内部有个静态文件指针,
只能向文件末尾移动,不能rewind,每次只能读取K的block到buf里,返回读取
的字节数(除非到文件尾,否则总是K)要求实现int anysize_reader(char *buf, int
size)从文件的
当前位置读取任意大小的数据存入buf,并返回实际读到的数据字节数,白板写code
*/
const int k = 1024;
char buffer[k];
int nSize = 0;
int block_reader(char *buf);
void moveToBuf(char*& pWriter, int n)
{
if (n <= 0 || pWriter == NULL || nSize < n)
return;

memcpy(pWriter, buffer, n);
... 阅读全帖
b*****e
发帖数: 5133
44
来自主题: GunsAndGears版 - 第一把AR15,初步构想。
buffer不一定是越重越好。Vltor A5系统中也有几个不同重量的buffer。
gas port大小,bolt/BCG重量,action spring弹性和可压缩程度(部分和extension
tube长度有关),buffer重量和子弹装药多少等很多因素决定了AR的射速(全自动时)和
可靠性。个人可以容易改动的就是buffer和action spring,光看buffer重量不能完全
说明什么问题。
.223和一些老毛子的子弹不如5.56给力,buffer太重可能会short stroke。
从后坐舒适性和控制性考虑,使用可以保证可靠抛壳装弹最重的buffer。重一点的
buffer也有助于开锁延迟使抽壳容易些。
Vltor A5使用rifle length action spring,extension tube也比普通carbine
extension tube稍长可以进一步缓和感受到的后坐并且积累更大的弹性势能保证装弹的
可靠。
如果用了.625 hand guard cap的话装Magpul mid-length hand guard应该没有问题。
http://www.... 阅读全帖
g****y
发帖数: 323
45
来自主题: Java版 - 有趣的Thread问题
想不到Mars计划就是因为这个BUG.
Importance of Understanding Scheduling
Consider a system which uses preemptive scheduling with the
following four threads:
MD runs infrequently for a short time with a low priority.
It writes to a shared memory buffer as follows:
lock buffer
write to buffer
unlock buffer
IB runs frequently for a short time at a high priority. It
removes items from the shared buffer as follows:
lock buffer
read from buffer
unlock buffer
CT runs at a medium priority, is long running and does no
S*A
发帖数: 7142
46
来自主题: Programming版 - 请教:属于google不到答案的问题

你自己跑过你这样的测量程序吗,肯定没有吧。我随便看一眼你这段修改过
嵌入汇编就有至少2处影响结果的错误。要不你先改好了先测一下吧。
这个就留给你做功课了。
关于 out of order, 你知道 Intel 内部是翻译成完全不同的 micro code
执行的吧?连 register 都是 remap 过的。 所以你说绝对不会产生 1000
clocks 级别的误差从那里来的,有 Intel 官方的出处吗?
我只是很奇怪你为什么不先修正了你的程序再讨论。
[ssa]$ sudo ./a.out 1 0
allocate mem@0xbb6010
memory lock is enabled.
Please run "sudo chrt -f -p [priority] " to change scheduling policy,
then press any key to continue.
Num of buffers: 1, size of each buffer: 256*8=2048 bytes, repeat 1 times,
testing.....
work... 阅读全帖
x**l
发帖数: 64
47
来自主题: Programming版 - 请教:属于google不到答案的问题
谢谢你指出错误,匆忙之中修改的,没有测试.
如果你的CPU不支持 rdtscp,请使用这个function
typedef unsigned long long ticks;
static __inline__ ticks getticks(void)
{
unsigned a, d;
asm volatile(
"rdtsc;"
: "=a" (a), "=d" (d)
:
: "memory");
asm volatile("cpuid"
:
:
: "%eax", "%ebx", "%ecx", "%edx");
return ((ticks)a) | (((ticks)d) << 32);
}
你没有用numactl去调用,所以即使修改了代码,结果也不准确。
这是我的sample 输出
$ sudo numactl --physcpubind=3 --membind=0 ./a_i... 阅读全帖
j******o
发帖数: 4219
48
来自主题: Programming版 - Python里边file writer的问题
没有参数的话,用系统默认的buffer大小。
The optional buffering argument specifies the file’s desired buffer size: 0
means unbuffered, 1 means line buffered, any other positive value means use
a buffer of (approximately) that size. A negative buffering means to use
the system default, which is usually line buffered for tty devices and fully
buffered for other files. If omitted, the system default is used.
j******o
发帖数: 4219
49
来自主题: Programming版 - Python里边file writer的问题
没有参数的话,用系统默认的buffer大小。
The optional buffering argument specifies the file’s desired buffer size: 0
means unbuffered, 1 means line buffered, any other positive value means use
a buffer of (approximately) that size. A negative buffering means to use
the system default, which is usually line buffered for tty devices and fully
buffered for other files. If omitted, the system default is used.
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)