I don't know if this is a bug or something wrong i am doing but when ever i type something and press enter to select from the auto complete menu it leaves whatever is written before... or specifically the # symbol for now
here a picture demonstration
enter image description here
enter image description here
So more to the question, Atom does replace whatever you type if you chose to auto-complete in contrary to what Brent said below. In an html file try typing dv or btn and select to auto-complete you'll then see that it replaces what you've typed. So this behavior is only (as far as i am concerned) replicable with symbols
From the Autocomplete section of the Atom Flight manual:
By default, the autocomplete system will look through the current open file for strings that match what you're starting to type.
If you've typed in part of a keyword that Atom doesn't recognize, and then autocomplete the rest of the phrase, Atom will not erase what you've previously typed. I used to do this a bunch when I first started using Atom. The solution is simple: just type the part of the keyword that Atom recognizes before auto-completing the rest of it. So in the case of your first example image, you just have to start typing the phrase media and then press enter; no need to include the preceding # symbol. This ultimately means that you just have to type less to get your desired code, which I think is pretty sweet.
Related
Part of my source code displays text in English that uses common text formatting characters (E.g.: \n: "This is my\nstring"). When I call lupdate and open the .ts file in Qt Linguist, it correctly displays the formatted text in the source text preview space (so without the \n or else).
The problem is that, when I translate the string and put the formatting characters in the translation and run the application with the translation file, my app reads the special characters as normal ones!
How may I overcome this problem? How can I put the necessary text formatting so the translation procedure don't generate such kind of bugs?
When you translate your app, you should press Enter, where you see \n.
For example,you see this string in source code
This is my\nstring
In linguist you should write:
This is my[here press Enter]
string.
When you run app with this translation, you'll see that all good.
I hope, it helps.
I'm aware that there are some languages that writes the order of some characters differently than the common latin languages. E.g.: a percentage number in English would be like "100%", while in Persian it would be "/100" (the symbol comes before the number).
Question: how to consider that in the Qt internationalization system in an intelligent way?
I first thought about this code:
myLabel->setText(tr("%1%2").arg(value).arg(tr("%")));
So what would happen is that, in the Qt Linguist, the translator would change the order of the replacement fields:
%1%2 -> in Persian translation -> %2%1
I checked that in my code and I found out that while in the normal (English) translation everything was fine, when I changed to the file containing the performed translation, a bug would occur: the number to be shown was never complete having one less number that what I had written. So e.g. if I chose "99%", it would show "%9", and if I set only "9%", I would have just "%".
The problem disappeared when I put a space between %1 and %2 both in the source code as well as in the translation (%2 %1). Since ISO xxxxx says that the % should be placed with a space between it and the correspondent number, no problem for this specific situation. But what If I wanted to have both symbols without a space between each other? How should it be done?
I confirm that the problem you described exists. However I would solve this problem in the following way:
QString sPer = QString("%%1").arg(value); // %99
QString sEng = QString("%1%").arg(value); // 99%
So that
%1% -> in Persian translation -> %%1
Put the percentage inside the string to translate, something like
myLabel->setText(tr("%%1").arg(value))
even better, I think I would add a disambiguation string (Qt "old style" comment)
myLabel->setText(tr("%%1", "Show the number with a percentage").arg(value))
or maybe a new style translation comment like this
//: Show the number with a percentage
myLabel->setText(tr("%%1").arg(value))
Translator comments have issues of their own, you might be better off using a Qt disambiguation string like the preceding example.
Putting a disambiguation string (or a translator comment) will let your translator know what they are translating...
Let the translators decide where they want to put the percentage, don't try to handle it in the code as somebody else suggested, it is not scalable, you can't start handling this in the code like that, what if you need to use another character or formatting for another language?
It might even be possible that Qt might have calls to handle number formatting but I can't seem to find them at the moment and I am not fully sure how we handle them in the Qt application I work on...
If putting a % alone doesn't work, try to precede it with \, it might be necessary to escape it, I am not sure...
I have never had practical success when using the search feature in Tridion (SDL Tridion 2011). I am looking at a list of components. I enter some of the text for one those component's name and the search does not find it. I have to use the exact name of the component for it to find it.
What fields does it search using my criteria?
Is there a wild card symbol I can use or a setting to make it a "contains" query?
The Search Indexer should index all fields of every components as well as text in binaries (PDFs, MS Word Docs etc). I have a running instance of SDL Tridion 2011 and can confirm that it does in fact give results from both binary and normal component content.
I am not entirely sure of the inner workings of the newer SolR version of Tridion, but I imagine that Titles and Full text are indexed separately.
It could be that your indexer is not actually running properly, I have seen the service appear to be in the running state, but not actually processing messages in the Search Queue. Try opening the Purge Queue tool (Normally located at "C:\Program Files (x86)\Tridion\bin\TcmPurgeQueue.exe"), and see if there are lots of messages waiting in the Search Queue. If there are, it may be that items are not being processed properly, try hitting refresh and see if the number is going down.
For a wildcard, you should just be able to use a '*'. I just tested putting the string "Rampusplong" in a component filed, and can confirm that searching for "Rampusplong" or "Rampus*" or "*ampusplo*" return my result, but "Rampus" returns no results.
Yes, * for wild cards as Chris mentions. See some reserved word options below (source: the SDL Welcome "Getting to Know SDL Tridion" help pages) for other options to try.
identifier (e.g. tcm:19-123-8)
search operators
AND
OR
NOT
IN (e.g. "someword IN title", where title is the component's XML)
exact phrases delimited with " (e.g. "Mad cookie")
wildcards
* for wildcard, multiple characters (I've sometimes needed this on supposed full matches)
? for single
special characters
+ - ! ( ) { } [ ] ^ " ~ * ? : \
(help file doesn't say much more except to escape with double quotes)
reserved words (escape with \ regardless of capitalization)
CONTAINS
NEAR
SENTENCE
PARAGRAPH
PHRASE
IN
MATCHES
STARTS
SUBSTRING
ENDS
AND
OR
NOT
You can also search in multimedia as well as metadata, schema, and the other visible search options by clicking on the advanced search (down arrow next to search).
At least in older versions (R5.3 specifically and possibly 2009), I've seen items outside of regular creation (via VBScript) skip getting indexed. Re-index if that's the case, but not sure with 2011.
I feel like I might be losing my mind...but if you search the AOT for anything with double colons "::", it fails completely. I'm trying to step through the Forms\SysAotFind to figure this out but I didn't want to spin my wheels a bunch for something that might be on my system only.
To reproduce in AX 2009, select Classes\SalesTableType, press Ctrl+F and put "CustLedgerAccounts::sumAccount" in the containing text box and click find now. You can see this is clearly located in the Classes\SalesTableType\accountCust method. I've tried searching for base enums inside objects with no luck either.
I noticed the same behavior, but escaping the colons with a backslash makes the search work correctly.
So in your case you would need to search for "CustLedgerAccounts\:\:sumAccount".
The search uses regular expressions in the syntax defined by the match function.
Colon is a special character, hence it needs to be escaped by a backslash.
For those searching for a fix, you can see where the issue is here and just tweak it if you want to allow specifically for double colons:
[c] \Classes\SysTreeNodeSearch\isNodeInRange #46
if (!match(containingText,source))
return false;
I've never messed with AppleScript so this is only a concept to me. Can this work?
Bungie, the game designer, is hosting a ton of PNGs for Halo Reach in systematically named files and directories. IE:
http://www.bungie.net/images/reachstats/commendations/onyx/onyx_large_precision_multiplayer.png
Change two instances of the same word, and you generate another version of the image. Change "onyx" to "iron", "bronze", "silver" or "gold" and you get a corresponding image, like so:
http://www.bungie.net/images/reachstats/commendations/gold/gold_large_precision_multiplayer.png
Would an AppleScript be able to take an input URL, find and change the instances of the words in the URL, and then download the associated file to a directory? Today is my birthday (Oct 27th! hence the XXVII) and if this will work I would be super excited if someone could make this!
Thanks for all of your kind answers!
This works:
set the destination_file to ((path to desktop as string) & "picture.jpg") as file specification
set thisImageSRC to "http://www.bungie.net/images/reachstats/commendations/gold/gold_large_precision_multiplayer.png"
tell application "URL Access Scripting"
download thisImageSRC to destination_file replacing yes
end tell
String manipulation is done completely with changing Applescript's text item delimiters. So to get the components of the URL into a list, you need to do the following:
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to "/"
set theUrlComponents to (every text item of theURL) as list
set AppleScript's text item delimiters to oldDelims
Add salt to taste, but I agree with the first commenter that there are better languages to do this. Applescript would be my last choice here.