Search Results

Search found 347 results on 14 pages for 'preprocessor'.

Page 3/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • CSS optimization - extra classes in dom or preprocessor-repetitive styling in css file?

    - by anna.mi
    I'm starting on a fairly large project and I'm considering the option of using LESS for pre-processing my css. the useful thing about LESS is that you can define a mixin that contains for example: .border-radius(@radius) { -webkit-border-radius: @radius; -moz-border-radius: @radius; -o-border-radius: @radius; -ms-border-radius: @radius; border-radius: @radius; } and then use it in a class declaration as .rounded-div { .border-radius(10px); } to get the outputted css as: .rounded-div { -webkit-border-radius: 10px; -moz-border-radius: 10px; -o-border-radius: 10px; -ms-border-radius: 10px; border-radius: 10px; } this is extremely useful in the case of browser prefixes. However this same concept could be used to encapsulate commonly-used css, for example: .column-container { overflow: hidden; display: block; width: 100%; } .column(@width) { float: left; width: @width; } and then use this mixin whenever i need columns in my design: .my-column-outer { .column-container(); background: red; } .my-column-inner { .column(50%); font-color: yellow; } (of course, using the preprocessor we could easily expand this to be much more useful, eg. pass the number of columns and the container width as variables and have LESS determine the width of each column depending on the number of columns and container width!) the problem with this is that when compliled, my final css file would have 100 such declarations, copy&pasted, making the file huge and bloated and repetitive. The alternative to this would be to use a grid system which has predefined classes for each column-layout option, eg .c-50 ( with a "float: left; width:50%;" definition ), .c-33, .c-25 to accomodate for a 2-column, 3-column and 4-column layout and then use these classes to my dom. i really mislike the idea of the extra classes, from experience it results to bloated dom (creating extra divs just to attach the grid classes to). Also the most basic tutorial for html/css would tell you that the dom should be separated from the styling - grid classes are styling related! to me, its the same as attaching a "border-radius-10" class to the .rounded-div example above! on the other hand, the large css file that would result from the repetitive code is also a disadvantage so i guess my question is, which one would you recommend? and which do you use? and, which solution is best for optimization? apart from the larger file size, has there even been any research on whether browser renders multiple classes faster than a large css file, or the other way round? tnx! i'd love to hear your opinion!

    Read the article

  • Are preprocessors obsolete in modern languages?

    - by Earlz
    Hello, I'm making a simple compiler for a simple pet language I'm creating and coming from a C background(though I'm writing it in Ruby) I wondered if a preprocessor is necessary. What do you think? Is a "dumb" preprocessor still necessary in modern languages? Would C#'s conditional compilation capabilities be considered a "preprocessor"? Does every modern language that doesn't include a preprocessor have the utilities necessary to properly replace it? (for instance, the C++ preprocessor is now mostly obsolete(though still depended upon) because of templates.)

    Read the article

  • MS Dev Studio 2005 Ignores Preprocessor directives during compile

    - by miked
    We just got a new developer and I'm trying to set him up with Dev Studio 2005 (The version we all use at this office), and we're running into a weird problem that I've never seen before. I have some code that works perfectly on my system, and he can't seem to get it compiled. We've tracked the issue down to his copy of dev studio ignoring the preprocessor directives. For example, in the project properties under C/C++|Preprocessor|Preprocessor Directives, I add DEFINE_ME. Which should translate to a /D"DEFINE_ME" for the compiler. And it does in my development environment, but it doesn't on his. I verified that when he checks out the code from the source repository, that he has the same version of the code I do. And if I look in his Project Properties, all of the directives are there. For some reason they're just not getting passed down to the compiler. Any Ideas?

    Read the article

  • Visual Studio 2005 Ignores Preprocessor directives during compile

    - by miked
    We just got a new developer and I'm trying to set him up with Dev Studio 2005 (The version we all use at this office), and we're running into a weird problem that I've never seen before. I have some code that works perfectly on my system, and he can't seem to get it compiled. We've tracked the issue down to his copy of dev studio ignoring the preprocessor directives. For example, in the project properties under C/C++|Preprocessor|Preprocessor Directives, I add DEFINE_ME. Which should translate to a /D"DEFINE_ME" for the compiler. And it does in my development environment, but it doesn't on his. I verified that when he checks out the code from the source repository, that he has the same version of the code I do. And if I look in his Project Properties, all of the directives are there. For some reason they're just not getting passed down to the compiler. Any Ideas?

    Read the article

  • llvm preprocessor g++ passes

    - by anon
    Suppose I want to write my own preprocessor. So I want something like this: all *.cpp and *.hpp (even the included ones), before they go to g++, they go: file --> my preprocessor -> g++ Is there a easy way to do this in the LLVM framework? i.e. to add in a stage that says: "after you load up the source file, pipe it through this program before compling it" ? Thanks!

    Read the article

  • Easiest way to use speex preprocessor in C#?

    - by eselk
    I need to use the speex preprocessor, and only the preprocessor in my VOIP app (don't need to use the codec). My app is written in C#. I think I know the easiest steps, but not sure where to find these items. Easiest in my opinion, if I can find these: Windows DLL that contains only the preprocessor functions, or if small enough in size I guess the entire speex library would be OK. So far I've only found binarys in EXE format, so if I can't find the binaries I'd have to install the compiler they use to build their source and probably several other libraries (as is my experience with most open source builds). C# versions of the header files, for pinvoking the DLL functions. So my question is, does anyone know where I can find these? I'm sure people have created these before, based on the huge number of speex users, just not able to find any on-line. Hope people don't think I'm lazy, I just hate doing this kind of "busy work" if I know many others have probably already done the exact same thing :) Update: I did find http://www.rarewares.org/files/others/libspeex-dll-1.2rc1.zip which includes libspeex.dll, but the DLL has no exports so not sure how they expect that to work. The other binaries they have are also just EXEs.

    Read the article

  • Additional macro support in clang?

    - by anon
    Since LLVM/cLang is especially well designed. This seems like a great opportunity to augment the C/C++ macro/preprocessor system. Does anyone know of additional macro/preprocessor abilities added by Clang or side projects to make the macro system more powerful (like turing complete) Thakns! Note: I am asking about macros. Not C++ templates. Readers: pleaser downvote any answers referring to templates. I want this thread to be macro/preprocessor specific.

    Read the article

  • How can I create different DLLs in one project?

    - by jaloplo
    I have a question I don't know if it can be solved. I have one C# project on Visual Studio 2005 and I want to create different DLL names depending on a preprocessor constant. What I have in this moment is the preprocessor constant, two snk files and two assembly's guid. I also create two configurations (Debug and Debug Preprocessor) and they compile perfectly using the snk and guid appropiate. #if PREPROCESSOR_CONSTANT [assembly: AssemblyTitle("MyLibraryConstant")] [assembly: AssemblyProduct("MyLibraryConstant")] #else [assembly: AssemblyTitle("MyLibrary")] [assembly: AssemblyProduct("MyLibrary")] #endif Now, I have to put the two assemblies into the GAC. The first assembly is added without problems but the second isn't. What can I do to create two or more different assemblies from one Visual Studio project? It's possible that I forgot to include a new line on "AssemblyInfo.cs" to change the DLL name depending on the preprocessor constant?

    Read the article

  • Eclipse Blackberry Preprocessor Not Working?

    - by Jessica
    I've already followed the directions @ http://stackoverflow.com/questions/1383277/using-preprocessor-directives-in-blackberry-jde-plugin-for-eclipse for making sure the blackberry plugin preprocessing hook is (theoretically) enabled. I'm using Eclipse 3.5.1 with Blackberry Plugin 1.1 with BB SDKs 4.7.0 and 4.6.0. I have my preprocessor defines set (and I've tried in both the Project's Blackberry Properties as well as the Workspace Blackberry Build settings), and checked their capitalization and spelling carefully too. I'm fairly confident the actual code to say "this stuff should be preprocessed" is good, because including/excluding preprocessed code seems to work fine on command line builds: //#preprocess --- at beginning of file and then code blocks like this throughout: //#ifndef jde_4_7 /* //#endif //#ifdef jde_4_7 import net.rim.device.api.ui.TouchEvent; //#endif //#ifndef jde_4_7 */ //#endif So what I can't figure out what else could be wrong that would cause Eclipse to not compile in my preprocessed code unless I remove the comments that are supposed to prevent the touch code from building into a build for blackberries that don't support touch. At one point it used to work (and no I haven't updated Eclipse), but sometime in the last couple of weeks it seemed to just stop working. And I'm getting kind of tired of the error-prone process of searching for ifdefs and manually commenting/uncommenting touch code and looking for a better solution while I do testing and initial development requiring testing both touch and non-touch functionality. Any other ideas on what could be wrong or how to fix it?

    Read the article

  • Is it better to use preprocessor directive or if(constant) statement?

    - by MByD
    Let's say we have a codebase that is used for many different costumer, and we have some code in it that relevant only for costumers of type X. Is it better to use preprocessor directives to include this code only in costumer of type X, or to use if statement, to be more clear: // some code #if TYPE_X_COSTUMER = 1 // do some things #endif // rest of the code or if(TYPE_X_COSTUMER) { // do some things } The arguments I can think about are: Preprocessor directive results in smaller code footprint and less branches (on non-optimizing compilers) If statements results with code that always compiles, e.g. if someone will make a mistake that will harm the irrelevant code for the project he works on, the error will still appear, and he will not corrupt the code base. Otherwise he will not be aware of the corruption. I was always been told to prefer the usage of the processor over the usage of the preprocessor (If this is an argument at all...) What is preferable - when talking about a code base for many different costumers?

    Read the article

  • How do I override a python import?

    - by Evan Plaice
    So I'm working on pypreprocessor which is a preprocessor that takes c-style directives and I've been able to make it work like a traditional preprocessor (it's self-consuming and executes postprocessed code on-the-fly) except that it breaks library imports. The problem is. The preprocessor runs through the file, processes' it, outputs to a temp file, and exec() the temp file. Libraries that are imported need to be handled a little different because they aren't executed but rather loaded and made accessible to the caller module. What I need to be able to do is. Interrupt the import (since the preprocessor is being run in the middle of the import), load the postprocessed code as a tempModule, and replace the original import with the tempModule to trick the calling script with the import into believing that the tempModule is the original module. I have searched everywhere and so far, have no solution. This question is the closest I've seen so far to providing an answer: http://stackoverflow.com/questions/1096216/override-namespace-in-python Here's what I have. # remove the bytecode file created by the first import os.remove(moduleName + '.pyc') # remove the first import del sys.modules[moduleName] # import the postprocessed module tmpModule = __import__(tmpModuleName) # set first module's reference to point to the preprocessed module sys.modules[moduleName] = tmpModule moduleName is the name of the original module, tmpModuleName is the name of the postprocessed code file. The strange part is, this solution still runs completely normal as if the first module completed loaded normally; unless you remove the last line, then you get a module not found error. Hopefully someone on SO know a lot more about imports than I do because this one has me stumped.

    Read the article

  • Unrecognized input filetype FFMPEG gas-preprocessor.pl

    - by Eyal
    Hi, I try to use FFMPEG in the iPhone, I follow by this link http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html When I running the ./configure --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.2.1 --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.2.1' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk --enable-cross-compile --target-os=darwin --arch=arm --cpu=arm1176jzf-s script I getting the error: “Unrecognized input filetype at /bin/sh line 23? Pls help me. Thanks, Eyal.

    Read the article

  • Fold C Preprocessor in VIM

    - by Sunny
    Is it possible to fold C preprocessor in VIM. For example: #if defined(DEBUG) //some block of code myfunction(); #endif I want to fold it so that it becomes: +-- 4 lines: #if defined(DEBUG)---

    Read the article

  • C preprocessor vs. C compiler

    - by Sunny209
    If I tell the C preprocessor to #include a file and use CPPFLAGS to help find the needed file, then the file is included already, right? What, if any, use is telling the C compiler about the same include directory with CFLAGS?

    Read the article

  • Problem with WiX Votive 3.0 preprocessor

    - by Leith Bade
    I have just started using WiX for the first time. I added a WiX Votive project to my existing C project. To automatically select the correct source folder for the binaries add used the following: <Directory Id="INSTALLLOCATION" Name="Trapeze Capture For Objective" FileSource="$(var.CaptureForObjective.TargetDir)"> That results in the following error: 1C:\code\CaptureForObjective\Installer\Product.wxs(10,0): error CNDL0150: Undefined preprocessor variable '$(var.CaptureForObjective.TargetDir)'. The C project is called CaptureForObjective, and the WiX project is called Installer. What do I need to do to get this to work?

    Read the article

  • Reliable portability for C code without relying on the preprocessor

    - by Yktula
    Relying on the preprocessor and predefined compiler macros for achieving portability seems hard to manage. What's a better way to achieve portability for a C project? I want to put environment-specific code in headers that behave the same way. Is there a way to have the build environment choose which headers to include? I was thinking that I'd put the environment-specific headers into directories for specific environments. The build environment would then just copy the headers from the platform's directory into the root directory, build the project, and then remove the copies.

    Read the article

  • #ifdef with gfortran 77

    - by ccook
    I am using gfortran to compile FORTRAN 77 and would like to have DEBUG build options by using the preprocessor directive #ifdef. However, when I use them I get compile time warnings "Illegal preprocessor directive". Is it possible to have this functionality without deviating from the standard toolchain?

    Read the article

  • Xcode/GCC predefined macro for target name?

    - by Justicle
    I was wondering if there is an Xcode or GCC preprocessor symbol for the target name of the application. For example if I'm building an application called "MonkeyChicken", is there a preprocessor symbol such that printf( __TARGET_NAME__ ) outputs: MonkeyChicken

    Read the article

  • C preprocessor problem in Microsoft Visual Studio 2010

    - by Remo.D
    I've encountered a problem with the new Visual C++ in VS 2010. I've got a header with the following defines: #define STC(y) #y #define STR(y) STC(\y) #define NUM(y) 0##y The intent is that you can have some constant around like #define TOKEN x5A and then you can have the token as a number or as a string: NUM(TOKEN) -> 0x5A STR(TOKEN) -> "\x5A" This is the expected behavior under the the substitution rules of macros arguments and so far it has worked well with gcc, open watcom, pellesC (lcc), Digital Mars C and Visual C++ in VS2008 Express. Today I recompiled the library with VS2010 Express only to discover that it doesn't work anymore! Using the new version I would get: NUM(TOKEN) -> 0x5A STR(TOKEN) -> "\y" It seems that the new preprocessor treats \y as an escape sequence even within a macro body which is a non-sense as escape sequences only have a meaning in literal strings. I suspect this is a gray area of the ANSI standard but even if the original behavior was mandated by the standard, MS VC++ is not exactly famous to be 100% ANSI C compliant so I guess I'll have to live with the new behavior of the MS compiler. Given that, does anybody have a suggestion on how to re-implement the original macros behavior with VS2010?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >