Atom snippets package not working - code-snippets

I created Atom snippets package https://atom.io/packages/angular2-snippets-atom
however I think its not working. What is wrong?
My snippets work if I add them in through > open your snippets and paste in snippets.cson

It looks like you fixed it with this push. You had a reference to a main file that didn't exist, and an activationCommand that called a method that didn't exist.
Methods called by activationCommands should exist on the object exported by file specified by main. In this case you had neither so it was failing.

Related

Lua require error if script is called "table.lua"?

Trying to replicate this simple Lua example (using the improved code in the second post), I encountered the following strange issue:
I copied the code verbatim, but happened to call the first file "table.lua" (instead of "funcs.lua").
The second file was called "main.lua" as in the example.
In my case, whatever I tried, I invariably got the popular error message "attempt to call field 'myfunc' (a nil value)" (as if the require statement had been ignored; but path etc. were all in order).
After two hours of trying and hunting for info, I more or less on a hunch renamed the first file from "table.lua" to "tabble.lua", and then everything promptly worked as expected. Renaming to e.g. "tables.lua" will also work.
Being very new to Lua, I'd still like to understand what exactly went wrong. Initially I thought the reason might be that "table" is a reserved Lua word, but all references I checked do not list it as such.
So what is going on here?
I am using LuaForWindows v5.1.4-46 with the included SciTE editor/IDE (v.1.75).
Thanks for all hints.
The standard libraries math, io, string, …, and table are pre-defined (and pre-loaded) in the Lua interpreter. Because require caches modules by name, saying require "table" will return the standard table library instead of loading your own table module from a file.
A good way to solve the problem is to create a folder and put your library files in there. If the folder is called mylib, then require "mylib.table" will work and load the file.
Alternatively, if you just need to load the file once and do not need the features of require (searching the file in a number of directories, caching loaded libraries), you can use loadfile: Change require "table" to loadfile "./table.lua" () (where ./table.lua should be the full (relative is fine) path to the file.)

How to use ros::pluginlib to load multi-library

I am trying to use ros::pluginlib to load a plugin called A_Plugin which has been registered to ROS Package System correctly. One thing to note is that A_Plugin depends on Opensplice DDS, and it need to link the DDS libraries "libddskernel.so" ,"libdcpsisocpp.so". In CmakeLists.txt file, I write like this:
```
add_library(A_Plugin
src/aplugin.cpp
)
target_link_libraries(A_Plugin
$ENV{OSPL_HOME}/lib/libddskernel.so
$ENV{OSPL_HOME}/lib/libdcpsisocpp.so
)
```
It can be registered to ROS package system correctly, but when I use pluginlib::ClassLoader to load A_plugin, I got the following errors:terminate called after throwing an instance of 'pluginlib::CreateClassException'what(): MultiLibraryClassLoader: Could not create object of class type test::A_Plugin as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary(). How can I solve this problem? Thanks!
I had a similar problem, turns out I was missing the plugin class declaration in the *.cpp file. I included it and it worked fine. The declaration should be something like:
PLUGINLIB_DECLARE_CLASS(rqt_example_cpp, MyPlugin, rqt_example_cpp::MyPlugin, rqt_gui_cpp::Plugin)
This can be seen in the example from the rqt tutorial github repo, line 62:
https://github.com/lucasw/rqt_mypkg/blob/master/rqt_example_cpp/src/rqt_example_cpp/my_plugin.cpp

Using signature file in script

I like using .fsi signature files to control visibility. However, if I have both Foo.fsi and Foo.fs files in my solution, and #load "Foo.fs" in a script, it doesn't seem like the corresponding signature file gets used. If I do:
#load "Foo.fsi"
#load "Foo.fs"
... then the desired visibility control happens. Is this the recommended way to achieve this, or is there a better way to do it? In a perfect world, one would like to see the signature file automatically loaded, too.
Not a final answer, but a better way.
From reading Expert F# 4.0 one can do
#load "Foo.fsi" "Foo.fs" "Foo.fsx"
All three loads are on one line.
TL;DR
The link to the book is via WolrdCat just put in a zip code and it will show you locations near there where the book can be found.

Xcode sees only some of similar extensions of a nested class written in separate files

I'm trying to keep my code as readable as it possible by keeping methods and files as short as I can and using nested classes for namespacing. It works fine except some really strange moment.
I have some class used for namespacing.
class Space { }
All classes used within that one are implemented in their own files as extensions.
extension Space {
class SomeClass {
// implementation
}
}
One of those SomeClasses have a number of quite sophisticated initialisers, so I have split them up to their own files as well and implemented it as follows:
extension Space.SomeClass {
convenience init(fromSomeSource source: SourceClass) {
self.init()
// other implementation
}
}
The problem is that some of those files works just fine, but some of them throwing 'SomeClass' is not a member type of 'Space' and I don't know why.
All of them are pretty similar. The only difference is implementation of an initialiser itself. All files are held in the same place and I have no idea why some of them works fine and some not.
I tried to move code from not working files into files that works fine and that works – Xcode agrees to see the code and said nothing against it. But when the very same code lies in its own file – Xcode or compiler doesn't want to understand that SomeClass is really a member of Space.
I tried to clean the build, including manual dumping of ~/Library/Developer/Xcode/DerivedData folder. Nothing helps.
Surely I can put it all in a single file and it will work fine, but what the reason why it so picky in my case?
I've tried to create a new file and move there all contents from one of the bad ones. It works, but only with certain file names. Some names gives the same error again, but it seems that if name is totally new and not similar to any of the existing ones - it works. Magic?
I've encountered similar issue, it seems like the complier is trying to process the file where you extend the nested class before the one where it's defined. Therefore you have this error saying that that Space has no member SomeClass.
The solution I've found is to go to your target settings, open Build Phases.
There, in Compile Sources section you should put the file where you define the nested class above files where you extend it.
This solution seems to even play well with your observation that when you recreate the file it sometimes compiles, because when you recreate the file its position in Compile Sources changes.

Attributes from MvxBindingAttributes are not added with MvvmCross

I have the MvxBindingAttributes.xml in my UI.Droid/Resources/Values but everytime I try to use the bindings in my layouts I get
Warning attribute is not declared.
No resource identifier found for attribute 'MvxBind' in package
'DroidUI'
so for some reason it cannot find those attributes. I have tried to close/reopen/clean/rebuild with no luck, tried removing the layouts and then building (Hoping it would add them at build) and then try to add them again, but nothing seems to work
Have you checked that the MvxBindingAttributes.xml file is marked in properties as an AndroidResource?
VisualStudio likes marking the xml files as content or none instead - especially if you've added the MvxBindingAttributes.xml file as a link.
As an update to this, you can also now use a special 'auto' xml scheme:
xmlns:local="http://schemas.android.com/apk/res-auto"
In the project properties, add a Android Manifest file and add a package name that contains at least two periods, for example:
com.DroidUI
In the axml file, type the package name instead of the namespace:
xmlns:local="http://schemas.android.com/apk/res/com.DroidUI
xmlns:local="http://schemas.android.com/apk/res-auto
Fixed it for me.
First, thanks for the answer. I had the same problem.
But in my case, attempting to use the suggestions above failed. or at least that is what i thought.
When i used local:MvxItemTemplate=#layout/My_Manifest while i had the My_Manifest.axml file correctly placed in Layout folder, and correct xml schemas, it still had problems.
But, when i changed My_Manifest to my_manifest while leaving the actual file name as My_Manifest.axml, everything was working.
just wanted to share
In my case for some reason the MvxBindingAttributes.xml file existed, but hadn't been included in the project. Right-clicking on MvxBindingAttributes.xml and choosing "Include in Project" sorted the problem for me.
Just in case: You might also have rubbish (in my case, it were dots) in some of your XML. But the error pointed "Maybe there's something wrong with the auto-generated XML lol" so it took me half an hour to notice it... Sigh!

Resources