Altium Snippets - Desginators are missing when placed - code-snippets

I am trying to reuse a part of my previous project, hence I created snippets for both schematic and pcb layout (see https://www.youtube.com/watch?v=R3HyuQ_N23A)
However, when placing the snippets in a new schematic page, all designators are changed to question mark (like C?) thus unable to sync with the pcb layout. How can I keep the designator when placing them in the schematic. Is this related to copy-paste behavior? Usually when paste a component its designator change to a question mark.

Uncheck "Reset Part Designators on Place" in Tools->Preferences.

Related

Template Dialogue Box not showing up when trying to create a new file in a Xcode Workspace

When I right click to add a new file (or do File -> New -> File), I don't get a dialogue box asking me which Template I want to use. It just creates a blank file like this:
I tried renaming it to a .swift file and adding in all the necessary code to start off, but two things happen:
First, the autocomplete function is one step behind. So when I've already typed import UIKit and moved on, it starts trying to autocomplete UIKit. And when I've already typed class className: UICollectionViewController {
} and moved on, it starts trying to autcomplete UICollectionViewController
After I manually type in the bare minimum needed to make a swift file into a UICollectionViewController with a colored background, I can't reference it in my other files.
I can only assume this is because of the lack of a template dialogue box, but maybe I'm wrong. Is there any way to toggle this template dialogue box on or off?
This problem is only happening with this particular project since I updated to Xcode 10.1
I can't seem to find anyone else online who's already had this issue. The only similar questions I found online were referring to creating reference folders rather than groups. I didn't find anything regarding the file template dialogue box not showing up.
I fixed this and I'll post the answer in case anyone else comes across this problem.
It was tedious, but I:
Created a new project
Initialized my podfile, added what was in the previous one, and installed it
Opened up the new workspace
Added each file one by one
Maybe there's an easier/quicker way to do it, but after looking through all the settings and not finding anything, I ended up doing this and it worked.
Check that in the left hand pane displaying your project structure you are adding the new file to a folder which comes under your application (identified by a blue Xcode application icon) instead of a general folder as your top level (identified by a blue folder icon). I can't add images yet so please see link.

Xcode - Invalid character in source file (Replace " " with " ")

I have a question about Xcode (Swift). Sometimes when I write an if statement. Something like this:
if(a == 2){
//do Sth
} else {
//do Sth
}
Xcode throws me an error: "Invalid character in source file"
I know it is no big deal and fixed by clicking on "Fix-it" but I want
to know what is the problem. That doesn't make sense to me...
My Xcode is on 7.2 and I am using Swift - I don't know if this is just a Swift problem.
For me it's the ESC key - it's completely reproducible! If I go to search and hit ESC in the search window I also find the occurrences marked - and can replace those with nothing. But it's not shown even with "Show invisible"!
final solution: Bind ESC keybinding to "Cancel". It's that simple.
I was having this problem. The way I solved it is by 1) copying whatever you have into Sublime Text or another code editor and having a look (you may need to enable viewing hidden characters). Mine had a code in there DC2 which is some sort of ASCII control character. For me it was caused by the fact that I had put the playground into manual execute and bound a keyboard shortcut to it that seemed to be entering that control character every time I executed it using the shortcut. I just changed the shortcut and removed the ASCII characters as I was able to see them in Sublime Text. (The link in the comments to the OP concerning left to right mode made no sense and didn't work for me.)
I encountered this problem when I was using a non-Apple keyboard with my iMac. Probably your case too. They add unnecessary control characters! One way to fix it in Xcode ischoose from the menu Editor>Show Invisibles and see if there are any unwanted characters where the error is being thrown and remove them.
Editor->Show Invisibles did not show the character that was causing a problem for me. No-break-space (u00a0) will be shown as a space with no "dot" indicator. However, that's really hard to see and I completely missed it the first time. Zoom helps.
One way I found to detect invalid characters is to use Visual Studio Code and enable the settings:
"editor.renderControlCharacters": true
"editor.renderWhitespace": "all"
This has the same visibility issue with no-break-space as Xcode, however it does show other special characters.
To make it more obvious and possibly detect more invalid characters, install the extension "ascii-unicode-escape" and follow the instructions.
I don't understand why Xcode allows these invalid characters, inserts them into your source files for no reason, and doesn't even give an option to detect them! I'm trying to write code, not secrets in invisible ink, damnit!! I guess it's less of an issue for compiled code, which will show an error, but not so convenient with shader code.
I'm having the same issue. I found a solution after extensive testing. Hopefully it could save others extensive hours of researching into this terrible Xcode experience.
The problem is I have a FILCO Minila keyboard, which has the 'App' key right next to 'left arrow'. I would accidentally hit 'App' when typing really fast, and it enters a 'DEL'(Data Link Escape, Unicode 0010) invisible character. It could only be seen when copy-pasted to Sublime. It's not even visible under Xcode's own 'Editor -> Show Invisibles'(Talking about good user experience...)
Magically this doesn't happen to Sublime or VSCode, only to Xcode. So no excuses for Xcode I guess?
The fix is to download Karabiner, an advanced keymapper for macOS, and invalidate the 'App' key or map it to something else. Karabiner would also invalidate your keymapping in the system default keyboard config. So you would have to remap stuff like 'cmd', 'alt' if you've customized them. If so, be sure to map both left & right modifier keys in Karabiner, because according to Karabiner's key event viewer, the system default keymap would map left_alt & left_cmd to right_cmd and right_alt... Just annoying as hell...
It took me 2 months to realize this problem and 2 hours to actually find out it's the 'app' key that's the culprit and fix it.
I'm using XCode 10.1.
With Xcode: Xcode does not help even after showing invisibles.
Then you can copy the code to Sublime Text => you will see these invisible characters which are the <0x0f>. Click the image to see in details.
With Sublime Text 3, it works!
=> Then you know where to remove the redundancies. Hope that helps!
Are you using the option ⌥ key for any keyboard shortcuts? This was my issue. It seems combining the option key with other keys can insert hidden characters.
For me, this happened when I used the ⌃+⌥+p shortcut in Xcode to resume the SwiftUI preview canvas. It added a 0x10 character. I discovered this, as other posters have recommended, by pasting the code from Xcode into Sublime Text.
(NB: I should have been using ⌘+⌥+p).

ignoring some text in Xcode's "Export for localization"

I am using the "Export for Localization" menu option in Xcode to generate XLIFF files for our translators.
Many of these labels will be changed at runtime populated with data. Is there a way to mark these labels, buttons, etc as not needing to be translated so that they do not make it to the XLIFF files? Right now I'm keeping the labels as "Label". Is there a way to mark it as non-translatable and could put in sample data that would be changed at runtime?
This question has been asked a few times before, and the answer was no: see for example Lou Franco's question here (with a Radar ID he has opened with Apple) and another one here. Unless Apple changes this behaviour in XCode you will have to live with workarounds like using a labelling mechanism or adding translate="no" attributes to your non-translatable <trans-unit> elements in XLIFF.

Disappearing files, refactoring mess

I'm pretty green, but I'm trying to modify a simple program to fit my own needs. You may remember the "BirdWatching" app from "Your Second iOS App: Storyboards" in the iOS Developer's Library.
Anyway, I've refactored most of the names, etc., successfully (it still worked), but then I tried to get rid of a file that kept appearing, even though its name had been expunged (or so I thought) through refactoring. Shows up in the Assistant Editor, right next to the file to which it was refactored.
Now I've got a mess. I tried to move the entire project into it's own folder, but now the compliler won't recognize the info-plist file (says it doesn't exist, and two other files are showing up in red, depending on their position in the navigator. However, it's the WMDG-info.plist that the complier complains about. Specifically, it appears to be following the old path to the file, even after it's been moved and re-added.
I've tried quitting and restarting xCode, re-adding the files, etc. I've searched under every keyword I can think of, but can't find a solution.
Please help!
Thanks!
--Tim

LaTeX not compiling properly

I'm using TeXshop, Natbib, Hyperef and two-column layout, and I am getting the following message:
\pdfendlink ended up in different
nesting level than \pdfstartlink
\AtBegShi#Output ...ipout \box \AtBeginShipoutBox
\fi \fi
which prevents LaTeX from compiling. This document compiles without problem when it is 'onecolumn', the problem only starts when it is 'twocolumn'.
I've searched online for solutions, but most of them are from a few years ago, and identify the problem as being caused by a 'long reference'.
Examples of solutions 1, 2
I've narrowed down the source of the problem to be a section that occurs after a table that is two columns wide. The section that follows does not have any references, but when I include it, it stops compiling. I have not included code here as to replicate the problem I need to include my entire document; it only occurs when there is a certain spacing.
Another reference, suggesting that is an obscure bug. I cannot apply their suggestion as I cannot locate the problem reference. I have, just shoved in a lot of spaces and it does compile, however this not really a solution for a working document.
Having the same problem here and it popped-up from nowhere. Interestingly if I comment out the hyperref package it works.
I believe a common cause for this error is a citation that is split across two pages. An easy test for this is to add some \vspace at the top of your document to force different page breaks. This has happened to me a few times, and my final solution typically involves rewriting the text to ensure that the offending citation does not cross the page break.
Make a copy of your LaTeX source and start ripping the content out of it until you have the smallest possible example that still causes this error.
If that alone reveals the problem, post it here as an answer.
If it doesn't, append it to the question.
Work on understanding the solutions. LaTeX is a very technical thing, like programming, and if you want to use it you have to accept the fact that you're going to be stuck using your brain to think through solutions.
The error itself is pretty descriptive. Are your levels of nesting for your /begin{} and /end{} statements all lined up properly? All the macros that you're using are being used correctly? Review the documentation for the packages that you're using.
Like programming, when you're not sure what's going on, recreate the error with the simplest possible code that you can use. If that on its own does not already tell you the error (it frequently does!), then post that simplest possible code with your question so that we at least have some small chance to help. Sadly, due to the complexity of LaTeX, things like package versions may also be quite relevant to the troubleshooting process.

Resources