Uncategorized
Telerik UI for Android libraries and dependencies
Add all dlls and then add the following packages using the NuGet:
Xamarin Support Library v7 AppCompat (required by the following assemblies: Chart, Feedback, Input, List & Primitives)
Xamarin Support Library v7 RecyclerView (required by the List assembly)
Xamarin Support Library v8 RenderScript (required by the Primitives assembly)
Or
The Primitives library references the Common library
The Data library references the Common library
The Input library references the Common library and v7 AppCompat
The Chart library references the Primitives, the Common libraries and v7 AppCompat
The List library references the Common, Data, v7 AppCompat and v7 RecyclerView libraries
The Feedback library references the Common librariy and v7 AppCompat
References :
http://docs.telerik.com/devtools/android/download-and-deployment/getting-started-for-xamarin
http://docs.telerik.com/devtools/android/download-and-deployment/installation-contents-and-dependencies
Linux Set Date and Time From a Command Prompt
Show date
date
Set date
date -s "2 OCT 2006 18:00:00"
Or
date --set="2 OCT 2006 18:00:00"
Or
date +%Y%m%d -s "20081128"
Set time
date +%T -s "10:13:13"
Resources :
http://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/
Enable or Disable Built-in Elevated Administrator Account in Windows 10
net user administrator /active:yes
References :
http://www.tenforums.com/tutorials/2969-administrator-account-enable-disable-windows-10-a.html
Java SLF4J Getting Started
import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HelloWorld { public static void main(String[] args) { Logger logger = LoggerFactory.getLogger(HelloWorld.class); logger.info("Hello World"); } }
References :
http://www.slf4j.org/manual.html
Java Subtract two joda datetimes
Seconds diff = Seconds.secondsBetween(start, end);
Or
Period diff = new Period(start, end);
References :
http://stackoverflow.com/questions/15814911/how-to-subtract-two-joda-datetimes
Java Compare DateTime objects in Joda
isAfter and isBefore methods compare dates by millis (ignoring time zone).
System.out.println(londonDT.getMillis() == estDT.getMillis());
will print true.
londonDT.isBefore(estDT) londonDT.isAfter(estDT)
are equal to
londonDT.getMillis() < estDT.getMillis() londonDT.getMillis() > estDT.getMillis()
References :
http://stackoverflow.com/questions/17172782/comparing-two-joda-time-datetime-objects
Java Quartz scheduler – Job Parameters
There are two ways to pass an object that can be retrieved when a Quartz job executes:
Pass the instance in the data map. When you set the job up, add your instance to the map with a key like this:
// Create job etc... var MyClass _myInstance; statusJob.JobDataMap.Put("myKey", _myInstance); // Schedule job...
Retrieve the instance in the job’s Execute() method like this:
public void Execute(IJobExecutionContext context) { var dataMap = context.MergedJobDataMap; var myInstance = (MyClass)dataMap["myKey"]; }
OR
Add the instance to the scheduler context when you set the job up, like this:
ISchedulerFactory schedFact = new StdSchedulerFactory(); _sched = schedFact.GetScheduler(); _sched.Start(); // Create job etc... var MyClass _myInstance; _sched.Context.Put("myKey", myInstance); // Schedule job...
Retrieve the instance in the job’s Execute() method like this:
public void Execute(IJobExecutionContext context) { var schedulerContext = context.Scheduler.Context; var myInstance = (MyClass)schedulerContext.Get("myKey"); }
References :
http://stackoverflow.com/questions/7137960/quartz-scheduler-how-to-pass-custom-objects-as-jobparameter
Java Quartz scheduler – Check Job Exists
DateTime dateTime=new DateTime(); dateTime =dateTime.plusMinutes(1); JobDetail job= JobBuilder.newJob(Task1.class).withIdentity("job1","group1").build(); System.out.println(job.getKey().toString()); SimpleTrigger trigger= (SimpleTrigger) TriggerBuilder.newTrigger() .withIdentity("trigger1","group1") .startAt(dateTime.toDate()) .build(); System.out.println(String.format("Start : %s",new DateTime().toString())); Scheduler scheduler = new StdSchedulerFactory().getScheduler(); scheduler.start(); scheduler.scheduleJob(job, trigger); System.out.println(scheduler.checkExists(new JobKey("job1","group1")));
References :
http://stackoverflow.com/questions/26523285/checking-if-the-job-exists-without-looping-through-all-the-jobs