blog.area23.at - a simple url encoder/decoder

 a simple url encoder/decoder
 http://blog.area23.at

Labels

Wirtschaft (128) Österreich (100) Pressefreiheit (72) IT (56) Staatsschulden (34) code (32) EZB (25) Pensionssystem (14) music (2) France (1)
Posts mit dem Label IT werden angezeigt. Alle Posts anzeigen
Posts mit dem Label IT werden angezeigt. Alle Posts anzeigen

2020-08-10

State management in Blazor

There is a sufficient document for state management in Blazor.
Here is a quick & fast work through with all prerequisites, how to get state management in Blazor working.

Example with Blazored.LocalStorage package

Install nuget package for your project

# Find packages providing a "Blazored.LocalStorage" 
Find-Package Blazored.LocalStorage
# install "Blazored.LocalStorage" 
Install-Package Blazored.LocalStorage -Project YourProject# alternatively


Add Blazored.LocalStorage to ConfigureServices at your Startup.cs

using System;/* ... */using Microsoft.AspNetCore.Hosting;using Microsoft.AspNetCore.Http;/* ... */using Blazored.LocalStorage;public class Startup{  /* ... */  public void ConfigureServices(IServiceCollection services)  {     /* ... */    services.AddRazorPages();     services.AddServerSideBlazor();    /* ... */    services.AddBlazoredLocalStorage();    /* ... */  }}

Using LocalStorage inside a razor page / control

@page "/MyPage"
@using Blazored.LocalStorage
@inject ILocalStorageService localStorage
@code {  /* ... */  Dictionary<stringstring> sessionDict;  /* ... */  protected override async Task OnAfterRenderAsync(bool firstRender)  {     if (firstRender)    {      sessionDict =         await localStorage.GetItemAsync<Dictionary<stringstring>>("SessDict");      StateHasChanged();    }    await base.OnAfterRenderAsync(firstRender);  }         protected async Task PersistSessionDict(<Dictionary<stringstring> persistDict) { if (persistDict != sessionDict) { await localStorage.SetItemAsync("SessDict", persistDict); } }}

Using LocalStorage inside an entity class

using System;/* ... */using Blazored.LocalStorage;
public class MyEntity{  [Inject]  public ILocalStorageService LS  {     get => _localStorage;    set => this._localStorage = value;  }  private ILocalStorageService _localStorage; 

  interal async Task<Dictionary<stringstring>> GetSessionDict() =>       await LS.GetItemAsync<Dictionary<stringstring>>("SessDict");  /* ... */}

Example with ProtectedBrowserStorage package

Install nuget package for your project

# Find packages providing a "ProtectedBrowserStorage" 
Find-Package ProtectedBrowserStorage 
# install "Microsoft.AspNetCore.ProtectedBrowserStorage" 
Install-Package Microsoft.AspNetCore.ProtectedBrowserStorage -Project YourProject# alternatively install "ProtectedBrowserStorage.NETStandard" Install-Package ProtectedBrowserStorage.NETStandard -Project YourProject


Add ProtectedBrowserStorage to ConfigureServices at your Startup.cs

using System;/* ... */using Microsoft.AspNetCore.Hosting;using Microsoft.AspNetCore.Http;/* ... */using Microsoft.AspNetCore.ProtectedBrowserStorage;
public class Startup{  /* ... */  public void ConfigureServices(IServiceCollection services)  {     /* ... */    services.AddRazorPages();     services.AddServerSideBlazor();    /* ... */    services.AddProtectedBrowserStorage();    /* ... */  }}


Using ProtectedBrowserStorage inside a razor page / control

@page "/MyPage"
@using Microsoft.AspNetCore.ProtectedBrowserStorage
@inject ProtectedSessionStorage ProtectedSessionStore
@code {  /* ... */  Dictionary<string, string> sessionDict;  /* ... */   protected override async Task OnAfterRenderAsync(bool firstRender)  {     if (firstRender)    {      sessionDict =         await ProtectedSessionStore.GetAsync<Dictionary<string, string>>("SessDict");      StateHasChanged();    }    await base.OnAfterRenderAsync(firstRender);  }         protected async Task PersistSessionDict(<Dictionary<stringstring> persistDict) { if (persistDict != sessionDict) { await ProtectedSessionStore.SetAsync("SessDict", persistDict); } }}

Sources and links:

https://www.nuget.org/packages/Microsoft.AspNetCore.ProtectedBrowserStorage
https://www.nuget.org/packages/ProtectedBrowserStorage.NETStandard/
https://github.com/MeysamMoghaddam/ProtectedBrowserStorage
https://github.com/Blazored/LocalStorage

2020-02-15

Semantic Internet: Trends, Facts, Futures, Verification

[Draft] [Concept] [Prototype]

Semantic Internet (former known as Semantic Web, see also RDF) has the possibility to record different semantic trends occurring at different sources with a certain frequency inside the in principle accessible to the public internet.
Day after day, month after month, semantic contexts are published on the Internet. area23 semantic web filters all semantic statements that occur with a certain frequency from different sources. Furthermore, not all trends and semantically significant events are more relevant for most semantic miners.

With area23 semantic web you can filter by region, topic categories, relevance from different sources and subsequent complexity.

A filter for a region can be set similiar to Google Trends, e.g. for United States or for Germany, etc.

Basic main categories are:

  • politics (Brexit, Sinn Féin, Thüringen, ...)
  • sports  (soccer, american football events, ...)
  • entertainement (music, cinema, tv, ...)
  • technology
  • business (stock markets, trading, bonds, central bank news, different economic indictors)
  • health
  • lifestyle (eating, drinking, other events)
  • housing (appartments, flat, hotel, camping / caravan sites, vacation rentals, accommodations, e.g.: Airbnb, Wimdu)
  • infrastructure (traffic reports, flights & airports occupancy, train connections, ships & ferries connections)
  • weather (including unexpected temperatures / weather effects, like ice, heavy rain, storm, dry periods plus enviroment disasters, like hurricanes, floodings, earthquakes, volcanic eruptions)
  • and many more
Once you created your filter enviroment, you can start collecting & recording semantic events.

After some time, collected semantic events will appear, e.g.: 'coronavirus'

In that example, 'coronavirus' the most common and reliable semantic logical statements are shown (extracted from different internet sites / ressources), e.g.: number of infections, behavior to stay healty, flights canceled to / from China, stock market risk for China in the next year.

Every statement extracted from the data pool that directly makes a statement or an assumption regarding matters other than the corona virus is now checked with other data sources as to whether the statement actually has a formal fuzzy truth content. So in that (our) example, the flight connections from and to China will be verified immediately as a result. Chinese economic data and the change behavior of futures in Hang Seng, which changed in the period since the outbreak of the coronavirus, will be checked too.

Warning, formally epistemologically an extracted statement is not necessarily true, even if 15 different articles from different countries in different languages in the web claim: "Corona virus has negative effects on the current Chinese fiscal year 2020." and if the outlook for futures in Hang Seng and the economic data have deteriorated in the same period.


to be continued...



Links about semantic web and similar topics:
https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki
https://www.opensemanticdata.org/
http://jena.apache.org/
https://www.nngroup.com/articles/user-need-statements/

2020-02-07

EPU Personenbetreuer in Vorarlberg & weiter stark (aber nicht mehr wachsend)

Im Jahr 2014 befasste ich mich rein privater Natur mit dem Wachstum / Entwicklung / Überhitzung der veschiedenen Wirtschaftssektoren, Sparten, Branchen, Fachgruppen, Berufsgruppen und sonstige kurzfristingen Trends und langfristiger Entwicklungen in den Bereichen Arbeit und Wirtschaft anhand des ganz konkreten Beispiels der Berufsgruppe Selbstständige Personenbetreuer.

Ich verfasste folgenden sehr kurzen Artikel auf meinem Blog hier dann dazu. Der Grund für gerade diese Berufsgruppe für jene Fallstudie war nicht etwa ein sozialer Hintergrund (z.B. arme ausgebeutete Scheinselbstständige im untersten Einkommenssegement)  oder ein rassistisches Motiv (es handelt sich bei Mitgliederinnen dieser Berufsgruppe vornehmlich um weibliche der Volksgruppe der Slawen zugehörige osteuropäische EU-Bürgerinnen), sondern ganz simpel und einfach die Tatsache, dass es in Österreich aufgrund der demographischen Entwicklungen in diesem Marktbereich sehr leicht einschätzen lässt, welche Nachfrage es durch immer mehr pflegebedürftige Pensionistinnen gibt und gleichzeitig welcher  Angebotsbedarf an Personenberteuerinnen (Pool an Betreuerinnen) dazu sich korrespondieren entwickelt.

Bis Anfang Jänner 2019 stiegen Angebot und Nachfrage in der Pflegebetreuung relativ konstant an (eine immer größer wachsende Anzahl von Pfelgebedürftigen mit immer exklusiveren Bedürfnissen stand korrelierend ein stetig wachsendes Angebot an Pflegeleistungen und immer mehr Betreuerinnen gegenüber).
Im fortschreitenden Jahr 2019 stagnierte allerdings die Angebotsseite deutlich zum 1. Mal seit Jahren und es gab kein sichtbares signifikantes Wachstum bei der Anzahl der sich anbietenden Personenbetreuerinnen.

Seit Anfang 2020 schrumpfte bereits die Angebotsseite sichbar. (sprich eine signifikante geringere Anzahl an vorhandenen selbstständigen Personenbetreuerinnen offerierte eindeutig nicht mehr derart manngfaltige Liestungsangebote, sondern viel mehr ein günstiges Standard-All-In Paket / Dienstleistung).


https://firmen.wko.at/Web/Ergebnis.aspx?StandortID=137&StandortName=Eisenstadt-Umgebung&Branche=45014&BranchenName=selbst%C3%A4ndige%20Personenbetreuer&CategoryID=0#


https://docs.google.com/spreadsheet/ccc?key=0Ajp8yYU5yBOBdEtMOUUxUHoyLWRQLW9GUUN5M3liSkE&usp=sharing

2019-10-07

query tools openID bearer

invoke-webrequest

$url = "https://webapi.area23.at/api/bearertest"
$headers = @{} 
$headers.Add("Accept","application/json")  
$headers.Add("Authorization", "bearer myBearer")

invoke-webrequest -Uri $url -Headers $headers  
invoke-webrequest -Uri $url -Method GET -Headers $headers 

curl

curl -X GET \
    -H "accept: application/json" \
    -H "Authorization: bearer myBearer" \
    "https://webapi.area23.at/api/bearertest"

wget

wget \ 
    --header="Authorization: Bearer myBearer" \ 
    --header="Content-Type: application/json" \ 
    --no-check-certificate \ 
    https://webapi.area23.at/api/bearertest

Postman


2019-04-23

Meta grouping school modules & courses (working draft)

We want to learn more MINT module courses and kess dead languages at highschool & basic college [Draft, still in work]

  1. mathematics
    • basics
    • technically drawing geometry
    • spreadsheets & business calculation
    • logics
  2. languages
    • native or classroom/school language
    • mandatory english
    • optional foreign languages, e.g. french, spanish, german, chinese, ...
    • dead languages, e.g. latin, ancient greek
  3. geopolitics & economics
    • geography & earth science
    • local & foreign economics
    • local & foreign politics
  4. biochemistry
    • biology
    • environmental studies
    • dietetics
    • chemistry
  5. mechatronics
    • physics
    • IT OS user level & simple programming
    • electronics
    • mechanical engineering
    • combined mechatronics with LEGO mindstorms
  6. culture & aesthetics
    • history
    • music
    • art
    • aesthetics
  7. ethics
    • theory: religious & ideology studies, later psychology & philosophy
    • practice: solving religious, ideologically, gender or special needs problems, group dynamics, NLP, choice & option role games
  8. sports
    • basics [athletics. fitness & stamina training]
    • ball games [soccer, basketball, volleyball, handball, hardball, rugby, ...]
    • creative [impulse dance, monkey & pirate gymnastics, acrobatics, wrestling]
    • outdoor & elements [swimming, skating, ice-skating, cycling, climbing, military, horse riding, sports with dogs]
      please notice, that military, horses and hounds is only a final joke. please take not all 100% seriously, but try to understand the message

Mathematics





Geopolitics & Economics






Mechatronics

Instead of physics, IT and additional electronics, I would try to introduce a much more practical mechatronic light little bit more light weight module already in school by introducing something like Lego mindstorms: Children and young people can so easy learn, how to combine mechanics construction, electronics and IT programming with quick and boombastic results.







Culture & Aesthetics







Ethics

I would dump all religious courses in school and provide instead a mandatory ethic coursed for all children. Basic knowledge part of that course should include most important religions, ideologies (like socialism, democratic and totalitarian ideologies, imperialism, love movement of 68, deep state ethics, feminism and so on). At college level, we might include philosophy here too. 
Practial part should help to resolve cultural, gender, religious or any other ideologically based conflicts by playing role plays, visiting conflict areas in country, etc.

Strong religious believers could offer their childs excellent private courses during their free time, if they want. But mission in school is different, religion should be more in private and family / community space than in public education. (There are certain expensive private religious schools too, everyone is free to take that choice).






2018-12-25

AWS CodePipeline for android Github project

A short summary, how to create an amazon code pipeline and build project by using an android java github as source repository. (inspired by j-a.f)

I have choosen my github schnapslet project android subtree for trial.

Login into amazon webservices console

https://console.aws.amazon.com/codesuite/codepipeline/pipelines?region=us-east-1#

Click on "Create pipeline"

Choose pipeline settings

Enter a "Pipeline name" and a service role for your new pipeline here. Click "Next".

Choose source provider

Choose Gitub, authorize with your github credentials or choose a public github project, choose repositoty, choose branch, then click "Next".

Add build stage

Choose AWS CodeBuild and click on "Create project".

Create build project

In section "Project" configuration fill out "Project name" (Description - optional).

In section "Environment", I choosed the simplest way with "Managed image" as environment image, "Ubuntu" as operating system, "Android" as runtime, "aws/codebuild/android-java-8:26.1.1" as runtime version, default new service role.

In subsection "Additional configuration", you can enable a VPC on your virtual Ubuntu build server, e.g. if you want to login with ssh; you can select various performance features here, like "15 GB memory, 8 vCPUs" for your build server, you can set manually environment variables here and so on. We didn't need that here for only a simple proof of concepts.


In section "Buildspec" I choosed "Insert build commands", then switched to source editor and edited the following buildspec.yaml:
version: 0.2
phases:
  #install: #commands: # - command
  #pre_build: #commands: # - command
  build:
    commands
     - sudo chmod 755 $CODEBUILD_SRC_DIR/android/Schnapslet/gradlew
     - $CODEBUILD_SRC_DIR/android/Schnapslet/gradlew init -i
     - $CODEBUILD_SRC_DIR/android/Schnapslet/gradlew build -i
     - $CODEBUILD_SRC_DIR/android/Schnapslet/gradlew build --build-file $CODEBUILD_SRC_DIR/android/Schnapslet/app/build.gradle -i
#post_build: #commands: # - command
#artifacts: #files: # - location
#cache: #paths: # - paths

Finally click "Continue to CodePipeline".

Now click "Next", when you are back again on "Add build stage" site.

Add deploy stage

I skipped that option for that proof of concept.

Review

Rewiew "Pipeline settings", "Add source stage", "Add build stage", "Add deploy stage" here and finally click "Create pipeline".

Release change

Finally "Release change".

You can configure your "Build project" seperatly now here: https://console.aws.amazon.com/codesuite/codebuild/projects?region=us-east-1
e.g. if you want to change your buildspec.yaml or view different build logs.

2018-12-18

Html-Sql-Injection Detection

A very simple prototype of html injection detection in MS SQLServer, please notice, that real detection is much more complex...

If Exists(Select Top 1 object_id From tempdb.sys.tables Where name = '##InjWatch')
Delete From ##InjWatch
Else
Create Table ##InjWatch ( ctext nvarchar(Max), tab varchar(768), col varchar(768)
);
GO 

Declare InjectCursor Cursor FAST_FORWARD READ_ONLY For 
  Select 'Cast([' + c.name + '] as nvarchar(max))' as c_cast,
    c.name as c_name, '' + s.name + '.[' +T.name + ']' as sT_name
  From sys.tables T
  Inner Join sys.columns c
    On  c.object_id = T.object_id
    and c.max_length > 16 and c.system_type_id In (Select system_type_id From sys.types Where name In('varchar', 'nvarchar''char''nchar''text''ntext'))
  Inner Join sys.schemas s
    On s.schema_id = T.schema_id

Declare @c_cast varchar(1024), @c_name varchar(768), @sT_name varchar(768)
Open InjectCursor
Fetch Next From InjectCursor Into @c_cast, @c_name, @sT_name

While
 (@@FETCH_STATUS = 0)
Begin
  Declare @execSQL nvarchar(max)
  Set @execSQL = 'insert into ##InjWatch (ctext, tab, col) '+
    'select ' + @c_cast + ' as ctext, ''' + @sT_name + ''' as tab, ''' + @c_name + ''' as col ' +
    ' from ' + @sT_name + ' with (nolock) ' +
    ' where (' + @c_cast + ' like ''%<%'' and ' + @c_cast + ' like ''%>%'') ' +
    ' or ' + @c_cast + ' like ''%script:%'' or ' + @c_cast + ' like ''%://%''' +
    ' or ' + @c_cast + ' like ''%href%'' or ' + @c_cast + ' like ''%return %''' +
    ' or ' + @c_cast + ' like ''%mailto:%'''
  Execute sp_executesql @execSQL;
  Fetch Next From InjectCursor Into @c_cast, @c_name, @sT_name
End
Close InjectCursor
Deallocate InjectCursor

Select Distinct * From ##InjWatch
GO