create or replace PROCEDURE CreateAliasPaths AS
pos1 NUMBER:=0;
pos2 NUMBER:=0;
origName VARCHAR2(4000);
origSearchStr VARCHAR2(4000);
aliasName VARCHAR2(4000);
aliasPath VARCHAR2(4000);
BEGIN
dbms_output.put_line ('------------ CreateAliasPaths Beginn:' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'));
FOR r IN (SELECT * FROM Table0) --for testing: where rownum<=3
LOOP
pos1:=INSTR(r.ALIAS,' ');
origName:=SUBSTR(r.ALIAS,1, pos1-1);
origSearchStr:='%' || origName || '%';
pos2:=INSTR(r.ALIAS,' ',pos1+1);
if (0=pos2) THEN
pos2:=LENGTH(r.ALIAS);
END IF;
LOOP
aliasName:=SUBSTR(r.ALIAS,pos1+1, pos2-pos1-1);
--dbms_output.put_line('AliasTabelle:' || r.ALIAS);
--dbms_output.put_line('originalName:' || origName || ',' || pos1 || ' ' || pos2 || ' aliasName:>' || aliasName || '<' );
FOR rRepro IN (SELECT * FROM table1 WHERE LOWER(PATH) like LOWER(origSearchStr))
LOOP
aliasPath:=REPLACE(rRepro.PATH, origName, aliasName);
--dbms_output.put_line('aliasPath:' || aliasPath );
UPDATE table1 SET ALIAS=rRepro.ALIAS || ' ' || aliasPath WHERE table1ID=rRepro.table1ID;
END LOOP;
--dbms_output.put_line( '-------------------------------------------------' );
pos1:=pos2;
EXIT WHEN (pos1>=LENGTH(r.ALIAS));
pos2:=INSTR(r.ALIAS,' ',pos1+1);
if (0=pos2) THEN
pos2:=LENGTH(r.ALIAS);
END IF;
END LOOP;
--dbms_output.put_line( '=============================================================================' );
END LOOP;
COMMIT;
dbms_output.put_line ('------------ CreateAliasPaths End:' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'));
END CreateAliasPaths;
meine Sys/Db admin & Developper Notitzen - wer Rechtschreibfehler findet darf sie behalten ... my Sys/Db Admin and developper notes - I don't care about typos
Monday, October 07, 2019
Oracle Sql Developper Debuggen:
Stored Procedure rechte Maustaste Debuggen, dann für Debug kompelieren
Breakpoint durch Click in linke breite Leiste
Rechte zum Oracle Debuggen:
grant debug connect session to myDebugUser;
grant debug any procedure to myDebugUser;
-- Wenn: ORA-24247: Netzwerkzugriff von Zugriffskontrollliste abgelehnt
grant execute on DBMS_DEBUG_JDWP to myDebugUser;
Breakpoint durch Click in linke breite Leiste
Rechte zum Oracle Debuggen:
grant debug connect session to myDebugUser;
grant debug any procedure to myDebugUser;
-- Wenn: ORA-24247: Netzwerkzugriff von Zugriffskontrollliste abgelehnt
grant execute on DBMS_DEBUG_JDWP to myDebugUser;
Thursday, October 03, 2019
oracle substr stored proc
create or replace
PROCEDURE TESTHM AS
BEGIN
dbms_output.put_line ('TestHm');
DECLARE str VARCHAR2(4000);
BEGIN
FOR r IN (SELECT * FROM myTable where rownum<=5)
LOOP
str:=SUBSTR(r.myStrField,1, 10);
dbms_output.put_line( str );
dbms_output.put_line( r.myStrField);
END LOOP;
END;
dbms_output.put_line (CURRENT_DATE);
END TESTHM;
PROCEDURE TESTHM AS
BEGIN
dbms_output.put_line ('TestHm');
DECLARE str VARCHAR2(4000);
BEGIN
FOR r IN (SELECT * FROM myTable where rownum<=5)
LOOP
str:=SUBSTR(r.myStrField,1, 10);
dbms_output.put_line( str );
dbms_output.put_line( r.myStrField);
END LOOP;
END;
dbms_output.put_line (CURRENT_DATE);
END TESTHM;
oracle stored procedure loop over records (withouth cursor)
create or replace
PROCEDURE TESTHM AS
BEGIN
dbms_output.put_line ('TestHm');
FOR r IN (SELECT * FROM myTable)
LOOP
dbms_output.put_line( r.myField );
END LOOP;
dbms_output.put_line (CURRENT_DATE);
END TESTHM;
set serveroutput on;
execute testhm;
PROCEDURE TESTHM AS
BEGIN
dbms_output.put_line ('TestHm');
FOR r IN (SELECT * FROM myTable)
LOOP
dbms_output.put_line( r.myField );
END LOOP;
dbms_output.put_line (CURRENT_DATE);
END TESTHM;
set serveroutput on;
execute testhm;
Thursday, September 12, 2019
From c# to Java - from Visual Studio to Eclipse
| task | VisualStudio | Eclipse | |
|---|---|---|---|
| go to definition | F12 | F3 | |
| last location | CRT - | CRT Q | |
| task | c# | java | |
|---|---|---|---|
| override | override | @Override | |
| Datum | DateTime | Date | |
Sunday, September 01, 2019
bildschirmaufloesung linux
zuerst mit cvt die konfig zeile für xrandr generieren cvt aufloesungx aufloesungy frequenz:
cvt 1920 1080 60
dann xrandr --addnew obigen output hinzufügen
dann in system/geräte/bildschirme neue auflösung auswählen
https://wiki.ubuntuusers.de/RandR/
cvt 1920 1080 60
dann xrandr --addnew obigen output hinzufügen
dann in system/geräte/bildschirme neue auflösung auswählen
https://wiki.ubuntuusers.de/RandR/
# 1024x768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
xrandr --newmode "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync xrandr --addmode DVI-0 "1024x768_60.00" xrandr --output DVI-0 --mode "1024x768_60.00"
Monday, August 19, 2019
browser raspi
from gui: midori,luakit,
start from commandline: dillo, epiphany-browser, netsurf, lynx
start from commandline: dillo, epiphany-browser, netsurf, lynx
Friday, June 14, 2019
gpio Raspberry
gpio read 23
php script test.php (www-data zu gruppe gpio hinzufügen )
php script test.php (www-data zu gruppe gpio hinzufügen )
| <html> | |
| <head> | |
| <meta name="viewport" content="width=device-width" /> | |
| <title>Schalter</title> | |
| </head> | |
| GPIO 23 schalten: | |
| <form method="get" action="pool.php"> | |
| <input type="submit" value="Licht ein" name="Lichtein"> | |
| <input type="submit" value="Licht aus" name="Lichtaus"> | |
| </form> | |
| <?php | |
| $modeon18 = exec("gpio mode 23 out"); | |
| if(isset($_GET["Lichtein"])){ | |
| $val = exec("gpio write 23 1"); | |
| echo "Licht an"; | |
| } | |
| else if(isset($_GET["Lichtaus"])){ | |
| $val = exec("gpio write 23 0"); | |
| echo "Licht aus"; | |
| } | |
| echo "<hr/>"; | |
| $val = exec("gpio read 23"); | |
| echo " gpio23 = $val "; | |
| echo " <hr />" | |
| ?> | |
| </body> | |
| </html> |
Friday, June 07, 2019
ownlcloud auf raspberry
Vorbedingungen
apt install -y apache2 mariadb-server libapache2-mod-php7.0 \
php7.0-gd php7.0-json php7.0-mysql php7.0-curl \
php7.0-intl php7.0-mcrypt php-imagick \
php7.0-zip php7.0-xml php7.0-mbstring php-intl
php7.0-gd php7.0-json php7.0-mysql php7.0-curl \
php7.0-intl php7.0-mcrypt php-imagick \
php7.0-zip php7.0-xml php7.0-mbstring php-intl
anschließend rebooten
download und entpacken owncloud
neueste version auf download page)wget https://download.owncloud.org/community/owncloud-10.2.0.zip
das zip file dann nach /var/www/html verschieben und entpacken:
unzip -q owncloud-10.2.0.zip
owncloud data verzeichnis vorbereiten:
mkdir /var/www/html/owncloud/data
chown www-data:www-data /var/www/html/owncloud/data
chmod 750 /var/www/html/owncloud/data
hat nicht ganz funktioniert:
wget -nv https://download.owncloud.org/download/repositories/production/Debian_9.0/Release.key -O Release.key
apt-key add - < Release.key
echo 'deb http://download.owncloud.org/download/repositories/production/Debian_9.0/ /' > /etc/apt/sources.list.d/owncloud.list
apt-get update
apt-get install owncloud-files
ssms sql server management studio pfad
"C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe"
Thursday, May 23, 2019
Sunday, May 19, 2019
wordpress Export/Import (einrichten der seite)
seiten importieren (Import, wordpress Importer installieren, starten, xml fiole
theme installieren (z.b. donovan)
Apeareance-Customize / HomepageSettings/StaticPage/Hauptseite=
Apeareance-Customize/Menu
theme installieren (z.b. donovan)
Apeareance-Customize / HomepageSettings/StaticPage/Hauptseite=
Apeareance-Customize/Menu
WPF Binding ToolTip and ContextMenu with PlacementTarget
ToolTip und Contextmenü haben keinen übergeordneten visuellen Baum, da sie in eigenen Fenstern angezeigt werden
Friday, May 10, 2019
linux mysql basics
linux: apt install mysql-server
starten wenn nicht gestartet: /etc/init.d/mysql start
mysql -u user
show databases;
SELECT User FROM mysql.user;
CREATE USER 'da'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'da'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
starten wenn nicht gestartet: /etc/init.d/mysql start
mysql -u user
show databases;
SELECT User FROM mysql.user;
CREATE USER 'da'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'da'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Monday, April 15, 2019
Razore Asp.net Core
- https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/razor-pages-start?view=aspnetcore-3.0&tabs=visual-studio
- neue Web App anlegen (asp.net core web app, Type Web Application)
- starten & testen
- statische Seiten in wwwroot hinufügen
- https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-3.0&tabs=visual-studio
- Model Folder und Model Klasse Test.cs hinzufügen
- in Pages Folder Test hinzu
- rechte Maustaste auf Foldfer test, Hinzufügen, nues Gerüstelement
- Razor Pages EF (CRUD) hinzufügen
- Modelkalsse Test.cs auswählen und bei Context auf + drücken => neuer Context wird erzeugt
- RUN: Zu Root /Test hinzufügen um generierte Seiten anzuzeigen
Sunday, April 14, 2019
Citadel: Apache und webcit citadel Ports
server starten: sudo service citadel start
neu konfigurieren: sudo /usr/lib/citadel-server/setup
/etc/default/webcit
/etc/apache2/ports.conf
#service webcit restart && service apache2 restart
wennes nicht geht:
updaten, dann:
apt-get install build-essential curl g++ gettext shared-mime-info libssl-dev zlib1g-devund
curl http://easyinstall.citadel.org/install | bash
Friday, April 12, 2019
nützliche Raspi Raspberry Software
sudo apt install:
lynx #textbrowser
midori #old rasbian browser, fast light
xrdp #remote desktop server
lynx #textbrowser
midori #old rasbian browser, fast light
xrdp #remote desktop server
rdesktop # remote desktop client
Thursday, March 28, 2019
wpf binding examples
Satic Resource und Converter:
Width="{Binding Source ={StaticResource ColorPickerColumnDefaultWidth}, Converter={StaticResource DoubleToGridLengthConverter}, Mode=OneWay}" />
Dependency property in User Control:
Text="{Binding TitleText, ElementName=MyUserControl}"
<TextBlock Text="{Binding Name, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}} }"/>
<TextBlock Text="{Binding Name, ElementName=UcPaneHeader}"/>
<TextBlock Text="{Binding Name, ElementName=PaneTitle}"/>
Width="{Binding Source ={StaticResource ColorPickerColumnDefaultWidth},
Dependency property in User Control:
Text="{Binding TitleText, ElementName=MyUserControl}"
<TextBlock Text="{Binding Name, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}} }"/>
<TextBlock Text="{Binding Name, ElementName=UcPaneHeader}"/>
<TextBlock Text="{Binding Name, ElementName=PaneTitle}"/>
Thursday, March 21, 2019
asp.net core and EF (asp.net types: empty, API)
Connection Strings
InMemory Datenbank:
services.AddDbContext<TodoContext>(opt => opt.UseInMemoryDatabase("TodoList"));LocalDb
aus https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/new-db?tabs=visual-studiovar connection = @"Server=(localdb)\mssqllocaldb;Database=EFGetStarted.AspNetCore.NewDb;Trusted_Connection=True;ConnectRetryCount=0";
services.AddDbContext<BloggingContext>
(options => options.UseSqlServer(connection));
leere Web App
Programm.cs startet Webhost mit class Startup und Methode Configure, z.b.:
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
{
await context.Response.WriteAsync("Hello World!");
});
einfaches Webservice (API)
webApi Template Projekt erstellen - liefert value1, value2 durch ValuesController, der einfach auf GET Request mit Konstantem String antwortet, dazu genügen die Attribute:
[Route("api/[controller]")] // antwortet auf SubDir mit Controllername (schneided Controller Suffix weg)
[ApiController]
in Startup.cs: app.UseMvc();
in Startup.cs: app.UseMvc();
Model(s):
public class TodoItem{
public long Id { get; set; }
public string Name { get; set; }
public bool IsComplete { get; set; }
}
DbContext:
public class TodoContext : DbContext
{
public TodoContext(DbContextOptions<TodoContext> options)
: base(options)
{
}
public DbSet<TodoItem> TodoItems { get; set; }
}
in Startup.cs DbContext hinzufügen:
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<TodoContext>(opt => opt.UseInMemoryDatabase("TodoList"));
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}
Controller hinzufügen (rechte Maustaste auf Controller Ordner )
1)MVC-Controller leer2) MVC Controller mit Ansichten unter Verwendung von EF
3) MVC Controller mit Lese/SchreibAktionen
4) API-Controller leer:
[Route("api/[controller]")]
[ApiController]
public class EmptyController : ControllerBase
{
}
5) API-Controller mit Lese/Schreibaktionen:
fügt get, post,put und delete Methoden hinzu, unter Annahme einer id vom Typ int,, gibt string "value" zurück
6) API-Controller mit Aktionen unter Verwendung von EF:
in Maske Context und Modell Klasse auswählen => generiert API mit put, get usw.
Statische Files
schließlich jquery static file dass die api nutzt:
in Startup.onfigure:
app.UseDefaultFiles();
app.UseStaticFiles();
in Startup.onfigure:
app.UseDefaultFiles();
app.UseStaticFiles();
Wednesday, March 20, 2019
clean obj bin
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
Subscribe to:
Posts (Atom)