• Create simple TODO app AngularJS with bootstrap and Spring MVC

    In this postwe will show how to create simple TODO application which consists of two main parts.
    1. AngularJS GUI client
    2. Spring MVC war file as backend for this application

    Firstly, we will consider GUI client build on AndroidJS framework.
    In Front-end we consider two views and two controllers. First view and controller is for manipulating with login logic and second for showing and retrieving data from server (our backend).
    We will use bootstrap framework as our base style, because we want to create responsive design with idea „mobile-first“. Keep in mind that we are not focusing on great design.

  • Colors in shell console

    Great examples of colors in console or terminal is described in ASCII-TABLE.COM.
    For me, the most usefull were these informations:

    Esc[Value;...;Valuem
    Set Graphics Mode:
    Calls the graphics functions specified by the following values. These specified functions remain active until the next occurrence of this escape sequence. Graphics mode changes the colors and attributes of text (such as bold and underline) displayed on the screen.
     
    Text attributes
    0	All attributes off
    1	Bold on
    4	Underscore (on monochrome display adapter only)
    5	Blink on
    7	Reverse video on
    8	Concealed on
     
    Foreground colors
    30	Black
    31	Red
    32	Green
    33	Yellow
    34	Blue
    35	Magenta
    36	Cyan
    37	White
     
    Background colors
    40	Black
    41	Red
    42	Green
    43	Yellow
    44	Blue
    45	Magenta
    46	Cyan
    47	White

    Takes from ASCII-TABLE.COM

  • Test Android native app with Appium – quick tutorial example

    In this post we will show how to create automatic test for native application in Android.
    We will show it in simple test case (only swipe to second fragment in FragmentActivity)

    Tests run thanks to Appium (link)

    1. Download Appium and install it
    2. Open folder that contains installed appium and appium.exe file
    3. Start appium.exe

  • update .properties file with sed

    in previous post we have mentioned how tu use sed link

    in this short tutorial we will show how to edit .properties files using sed

    lets consider this short properties file

    java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
    java.naming.provider.url=http-remoting://localhost:8080
    jboss.naming.client.ejb.context=TRUE

    yes it is jndi.properties BTW

    now we will use this sed script to update file

    sed.exe -ri "s/java.naming.provider.url.*/java.naming.provider.url=http-remoting:\/\/127.0.0.1:8080/" jndi.properties

    command i is for insert to the same file and r is for using special expresions like “^”
    remember to escape special characters

    after this script was executed content of jndi.properties is showed below

    java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
    java.naming.provider.url=http-remoting://127.0.0.1:8080
    jboss.naming.client.ejb.context=TRUE
  • recursion in postgresql with working example

    Postgre logo

    recursion in postgresql is defined with key words “WITH RECURSIVE”.
    you need to create CTE (Common Table Expressions)

    in example below you can see using recursion for compute factorial for

    WITH RECURSIVE t(n,m) AS ( -- this is CTE
        SELECT 5 AS n,5 AS m   -- something like n=5
      UNION ALL                -- this is needed for "join" iterations
        SELECT n-1, (n-1)*m FROM t WHERE (n-1)>0 -- for every iteration do value-- and make multiplication
    )
    SELECT MAX(n) AS NUMBER,MAX(m) AS factorial FROM t; -- finally show result
  • sed start line with word does not work

     

    if u are confused when you are using “^start” as regular expression and your script does not return lines which start with word “start” you probably need to use option “-r”
    so try this:

    sed -r "/^start/ p" input.txt