symbols

Lisp symbols without package bindings

人盡茶涼 提交于 2019-12-10 22:24:07
问题 I've been working on some project. It should be able to do numerical and symbolic computing. But now I stuck on one problem and I don't really know how to resolve it. To be specific and short, let's say we are in package (in-package #:brand-new-package) Where we have symbol database (defvar var-symbol-database (make-hash-table :test #'equal)) Reading and setting functions (defun var-symbol (name) (get-hash name var-symbol-database)) (defun set-var-symbol (name value) (setf (get-hash name var

Is it valid to use Object.defineProperties with symbols?

偶尔善良 提交于 2019-12-10 18:38:54
问题 Let's take the following code: var obj = {}; var x = Symbol(); Object.defineProperties(obj, { [x]: { value: true, writable: true }, "property2": { value: "Hello", writable: false } // etc. etc. }); console.log(obj[x]) Is this valid? With the native Object.defineproperties code we get in the console.log true. With the polyfill of zone.js which is of the form of : Object.defineProperties = function (obj, props) { Object.keys(props).forEach(function (prop) { Object.defineProperty(obj, prop,

Fitnesse Slim: How to concatenate symbol

不羁的心 提交于 2019-12-10 18:22:17
问题 How would one concatenate a symbol with text on either side? For example: Prefix: "GAR_" Variable: $todayDate Suffix: "_1" GAR_$todayDate_1 Which would evaluate to: GAR_07202012_1 When running the test in fitnesse, it seems as though the concatenation is working ( GAR_$todayDate->[07202012]_1 ). However, I am passing this value as a parameter to visual studio and I instead end up with the following text: GAR_$todayDate_1 . When I remove the suffix or put a space between $todayDate and "_1" ,

WinDbg: APPLICATION_HANG_WRONG_SYMBOLS

天大地大妈咪最大 提交于 2019-12-10 17:52:18
问题 I'm pretty new to WinDbg and I'm trying to find a bug which has my application hanging for no appearent reason. I'm not sure I'm doing things right, but I understand that I need both symbols for the system dlls aswell as the .exe I'm debugging. Thus, I set up my symbol path like this: srv*c:\websymbols*http://msdl.microsoft.com/download/symbols;S:\MY\PATH The second path pointing to a folder where I placed the .pdb that was generated by VS. I'm positive that's the correct .pdb file, but it

SDL in XCode 4.3.2 SDLMain.o undefined symbols

て烟熏妆下的殇ゞ 提交于 2019-12-10 17:31:29
问题 I have started trying to use SDL in Xcode 4.3.2 so I started up a Cocoa application for Mac OS X and connected all my frameworks : OpenGL, SDL etc. I don't have SDL_Image, SDL_Mixer etc. (Do I need these?) When I try to compile the project that just has SDLmain.h and SDLmain.m I get this error: Undefined symbols for architecture x86_64: "_SDL_main", referenced from: -[SDLMain applicationDidFinishLaunching:] in SDLMain.o ld: symbol(s) not found for architecture x86_64 clang: error: linker

Debugging a renamed DLL?

Deadly 提交于 2019-12-10 17:29:27
问题 I am having problems trying to debug a DLL, which has been renamed during the post-build process: WinDBG fails to load the correct symbols (pdb file). Example: Original file name was: abc.dll The created PDB is named: abc.pdb During post-build process the DLL was renamed to 'a-b.DLL'. For some reason when debugging I can see the module apears as 'a_b.dll' (hyphen was replaced by underscore, not sure why this happen). In addition, WinDBG cannot load its symbols. I tried ld a_b /f abc , and

Why do callbacks use symbols in Ruby on Rails

泪湿孤枕 提交于 2019-12-10 17:15:50
问题 I am struggling to understand when and when not to use symbols in Rails. I understand that symbols are not too dissimilar from a string without many of the methods. I also understand the symbols make good keys as symbols of the same name occupy one address in memory. What I struggle to understand is why Rails decides to use symbols in some cases. If I had the callback before_action :ask_stack_overflow_question def ask_stack_overflow_question puts "why did I just use a symbol?" end I don't

How to unmangle exported symbols from C++ in dynamic libraries in XCode on OSX

℡╲_俬逩灬. 提交于 2019-12-10 16:23:30
问题 I've been trying to develop a dynamic library in C++ that can be run-time loaded in an application. I finally got it working, but it's a little ugly. I have a function that takes a pointer to a C++ class as an argument, which looks like this: bool registerGrindPlugin( Grind::PluginManager* mgr ); But of course it's being exported as: _Z19registerGrindPluginPN5Grind13PluginManagerE I tried a .c file with a simple function and it exported fine as "registerGrindPlugin", but of course I can't

How do I evaluate a symbol returned from a function in Scheme?

南笙酒味 提交于 2019-12-10 15:47:15
问题 I'm refamiliarizing myself with Scheme and I've hit a problem that is probably reflecting a fundamental misunderstanding on my part. Say I do the following in Scheme (using Guile in this case but it's the same in Chicken): > (define x 5) > x 5 > (string->symbol "x") x > (+ 5 (string->symbol "x")) <unnamed port>:45:0: In procedure #<procedure 1b84960 at <current input>:45:0 ()>: <unnamed port>:45:0: In procedure +: Wrong type: x > (symbol? (string->symbol "x")) #t > (+ 5 x) ; here x is

print non-ASCII / symbolic characters in Matlab

本秂侑毒 提交于 2019-12-10 15:38:45
问题 I'd like to have a statement that did: my_angle = 1*pi; fprintf('My angle is %.3f pi.\n',my_angle/pi); but that produced My angle is 1.000 pi , instead of the actual π character. I'm thinking some sort of use of Unicode... I found some related things: Page on Unicode pi Sort of related SO question Perhaps a more relevant SO question 回答1: I don't know how to do it with fprintf , but sprintf works – just leave off the semicolon: sprintf('My angle is %.3f %c.\n',my_angle,char(960)) Or you can