You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.
// siehe auch : http://developer.android.com/guide/topics/ui/dialogs.html
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure you want to exit?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
WhatHaveYouDoneActivity.this.finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
114
Android
GUI, ComboBox
ComboBox füllen
public void fillSpn()
{
String dummyarr[];
Spinner spn1 = (Spinner) findViewById(R.id.spn1);
// Dummy Data
dummyarr = new String[5];
int i;
for (i=0;i<5;i++)
{
dummyarr[i]=String.valueOf(i);
}
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, dummyarr);
spn1.setAdapter(adapter);
}
searchFor:='this';
text:='this is a simple text';
if pos(searchFor,text)>0 then
begin
ShowMessage('found');
end;
117
T-SQL
Datenbank
CSV erstellen
SELECT SUBSTRING(
(SELECT ',' + CSVItem
FROM TableWithItems s
ORDER BY s.Name
FOR XML PATH('')),2,200000)
GO
118
T-SQL
Kontrollstrukturen
Switch / Case Anweisung
-- http://msdn.microsoft.com/de-de/library/ms181765.aspx
USE AdventureWorks2008R2;
GO
SELECT ProductNumber, Category =
CASE ProductLine
WHEN 'R' THEN 'Road'
WHEN 'M' THEN 'Mountain'
WHEN 'T' THEN 'Touring'
WHEN 'S' THEN 'Other sale items'
ELSE 'Not for sale'
END,
Name
FROM Production.Product
ORDER BY ProductNumber;
GO
119
T-SQL
Strings
Vorkommnisse eines Zeichen in einem String ermitteln
-- Da im Deutschen das Trennzeichen für eine
-- Dezimalstelle ein Komma ist, muss dieses erst
-- gegen einen Punkt ersetzt werden
select cast(replace(cast('12.12' as varchar(10)),',','.') as numeric(12,2))
121
PL/pgSQL
Datum, Zeit
Monat aus Datum extrahieren
-- http://www.postgresql.org/docs/9.1/static/functions-datetime.html
select extract(month from now())