Skip to content

Instantly share code, notes, and snippets.

View rajeshpv's full-sized avatar

Rajesh Rao rajeshpv

  • Consultant
  • Cary NC
  • 07:29 (UTC -04:00)
View GitHub Profile
var jq = document.createElement('script');
jq.src = "//code.jquery.com/jquery-latest.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
!function () {
var script = document.createElement("script");
script.setAttribute("src", "//code.jquery.com/jquery-2.0.0.min.js");
document.body.appendChild(script);
}();
@rajeshpv
rajeshpv / int_sort.sql
Created July 18, 2014 19:42
Given a table with one int column with random int ordered, write a query to get sorted asc and desc, as 2 columns of output
-- the idea here is to populate rownum after sorting is done
-- if sorting is done along with row num, it defeats the purpose
-- rowid, does not help, since it almost generates a hascode value like
with l_table as (
select measure_id from int_table order by 1 asc
), r_table as (
select measure_id from int_table order by 1 desc
)
import sbt._
class MyProject(info: ProjectInfo) extends DefaultProject(info)
//with de.element34.sbteclipsify.Eclipsify
//with IdeaProject
{
lazy val hi = task { println("hi Task"); None }
}
import sbt._
class MyPlugins(info: ProjectInfo) extends PluginDefinition(info)
{
val a = "org.markdownj" % "markdownj" % "0.3.0-1.0.2b4"
lazy val eclipsify = "de.element34" % "sbt-eclipsify" % "0.5.1"
val repo = "GH-pages repo" at "http://mpeltonen.github.com/maven/"
val idea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT"
}
.
|-- ant
| `-- apache-ant-1.8.1-bin.zip
|-- best-jboss.tar
|-- eclipse
| |-- eclipse-jee-galileo-SR2-linux-gtk.tar.gz
| `-- eclipse-jee-helios-linux-gtk.tar
|-- idea
| |-- idea-902
| | `-- ideaIC-9.0.2.tar.gz
#!/bin/bash
logDir=~/work/logs
#find $logDir -type f -name '*.log' | xargs echo $1
shopt -s nullglob
for f in $(find $logDir -type f -name '*.log')
do
echo $f
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" $f > ${logDir}/temp.txt
cp ${logDir}/temp.txt $f
#!/bin/bash
givenDir=$(basename $PWD)
echo $givenDir
logFile=~/work/logs/term-${givenDir}.log
script -afq $logFile
Task(typeTask:String, id:Int, parentProject:Int price:Float)
notice "p" means project
task for "t"
there can be n number of tasks below project
and parent of project id will be always zero
the list is ordered based on id field
List(
[info] Wrote /home/rxxxxxx/dev/scalatra/fileupload/target/scala_2.8.0/scalatra-fileupload_2.8.0-2.0.0-SNAPSHOT.pom
[info] == scalatra-fileupload / make-pom ==
[info]
[info] == scalatra-fileupload / deliver-local ==
[warn] [NOT FOUND ] org.scalatra#scalatra_2.8.0;2.0.0-SNAPSHOT!scalatra_2.8.0.pom.asc(asc) (0ms)
[warn] ==== local: tried
[warn] /home/rxxxxxx/.ivy2/local/org.scalatra/scalatra_2.8.0/2.0.0-SNAPSHOT/ascs/scalatra_2.8.0.pom.asc
[warn] [NOT FOUND ] org.scalatra#scalatra_2.8.0;2.0.0-SNAPSHOT!scalatra_2.8.0.jar.asc(asc) (0ms)
[warn] ==== local: tried
[warn] /home/rxxxxxx/.ivy2/local/org.scalatra/scalatra_2.8.0/2.0.0-SNAPSHOT/ascs/scalatra_2.8.0-javadoc.jar.asc
Requesting /reports but only have Map(DELETE -> List(), POST -> List(WrappedArray(/flash-map/form), WrappedArray(/upload), WrappedArray(/login), WrappedArray(/post)), GET -> List(WrappedArray(/flash-map/result), WrappedArray(/flash-map/form), WrappedArray(/upload), WrappedArray(/scalate), WrappedArray(/), WrappedArray(/logout), WrappedArray(/login), WrappedArray(/form), WrappedArray(/date/:year/:month/:day)), PUT -> List())