2017-12-12

Simple AngularJS Binding With Nested Components

Simple AngularJS Binding With Nested Components

This is a simple example of binding between two nested components.


2017-12-10

Servlet Using Google Vision API Sample

Servlet Using Google Vision API

A simple servlet with POST getting an image URL and performs a SAFE SEARCH check using Google Vision API.
Note that it doesn't contain authorization. You can do it locally on your machine or run it live at App Engine using it's service account (it does that automatic so you just deploy it).

2017-11-24

Authorize Jenkins to Google App Engine

Authorize Jenkins to Google App Engine

I usually want everything in the cloud including my Jenkins server. I've been using Bitnami for this but each time I've the same problem of authorize since in the middle of the build Google asks Jenkins to follow a URL and authorize and then paste a key.

Bitnami

Bitnami is an excellent cloud service where you can run services in the cloud. I choose an installation in Europe using Google Compute API and with a Jenkins Image.
When creating your Virtual machine with Jenkins you start an installation wizard where you can select the most common plugins like Maven.

Preparation

It's necessary to know where Maven is installed. This is a simple way to do it without using a console.
  1. Make sure you have installed "Maven Integration Plugin" 
  2. Create a Freestyle project and add a "Execute shell" buildstep with the following command:
    find / -name "mvn"
  3. Check the console for Maven installation folder

Maven Google App Engine Project

Let's create the Maven Google App Engine Project and authorize!
  1. Create a "Freestyle project"
  2. Enter project details like Source code and build triggers. At "Build step" add "Execute bash" as "Build step". Run maven with:
    /opt/bitnami/apps/jenkins/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven/bin/mvn appengine:update
  3. This will fail since the App Engine plugin will stop for a authorization. It prints an URL which Jenkins cannot open. Follow the link in your browser and sign in using your Google account. Copy the key you receive.
  4. Update your project and change the command to:
    echo "key-you-got-from-your-browser" | /opt/bitnami/apps/jenkins/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven/bin/mvn appengine:update
  5. Run the project and you should be authorized!
What happens is that your key is entered when Maven stops for input.

2017-06-08

Compiling JavaScript on Serverside With Scala and ScalaJS

Compiling JavaScript on Serverside With Scala and ScalaJS

Since my experience with the JavaScript world and exploration of ScalaJS I felt compelled to move from Node and Grunt and try to fully utilize Scala for both front and back.
I reached a goal with Scala Stack, a concept of creating all web content on serverside using only Scala code. The concept is extended to keep everything in code including configuration to be fully testable.

Future of Internet

If we try to look into the future of internet, I think we see two strong forces: Market and AI.
How will they alter the internet we use today?
  • Market want to extract most of its users and want to create webpages which are fully personalized in an effort to guide the users to their goals. Sites are personlizing the pages by user settings but why shouldn't all content including color and shape be adopted to the user in a effort to please the user as much as possible? 
  • AI and ML is on the uprising and if the server is thinking for itself it could create whatever as a response.

Obvious Advantages

My main purpose was to skip the JavaScript world but it moved on to something much larger. If all code is shared there are quite a few advantages
  • Single, isomorphic source which ease work and can share logic
  • Share data by keeping it in code. For instance languages could be defined with a Enum type
  • Fully testable code
  • No JavaScript package manager like NPM or WebPack
  • No pre processor like Gulp or Grunt

Risks

There are some traps though 
  • Security, some code should not be shared 
  • Long term effects, demands a experienced architect 
  • Shared code needs to be ScalaJS compatible and cannot use backend dependencies since it's compiled and used on frontend

Scala Stack

I've made three implementations using Google Flexible Environment. Implemented in native JavaScript, jQuery and AngularJS.
Goal is to keep everything in code and to avoid configuration, annotations and settings in Strings.
By only using Scala on serverside, it produce HTML, CSS and JavaScript which is all components for a webpage. 
Map of Scala Stack

Servlet Compiler

Scala Stack is using a Servlet compiler with different logging:
I discovered C and JavaScript in school 98-99 and have coded since.
As an individual the first problem is to be creative within the little time that is left of work and social life. Keeping goals through discipline and understand how to be efficient was fundamental. 2012 I discovered Google App Engine and within a single JSP-file kept HTML, CSS, JavaScript and Java with a database connection, I was hooked! This was all I needed to create a site. The PaaS handled publication, dashboard, configuration of services, hosting, logging and have a big library of API for the basic operation, which meant I could spend time on coding.
Mixing code with a subject are my main interests and when creating my first sites I understood that it's impossible to create content driven sites by myself. The solution was to give the users tools to modify the site as they witched and, as a community, create the site they wanted in a democratic way.

2017-05-19

2 recorded wins using Art of Camping (Diamond IV)

2 Recorded Wins Using Art of Camping 

You can read about the tactics here.

1 Win

  1. 0:00-05:00 Going for the farm north east (I2). There is usually no players there and it's easy to loot.
  2. The first circle isn't too far away. I calculate it's about 3 squares away and takes 6 minutes. The first gas is spreading for 5 minutes so I need to go 1 min before it starts.
  3. I need to cross plains which is dangerous since there is often cars "sharking" and looking for a kill. But I was lucky and could advance north and far away from the center.
  4. 15:00-20:00 I stay at Dragon Lake (E3) and hear some gun shoots.
  5. 20:00-25:00 The final is at Harris Ridge (D3) and I advance from north, going around the mountain on the north side, again far from the center.
  6. 30:00 I don't spot the last player and advance to top corner of gas. But finally I spot a car, make cover with smoke and throw grenades. My opponent is hiding behind a hill and I charge with shotgun winning!

2 Win

  1. 03:00-05:00 Looting at far south west at the farm (B9). This is a safe place but far away.
  2. 06:00-14:00 The first circle is far away, about 4 squares, and luckily I find a car, otherwise I would need to run for about 8 minutes (2 minutes per square)! I drive on the south side of Runamok River to avoid players and then north to the church at Humberdink Reserve (J6).
  3. 14:00-26:00 I ditch the car to advance quietly.
  4. 27:00-31:00 There is some fighting and I advance to the far away north part of the final circles.
  5. 31:00-33:00 The last player have a car and I hide until the car drives by me to shoot at it in the passing. I use smoke grenade to cover me when I change position. finally I charge the car is burning and the player is moving out. I throw smoke grenade to advance the get shoot at. Finally the other player is hiding behind a rock and I win by throwing hand grenades!

2017-04-27

ArtOfCamping Pre-Season 4 Ranking: Diamond 5

Just by using positioning and Art of Camping tactics I made it to Platinum II without any kills (sorry)!
Season 4 ranking Platinum II
And about 70% top 10 matches.
About 70% top 10 
Updated: Diamond V

2017-04-20

ArtOfCamping : Gaming Tips

Art of Camping: Gaming Tips

This blog series is about how to get into the finale as safe as possible. This is gaming. Not playing.

Terms

The Art of Camping strategy is go the to the finale as safe as possible. It's described in short terms:
  1. Parachute to the outer part of the map close to the border and loot at safe places were there aren't any other players
  2. Advance into the first circle but
    1. Avoid areas with other players
    2. Advance towards the outer border of the circle
  3. The finale is when the circle is 1 square wide and with about 10 players left. Good luck!

Tips

This is miscellaneous tips for optimizing your gaming.

  1. Let car roll when exiting the vehicle to save some gas
  2. Gas spread faster over bigger distance
  3. Cross into woods
  4. You can open doors a meter away from them and you can reloading at the same time
  5. Make bandage when you're inside the gas circle and have plenty of time
  6. Find boots or better sneakers to run faster
  7. Get a backpack as soon as possible
  8. Don't pick up pistols or melee weapons, you'll find an auto rifle soon enough
  9. Smoke grenade is great to cover your advance into a forest or building
  10. Gas grenade is great to make your opponent move out from cover. It can be thrown longer than molotov, covers a bigger area than other grenades and last
  11. Molotov are heavier and cannot be thrown as long as other grenades 
  12. Always loot gas from other cars for you to driver longer and other players shorter
  13. Always loot keys from other cars to make it more difficult for other players to have a car
  14. Change car to get a new car with full tank
  15. You usually don't need more than 300 in ammo for a gun. It can be useful to have some ammo to shoot down cars
  16. You usually don't need more than 10 health packs. But you should have enough to create some healing glue
  17. Optimize all your looting at the start to loot as much as possible to make sure you don't need to loot more
  18. If you got shoot at when crafting or handling your inventory it's important to learn to double tap the inventory key to exit the inventory and crafting menu as fast as possible. 
  19. When looting, open as few doors as possible since it takes time. Try to loot at places which are open and easy to scan.
  20. Don't shred until you have plenty of time.
  21. Loot at a safe area. See my complete guide for locations.


Art of Camping: Z2 Map

King of the Kill have a new map and here is a new Art of Camping guide!

Art Of Camping

Art of Camping is a series of articles and videos explaining how to in the most secure way win a round. It is quite easy to get to top 10 of each game and if you have good aim you can easily win. I finish as top 10 at about 70% of the matches!
Top 10 at about 70% of my games!

It consist of three parts
  1. Parachute to a safe area
  2. Advance in the edge of the gas
  3. Finale

Settings

You should have about 1000 in field view. This will make it easier to scan the map when you parachute. It'll also single out cars at high altitude. And when you advance across the map it's easier to see landmarks and know your location.
Maximize the brightness  to have a clearer view and have better sight inside buildings.

Step 1: Parachute

First objective is to loot at a safe location. Make sure you parachute to a remote area where there are no other players. You can parachute 2 squares.
Green areas are safe, avoid red areas!


Looting

When looting, try to be as efficient as possible and use the rule minimize the numbers of doors you open. Find barns and storage since the are open you can easily scan for loot. Avoid houses with a lot of doors since it takes time to open doors and usually there is little loot in each room.
H1 is a favorite place to land

It's essential to get a military backpack to be able to have as much loot as possible. Don't shred stuff and this time and focus on looting. Only when you are safe within a cirle and have filled up your backpack start shred.
I usually aim for the following loot (in prioritized order)
  1. Military backpack
  2. Backpack
  3. AK and about 100 bullets Shotgun is necessary in close combat to kill opponents with body armor
  4. AR and about 100 bullets
  5. 2-4 helmets
  6. Sneakers
  7. Laminated tactical body armor
  8. Medkits
  9. Shirts and backpacks for shreding
  10. Grenades
  11. Tape (to craft makeshift armor)
  12. Keys and gas (from cars)

Step 2: Advance

As soon as the first circle appears calculate how long it will take you to move into it and if you need any medkits. If you have a car this will be easier but have other risks. General advice is to move at the edge of hills and mountains since you can either move down or up to take cover or hide. Smoke grenades is also good to cover an area. Also use auto run and free look to run in a direction and scan your surrounding area. A good tip is too look behind you since an attacker usually want you to pass by and then attack.
Try to move at the edge of the circles and as close to the map's edge as long from the center as possible. This means you usually circulate around circles to stay away from the center.

Timing

You need to know how fast you move and how much you heal. This is important when you calculate your movement across the map and how much damage you can take in the gas.
Time to cross a square:
  • 2 min by foot
  • 1 min 50 s by sneakers or boots (approx.)
  • 50 s with car (approx.)
Healing:

  • Bandage heals 10 health points during 10 sec
  • Medkit heals 60 health points during 60 sec

First Circle

When the first circle appears you have 5 min before the gas is spreading and it spreads for 5 min which makes a total of 10 min before you should be inside the circle. This means that if you run by foot you can cover about 5 squares during this time.
First circle is 5 squares wide and it takes approx. 10 min to run cross 5 squares

Sharking

The main threat is other cars that are "sharking" and roaming areas for a kill.

By Foot

Make sure you have sneakers since you run faster. 

By Car

A car have big advantages since you can travel much faster and loot in more remote areas. The car is big and noisy so you need to be more careful for other cars that are sharking. Don't camp in the car since you are an easy target at the driver's seat and one grenade will blow the car up. You should park the car and hide at a tree nearby instead.

Step 3: Final

There is only general advice since you need to be a good at aim and win duels to win the whole round. But advance as earlier towards the edge of map and shoot at cars to try to destroy them.
Advance by flanking

Cars have an advantage at the finals so you need to stop them by shooting at them, but keep your cover!
You throw grenades longer than Molotov cocktails and gas grenades is good to lure out players from cover. If you have plenty of medkits, use them regularly to always get a health boost.
Keep watch if someone uses a sniper.
If you have a car in the finals you may slow drive and hide from other players. You may also circle around a player until you find a good spot, usually higher ground and with the car as cover, and fire against the opponent. And enter the circle as late as possible with car.

2017-01-13

Create app for App Store as Windows User

It was quite difficult but suddenly I was able to add an app to iTunes Connect. These was the steps necessary
  1. Created a personal Apple account
  2. Enrolled in Apples developer program for a single user
  3. Created certificates
    1. iOS Certificates
      1. iOS Development
      2. iOS Distribution
      3. Apple Push Services
      4. WatchKit Services
      5. APNs Development iOS
    2. App ID
    3. iOS Provisioning Profiles
      1. AppStore iOS Distribution
      2. Ad Hoc iOS Distribution
  4. Installed iTunes and logged in
  5. Logged in to iTunes Connect.