2017-12-12
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).
Etiketter:
app engine,
authorization,
check,
google vision api,
image,
java,
safe search,
servlet,
url
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.
- Make sure you have installed "Maven Integration Plugin"
- Create a Freestyle project and add a "Execute shell" buildstep with the following command:
find / -name "mvn" - Check the console for Maven installation folder
Maven Google App Engine Project
Let's create the Maven Google App Engine Project and authorize!
- Create a "Freestyle project"
- 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 - 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.
- 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 - 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:
- https://github.com/AIMMOTH/scala-js-compiler
- Jetty https://github.com/AIMMOTH/scalajs-compiler-jetty
Moi
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.
Etiketter:
compiling,
javascript,
scala,
scalajs,
serverside
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
- 0:00-05:00 Going for the farm north east (I2). There is usually no players there and it's easy to loot.
- 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.
- 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.
- 15:00-20:00 I stay at Dragon Lake (E3) and hear some gun shoots.
- 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.
- 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
- 03:00-05:00 Looting at far south west at the farm (B9). This is a safe place but far away.
- 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).
- 14:00-26:00 I ditch the car to advance quietly.
- 27:00-31:00 There is some fighting and I advance to the far away north part of the final circles.
- 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-05-08
2 times 1st place playing with ArtOfCamping King of the Kill KotK
1st place with 1 kill (starts at 31min).
Watch live video from AIMMOTH on www.twitch.tv 1st place with 2 kills. Parashuting south to storage at F10. Going north. At the end,
Watch live video from AIMMOTH on www.twitch.tv
Watch live video from AIMMOTH on www.twitch.tv 1st place with 2 kills. Parashuting south to storage at F10. Going north. At the end,
Watch live video from AIMMOTH on www.twitch.tv
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)!
And about 70% top 10 matches.
Updated: Diamond V
![]() |
| Season 4 ranking Platinum II |
| About 70% top 10 |
Prenumerera på:
Inlägg (Atom)


