Skip to content

Instantly share code, notes, and snippets.

Avatar

Anmol Singh Jaggi Anmol-Singh-Jaggi

View GitHub Profile
View trie.py
from functools import total_ordering
@total_ordering
class TreeNode:
"""
General purpose multi-children Tree Node class.
"""
def __init__(self, data):
View approach2-crontab-monitoring-thread.java
class JobRunnable implements Runnable
{
private final Job job;
public JobRunnable(Job job)
{
this.job = job;
}
@Override
void run()
View approach1-crontab-monitoring-thread.java
@Override
void run()
{
while(true)
{
newJob = getNewJobFromCrontabFile() // blocking call
JobThread newJobThread = new JobThread(newJob);
newJobThread.start();
}
}
View approach3-queue-producer-thread-incorrect.java
@Override
void run()
{
while(true)
{
newJob = getNewJobFromCrontabFile() // blocking call
jobQueue.push(newJob)
}
}
View approach3-queue-producer-thread.java
@Override
void run()
{
while(true)
{
newJob = getNewJobFromCrontabFile() // blocking call
jobQueue.push(newJob)
if(newJob == jobQueue.peek())
{
// The new job is the one that will be scheduled next.
View approach3-queue-consumer-thread.java
void goToSleep(job, jobQueue){
jobQueue.push(job);
sleep(job.nextExecutionTime() - getCurrentTime());
}
void executeJob(job, jobQueue){
threadpool.submit(job); // async call
job = job.copy();
job.setNextExecutionTime(getCurrentTime() + job.getExecutionInterval());
jobQueue.add(job);
View approach1-dedicated-thread.java
@Override
void run()
{
while(true)
{
Thread.sleep(job.getNextExecutionTime() - currentTime());
job.execute();
job.setNextExecutionTime(currentTime() + job.getExecutionInterval());
}
}
View ad.txt
A room is available in a 3 BHK apartment in 'Pramuk Aqua Heights Apartments', Electronic City Phase 1.
It is available on both, private as well as on a sharing basis.
**About the room** :
- Attached wardrobe.
- Dressing table with mirror.
- Attached bathroom with Geyser and all other fittings.
- Lake facing (balcony side).
- Dimensions = 156 x 116 in.
View add_cmd_autorun.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor] "Autorun"="%USERPROFILE%/Documents/cmd_autorun.cmd"
You can’t perform that action at this time.