Thursday, September 26, 2013

SVG Transform Translate

Translate The translation is an elementary displacement transformation. Syntax: translate(tx, ty) tx x-coordinate of displacement ty y-coordinate of displacement Here we apply the translate transformation...

Wednesday, September 25, 2013

Java Regular Expression - Matches vs Find

Regular Expression import java.io.*; public class Test{ public static void main(String args[]){ String Str = new String("Welcome to Tutorialspoint.com"); System.out.print("Return Value :" ); System.out.println(Str.matches("(.*)Tutorials(.*)")); System.out.print("Return...

Tuesday, September 24, 2013

Monday, September 23, 2013

XML XSD Schema

xmlfox is a good free editor that supports XSD. I however like Oxygen XML Editor. It is very cheap for the functionality it provides. EditiX supports visual editing....

Thursday, September 19, 2013

SPARQL - JavaScript

$.getJSON("http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+*+where+%7B%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FRoger_Federer%3E+%3Fp+%3Fo+filter%28lang%28%3Fo%29+%3D+%27en%27%29%7D%0D%0A&debug=on&timeout=&format=application%2Fsparql-results%2Bjson&save=display&fname=", ...

SPARQL FOAF ENDPOINT

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT Distinct ?Name ?Interest FROM <http://www.yourwebsite/yourfoaf.rdf> WHERE { {?me foaf:knows ?friend . ?friend foaf:name ?Name . ?friend foaf:interest ?Interest} } Order by ?N...

Wednesday, September 18, 2013

SKOS Ontology with sample SPARQL

SKOS Simple Knowledge Organization System  Select the first 3 concepts that have a skos:altLabel PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?concept ?label WHERE { ?concept skos:altLabel ?label . } LIMIT 3 Select the first 3 concepts that have a skos:altLabel, as RDF PREFIX...

Flex Hints

List Object Properties for(var id:String in object) { var value:Object = object[id]; trace(id + " = " + value); } Application-sandbox content ERROR Solution 1 work on the web and as an app. (apps don't need to allowDomain b/c they can download everything by default and that is why it fails.) try...

Monday, September 16, 2013

Flex - GraphAPI Facebook

http://code.google.com/p/facebook-actionscript-api Graph Explorer: https://developers.facebook.com/tools/explorer/ - Get list friends: 'me/friends?fields=work' https://graph.facebook.com/FriendID?fields=current_locati...

Friday, September 13, 2013

Thursday, September 12, 2013

Extract Images from Power Point

Solution 1 Save as HTML Solution 2 Save the Powerpoint presentation as a XPS Document. Rename the saved document, replace the .xps extension with a .zip extension (as XPS documents are actually ZIP files containing a bunch of other files). Extract the ZIP file with your favorite ZIP extractor...

Tuesday, September 10, 2013

Friday, September 6, 2013

Thursday, September 5, 2013

Java Increase Memeory for Tomcat

On windows: (catalina.bat) set CATALINA_OPTS/JAVA_OPTS "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" On linux: create setenv.sh in tomcat/bin folder with the following...

Wednesday, September 4, 2013

SVG - viewBox

ViewBox value will be set relevant with the x,y coodirnator. If x,y ~ 1-10 -> viewBox width,height: 10,10 .... <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG...

Java - Invalid byte 2 of 2-byte UTF-8 sequence

ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes()); Use UTF-8: ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes("UTF-8")); Likewise don't use ByteArrayOutputStream.toString(), which again uses the platform default encoding. Indeed, you don't need to convert the output...

Java - Format Number

public class DecimalFormatExample {         public static void main(String args[])  {               //formatting numbers upto 2 decimal places in Java         DecimalFormat df = new DecimalFormat("#,###,##0.00");  ...