由买买提看人间百态

topics

全部话题 - 话题: readonly
1 2 3 下页 末页 (共3页)
d********o
发帖数: 1738
1
为什么我用readon 9800连上电视后,电影画面好象有很细的波纹。
k****e
发帖数: 126
2
来自主题: Programming版 - 问个超简单的C问题
If a[][] is declared as static storage duration then it will certainly go to
.data segment. If not, the compiler will probably use immediate value
instead.
If you compare the following, (gcc version 4.5.3 -O0)
(1) array a[] has "auto" storage duration.
#include
#include
int foo()
{
int a[] = {3, 4, 5};
return a[2];
}
int main(void)
{
int temp;
temp = foo();
printf("%d", temp);
return 0;
}
Sections:
Idx Name Size VMA LMA File ... 阅读全帖
r*c
发帖数: 167
3
来自主题: JobHunting版 - simple question
using System;
using System.Collections.Generic;
namespace WinningGame
{
class Program
{
static void Main(string[] args)
{
int nCount = 0;
int nTotalGames = 1000;
for (int i = 0; i < nTotalGames; i++)
{
Board bd = new Board();
//bd.PrintBoard();
bool bResult = bd.IsWinner();
if (bResult)
{
nCount++;
bd.Print... 阅读全帖
st
发帖数: 1685
4
btw, C# supports const ah... what's your problme? what's your code?
I use readonly since I init them in contructor.
also:
Note The readonly keyword is different from the const keyword. A const
field can only be initialized at the declaration of the field. A
readonly field can be initialized either at the declaration or in a
constructor. Therefore, readonly fields can have different values
depending on the constructor used. Also, while a const field is a
compile-time constant, the readonly fiel
r****y
发帖数: 26819
5
and FYI:
Note The readonly keyword is different from the const keyword. A const field
can only be initialized at the declaration of the field. A readonly field can
be initialized either at the declaration or in a constructor. Therefore,
readonly fields can have different values depending on the constructor used.
Also, while a const field is a compile-time constant, the readonly field can
be used for runtime constants, as in the following example:
public static readonly uint l1 = (uint) DateTim
st
发帖数: 1685
6
The readonly keyword is a modifier that you can use on fields. When a
field declaration includes a readonly modifier, assignments to the
fields introduced by the declaration can only occur as part of the
declaration or in a constructor in the same class.
You can assign a value to a readonly field only in the following
contexts:
When the variable is initialized in the declaration, for example:
public readonly int y = 5;
For an instance field, in the instance constructors of the class that
contain
m******z
发帖数: 1
7
小弟前段时间找工作,经常来本版,收益不少。在狂练了careercup和leetcode后摩拳
擦掌,牛刀小试去面了几家公司。面之前也没有太多看design的帖子,本以为自己七年
多内核经验咋也可以忽悠过去 。。。结果 。。。 下面是一段经典对话:
Q:你懂Hadoop吗?A:不懂
Q:你用过DB吗?A:没用过
Q:你用过Restful API吗?A:没用过(这时那家伙已经不耐烦…)
Q:那你用过WCF吗?A:WCF是啥。。。
Q:不好意思,我们还是决定要找比较junior的人。你的experience有点不太适合。
偶当时是那个汗呀,顿悟人坚不拆的道理。。。
总的来说,面试间同胞还是很照顾的,赞一个!
后来想想不学点新东东就是坐吃等死,所以就和另外一个兄弟一起边做边学弄了个小网
站(www.myappwiz.com),也过来分享一点经验吧:
1. 感觉数据大了,DB会很慢,我们最开始用DB,往里面插几万条数据就要用半个小时
。也有可能是我们DB没建对,不过想想对于很多startup来说design几乎每个星期都在
变,数据一变,以前的DB design就要换,这个还是很不方便滴。
2.... 阅读全帖
f*****Q
发帖数: 1912
8
@interface a:NSObject{
@private
id a, b, c;
}
@property(readonly) id a;
@property(readonly) id b;
@property(readonly) id c;
@end
@implementation a
@synthesize a;
@synthesize b;
@synthesize c;
@end
o**********a
发帖数: 330
9
来自主题: DotNet版 - 新手请教问题
刚接触 xml,为什么第一段code 可以work。 而第2段code不能正确地创建xml
多谢
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;
namespace xmlapp
{

public class Movie
{
public string Title
{ get; set; }
public int Rating
{ get; set; }
public DateTime ReleaseDate
{ get; set; }
}
class Program
{
static void Main(string[] args)
{

Movi... 阅读全帖
m*t
发帖数: 2464
10
来自主题: Hardware版 - Win2016 正式了,官方下载地址
Dism.exe 文件win10/win2016自带。
——————————————————————————————————————
/Mount-Wim /WimFile:
{/Index: | /Name:}
/MountDir: [/readonly]
Mounts the WIM file to the specified directory so that it is available for
servicing.
Use /ReadOnly to set the mounted image to have read-only permissions.
Examples:
DISM.exe /Mount-Wim /WimFile:C:testimagesmyimage.wim /index:1
/MountDir:C:testoffline
DISM.exe /Mount-W... 阅读全帖
t*****9
发帖数: 569
11
来自主题: JobHunting版 - 问个google面试题的最佳解法
用动态规划如何?
class FindMinWindow
{
private static readonly int[] A = { 1,1,1,1,2,1,1,1,1,3 };
private static readonly int[] Q = { 1,1,1,1,3 };

public static Point FindWindow(int startA, int startQ, bool
firstCall)
{
if (Q.Length <= startQ) return new Point(startA, 0);
if (A.Length <= startA) return new Point(startA, Int32.MaxValue);
List valueList = FindValue(startA, Q[startQ]);
i... 阅读全帖
l**b
发帖数: 457
12
来自主题: JobHunting版 - A家电面No.2
很不牛,
Dir,File和Symbol link和你的差不多,我直接sub class了一个interface,Dir和
File分开,我个人的感觉是这个是比较high level的design,还是分开比较好因为
behavior不一样,
Readable和Writtable的意思是permission,更准去应该是ReadOnly这样,read和write
我默认在Interface里面就有,但是要实现ReadOnly这样的东西,我的想法是如果直接
写到class里面,变成很多class。E.g. ReadOnlyFile, ReadOnlyDir,什么的,很啰嗦
,直接用decorator的话,只用2个class就搞点了。比较naive,希望make sense吧,对
方比较好说话,问觉得怎么样,说很reasonable。
d*****n
发帖数: 908
13
又试了一下,只有我一个人打开文件,还是readonly。而且原先打开本帖第一页的
https://docs.google.com/spreadsheet/ccc?key=
0ArJfDpq4cDuBdFpsUDBjWWNOS2k5RE5kVldGWUQyQ0E
是可以edit文件的,现在也不行了。似乎被设成readonly了?
刚查了权限,我是“can edit”。奇怪。
C****n
发帖数: 2324
14
来自主题: DotNet版 - C# interview question
All right guys.
1. Const can not be changed, and can only be declared in the field
declaration.
i.e.: public const int i=5;
2. const automatically means static.
3. Readonly can be asigned in CONSTRUCTOR!
The real world concern:
Never declare a public field as CONST (static), use readonly
instead, which will save you from recompilation if the const in the underlying
library is
recompiled. Only use const with your private field.
Well, a better pratice is never declare public field.
The Count in Ar
a**y
发帖数: 335
15
来自主题: DotNet版 - C# interview question
o. I thought the 'readonly' in the question is an attribute
instead of a data type modifier.
And I didn't know C# has a 'readonly' modifier until now. //blush
S****e
发帖数: 10596
16
我用jq rateit preset, readonly 显示rating
a-rateit-ispreset="true" data-rateit-readonly="true">
里面 data-rateit-value 是jq rateit 定义的
有什么方法给这个参数赋值?
谢谢
j********2
发帖数: 4438
17
来自主题: Hardware版 - Pogoplug E02: arch or debian?
发一个我的最简单的smb.conf
workgroup = WORKGROUP
security = share
guestok = yes
[data]
path = /data
readonly = no
[goflex]
path = /mnt
readonly = yes
[data]目录可读写,[goflex]只读
S*A
发帖数: 7142
18
来自主题: Hardware版 - 求助,carbon x1 第一代换大ssd
你个大SB, 我不就是指出了你以前说了几个和实际情况不符合的
东西,至于这么耿耿于怀吗?
你都没有明白 LZ 的难处在哪里就乱喷。 我的理解是(LZ 可以指正
我说的对不对),LZ 只有一个电脑(x1)有那个 AFF 接口,所以新的
硬盘如果直接插到x1 就没法从 AFF 硬盘启动,因为必须通过X1的 AFF
往硬盘里面写东西。所以难处不是你的 DOS 做的创建 GPT partition,
是没有 USB 启动的 OS 的话没法往 AFF 硬盘写东西的问题。
所以如果 Windows 在 USB 上面启动有困难,那么用 USB LiveCD
是很合理而且可以走下来的一个选择。当然不会是唯一的选择。
至于你的 DOS 做 GPT,根本不解决 LZ 的问题。
你看我已经尽量忍住不喷你的不精确的地方了,既然你点名了我
就再顺带说一下把。
:啥时候USB能boot了?就是USB live CD也是先写到RAM的
USB 一直都是可以 boot 的。USB Live CD 不需要写到 RAM 再
boot。 写到 RAM 的是启动以后在 readonly filesystem上面
overla... 阅读全帖
g*****g
发帖数: 34805
19
You probably want to discuss it in case by case manner.
e.g. MySQL cluster allows lagging readonly instances, it has high
availability for read, but it's not consistent when you read from readonly
instances.
That's the point of my back and white Metaphor. RDBMS can implement non-
transaction operation too for high availability, but those operations won't
be consistent.
g*****g
发帖数: 34805
20
来自主题: Java版 - 问Zhaoce个问题
There are a couple of approaches you can consider.
1. Form a cluster for your RDMBS, have a readonly node and let your queries
go through the readonly node. You offload the load from the main DB
immediately and your long queries ain't contending for the resource.
2. Cache the join result if some queries/parameters are being used in high
frequency.
3. If queries are ad-hoc, use SOLR or Elastic Search for your queries.
g*****g
发帖数: 34805
21
来自主题: Java版 - 问Zhaoce个问题
There are a couple of approaches you can consider.
1. Form a cluster for your RDMBS, have a readonly node and let your queries
go through the readonly node. You offload the load from the main DB
immediately and your long queries ain't contending for the resource.
2. Cache the join result if some queries/parameters are being used in high
frequency.
3. If queries are ad-hoc, use SOLR or Elastic Search for your queries.
s******n
发帖数: 876
22
现在的程序员竟然便宜到这个地步了。。。
你把下面这段code存成html, 然后用browser看。

Position on the Tray Agar:


Region:
Row:
Line:

Position on the 24x16 well assay plate: