Search Results

Search found 1127 results on 46 pages for 'macro'.

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

  • Can I make clojure macro that will allow me to get a list of all functions created by the macro?

    - by Rob Lachlan
    I would like to have a macro which I'll call def-foo. Def-foo will create a function, and then will add this function to a set. So I could call (def-foo bar ...) (def-foo baz ...) And then there would be some set, e.g. all-foos, which I could call: all-foos => #{bar, baz} Essentially, I'm just trying to avoid repeating myself. I could of course define the functions in the normal way, (defn bar ...) and then write the set manually. A better alternative, and simpler than the macro idea, would be to do: (def foos #{(defn bar ...) (defn baz ...)} ) But I'm still curious as to whether there is a good way for the macro idea to work.

    Read the article

  • SQL Server Compact 'Data Directory' macro in Connection String - more info needed

    - by codeulike
    So, as described on this msdn page, when you define a Connection String for SQL Server Compact 3.5, you can use the "Data Directory" macro, like this: quote from this msdn page: Data Directory Support SQL Server Compact 3.5 now supports the Data Directory macro. This means that if you add the string |DataDirectory| (enclosed in pipe symbols) to a file path, it will resolve to the path of the database. For example, consider the connection string: "Data Source= c:\program files\MyApp\Mydb.sdf" When using Data Directory, you can instead use the following connection string: "Data Source = |DataDirectory|\Mydb.sdf" For more information, see How to: Deploy a SQL Server Compact 3.5 Database with an Application. However, the 'for more information' link on msdn doesn't actually give any more information. So my question is: How does the |Data Directory| macro translate at run time? For WinForm apps, it seems to just give the location of the executable. Or is it more complicated than that?

    Read the article

  • using macro defined in header files

    - by Neeraj
    I have a macro definition in header file like this: // header.h ARRAY_SZ(a) = ((int) sizeof(a)/sizeof(a[0])); This is defined in some header file, which includes some more header files. Now, i need to use this macro in some source file that has no other reason to include header.h or any other header files included in header.h, so should i redefine the macro in my source file or simply include the header file header.h. Will the latter approach affect the code size/compile time (I think yes), or runtime (i think no)? Your advice on this!

    Read the article

  • Call a macro every time any method is called - Objective C

    - by Jacob Relkin
    Hi, I wrote a debug macro that prints to the console the passed-in string whenever the global kDebug flag == YES. I need to print out the name of a method and it's classname whenever any method is called. That works fine when i painstakingly go through every method and write the name of the class and the method in a string. Is there any special handler that gets called when any method in Objective-C is called, and if so, is there a way i can somehow override it to call my debug macro?? The entire purpose of this is so that I don't have to go through every method in my code and hand-code the method signature in the debug macro call. Thanks

    Read the article

  • running excel macro from another workbook

    - by every_answer_gets_a_point
    I have a macro that is on a server. I need to be able to run it from different workstations that connect to this server. Currently I am doing: Application.Run ("L:\database\lcmsmacro\macro1.xlsm!macro_name") The error message I am getting is "The macro may not be available in this workbook #1004" I have already made sure that my security settings are set on the lowest level. How do I run a macro from another workbook which is hosted on a different server? would using add-ins help me?

    Read the article

  • Execute VBA Macro via C# Interop?

    - by Jon Artus
    Hi all, just wondering if anyone could suggest why I might be getting an error? I'm currently trying to execute a macro in a workbook by calling the Application.Run method that the interop exposes. It's currently throwing the following COM Exception: {System.Runtime.InteropServices.COMException (0x800A03EC): Cannot run the macro Macro1'. The macro may not be available in this workbook or all macros may be disabled. I've put the containing workbook in a trusted location, set all of the security settings to their minimum values, and trusted programmatic access to my object model. I'm entirely out of ideas and Google's failed me so far! Has anyone done this, or can you suggest anything which I could try? Many thanks!

    Read the article

  • Do we really need a safe release macro?

    - by Ian1971
    Quite a lot of people seem to use a macro such as #define SAFE_RELEASE(X) [X release]; X = nil; (myself included). I've been reassessing why I am using it and wanted to canvas some opinion. The purpose (I think) for using this macro is so that if you were to accidentally use your object after releasing it then you won't get a bad access exception because objective-c will quite happily ignore it when the object is nil. It strikes me that this has the potential to mask some obscure bugs. Maybe it would actually be preferable for the program to crash when you try to use X again. That way during testing you can find the issue and improve the code. Does this macro encourage lazy programming? Thoughts?

    Read the article

  • how is a macro expanded in clojure?

    - by john wang
    In the book Programming Clojure(Stuart), when read how macros are expanded I got confused. user=> (defmacro chain ([x form] (list '. x form)) ([x form & more] (concat (list 'chain (list '. x form)) more))) #'user/chain The above macro can be expanded as: user=> (macroexpand '(chain a b c)) (. (. a b) c) But the following is only expanded to the first level: user=> (macroexpand '(and a b c)) (let* [and__3822__auto__ a] (if and__3822__auto__ (clojure.core/and b c) and__3822__auto__)) The and macro source: user=> (source and) (defmacro and([] true) ([x] x) ([x & next] `(let [and# ~x] (if and# (and ~@next) and#)))) Why is the chain macro expanded all the way but the and not ? Why is it not expanded to something like the following: user=> (macroexpand '(chain a b c d)) (. (chain a b c) d)

    Read the article

  • Array-size macro that rejects pointers

    - by nneonneo
    The standard array-size macro that is often taught is #define ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0])) or some equivalent formation. However, this kind of thing silently succeeds when a pointer is passed in, and gives results that can seem plausible at runtime until things mysteriously fall apart. It's all-too-easy to make this mistake: a function that has a local array variable is refactored, moving a bit of array manipulation into a new function called with the array as a parameter. So, the question is: is there a "sanitary" macro to detect misuse of the ARRAYSIZE macro in C, preferably at compile-time? In C++ we'd just use a template specialized for array arguments only; in C, it seems we'll need some way to distinguish arrays and pointers. (If I wanted to reject arrays, for instance, I'd just do e.g. (arr=arr, ...) because array assignment is illegal).

    Read the article

  • Standardize word macro usage within the team

    - by user138010
    Hi, I have a team of 10 persons who work on word documents, they format them as per our defined guidlines. To complete the work fast we have created a macro that has been updated on all the machines. This macro corrects the font, size and formatting. How can I ensure and implement that nobody can change/replace or delete this macro from their system? In case this happens I should get an alert. Can something be done at the system or programme level? Thanks, PK

    Read the article

  • Getting macro keys from a razer blackwidow to work on linux

    - by Journeyman Geek
    I picked up a razer blackwidow ultimate that has additional keys meant for macros that are set using a tool that's installed on windows. I'm assuming that these arn't some fancypants joojoo keys and should emit scancodes like any other keys. Firstly is there a standard way to check these scancodes in linux? Secondly how do i set these keys to do things in command line and x based linux setups? My current linux install is xubuntu 10.10, but i'll be switching to kubuntu once i have a few things fixed up. Ideally the answer should be generic and system-wide Things i have tried so far: showkeys from the built in kbd package (in a seperate vt) - macro keys not detected xev - macro keys not detected lsusb and evdev output this ahk script's output suggests the M keys are not outputting standard scancodes Things i need to try snoopy pro + reverse engineering (oh dear) Wireshark - preliminary futzing around seems to indicate no scancodes emitted when what i seem to think is the keyboard is monitored and keys pressed. Might indicate additional keys are a seperate device or need to be initialised somehow. Need to cross reference that with lsusb output from linux, in 3 scenarios - standalone, passed through to a windows VM without the drivers installed, and the same with. LSUSB only detects one device on a standalone linux install It might be useful to check if the mice use the same razer synapse driver , since that means some variation of razercfg might work (not detected. only seems to work for mice) Things i have Have worked out: In a windows system with the driver, the keyboard is seen as a keyboard and a pointing device. And said pointing device uses, in addition to your bog standard mouse drivers.. a driver for something called a razer synapse. Mouse driver seen in linux under evdev and lsusb as well Single Device under OS X apparently, though i have yet to try lsusb equivilent on that Keyboard goes into pulsing backlight mode in OS X upon initialisation with the driver. This should probably indicate that there's some initialisation sequence sent to the keyboard on activation. They are, in fact, fancypants joojoo keys. Extending this question a little I have access to a windows system so if i need to use any tools on that to help answer the question, its fine. I can also try it on systems with and without the config utility. The expected end result is still to make those keys usable on linux however. I also realise this is a very specific family of hardware. I would be willing to test anything that makes sense on a linux system if i have detailed instructions - this should open up the question to people who have linux skills, but no access to this keyboard The minimum end result i require I need these keys detected, and usable in any fashion on any of the current graphical mainstream ubuntu varients

    Read the article

  • Windows keyboard macro playback software?

    - by WilliamKF
    Many years ago, I had a product called Quickeys for the Macintosh that allowed me to record keyboard and mouse events and create a macro that could be assigned to a keyboard accelerator. This was a really useful tool, but I haven't seen anything like it ever on Microsoft Windows OS platform. Does such a product exist?

    Read the article

  • Excel 2007 Macro Changes?

    - by Guy Thomas
    My excel macros are no longer working as designed. Last week they worked as expected, this week a different result. I even tried a two year old version, it did not work the way it used to. Guy's conclusion an Office / Excel update changed the macro behaviour. Am I alone in this conclusion? If so I'll take a different troubleshooting approach.

    Read the article

  • Macro to open excel hyperlinks

    - by admintech
    I would like to know if anyone can help me do a macro to open a list of hyper links. I have a list of about 600 hyper links all in a column in separate rows, i have to open each one to see if the link works, yet it is boring and tedious as i have to wait sometimes for excel to catch up i would much rather leave it doing 100 at a time while i do other things

    Read the article

  • Any utility to test expand C/C++ #define macros?

    - by Randy
    It seems I often spend way too much time trying to get a #define macro to do exactly what i want. I'll post my current delemia below and any help is appreciated. But really the bigger question is whether there is any utility someone could reccomend, to quickly display what a macro is actually doing? It seems like even the slow trial and error process would go much faster if I could see what is wrong. Currently, I'm dynamically loading a long list of functions from a DLL I made. The way I've set things up, the function pointers have the same nanes as the exported functions, and the typedef(s) used to prototyp them have the same names, but with a prepended underscor. So I want to use a define to simplfy assignments of a long long list of function pointers. For example, In the code statement below, 'hexdump' is the name of a typdef'd function point, and is also the name of the function, while _hexdump is the name of the typedef. If GetProcAddress() fails, a failure counter in incremented. if (!(hexdump = (_hexdump)GetProcAddress(h, "hexdump"))) --iFail; So lets say I'd like to rplace each line like the above with a macro, like this... GETADDR_FOR(hexdump ) Well this is the best I've come up with so far. It doesn't work (my // comment is just to prevent text formatting in the message)... // #define GETADDR_FOR(a) if (!(a = (#_#a)GetProcAddress(h, "/""#a"/""))) --iFail; And again, while I'd APPRECIATE an insight into what silly mistake I've made, it would make my day to have a utility that would show me the error of my ways, by simply plugging in my macro

    Read the article

  • SAS V9.1.3 - Error when combining %INC and CALL EXECUTE

    - by Mark
    Hi, I am getting a resolution error with some SAS v9.1.3 code. Here is some code I want to store in a .txt file (called problem2.txt) and bring into SAS with a %INC %macro email020; %if &email = 1 %then %do; %put THIS RESOLVED AT 1; %end; %else %if &email = 2 %then %do; %put THIS RESOVLED AT 2; %end; %put _user_; %mend email020; %email020; Then this is the main code: filename problem2 'C:\Documents and Settings\Mark\My Documents\problem2.txt'; %macro report1; %let email = 1; %inc problem2; %mend report1; %macro report2 (inc); %let email = 2; %inc problem2; %mend report2; data test; run = 'YES'; run; data _null_; set test; call execute("%report1"); call execute("%report2"); run; The log shows: NOTE: CALL EXECUTE generated line. 1 + %inc problem2; MLOGIC(EMAIL020): Beginning execution. WARNING: Apparent symbolic reference EMAIL not resolved. ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &email = 1 ERROR: The macro EMAIL020 will stop executing. MLOGIC(EMAIL020): Ending execution. So the question is why does CALL EXECUTE generate %inc problem2 rather than %report1, causing SAS to miss the assignment and what can I do about it?

    Read the article

  • Macro doesn't work in the function.

    - by avp
    I have problems with following code: http://lisper.ru/apps/format/96 The problem is in "normalize" function, which does not work. It fails on the fifth line: (zero-p a indexes i) (defun normalize (a &optional indexes i) "Returns normalized A." (pragma (format t "Data=~A ~A ~A" a indexes i) (if (zero-p a indexes i) a ;; cannot normalize empty vector (let* ((mmm (format t "Zero?=~a" (zero-p a indexes i))) (L (sqrt (+ (do-op-on * a :x a :x indexes i indexes i) (do-op-on * a :y a :y indexes i indexes i) (do-op-on * a :z a :z indexes i indexes i)))) (mmm (format t "L=~a" L)) (L (/ 1D0 L)) (mmm (format t "L=~a" L))) ; L=1/length(A) (make-V3 (* (ref-of a :x indexes i) l) (* (ref-of a :y indexes i) l) (* (ref-of a :z indexes i) l)))))) in function "normalize" I call the macro "zero-p", which in turn calls macro "ref-of", which is the last in the chain. (defmacro zero-p (v &optional indexes index) "Checks if the vector is 'almost' zero length." `(and (< (ref-of ,v :x ,indexes ,index) *min+*) (< (ref-of ,v :y ,indexes ,index) *min+*) (< (ref-of ,v :z ,indexes ,index) *min+*) (> (ref-of ,v :x ,indexes ,index) *min-*) (> (ref-of ,v :y ,indexes ,index) *min-*) (> (ref-of ,v :z ,indexes ,index) *min-*))) Here is ref-of: (defmacro ref-of (values coordinate &optional indexes index) "Please see DATA STRUCTURE for details." (if indexes (cond ((eq coordinate :x) `(aref ,values (aref ,indexes ,index))) ((eq coordinate :y) `(aref ,values (+ 1 (aref ,indexes ,index)))) ((eq coordinate :z) `(aref ,values (+ 2 (aref ,indexes ,index)))) (T (error "The symbol ~S is not :X, :Y or :Z." coordinate))) (cond ((eq coordinate :x) `(aref ,values 0)) ((eq coordinate :y) `(aref ,values 1)) ((eq coordinate :z) `(aref ,values 2)) (T (error "The symbol ~S is not :X, :Y or :Z." coordinate))))) Also, in "normalize" I call the macro "do-op-on", which calls "ref-of" as well. (defmacro do-op-on (op name1 coord1 name2 coord2 &optional is1 i1 is2 i2) "Example: (do-op-on * A :x B :y i n) == A[i[n]].x*B.y" `(,op (ref-of ,name1 ,coord1 ,is1 ,i1) (ref-of ,name2 ,coord2 ,is2 ,i2))) As a result, instead of having this: (aref some-array 0) I have (aref NIL NIL) which is created in "ref-of". I suppose that I lose the symbol A from the call (normalize A). I just feel that the symbol does not survive the macroexpanson. The thing is, macroexpansoin works in REPL for each macro independently. Can anyone explain where is the mistake?

    Read the article

  • Insert a snippet from a Visual Studio macro

    - by Kyralessa
    I have a situation where I want to run a Visual Studio macro that has the user type something in an InputBox, then inserts a snippet and includes that text somewhere in it. Unfortunately, I can't figure out how to insert the snippet from macro code. It seems like it'd be something like DTE.ExecuteCommand("Edit.InvokeSnippetFromShortcut") or DTE.ExecuteCommand("Edit.InvokeSnippetFromShortcut", "theSnippetName") but those don't work. Any ideas?

    Read the article

  • How to create nested macro in BOO

    - by Neo
    Hi, I am creating nested macros in BOO, I wrote this program: macro text: macro subMacro: text["Text"] = "Hello World" return [| block: System.Console.WriteLine( "Hello World" ); |] But I am getting the error "Unknown Identifer: 'text'" in the 3rd line of the code.

    Read the article

  • What is needed to invoke LibreOffice running just the macro without the GUI?

    - by C.W.Holeman II
    Invoking LibreOffice and running a macro via the GUI works as expected producing three HTML files, one for each spreadsheet page: $ libreoffice x.ods Tools>Macros>Run Macros... Library: LibreOffice Macros> ExportSheetsToHTML Macro Names: exportsheetstohtml.js Run When attempting to invoke just the macro it just hangs: $ libreoffice\ -invisible\ -nofirststartwizard\ -headless\ -norestore\ x.ods "macro:///LibreOffice Macros.ExportSheetsToHTML.exportsheetstohtml.js" $ ps x | grep libreoffice 11286 pts/0 S+ 0:00 /bin/sh /opt/libreoffice/program/soffice -invisible -nofirststartwizard -headless -norestore x.ods macro:///LibreOffice Macros.ExportSheetsToHTML.exportsheetstohtml.js 11296 pts/0 Sl+ 0:58 /opt/libreoffice/program/soffice.bin -invisible -nofirststartwizard -headless -norestore x.ods macro:///LibreOffice Macros.ExportSheetsToHTML.exportsheetstohtml.js Version info: Linux road 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux LibreOffice 3.3.0 OOO330m19 (Build:6) tag libreoffice-3.3.0.4

    Read the article

  • macro function in libcurl which return the libcurl version

    - by Mohamed KALLEL
    I m developing a c program using libcurl. when I build my program I can use different version of libcurl. When I change from version to other (of libcurl) I have to change some blocks in my source code to adapt it to the libcurl version. I'm looking to add macro in my code which will check the libcurl version and then determine which block of source code to use automatically Are there a macro function or constant in libcurl which return the libcurl version?

    Read the article

  • How to write (simple) macro?

    - by krzysz00
    I need to write a macro (with-hooks (monster method who what) &body body) for a game I'm writing. Monster is a CLOS object, method and who are strings and what is a function (#' notation). The macroexpansion would be something to the effect of (add-hook monster method who what) ,@body (remove-hook monster method who) I have absolutely no idea how to write such a macro, and I would appreciate some help.

    Read the article

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