由买买提看人间百态

topics

全部话题 - 话题: compiler
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
d**o
发帖数: 864
1
来自主题: Programming版 - 弱问C++一个问题 一直不解
简单地说,.h管定义,.cpp管实现
当B对A有dependency时,只需要找A.h里的定义就可以compile了,但如果程序要运行必
须得compile A.cpp,并link起来。
好处在于,A.h里只管定义,所以需要编辑的时候不多,如果A.h不变,编辑A.cpp后,
重新编译程序时,只compile A.cpp,B就不用compile了,只样节省了compile B的时间。
这在项目大的时候节省很多时间。
z*w
发帖数: 45
2
来自主题: Programming版 - 请教Intel MPI基本常识
Intel® MPI Library 4.1 Getting Started Guide for Linux* OS
Quick Start
Source the mpivars.[c]sh script to establish the proper environment settings
for the Intel® MPI Library. It is located in the //
bin directory, where refers to the Intel MPI Library
installation directory (for example, /opt/intel/impi) and is one of
the following architectures:
ia32 - IA-32 architecture binaries
intel64 - Intel® 64 architecture binaries.
Create a hostfile text... 阅读全帖
a*********a
发帖数: 3656
3
来自主题: Programming版 - 关于c++的效率再给个例子
hmm, I thought long and hard how can a simple Fibonacci violate separation
of data and code.
Then I realized, that we were demonstrating how static computation can be
used to optimize run time. I said you can create a static table of fib
for n imposed separation of data and code so algorithms to compute Fibonacci at
compile time are outlawed.
Very very impressive PPT skills you possess there! Your legal team should
have asked ... 阅读全帖
v******y
发帖数: 84
4
搞对八题
下面二题错了
Which of the following is the most portable way to declare a C preprocessor
constant for the number of seconds in a (non-leap) calendar year?
Response:
#define SECONDS_PER_YEAR 60 * 60 * 24 * 365
#define SECONDS_PER_YEAR 60 * 60 * 24 * 365;
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365UL)
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365)
Which ANSI C compilers allow a variable to be declared both volatile and
const?
Response:
All ANSI C compilers allow this
No ANSI C compilers allow this;... 阅读全帖
v******y
发帖数: 84
5
这是我做的10题,大家试试
以后公布答案
Which of the following is the most portable way to declare a C preprocessor
constant for the number of seconds in a (non-leap) calendar year?
Response:
#define SECONDS_PER_YEAR 60 * 60 * 24 * 365
#define SECONDS_PER_YEAR 60 * 60 * 24 * 365;
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365UL)
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365)
Score 1 of 1
Question:
Which of the following is the most flexible way to declare a C preprocessor
macro that takes two arguments and returns th... 阅读全帖
c*******n
发帖数: 913
6
来自主题: Accounting版 - Auditing和Attestion到底什么区别?
纯属我个人的观点哈:
1)Auditing 主要、或者全部是针对Financial Statement来说的。其遵循的原则是
Statement of Auditing Standard(SAS)。因为auditing观点的assurance是最高级别的
。所以就financial statement而言,其过程是最复杂而且格式也是最为严格的。而且
审计的观点一般是没有限制用处的。
2)就financial statement 而言,低一级别的审查就是Review. Review服务遵循的原
则就是statement of standard for accounting and review service (SSARS).Review
的assurance就是所谓的limited assurance or negative assurance. 所以在review
服务的报告里,要表明CPA是Disclaimer Opinion的。而且用I am not aware of any
material modification ...放在结论部分。
3) 就financial state... 阅读全帖
j**u
发帖数: 6059
7
来自主题: Computation版 - [合集] 请教一个C++程序结构的问题
☆─────────────────────────────────────☆
eagletiger (eagletiger) 于 (Wed Nov 23 23:01:21 2011, 美东) 提到:
程序里现在需要一个很大的Matrix, 以前写的时候是放在一个文件里,每次程序执行的
时候现读入,这样很浪费时间,现在把整个Matrix写成一个array存在程序里作global
variable,但是编译的时候很慢,要十几分钟的样子,而且编译出来的程序很大,请问
各位一般处理大的矩阵时候是如何处理的,谢谢哈.
☆─────────────────────────────────────☆
Augu (奥古) 于 (Thu Nov 24 16:35:31 2011, 美东) 提到:
要不空间换时间
要不时间换空间

global
☆─────────────────────────────────────☆
eagletiger (eagletiger) 于 (Fri Nov 25 02:14:55 2011, 美东) 提到:
俺现在就是空间换时间,矩阵大概... 阅读全帖
D****y
发帖数: 2207
8
大多数初级码农看不懂Compiler的Code不是因为Code本身晦涩难懂而是他们缺乏
Compiler的背景知识。对于初步具备Compiler背景知识的人来说不管是Gcc还是LLVM的
代码都很容易懂。我二十年前刚入这一行的时候就是从Gcc源码起步的,今天Gcc的源码
质量更是比20年前有了质的飞跃,而LLVM的代码质量要比Gcc的更好。在学术界,
Stanford的SUIF和UMN的Agassiz都是构架很不错,容易上手的Compiler
w******i
发帖数: 1476
9
来自主题: JobHunting版 - 一个很全SAS Interview Q. List [ZT]
SAS Interview Questions from http://www.sconsig.com/
Very Basic
What SAS statements would you code to read an external raw data file to a DATA
step?
How do you read in the variables that you need?
Are you familiar with special input delimiters? How are they used?
If reading a variable length file with fixed input, how would you prevent SAS
from reading the next record if the last variable didn't have a value?
What is the difference between an informat and a format? Name three informats
or format... 阅读全帖
S**I
发帖数: 15689
10
来自主题: JobHunting版 - C++ Q83: 这个const_cast什么意思?
I bet if you run a debugger for this example, you will see that both a and *
b have value 3 after "*b = 3", but the output of "std::cout << a" is still 2.
The reason is when compiler sees "std::cout << a", since a is declared as
const and initialized to 2, it may replace this statement with "std::cout <<
2". The compiler never bothers to check whether the value of a has been
modified before "std::cout << a". This is a valid optimization and many
compilers do it.
Change you code to the following ... 阅读全帖
s******n
发帖数: 3946
11
When compiler handles b->func(para1, para2), it assumes the address is like
this
vptr_BClass
B data member 1
B data member 2
The call will be translated like this:
((vptr_BClass*)b)[0] -> func (b, para1, para2)
class C extends B & A, then memory layout is like this:
vptr_AClass
A data member 1
A data member 2
vptr_BClass
B data member 1
B data member 2
When we do B* b= &c, compiler will add offset to skip the A part. So a
later call b->func() can be handled in the same way for all subclass... 阅读全帖
S**I
发帖数: 15689
12
☆─────────────────────────────────────☆
gzou (gzou) 于 (Thu May 12 02:26:35 2011, 美东) 提到:
马上就要G on site了,
求祝福。
下面是从本版收集到的Google的试题,便于大家查询。
申明:有的附带有解释说明的,也来自于本版或者网络,大家自己看, 不保证真确
http://www.mitbbs.com/article_t1/JobHunting/31847453_0_1.html
本人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... 阅读全帖
S**I
发帖数: 15689
13
☆─────────────────────────────────────☆
gzou (gzou) 于 (Thu May 12 02:26:35 2011, 美东) 提到:
马上就要G on site了,
求祝福。
下面是从本版收集到的Google的试题,便于大家查询。
申明:有的附带有解释说明的,也来自于本版或者网络,大家自己看, 不保证真确
http://www.mitbbs.com/article_t1/JobHunting/31847453_0_1.html
本人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... 阅读全帖
h*****f
发帖数: 248
14
来自主题: JobHunting版 - 微软C++面试题
You will get a warning for the "incorrect" order of initialization for line
#14 as well.
Running 1, 2, 3 will have no warning or error.
#4 and 5 will have a runtime error (not compilation error as cplusplus.com
mentions).
#2 will have a compilation error (for all compilers?) if virtual D::foo()
isn't defined since the compiler doesn't know whether D::foo() should be
inherited from B or C.
#6 will have a runtime error because p3's vtable pointer is pointing to B's
vtable, and B has no virtual fun... 阅读全帖
a*****e
发帖数: 1717
15
来自主题: Stock版 - 房屋数据出来了
saw one article about this
Options Highest Since 2007 Shows Gains Intact Amid Hedging (1)
(Updates with today’s S&P 500 level in seventh paragraph.)
By Jeff Kearns and Whitney Kisling
April 25 (Bloomberg) -- The end of the Federal Reserve’s
Treasury repurchase program is prompting options traders to pay
the most in four years for protection against stock declines, a
signal that proved bullish in the past.
The cost of three-month put options to sell the Standard &
Poor’s 500 Index ... 阅读全帖
m***f
发帖数: 732
16
来自主题: LosAngeles版 - 写了个 SAC的抓deal code (转载)
【 以下文字转载自 Outdoors 讨论区 】
发信人: motif (魔地佛), 信区: Outdoors
标 题: 写了个 SAC的抓deal code
发信站: BBS 未名空间站 (Wed Nov 3 17:01:39 2010, 美东)
抓到你想要的deal自动给你发email或短消息,有兴趣的下去改了用。直接拷贝下面这
段code修改后存为sac.py,然后运行python sac.py即可。在python 2.7下测试通过。
#!/usr/bin/python
import re
import urllib
import smtplib
import time
from email.mime.text import MIMEText
target=[['trekking', 'poles'],['Napali', 'Backpack'],['north', 'face'],['
oakley','battalion']] #The items you want to monitor, in every set of [] AND
logical will be us... 阅读全帖
m***f
发帖数: 732
17
来自主题: Outdoors版 - 写了个 SAC的抓deal code
抓到你想要的deal自动给你发email或短消息,有兴趣的下去改了用。直接拷贝下面这
段code修改后存为sac.py,然后运行python sac.py即可。在python 2.7下测试通过。
#!/usr/bin/python
import re
import urllib
import smtplib
import time
from email.mime.text import MIMEText
target=[['trekking', 'poles'],['Napali', 'Backpack'],['north', 'face'],['
oakley','battalion']] #The items you want to monitor, in every set of [] AND
logical will be used to match a specific item
discount_threshold=50 #threshold of percentage to trigger event
check_interval=60 #the interval to ... 阅读全帖
c*****s
发帖数: 180
18
来自主题: WaterWorld版 - PURE WATER DO NOT NETER PLEASE
Using Stored Compiled Macros (continued)
Creating a Stored Compiled Macro
To create a permanently stored compiled macro, you must
1. assign a libref to the SAS library in which the compiled macro will be
stored
2. set the system options MSTORED and SASMSTORE=libref
3. use the STORE option in the %MACRO statement when you submit the macro
definition.
General form, macro definition with STORE option:
%MACRO macro-name <(parameter-list)> /STORE
;
c*****s
发帖数: 180
19
来自主题: WaterWorld版 - PURE WATER DO NOT NETER PLEASE

Using Stored Compiled Macros (continued)
Accessing Stored Compiled Macros
In order to access a stored compiled macro, you must
1. assign a libref to the SAS library that contains a Sasmacr catalog in
which the macro was stored
2. set the system options MSTORED and SASMSTORE=libref
3. call the macro.
Only one permanent catalog containing compiled macros can be accessed at any
given time.
Example
The following program calls the Words macro. Assume that the Words macro was
compi
a****a
发帖数: 5763
20
http://bbs.weiphone.com/read.php?tid=506463
Mac OS X 10.6即所谓的Snow Leopard操作系统已正式发售。一如既往,Apple产
品光鲜的外表下凝聚了太多艰辛的劳作。ArsTechnic的John Siracusa以其独特的、专
业的、全面的视角深入翔实地体验这款最新的操作系统。
Weiphone.com将对该综述进行翻译整理并独家连载。欢迎关注。

引用
译注:为了帮助您更加顺畅地理解本文的内容,这里补充了文中一些相关概念的背景资
料。
编译器(compiler):是一种能够将源代码(通常由高级别的程序语言编写而成)
转换为低级别机器语言的程序。源码转换最重要的一个目的在于创建可执行文件。详情
请参考wikipedia。
LLVM(Low Level Virtual Machine,低级虚拟机):是构架编译器(compiler)
的框架系统,以C++编写而成,用于优化以任意程序语言编写的程序的编译时间(
compile-time)、链接时间(link... 阅读全帖
d*********8
发帖数: 2192
21
查了一下 arc和c++0x是新功能 我猜的没错 呵呵
Default Compiler
The default compiler for iOS development in Xcode 4.2 is LLVM 3.0. Compared
with the GCC compiler that was the default in Xcode 4.0 and the LLVM-GCC
compiler in Xcode 4.1, LLVM provides better code generation and optimization
than GCC, along with newer language support than LLVM-GCC, including
support for ARC in Objective-C and for the new C++ standard, C++0x.
a***c
发帖数: 315
22
Big companies often hire PL and compiler PhDs. Those include IBM, MS, Intel,
AMD, Nvidia, TI, MIPS. A number of not so big companies in silicon valley
designing new processors also hire PL and compiler PhDs. Majority of them
are doing compiler backend.
You must be very very good and smart to get those jobs. The sheer number of
those jobs are much less than other areas but the job security is higher in
my view because there are very few good compiler backend folks in the market
.
z*******3
发帖数: 13709
23
所谓compile就是一个把人阅读的语言解释成机器执行的一个过程
这中间有非常多状态,并不是一个不是1就是0的过程
解释,要怎么解释?解释成什么状态?都可以tune其实
只不过对于大多数语言来说,都有一个约定俗成
一般c会compile成native code,java会compile成byte code
脚本一般不compile,在你书写的时候
L*******r
发帖数: 1011
24
来自主题: DotNet版 - I am back. :)
reinstalling my gentoo linux. Costs a lot time to compile.
No time for bbs. hehe.
KDE compiling lasts for ever. :( dump it le.
mono compiles and works fine on my machine.
A small browser named dillo runs damn fast! hehe, just costs 3M to run it.
But dillo doesn't support unicode and javascript. Otherwise I may dump my
Mozilla-firebird.
Sigh. When can I compile my windows kernel? damn slow windows kernel!
B******N
发帖数: 445
25
来自主题: Java版 - Help with Tomcat for Eclipse v1.03
you need set your jvm directory to your sdk folder which include jre and
compiler. instead of program file/... folder, which only contains jre.

org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternal
org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.ja
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:508
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190
org.apache.catalina.core.ApplicationFil
c*****t
发帖数: 1879
26
来自主题: Java版 - ant javac error in eclipse 3.0?
I was able to launch ant view, but when I tried to compile things,
the following error occurred
Buildfile: E:\pjcvs\build.xml
eclipse:
init:
compile:
[javac] Compiling 257 source files to E:\pjcvs
BUILD FAILED: E:\pjcvs\build.xml:33: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
Total time: 3 seconds
Eclipse 2.1x also had similar problem, but I forgot the necessary
fix (setting variable?) Anyone can help?
Thank
p***p
发帖数: 559
27
来自主题: Java版 - Jasper找不到JDK居然
Jetty5上面跑JSP,老是有错误信息说找不到JDK,我JAVA_HOME这些都设置好好的,其他T
OMCAT什么都正常,而且手动加入-Djava.home还是老问题,请教
[ERROR] Compiler - -Javac exception com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK>Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
at
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(Com
pilerAdapterFactory.java:105)
at org.a
y********o
发帖数: 2565
28
来自主题: Java版 - 也问一个Eclipse的问题
我装了JDK1.6.0。
将Sun的java教程中的code放到Eclipse里面编译出错:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method format(Locale, String, Object[]) in the type PrintStream
is not
applicable for the arguments (String, String, String)
查了一下,看到这个:
http://dev.eclipse.org/newslists/news.eclipse.platform/msg53962.html
按他说的做了,即:
Window->Preferences->Java->Compiler->Compiler compliance level
将Compiler compliance level设置为6.0, Apply, OK了。
Eclipse还是不受用。
在Dos窗口用javac编译运行冇问题。
麻烦指点一下
b******y
发帖数: 9224
29
or, you can write your own java based parser/compiler, LL based.
I've read a book called "let's write a compiler" before, it is good and
tells you how to roll your own.
In fact, java compiler is LL (recursive decent), so you can hand-code a java
compiler yourself ;-)
c*****t
发帖数: 1879
30
来自主题: Java版 - QT is LGPL now
Not only that, different C++ compilers have different C++ compliance
and checks. As the result, even for the code that do not call
system API, do not change int size etc, and have passed one or two
C++ compiler w/o any warnings can have a lot of warning on a 3rd C++
compiler. Speaking from an experience trying to get a piece of C++
code to compile under g++ 2.9 and 3 / borland c++ / sun c++ / vc++ .
It was a nightmare.
F****n
发帖数: 3271
31
来自主题: Java版 - type erasure weird problem
That's because you confuse Java language vs JVM byte code. They are not the
same by specification and JVM byte code can have a lot of illegal Java
constructs.
In fact today's best obfuscator utilizes this, for instance, directly write
a compiled byte code to replace Java names with weird illegal characters to prevent
decompiling.
Back to the question, I think LZ simply made a wrong observation during compiling. The class can be compiled but the caller will have problem if no Generic parameters a... 阅读全帖
s******n
发帖数: 876
32
来自主题: Java版 - It's a Java Bug
well, the language spec has dedicated 50 pages for
this subject alone. we thought java is supposed
to be simpler than c++...
http://java.sun.com/docs/books/jls/third_edition/html/expressio
15.12 Method Invocation Expressions
15.12.1 Compile-Time Step 1: Determine Class or Interface to Search
15.12.2 Compile-Time Step 2: Determine Method Signature
15.12.2.1 Identify Potentially Applicable Methods
15.12.2.2 Phase 1: Identify Matching Arity Methods Applicable by
Subtyping
... 阅读全帖
i****e
发帖数: 913
33
Spring's use of unchecked data access exceptions is consistent with that of
many - probably most - successful persistence frameworks. (Indeed, it was
partly inspired by JDO.) JDBC is one of the few data access APIs to use
checked exceptions. TopLink and JDO, for example, use unchecked exceptions
exclusively. Hibernate switched from checked to unchecked exceptions in
version 3.
这是Rod讲解Spring JDBC的原话
http://www.theserverside.com/news/1364527/Introduction-to-the-S
大体意思是:
By wrapping JDBC check exce... 阅读全帖
r*****l
发帖数: 2859
34
来自主题: Java版 - 这玩意是啥?
Person.class is the class of Person. It's type is Class at compile
time.
If Student is Person's subclass. Student.class's compile time type is Class<
Student>
Class is NOT Class's sub class. They are NOT compatible at
compile time.
If the method takes type Class as parameter, you can pass in Person.class
and Student.class but you are not using generics.
If you use type Class as parameter, you cannot pass in Class > as parameter (compile error). You have t... 阅读全帖
b***i
发帖数: 3043
35
来自主题: Java版 - OpenShift的配置一问
事情比较复杂。现在,在Eclipse里面生成openshift的JBoss AS 是可以的。一切都正
常。
然后TomCat 7.0 (JBoss EWS 2.0),模板都抱错,就是不理解javax.servlet。那个
JBoss AS的项目里面Maven Dependency有一堆jar,里面就有jboss的servlet-api.jar
,而这个Tomcat项目maven里面只有我加入的mysql和progresql的jar。好,我设置
server,apache tomcat,然后得到了jar,Eclipse自动加入了library里面,可以build
了。但是,放到openshift上就出错了,找不到javax.servlet。我想,我本地的
library里面的是在java build path里面,但是目标机器上是不是就不一定了。我目前
看到一帖
https://www.openshift.com/blogs/multipart-forms-and-file-uploads-with-tomcat
-7
居然要手动改pom.xml。还要把failOnMissingWebX... 阅读全帖
w*********n
发帖数: 439
36
来自主题: Java版 - Java 求解2
What happens when these statements are compiled?
Loan loan = new Loan(amount, months);
Object obj = loan;
obj.calculatePayments();
Answer
a.
A compile-time error occurs because the Object object can’t invoke the
calculatePayments method
b.
A compile-time error occurs because the Object object can’t reference a
Loan object without a cast
c.
These statements will compile without errors
S*A
发帖数: 7142
37
来自主题: Linux版 - Google go 还挺不错的

Stack-based VM is hard to do normal function optimization like CSE.
You can in theory undo the stack and convert them back to SSA
form. A lot of modern compiler transformation is depend on SSA.
Convert stack to SSA takes memory and CPU time. In modern C
compilers, most of the time is spend on IR transformation.
The C front end is very fast.
That is why Java better use JIT, it only work on the hot path,
and most of the scalor is already on the stack. It can not afford
to full optimization of the... 阅读全帖
w*****3
发帖数: 910
38
来自主题: Linux版 - Fortran complier
准备compile CMAQ 一个大气模型软件。
里面的module 指明用PGI or Intel Fortran 。
Requirements: I/O API & netCDF libs, CVS, and PGI or Intel Fortran
但这两个fortran compiler 都不免费。
想用GNU gfortran 但是module中 Flags参数不一样。
#> Portland Group 9.01 Fortran Compiler Flags
#set FSTD = "-Mfixed -Mextend"
#set LINK_FLAGS = "-Bstatic"
#> Intel Fortran 10.1 Compiler Flags
set FSTD = "-extend_source 132 -vec-report0 -cm -w95 -c"
set LINK_FLAGS = "-liomp5 -lpthread -Bstatic"
不知道有哪位高手可以指点一下。
多谢了
F****3
发帖数: 1504
39
谢谢各位大哥帮忙!!!!
试了一下autoconf,好像卡住了。
fas133@ubuntu:~/temp/geoip-api-c-master$ autoconf
configure.ac:6: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
./configure终于能执行了。
fas133@ubuntu:~/temp/geoip-api-c-master$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
... 阅读全帖
f*z
发帖数: 421
40
"C was developed in the 1970s at Bell Labs. It was originally designed for
and used on the DEC PDP-11—whose operating system, C compiler, and UNIX
application programs were all written in C."
要是C compiler都是用C写的,那些compiler的原码使用什么编译的?上文的C
copmiler是通常我们说的compiler, 还是其他什么东西?
L*********r
发帖数: 92
41
来自主题: Programming版 - 一个java class downcast 的问题
你应该理解一下下面的rules in java.
1.The rules for a casting from compile-time reference type S to a compile-
time reference type T are as follows:
If S is a class type:
If T is a class type, then either |S| <: |T|, or |T| <: |S|; otherwise a
compile-time error occurs.
2.
If a cast to a reference type is not a compile-time error, there are several
cases:
The cast is a checked cast. Such a cast requires a run-time validity check.
downcast follows the above 2 rules.

error
Run-
d*******d
发帖数: 2050
42
来自主题: Programming版 - C array
depends on compiler。
有的compiler会自己去猜着这个变量是不是compile time available,如果是的话,com
piler自己就fold in了。不是的话,compile会记下这个变量是数组,自己猜个长度。
O******e
发帖数: 734
43
来自主题: Programming版 - gfortran 编译f90程序
What does the compiler tell you when you try to compile something?
Try compiling this program with just "gfortran" and no options.
PROGRAM MAIN
END PROGRAM MAIN
What does the compiler say?
O******e
发帖数: 734
44
A FORTRAN 77 compiler must support both single- and double-precision
data, but is not required to support quadruple-precision. If a
FORTRAN 77 compiler supports quad-precision data, the name of the
conversion function is implementation dependent, so you'll have to
check the compiler manual.
In Fortran 90 or later, the compiler is also not required to support
quad-precision data, but if it does support it, the standard way to
convert data is to call the real() function with a kind type parameter
a**a
发帖数: 416
45
来自主题: Programming版 - question for C++ constant
I am really sorry that you are lost in the details and forget the big
picture.
The big picture is, any compiler is just an implementation of the standard.
All implementations are trying to follow the standard. So people only want
to talk about standard. Compilers are always in transition by all sort of
technical or nontechnical reasons. If you indulge yourself digging dark
corners of compilers, you are really wasting your time in something unuseful.
You should use compiler as a tool, not a refer
c*******3
发帖数: 21
46
来自主题: Programming版 - C++ template problem
Answer from http://www.cplusplus.com/doc/tutorial/templates.html:
Templates and multiple-file projects
From the point of view of the compiler, templates are not normal functions
or classes. They are
compiled on demand, meaning that the code of a template function is not
compiled until an
instantiation with specific template arguments is required. At that moment,
when an instantiation is
required, the compiler generates a function specifically for those arguments
from the template.
When projects
f**y
发帖数: 138
47
Not so easy. Programs written with MFC are usually not compatible with
MatLab's graphics library. Such programs will crash at run time if linked
with dll built with MatLab's compiler.
I only succeeded once with MatLab's old 2.x compiler which compiled m files
into tons of C or C++ files. Then made a wrapper around those C or C++ files
to provide an interface without referring to MatLab's mwArray class. Those
files were compiled into a dll with MSVC. The original MFC program linked
with this dll
b******n
发帖数: 592
48
来自主题: Programming版 - 关于 gcc 和 g++ 的问题

gcc can compile anything. it is not c compiler, it is a collection of compil
er. it will call g++ to compile program if you have the correct flags and ex
tensions..
t****t
发帖数: 6806
49
来自主题: Programming版 - In C++, how to do matrix computation?
Add the following function into comparison. Note, this is almost the same as
"naive" version, but i added hint: "restrict", meaning a and b are not
alias of each other.
int **mx_add_restrict(int row, int col, int * restrict const * restrict a,
int * restrict const * restrict b)
{
int i, j;
int **m = _MX_INIT(int, row, col);
for (i = 0; i < row; ++i)
for (j = 0; j < col; ++j)
m[i][j] = a[i][j] + b[i][j];
return m;
}
compile with -std=c99 since restrict is a c99 keyword... 阅读全帖
m********5
发帖数: 17667
50
比如
>>> re.compile(r'([ab]*)*')
Traceback (most recent call last):
File "", line 1, in
re.compile(r'([ab]*)*')
File "/usr/lib/python2.7/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.7/re.py", line 242, in _compile
raise error, v # invalid expression
error: nothing to repeat
但:
>>> re.compile(r'([ab]?)*')
<_sre.SRE_Pattern object at 0x1274be0>
在java, ruby里面都没这些莫名奇妙的shit
很多bug曾经fix但是后来又挂掉,比如上例:
http://bugs.python.org/issue... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)