17,495 questions
1685
votes
7
answers
167k
views
Why does changing 0.1f to 0 slow down performance by 10x?
Why does this bit of code,
const float x[16] = { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8,
1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6};
const float z[...
622
votes
15
answers
175k
views
Why does C++ compilation take so long? [closed]
Compiling a C++ file takes a very long time when compared to C# and Java. It takes significantly longer to compile a C++ file than it would to run a normal size Python script. I'm currently using VC++ ...
490
votes
8
answers
338k
views
How to check syntax of Python file/script without executing it?
I used to use perl -c <filename> to check the syntax of a Perl program and then exit without executing it. Is there an equivalent way to do this for a Python script?
357
votes
5
answers
155k
views
How to prevent Less from trying to compile CSS calc() properties?
The Less compilers that I'm using (OrangeBits and dotless 1.3.0.5) are aggressively translating
body { width: calc(100% - 250px - 1.5em); }
into
body { width: calc(-151.5%); }
Which is obviously not ...
331
votes
35
answers
209k
views
Displaying the build date
I currently have an app displaying the build number in its title window. That's well and good except it means nothing to most of the users, who want to know if they have the latest build - they tend ...
255
votes
6
answers
395k
views
OPTION (RECOMPILE) is Always Faster; Why?
I encountered an odd situation where appending OPTION (RECOMPILE) to my query causes it to run in half a second, while omitting it causes the query to take well over five minutes.
This is the case ...
244
votes
4
answers
115k
views
What is the purpose of the "Prefer 32-bit" setting in Visual Studio and how does it actually work?
It is unclear to me how the compiler will automatically know to compile for 64-bit when it needs to. How does it know when it can confidently target 32-bit?
I am mainly curious about how the compiler ...
235
votes
9
answers
269k
views
Is Java a Compiled or an Interpreted programming language ?
In the past I have used C++ as a programming language. I know that the code written in C++ goes through a compilation process until it becomes object code "machine code".
I would like to know how ...
230
votes
3
answers
18k
views
Java method with return type compiles without return statement
Question 1:
Why does the following code compile without having a return statement?
public int a() {
while(true);
}
Notice: If I add return after the while then I get an Unreachable Code Error.
...
224
votes
22
answers
54k
views
Why is Swift compile time so slow?
I'm using Xcode 6 Beta 6.
This is something that's been bugging me for some time now, but it's reaching a point where it's barely usable now.
My project is starting to have a decent size of 65 Swift ...
221
votes
20
answers
406k
views
Compiling/Executing a C# Source File in Command Prompt
How do you compile and execute a .cs file from a command-prompt window?
213
votes
5
answers
77k
views
Why use make over a shell script?
Make seems to me simply a shell script with slightly easier handling of command line arguments.
Why is it standard to run make instead of ./make.sh
207
votes
15
answers
502k
views
How do I show a console output/window in a forms application?
To get stuck in straight away, a very basic example:
using System;
using System.Windows.Forms;
class test
{
static void Main()
{
Console.WriteLine("test");
MessageBox.Show("...
202
votes
3
answers
207k
views
Create a single executable from a Python project [closed]
I want to create a single executable from my Python project. A user should be able to download and run it without needing Python installed. If I were just distributing a package, I could use pip, ...
186
votes
11
answers
18k
views
How can a compiler compile itself?
I am researching CoffeeScript on the website http://coffeescript.org/, and it has the text
The CoffeeScript compiler is itself written in CoffeeScript
How can a compiler compile itself, or what does ...
179
votes
8
answers
149k
views
Just-in-Time (JiT) vs Ahead-of-Time (AoT) compilation in Angular
I was referring this documentation and came across the compilation concept. One can use either JIT or AOT compilation. However, I found it very brief and need to know following points in details,
...
175
votes
8
answers
140k
views
Building vs. Compiling (Java)
Thinking that the answer to this is pretty obvious but here it goes:
When I am working on a small project for school (in java) I compile it.
On my coop we are using ant to build our project.
I ...
170
votes
8
answers
132k
views
C++, variable declaration in 'if' expression
What's going on here?
if(int a = Func1())
{
// Works.
}
if((int a = Func1()))
{
// Fails to compile.
}
if((int a = Func1())
&& (int b = Func2()))
)
{
// Do stuff with a and b....
167
votes
5
answers
179k
views
Mismatch Detected for 'RuntimeLibrary'
I downloaded and extracted Crypto++ in C:\cryptopp. I used Visual Studio Express 2012 to build all the projects inside (as instructed in readme), and everything was built successfully. Then I made a ...
159
votes
15
answers
128k
views
IntelliJ IDEA 13 uses Java 1.5 despite setting to 1.7
Despite specifying JDK 1.7 in all project settings (including in File -> Project Structure -> Project :: Project SDK), the following error is produced by IntelliJ 13 when trying to compile some ...
151
votes
13
answers
31k
views
How do I get Windows to go as fast as Linux for compiling C++?
I know this is not so much a programming question but it is relevant.
I work on a fairly large cross platform project. On Windows I use VC++ 2008. On Linux I use gcc. There are around 40k files in ...
141
votes
12
answers
258k
views
How to watch and compile all TypeScript sources?
I'm trying to convert a pet project to TypeScript and don't seem to be able to use the tsc utility to watch and compile my files. The help says I should use the -w switch, but it looks like it can't ...
133
votes
5
answers
160k
views
Compiling dynamic HTML strings from database
The Situation
Nested within our Angular app is a directive called Page, backed by a controller, which contains a div with an ng-bind-html-unsafe attribute. This is assigned to a $scope var called '...
133
votes
7
answers
369k
views
Compiling a java program into an executable [duplicate]
Possible Duplicate:
How do I create an .exe for a Java program?
I've just made a simple program with Eclipse and I want to compile it into an executable, but simply can't seem to find out how to ...
130
votes
6
answers
71k
views
What is the difference between compile code and executable code?
I always use the terms compile and build interchangeably.
What exactly do these terms stand for?