The FASTA file format is used for representing one or more nucleotide or amino acid sequences as a continuous string of characters. Sequences are annotated with a comment line, which starts with the > character, that precedes each sequence. The comment line is typically formatted in a uniform w...
A string can be written to a file with an instance of the File class.
file = File.new('tmp.txt', 'w')
file.write("NaNaNaNa\n")
file.write('Batman!\n')
file.close
The File class also offers a shorthand for the new and close operations with the open method.
File.open('tmp.txt', 'w') ...
You can call an instance method using the . special form:
(.trim " hello ")
;;=> "hello"
You can call instance methods with arguments like this:
(.substring "hello" 0 2)
;;=> "he"
You can call static methods like this:
(System/currentTimeMillis)
;;=> 1469493415265
Or pass in arguments, like this:
(System/setProperty "foo" "42")
;;=> nil
(System/getProperty "foo")
;;=> "42"
Goto https://atom.io/ and install the atom editor.
Then install some Atom packages for easier Titanium coding:
NameTypeFeaturestitanium language javascriptLanguageJS Autocomplete (non alloy)Titanium Alloyadd-onAll-in-one packageJump to definitionOpen relatedTSS HighlightTi-Createadd-onCreate proje...
We are just creating an empty Alloy app using CLI and Atom.
Open a new terminal and add the following:
ti create --id com.test -d . -n APPNAME -p all -t app -u http://migaweb.de
cd APPNAME/
alloy new
This will create a basic app (name: APPNAME, bundle identifier: com.test, type: app, platform...
let configuration = WKWebViewConfiguration()
if let path = NSBundle.mainBundle().pathForResource("customUserScript", ofType: "js"),
source = try? NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String {
let userScript = WKUserScript(source...
Get all Google Forms with the word "Untitled" in the file name.
function mainSearchFunction(searchStr) {
var fileInfo,arrayFileIDs,arrayFileNames,arrayOfIndexNumbers,
allFileIDsWithStringInName,i,searchStr,thisID;//Declare variables
if (!searchStr) {
searchStr = &quo...
type
TIntegerList = class(TList<Integer>)
public
function Sum: Integer;
end;
...
function TIntegerList.Sum: Integer;
var
Item: Integer;
begin
Result := 0;
for Item in Self do
Result := Result + Item;
end;
Value constructors are functions that return a value of a data type. Because of this, just like any other function, they can take one or more parameters:
data Foo = Bar String Int | Biz String
Let's check the type of the Bar value constructor.
:t Bar
prints
Bar :: String -> Int -> Foo...
This is the normal HTML table structure
<style>
table {
width: 100%;
}
</style>
<table>
<tr>
<td>
I'm a table
</td>
</tr>
</table>
You can do same implementation like this
<style>
.table-...