Wednesday, 21 August 2013

How to have a newly plugged in keyboard to function to its full potential?

How to have a newly plugged in keyboard to function to its full potential?

Everytime I changed keyboard, it works slower, which means the cursor
moves very slow, compared to the previously attached keyboard, unless I
restart my PC.
Is there a way I can get it to maximize its functionality without having
to restart my PC?

Time Machine backup between networks

Time Machine backup between networks

I have a computer on network A that I would like to backup via Time
Machine to a drive connected to a computer on network B. Can this be done?
Would I need a VPN? I just need the network B computer's drive to show up
as Shared to the computer on network A.

Playframework 2.x Apache Tika issue

Playframework 2.x Apache Tika issue

i am uploading file using upload from then after getting uploaded file i
am using Apache tika top extract content,metadata from uploaded file and
applying but some error is coming
have a look of my playframework controller code :
public static Result upload() {
MultipartFormData body = request().body().asMultipartFormData();
FilePart picture = body.getFile("doc");
if (picture != null) {
String fileName = picture.getFilename();
int eof = fileName.lastIndexOf('.');
String ext = fileName.substring(eof + 1);
file = picture.getFile();
InputStream is;
try {
is = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
Parser ps=new AutoDetectParser();
BodyContentHandler bch=new BodyContentHandler();
Metadata metadata=new Metadata();
try {
ps.parse(is, bch, metadata, new ParseContext());
} catch (IOException | SAXException | TikaException e) {
e.printStackTrace();
}
String sw=bch.toString();
return ok(sw+" entity extracted and saved" + ext);
}else {
flash("error", "Missing file");
return redirect(routes.Application.index());
}
but when i am running this web application i am using commands:
rahul@inext:~/playframwrk apps/EntWebPrj$ play
[info] Loading project definition from /home/rahul/playframwrk
apps/EntWebPrj/project
[info] Set current project to EntWebPrj (in build
file:/home/rahul/playframwrk%20apps/EntWebPrj/)
_ _
_ __ | | __ _ _ _| |
| '_ \| |/ _' | || |_|
| __/|_|\____|\__ (_)
|_| |__/
play! 2.1.2 (using Java 1.7.0_25 and Scala 2.10.0),
http://www.playframework.org
> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.
[EntWebPrj] $ ~run
it is giving error :
if you want to see full error then full error
and some of error is :
sbt.PlayExceptions$CompilationException: Compilation error[error: package
org.apache.tika.exception does not exist]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$2$$anonfun$apply$15$$anonfun$apply$16.apply(PlayReloader.scala:349)
~[na:na]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$2$$anonfun$apply$15$$anonfun$apply$16.apply(PlayReloader.scala:349)
~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:na]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$2$$anonfun$apply$15.apply(PlayReloader.scala:349)
~[na:na]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$2$$anonfun$apply$15.apply(PlayReloader.scala:346)
~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:na]
[warn] play - No application found at invoker init
i added tika jar file.
Give me some idea to fix this issue.

c# multi line strings allowing variable calling

c# multi line strings allowing variable calling

I have googled but cannot find an answer for this question:
I know about multi-line strings in c#. But how can I create a string like:
string temp = @"DECLARE @rolename varchar(max)
SET @rolename ='***'
EXEC sp_addrolemember N'db_execute',@rolename"
* represents there I have to delcare a variable having some value like
(object.variable).
Is this possible??

IllegalArgumentException: Numbers of source Raster bands and source color space components do not match For a color image Exception

IllegalArgumentException: Numbers of source Raster bands and source color
space components do not match For a color image Exception

File file = new File("path");
BufferedImage bufferedImage = ImageIO.read( file );
here is the code and below is the image to get the exception in the topic.
Download image:
https://skydrive.live.com/?cid=19547371C4F3B839&id=19547371C4F3B839%21105
Simply if someone can obtain a java.awt.image.BufferedImage object from
the image given that's enough (should not convert the image to gray scale
one).
You are a genius if you can answer this :D. Plz help.

Tuesday, 20 August 2013

Android - PHP or Java Webservice

Android - PHP or Java Webservice

I was wondering what peoples thoughts are with using PHP or Java
Webserices to connect with MYsql...or any other ways.
Between the two what do you find easier and safer?

HLS Video Doesn't Upscale in Browser

HLS Video Doesn't Upscale in Browser

I am attempting to get an HLS stream to work in a browser (Webkit).
It first appears to work, the video starts, playing the
medium(480p)stream. Unfortunately, the stream quality doesn't improve over
time as it should.
Does anyone have a source that discusses either a tool or simple method to
manage the changes of these different streams? or.. Perhaps a direction in
which to follow so I can write my own controller for switching between the
streams?
Thank you for you help.