lördag 2 november 2019

Kotline React GH-pages app Stage 3

So the goal of step 3 is to bring in Material UI and use a simple component. Going for a Button doing something. The simple part is to include the package.
yarn add @material-ui/core 
But to use js libraries in kotlin is a bit complicated. For each component we need to define it in Button.kt:
@file:JsModule("@material-ui/core")
@file:JsNonModule

package materialUi

import org.w3c.dom.events.Event
import react.RProps
import react.RClass

 // way 1
@JsName("Button") // because it was exported as default
external val Button : RClass;

 external interface ButtonProps: RProps {
    var className : String
    var onClick: (Event?)->Unit
    var color: String
    var href: String
}
If you have any tips to make it easier this wrapping things feels a bit complicated: Now on can us Material UI Button in App.kt but frist we need a state for the button to manipulate:

    interface APPstate : RState {
        var ticker: Int;
    }
    fun APPstate.init(props: TickerProps) {
        ticker = 0
    }
Now for the button, and asmale change using the state in ticker.
override fun RBuilder.render() {
        div("App-header") {
            h2 {
                +"The awesome Page"
            }
        }
        p("App-ticker") {

            Button {  +"Timetravel"
                attrs {
                    onClick = {
                        setState { ticker += 1 }
                    }
                    variant="contained"
                }}

            br{}
            ticker(state.ticker)

        }
    }
Small changes from the original tweet: #dcb19ca8e1d7d84bf6cfc0c102a10a67405a811d

tisdag 29 oktober 2019

Kotline React GH-pages app Stage 1-2

This is my record of learning to use Kotlin in combination of React on github pages. I used React with typescript before at work. I did some Kotlin for android dabeling. I use gh-pages for most my hosting. I also want my source code to be private, so we need two github repositories. One for the source code and one for the gh-page.

I created two repositories on : https://github.com/new
The private project for my source code organiser, git-url: git@github.com:paven/organiser.git
gh page project organiser_beta: git@github.com:paven/organiser_beta.git

This first step required me to create a react kotlin app and hook it up to github:
yarn global add create-react-kotlin-app
create-react-kotlin-app organiser
yarn add gh-pages
cd organiser
git init
git remote add github git@github.com:paven/organiser.git
git commit -a -m "create-react-kotlin-app"
git push -f github master 
You can read about the create-react-kotlin-app here:  create-react-kotlin-app
And the git commands: git/docs

By now I had my source project created and up on github, but the gh-page was not up and running, for this I needed to do some editing to the configuration. The guide i looked at "How to deploy your react application to github pages" was pretty strait forward, but it defaults to sending to the origin repo and I wanted to send to a second github repo so i hade to figure some things out from npm/gh-pages.

So i modified my package.json (int the organiser repo) with the this:
{
   ...
   "predeploy": "yarn run build",
   "deploy": "gh-pages -d build --repo 'git@github.com:paven/organiser_beta.git'"
   ...
}

yarn deploy
Resulting in some joy from me, I figured this was a twitter moment
Though the page was mysteriously white it was a smale win. After investigating the webcode I realised that code tried to load from organiser instead of organiser_beta. I needed to change the first value in package-json
{
   {
      "name": "organiser_beta",
   ...
}
and after yarn deploy  this it was a second twitter moment.
Tada!
More react: https://medium.com/@ralf.stuckert/getting-started-with-kotlin-react-c5f3b079a8bf

torsdag 20 februari 2014

Java Forium Notes: Spring4, Java EE 7 or Both

Ivar Grimstad
JavaForum

"Problems choosing between Java EE and Spring? Or do you want to use both in combination? Then this session is something for you.

In this session I will build an application using Spring 4, then build the same application using Java EE 7 and at last build it again using a combination of the two.

Strengths and weaknesses with the three approaches will then be explored and lessons learned summarized.

Ivar Grimstad is an experienced software architect with a strong focus on Enterprise Java.

He has been working with Java since the beginning and has over the years tried out everything from lightweight mobile applications to large scale enterprise applications. His experience covers all aspdects of designing architectures based on a variety of technologies including standard Java EE as well as more lightweight frameworks such as Spring and a variety of open source products.

Ivar is always focusing on quality and on using the right tools and technologies for the right task to optimize the software development process.

Ivar is a frequent speaker at conferences, locally as well as internationally. Presented in Swedish.

Ivar Grimstad, Cybercom"

Java EE7 compability today
  • WildFly
  • Glasfish 
  • and a korean on without documentation.
this talks make me wanna code! So I do that..

Links:
http://spring.io/

JavaForum Notes: ClassLoader leaks

JavaForum

Mattias Jiderhamn
classloader-leaks

Sometimes classes is not garbage colected.

Some situations where the their will be references keeping your application from garbage collection.

Slides


Leak prevention lib
- Apache 2 licence
Classloader leak prevention

lördag 1 februari 2014

howToCode (weekly)

Posted from Diigo. The rest of my favorite links are here.

tisdag 15 januari 2013

locate i linux


locate <file>
will find a file for you much faster than anything else.

To get the find print and some powerful extra information look at this post by HIMANSHU ARORA that explains some neat tricks.

lördag 10 november 2012

lib: impress.js

I have been testing impress.js on my webpage to day. I think it is cool and will nicely replace prezi for me. But i wished it didn't have one feature. It replaces the default html / css way of working with its own absolute positioning system.

I will do to things to investigate if i should stay with impress.js

  1. See if it is possible to disable the prezi positioning.
  2. See if any of the other js alternatives does use standard html/css for layout.

https://github.com/paven/impress.js

FSCONS: Debian Packaging


Talk: Debian Packaging

Day
Saturday 10th of November, 2012
Start
17:15
End
18:00
Duration
0:45:00
Room
Room 2
TBA



______________________________________________________________________
dpkg, debs

Debian Package

  • Source Package
    • Upstream source with debian/ dir or patched with diff.gz
  • debian/
    • control
    • copyright
    • changelog
    • rules
    • Package related files
    • debian/bin-pkg-name
  • Binary Package
    • deb or udeb
    • Package name listed in control field Package
    • ar(1) archive with special magic value

FSCONS: Keynote: Weapons of the Geek


Keynote: Weapons of the Geek

Day
Saturday 10th of November, 2012
Start
14:00
End
15:00
Duration
1:00:00
Room
Room 1
What are the different elements – legal, ethical, and aesthetic – that have fed into the stellar success of the free and open source software movement? In this talk, drawing on material from my forthcoming book, I will discuss the unique elements within F/OSS that constitute it as a site of political action, and contextualize free software within a wider field of geek and hacker politics. I will conclude by marshaling this material to critically assess the concept of Web 2.0, which has so powerfully structured understandings of the politics and power of digital media.
______________________________________________________________________
Acat, Anonymous, hackers, hacker etics, builders vs breakers, Craftmanship, Copyleft, freespaces - request for comments, BBSand IRC, free software project, Hack Lab, Hack Space, Free Software Confrerence.

FSCONS: Introduction to development for the others


Talk: Introduction to development for the others

Day
Saturday 10th of November, 2012
Start
12:00
End
12:45
Duration
0:45:00
Room
Room 3
ABOUT THE TALK AND WORKSHOP
As a visitor to FSCONS I realised that all guests are not developers or know how to program. But many guests have an interest in, and would benefit from, knowing about coding. This is an introduction to programming visiting the core building blocks of many languages. The goal is for you to be able to follow the flow of a program. Concepts I will explain include sequence, selection, iteration, method. You will also receive good tips on where to continue from this introduction.
In the workshop we also will be writing some code.
This talk will also be given as a workshop
______________________________________________________________________

FSCONS: All about Free Your Android


Talk: All about Free Your Android

General Purpose Computing
Day
Saturday 10th of November, 2012
Start
11:00
End
11:45
Duration
0:45:00
Room
Room 1
Regain control of your Android device and your data! This talk will give you all the information necessary to achieve this by running (almost) exclusively Free Software on your phone. It will cover the Android operating system and F-Droid, an alternative Free Software App repository that works like a marketplace. In these areas, a lot has been achieved, while there are still more challenges ahead.
This talk will also give you an insight of the current FYA-campaign, its short-term and its long-term goals as well as our experience so far with this decentralised campaign. Different ways will be presented how you can help to make phone liberation effortless and free the last few apps necessary for freedom phones to thrive.
______________________________________________________________________
What is the android system, what is wrong with it. 
  • universal operating system with inux kernel.
  • google account
  • google collects and connects data of emails, calendrar, adressbook, photos, usage-behavior
  • Thousands of proprietary, unctrolled apps
But
  • developed under no-disclosure agreement
  • might be proprietary in future
  • vendor locked ROMs
... have early to run to be prepared for my talk coming up next...

FSCONS: An endangered species: computer as a universal machine

Development for Embedded Systems
Day
Saturday 12th of November, 2011
Start
10:00
End
10:45
Duration
0:45:00
Room
2
The automotive industry has discovered Free Software/Open Source and are embracing GNU/Linux to build the next generation of "infotainment" head units in your car. This talk will discuss the challenges as well as the immense opportunities GNU/Linux brings to the automotive marketplace.
________________________________________________________________________________
"Your mobile phones has more computing power than the entire human race when we landed on the moon"
Things that use to be normal, loaning, lending, sharing, copy are now limited.
With the future uefi secure boot I will not be able to decide what software I trust. - But a single third party decides who I should thrust. They become gatekeepers to our computer with this. 
Who should decide? - What should be able to to do whit our computers?



fredag 9 november 2012

Soon my workshop will start on FSCONS.

In the begining i will show this presentation  (follow it live)
then we will look at an code example to see if we can get it to work.