Add Expire date on PDF

function Expire()
var rightNow = new Date();
var beginDate = new Date(“March 23, 2014 00:00:01″);
var endDate = new Date(“March 28, 2014 23:59:59″);
if (rightNow < beginDate || rightNow > endDate)
app.alert(“Expired”, 0, 0);

Open DeviceAdmin from adb shell

adb shell am start -a android.intent.action.MAIN -n

android: Permission is only granted to system apps

In Eclipse:

Window -> Preferences -> Android -> Lint Error Checking.

In the list find an entry with ID = ProtectedPermission. Set the Severity to something lower than Error. This way you can still compile the project using Eclipse.

In Android Studio:

File -> Settings -> Inspections

Under Android Lint, locate Using system app permission. Either uncheck the checkbox or choose a Severity lower than Error.

How to get screen dimensions (deprecated)

Now, if you used get screen dimension.

Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();

So, it need to change your code to.

Display display = getWindowManager().getDefaultDisplay();
Point point = new Point();

int width = size.x;
int height = size.y;

How to install nginx as a windows service

download winsw-X.x-bin.exe from

then rename it to nginx_service.exe and put it into c:/nginx  folder.

make nginx_service.xml file and copy the code below into this file.


<startargument>-p c:\nginx</startargument>
<stopargument>-p c:\nginx -s stop</stopargument>