package com.jostens.spring3template.web;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* Test of spring's handling of double slashes
*
* @see http://webmasters.stackexchange.com/questions/8354/what-does-the-double-slash-mean-in-urls
*/
@Controller
public class SlashTestController {
@RequestMapping(value = "/productDetail/{param1}/{param2}/{param3}", method = RequestMethod.GET)
@ResponseBody
public String slashTest1(HttpServletRequest request,
@PathVariable String param1, @PathVariable String param2,
@PathVariable String param3) throws Exception {
return "slashTest1\n"
+ request.getServletPath() + "\n"
+ "param1[" + param1 + "]\n" + "param2[" + param2 + "]\n" + "param3[" + param3 + "]\n";
}
@RequestMapping(value = "/productDetail/{param1}//{param3}", method = RequestMethod.GET)
@ResponseBody
public String slashTest2(HttpServletRequest request,
@PathVariable String param1, @PathVariable String param3)
throws Exception {
String param2 = "-";
return "slashTest2\n"
+ request.getServletPath() + "\n"
+ "param1[" + param1 + "]\n" + "param2[" + param2 + "]\n" + "param3[" + param3 + "]\n";
}
@RequestMapping(value = "/productDetail/{param1}/{param2}", method = RequestMethod.GET)
@ResponseBody
public String slashTest3(HttpServletRequest request,
@PathVariable String param1, @PathVariable String param2)
throws Exception {
return "slashTest3\n"
+ request.getServletPath() + "\n"
+ "param1[" + param1 + "]\n" + "param2[" + param2 + "]\n";
}
}
Logged as SPR-11220 RequestMapping maps double-slashes to single slashes.
Dec 12, 2013
Spring @RequestMethod Double Slashes
Orgel Klang Elektro Tanz
Dec 8, 2013
Dec 4, 2013
Dec 2, 2013
Ross' Soviet Poster
«Чтобы строить — надо знать. Чтобы знать — надо учиться»
From here. Not really bold or angular enough to be considered Konstructivism. Yet a good engineering education statement, "To build, you need to know. To know you need to study."
Nov 30, 2013
Nov 28, 2013
Spock in Eclipse
I was having to run spock from the command line (Cygwin), until I fixed the CatalogSpock project using this article as reference. Not sure if it was
./gradlew cleanEclipse eclipsefrom kousnit's block, or tweaking the pom.xml as per mrhaki's blog
Incidentally Mr. Haki has two interesting books groovy and gradle:
Nov 7, 2013
Nov 4, 2013
Recommender Systems
jquery script to gather h1-h6 header tag text from a web page
var ht={}; ht["title"] = $("title").text().trim(); ht["description"] = $("meta[name=description]").attr("content").trim(); ht["keywords"] = $("meta[name=keywords]").attr("content").trim(); var hs=[]; for (var i=0;i<6;i++) { hs[i]="h"+(i+1); ta=[]; $(hs[i]).each(function() { var t = $(this).text().trim(); ta.push(t); }); ht[hs[i]] = ta.join(","); } console.log(ht);
Nov 1, 2013
Wicked
Popular
Defying Gravity
Dancing through life - what I like to call the Mentos song
For Good
More Jenn Gambatese from all shook up
Oct 29, 2013
Oct 23, 2013
Oct 16, 2013
Banff world tour
Saw this interesting exploration video about the Banff film festival at the Midwest Mountaineering Adventure Expo site.
North Face: skiing in Kyrgystan
Oct 14, 2013
MongoDB for Java Week Two
One of the students, Daniel Hodgin, created this Cheat sheet for the mongo command line.
Suggestion from in the forum: Create a MONGODB_HOME environment variable and place it in the CLASSPATH and PATH: %MONGODB_HOME%/bin.
Vista open cmd window here
Oct 11, 2013
Oct 9, 2013
Free online courses
- M101J: MongoDB for Java Developers
Notes:
- need to add data to "course" database for example
- SparkJava requires JDK 1.7 (java.lang.UnsupportedClassVersionError: spark/Route : Unsupported major.minor version 51.0)
- If you shutdown mongodb via control c you may need to repair it: recovery and repair
- I created batch scripts to handle the startup and recovery
mongod-start.bat "D:\dev\mongodb-win32-i386-2.4.6\bin\mongod" --dbpath "D:\dev\mongodb-win32-i386-2.4.6\data\db" pause mongod-repair.bat "D:\dev\mongodb-win32-i386-2.4.6\bin\mongod" --dbpath "D:\dev\mongodb-win32-i386-2.4.6\data\db" --repair pause
- SparkJava
- FreeMarker
- Mongo command line commands
db.createCollection("hello") db.getCollection("hello").insert({name:"MongoDB"})
- echo cat
- fruitpicker
- Introduction to Recommender Systems
- Social Network Analysis
Oct 8, 2013
No sound at startup of each video on youtube
Sep 11, 2013
Shokunin
Sep 7, 2013
Android Maps Setup
Some notes from today
- Maps
- Requires play
- Android 4 required to run maps sample project:
- Boost memory in windows above 768MB: config.ini fix
- How to set up sample project so it really runs: Stack overflow
- There there's this issue: Google Play services out of date. Requires 3225100 but found 3136130
Sep 4, 2013
Sep 3, 2013
Open Graph protocol library for Java
- opengraph-java the toXHTML function fails., there are no tests
- open-graph-java Empty!
- og4j - I like that it handles multiples as per the specification (see this test for example).
I need to investigate these, could they have some shareable libraries?
Unsatisfied, I started a project at github: ogp-java. It does not handle multiple fields yet (2 image tags for instance).Sep 1, 2013
General nanosystems
Aug 27, 2013
GeoPaddler
I've seen some interesting map applications, but none that combine the features I sought:
- Grouping of geo/time data
- Secure sharing of geo/time data
- Sharing cautions, waypoints
- Distance/velocity measurement
Aug 23, 2013
Grammatically fixing songs
- U2: I still haven't found that for which I'm looking.
- Salt 'n Pepa: Push it. Push it real well.
- Simon and Garfunkel: Havimg seen Julio and me down by the school yard.
- Van Halen: Because that's of what dreams are made.
Aug 22, 2013
Jul 23, 2013
Jul 19, 2013
Jul 18, 2013
Reading Finding Serenity
Jul 7, 2013
ST:TNG Geordi Connections
Jun 30, 2013
May 29, 2013
TIL: Kerbal Space Program
Staging analysis
Munar Footage
A Cake Odyssey
May 28, 2013
Nice JS Math package
May 24, 2013
Ruby/Heroku/Twilio App
Twilio Ruby App
Local | Heroku |
---|---|
/ | heroku / |
References
- Ruby on heroku
- Ruby cgi
- Sinatra
- Haml
- Twilio-ruby - this is the one I used
- Twilio-rb - not the one I used
- Haml and Sinatra Tutorial
May 20, 2013
May 19, 2013
May 10, 2013
May 8, 2013
May 6, 2013
Selectivizr and CSS3 Media Queries
As is typical in the web, there is no end-all solution:
- Respond only supports min and max width and print/screen media types, and does not support em width selectors.
- css3-mediaqueries-js doesn't support the media attribute of link and style tags.
- Selectivizr supports import but not style tags.
It seems like there is a conflict, between selectivizr and css3mediaqueries.
This article looks at a solution for getting over that issue with respond and selectivizr.
Here is a discussion of the issue.
This discussion is closer to what I need but still no official solution.
May 1, 2013
Apr 30, 2013
4 am sirens
Apr 22, 2013
Brain Games
Apr 21, 2013
Github: Calendar Service
Star Trek: Disaster
Similar but not exactly like the script, "Then I shall appoint you my executive officer in charge of radishes."
However, we never find out what Marissa's science fair project is.
Blue Angels
The Blue Angels and Thunderbirds summer appearances might be cancelled due to sequestration. What they inspire in terms of skill and teamwork is awe-inspiring and I wish that Congress would make the decisions necessary to keep the government working in a steady-state, for the programs that really matter, create, build, and inspire.
Van Halen - Dreams Douglas A-4F Skyhawk II version
Dreams F/A-18 version
FC Kahuna - Hayling - "Don't think about all those things you fear. Just be glad to be here."
The Taste of Tea
Borrowed The Taste of Tea from the library this weekend. Interesting, long movie that only captures a little of everyone's characters, but very relaxing view of life in the countryside in rural Japan.
The Haruno family is an interesting group of individuals. The littlest girl, Sachiko keeps viewing massive versions of herself, daydreaming, such as seeing a giant version of her head in the back of the classroom. There are other odd interactions such as bumping into a couple of costumed characters in a train, a ghost Yakuza, a man buried alive in mud, and a throwdown fight between the sister and her co-worker.
They all have life-changing conflicts and face important changes during this time. The little girl has trouble with gymnastics. The young boy wants to make a girlfriend. The grandfather wants to create pop music. The mother returns to artistry in anime. The uncle readdresses a relationship he skipped out on earlier.
At the end it feels like a life tale - sunsets are beautiful, birdsongs are soothing, even if life seems difficult, it's not really that bad (except for the couple Yakuza related scenes).
Apr 19, 2013
Apr 14, 2013
The Chip
Apr 10, 2013
Apr 4, 2013
Mar 31, 2013
Mar 30, 2013
Mar 29, 2013
Vegetable Soup - Outerscope
Used to watch this show as a kid. Messed up but I think it was the first sci fi I was exposed to. Plenty of examples though of labeling in children's programs, "Wierdos".
Zen is Emmet
Mar 24, 2013
Javascript end loop wrapper
I was taking an HTML5 Game Development course and saw a neat trick for wrapping at the end of a sequence:
index = index + 1 % array.length;It saves 3 lines of code, the usual:
index++ if (index > array.length) { index = 0; }
Mar 23, 2013
Mar 21, 2013
Arc reactor
Mar 20, 2013
Mar 17, 2013
Mar 11, 2013
Robo Hamster
Mar 9, 2013
Mar 8, 2013
Mar 4, 2013
Mar 3, 2013
Mar 1, 2013
Feb 25, 2013
Feb 19, 2013
Feb 17, 2013
Con of the North 2012 - Day Two
Feb 15, 2013
Con of the North 2012 - Day One
Feb 9, 2013
Zedd and Foxes - Clarity
I wonder if they obtained copyright permission from Egypt to use all the pyramids.
Feb 3, 2013
Jan 29, 2013
Jan 28, 2013
Little Free Library
Jan 27, 2013
Jan 26, 2013
Jan 21, 2013
Jan 16, 2013
Counting songs
Thievery Corporation - Warning Shots: "A one to the two and three and..."
Atmosphere - Puppets: "One for the bass two for the drums..."