compilation

Can I tell javac to ignore the lack of `import foo.Bar`?

百般思念 提交于 2019-12-01 19:30:12
I'm using reflection to load MyClass.class (an external file) at runtime. MyClass.class uses the library Bar , which would mean that I need to place import foo.Bar; at the top of the file. However, the Bar library is already loaded in the main class loading MyClass . Is there a way for me to tell javac to ignore that Bar doesn't exist and just compile without it? No this is not possible. When compiling a class, the compiler has no "memory" of which classes were already "loaded" (don't confuse this with the concept related to classloading -- that's a completely different story). Whenever a

Compile a C# Array at runtime and use it in code?

好久不见. 提交于 2019-12-01 19:27:54
I know C# code can be compiled at runtime using C# . However I'm very very shaky at it since I just read about it a few minutes ago. I learn a lot better by examples. So tell me. If I want to compile something like: // MapScript.CS String[] LevelMap = { "WWWWWWWWWWWWWWWWWWW", "WGGGGGGGGGGGGGGGGGW", "WGGGGGGGGGGGGGGGGGW", "WWWWWWWWWWWWWWWWWWW" }; and use this array in my code, how would I go about it? In pseudocode I want to do something like this: Open("MapScript.CS"); String[] levelMap = CompileArray("levelMap"); // use the array LINQ Expression trees are probably the friendliest way of doing

C order of evaluation of assignment statement

独自空忆成欢 提交于 2019-12-01 19:12:26
I've been encountered on a case where cross-platform code was behaving differently on a basic assignment statement. One compiler evaluated the Lvalue first, Rvalue second and then the assignment. Another compiler did the Rvalue first, Lvalue second and then the assignment. This may have impact in case Lvalue influence the value of Rvalue as shown in the following case: struct MM { int m; } int helper (struct MM** ppmm ) { (*ppmm) = (struct MM *) malloc (sizeof (struct MM)); (*ppmm)->m = 1000; return 100; } int main() { struct MM mm = {500}; struct MM* pmm = &mm pmm->m = helper(&pmm); printf("

How to analyze Closure Compiler bundle size

∥☆過路亽.° 提交于 2019-12-01 18:47:59
I have an app in ClojureScript, which uses Google's Closure Compiler as a compiler backend. The resulting bundle using advanced optimizations seems way too big for what it is. I blame the dependencies but how do I find out which modules are taking the most bytes in the output bundle? I scanned through all the Closure Compiler options and didn't find anything useful. Then I tried to learn about source maps and use that to calculate individual module size but with no success. I would like a tree-like output where I can dig in and find the biggest modules in terms of size, eg. [+] goog 100kb [+]

Compile a TypeScript String to a Javascript String programmatically

邮差的信 提交于 2019-12-01 18:44:14
Is there a way to compile a String containing TypeScript to its JavaScript String equivalent ? For instance, in Coffeescript (and LiveScript, coco etc) its a (simplified) one-liner: jsCompiledCode = require('coffee-script').compile('do -> console.log "Hello world"', {bare:true}); Can something similar be implemented for TypeScript, preferably without involving the filesystem ? Are there any implications with referencing other modules that would have to be resolved at compile time ? You can use TypeScript.Api nodejs package : https://npmjs.org/package/typescript.api In particular check out this

Is C# considered a context free language?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 18:41:23
I have been looking for this, but there is a lot of different answers to this question on the MSDN forums . Some people say that "All computer language grammars are context free" and others say that any language that has white-space sensitive syntax is likely context-sensitive and therefore not context-free (F# and Python). Whould be nice a definitive answer and maybe some proof. Mike Zboray I would describe C# as having a context-free grammar, but the language has context-sensitive rules that are not expressed in the grammar. From Wikipedia ( Formal grammar ): A context-free grammar is a

OpenSSL Windows x64 Compilation error

痴心易碎 提交于 2019-12-01 18:19:28
I'm getting the following error when trying to compile OpenSSL 1.0, 64 bit: ias -o tmp32\ia64cpuid.obj tmp32\ia64cpuid.asm 'ias' is not recognized as an internal or external command, operable program or batch file. NMAKE : fatal error U1077: 'ias' : return code '0x1' Stop. Does someone know what can I do? (I do it on Windows 2008 x64 OS) Thanks. You've probably chosen VC-WIN64I (as an argument for the perl Configure command), which is a wrong platform in your case. You should have passed VC-WIN64A. "I" stands for "Itanium" and "A" still stands "AMD64". Run perl Configure VC-WIN64A and then run

Dev C++ compilation error, permission denied

让人想犯罪 __ 提交于 2019-12-01 18:08:53
I want to compile a code program using dev c++ compiler but my compiler didn't compile my code.The program consist of two files one is header and other is implementation .cpp file. The code i want to compile is correct and working,but it didn't compiling on my pc(windows 7) Please help The error which i am getting is Permission denied ld returned 1 exit status C:\Makefile.win [Build Error] [Project1.exe] Error 1 here is my compile log Compiler: Default compiler Building Makefile: "C:\Makefile.win" Executing make... make.exe -f "C:\Makefile.win" all g++.exe -c testProgDoublyLinkedList.cpp -o

How do I compile multiple py files as one?

别来无恙 提交于 2019-12-01 18:08:01
I am new to Python and am totally lost as to where to even start to get this done. I have written many small modules (a toolset for maya) that need to be compiled into on single .pyc file. Is there a module that just does this? Or can you tell me where to go to start? A tutorial? I don't even know what terms to look for. theodox You don't even need to make an egg, you can just zip up your files and put the zip file onto your python path. Maya's version of python includes the zipimport module by default so it 'just works' as long as maya can find your zip file. Here are some discussions of the

How can I use a library compiled for Java 7 in Java 6?

…衆ロ難τιáo~ 提交于 2019-12-01 17:58:19
I'm working on a Java application, where I need to use a jar called myBeans.jar . This myBeans.jar contains lots of class files, that are compiled with jdk 1.7 . I don't have the source code for those class files. And my whole application is using jdk 1.6 . I can't change it's compiler to jdk 1.7 . So I want my jar to be compatible with my app. And that's why I want the classes of the jar to be compiled with jdk 1.6 . Now my question is: Is there any way to compile the class files (& not java files) using jdk 1.6? Any alternate suggestions are also welcome. Someone recommended me to get the